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

StateService/ListOwnedObjects - SUI

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

Returns objects owned by an address. Paginated; an optional object_type filter narrows the result to a specific Move type (e.g. all NFTs of a given collection).

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

Request Fields

Field
Type
Required
Description

owner

Address

Yes

32-byte address (hex 0x...)

object_type

string

No

Filter results to a specific Move type (e.g. 0x2::coin::Coin<0x2::sui::SUI>)

page_size

uint32

No

Maximum objects per page

page_token

string

No

Pagination token from a previous response

read_mask

FieldMask

No

Field paths to include for each object

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 '{
    "owner": "0xb871a42470b59c7184033a688f883cf24eb5e66eae1db62319bab27adb30b873",
    "object_type": "0x2::coin::Coin<0x2::sui::SUI>",
    "page_size": 50,
    "read_mask": {
        "paths": [
            "object_id",
            "version",
            "object_type"
        ]
    }
}' \
  go.getblock.io:443/<ACCESS-TOKEN> \
  sui.rpc.v2.StateService/ListOwnedObjects

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

objects

repeated Object

Objects owned by the address

objects[].object_id

ObjectId

Object ID

objects[].version

string

Object version

objects[].object_type

string

Move type

next_page_token

string

Pagination cursor; empty when no more pages

Use Cases

  • Wallet UIs enumerating all coins, NFTs, and Move objects owned by a user

  • DEX wallets fetching all coin objects of a specific type before constructing a swap

  • NFT galleries filtering by collection (via object_type)

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?