Documentation
¶
Overview ¶
Package eth implements RPC API bindings for methods in the "eth" namespace.
Index ¶
- func BlockByHash(hash common.Hash) interface{ ... }
- func BlockByNumber(number *big.Int) interface{ ... }
- func BlockNumber() core.CallFactoryReturns[big.Int]
- func ChainID() core.CallFactoryReturns[uint64]
- 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 SendRawTransaction(rawTx []byte) core.CallFactoryReturns[common.Hash]
- func SendTransaction(tx *types.Transaction) core.CallFactoryReturns[common.Hash]
- func TransactionByHash(hash common.Hash) interface{ ... }
- func TransactionReceipt(hash common.Hash) interface{ ... }
- type Account
- type AccountOverrides
- type BalanceFactory
- type CallFactory
- func (f *CallFactory) AtBlock(blockNumber *big.Int) *CallFactory
- func (f *CallFactory) CreateRequest() (rpc.BatchElem, error)
- func (f *CallFactory) HandleResponse(elem rpc.BatchElem) error
- func (f *CallFactory) Overrides(overrides AccountOverrides) *CallFactory
- func (f *CallFactory) Returns(output *[]byte) core.Caller
- 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 CodeFactory
- type NonceFactory
- type RPCBlock
- type RPCHeader
- type RPCReceipt
- type RPCTransaction
- type StorageAtFactory
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 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 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 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 BalanceFactory ¶ added in v0.2.0
type BalanceFactory struct {
// contains filtered or unexported fields
}
func Balance ¶
func Balance(addr common.Address) *BalanceFactory
Balance requests the balance of the given common.Address addr.
func (*BalanceFactory) AtBlock ¶ added in v0.2.0
func (f *BalanceFactory) AtBlock(blockNumber *big.Int) *BalanceFactory
func (*BalanceFactory) CreateRequest ¶ added in v0.2.0
func (f *BalanceFactory) CreateRequest() (rpc.BatchElem, error)
CreateRequest implements the core.RequestCreator interface.
func (*BalanceFactory) HandleResponse ¶ added in v0.2.0
func (f *BalanceFactory) HandleResponse(elem rpc.BatchElem) error
HandleResponse implements the core.ResponseHandler interface.
type CallFactory ¶
type CallFactory struct {
// contains filtered or unexported fields
}
func Call ¶
func Call(msg ethereum.CallMsg) *CallFactory
Call requests the output data of the given message.
func (*CallFactory) AtBlock ¶
func (f *CallFactory) AtBlock(blockNumber *big.Int) *CallFactory
func (*CallFactory) CreateRequest ¶
func (f *CallFactory) CreateRequest() (rpc.BatchElem, error)
CreateRequest implements the core.RequestCreator interface.
func (*CallFactory) HandleResponse ¶
func (f *CallFactory) HandleResponse(elem rpc.BatchElem) error
HandleResponse implements the core.ResponseHandler interface.
func (*CallFactory) Overrides ¶ added in v0.6.0
func (f *CallFactory) Overrides(overrides AccountOverrides) *CallFactory
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 CodeFactory ¶ added in v0.2.0
type CodeFactory struct {
// contains filtered or unexported fields
}
func Code ¶
func Code(addr common.Address) *CodeFactory
Code requests the contract code of the given common.Address addr.
func (*CodeFactory) AtBlock ¶ added in v0.2.0
func (f *CodeFactory) AtBlock(blockNumber *big.Int) *CodeFactory
func (*CodeFactory) CreateRequest ¶ added in v0.2.0
func (f *CodeFactory) CreateRequest() (rpc.BatchElem, error)
CreateRequest implements the core.RequestCreator interface.
func (*CodeFactory) HandleResponse ¶ added in v0.2.0
func (f *CodeFactory) HandleResponse(elem rpc.BatchElem) error
HandleResponse implements the core.ResponseHandler interface.
type NonceFactory ¶ added in v0.2.0
type NonceFactory struct {
// contains filtered or unexported fields
}
func Nonce ¶
func Nonce(addr common.Address) *NonceFactory
Nonce requests the nonce of the given common.Address addr.
func (*NonceFactory) AtBlock ¶ added in v0.2.0
func (f *NonceFactory) AtBlock(blockNumber *big.Int) *NonceFactory
func (*NonceFactory) CreateRequest ¶ added in v0.2.0
func (f *NonceFactory) CreateRequest() (rpc.BatchElem, error)
CreateRequest implements the core.RequestCreator interface.
func (*NonceFactory) HandleResponse ¶ added in v0.2.0
func (f *NonceFactory) HandleResponse(elem rpc.BatchElem) error
HandleResponse implements the core.ResponseHandler interface.
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.
type StorageAtFactory ¶ added in v0.2.0
type StorageAtFactory struct {
// contains filtered or unexported fields
}
func StorageAt ¶
func StorageAt(addr common.Address, slot common.Hash) *StorageAtFactory
StorageAt requests the storage of the given common.Address addr at the given common.Hash slot.
func (*StorageAtFactory) AtBlock ¶ added in v0.2.0
func (f *StorageAtFactory) AtBlock(blockNumber *big.Int) *StorageAtFactory
func (*StorageAtFactory) CreateRequest ¶ added in v0.2.0
func (f *StorageAtFactory) CreateRequest() (rpc.BatchElem, error)
CreateRequest implements the core.RequestCreator interface.
func (*StorageAtFactory) HandleResponse ¶ added in v0.2.0
func (f *StorageAtFactory) HandleResponse(elem rpc.BatchElem) error
HandleResponse implements the core.ResponseHandler interface.
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