# suix_queryTransactionBlocks{deprecated} - Sui

> Example code for the suix_queryTransactionBlocks JSON-RPC method. Complete guide on how to use suix_queryTransactionBlocks JSON-RPC in GetBlock Web3 documentation.

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.

> **Warning:** This method is deprecated

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| query | TransactionBlocksQuery | Yes | Query criteria with filter and options |
| cursor | TransactionDigest | No | Pagination cursor |
| limit | uint | No | Maximum items per page |
| descending_order | boolean | No | Sort 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

#### cURL

```bash
curl -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
  ]
}'
```

#### JavaScript (Axios)

```javascript
const 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));
```

#### Python

```python
import 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())
```

#### Rust

```rust
use 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

| Parameter | Type | Description |
| --- | --- | --- |
| data | array | Matching transaction digests |
| nextCursor | string | Cursor for pagination |
| hasNextPage | boolean | More 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 Code | Description |
| --- | --- |
| -32602 | Invalid params - malformed query |
| -32603 | Internal error - node issues |

## SDK Integration

#### Sui TypeScript SDK

```typescript
import { 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);
```

#### Sui Rust SDK

```rust
use 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(())
}
```
