@sentio/sdk 2.45.2 → 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 (89) hide show
  1. package/lib/aptos/builtin/0x1.d.ts +2 -2
  2. package/lib/aptos/builtin/0x1.d.ts.map +1 -1
  3. package/lib/aptos/builtin/0x1.js +1 -2
  4. package/lib/aptos/builtin/0x1.js.map +1 -1
  5. package/lib/aptos/builtin/0x3.d.ts +2 -2
  6. package/lib/aptos/builtin/0x3.d.ts.map +1 -1
  7. package/lib/aptos/builtin/0x3.js +1 -2
  8. package/lib/aptos/builtin/0x3.js.map +1 -1
  9. package/lib/aptos/builtin/0x4.d.ts +2 -2
  10. package/lib/aptos/builtin/0x4.d.ts.map +1 -1
  11. package/lib/aptos/builtin/0x4.js +1 -2
  12. package/lib/aptos/builtin/0x4.js.map +1 -1
  13. package/lib/aptos/codegen/codegen.js +7 -1
  14. package/lib/aptos/codegen/codegen.js.map +1 -1
  15. package/lib/eth/builtin/internal/eacaggregatorproxy-processor.d.ts +23 -23
  16. package/lib/eth/builtin/internal/eacaggregatorproxy-processor.d.ts.map +1 -1
  17. package/lib/eth/builtin/internal/eacaggregatorproxy-processor.js +93 -659
  18. package/lib/eth/builtin/internal/eacaggregatorproxy-processor.js.map +1 -1
  19. package/lib/eth/builtin/internal/erc1155-processor.d.ts +8 -8
  20. package/lib/eth/builtin/internal/erc1155-processor.d.ts.map +1 -1
  21. package/lib/eth/builtin/internal/erc1155-processor.js +33 -264
  22. package/lib/eth/builtin/internal/erc1155-processor.js.map +1 -1
  23. package/lib/eth/builtin/internal/erc20-processor.d.ts +18 -18
  24. package/lib/eth/builtin/internal/erc20-processor.d.ts.map +1 -1
  25. package/lib/eth/builtin/internal/erc20-processor.js +75 -538
  26. package/lib/eth/builtin/internal/erc20-processor.js.map +1 -1
  27. package/lib/eth/builtin/internal/erc20bytes-processor.d.ts +9 -9
  28. package/lib/eth/builtin/internal/erc20bytes-processor.d.ts.map +1 -1
  29. package/lib/eth/builtin/internal/erc20bytes-processor.js +37 -268
  30. package/lib/eth/builtin/internal/erc20bytes-processor.js.map +1 -1
  31. package/lib/eth/builtin/internal/erc721-processor.d.ts +14 -14
  32. package/lib/eth/builtin/internal/erc721-processor.d.ts.map +1 -1
  33. package/lib/eth/builtin/internal/erc721-processor.js +57 -430
  34. package/lib/eth/builtin/internal/erc721-processor.js.map +1 -1
  35. package/lib/eth/builtin/internal/weth9-processor.d.ts +11 -11
  36. package/lib/eth/builtin/internal/weth9-processor.d.ts.map +1 -1
  37. package/lib/eth/builtin/internal/weth9-processor.js +45 -321
  38. package/lib/eth/builtin/internal/weth9-processor.js.map +1 -1
  39. package/lib/eth/codegen/file.d.ts.map +1 -1
  40. package/lib/eth/codegen/file.js +3 -6
  41. package/lib/eth/codegen/file.js.map +1 -1
  42. package/lib/eth/codegen/function-calls.d.ts.map +1 -1
  43. package/lib/eth/codegen/function-calls.js +5 -27
  44. package/lib/eth/codegen/function-calls.js.map +1 -1
  45. package/lib/eth/context.d.ts +4 -2
  46. package/lib/eth/context.d.ts.map +1 -1
  47. package/lib/eth/context.js +15 -0
  48. package/lib/eth/context.js.map +1 -1
  49. package/lib/eth/eth.d.ts +2 -0
  50. package/lib/eth/eth.d.ts.map +1 -1
  51. package/lib/eth/eth.js +15 -1
  52. package/lib/eth/eth.js.map +1 -1
  53. package/lib/move/shared-network-codegen.d.ts.map +1 -1
  54. package/lib/move/shared-network-codegen.js +2 -3
  55. package/lib/move/shared-network-codegen.js.map +1 -1
  56. package/lib/sui/builtin/0x1.d.ts +751 -12
  57. package/lib/sui/builtin/0x1.d.ts.map +1 -1
  58. package/lib/sui/builtin/0x1.js +3857 -0
  59. package/lib/sui/builtin/0x1.js.map +1 -1
  60. package/lib/sui/builtin/0x2.d.ts +3876 -14
  61. package/lib/sui/builtin/0x2.d.ts.map +1 -1
  62. package/lib/sui/builtin/0x2.js +14389 -188
  63. package/lib/sui/builtin/0x2.js.map +1 -1
  64. package/lib/sui/builtin/0x3.d.ts +1923 -0
  65. package/lib/sui/builtin/0x3.d.ts.map +1 -1
  66. package/lib/sui/builtin/0x3.js +5425 -0
  67. package/lib/sui/builtin/0x3.js.map +1 -1
  68. package/lib/sui/codegen/codegen.js +5 -1
  69. package/lib/sui/codegen/codegen.js.map +1 -1
  70. package/package.json +6 -6
  71. package/src/aptos/builtin/0x1.ts +5 -5
  72. package/src/aptos/builtin/0x3.ts +5 -5
  73. package/src/aptos/builtin/0x4.ts +5 -5
  74. package/src/aptos/codegen/codegen.ts +7 -1
  75. package/src/eth/builtin/internal/eacaggregatorproxy-processor.ts +189 -662
  76. package/src/eth/builtin/internal/erc1155-processor.ts +69 -261
  77. package/src/eth/builtin/internal/erc20-processor.ts +136 -535
  78. package/src/eth/builtin/internal/erc20bytes-processor.ts +68 -265
  79. package/src/eth/builtin/internal/erc721-processor.ts +118 -433
  80. package/src/eth/builtin/internal/weth9-processor.ts +81 -318
  81. package/src/eth/codegen/file.ts +2 -6
  82. package/src/eth/codegen/function-calls.ts +7 -29
  83. package/src/eth/context.ts +19 -2
  84. package/src/eth/eth.ts +21 -1
  85. package/src/move/shared-network-codegen.ts +1 -4
  86. package/src/sui/builtin/0x1.ts +5590 -19
  87. package/src/sui/builtin/0x2.ts +21779 -92
  88. package/src/sui/builtin/0x3.ts +8825 -15
  89. package/src/sui/codegen/codegen.ts +6 -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, Interface } from "ethers";
