client

package
v0.0.0-...-1b15b10 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2022 License: LGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultGasLimit = 6721975
View Source
const DefaultGasPrice = 20000000000

Variables

View Source
var BlockRetryInterval = time.Second * 5

Functions

func ClientWithValue

func ClientWithValue(value *big.Int) func(*Client)

ClientWithValue arg updater of Client that sets opts.Value with provided value

func OptsWithValue

func OptsWithValue(value *big.Int) func(*bind.TransactOpts)

OptsWithValue args updating function that updates opts.Value argument

Types

type Client

type Client struct {
	*ethclient.Client
	// contains filtered or unexported fields
}

func NewClient

func NewClient(endpoint string, http bool, kp *secp256k1.Keypair, gasLimit *big.Int, gasPrice *big.Int, gasMultiplier *big.Float) (*Client, error)

NewConnection returns an uninitialized connection, must call Client.Connect() before using.

func (*Client) CallOpts

func (c *Client) CallOpts() *bind.CallOpts

func (*Client) ClientWithArgs

func (c *Client) ClientWithArgs(args ...func(*Client))

ClientWithArgs updates client with provided array of arg updaters

func (*Client) Close

func (c *Client) Close()

Close terminates the client connection and stops any running routines

func (*Client) Connect

func (c *Client) Connect() error

Connect starts the ethereum WS connection

func (*Client) EnsureHasBytecode

func (c *Client) EnsureHasBytecode(addr ethcommon.Address) error

EnsureHasBytecode asserts if contract code exists at the specified address

func (*Client) Keypair

func (c *Client) Keypair() *secp256k1.Keypair

func (*Client) LatestBlock

func (c *Client) LatestBlock() (*big.Int, error)

LatestBlock returns the latest block from the current chain

func (*Client) LockAndUpdateNonce

func (c *Client) LockAndUpdateNonce() error

func (*Client) LockAndUpdateOpts

func (c *Client) LockAndUpdateOpts() error

LockAndUpdateOpts acquires a lock on the opts before updating the nonce and gas price.

func (*Client) Opts

func (c *Client) Opts() *bind.TransactOpts

func (*Client) OptsCopyWithArgs

func (c *Client) OptsCopyWithArgs(opts ...func(*bind.TransactOpts)) *bind.TransactOpts

OptsCopyWithArgs returns copy of Client.opts with updated by args updaters functions aruments

func (*Client) SafeEstimateGas

func (c *Client) SafeEstimateGas(ctx context.Context) (*big.Int, error)

func (*Client) UnlockNonce

func (c *Client) UnlockNonce()

func (*Client) UnlockOpts

func (c *Client) UnlockOpts()

func (*Client) WaitForBlock

func (c *Client) WaitForBlock(block *big.Int) error

WaitForBlock will poll for the block number until the current block is equal or greater than

type LogFilterWithLatestBlock

type LogFilterWithLatestBlock interface {
	FilterLogs(ctx context.Context, q eth.FilterQuery) ([]types.Log, error)
	LatestBlock() (*big.Int, error)
	BlockByNumber(ctx context.Context, number *big.Int) (*types.Block, error)
}

Directories

Path Synopsis
Package mock_client is a generated GoMock package.
Package mock_client is a generated GoMock package.

Jump to

Keyboard shortcuts

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