evmgaspricer

package
v1.0.19 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2022 License: LGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const TwoAndTheHalfGwei = 2500000000 // Lowest MaxPriorityFee. Defined by some researches...

Variables

This section is empty.

Functions

This section is empty.

Types

type GasPriceClient

type GasPriceClient interface {
	SuggestGasPrice(ctx context.Context) (*big.Int, error)
}

type GasPricerOpts

type GasPricerOpts struct {
	UpperLimitFeePerGas *big.Int      // UpperLimitFeePerGas in Static and London gasPricer limits the maximum gas price that could be used. In London gasPricer if BaseFee > UpperLimitFeePerGas, then maxFeeCap will be BaseFee + 2.5 Gwei for MaxTipCap. If nil - not applied
	GasPriceFactor      *big.Float    // GasPriceFactor In static gasPricer multiplies final gasPrice. Could be for example 0.75 or 5.
	Args                []interface{} // Args is the array of dynamic typed args that could be used for other custom GasPricer implementations
}

GasPricerOpts is the structure that holds parameters that could be used to configure different gasPRicer implementation

type LondonGasClient

type LondonGasClient interface {
	GasPriceClient
	BaseFee() (*big.Int, error)
	SuggestGasTipCap(ctx context.Context) (*big.Int, error)
}

type LondonGasPriceDeterminant

type LondonGasPriceDeterminant struct {
	// contains filtered or unexported fields
}

func NewLondonGasPriceClient

func NewLondonGasPriceClient(client LondonGasClient, opts *GasPricerOpts) *LondonGasPriceDeterminant

func (*LondonGasPriceDeterminant) GasPrice

func (gasPricer *LondonGasPriceDeterminant) GasPrice(priority *uint8) ([]*big.Int, error)

func (*LondonGasPriceDeterminant) SetClient

func (gasPricer *LondonGasPriceDeterminant) SetClient(client LondonGasClient)

func (*LondonGasPriceDeterminant) SetOpts

func (gasPricer *LondonGasPriceDeterminant) SetOpts(opts *GasPricerOpts)

type StaticGasPriceDeterminant

type StaticGasPriceDeterminant struct {
	// contains filtered or unexported fields
}

StaticGasPriceDeterminant for when you want to always use generic `GasPrice()` method from an EVM client.

Client should implement `GasPrice()` to query first for a gas price field that is set on client construction This way a developer can use a specific gas price for transactions, such as in the CLI

Currently, if the client being used is created by the `EVMClientFromParams` constructor a constant gas price is then set and will be returned by this gas pricer

func NewStaticGasPriceDeterminant

func NewStaticGasPriceDeterminant(client GasPriceClient, opts *GasPricerOpts) *StaticGasPriceDeterminant

func (*StaticGasPriceDeterminant) GasPrice

func (gasPricer *StaticGasPriceDeterminant) GasPrice(priority *uint8) ([]*big.Int, error)

func (*StaticGasPriceDeterminant) SetClient

func (gasPricer *StaticGasPriceDeterminant) SetClient(client LondonGasClient)

func (*StaticGasPriceDeterminant) SetOpts

func (gasPricer *StaticGasPriceDeterminant) SetOpts(opts *GasPricerOpts)

Directories

Path Synopsis
Package mock_evmgaspricer is a generated GoMock package.
Package mock_evmgaspricer is a generated GoMock package.

Jump to

Keyboard shortcuts

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