4
+ import { BigNumberish, Overrides } 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
 
@@ -166,27 +167,6 @@ export type TransferOwnershipCallTrace = TypedCallTrace<
166
167
 
167
168
  const templateContract = ERC20__factory.connect("0x0", DummyProvider);
168
169
 
169
- const iface = new Interface([
170
- "function allowance(address owner, address spender) view returns (uint256)",
171
- "function approve(address spender, uint256 amount) returns (bool)",
172
- "function balanceOf(address account) view returns (uint256)",
173
- "function burn(uint256 amount) returns ()",
174
- "function burnFrom(address account, uint256 amount) returns ()",
175
- "function decimals() view returns (uint8)",
176
- "function decreaseAllowance(address spender, uint256 subtractedValue) returns (bool)",
177
- "function increaseAllowance(address spender, uint256 addedValue) returns (bool)",
178
- "function locker() view returns (address)",
179
- "function name() view returns (string)",
180
- "function owner() view returns (address)",
181
- "function renounceOwnership() returns ()",
182
- "function setLocker(address _locker) returns ()",
183
- "function symbol() view returns (string)",
184
- "function totalSupply() view returns (uint256)",
185
- "function transfer(address recipient, uint256 amount) returns (bool)",
186
- "function transferFrom(address sender, address recipient, uint256 amount) returns (bool)",
187
- "function transferOwnership(address newOwner) returns ()",
188
- ]);
189
-
190
170
  export class ERC20ContractView extends ContractView<ERC20> {
191
171
  constructor(contract: ERC20) {
192
172
  super(contract);
@@ -472,295 +452,150 @@ export class ERC20ContractView extends ContractView<ERC20> {
472
452
  allowance(
473
453
  owner: string,
474
454
  spender: string,
475
- ethCallContext: EthCallContext,
455
+ callContext: EthCallContext,
476
456
  ): EthCallParam {
477
- try {
478
- const iface = new Interface(["function allowance(address,address)"]);
479
- const calldata = iface.encodeFunctionData("allowance", [
480
- owner,
481
- spender,
482
- ]);
483
- return {
484
- context: ethCallContext,
485
- calldata,
486
- };
487
- } catch (e) {
488
- const stack = new Error().stack;
489
- throw transformEtherError(e, undefined, stack);
490
- }
457
+ return encodeCallData(
458
+ callContext,
459
+ "allowance",
460
+ "function allowance(address,address)",
461
+ [owner, spender],
462
+ );
491
463
  },
492
464
  approve(
493
465
  spender: string,
494
466
  amount: BigNumberish,
495
- ethCallContext: EthCallContext,
467
+ callContext: EthCallContext,
496
468
  ): EthCallParam {
497
- try {
498
- const iface = new Interface(["function approve(address,uint256)"]);
499
- const calldata = iface.encodeFunctionData("approve", [spender, amount]);
500
- return {
501
- context: ethCallContext,
502
- calldata,
503
- };
504
- } catch (e) {
505
- const stack = new Error().stack;
506
- throw transformEtherError(e, undefined, stack);
507
- }
469
+ return encodeCallData(
470
+ callContext,
471
+ "approve",
472
+ "function approve(address,uint256)",
473
+ [spender, amount],
474
+ );
508
475
  },
509
- balanceOf(account: string, ethCallContext: EthCallContext): EthCallParam {
510
- try {
511
- const iface = new Interface(["function balanceOf(address)"]);
512
- const calldata = iface.encodeFunctionData("balanceOf", [account]);
513
- return {
514
- context: ethCallContext,
515
- calldata,
516
- };
517
- } catch (e) {
518
- const stack = new Error().stack;
519
- throw transformEtherError(e, undefined, stack);
520
- }
476
+ balanceOf(account: string, callContext: EthCallContext): EthCallParam {
477
+ return encodeCallData(
478
+ callContext,
479
+ "balanceOf",
480
+ "function balanceOf(address)",
481
+ [account],
482
+ );
521
483
  },
522
- burn(amount: BigNumberish, ethCallContext: EthCallContext): EthCallParam {
523
- try {
524
- const iface = new Interface(["function burn(uint256)"]);
525
- const calldata = iface.encodeFunctionData("burn", [amount]);
526
- return {
527
- context: ethCallContext,
528
- calldata,
529
- };
530
- } catch (e) {
531
- const stack = new Error().stack;
532
- throw transformEtherError(e, undefined, stack);
533
- }
484
+ burn(amount: BigNumberish, callContext: EthCallContext): EthCallParam {
485
+ return encodeCallData(callContext, "burn", "function burn(uint256)", [
486
+ amount,
487
+ ]);
534
488
  },
535
489
  burnFrom(
536
490
  account: string,
537
491
  amount: BigNumberish,
538
- ethCallContext: EthCallContext,
492
+ callContext: EthCallContext,
539
493
  ): EthCallParam {
540
- try {
541
- const iface = new Interface(["function burnFrom(address,uint256)"]);
542
- const calldata = iface.encodeFunctionData("burnFrom", [
543
- account,
544
- amount,
545
- ]);
546
- return {
547
- context: ethCallContext,
548
- calldata,
549
- };
550
- } catch (e) {
551
- const stack = new Error().stack;
552
- throw transformEtherError(e, undefined, stack);
553
- }
494
+ return encodeCallData(
495
+ callContext,
496
+ "burnFrom",
497
+ "function burnFrom(address,uint256)",
498
+ [account, amount],
499
+ );
554
500
  },
555
- decimals(ethCallContext: EthCallContext): EthCallParam {
556
- try {
557
- const iface = new Interface(["function decimals()"]);
558
- const calldata = iface.encodeFunctionData("decimals", []);
559
- return {
560
- context: ethCallContext,
561
- calldata,
562
- };
563
- } catch (e) {
564
- const stack = new Error().stack;
565
- throw transformEtherError(e, undefined, stack);
566
- }
501
+ decimals(callContext: EthCallContext): EthCallParam {
502
+ return encodeCallData(callContext, "decimals", "function decimals()", []);
567
503
  },
568
504
  decreaseAllowance(
569
505
  spender: string,
570
506
  subtractedValue: BigNumberish,
571
- ethCallContext: EthCallContext,
507
+ callContext: EthCallContext,
572
508
  ): EthCallParam {
573
- try {
574
- const iface = new Interface([
575
- "function decreaseAllowance(address,uint256)",
576
- ]);
577
- const calldata = iface.encodeFunctionData("decreaseAllowance", [
578
- spender,
579
- subtractedValue,
580
- ]);
581
- return {
582
- context: ethCallContext,
583
- calldata,
584
- };
585
- } catch (e) {
586
- const stack = new Error().stack;
587
- throw transformEtherError(e, undefined, stack);
588
- }
509
+ return encodeCallData(
510
+ callContext,
511
+ "decreaseAllowance",
512
+ "function decreaseAllowance(address,uint256)",
513
+ [spender, subtractedValue],
514
+ );
589
515
  },
590
516
  increaseAllowance(
591
517
  spender: string,
592
518
  addedValue: BigNumberish,
593
- ethCallContext: EthCallContext,
519
+ callContext: EthCallContext,
594
520
  ): EthCallParam {
595
- try {
596
- const iface = new Interface([
597
- "function increaseAllowance(address,uint256)",
598
- ]);
599
- const calldata = iface.encodeFunctionData("increaseAllowance", [
600
- spender,
601
- addedValue,
602
- ]);
603
- return {
604
- context: ethCallContext,
605
- calldata,
606
- };
607
- } catch (e) {
608
- const stack = new Error().stack;
609
- throw transformEtherError(e, undefined, stack);
610
- }
521
+ return encodeCallData(
522
+ callContext,
523
+ "increaseAllowance",
524
+ "function increaseAllowance(address,uint256)",
525
+ [spender, addedValue],
526
+ );
611
527
  },
612
- locker(ethCallContext: EthCallContext): EthCallParam {
613
- try {
614
- const iface = new Interface(["function locker()"]);
615
- const calldata = iface.encodeFunctionData("locker", []);
616
- return {
617
- context: ethCallContext,
618
- calldata,
619
- };
620
- } catch (e) {
621
- const stack = new Error().stack;
622
- throw transformEtherError(e, undefined, stack);
623
- }
528
+ locker(callContext: EthCallContext): EthCallParam {
529
+ return encodeCallData(callContext, "locker", "function locker()", []);
624
530
  },
625
- name(ethCallContext: EthCallContext): EthCallParam {
626
- try {
627
- const iface = new Interface(["function name()"]);
628
- const calldata = iface.encodeFunctionData("name", []);
629
- return {
630
- context: ethCallContext,
631
- calldata,
632
- };
633
- } catch (e) {
634
- const stack = new Error().stack;
635
- throw transformEtherError(e, undefined, stack);
636
- }
531
+ name(callContext: EthCallContext): EthCallParam {
532
+ return encodeCallData(callContext, "name", "function name()", []);
637
533
  },
638
- owner(ethCallContext: EthCallContext): EthCallParam {
639
- try {
640
- const iface = new Interface(["function owner()"]);
641
- const calldata = iface.encodeFunctionData("owner", []);
642
- return {
643
- context: ethCallContext,
644
- calldata,
645
- };
646
- } catch (e) {
647
- const stack = new Error().stack;
648
- throw transformEtherError(e, undefined, stack);
649
- }
534
+ owner(callContext: EthCallContext): EthCallParam {
535
+ return encodeCallData(callContext, "owner", "function owner()", []);
650
536
  },
651
- renounceOwnership(ethCallContext: EthCallContext): EthCallParam {
652
- try {
653
- const iface = new Interface(["function renounceOwnership()"]);
654
- const calldata = iface.encodeFunctionData("renounceOwnership", []);
655
- return {
656
- context: ethCallContext,
657
- calldata,
658
- };
659
- } catch (e) {
660
- const stack = new Error().stack;
661
- throw transformEtherError(e, undefined, stack);
662
- }
537
+ renounceOwnership(callContext: EthCallContext): EthCallParam {
538
+ return encodeCallData(
539
+ callContext,
540
+ "renounceOwnership",
541
+ "function renounceOwnership()",
542
+ [],
543
+ );
663
544
  },
664
- setLocker(_locker: string, ethCallContext: EthCallContext): EthCallParam {
665
- try {
666
- const iface = new Interface(["function setLocker(address)"]);
667
- const calldata = iface.encodeFunctionData("setLocker", [_locker]);
668
- return {
669
- context: ethCallContext,
670
- calldata,
671
- };
672
- } catch (e) {
673
- const stack = new Error().stack;
674
- throw transformEtherError(e, undefined, stack);
675
- }
545
+ setLocker(_locker: string, callContext: EthCallContext): EthCallParam {
546
+ return encodeCallData(
547
+ callContext,
548
+ "setLocker",
549
+ "function setLocker(address)",
550
+ [_locker],
551
+ );
676
552
  },
677
- symbol(ethCallContext: EthCallContext): EthCallParam {
678
- try {
679
- const iface = new Interface(["function symbol()"]);
680
- const calldata = iface.encodeFunctionData("symbol", []);
681
- return {
682
- context: ethCallContext,
683
- calldata,
684
- };
685
- } catch (e) {
686
- const stack = new Error().stack;
687
- throw transformEtherError(e, undefined, stack);
688
- }
553
+ symbol(callContext: EthCallContext): EthCallParam {
554
+ return encodeCallData(callContext, "symbol", "function symbol()", []);
689
555
  },
690
- totalSupply(ethCallContext: EthCallContext): EthCallParam {
691
- try {
692
- const iface = new Interface(["function totalSupply()"]);
693
- const calldata = iface.encodeFunctionData("totalSupply", []);
694
- return {
695
- context: ethCallContext,
696
- calldata,
697
- };
698
- } catch (e) {
699
- const stack = new Error().stack;
700
- throw transformEtherError(e, undefined, stack);
701
- }
556
+ totalSupply(callContext: EthCallContext): EthCallParam {
557
+ return encodeCallData(
558
+ callContext,
559
+ "totalSupply",
560
+ "function totalSupply()",
561
+ [],
562
+ );
702
563
  },
703
564
  transfer(
704
565
  recipient: string,
705
566
  amount: BigNumberish,
706
- ethCallContext: EthCallContext,
567
+ callContext: EthCallContext,
707
568
  ): EthCallParam {
708
- try {
709
- const iface = new Interface(["function transfer(address,uint256)"]);
710
- const calldata = iface.encodeFunctionData("transfer", [
711
- recipient,
712
- amount,
713
- ]);
714
- return {
715
- context: ethCallContext,
716
- calldata,
717
- };
718
- } catch (e) {
719
- const stack = new Error().stack;
720
- throw transformEtherError(e, undefined, stack);
721
- }
569
+ return encodeCallData(
570
+ callContext,
571
+ "transfer",
572
+ "function transfer(address,uint256)",
573
+ [recipient, amount],
574
+ );
722
575
  },
723
576
  transferFrom(
724
577
  sender: string,
725
578
  recipient: string,
726
579
  amount: BigNumberish,
727
- ethCallContext: EthCallContext,
580
+ callContext: EthCallContext,
728
581
  ): EthCallParam {
729
- try {
730
- const iface = new Interface([
731
- "function transferFrom(address,address,uint256)",
732
- ]);
733
- const calldata = iface.encodeFunctionData("transferFrom", [
734
- sender,
735
- recipient,
736
- amount,
737
- ]);
738
- return {
739
- context: ethCallContext,
740
- calldata,
741
- };
742
- } catch (e) {
743
- const stack = new Error().stack;
744
- throw transformEtherError(e, undefined, stack);
745
- }
582
+ return encodeCallData(
583
+ callContext,
584
+ "transferFrom",
585
+ "function transferFrom(address,address,uint256)",
586
+ [sender, recipient, amount],
587
+ );
746
588
  },
747
589
  transferOwnership(
748
590
  newOwner: string,
749
- ethCallContext: EthCallContext,
591
+ callContext: EthCallContext,
750
592
  ): EthCallParam {
751
- try {
752
- const iface = new Interface(["function transferOwnership(address)"]);
753
- const calldata = iface.encodeFunctionData("transferOwnership", [
754
- newOwner,
755
- ]);
756
- return {
757
- context: ethCallContext,
758
- calldata,
759
- };
760
- } catch (e) {
761
- const stack = new Error().stack;
762
- throw transformEtherError(e, undefined, stack);
763
- }
593
+ return encodeCallData(
594
+ callContext,
595
+ "transferOwnership",
596
+ "function transferOwnership(address)",
597
+ [newOwner],
598
+ );
764
599
  },
765
600
  };
766
601
  }
@@ -774,11 +609,6 @@ export class ERC20BoundContractView extends BoundContractView<
774
609
  spender: string,
775
610
  overrides?: Overrides,
776
611
  ): Promise<bigint> {
777
- const ethCallContext = {
778
- chainId: this.context.chainId,
779
- blockTag: "0x" + this.context.blockNumber.toString(16),
780
- address: this.context.address,
781
- };
782
612
  return await this.view.allowance(
783
613
  owner,
784
614
  spender,
@@ -787,16 +617,11 @@ export class ERC20BoundContractView extends BoundContractView<
787
617
  ...overrides,
788
618
  },
789
619
  this.context.preparedData,
790
- ethCallContext,
620
+ this.context.getEthCallContext(),
791
621
  );
792
622
  }
793
623
 
794
624
  async balanceOf(account: string, overrides?: Overrides): Promise<bigint> {
795
- const ethCallContext = {
796
- chainId: this.context.chainId,
797
- blockTag: "0x" + this.context.blockNumber.toString(16),
798
- address: this.context.address,
799
- };
800
625
  return await this.view.balanceOf(
801
626
  account,
802
627
  {
@@ -804,103 +629,73 @@ export class ERC20BoundContractView extends BoundContractView<
804
629
  ...overrides,
805
630
  },
806
631
  this.context.preparedData,
807
- ethCallContext,
632
+ this.context.getEthCallContext(),
808
633
  );
809
634
  }
810
635
 
811
636
  async decimals(overrides?: Overrides): Promise<bigint> {
812
- const ethCallContext = {
813
- chainId: this.context.chainId,
814
- blockTag: "0x" + this.context.blockNumber.toString(16),
815
- address: this.context.address,
816
- };
817
637
  return await this.view.decimals(
818
638
  {
819
639
  blockTag: this.context.blockNumber,
820
640
  ...overrides,
821
641
  },
822
642
  this.context.preparedData,
823
- ethCallContext,
643
+ this.context.getEthCallContext(),
824
644
  );
825
645
  }
826
646
 
827
647
  async locker(overrides?: Overrides): Promise<string> {
828
- const ethCallContext = {
829
- chainId: this.context.chainId,
830
- blockTag: "0x" + this.context.blockNumber.toString(16),
831
- address: this.context.address,
832
- };
833
648
  return await this.view.locker(
834
649
  {
835
650
  blockTag: this.context.blockNumber,
836
651
  ...overrides,
837
652
  },
838
653
  this.context.preparedData,
839
- ethCallContext,
654
+ this.context.getEthCallContext(),
840
655
  );
841
656
  }
842
657
 
843
658
  async name(overrides?: Overrides): Promise<string> {
844
- const ethCallContext = {
845
- chainId: this.context.chainId,
846
- blockTag: "0x" + this.context.blockNumber.toString(16),
847
- address: this.context.address,
848
- };
849
659
  return await this.view.name(
850
660
  {
851
661
  blockTag: this.context.blockNumber,
852
662
  ...overrides,
853
663
  },
854
664
  this.context.preparedData,
855
- ethCallContext,
665
+ this.context.getEthCallContext(),
856
666
  );
857
667
  }
858
668
 
859
669
  async owner(overrides?: Overrides): Promise<string> {
860
- const ethCallContext = {
861
- chainId: this.context.chainId,
862
- blockTag: "0x" + this.context.blockNumber.toString(16),
863
- address: this.context.address,
864
- };
865
670
  return await this.view.owner(
866
671
  {
867
672
  blockTag: this.context.blockNumber,
868
673
  ...overrides,
869
674
  },
870
675
  this.context.preparedData,
871
- ethCallContext,
676
+ this.context.getEthCallContext(),
872
677
  );
873
678
  }
874
679
 
875
680
  async symbol(overrides?: Overrides): Promise<string> {
876
- const ethCallContext = {
877
- chainId: this.context.chainId,
878
- blockTag: "0x" + this.context.blockNumber.toString(16),
879
- address: this.context.address,
880
- };
881
681
  return await this.view.symbol(
882
682
  {
883
683
  blockTag: this.context.blockNumber,
884
684
  ...overrides,
885
685
  },
886
686
  this.context.preparedData,
887
- ethCallContext,
687
+ this.context.getEthCallContext(),
888
688
  );
889
689
  }
890
690
 
891
691
  async totalSupply(overrides?: Overrides): Promise<bigint> {
892
- const ethCallContext = {
893
- chainId: this.context.chainId,
894
- blockTag: "0x" + this.context.blockNumber.toString(16),
895
- address: this.context.address,
896
- };
897
692
  return await this.view.totalSupply(
898
693
  {
899
694
  blockTag: this.context.blockNumber,
900
695
  ...overrides,
901
696
  },
902
697
  this.context.preparedData,
903
- ethCallContext,
698
+ this.context.getEthCallContext(),
904
699
  );
905
700
  }
906
701
 
@@ -913,11 +708,6 @@ export class ERC20BoundContractView extends BoundContractView<
913
708
  amount: BigNumberish,
914
709
  overrides?: Overrides,
915
710
  ): Promise<boolean> {
916
- const ethCallContext = {
917
- chainId: this.context.chainId,
918
- blockTag: "0x" + this.context.blockNumber.toString(16),
919
- address: this.context.address,
920
- };
921
711
  return await this.view.callStatic.approve(
922
712
  spender,
923
713
  amount,
@@ -926,15 +716,10 @@ export class ERC20BoundContractView extends BoundContractView<
926
716
  ...overrides,
927
717
  },
928
718
  this.context.preparedData,
929
- ethCallContext,
719
+ this.context.getEthCallContext(),
930
720
  );
931
721
  },
932
722
  async burn(amount: BigNumberish, overrides?: Overrides): Promise<void> {
933
- const ethCallContext = {
934
- chainId: this.context.chainId,
935
- blockTag: "0x" + this.context.blockNumber.toString(16),
936
- address: this.context.address,
937
- };
938
723
  return await this.view.callStatic.burn(
939
724
  amount,
940
725
  {
@@ -942,7 +727,7 @@ export class ERC20BoundContractView extends BoundContractView<
942
727
  ...overrides,
943
728
  },
944
729
  this.context.preparedData,
945
- ethCallContext,
730
+ this.context.getEthCallContext(),
946
731
  );
947
732
  },
948
733
  async burnFrom(
@@ -950,11 +735,6 @@ export class ERC20BoundContractView extends BoundContractView<
950
735
  amount: BigNumberish,
951
736
  overrides?: Overrides,
952
737
  ): Promise<void> {
953
- const ethCallContext = {
954
- chainId: this.context.chainId,
955
- blockTag: "0x" + this.context.blockNumber.toString(16),
956
- address: this.context.address,
957
- };
958
738
  return await this.view.callStatic.burnFrom(
959
739
  account,
960
740
  amount,
@@ -963,7 +743,7 @@ export class ERC20BoundContractView extends BoundContractView<
963
743
  ...overrides,
964
744
  },
965
745
  this.context.preparedData,
966
- ethCallContext,
746
+ this.context.getEthCallContext(),
967
747
  );
968
748
  },
969
749
  async decreaseAllowance(
@@ -971,11 +751,6 @@ export class ERC20BoundContractView extends BoundContractView<
971
751
  subtractedValue: BigNumberish,
972
752
  overrides?: Overrides,
973
753
  ): Promise<boolean> {
974
- const ethCallContext = {
975
- chainId: this.context.chainId,
976
- blockTag: "0x" + this.context.blockNumber.toString(16),
977
- address: this.context.address,
978
- };
979
754
  return await this.view.callStatic.decreaseAllowance(
980
755
  spender,
981
756
  subtractedValue,
@@ -984,7 +759,7 @@ export class ERC20BoundContractView extends BoundContractView<
984
759
  ...overrides,
985
760
  },
986
761
  this.context.preparedData,
987
- ethCallContext,
762
+ this.context.getEthCallContext(),
988
763
  );
989
764
  },
990
765
  async increaseAllowance(
@@ -992,11 +767,6 @@ export class ERC20BoundContractView extends BoundContractView<
992
767
  addedValue: BigNumberish,
993
768
  overrides?: Overrides,
994
769
  ): Promise<boolean> {
995
- const ethCallContext = {
996
- chainId: this.context.chainId,
997
- blockTag: "0x" + this.context.blockNumber.toString(16),
998
- address: this.context.address,
999
- };
1000
770
  return await this.view.callStatic.increaseAllowance(
1001
771
  spender,
1002
772
  addedValue,
@@ -1005,30 +775,20 @@ export class ERC20BoundContractView extends BoundContractView<
1005
775
  ...overrides,
1006
776
  },
1007
777
  this.context.preparedData,
1008
- ethCallContext,
778
+ this.context.getEthCallContext(),
1009
779
  );
1010
780
  },
1011
781
  async renounceOwnership(overrides?: Overrides): Promise<void> {
1012
- const ethCallContext = {
1013
- chainId: this.context.chainId,
1014
- blockTag: "0x" + this.context.blockNumber.toString(16),
1015
- address: this.context.address,
1016
- };
1017
782
  return await this.view.callStatic.renounceOwnership(
1018
783
  {
1019
784
  blockTag: this.context.blockNumber,
1020
785
  ...overrides,
1021
786
  },
1022
787
  this.context.preparedData,
1023
- ethCallContext,
788
+ this.context.getEthCallContext(),
1024
789
  );
1025
790
  },
1026
791
  async setLocker(_locker: string, overrides?: Overrides): Promise<void> {
1027
- const ethCallContext = {
1028
- chainId: this.context.chainId,
1029
- blockTag: "0x" + this.context.blockNumber.toString(16),
1030
- address: this.context.address,
1031
- };
1032
792
  return await this.view.callStatic.setLocker(
1033
793
  _locker,
1034
794
  {
@@ -1036,7 +796,7 @@ export class ERC20BoundContractView extends BoundContractView<
1036
796
  ...overrides,
1037
797
  },
1038
798
  this.context.preparedData,
1039
- ethCallContext,
799
+ this.context.getEthCallContext(),
1040
800
  );
1041
801
  },
1042
802
  async transfer(
@@ -1044,11 +804,6 @@ export class ERC20BoundContractView extends BoundContractView<
1044
804
  amount: BigNumberish,
1045
805
  overrides?: Overrides,
1046
806
  ): Promise<boolean> {
1047
- const ethCallContext = {
1048
- chainId: this.context.chainId,
1049
- blockTag: "0x" + this.context.blockNumber.toString(16),
1050
- address: this.context.address,
1051
- };
1052
807
  return await this.view.callStatic.transfer(
1053
808
  recipient,
1054
809
  amount,
@@ -1057,7 +812,7 @@ export class ERC20BoundContractView extends BoundContractView<
1057
812
  ...overrides,
1058
813
  },
1059
814
  this.context.preparedData,
1060
- ethCallContext,
815
+ this.context.getEthCallContext(),
1061
816
  );
1062
817
  },
1063
818
  async transferFrom(
@@ -1066,11 +821,6 @@ export class ERC20BoundContractView extends BoundContractView<
1066
821
  amount: BigNumberish,
1067
822
  overrides?: Overrides,
1068
823
  ): Promise<boolean> {
1069
- const ethCallContext = {
1070
- chainId: this.context.chainId,
1071
- blockTag: "0x" + this.context.blockNumber.toString(16),
1072
- address: this.context.address,
1073
- };
1074
824
  return await this.view.callStatic.transferFrom(
1075
825
  sender,
1076
826
  recipient,
@@ -1080,18 +830,13 @@ export class ERC20BoundContractView extends BoundContractView<
1080
830
  ...overrides,
1081
831
  },
1082
832
  this.context.preparedData,
1083
- ethCallContext,
833
+ this.context.getEthCallContext(),
1084
834
  );
1085
835
  },
1086
836
  async transferOwnership(
1087
837
  newOwner: string,
1088
838
  overrides?: Overrides,
1089
839
  ): Promise<void> {
1090
- const ethCallContext = {
1091
- chainId: this.context.chainId,
1092
- blockTag: "0x" + this.context.blockNumber.toString(16),
1093
- address: this.context.address,
1094
- };
1095
840
  return await this.view.callStatic.transferOwnership(
1096
841
  newOwner,
1097
842
  {
@@ -1099,7 +844,7 @@ export class ERC20BoundContractView extends BoundContractView<
1099
844
  ...overrides,
1100
845
  },
1101
846
  this.context.preparedData,
1102
- ethCallContext,
847
+ this.context.getEthCallContext(),
1103
848
  );
1104
849
  },
1105
850
  };
@@ -1113,18 +858,10 @@ export class ERC20BoundContractView extends BoundContractView<
1113
858
  spender: string,
1114
859
  overrides?: Overrides,
1115
860
  ): EthCallParam {
1116
- let blockTagWithOverride = "0x" + this.context.blockNumber.toString(16);
1117
- if (overrides?.blockTag) {
1118
- blockTagWithOverride =
1119
- typeof overrides.blockTag == "string"
1120
- ? overrides.blockTag
1121
- : "0x" + overrides.blockTag.toString(16);
1122
- }
1123
-
1124
861
  return this.view.encodeCall.allowance(owner, spender, {
1125
862
  chainId: this.context.chainId.toString(),
1126
863
  address: this.context.address,
1127
- blockTag: blockTagWithOverride,
864
+ blockTag: this.context.getBlockTag(overrides),
1128
865
  });
1129
866
  },
