gRPCGetFunction

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

Retrieves the Move function 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 function.

Responses
namestring

Name of the function.

visibilitystring

Visibility (public/private/public(friend)).

is_entryboolean

Whether the function is an entry function.

type_parametersobject[]

Generic type parameters.

constraintsstring[]

Ability constraints on the parameter.

is_phantomboolean

Whether the parameter is phantom.

parametersobject[]

Parameter types.

referenceobject

Reference kind, if the type is a reference.

bodyobject

The signature body.

typeobject

The type.

type_namestring

Fully qualified datatype name.

type_parameter_instantiationobject[]

Instantiation of type parameters.

type_parameterinteger

Type parameter position.

returnsobject[]

Return types.

referenceobject

Reference kind, if the type is a reference.

bodyobject

The signature body.

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/GetFunction
Response
Example · 200
{
  "function": {}
}