eth

package
v1.24.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 13, 2022 License: GPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseInt added in v1.23.0

func ParseInt(value string) (int, error)

ParseInt parse hex string value to int

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

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

func (api *PublicEthereumAPI) EstimateGas(args types2.CallArgs) (hexutil.Uint64, error)

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

func (api *PublicEthereumAPI) GetTransactionLogs(txHash common.Hash) ([]*pb.EvmLog, error)

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

func (api *PublicEthereumAPI) MaxPriorityFeePerGas(ctx context.Context) (*hexutil.Big, error)

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

func (api *PublicEthereumAPI) SendRawTransaction(data hexutil.Bytes) (common.Hash, error)

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.

Directories

Path Synopsis
Package filters implements an ethereum filtering system for block, transactions and log events.
Package filters implements an ethereum filtering system for block, transactions and log events.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL