@sentio/sdk 2.45.3-rc.1 → 2.45.3-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.
Files changed (49) hide show
  1. package/lib/eth/builtin/internal/eacaggregatorproxy-processor.d.ts +23 -23
  2. package/lib/eth/builtin/internal/eacaggregatorproxy-processor.d.ts.map +1 -1
  3. package/lib/eth/builtin/internal/eacaggregatorproxy-processor.js +93 -659
  4. package/lib/eth/builtin/internal/eacaggregatorproxy-processor.js.map +1 -1
  5. package/lib/eth/builtin/internal/erc1155-processor.d.ts +8 -8
  6. package/lib/eth/builtin/internal/erc1155-processor.d.ts.map +1 -1
  7. package/lib/eth/builtin/internal/erc1155-processor.js +33 -264
  8. package/lib/eth/builtin/internal/erc1155-processor.js.map +1 -1
  9. package/lib/eth/builtin/internal/erc20-processor.d.ts +18 -18
  10. package/lib/eth/builtin/internal/erc20-processor.d.ts.map +1 -1
  11. package/lib/eth/builtin/internal/erc20-processor.js +75 -538
  12. package/lib/eth/builtin/internal/erc20-processor.js.map +1 -1
  13. package/lib/eth/builtin/internal/erc20bytes-processor.d.ts +9 -9
  14. package/lib/eth/builtin/internal/erc20bytes-processor.d.ts.map +1 -1
  15. package/lib/eth/builtin/internal/erc20bytes-processor.js +37 -268
  16. package/lib/eth/builtin/internal/erc20bytes-processor.js.map +1 -1
  17. package/lib/eth/builtin/internal/erc721-processor.d.ts +14 -14
  18. package/lib/eth/builtin/internal/erc721-processor.d.ts.map +1 -1
  19. package/lib/eth/builtin/internal/erc721-processor.js +57 -430
  20. package/lib/eth/builtin/internal/erc721-processor.js.map +1 -1
  21. package/lib/eth/builtin/internal/weth9-processor.d.ts +11 -11
  22. package/lib/eth/builtin/internal/weth9-processor.d.ts.map +1 -1
  23. package/lib/eth/builtin/internal/weth9-processor.js +45 -321
  24. package/lib/eth/builtin/internal/weth9-processor.js.map +1 -1
  25. package/lib/eth/codegen/file.d.ts.map +1 -1
  26. package/lib/eth/codegen/file.js +3 -6
  27. package/lib/eth/codegen/file.js.map +1 -1
  28. package/lib/eth/codegen/function-calls.d.ts.map +1 -1
  29. package/lib/eth/codegen/function-calls.js +5 -27
  30. package/lib/eth/codegen/function-calls.js.map +1 -1
  31. package/lib/eth/context.d.ts +4 -2
  32. package/lib/eth/context.d.ts.map +1 -1
  33. package/lib/eth/context.js +15 -0
  34. package/lib/eth/context.js.map +1 -1
  35. package/lib/eth/eth.d.ts +2 -0
  36. package/lib/eth/eth.d.ts.map +1 -1
  37. package/lib/eth/eth.js +15 -1
  38. package/lib/eth/eth.js.map +1 -1
  39. package/package.json +3 -3
  40. package/src/eth/builtin/internal/eacaggregatorproxy-processor.ts +189 -662
  41. package/src/eth/builtin/internal/erc1155-processor.ts +69 -261
  42. package/src/eth/builtin/internal/erc20-processor.ts +136 -535
  43. package/src/eth/builtin/internal/erc20bytes-processor.ts +68 -265
  44. package/src/eth/builtin/internal/erc721-processor.ts +118 -433
  45. package/src/eth/builtin/internal/weth9-processor.ts +81 -318
  46. package/src/eth/codegen/file.ts +2 -6
  47. package/src/eth/codegen/function-calls.ts +7 -29
  48. package/src/eth/context.ts +19 -2
  49. package/src/eth/eth.ts +21 -1
