eth

package
v0.0.0-...-f4d84f6 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2022 License: MIT Imports: 12 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 {
	BaseURL string
	Ctx     context.Context

	EthClient  *ethclient.Client
	GethClient *gethclient.Client
	// contains filtered or unexported fields
}

func NewEthClient

func NewEthClient(ctx context.Context, logger log.Logger) *Client

func (*Client) GetBalance

func (c *Client) GetBalance(address common.Address, blockNumber *big.Int) (*big.Int, error)

GetBalance Passing the block number let's you read the account balance at the time of that block. The block number must be a big.Int.

func (*Client) GetBlockByNumber

func (c *Client) GetBlockByNumber(chainID *big.Int) (*types.Block, error)

GetBlockByNumber returns a block from the current canonical chain. If number is nil, the latest known block is returned.

Note that loading full blocks requires two requests. Use HeaderByNumber if you don't need all transactions or uncle headers.

func (*Client) GetBlockNumber

func (c *Client) GetBlockNumber() (uint64, error)

GetBlockNumber returns the most recent block number

func (*Client) GetChainID

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

func (*Client) GetHeaderByNumber

func (c *Client) GetHeaderByNumber(chainID *big.Int) (*types.Header, error)

func (*Client) GetNetworkID

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

func (*Client) GetNodeInfo

func (c *Client) GetNodeInfo() (*p2p.NodeInfo, error)

func (*Client) GetPeerCount

func (c *Client) GetPeerCount() (uint64, error)

GetPeerCount returns the most recent block number

func (*Client) SendTransaction

func (c *Client) SendTransaction(pk string, transmitter string, receiver string, amount int64, gasLimitTx int64, chainID *big.Int) error

SendTransaction sends a transaction to a specified address.

Jump to

Keyboard shortcuts

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