For the complete documentation index, see llms.txt. This page is also available as Markdown.

tateService/ListDynamicFields - SUI

Example code for the tateService/ListDynamicFields gRPC method. Complete guide on how to use tateService/ListDynamicFields gRPC method in GetBlock Web3 documentation.

Returns the dynamic fields of a parent object. Dynamic fields are Sui's mechanism for attaching child objects to a parent with arbitrary keys — used for collections, mappings, and on-chain key-value stores. Paginated.

Service: sui.rpc.v2.StateService Proto file: sui/rpc/v2/state_service.proto Full method path: sui.rpc.v2.StateService/ListDynamicFields

Request Fields

Field
Type
Required
Description

parent

ObjectId

Yes

32-byte ID of the parent object

page_size

uint32

No

Maximum fields per page

page_token

string

No

Pagination token from a previous response

Request Example

# Clone the official proto files first (one-time setup):
#   git clone https://github.com/MystenLabs/sui-apis.git && cd sui-apis

grpcurl \
  -import-path proto \
  -proto sui/rpc/v2/state_service.proto \
  -H "x-grpc-web: 1" \
  -d '{
    "parent": "0xc8ec1d6e3a7e9d2f5a8c3e7b1d4f9a6c2e5b8d3f7a1c4e9b2d4f6a8c0e2f4b6d",
    "page_size": 50
}' \
  go.getblock.io:443/<ACCESS-TOKEN> \
  sui.rpc.v2.StateService/ListDynamicFields
import * as grpc from '@grpc/grpc-js';
import * as protoLoader from '@grpc/proto-loader';
import * as path from 'path';

const PROTO_PATH = path.join(__dirname, 'protos/proto/sui/rpc/v2/state_service.proto');
const ACCESS_TOKEN = '<ACCESS-TOKEN>';

const packageDef = protoLoader.loadSync(PROTO_PATH, {
    includeDirs: [path.join(__dirname, 'protos/proto')],
    keepCase: true, longs: String, enums: String, defaults: true,
});
const proto = grpc.loadPackageDefinition(packageDef) as any;
const ServiceClient = proto.sui.rpc.v2.StateService;

const metadata = new grpc.Metadata();
metadata.add('authorization', `Bearer ${ACCESS_TOKEN}`);

const client = new ServiceClient('go.getblock.io:443', grpc.credentials.createSsl());

const request = {
    "parent": "0xc8ec1d6e3a7e9d2f5a8c3e7b1d4f9a6c2e5b8d3f7a1c4e9b2d4f6a8c0e2f4b6d",
    "page_size": 50
};

client.ListDynamicFields(request, metadata, (err: any, response: any) => {
    if (err) {
        console.error('Error:', err);
        return;
    }
    console.log(JSON.stringify(response, null, 2));
});

Response Example

Responses are encoded in Protocol Buffers binary format on the wire. The example below shows the protobuf JSON encoding for readability.

Response Fields

Field
Type
Description

dynamic_fields

repeated DynamicField

Dynamic field entries on the parent

dynamic_fields[].name

MoveValue

Field key (Move-typed value)

dynamic_fields[].object_id

ObjectId

Object ID of the field's child object

dynamic_fields[].object_type

string

Full Move type of the field

next_page_token

string

Pagination cursor; empty when no more pages

Use Cases

  • Enumerating on-chain mappings (e.g. governance vote tallies, voting registries)

  • Walking DEX pools' liquidity bins

  • Reading game state stored under dynamic fields

Error Handling

gRPC uses status codes rather than JSON-RPC numeric error codes. The most relevant for this method:

Status Code
Numeric
Cause

UNAUTHENTICATED

16

Missing or invalid <ACCESS-TOKEN> in the URL path

INVALID_ARGUMENT

3

Request fields are missing, malformed, or fail validation

UNAVAILABLE

14

Node is overloaded or temporarily unable to handle the request — retry with backoff

DEADLINE_EXCEEDED

4

Request did not complete within the timeout window

RESOURCE_EXHAUSTED

8

Rate limit exceeded for your plan

SDK Integration

Was this helpful?