Documentation ¶
Index ¶
- type Client
- func (c *Client) BlockNumber(ctx context.Context) (uint64, error)
- func (c *Client) CallContract(ctx context.Context, msg geth.CallMsg, blockNumber *big.Int) ([]byte, error)
- func (c *Client) ChainID(ctx context.Context) (*big.Int, error)
- func (c *Client) CodeAt(ctx context.Context, account gethcommon.Address, blockNumber *big.Int) ([]byte, error)
- func (c *Client) EstimateGas(ctx context.Context, msg geth.CallMsg) (uint64, error)
- func (c *Client) FilterLogs(ctx context.Context, q geth.FilterQuery) ([]gethtypes.Log, error)
- func (c *Client) HeaderByNumber(ctx context.Context, blockNumber *big.Int) (*gethtypes.Header, error)
- func (c *Client) Logger() logrus.FieldLogger
- func (c *Client) NonceAt(ctx context.Context, account gethcommon.Address, blockNumber *big.Int) (uint64, error)
- func (c *Client) PendingCodeAt(ctx context.Context, account gethcommon.Address) ([]byte, error)
- func (c *Client) PendingNonceAt(ctx context.Context, account gethcommon.Address) (uint64, error)
- func (c *Client) SendTransaction(ctx context.Context, tx *gethtypes.Transaction) error
- func (c *Client) SetLogger(logger logrus.FieldLogger)
- func (c *Client) SubscribeFilterLogs(ctx context.Context, _ geth.FilterQuery, _ chan<- gethtypes.Log) (geth.Subscription, error)
- func (c *Client) SuggestGasPrice(ctx context.Context) (*big.Int, error)
- func (c *Client) SuggestGasTipCap(ctx context.Context) (*big.Int, error)
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client provides methods to interface with a JSON-RPC Ethereum 1.0 node
func New ¶
func New(cfg *jsonrpchttp.Config) (*Client, error)
NewFromAddress creates a new client connecting to an Ethereum node at addr
func (*Client) BlockNumber ¶
BlockNumber returns current chain head number
func (*Client) CallContract ¶
func (c *Client) CallContract(ctx context.Context, msg geth.CallMsg, blockNumber *big.Int) ([]byte, error)
CallContract executes contract call The block number can be nil, in which case call is executed at the latest block.
func (*Client) CodeAt ¶
func (c *Client) CodeAt(ctx context.Context, account gethcommon.Address, blockNumber *big.Int) ([]byte, error)
CodeAt returns the contract code of the given account. The block number can be nil, in which case the code is taken from the latest block.
func (*Client) EstimateGas ¶
EstimateGas tries to estimate the gas needed to execute a specific transaction based on the current pending state of the chain.
func (*Client) FilterLogs ¶
FilterLogs executes a filter query.
func (*Client) HeaderByNumber ¶
func (c *Client) HeaderByNumber(ctx context.Context, blockNumber *big.Int) (*gethtypes.Header, error)
HeaderByNumber returns header a given block number
func (*Client) Logger ¶
func (c *Client) Logger() logrus.FieldLogger
func (*Client) NonceAt ¶
func (c *Client) NonceAt(ctx context.Context, account gethcommon.Address, blockNumber *big.Int) (uint64, error)
NonceAt returns the next nonce for the given account. The block number can be nil, in which case the code is taken from the latest block.
func (*Client) PendingCodeAt ¶
PendingCodeAt returns the contract code of the given account on pending state
func (*Client) PendingNonceAt ¶
PendingNonceAt returns the next nonce for the given account considering pending transaction.
func (*Client) SendTransaction ¶
SendTransaction injects a signed transaction into the pending pool for execution.
func (*Client) SetLogger ¶
func (c *Client) SetLogger(logger logrus.FieldLogger)
func (*Client) SubscribeFilterLogs ¶
func (c *Client) SubscribeFilterLogs(ctx context.Context, _ geth.FilterQuery, _ chan<- gethtypes.Log) (geth.Subscription, error)
SubscribeFilterLogs subscribes to the results of a streaming filter query.
func (*Client) SuggestGasPrice ¶
SuggestGasPrice returns gas price for a transaction to be included in a miner block in a timely manner considering current network activity
type Config ¶
type Config struct { Address string HTTP *kilnhttp.ClientConfig }