@@ -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, Interface } from "ethers";
4
+ import { BigNumberish, Overrides, BytesLike } from "ethers";
5
5
  import {
6
6
  addContractByABI,
7
7
  getContractByABI,
@@ -21,6 +21,7 @@ import {
21
21
  EthContext,
22
22
  EthFetchConfig,
23
23
  PreprocessResult,
24
+ encodeCallData,
24
25
  } from "@sentio/sdk/eth";
25
26
  import { EthCallParam, EthCallContext, PreparedData } from "@sentio/protos";
26
27
 
@@ -120,17 +121,6 @@ export type UriCallTrace = TypedCallTrace<[bigint], UriCallObject>;
120
121
 
121
122
  const templateContract = ERC1155__factory.connect("0x0", DummyProvider);
122
123
 
123
- const iface = new Interface([
124
- "function balanceOf(address account, uint256 id) view returns (uint256)",
125
- "function balanceOfBatch(address[] accounts, uint256[] ids) view returns (uint256[])",
126
- "function isApprovedForAll(address account, address operator) view returns (bool)",
127
- "function safeBatchTransferFrom(address from, address to, uint256[] ids, uint256[] amounts, bytes data) returns ()",
128
- "function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes data) returns ()",
129
- "function setApprovalForAll(address operator, bool approved) returns ()",
130
- "function supportsInterface(bytes4 interfaceId) view returns (bool)",
131
- "function uri(uint256 id) view returns (string)",
132
- ]);
133
-
134
124
  export class ERC1155ContractView extends ContractView<ERC1155> {
135
125
  constructor(contract: ERC1155) {
136
126
  super(contract);
@@ -291,63 +281,38 @@ export class ERC1155ContractView extends ContractView<ERC1155> {
291
281
  balanceOf(
292
282
  account: string,
293
283
  id: BigNumberish,
294
- ethCallContext: EthCallContext,
284
+ callContext: EthCallContext,
295
285
  ): EthCallParam {
296
- try {
297
- const iface = new Interface(["function balanceOf(address,uint256)"]);
298
- const calldata = iface.encodeFunctionData("balanceOf", [account, id]);
299
- return {
300
- context: ethCallContext,
301
- calldata,
302
- };
303
- } catch (e) {
304
- const stack = new Error().stack;
305
- throw transformEtherError(e, undefined, stack);
306
- }
286
+ return encodeCallData(
287
+ callContext,
288
+ "balanceOf",
289
+ "function balanceOf(address,uint256)",
290
+ [account, id],
291
+ );
307
292
  },
308
293
  balanceOfBatch(
309
294
  accounts: string[],
310
295
  ids: BigNumberish[],
311
- ethCallContext: EthCallContext,
296
+ callContext: EthCallContext,
312
297
  ): EthCallParam {
313
- try {
314
- const iface = new Interface([
315
- "function balanceOfBatch(address[],uint256[])",
316
- ]);
317
- const calldata = iface.encodeFunctionData("balanceOfBatch", [
318
- accounts,
319
- ids,
320
- ]);
321
- return {
322
- context: ethCallContext,
323
- calldata,
324
- };
325
- } catch (e) {
326
- const stack = new Error().stack;
327
- throw transformEtherError(e, undefined, stack);
328
- }
298
+ return encodeCallData(
299
+ callContext,
300
+ "balanceOfBatch",
301
+ "function balanceOfBatch(address[],uint256[])",
302
+ [accounts, ids],
303
+ );
329
304
  },
330
305
  isApprovedForAll(
331
306
  account: string,
332
307
  operator: string,
333
- ethCallContext: EthCallContext,
308
+ callContext: EthCallContext,
334
309
  ): EthCallParam {
335
- try {
336
- const iface = new Interface([
337
- "function isApprovedForAll(address,address)",
338
- ]);
339
- const calldata = iface.encodeFunctionData("isApprovedForAll", [
340
- account,
341
- operator,
342
- ]);
343
- return {
344
- context: ethCallContext,
345
- calldata,
346
- };
347
- } catch (e) {
348
- const stack = new Error().stack;
349
- throw transformEtherError(e, undefined, stack);
350
- }
310
+ return encodeCallData(
311
+ callContext,
312
+ "isApprovedForAll",
313
+ "function isApprovedForAll(address,address)",
314
+ [account, operator],
315
+ );
351
316
  },
352
317
  safeBatchTransferFrom(
353
318
  from: string,
@@ -355,27 +320,14 @@ export class ERC1155ContractView extends ContractView<ERC1155> {
355
320
  ids: BigNumberish[],
356
321
  amounts: BigNumberish[],
357
322
  data: BytesLike,
358
- ethCallContext: EthCallContext,
323
+ callContext: EthCallContext,
359
324
  ): EthCallParam {
360
- try {
361
- const iface = new Interface([
362
- "function safeBatchTransferFrom(address,address,uint256[],uint256[],bytes)",
363
- ]);
364
- const calldata = iface.encodeFunctionData("safeBatchTransferFrom", [
365
- from,
366
- to,
367
- ids,
368
- amounts,
369
- data,
370
- ]);
371
- return {
372
- context: ethCallContext,
373
- calldata,
374
- };
375
- } catch (e) {
376
- const stack = new Error().stack;
377
- throw transformEtherError(e, undefined, stack);
378
- }
325
+ return encodeCallData(
326
+ callContext,
327
+ "safeBatchTransferFrom",
328
+ "function safeBatchTransferFrom(address,address,uint256[],uint256[],bytes)",
329
+ [from, to, ids, amounts, data],
330
+ );
379
331
  },
380
332
  safeTransferFrom(
381
333
  from: string,
@@ -383,80 +335,40 @@ export class ERC1155ContractView extends ContractView<ERC1155> {
383
335
  id: BigNumberish,
384
336
  amount: BigNumberish,
385
337
  data: BytesLike,
386
- ethCallContext: EthCallContext,
338
+ callContext: EthCallContext,
387
339
  ): EthCallParam {
388
- try {
389
- const iface = new Interface([
390
- "function safeTransferFrom(address,address,uint256,uint256,bytes)",
391
- ]);
392
- const calldata = iface.encodeFunctionData("safeTransferFrom", [
393
- from,
394
- to,
395
- id,
396
- amount,
397
- data,
398
- ]);
399
- return {
400
- context: ethCallContext,
401
- calldata,
402
- };
403
- } catch (e) {
404
- const stack = new Error().stack;
405
- throw transformEtherError(e, undefined, stack);
406
- }
340
+ return encodeCallData(
341
+ callContext,
342
+ "safeTransferFrom",
343
+ "function safeTransferFrom(address,address,uint256,uint256,bytes)",
344
+ [from, to, id, amount, data],
345
+ );
407
346
  },
408
347
  setApprovalForAll(
409
348
  operator: string,
410
349
  approved: boolean,
411
- ethCallContext: EthCallContext,
350
+ callContext: EthCallContext,
412
351
  ): EthCallParam {
413
- try {
414
- const iface = new Interface([
415
- "function setApprovalForAll(address,bool)",
416
- ]);
417
- const calldata = iface.encodeFunctionData("setApprovalForAll", [
418
- operator,
419
- approved,
420
- ]);
421
- return {
422
- context: ethCallContext,
423
- calldata,
424
- };
425
- } catch (e) {
426
- const stack = new Error().stack;
427
- throw transformEtherError(e, undefined, stack);
428
- }
352
+ return encodeCallData(
353
+ callContext,
354
+ "setApprovalForAll",
355
+ "function setApprovalForAll(address,bool)",
356
+ [operator, approved],
357
+ );
429
358
  },
430
359
  supportsInterface(
431
360
  interfaceId: BytesLike,
432
- ethCallContext: EthCallContext,
361
+ callContext: EthCallContext,
433
362
  ): EthCallParam {
434
- try {
435
- const iface = new Interface(["function supportsInterface(bytes4)"]);
436
- const calldata = iface.encodeFunctionData("supportsInterface", [
437
- interfaceId,
438
- ]);
439
- return {
440
- context: ethCallContext,
441
- calldata,
442
- };
443
- } catch (e) {
444
- const stack = new Error().stack;
445
- throw transformEtherError(e, undefined, stack);
446
- }
363
+ return encodeCallData(
364
+ callContext,
365
+ "supportsInterface",
366
+ "function supportsInterface(bytes4)",
367
+ [interfaceId],
368
+ );
447
369
  },
448
- uri(id: BigNumberish, ethCallContext: EthCallContext): EthCallParam {
449
- try {
450
- const iface = new Interface(["function uri(uint256)"]);
451
- const calldata = iface.encodeFunctionData("uri", [id]);
452
- return {
453
- context: ethCallContext,
454
- calldata,
455
- };
456
- } catch (e) {
457
- const stack = new Error().stack;
458
- throw transformEtherError(e, undefined, stack);
459
- }
370
+ uri(id: BigNumberish, callContext: EthCallContext): EthCallParam {
371
+ return encodeCallData(callContext, "uri", "function uri(uint256)", [id]);
460
372
  },
461
373
  };
462
374
  }
@@ -470,11 +382,6 @@ export class ERC1155BoundContractView extends BoundContractView<
470
382
  id: BigNumberish,
471
383
  overrides?: Overrides,
472
384
  ): Promise<bigint> {
473
- const ethCallContext = {
474
- chainId: this.context.chainId,
475
- blockTag: "0x" + this.context.blockNumber.toString(16),
476
- address: this.context.address,
477
- };
478
385
  return await this.view.balanceOf(
479
386
  account,
480
387
  id,
@@ -483,7 +390,7 @@ export class ERC1155BoundContractView extends BoundContractView<
483
390
  ...overrides,
484
391
  },
485
392
  this.context.preparedData,
486
- ethCallContext,
393
+ this.context.getEthCallContext(),
487
394
  );
488
395
  }
489
396
 
@@ -492,11 +399,6 @@ export class ERC1155BoundContractView extends BoundContractView<
492
399
  ids: BigNumberish[],
493
400
  overrides?: Overrides,
494
401
  ): Promise<bigint[]> {
495
- const ethCallContext = {
496
- chainId: this.context.chainId,
497
- blockTag: "0x" + this.context.blockNumber.toString(16),
498
- address: this.context.address,
499
- };
500
402
  return await this.view.balanceOfBatch(
501
403
  accounts,
502
404
  ids,
@@ -505,7 +407,7 @@ export class ERC1155BoundContractView extends BoundContractView<
505
407
  ...overrides,
506
408
  },
507
409
  this.context.preparedData,
508
- ethCallContext,
410
+ this.context.getEthCallContext(),
509
411
  );
510
412
  }
511
413
 
@@ -514,11 +416,6 @@ export class ERC1155BoundContractView extends BoundContractView<
514
416
  operator: string,
515
417
  overrides?: Overrides,
516
418
  ): Promise<boolean> {
517
- const ethCallContext = {
518
- chainId: this.context.chainId,
519
- blockTag: "0x" + this.context.blockNumber.toString(16),
520
- address: this.context.address,
521
- };
522
419
  return await this.view.isApprovedForAll(
523
420
  account,
524
421
  operator,
@@ -527,7 +424,7 @@ export class ERC1155BoundContractView extends BoundContractView<
527
424
  ...overrides,
528
425
  },
529
426
  this.context.preparedData,
530
- ethCallContext,
427
+ this.context.getEthCallContext(),
531
428
  );
