sui_tryMultiGetPastObjects{deprecated} - Sui

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 historical state queries efficient.

This method is deprecated

Parameters

ParameterTypeRequiredDescription
past_objectsarrayYesArray of {objectId, version} pairs
optionsObjectDataOptionsNoOptions for response content

Request Example

cURL

bashcurl -X POST https://shared.eu-central-1.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 }
  ]
}'

request.js

javascriptconst axios = require('axios');

const payload = {
  jsonrpc: '2.0',
  id: 'getblock.io',
  method: 'sui_tryMultiGetPastObjects',
  params: [
    [{ objectId: '0x53e4567ccafa5f36ce84c80aa8bc9be64e0d5ae796884274aef3005ae6733809', version: '4' }],
    { showContent: true }
  ]
};

axios.post('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/', payload)
.then(response => console.log(response.data));

request.py

pythonimport requests

payload = {
    "jsonrpc": "2.0",
    "id": "getblock.io",
    "method": "sui_tryMultiGetPastObjects",
    "params": [
        [{"objectId": "0x53e4567ccafa5f36ce84c80aa8bc9be64e0d5ae796884274aef3005ae6733809", "version": "4"}],
        {"showContent": True}
    ]
}

response = requests.post("https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/", json=payload)
print(response.json())

main.rs

rustuse reqwest::Client;
use serde_json::json;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    let payload = json!({
        "jsonrpc": "2.0",
        "id": "getblock.io",
        "method": "sui_tryMultiGetPastObjects",
        "params": [
            [{"objectId": "0x53e4567...", "version": "4"}],
            {"showContent": true}
        ]
    });
    let response = client.post("https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/")
        .json(&payload).send().await?;
    println!("{}", response.text().await?);
    Ok(())
}

Response Example

json{
  "jsonrpc": "2.0",
  "result": [
    {
      "status": "VersionFound",
      "details": {
        "objectId": "0x53e4567ccafa5f36ce84c80aa8bc9be64e0d5ae796884274aef3005ae6733809",
        "version": "4",
        "content": { "dataType": "moveObject" }
      }
    }
  ],
  "id": "getblock.io"
}

Response Parameters

ParameterTypeDescription
statusstringVersionFound, ObjectNotExists, etc.
detailsobjectObject 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

Error CodeDescription
-32602Invalid params - malformed input
-32603Internal error - node issues

SDK Integration

example.ts

typescriptimport { SuiClient } from '@mysten/sui/client';

const client = new SuiClient({ url: 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/' });
const pastObjects = await client.tryMultiGetPastObjects({
  pastObjects: [{ objectId: '0x53e4567...', version: '4' }],
  options: { showContent: true }
});
console.log(pastObjects);

example.rs

rustuse sui_sdk::SuiClientBuilder;

#[tokio::main]
async fn main() -> Result<(), anyhow::Error> {
    let sui = SuiClientBuilder::default().build("https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/").await?;
    // Use multi_try_get_parsed_past_object
    Ok(())
}