sui_multiGetObjects - Sui
Example code for the sui_multiGetObjects JSON-RPC method. Complete guide on how to use sui_multiGetObjects JSON-RPC in GetBlock Web3 documentation.
This method returns object data for a list of objects on the SUI network in a single request. This batch method is more efficient than making individual sui_getObject calls when you need data for multiple objects.
Parameters
object_ids
array
Yes
Array of object IDs to query
options
ObjectDataOptions
No
Options for response content
Request Example
curl --location --request POST 'https://go.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
"jsonrpc": "2.0",
"id": "getblock.io",
"method": "sui_multiGetObjects",
"params": [
[
"0x53e4567ccafa5f36ce84c80aa8bc9be64e0d5ae796884274aef3005ae6733809",
"0x11af4b844ff94b3fbef6e36b518da3ad4c5856fa686464524a876b463d129760"
],
{
"showType": true,
"showOwner": true,
"showContent": true
}
]
}'import axios from 'axios';
const data = JSON.stringify({
"jsonrpc": "2.0",
"id": "getblock.io",
"method": "sui_multiGetObjects",
"params": [
[
"0x53e4567ccafa5f36ce84c80aa8bc9be64e0d5ae796884274aef3005ae6733809",
"0x11af4b844ff94b3fbef6e36b518da3ad4c5856fa686464524a876b463d129760"
],
{
"showType": true,
"showOwner": true,
"showContent": true
}
]
});
const config = {
method: 'post',
url: 'https://go.getblock.io/<ACCESS-TOKEN>/',
headers: {
'Content-Type': 'application/json'
},
data: data
};
axios(config)
.then(response => console.log(JSON.stringify(response.data)))
.catch(error => console.log(error));Response Example
Response Parameters
result
array
Array of object responses
Use Cases
Fetch multiple NFTs efficiently
Load coin objects for transaction building
Batch validate object existence
Optimize API calls for large datasets
Error Handling
-32602
Invalid params - malformed object IDs
-32603
Internal error - node issues
SDK Integration
Last updated
Was this helpful?