evm

package
v1.5.2-rc-3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	client.Core
	// contains filtered or unexported fields
}

Client EVM JSON RPC Client

func NewClient

func NewClient(c config.Evm, chainId uint64) *Client

NewClient creates new instance of an EVM client

func (Client) BlockConfirmations

func (ec Client) BlockConfirmations() uint64

func (*Client) ChainID

func (ec *Client) ChainID(ctx context.Context) (*big.Int, error)

func (*Client) GetBlockTimestamp

func (ec *Client) GetBlockTimestamp(blockNumber *big.Int) uint64

GetBlockTimestamp retrieves the timestamp of the given block

func (*Client) GetChainID

func (ec *Client) GetChainID() uint64

func (*Client) GetClient

func (ec *Client) GetClient() client.Core

GetClient returns the instance of an ethclient already established connection to a JSON RPC EVM Node

func (*Client) GetPrivateKey

func (ec *Client) GetPrivateKey() string

func (Client) RetryBlockNumber

func (ec Client) RetryBlockNumber() (uint64, error)

RetryBlockNumber returns the most recent block number Uses a retry mechanism in case the filter query is stuck

func (Client) RetryFilterLogs

func (ec Client) RetryFilterLogs(query ethereum.FilterQuery) ([]types.Log, error)

RetryFilterLogs returns the logs from the input query Uses a retry mechanism in case the filter query is stuck

func (*Client) RetryTransactionByHash

func (ec *Client) RetryTransactionByHash(hash common.Hash) (*types.Transaction, error)

func (*Client) SetChainID

func (ec *Client) SetChainID(chainId uint64)

func (*Client) ValidateContractDeployedAt

func (ec *Client) ValidateContractDeployedAt(contractAddress string) (*common.Address, error)

ValidateContractDeployedAt performs validation that a smart contract is deployed at the provided address

func (*Client) WaitForConfirmations

func (ec *Client) WaitForConfirmations(raw types.Log) error

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

func (*Client) WaitForTransactionReceipt

func (ec *Client) WaitForTransactionReceipt(hash common.Hash) (txReceipt *types.Receipt, err error)

WaitForTransactionReceipt Polls the provided hash every 5 seconds until the transaction mined (either successfully or reverted)

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 (cp *ClientPool) CallContract(ctx context.Context, call ethereum.CallMsg, blockNumber *big.Int) ([]byte, error)

func (*ClientPool) ChainID added in v1.5.0

func (cp *ClientPool) ChainID(ctx context.Context) (*big.Int, error)

func (*ClientPool) CodeAt added in v1.5.0

func (cp *ClientPool) CodeAt(ctx context.Context, contract common.Address, blockNumber *big.Int) ([]byte, error)

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 (cp *ClientPool) FilterLogs(ctx context.Context, query ethereum.FilterQuery) ([]types.Log, error)

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 (cp *ClientPool) HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error)

func (*ClientPool) PendingCodeAt added in v1.5.0

func (cp *ClientPool) PendingCodeAt(ctx context.Context, account common.Address) ([]byte, error)

func (*ClientPool) PendingNonceAt added in v1.5.0

func (cp *ClientPool) PendingNonceAt(ctx context.Context, account common.Address) (uint64, error)

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 (cp *ClientPool) SubscribeFilterLogs(ctx context.Context, query ethereum.FilterQuery, ch chan<- types.Log) (ethereum.Subscription, error)

func (*ClientPool) SuggestGasPrice added in v1.5.0

func (cp *ClientPool) SuggestGasPrice(ctx context.Context) (*big.Int, error)

func (*ClientPool) SuggestGasTipCap added in v1.5.0

func (cp *ClientPool) SuggestGasTipCap(ctx context.Context) (*big.Int, error)

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))

func (*ClientPool) WaitForTransactionReceipt added in v1.5.0

func (cp *ClientPool) WaitForTransactionReceipt(hash common.Hash) (*types.Receipt, error)

Directories

Path Synopsis
contracts

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL