import { Avalanche } from "@avalanche-sdk/chainkit";
const avalanche = new Avalanche();
async function run() {
const result = await avalanche.data.evm.blocks.listLatestAllChains({
pageSize: 10,
network: "mainnet",
});
for await (const page of result) {
console.log(page);
}
}
run();{
"blocks": [
{
"chainId": "<string>",
"blockNumber": "<string>",
"blockTimestamp": 123,
"blockHash": "<string>",
"txCount": 123,
"baseFee": "<string>",
"gasUsed": "<string>",
"gasLimit": "<string>",
"gasCost": "<string>",
"parentHash": "<string>",
"feesSpent": "<string>",
"cumulativeTransactions": "<string>"
}
],
"nextPageToken": "<string>"
}Lists the most recent blocks from all supported EVM-compatible chains. The results can be filtered by network.
import { Avalanche } from "@avalanche-sdk/chainkit";
const avalanche = new Avalanche();
async function run() {
const result = await avalanche.data.evm.blocks.listLatestAllChains({
pageSize: 10,
network: "mainnet",
});
for await (const page of result) {
console.log(page);
}
}
run();{
"blocks": [
{
"chainId": "<string>",
"blockNumber": "<string>",
"blockTimestamp": 123,
"blockHash": "<string>",
"txCount": 123,
"baseFee": "<string>",
"gasUsed": "<string>",
"gasLimit": "<string>",
"gasCost": "<string>",
"parentHash": "<string>",
"feesSpent": "<string>",
"cumulativeTransactions": "<string>"
}
],
"nextPageToken": "<string>"
}Api keys provide higher access to rate limits. To obtain an api key, sign up for an account at https://avacloud.io/.
A page token, received from a previous list call. Provide this to retrieve the subsequent page.
The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100.
1 <= x <= 100Either mainnet or testnet/fuji.
mainnet, fuji, testnet Was this page helpful?