@sentio/sdk 2.40.0-rc.13 → 2.40.0-rc.14

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 (29) hide show
  1. package/lib/eth/builtin/internal/eacaggregatorproxy-processor.d.ts.map +1 -1
  2. package/lib/eth/builtin/internal/eacaggregatorproxy-processor.js +230 -69
  3. package/lib/eth/builtin/internal/eacaggregatorproxy-processor.js.map +1 -1
  4. package/lib/eth/builtin/internal/erc1155-processor.d.ts.map +1 -1
  5. package/lib/eth/builtin/internal/erc1155-processor.js +80 -24
  6. package/lib/eth/builtin/internal/erc1155-processor.js.map +1 -1
  7. package/lib/eth/builtin/internal/erc20-processor.d.ts.map +1 -1
  8. package/lib/eth/builtin/internal/erc20-processor.js +180 -54
  9. package/lib/eth/builtin/internal/erc20-processor.js.map +1 -1
  10. package/lib/eth/builtin/internal/erc20bytes-processor.d.ts.map +1 -1
  11. package/lib/eth/builtin/internal/erc20bytes-processor.js +90 -27
  12. package/lib/eth/builtin/internal/erc20bytes-processor.js.map +1 -1
  13. package/lib/eth/builtin/internal/erc721-processor.d.ts.map +1 -1
  14. package/lib/eth/builtin/internal/erc721-processor.js +140 -42
  15. package/lib/eth/builtin/internal/erc721-processor.js.map +1 -1
  16. package/lib/eth/builtin/internal/weth9-processor.d.ts.map +1 -1
  17. package/lib/eth/builtin/internal/weth9-processor.js +110 -33
  18. package/lib/eth/builtin/internal/weth9-processor.js.map +1 -1
  19. package/lib/eth/codegen/function-calls.d.ts.map +1 -1
  20. package/lib/eth/codegen/function-calls.js +7 -2
  21. package/lib/eth/codegen/function-calls.js.map +1 -1
  22. package/package.json +3 -3
  23. package/src/eth/builtin/internal/eacaggregatorproxy-processor.ts +230 -92
  24. package/src/eth/builtin/internal/erc1155-processor.ts +80 -32
  25. package/src/eth/builtin/internal/erc20-processor.ts +180 -72
  26. package/src/eth/builtin/internal/erc20bytes-processor.ts +90 -36
  27. package/src/eth/builtin/internal/erc721-processor.ts +140 -56
  28. package/src/eth/builtin/internal/weth9-processor.ts +110 -44
  29. package/src/eth/codegen/function-calls.ts +7 -2
@@ -21,8 +21,10 @@ export class ERC721ContractView extends ContractView {
21
21
  context: ethCallContext,
22
22
  calldata,
23
23
  });
24
+ console.debug("looking up eth call key:", key);
24
25
  const ret = preparedData.ethCallResults[key];
25
26
  if (ret) {
27
+ console.debug("prepared eth call found:", key);
26
28
  const result = iface
27
29
  .decodeFunctionResult("totalSupply", ret)
28
30
  .toArray();
@@ -47,8 +49,10 @@ export class ERC721ContractView extends ContractView {
47
49
  context: ethCallContext,
48
50
  calldata,
49
51
  });
52
+ console.debug("looking up eth call key:", key);
50
53
  const ret = preparedData.ethCallResults[key];
51
54
  if (ret) {
55
+ console.debug("prepared eth call found:", key);
52
56
  const result = iface.decodeFunctionResult("balanceOf", ret).toArray();
53
57
  return result.length == 1 ? result[0] : result;
54
58
  }
@@ -71,8 +75,10 @@ export class ERC721ContractView extends ContractView {
71
75
  context: ethCallContext,
72
76
  calldata,
73
77
  });
78
+ console.debug("looking up eth call key:", key);
74
79
  const ret = preparedData.ethCallResults[key];
