Skip to main content

suix_getOwnedObjects

Returns a paginated list of all objects owned by a specific address on the Sui network, with support for filtering by object type.

Overview​

The suix_getOwnedObjects method is essential for querying all objects owned by an address. In Sui's object-centric model, everything is represented as objects - coins, NFTs, smart contracts, and custom data structures. This method allows you to discover and enumerate all objects belonging to a specific address, making it crucial for wallet implementations, portfolio trackers, and analytics tools.

Parameters​

ParameterTypeRequiredDescription
ownerstringYesThe Sui address to query (66-character hex string with 0x prefix)
queryobjectNoQuery options for filtering and pagination
cursorstringNoPagination cursor from previous response
limitnumberNoMaximum number of objects to return (default: 50, max: 200)

Query Object​

FieldTypeDescription
MatchAllarrayMatch all specified filters
MatchAnyarrayMatch any of the specified filters
MatchNonearrayExclude objects matching these filters

Filter Options​

Filter TypeDescriptionExample
StructTypeFilter by Move struct type"0x2::coin::Coin<0x2::sui::SUI>"
AddressOwnerFilter by address ownerAddress string
ObjectOwnerFilter by object ownerObject ID string
ObjectIdFilter by specific object IDObject ID string
VersionFilter by object versionVersion number

Returns​

Returns an object containing the paginated list of owned objects.

FieldTypeDescription
dataarrayArray of object information
nextCursorstringCursor for next page (null if no more pages)
hasNextPagebooleanWhether more pages are available

Object Information Structure​

FieldTypeDescription
objectIdstringUnique identifier of the object
versionstringCurrent version of the object
digeststringObject content digest
typestringMove type of the object
ownerobjectOwnership information
previousTransactionstringPrevious transaction digest
storageRebatestringStorage rebate amount
displayobjectDisplay metadata (if available)
contentobjectObject's fields and values (if requested)

Code Examples​

# Get all owned objects (basic query)
curl -X POST https://sui-mainnet.dwellir.com/YOUR_API_KEY \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "suix_getOwnedObjects",
"params": [
"0xd77955e670601c2c2e6e8637e383695c166aac0a86b741c266bdfb23c2e3369f"
],
"id": 1
}'

# Get only SUI coin objects
curl -X POST https://sui-mainnet.dwellir.com/YOUR_API_KEY \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "suix_getOwnedObjects",
"params": [
"0xd77955e670601c2c2e6e8637e383695c166aac0a86b741c266bdfb23c2e3369f",
{
"filter": {
"StructType": "0x2::coin::Coin<0x2::sui::SUI>"
}
},
null,
50
],
"id": 1
}'

# Get objects with content and display info
curl -X POST https://sui-mainnet.dwellir.com/YOUR_API_KEY \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "suix_getOwnedObjects",
"params": [
"0xd77955e670601c2c2e6e8637e383695c166aac0a86b741c266bdfb23c2e3369f",
{
"filter": null,
"options": {
"showType": true,
"showOwner": true,
"showPreviousTransaction": true,
"showDisplay": true,
"showContent": true,
"showBcs": false,
"showStorageRebate": true
}
},
null,
25
],
"id": 1
}'

Response Example​

