Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var (
ErrNoSuitableTransactions = errors.New("no suitable transactions")
)
Functions ¶
func HexToInt64 ¶
func HexToInt64(input interface{}) int64
HexToInt64 performs the inverse of Int64ToHex Returns 0 on invalid input
func Int64ToHex ¶
Int64ToHex converts an int64 into go-ethereum's hex representation
Types ¶
type Block ¶
type Block struct { Number int64 Hash common.Hash ParentHash common.Hash Transactions []Transaction }
Block represents an ethereum block This type is only used for the gas updater, and can be expensive to unmarshal. Don't add unnecessary fields here.
func (Block) MarshalJSON ¶
MarshalJSON implements json marshalling for Block
func (*Block) UnmarshalJSON ¶
UnmarshalJSON unmarshals to a Block
type Config ¶
type Config interface { GasUpdaterBlockHistorySize() uint16 GasUpdaterBlockDelay() uint16 GasUpdaterTransactionPercentile() uint16 GasUpdaterBatchSize() uint32 EthMaxGasPriceWei() *big.Int EthMinGasPriceWei() *big.Int EthFinalityDepth() uint SetEthGasPriceDefault(value *big.Int) error ChainID() *big.Int }
Config defines the interface for the supplied config
type GasUpdater ¶
type GasUpdater interface { httypes.HeadTrackable service.Service }
GasUpdater listens for new heads and updates the base gas price dynamically based on the configured percentile of gas prices in that block
func NewGasUpdater ¶
func NewGasUpdater(ethClient eth.Client, config Config) GasUpdater
NewGasUpdater returns a new gas updater.
type Transaction ¶
Transaction represents an ethereum transaction Use our own type because geth's type has validation failures on e.g. zero gas used, which can occur on other chains. This type is only used for the gas updater, and can be expensive to unmarshal. Don't add unnecessary fields here.
func (*Transaction) UnmarshalJSON ¶
func (t *Transaction) UnmarshalJSON(data []byte) error
UnmarshalJSON unmarshals a Transaction