75
80
  if (ret) {
81
+ console.debug("prepared eth call found:", key);
76
82
  const result = iface
77
83
  .decodeFunctionResult("getApproved", ret)
78
84
  .toArray();
@@ -100,8 +106,10 @@ export class ERC721ContractView extends ContractView {
100
106
  context: ethCallContext,
101
107
  calldata,
102
108
  });
109
+ console.debug("looking up eth call key:", key);
103
110
  const ret = preparedData.ethCallResults[key];
104
111
  if (ret) {
112
+ console.debug("prepared eth call found:", key);
105
113
  const result = iface
106
114
  .decodeFunctionResult("isApprovedForAll", ret)
107
115
  .toArray();
@@ -124,8 +132,10 @@ export class ERC721ContractView extends ContractView {
124
132
  context: ethCallContext,
125
133
  calldata,
126
134
  });
135
+ console.debug("looking up eth call key:", key);
127
136
  const ret = preparedData.ethCallResults[key];
128
137
  if (ret) {
138
+ console.debug("prepared eth call found:", key);
129
139
  const result = iface.decodeFunctionResult("name", ret).toArray();
130
140
  return result.length == 1 ? result[0] : result;
131
141
  }
@@ -148,8 +158,10 @@ export class ERC721ContractView extends ContractView {
148
158
  context: ethCallContext,
149
159
  calldata,
150
160
  });
161
+ console.debug("looking up eth call key:", key);
151
162
  const ret = preparedData.ethCallResults[key];
152
163
  if (ret) {
164
+ console.debug("prepared eth call found:", key);
153
165
  const result = iface.decodeFunctionResult("ownerOf", ret).toArray();
154
166
  return result.length == 1 ? result[0] : result;
155
167
  }
@@ -174,8 +186,10 @@ export class ERC721ContractView extends ContractView {
174
186
  context: ethCallContext,
175
187
  calldata,
176
188
  });
189
+ console.debug("looking up eth call key:", key);
177
190
  const ret = preparedData.ethCallResults[key];
178
191
  if (ret) {
192
+ console.debug("prepared eth call found:", key);
179
193
  const result = iface
180
194
  .decodeFunctionResult("supportsInterface", ret)
181
195
  .toArray();
@@ -200,8 +214,10 @@ export class ERC721ContractView extends ContractView {
200
214
  context: ethCallContext,
201
215
  calldata,
202
216
  });
217
+ console.debug("looking up eth call key:", key);
203
218
  const ret = preparedData.ethCallResults[key];
204
219
  if (ret) {
220
+ console.debug("prepared eth call found:", key);
205
221
  const result = iface.decodeFunctionResult("symbol", ret).toArray();
206
222
  return result.length == 1 ? result[0] : result;
207
223
  }
@@ -224,8 +240,10 @@ export class ERC721ContractView extends ContractView {
224
240
  context: ethCallContext,
225
241
  calldata,
226
242
  });
243
+ console.debug("looking up eth call key:", key);
227
244
  const ret = preparedData.ethCallResults[key];
228
245
  if (ret) {
246
+ console.debug("prepared eth call found:", key);
229
247
  const result = iface.decodeFunctionResult("tokenURI", ret).toArray();
230
248
  return result.length == 1 ? result[0] : result;
231
249
  }
@@ -250,8 +268,10 @@ export class ERC721ContractView extends ContractView {
250
268
  context: ethCallContext,
251
269
  calldata,
252
270
  });
271
+ console.debug("looking up eth call key:", key);
253
272
  const ret = preparedData.ethCallResults[key];
254
273
  if (ret) {
274
+ console.debug("prepared eth call found:", key);
255
275
  const result = iface.decodeFunctionResult("approve", ret).toArray();
256
276
  return result.length == 1 ? result[0] : result;
257
277
  }
@@ -280,8 +300,10 @@ export class ERC721ContractView extends ContractView {
280
300
  context: ethCallContext,
281
301
  calldata,
282
302
  });
303
+ console.debug("looking up eth call key:", key);
283
304
  const ret = preparedData.ethCallResults[key];