1130
867
  approve(
@@ -1132,48 +869,24 @@ export class ERC20BoundContractView extends BoundContractView<
1132
869
  amount: BigNumberish,
1133
870
  overrides?: Overrides,
1134
871
  ): EthCallParam {
1135
- let blockTagWithOverride = "0x" + this.context.blockNumber.toString(16);
1136
- if (overrides?.blockTag) {
1137
- blockTagWithOverride =
1138
- typeof overrides.blockTag == "string"
1139
- ? overrides.blockTag
1140
- : "0x" + overrides.blockTag.toString(16);
1141
- }
1142
-
1143
872
  return this.view.encodeCall.approve(spender, amount, {
1144
873
  chainId: this.context.chainId.toString(),
1145
874
  address: this.context.address,
1146
- blockTag: blockTagWithOverride,
875
+ blockTag: this.context.getBlockTag(overrides),
1147
876
  });
1148
877
  },
1149
878
  balanceOf(account: string, overrides?: Overrides): EthCallParam {
1150
- let blockTagWithOverride = "0x" + this.context.blockNumber.toString(16);
1151
- if (overrides?.blockTag) {
1152
- blockTagWithOverride =
1153
- typeof overrides.blockTag == "string"
1154
- ? overrides.blockTag
1155
- : "0x" + overrides.blockTag.toString(16);
1156
- }
1157
-
1158
879
  return this.view.encodeCall.balanceOf(account, {
1159
880
  chainId: this.context.chainId.toString(),
1160
881
  address: this.context.address,
1161
- blockTag: blockTagWithOverride,
882
+ blockTag: this.context.getBlockTag(overrides),
1162
883
  });
1163
884
  },
