GET
/
v1
/
chains
/
{chainId}
/
blocks
/
{blockId}
import { AvaCloudSDK } from "@avalabs/avacloud-sdk";

const avaCloudSDK = new AvaCloudSDK({
  serverURL: "https://api.example.com",
  chainId: "43114",
  network: "mainnet",
});

async function run() {
  const result = await avaCloudSDK.data.evm.blocks.get({
    chainId: "43114",
    blockId: "0x17533aeb5193378b9ff441d61728e7a2ebaf10f61fd5310759451627dfca2e7c",
  });

  // Handle the result
  console.log(result);
}

run();
{
  "chainId": "43114",
  "blockNumber": "339",
  "blockTimestamp": 1648672486,
  "blockHash": "0x17533aeb5193378b9ff441d61728e7a2ebaf10f61fd5310759451627dfca2e7c",
  "txCount": 123,
  "baseFee": "<string>",
  "gasUsed": "<string>",
  "gasLimit": "<string>",
  "gasCost": "<string>",
  "parentHash": "<string>",
  "feesSpent": "<string>",
  "cumulativeTransactions": "<string>"
}

Authorizations

x-glacier-api-key
string
header
required

Api keys provide higher access to rate limits. To obtain an api key, sign up for an account at https://avacloud.io/.

Path Parameters

chainId
string
required

A supported evm chain id or blockchain id. Use the /chains endpoint to get a list of supported chain ids.

blockId
string
required

A block identifier which is either a block number or the block hash.

Response

200
application/json

Successful response

The response is of type object.