Documentation ¶
Index ¶
- Constants
- Variables
- func CalculatePercentiles(rewardPercentiles []float64, GasAndRewards []GasAndReward, ...) []*hexutil.Big
- func CheckPath(r *http.Request, path string) bool
- func CheckTimeouts(timeouts *rpc.HTTPTimeouts)
- func CheckVersion(ctx sdk.Context, k *keeper.Keeper) error
- func EncodeFilters(addresses []common.Address, topics [][]common.Hash) (res [][]bloomIndexes)
- func EncodeTmBlock(ctx sdk.Context, block *coretypes.ResultBlock, ...) (map[string]interface{}, error)
- func FullBloom() ethtypes.Bloom
- func GetBlockNumberByNrOrHash(ctx context.Context, tmClient rpcclient.Client, ...) (*int64, error)
- func GetEvmTxIndex(txs tmtypes.Txs, txIndex uint32, decoder sdk.TxDecoder) (index int, found bool)
- func MatchFilters(bloom ethtypes.Bloom, filters [][]bloomIndexes) bool
- func NewGzipHandler(next http.Handler) http.Handler
- func NewHTTPHandlerStack(srv http.Handler, cors []string, vhosts []string, JwtSecret []byte) http.Handler
- func NewWSConnectionHandler(handler http.Handler) http.Handler
- func NewWSHandlerStack(srv http.Handler, JwtSecret []byte) http.Handler
- func RegisterApis(logger log.Logger, apis []rpc.API, modules []string, srv *rpc.Server) error
- func StartHTTPEndpoint(endpoint string, timeouts rpc.HTTPTimeouts, handler http.Handler) (*http.Server, net.Addr, error)
- type AccessListResult
- type AssociateRequest
- type AssociationAPI
- func (t *AssociationAPI) Associate(ctx context.Context, req *AssociateRequest) (returnErr error)
- func (t *AssociationAPI) GetEVMAddress(_ context.Context, seiAddress string) (result string, returnErr error)
- func (t *AssociationAPI) GetSeiAddress(_ context.Context, ethAddress common.Address) (result string, returnErr error)
- type Backend
- func (b Backend) BlockByHash(ctx context.Context, hash common.Hash) (*ethtypes.Block, error)
- func (b Backend) BlockByNumber(ctx context.Context, bn rpc.BlockNumber) (*ethtypes.Block, error)
- func (b *Backend) ChainConfig() *params.ChainConfig
- func (b *Backend) ChainDb() ethdb.Database
- func (b *Backend) CurrentHeader() *ethtypes.Header
- func (b *Backend) Engine() consensus.Engine
- func (b *Backend) GetEVM(_ context.Context, msg *core.Message, stateDB vm.StateDB, _ *ethtypes.Header, ...) *vm.EVM
- func (b *Backend) GetPoolNonce(_ context.Context, addr common.Address) (uint64, error)
- func (b *Backend) GetTransaction(ctx context.Context, txHash common.Hash) (tx *ethtypes.Transaction, blockHash common.Hash, blockNumber uint64, ...)
- func (b *Backend) HeaderByNumber(ctx context.Context, bn rpc.BlockNumber) (*ethtypes.Header, error)
- func (b *Backend) RPCEVMTimeout() time.Duration
- func (b *Backend) RPCGasCap() uint64
- func (b *Backend) StateAndHeaderByNumberOrHash(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) (vm.StateDB, *ethtypes.Header, error)
- func (b *Backend) StateAtBlock(ctx context.Context, block *ethtypes.Block, reexec uint64, base vm.StateDB, ...) (vm.StateDB, tracers.StateReleaseFunc, error)
- func (b *Backend) StateAtTransaction(ctx context.Context, block *ethtypes.Block, txIndex int, reexec uint64) (*ethtypes.Transaction, vm.BlockContext, vm.StateDB, tracers.StateReleaseFunc, ...)
- func (b *Backend) SuggestGasTipCap(context.Context) (*big.Int, error)
- type BlockAPI
- func (a *BlockAPI) GetBlockByHash(ctx context.Context, blockHash common.Hash, fullTx bool) (result map[string]interface{}, returnErr error)
- func (a *BlockAPI) GetBlockByNumber(ctx context.Context, number rpc.BlockNumber, fullTx bool) (result map[string]interface{}, returnErr error)
- func (a *BlockAPI) GetBlockReceipts(ctx context.Context, number rpc.BlockNumber) (result []map[string]interface{}, returnErr error)
- func (a *BlockAPI) GetBlockTransactionCountByHash(ctx context.Context, blockHash common.Hash) (result *hexutil.Uint, returnErr error)
- func (a *BlockAPI) GetBlockTransactionCountByNumber(ctx context.Context, number rpc.BlockNumber) (result *hexutil.Uint, returnErr error)
- type Config
- type ConnectionType
- type DebugAPI
- func (api *DebugAPI) TraceBlockByHash(ctx context.Context, hash common.Hash, config *tracers.TraceConfig) (interface{}, error)
- func (api *DebugAPI) TraceBlockByNumber(ctx context.Context, number rpc.BlockNumber, config *tracers.TraceConfig) (interface{}, error)
- func (api *DebugAPI) TraceTransaction(ctx context.Context, hash common.Hash, config *tracers.TraceConfig) (interface{}, error)
- type EVMServer
- type EchoAPI
- type Engine
- type EventItemDataWrapper
- type FeeHistoryResult
- type FilterAPI
- func (a *FilterAPI) GetFilterChanges(ctx context.Context, filterID ethrpc.ID) (res interface{}, err error)
- func (a *FilterAPI) GetFilterLogs(ctx context.Context, filterID ethrpc.ID) (res []*ethtypes.Log, err error)
- func (a *FilterAPI) GetLogs(ctx context.Context, crit filters.FilterCriteria) (res []*ethtypes.Log, err error)
- func (a *FilterAPI) NewBlockFilter(_ context.Context) (id ethrpc.ID, err error)
- func (a *FilterAPI) NewFilter(_ context.Context, crit filters.FilterCriteria) (id ethrpc.ID, err error)
- func (a *FilterAPI) UninstallFilter(_ context.Context, filterID ethrpc.ID) (res bool)
- type FilterConfig
- type FilterType
- type GasAndReward
- type HTTPConfig
- type HTTPServer
- func (h *HTTPServer) EnableRPC(apis []rpc.API, config HTTPConfig) error
- func (h *HTTPServer) EnableWS(apis []rpc.API, config WsConfig) error
- func (h *HTTPServer) ListenAddr() string
- func (h *HTTPServer) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (h *HTTPServer) SetListenAddr(host string, port int) error
- func (h *HTTPServer) Start() error
- func (h *HTTPServer) Stop()
- type InfoAPI
- func (i *InfoAPI) Accounts() (result []common.Address, returnErr error)
- func (i *InfoAPI) BlockNumber() hexutil.Uint64
- func (i *InfoAPI) ChainId() *hexutil.Big
- func (i *InfoAPI) Coinbase() (common.Address, error)
- func (i *InfoAPI) FeeHistory(ctx context.Context, blockCount math.HexOrDecimal64, lastBlock rpc.BlockNumber, ...) (result *FeeHistoryResult, returnErr error)
- func (i *InfoAPI) GasPrice(ctx context.Context) (result *hexutil.Big, returnErr error)
- type LogFetcher
- func (f *LogFetcher) FindBlockesByBloom(begin, end int64, filters [][]bloomIndexes) (res []int64)
- func (f *LogFetcher) FindLogsByBloom(height int64, filters [][]bloomIndexes) (res []*ethtypes.Log)
- func (f *LogFetcher) GetLogsByFilters(ctx context.Context, crit filters.FilterCriteria, lastToHeight int64) ([]*ethtypes.Log, int64, error)
- func (f *LogFetcher) GetLogsForBlock(ctx context.Context, block *coretypes.ResultBlock, crit filters.FilterCriteria, ...) []*ethtypes.Log
- func (f *LogFetcher) IsLogExactMatch(log *ethtypes.Log, crit filters.FilterCriteria) bool
- type NetAPI
- type ProofResult
- type QueryBuilder
- type RPCEndpointConfig
- type RevertError
- type SendAPI
- func (s *SendAPI) SendRawTransaction(ctx context.Context, input hexutil.Bytes) (hash common.Hash, err error)
- func (s *SendAPI) SendTransaction(ctx context.Context, args ethapi.TransactionArgs) (result common.Hash, returnErr error)
- func (s *SendAPI) SignTransaction(_ context.Context, args apitypes.SendTxArgs, _ *string) (result *ethapi.SignTransactionResult, returnErr error)
- type SendConfig
- type SimulateConfig
- type SimulationAPI
- func (s *SimulationAPI) Call(ctx context.Context, args ethapi.TransactionArgs, ...) (result hexutil.Bytes, returnErr error)
- func (s *SimulationAPI) CreateAccessList(ctx context.Context, args ethapi.TransactionArgs, ...) (result *AccessListResult, returnErr error)
- func (s *SimulationAPI) EstimateGas(ctx context.Context, args ethapi.TransactionArgs, ...) (result hexutil.Uint64, returnErr error)
- type StateAPI
- func (a *StateAPI) GetBalance(ctx context.Context, address common.Address, ...) (result *hexutil.Big, returnErr error)
- func (a *StateAPI) GetCode(ctx context.Context, address common.Address, ...) (result hexutil.Bytes, returnErr error)
- func (a *StateAPI) GetNonce(_ context.Context, address common.Address) uint64
- func (a *StateAPI) GetProof(ctx context.Context, address common.Address, storageKeys []string, ...) (result *ProofResult, returnErr error)
- func (a *StateAPI) GetStorageAt(ctx context.Context, address common.Address, hexKey string, ...) (result hexutil.Bytes, returnErr error)
- type SubInfo
- type SubscriberID
- type SubscriptionAPI
- type SubscriptionConfig
- type SubscriptionManager
- type TestAPI
- type TransactionAPI
- func (t *TransactionAPI) GetTransactionByBlockHashAndIndex(ctx context.Context, blockHash common.Hash, index hexutil.Uint) (result *ethapi.RPCTransaction, returnErr error)
- func (t *TransactionAPI) GetTransactionByBlockNumberAndIndex(ctx context.Context, blockNr rpc.BlockNumber, index hexutil.Uint) (result *ethapi.RPCTransaction, returnErr error)
- func (t *TransactionAPI) GetTransactionByHash(ctx context.Context, hash common.Hash) (result *ethapi.RPCTransaction, returnErr error)
- func (t *TransactionAPI) GetTransactionCount(ctx context.Context, address common.Address, ...) (result *hexutil.Uint64, returnErr error)
- func (t *TransactionAPI) GetTransactionErrorByHash(_ context.Context, hash common.Hash) (result string, returnErr error)
- func (t *TransactionAPI) GetTransactionReceipt(ctx context.Context, hash common.Hash) (result map[string]interface{}, returnErr error)
- func (t *TransactionAPI) GetVMError(hash common.Hash) (result string, returnErr error)
- func (t *TransactionAPI) Sign(addr common.Address, data hexutil.Bytes) (result hexutil.Bytes, returnErr error)
- type TxPoolAPI
- type TxPoolConfig
- type Web3API
- type WsConfig
Constants ¶
const GasUsedRatio float64 = 0.5
Since we use a static base fee, we want GasUsedRatio returned in RPC queries to reflect the fact that base fee would never change, which is only true if the block is exactly half-utilized.
const JwtExpiryTimeout = 60 * time.Second
const LatestCtxHeight int64 = -1
const LocalAddress = "0.0.0.0"
const NewHeadsListenerBuffer = 10
const SleepInterval = 5 * time.Second
const SubscriberPrefix = "evm.rpc."
const TxSearchPerPage = 10
const UnconfirmedTxQueryMaxPage = 20
const UnconfirmedTxQueryPerPage = 30
Variables ¶
var BitMasks = [8]uint8{1, 2, 4, 8, 16, 32, 64, 128}
var DefaultConfig = Config{ HTTPEnabled: true, HTTPPort: 8545, WSEnabled: true, WSPort: 8546, ReadTimeout: rpc.DefaultHTTPTimeouts.ReadTimeout, ReadHeaderTimeout: rpc.DefaultHTTPTimeouts.ReadHeaderTimeout, WriteTimeout: rpc.DefaultHTTPTimeouts.WriteTimeout, IdleTimeout: rpc.DefaultHTTPTimeouts.IdleTimeout, SimulationGasLimit: 10_000_000, SimulationEVMTimeout: 60 * time.Second, CORSOrigins: "*", WSOrigins: "*", FilterTimeout: 120 * time.Second, CheckTxTimeout: 5 * time.Second, MaxTxPoolTxs: 1000, Slow: false, DenyList: make([]string, 0), MaxLogNoBlock: 10000, MaxBlocksForLog: 2000, MaxSubscriptionsNewHead: 10000, EnableTestAPI: false, }
Functions ¶
func CalculatePercentiles ¶
func CalculatePercentiles(rewardPercentiles []float64, GasAndRewards []GasAndReward, totalEVMGasUsed uint64) []*hexutil.Big
Following go-ethereum implementation Specifically, the reward value at a percentile of p% will be the reward value of the lowest-rewarded transaction such that the sum of its gasUsed value and gasUsed values of all lower-rewarded transactions is no less than (total gasUsed * p%).
func CheckTimeouts ¶
func CheckTimeouts(timeouts *rpc.HTTPTimeouts)
CheckTimeouts ensures that timeout values are meaningful
func EncodeFilters ¶
res: AND on outer level, OR on mid level, AND on inner level (i.e. all 3 bits)
func EncodeTmBlock ¶
func GetEvmTxIndex ¶
Gets the EVM tx index based on the tx index (typically from receipt.TransactionIndex Essentially loops through and calculates the index if we ignore cosmos txs
func MatchFilters ¶
TODO: parallelize if filters too large
func NewHTTPHandlerStack ¶
func NewHTTPHandlerStack(srv http.Handler, cors []string, vhosts []string, JwtSecret []byte) http.Handler
NewHTTPHandlerStack returns wrapped http-related handlers
func NewWSHandlerStack ¶
NewWSHandlerStack returns a wrapped ws-related handler.
func RegisterApis ¶
RegisterApis checks the given modules' availability, generates an allowlist based on the allowed modules, and then registers all of the APIs exposed by the services.
Types ¶
type AccessListResult ¶
type AccessListResult struct { Accesslist *ethtypes.AccessList `json:"accessList"` Error string `json:"error,omitempty"` GasUsed hexutil.Uint64 `json:"gasUsed"` }
type AssociateRequest ¶
type AssociationAPI ¶
type AssociationAPI struct {
// contains filtered or unexported fields
}
func NewAssociationAPI ¶
func (*AssociationAPI) Associate ¶
func (t *AssociationAPI) Associate(ctx context.Context, req *AssociateRequest) (returnErr error)
func (*AssociationAPI) GetEVMAddress ¶
func (*AssociationAPI) GetSeiAddress ¶
type Backend ¶
type Backend struct { *eth.EthAPIBackend // contains filtered or unexported fields }
func NewBackend ¶
func (Backend) BlockByHash ¶
func (Backend) BlockByNumber ¶
func (*Backend) ChainConfig ¶
func (b *Backend) ChainConfig() *params.ChainConfig
func (*Backend) CurrentHeader ¶
func (*Backend) GetPoolNonce ¶
func (*Backend) GetTransaction ¶
func (*Backend) HeaderByNumber ¶
func (*Backend) RPCEVMTimeout ¶
func (*Backend) StateAndHeaderByNumberOrHash ¶
func (*Backend) StateAtBlock ¶
func (*Backend) StateAtTransaction ¶
type BlockAPI ¶
type BlockAPI struct {
// contains filtered or unexported fields
}
func NewBlockAPI ¶
func (*BlockAPI) GetBlockByHash ¶
func (*BlockAPI) GetBlockByNumber ¶
func (*BlockAPI) GetBlockReceipts ¶
func (*BlockAPI) GetBlockTransactionCountByHash ¶
func (*BlockAPI) GetBlockTransactionCountByNumber ¶
type Config ¶
type Config struct { // controls whether an HTTP EVM server is enabled HTTPEnabled bool `mapstructure:"http_enabled"` HTTPPort int `mapstructure:"http_port"` // controls whether a websocket server is enabled WSEnabled bool `mapstructure:"ws_enabled"` WSPort int `mapstructure:"ws_port"` // ReadTimeout is the maximum duration for reading the entire // request, including the body. // // Because ReadTimeout does not let Handlers make per-request // decisions on each request body's acceptable deadline or // upload rate, most users will prefer to use // ReadHeaderTimeout. It is valid to use them both. ReadTimeout time.Duration `mapstructure:"read_timeout"` // ReadHeaderTimeout is the amount of time allowed to read // request headers. The connection's read deadline is reset // after reading the headers and the Handler can decide what // is considered too slow for the body. If ReadHeaderTimeout // is zero, the value of ReadTimeout is used. If both are // zero, there is no timeout. ReadHeaderTimeout time.Duration `mapstructure:"read_header_timeout"` // WriteTimeout is the maximum duration before timing out // writes of the response. It is reset whenever a new // request's header is read. Like ReadTimeout, it does not // let Handlers make decisions on a per-request basis. WriteTimeout time.Duration `mapstructure:"write_timeout"` // IdleTimeout is the maximum amount of time to wait for the // next request when keep-alives are enabled. If IdleTimeout // is zero, the value of ReadTimeout is used. If both are // zero, ReadHeaderTimeout is used. IdleTimeout time.Duration `mapstructure:"idle_timeout"` // Maximum gas limit for simulation SimulationGasLimit uint64 `mapstructure:"simulation_gas_limit"` // Timeout for EVM call in simulation SimulationEVMTimeout time.Duration `mapstructure:"simulation_evm_timeout"` // list of CORS allowed origins, separated by comma CORSOrigins string `mapstructure:"cors_origins"` // list of WS origins, separated by comma WSOrigins string `mapstructure:"ws_origins"` // timeout for filters FilterTimeout time.Duration `mapstructure:"filter_timeout"` // checkTx timeout for sig verify CheckTxTimeout time.Duration `mapstructure:"checktx_timeout"` // max number of txs to pull from mempool MaxTxPoolTxs uint64 `mapstructure:"max_tx_pool_txs"` // controls whether to have txns go through one by one Slow bool `mapstructure:"slow"` // Deny list defines list of methods that EVM RPC should fail fast DenyList []string `mapstructure:"deny_list"` // max number of logs returned if block range is open-ended MaxLogNoBlock int64 `mapstructure:"max_log_no_block"` // max number of blocks to query logs for MaxBlocksForLog int64 `mapstructure:"max_blocks_for_log"` // max number of concurrent NewHead subscriptions MaxSubscriptionsNewHead uint64 `mapstructure:"max_subscriptions_new_head"` // test api enables certain override apis for integration test situations EnableTestAPI bool `mapstructure:"enable_test_api"` }
EVMRPC Config defines configurations for EVM RPC server on this node
func ReadConfig ¶
func ReadConfig(opts servertypes.AppOptions) (Config, error)
type ConnectionType ¶
type ConnectionType string
var ConnectionTypeHTTP ConnectionType = "http"
var ConnectionTypeWS ConnectionType = "websocket"
type DebugAPI ¶
type DebugAPI struct {
// contains filtered or unexported fields
}
func NewDebugAPI ¶
func (*DebugAPI) TraceBlockByHash ¶
func (*DebugAPI) TraceBlockByNumber ¶
func (api *DebugAPI) TraceBlockByNumber(ctx context.Context, number rpc.BlockNumber, config *tracers.TraceConfig) (interface{}, error)
func (*DebugAPI) TraceTransaction ¶
type EventItemDataWrapper ¶
type EventItemDataWrapper struct { Type string `json:"type"` Value json.RawMessage `json:"value"` }
type FeeHistoryResult ¶
type FilterAPI ¶
type FilterAPI struct {
// contains filtered or unexported fields
}
func NewFilterAPI ¶
func NewFilterAPI(tmClient rpcclient.Client, logFetcher *LogFetcher, filterConfig *FilterConfig, connectionType ConnectionType) *FilterAPI
func (*FilterAPI) GetFilterChanges ¶
func (*FilterAPI) GetFilterLogs ¶
func (*FilterAPI) NewBlockFilter ¶
type FilterConfig ¶
type FilterConfig struct {
// contains filtered or unexported fields
}
type FilterType ¶
type FilterType byte
const ( UnknownSubscription FilterType = iota LogsSubscription BlocksSubscription )
type GasAndReward ¶
type HTTPConfig ¶
type HTTPConfig struct { Modules []string CorsAllowedOrigins []string Vhosts []string DenyList []string RPCEndpointConfig // contains filtered or unexported fields }
HTTPConfig is the JSON-RPC/HTTP configuration.
type HTTPServer ¶
type HTTPServer struct { HTTPConfig HTTPConfig // WebSocket handler things. WsConfig WsConfig // contains filtered or unexported fields }
func NewHTTPServer ¶
func NewHTTPServer(log log.Logger, timeouts rpc.HTTPTimeouts) *HTTPServer
func (*HTTPServer) EnableRPC ¶
func (h *HTTPServer) EnableRPC(apis []rpc.API, config HTTPConfig) error
EnableRPC turns on JSON-RPC over HTTP on the server.
func (*HTTPServer) EnableWS ¶
func (h *HTTPServer) EnableWS(apis []rpc.API, config WsConfig) error
EnableWS turns on JSON-RPC over WebSocket on the server.
func (*HTTPServer) ListenAddr ¶
func (h *HTTPServer) ListenAddr() string
listenAddr returns the listening address of the server.
func (*HTTPServer) ServeHTTP ¶
func (h *HTTPServer) ServeHTTP(w http.ResponseWriter, r *http.Request)
func (*HTTPServer) SetListenAddr ¶
func (h *HTTPServer) SetListenAddr(host string, port int) error
SetListenAddr configures the listening address of the server. The address can only be set while the server isn't running.
func (*HTTPServer) Start ¶
func (h *HTTPServer) Start() error
start starts the HTTP server if it is enabled and not already running.
type InfoAPI ¶
type InfoAPI struct {
// contains filtered or unexported fields
}
func NewInfoAPI ¶
func (*InfoAPI) BlockNumber ¶
func (*InfoAPI) FeeHistory ¶
func (i *InfoAPI) FeeHistory(ctx context.Context, blockCount math.HexOrDecimal64, lastBlock rpc.BlockNumber, rewardPercentiles []float64) (result *FeeHistoryResult, returnErr error)
lastBlock is inclusive
type LogFetcher ¶
type LogFetcher struct {
// contains filtered or unexported fields
}
func (*LogFetcher) FindBlockesByBloom ¶
func (f *LogFetcher) FindBlockesByBloom(begin, end int64, filters [][]bloomIndexes) (res []int64)
func (*LogFetcher) FindLogsByBloom ¶
func (f *LogFetcher) FindLogsByBloom(height int64, filters [][]bloomIndexes) (res []*ethtypes.Log)
func (*LogFetcher) GetLogsByFilters ¶
func (f *LogFetcher) GetLogsByFilters(ctx context.Context, crit filters.FilterCriteria, lastToHeight int64) ([]*ethtypes.Log, int64, error)
func (*LogFetcher) GetLogsForBlock ¶
func (f *LogFetcher) GetLogsForBlock(ctx context.Context, block *coretypes.ResultBlock, crit filters.FilterCriteria, filters [][]bloomIndexes) []*ethtypes.Log
func (*LogFetcher) IsLogExactMatch ¶
func (f *LogFetcher) IsLogExactMatch(log *ethtypes.Log, crit filters.FilterCriteria) bool
type ProofResult ¶
type ProofResult struct { Address common.Address `json:"address"` HexValues []string `json:"hexValues"` StorageProof []*crypto.ProofOps `json:"storageProof"` }
Result structs for GetProof This differs from go-ethereum AccountResult in two ways: 1. Proof object is an iavl proof, not a trie proof 2. Per-account fields are excluded because there is no per-account root
type QueryBuilder ¶
type QueryBuilder struct {
// contains filtered or unexported fields
}
func NewBlockQueryBuilder ¶
func NewBlockQueryBuilder() *QueryBuilder
func NewHeadQueryBuilder ¶
func NewHeadQueryBuilder() *QueryBuilder
func (*QueryBuilder) Build ¶
func (q *QueryBuilder) Build() string
type RPCEndpointConfig ¶
type RPCEndpointConfig struct { JwtSecret []byte // optional JWT secret // contains filtered or unexported fields }
type RevertError ¶
type RevertError struct {
// contains filtered or unexported fields
}
RevertError is an API error that encompasses an EVM revertal with JSON error code and a binary data blob.
func NewRevertError ¶
func NewRevertError(result *core.ExecutionResult) *RevertError
func (*RevertError) ErrorCode ¶
func (e *RevertError) ErrorCode() int
ErrorCode returns the JSON error code for a revertal. See: https://github.com/ethereum/wiki/wiki/JSON-RPC-Error-Codes-Improvement-Proposal
func (*RevertError) ErrorData ¶
func (e *RevertError) ErrorData() interface{}
ErrorData returns the hex encoded revert reason.
type SendAPI ¶
type SendAPI struct {
// contains filtered or unexported fields
}
func NewSendAPI ¶
func NewSendAPI(tmClient rpcclient.Client, txConfig client.TxConfig, sendConfig *SendConfig, k *keeper.Keeper, ctxProvider func(int64) sdk.Context, homeDir string, simulateConfig *SimulateConfig, connectionType ConnectionType) *SendAPI
func (*SendAPI) SendRawTransaction ¶
func (*SendAPI) SendTransaction ¶
func (*SendAPI) SignTransaction ¶
func (s *SendAPI) SignTransaction(_ context.Context, args apitypes.SendTxArgs, _ *string) (result *ethapi.SignTransactionResult, returnErr error)
type SendConfig ¶
type SendConfig struct {
// contains filtered or unexported fields
}
type SimulateConfig ¶
type SimulationAPI ¶
type SimulationAPI struct {
// contains filtered or unexported fields
}
func NewSimulationAPI ¶
func NewSimulationAPI( ctxProvider func(int64) sdk.Context, keeper *keeper.Keeper, txDecoder sdk.TxDecoder, tmClient rpcclient.Client, config *SimulateConfig, connectionType ConnectionType, ) *SimulationAPI
func (*SimulationAPI) Call ¶
func (s *SimulationAPI) Call(ctx context.Context, args ethapi.TransactionArgs, blockNrOrHash *rpc.BlockNumberOrHash, overrides *ethapi.StateOverride, blockOverrides *ethapi.BlockOverrides) (result hexutil.Bytes, returnErr error)
func (*SimulationAPI) CreateAccessList ¶
func (s *SimulationAPI) CreateAccessList(ctx context.Context, args ethapi.TransactionArgs, blockNrOrHash *rpc.BlockNumberOrHash) (result *AccessListResult, returnErr error)
func (*SimulationAPI) EstimateGas ¶
func (s *SimulationAPI) EstimateGas(ctx context.Context, args ethapi.TransactionArgs, blockNrOrHash *rpc.BlockNumberOrHash, overrides *ethapi.StateOverride) (result hexutil.Uint64, returnErr error)
type StateAPI ¶
type StateAPI struct {
// contains filtered or unexported fields
}
func NewStateAPI ¶
func (*StateAPI) GetBalance ¶
type SubInfo ¶
type SubInfo struct { Query string SubscriptionCh <-chan coretypes.ResultEvent }
type SubscriberID ¶
type SubscriberID uint64
type SubscriptionAPI ¶
type SubscriptionAPI struct {
// contains filtered or unexported fields
}
func NewSubscriptionAPI ¶
func NewSubscriptionAPI(tmClient rpcclient.Client, logFetcher *LogFetcher, subscriptionConfig *SubscriptionConfig, filterConfig *FilterConfig, connectionType ConnectionType) *SubscriptionAPI
func (*SubscriptionAPI) Logs ¶
func (a *SubscriptionAPI) Logs(ctx context.Context, filter *filters.FilterCriteria) (s *rpc.Subscription, err error)
func (*SubscriptionAPI) NewHeads ¶
func (a *SubscriptionAPI) NewHeads(ctx context.Context) (s *rpc.Subscription, err error)
type SubscriptionConfig ¶
type SubscriptionConfig struct {
// contains filtered or unexported fields
}
type SubscriptionManager ¶
type SubscriptionManager struct { NextID SubscriberID SubscriptionInfo map[SubscriberID]SubInfo // contains filtered or unexported fields }
func NewSubscriptionManager ¶
func NewSubscriptionManager(tmClient rpcclient.Client) *SubscriptionManager
func (*SubscriptionManager) Subscribe ¶
func (s *SubscriptionManager) Subscribe(ctx context.Context, q *QueryBuilder, limit int) (SubscriberID, <-chan coretypes.ResultEvent, error)
func (*SubscriptionManager) Unsubscribe ¶
func (s *SubscriptionManager) Unsubscribe(ctx context.Context, id SubscriberID) error
type TransactionAPI ¶
type TransactionAPI struct {
// contains filtered or unexported fields
}
func NewTransactionAPI ¶
func (*TransactionAPI) GetTransactionByBlockHashAndIndex ¶
func (t *TransactionAPI) GetTransactionByBlockHashAndIndex(ctx context.Context, blockHash common.Hash, index hexutil.Uint) (result *ethapi.RPCTransaction, returnErr error)
func (*TransactionAPI) GetTransactionByBlockNumberAndIndex ¶
func (t *TransactionAPI) GetTransactionByBlockNumberAndIndex(ctx context.Context, blockNr rpc.BlockNumber, index hexutil.Uint) (result *ethapi.RPCTransaction, returnErr error)
func (*TransactionAPI) GetTransactionByHash ¶
func (t *TransactionAPI) GetTransactionByHash(ctx context.Context, hash common.Hash) (result *ethapi.RPCTransaction, returnErr error)
func (*TransactionAPI) GetTransactionCount ¶
func (t *TransactionAPI) GetTransactionCount(ctx context.Context, address common.Address, blockNrOrHash rpc.BlockNumberOrHash) (result *hexutil.Uint64, returnErr error)
func (*TransactionAPI) GetTransactionErrorByHash ¶
func (*TransactionAPI) GetTransactionReceipt ¶
func (*TransactionAPI) GetVMError ¶
func (t *TransactionAPI) GetVMError(hash common.Hash) (result string, returnErr error)
type TxPoolAPI ¶
type TxPoolAPI struct {
// contains filtered or unexported fields
}
func NewTxPoolAPI ¶
type TxPoolConfig ¶
type TxPoolConfig struct {
// contains filtered or unexported fields
}
type WsConfig ¶
type WsConfig struct { Origins []string Modules []string RPCEndpointConfig // contains filtered or unexported fields }
WsConfig is the JSON-RPC/Websocket configuration