gasprice

package
v0.0.0-...-ed08616 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrBadTargets = errors.New("targets is invalid")
View Source
var ErrNoSample = errors.New("no sample to estimate")

Functions

This section is empty.

Types

type Estimator

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

func NewEstimator

func NewEstimator(
	ctx context.Context,
	tracker Tracker,
	sampler Sampler,
	skip int,
	history int,
	targets []Target,
) (*Estimator, error)

func (*Estimator) GasPrices

func (e *Estimator) GasPrices(ctx context.Context) ([]*big.Int, error)

type MinimumSampler

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

func NewMinimumSampler

func NewMinimumSampler(provider Provider, size int, minPrice *big.Int) (*MinimumSampler, error)

type PollingTracker

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

func NewPollingTracker

func NewPollingTracker(ctx context.Context, provider Provider) *PollingTracker

type Provider

type Provider interface {
	HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error)
	BlockByHash(ctx context.Context, hash common.Hash) (*types.Block, error)
	SubscribeNewHead(ctx context.Context, ch chan<- *types.Header) (ethereum.Subscription, error)
}

type Sample

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

type Sampler

type Sampler interface {
	// contains filtered or unexported methods
}

type SubscribedTracker

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

func NewSubscribedTracker

func NewSubscribedTracker(ctx context.Context, provider Provider) (*SubscribedTracker, error)

type Target

type Target struct {
	Start float64
	End   float64
}

type Tracker

type Tracker interface {
	// contains filtered or unexported methods
}

Jump to

Keyboard shortcuts

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