getBlock
Returns identity and transaction information about a confirmed block in the ledger.
https://api.1inch.com/web3/501
Supported on: Solana
Request
Request
object jsonrpc
* string (Enum)JSON-RPC version
2.0
method
* string The method to call
params
array Method parameters
items
any id
* number Request ID
JavaScript
Copy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
const response = await fetch('https://api.1inch.com/web3/501', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer ${API_KEY}`,
},
body: JSON.stringify({
jsonrpc: '2.0',
method: 'getBlock',
params: [],
id: 1,
}),
});
const data = await response.json();
console.log(data);
Response
Block Response
Block Response
any oneOf[0]
null oneOf[1]
object blockHeight
any oneOf[0]
null oneOf[1]
integer The number of blocks beneath this block
blockTime
any oneOf[0]
null oneOf[1]
integer Estimated production time as Unix timestamp
blockhash
* string The blockhash of this block as a base-58 encoded string
parentSlot
* integer The slot index of this block's parent
previousBlockhash
* string The blockhash of this block's parent as a base-58 encoded string
transactions
* array Present if "full" transaction details are requested
items
object meta
* object Transaction status metadata object
transaction
* object Transaction object, either in JSON format or encoded binary data
additionalProperties
none additionalProperties
none JSON
Copy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
{
"blockHeight": 428,
"blockTime": null,
"blockhash": "3Eq21vXNB5s86c62bVuUfTeaMif1N2kUqRPBmGRJhyTA",
"parentSlot": 429,
"previousBlockhash": "mfcyqEXB3DnHXki6KjjmZck6YjmZLvpAByy2fj4nh6B",
"transactions": [
{
"meta": {},
"transaction": {}
}
]
}