Skip to content

MovePackageService.GetFunction ​

Get function through sui.rpc.v2.MovePackageService/GetFunction on Inodra's Sui gRPC endpoint.

Endpoint ​

NetworkHostAuthentication
Mainnetmainnet-grpc.inodra.com:443x-api-key metadata
Testnettestnet-grpc.inodra.com:443x-api-key metadata

Full method name: sui.rpc.v2.MovePackageService/GetFunction. Unary: one request, one response. Get a key from the dashboard; the same key works on every protocol.

Request: GetFunctionRequest ​

FieldTypeDescription
package_idstringRequired. The storage_id of the requested package.
module_namestringRequired. The name of the requested module.
namestringRequired. The name of the requested function.

Response: GetFunctionResponse ​

FieldTypeDescription
functionFunctionDescriptorThe function.

FunctionDescriptor ​

Descriptor of a Move function

FieldTypeDescription
namestringName of the function
visibilityFunctionDescriptor.VisibilityWhether the function is public, private or public(friend)
is_entryboolWhether the function is marked entry or not.
type_parametersrepeated TypeParameterAbility constraints for type parameters
parametersrepeated OpenSignatureFormal parameter types.
returnsrepeated OpenSignatureReturn types.

grpcurl ​

bash
grpcurl -H "x-api-key: YOUR_API_KEY" \
  -d '{
  "package_id": "0x2",
  "module_name": "coin",
  "name": "transfer"
}' \
  mainnet-grpc.inodra.com:443 \
  sui.rpc.v2.MovePackageService/GetFunction

Server reflection is enabled, so no proto files are needed for grpcurl. Field masks are written as {"paths": [...]}.

TypeScript ​

typescript
import { GrpcWebFetchTransport, SuiGrpcClient } from '@mysten/sui/grpc'

const transport = new GrpcWebFetchTransport({
  baseUrl: 'https://mainnet-grpc.inodra.com',
  meta: { 'x-api-key': process.env.INODRA_API_KEY! }
})
const client = new SuiGrpcClient({ network: 'mainnet', transport })

const { function: fn } = await client.getMoveFunction({
  packageId: '0x2',
  moduleName: 'coin',
  name: 'value'
})
console.log(fn)

Uses the typed SuiGrpcClient method from @mysten/sui v2 that calls this RPC. Install with npm install @mysten/sui and set INODRA_API_KEY. The gRPC gateway guide covers native gRPC transport for backends.

Credits ​

1 credit per call. See credits and billing for the full table.

JSON-RPC equivalent ​

Replaces sui_getNormalizedMoveFunction. The JSON-RPC to gRPC migration guide has before and after code for the common calls.

The full-stack Sui data layer.