Skip to main content
POST
/
finalized-stream
curl --compressed -X POST 'https://portal.sqd.dev/datasets/polkadot/finalized-stream' \ -H 'Content-Type: application/json' \ -d '{ "type": "substrate", "fromBlock": 20000000, "toBlock": 20000100, "fields": { "block": { "number": true, "timestamp": true }, "event": { "name": true, "args": true } }, "events": [{ "name": ["Balances.Transfer"] }] }'
[
  {
    "header": {
      "number": 123,
      "hash": "<string>",
      "parentHash": "<string>",
      "stateRoot": "<string>",
      "extrinsicsRoot": "<string>",
      "digest": {},
      "specName": "<string>",
      "specVersion": 123,
      "implName": "<string>",
      "implVersion": 123,
      "validator": "<string>",
      "timestamp": 123
    },
    "extrinsics": [
      {
        "index": 123,
        "version": 123,
        "success": true,
        "hash": "<string>",
        "fee": "<string>",
        "tip": "<string>",
        "signature": {},
        "error": {}
      }
    ],
    "calls": [
      {
        "extrinsicIndex": 123,
        "address": [
          123
        ],
        "name": "<string>",
        "success": true,
        "args": {},
        "origin": {},
        "error": {}
      }
    ],
    "events": [
      {
        "index": 123,
        "extrinsicIndex": 123,
        "callAddress": [
          123
        ],
        "name": "<string>",
        "phase": "<string>",
        "topics": [
          "<string>"
        ],
        "args": {}
      }
    ]
  }
]
Real-time streaming is not supported for Substrate chains. Only finalized historical data is available. If you need real-time Substrate data, schedule a call with our team.

Body

application/json

Data query to filter and retrieve blocks

fromBlock
integer<int64>
default:20000000
required

The number of the first block to fetch. If unsure how far into the past this can go consult /metadata

type
enum<string>
default:substrate
Available options:
substrate
toBlock
integer<int64>
default:20000100

The number of the last block to fetch (inclusive)

parentBlockHash
string

Expected hash of the parent of the first requested block

includeAllBlocks
boolean
default:false

If true, includes blocks with no matching data

fields
object

Field selector. See the HTTP 200 response description for details on fields that aren't self-explanatory

events
object[]

Event data requests. An empty object matches all events; an empty array matches no events

calls
object[]

Call data requests. An empty object matches all calls; an empty array matches no calls

evmLogs
object[]

EVM.Log event requests for Frontier EVM parachains (e.g. Moonbeam, Astar). Filters on EVM.Log events specifically

ethereumTransactions
object[]

Ethereum.transact call requests for Frontier EVM parachains. Filters on Ethereum.transact calls specifically

contractsEvents
object[]

Contracts.ContractEmitted event requests for ink! smart contracts. Contract addresses must be hexadecimal (decoded from SS58) and lowercase

gearMessagesEnqueued
object[]

Gear.UserMessageEnqueued event requests for Gear/Vara networks

gearUserMessagesSent
object[]

Gear.UserMessageSent event requests for Gear/Vara networks

reviveContractEmitted
object[]

Revive.ContractEmitted event requests for Revive smart contracts

Response

A stream of finalized blocks in JSON lines format, optionally gzipped. Never returns blocks above the finalized head.

header
object
required
extrinsics
object[]
calls
object[]
events
object[]