next_light_client_block - NEAR Protocol

Returns the next light-client block after the given known block hash — the data a light client needs to advance and verify the chain without a full node.

Method

next_light_client_block

Parameters

The params object carries:

ParameterExampleDescription
last_block_hash"9MzuZ...lastknownhash"—

Example

bashexport NEAR_RPC=https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/

curl -X POST "${NEAR_RPC}" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc": "2.0", "id": "getblock.io", "method": "next_light_client_block", "params": {"last_block_hash": "9MzuZ...lastknownhash"}}'

Response

json{
    "prev_block_hash": "9MzuZ...",
    "next_block_inner_hash": "7Ab...",
    "inner_lite": {
        "height": 152000050,
        "epoch_id": "8Lk...",
        "timestamp": "1780000000000000000"
    },
    "next_bps": [],
    "approvals_after_next": []
}

Response Fields

FieldTypeDescription
inner_liteobjectThe compact header (height, epoch, timestamp, next-validator hash)
next_bpsarrayThe next block producers, when the epoch changes
approvals_after_nextarrayValidator approvals used to verify the block

Use Cases

  • Light clients: Advance a light client to the next verifiable block
  • Bridges: Supply headers to a trustless NEAR light-client bridge

Error Handling

ErrorMessageDescription
-32700 / Parse errorParse errorThe JSON request was malformed
-32601 / Method not foundMethod not foundThe method is unknown or disabled on this node version
HANDLER_ERRORRequested data not foundThe account, block, chunk, or transaction does not exist or is garbage-collected (use an archival node)
403 / RBAC: access deniedAccess deniedThe GetBlock access token is missing or incorrect