Skip to content

MovePackageService.GetPackage ​

Get package through sui.rpc.v2.MovePackageService/GetPackage on Inodra's Sui gRPC endpoint.

Endpoint ​

NetworkHostAuthentication
Mainnetmainnet-grpc.inodra.com:443x-api-key metadata
Testnettestnet-grpc.inodra.com:443x-api-key metadata

Full method name: sui.rpc.v2.MovePackageService/GetPackage. Unary: one request, one response. Get a key from the dashboard; the same key works on every protocol.

Request: GetPackageRequest ​

FieldTypeDescription
package_idstringRequired. The storage_id of any version of the requested package. When no selector is set, the package stored at exactly this id is returned. When a selector is set, package_id only identifies the package's upgrade lineage (via its original id), and the selected version within that lineage is returned.
versionuint64 (one of selector)
at_checkpointuint64 (one of selector)

Response: GetPackageResponse ​

FieldTypeDescription
packagePackageThe package.

Package ​

A Move Package

FieldTypeDescription
storage_idstringThe PackageId of this package A package's storage_id is the Sui ObjectId of the package on-chain. Outside of system packages the storage_id for every package version is different.
original_idstringThe PackageId of the first published version of this package. A package's original_id (sometimes also called its runtime_id) is the storage_id of the first version of this package that has been published. The original_id/runtime_id is stable across all versions of the package and does not ever change.
versionuint64The version of this package
modulesrepeated ModuleThe modules defined by this package
type_originsrepeated TypeOriginList of datatype origins for mapping datatypes to a package version where it was first defined
linkagerepeated LinkageThe package's transitive dependencies as a mapping from the package's runtime Id (the Id it is referred to by in other packages) to its storage Id (the Id it is loaded from on chain).

grpcurl ​

bash
grpcurl -H "x-api-key: YOUR_API_KEY" \
  -d '{
  "package_id": "0x2"
}' \
  mainnet-grpc.inodra.com:443 \
  sui.rpc.v2.MovePackageService/GetPackage

Server reflection is enabled, so no proto files are needed for grpcurl. Field masks are written as {"paths": [...]}.

TypeScript ​

typescript
import { GrpcWebFetchTransport, SuiGrpcClient } from '@mysten/sui/grpc'

const transport = new GrpcWebFetchTransport({
  baseUrl: 'https://mainnet-grpc.inodra.com',
  meta: { 'x-api-key': process.env.INODRA_API_KEY! }
})
const client = new SuiGrpcClient({ network: 'mainnet', transport })

const { response } = await client.movePackageService.getPackage({ packageId: '0x2' })
console.log(response.package?.modules.map((m) => m.name))

@mysten/sui v2 has no typed method for this RPC, so the sample calls the generated client.movePackageService service client. Install with npm install @mysten/sui and set INODRA_API_KEY. The gRPC gateway guide covers native gRPC transport for backends.

Credits ​

1 credit per call. See credits and billing for the full table.

JSON-RPC equivalent ​

Replaces sui_getNormalizedMoveModule. The JSON-RPC to gRPC migration guide has before and after code for the common calls.

The full-stack Sui data layer.