GET
/
v1
/
{chainName}
/
event
/
{eventType}
/
gas_prices
import { GoldRushClient } from "@covalenthq/client-sdk";

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

ApiServices();
{
  "chain_id": 123,
  "chain_name": "<string>",
  "quote_currency": "<string>",
  "updated_at": "2023-11-07T05:31:56Z",
  "event_type": "<string>",
  "gas_quote_rate": 123,
  "base_fee": "<string>",
  "items": [
    {
      "gas_price": "<string>",
      "gas_spent": "<string>",
      "gas_quote": 123,
      "other_fees": {
        "l_1_gas_quote": 123
      },
      "total_gas_quote": 123,
      "pretty_total_gas_quote": "<string>",
      "interval": "<string>"
    }
  ]
}
Credit Cost: 1 per call.
Processing: Batch

Currently support these event types: erc20 token transfers, nativetokens transfer, and uniswapv3 swap events.

Path Parameters

chainName
string
required

The chain name eg: eth-mainnet.

eventType
string
required

The desired event type to retrieve gas prices for. Supports erc20 transfer events, uniswapv3 swap events and nativetokens transfers.

Query Parameters

quote-currency
string

The currency to convert. Supports USD, CAD, EUR, SGD, INR, JPY, VND, CNY, KRW, RUB, TRY, NGN, ARS, AUD, CHF, and GBP.

Response

200 - application/json
Successful response
chain_id
integer

The requested chain ID eg: 1.

chain_name
string

The requested chain name eg: eth-mainnet.

quote_currency
string

The requested quote currency eg: USD.

updated_at
string

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

event_type
string

The requested event type.

gas_quote_rate
number

The exchange rate for the requested quote currency.

base_fee
string

b;The lowest gas fee for the latest block height.

items
object[]

List of response items.