gas

package
v0.5.15 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2022 License: GPL-3.0 Imports: 2 Imported by: 2

Documentation

Overview

Package gas defines the Gas API. All chains that support transactions (either account-based or utxo-based) should implement this API. This API is used to understand the current recommended gas costs required to get confirmations in a reasonable amount of time.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Estimator

type Estimator interface {

	// In Ethereum without EIP-1559, the gas price (and gas cap) would be the
	// recommended GWEI-per-gas required to get a transaction into one of the
	// next few blocks (because blocks happen a lot faster). In Ethereum with
	// EIP1559, the gas price and gas cap would be back calculated given the gas
	// cap and an estimate of the current gas base.
	//
	// The assumption is that the total gas cost will be gasLimit * gasPrice <
	// gasLimit * gasCap. If chain nodes give back values based on different
	// assumptions, then the values must be normalised as needed.
	EstimateGas(context.Context) (gasPrice, gasCap pack.U256, err error)
}

The Estimator interface defines the functionality required to know the current recommended gas price per gas unit and gas cap per gas unit. Not all chains have the concept of a gas cap, in which case it should be set to be equal to the gas price.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL