Links
Comment on page

platform.getBlock

Get a block by its ID.

Signature​​

platform.getBlock({
blockID: string
encoding: string // optional
}) -> {
block: string,
encoding: string
}

Request

  • blockID is the block ID. It should be in cb58 format.
  • encoding is the encoding format to use. Can be either cb58, hex, or json. Defaults to cb58.

Response

  • block is the transaction encoded to encoding.
  • encoding is the encoding.

Example

Request
curl -X POST --data '{
"jsonrpc": "2.0",
"method": "platform.getBlock",
"params": {
"blockID": "d7WYmb8VeZNHsny3EJCwMm6QA37s1EHwMxw1Y71V3FqPZ5EFG",
"encoding": "cb58"
},
"id": 1
}' -H 'content-type:application/json;' https://ava-mainnet.blastapi.io/<project-id>/ext/P
Result
{
"jsonrpc": "2.0",
"result": {
"block": "11111BwoDGdFYQfsbfJ35VKjMP6z5dtggBJqFay7KN33GdqpU8ZFAvaSVegwfADYFipsCpTft27TA8h99krBjsMvFZ5TgFYrQCNN2DkyXQSVuGadYh8UhZ6Ptp3HwVYvXWHaDwjt3mEs9fkoS5JiTDfrrp3w6ws2LTksv3LGtb66iWjWgnHU46WgY2wVqnwrit2x7mYGTgJpXeziLCY66Hnnu1jAy5hYhK2Ek37XhvBcd1UeTcPAFsEtFdLr8Ku19K2dYYNvvuz7YnJjuqxUjtNoC61UcKrtTyJCqRuyA85NRFD7ZYVKwSd13CevyZWuBiBWZkukUpLhJwTcWnFnzbntKDCMdip4kAtQueDkjYnrXu2AWS3SXiJTSmZm55iwn4iE9sqBs6Rj1CnrakGi7sCcXg1UyYu5scmb5RVDKDtZPNLr5Vb6oTWaM4egHfwgT98koZ28rSw8otJfv4q1BH9vrS4N7pUJxh9grnksG9TQDtjBjD9tmhxC8iSLYTwGNxitAqjZd7SGE9",
"encoding": "cb58"
},
"id": 1
}