Documentation
¶
Index ¶
- type RPCClient
- func (c *RPCClient) CallContext(ctx context.Context, result interface{}, method string, args ...interface{}) error
- func (c *RPCClient) NonceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (uint64, error)
- func (c *RPCClient) QueryDetailedTransactionStatus(txHash common.Hash) error
- func (c *RPCClient) QueryTransactionByHash(txHash common.Hash) (string, error)
- func (c *RPCClient) QueryTxpoolContent(txHash common.Hash) (string, error)
- func (c *RPCClient) SendRequest(method string, params []interface{}) (map[string]interface{}, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RPCClient ¶
RPCClient represents an RPC client for Ethereum node communication
func NewRPCClient ¶
NewRPCClient creates a new RPC client with the specified URL
func (*RPCClient) CallContext ¶
func (c *RPCClient) CallContext(ctx context.Context, result interface{}, method string, args ...interface{}) error
CallContext performs a JSON-RPC call with the given arguments. If the context is canceled before the call has successfully returned, CallContext returns immediately.
The result must be a pointer so that package json can unmarshal into it. You can also pass nil, in which case the result is ignored.
func (*RPCClient) NonceAt ¶
func (c *RPCClient) NonceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (uint64, error)
NonceAt returns the account nonce of the given account. The block number can be nil, in which case the nonce is taken from the latest known block.
func (*RPCClient) QueryDetailedTransactionStatus ¶
QueryDetailedTransactionStatus queries detailed pending/queued status via RPC
func (*RPCClient) QueryTransactionByHash ¶
QueryTransactionByHash queries eth_getTransactionByHash
func (*RPCClient) QueryTxpoolContent ¶
QueryTxpoolContent queries txpool_content to get pending/queued status