gasprice

package
v1.1.0-rc.4 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2022 License: MIT Imports: 10 Imported by: 1

Documentation

Index

Constants

View Source
const DecimalUnit = piecefunc.DecimalUnit

Variables

View Source
var DecimalUnitBn = big.NewInt(DecimalUnit)
View Source
var DefaultMaxTipCap = big.NewInt(100000 * params.GWei)

Functions

This section is empty.

Types

type Config

type Config struct {
	MaxTipCap                   *big.Int `toml:",omitempty"`
	MinTipCap                   *big.Int `toml:",omitempty"`
	MaxTipCapMultiplierRatio    *big.Int `toml:",omitempty"`
	MiddleTipCapMultiplierRatio *big.Int `toml:",omitempty"`
	GasPowerWallRatio           *big.Int `toml:",omitempty"`
}

type Oracle

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

Oracle recommends gas prices based on the content of recent blocks. Suitable for both light and full clients.

func NewOracle

func NewOracle(backend Reader, params Config) *Oracle

NewOracle returns a new gasprice oracle which can recommend suitable gasprice for newly created transaction.

func (*Oracle) SuggestTipCap

func (gpo *Oracle) SuggestTipCap() *big.Int

SuggestTipCap returns a tip cap so that newly created transaction can have a very high chance to be included in the following blocks.

Note, for legacy transactions and the legacy eth_gasPrice RPC call, it will be necessary to add the basefee to the returned number to fall back to the legacy behavior.

type Reader

type Reader interface {
	GetLatestBlockIndex() idx.Block
	TotalGasPowerLeft() uint64
	GetRules() opera.Rules
	GetPendingRules() opera.Rules
}

Jump to

Keyboard shortcuts

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