Versions in this module Expand all Collapse all v0 v0.5.0 Jun 23, 2023 v0.4.0 Jun 22, 2023 v0.3.0 Jun 22, 2023 v0.2.0 Jun 22, 2023 Changes in this version + const Fatal + const InsufficientEth + const L2FeeTooHigh + const L2FeeTooLow + const L2Full + const LimitReached + const NodeSelectionMode_HighestHead + const NodeSelectionMode_RoundRobin + const NodeSelectionMode_TotalDifficulty + const NodeStateAlive + const NodeStateClosed + const NodeStateDialed + const NodeStateInvalidChainID + const NodeStateOutOfSync + const NodeStateUndialed + const NodeStateUnreachable + const NodeStateUnusable + const NonceTooHigh + const NonceTooLow + const NullClientChainID + const ReplacementTransactionUnderpriced + const TerminallyUnderpriced + const TransactionAlreadyInMempool + const TransactionAlreadyMined + const TxFeeExceedsCap + var PromEVMPoolRPCNodeStates = promauto.NewGaugeVec(prometheus.GaugeOpts{ ... }, []string{ ... }) + func ContextWithDefaultTimeoutFromChan(chStop <-chan struct{}) (ctx context.Context, cancel context.CancelFunc) + func NewClientWithNodes(logger logger.Logger, cfg PoolConfig, primaryNodes []Node, ...) (*client, error) + func ToBlockNumArg(number *big.Int) string + type BatchSender interface + BatchCallContext func(ctx context.Context, b []rpc.BatchElem) error + type CallArgs struct + Data hexutil.Bytes + From common.Address + To common.Address + type Client interface + BalanceAt func(ctx context.Context, account common.Address, blockNumber *big.Int) (*big.Int, error) + BatchCallContext func(ctx context.Context, b []rpc.BatchElem) error + BatchCallContextAll func(ctx context.Context, b []rpc.BatchElem) error + BlockByHash func(ctx context.Context, hash common.Hash) (*types.Block, error) + BlockByNumber func(ctx context.Context, number *big.Int) (*types.Block, error) + CallContext func(ctx context.Context, result interface{}, method string, args ...interface{}) error + CallContract func(ctx context.Context, msg ethereum.CallMsg, blockNumber *big.Int) ([]byte, error) + ChainID func() *big.Int + Close func() + CodeAt func(ctx context.Context, account common.Address, blockNumber *big.Int) ([]byte, error) + Dial func(ctx context.Context) error + EstimateGas func(ctx context.Context, call ethereum.CallMsg) (uint64, error) + FilterLogs func(ctx context.Context, q ethereum.FilterQuery) ([]types.Log, error) + GetERC20Balance func(ctx context.Context, address common.Address, contractAddress common.Address) (*big.Int, error) + GetEthBalance func(ctx context.Context, account common.Address, blockNumber *big.Int) (*assets.Eth, error) + GetLINKBalance func(ctx context.Context, linkAddress common.Address, address common.Address) (*assets.Link, error) + HeadByHash func(ctx context.Context, n common.Hash) (*evmtypes.Head, error) + HeadByNumber func(ctx context.Context, n *big.Int) (*evmtypes.Head, error) + HeaderByHash func(context.Context, common.Hash) (*types.Header, error) + HeaderByNumber func(context.Context, *big.Int) (*types.Header, error) + NodeStates func() map[string]string + NonceAt func(ctx context.Context, account common.Address, blockNumber *big.Int) (uint64, error) + PendingCodeAt func(ctx context.Context, account common.Address) ([]byte, error) + PendingNonceAt func(ctx context.Context, account common.Address) (uint64, error) + SendTransaction func(ctx context.Context, tx *types.Transaction) error + SubscribeFilterLogs func(ctx context.Context, q ethereum.FilterQuery, ch chan<- types.Log) (ethereum.Subscription, error) + SubscribeNewHead func(ctx context.Context, ch chan<- *evmtypes.Head) (ethereum.Subscription, error) + SuggestGasPrice func(ctx context.Context) (*big.Int, error) + SuggestGasTipCap func(ctx context.Context) (*big.Int, error) + TransactionReceipt func(ctx context.Context, txHash common.Hash) (*types.Receipt, error) + type ClientErrors = map[int]*regexp.Regexp + type JsonError struct + Code int + Data interface{} + Message string + func ExtractRPCError(baseErr error) (*JsonError, error) + func ExtractRPCErrorOrNil(err error) *JsonError + func (err *JsonError) Error() string + func (err *JsonError) String() string + type Node interface + BalanceAt func(ctx context.Context, account common.Address, blockNumber *big.Int) (*big.Int, error) + BatchCallContext func(ctx context.Context, b []rpc.BatchElem) error + BlockByHash func(ctx context.Context, hash common.Hash) (*types.Block, error) + BlockByNumber func(ctx context.Context, number *big.Int) (*types.Block, error) + CallContext func(ctx context.Context, result interface{}, method string, args ...interface{}) error + CallContract func(ctx context.Context, msg ethereum.CallMsg, blockNumber *big.Int) ([]byte, error) + ChainID func() *big.Int + Close func() error + CodeAt func(ctx context.Context, account common.Address, blockNumber *big.Int) ([]byte, error) + EstimateGas func(ctx context.Context, call ethereum.CallMsg) (uint64, error) + EthSubscribe func(ctx context.Context, channel chan<- *evmtypes.Head, args ...interface{}) (ethereum.Subscription, error) + FilterLogs func(ctx context.Context, q ethereum.FilterQuery) ([]types.Log, error) + HeaderByHash func(context.Context, common.Hash) (*types.Header, error) + HeaderByNumber func(context.Context, *big.Int) (*types.Header, error) + Name func() string + NonceAt func(ctx context.Context, account common.Address, blockNumber *big.Int) (uint64, error) + PendingCodeAt func(ctx context.Context, account common.Address) ([]byte, error) + PendingNonceAt func(ctx context.Context, account common.Address) (uint64, error) + SendTransaction func(ctx context.Context, tx *types.Transaction) error + Start func(ctx context.Context) error + State func() NodeState + StateAndLatest func() (state NodeState, blockNum int64, totalDifficulty *utils.Big) + String func() string + SubscribeFilterLogs func(ctx context.Context, q ethereum.FilterQuery, ch chan<- types.Log) (ethereum.Subscription, error) + SuggestGasPrice func(ctx context.Context) (*big.Int, error) + SuggestGasTipCap func(ctx context.Context) (*big.Int, error) + TransactionReceipt func(ctx context.Context, txHash common.Hash) (*types.Receipt, error) + func NewNode(nodeCfg NodeConfig, lggr logger.Logger, wsuri url.URL, httpuri *url.URL, ...) Node + type NodeConfig interface + NodeNoNewHeadsThreshold func() time.Duration + NodePollFailureThreshold func() uint32 + NodePollInterval func() time.Duration + NodeSelectionMode func() string + NodeSyncThreshold func() uint32 + type NodeSelector interface + Name func() string + Select func() Node + func NewHighestHeadNodeSelector(nodes []Node) NodeSelector + func NewRoundRobinSelector(nodes []Node) NodeSelector + func NewTotalDifficultyNodeSelector(nodes []Node) NodeSelector + type NodeState int + func (n NodeState) GoString() string + func (n NodeState) String() string + type NullClient struct + func NewNullClient(cid *big.Int, lggr logger.Logger) *NullClient + func (nc *NullClient) BalanceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (*big.Int, error) + func (nc *NullClient) BatchCallContext(ctx context.Context, b []rpc.BatchElem) error + func (nc *NullClient) BatchCallContextAll(ctx context.Context, b []rpc.BatchElem) error + func (nc *NullClient) BlockByHash(ctx context.Context, hash common.Hash) (*types.Block, error) + func (nc *NullClient) BlockByNumber(ctx context.Context, number *big.Int) (*types.Block, error) + func (nc *NullClient) CallContext(ctx context.Context, result interface{}, method string, args ...interface{}) error + func (nc *NullClient) CallContract(ctx context.Context, msg ethereum.CallMsg, blockNumber *big.Int) ([]byte, error) + func (nc *NullClient) ChainID() *big.Int + func (nc *NullClient) Close() + func (nc *NullClient) CodeAt(ctx context.Context, account common.Address, blockNumber *big.Int) ([]byte, error) + func (nc *NullClient) Dial(context.Context) error + func (nc *NullClient) EstimateGas(ctx context.Context, call ethereum.CallMsg) (uint64, error) + func (nc *NullClient) FilterLogs(ctx context.Context, q ethereum.FilterQuery) ([]types.Log, error) + func (nc *NullClient) GetERC20Balance(ctx context.Context, address common.Address, contractAddress common.Address) (*big.Int, error) + func (nc *NullClient) GetEthBalance(context.Context, common.Address, *big.Int) (*assets.Eth, error) + func (nc *NullClient) GetLINKBalance(ctx context.Context, linkAddress common.Address, address common.Address) (*assets.Link, error) + func (nc *NullClient) HeadByHash(ctx context.Context, h common.Hash) (*evmtypes.Head, error) + func (nc *NullClient) HeadByNumber(ctx context.Context, n *big.Int) (*evmtypes.Head, error) + func (nc *NullClient) HeaderByHash(ctx context.Context, h common.Hash) (*types.Header, error) + func (nc *NullClient) HeaderByNumber(ctx context.Context, n *big.Int) (*types.Header, error) + func (nc *NullClient) NodeStates() map[string]string + func (nc *NullClient) NonceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (uint64, error) + func (nc *NullClient) PendingCodeAt(ctx context.Context, account common.Address) ([]byte, error) + func (nc *NullClient) PendingNonceAt(ctx context.Context, account common.Address) (uint64, error) + func (nc *NullClient) SendTransaction(ctx context.Context, tx *types.Transaction) error + func (nc *NullClient) SubscribeFilterLogs(ctx context.Context, q ethereum.FilterQuery, ch chan<- types.Log) (ethereum.Subscription, error) + func (nc *NullClient) SubscribeNewHead(ctx context.Context, ch chan<- *evmtypes.Head) (ethereum.Subscription, error) + func (nc *NullClient) SuggestGasPrice(ctx context.Context) (*big.Int, error) + func (nc *NullClient) SuggestGasTipCap(ctx context.Context) (tipCap *big.Int, err error) + func (nc *NullClient) TransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error) + type Pool struct + func NewPool(logger logger.Logger, cfg PoolConfig, nodes []Node, sendonlys []SendOnlyNode, ...) *Pool + func (p *Pool) BalanceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (*big.Int, error) + func (p *Pool) BatchCallContext(ctx context.Context, b []rpc.BatchElem) error + func (p *Pool) BatchCallContextAll(ctx context.Context, b []rpc.BatchElem) error + func (p *Pool) BlockByHash(ctx context.Context, hash common.Hash) (*types.Block, error) + func (p *Pool) BlockByNumber(ctx context.Context, number *big.Int) (*types.Block, error) + func (p *Pool) CallContext(ctx context.Context, result interface{}, method string, args ...interface{}) error + func (p *Pool) CallContract(ctx context.Context, msg ethereum.CallMsg, blockNumber *big.Int) ([]byte, error) + func (p *Pool) ChainID() *big.Int + func (p *Pool) Close() error + func (p *Pool) CodeAt(ctx context.Context, account common.Address, blockNumber *big.Int) ([]byte, error) + func (p *Pool) Dial(ctx context.Context) error + func (p *Pool) EstimateGas(ctx context.Context, call ethereum.CallMsg) (uint64, error) + func (p *Pool) EthSubscribe(ctx context.Context, channel chan<- *evmtypes.Head, args ...interface{}) (ethereum.Subscription, error) + func (p *Pool) FilterLogs(ctx context.Context, q ethereum.FilterQuery) ([]types.Log, error) + func (p *Pool) HeaderByHash(ctx context.Context, h common.Hash) (*types.Header, error) + func (p *Pool) HeaderByNumber(ctx context.Context, n *big.Int) (*types.Header, error) + func (p *Pool) NonceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (uint64, error) + func (p *Pool) PendingCodeAt(ctx context.Context, account common.Address) ([]byte, error) + func (p *Pool) PendingNonceAt(ctx context.Context, account common.Address) (uint64, error) + func (p *Pool) SendTransaction(ctx context.Context, tx *types.Transaction) error + func (p *Pool) SubscribeFilterLogs(ctx context.Context, q ethereum.FilterQuery, ch chan<- types.Log) (ethereum.Subscription, error) + func (p *Pool) SuggestGasPrice(ctx context.Context) (*big.Int, error) + func (p *Pool) SuggestGasTipCap(ctx context.Context) (*big.Int, error) + func (p *Pool) TransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error) + type PoolConfig interface + NodeNoNewHeadsThreshold func() time.Duration + NodeSelectionMode func() string + type SendError struct + func NewFatalSendError(e error) *SendError + func NewSendError(e error) *SendError + func NewSendErrorS(s string) *SendError + func (s *SendError) CauseStr() string + func (s *SendError) Error() string + func (s *SendError) Fatal() bool + func (s *SendError) IsInsufficientEth() bool + func (s *SendError) IsL2FeeTooHigh() bool + func (s *SendError) IsL2Full() bool + func (s *SendError) IsNonceTooHighError() bool + func (s *SendError) IsNonceTooLowError() bool + func (s *SendError) IsReplacementUnderpriced() bool + func (s *SendError) IsTemporarilyUnderpriced() bool + func (s *SendError) IsTerminallyUnderpriced() bool + func (s *SendError) IsTimeout() bool + func (s *SendError) IsTransactionAlreadyInMempool() bool + func (s *SendError) IsTransactionAlreadyMined() bool + func (s *SendError) IsTxFeeExceedsCap() bool + func (s *SendError) L2FeeTooLow() bool + type SendOnlyNode interface + BatchCallContext func(ctx context.Context, b []rpc.BatchElem) error + ChainID func() (chainID *big.Int) + Close func() error + Name func() string + SendTransaction func(ctx context.Context, tx *types.Transaction) error + Start func(context.Context) error + State func() NodeState + String func() string + func NewSendOnlyNode(lggr logger.Logger, httpuri url.URL, name string, chainID *big.Int) SendOnlyNode + type SimulatedBackendClient struct + func NewSimulatedBackendClient(t testing.TB, b *backends.SimulatedBackend, chainId *big.Int) *SimulatedBackendClient + func (c *SimulatedBackendClient) Backend() *backends.SimulatedBackend + func (c *SimulatedBackendClient) BalanceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (*big.Int, error) + func (c *SimulatedBackendClient) BatchCallContext(ctx context.Context, b []rpc.BatchElem) error + func (c *SimulatedBackendClient) BatchCallContextAll(ctx context.Context, b []rpc.BatchElem) error + func (c *SimulatedBackendClient) BlockByHash(ctx context.Context, hash common.Hash) (*types.Block, error) + func (c *SimulatedBackendClient) BlockByNumber(ctx context.Context, n *big.Int) (*types.Block, error) + func (c *SimulatedBackendClient) CallContext(ctx context.Context, result interface{}, method string, args ...interface{}) error + func (c *SimulatedBackendClient) CallContract(ctx context.Context, msg ethereum.CallMsg, blockNumber *big.Int) ([]byte, error) + func (c *SimulatedBackendClient) ChainID() *big.Int + func (c *SimulatedBackendClient) Close() + func (c *SimulatedBackendClient) CodeAt(ctx context.Context, account common.Address, blockNumber *big.Int) ([]byte, error) + func (c *SimulatedBackendClient) Commit() common.Hash + func (c *SimulatedBackendClient) Dial(context.Context) error + func (c *SimulatedBackendClient) EstimateGas(ctx context.Context, call ethereum.CallMsg) (gas uint64, err error) + func (c *SimulatedBackendClient) FilterLogs(ctx context.Context, q ethereum.FilterQuery) (logs []types.Log, err error) + func (c *SimulatedBackendClient) GetERC20Balance(ctx context.Context, address common.Address, contractAddress common.Address) (balance *big.Int, err error) + func (c *SimulatedBackendClient) GetEthBalance(ctx context.Context, account common.Address, blockNumber *big.Int) (*assets.Eth, error) + func (c *SimulatedBackendClient) GetLINKBalance(ctx context.Context, linkAddress common.Address, address common.Address) (*assets.Link, error) + func (c *SimulatedBackendClient) HeadByHash(ctx context.Context, h common.Hash) (*evmtypes.Head, error) + func (c *SimulatedBackendClient) HeadByNumber(ctx context.Context, n *big.Int) (*evmtypes.Head, error) + func (c *SimulatedBackendClient) HeaderByHash(ctx context.Context, h common.Hash) (*types.Header, error) + func (c *SimulatedBackendClient) HeaderByNumber(ctx context.Context, n *big.Int) (*types.Header, error) + func (c *SimulatedBackendClient) NodeStates() map[string]string + func (c *SimulatedBackendClient) NonceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (uint64, error) + func (c *SimulatedBackendClient) PendingCodeAt(ctx context.Context, account common.Address) ([]byte, error) + func (c *SimulatedBackendClient) PendingNonceAt(ctx context.Context, account common.Address) (uint64, error) + func (c *SimulatedBackendClient) SendTransaction(ctx context.Context, tx *types.Transaction) error + func (c *SimulatedBackendClient) SubscribeFilterLogs(ctx context.Context, q ethereum.FilterQuery, channel chan<- types.Log) (ethereum.Subscription, error) + func (c *SimulatedBackendClient) SubscribeNewHead(ctx context.Context, channel chan<- *evmtypes.Head) (ethereum.Subscription, error) + func (c *SimulatedBackendClient) SuggestGasPrice(ctx context.Context) (*big.Int, error) + func (c *SimulatedBackendClient) SuggestGasTipCap(ctx context.Context) (tipCap *big.Int, err error) + func (c *SimulatedBackendClient) TransactionReceipt(ctx context.Context, receipt common.Hash) (*types.Receipt, error) + type Subscription interface + Err func() <-chan error + Unsubscribe func() + type TxSender interface + ChainID func(context.Context) (*big.Int, error) + SendTransaction func(ctx context.Context, tx *types.Transaction) error