forecast

package
v0.0.0-...-91a82d4 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2019 License: LGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = &Config{
	BlockNum: 20,
	Percent:  260,
	GasPrice: big.NewInt(18 * 1e9),
}

Functions

This section is empty.

Types

type Config

type Config struct {
	BlockNum int // the number of block
	Percent  int
	GasPrice *big.Int
}

type Forecast

type Forecast struct {
	// contains filtered or unexported fields
}

Forecast gas prices based on the content of recent blocks.

func NewForecast

func NewForecast(f GetBlock, cfg *Config) *Forecast

NewForecast returns a new Forecast.

func (*Forecast) SuggestPrice

func (gpf *Forecast) SuggestPrice(ctx context.Context) (*big.Int, error)

SuggestPrice returns the recommended gas price.

type GetBlock

type GetBlock func(ctx context.Context, height rpcapi.BlockHeight) (*types.Block, error)

Jump to

Keyboard shortcuts

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