Skip to content

Commit 2d94327

Browse files
authored
feat: partially expose internal/ethapi package (#182)
## Why this should be merged Exposes API implementations for use by SAE. ## How this works Type aliases and constructor propagation. ## How this was tested N/A
1 parent c2e6df1 commit 2d94327

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

libevm/ethapi/ethapi.go

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// Copyright 2025 the libevm authors.
2+
//
3+
// The libevm additions to go-ethereum are free software: you can redistribute
4+
// them and/or modify them under the terms of the GNU Lesser General Public License
5+
// as published by the Free Software Foundation, either version 3 of the License,
6+
// or (at your option) any later version.
7+
//
8+
// The libevm additions are distributed in the hope that they will be useful,
9+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
11+
// General Public License for more details.
12+
//
13+
// You should have received a copy of the GNU Lesser General Public License
14+
// along with the go-ethereum library. If not, see
15+
// <http://www.gnu.org/licenses/>.
16+
17+
// Package ethapi exposes the internal ethapi package.
18+
package ethapi
19+
20+
import "github.com/ava-labs/libevm/internal/ethapi"
21+
22+
// Type aliases required by constructors.
23+
type (
24+
Backend = ethapi.Backend
25+
AddrLocker = ethapi.AddrLocker
26+
)
27+
28+
type (
29+
// BlockChainAPI exposes RPC methods for querying chain data.
30+
BlockChainAPI = ethapi.BlockChainAPI
31+
// TransactionAPI exposes RPC methods for querying and creating
32+
// transactions.
33+
TransactionAPI = ethapi.TransactionAPI
34+
)
35+
36+
// NewBlockChainAPI is identical to [ethapi.NewBlockChainAPI].
37+
func NewBlockChainAPI(b Backend) *BlockChainAPI {
38+
return ethapi.NewBlockChainAPI(b)
39+
}
40+
41+
// NewTransactionAPI is identical to [ethapi.NewTransactionAPI].
42+
func NewTransactionAPI(b Backend, nonceLock *AddrLocker) *TransactionAPI {
43+
return ethapi.NewTransactionAPI(b, nonceLock)
44+
}

0 commit comments

Comments
 (0)