Skip to content

Commit 749b6ce

Browse files
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)
1 parent 1ec8741 commit 749b6ce

File tree

1 file changed

+25
-3
lines changed

1 file changed

+25
-3
lines changed

libevm/ethapi/ethapi.go

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,25 @@ type (
2626
)
2727

2828
type (
29-
// BlockChainAPI exposes RPC methods for querying chain data.
29+
// EthereumAPI provides an API to access Ethereum related information.
30+
EthereumAPI = ethapi.EthereumAPI
31+
// BlockChainAPI provides an API to access Ethereum blockchain data.
3032
BlockChainAPI = ethapi.BlockChainAPI
31-
// TransactionAPI exposes RPC methods for querying and creating
32-
// transactions.
33+
// TransactionAPI exposes methods for reading and creating transaction data.
3334
TransactionAPI = ethapi.TransactionAPI
35+
// TxPoolAPI offers and API for the transaction pool. It only operates on
36+
// data that is non-confidential.
37+
TxPoolAPI = ethapi.TxPoolAPI
38+
// DebugAPI is the collection of Ethereum APIs exposed over the debugging
39+
// namespace.
40+
DebugAPI = ethapi.DebugAPI
3441
)
3542

43+
// NewEthereumAPI is identical to [ethapi.NewEthereumAPI].
44+
func NewEthereumAPI(b Backend) *EthereumAPI {
45+
return ethapi.NewEthereumAPI(b)
46+
}
47+
3648
// NewBlockChainAPI is identical to [ethapi.NewBlockChainAPI].
3749
func NewBlockChainAPI(b Backend) *BlockChainAPI {
3850
return ethapi.NewBlockChainAPI(b)
@@ -42,3 +54,13 @@ func NewBlockChainAPI(b Backend) *BlockChainAPI {
4254
func NewTransactionAPI(b Backend, nonceLock *AddrLocker) *TransactionAPI {
4355
return ethapi.NewTransactionAPI(b, nonceLock)
4456
}
57+
58+
// NewTxPoolAPI is identical to [ethapi.NewTxPoolAPI].
59+
func NewTxPoolAPI(b Backend) *TxPoolAPI {
60+
return ethapi.NewTxPoolAPI(b)
61+
}
62+
63+
// NewDebugAPI is identical to [ethapi.NewDebugAPI].
64+
func NewDebugAPI(b Backend) *DebugAPI {
65+
return ethapi.NewDebugAPI(b)
66+
}

0 commit comments

Comments
 (0)