Documentation
¶
Index ¶
- func RegisterRoutes(r chi.Router, svc Service, rpcRequestTimeout time.Duration, logger *zap.Logger)
- type EthAPI
- func (api *EthAPI) BlockNumber(ctx context.Context) (hexutil.Uint64, error)
- func (api *EthAPI) Call(ctx context.Context, args *ethrpc.CallArgs, _ ethrpc.BlockNumberOrHash, ...) (hexutil.Bytes, error)
- func (api *EthAPI) ChainId(ctx context.Context) hexutil.Uint64
- func (api *EthAPI) EstimateGas(ctx context.Context, args *ethrpc.CallArgs, _ *ethrpc.BlockNumberOrHash) (hexutil.Uint64, error)
- func (api *EthAPI) GasPrice(ctx context.Context) (*hexutil.Big, error)
- func (api *EthAPI) GetBalance(ctx context.Context, address common.Address, _ ethrpc.BlockNumberOrHash) (*hexutil.Big, error)
- func (api *EthAPI) GetBlockByHash(ctx context.Context, hash common.Hash, fullTx bool) (*ethrpc.RPCBlock, error)
- func (api *EthAPI) GetBlockByNumber(ctx context.Context, blockNr ethrpc.BlockNumberOrHash, fullTx bool) (*ethrpc.RPCBlock, error)
- func (api *EthAPI) GetCode(ctx context.Context, address common.Address, _ ethrpc.BlockNumberOrHash) (hexutil.Bytes, error)
- func (api *EthAPI) GetLogs(ctx context.Context, query ethrpc.FilterQuery) ([]*types.Log, error)
- func (api *EthAPI) GetTransactionByHash(ctx context.Context, hash common.Hash) (*ethrpc.RPCTransaction, error)
- func (api *EthAPI) GetTransactionCount(ctx context.Context, address common.Address, _ ethrpc.BlockNumberOrHash) (hexutil.Uint64, error)
- func (api *EthAPI) GetTransactionReceipt(ctx context.Context, hash common.Hash) (*ethrpc.RPCReceipt, error)
- func (api *EthAPI) MaxPriorityFeePerGas(ctx context.Context) (*hexutil.Big, error)
- func (api *EthAPI) SendRawTransaction(ctx context.Context, data hexutil.Bytes) (common.Hash, error)
- func (api *EthAPI) Syncing(ctx context.Context) (any, error)
- type HTTP
- type NetAPI
- type Service
- type Store
- type TokenService
- type Web3API
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type EthAPI ¶
type EthAPI struct {
// contains filtered or unexported fields
}
EthAPI implements the eth_* JSON-RPC namespace. It is a thin adapter: each method translates the RPC signature to a Service call, dropping unused parameters (blockNrOrHash, overrides) that this facade does not need.
func (*EthAPI) BlockNumber ¶
func (*EthAPI) EstimateGas ¶
func (*EthAPI) GetBalance ¶
func (*EthAPI) GetBlockByHash ¶
func (*EthAPI) GetBlockByNumber ¶
func (*EthAPI) GetTransactionByHash ¶
func (*EthAPI) GetTransactionCount ¶
func (*EthAPI) GetTransactionReceipt ¶
func (*EthAPI) MaxPriorityFeePerGas ¶
func (*EthAPI) SendRawTransaction ¶
type HTTP ¶
type HTTP struct {
// contains filtered or unexported fields
}
HTTP handles Ethereum JSON-RPC requests over HTTP.
type NetAPI ¶
type NetAPI struct {
// contains filtered or unexported fields
}
NetAPI implements the net_* JSON-RPC namespace.
type Service ¶
type Service interface {
ChainID(ctx context.Context) hexutil.Uint64
BlockNumber(ctx context.Context) (hexutil.Uint64, error)
GasPrice(ctx context.Context) (*hexutil.Big, error)
MaxPriorityFeePerGas(ctx context.Context) (*hexutil.Big, error)
EstimateGas(ctx context.Context, args *ethrpc.CallArgs) (hexutil.Uint64, error)
GetBalance(ctx context.Context, address common.Address) (*hexutil.Big, error)
GetTransactionCount(ctx context.Context, address common.Address) (hexutil.Uint64, error)
GetCode(ctx context.Context, address common.Address) (hexutil.Bytes, error)
Syncing(ctx context.Context) bool
SendRawTransaction(ctx context.Context, data hexutil.Bytes) (common.Hash, error)
GetTransactionReceipt(ctx context.Context, hash common.Hash) (*ethrpc.RPCReceipt, error)
GetTransactionByHash(ctx context.Context, hash common.Hash) (*ethrpc.RPCTransaction, error)
Call(ctx context.Context, args *ethrpc.CallArgs) (hexutil.Bytes, error)
GetLogs(ctx context.Context, query ethrpc.FilterQuery) ([]*types.Log, error)
GetBlockByNumber(ctx context.Context, blockNr ethrpc.BlockNumberOrHash, fullTx bool) (*ethrpc.RPCBlock, error)
GetBlockByHash(ctx context.Context, hash common.Hash, fullTx bool) (*ethrpc.RPCBlock, error)
}
Service defines the Ethereum JSON-RPC business logic interface.
func NewLog ¶
NewLog creates a logging decorator for Service. Returns svc unchanged if logger is nil.
func NewService ¶
func NewService( cfg *ethrpc.Config, evmStore Store, tokenSvc TokenService, ) Service
NewService creates a new ethService.
type Store ¶
type Store interface {
// Read-only queries used by JSON-RPC handlers.
GetLatestEvmBlockNumber(ctx context.Context) (uint64, error)
GetEvmTransactionCount(ctx context.Context, fromAddress string) (uint64, error)
GetEvmTransaction(ctx context.Context, txHash []byte) (*ethrpc.EvmTransaction, error)
GetEvmLogsByTxHash(ctx context.Context, txHash []byte) ([]*ethrpc.EvmLog, error)
GetEvmLogs(ctx context.Context, address []byte, topic0 []byte, fromBlock, toBlock uint64) ([]*ethrpc.EvmLog, error)
GetBlockNumberByHash(ctx context.Context, blockHash []byte) (uint64, error)
// InsertMempoolEntry records a new transfer intent with status=pending.
// SendRawTransaction returns immediately after this insert; the submitter
// worker drives pending → completed/failed asynchronously, and the miner
// then seals the entry into a synthetic EVM block.
InsertMempoolEntry(ctx context.Context, entry *ethrpc.MempoolEntry) error
}
Store is the narrow data-access interface consumed by the EthRPC service.
Click to show internal directories.
Click to hide internal directories.