rpc

package
v1.7.2 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2022 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TxLogsFromEvents

func TxLogsFromEvents(events []abci.Event) ([]*evmtypes.Log, error)

TxLogsFromEvents parses ethereum logs from cosmos events

Types

type AccessList

type AccessList []AccessTuple

func AccessListReplace

func AccessListReplace(eal ethtypes.AccessList) AccessList

AccessListReplace

func (AccessList) StorageKeys

func (al AccessList) StorageKeys() int

StorageKeys returns the total number of storage keys in the access list.

type AccessTuple

type AccessTuple struct {
	Address     sdk.AccAddress `json:"address"        gencodec:"required"`
	StorageKeys []common.Hash  `json:"storageKeys"    gencodec:"required"`
}

AccessTuple is the element type of an access list.

func (AccessTuple) MarshalJSON

func (a AccessTuple) MarshalJSON() ([]byte, error)

MarshalJSON marshals as JSON.

func (*AccessTuple) UnmarshalJSON

func (a *AccessTuple) UnmarshalJSON(input []byte) error

UnmarshalJSON unmarshals from JSON.

type EthLog

type EthLog struct {
	*ethtypes.Log
}

func (EthLog) MarshalJSON

func (l EthLog) MarshalJSON() ([]byte, error)

type ProofAccountResult

type ProofAccountResult struct {
	rpctypes.AccountResult
}

AccountResult refactored structure address type to sdk.AccAddress

func (ProofAccountResult) MarshalJSON

func (p ProofAccountResult) MarshalJSON() ([]byte, error)

MarshalJSON marshals as JSON.

type PublicAPI

type PublicAPI struct {
	// contains filtered or unexported fields
}

PublicAPI is the rpc_ prefixed set of APIs in the Web3 JSON-RPC spec.

func NewPublicAPI

func NewPublicAPI(
	logger log.Logger,
	clientCtx client.Context,
	backend backend.EVMBackend,
	nonceLock *rpctypes.AddrLocker,
) *PublicAPI

NewPublicAPI creates an instance of the public ETH Web3 API.

func (*PublicAPI) Accounts

func (e *PublicAPI) Accounts() ([]sdk.AccAddress, error)

Accounts returns the list of accounts available to this node.

func (*PublicAPI) AddressTranslation

func (e *PublicAPI) AddressTranslation(arg string) (map[string]interface{}, error)

AddressTranslation returns the byte, hex, eip-55, bech32 type information of the incoming address

func (*PublicAPI) BalanceOf

func (e *PublicAPI) BalanceOf(trans rpctypes.TransactionArgs, blockNrOrHash rpctypes.BlockNumberOrHash) (interface{}, error)

BalanceOf returns prc20 balance

func (*PublicAPI) BlockNumber

func (e *PublicAPI) BlockNumber() (hexutil.Uint64, error)

BlockNumber returns the current block number.

func (*PublicAPI) Call

Call performs a raw contract call.

func (*PublicAPI) ChainId

func (e *PublicAPI) ChainId() (*big.Int, error)

ChainId is the EIP-155 replay-protection chain id for the current ethereum chain config.

func (*PublicAPI) ClientCtx

func (e *PublicAPI) ClientCtx() client.Context

ClientCtx returns client context

func (*PublicAPI) Coinbase

func (e *PublicAPI) Coinbase() (string, error)

Coinbase is the address that staking rewards will be send to (alias for Etherbase).

func (*PublicAPI) Ctx

func (e *PublicAPI) Ctx() context.Context

func (*PublicAPI) EstimateGas

func (e *PublicAPI) EstimateGas(trans rpctypes.TransactionArgs, blockNrOptional *rpctypes.BlockNumber) (hexutil.Uint64, error)

EstimateGas returns an estimate of gas usage for the given smart contract call.

func (*PublicAPI) FillTransaction

func (e *PublicAPI) FillTransaction(trans rpctypes.TransactionArgs) (*rpctypes.SignTransactionResult, error)

FillTransaction fills the defaults (nonce, gas, gasPrice or 1559 fields) on a given unsigned transaction, and returns it to the caller for further processing (signing + broadcast).

func (*PublicAPI) GasPrice

func (e *PublicAPI) GasPrice() (*hexutil.Big, error)

GasPrice returns the current gas price based on Ethermint's gas price oracle.

func (*PublicAPI) GetBalance

func (e *PublicAPI) GetBalance(addr sdk.AccAddress, blockNrOrHash rpctypes.BlockNumberOrHash) (*hexutil.Big, error)

GetBalance returns the provided account's balance up to the provided block number.

func (*PublicAPI) GetBlockByHash

func (e *PublicAPI) GetBlockByHash(hash common.Hash, fullTx bool) (result map[string]interface{}, err error)

GetBlockByHash returns the block identified by hash.

func (*PublicAPI) GetBlockByNumber

func (e *PublicAPI) GetBlockByNumber(ethBlockNum rpctypes.BlockNumber, fullTx bool) (result map[string]interface{}, err error)

