Documentation ¶
Index ¶
Constants ¶
const ( // FeeHistoryBlocks specifies how many blocks to consider for priority fee estimation FeeHistoryBlocks = 10 // FeeHistoryPercentile specifies the percentile of effective priority fees to include FeeHistoryPercentile = 5 // FallbackMaxFeePerGas is the fallback value used when MaxFeePerGas cannot be calculated FallbackMaxFeePerGas = 20000000000 )
const ( // DefaultClientRPCURL is the RPC URL used by default, to interact with the // ethereum node. DefaultClientRPCURL = "http://127.0.0.1:8545/" )
Variables ¶
var ( // NewAddressEncodeDecoder re-exports evm.NewAddressEncodeDecoder. NewAddressEncodeDecoder = evm.NewAddressEncodeDecoder // NewAddressDecoder re-exports evm.NewAddressDecoder. NewAddressDecoder = evm.NewAddressDecoder // NewAddressEncoder re-exports evm.NewAddressEncoder. NewAddressEncoder = evm.NewAddressEncoder // NewAddressFromHex re-exports evm.NewAddressFromHex. NewAddressFromHex = evm.NewAddressFromHex )
var ( // PriorityFeeEstimationTrigger specifies which base fee to trigger priority fee estimation at PriorityFeeEstimationTrigger = big.NewInt(100000000000) // WEI // DefaultPriorityFee is returned if above trigger is not met DefaultPriorityFee = big.NewInt(3000000000) // PriorityFeeIncreaseBoundary signifies a big bump in fee history priority reward, due to which we choose // not to consider values under it while calculating the median priority fee. PriorityFeeIncreaseBoundary = big.NewInt(200) )
var Encode = evm.Encode
Encode re-exports evm.Encode.
var NewClient = evm.NewClient
NewClient re-exports evm.NewClient.
Functions ¶
This section is empty.
Types ¶
type AddressDecoder ¶
type AddressDecoder = evm.AddressDecoder
AddressDecoder re-exports evm.AddressDecoder.
type AddressEncodeDecoder ¶
type AddressEncodeDecoder = evm.AddressEncodeDecoder
AddressEncodeDecoder re-exports evm.AddressEncodeDecoder.
type AddressEncoder ¶
type AddressEncoder = evm.AddressEncoder
AddressEncoder re-exports evm.AddressEncoder.
type GasEstimator ¶
type GasEstimator struct {
// contains filtered or unexported fields
}
A GasEstimator returns the gas price and the provide gas limit that is needed in order to confirm transactions with an estimated maximum delay of one block.
func NewDefaultGasEstimator ¶
func NewDefaultGasEstimator(client *Client) *GasEstimator
NewDefaultGasEstimator returns a simple gas estimator with default gas options that fetches the ideal gas price for an ethereum transaction to be included in a block with minimal delay.
func NewGasEstimator ¶
func NewGasEstimator(client *Client, opts GasOptions) *GasEstimator
NewGasEstimator returns a simple gas estimator that fetches the ideal gas price for an ethereum transaction to be included in a block with minimal delay.
func (*GasEstimator) EstimateGas ¶
EstimateGas returns an estimate of the current gas price and returns the gas limit provided. These numbers change with congestion. These estimates are often a little off, and this should be considered when using them.
type GasOptions ¶
type GasOptions struct { FeeHistoryBlocks uint64 FeeHistoryPercentile uint64 FallbackMaxFeePerGas uint64 PriorityFeeEstimationTrigger *big.Int DefaultPriorityFee *big.Int PriorityFeeIncreaseBoundary *big.Int }
GasOptions allow a user to configure the parameters used while heuristically recommending fees for EIP-1559 compatible transactions.
type TxBuilder ¶
TxBuilder represents a transaction builder that builds transactions to be broadcasted to the ethereum network. The TxBuilder is configured using a chain id.
func NewTxBuilder ¶
NewTxBuilder creates a new transaction builder.