Skip to main content
POST
/
stream
cURL
curl --request POST \
  --url https://portal.sqd.dev/datasets/solana-mainnet/stream \
  --header 'Content-Type: application/json' \
  --data '{
  "type": "solana",
  "fromBlock": 317617480,
  "toBlock": 317617482,
  "parentBlockHash": "<string>",
  "includeAllBlocks": true,
  "fields": {
    "instruction": {
      "data": true
    },
    "block": {
      "number": true
    }
  },
  "instructions": [
    {
      "programId": [
        "dRiftyHA39MWEi3m9aunc5MzRF1JYuBsbn6VPcn33UH"
      ]
    }
  ],
  "transactions": [
    {
      "feePayer": [
        "<string>"
      ],
      "mentionsAccount": [
        "<string>"
      ],
      "instructions": true,
      "balances": true,
      "tokenBalances": true,
      "logs": true
    }
  ],
  "balances": [
    {
      "account": [
        "<string>"
      ],
      "transaction": true,
      "transactionInstructions": true
    }
  ],
  "tokenBalances": [
    {
      "account": [
        "<string>"
      ],
      "preProgramId": [
        "<string>"
      ],
      "postProgramId": [
        "<string>"
      ],
      "preMint": [
        "<string>"
      ],
      "postMint": [
        "<string>"
      ],
      "preOwner": [
        "<string>"
      ],
      "postOwner": [
        "<string>"
      ],
      "transaction": true,
      "transactionInstructions": true
    }
  ],
  "rewards": [
    {
      "pubkey": [
        "<string>"
      ]
    }
  ],
  "logs": [
    {
      "programId": [
        "<string>"
      ],
      "kind": [
        "log"
      ],
      "instruction": true,
      "transaction": true
    }
  ]
}'
[
  {
    "header": {
      "number": 123,
      "height": 123,
      "parentSlot": 123,
      "hash": "<string>"
    },
    "instructions": [
      {
        "transactionIndex": 123,
        "instructionAddress": [
          123
        ],
        "programId": "<string>",
        "accounts": [
          "<string>"
        ],
        "data": "<string>",
        "d1": "<string>",
        "d2": "<string>",
        "d4": "<string>",
        "d8": "<string>",
        "error": "<string>",
        "computeUnitsConsumed": 123,
        "isCommitted": true,
        "hasDroppedLogMessages": true
      }
    ],
    "transactions": [
      {
        "transactionIndex": 123,
        "version": 123,
        "accountKeys": [
          123
        ],
        "addressTableLookups": [
          {
            "accountKey": "<string>",
            "readonlyIndexes": [
              123
            ],
            "writableIndexes": [
              123
            ]
          }
        ],
        "numReadonlySignedAccounts": 123,
        "numReadonlyUnsignedAccounts": 123,
        "numRequiredSignatures": 123,
        "recentBlockhash": "<string>",
        "signatures": [
          "<string>"
        ],
        "err": {},
        "fee": 123,
        "computeUnitsConsumed": 123,
        "loadedAddresses": {
          "readonly": [
            "<string>"
          ],
          "writable": [
            "<string>"
          ]
        },
        "feePayer": "<string>",
        "hasDroppedLogMessages": true
      }
    ],
    "balances": [
      {
        "transactionIndex": 123,
        "account": "<string>",
        "pre": 123,
        "post": 123
      }
    ],
    "tokenBalances": [
      {
        "transactionIndex": 123,
        "account": "<string>",
        "preMint": "<string>",
        "postMint": "<string>",
        "preDecimals": 123,
        "postDecimals": 123,
        "preProgramId": "<string>",
        "postProgramId": "<string>",
        "preOwner": "<string>",
        "postOwner": "<string>",
        "preAmount": 123,
        "postAmount": 123
      }
    ],
    "rewards": [
      {
        "pubKey": "<string>",
        "lamports": 123,
        "postBalance": 123,
        "rewardType": "<string>",
        "commission": 123
      }
    ],
    "logs": [
      {
        "transactionIndex": 123,
        "logIndex": 123,
        "instructionAddress": [
          123
        ],
        "programId": "<string>",
        "kind": "log",
        "message": "<string>"
      }
    ]
  }
]

Body

application/json

Data query to filter and retrieve blocks

fromBlock
integer
default:317617480
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:solana
Available options:
solana
toBlock
integer
default:317617482

The number of the last block to fetch (inclusive)

parentBlockHash
string

Expected hash of the parent of the first requested block

includeAllBlocks
boolean

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

instructions
object[]

Instruction data requests. Selects instructions found anywhere in the call tree, not just the top level ones. d1-d8 filter by the starting bytes of the data (in 0x-prefixed hex format); a0-a15 filter by account at the corresponding position in the accounts array; mentionsAccount filters by account mentions anywhere in the list

transactions
object[]

Transaction data requests

balances
object[]

Requests for SOL balance updates

tokenBalances
object[]

Requests for token balance updates

rewards
object[]

Reward data requests

logs
object[]

Logs data requests. Read https://docs.soldexer.dev/api-reference/data-notes/logs-truncation before attempting to use logs

Response

A stream of blocks in JSON lines format, optionally gzipped. Can only 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
required
instructions
object[]
transactions
object[]
balances
object[]

Records of SOL balance updates done per transaction and account. Combines pre- and post-balance records, making one record per account

tokenBalances
object[]

Records of token balance updates done per transaction and token account. Uses data from https://solana.com/docs/rpc/json-structures#token-balances but combines pre- and post-balance records, making one record per token account

rewards
object[]
logs
object[]