GET
/
v1
/
{chainName}
/
block_v2
/
{blockHeight}
import { GoldRushClient } from "@covalenthq/client-sdk";

const ApiServices = async () => {
    const client = new GoldRushClient("YOUR_API_KEY");
    const resp = await client.BaseService.getBlock({chainName: "chainName", walletAddress: "walletAddress"});
    console.log(resp.data);
};

ApiServices();
{
  "updated_at": "2023-11-07T05:31:56Z",
  "chain_id": 123,
  "chain_name": "<string>",
  "items": [
    {
      "block_hash": "<string>",
      "signed_at": "2023-11-07T05:31:56Z",
      "height": 123,
      "block_parent_hash": "<string>",
      "extra_data": "<string>",
      "miner_address": "<string>",
      "mining_cost": 123,
      "gas_used": 123,
      "gas_limit": 123,
      "transactions_link": "<string>"
    }
  ]
}
Credit Cost: 1 per call.
Processing: Realtime

Path Parameters

chainName
string
required

The chain name eg: eth-mainnet.

blockHeight
string
required

The block height or latest for the latest block available.

Response

200 - application/json
Successful response
updated_at
string

The timestamp when the response was generated. Useful to show data staleness to users.

chain_id
integer

The requested chain ID eg: 1.

chain_name
string

The requested chain name eg: eth-mainnet.

items
object[]

List of response items.