Skip to content
Alchemy Logo

State and balances

The StateService provides methods for querying coin balances, dynamic fields, and owned objects.

Gets the balance of a specific coin type for an owner address.

Request:

FieldTypeRequiredDescription
ownerstringYesOwner address
coin_typestringYesCoin type (e.g., 0x2::sui::SUI)

Response:

FieldTypeDescription
balanceBalanceBalance information including total and coin count
grpcurl \
  -H "Authorization: Bearer <YOUR_API_KEY>" \
  -import-path proto \
  -proto sui/rpc/v2/state_service.proto \
  -d '{
    "owner": "0xYOUR_ADDRESS",
    "coin_type": "0x2::sui::SUI"
  }' \
  sui-mainnet.g.alchemy.com:443 \
  sui.rpc.v2.StateService/GetBalance

Lists all coin balances for an owner with pagination.

Request:

FieldTypeRequiredDescription
ownerstringYesOwner address
page_sizeuint32NoMaximum results to return
page_tokenbytesNoPagination token from a previous response

Response:

FieldTypeDescription
balancesrepeated BalanceList of balances by coin type
next_page_tokenbytesToken for the next page of results
grpcurl \
  -H "Authorization: Bearer <YOUR_API_KEY>" \
  -import-path proto \
  -proto sui/rpc/v2/state_service.proto \
  -d '{"owner": "0xYOUR_ADDRESS"}' \
  sui-mainnet.g.alchemy.com:443 \
  sui.rpc.v2.StateService/ListBalances

Gets metadata and treasury information for a coin type.

Request:

FieldTypeRequiredDescription
coin_typestringYesThe coin type to query

Response:

FieldTypeDescription
coin_typestringThe queried coin type
metadataCoinMetadataCoin metadata (name, symbol, decimals, etc.)
regulated_metadataRegulatedCoinMetadataRegulated coin metadata if applicable
treasuryCoinTreasuryTreasury information
grpcurl \
  -H "Authorization: Bearer <YOUR_API_KEY>" \
  -import-path proto \
  -proto sui/rpc/v2/state_service.proto \
  -d '{"coin_type": "0x2::sui::SUI"}' \
  sui-mainnet.g.alchemy.com:443 \
  sui.rpc.v2.StateService/GetCoinInfo

Lists dynamic fields of an object with pagination.

Request:

FieldTypeRequiredDescription
parentstringYesParent object ID
page_sizeuint32NoMaximum results to return
page_tokenbytesNoPagination token from a previous response
read_maskFieldMaskNoFields to include in the response

Response:

FieldTypeDescription
dynamic_fieldsrepeated DynamicFieldList of dynamic fields
next_page_tokenbytesToken for the next page of results
grpcurl \
  -H "Authorization: Bearer <YOUR_API_KEY>" \
  -import-path proto \
  -proto sui/rpc/v2/state_service.proto \
  -d '{"parent": "0xOBJECT_ID"}' \
  sui-mainnet.g.alchemy.com:443 \
  sui.rpc.v2.StateService/ListDynamicFields

Lists objects owned by an address, optionally filtered by type.

Request:

FieldTypeRequiredDescription
ownerstringYesOwner address
object_typestringNoFilter by object type
page_sizeuint32NoMaximum results to return
page_tokenbytesNoPagination token from a previous response
read_maskFieldMaskNoFields to include in the response

Response:

FieldTypeDescription
objectsrepeated ObjectList of owned objects
next_page_tokenbytesToken for the next page of results
grpcurl \
  -H "Authorization: Bearer <YOUR_API_KEY>" \
  -import-path proto \
  -proto sui/rpc/v2/state_service.proto \
  -d '{"owner": "0xYOUR_ADDRESS"}' \
  sui-mainnet.g.alchemy.com:443 \
  sui.rpc.v2.StateService/ListOwnedObjects
Was this page helpful?