Skip to content
Alchemy Logo

Move packages

The MovePackageService provides methods for inspecting Move packages, functions, and data types.

Fetches a Move package by its ID.

Request:

FieldTypeRequiredDescription
package_idstringYesThe Move package ID

Response:

FieldTypeDescription
packagePackageThe Move package including its modules
grpcurl \
  -H "Authorization: Bearer <YOUR_API_KEY>" \
  -import-path proto \
  -proto sui/rpc/v2/move_package_service.proto \
  -d '{"package_id": "0x2"}' \
  sui-mainnet.g.alchemy.com:443 \
  sui.rpc.v2.MovePackageService/GetPackage

Fetches a Move function definition by package, module, and function name.

Request:

FieldTypeRequiredDescription
package_idstringYesThe Move package ID
module_namestringYesThe module name
namestringYesThe function name

Response:

FieldTypeDescription
functionFunctionDescriptorThe function definition including parameters and return types
grpcurl \
  -H "Authorization: Bearer <YOUR_API_KEY>" \
  -import-path proto \
  -proto sui/rpc/v2/move_package_service.proto \
  -d '{
    "package_id": "0x2",
    "module_name": "coin",
    "name": "balance"
  }' \
  sui-mainnet.g.alchemy.com:443 \
  sui.rpc.v2.MovePackageService/GetFunction

Fetches a Move struct or enum definition by package, module, and name.

Request:

FieldTypeRequiredDescription
package_idstringYesThe Move package ID
module_namestringYesThe module name
namestringYesThe datatype name

Response:

FieldTypeDescription
datatypeDatatypeDescriptorThe datatype definition including fields and abilities
grpcurl \
  -H "Authorization: Bearer <YOUR_API_KEY>" \
  -import-path proto \
  -proto sui/rpc/v2/move_package_service.proto \
  -d '{
    "package_id": "0x2",
    "module_name": "coin",
    "name": "Coin"
  }' \
  sui-mainnet.g.alchemy.com:443 \
  sui.rpc.v2.MovePackageService/GetDatatype

Lists all versions of a Move package with pagination.

Request:

FieldTypeRequiredDescription
package_idstringYesThe Move package ID
page_sizeuint32NoMaximum results to return
page_tokenbytesNoPagination token from a previous response

Response:

FieldTypeDescription
versionsrepeated PackageVersionList of package versions
next_page_tokenbytesToken for the next page of results
grpcurl \
  -H "Authorization: Bearer <YOUR_API_KEY>" \
  -import-path proto \
  -proto sui/rpc/v2/move_package_service.proto \
  -d '{"package_id": "0x2"}' \
  sui-mainnet.g.alchemy.com:443 \
  sui.rpc.v2.MovePackageService/ListPackageVersions
Was this page helpful?