532
429
  }
533
430
 
@@ -535,11 +432,6 @@ export class ERC1155BoundContractView extends BoundContractView<
535
432
  interfaceId: BytesLike,
536
433
  overrides?: Overrides,
537
434
  ): Promise<boolean> {
538
- const ethCallContext = {
539
- chainId: this.context.chainId,
540
- blockTag: "0x" + this.context.blockNumber.toString(16),
541
- address: this.context.address,
542
- };
543
435
  return await this.view.supportsInterface(
544
436
  interfaceId,
545
437
  {
@@ -547,16 +439,11 @@ export class ERC1155BoundContractView extends BoundContractView<
547
439
  ...overrides,
548
440
  },
549
441
  this.context.preparedData,
550
- ethCallContext,
442
+ this.context.getEthCallContext(),
551
443
  );
552
444
  }
553
445
 
554
446
  async uri(id: BigNumberish, overrides?: Overrides): Promise<string> {
555
- const ethCallContext = {
556
- chainId: this.context.chainId,
557
- blockTag: "0x" + this.context.blockNumber.toString(16),
558
- address: this.context.address,
559
- };
560
447
  return await this.view.uri(
561
448
  id,
562
449
  {
@@ -564,7 +451,7 @@ export class ERC1155BoundContractView extends BoundContractView<
564
451
  ...overrides,
565
452
  },
566
453
  this.context.preparedData,
567
- ethCallContext,
454
+ this.context.getEthCallContext(),
568
455
  );
569
456
  }
