Skip to main content
POST
/
stream
curl --compressed -X POST 'https://portal.sqd.dev/datasets/tron-mainnet/stream' \
  -H 'Content-Type: application/json' \
  -d '{
    "type": "tron",
    "fromBlock": 79257136,
    "toBlock": 79257200,
    "fields": {
      "block": { "number": true, "timestamp": true },
      "log": {
        "address": true,
        "topics": true,
        "data": true,
        "transactionIndex": true,
        "logIndex": true
      }
    },
    "logs": [{
      "address": ["a614f803b6fd780986a42c78ec9c7f77e6ded13c"],
      "topic0": ["ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"]
    }]
  }'
[
  {
    "header": {
      "number": 79257136,
      "hash": "0000000004b95e300d9e52d878f88dba9776017f01923b8ab8c3680fc49b0771",
      "timestamp": 1768435116000
    },
    "logs": [
      {
        "transactionIndex": 2,
        "logIndex": 0,
        "address": "a614f803b6fd780986a42c78ec9c7f77e6ded13c",
        "data": "00000000000000000000000000000000000000000000000000000003c4a67e65",
        "topics": [
          "ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
          "000000000000000000000000056d10e7b4ffd1ea56fd26f7ba5cedb3cf022ed7",
          "000000000000000000000000201ec2a6830ce97884f284db2c080612de342806"
        ]
      }
    ],
    "transactions": [],
    "internalTransactions": []
  }
]

Body

application/json

Data query to filter and retrieve blocks. Request body may be gzipped (Content-Encoding: gzip).

type
enum<string>
default:tron
required

The type of blockchain data (fixed to Tron for this API).

Available options:
tron
fromBlock
integer<int64>
required

The block number to start fetching from (inclusive).

toBlock
integer<int64>

The block number to fetch up to (inclusive). Optional; if omitted, streams until dataset height or timeout.

parentBlockHash
string

Expected hash of the parent of the first requested block.

includeAllBlocks
boolean
default:false

If true, includes blocks with no matching data in the response.

fields
object

Field selector for data items to retrieve.

transactions
object[]

Transaction data requests. Matches transactions by contract type.

transferTransactions
object[]

Native TRX transfer requests (TransferContract). Addresses are 41-prefixed lowercase hex.

transferAssetTransactions
object[]

TRC-10 asset transfer requests (TransferAssetContract).

triggerSmartContractTransactions
object[]

Smart-contract call requests (TriggerSmartContract). Covers TRC-20 and all other contract interactions.

logs
object[]

Log data requests (TVM event logs).

internalTransactions
object[]

Internal transaction data requests.

Response

A stream of blocks in JSON lines format, optionally gzipped. Can be empty if the data query has a bounded range and all blocks in the range have been skipped. May include X-Sqd-Finalized-Head-Number and X-Sqd-Finalized-Head-Hash headers, indicating the latest finalized block that's on the same chain as the returned blocks.

header
object

Block header data. Fields are conditionally returned based on the fields.block parameter in the request. Only requested fields will be included in the response.

transactions
object[]
logs
object[]
internalTransactions
object[]