1164
885
  burn(amount: BigNumberish, overrides?: Overrides): EthCallParam {
1165
- let blockTagWithOverride = "0x" + this.context.blockNumber.toString(16);
1166
- if (overrides?.blockTag) {
1167
- blockTagWithOverride =
1168
- typeof overrides.blockTag == "string"
1169
- ? overrides.blockTag
1170
- : "0x" + overrides.blockTag.toString(16);
1171
- }
1172
-
1173
886
  return this.view.encodeCall.burn(amount, {
1174
887
  chainId: this.context.chainId.toString(),
1175
888
  address: this.context.address,
1176
- blockTag: blockTagWithOverride,
889
+ blockTag: this.context.getBlockTag(overrides),
1177
890
  });
1178
891
  },
1179
892
  burnFrom(
@@ -1181,33 +894,17 @@ export class ERC20BoundContractView extends BoundContractView<
1181
894
  amount: BigNumberish,
1182
895
  overrides?: Overrides,
1183
896
  ): EthCallParam {
1184
- let blockTagWithOverride = "0x" + this.context.blockNumber.toString(16);
1185
- if (overrides?.blockTag) {
1186
- blockTagWithOverride =
1187
- typeof overrides.blockTag == "string"
1188
- ? overrides.blockTag
1189
- : "0x" + overrides.blockTag.toString(16);
1190
- }
1191
-
1192
897
  return this.view.encodeCall.burnFrom(account, amount, {
1193
898
  chainId: this.context.chainId.toString(),
1194
899
  address: this.context.address,
1195
- blockTag: blockTagWithOverride,
900
+ blockTag: this.context.getBlockTag(overrides),
1196
901
  });
1197
902
  },