570
457
 
@@ -580,11 +467,6 @@ export class ERC1155BoundContractView extends BoundContractView<
580
467
  data: BytesLike,
581
468
  overrides?: Overrides,
582
469
  ): Promise<void> {
583
- const ethCallContext = {
584
- chainId: this.context.chainId,
585
- blockTag: "0x" + this.context.blockNumber.toString(16),
586
- address: this.context.address,
587
- };
588
470
  return await this.view.callStatic.safeBatchTransferFrom(
589
471
  from,
590
472
  to,
@@ -596,7 +478,7 @@ export class ERC1155BoundContractView extends BoundContractView<
596
478
  ...overrides,
597
479
  },
598
480
  this.context.preparedData,
599
- ethCallContext,
481
+ this.context.getEthCallContext(),
600
482
  );
601
483
  },
602
484
  async safeTransferFrom(
@@ -607,11 +489,6 @@ export class ERC1155BoundContractView extends BoundContractView<
607
489
  data: BytesLike,
608
490
  overrides?: Overrides,
609
491
  ): Promise<void> {
610
- const ethCallContext = {
611
- chainId: this.context.chainId,
612
- blockTag: "0x" + this.context.blockNumber.toString(16),
613
- address: this.context.address,
614
- };
615
492
  return await this.view.callStatic.safeTransferFrom(
616
493
  from,
617
494
  to,
@@ -623,7 +500,7 @@ export class ERC1155BoundContractView extends BoundContractView<
623
500
  ...overrides,
624
501
  },
625
502
  this.context.preparedData,
626
- ethCallContext,
503
+ this.context.getEthCallContext(),
627
504
  );
