Skip to content

Commit 39e9b7a

Browse files
committed
feat: add contract
1 parent 2fff162 commit 39e9b7a

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

evmc.go

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,10 @@ type Evmc struct {
5555
// trace *traceNamespace
5656
// ots *otsNamespace
5757

58-
erc20 *erc20Contract
59-
erc721 *erc721Contract
60-
erc1155 *erc1155Contract
58+
contract *contract
59+
erc20 *erc20Contract
60+
erc721 *erc721Contract
61+
erc1155 *erc1155Contract
6162

6263
abiCache *lru.Cache[string, interface{}]
6364
}
@@ -125,6 +126,7 @@ func newClient(ctx context.Context, url string, isWs bool, opts ...Options) (*Ev
125126
evmc.eth = &ethNamespace{info: evmc, c: evmc, s: evmc, ts: evmc}
126127
evmc.web3 = &web3Namespace{c: evmc, n: evmc}
127128
evmc.debug = &debugNamespace{c: evmc}
129+
evmc.contract = &contract{c: evmc}
128130
evmc.erc20 = &erc20Contract{info: evmc, c: evmc, ts: evmc}
129131

130132
chainID, err := evmc.eth.ChainID()
@@ -165,10 +167,15 @@ func (e *Evmc) Web3() *web3Namespace {
165167
func (e *Evmc) Eth() *ethNamespace {
166168
return e.eth
167169
}
170+
168171
func (e *Evmc) Debug() *debugNamespace {
169172
return e.debug
170173
}
171174

175+
func (e *Evmc) Contract() *contract {
176+
return e.contract
177+
}
178+
172179
// func (e *Evmc) Trace() *traceNamespace {
173180
// return e.trace
174181
// }

0 commit comments

Comments
 (0)