Documentation ¶
Index ¶
- func ParseInt(value string) (int, error)
- type PublicEthereumAPI
- func (api *PublicEthereumAPI) BlockNumber() (hexutil.Uint64, error)
- func (api *PublicEthereumAPI) Call(args types2.CallArgs, blockNr rpc.BlockNumber, ...) (hexutil.Bytes, error)
- func (api *PublicEthereumAPI) ChainId() (hexutil.Uint, error)
- func (api *PublicEthereumAPI) EstimateGas(args types2.CallArgs) (hexutil.Uint64, error)
- func (api *PublicEthereumAPI) FeeHistory(ctx context.Context, blockCount rpctypes.DecimalOrHex, ...) (*feeHistoryResult, error)
- func (api *PublicEthereumAPI) GasPrice() *hexutil.Big
- func (api *PublicEthereumAPI) GetBalance(address common.Address, blockNum rpctypes.BlockNumber) (*hexutil.Big, error)
- func (api *PublicEthereumAPI) GetBlockByHash(hash common.Hash, fullTx bool) (map[string]interface{}, error)
- func (api *PublicEthereumAPI) GetBlockByNumber(blockNum rpc.BlockNumber, fullTx bool) (map[string]interface{}, error)
- func (api *PublicEthereumAPI) GetBlockTransactionCountByHash(hash common.Hash) *hexutil.Uint
- func (api *PublicEthereumAPI) GetBlockTransactionCountByNumber(blockNum string) *hexutil.Uint
- func (api *PublicEthereumAPI) GetCode(address common.Address, blockNum rpctypes.BlockNumber) (hexutil.Bytes, error)
- func (api *PublicEthereumAPI) GetEthTransactionByHash(hash *types.Hash) (*types2.EthTransaction, *pb.TransactionMeta, error)
- func (api *PublicEthereumAPI) GetStorageAt(address common.Address, key string, blockNum rpctypes.BlockNumber) (hexutil.Bytes, error)
- func (api *PublicEthereumAPI) GetTransactionByBlockHashAndIndex(hash common.Hash, idx hexutil.Uint) (*rpctypes.RPCTransaction, error)
- func (api *PublicEthereumAPI) GetTransactionByBlockNumberAndIndex(blockNum rpctypes.BlockNumber, idx hexutil.Uint) (*rpctypes.RPCTransaction, error)
- func (api *PublicEthereumAPI) GetTransactionByHash(hash common.Hash) (*rpctypes.RPCTransaction, error)
- func (api *PublicEthereumAPI) GetTransactionCount(address common.Address, blockNum rpctypes.BlockNumber) (*hexutil.Uint64, error)
- func (api *PublicEthereumAPI) GetTransactionLogs(txHash common.Hash) ([]*pb.EvmLog, error)
- func (api *PublicEthereumAPI) GetTransactionReceipt(hash common.Hash) (map[string]interface{}, error)
- func (api *PublicEthereumAPI) GetUncleByBlockHashAndIndex(hash common.Hash, idx hexutil.Uint) map[string]interface{}
- func (api *PublicEthereumAPI) GetUncleByBlockNumberAndIndex(number hexutil.Uint, idx hexutil.Uint) map[string]interface{}
- func (api *PublicEthereumAPI) GetUncleCountByBlockHash(_ common.Hash) hexutil.Uint
- func (api *PublicEthereumAPI) GetUncleCountByBlockNumber(_ uint64) hexutil.Uint
- func (api *PublicEthereumAPI) Hashrate() hexutil.Uint64
- func (api *PublicEthereumAPI) MaxPriorityFeePerGas(ctx context.Context) (*hexutil.Big, error)
- func (api *PublicEthereumAPI) Mining() bool
- func (api *PublicEthereumAPI) PendingTransactions() ([]*rpctypes.RPCTransaction, error)
- func (api *PublicEthereumAPI) ProtocolVersion() hexutil.Uint
- func (api *PublicEthereumAPI) SendRawTransaction(data hexutil.Bytes) (common.Hash, error)
- func (api *PublicEthereumAPI) Syncing() (interface{}, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type PublicEthereumAPI ¶
type PublicEthereumAPI struct {
// contains filtered or unexported fields
}
PublicEthereumAPI is the eth_ prefixed set of APIs in the Web3 JSON-RPC spec.
func NewAPI ¶
func NewAPI(config *repo.Config, api api.CoreAPI, logger logrus.FieldLogger) (*PublicEthereumAPI, error)
NewAPI creates an instance of the public ETH Web3 API.
func (*PublicEthereumAPI) BlockNumber ¶
func (api *PublicEthereumAPI) BlockNumber() (hexutil.Uint64, error)
BlockNumber returns the current block number.
func (*PublicEthereumAPI) Call ¶
func (api *PublicEthereumAPI) Call(args types2.CallArgs, blockNr rpc.BlockNumber, _ *map[common.Address]rpctypes.Account) (hexutil.Bytes, error)
Call performs a raw contract call.
func (*PublicEthereumAPI) ChainId ¶
func (api *PublicEthereumAPI) ChainId() (hexutil.Uint, error)
ChainId returns the chain's identifier in hex format
func (*PublicEthereumAPI) EstimateGas ¶
EstimateGas returns an estimate of gas usage for the given smart contract call. It adds 2,000 gas to the returned value instead of using the gas adjustment param from the SDK.
func (*PublicEthereumAPI) FeeHistory ¶ added in v1.11.1
func (api *PublicEthereumAPI) FeeHistory(ctx context.Context, blockCount rpctypes.DecimalOrHex, lastBlock rpc.BlockNumber, rewardPercentiles []float64) (*feeHistoryResult, error)
func (*PublicEthereumAPI) GasPrice ¶
func (api *PublicEthereumAPI) GasPrice() *hexutil.Big
GasPrice returns the current gas price based on Ethermint's gas price oracle.
func (*PublicEthereumAPI) GetBalance ¶
func (api *PublicEthereumAPI) GetBalance(address common.Address, blockNum rpctypes.BlockNumber) (*hexutil.Big, error)
GetBalance returns the provided account's balance, blockNum is ignored.
func (*PublicEthereumAPI) GetBlockByHash ¶
func (api *PublicEthereumAPI) GetBlockByHash(hash common.Hash, fullTx bool) (map[string]interface{}, error)
GetBlockByHash returns the block identified by hash.
func (*PublicEthereumAPI) GetBlockByNumber ¶
func (api *PublicEthereumAPI) GetBlockByNumber(blockNum rpc.BlockNumber, fullTx bool) (map[string]interface{}, error)
GetBlockByNumber returns the block identified by number.
func (*PublicEthereumAPI) GetBlockTransactionCountByHash ¶
func (api *PublicEthereumAPI) GetBlockTransactionCountByHash(hash common.Hash) *hexutil.Uint
GetBlockTransactionCountByHash returns the number of transactions in the block identified by hash.
func (*PublicEthereumAPI) GetBlockTransactionCountByNumber ¶
func (api *PublicEthereumAPI) GetBlockTransactionCountByNumber(blockNum string) *hexutil.Uint
GetBlockTransactionCountByNumber returns the number of transactions in the block identified by its height.
func (*PublicEthereumAPI) GetCode ¶
func (api *PublicEthereumAPI) GetCode(address common.Address, blockNum rpctypes.BlockNumber) (hexutil.Bytes, error)
GetCode returns the contract code at the given address, blockNum is ignored.
func (*PublicEthereumAPI) GetEthTransactionByHash ¶ added in v1.9.0
func (api *PublicEthereumAPI) GetEthTransactionByHash(hash *types.Hash) (*types2.EthTransaction, *pb.TransactionMeta, error)
func (*PublicEthereumAPI) GetStorageAt ¶
func (api *PublicEthereumAPI) GetStorageAt(address common.Address, key string, blockNum rpctypes.BlockNumber) (hexutil.Bytes, error)
GetStorageAt returns the contract storage at the given address and key, blockNum is ignored.
func (*PublicEthereumAPI) GetTransactionByBlockHashAndIndex ¶
func (api *PublicEthereumAPI) GetTransactionByBlockHashAndIndex(hash common.Hash, idx hexutil.Uint) (*rpctypes.RPCTransaction, error)
GetTransactionByBlockHashAndIndex returns the transaction identified by hash and index.
func (*PublicEthereumAPI) GetTransactionByBlockNumberAndIndex ¶
func (api *PublicEthereumAPI) GetTransactionByBlockNumberAndIndex(blockNum rpctypes.BlockNumber, idx hexutil.Uint) (*rpctypes.RPCTransaction, error)
GetTransactionByBlockNumberAndIndex returns the transaction identified by number and index.
func (*PublicEthereumAPI) GetTransactionByHash ¶
func (api *PublicEthereumAPI) GetTransactionByHash(hash common.Hash) (*rpctypes.RPCTransaction, error)
GetTransactionByHash returns the transaction identified by hash.
func (*PublicEthereumAPI) GetTransactionCount ¶
func (api *PublicEthereumAPI) GetTransactionCount(address common.Address, blockNum rpctypes.BlockNumber) (*hexutil.Uint64, error)
GetTransactionCount returns the number of transactions at the given address, blockNum is ignored.
func (*PublicEthereumAPI) GetTransactionLogs ¶
GetTransactionLogs returns the logs given a transaction hash.
func (*PublicEthereumAPI) GetTransactionReceipt ¶
func (api *PublicEthereumAPI) GetTransactionReceipt(hash common.Hash) (map[string]interface{}, error)
GetTransactionReceipt returns the transaction receipt identified by hash.
func (*PublicEthereumAPI) GetUncleByBlockHashAndIndex ¶
func (api *PublicEthereumAPI) GetUncleByBlockHashAndIndex(hash common.Hash, idx hexutil.Uint) map[string]interface{}
GetUncleByBlockHashAndIndex returns the uncle identified by hash and index. Always returns nil.
func (*PublicEthereumAPI) GetUncleByBlockNumberAndIndex ¶
func (api *PublicEthereumAPI) GetUncleByBlockNumberAndIndex(number hexutil.Uint, idx hexutil.Uint) map[string]interface{}
GetUncleByBlockNumberAndIndex returns the uncle identified by number and index. Always returns nil.
func (*PublicEthereumAPI) GetUncleCountByBlockHash ¶
func (api *PublicEthereumAPI) GetUncleCountByBlockHash(_ common.Hash) hexutil.Uint
GetUncleCountByBlockHash returns the number of uncles in the block identified by hash. Always zero.
func (*PublicEthereumAPI) GetUncleCountByBlockNumber ¶
func (api *PublicEthereumAPI) GetUncleCountByBlockNumber(_ uint64) hexutil.Uint
func (*PublicEthereumAPI) Hashrate ¶
func (api *PublicEthereumAPI) Hashrate() hexutil.Uint64
Hashrate returns the current node's hashrate. Always 0.
func (*PublicEthereumAPI) MaxPriorityFeePerGas ¶ added in v1.11.1
MaxPriorityFeePerGas returns a suggestion for a gas tip cap for dynamic transactions.
func (*PublicEthereumAPI) Mining ¶
func (api *PublicEthereumAPI) Mining() bool
Mining returns whether or not this node is currently mining. Always false.
func (*PublicEthereumAPI) PendingTransactions ¶
func (api *PublicEthereumAPI) PendingTransactions() ([]*rpctypes.RPCTransaction, error)
PendingTransactions returns the transactions that are in the transaction pool and have a from address that is one of the accounts this node manages.
func (*PublicEthereumAPI) ProtocolVersion ¶
func (api *PublicEthereumAPI) ProtocolVersion() hexutil.Uint
ProtocolVersion returns the supported Ethereum protocol version.
func (*PublicEthereumAPI) SendRawTransaction ¶
SendRawTransaction send a raw Ethereum transaction.
func (*PublicEthereumAPI) Syncing ¶
func (api *PublicEthereumAPI) Syncing() (interface{}, error)
Syncing returns whether or not the current node is syncing with other peers. Returns false if not, or a struct outlining the state of the sync if it is.