gasprice

package
v1.9.25-zilion-0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2021 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() zilionixx.Rules
	GetPendingRules() zilionixx.Rules
}

Jump to

Keyboard shortcuts

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