sui_tryMultiGetPastObjects - Sui
Example code for the sui_tryMultiGetPastObjects JSON-RPC method. Complete guide on how to use sui_tryMultiGetPastObjects JSON-RPC in GetBlock Web3 documentation.
This method returns object data for multiple objects at their specified versions on the SUI network. This batch method combines the functionality of sui_tryGetPastObject for multiple objects in a single request, making it efficient for historical state queries.
Parameters
past_objects
array
Yes
Array of {objectId, version} pairs
options
ObjectDataOptions
No
Options for response content
Request Example
curl -X POST https://go.getblock.io/<ACCESS-TOKEN>/ \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": "getblock.io",
"method": "sui_tryMultiGetPastObjects",
"params": [
[
{
"objectId": "0x53e4567ccafa5f36ce84c80aa8bc9be64e0d5ae796884274aef3005ae6733809",
"version": "4"
}
],
{ "showContent": true }
]
}'const axios = require('axios');
const payload = {
jsonrpc: '2.0',
id: 'getblock.io',
method: 'sui_tryMultiGetPastObjects',
params: [
[{ objectId: '0x53e4567ccafa5f36ce84c80aa8bc9be64e0d5ae796884274aef3005ae6733809', version: '4' }],
{ showContent: true }
]
};
axios.post('https://go.getblock.io/<ACCESS-TOKEN>/', payload)
.then(response => console.log(response.data));Response Example
Response Parameters
status
string
VersionFound, ObjectNotExists, etc.
details
object
Object data at specified version
Use Cases
Batch historical state queries
Audit multiple objects at once
Compare object states across versions
Historical portfolio snapshots
Error Handling
-32602
Invalid params - malformed input
-32603
Internal error - node issues
SDK Integration
Last updated
Was this helpful?