Documentation ¶
Index ¶
- type Client
- func (ec Client) BlockConfirmations() uint64
- func (ec *Client) ChainID(ctx context.Context) (*big.Int, error)
- func (ec *Client) GetBlockTimestamp(blockNumber *big.Int) uint64
- func (ec *Client) GetChainID() uint64
- func (ec *Client) GetClient() client.Core
- func (ec *Client) GetPrivateKey() string
- func (ec Client) RetryBlockNumber() (uint64, error)
- func (ec Client) RetryFilterLogs(query ethereum.FilterQuery) ([]types.Log, error)
- func (ec *Client) RetryTransactionByHash(hash common.Hash) (*types.Transaction, error)
- func (ec *Client) SetChainID(chainId uint64)
- func (ec *Client) ValidateContractDeployedAt(contractAddress string) (*common.Address, error)
- func (ec *Client) WaitForConfirmations(raw types.Log) error
- func (ec *Client) WaitForTransactionCallback(hex string, onSuccess, onRevert func(), onError func(err error))
- func (ec *Client) WaitForTransactionReceipt(hash common.Hash) (txReceipt *types.Receipt, err error)
- type ClientPool
- func (cp *ClientPool) BlockConfirmations() uint64
- func (cp *ClientPool) BlockNumber(ctx context.Context) (uint64, error)
- func (cp *ClientPool) CallContract(ctx context.Context, call ethereum.CallMsg, blockNumber *big.Int) ([]byte, error)
- func (cp *ClientPool) ChainID(ctx context.Context) (*big.Int, error)
- func (cp *ClientPool) CodeAt(ctx context.Context, contract common.Address, blockNumber *big.Int) ([]byte, error)
- func (cp *ClientPool) EstimateGas(ctx context.Context, call ethereum.CallMsg) (gas uint64, err error)
- func (cp *ClientPool) FilterLogs(ctx context.Context, query ethereum.FilterQuery) ([]types.Log, error)
- func (cp *ClientPool) GetBlockTimestamp(blockNumber *big.Int) uint64
- func (cp *ClientPool) GetChainID() uint64
- func (cp *ClientPool) GetClient() client.Core
- func (cp *ClientPool) GetPrivateKey() string
- func (cp *ClientPool) HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error)
- func (cp *ClientPool) PendingCodeAt(ctx context.Context, account common.Address) ([]byte, error)
- func (cp *ClientPool) PendingNonceAt(ctx context.Context, account common.Address) (uint64, error)
- func (cp *ClientPool) RetryBlockNumber() (uint64, error)
- func (cp *ClientPool) RetryFilterLogs(query ethereum.FilterQuery) ([]types.Log, error)
- func (cp *ClientPool) RetryTransactionByHash(hash common.Hash) (*types.Transaction, error)
- func (cp *ClientPool) SendTransaction(ctx context.Context, tx *types.Transaction) error
- func (cp *ClientPool) SetChainID(chainID uint64)
- func (cp *ClientPool) SubscribeFilterLogs(ctx context.Context, query ethereum.FilterQuery, ch chan<- types.Log) (ethereum.Subscription, error)
- func (cp *ClientPool) SuggestGasPrice(ctx context.Context) (*big.Int, error)
- func (cp *ClientPool) SuggestGasTipCap(ctx context.Context) (*big.Int, error)
- func (cp *ClientPool) ValidateContractDeployedAt(contractAddress string) (*common.Address, error)
- func (cp *ClientPool) WaitForConfirmations(raw types.Log) error
- func (cp *ClientPool) WaitForTransactionCallback(hex string, onSuccess, onRevert func(), onError func(err error))
- func (cp *ClientPool) WaitForTransactionReceipt(hash common.Hash) (*types.Receipt, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client EVM JSON RPC Client
func (Client) BlockConfirmations ¶
func (*Client) GetBlockTimestamp ¶
GetBlockTimestamp retrieves the timestamp of the given block
func (*Client) GetChainID ¶
func (*Client) GetClient ¶
GetClient returns the instance of an ethclient already established connection to a JSON RPC EVM Node
func (*Client) GetPrivateKey ¶
func (Client) RetryBlockNumber ¶
RetryBlockNumber returns the most recent block number Uses a retry mechanism in case the filter query is stuck
func (Client) RetryFilterLogs ¶
RetryFilterLogs returns the logs from the input query Uses a retry mechanism in case the filter query is stuck
func (*Client) RetryTransactionByHash ¶
func (*Client) SetChainID ¶
func (*Client) ValidateContractDeployedAt ¶
ValidateContractDeployedAt performs validation that a smart contract is deployed at the provided address
func (*Client) WaitForTransactionCallback ¶
func (ec *Client) WaitForTransactionCallback(hex string, onSuccess, onRevert func(), onError func(err error))
WaitForTransactionCallback waits for transaction receipt and depending on receipt status calls one of the provided functions onSuccess is called once the TX is successfully mined onRevert is called once the TX is mined but it reverted onError is called if an error occurs while waiting for TX to go into one of the other 2 states
type ClientPool ¶ added in v1.5.0
type ClientPool struct {
// contains filtered or unexported fields
}
func NewClientPool ¶ added in v1.5.0
func NewClientPool(c config.EvmPool, chainId uint64) *ClientPool
func (*ClientPool) BlockConfirmations ¶ added in v1.5.0
func (cp *ClientPool) BlockConfirmations() uint64
func (*ClientPool) BlockNumber ¶ added in v1.5.0
func (cp *ClientPool) BlockNumber(ctx context.Context) (uint64, error)
func (*ClientPool) CallContract ¶ added in v1.5.0
func (*ClientPool) EstimateGas ¶ added in v1.5.0
func (cp *ClientPool) EstimateGas(ctx context.Context, call ethereum.CallMsg) (gas uint64, err error)
func (*ClientPool) FilterLogs ¶ added in v1.5.0
func (*ClientPool) GetBlockTimestamp ¶ added in v1.5.0
func (cp *ClientPool) GetBlockTimestamp(blockNumber *big.Int) uint64
func (*ClientPool) GetChainID ¶ added in v1.5.0
func (cp *ClientPool) GetChainID() uint64
func (*ClientPool) GetClient ¶ added in v1.5.0
func (cp *ClientPool) GetClient() client.Core
func (*ClientPool) GetPrivateKey ¶ added in v1.5.0
func (cp *ClientPool) GetPrivateKey() string
func (*ClientPool) HeaderByNumber ¶ added in v1.5.0
func (*ClientPool) PendingCodeAt ¶ added in v1.5.0
func (*ClientPool) PendingNonceAt ¶ added in v1.5.0
func (*ClientPool) RetryBlockNumber ¶ added in v1.5.0
func (cp *ClientPool) RetryBlockNumber() (uint64, error)
func (*ClientPool) RetryFilterLogs ¶ added in v1.5.0
func (cp *ClientPool) RetryFilterLogs(query ethereum.FilterQuery) ([]types.Log, error)
func (*ClientPool) RetryTransactionByHash ¶ added in v1.5.0
func (cp *ClientPool) RetryTransactionByHash(hash common.Hash) (*types.Transaction, error)
func (*ClientPool) SendTransaction ¶ added in v1.5.0
func (cp *ClientPool) SendTransaction(ctx context.Context, tx *types.Transaction) error
func (*ClientPool) SetChainID ¶ added in v1.5.0
func (cp *ClientPool) SetChainID(chainID uint64)
func (*ClientPool) SubscribeFilterLogs ¶ added in v1.5.0
func (*ClientPool) SuggestGasPrice ¶ added in v1.5.0
func (*ClientPool) SuggestGasTipCap ¶ added in v1.5.0
func (*ClientPool) ValidateContractDeployedAt ¶ added in v1.5.0
func (cp *ClientPool) ValidateContractDeployedAt(contractAddress string) (*common.Address, error)
func (*ClientPool) WaitForConfirmations ¶ added in v1.5.0
func (cp *ClientPool) WaitForConfirmations(raw types.Log) error
func (*ClientPool) WaitForTransactionCallback ¶ added in v1.5.0
func (cp *ClientPool) WaitForTransactionCallback(hex string, onSuccess, onRevert func(), onError func(err error))