284
305
  if (ret) {
306
+ console.debug("prepared eth call found:", key);
285
307
  const result = iface
286
308
  .decodeFunctionResult("safeTransferFrom", ret)
287
309
  .toArray();
@@ -313,8 +335,10 @@ export class ERC721ContractView extends ContractView {
313
335
  context: ethCallContext,
314
336
  calldata,
315
337
  });
338
+ console.debug("looking up eth call key:", key);
316
339
  const ret = preparedData.ethCallResults[key];
317
340
  if (ret) {
341
+ console.debug("prepared eth call found:", key);
318
342
  const result = iface
319
343
  .decodeFunctionResult("safeTransferFrom", ret)
320
344
  .toArray();
@@ -344,8 +368,10 @@ export class ERC721ContractView extends ContractView {
344
368
  context: ethCallContext,
345
369
  calldata,
346
370
  });
371
+ console.debug("looking up eth call key:", key);
347
372
  const ret = preparedData.ethCallResults[key];
348
373
  if (ret) {
374
+ console.debug("prepared eth call found:", key);
349
375
  const result = iface
350
376
  .decodeFunctionResult("setApprovalForAll", ret)
351
377
  .toArray();
@@ -376,8 +402,10 @@ export class ERC721ContractView extends ContractView {
376
402
  context: ethCallContext,
377
403
  calldata,
378
404
  });
405
+ console.debug("looking up eth call key:", key);
379
406
  const ret = preparedData.ethCallResults[key];
