Blocks
This component of the REST API allows one to query information about Blocks and Hyperblocks.
GET Get Hyperblock by Nonce
https://gateway.multiversx.com/hyperblock/by-nonce/:nonce
This endpoint allows one to query a Hyperblock by its nonce.
- Request
- Response
Path Parameters
Param | Required | Type | Description |
---|---|---|---|
nonce | REQUIRED | number | The Block nonce (height). |
🟢 200: OK
Block details retrieved successfully.
{
"hyperblock": {
"nonce": 185833,
"round": 186582,
"hash": "6a33...",
"prevBlockHash": "aa7e...",
"epoch": 12,
"numTxs": 1,
"shardBlocks": [
{
"hash": "cba4...",
"nonce": 186556,
"shard": 0
},
{
"hash": "50a16...",
"nonce": 186535,
"shard": 1
},
{
"hash": "7981...",
"nonce": 186536,
"shard": 2
}
],
"transactions": [
{
"type": "normal",
"hash": "b035...",
"nonce": 3,
"value": "1000000000000000000",
"receiver": "erd1...",
"sender": "erd1...",
"gasPrice": 1000000000,
"gasLimit": 70000,
"data": "Zm9yIHRlc3Rz",
"signature": "1047...",
"status": "executed"
}
]
}
}
This endpoint is only defined by the Proxy. The Observer does not expose this endpoint.
A Hyperblock is a block-like abstraction that reunites the data from all shards, and contains only fully-executed transactions (that is, transactions executed both in source and in destination shard).
A hyperblock is composed using a metablock as a starting point - therefore, the nonce
or hash
of a hyperblock is the same as the nonce
or hash
of the base metablock.
GET Get Hyperblock by Hash
https://gateway.multiversx.com/hyperblock/by-hash/:hash
This endpoint allows one to query a Hyperblock by its hash.
- Request
- Response
Path Parameters
Param | Required | Type | Description |
---|---|---|---|
hash | OPTIONAL | string | The Block hash. |
🟢 200: OK
{
"hyperblock": {
"nonce": 185833,
"round": 186582,
"hash": "6a33...",
"prevBlockHash": "aa7e...",
"epoch": 12,
"numTxs": 1,
"shardBlocks": [
{
"hash": "cba4...",
"nonce": 186556,
"shard": 0
},
{
"hash": "50a16...",
"nonce": 186535,
"shard": 1
},
{
"hash": "7981...",
"nonce": 186536,
"shard": 2
}
],
"transactions": [
{
"type": "normal",
"hash": "b035...",
"nonce": 3,
"value": "1000000000000000000",
"receiver": "erd1...",
"sender": "erd1...",
"gasPrice": 1000000000,
"gasLimit": 70000,
"data": "Zm9yIHRlc3Rz",
"signature": "1047...",
"status": "executed"
}
]
}
}
This endpoint is only is only defined by the Proxy. The Observer does not expose this endpoint.
GET Get Block by Nonce
https://gateway.multiversx.com/block/:shard/by-nonce/:nonce
This endpoint allows one to query a Shard Block by its nonce (or height).
- Request
- Response
Path Parameters
Param | Required | Type | Description |
---|---|---|---|
shard | OPTIONAL | number | The Shard. |
nonce | REQUIRED | number | The Block nonce (height). |
Query Parameters
Param | Required | Type | Description |
---|---|---|---|
withTxs | OPTIONAL | boolean | Whether to include the transactions in the response. |
🟢 200: OK
Block retrieved successfully, with transactions included.
{
"data": {
"block": {
"nonce": 186532,
"round": 186576,
"hash": "7aa3...",
"prevBlockHash": "2580...",
"epoch": 12,
"shard": 2,
"numTxs": 1,
"miniBlocks": [
{
"hash": "e927...",
"type": "TxBlock",
"sourceShard": 2,
"destinationShard": 1,
"transactions": [
{
"type": "normal",
"hash": "b035...",
"nonce": 3,
"value": "1000000000000000000",
"receiver": "erd1...",
"sender": "erd1...",
"gasPrice": 1000000000,
"gasLimit": 70000,
"data": "Zm9yIHRlc3Rz",
"signature": "1047...",
"status": "partially-executed"
}
]
}
]
}
},
"error": "",
"code": "successful"
}
For Observers, the shard
parameter should not be set.
GET Get Block by Hash
https://gateway.multiversx.com/block/:shard/by-hash/:hash
This endpoint allows one to query a Shard Block by its hash.
- Request
- Response
Path Parameters
Param | Required | Type | Description |
---|---|---|---|
shard | OPTIONAL | number | The Shard. |
hash | REQUIRED | string | The Block hash. |
Query Parameters
Param | Required | Type | Description |
---|---|---|---|
withTxs | OPTIONAL | boolean | Whether to include the transactions in the response. |
🟢 200: OK
Block retrieved successfully, with transactions included.
{
"data": {
"block": {
"nonce": 186532,
"round": 186576,
"hash": "7aa3...",
"prevBlockHash": "2580...",
"epoch": 12,
"shard": 2,
"numTxs": 1,
"miniBlocks": [
{
"hash": "e927...",
"type": "TxBlock",
"sourceShard": 2,
"destinationShard": 1,
"transactions": [
{
"type": "normal",
"hash": "b035...",
"nonce": 3,
"value": "1000000000000000000",
"receiver": "erd1...",
"sender": "erd1...",
"gasPrice": 1000000000,
"gasLimit": 70000,
"data": "Zm9yIHRlc3Rz",
"signature": "1047...",
"status": "partially-executed"
}
]
}
]
}
},
"error": "",
"code": "successful"
}
For Observers, the shard
parameter should not be set.