UNPKG

rubic-sdk

Version:
35 lines (34 loc) 1.14 kB
import BigNumber from 'bignumber.js'; import { EvmBlockchainName } from "../blockchain/models/blockchain-name"; import { HttpClient } from "../http-client/models/http-client"; /** * Uses different api or web3 to retrieve current gas price. */ export declare class GasPriceApi { private readonly httpClient; /** * Gas price request interval in seconds. */ private static readonly requestInterval; constructor(httpClient: HttpClient); /** * Gets gas price in Wei for selected blockchain. * @param blockchain Blockchain to get gas price from. */ getGasPrice(blockchain: EvmBlockchainName): Promise<string>; /** * Gets gas price in Eth units for selected blockchain. * @param blockchain Blockchain to get gas price from. */ getGasPriceInEthUnits(blockchain: EvmBlockchainName): Promise<BigNumber>; /** * Gets Ethereum gas price from different APIs, sorted by priority. * @returns Average gas price in Wei. */ private fetchEthGas; /** * Gets gas price from web3. * @returns Average gas price in Wei. */ private fetchGas; }