Documentation
¶
Overview ¶
Copyright (c) 2023-2024 Nibi, Inc.
Copyright (c) 2023-2024 Nibi, Inc.
Copyright (c) 2023-2024 Nibi, Inc.
Copyright (c) 2023-2024 Nibi, Inc.
Copyright (c) 2023-2024 Nibi, Inc.
Copyright (c) 2023-2024 Nibi, Inc.
Index ¶
- Constants
- func GetRPCAPIs(ctx *server.Context, clientCtx client.Context, tmWSClient *rpcclient.WSClient, ...) []rpc.API
- type APICreator
- type APIWeb3
- type ErrorMessageJSON
- type ErrorResponseJSON
- type EthAPI
- func (e *EthAPI) Accounts() ([]common.Address, error)
- func (e *EthAPI) BlockNumber() (hexutil.Uint64, error)
- func (e *EthAPI) Call(args evm.JsonTxArgs, blockNrOrHash rpc.BlockNumberOrHash, _ *rpc.StateOverride) (hexutil.Bytes, error)
- func (e *EthAPI) ChainId() (*hexutil.Big, error)
- func (e *EthAPI) EstimateGas(args evm.JsonTxArgs, blockNrOptional *rpc.BlockNumber) (hexutil.Uint64, error)
- func (e *EthAPI) FeeHistory(blockCount gethrpc.DecimalOrHex, lastBlock gethrpc.BlockNumber, ...) (*rpc.FeeHistoryResult, error)
- func (e *EthAPI) FillTransaction(args evm.JsonTxArgs) (*rpc.SignTransactionResult, error)
- func (e *EthAPI) GasPrice() (*hexutil.Big, error)
- func (e *EthAPI) GetBalance(address common.Address, blockNrOrHash rpc.BlockNumberOrHash) (*hexutil.Big, error)
- func (e *EthAPI) GetBlockByHash(hash common.Hash, fullTx bool) (map[string]interface{}, error)
- func (e *EthAPI) GetBlockByNumber(ethBlockNum rpc.BlockNumber, fullTx bool) (map[string]interface{}, error)
- func (e *EthAPI) GetBlockTransactionCountByHash(hash common.Hash) *hexutil.Uint
- func (e *EthAPI) GetBlockTransactionCountByNumber(blockNum rpc.BlockNumber) *hexutil.Uint
- func (e *EthAPI) GetCode(address common.Address, blockNrOrHash rpc.BlockNumberOrHash) (hexutil.Bytes, error)
- func (e *EthAPI) GetPendingTransactions() ([]*rpc.EthTxJsonRPC, error)
- func (e *EthAPI) GetProof(address common.Address, storageKeys []string, ...) (*rpc.AccountResult, error)
- func (e *EthAPI) GetStorageAt(address common.Address, key string, blockNrOrHash rpc.BlockNumberOrHash) (hexutil.Bytes, error)
- func (e *EthAPI) GetTransactionByBlockHashAndIndex(hash common.Hash, idx hexutil.Uint) (*rpc.EthTxJsonRPC, error)
- func (e *EthAPI) GetTransactionByBlockNumberAndIndex(blockNum rpc.BlockNumber, idx hexutil.Uint) (*rpc.EthTxJsonRPC, error)
- func (e *EthAPI) GetTransactionByHash(hash common.Hash) (*rpc.EthTxJsonRPC, error)
- func (e *EthAPI) GetTransactionCount(address common.Address, blockNrOrHash rpc.BlockNumberOrHash) (*hexutil.Uint64, error)
- func (e *EthAPI) GetTransactionLogs(txHash common.Hash) ([]*gethcore.Log, error)
- func (e *EthAPI) GetTransactionReceipt(hash common.Hash) (map[string]interface{}, error)
- func (e *EthAPI) GetUncleByBlockHashAndIndex(_ common.Hash, _ hexutil.Uint) map[string]interface{}
- func (e *EthAPI) GetUncleByBlockNumberAndIndex(_, _ hexutil.Uint) map[string]interface{}
- func (e *EthAPI) GetUncleCountByBlockHash(_ common.Hash) hexutil.Uint
- func (e *EthAPI) GetUncleCountByBlockNumber(_ rpc.BlockNumber) hexutil.Uint
- func (e *EthAPI) MaxPriorityFeePerGas() (*hexutil.Big, error)
- func (e *EthAPI) ProtocolVersion() hexutil.Uint
- func (e *EthAPI) Resend(_ context.Context, args evm.JsonTxArgs, gasPrice *hexutil.Big, ...) (common.Hash, error)
- func (e *EthAPI) SendRawTransaction(data hexutil.Bytes) (common.Hash, error)
- func (e *EthAPI) SendTransaction(txArgs evm.JsonTxArgs) (common.Hash, error)
- func (e *EthAPI) SignTypedData(address common.Address, typedData apitypes.TypedData) (hexutil.Bytes, error)
- func (e *EthAPI) Syncing() (interface{}, error)
- type IEthAPI
- type NetAPI
- type SubscriptionNotification
- type SubscriptionResponseJSON
- type SubscriptionResult
- type TxPoolAPI
- type WebsocketsServer
Constants ¶
const ( // Cosmos namespaces NamespaceCosmos = "cosmos" // Ethereum namespaces NamespaceWeb3 = "web3" NamespaceEth = "eth" NamespaceNet = "net" NamespaceTxPool = "txpool" NamespaceDebug = "debug" )
RPC namespaces and API version
Variables ¶
This section is empty.
Functions ¶
Types ¶
type APICreator ¶
type APICreator = func( ctx *server.Context, clientCtx client.Context, tendermintWebsocketClient *rpcclient.WSClient, allowUnprotectedTxs bool, indexer eth.EVMTxIndexer, ) []rpc.API
APICreator creates the JSON-RPC API implementations.
type APIWeb3 ¶
type APIWeb3 struct{}
APIWeb3 is the web3_ prefixed set of APIs in the Web3 JSON-RPC spec.
func NewImplWeb3API ¶
func NewImplWeb3API() *APIWeb3
NewImplWeb3API creates an instance of the Web3 API.
func (*APIWeb3) ClientVersion ¶
ClientVersion returns the client version in the Web3 user agent format.
type ErrorMessageJSON ¶
type ErrorResponseJSON ¶
type ErrorResponseJSON struct { Jsonrpc string `json:"jsonrpc"` Error *ErrorMessageJSON `json:"error"` ID *big.Int `json:"id"` }
type EthAPI ¶
type EthAPI struct {
// contains filtered or unexported fields
}
EthAPI is the eth_ prefixed set of APIs in the Web3 JSON-RPC spec.
func NewImplEthAPI ¶
func NewImplEthAPI(logger log.Logger, backend backend.EVMBackend) *EthAPI
NewImplEthAPI creates an instance of the public ETH Web3 API.
func (*EthAPI) BlockNumber ¶
BlockNumber returns the current block number.
func (*EthAPI) Call ¶
func (e *EthAPI) Call(args evm.JsonTxArgs, blockNrOrHash rpc.BlockNumberOrHash, _ *rpc.StateOverride, ) (hexutil.Bytes, error)
Call performs a raw contract call.
func (*EthAPI) ChainId ¶
ChainId is the EIP-155 replay-protection chain id for the current ethereum chain config.
func (*EthAPI) EstimateGas ¶
func (e *EthAPI) EstimateGas( args evm.JsonTxArgs, blockNrOptional *rpc.BlockNumber, ) (hexutil.Uint64, error)
EstimateGas returns an estimate of gas usage for the given smart contract call.
func (*EthAPI) FeeHistory ¶
func (e *EthAPI) FeeHistory(blockCount gethrpc.DecimalOrHex, lastBlock gethrpc.BlockNumber, rewardPercentiles []float64, ) (*rpc.FeeHistoryResult, error)
func (*EthAPI) FillTransaction ¶
func (e *EthAPI) FillTransaction( args evm.JsonTxArgs, ) (*rpc.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 (*EthAPI) GasPrice ¶
GasPrice returns the current gas price based on Ethermint's gas price oracle.
func (*EthAPI) GetBalance ¶
func (e *EthAPI) GetBalance( address common.Address, blockNrOrHash rpc.BlockNumberOrHash, ) (*hexutil.Big, error)
GetBalance returns the provided account's balance up to the provided block number.
func (*EthAPI) GetBlockByHash ¶
GetBlockByHash returns the block identified by hash.
func (*EthAPI) GetBlockByNumber ¶
func (e *EthAPI) GetBlockByNumber(ethBlockNum rpc.BlockNumber, fullTx bool) (map[string]interface{}, error)
GetBlockByNumber returns the block identified by number.
func (*EthAPI) GetBlockTransactionCountByHash ¶
GetBlockTransactionCountByHash returns the number of transactions in the block identified by hash.
func (*EthAPI) GetBlockTransactionCountByNumber ¶
func (e *EthAPI) GetBlockTransactionCountByNumber( blockNum rpc.BlockNumber, ) *hexutil.Uint
GetBlockTransactionCountByNumber returns the number of transactions in the block identified by number.
func (*EthAPI) GetCode ¶
func (e *EthAPI) GetCode( address common.Address, blockNrOrHash rpc.BlockNumberOrHash, ) (hexutil.Bytes, error)
GetCode returns the contract code at the given address and block number.
func (*EthAPI) GetPendingTransactions ¶
func (e *EthAPI) GetPendingTransactions() ([]*rpc.EthTxJsonRPC, error)
GetPendingTransactions returns the transactions that are in the transaction pool and have a from address that is one of the accounts this node manages.
func (*EthAPI) GetProof ¶
func (e *EthAPI) GetProof(address common.Address, storageKeys []string, blockNrOrHash rpc.BlockNumberOrHash, ) (*rpc.AccountResult, error)
GetProof returns an account object with proof and any storage proofs
func (*EthAPI) GetStorageAt ¶
func (e *EthAPI) GetStorageAt( address common.Address, key string, blockNrOrHash rpc.BlockNumberOrHash, ) (hexutil.Bytes, error)
GetStorageAt returns the contract storage at the given address, block number, and key.
func (*EthAPI) GetTransactionByBlockHashAndIndex ¶
func (e *EthAPI) GetTransactionByBlockHashAndIndex( hash common.Hash, idx hexutil.Uint, ) (*rpc.EthTxJsonRPC, error)
GetTransactionByBlockHashAndIndex returns the transaction identified by hash and index.
func (*EthAPI) GetTransactionByBlockNumberAndIndex ¶
func (e *EthAPI) GetTransactionByBlockNumberAndIndex( blockNum rpc.BlockNumber, idx hexutil.Uint, ) (*rpc.EthTxJsonRPC, error)
GetTransactionByBlockNumberAndIndex returns the transaction identified by number and index.
func (*EthAPI) GetTransactionByHash ¶
GetTransactionByHash returns the transaction identified by hash.
func (*EthAPI) GetTransactionCount ¶
func (e *EthAPI) GetTransactionCount( address common.Address, blockNrOrHash rpc.BlockNumberOrHash, ) (*hexutil.Uint64, error)
GetTransactionCount returns the number of transactions at the given address up to the given block number.
func (*EthAPI) GetTransactionLogs ¶
GetTransactionLogs returns the logs given a transaction hash.
func (*EthAPI) GetTransactionReceipt ¶
GetTransactionReceipt returns the transaction receipt identified by hash.
func (*EthAPI) GetUncleByBlockHashAndIndex ¶
func (e *EthAPI) GetUncleByBlockHashAndIndex( _ common.Hash, _ hexutil.Uint, ) map[string]interface{}
GetUncleByBlockHashAndIndex returns the uncle identified by hash and index. Always returns nil.
func (*EthAPI) GetUncleByBlockNumberAndIndex ¶
GetUncleByBlockNumberAndIndex returns the uncle identified by number and index. Always returns nil.
func (*EthAPI) GetUncleCountByBlockHash ¶
GetUncleCountByBlockHash returns the number of uncles in the block identified by hash. Always zero.
func (*EthAPI) GetUncleCountByBlockNumber ¶
func (e *EthAPI) GetUncleCountByBlockNumber(_ rpc.BlockNumber) hexutil.Uint
GetUncleCountByBlockNumber returns the number of uncles in the block identified by number. Always zero.
func (*EthAPI) MaxPriorityFeePerGas ¶
MaxPriorityFeePerGas returns a suggestion for a gas tip cap for dynamic fee transactions.
func (*EthAPI) ProtocolVersion ¶
ProtocolVersion returns the supported Ethereum protocol version.
func (*EthAPI) Resend ¶
func (e *EthAPI) Resend(_ context.Context, args evm.JsonTxArgs, 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 (*EthAPI) SendRawTransaction ¶
SendRawTransaction send a raw Ethereum transaction.
func (*EthAPI) SendTransaction ¶
SendTransaction sends an Ethereum transaction.
func (*EthAPI) SignTypedData ¶
func (e *EthAPI) SignTypedData( address common.Address, typedData apitypes.TypedData, ) (hexutil.Bytes, error)
SignTypedData signs EIP-712 conformant typed data
func (*EthAPI) Syncing ¶
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 IEthAPI ¶
type IEthAPI interface { // Getting Blocks // // Retrieves information from a particular block in the blockchain. BlockNumber() (hexutil.Uint64, error) GetBlockByNumber(ethBlockNum rpc.BlockNumber, fullTx bool) (map[string]interface{}, error) GetBlockByHash(hash common.Hash, fullTx bool) (map[string]interface{}, error) GetBlockTransactionCountByHash(hash common.Hash) *hexutil.Uint GetBlockTransactionCountByNumber(blockNum rpc.BlockNumber) *hexutil.Uint // Reading Transactions // // Retrieves information on the state data for addresses regardless of whether // it is a user or a smart contract. GetTransactionByHash(hash common.Hash) (*rpc.EthTxJsonRPC, error) GetTransactionCount(address common.Address, blockNrOrHash rpc.BlockNumberOrHash) (*hexutil.Uint64, error) GetTransactionReceipt(hash common.Hash) (map[string]interface{}, error) GetTransactionByBlockHashAndIndex(hash common.Hash, idx hexutil.Uint) (*rpc.EthTxJsonRPC, error) GetTransactionByBlockNumberAndIndex(blockNum rpc.BlockNumber, idx hexutil.Uint) (*rpc.EthTxJsonRPC, error) // Writing Transactions // // Allows developers to both send ETH from one address to another, write data // on-chain, and interact with smart contracts. SendRawTransaction(data hexutil.Bytes) (common.Hash, error) SendTransaction(args evm.JsonTxArgs) (common.Hash, error) // Account Information // // Returns information regarding an address's stored on-chain data. Accounts() ([]common.Address, error) GetBalance( address common.Address, blockNrOrHash rpc.BlockNumberOrHash, ) (*hexutil.Big, error) GetStorageAt( address common.Address, key string, blockNrOrHash rpc.BlockNumberOrHash, ) (hexutil.Bytes, error) GetCode( address common.Address, blockNrOrHash rpc.BlockNumberOrHash, ) (hexutil.Bytes, error) GetProof( address common.Address, storageKeys []string, blockNrOrHash rpc.BlockNumberOrHash, ) (*rpc.AccountResult, error) // EVM/Smart Contract Execution // // Allows developers to read data from the blockchain which includes executing // smart contracts. However, no data is published to the Ethereum network. Call( args evm.JsonTxArgs, blockNrOrHash rpc.BlockNumberOrHash, _ *rpc.StateOverride, ) (hexutil.Bytes, error) // Chain Information // // Returns information on the Ethereum network and internal settings. ProtocolVersion() hexutil.Uint GasPrice() (*hexutil.Big, error) EstimateGas( args evm.JsonTxArgs, blockNrOptional *rpc.BlockNumber, ) (hexutil.Uint64, error) FeeHistory( blockCount gethrpc.DecimalOrHex, lastBlock gethrpc.BlockNumber, rewardPercentiles []float64, ) (*rpc.FeeHistoryResult, error) MaxPriorityFeePerGas() (*hexutil.Big, error) ChainId() (*hexutil.Big, error) // Getting Uncles // // Returns information on uncle blocks are which are network rejected blocks // and replaced by a canonical block instead. GetUncleByBlockHashAndIndex( hash common.Hash, idx hexutil.Uint, ) map[string]interface{} GetUncleByBlockNumberAndIndex( number, idx hexutil.Uint, ) map[string]interface{} GetUncleCountByBlockHash(hash common.Hash) hexutil.Uint GetUncleCountByBlockNumber(blockNum rpc.BlockNumber) hexutil.Uint // Other Syncing() (interface{}, error) GetTransactionLogs(txHash common.Hash) ([]*gethcore.Log, error) SignTypedData( address common.Address, typedData apitypes.TypedData, ) (hexutil.Bytes, error) FillTransaction( args evm.JsonTxArgs, ) (*rpc.SignTransactionResult, error) Resend( ctx context.Context, args evm.JsonTxArgs, gasPrice *hexutil.Big, gasLimit *hexutil.Uint64, ) (common.Hash, error) GetPendingTransactions() ([]*rpc.EthTxJsonRPC, error) }
Ethereum API: Allows connection to a full node of the Nibiru blockchain network via Nibiru EVM. Developers can interact with on-chain EVM data and send different types of transactions to the network by utilizing the endpoints provided by the API. The API follows a JSON-RPC standard. If not otherwise specified, the interface is derived from the Alchemy Ethereum API: https://docs.alchemy.com/alchemy/apis/ethereum
type NetAPI ¶
type NetAPI struct {
// contains filtered or unexported fields
}
NetAPI is the eth_ prefixed set of APIs in the Web3 JSON-RPC spec.
func NewImplNetAPI ¶
NewImplNetAPI creates an instance of the public Net Web3 API.
func (*NetAPI) Listening ¶
Listening returns if client is actively listening for network connections.
type SubscriptionNotification ¶
type SubscriptionNotification struct { Jsonrpc string `json:"jsonrpc"` Method string `json:"method"` Params *SubscriptionResult `json:"params"` }
type SubscriptionResult ¶
type TxPoolAPI ¶
type TxPoolAPI struct {
// contains filtered or unexported fields
}
TxPoolAPI offers and API for the transaction pool. It only operates on data that is non-confidential.
func NewImplTxPoolAPI ¶
NewImplTxPoolAPI creates a new tx pool service that gives information about the transaction pool.
type WebsocketsServer ¶
type WebsocketsServer interface {
Start()
}