evm

package
v1.3.1-rc-1 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2023 License: Apache-2.0 Imports: 14 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)

Directories

Path Synopsis
contracts

Jump to

Keyboard shortcuts

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