ethclient

package
v0.0.0-...-092aa0d Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EthClient

type EthClient struct {
	// contains filtered or unexported fields
}

EthClient wraps ethereum client for convenient use.

func NewEthClient

func NewEthClient(url string) (*EthClient, error)

NewEthClient creates a new EthClient instance.

func (*EthClient) FilterLogs

func (ec *EthClient) FilterLogs(query ethereum.FilterQuery) ([]types.Log, error)

FilterLogs filters logs based on the given query.

func (*EthClient) GetBalance

func (ec *EthClient) GetBalance(account common.Address) (*big.Int, error)

GetBalance retrieves the balance of the given account address.

func (*EthClient) GetLatestBlockNumber

func (ec *EthClient) GetLatestBlockNumber() (uint64, error)

GetLatestBlockNumber retrieves the block number of the latest block.

func (*EthClient) GetTransactionByHash

func (ec *EthClient) GetTransactionByHash(hash common.Hash) (*types.Transaction, bool, error)

GetTransactionByHash returns the transaction for the given hash.

func (*EthClient) GetTransactionReceipt

func (ec *EthClient) GetTransactionReceipt(hash common.Hash) (*types.Receipt, error)

GetTransactionReceipt returns the receipt for the given transaction hash.

func (*EthClient) SendTransaction

func (ec *EthClient) SendTransaction(tx *types.Transaction) error

SendTransaction sends the given transaction to blockchain.

Jump to

Keyboard shortcuts

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