628
505
  },
629
506
  async setApprovalForAll(
@@ -631,11 +508,6 @@ export class ERC1155BoundContractView extends BoundContractView<
631
508
  approved: boolean,
632
509
  overrides?: Overrides,
633
510
  ): Promise<void> {
634
- const ethCallContext = {
635
- chainId: this.context.chainId,
636
- blockTag: "0x" + this.context.blockNumber.toString(16),
637
- address: this.context.address,
638
- };
639
511
  return await this.view.callStatic.setApprovalForAll(
640
512
  operator,
641
513
  approved,
@@ -644,7 +516,7 @@ export class ERC1155BoundContractView extends BoundContractView<
644
516
  ...overrides,
645
517
  },
646
518
  this.context.preparedData,
647
- ethCallContext,
519
+ this.context.getEthCallContext(),
648
520
  );
649
521
  },
650
522
  };
@@ -658,18 +530,10 @@ export class ERC1155BoundContractView extends BoundContractView<
658
530
  id: BigNumberish,
659
531
  overrides?: Overrides,
660
532
  ): EthCallParam {
661
- let blockTagWithOverride = "0x" + this.context.blockNumber.toString(16);
662
- if (overrides?.blockTag) {
663
- blockTagWithOverride =
664
- typeof overrides.blockTag == "string"
665
- ? overrides.blockTag
666
- : "0x" + overrides.blockTag.toString(16);
667
- }
668
-
669
533
  return this.view.encodeCall.balanceOf(account, id, {
670
534
  chainId: this.context.chainId.toString(),
671
535
  address: this.context.address,
672
- blockTag: blockTagWithOverride,
536
+ blockTag: this.context.getBlockTag(overrides),
673
537
  });
674
538
  },
675
539
  balanceOfBatch(
@@ -677,18 +541,10 @@ export class ERC1155BoundContractView extends BoundContractView<
677
541
  ids: BigNumberish[],
678
542
  overrides?: Overrides,
679
543
  ): EthCallParam {
680
- let blockTagWithOverride = "0x" + this.context.blockNumber.toString(16);
681
- if (overrides?.blockTag) {
682
- blockTagWithOverride =
683
- typeof overrides.blockTag == "string"
684
- ? overrides.blockTag
685
- : "0x" + overrides.blockTag.toString(16);
686
- }
687
-
688
544
  return this.view.encodeCall.balanceOfBatch(accounts, ids, {
689
545
  chainId: this.context.chainId.toString(),
690
546
  address: this.context.address,
691
- blockTag: blockTagWithOverride,
547
+ blockTag: this.context.getBlockTag(overrides),
692
548
  });
693
549
  },
694
550
  isApprovedForAll(
@@ -696,18 +552,10 @@ export class ERC1155BoundContractView extends BoundContractView<
696
552
  operator: string,
697
553
  overrides?: Overrides,
698
554
  ): EthCallParam {
699
- let blockTagWithOverride = "0x" + this.context.blockNumber.toString(16);
700
- if (overrides?.blockTag) {
701
- blockTagWithOverride =
702
- typeof overrides.blockTag == "string"
703
- ? overrides.blockTag
704
- : "0x" + overrides.blockTag.toString(16);
705
- }
706
-
707
555
  return this.view.encodeCall.isApprovedForAll(account, operator, {
708
556
  chainId: this.context.chainId.toString(),
709
557
  address: this.context.address,
710
- blockTag: blockTagWithOverride,
558
+ blockTag: this.context.getBlockTag(overrides),
711
559
  });
712
560
  },
