gasprice

package
v0.0.0-...-f498596 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MinPrice = getDefaultGasPrice()
	MaxPrice = new(big.Int).Mul(MinPrice, big.NewInt(5000))
)

Functions

This section is empty.

Types

type GPOConfig

type GPOConfig struct {
	Weight  int
	Default *big.Int `toml:",omitempty"`
	Blocks  int
}

func NewGPOConfig

func NewGPOConfig(weight int, checkBlocks int) GPOConfig

type Oracle

type Oracle struct {
	CurrentBlockGPs *types.SingleBlockGPs
	// hold the gas prices of the latest few blocks
	BlockGPQueue *types.BlockGPResults
	// contains filtered or unexported fields
}

Oracle recommends gas prices based on the content of recent blocks.

func NewOracle

func NewOracle(params GPOConfig) *Oracle

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

func (*Oracle) RecommendGP

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

Jump to

Keyboard shortcuts

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