gRPCGetDatatype

sui-mainnet.nodit.io:443 sui.rpc.v2.MovePackageService/GetDatatypeunary

Retrieves the Move datatype information for the specified package.

TransportgRPC

Request and response messages are identical for both transports. Only the wire protocol, headers, and client library differ.

Protocol
Native gRPC over HTTP/2 with TLS. Suited to server-side clients and grpcurl.
Content-Type
application/grpc
Headers
x-api-key
Streaming
Server, client, and bidirectional streaming are all supported.
Errors
grpc-status and grpc-message are delivered as HTTP/2 trailers.
Request Body
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.

Responses
type_namestring

Fully qualified type name.

defining_idstring

Package storage ID that defines the type.

modulestring

Module name.

namestring

Datatype name.

abilitiesstring[]

Abilities of the datatype.

type_parametersobject[]

Generic type parameters.

constraintsstring[]

Ability constraints on the parameter.

is_phantomboolean

Whether the parameter is phantom.

kindstring

Whether it is a struct or enum.

fieldsobject[]

Fields of the datatype.

namestring

Name of the field.

positioninteger

Position in definition order.

typeobject

Type of the field.

typeobject

The type.

type_namestring

Fully qualified datatype name.

type_parameter_instantiationobject[]

Instantiation of type parameters.

type_parameterinteger

Type parameter position.

variantsobject[]

Variants if the datatype is an enum.

namestring

Name of the variant.

positioninteger

Position in definition order.

fieldsobject[]

Fields of the variant.

namestring

Name of the field.

positioninteger

Position in definition order.

typeobject

Type of the field.

typeobject

The type.

type_namestring

Fully qualified datatype name.

type_parameter_instantiationobject[]

Instantiation of type parameters.

type_parameterinteger

Type parameter position.

X-API-KEY
RequestCU50
grpcurl
grpcurl \
  -import-path . -proto sui/rpc/v2/move_package_service.proto \
  -H "X-API-KEY: {YOUR_API_KEY}" \
  -d '{
  "package_id": "0x0000000000000000000000000000000000000000000000000000000000000001",
  "module_name": "example.sui",
  "name": "example.sui"
}' \
  sui-mainnet.nodit.io:443 sui.rpc.v2.MovePackageService/GetDatatype
Response
Example · 200
{
  "datatype": {}
}