Documentation
¶
Overview ¶
Package eth implements RPC API bindings for methods in the "eth" namespace.
Index ¶
- func AccessList(msg *w3types.Message, blockNumber *big.Int) w3types.RPCCallerFactory[*AccessListResponse]
- func Balance(addr common.Address, blockNumber *big.Int) w3types.RPCCallerFactory[*big.Int]
- func BlockByHash(hash common.Hash) w3types.RPCCallerFactory[*types.Block]
- func BlockByNumber(number *big.Int) w3types.RPCCallerFactory[*types.Block]
- func BlockNumber() w3types.RPCCallerFactory[*big.Int]
- func BlockReceipts(number *big.Int) w3types.RPCCallerFactory[types.Receipts]
- func BlockTxCountByHash(hash common.Hash) w3types.RPCCallerFactory[uint]
- func BlockTxCountByNumber(number *big.Int) w3types.RPCCallerFactory[uint]
- func Call(msg *w3types.Message, blockNumber *big.Int, overrides w3types.State) w3types.RPCCallerFactory[[]byte]
- func CallBundle(calls []*BundleCall, blockNumber *big.Int, requireCanonical bool) w3types.RPCCallerFactory[*BundleCallResponse]
- func ChainID() w3types.RPCCallerFactory[uint64]
- func Code(addr common.Address, blockNumber *big.Int) w3types.RPCCallerFactory[[]byte]
- func EstimateGas(msg *w3types.Message, blockNumber *big.Int) w3types.RPCCallerFactory[uint64]
- func GasPrice() w3types.RPCCallerFactory[*big.Int]
- func GasTipCap() w3types.RPCCallerFactory[*big.Int]
- func HeaderByHash(hash common.Hash) w3types.RPCCallerFactory[*types.Header]
- func HeaderByNumber(number *big.Int) w3types.RPCCallerFactory[*types.Header]
- func Logs(q ethereum.FilterQuery) w3types.RPCCallerFactory[[]types.Log]
- func NewHeads(ch chan<- *types.Header) w3types.RPCSubscriber
- func NewLogs(ch chan<- *types.Log, q ethereum.FilterQuery) w3types.RPCSubscriber
- func Nonce(addr common.Address, blockNumber *big.Int) w3types.RPCCallerFactory[uint64]
- func PendingTransactions(ch chan<- *types.Transaction) w3types.RPCSubscriber
- func SendRawTx(rawTx []byte) w3types.RPCCallerFactory[common.Hash]
- func SendTx(tx *types.Transaction) w3types.RPCCallerFactory[common.Hash]
- func StorageAt(addr common.Address, slot common.Hash, blockNumber *big.Int) w3types.RPCCallerFactory[common.Hash]
- func Syncing() w3types.RPCCallerFactory[bool]
- func Tx(hash common.Hash) w3types.RPCCallerFactory[*types.Transaction]
- func TxByBlockHashAndIndex(blockHash common.Hash, index uint64) w3types.RPCCallerFactory[*types.Transaction]
- func TxByBlockNumberAndIndex(blockNumber *big.Int, index uint64) w3types.RPCCallerFactory[*types.Transaction]
- func TxReceipt(txHash common.Hash) w3types.RPCCallerFactory[*types.Receipt]
- func UncleByBlockHashAndIndex(hash common.Hash, index uint) w3types.RPCCallerFactory[*types.Header]
- func UncleByBlockNumberAndIndex(number *big.Int, index uint) w3types.RPCCallerFactory[*types.Header]
- func UncleCountByBlockHash(hash common.Hash) w3types.RPCCallerFactory[uint]
- func UncleCountByBlockNumber(number *big.Int) w3types.RPCCallerFactory[uint]
- type AccessListResponse
- type BundleCall
- type BundleCallResponse
- type BundleCallResult
- type CallFuncFactory
- func (f *CallFuncFactory) AtBlock(blockNumber *big.Int) *CallFuncFactory
- func (f *CallFuncFactory) CreateRequest() (rpc.BatchElem, error)
- func (f *CallFuncFactory) From(from common.Address) *CallFuncFactory
- func (f *CallFuncFactory) HandleResponse(elem rpc.BatchElem) error
- func (f *CallFuncFactory) Overrides(overrides w3types.State) *CallFuncFactory
- func (f *CallFuncFactory) Returns(returns ...any) w3types.RPCCaller
- func (f *CallFuncFactory) Value(value *big.Int) *CallFuncFactory
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AccessList ¶
func AccessList(msg *w3types.Message, blockNumber *big.Int) w3types.RPCCallerFactory[*AccessListResponse]
AccessList requests the access list of the given message at the given blockNumber. If blockNumber is nil, the access list of the message at the latest block is requested.
func Balance ¶
Balance requests the balance of the given common.Address addr at the given blockNumber. If blockNumber is nil, the balance at the latest known block is requested.
func BlockByHash ¶
BlockByHash requests the block with the given hash with full transactions.
func BlockByNumber ¶
BlockByNumber requests the block with the given number with full transactions. If number is nil, the latest block is requested.
func BlockNumber ¶
func BlockNumber() w3types.RPCCallerFactory[*big.Int]
BlockNumber requests the number of the most recent block.
func BlockReceipts ¶
BlockReceipts requests all receipts of the transactions in the given block.
func BlockTxCountByHash ¶
func BlockTxCountByHash(hash common.Hash) w3types.RPCCallerFactory[uint]
BlockTxCountByHash requests the number of transactions in the block with the given hash.
func BlockTxCountByNumber ¶
func BlockTxCountByNumber(number *big.Int) w3types.RPCCallerFactory[uint]
BlockTxCountByNumber requests the number of transactions in the block with the given number.
func Call ¶
func Call(msg *w3types.Message, blockNumber *big.Int, overrides w3types.State) w3types.RPCCallerFactory[[]byte]
Call requests the output data of the given message at the given blockNumber. If blockNumber is nil, the output of the message at the latest known block is requested.
func CallBundle ¶
func CallBundle(calls []*BundleCall, blockNumber *big.Int, requireCanonical bool) w3types.RPCCallerFactory[*BundleCallResponse]
CallBundle requests the execution of multiple calls in a bundle at the given blockNumber. If blockNumber is nil, the calls are executed at the latest known block.
func Code ¶
Code requests the code of the given common.Address addr at the given blockNumber. If blockNumber is nil, the code at the latest known block is requested.
func EstimateGas ¶
EstimateGas requests the estimated gas cost of the given message at the given blockNumber. If blockNumber is nil, the estimated gas cost of the message at the latest block is requested.
func GasPrice ¶
func GasPrice() w3types.RPCCallerFactory[*big.Int]
GasPrice requests the current gas price in wei.
func GasTipCap ¶
func GasTipCap() w3types.RPCCallerFactory[*big.Int]
GasTipCap requests the currently suggested gas tip cap after EIP-1559 to allow a timely execution of a transaction.
func HeaderByHash ¶
HeaderByHash requests the header with the given hash.
func HeaderByNumber ¶
HeaderByNumber requests the header with the given number. If number is nil, the latest header is requested.
func Logs ¶
func Logs(q ethereum.FilterQuery) w3types.RPCCallerFactory[[]types.Log]
Logs requests the logs of the given ethereum.FilterQuery q.
func NewHeads ¶
func NewHeads(ch chan<- *types.Header) w3types.RPCSubscriber
NewHeads subscribes to notifications of updates to the blockchain head.
func NewLogs ¶
func NewLogs(ch chan<- *types.Log, q ethereum.FilterQuery) w3types.RPCSubscriber
NewLogs subscribes to notifications about logs that match the given filter query.
func Nonce ¶
Nonce requests the nonce of the given common.Address addr at the given blockNumber. If blockNumber is nil, the nonce at the latest known block is requested.
func PendingTransactions ¶
func PendingTransactions(ch chan<- *types.Transaction) w3types.RPCSubscriber
PendingTransactions subscribes to notifications about new pending transactions in the transaction pool.
func SendRawTx ¶
func SendRawTx(rawTx []byte) w3types.RPCCallerFactory[common.Hash]
SendRawTx sends a raw transaction to the network and returns its hash.
func SendTx ¶
func SendTx(tx *types.Transaction) w3types.RPCCallerFactory[common.Hash]
SendTx sends a signed transaction to the network and returns its hash.
func StorageAt ¶
func StorageAt(addr common.Address, slot common.Hash, blockNumber *big.Int) w3types.RPCCallerFactory[common.Hash]
StorageAt requests the storage of the given common.Address addr at the given common.Hash slot at the given blockNumber. If block number is nil, the slot at the latest known block is requested.
func Syncing ¶
func Syncing() w3types.RPCCallerFactory[bool]
Syncing requests the syncing status of the node.
func Tx ¶
func Tx(hash common.Hash) w3types.RPCCallerFactory[*types.Transaction]
Tx requests the transaction with the given hash.
func TxByBlockHashAndIndex ¶
func TxByBlockHashAndIndex(blockHash common.Hash, index uint64) w3types.RPCCallerFactory[*types.Transaction]
TxByBlockHashAndIndex requests the transaction in the given block with the given index.
func TxByBlockNumberAndIndex ¶
func TxByBlockNumberAndIndex(blockNumber *big.Int, index uint64) w3types.RPCCallerFactory[*types.Transaction]
TxByBlockNumberAndIndex requests the transaction in the given block with the given index.
func UncleByBlockHashAndIndex ¶
UncleByBlockHashAndIndex requests the uncle of the block with the given hash at the given index.
func UncleByBlockNumberAndIndex ¶
func UncleByBlockNumberAndIndex(number *big.Int, index uint) w3types.RPCCallerFactory[*types.Header]
UncleByBlockNumberAndIndex requests the uncle of the block with the given number at the given index.
func UncleCountByBlockHash ¶
func UncleCountByBlockHash(hash common.Hash) w3types.RPCCallerFactory[uint]
UncleCountByBlockHash requests the number of uncles of the block with the given hash.
func UncleCountByBlockNumber ¶
func UncleCountByBlockNumber(number *big.Int) w3types.RPCCallerFactory[uint]
UncleCountByBlockNumber requests the number of uncles of the block with the given number.
Types ¶
type AccessListResponse ¶
type AccessListResponse struct { AccessList types.AccessList GasUsed uint64 }
func (*AccessListResponse) UnmarshalJSON ¶
func (resp *AccessListResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaler.
type BundleCall ¶
type BundleCall struct { From *common.Address `json:"from,omitempty"` To *common.Address `json:"to,omitempty"` Gas *hexutil.Uint64 `json:"gas,omitempty"` GasPrice *hexutil.Big `json:"gasPrice,omitempty"` Value *hexutil.Big `json:"value,omitempty"` Data hexutil.Bytes `json:"data,omitempty"` }
BundleCall represents a single call in the bundle
type BundleCallResponse ¶
type BundleCallResponse []BundleCallResult
BundleCallResponse represents the response from eth_callBundle
func (*BundleCallResponse) UnmarshalJSON ¶
func (resp *BundleCallResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaler interface
type BundleCallResult ¶
type BundleCallResult struct { Result string `json:"result"` Error string `json:"error,omitempty"` RevertData string `json:"revertData,omitempty"` }
BundleCallResult represents the result of a single call in the bundle
type CallFuncFactory ¶
type CallFuncFactory struct {
// contains filtered or unexported fields
}
func CallFunc ¶
CallFunc requests the returns of Func f at common.Address contract with the given args.
func (*CallFuncFactory) AtBlock ¶
func (f *CallFuncFactory) AtBlock(blockNumber *big.Int) *CallFuncFactory
func (*CallFuncFactory) CreateRequest ¶
func (f *CallFuncFactory) CreateRequest() (rpc.BatchElem, error)
func (*CallFuncFactory) From ¶
func (f *CallFuncFactory) From(from common.Address) *CallFuncFactory
func (*CallFuncFactory) HandleResponse ¶
func (f *CallFuncFactory) HandleResponse(elem rpc.BatchElem) error
func (*CallFuncFactory) Overrides ¶
func (f *CallFuncFactory) Overrides(overrides w3types.State) *CallFuncFactory
func (*CallFuncFactory) Returns ¶
func (f *CallFuncFactory) Returns(returns ...any) w3types.RPCCaller
func (*CallFuncFactory) Value ¶
func (f *CallFuncFactory) Value(value *big.Int) *CallFuncFactory