713
561
  safeBatchTransferFrom(
@@ -718,14 +566,6 @@ export class ERC1155BoundContractView extends BoundContractView<
718
566
  data: BytesLike,
719
567
  overrides?: Overrides,
720
568
  ): EthCallParam {
721
- let blockTagWithOverride = "0x" + this.context.blockNumber.toString(16);
722
- if (overrides?.blockTag) {
723
- blockTagWithOverride =
724
- typeof overrides.blockTag == "string"
725
- ? overrides.blockTag
726
- : "0x" + overrides.blockTag.toString(16);
727
- }
728
-
729
569
  return this.view.encodeCall.safeBatchTransferFrom(
730
570
  from,
731
571
  to,
@@ -735,7 +575,7 @@ export class ERC1155BoundContractView extends BoundContractView<
735
575
  {
736
576
  chainId: this.context.chainId.toString(),
737
577
  address: this.context.address,
738
- blockTag: blockTagWithOverride,
578
+ blockTag: this.context.getBlockTag(overrides),
739
579
  },
740
580
  );
741
581
  },
@@ -747,18 +587,10 @@ export class ERC1155BoundContractView extends BoundContractView<
747
587
  data: BytesLike,
748
588
  overrides?: Overrides,
749
589
  ): EthCallParam {
750
- let blockTagWithOverride = "0x" + this.context.blockNumber.toString(16);
751
- if (overrides?.blockTag) {
752
- blockTagWithOverride =
753
- typeof overrides.blockTag == "string"
754
- ? overrides.blockTag
755
- : "0x" + overrides.blockTag.toString(16);
756
- }
757
-
758
590
  return this.view.encodeCall.safeTransferFrom(from, to, id, amount, data, {
759
591
  chainId: this.context.chainId.toString(),
760
592
  address: this.context.address,
761
- blockTag: blockTagWithOverride,
593
+ blockTag: this.context.getBlockTag(overrides),
762
594
  });
763
595
  },
764
596
  setApprovalForAll(
@@ -766,51 +598,27 @@ export class ERC1155BoundContractView extends BoundContractView<
766
598
  approved: boolean,
767
599
  overrides?: Overrides,
768
600
  ): EthCallParam {
769
- let blockTagWithOverride = "0x" + this.context.blockNumber.toString(16);
770
- if (overrides?.blockTag) {
771
- blockTagWithOverride =
772
- typeof overrides.blockTag == "string"
773
- ? overrides.blockTag
774
- : "0x" + overrides.blockTag.toString(16);
775
- }
776
-
777
601
  return this.view.encodeCall.setApprovalForAll(operator, approved, {
778
602
  chainId: this.context.chainId.toString(),
779
603
  address: this.context.address,
780
- blockTag: blockTagWithOverride,
604
+ blockTag: this.context.getBlockTag(overrides),
781
605
  });
782
606
  },
783
607
  supportsInterface(
784
608
  interfaceId: BytesLike,
785
609
  overrides?: Overrides,
786
610
  ): EthCallParam {
787
- let blockTagWithOverride = "0x" + this.context.blockNumber.toString(16);
788
- if (overrides?.blockTag) {
789
- blockTagWithOverride =
790
- typeof overrides.blockTag == "string"
791
- ? overrides.blockTag
792
- : "0x" + overrides.blockTag.toString(16);
793
- }
794
-
795
611
  return this.view.encodeCall.supportsInterface(interfaceId, {
796
612
  chainId: this.context.chainId.toString(),
797
613
  address: this.context.address,
798
- blockTag: blockTagWithOverride,
614
+ blockTag: this.context.getBlockTag(overrides),
799
615
  });
800
616
  },
801
617
  uri(id: BigNumberish, overrides?: Overrides): EthCallParam {
802
- let blockTagWithOverride = "0x" + this.context.blockNumber.toString(16);
803
- if (overrides?.blockTag) {
804
- blockTagWithOverride =
805
- typeof overrides.blockTag == "string"
806
- ? overrides.blockTag
807
- : "0x" + overrides.blockTag.toString(16);
808
- }
809
-
810
618
  return this.view.encodeCall.uri(id, {
811
619
  chainId: this.context.chainId.toString(),
812
620
  address: this.context.address,
813
- blockTag: blockTagWithOverride,
621
+ blockTag: this.context.getBlockTag(overrides),
814
622
  });
815
623
  },
816
624
  };