Gas Price from network for solana accounts

Get Gas Price info from network for solana accounts

POSThttps://api.1inch.com/gas-price/v1.6/{chainId}/accounts
Supported on:
EthereumBaseSolanaBNB ChainOptimismPolygonLineaSonicUnichainRobinhoodArbitrumAvalancheCronosZKsyncGnosisHyperEVMArcMonad

Parameters

chainId
* number path

Request Body

GetGasPriceForAccountsRequest object
accounts
* array
items
string
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
const axios = require('axios');

async function httpCall() {
  const url = 'https://api.1inch.com/gas-price/v1.6/{chainId}/accounts';

  const config = {
    headers: {
      Authorization: `Bearer ${API_KEY}`,
    },
    params: {},
    paramsSerializer: {
      indexes: null,
    },
  };
  const body = {
    accounts: ['HyZ2nPL19eGRN8fGYbG5sMaWQMJpoQCGgvqr2znYKyPm'],
  };

  try {
    const response = await axios.post(url, body, config);
    console.log(response.data);
  } catch (error) {
    console.error(error);
  }
}

Returns

SolanaGasPriceResponse object
baseFee
* string
lowPriority
* string
highPriority
* string
instantPriority
* string
JSON
1
2
3
4
5
6
7
{
  "baseFee": "string",
  "lowPriority": "string",
  "highPriority": "string",
  "instantPriority": "string"
}

Did you find what you need?