Documentation ¶
Index ¶
- func IsParityQueriedReceiptTooEarly(e error) bool
- type Client
- type GethClient
- type Impl
- func (client *Impl) BalanceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (*big.Int, error)
- func (client *Impl) BlockByNumber(ctx context.Context, number *big.Int) (*types.Block, error)
- func (client *Impl) Call(result interface{}, method string, args ...interface{}) error
- func (client *Impl) CallContext(ctx context.Context, result interface{}, method string, args ...interface{}) error
- func (client *Impl) ChainID(ctx context.Context) (*big.Int, error)
- func (client *Impl) Dial(ctx context.Context) error
- func (client *Impl) EstimateGas(ctx context.Context, call ethereum.CallMsg) (gas uint64, err error)
- func (client *Impl) FeeHistory(ctx context.Context, blockCount uint64, lastBlock *big.Int, ...) (*ethereum.FeeHistory, error)
- func (client *Impl) FilterLogs(ctx context.Context, q ethereum.FilterQuery) ([]types.Log, error)
- func (client *Impl) HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error)
- func (client *Impl) PendingCodeAt(ctx context.Context, account common.Address) ([]byte, error)
- func (client *Impl) PendingNonceAt(ctx context.Context, account common.Address) (uint64, error)
- func (client *Impl) SendRawTx(bytes []byte) (common.Hash, error)
- func (client *Impl) SendTransaction(ctx context.Context, tx *types.Transaction) error
- func (client *Impl) SubscribeFilterLogs(ctx context.Context, q ethereum.FilterQuery, ch chan<- types.Log) (ethereum.Subscription, error)
- func (client *Impl) SubscribeNewHead(ctx context.Context, ch chan<- *types.Header) (ethereum.Subscription, error)
- func (client *Impl) SuggestGasPrice(ctx context.Context) (*big.Int, error)
- func (client *Impl) SuggestGasTipCap(ctx context.Context) (*big.Int, error)
- func (client *Impl) TransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error)
- type RPCClient
- type SendError
- func (s *SendError) Error() string
- func (s *SendError) Fatal() bool
- func (s *SendError) IsInsufficientEth() bool
- func (s *SendError) IsNonceTooLowError() bool
- func (s *SendError) IsReplacementUnderpriced() bool
- func (s *SendError) IsTemporarilyUnderpriced() bool
- func (s *SendError) IsTerminallyUnderpriced() bool
- func (s *SendError) IsTransactionAlreadyInMempool() bool
- func (s *SendError) StrPtr() *string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsParityQueriedReceiptTooEarly ¶
Parity can return partially hydrated Log entries if you query a receipt while the transaction is still in the mempool. Go-ethereum's built-in client raises an error since this is a required field. There is no easy way to ignore the error or pass in a custom struct, so we use this hack to detect it instead.
Types ¶
type Client ¶
type Client interface { GethClient Dial(ctx context.Context) error Close() Call(result interface{}, method string, args ...interface{}) error CallContext(ctx context.Context, result interface{}, method string, args ...interface{}) error }
Client is the interface used to interact with an ethereum node.
type GethClient ¶
type GethClient interface { ethereum.TransactionSender ethereum.LogFilterer ethereum.GasPricer ethereum.GasEstimator ethereum.ChainReader ethereum.PendingStateReader ChainID(ctx context.Context) (*big.Int, error) TransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error) BlockByNumber(ctx context.Context, number *big.Int) (*types.Block, error) BalanceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (*big.Int, error) CallContract(ctx context.Context, msg ethereum.CallMsg, blockNumber *big.Int) ([]byte, error) CodeAt(ctx context.Context, account common.Address, blockNumber *big.Int) ([]byte, error) // SuggestGasTipCap retrieves the currently suggested 1559 priority fee to allow // a timely execution of a transaction. SuggestGasTipCap(ctx context.Context) (*big.Int, error) FeeHistory(ctx context.Context, blockCount uint64, lastBlock *big.Int, rewardPercentiles []float64) (*ethereum.FeeHistory, error) }
GethClient is an interface that represents go-ethereum's own ethclient https://github.com/ethereum/go-ethereum/blob/master/ethclient/ethclient.go
type Impl ¶
type Impl struct { GethClient RPCClient SecondaryGethClients []GethClient SecondaryRPCClients []RPCClient // contains filtered or unexported fields }
Impl implements the ethereum Client interface using a CallerSubscriber instance.
func (*Impl) BlockByNumber ¶
func (*Impl) CallContext ¶
func (*Impl) EstimateGas ¶
func (*Impl) FeeHistory ¶
func (client *Impl) FeeHistory(ctx context.Context, blockCount uint64, lastBlock *big.Int, rewardPercentiles []float64) (*ethereum.FeeHistory, error)
FeeHistory returns the collection of historical gas information
func (*Impl) FilterLogs ¶
func (*Impl) HeaderByNumber ¶
func (*Impl) PendingCodeAt ¶
func (*Impl) PendingNonceAt ¶
func (*Impl) SendTransaction ¶
SendTransaction also uses the secondary HTTP RPC URL if set
func (*Impl) SubscribeFilterLogs ¶
func (*Impl) SubscribeNewHead ¶
func (*Impl) SuggestGasPrice ¶
func (*Impl) SuggestGasTipCap ¶
SuggestGasTipCap retrieves the currently suggested 1559 priority fee to allow a timely execution of a transaction.
func (*Impl) TransactionReceipt ¶
func (client *Impl) TransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error)
TransactionReceipt wraps the GethClient's `TransactionReceipt` method so that we can ignore the error that arises when we're talking to a Parity node that has no receipt yet.
type RPCClient ¶
type RPCClient interface { Call(result interface{}, method string, args ...interface{}) error CallContext(ctx context.Context, result interface{}, method string, args ...interface{}) error BatchCallContext(ctx context.Context, b []rpc.BatchElem) error EthSubscribe(ctx context.Context, channel interface{}, args ...interface{}) (ethereum.Subscription, error) Close() }
RPCClient is an interface that represents go-ethereum's own rpc.Client. https://github.com/ethereum/go-ethereum/blob/master/rpc/client.go
type SendError ¶
type SendError struct {
// contains filtered or unexported fields
}
func NewFatalSendError ¶
func NewFatalSendErrorS ¶
func NewSendError ¶
func NewSendErrorS ¶
func (*SendError) Fatal ¶
Fatal indicates whether the error should be considered fatal or not Fatal errors mean that no matter how many times the send is retried, no node will ever accept it
func (*SendError) IsInsufficientEth ¶
func (*SendError) IsNonceTooLowError ¶
func (*SendError) IsReplacementUnderpriced ¶
IsReplacementUnderpriced indicates that a transaction already exists in the mempool with this nonce but a different gas price or payload
func (*SendError) IsTemporarilyUnderpriced ¶
func (*SendError) IsTerminallyUnderpriced ¶
IsTerminallyUnderpriced indicates that this transaction is so far underpriced the node won't even accept it in the first place
func (*SendError) IsTransactionAlreadyInMempool ¶
Geth/parity returns this error if the transaction is already in the node's mempool