Documentation ¶
Overview ¶
Package eth implements RPC API bindings for methods in the "eth" namespace.
Index ¶
- func Balance(addr common.Address, blockNumber *big.Int) core.CallFactoryReturns[big.Int]
- func BlockByHash(hash common.Hash) interface{ ... }
- func BlockByNumber(number *big.Int) interface{ ... }
- func BlockNumber() core.CallFactoryReturns[big.Int]
- func Call(msg ethereum.CallMsg, blockNumber *big.Int, overrides AccountOverrides) core.CallFactoryReturns[[]byte]
- func ChainID() core.CallFactoryReturns[uint64]
- func Code(addr common.Address, blockNumber *big.Int) core.CallFactoryReturns[[]byte]
- func GasPrice() core.CallFactoryReturns[big.Int]
- func HeaderByHash(hash common.Hash) interface{ ... }
- func HeaderByNumber(number *big.Int) interface{ ... }
- func Logs(q ethereum.FilterQuery) core.CallFactoryReturns[[]types.Log]
- func Nonce(addr common.Address, blockNumber *big.Int) core.CallFactoryReturns[uint64]
- func SendRawTransaction(rawTx []byte) core.CallFactoryReturns[common.Hash]
- func SendTransaction(tx *types.Transaction) core.CallFactoryReturns[common.Hash]
- func StorageAt(addr common.Address, slot common.Hash, blockNumber *big.Int) core.CallFactoryReturns[common.Hash]
- func TransactionByHash(hash common.Hash) interface{ ... }
- func TransactionReceipt(hash common.Hash) interface{ ... }
- type Account
- type AccountOverrides
- 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 AccountOverrides) *CallFuncFactory
- func (f *CallFuncFactory) Returns(returns ...any) core.Caller
- type RPCBlock
- type RPCHeader
- type RPCReceipt
- type RPCTransaction
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 ¶ added in v0.2.0
func BlockByHash(hash common.Hash) interface { core.CallFactoryReturns[types.Block] core.CallFactoryReturnsRAW[RPCBlock] }
BlockByHash requests the block with full transactions with the given hash.
func BlockByNumber ¶ added in v0.2.0
func BlockByNumber(number *big.Int) interface { core.CallFactoryReturns[types.Block] core.CallFactoryReturnsRAW[RPCBlock] }
BlockByNumber requests the block with full transactions with the given number.
func BlockNumber ¶
func BlockNumber() core.CallFactoryReturns[big.Int]
BlockNumber requests the number of the most recent block.
func Call ¶
func Call(msg ethereum.CallMsg, blockNumber *big.Int, overrides AccountOverrides) core.CallFactoryReturns[[]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 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 GasPrice ¶
func GasPrice() core.CallFactoryReturns[big.Int]
GasPrice requests the current gas price in wei.
func HeaderByHash ¶ added in v0.2.0
func HeaderByHash(hash common.Hash) interface { core.CallFactoryReturns[types.Header] core.CallFactoryReturnsRAW[RPCHeader] }
HeaderByHash requests the header with the given hash.
func HeaderByNumber ¶ added in v0.2.0
func HeaderByNumber(number *big.Int) interface { core.CallFactoryReturns[types.Header] core.CallFactoryReturnsRAW[RPCHeader] }
HeaderByNumber requests the header with the given number.
func Logs ¶ added in v0.2.0
func Logs(q ethereum.FilterQuery) core.CallFactoryReturns[[]types.Log]
Logs requests the logs of the given ethereum.FilterQuery q.
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 SendRawTransaction ¶ added in v0.2.0
func SendRawTransaction(rawTx []byte) core.CallFactoryReturns[common.Hash]
SendRawTransaction sends a raw transaction to the network.
func SendTransaction ¶ added in v0.2.0
func SendTransaction(tx *types.Transaction) core.CallFactoryReturns[common.Hash]
SendTransaction sends a signed transaction to the network.
func StorageAt ¶
func StorageAt(addr common.Address, slot common.Hash, blockNumber *big.Int) core.CallFactoryReturns[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 TransactionByHash ¶ added in v0.2.0
func TransactionByHash(hash common.Hash) interface { core.CallFactoryReturns[types.Transaction] core.CallFactoryReturnsRAW[RPCTransaction] }
TransactionByHash requests the transaction with the given hash.
func TransactionReceipt ¶ added in v0.2.0
func TransactionReceipt(hash common.Hash) interface { core.CallFactoryReturns[types.Receipt] core.CallFactoryReturnsRAW[RPCReceipt] }
TransactionReceipt requests the receipt of the transaction with the given hash.
Types ¶
type Account ¶ added in v0.6.0
type Account struct { Nonce *uint64 Code []byte Balance *big.Int State map[common.Hash]common.Hash StateDiff map[common.Hash]common.Hash }
func (Account) MarshalJSON ¶ added in v0.6.0
MarshalJSON implements the json.Marshaler.
type AccountOverrides ¶ added in v0.6.0
AccountOverrides is the collection of overridden accounts.
type CallFuncFactory ¶
type CallFuncFactory struct {
// contains filtered or unexported fields
}
func CallFunc ¶
CallFunc requests the returns of Func fn 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)
CreateRequest implements the core.RequestCreator interface.
func (*CallFuncFactory) From ¶ added in v0.6.0
func (f *CallFuncFactory) From(from common.Address) *CallFuncFactory
func (*CallFuncFactory) HandleResponse ¶
func (f *CallFuncFactory) HandleResponse(elem rpc.BatchElem) error
HandleResponse implements the core.ResponseHandler interface.
func (*CallFuncFactory) Overrides ¶ added in v0.6.0
func (f *CallFuncFactory) Overrides(overrides AccountOverrides) *CallFuncFactory
type RPCBlock ¶ added in v0.5.0
type RPCBlock struct { Hash common.Hash `json:"hash"` Transactions []RPCTransaction `json:"transactions"` UncleHashes []common.Hash `json:"uncles"` ParentHash common.Hash `json:"parentHash" gencodec:"required"` UncleHash common.Hash `json:"sha3Uncles" gencodec:"required"` Coinbase common.Address `json:"miner" gencodec:"required"` Root common.Hash `json:"stateRoot" gencodec:"required"` TxHash common.Hash `json:"transactionsRoot" gencodec:"required"` ReceiptHash common.Hash `json:"receiptsRoot" gencodec:"required"` Bloom types.Bloom `json:"logsBloom" gencodec:"required"` Difficulty *big.Int `json:"difficulty" gencodec:"required"` Number *big.Int `json:"number" gencodec:"required"` GasLimit uint64 `json:"gasLimit" gencodec:"required"` GasUsed uint64 `json:"gasUsed" gencodec:"required"` Time uint64 `json:"timestamp" gencodec:"required"` Extra []byte `json:"extraData" gencodec:"required"` MixDigest common.Hash `json:"mixHash"` Nonce types.BlockNonce `json:"nonce"` BaseFee *big.Int `json:"baseFeePerGas" rlp:"optional"` }
func (RPCBlock) MarshalJSON ¶ added in v0.5.0
MarshalJSON marshals as JSON.
func (*RPCBlock) UnmarshalJSON ¶ added in v0.5.0
UnmarshalJSON unmarshals from JSON.
type RPCHeader ¶ added in v0.5.0
type RPCHeader struct { Hash common.Hash `json:"hash"` TransactionHashes []common.Hash `json:"transactions"` UncleHashes []common.Hash `json:"uncles"` ParentHash common.Hash `json:"parentHash" gencodec:"required"` UncleHash common.Hash `json:"sha3Uncles" gencodec:"required"` Coinbase common.Address `json:"miner" gencodec:"required"` Root common.Hash `json:"stateRoot" gencodec:"required"` TxHash common.Hash `json:"transactionsRoot" gencodec:"required"` ReceiptHash common.Hash `json:"receiptsRoot" gencodec:"required"` Bloom types.Bloom `json:"logsBloom" gencodec:"required"` Difficulty *big.Int `json:"difficulty" gencodec:"required"` Number *big.Int `json:"number" gencodec:"required"` GasLimit uint64 `json:"gasLimit" gencodec:"required"` GasUsed uint64 `json:"gasUsed" gencodec:"required"` Time uint64 `json:"timestamp" gencodec:"required"` Extra []byte `json:"extraData" gencodec:"required"` MixDigest common.Hash `json:"mixHash"` Nonce types.BlockNonce `json:"nonce"` BaseFee *big.Int `json:"baseFeePerGas" rlp:"optional"` }
func (RPCHeader) MarshalJSON ¶ added in v0.5.0
MarshalJSON marshals as JSON.
func (*RPCHeader) UnmarshalJSON ¶ added in v0.5.0
UnmarshalJSON unmarshals from JSON.
type RPCReceipt ¶ added in v0.5.0
type RPCReceipt struct { TransactionHash common.Hash `json:"transactionHash"` TransactionIndex uint64 `json:"transactionIndex"` BlockHash common.Hash `json:"blockHash"` BlockNumber *big.Int `json:"blockNumber"` From common.Address `json:"from"` To *common.Address `json:"to"` CumulativeGasUsed uint64 `json:"cumulativeGasUsed"` GasUsed uint64 `json:"gasUsed"` ContractAddress *common.Address `json:"contractAddress"` Logs []*types.Log `json:"logs"` LogsBloom types.Bloom `json:"logsBloom"` Type uint64 `json:"type"` Status uint64 `json:"status"` // 1 (success) or 0 (failure) }
func (RPCReceipt) MarshalJSON ¶ added in v0.5.0
func (r RPCReceipt) MarshalJSON() ([]byte, error)
MarshalJSON marshals as JSON.
func (*RPCReceipt) UnmarshalJSON ¶ added in v0.5.0
func (r *RPCReceipt) UnmarshalJSON(input []byte) error
UnmarshalJSON unmarshals from JSON.
type RPCTransaction ¶ added in v0.5.0
type RPCTransaction struct { BlockHash *common.Hash `json:"blockHash"` BlockNumber *big.Int `json:"blockNumber"` From common.Address `json:"from"` Gas uint64 `json:"gas"` GasPrice *big.Int `json:"gasPrice"` GasFeeCap *big.Int `json:"maxFeePerGas,omitempty"` GasTipCap *big.Int `json:"maxPriorityFeePerGas,omitempty"` Hash common.Hash `json:"hash"` Input []byte `json:"input"` Nonce uint64 `json:"nonce"` To *common.Address `json:"to"` TransactionIndex *uint64 `json:"transactionIndex"` Value *big.Int `json:"value"` Type uint64 `json:"type"` Accesses *types.AccessList `json:"accessList,omitempty"` ChainID *big.Int `json:"chainId,omitempty"` V *big.Int `json:"v"` R *big.Int `json:"r"` S *big.Int `json:"s"` }
func (RPCTransaction) MarshalJSON ¶ added in v0.5.0
func (r RPCTransaction) MarshalJSON() ([]byte, error)
MarshalJSON marshals as JSON.
func (*RPCTransaction) UnmarshalJSON ¶ added in v0.5.0
func (r *RPCTransaction) UnmarshalJSON(input []byte) error
UnmarshalJSON unmarshals from JSON.
Source Files ¶
- block_number.go
- call.go
- chain_id.go
- common.go
- doc.go
- gas_price.go
- get_balance.go
- get_block_by_hash.go
- get_block_by_number.go
- get_code.go
- get_logs.go
- get_storage_at.go
- get_transaction_by_hash.go
- get_transaction_count.go
- get_transaction_receipt.go
- send_raw_transaction.go
- types.go
- types_block.gen.go
- types_header.gen.go
- types_receipt.gen.go
- types_transaction.gen.go