Blocks
Chain coverage:
getBlockHeight,getBlockByNumber,getBlockByHash, andgetBlockTransactionsare dispatched through a shared service layer that supports EVM chains, Solana, Bitcoin, Starknet, and the Cosmos SDK chains (cosmoshub,osmosis,axelar,noble,agoric). On Cosmos chains, block transactions are decoded from the LCDtxs/block/{n}endpoint (Cosmos SDK 0.50+).
getBlockHeight
Returns the latest block number for EVM/Bitcoin or slot for Solana.
curl -X POST https://your-endpoint.simplystaking.xyz/v1 \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "getBlockHeight",
"params": {
"chain": "ethereum"
},
"id": 1
}'import { Spectrum } from '@spectrumnodes/sdk';
const spectrum = new Spectrum({ api: 'https://your-endpoint.simplystaking.xyz/YOUR_API_KEY/' });
const result = await spectrum.core.getBlockHeight('ethereum');
console.log(result);{
"jsonrpc": "2.0",
"result": {
"data": {
"chain": "0x1",
"height": 24535031
}
},
"id": 1
}Parameters
| Name | Required | Description |
|---|---|---|
| chain | yes | Network slug |
Response Fields
| Field | Type |
|---|---|
data | object |
chain | string |
height | integer |
Supported Networks
getBlockTransactions
Returns all transactions in a specific block. On EVM the response includes full transaction objects (from, to, value, input data, gas). On Starknet the transactions come from `starknet_getBlockWithTxs`. On Cosmos SDK chains they are decoded from the LCD `txs/block/{n}` endpoint (sdk 0.50+).
curl -X POST https://your-endpoint.simplystaking.xyz/v1 \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "getBlockTransactions",
"params": {
"chain": "ethereum",
"blockNumber": 21000000
},
"id": 1
}'import { Spectrum } from '@spectrumnodes/sdk';
const spectrum = new Spectrum({ api: 'https://your-endpoint.simplystaking.xyz/YOUR_API_KEY/' });
const result = await spectrum.core.getBlockTransactions('ethereum', 21000000);
console.log(result);{
"jsonrpc": "2.0",
"result": {
"data": {
"blockNumber": 21000000,
"hash": "0xabc123...",
"timestamp": 1700000000,
"transactionCount": 142,
"transactions": [
{
"hash": "0x...",
"from": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"to": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"value": "0x0",
"gasPrice": "0x1234"
}
]
}
},
"id": 1
}Parameters
| Name | Required | Description |
|---|---|---|
| chain | yes | Network slug |
| blockNumber | yes | Block number to fetch transactions from e.g. 21000000 |
Response Fields
| Field | Type |
|---|---|
data | object |
blockNumber | integer |
hash | string |
timestamp | integer |
transactionCount | integer |
transactions | object[] |
hash | string |
from | string |
to | string |
value | string |
gasPrice | string |
Supported Networks
getBlockByNumber
Get blocks by number from multiple chains in a single call. Pass chain:blockNumber pairs. Supports EVM chains, Solana, and Bitcoin in the same batch. Bitcoin returns Bitcoin Core's `getblock` payload (the `confirmations` field drifts as new tip blocks arrive).
curl -X POST https://your-endpoint.simplystaking.xyz/v1 \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "getBlockByNumber",
"params": [
{
"chain": "ethereum",
"block": 21000000
},
{
"chain": "bitcoin",
"block": 900000
}
],
"id": 1
}'{
"jsonrpc": "2.0",
"result": {
"data": {
"count": 2,
"results": [
{
"chain": "ethereum",
"height": "21000000",
"block": {
"number": "0x1406f40",
"hash": "0xabc..."
}
},
{
"chain": "bitcoin",
"height": "900000",
"block": {
"hash": "000000000000000000010538edbfd2d5b809a33dd83f284aeea41c6d0d96968a",
"height": 900000,
"confirmations": 50260,
"merkleroot": "0cfb54e522b07bd1a381adc774ec1851590ef4c3add83958135106534569f970",
"previousblockhash": "0000000000000000000196400396be46d0816dc462df4c3450972f589f4d7d24",
"nTx": 1562,
"size": 1920777,
"weight": 3130335
}
}
]
}
},
"id": 1
}Parameters
| Name | Required | Description |
|---|---|---|
| items | yes | Comma-separated chain:blockNumber pairs (EVM/Solana/Bitcoin) e.g. ethereum:21000000,bitcoin:900000 |
Response Fields
| Field | Type |
|---|---|
data | object |
count | integer |
results | object[] |
chain | string |
height | string |
block | object |
number | string |
hash | string |
getBlockByHash
Get blocks by hash from multiple chains in a single call. Pass chain:blockHash pairs.
curl -X POST https://your-endpoint.simplystaking.xyz/v1 \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "getBlockByHash",
"params": [
{
"chain": "ethereum",
"hash": "0x4e3a3754410177e6937ef1f84bba68ea139e8d1a2258c5f85db9f1cd715a1bdd"
}
],
"id": 1
}'{
"jsonrpc": "2.0",
"result": {
"data": {
"count": 1,
"results": [
{
"chain": "ethereum",
"hash": "0x4e3a3754410177e6937ef1f84bba68ea139e8d1a2258c5f85db9f1cd715a1bdd",
"block": {
"number": "0x1406f40"
}
}
]
}
},
"id": 1
}Parameters
| Name | Required | Description |
|---|---|---|
| items | yes | Comma-separated chain:blockHash pairs e.g. ethereum:0x4e3a3754410177e6937ef1f84bba68ea139e8d1a2258c5f85db9f1cd715a1bdd |
Response Fields
| Field | Type |
|---|---|
data | object |
count | integer |
results | object[] |
chain | string |
hash | string |
block | object |
number | string |