From 749b6cefda2894bab9bbdbe2d27086d57ca0d393 Mon Sep 17 00:00:00 2001 From: Stephen Buttolph Date: Fri, 14 Nov 2025 12:04:01 -0500 Subject: [PATCH] feat: expose additional `ethapi` servers (#245) ## Why this should be merged Required for SAE to support more of the required APIs. I left out the account and personal APIs, as we really shouldn't be managing any keys on the node. ## How this works Follows the same style that already existed. Additionally, copied the upstream description for the types. ## How this was tested Only local testing (although the prior functions were also not tested) --- libevm/ethapi/ethapi.go | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/libevm/ethapi/ethapi.go b/libevm/ethapi/ethapi.go index ec5b7cb948..7882d4364b 100644 --- a/libevm/ethapi/ethapi.go +++ b/libevm/ethapi/ethapi.go @@ -26,13 +26,25 @@ type ( ) type ( - // BlockChainAPI exposes RPC methods for querying chain data. + // EthereumAPI provides an API to access Ethereum related information. + EthereumAPI = ethapi.EthereumAPI + // BlockChainAPI provides an API to access Ethereum blockchain data. BlockChainAPI = ethapi.BlockChainAPI - // TransactionAPI exposes RPC methods for querying and creating - // transactions. + // TransactionAPI exposes methods for reading and creating transaction data. TransactionAPI = ethapi.TransactionAPI + // TxPoolAPI offers and API for the transaction pool. It only operates on + // data that is non-confidential. + TxPoolAPI = ethapi.TxPoolAPI + // DebugAPI is the collection of Ethereum APIs exposed over the debugging + // namespace. + DebugAPI = ethapi.DebugAPI ) +// NewEthereumAPI is identical to [ethapi.NewEthereumAPI]. +func NewEthereumAPI(b Backend) *EthereumAPI { + return ethapi.NewEthereumAPI(b) +} + // NewBlockChainAPI is identical to [ethapi.NewBlockChainAPI]. func NewBlockChainAPI(b Backend) *BlockChainAPI { return ethapi.NewBlockChainAPI(b) @@ -42,3 +54,13 @@ func NewBlockChainAPI(b Backend) *BlockChainAPI { func NewTransactionAPI(b Backend, nonceLock *AddrLocker) *TransactionAPI { return ethapi.NewTransactionAPI(b, nonceLock) } + +// NewTxPoolAPI is identical to [ethapi.NewTxPoolAPI]. +func NewTxPoolAPI(b Backend) *TxPoolAPI { + return ethapi.NewTxPoolAPI(b) +} + +// NewDebugAPI is identical to [ethapi.NewDebugAPI]. +func NewDebugAPI(b Backend) *DebugAPI { + return ethapi.NewDebugAPI(b) +}