Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace GasUtil

Index

Functions

  • calculateTimeEstimate(maxPriorityFeePerGas: string, maxFeePerGas: string, gasFeeEstimates: GasFeeEstimates): EstimatedGasFeeTimeBounds
  • Estimate the time it will take for a transaction to be confirmed.

    Parameters

    • maxPriorityFeePerGas: string

      The max priority fee per gas.

    • maxFeePerGas: string

      The max fee per gas.

    • gasFeeEstimates: GasFeeEstimates

      The gas fee estimates.

    Returns EstimatedGasFeeTimeBounds

    The estimated lower and upper bounds for when this transaction will be confirmed.

  • fetchEthGasPriceEstimate(ethQuery: any): Promise<EthGasPriceEstimate>
  • Get a gas price estimate from the network using the eth_gasPrice method.

    Parameters

    • ethQuery: any

      The EthQuery instance to call the network with.

    Returns Promise<EthGasPriceEstimate>

    A gas price estimate.

  • fetchGasEstimates(url: string, clientId?: string): Promise<GasFeeEstimates>
  • Fetch gas estimates from the given URL.

    Parameters

    • url: string

      The gas estimate URL.

    • Optional clientId: string

      The client ID used to identify to the API who is asking for estimates.

    Returns Promise<GasFeeEstimates>

    The gas estimates.

  • fetchLegacyGasPriceEstimates(url: string, clientId?: string): Promise<LegacyGasPriceEstimate>
  • Hit the legacy MetaSwaps gasPrices estimate api and return the low, medium high values from that API.

    Parameters

    • url: string

      The URL to fetch gas price estimates from.

    • Optional clientId: string

      The client ID used to identify to the API who is asking for estimates.

    Returns Promise<LegacyGasPriceEstimate>

    The gas price estimates.

  • normalizeGWEIDecimalNumbers(n: string | number): any
  • Convert a decimal GWEI value to a decimal string rounded to the nearest WEI.

    Parameters

    • n: string | number

      The input GWEI amount, as a decimal string or a number.

    Returns any

    The decimal string GWEI amount.

Generated using TypeDoc