1198
903
  decimals(overrides?: Overrides): EthCallParam {
1199
- let blockTagWithOverride = "0x" + this.context.blockNumber.toString(16);
1200
- if (overrides?.blockTag) {
1201
- blockTagWithOverride =
1202
- typeof overrides.blockTag == "string"
1203
- ? overrides.blockTag
1204
- : "0x" + overrides.blockTag.toString(16);
1205
- }
1206
-
1207
904
  return this.view.encodeCall.decimals({
1208
905
  chainId: this.context.chainId.toString(),
1209
906
  address: this.context.address,
1210
- blockTag: blockTagWithOverride,
907
+ blockTag: this.context.getBlockTag(overrides),
1211
908
  });
1212
909
  },
1213
910
  decreaseAllowance(
@@ -1215,18 +912,10 @@ export class ERC20BoundContractView extends BoundContractView<
1215
912
  subtractedValue: BigNumberish,
1216
913
  overrides?: Overrides,
1217
914
  ): EthCallParam {
1218
- let blockTagWithOverride = "0x" + this.context.blockNumber.toString(16);
1219
- if (overrides?.blockTag) {
1220
- blockTagWithOverride =
1221
- typeof overrides.blockTag == "string"
1222
- ? overrides.blockTag
1223
- : "0x" + overrides.blockTag.toString(16);
1224
- }
1225
-
1226
915
  return this.view.encodeCall.decreaseAllowance(spender, subtractedValue, {
1227
916
  chainId: this.context.chainId.toString(),
1228
917
  address: this.context.address,
1229
- blockTag: blockTagWithOverride,
918
+ blockTag: this.context.getBlockTag(overrides),
1230
919
  });
1231
920
  },