{
"jsonrpc": "2.0",
"id": 1,
"result": {
"data": [
{
"data": {
"objectId": "0x5d3c87e88bc566e3f10c66e0275a366001ffa8b86142adc78c744de6afffeb34",
"version": "31823924",
"digest": "HpSeCiMLG53N9FcHDrRTxwGhc4RVJa1seZhXYJ7KFpJe",
"type": "0x2::coin::Coin<0x2::sui::SUI>",
"owner": {
"AddressOwner": "0xd77955e670601c2c2e6e8637e383695c166aac0a86b741c266bdfb23c2e3369f"
},
"previousTransaction": "C2QKmxrYPNBJjNmLtZrzFt9tVfq7wo2JZBmc5nQKYFdt",
"storageRebate": "988000",
"content": {
"dataType": "moveObject",
"type": "0x2::coin::Coin<0x2::sui::SUI>",
"hasPublicTransfer": true,
"fields": {
"balance": "1000000000",
"id": {
"id": "0x5d3c87e88bc566e3f10c66e0275a366001ffa8b86142adc78c744de6afffeb34"
}
}
}
}
},
{
"data": {
"objectId": "0x7f8e9d1a2b3c4e5f6789abcdef0123456789abcdef0123456789abcdef012345",
"version": "15234567",
"digest": "9mNkLp3QrTyU8vWx2ZaB4CdE6fGh1JkL7MnOpQrSt2Uv",
"type": "0x2::devnet_nft::DevNetNFT",
"owner": {
"AddressOwner": "0xd77955e670601c2c2e6e8637e383695c166aac0a86b741c266bdfb23c2e3369f"
},
"previousTransaction": "8X9Y0Z1A2B3C4D5E6F789GHIJK123456789ABCDEF0123456789ABCDEF0123456",
"storageRebate": "1500000",
"display": {
"data": {
"name": "Sui Developer NFT #1234",
"description": "A unique NFT for Sui developers",
"image_url": "https://example.com/nft/1234.png",
"creator": "Sui Foundation"
},
"error": null
},
"content": {
"dataType": "moveObject",
"type": "0x2::devnet_nft::DevNetNFT",
"hasPublicTransfer": true,
"fields": {
"id": {
"id": "0x7f8e9d1a2b3c4e5f6789abcdef0123456789abcdef0123456789abcdef012345"
},
"name": "Sui Developer NFT #1234",
"description": "A unique NFT for Sui developers",
"url": "https://example.com/nft/1234.png"
}
}
}
}
],
"nextCursor": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...",
"hasNextPage": true
}
}

Common Use Cases​

1. Wallet Asset Discovery​

async function buildWalletAssets(address) {
const portfolio = await analyzePortfolio(address);

return {
balances: portfolio.coinBalances.map(coin => ({
symbol: coin.symbol,
balance: coin.formattedBalance,
usdValue: 0, // Would need price feed integration
objectCount: coin.objectCount
})),
collectibles: portfolio.nftCollection.map(nft => ({
name: nft.name,
image: nft.imageUrl,
collection: nft.type.split('::')[0] // Extract package ID
})),
totalAssets: portfolio.summary.totalObjects
};
}

2. Object Type Analytics​

async function analyzeObjectTypes(addresses) {
const typeDistribution = {};

for (const address of addresses) {
const objects = await getAllObjectsPaginated(address);

objects.forEach(obj => {
const type = obj.data?.type || 'Unknown';
typeDistribution[type] = (typeDistribution[type] || 0) + 1;
});
}

return Object.entries(typeDistribution)
.sort(([,a], [,b]) => b - a)
.slice(0, 20); // Top 20 types
}

3. NFT Collection Management​

async function manageNFTCollection(address) {
const categorized = await categorizeOwnedObjects(address);
const nfts = categorized.categories.nfts;

// Group by collection (package)
const collections = {};
nfts.forEach(nft => {
const collection = nft.type.split('::')[0];
if (!collections[collection]) {
collections[collection] = [];
}
collections[collection].push(nft);
});

return Object.entries(collections).map(([packageId, nfts]) => ({
packageId: packageId,
name: nfts[0]?.type.split('::')[1] || 'Unknown Collection',
count: nfts.length,
items: nfts.map(nft => ({
objectId: nft.objectId,
name: nft.name,
image: nft.imageUrl
}))
}));
}

Best Practices​

  1. Use pagination for addresses with many objects to avoid timeouts
  2. Filter by type when you only need specific object categories
  3. Request minimal data by configuring options appropriately
  4. Cache results for frequently accessed data to improve performance
  5. Handle empty results gracefully for addresses with no objects
  6. Monitor changes for real-time applications using periodic polling

Error Handling​

async function safeGetOwnedObjects(address, options = {}) {
try {
const result = await client.getOwnedObjects({
owner: address,
...options
});

return {
success: true,
data: result
};
} catch (error) {
if (error.message.includes('Invalid address')) {
return {
success: false,
error: 'Invalid Sui address format'
};
}

return {
success: false,
error: 'Failed to fetch objects',
details: error.message
};
}
}

Need help? Contact our support team or check the Sui documentation.