ethereum

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2021 License: Apache-2.0 Imports: 11 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 {
	*ethclient.Client
	// contains filtered or unexported fields
}

Client Ethereum JSON RPC Client

func NewClient

func NewClient(c config.Ethereum) *Client

NewClient creates new instance of an Ethereum client

func (*Client) ChainID

func (ec *Client) ChainID() *big.Int

func (*Client) GetClient

func (ec *Client) GetClient() *ethclient.Client

GetClients returns the instance of a ethclient already established connection to a JSON RPC Ethereum Node

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

func (ec *Client) WaitForTransaction(hex string, onSuccess, onRevert func(), onError func(err error))

WaitForTransaction 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

Directories

Path Synopsis
contracts

Jump to

Keyboard shortcuts

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