gasprice

package
v0.0.0-...-59e56fa Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Blocks     int
	Percentile int
	Default    *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 oracle.

func (*Oracle) SuggestPrice

func (gpo *Oracle) SuggestPrice(ctx context.Context) (*big.Int, error)

SuggestPrice returns the recommended gas price.

type Reader

type Reader interface {
	HeaderByNumber(ctx context.Context, number rpc.BlockNumber) (*evmcore.EvmHeader, error)
	BlockByNumber(ctx context.Context, number rpc.BlockNumber) (*evmcore.EvmBlock, error)
	ChainConfig() *params.ChainConfig
}

Jump to

Keyboard shortcuts

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