Gas Price from network for solana accounts

Get Gas Price info from network for solana accounts

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

Parameters

chain
* 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/{chain}/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

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

Did you find what you need?