gasprice

package
v2.2.26+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2019 License: GPL-3.0 Imports: 8 Imported by: 32

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Default = new(big.Int).SetUint64(2 * params.Shannon)
)

Functions

This section is empty.

Types

type Backend

type Backend interface {
	HeaderByNumber(ctx context.Context, blockNr rpc.BlockNumber) (*types.Header, error)
	BlockByNumber(ctx context.Context, blockNr rpc.BlockNumber) (*types.Block, error)
	ChainConfig() *params.ChainConfig
}

Backend is a subset of the methods from the interface ethapi.Backend.

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 Backend, cfg 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.

Jump to

Keyboard shortcuts

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