380
407
  if (ret) {
408
+ console.debug("prepared eth call found:", key);
381
409
  const result = iface
382
410
  .decodeFunctionResult("transferFrom", ret)
383
411
  .toArray();
@@ -628,7 +656,7 @@ export class ERC721BoundContractView extends BoundContractView {
628
656
  async totalSupply(overrides) {
629
657
  const ethCallContext = {
630
658
  chainId: this.context.chainId,
631
- blockTag: this.context.blockNumber.toString(16),
659
+ blockTag: "0x" + this.context.blockNumber.toString(16),
632
660
  address: this.context.address,
633
661
  };
634
662
  return await this.view.totalSupply({
@@ -639,7 +667,7 @@ export class ERC721BoundContractView extends BoundContractView {
639
667
  async balanceOf(owner, overrides) {
640
668
  const ethCallContext = {
641
669
  chainId: this.context.chainId,
642
- blockTag: this.context.blockNumber.toString(16),
670
+ blockTag: "0x" + this.context.blockNumber.toString(16),
643
671
  address: this.context.address,
644
672
  };
645
673
  return await this.view.balanceOf(owner, {
@@ -650,7 +678,7 @@ export class ERC721BoundContractView extends BoundContractView {
650
678
  async getApproved(tokenId, overrides) {
651
679
  const ethCallContext = {
652
680
  chainId: this.context.chainId,
653
- blockTag: this.context.blockNumber.toString(16),
681
+ blockTag: "0x" + this.context.blockNumber.toString(16),
654
682
  address: this.context.address,
655
683
  };
656
684
  return await this.view.getApproved(tokenId, {
@@ -661,7 +689,7 @@ export class ERC721BoundContractView extends BoundContractView {
661
689
  async isApprovedForAll(owner, operator, overrides) {
662
690
  const ethCallContext = {
663
691
  chainId: this.context.chainId,
664
- blockTag: this.context.blockNumber.toString(16),
692
+ blockTag: "0x" + this.context.blockNumber.toString(16),
665
693
  address: this.context.address,
666
694
  };
667
695
  return await this.view.isApprovedForAll(owner, operator, {
@@ -672,7 +700,7 @@ export class ERC721BoundContractView extends BoundContractView {
672
700
  async name(overrides) {
673
701
  const ethCallContext = {
674
702
  chainId: this.context.chainId,
675
- blockTag: this.context.blockNumber.toString(16),
703
+ blockTag: "0x" + this.context.blockNumber.toString(16),
676
704
  address: this.context.address,
677
705
  };
678
706
  return await this.view.name({
@@ -683,7 +711,7 @@ export class ERC721BoundContractView extends BoundContractView {
683
711
  async ownerOf(tokenId, overrides) {
684
712
  const ethCallContext = {
685
713
  chainId: this.context.chainId,
686
- blockTag: this.context.blockNumber.toString(16),
714
+ blockTag: "0x" + this.context.blockNumber.toString(16),
687
715
  address: this.context.address,
688
716
  };
689
717
  return await this.view.ownerOf(tokenId, {
@@ -694,7 +722,7 @@ export class ERC721BoundContractView extends BoundContractView {
694
722
  async supportsInterface(interfaceId, overrides) {
695
723
  const ethCallContext = {
696
724
  chainId: this.context.chainId,
697
- blockTag: this.context.blockNumber.toString(16),
725
+ blockTag: "0x" + this.context.blockNumber.toString(16),
698
726
  address: this.context.address,
699
727
  };
700
728
  return await this.view.supportsInterface(interfaceId, {
@@ -705,7 +733,7 @@ export class ERC721BoundContractView extends BoundContractView {
705
733
  async symbol(overrides) {
706
734
  const ethCallContext = {
707
735
  chainId: this.context.chainId,
708
- blockTag: this.context.blockNumber.toString(16),
736
+ blockTag: "0x" + this.context.blockNumber.toString(16),
709
737
  address: this.context.address,
710
738
  };
711
739
  return await this.view.symbol({
@@ -716,7 +744,7 @@ export class ERC721BoundContractView extends BoundContractView {
716
744
  async tokenURI(tokenId, overrides) {
717
745
  const ethCallContext = {
718
746
  chainId: this.context.chainId,
719
- blockTag: this.context.blockNumber.toString(16),
747
+ blockTag: "0x" + this.context.blockNumber.toString(16),
720
748
  address: this.context.address,
721
749
  };
722
750
  return await this.view.tokenURI(tokenId, {
@@ -730,7 +758,7 @@ export class ERC721BoundContractView extends BoundContractView {
730
758
  async approve(to, tokenId, overrides) {
731
759
  const ethCallContext = {
732
760
  chainId: this.context.chainId,
733
- blockTag: this.context.blockNumber.toString(16),
761
+ blockTag: "0x" + this.context.blockNumber.toString(16),
734
762
  address: this.context.address,
735
763
  };
736
764
  return await this.view.callStatic.approve(to, tokenId, {
@@ -741,7 +769,7 @@ export class ERC721BoundContractView extends BoundContractView {
741
769
  async safeTransferFrom_address_address_uint256(from, to, tokenId, overrides) {
742
770
  const ethCallContext = {
743
771
  chainId: this.context.chainId,
744
- blockTag: this.context.blockNumber.toString(16),
772
+ blockTag: "0x" + this.context.blockNumber.toString(16),
745
773
  address: this.context.address,
746
774
  };
747
775
  return await this.view.callStatic.safeTransferFrom_address_address_uint256(from, to, tokenId, {
@@ -752,7 +780,7 @@ export class ERC721BoundContractView extends BoundContractView {
752
780
  async safeTransferFrom_address_address_uint256_bytes(from, to, tokenId, data, overrides) {
753
781
  const ethCallContext = {
754
782
  chainId: this.context.chainId,
755
- blockTag: this.context.blockNumber.toString(16),
783
+ blockTag: "0x" + this.context.blockNumber.toString(16),
756
784
  address: this.context.address,
757
785
  };
758
786
  return await this.view.callStatic.safeTransferFrom_address_address_uint256_bytes(from, to, tokenId, data, {
@@ -763,7 +791,7 @@ export class ERC721BoundContractView extends BoundContractView {
763
791
  async setApprovalForAll(operator, _approved, overrides) {
764
792
  const ethCallContext = {
765
793
  chainId: this.context.chainId,
766
- blockTag: this.context.blockNumber.toString(16),
794
+ blockTag: "0x" + this.context.blockNumber.toString(16),
767
795
  address: this.context.address,
768
796
  };
769
797
  return await this.view.callStatic.setApprovalForAll(operator, _approved, {
@@ -774,7 +802,7 @@ export class ERC721BoundContractView extends BoundContractView {
774
802
  async transferFrom(from, to, tokenId, overrides) {
775
803
  const ethCallContext = {
776
804
  chainId: this.context.chainId,
777
- blockTag: this.context.blockNumber.toString(16),
805
+ blockTag: "0x" + this.context.blockNumber.toString(16),
778
806
  address: this.context.address,
779
807
  };
780
808
  return await this.view.callStatic.transferFrom(from, to, tokenId, {
@@ -788,9 +816,14 @@ export class ERC721BoundContractView extends BoundContractView {
788
816
  context: this.context,
789
817
  approve(to, tokenId, overrides) {
790
818
  const chainId = overrides?.chainId?.toString() ?? this.context.chainId.toString();
791
- const blockTag = overrides?.blockTag?.toString() ??
792
- this.context.blockNumber.toString(16);
793
819
  const address = this.context.address;
820
+ let blockTag = "0x" + this.context.blockNumber.toString(16);
821
+ if (overrides?.blockTag) {
822
+ blockTag =
823
+ typeof overrides.blockTag == "string"
824
+ ? overrides.blockTag
825
+ : "0x" + overrides.blockTag.toString(16);
826
+ }
794
827
  return this.view.encodeCall.approve(to, tokenId, {
795
828
  chainId,
796
829
  address,
@@ -799,16 +832,26 @@ export class ERC721BoundContractView extends BoundContractView {
799
832
  },
800
833
  totalSupply(overrides) {
801
834
  const chainId = overrides?.chainId?.toString() ?? this.context.chainId.toString();
802
- const blockTag = overrides?.blockTag?.toString() ??
803
- this.context.blockNumber.toString(16);
804
835
  const address = this.context.address;
836
+ let blockTag = "0x" + this.context.blockNumber.toString(16);
837
+ if (overrides?.blockTag) {
838
+ blockTag =
839
+ typeof overrides.blockTag == "string"
840
+ ? overrides.blockTag
841
+ : "0x" + overrides.blockTag.toString(16);
842
+ }
805
843
  return this.view.encodeCall.totalSupply({ chainId, address, blockTag });
806
844
  },
807
845
  balanceOf(owner, overrides) {
808
846
  const chainId = overrides?.chainId?.toString() ?? this.context.chainId.toString();
809
- const blockTag = overrides?.blockTag?.toString() ??
810
- this.context.blockNumber.toString(16);
811
847
  const address = this.context.address;
848
+ let blockTag = "0x" + this.context.blockNumber.toString(16);
849
+ if (overrides?.blockTag) {
850
+ blockTag =
851
+ typeof overrides.blockTag == "string"
852
+ ? overrides.blockTag
853
+ : "0x" + overrides.blockTag.toString(16);
854
+ }
812
855
  return this.view.encodeCall.balanceOf(owner, {
813
856
  chainId,
814
857
  address,
@@ -817,9 +860,14 @@ export class ERC721BoundContractView extends BoundContractView {
817
860
  },
818
861
  getApproved(tokenId, overrides) {
819
862
  const chainId = overrides?.chainId?.toString() ?? this.context.chainId.toString();
820
- const blockTag = overrides?.blockTag?.toString() ??
821
- this.context.blockNumber.toString(16);
822
863
  const address = this.context.address;
864
+ let blockTag = "0x" + this.context.blockNumber.toString(16);
865
+ if (overrides?.blockTag) {
866
+ blockTag =
867
+ typeof overrides.blockTag == "string"
868
+ ? overrides.blockTag
869
+ : "0x" + overrides.blockTag.toString(16);
870
+ }
823
871
  return this.view.encodeCall.getApproved(tokenId, {
824
872
  chainId,
825
873
  address,
@@ -828,9 +876,14 @@ export class ERC721BoundContractView extends BoundContractView {
828
876
  },
829
877
  isApprovedForAll(owner, operator, overrides) {
830
878
  const chainId = overrides?.chainId?.toString() ?? this.context.chainId.toString();
831
- const blockTag = overrides?.blockTag?.toString() ??
832
- this.context.blockNumber.toString(16);
833
879
  const address = this.context.address;
880
+ let blockTag = "0x" + this.context.blockNumber.toString(16);
881
+ if (overrides?.blockTag) {
882
+ blockTag =
883
+ typeof overrides.blockTag == "string"
884
+ ? overrides.blockTag
885
+ : "0x" + overrides.blockTag.toString(16);
886
+ }
834
887
  return this.view.encodeCall.isApprovedForAll(owner, operator, {
835
888
  chainId,
836
889
  address,
@@ -839,16 +892,26 @@ export class ERC721BoundContractView extends BoundContractView {
839
892
  },
840
893
  name(overrides) {
841
894
  const chainId = overrides?.chainId?.toString() ?? this.context.chainId.toString();
842
- const blockTag = overrides?.blockTag?.toString() ??
843
- this.context.blockNumber.toString(16);
844
895
  const address = this.context.address;
896
+ let blockTag = "0x" + this.context.blockNumber.toString(16);
897
+ if (overrides?.blockTag) {
898
+ blockTag =
899
+ typeof overrides.blockTag == "string"
900
+ ? overrides.blockTag
901
+ : "0x" + overrides.blockTag.toString(16);
902
+ }
845
903
  return this.view.encodeCall.name({ chainId, address, blockTag });
846
904
  },
847
905
  ownerOf(tokenId, overrides) {
848
906
  const chainId = overrides?.chainId?.toString() ?? this.context.chainId.toString();
849
- const blockTag = overrides?.blockTag?.toString() ??
850
- this.context.blockNumber.toString(16);
851
907
  const address = this.context.address;
908
+ let blockTag = "0x" + this.context.blockNumber.toString(16);
909
+ if (overrides?.blockTag) {
910
+ blockTag =
911
+ typeof overrides.blockTag == "string"
912
+ ? overrides.blockTag
913
+ : "0x" + overrides.blockTag.toString(16);
914
+ }
852
915
  return this.view.encodeCall.ownerOf(tokenId, {
853
916
  chainId,
854
917
  address,
@@ -857,23 +920,38 @@ export class ERC721BoundContractView extends BoundContractView {
857
920
  },
858
921
  safeTransferFrom_address_address_uint256(from, to, tokenId, overrides) {
859
922
  const chainId = overrides?.chainId?.toString() ?? this.context.chainId.toString();
860
- const blockTag = overrides?.blockTag?.toString() ??
861
- this.context.blockNumber.toString(16);
862
923
  const address = this.context.address;
924
+ let blockTag = "0x" + this.context.blockNumber.toString(16);
925
+ if (overrides?.blockTag) {
926
+ blockTag =
927
+ typeof overrides.blockTag == "string"
928
+ ? overrides.blockTag
929
+ : "0x" + overrides.blockTag.toString(16);
930
+ }
863
931
  return this.view.encodeCall.safeTransferFrom_address_address_uint256(from, to, tokenId, { chainId, address, blockTag });
864
932
  },
865
933
  safeTransferFrom_address_address_uint256_bytes(from, to, tokenId, data, overrides) {
866
934
  const chainId = overrides?.chainId?.toString() ?? this.context.chainId.toString();
867
- const blockTag = overrides?.blockTag?.toString() ??
868
- this.context.blockNumber.toString(16);
869
935
  const address = this.context.address;
936
+ let blockTag = "0x" + this.context.blockNumber.toString(16);
937
+ if (overrides?.blockTag) {
938
+ blockTag =
939
+ typeof overrides.blockTag == "string"
940
+ ? overrides.blockTag
941
+ : "0x" + overrides.blockTag.toString(16);
942
+ }
870
943
  return this.view.encodeCall.safeTransferFrom_address_address_uint256_bytes(from, to, tokenId, data, { chainId, address, blockTag });
871
944
  },
872
945
  setApprovalForAll(operator, _approved, overrides) {
873
946
  const chainId = overrides?.chainId?.toString() ?? this.context.chainId.toString();
874
- const blockTag = overrides?.blockTag?.toString() ??
875
- this.context.blockNumber.toString(16);
876
947
  const address = this.context.address;
948
+ let blockTag = "0x" + this.context.blockNumber.toString(16);
949
+ if (overrides?.blockTag) {
950
+ blockTag =
951
+ typeof overrides.blockTag == "string"
952
+ ? overrides.blockTag
953
+ : "0x" + overrides.blockTag.toString(16);
954
+ }
877
955
  return this.view.encodeCall.setApprovalForAll(operator, _approved, {
878
956
  chainId,
879
957
  address,
@@ -882,9 +960,14 @@ export class ERC721BoundContractView extends BoundContractView {
882
960
  },
883
961
  supportsInterface(interfaceId, overrides) {
884
962
  const chainId = overrides?.chainId?.toString() ?? this.context.chainId.toString();
885
- const blockTag = overrides?.blockTag?.toString() ??
886
- this.context.blockNumber.toString(16);
887
963
  const address = this.context.address;
964
+ let blockTag = "0x" + this.context.blockNumber.toString(16);
965
+ if (overrides?.blockTag) {
966
+ blockTag =
967
+ typeof overrides.blockTag == "string"
968
+ ? overrides.blockTag
969
+ : "0x" + overrides.blockTag.toString(16);
970
+ }
888
971
  return this.view.encodeCall.supportsInterface(interfaceId, {
889
972
  chainId,
890
973
  address,
@@ -893,16 +976,26 @@ export class ERC721BoundContractView extends BoundContractView {
893
976
  },
894
977
  symbol(overrides) {
895
978
  const chainId = overrides?.chainId?.toString() ?? this.context.chainId.toString();
896
- const blockTag = overrides?.blockTag?.toString() ??
897
- this.context.blockNumber.toString(16);
898
979
  const address = this.context.address;
980
+ let blockTag = "0x" + this.context.blockNumber.toString(16);
981
+ if (overrides?.blockTag) {
982
+ blockTag =
983
+ typeof overrides.blockTag == "string"
984
+ ? overrides.blockTag
985
+ : "0x" + overrides.blockTag.toString(16);
986
+ }
899
987
  return this.view.encodeCall.symbol({ chainId, address, blockTag });
900
988
  },
901
989
  tokenURI(tokenId, overrides) {
902
990
  const chainId = overrides?.chainId?.toString() ?? this.context.chainId.toString();
903
- const blockTag = overrides?.blockTag?.toString() ??
904
- this.context.blockNumber.toString(16);
905
991
  const address = this.context.address;
992
+ let blockTag = "0x" + this.context.blockNumber.toString(16);
993
+ if (overrides?.blockTag) {
994
+ blockTag =
995
+ typeof overrides.blockTag == "string"
996
+ ? overrides.blockTag
997
+ : "0x" + overrides.blockTag.toString(16);
998
+ }
906
999
  return this.view.encodeCall.tokenURI(tokenId, {
907
1000
  chainId,
908
1001
  address,
@@ -911,9 +1004,14 @@ export class ERC721BoundContractView extends BoundContractView {
911
1004
  },
912
1005
  transferFrom(from, to, tokenId, overrides) {
913
1006
  const chainId = overrides?.chainId?.toString() ?? this.context.chainId.toString();
914
- const blockTag = overrides?.blockTag?.toString() ??
915
- this.context.blockNumber.toString(16);
916
1007
  const address = this.context.address;
1008
+ let blockTag = "0x" + this.context.blockNumber.toString(16);
1009
+ if (overrides?.blockTag) {
1010
+ blockTag =
1011
+ typeof overrides.blockTag == "string"
1012
+ ? overrides.blockTag
1013
+ : "0x" + overrides.blockTag.toString(16);
1014
+ }
917
1015
  return this.view.encodeCall.transferFrom(from, to, tokenId, {
918
1016
  chainId,
919
1017
  address,