suix_getOwnedObjects - Sui

Example code for the suix_getOwnedObjects JSON-RPC method. Complete guide on how to use suix_getOwnedObjects JSON-RPC in GetBlock Web3 documentation.

This method returns a list of objects owned by an address on the SUI network with powerful filtering capabilities. This method supports pagination and allows filtering by object type, module, package, or other criteria.

Parameters

Parameter
Type
Required
Description
Default/Supported Values

address

string

Yes

The owner's SUI address

Valid SUI address

query

object

No

Query criteria for filtering

ObjectResponseQuery object

cursor

string

No

Pagination cursor

Object ID for cursor

limit

integer

No

Maximum items per page

Default varies by node

Request Example

curl --location --request POST https://go.getblock.io/<ACCESS-TOKEN>/ \
--header 'Content-Type: application/json' \
--data-raw '{
  "jsonrpc": "2.0",
  "method": "suix_getOwnedObjects",
  "params": [
    "0x94f1a597b4e8f709a396f7f6b1482bdcd65a673d111e49286c527fab7c2d0961",
    {
      "filter": {"StructType": "0x2::coin::Coin<0x2::sui::SUI>"},
      "options": {"showType": true, "showOwner": true}
    },
    null,
    10
  ],
  "id": "getblock.io"
}'

Response

Response Parameters

Parameter
Type
Description

result.data

array

Array of owned objects

result.nextCursor

string

Cursor for next page

result.hasNextPage

boolean

Whether more pages exist

Use Cases

  1. NFT Gallery

    List all NFTs owned by an address for gallery displays.

  2. Wallet Inventory

    Display all objects and assets owned by a wallet.

  3. Filtered Queries

    Find specific token types using struct filters.

Error Handling

Error
Description
Solution

Invalid Address

Malformed SUI address

Verify address format

Invalid Filter

Malformed filter object

Check filter syntax

SDK Integration

Last updated

Was this helpful?