1232
921
  increaseAllowance(
@@ -1234,123 +923,59 @@ export class ERC20BoundContractView extends BoundContractView<
1234
923
  addedValue: BigNumberish,
1235
924
  overrides?: Overrides,
1236
925
  ): EthCallParam {
1237
- let blockTagWithOverride = "0x" + this.context.blockNumber.toString(16);
1238
- if (overrides?.blockTag) {
1239
- blockTagWithOverride =
1240
- typeof overrides.blockTag == "string"
1241
- ? overrides.blockTag
1242
- : "0x" + overrides.blockTag.toString(16);
1243
- }
1244
-
1245
926
  return this.view.encodeCall.increaseAllowance(spender, addedValue, {
1246
927
  chainId: this.context.chainId.toString(),
1247
928
  address: this.context.address,
1248
- blockTag: blockTagWithOverride,
929
+ blockTag: this.context.getBlockTag(overrides),
1249
930
  });
1250
931
  },
1251
932
  locker(overrides?: Overrides): EthCallParam {
1252
- let blockTagWithOverride = "0x" + this.context.blockNumber.toString(16);
1253
- if (overrides?.blockTag) {
1254
- blockTagWithOverride =
1255
- typeof overrides.blockTag == "string"
1256
- ? overrides.blockTag
1257
- : "0x" + overrides.blockTag.toString(16);
1258
- }
1259
-
1260
933
  return this.view.encodeCall.locker({
1261
934
  chainId: this.context.chainId.toString(),
1262
935
  address: this.context.address,
1263
- blockTag: blockTagWithOverride,
936
+ blockTag: this.context.getBlockTag(overrides),
1264
937
  });
1265
938
  },
