Skip to main content

Query Owned Objects

Alpha Software

The IOTA SDK is currently in alpha. APIs, interfaces, and behavior may change without notice between releases. It is not yet recommended for production use.

This guide shows you how to list the objects owned by an IOTA address using the IOTA SDK's GraphQL client.

Prerequisites

  • The IOTA SDK installed for your target language
  • A valid IOTA address on the testnet

Steps

1. Initialize the GraphQL Client

Create a client connected to the IOTA Testnet.

crates/iota-sdk/examples/owned_objects.rs
loading...

2. Set the Address

Set the address whose objects you want to list. The examples use the zero address; replace it with your own.

crates/iota-sdk/examples/owned_objects.rs
loading...

3. Query the Owned Objects

Query the objects owned by the address using an object filter, then print the ID of each object in the result page.

crates/iota-sdk/examples/owned_objects.rs
loading...

Expected Output

Owned objects (<count>):
0x<object-id>
0x<object-id>
...

Full Example

crates/iota-sdk/examples/owned_objects.rs
loading...