rpcclient

package
v4.14.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2019 License: Apache-2.0 Imports: 10 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Interface

type Interface interface {
	TransactionReceiptWithBlockNumber(
		ctx context.Context, hash common.Hash) (*RPCTransactionReceipt, error)
	HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error)
	BalanceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (*big.Int, error)
	bind.ContractBackend
}

Interface can be implemented to provide an Ethereum rpc client.

type RPCClient

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

RPCClient wraps the high level ethclient, extending it with more functions. Implements Interface.

func RPCDial

func RPCDial(url string) (*RPCClient, error)

RPCDial connects to a backend.

func (*RPCClient) TransactionReceiptWithBlockNumber

func (rpc *RPCClient) TransactionReceiptWithBlockNumber(
	ctx context.Context, hash common.Hash) (*RPCTransactionReceipt, error)

TransactionReceiptWithBlockNumber is like rpc.TransactionReceipt, but exposes the block number as well. If no receipt was found, `nil, nil` is returned.

type RPCTransactionReceipt

type RPCTransactionReceipt struct {
	types.Receipt
	BlockNumber uint64
}

RPCTransactionReceipt is a receipt extended with the block number.

func (*RPCTransactionReceipt) UnmarshalJSON

func (rpcTR *RPCTransactionReceipt) UnmarshalJSON(msg []byte) error

UnmarshalJSON implements json.Unmarshaler.

Jump to

Keyboard shortcuts

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