Documentation ¶
Index ¶
- Variables
- type PublicAPI
- func (api *PublicAPI) Accounts() ([]common.Address, error)
- func (api *PublicAPI) BlockNumber() (hexutil.Uint64, error)
- func (api *PublicAPI) Call(args utils.TransactionArgs, blockNrOrHash ethrpc.BlockNumberOrHash, ...) (hexutil.Bytes, error)
- func (api *PublicAPI) ChainId() (*hexutil.Big, error)
- func (api *PublicAPI) EstimateGas(args utils.TransactionArgs, blockNum *ethrpc.BlockNumber) (hexutil.Uint64, error)
- func (api *PublicAPI) GasPrice() (*hexutil.Big, error)
- func (api *PublicAPI) GetBalance(address common.Address, blockNrOrHash ethrpc.BlockNumberOrHash) (*hexutil.Big, error)
- func (api *PublicAPI) GetBlockByHash(blockHash common.Hash, fullTx bool) (map[string]interface{}, error)
- func (api *PublicAPI) GetBlockByNumber(blockNum ethrpc.BlockNumber, fullTx bool) (map[string]interface{}, error)
- func (api *PublicAPI) GetBlockHash(blockNum ethrpc.BlockNumber, _ bool) (common.Hash, error)
- func (api *PublicAPI) GetBlockTransactionCountByHash(blockHash common.Hash) (hexutil.Uint, error)
- func (api *PublicAPI) GetBlockTransactionCountByNumber(blockNum ethrpc.BlockNumber) (hexutil.Uint, error)
- func (api *PublicAPI) GetCode(address common.Address, blockNrOrHash ethrpc.BlockNumberOrHash) (hexutil.Bytes, error)
- func (api *PublicAPI) GetLogs(filter filters.FilterCriteria) ([]*ethtypes.Log, error)
- func (api *PublicAPI) GetStorageAt(address common.Address, position hexutil.Big, ...) (hexutil.Big, error)
- func (api *PublicAPI) GetTransactionByBlockHashAndIndex(blockHash common.Hash, index hexutil.Uint) (*utils.RPCTransaction, error)
- func (api *PublicAPI) GetTransactionByBlockNumberAndIndex(blockNum ethrpc.BlockNumber, index hexutil.Uint) (*utils.RPCTransaction, error)
- func (api *PublicAPI) GetTransactionByHash(hash common.Hash) (*utils.RPCTransaction, error)
- func (api *PublicAPI) GetTransactionCount(ethAddr common.Address, blockNrOrHash ethrpc.BlockNumberOrHash) (*hexutil.Uint64, error)
- func (api *PublicAPI) GetTransactionReceipt(txHash common.Hash) (map[string]interface{}, error)
- func (api *PublicAPI) Hashrate() hexutil.Uint64
- func (api *PublicAPI) Mining() bool
- func (api *PublicAPI) NewRevertError(revertErr error) *RevertError
- func (api *PublicAPI) SendRawTransaction(data hexutil.Bytes) (common.Hash, error)
- type RevertError
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type PublicAPI ¶
PublicAPI is the eth_ prefixed set of APIs in the Web3 JSON-RPC spec.
func NewPublicAPI ¶
func NewPublicAPI( ctx context.Context, client client.RuntimeClient, logger *logging.Logger, chainID uint32, backend indexer.Backend, methodLimits *conf.MethodLimits, ) *PublicAPI
NewPublicAPI creates an instance of the public ETH Web3 API.
func (*PublicAPI) BlockNumber ¶
BlockNumber returns the latest block number.
func (*PublicAPI) Call ¶
func (api *PublicAPI) Call(args utils.TransactionArgs, blockNrOrHash ethrpc.BlockNumberOrHash, _ *utils.StateOverride) (hexutil.Bytes, error)
Call executes the given transaction on the state for the given block number. This function doesn't make any changes in the evm state of blockchain.
func (*PublicAPI) ChainId ¶
nolint:revive,stylecheck ChainId return the EIP-155 chain id for the current network.
func (*PublicAPI) EstimateGas ¶
func (api *PublicAPI) EstimateGas(args utils.TransactionArgs, blockNum *ethrpc.BlockNumber) (hexutil.Uint64, error)
EstimateGas returns an estimate of gas usage for the given transaction .
func (*PublicAPI) GetBalance ¶
func (api *PublicAPI) GetBalance(address common.Address, blockNrOrHash ethrpc.BlockNumberOrHash) (*hexutil.Big, error)
GetBalance returns the provided account's balance up to the provided block number.
func (*PublicAPI) GetBlockByHash ¶
func (api *PublicAPI) GetBlockByHash(blockHash common.Hash, fullTx bool) (map[string]interface{}, error)
GetBlockByHash returns the block identified by hash.
func (*PublicAPI) GetBlockByNumber ¶
func (api *PublicAPI) GetBlockByNumber(blockNum ethrpc.BlockNumber, fullTx bool) (map[string]interface{}, error)
GetBlockByNumber returns the block identified by number.
func (*PublicAPI) GetBlockHash ¶
GetBlockHash returns the block hash by the given number.
func (*PublicAPI) GetBlockTransactionCountByHash ¶
GetBlockTransactionCountByHash returns the number of transactions in the block identified by hash.
func (*PublicAPI) GetBlockTransactionCountByNumber ¶
func (api *PublicAPI) GetBlockTransactionCountByNumber(blockNum ethrpc.BlockNumber) (hexutil.Uint, error)
GetBlockTransactionCountByNumber returns the number of transactions in the block.
func (*PublicAPI) GetCode ¶
func (api *PublicAPI) GetCode(address common.Address, blockNrOrHash ethrpc.BlockNumberOrHash) (hexutil.Bytes, error)
GetCode returns the contract code at the given address and block number.
func (*PublicAPI) GetStorageAt ¶
func (*PublicAPI) GetTransactionByBlockHashAndIndex ¶
func (api *PublicAPI) GetTransactionByBlockHashAndIndex(blockHash common.Hash, index hexutil.Uint) (*utils.RPCTransaction, error)
GetTransactionByBlockHashAndIndex returns the transaction for the given block hash and index.
func (*PublicAPI) GetTransactionByBlockNumberAndIndex ¶
func (api *PublicAPI) GetTransactionByBlockNumberAndIndex(blockNum ethrpc.BlockNumber, index hexutil.Uint) (*utils.RPCTransaction, error)
GetTransactionByBlockNumberAndIndex returns the transaction identified by number and index.
func (*PublicAPI) GetTransactionByHash ¶
GetTransactionByHash returns the transaction identified by hash.
func (*PublicAPI) GetTransactionCount ¶
func (api *PublicAPI) GetTransactionCount(ethAddr common.Address, blockNrOrHash ethrpc.BlockNumberOrHash) (*hexutil.Uint64, error)
GetTransactionCount returns the number of transactions the given address has sent for the given block number.
func (*PublicAPI) GetTransactionReceipt ¶
GetTransactionReceipt returns the transaction receipt by hash.
func (*PublicAPI) Mining ¶
Mining returns whether or not this node is currently mining. Always false.
func (*PublicAPI) NewRevertError ¶
func (api *PublicAPI) NewRevertError(revertErr error) *RevertError
NewRevertError returns an revert error with ABI encoded revert reason.
type RevertError ¶
type RevertError struct { Reason string `json:"reason"` // contains filtered or unexported fields }
func (*RevertError) ErrorData ¶
func (e *RevertError) ErrorData() interface{}
ErrorData returns the ABI encoded error reason.