1266
939
  name(overrides?: Overrides): EthCallParam {
1267
- let blockTagWithOverride = "0x" + this.context.blockNumber.toString(16);
1268
- if (overrides?.blockTag) {
1269
- blockTagWithOverride =
1270
- typeof overrides.blockTag == "string"
1271
- ? overrides.blockTag
1272
- : "0x" + overrides.blockTag.toString(16);
1273
- }
1274
-
1275
940
  return this.view.encodeCall.name({
1276
941
  chainId: this.context.chainId.toString(),
1277
942
  address: this.context.address,
1278
- blockTag: blockTagWithOverride,
943
+ blockTag: this.context.getBlockTag(overrides),
1279
944
  });
1280
945
  },
1281
946
  owner(overrides?: Overrides): EthCallParam {
1282
- let blockTagWithOverride = "0x" + this.context.blockNumber.toString(16);
1283
- if (overrides?.blockTag) {
1284
- blockTagWithOverride =
1285
- typeof overrides.blockTag == "string"
1286
- ? overrides.blockTag
1287
- : "0x" + overrides.blockTag.toString(16);
1288
- }
1289
-
1290
947
  return this.view.encodeCall.owner({
1291
948
  chainId: this.context.chainId.toString(),
1292
949
  address: this.context.address,
1293
- blockTag: blockTagWithOverride,
950
+ blockTag: this.context.getBlockTag(overrides),
1294
951
  });
1295
952
  },