GetBlockByNumber returns the block identified by number.

func (*PublicAPI) GetBlockTransactionCountByHash

func (e *PublicAPI) GetBlockTransactionCountByHash(hash common.Hash) *hexutil.Uint

GetBlockTransactionCountByHash returns the number of transactions in the block identified by hash.

func (*PublicAPI) GetBlockTransactionCountByNumber

func (e *PublicAPI) GetBlockTransactionCountByNumber(blockNum rpctypes.BlockNumber) *hexutil.Uint

GetBlockTransactionCountByNumber returns the number of transactions in the block identified by number.

func (*PublicAPI) GetCode

func (e *PublicAPI) GetCode(addr sdk.AccAddress, blockNrOrHash rpctypes.BlockNumberOrHash) (hexutil.Bytes, error)

GetCode returns the contract code at the given address and block number.

func (*PublicAPI) GetProof

func (e *PublicAPI) GetProof(addr sdk.AccAddress, storageKeys []string, blockNrOrHash rpctypes.BlockNumberOrHash) (*ProofAccountResult, error)

GetProof returns an account object with proof and any storage proofs

func (*PublicAPI) GetStorageAt

func (e *PublicAPI) GetStorageAt(addr sdk.AccAddress, key string, blockNrOrHash rpctypes.BlockNumberOrHash) (hexutil.Bytes, error)

GetStorageAt returns the contract storage at the given address, block number, and key.

func (*PublicAPI) GetTransactionByHash

func (e *PublicAPI) GetTransactionByHash(hash common.Hash) (*RPCTransactionResult, error)

GetTransactionByHash returns the transaction identified by hash.

func (*PublicAPI) GetTransactionCount

func (e *PublicAPI) GetTransactionCount(addr sdk.AccAddress, blockNrOrHash rpctypes.BlockNumberOrHash) (*hexutil.Uint64, error)

GetTransactionCount returns the number of transactions at the given address up to the given block number.

func (*PublicAPI) GetTransactionLogs

func (e *PublicAPI) GetTransactionLogs(txHash common.Hash) ([]*EthLog, error)

GetTransactionLogs returns the logs given a transaction hash.

func (*PublicAPI) GetTransactionReceipt

func (e *PublicAPI) GetTransactionReceipt(hash common.Hash) (map[string]interface{}, error)

GetTransactionReceipt returns the transaction receipt identified by hash.

func (*PublicAPI) MaxPriorityFeePerGas

func (e *PublicAPI) MaxPriorityFeePerGas() (*hexutil.Big, error)

MaxPriorityFeePerGas returns a suggestion for a gas tip cap for dynamic fee transactions.

func (*PublicAPI) Prc20TokenInfo

func (e *PublicAPI) Prc20TokenInfo(trans rpctypes.TransactionArgs, blockNrOrHash rpctypes.BlockNumberOrHash) map[string]interface{}

Prc20TokenInfo returns to the basic information of prc20 token contract

func (*PublicAPI) QueryClient

func (e *PublicAPI) QueryClient() *rpctypes.QueryClient

func (*PublicAPI) Resend

func (e *PublicAPI) Resend(ctx context.Context, trans rpctypes.TransactionArgs, gasPrice *hexutil.Big, gasLimit *hexutil.Uint64) (common.Hash, error)

Resend accepts an existing transaction and a new gas price and limit. It will remove the given transaction from the pool and reinsert it with the new gas price and limit.

func (*PublicAPI) SendRawTransaction

func (e *PublicAPI) SendRawTransaction(data hexutil.Bytes) (common.Hash, error)

TODO: SendRawTransaction send a raw Ethereum transaction.

func (*PublicAPI) SendTransaction

func (e *PublicAPI) SendTransaction(trans rpctypes.TransactionArgs) (common.Hash, error)

SendTransaction sends an Ethereum transaction.

func (*PublicAPI) Sha3

func (e *PublicAPI) Sha3(input hexutil.Bytes) hexutil.Bytes

Sha3 returns the keccak-256 hash of the passed-in input.

func (*PublicAPI) Sign

func (e *PublicAPI) Sign(addr sdk.AccAddress, data hexutil.Bytes) (hexutil.Bytes, error)

TODO: Sign signs the provided data using the private key of address via Geth's signature standard.

func (*PublicAPI) Syncing

func (e *PublicAPI) Syncing() (interface{}, error)

Syncing returns false in case the node is currently not syncing with the network. It can be up to date or has not yet received the latest block headers from its pears. In case it is synchronizing: - startingBlock: block number this node started to synchronize from - currentBlock: block number this node is currently importing - highestBlock: block number of the highest block header this node has received from peers - pulledStates: number of state entries processed until now - knownStates: number of known state entries that still need to be pulled

type RPCTransactionResult

type RPCTransactionResult struct {
	*rpctypes.RPCTransaction
}

func (RPCTransactionResult) MarshalJSON

func (r RPCTransactionResult) MarshalJSON() ([]byte, error)

MarshalJSON marshals as JSON.

Jump to

Keyboard shortcuts

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