MovePackageService.GetPackage
Get package through sui.rpc.v2.MovePackageService/GetPackage on Inodra's Sui gRPC endpoint.
Endpoint
| Network | Host | Authentication |
|---|---|---|
| Mainnet | mainnet-grpc.inodra.com:443 | x-api-key metadata |
| Testnet | testnet-grpc.inodra.com:443 | x-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
| Field | Type | Description |
|---|---|---|
package_id | string | Required. 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. |
version | uint64 (one of selector) | |
at_checkpoint | uint64 (one of selector) |
Response: GetPackageResponse
| Field | Type | Description |
|---|---|---|
package | Package | The package. |
Package
A Move Package
| Field | Type | Description |
|---|---|---|
storage_id | string | The 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_id | string | The 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. |
version | uint64 | The version of this package |
modules | repeated Module | The modules defined by this package |
type_origins | repeated TypeOrigin | List of datatype origins for mapping datatypes to a package version where it was first defined |
linkage | repeated Linkage | The 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
grpcurl -H "x-api-key: YOUR_API_KEY" \
-d '{
"package_id": "0x2"
}' \
mainnet-grpc.inodra.com:443 \
sui.rpc.v2.MovePackageService/GetPackageServer reflection is enabled, so no proto files are needed for grpcurl. Field masks are written as {"paths": [...]}.
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.