1296
953
  renounceOwnership(overrides?: Overrides): EthCallParam {
1297
- let blockTagWithOverride = "0x" + this.context.blockNumber.toString(16);
1298
- if (overrides?.blockTag) {
1299
- blockTagWithOverride =
1300
- typeof overrides.blockTag == "string"
1301
- ? overrides.blockTag
1302
- : "0x" + overrides.blockTag.toString(16);
1303
- }
1304
-
1305
954
  return this.view.encodeCall.renounceOwnership({
1306
955
  chainId: this.context.chainId.toString(),
1307
956
  address: this.context.address,
1308
- blockTag: blockTagWithOverride,
957
+ blockTag: this.context.getBlockTag(overrides),
1309
958
  });
1310
959
  },
1311
960
  setLocker(_locker: string, overrides?: Overrides): EthCallParam {
1312
- let blockTagWithOverride = "0x" + this.context.blockNumber.toString(16);
1313
- if (overrides?.blockTag) {
1314
- blockTagWithOverride =
1315
- typeof overrides.blockTag == "string"
1316
- ? overrides.blockTag
1317
- : "0x" + overrides.blockTag.toString(16);
1318
- }
1319
-
1320
961
  return this.view.encodeCall.setLocker(_locker, {
1321
962
  chainId: this.context.chainId.toString(),
1322
963
  address: this.context.address,
1323
- blockTag: blockTagWithOverride,
964
+ blockTag: this.context.getBlockTag(overrides),
1324
965
  });
1325
966
  },
1326
967
  symbol(overrides?: Overrides): EthCallParam {
1327
- let blockTagWithOverride = "0x" + this.context.blockNumber.toString(16);
1328
- if (overrides?.blockTag) {
1329
- blockTagWithOverride =
1330
- typeof overrides.blockTag == "string"
1331
- ? overrides.blockTag
1332
- : "0x" + overrides.blockTag.toString(16);
1333
- }
1334
-
1335
968
  return this.view.encodeCall.symbol({
1336
969
  chainId: this.context.chainId.toString(),
1337
970
  address: this.context.address,
1338
- blockTag: blockTagWithOverride,
971
+ blockTag: this.context.getBlockTag(overrides),
1339
972
  });
1340
973
  },
1341
974
  totalSupply(overrides?: Overrides): EthCallParam {
1342
- let blockTagWithOverride = "0x" + this.context.blockNumber.toString(16);
1343
- if (overrides?.blockTag) {
1344
- blockTagWithOverride =
1345
- typeof overrides.blockTag == "string"
1346
- ? overrides.blockTag
1347
- : "0x" + overrides.blockTag.toString(16);
1348
- }
1349
-
1350
975
  return this.view.encodeCall.totalSupply({
1351
976
  chainId: this.context.chainId.toString(),
1352
977
  address: this.context.address,
1353
- blockTag: blockTagWithOverride,
978
+ blockTag: this.context.getBlockTag(overrides),
1354
979
  });
1355
980
  },
1356
981
  transfer(
@@ -1358,18 +983,10 @@ export class ERC20BoundContractView extends BoundContractView<
1358
983
  amount: BigNumberish,
1359
984
  overrides?: Overrides,
1360
985
  ): EthCallParam {
1361
- let blockTagWithOverride = "0x" + this.context.blockNumber.toString(16);
1362
- if (overrides?.blockTag) {
1363
- blockTagWithOverride =
1364
- typeof overrides.blockTag == "string"
1365
- ? overrides.blockTag
1366
- : "0x" + overrides.blockTag.toString(16);
1367
- }
1368
-
1369
986
  return this.view.encodeCall.transfer(recipient, amount, {
1370
987
  chainId: this.context.chainId.toString(),
1371
988
  address: this.context.address,
1372
- blockTag: blockTagWithOverride,
989
+ blockTag: this.context.getBlockTag(overrides),
1373
990
  });
1374
991
  },
1375
992
  transferFrom(
@@ -1378,33 +995,17 @@ export class ERC20BoundContractView extends BoundContractView<
1378
995
  amount: BigNumberish,
1379
996
  overrides?: Overrides,
1380
997
  ): EthCallParam {
1381
- let blockTagWithOverride = "0x" + this.context.blockNumber.toString(16);
1382
- if (overrides?.blockTag) {
1383
- blockTagWithOverride =
1384
- typeof overrides.blockTag == "string"
1385
- ? overrides.blockTag
1386
- : "0x" + overrides.blockTag.toString(16);
1387
- }
1388
-
1389
998
  return this.view.encodeCall.transferFrom(sender, recipient, amount, {
1390
999
  chainId: this.context.chainId.toString(),
1391
1000
  address: this.context.address,
1392
- blockTag: blockTagWithOverride,
1001
+ blockTag: this.context.getBlockTag(overrides),
1393
1002
  });
1394
1003
  },
1395
1004
  transferOwnership(newOwner: string, overrides?: Overrides): EthCallParam {
1396
- let blockTagWithOverride = "0x" + this.context.blockNumber.toString(16);
1397
- if (overrides?.blockTag) {
1398
- blockTagWithOverride =
1399
- typeof overrides.blockTag == "string"
1400
- ? overrides.blockTag
1401
- : "0x" + overrides.blockTag.toString(16);
1402
- }
1403
-
1404
1005
  return this.view.encodeCall.transferOwnership(newOwner, {
1405
1006
  chainId: this.context.chainId.toString(),
1406
1007
  address: this.context.address,
1407
- blockTag: blockTagWithOverride,
1008
+ blockTag: this.context.getBlockTag(overrides),
1408
1009
  });
1409
1010
  },
1410
1011
  };