gasprice

package
v0.0.0-...-2cf946a Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const DecimalUnit = piecefunc.DecimalUnit

Variables

View Source
var DecimalUnitBn = big.NewInt(DecimalUnit)
View Source
var DefaultMaxPrice = big.NewInt(1000000 * params.GWei)

Functions

This section is empty.

Types

type Config

type Config struct {
	MaxPrice                   *big.Int `toml:",omitempty"`
	MinPrice                   *big.Int `toml:",omitempty"`
	MaxPriceMultiplierRatio    *big.Int `toml:",omitempty"`
	MiddlePriceMultiplierRatio *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) SuggestPrice

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

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

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