suix_queryTransactionBlocks{deprecated} - Sui

This method returns transactions that match the specified query criteria on the SUI network. This query supports filtering by sender, recipient, input objects, changed objects, and Move function calls, with pagination.

This method is deprecated

Parameters

ParameterTypeRequiredDescription
queryTransactionBlocksQueryYesQuery criteria with filter and options
cursorTransactionDigestNoPagination cursor
limituintNoMaximum items per page
descending_orderbooleanNoSort order (default: false)

Filter Options

  • Checkpoint - Filter by checkpoint
  • MoveFunction - Filter by Move function call
  • InputObject - Filter by input object
  • ChangedObject - Filter by modified object
  • FromAddress - Filter by sender
  • ToAddress - Filter by recipient
  • FromAndToAddress - Filter by both sender and recipient
  • TransactionKind - Filter by transaction type

Request Example

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": "suix_queryTransactionBlocks",
  "params": [
    {
      "filter": {
        "InputObject": "0x93633829fcba6d6e0ccb13d3dbfe7614b81ea76b255e5d435032cd8595f37eb8"
      },
      "options": null
    },
    null,
    100,
    false
  ]
}'
javascriptconst axios = require('axios');

const payload = {
  jsonrpc: '2.0',
  id: 'getblock.io',
  method: 'suix_queryTransactionBlocks',
  params: [
    { filter: { InputObject: '0x93633829fcba6d6e0ccb13d3dbfe7614b81ea76b255e5d435032cd8595f37eb8' }, options: null },
    null,
    100,
    false
  ]
};

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

payload = {
    "jsonrpc": "2.0",
    "id": "getblock.io",
    "method": "suix_queryTransactionBlocks",
    "params": [
        {
            "filter": {"InputObject": "0x93633829fcba6d6e0ccb13d3dbfe7614b81ea76b255e5d435032cd8595f37eb8"},
            "options": None
        },
        None,
        100,
        False
    ]
}

response = requests.post("https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/", json=payload)
print(response.json())
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": "suix_queryTransactionBlocks",
        "params": [
            {"filter": {"InputObject": "0x93633829..."}, "options": null},
            null, 100, false
        ]
    });
    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": {
    "data": [
      {
        "digest": "5PLgmQye6rraDYqpV3npV6H1cUXoJZgJh1dPCyRa3WCv",
        "timestampMs": "1676911928000",
        "checkpoint": "1000"
      }
    ],
    "nextCursor": "5PLgmQye6rraDYqpV3npV6H1cUXoJZgJh1dPCyRa3WCv",
    "hasNextPage": false
  },
  "id": "getblock.io"
}

Response Parameters

ParameterTypeDescription
dataarrayMatching transaction digests
nextCursorstringCursor for pagination
hasNextPagebooleanMore results available

Use Cases

  • Query transaction history by address
  • Find transactions involving specific objects
  • Track Move function calls
  • Build transaction explorers
  • Monitor contract interactions

Error Handling

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

SDK Integration

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

const client = new SuiClient({ url: 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/' });
const txs = await client.queryTransactionBlocks({
  filter: { InputObject: '0x93633829fcba6d6e0ccb13d3dbfe7614b81ea76b255e5d435032cd8595f37eb8' },
  limit: 100
});
console.log(txs);
rustuse sui_sdk::SuiClientBuilder;
use sui_sdk::rpc_types::TransactionFilter;

#[tokio::main]
async fn main() -> Result<(), anyhow::Error> {
    let sui = SuiClientBuilder::default().build("https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/").await?;
    let txs = sui.read_api().query_transaction_blocks(
        TransactionFilter::InputObject("0x93633829...".parse()?),
        None, None, false
    ).await?;
    println!("{:?}", txs);
    Ok(())
}