getBlock

Returns identity and transaction information about a confirmed block in the ledger

getBlock

POST http://srpc.solapi.pro/?api_key=<api-key>

Request:

const response = await fetch('http://srpc.solapi.pro/?api_key=<api-key>', {
    method: 'POST',
    headers: {
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "jsonrpc": "2.0",
      "id": "1",
      "method": "getBlock",
      "params": [
        430
      ]
    }),
});
const data = await response.json();

Response:

{
  "jsonrpc": "2.0",
  "id": "text",
  "result": {
    "blockhash": "3Eq21vXNB5s86c62bVuUfTeaMif1N2kUqRPBmGRJhyTA",
    "previousBlockhash": "mfcyqEXB3DnHXki6KjjmZck6YjmZLvpAByy2fj4nh6B",
    "parentSlot": 429,
    "transactions": [
      {
        "meta": {
          "fee": 5000,
          "preBalances": [
            0
          ],
          "postBalances": [
            0
          ],
          "rewards": [
            {
              "pubkey": "text",
              "lamports": 0,
              "rewardType": "text"
            }
          ]
        }
      }
    ],
    "blockTime": null,
    "blockHeight": 428
  }
}

Last updated