GetDatatype
gRPC
RPC Method
sui.rpc.v2.MovePackageService/GetDatatypeRetrieves the Move datatype information for the specified package.
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.module_namestringrequired
Required. The name of the requested module.namestringrequired
Required. The name of the requested datatype.Response Message
The requested datatype.
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.grpcurl
grpcurl \-import-path . \-proto sui/rpc/v2/move_package_service.proto \-H 'X-API-KEY: nodit-demo' \-d '{"package_id": "0x0000000000000000000000000000000000000000000000000000000000000001","module_name": "example.sui","name": "example.sui"}' \sui-mainnet.nodit.io:443 \sui.rpc.v2.MovePackageService/GetDatatype