@sentio/sdk 2.15.6-rc.1 → 2.15.6-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/eth/builtin/internal/eacaggregatorproxy-processor.d.ts +2 -1
- package/lib/eth/builtin/internal/eacaggregatorproxy-processor.js +81 -114
- package/lib/eth/builtin/internal/eacaggregatorproxy-processor.js.map +1 -1
- package/lib/eth/builtin/internal/erc1155-processor.d.ts +2 -1
- package/lib/eth/builtin/internal/erc1155-processor.js +29 -36
- package/lib/eth/builtin/internal/erc1155-processor.js.map +1 -1
- package/lib/eth/builtin/internal/erc20-processor.d.ts +2 -1
- package/lib/eth/builtin/internal/erc20-processor.js +41 -54
- package/lib/eth/builtin/internal/erc20-processor.js.map +1 -1
- package/lib/eth/builtin/internal/erc20bytes-processor.d.ts +2 -1
- package/lib/eth/builtin/internal/erc20bytes-processor.js +33 -42
- package/lib/eth/builtin/internal/erc20bytes-processor.js.map +1 -1
- package/lib/eth/builtin/internal/erc721-processor.d.ts +2 -1
- package/lib/eth/builtin/internal/erc721-processor.js +45 -60
- package/lib/eth/builtin/internal/erc721-processor.js.map +1 -1
- package/lib/eth/builtin/internal/weth9-processor.d.ts +2 -1
- package/lib/eth/builtin/internal/weth9-processor.js +33 -42
- package/lib/eth/builtin/internal/weth9-processor.js.map +1 -1
- package/lib/eth/codegen/file.js +10 -7
- package/lib/eth/codegen/file.js.map +1 -1
- package/lib/eth/codegen/view-function.js +4 -6
- package/lib/eth/codegen/view-function.js.map +1 -1
- package/lib/eth/index.d.ts +1 -1
- package/lib/eth/index.js +1 -1
- package/lib/eth/index.js.map +1 -1
- package/lib/eth/provider.d.ts +0 -2
- package/lib/eth/provider.js +9 -10
- package/lib/eth/provider.js.map +1 -1
- package/lib/eth/provider.test.js.map +1 -1
- package/lib/utils/token.js +9 -2
- package/lib/utils/token.js.map +1 -1
- package/package.json +3 -3
- package/src/eth/builtin/internal/eacaggregatorproxy-processor.ts +84 -114
- package/src/eth/builtin/internal/erc1155-processor.ts +32 -36
- package/src/eth/builtin/internal/erc20-processor.ts +44 -54
- package/src/eth/builtin/internal/erc20bytes-processor.ts +36 -42
- package/src/eth/builtin/internal/erc721-processor.ts +48 -60
- package/src/eth/builtin/internal/weth9-processor.ts +36 -42
- package/src/eth/codegen/file.ts +10 -9
- package/src/eth/codegen/view-function.ts +4 -6
- package/src/eth/index.ts +1 -1
- package/src/eth/provider.ts +9 -11
- package/src/utils/token.ts +9 -2
@@ -18,7 +18,6 @@ import {
|
|
18
18
|
DummyProvider,
|
19
19
|
EthChainId,
|
20
20
|
TypedCallTrace,
|
21
|
-
getEthChainId,
|
22
21
|
EthContext,
|
23
22
|
EthFetchConfig,
|
24
23
|
} from "@sentio/sdk/eth";
|
@@ -202,12 +201,10 @@ export class ERC1155BoundContractView extends BoundContractView<
|
|
202
201
|
id: BigNumberish,
|
203
202
|
overrides?: Overrides
|
204
203
|
): Promise<bigint> {
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
}
|
210
|
-
return await this.view.balanceOf(account, id, overrides || {});
|
204
|
+
return await this.view.balanceOf(account, id, {
|
205
|
+
blockTag: this.context.blockNumber,
|
206
|
+
...overrides,
|
207
|
+
});
|
211
208
|
}
|
212
209
|
|
213
210
|
async balanceOfBatch(
|
@@ -215,12 +212,10 @@ export class ERC1155BoundContractView extends BoundContractView<
|
|
215
212
|
ids: BigNumberish[],
|
216
213
|
overrides?: Overrides
|
217
214
|
): Promise<bigint[]> {
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
}
|
223
|
-
return await this.view.balanceOfBatch(accounts, ids, overrides || {});
|
215
|
+
return await this.view.balanceOfBatch(accounts, ids, {
|
216
|
+
blockTag: this.context.blockNumber,
|
217
|
+
...overrides,
|
218
|
+
});
|
224
219
|
}
|
225
220
|
|
226
221
|
async isApprovedForAll(
|
@@ -228,33 +223,27 @@ export class ERC1155BoundContractView extends BoundContractView<
|
|
228
223
|
operator: string,
|
229
224
|
overrides?: Overrides
|
230
225
|
): Promise<boolean> {
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
}
|
236
|
-
return await this.view.isApprovedForAll(account, operator, overrides || {});
|
226
|
+
return await this.view.isApprovedForAll(account, operator, {
|
227
|
+
blockTag: this.context.blockNumber,
|
228
|
+
...overrides,
|
229
|
+
});
|
237
230
|
}
|
238
231
|
|
239
232
|
async supportsInterface(
|
240
233
|
interfaceId: BytesLike,
|
241
234
|
overrides?: Overrides
|
242
235
|
): Promise<boolean> {
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
}
|
248
|
-
return await this.view.supportsInterface(interfaceId, overrides || {});
|
236
|
+
return await this.view.supportsInterface(interfaceId, {
|
237
|
+
blockTag: this.context.blockNumber,
|
238
|
+
...overrides,
|
239
|
+
});
|
249
240
|
}
|
250
241
|
|
251
242
|
async uri(id: BigNumberish, overrides?: Overrides): Promise<string> {
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
}
|
257
|
-
return await this.view.uri(id, overrides || {});
|
243
|
+
return await this.view.uri(id, {
|
244
|
+
blockTag: this.context.blockNumber,
|
245
|
+
...overrides,
|
246
|
+
});
|
258
247
|
}
|
259
248
|
}
|
260
249
|
|
@@ -502,19 +491,26 @@ export class ERC1155ProcessorTemplate extends BaseProcessorTemplate<
|
|
502
491
|
}
|
503
492
|
|
504
493
|
export function getERC1155Contract(
|
505
|
-
|
494
|
+
chainId: EthChainId,
|
506
495
|
address: string
|
507
496
|
): ERC1155ContractView {
|
508
|
-
const network = getEthChainId(contextOrNetwork);
|
509
497
|
let contract = getContractByABI(
|
510
498
|
"ERC1155",
|
511
499
|
address,
|
512
|
-
|
500
|
+
chainId
|
513
501
|
) as ERC1155ContractView;
|
514
502
|
if (!contract) {
|
515
|
-
const rawContract = ERC1155__factory.connect(address, getProvider(
|
503
|
+
const rawContract = ERC1155__factory.connect(address, getProvider(chainId));
|
516
504
|
contract = new ERC1155ContractView(rawContract);
|
517
|
-
addContractByABI("ERC1155", address,
|
505
|
+
addContractByABI("ERC1155", address, chainId, contract);
|
518
506
|
}
|
519
507
|
return contract;
|
520
508
|
}
|
509
|
+
|
510
|
+
export function getERC1155ContractOnContext(
|
511
|
+
context: EthContext,
|
512
|
+
address: string
|
513
|
+
): ERC1155BoundContractView {
|
514
|
+
const view = getERC1155Contract(context.getChainId(), address);
|
515
|
+
return new ERC1155BoundContractView(address, view);
|
516
|
+
}
|
@@ -18,7 +18,6 @@ import {
|
|
18
18
|
DummyProvider,
|
19
19
|
EthChainId,
|
20
20
|
TypedCallTrace,
|
21
|
-
getEthChainId,
|
22
21
|
EthContext,
|
23
22
|
EthFetchConfig,
|
24
23
|
} from "@sentio/sdk/eth";
|
@@ -254,75 +253,59 @@ export class ERC20BoundContractView extends BoundContractView<
|
|
254
253
|
spender: string,
|
255
254
|
overrides?: Overrides
|
256
255
|
): Promise<bigint> {
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
}
|
262
|
-
return await this.view.allowance(owner, spender, overrides || {});
|
256
|
+
return await this.view.allowance(owner, spender, {
|
257
|
+
blockTag: this.context.blockNumber,
|
258
|
+
...overrides,
|
259
|
+
});
|
263
260
|
}
|
264
261
|
|
265
262
|
async balanceOf(account: string, overrides?: Overrides): Promise<bigint> {
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
}
|
271
|
-
return await this.view.balanceOf(account, overrides || {});
|
263
|
+
return await this.view.balanceOf(account, {
|
264
|
+
blockTag: this.context.blockNumber,
|
265
|
+
...overrides,
|
266
|
+
});
|
272
267
|
}
|
273
268
|
|
274
269
|
async decimals(overrides?: Overrides): Promise<bigint> {
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
}
|
280
|
-
return await this.view.decimals(overrides || {});
|
270
|
+
return await this.view.decimals({
|
271
|
+
blockTag: this.context.blockNumber,
|
272
|
+
...overrides,
|
273
|
+
});
|
281
274
|
}
|
282
275
|
|
283
276
|
async locker(overrides?: Overrides): Promise<string> {
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
}
|
289
|
-
return await this.view.locker(overrides || {});
|
277
|
+
return await this.view.locker({
|
278
|
+
blockTag: this.context.blockNumber,
|
279
|
+
...overrides,
|
280
|
+
});
|
290
281
|
}
|
291
282
|
|
292
283
|
async name(overrides?: Overrides): Promise<string> {
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
}
|
298
|
-
return await this.view.name(overrides || {});
|
284
|
+
return await this.view.name({
|
285
|
+
blockTag: this.context.blockNumber,
|
286
|
+
...overrides,
|
287
|
+
});
|
299
288
|
}
|
300
289
|
|
301
290
|
async owner(overrides?: Overrides): Promise<string> {
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
}
|
307
|
-
return await this.view.owner(overrides || {});
|
291
|
+
return await this.view.owner({
|
292
|
+
blockTag: this.context.blockNumber,
|
293
|
+
...overrides,
|
294
|
+
});
|
308
295
|
}
|
309
296
|
|
310
297
|
async symbol(overrides?: Overrides): Promise<string> {
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
}
|
316
|
-
return await this.view.symbol(overrides || {});
|
298
|
+
return await this.view.symbol({
|
299
|
+
blockTag: this.context.blockNumber,
|
300
|
+
...overrides,
|
301
|
+
});
|
317
302
|
}
|
318
303
|
|
319
304
|
async totalSupply(overrides?: Overrides): Promise<bigint> {
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
}
|
325
|
-
return await this.view.totalSupply(overrides || {});
|
305
|
+
return await this.view.totalSupply({
|
306
|
+
blockTag: this.context.blockNumber,
|
307
|
+
...overrides,
|
308
|
+
});
|
326
309
|
}
|
327
310
|
}
|
328
311
|
|
@@ -610,19 +593,26 @@ export class ERC20ProcessorTemplate extends BaseProcessorTemplate<
|
|
610
593
|
}
|
611
594
|
|
612
595
|
export function getERC20Contract(
|
613
|
-
|
596
|
+
chainId: EthChainId,
|
614
597
|
address: string
|
615
598
|
): ERC20ContractView {
|
616
|
-
const network = getEthChainId(contextOrNetwork);
|
617
599
|
let contract = getContractByABI(
|
618
600
|
"ERC20",
|
619
601
|
address,
|
620
|
-
|
602
|
+
chainId
|
621
603
|
) as ERC20ContractView;
|
622
604
|
if (!contract) {
|
623
|
-
const rawContract = ERC20__factory.connect(address, getProvider(
|
605
|
+
const rawContract = ERC20__factory.connect(address, getProvider(chainId));
|
624
606
|
contract = new ERC20ContractView(rawContract);
|
625
|
-
addContractByABI("ERC20", address,
|
607
|
+
addContractByABI("ERC20", address, chainId, contract);
|
626
608
|
}
|
627
609
|
return contract;
|
628
610
|
}
|
611
|
+
|
612
|
+
export function getERC20ContractOnContext(
|
613
|
+
context: EthContext,
|
614
|
+
address: string
|
615
|
+
): ERC20BoundContractView {
|
616
|
+
const view = getERC20Contract(context.getChainId(), address);
|
617
|
+
return new ERC20BoundContractView(address, view);
|
618
|
+
}
|
@@ -18,7 +18,6 @@ import {
|
|
18
18
|
DummyProvider,
|
19
19
|
EthChainId,
|
20
20
|
TypedCallTrace,
|
21
|
-
getEthChainId,
|
22
21
|
EthContext,
|
23
22
|
EthFetchConfig,
|
24
23
|
} from "@sentio/sdk/eth";
|
@@ -166,48 +165,38 @@ export class ERC20BytesBoundContractView extends BoundContractView<
|
|
166
165
|
ERC20BytesContractView
|
167
166
|
> {
|
168
167
|
async name(overrides?: Overrides): Promise<string> {
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
}
|
174
|
-
return await this.view.name(overrides || {});
|
168
|
+
return await this.view.name({
|
169
|
+
blockTag: this.context.blockNumber,
|
170
|
+
...overrides,
|
171
|
+
});
|
175
172
|
}
|
176
173
|
|
177
174
|
async totalSupply(overrides?: Overrides): Promise<bigint> {
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
}
|
183
|
-
return await this.view.totalSupply(overrides || {});
|
175
|
+
return await this.view.totalSupply({
|
176
|
+
blockTag: this.context.blockNumber,
|
177
|
+
...overrides,
|
178
|
+
});
|
184
179
|
}
|
185
180
|
|
186
181
|
async decimals(overrides?: Overrides): Promise<bigint> {
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
}
|
192
|
-
return await this.view.decimals(overrides || {});
|
182
|
+
return await this.view.decimals({
|
183
|
+
blockTag: this.context.blockNumber,
|
184
|
+
...overrides,
|
185
|
+
});
|
193
186
|
}
|
194
187
|
|
195
188
|
async balanceOf(who: string, overrides?: Overrides): Promise<bigint> {
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
}
|
201
|
-
return await this.view.balanceOf(who, overrides || {});
|
189
|
+
return await this.view.balanceOf(who, {
|
190
|
+
blockTag: this.context.blockNumber,
|
191
|
+
...overrides,
|
192
|
+
});
|
202
193
|
}
|
203
194
|
|
204
195
|
async symbol(overrides?: Overrides): Promise<string> {
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
}
|
210
|
-
return await this.view.symbol(overrides || {});
|
196
|
+
return await this.view.symbol({
|
197
|
+
blockTag: this.context.blockNumber,
|
198
|
+
...overrides,
|
199
|
+
});
|
211
200
|
}
|
212
201
|
|
213
202
|
async allowance(
|
@@ -215,12 +204,10 @@ export class ERC20BytesBoundContractView extends BoundContractView<
|
|
215
204
|
spender: string,
|
216
205
|
overrides?: Overrides
|
217
206
|
): Promise<bigint> {
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
}
|
223
|
-
return await this.view.allowance(owner, spender, overrides || {});
|
207
|
+
return await this.view.allowance(owner, spender, {
|
208
|
+
blockTag: this.context.blockNumber,
|
209
|
+
...overrides,
|
210
|
+
});
|
224
211
|
}
|
225
212
|
}
|
226
213
|
|
@@ -412,22 +399,29 @@ export class ERC20BytesProcessorTemplate extends BaseProcessorTemplate<
|
|
412
399
|
}
|
413
400
|
|
414
401
|
export function getERC20BytesContract(
|
415
|
-
|
402
|
+
chainId: EthChainId,
|
416
403
|
address: string
|
417
404
|
): ERC20BytesContractView {
|
418
|
-
const network = getEthChainId(contextOrNetwork);
|
419
405
|
let contract = getContractByABI(
|
420
406
|
"ERC20Bytes",
|
421
407
|
address,
|
422
|
-
|
408
|
+
chainId
|
423
409
|
) as ERC20BytesContractView;
|
424
410
|
if (!contract) {
|
425
411
|
const rawContract = ERC20Bytes__factory.connect(
|
426
412
|
address,
|
427
|
-
getProvider(
|
413
|
+
getProvider(chainId)
|
428
414
|
);
|
429
415
|
contract = new ERC20BytesContractView(rawContract);
|
430
|
-
addContractByABI("ERC20Bytes", address,
|
416
|
+
addContractByABI("ERC20Bytes", address, chainId, contract);
|
431
417
|
}
|
432
418
|
return contract;
|
433
419
|
}
|
420
|
+
|
421
|
+
export function getERC20BytesContractOnContext(
|
422
|
+
context: EthContext,
|
423
|
+
address: string
|
424
|
+
): ERC20BytesBoundContractView {
|
425
|
+
const view = getERC20BytesContract(context.getChainId(), address);
|
426
|
+
return new ERC20BytesBoundContractView(address, view);
|
427
|
+
}
|
@@ -18,7 +18,6 @@ import {
|
|
18
18
|
DummyProvider,
|
19
19
|
EthChainId,
|
20
20
|
TypedCallTrace,
|
21
|
-
getEthChainId,
|
22
21
|
EthContext,
|
23
22
|
EthFetchConfig,
|
24
23
|
} from "@sentio/sdk/eth";
|
@@ -261,33 +260,27 @@ export class ERC721BoundContractView extends BoundContractView<
|
|
261
260
|
ERC721ContractView
|
262
261
|
> {
|
263
262
|
async totalSupply(overrides?: Overrides): Promise<bigint> {
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
}
|
269
|
-
return await this.view.totalSupply(overrides || {});
|
263
|
+
return await this.view.totalSupply({
|
264
|
+
blockTag: this.context.blockNumber,
|
265
|
+
...overrides,
|
266
|
+
});
|
270
267
|
}
|
271
268
|
|
272
269
|
async balanceOf(owner: string, overrides?: Overrides): Promise<bigint> {
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
}
|
278
|
-
return await this.view.balanceOf(owner, overrides || {});
|
270
|
+
return await this.view.balanceOf(owner, {
|
271
|
+
blockTag: this.context.blockNumber,
|
272
|
+
...overrides,
|
273
|
+
});
|
279
274
|
}
|
280
275
|
|
281
276
|
async getApproved(
|
282
277
|
tokenId: BigNumberish,
|
283
278
|
overrides?: Overrides
|
284
279
|
): Promise<string> {
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
}
|
290
|
-
return await this.view.getApproved(tokenId, overrides || {});
|
280
|
+
return await this.view.getApproved(tokenId, {
|
281
|
+
blockTag: this.context.blockNumber,
|
282
|
+
...overrides,
|
283
|
+
});
|
291
284
|
}
|
292
285
|
|
293
286
|
async isApprovedForAll(
|
@@ -295,63 +288,51 @@ export class ERC721BoundContractView extends BoundContractView<
|
|
295
288
|
operator: string,
|
296
289
|
overrides?: Overrides
|
297
290
|
): Promise<boolean> {
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
}
|
303
|
-
return await this.view.isApprovedForAll(owner, operator, overrides || {});
|
291
|
+
return await this.view.isApprovedForAll(owner, operator, {
|
292
|
+
blockTag: this.context.blockNumber,
|
293
|
+
...overrides,
|
294
|
+
});
|
304
295
|
}
|
305
296
|
|
306
297
|
async name(overrides?: Overrides): Promise<string> {
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
}
|
312
|
-
return await this.view.name(overrides || {});
|
298
|
+
return await this.view.name({
|
299
|
+
blockTag: this.context.blockNumber,
|
300
|
+
...overrides,
|
301
|
+
});
|
313
302
|
}
|
314
303
|
|
315
304
|
async ownerOf(tokenId: BigNumberish, overrides?: Overrides): Promise<string> {
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
}
|
321
|
-
return await this.view.ownerOf(tokenId, overrides || {});
|
305
|
+
return await this.view.ownerOf(tokenId, {
|
306
|
+
blockTag: this.context.blockNumber,
|
307
|
+
...overrides,
|
308
|
+
});
|
322
309
|
}
|
323
310
|
|
324
311
|
async supportsInterface(
|
325
312
|
interfaceId: BytesLike,
|
326
313
|
overrides?: Overrides
|
327
314
|
): Promise<boolean> {
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
}
|
333
|
-
return await this.view.supportsInterface(interfaceId, overrides || {});
|
315
|
+
return await this.view.supportsInterface(interfaceId, {
|
316
|
+
blockTag: this.context.blockNumber,
|
317
|
+
...overrides,
|
318
|
+
});
|
334
319
|
}
|
335
320
|
|
336
321
|
async symbol(overrides?: Overrides): Promise<string> {
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
}
|
342
|
-
return await this.view.symbol(overrides || {});
|
322
|
+
return await this.view.symbol({
|
323
|
+
blockTag: this.context.blockNumber,
|
324
|
+
...overrides,
|
325
|
+
});
|
343
326
|
}
|
344
327
|
|
345
328
|
async tokenURI(
|
346
329
|
tokenId: BigNumberish,
|
347
330
|
overrides?: Overrides
|
348
331
|
): Promise<string> {
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
}
|
354
|
-
return await this.view.tokenURI(tokenId, overrides || {});
|
332
|
+
return await this.view.tokenURI(tokenId, {
|
333
|
+
blockTag: this.context.blockNumber,
|
334
|
+
...overrides,
|
335
|
+
});
|
355
336
|
}
|
356
337
|
}
|
357
338
|
|
@@ -627,19 +608,26 @@ export class ERC721ProcessorTemplate extends BaseProcessorTemplate<
|
|
627
608
|
}
|
628
609
|
|
629
610
|
export function getERC721Contract(
|
630
|
-
|
611
|
+
chainId: EthChainId,
|
631
612
|
address: string
|
632
613
|
): ERC721ContractView {
|
633
|
-
const network = getEthChainId(contextOrNetwork);
|
634
614
|
let contract = getContractByABI(
|
635
615
|
"ERC721",
|
636
616
|
address,
|
637
|
-
|
617
|
+
chainId
|
638
618
|
) as ERC721ContractView;
|
639
619
|
if (!contract) {
|
640
|
-
const rawContract = ERC721__factory.connect(address, getProvider(
|
620
|
+
const rawContract = ERC721__factory.connect(address, getProvider(chainId));
|
641
621
|
contract = new ERC721ContractView(rawContract);
|
642
|
-
addContractByABI("ERC721", address,
|
622
|
+
addContractByABI("ERC721", address, chainId, contract);
|
643
623
|
}
|
644
624
|
return contract;
|
645
625
|
}
|
626
|
+
|
627
|
+
export function getERC721ContractOnContext(
|
628
|
+
context: EthContext,
|
629
|
+
address: string
|
630
|
+
): ERC721BoundContractView {
|
631
|
+
const view = getERC721Contract(context.getChainId(), address);
|
632
|
+
return new ERC721BoundContractView(address, view);
|
633
|
+
}
|