GetPackage
gRPC
RPC Method
sui.rpc.v2.MovePackageService/GetPackageRetrieves the Move package information for the specified package ID.
Proto files required
Running the examples below requires the official Sui proto files. Download the proto files, then set the example's -import-path relative to the proto root (the -proto path in the examples is relative to the proto root).
Request Message
package_idstringrequired
Required. The storage_id of the requested package.Response Message
The requested package.
storage_idstring
Package ObjectId (storage ID).original_idstring
ID of the first published version.versioninteger
Version of the package.Modules in the package.
namestring
Name of the module.contentsstring
Serialized bytecode.Datatypes defined in the module.
type_namestring
Fully qualified type name.defining_idstring
Package storage ID that defines the type.modulestring
Module name.namestring
Datatype name.abilitiesarray
Abilities of the datatype.Generic type parameters.
constraintsarray
Ability constraints on the parameter.is_phantomboolean
Whether the parameter is phantom.kindstring
Whether it is a struct or enum.Fields of the datatype.
namestring
Name of the field.positioninteger
Position in definition order.Type of the field.
typeobject
The type.type_namestring
Fully qualified datatype name.type_parameter_instantiationarray
Instantiation of type parameters.type_parameterinteger
Type parameter position.Variants if the datatype is an enum.
namestring
Name of the variant.positioninteger
Position in definition order.Fields of the variant.
namestring
Name of the field.positioninteger
Position in definition order.Type of the field.
typeobject
The type.type_namestring
Fully qualified datatype name.type_parameter_instantiationarray
Instantiation of type parameters.type_parameterinteger
Type parameter position.Functions defined in the module.
namestring
Name of the function.visibilitystring
Visibility (public/private/public(friend)).is_entryboolean
Whether the function is an entry function.Generic type parameters.
constraintsarray
Ability constraints on the parameter.is_phantomboolean
Whether the parameter is phantom.Parameter types.
referenceobject
Reference kind, if the type is a reference.The signature body.
typeobject
The type.type_namestring
Fully qualified datatype name.type_parameter_instantiationarray
Instantiation of type parameters.type_parameterinteger
Type parameter position.Return types.
referenceobject
Reference kind, if the type is a reference.The signature body.
typeobject
The type.type_namestring
Fully qualified datatype name.type_parameter_instantiationarray
Instantiation of type parameters.type_parameterinteger
Type parameter position.Type origins for the package's types.
module_namestring
Name of the defining module.datatype_namestring
Name of the datatype.package_idstring
Package ID where the type originated.Transitive dependencies (linkage table).
original_idstring
Original package ID.upgraded_idstring
Upgraded package ID.upgraded_versioninteger
Upgraded package version.grpcurl
grpcurl \-import-path . \-proto sui/rpc/v2/move_package_service.proto \-H 'X-API-KEY: nodit-demo' \-d '{"package_id": "0x0000000000000000000000000000000000000000000000000000000000000001"}' \sui-mainnet.nodit.io:443 \sui.rpc.v2.MovePackageService/GetPackage