@sentio/sdk 2.40.0-rc.5 → 2.40.0-rc.6

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.
Files changed (79) hide show
  1. package/lib/aptos/builtin/0x1.js +10 -10
  2. package/lib/aptos/builtin/0x3.js +11 -11
  3. package/lib/aptos/builtin/index.js +11 -11
  4. package/lib/aptos/codegen/index.js +3 -3
  5. package/lib/aptos/ext/index.js +10 -10
  6. package/lib/aptos/index.js +10 -10
  7. package/lib/chunk-2QEQTKQY.js +1050 -0
  8. package/lib/{chunk-Z7QWETBQ.js → chunk-3LE323R2.js} +2 -2
  9. package/lib/{chunk-QHHXY7LO.js → chunk-5XM56ENY.js} +5 -5
  10. package/lib/{chunk-RX5G4RN2.js → chunk-7NFMED3E.js} +2 -2
  11. package/lib/{chunk-KA5CLZU6.js → chunk-7NWX3CH7.js} +90 -53
  12. package/lib/{chunk-F2IZC2B6.js → chunk-EMF4HXFG.js} +5 -5
  13. package/lib/{chunk-VP6Y633M.js → chunk-GOWJIAB2.js} +2 -2
  14. package/lib/chunk-K5OSTLHI.js +916 -0
  15. package/lib/{chunk-WLLDVQFE.js → chunk-KO4GSZCM.js} +3 -3
  16. package/lib/chunk-KTAUVRJN.js +1910 -0
  17. package/lib/{chunk-2QVJGMW4.js → chunk-KVB555XD.js} +2 -2
  18. package/lib/{chunk-TDPQO2SX.js → chunk-LICAL3XW.js} +2 -2
  19. package/lib/{chunk-NBZRHB5V.js → chunk-O6QXDRGG.js} +5 -5
  20. package/lib/{chunk-6DDG76PU.js → chunk-P6T5WFAZ.js} +4 -4
  21. package/lib/chunk-QKJ5SWA2.js +861 -0
  22. package/lib/{chunk-VJTNBZMU.js → chunk-QTWMU7GQ.js} +1 -1
  23. package/lib/{chunk-OAIP7J4S.js → chunk-RXO7SOTL.js} +2757 -1157
  24. package/lib/{chunk-S727P6WP.js → chunk-SYEQKTIU.js} +1 -1
  25. package/lib/{chunk-7OBRGY7G.js → chunk-YNJXNOVA.js} +2 -2
  26. package/lib/{chunk-N4OQDWM2.js → chunk-YOLIZKGZ.js} +1 -1
  27. package/lib/{chunk-USETTWR7.js → chunk-Z5PQR6UE.js} +100 -54
  28. package/lib/core/index.js +3 -3
  29. package/lib/{eacaggregatorproxy-aed46d4a.d.ts → eacaggregatorproxy-cb8e39be.d.ts} +76 -24
  30. package/lib/{erc1155-80a76eb5.d.ts → erc1155-fb097c50.d.ts} +31 -9
  31. package/lib/{erc20-39aae019.d.ts → erc20-95ba7721.d.ts} +61 -19
  32. package/lib/{erc721-0a429bd4.d.ts → erc721-13bf7a61.d.ts} +49 -15
  33. package/lib/eth/builtin/eacaggregatorproxy.d.ts +1 -1
  34. package/lib/eth/builtin/eacaggregatorproxy.js +5 -5
  35. package/lib/eth/builtin/erc1155.d.ts +1 -1
  36. package/lib/eth/builtin/erc1155.js +5 -5
  37. package/lib/eth/builtin/erc20.d.ts +1 -1
  38. package/lib/eth/builtin/erc20.js +4 -4
  39. package/lib/eth/builtin/erc721.d.ts +1 -1
  40. package/lib/eth/builtin/erc721.js +4 -4
  41. package/lib/eth/builtin/index.d.ts +39 -15
  42. package/lib/eth/builtin/index.js +8 -8
  43. package/lib/eth/builtin/weth9.d.ts +1 -1
  44. package/lib/eth/builtin/weth9.js +5 -5
  45. package/lib/eth/codegen/index.js +130 -39
  46. package/lib/eth/index.d.ts +1 -0
  47. package/lib/eth/index.js +7 -4
  48. package/lib/fuel/index.js +4 -4
  49. package/lib/index.js +5 -3
  50. package/lib/move/index.js +4 -4
  51. package/lib/solana/builtin/index.js +4 -4
  52. package/lib/solana/index.js +4 -4
  53. package/lib/store/index.js +3 -3
  54. package/lib/sui/builtin/0x1.js +12 -12
  55. package/lib/sui/builtin/0x2.js +13 -13
  56. package/lib/sui/builtin/0x3.js +14 -14
  57. package/lib/sui/builtin/index.js +14 -14
  58. package/lib/sui/codegen/index.js +2 -2
  59. package/lib/sui/ext/index.js +10 -10
  60. package/lib/sui/index.js +11 -11
  61. package/lib/testing/index.js +14 -14
  62. package/lib/utils/index.js +7 -7
  63. package/lib/{weth9-08664cb7.d.ts → weth9-2b52cb06.d.ts} +40 -12
  64. package/package.json +1 -1
  65. package/src/eth/builtin/internal/eacaggregatorproxy-processor.ts +1446 -115
  66. package/src/eth/builtin/internal/erc1155-processor.ts +611 -34
  67. package/src/eth/builtin/internal/erc20-processor.ts +1182 -84
  68. package/src/eth/builtin/internal/erc20bytes-processor.ts +595 -45
  69. package/src/eth/builtin/internal/erc721-processor.ts +967 -64
  70. package/src/eth/builtin/internal/weth9-processor.ts +698 -55
  71. package/src/eth/codegen/file.ts +26 -3
  72. package/src/eth/codegen/function-calls.ts +93 -8
  73. package/src/eth/codegen/types.ts +22 -1
  74. package/src/eth/eth-plugin.ts +4 -4
  75. package/src/eth/index.ts +2 -0
  76. package/lib/chunk-76HTCT5F.js +0 -469
  77. package/lib/chunk-ERTIHPSD.js +0 -528
  78. package/lib/chunk-LWKILLQ6.js +0 -820
  79. package/lib/chunk-S36AAZOU.js +0 -417
@@ -1,7 +1,7 @@
1
1
  /* Autogenerated file. Do not edit manually. */
2
2
  /* tslint:disable */
3
3
  /* eslint-disable */
