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

const ApiServices = async () => {
    const client = new GoldRushClient("YOUR_API_KEY");
    const resp = await client.BaseService.getBlockHeights({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>"
    }
  ],
  "pagination": {
    "has_more": true,
    "page_number": 123,
    "page_size": 123,
    "total_count": 123
  }
}
Credit Cost: 1 per call.
Processing: Realtime

Path Parameters

chainName
string
required

The chain name eg: eth-mainnet.

startDate
string
required

The start date in YYYY-MM-DD format.

endDate
string
required

The end date in YYYY-MM-DD format or latest for the latest block available.

Query Parameters

page-size
integer

Number of items per page. Omitting this parameter defaults to 100.

page-number
integer

0-indexed page number to begin pagination.

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.

pagination
object

Pagination metadata.