Skip to main content

GetFunction

gRPC
RPC Methodsui.rpc.v2.MovePackageService/GetFunction

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

github.com/MystenLabs/sui-apis/tree/main/proto

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 function.
Response Message
The requested function.
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.
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/GetFunction