MovePackageService.ListPackageVersions
List package versions through sui.rpc.v2.MovePackageService/ListPackageVersions 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/ListPackageVersions. Unary: one request, one response. Get a key from the dashboard; the same key works on every protocol.
Request: ListPackageVersionsRequest
| Field | Type | Description |
|---|---|---|
package_id | string | Required. The storage_id of any version of the package. |
page_size | uint32 | The maximum number of versions to return. The service may return fewer than this value. If unspecified, at most 1000 entries will be returned. The maximum value is 10000; values above 10000 will be coerced to 10000. |
page_token | bytes | A page token, received from a previous ListPackageVersions call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to ListPackageVersions must match the call that provided the page token. |
Response: ListPackageVersionsResponse
| Field | Type | Description |
|---|---|---|
versions | repeated PackageVersion | List of all package versions, ordered by version. |
next_page_token | bytes | A token, which can be sent as page_token to retrieve the next page. If this field is omitted, there are no subsequent pages. |
PackageVersion
A simplified representation of a package version
| Field | Type | Description |
|---|---|---|
package_id | string | The storage ID of this package version |
version | uint64 | The version number |
grpcurl
grpcurl -H "x-api-key: YOUR_API_KEY" \
-d '{
"package_id": "0x2",
"page_size": 20
}' \
mainnet-grpc.inodra.com:443 \
sui.rpc.v2.MovePackageService/ListPackageVersionsServer 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.listPackageVersions({
packageId: '0x2',
pageSize: 20
})
console.log(response.versions)@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 item actually returned; an empty page bills the 1-credit minimum. See credits and billing for the full table.