gasprice

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2021 License: GPL-3.0 Imports: 10 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 ethapi.Backend, 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 RollupOracle

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

RollupOracle holds the L1 and L2 gas prices for fee calculation

func NewRollupOracle

func NewRollupOracle(l1GasPrice *big.Int, l2GasPrice *big.Int) *RollupOracle

NewRollupOracle returns an initialized RollupOracle

func (*RollupOracle) SetL1GasPrice

func (gpo *RollupOracle) SetL1GasPrice(gasPrice *big.Int) error

SetL1GasPrice returns the current L1 gas price

func (*RollupOracle) SetL2GasPrice

func (gpo *RollupOracle) SetL2GasPrice(gasPrice *big.Int) error

SetL2GasPrice returns the current L2 gas price

func (*RollupOracle) SuggestL1GasPrice

func (gpo *RollupOracle) SuggestL1GasPrice(ctx context.Context) (*big.Int, error)

SuggestL1GasPrice returns the gas price which should be charged per byte of published data by the sequencer.

func (*RollupOracle) SuggestL2GasPrice

func (gpo *RollupOracle) SuggestL2GasPrice(ctx context.Context) (*big.Int, error)

SuggestL2GasPrice returns the gas price which should be charged per unit of gas set manually by the sequencer depending on congestion

Jump to

Keyboard shortcuts

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