blockclient

package
v0.0.0-...-24518c4 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2022 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTimeout       = errors.New("timed out of attempts")
	ErrReceiptStatus = errors.New("the receipt has a status of 0")
)

Functions

This section is empty.

Types

type Client

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

An ethereum client that implements the ContractBackend interface https://pkg.go.dev/github.com/ethereum/go-ethereum@v1.10.12/accounts/abi/bind#ContractBackend and reconnects automatically on failure

func Dial

func Dial(rawurl string) (*Client, error)

Dial connects to a client to the given URL

func (*Client) CallContract

func (c *Client) CallContract(ctx context.Context, call ethereum.CallMsg, blockNumber *big.Int) ([]byte, error)

Implements the ContractCaller interface https://pkg.go.dev/github.com/ethereum/go-ethereum@v1.10.12/accounts/abi/bind#ContractCaller

func (*Client) CodeAt

func (c *Client) CodeAt(ctx context.Context, contract common.Address, blockNumber *big.Int) ([]byte, error)

Implements the ContractCaller interface https://pkg.go.dev/github.com/ethereum/go-ethereum@v1.10.12/accounts/abi/bind#ContractCaller

func (*Client) EstimateGas

func (c *Client) EstimateGas(ctx context.Context, call ethereum.CallMsg) (gas uint64, err error)

Implements the ContractTransactor interface https://pkg.go.dev/github.com/ethereum/go-ethereum@v1.10.12/accounts/abi/bind#ContractTransactor

func (*Client) FilterLogs

func (c *Client) FilterLogs(ctx context.Context, query ethereum.FilterQuery) ([]types.Log, error)

Implements the ContractFilterer interface https://pkg.go.dev/github.com/ethereum/go-ethereum@v1.10.12/accounts/abi/bind#ContractFilterer

func (*Client) GetPendingTxReceipt

func (c *Client) GetPendingTxReceipt(ctx context.Context, tx *types.Transaction) (*types.Receipt, error)

Blocks until the transaction is mined and returns it's receipt. It returns an error if the receipt status is 0

func (*Client) HeaderByNumber

func (c *Client) HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error)

Implements the ContractTransactor interface https://pkg.go.dev/github.com/ethereum/go-ethereum@v1.10.12/accounts/abi/bind#ContractTransactor

func (*Client) PendingCodeAt

func (c *Client) PendingCodeAt(ctx context.Context, account common.Address) ([]byte, error)

Implements the ContractTransactor interface https://pkg.go.dev/github.com/ethereum/go-ethereum@v1.10.12/accounts/abi/bind#ContractTransactor

func (*Client) PendingNonceAt

func (c *Client) PendingNonceAt(ctx context.Context, account common.Address) (uint64, error)

Implements the ContractTransactor interface https://pkg.go.dev/github.com/ethereum/go-ethereum@v1.10.12/accounts/abi/bind#ContractTransactor

func (*Client) SendTransaction

func (c *Client) SendTransaction(ctx context.Context, tx *types.Transaction) error

Implements the ContractTransactor interface https://pkg.go.dev/github.com/ethereum/go-ethereum@v1.10.12/accounts/abi/bind#ContractTransactor

func (*Client) SubscribeFilterLogs

func (c *Client) SubscribeFilterLogs(ctx context.Context, query ethereum.FilterQuery, ch chan<- types.Log) (ethereum.Subscription, error)

Implements the ContractFilterer interface https://pkg.go.dev/github.com/ethereum/go-ethereum@v1.10.12/accounts/abi/bind#ContractFilterer

func (*Client) SubscribeNewHead

func (c *Client) SubscribeNewHead(ctx context.Context, ch chan<- *types.Header) (ethereum.Subscription, error)

func (*Client) SuggestGasPrice

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

Implements the ContractTransactor interface https://pkg.go.dev/github.com/ethereum/go-ethereum@v1.10.12/accounts/abi/bind#ContractTransactor

func (*Client) SuggestGasTipCap

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

Implements the ContractTransactor interface https://pkg.go.dev/github.com/ethereum/go-ethereum@v1.10.12/accounts/abi/bind#ContractTransactor

func (*Client) TransactionByHash

func (c *Client) TransactionByHash(ctx context.Context, hash common.Hash) (tx *types.Transaction, isPending bool, err error)

func (*Client) TransactionReceipt

func (c *Client) TransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error)

Jump to

Keyboard shortcuts

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