Documentation ¶
Index ¶
- type Client
- func (c *Client) BlockNumber(ctx context.Context) (uint64, error)
- func (c *Client) CallContract(ctx context.Context, call ethereum.CallMsg, blockNumber *big.Int) ([]byte, error)
- func (c *Client) ChainID(ctx context.Context) (*big.Int, error)
- func (c *Client) CodeAt(ctx context.Context, contract common.Address, blockNumber *big.Int) ([]byte, error)
- func (c *Client) EstimateGas(ctx context.Context, call ethereum.CallMsg) (gas uint64, err error)
- func (c *Client) FilterLogs(ctx context.Context, query ethereum.FilterQuery) ([]types.Log, error)
- func (c *Client) HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error)
- func (c *Client) PendingCodeAt(ctx context.Context, account common.Address) ([]byte, error)
- func (c *Client) PendingNonceAt(ctx context.Context, account common.Address) (uint64, error)
- func (c *Client) SendTransaction(ctx context.Context, tx *types.Transaction) error
- func (c *Client) SubscribeFilterLogs(ctx context.Context, query ethereum.FilterQuery, ch chan<- types.Log) (ethereum.Subscription, error)
- func (c *Client) SuggestGasPrice(ctx context.Context) (*big.Int, error)
- func (c *Client) SuggestGasTipCap(ctx context.Context) (*big.Int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { CallContractF func(call ethereum.CallMsg) ([]byte, error) CodeAtMap map[common.Address]bool }
func (*Client) CallContract ¶
func (c *Client) CallContract(ctx context.Context, call ethereum.CallMsg, blockNumber *big.Int) ([]byte, error)
CallContract executes an Ethereum contract call with the specified data as the input.
func (*Client) EstimateGas ¶
EstimateGas tries to estimate the gas needed to execute a specific transaction based on the current pending state of the backend blockchain. There is no guarantee that this is the true gas limit requirement as other transactions may be added or removed by miners, but it should provide a basis for setting a reasonable default.
func (*Client) FilterLogs ¶
FilterLogs executes a log filter operation, blocking during execution and returning all the results in one batch.
TODO(karalabe): Deprecate when the subscription one can return past data too.
func (*Client) HeaderByNumber ¶
func (*Client) PendingCodeAt ¶
PendingCodeAt returns the code of the given account in the pending state.
func (*Client) PendingNonceAt ¶
PendingNonceAt retrieves the current pending nonce associated with an account.
func (*Client) SendTransaction ¶
SendTransaction injects the transaction into the pending pool for execution.
func (*Client) SubscribeFilterLogs ¶
func (c *Client) SubscribeFilterLogs(ctx context.Context, query ethereum.FilterQuery, ch chan<- types.Log) (ethereum.Subscription, error)
SubscribeFilterLogs creates a background log filtering operation, returning a subscription immediately, which can be used to stream the found events.
func (*Client) SuggestGasPrice ¶
SuggestGasPrice retrieves the currently suggested gas price to allow a timely execution of a transaction.