4
- import { BigNumberish, Overrides, BytesLike } from "ethers";
4
+ import { BigNumberish, Overrides, BytesLike, Interface } from "ethers";
5
5
  import {
6
6
  addContractByABI,
7
7
  getContractByABI,
@@ -21,7 +21,9 @@ import {
21
21
  EthContext,
22
22
  EthFetchConfig,
23
23
  PreprocessResult,
24
+ makeEthCallKey,
24
25
  } from "@sentio/sdk/eth";
26
+ import { EthCallParam, EthCallContext, PreparedData } from "@sentio/protos";
25
27
 
26
28
  import { ERC721__factory } from "./index.js";
27
29
  import {
@@ -155,8 +157,29 @@ export class ERC721ContractView extends ContractView<ERC721> {
155
157
  this.callStatic.contract = contract;
156
158
  }
157
159
 
158
- async totalSupply(overrides?: Overrides): Promise<bigint> {
160
+ async totalSupply(
161
+ overrides?: Overrides,
162
+ preparedData?: PreparedData,
163
+ ethCallContext?: EthCallContext
164
+ ): Promise<bigint> {
159
165
  try {
166
+ if (preparedData?.ethCallResults && ethCallContext) {
167
+ const iface = new Interface([
168
+ "function totalSupply() view returns (uint256)",
169
+ ]);
170
+ const calldata = iface.encodeFunctionData("totalSupply", []);
171
+ const key = makeEthCallKey({
172
+ context: ethCallContext,
173
+ calldata,
174
+ });
175
+ const ret = preparedData.ethCallResults[key];
176
+ if (ret) {
177
+ const result = iface
178
+ .decodeFunctionResult("totalSupply", ret)
179
+ .toArray();
180
+ return result.length == 1 ? result[0] : result;
181
+ }
182
+ }
160
183
  return await this.contract.getFunction("totalSupply()")(overrides || {});
161
184
  } catch (e) {
162
185
  const stack = new Error().stack;
@@ -164,8 +187,28 @@ export class ERC721ContractView extends ContractView<ERC721> {
164
187
  }
165
188
  }
166
189
 
167
- async balanceOf(owner: string, overrides?: Overrides): Promise<bigint> {
190
+ async balanceOf(
191
+ owner: string,
192
+ overrides?: Overrides,
193
+ preparedData?: PreparedData,
194
+ ethCallContext?: EthCallContext
195
+ ): Promise<bigint> {
168
196
  try {
197
+ if (preparedData?.ethCallResults && ethCallContext) {
198
+ const iface = new Interface([
199
+ "function balanceOf(address) view returns (uint256)",
200
+ ]);
201
+ const calldata = iface.encodeFunctionData("balanceOf", [owner]);
202
+ const key = makeEthCallKey({
203
+ context: ethCallContext,
204
+ calldata,
205
+ });
206
+ const ret = preparedData.ethCallResults[key];
207
+ if (ret) {
208
+ const result = iface.decodeFunctionResult("balanceOf", ret).toArray();
209
+ return result.length == 1 ? result[0] : result;
210
+ }
211
+ }
169
212
  return await this.contract.getFunction("balanceOf(address)")(
170
213
  owner,
171
214
  overrides || {}
@@ -178,9 +221,28 @@ export class ERC721ContractView extends ContractView<ERC721> {
178
221
 
179
222
  async getApproved(
180
223
  tokenId: BigNumberish,
181
- overrides?: Overrides
224
+ overrides?: Overrides,
225
+ preparedData?: PreparedData,
226
+ ethCallContext?: EthCallContext
182
227
  ): Promise<string> {
183
228
  try {
229
+ if (preparedData?.ethCallResults && ethCallContext) {
230
+ const iface = new Interface([
231
+ "function getApproved(uint256) view returns (address)",
232
+ ]);
233
+ const calldata = iface.encodeFunctionData("getApproved", [tokenId]);
234
+ const key = makeEthCallKey({
235
+ context: ethCallContext,
236
+ calldata,
237
+ });
238
+ const ret = preparedData.ethCallResults[key];
239
+ if (ret) {
240
+ const result = iface
241
+ .decodeFunctionResult("getApproved", ret)
242
+ .toArray();
243
+ return result.length == 1 ? result[0] : result;
244
+ }
245
+ }
184
246
  return await this.contract.getFunction("getApproved(uint256)")(
185
247
  tokenId,
186
248
  overrides || {}
@@ -194,9 +256,31 @@ export class ERC721ContractView extends ContractView<ERC721> {
194
256
  async isApprovedForAll(
195
257
  owner: string,
196
258
  operator: string,
197
- overrides?: Overrides
259
+ overrides?: Overrides,
260
+ preparedData?: PreparedData,
261
+ ethCallContext?: EthCallContext
198
262
  ): Promise<boolean> {
199
263
  try {
264
+ if (preparedData?.ethCallResults && ethCallContext) {
265
+ const iface = new Interface([
266
+ "function isApprovedForAll(address,address) view returns (bool)",
267
+ ]);
268
+ const calldata = iface.encodeFunctionData("isApprovedForAll", [
269
+ owner,
270
+ operator,
271
+ ]);
272
+ const key = makeEthCallKey({
273
+ context: ethCallContext,
274
+ calldata,
275
+ });
276
+ const ret = preparedData.ethCallResults[key];
277
+ if (ret) {
278
+ const result = iface
279
+ .decodeFunctionResult("isApprovedForAll", ret)
280
+ .toArray();
281
+ return result.length == 1 ? result[0] : result;
282
+ }
283
+ }
200
284
  return await this.contract.getFunction(
201
285
  "isApprovedForAll(address,address)"
202
286
  )(owner, operator, overrides || {});
@@ -206,8 +290,25 @@ export class ERC721ContractView extends ContractView<ERC721> {
206
290
  }
207
291
  }
208
292
 
209
- async name(overrides?: Overrides): Promise<string> {
293
+ async name(
294
+ overrides?: Overrides,
295
+ preparedData?: PreparedData,
296
+ ethCallContext?: EthCallContext
297
+ ): Promise<string> {
210
298
  try {
299
+ if (preparedData?.ethCallResults && ethCallContext) {
300
+ const iface = new Interface(["function name() view returns (string)"]);
301
+ const calldata = iface.encodeFunctionData("name", []);
302
+ const key = makeEthCallKey({
303
+ context: ethCallContext,
304
+ calldata,
305
+ });
306
+ const ret = preparedData.ethCallResults[key];
307
+ if (ret) {
308
+ const result = iface.decodeFunctionResult("name", ret).toArray();
309
+ return result.length == 1 ? result[0] : result;
310
+ }
311
+ }
211
312
  return await this.contract.getFunction("name()")(overrides || {});
212
313
  } catch (e) {
213
314
  const stack = new Error().stack;
@@ -215,8 +316,28 @@ export class ERC721ContractView extends ContractView<ERC721> {
215
316
  }
216
317
  }
217
318
 
218
- async ownerOf(tokenId: BigNumberish, overrides?: Overrides): Promise<string> {
319
+ async ownerOf(
320
+ tokenId: BigNumberish,
321
+ overrides?: Overrides,
322
+ preparedData?: PreparedData,
323
+ ethCallContext?: EthCallContext
324
+ ): Promise<string> {
219
325
  try {
326
+ if (preparedData?.ethCallResults && ethCallContext) {
327
+ const iface = new Interface([
328
+ "function ownerOf(uint256) view returns (address)",
329
+ ]);
330
+ const calldata = iface.encodeFunctionData("ownerOf", [tokenId]);
331
+ const key = makeEthCallKey({
332
+ context: ethCallContext,
333
+ calldata,
334
+ });
335
+ const ret = preparedData.ethCallResults[key];
336
+ if (ret) {
337
+ const result = iface.decodeFunctionResult("ownerOf", ret).toArray();
338
+ return result.length == 1 ? result[0] : result;
339
+ }
340
+ }
220
341
  return await this.contract.getFunction("ownerOf(uint256)")(
221
342
  tokenId,
222
343
  overrides || {}
@@ -229,9 +350,30 @@ export class ERC721ContractView extends ContractView<ERC721> {
229
350
 
230
351
  async supportsInterface(
231
352
  interfaceId: BytesLike,
232
- overrides?: Overrides
353
+ overrides?: Overrides,
354
+ preparedData?: PreparedData,
355
+ ethCallContext?: EthCallContext
233
356
  ): Promise<boolean> {
234
357
  try {
358
+ if (preparedData?.ethCallResults && ethCallContext) {
359
+ const iface = new Interface([
360
+ "function supportsInterface(bytes4) view returns (bool)",
361
+ ]);
362
+ const calldata = iface.encodeFunctionData("supportsInterface", [
363
+ interfaceId,
364
+ ]);
365
+ const key = makeEthCallKey({
366
+ context: ethCallContext,
367
+ calldata,
368
+ });
369
+ const ret = preparedData.ethCallResults[key];
370
+ if (ret) {
371
+ const result = iface
372
+ .decodeFunctionResult("supportsInterface", ret)
373
+ .toArray();
374
+ return result.length == 1 ? result[0] : result;
375
+ }
376
+ }
235
377
  return await this.contract.getFunction("supportsInterface(bytes4)")(
236
378
  interfaceId,
237
379
  overrides || {}
@@ -242,8 +384,27 @@ export class ERC721ContractView extends ContractView<ERC721> {
242
384
  }
243
385
  }
244
386
 
245
- async symbol(overrides?: Overrides): Promise<string> {
387
+ async symbol(
388
+ overrides?: Overrides,
389
+ preparedData?: PreparedData,
390
+ ethCallContext?: EthCallContext
391
+ ): Promise<string> {
246
392
  try {
393
+ if (preparedData?.ethCallResults && ethCallContext) {
394
+ const iface = new Interface([
395
+ "function symbol() view returns (string)",
396
+ ]);
397
+ const calldata = iface.encodeFunctionData("symbol", []);
398
+ const key = makeEthCallKey({
399
+ context: ethCallContext,
400
+ calldata,
401
+ });
402
+ const ret = preparedData.ethCallResults[key];
403
+ if (ret) {
404
+ const result = iface.decodeFunctionResult("symbol", ret).toArray();
405
+ return result.length == 1 ? result[0] : result;
406
+ }
407
+ }
247
408
  return await this.contract.getFunction("symbol()")(overrides || {});
248
409
  } catch (e) {
249
410
  const stack = new Error().stack;
@@ -253,9 +414,26 @@ export class ERC721ContractView extends ContractView<ERC721> {
253
414
 
254
415
  async tokenURI(
255
416
  tokenId: BigNumberish,
256
- overrides?: Overrides
417
+ overrides?: Overrides,
418
+ preparedData?: PreparedData,
419
+ ethCallContext?: EthCallContext
257
420
  ): Promise<string> {
258
421
  try {
422
+ if (preparedData?.ethCallResults && ethCallContext) {
423
+ const iface = new Interface([
424
+ "function tokenURI(uint256) view returns (string)",
425
+ ]);
426
+ const calldata = iface.encodeFunctionData("tokenURI", [tokenId]);
427
+ const key = makeEthCallKey({
428
+ context: ethCallContext,
429
+ calldata,
430
+ });
431
+ const ret = preparedData.ethCallResults[key];
432
+ if (ret) {
433
+ const result = iface.decodeFunctionResult("tokenURI", ret).toArray();
434
+ return result.length == 1 ? result[0] : result;
435
+ }
436
+ }
259
437
  return await this.contract.getFunction("tokenURI(uint256)")(
260
438
  tokenId,
261
439
  overrides || {}
@@ -272,9 +450,26 @@ export class ERC721ContractView extends ContractView<ERC721> {
272
450
  async approve(
273
451
  to: string,
274
452
  tokenId: BigNumberish,
275
- overrides?: Overrides
453
+ overrides?: Overrides,
454
+ preparedData?: PreparedData,
455
+ ethCallContext?: EthCallContext
276
456
  ): Promise<void> {
277
457
  try {
458
+ if (preparedData?.ethCallResults && ethCallContext) {
459
+ const iface = new Interface([
460
+ "function approve(address,uint256) nonpayable returns ()",
461
+ ]);
462
+ const calldata = iface.encodeFunctionData("approve", [to, tokenId]);
463
+ const key = makeEthCallKey({
464
+ context: ethCallContext,
465
+ calldata,
466
+ });
467
+ const ret = preparedData.ethCallResults[key];
468
+ if (ret) {
469
+ const result = iface.decodeFunctionResult("approve", ret).toArray();
470
+ return result.length == 1 ? result[0] : result;
471
+ }
472
+ }
278
473
  return await this.contract
279
474
  .getFunction("approve(address,uint256)")
280
475
  .staticCall(to, tokenId, overrides || {});
@@ -287,9 +482,32 @@ export class ERC721ContractView extends ContractView<ERC721> {
287
482
  from: string,
288
483
  to: string,
289
484
  tokenId: BigNumberish,
290
- overrides?: Overrides
485
+ overrides?: Overrides,
486
+ preparedData?: PreparedData,
487
+ ethCallContext?: EthCallContext
291
488
  ): Promise<void> {
292
489
  try {
490
+ if (preparedData?.ethCallResults && ethCallContext) {
491
+ const iface = new Interface([
492
+ "function safeTransferFrom(address,address,uint256) nonpayable returns ()",
493
+ ]);
494
+ const calldata = iface.encodeFunctionData("safeTransferFrom", [
495
+ from,
496
+ to,
497
+ tokenId,
498
+ ]);
499
+ const key = makeEthCallKey({
500
+ context: ethCallContext,
501
+ calldata,
502
+ });
503
+ const ret = preparedData.ethCallResults[key];
504
+ if (ret) {
505
+ const result = iface
506
+ .decodeFunctionResult("safeTransferFrom", ret)
507
+ .toArray();
508
+ return result.length == 1 ? result[0] : result;
509
+ }
510
+ }
293
511
  return await this.contract
294
512
  .getFunction("safeTransferFrom(address,address,uint256)")
295
513
  .staticCall(from, to, tokenId, overrides || {});
@@ -303,9 +521,33 @@ export class ERC721ContractView extends ContractView<ERC721> {
303
521
  to: string,
304
522
  tokenId: BigNumberish,
305
523
  data: BytesLike,
306
- overrides?: Overrides
524
+ overrides?: Overrides,
525
+ preparedData?: PreparedData,
526
+ ethCallContext?: EthCallContext
307
527
  ): Promise<void> {
308
528
  try {
529
+ if (preparedData?.ethCallResults && ethCallContext) {
530
+ const iface = new Interface([
531
+ "function safeTransferFrom(address,address,uint256,bytes) nonpayable returns ()",
532
+ ]);
533
+ const calldata = iface.encodeFunctionData("safeTransferFrom", [
534
+ from,
535
+ to,
536
+ tokenId,
537
+ data,
538
+ ]);
539
+ const key = makeEthCallKey({
540
+ context: ethCallContext,
541
+ calldata,
542
+ });
543
+ const ret = preparedData.ethCallResults[key];
544
+ if (ret) {
545
+ const result = iface
546
+ .decodeFunctionResult("safeTransferFrom", ret)
547
+ .toArray();
548
+ return result.length == 1 ? result[0] : result;
549
+ }
550
+ }
309
551
  return await this.contract
310
552
  .getFunction("safeTransferFrom(address,address,uint256,bytes)")
311
553
  .staticCall(from, to, tokenId, data, overrides || {});
@@ -317,9 +559,31 @@ export class ERC721ContractView extends ContractView<ERC721> {
317
559
  async setApprovalForAll(
318
560
  operator: string,
319
561
  _approved: boolean,
320
- overrides?: Overrides
562
+ overrides?: Overrides,
563
+ preparedData?: PreparedData,
564
+ ethCallContext?: EthCallContext
321
565
  ): Promise<void> {
322
566
  try {
567
+ if (preparedData?.ethCallResults && ethCallContext) {
568
+ const iface = new Interface([
569
+ "function setApprovalForAll(address,bool) nonpayable returns ()",
570
+ ]);
571
+ const calldata = iface.encodeFunctionData("setApprovalForAll", [
572
+ operator,
573
+ _approved,
574
+ ]);
575
+ const key = makeEthCallKey({
576
+ context: ethCallContext,
577
+ calldata,
578
+ });
579
+ const ret = preparedData.ethCallResults[key];
580
+ if (ret) {
581
+ const result = iface
582
+ .decodeFunctionResult("setApprovalForAll", ret)
583
+ .toArray();
584
+ return result.length == 1 ? result[0] : result;
585
+ }
586
+ }
323
587
  return await this.contract
324
588
  .getFunction("setApprovalForAll(address,bool)")
325
589
  .staticCall(operator, _approved, overrides || {});
@@ -332,9 +596,32 @@ export class ERC721ContractView extends ContractView<ERC721> {
332
596
  from: string,
333
597
  to: string,
334
598
  tokenId: BigNumberish,
335
- overrides?: Overrides
599
+ overrides?: Overrides,
600
+ preparedData?: PreparedData,
601
+ ethCallContext?: EthCallContext
336
602
  ): Promise<void> {
337
603
  try {
604
+ if (preparedData?.ethCallResults && ethCallContext) {
605
+ const iface = new Interface([
606
+ "function transferFrom(address,address,uint256) nonpayable returns ()",
607
+ ]);
608
+ const calldata = iface.encodeFunctionData("transferFrom", [
609
+ from,
610
+ to,
611
+ tokenId,
612
+ ]);
613
+ const key = makeEthCallKey({
614
+ context: ethCallContext,
615
+ calldata,
616
+ });
617
+ const ret = preparedData.ethCallResults[key];
618
+ if (ret) {
619
+ const result = iface
620
+ .decodeFunctionResult("transferFrom", ret)
621
+ .toArray();
622
+ return result.length == 1 ? result[0] : result;
623
+ }
624
+ }
338
625
  return await this.contract
339
626
  .getFunction("transferFrom(address,address,uint256)")
340
627
  .staticCall(from, to, tokenId, overrides || {});
@@ -344,6 +631,262 @@ export class ERC721ContractView extends ContractView<ERC721> {
344
631
  }
345
632
  },
346
633
  };
634
+
635
+ encodeCall = {
636
+ approve(
637
+ to: string,
638
+ tokenId: BigNumberish,
639
+ ethCallContext: EthCallContext
640
+ ): EthCallParam {
641
+ try {
642
+ const iface = new Interface(["function approve(address,uint256)"]);
643
+ const calldata = iface.encodeFunctionData("approve", [to, tokenId]);
644
+ return {
645
+ context: ethCallContext,
646
+ calldata,
647
+ };
648
+ } catch (e) {
649
+ const stack = new Error().stack;
650
+ throw transformEtherError(e, undefined, stack);
651
+ }
652
+ },
653
+ totalSupply(ethCallContext: EthCallContext): EthCallParam {
654
+ try {
655
+ const iface = new Interface(["function totalSupply()"]);
656
+ const calldata = iface.encodeFunctionData("totalSupply", []);
657
+ return {
658
+ context: ethCallContext,
659
+ calldata,
660
+ };
661
+ } catch (e) {
662
+ const stack = new Error().stack;
663
+ throw transformEtherError(e, undefined, stack);
664
+ }
665
+ },
666
+ balanceOf(owner: string, ethCallContext: EthCallContext): EthCallParam {
667
+ try {
668
+ const iface = new Interface(["function balanceOf(address)"]);
669
+ const calldata = iface.encodeFunctionData("balanceOf", [owner]);
670
+ return {
671
+ context: ethCallContext,
672
+ calldata,
673
+ };
674
+ } catch (e) {
675
+ const stack = new Error().stack;
676
+ throw transformEtherError(e, undefined, stack);
677
+ }
678
+ },
679
+ getApproved(
680
+ tokenId: BigNumberish,
681
+ ethCallContext: EthCallContext
682
+ ): EthCallParam {
683
+ try {
684
+ const iface = new Interface(["function getApproved(uint256)"]);
685
+ const calldata = iface.encodeFunctionData("getApproved", [tokenId]);
686
+ return {
687
+ context: ethCallContext,
688
+ calldata,
689
+ };
690
+ } catch (e) {
691
+ const stack = new Error().stack;
692
+ throw transformEtherError(e, undefined, stack);
693
+ }
694
+ },
695
+ isApprovedForAll(
696
+ owner: string,
697
+ operator: string,
698
+ ethCallContext: EthCallContext
699
+ ): EthCallParam {
700
+ try {
701
+ const iface = new Interface([
702
+ "function isApprovedForAll(address,address)",
703
+ ]);
704
+ const calldata = iface.encodeFunctionData("isApprovedForAll", [
705
+ owner,
706
+ operator,
707
+ ]);
708
+ return {
709
+ context: ethCallContext,
710
+ calldata,
711
+ };
712
+ } catch (e) {
713
+ const stack = new Error().stack;
714
+ throw transformEtherError(e, undefined, stack);
715
+ }
716
+ },
717
+ name(ethCallContext: EthCallContext): EthCallParam {
718
+ try {
719
+ const iface = new Interface(["function name()"]);
720
+ const calldata = iface.encodeFunctionData("name", []);
721
+ return {
722
+ context: ethCallContext,
723
+ calldata,
724
+ };
725
+ } catch (e) {
726
+ const stack = new Error().stack;
727
+ throw transformEtherError(e, undefined, stack);
728
+ }
729
+ },
730
+ ownerOf(
731
+ tokenId: BigNumberish,
732
+ ethCallContext: EthCallContext
733
+ ): EthCallParam {
734
+ try {
735
+ const iface = new Interface(["function ownerOf(uint256)"]);
736
+ const calldata = iface.encodeFunctionData("ownerOf", [tokenId]);
737
+ return {
738
+ context: ethCallContext,
739
+ calldata,
740
+ };
741
+ } catch (e) {
742
+ const stack = new Error().stack;
743
+ throw transformEtherError(e, undefined, stack);
744
+ }
745
+ },
746
+ safeTransferFrom_address_address_uint256(
747
+ from: string,
748
+ to: string,
749
+ tokenId: BigNumberish,
750
+ ethCallContext: EthCallContext
751
+ ): EthCallParam {
752
+ try {
753
+ const iface = new Interface([
754
+ "function safeTransferFrom(address,address,uint256)",
755
+ ]);
756
+ const calldata = iface.encodeFunctionData("safeTransferFrom", [
757
+ from,
758
+ to,
759
+ tokenId,
760
+ ]);
761
+ return {
762
+ context: ethCallContext,
763
+ calldata,
764
+ };
765
+ } catch (e) {
766
+ const stack = new Error().stack;
767
+ throw transformEtherError(e, undefined, stack);
768
+ }
769
+ },
770
+ safeTransferFrom_address_address_uint256_bytes(
771
+ from: string,
772
+ to: string,
773
+ tokenId: BigNumberish,
774
+ data: BytesLike,
775
+ ethCallContext: EthCallContext
776
+ ): EthCallParam {
777
+ try {
778
+ const iface = new Interface([
779
+ "function safeTransferFrom(address,address,uint256,bytes)",
780
+ ]);
781
+ const calldata = iface.encodeFunctionData("safeTransferFrom", [
782
+ from,
783
+ to,
784
+ tokenId,
785
+ data,
786
+ ]);
787
+ return {
788
+ context: ethCallContext,
789
+ calldata,
790
+ };
791
+ } catch (e) {
792
+ const stack = new Error().stack;
793
+ throw transformEtherError(e, undefined, stack);
794
+ }
795
+ },
796
+ setApprovalForAll(
797
+ operator: string,
798
+ _approved: boolean,
799
+ ethCallContext: EthCallContext
800
+ ): EthCallParam {
801
+ try {
802
+ const iface = new Interface([
803
+ "function setApprovalForAll(address,bool)",
804
+ ]);
805
+ const calldata = iface.encodeFunctionData("setApprovalForAll", [
806
+ operator,
807
+ _approved,
808
+ ]);
809
+ return {
810
+ context: ethCallContext,
811
+ calldata,
812
+ };
813
+ } catch (e) {
814
+ const stack = new Error().stack;
815
+ throw transformEtherError(e, undefined, stack);
816
+ }
817
+ },
818
+ supportsInterface(
819
+ interfaceId: BytesLike,
820
+ ethCallContext: EthCallContext
821
+ ): EthCallParam {
822
+ try {
823
+ const iface = new Interface(["function supportsInterface(bytes4)"]);
824
+ const calldata = iface.encodeFunctionData("supportsInterface", [
825
+ interfaceId,
826
+ ]);
827
+ return {
828
+ context: ethCallContext,
829
+ calldata,
830
+ };
831
+ } catch (e) {
832
+ const stack = new Error().stack;
833
+ throw transformEtherError(e, undefined, stack);
834
+ }
835
+ },
836
+ symbol(ethCallContext: EthCallContext): EthCallParam {
837
+ try {
838
+ const iface = new Interface(["function symbol()"]);
839
+ const calldata = iface.encodeFunctionData("symbol", []);
840
+ return {
841
+ context: ethCallContext,
842
+ calldata,
843
+ };
844
+ } catch (e) {
845
+ const stack = new Error().stack;
846
+ throw transformEtherError(e, undefined, stack);
847
+ }
848
+ },
849
+ tokenURI(
850
+ tokenId: BigNumberish,
851
+ ethCallContext: EthCallContext
852
+ ): EthCallParam {
853
+ try {
854
+ const iface = new Interface(["function tokenURI(uint256)"]);
855
+ const calldata = iface.encodeFunctionData("tokenURI", [tokenId]);
856
+ return {
857
+ context: ethCallContext,
858
+ calldata,
859
+ };
860
+ } catch (e) {
861
+ const stack = new Error().stack;
862
+ throw transformEtherError(e, undefined, stack);
863
+ }
864
+ },
865
+ transferFrom(
866
+ from: string,
867
+ to: string,
868
+ tokenId: BigNumberish,
869
+ ethCallContext: EthCallContext
870
+ ): EthCallParam {
871
+ try {
872
+ const iface = new Interface([
873
+ "function transferFrom(address,address,uint256)",
874
+ ]);
875
+ const calldata = iface.encodeFunctionData("transferFrom", [
876
+ from,
877
+ to,
878
+ tokenId,
879
+ ]);
880
+ return {
881
+ context: ethCallContext,
882
+ calldata,
883
+ };
884
+ } catch (e) {
885
+ const stack = new Error().stack;
886
+ throw transformEtherError(e, undefined, stack);
887
+ }
888
+ },
889
+ };
347
890
  }
348
891
 
349
892
  export class ERC721BoundContractView extends BoundContractView<
@@ -351,27 +894,56 @@ export class ERC721BoundContractView extends BoundContractView<
351
894
  ERC721ContractView
352
895
  > {
353
896
  async totalSupply(overrides?: Overrides): Promise<bigint> {
354
- return await this.view.totalSupply({
355
- blockTag: this.context.blockNumber,
356
- ...overrides,
357
- });
897
+ const ethCallContext = {
898
+ chainId: this.context.chainId,
899
+ blockTag: this.context.blockNumber.toString(16),
900
+ address: this.context.address,
901
+ };
902
+ return await this.view.totalSupply(
903
+ {
904
+ blockTag: this.context.blockNumber,
905
+ ...overrides,
906
+ },
907
+ this.context.preparedData,
908
+ ethCallContext
909
+ );
358
910
  }
359
911
 
360
912
  async balanceOf(owner: string, overrides?: Overrides): Promise<bigint> {
361
- return await this.view.balanceOf(owner, {
362
- blockTag: this.context.blockNumber,
363
- ...overrides,
364
- });
913
+ const ethCallContext = {
914
+ chainId: this.context.chainId,
915
+ blockTag: this.context.blockNumber.toString(16),
916
+ address: this.context.address,
917
+ };
918
+ return await this.view.balanceOf(
919
+ owner,
920
+ {
921
+ blockTag: this.context.blockNumber,
922
+ ...overrides,
923
+ },
924
+ this.context.preparedData,
925
+ ethCallContext
926
+ );
365
927
  }
366
928
 
367
929
  async getApproved(
368
930
  tokenId: BigNumberish,
369
931
  overrides?: Overrides
370
932
  ): Promise<string> {
371
- return await this.view.getApproved(tokenId, {
372
- blockTag: this.context.blockNumber,
373
- ...overrides,
374
- });
933
+ const ethCallContext = {
934
+ chainId: this.context.chainId,
935
+ blockTag: this.context.blockNumber.toString(16),
936
+ address: this.context.address,
937
+ };
938
+ return await this.view.getApproved(
939
+ tokenId,
940
+ {
941
+ blockTag: this.context.blockNumber,
942
+ ...overrides,
943
+ },
944
+ this.context.preparedData,
945
+ ethCallContext
946
+ );
375
947
  }
376
948
 
377
949
  async isApprovedForAll(
@@ -379,51 +951,110 @@ export class ERC721BoundContractView extends BoundContractView<
379
951
  operator: string,
380
952
  overrides?: Overrides
381
953
  ): Promise<boolean> {
382
- return await this.view.isApprovedForAll(owner, operator, {
383
- blockTag: this.context.blockNumber,
384
- ...overrides,
385
- });
954
+ const ethCallContext = {
955
+ chainId: this.context.chainId,
956
+ blockTag: this.context.blockNumber.toString(16),
957
+ address: this.context.address,
958
+ };
959
+ return await this.view.isApprovedForAll(
960
+ owner,
961
+ operator,
962
+ {
963
+ blockTag: this.context.blockNumber,
964
+ ...overrides,
965
+ },
966
+ this.context.preparedData,
967
+ ethCallContext
968
+ );
386
969
  }
387
970
 
388
971
  async name(overrides?: Overrides): Promise<string> {
389
- return await this.view.name({
390
- blockTag: this.context.blockNumber,
391
- ...overrides,
392
- });
972
+ const ethCallContext = {
973
+ chainId: this.context.chainId,
974
+ blockTag: this.context.blockNumber.toString(16),
975
+ address: this.context.address,
976
+ };
977
+ return await this.view.name(
978
+ {
979
+ blockTag: this.context.blockNumber,
980
+ ...overrides,
981
+ },
982
+ this.context.preparedData,
983
+ ethCallContext
984
+ );
393
985
  }
394
986
 
395
987
  async ownerOf(tokenId: BigNumberish, overrides?: Overrides): Promise<string> {
396
- return await this.view.ownerOf(tokenId, {
397
- blockTag: this.context.blockNumber,
398
- ...overrides,
399
- });
988
+ const ethCallContext = {
989
+ chainId: this.context.chainId,
990
+ blockTag: this.context.blockNumber.toString(16),
991
+ address: this.context.address,
992
+ };
993
+ return await this.view.ownerOf(
994
+ tokenId,
995
+ {
996
+ blockTag: this.context.blockNumber,
997
+ ...overrides,
998
+ },
999
+ this.context.preparedData,
1000
+ ethCallContext
1001
+ );
400
1002
  }
401
1003
 
402
1004
  async supportsInterface(
403
1005
  interfaceId: BytesLike,
404
1006
  overrides?: Overrides
405
1007
  ): Promise<boolean> {
406
- return await this.view.supportsInterface(interfaceId, {
407
- blockTag: this.context.blockNumber,
408
- ...overrides,
409
- });
1008
+ const ethCallContext = {
1009
+ chainId: this.context.chainId,
1010
+ blockTag: this.context.blockNumber.toString(16),
1011
+ address: this.context.address,
1012
+ };
1013
+ return await this.view.supportsInterface(
1014
+ interfaceId,
1015
+ {
1016
+ blockTag: this.context.blockNumber,
1017
+ ...overrides,
1018
+ },
1019
+ this.context.preparedData,
1020
+ ethCallContext
1021
+ );
410
1022
  }
411
1023
 
412
1024
  async symbol(overrides?: Overrides): Promise<string> {
413
- return await this.view.symbol({
414
- blockTag: this.context.blockNumber,
415
- ...overrides,
416
- });
1025
+ const ethCallContext = {
1026
+ chainId: this.context.chainId,
1027
+ blockTag: this.context.blockNumber.toString(16),
1028
+ address: this.context.address,
1029
+ };
1030
+ return await this.view.symbol(
1031
+ {
1032
+ blockTag: this.context.blockNumber,
1033
+ ...overrides,
1034
+ },
1035
+ this.context.preparedData,
1036
+ ethCallContext
1037
+ );
417
1038
  }
418
1039
 
419
1040
  async tokenURI(
420
1041
  tokenId: BigNumberish,
421
1042
  overrides?: Overrides
422
1043
  ): Promise<string> {
423
- return await this.view.tokenURI(tokenId, {
424
- blockTag: this.context.blockNumber,
425
- ...overrides,
426
- });
1044
+ const ethCallContext = {
1045
+ chainId: this.context.chainId,
1046
+ blockTag: this.context.blockNumber.toString(16),
1047
+ address: this.context.address,
1048
+ };
1049
+ return await this.view.tokenURI(
1050
+ tokenId,
1051
+ {
1052
+ blockTag: this.context.blockNumber,
1053
+ ...overrides,
1054
+ },
1055
+ this.context.preparedData,
1056
+ ethCallContext
1057
+ );
427
1058
  }
428
1059
 
429
1060
  callStatic = {
@@ -435,10 +1066,21 @@ export class ERC721BoundContractView extends BoundContractView<
435
1066
  tokenId: BigNumberish,
436
1067
  overrides?: Overrides
437
1068
  ): Promise<void> {
438
- return await this.view.callStatic.approve(to, tokenId, {
439
- blockTag: this.context.blockNumber,
440
- ...overrides,
441
- });
1069
+ const ethCallContext = {
1070
+ chainId: this.context.chainId,
1071
+ blockTag: this.context.blockNumber.toString(16),
1072
+ address: this.context.address,
1073
+ };
1074
+ return await this.view.callStatic.approve(
1075
+ to,
1076
+ tokenId,
1077
+ {
1078
+ blockTag: this.context.blockNumber,
1079
+ ...overrides,
1080
+ },
1081
+ this.context.preparedData,
1082
+ ethCallContext
1083
+ );
442
1084
  },
443
1085
  async safeTransferFrom_address_address_uint256(
444
1086
  from: string,
@@ -446,6 +1088,11 @@ export class ERC721BoundContractView extends BoundContractView<
446
1088
  tokenId: BigNumberish,
447
1089
  overrides?: Overrides
448
1090
  ): Promise<void> {
1091
+ const ethCallContext = {
1092
+ chainId: this.context.chainId,
1093
+ blockTag: this.context.blockNumber.toString(16),
1094
+ address: this.context.address,
1095
+ };
449
1096
  return await this.view.callStatic.safeTransferFrom_address_address_uint256(
450
1097
  from,
451
1098
  to,
@@ -453,7 +1100,9 @@ export class ERC721BoundContractView extends BoundContractView<
453
1100
  {
454
1101
  blockTag: this.context.blockNumber,
455
1102
  ...overrides,
456
- }
1103
+ },
1104
+ this.context.preparedData,
1105
+ ethCallContext
457
1106
  );
458
1107
  },
459
1108
  async safeTransferFrom_address_address_uint256_bytes(
@@ -463,6 +1112,11 @@ export class ERC721BoundContractView extends BoundContractView<
463
1112
  data: BytesLike,
464
1113
  overrides?: Overrides
465
1114
  ): Promise<void> {
1115
+ const ethCallContext = {
1116
+ chainId: this.context.chainId,
1117
+ blockTag: this.context.blockNumber.toString(16),
1118
+ address: this.context.address,
1119
+ };
466
1120
  return await this.view.callStatic.safeTransferFrom_address_address_uint256_bytes(
467
1121
  from,
468
1122
  to,
@@ -471,7 +1125,9 @@ export class ERC721BoundContractView extends BoundContractView<
471
1125
  {
472
1126
  blockTag: this.context.blockNumber,
473
1127
  ...overrides,
474
- }
1128
+ },
1129
+ this.context.preparedData,
1130
+ ethCallContext
475
1131
  );
476
1132
  },
477
1133
  async setApprovalForAll(
@@ -479,10 +1135,21 @@ export class ERC721BoundContractView extends BoundContractView<
479
1135
  _approved: boolean,
480
1136
  overrides?: Overrides
481
1137
  ): Promise<void> {
482
- return await this.view.callStatic.setApprovalForAll(operator, _approved, {
483
- blockTag: this.context.blockNumber,
484
- ...overrides,
485
- });
1138
+ const ethCallContext = {
1139
+ chainId: this.context.chainId,
1140
+ blockTag: this.context.blockNumber.toString(16),
1141
+ address: this.context.address,
1142
+ };
1143
+ return await this.view.callStatic.setApprovalForAll(
1144
+ operator,
1145
+ _approved,
1146
+ {
1147
+ blockTag: this.context.blockNumber,
1148
+ ...overrides,
1149
+ },
1150
+ this.context.preparedData,
1151
+ ethCallContext
1152
+ );
486
1153
  },
487
1154
  async transferFrom(
488
1155
  from: string,
@@ -490,9 +1157,245 @@ export class ERC721BoundContractView extends BoundContractView<
490
1157
  tokenId: BigNumberish,
491
1158
  overrides?: Overrides
492
1159
  ): Promise<void> {
493
- return await this.view.callStatic.transferFrom(from, to, tokenId, {
494
- blockTag: this.context.blockNumber,
495
- ...overrides,
1160
+ const ethCallContext = {
1161
+ chainId: this.context.chainId,
1162
+ blockTag: this.context.blockNumber.toString(16),
1163
+ address: this.context.address,
1164
+ };
1165
+ return await this.view.callStatic.transferFrom(
1166
+ from,
1167
+ to,
1168
+ tokenId,
1169
+ {
1170
+ blockTag: this.context.blockNumber,
1171
+ ...overrides,
1172
+ },
1173
+ this.context.preparedData,
1174
+ ethCallContext
1175
+ );
1176
+ },
1177
+ };
1178
+
1179
+ encodeCall = {
1180
+ view: this.view,
1181
+ context: this.context,
1182
+
1183
+ approve(
1184
+ to: string,
1185
+ tokenId: BigNumberish,
1186
+ overrides?: Overrides
1187
+ ): EthCallParam {
1188
+ const chainId =
1189
+ overrides?.chainId?.toString() ?? this.context.chainId.toString();
1190
+ const blockTag =
1191
+ overrides?.blockTag?.toString() ??
1192
+ this.context.blockNumber.toString(16);
1193
+ const address = this.context.address;
1194
+
1195
+ return this.view.encodeCall.approve(to, tokenId, {
1196
+ chainId,
1197
+ address,
1198
+ blockTag,
1199
+ });
1200
+ },
1201
+ totalSupply(overrides?: Overrides): EthCallParam {
1202
+ const chainId =
1203
+ overrides?.chainId?.toString() ?? this.context.chainId.toString();
1204
+ const blockTag =
1205
+ overrides?.blockTag?.toString() ??
1206
+ this.context.blockNumber.toString(16);
1207
+ const address = this.context.address;
1208
+
1209
+ return this.view.encodeCall.totalSupply({ chainId, address, blockTag });
1210
+ },
1211
+ balanceOf(owner: string, overrides?: Overrides): EthCallParam {
1212
+ const chainId =
1213
+ overrides?.chainId?.toString() ?? this.context.chainId.toString();
1214
+ const blockTag =
1215
+ overrides?.blockTag?.toString() ??
1216
+ this.context.blockNumber.toString(16);
1217
+ const address = this.context.address;
1218
+
1219
+ return this.view.encodeCall.balanceOf(owner, {
1220
+ chainId,
1221
+ address,
1222
+ blockTag,
1223
+ });
1224
+ },
1225
+ getApproved(tokenId: BigNumberish, overrides?: Overrides): EthCallParam {
1226
+ const chainId =
1227
+ overrides?.chainId?.toString() ?? this.context.chainId.toString();
1228
+ const blockTag =
1229
+ overrides?.blockTag?.toString() ??
1230
+ this.context.blockNumber.toString(16);
1231
+ const address = this.context.address;
1232
+
1233
+ return this.view.encodeCall.getApproved(tokenId, {
1234
+ chainId,
1235
+ address,
1236
+ blockTag,
1237
+ });
1238
+ },
1239
+ isApprovedForAll(
1240
+ owner: string,
1241
+ operator: string,
1242
+ overrides?: Overrides
1243
+ ): EthCallParam {
1244
+ const chainId =
1245
+ overrides?.chainId?.toString() ?? this.context.chainId.toString();
1246
+ const blockTag =
1247
+ overrides?.blockTag?.toString() ??
1248
+ this.context.blockNumber.toString(16);
1249
+ const address = this.context.address;
1250
+
1251
+ return this.view.encodeCall.isApprovedForAll(owner, operator, {
1252
+ chainId,
1253
+ address,
1254
+ blockTag,
1255
+ });
1256
+ },
1257
+ name(overrides?: Overrides): EthCallParam {
1258
+ const chainId =
1259
+ overrides?.chainId?.toString() ?? this.context.chainId.toString();
1260
+ const blockTag =
1261
+ overrides?.blockTag?.toString() ??
1262
+ this.context.blockNumber.toString(16);
1263
+ const address = this.context.address;
1264
+
1265
+ return this.view.encodeCall.name({ chainId, address, blockTag });
1266
+ },
1267
+ ownerOf(tokenId: BigNumberish, overrides?: Overrides): EthCallParam {
1268
+ const chainId =
1269
+ overrides?.chainId?.toString() ?? this.context.chainId.toString();
1270
+ const blockTag =
1271
+ overrides?.blockTag?.toString() ??
1272
+ this.context.blockNumber.toString(16);
1273
+ const address = this.context.address;
1274
+
1275
+ return this.view.encodeCall.ownerOf(tokenId, {
1276
+ chainId,
1277
+ address,
1278
+ blockTag,
1279
+ });
1280
+ },
1281
+ safeTransferFrom_address_address_uint256(
1282
+ from: string,
1283
+ to: string,
1284
+ tokenId: BigNumberish,
1285
+ overrides?: Overrides
1286
+ ): EthCallParam {
1287
+ const chainId =
1288
+ overrides?.chainId?.toString() ?? this.context.chainId.toString();
1289
+ const blockTag =
1290
+ overrides?.blockTag?.toString() ??
1291
+ this.context.blockNumber.toString(16);
1292
+ const address = this.context.address;
1293
+
1294
+ return this.view.encodeCall.safeTransferFrom_address_address_uint256(
1295
+ from,
1296
+ to,
1297
+ tokenId,
1298
+ { chainId, address, blockTag }
1299
+ );
1300
+ },
1301
+ safeTransferFrom_address_address_uint256_bytes(
1302
+ from: string,
1303
+ to: string,
1304
+ tokenId: BigNumberish,
1305
+ data: BytesLike,
1306
+ overrides?: Overrides
1307
+ ): EthCallParam {
1308
+ const chainId =
1309
+ overrides?.chainId?.toString() ?? this.context.chainId.toString();
1310
+ const blockTag =
1311
+ overrides?.blockTag?.toString() ??
1312
+ this.context.blockNumber.toString(16);
1313
+ const address = this.context.address;
1314
+
1315
+ return this.view.encodeCall.safeTransferFrom_address_address_uint256_bytes(
1316
+ from,
1317
+ to,
1318
+ tokenId,
1319
+ data,
1320
+ { chainId, address, blockTag }
1321
+ );
1322
+ },
1323
+ setApprovalForAll(
1324
+ operator: string,
1325
+ _approved: boolean,
1326
+ overrides?: Overrides
1327
+ ): EthCallParam {
1328
+ const chainId =
1329
+ overrides?.chainId?.toString() ?? this.context.chainId.toString();
1330
+ const blockTag =
1331
+ overrides?.blockTag?.toString() ??
1332
+ this.context.blockNumber.toString(16);
1333
+ const address = this.context.address;
1334
+
1335
+ return this.view.encodeCall.setApprovalForAll(operator, _approved, {
1336
+ chainId,
1337
+ address,
1338
+ blockTag,
1339
+ });
1340
+ },
1341
+ supportsInterface(
1342
+ interfaceId: BytesLike,
1343
+ overrides?: Overrides
1344
+ ): EthCallParam {
1345
+ const chainId =
1346
+ overrides?.chainId?.toString() ?? this.context.chainId.toString();
1347
+ const blockTag =
1348
+ overrides?.blockTag?.toString() ??
1349
+ this.context.blockNumber.toString(16);
1350
+ const address = this.context.address;
1351
+
1352
+ return this.view.encodeCall.supportsInterface(interfaceId, {
1353
+ chainId,
1354
+ address,
1355
+ blockTag,
1356
+ });
1357
+ },
1358
+ symbol(overrides?: Overrides): EthCallParam {
1359
+ const chainId =
1360
+ overrides?.chainId?.toString() ?? this.context.chainId.toString();
1361
+ const blockTag =
1362
+ overrides?.blockTag?.toString() ??
1363
+ this.context.blockNumber.toString(16);
1364
+ const address = this.context.address;
1365
+
1366
+ return this.view.encodeCall.symbol({ chainId, address, blockTag });
1367
+ },
1368
+ tokenURI(tokenId: BigNumberish, overrides?: Overrides): EthCallParam {
1369
+ const chainId =
1370
+ overrides?.chainId?.toString() ?? this.context.chainId.toString();
1371
+ const blockTag =
1372
+ overrides?.blockTag?.toString() ??
1373
+ this.context.blockNumber.toString(16);
1374
+ const address = this.context.address;
1375
+
1376
+ return this.view.encodeCall.tokenURI(tokenId, {
1377
+ chainId,
1378
+ address,
1379
+ blockTag,
1380
+ });
1381
+ },
1382
+ transferFrom(
1383
+ from: string,
1384
+ to: string,
1385
+ tokenId: BigNumberish,
1386
+ overrides?: Overrides
1387
+ ): EthCallParam {
1388
+ const chainId =
1389
+ overrides?.chainId?.toString() ?? this.context.chainId.toString();
1390
+ const blockTag =
1391
+ overrides?.blockTag?.toString() ??
1392
+ this.context.blockNumber.toString(16);
1393
+ const address = this.context.address;
1394
+
1395
+ return this.view.encodeCall.transferFrom(from, to, tokenId, {
1396
+ chainId,
1397
+ address,
1398
+ blockTag,
496
1399
  });
497
1400
  },
498
1401
  };