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

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
@@ -24,8 +24,10 @@ export class ERC20ContractView extends ContractView {
24
24
  context: ethCallContext,
25
25
  calldata,
26
26
  });
27
+ console.debug("looking up eth call key:", key);
27
28
  const ret = preparedData.ethCallResults[key];
28
29
  if (ret) {
30
+ console.debug("prepared eth call found:", key);
29
31
  const result = iface.decodeFunctionResult("allowance", ret).toArray();
30
32
  return result.length == 1 ? result[0] : result;
31
33
  }
@@ -48,8 +50,10 @@ export class ERC20ContractView extends ContractView {
48
50
  context: ethCallContext,
49
51
  calldata,
50
52
  });
53
+ console.debug("looking up eth call key:", key);
51
54
  const ret = preparedData.ethCallResults[key];
52
55
  if (ret) {
56
+ console.debug("prepared eth call found:", key);
53
57
  const result = iface.decodeFunctionResult("balanceOf", ret).toArray();
54
58
  return result.length == 1 ? result[0] : result;
55
59
  }
@@ -72,8 +76,10 @@ export class ERC20ContractView extends ContractView {
72
76
  context: ethCallContext,
73
77
  calldata,
74
78
  });
79
+ console.debug("looking up eth call key:", key);
75
80
  const ret = preparedData.ethCallResults[key];
76
81
  if (ret) {
82
+ console.debug("prepared eth call found:", key);
77
83
  const result = iface.decodeFunctionResult("decimals", ret).toArray();
78
84
  return result.length == 1 ? result[0] : result;
79
85
  }
@@ -96,8 +102,10 @@ export class ERC20ContractView extends ContractView {
96
102
  context: ethCallContext,
97
103
  calldata,
98
104
  });
105
+ console.debug("looking up eth call key:", key);
99
106
  const ret = preparedData.ethCallResults[key];
100
107
  if (ret) {
108
+ console.debug("prepared eth call found:", key);
101
109
  const result = iface.decodeFunctionResult("locker", ret).toArray();
102
110
  return result.length == 1 ? result[0] : result;
103
111
  }
@@ -118,8 +126,10 @@ export class ERC20ContractView extends ContractView {
118
126
  context: ethCallContext,
119
127
  calldata,
120
128
  });
129
+ console.debug("looking up eth call key:", key);
121
130
  const ret = preparedData.ethCallResults[key];
122
131
  if (ret) {
132
+ console.debug("prepared eth call found:", key);
123
133
  const result = iface.decodeFunctionResult("name", ret).toArray();
124
134
  return result.length == 1 ? result[0] : result;
125
135
  }
@@ -142,8 +152,10 @@ export class ERC20ContractView extends ContractView {
142
152
  context: ethCallContext,
143
153
  calldata,
144
154
  });
155
+ console.debug("looking up eth call key:", key);
145
156
  const ret = preparedData.ethCallResults[key];
146
157
  if (ret) {
158
+ console.debug("prepared eth call found:", key);
147
159
  const result = iface.decodeFunctionResult("owner", ret).toArray();
148
160
  return result.length == 1 ? result[0] : result;
149
161
  }
@@ -166,8 +178,10 @@ export class ERC20ContractView extends ContractView {
166
178
  context: ethCallContext,
167
179
  calldata,
168
180
  });
181
+ console.debug("looking up eth call key:", key);
169
182
  const ret = preparedData.ethCallResults[key];
170
183
  if (ret) {
184
+ console.debug("prepared eth call found:", key);
171
185
  const result = iface.decodeFunctionResult("symbol", ret).toArray();
172
186
  return result.length == 1 ? result[0] : result;
173
187
  }
@@ -190,8 +204,10 @@ export class ERC20ContractView extends ContractView {
190
204
  context: ethCallContext,
191
205
  calldata,
192
206
  });
207
+ console.debug("looking up eth call key:", key);
193
208
  const ret = preparedData.ethCallResults[key];
194
209
  if (ret) {
210
+ console.debug("prepared eth call found:", key);
195
211
  const result = iface
196
212
  .decodeFunctionResult("totalSupply", ret)
197
213
  .toArray();
@@ -221,8 +237,10 @@ export class ERC20ContractView extends ContractView {
221
237
  context: ethCallContext,
222
238
  calldata,
223
239
  });
240
+ console.debug("looking up eth call key:", key);
224
241
  const ret = preparedData.ethCallResults[key];
225
242
  if (ret) {
243
+ console.debug("prepared eth call found:", key);
226
244
  const result = iface.decodeFunctionResult("approve", ret).toArray();
227
245
  return result.length == 1 ? result[0] : result;
228
246
  }
@@ -247,8 +265,10 @@ export class ERC20ContractView extends ContractView {
247
265
  context: ethCallContext,
248
266
  calldata,
249
267
  });
268
+ console.debug("looking up eth call key:", key);
250
269
  const ret = preparedData.ethCallResults[key];
251
270
  if (ret) {
271
+ console.debug("prepared eth call found:", key);
252
272
  const result = iface.decodeFunctionResult("burn", ret).toArray();
253
273
  return result.length == 1 ? result[0] : result;
254
274
  }
@@ -276,8 +296,10 @@ export class ERC20ContractView extends ContractView {
276
296
  context: ethCallContext,
277
297
  calldata,
278
298
  });
299
+ console.debug("looking up eth call key:", key);
279
300
  const ret = preparedData.ethCallResults[key];
280
301
  if (ret) {
302
+ console.debug("prepared eth call found:", key);
281
303
  const result = iface
282
304
  .decodeFunctionResult("burnFrom", ret)
283
305
  .toArray();
@@ -307,8 +329,10 @@ export class ERC20ContractView extends ContractView {
307
329
  context: ethCallContext,
308
330
  calldata,
309
331
  });
332
+ console.debug("looking up eth call key:", key);
310
333
  const ret = preparedData.ethCallResults[key];
311
334
  if (ret) {
335
+ console.debug("prepared eth call found:", key);
312
336
  const result = iface
313
337
  .decodeFunctionResult("decreaseAllowance", ret)
314
338
  .toArray();
@@ -338,8 +362,10 @@ export class ERC20ContractView extends ContractView {
338
362
  context: ethCallContext,
339
363
  calldata,
340
364
  });
365
+ console.debug("looking up eth call key:", key);
341
366
  const ret = preparedData.ethCallResults[key];
342
367
  if (ret) {
368
+ console.debug("prepared eth call found:", key);
343
369
  const result = iface
344
370
  .decodeFunctionResult("increaseAllowance", ret)
345
371
  .toArray();
@@ -366,8 +392,10 @@ export class ERC20ContractView extends ContractView {
366
392
  context: ethCallContext,
367
393
  calldata,
368
394
  });
395
+ console.debug("looking up eth call key:", key);
369
396
  const ret = preparedData.ethCallResults[key];
370
397
  if (ret) {
398
+ console.debug("prepared eth call found:", key);
371
399
  const result = iface
372
400
  .decodeFunctionResult("renounceOwnership", ret)
373
401
  .toArray();
@@ -394,8 +422,10 @@ export class ERC20ContractView extends ContractView {
394
422
  context: ethCallContext,
395
423
  calldata,
396
424
  });
425
+ console.debug("looking up eth call key:", key);
397
426
  const ret = preparedData.ethCallResults[key];
398
427
  if (ret) {
428
+ console.debug("prepared eth call found:", key);
399
429
  const result = iface
400
430
  .decodeFunctionResult("setLocker", ret)
401
431
  .toArray();
@@ -425,8 +455,10 @@ export class ERC20ContractView extends ContractView {
425
455
  context: ethCallContext,
426
456
  calldata,
427
457
  });
458
+ console.debug("looking up eth call key:", key);
428
459
  const ret = preparedData.ethCallResults[key];
429
460
  if (ret) {
461
+ console.debug("prepared eth call found:", key);
430
462
  const result = iface
431
463
  .decodeFunctionResult("transfer", ret)
432
464
  .toArray();
@@ -457,8 +489,10 @@ export class ERC20ContractView extends ContractView {
457
489
  context: ethCallContext,
458
490
  calldata,
459
491
  });
492
+ console.debug("looking up eth call key:", key);
460
493
  const ret = preparedData.ethCallResults[key];
461
494
  if (ret) {
495
+ console.debug("prepared eth call found:", key);
462
496
  const result = iface
463
497
  .decodeFunctionResult("transferFrom", ret)
464
498
  .toArray();
@@ -487,8 +521,10 @@ export class ERC20ContractView extends ContractView {
487
521
  context: ethCallContext,
488
522
  calldata,
489
523
  });
524
+ console.debug("looking up eth call key:", key);
490
525
  const ret = preparedData.ethCallResults[key];
491
526
  if (ret) {
527
+ console.debug("prepared eth call found:", key);
492
528
  const result = iface
493
529
  .decodeFunctionResult("transferOwnership", ret)
494
530
  .toArray();
@@ -791,7 +827,7 @@ export class ERC20BoundContractView extends BoundContractView {
791
827
  async allowance(owner, spender, overrides) {
792
828
  const ethCallContext = {
793
829
  chainId: this.context.chainId,
794
- blockTag: this.context.blockNumber.toString(16),
830
+ blockTag: "0x" + this.context.blockNumber.toString(16),
795
831
  address: this.context.address,
796
832
  };
797
833
  return await this.view.allowance(owner, spender, {
@@ -802,7 +838,7 @@ export class ERC20BoundContractView extends BoundContractView {
802
838
  async balanceOf(account, overrides) {
803
839
  const ethCallContext = {
804
840
  chainId: this.context.chainId,
805
- blockTag: this.context.blockNumber.toString(16),
841
+ blockTag: "0x" + this.context.blockNumber.toString(16),
806
842
  address: this.context.address,
807
843
  };
808
844
  return await this.view.balanceOf(account, {
@@ -813,7 +849,7 @@ export class ERC20BoundContractView extends BoundContractView {
813
849
  async decimals(overrides) {
814
850
  const ethCallContext = {
815
851
  chainId: this.context.chainId,
816
- blockTag: this.context.blockNumber.toString(16),
852
+ blockTag: "0x" + this.context.blockNumber.toString(16),
817
853
  address: this.context.address,
818
854
  };
819
855
  return await this.view.decimals({
@@ -824,7 +860,7 @@ export class ERC20BoundContractView extends BoundContractView {
824
860
  async locker(overrides) {
825
861
  const ethCallContext = {
826
862
  chainId: this.context.chainId,
827
- blockTag: this.context.blockNumber.toString(16),
863
+ blockTag: "0x" + this.context.blockNumber.toString(16),
828
864
  address: this.context.address,
829
865
  };
830
866
  return await this.view.locker({
@@ -835,7 +871,7 @@ export class ERC20BoundContractView extends BoundContractView {
835
871
  async name(overrides) {
836
872
  const ethCallContext = {
837
873
  chainId: this.context.chainId,
838
- blockTag: this.context.blockNumber.toString(16),
874
+ blockTag: "0x" + this.context.blockNumber.toString(16),
839
875
  address: this.context.address,
840
876
  };
841
877
  return await this.view.name({
@@ -846,7 +882,7 @@ export class ERC20BoundContractView extends BoundContractView {
846
882
  async owner(overrides) {
847
883
  const ethCallContext = {
848
884
  chainId: this.context.chainId,
849
- blockTag: this.context.blockNumber.toString(16),
885
+ blockTag: "0x" + this.context.blockNumber.toString(16),
850
886
  address: this.context.address,
851
887
  };
852
888
  return await this.view.owner({
@@ -857,7 +893,7 @@ export class ERC20BoundContractView extends BoundContractView {
857
893
  async symbol(overrides) {
858
894
  const ethCallContext = {
859
895
  chainId: this.context.chainId,
860
- blockTag: this.context.blockNumber.toString(16),
896
+ blockTag: "0x" + this.context.blockNumber.toString(16),
861
897
  address: this.context.address,
862
898
  };
863
899
  return await this.view.symbol({
@@ -868,7 +904,7 @@ export class ERC20BoundContractView extends BoundContractView {
868
904
  async totalSupply(overrides) {
869
905
  const ethCallContext = {
870
906
  chainId: this.context.chainId,
871
- blockTag: this.context.blockNumber.toString(16),
907
+ blockTag: "0x" + this.context.blockNumber.toString(16),
872
908
  address: this.context.address,
873
909
  };
874
910
  return await this.view.totalSupply({
@@ -882,7 +918,7 @@ export class ERC20BoundContractView extends BoundContractView {
882
918
  async approve(spender, amount, overrides) {
883
919
  const ethCallContext = {
884
920
  chainId: this.context.chainId,
885
- blockTag: this.context.blockNumber.toString(16),
921
+ blockTag: "0x" + this.context.blockNumber.toString(16),
886
922
  address: this.context.address,
887
923
  };
888
924
  return await this.view.callStatic.approve(spender, amount, {
@@ -893,7 +929,7 @@ export class ERC20BoundContractView extends BoundContractView {
893
929
  async burn(amount, overrides) {
894
930
  const ethCallContext = {
895
931
  chainId: this.context.chainId,
896
- blockTag: this.context.blockNumber.toString(16),
932
+ blockTag: "0x" + this.context.blockNumber.toString(16),
897
933
  address: this.context.address,
898
934
  };
899
935
  return await this.view.callStatic.burn(amount, {
@@ -904,7 +940,7 @@ export class ERC20BoundContractView extends BoundContractView {
904
940
  async burnFrom(account, amount, overrides) {
905
941
  const ethCallContext = {
906
942
  chainId: this.context.chainId,
907
- blockTag: this.context.blockNumber.toString(16),
943
+ blockTag: "0x" + this.context.blockNumber.toString(16),
908
944
  address: this.context.address,
909
945
  };
910
946
  return await this.view.callStatic.burnFrom(account, amount, {
@@ -915,7 +951,7 @@ export class ERC20BoundContractView extends BoundContractView {
915
951
  async decreaseAllowance(spender, subtractedValue, overrides) {
916
952
  const ethCallContext = {
917
953
  chainId: this.context.chainId,
918
- blockTag: this.context.blockNumber.toString(16),
954
+ blockTag: "0x" + this.context.blockNumber.toString(16),
919
955
  address: this.context.address,
920
956
  };
921
957
  return await this.view.callStatic.decreaseAllowance(spender, subtractedValue, {
@@ -926,7 +962,7 @@ export class ERC20BoundContractView extends BoundContractView {
926
962
  async increaseAllowance(spender, addedValue, overrides) {
927
963
  const ethCallContext = {
928
964
  chainId: this.context.chainId,
929
- blockTag: this.context.blockNumber.toString(16),
965
+ blockTag: "0x" + this.context.blockNumber.toString(16),
930
966
  address: this.context.address,
931
967
  };
932
968
  return await this.view.callStatic.increaseAllowance(spender, addedValue, {
@@ -937,7 +973,7 @@ export class ERC20BoundContractView extends BoundContractView {
937
973
  async renounceOwnership(overrides) {
938
974
  const ethCallContext = {
939
975
  chainId: this.context.chainId,
940
- blockTag: this.context.blockNumber.toString(16),
976
+ blockTag: "0x" + this.context.blockNumber.toString(16),
941
977
  address: this.context.address,
942
978
  };
943
979
  return await this.view.callStatic.renounceOwnership({
@@ -948,7 +984,7 @@ export class ERC20BoundContractView extends BoundContractView {
948
984
  async setLocker(_locker, overrides) {
949
985
  const ethCallContext = {
950
986
  chainId: this.context.chainId,
951
- blockTag: this.context.blockNumber.toString(16),
987
+ blockTag: "0x" + this.context.blockNumber.toString(16),
952
988
  address: this.context.address,
953
989
  };
954
990
  return await this.view.callStatic.setLocker(_locker, {
@@ -959,7 +995,7 @@ export class ERC20BoundContractView extends BoundContractView {
959
995
  async transfer(recipient, amount, overrides) {
960
996
  const ethCallContext = {
961
997
  chainId: this.context.chainId,
962
- blockTag: this.context.blockNumber.toString(16),
998
+ blockTag: "0x" + this.context.blockNumber.toString(16),
963
999
  address: this.context.address,
964
1000
  };
965
1001
  return await this.view.callStatic.transfer(recipient, amount, {
@@ -970,7 +1006,7 @@ export class ERC20BoundContractView extends BoundContractView {
970
1006
  async transferFrom(sender, recipient, amount, overrides) {
971
1007
  const ethCallContext = {
972
1008
  chainId: this.context.chainId,
973
- blockTag: this.context.blockNumber.toString(16),
1009
+ blockTag: "0x" + this.context.blockNumber.toString(16),
974
1010
  address: this.context.address,
975
1011
  };
976
1012
  return await this.view.callStatic.transferFrom(sender, recipient, amount, {
@@ -981,7 +1017,7 @@ export class ERC20BoundContractView extends BoundContractView {
981
1017
  async transferOwnership(newOwner, overrides) {
982
1018
  const ethCallContext = {
983
1019
  chainId: this.context.chainId,
984
- blockTag: this.context.blockNumber.toString(16),
1020
+ blockTag: "0x" + this.context.blockNumber.toString(16),
985
1021
  address: this.context.address,
986
1022
  };
987
1023
  return await this.view.callStatic.transferOwnership(newOwner, {
@@ -995,9 +1031,14 @@ export class ERC20BoundContractView extends BoundContractView {
995
1031
  context: this.context,
996
1032
  allowance(owner, spender, overrides) {
997
1033
  const chainId = overrides?.chainId?.toString() ?? this.context.chainId.toString();
998
- const blockTag = overrides?.blockTag?.toString() ??
999
- this.context.blockNumber.toString(16);
1000
1034
  const address = this.context.address;
1035
+ let blockTag = "0x" + this.context.blockNumber.toString(16);
1036
+ if (overrides?.blockTag) {
1037
+ blockTag =
1038
+ typeof overrides.blockTag == "string"
1039
+ ? overrides.blockTag
1040
+ : "0x" + overrides.blockTag.toString(16);
1041
+ }
1001
1042
  return this.view.encodeCall.allowance(owner, spender, {
1002
1043
  chainId,
1003
1044
  address,
@@ -1006,9 +1047,14 @@ export class ERC20BoundContractView extends BoundContractView {
1006
1047
  },
1007
1048
  approve(spender, amount, overrides) {
1008
1049
  const chainId = overrides?.chainId?.toString() ?? this.context.chainId.toString();
1009
- const blockTag = overrides?.blockTag?.toString() ??
1010
- this.context.blockNumber.toString(16);
1011
1050
  const address = this.context.address;
1051
+ let blockTag = "0x" + this.context.blockNumber.toString(16);
1052
+ if (overrides?.blockTag) {
1053
+ blockTag =
1054
+ typeof overrides.blockTag == "string"
1055
+ ? overrides.blockTag
1056
+ : "0x" + overrides.blockTag.toString(16);
1057
+ }
1012
1058
  return this.view.encodeCall.approve(spender, amount, {
1013
1059
  chainId,
1014
1060
  address,
@@ -1017,9 +1063,14 @@ export class ERC20BoundContractView extends BoundContractView {
1017
1063
  },
1018
1064
  balanceOf(account, overrides) {
1019
1065
  const chainId = overrides?.chainId?.toString() ?? this.context.chainId.toString();
1020
- const blockTag = overrides?.blockTag?.toString() ??
1021
- this.context.blockNumber.toString(16);
1022
1066
  const address = this.context.address;
1067
+ let blockTag = "0x" + this.context.blockNumber.toString(16);
1068
+ if (overrides?.blockTag) {
1069
+ blockTag =
1070
+ typeof overrides.blockTag == "string"
1071
+ ? overrides.blockTag
1072
+ : "0x" + overrides.blockTag.toString(16);
1073
+ }
1023
1074
  return this.view.encodeCall.balanceOf(account, {
1024
1075
  chainId,
1025
1076
  address,
@@ -1028,16 +1079,26 @@ export class ERC20BoundContractView extends BoundContractView {
1028
1079
  },
1029
1080
  burn(amount, overrides) {
1030
1081
  const chainId = overrides?.chainId?.toString() ?? this.context.chainId.toString();
1031
- const blockTag = overrides?.blockTag?.toString() ??
1032
- this.context.blockNumber.toString(16);
1033
1082
  const address = this.context.address;
1083
+ let blockTag = "0x" + this.context.blockNumber.toString(16);
1084
+ if (overrides?.blockTag) {
1085
+ blockTag =
1086
+ typeof overrides.blockTag == "string"
1087
+ ? overrides.blockTag
1088
+ : "0x" + overrides.blockTag.toString(16);
1089
+ }
1034
1090
  return this.view.encodeCall.burn(amount, { chainId, address, blockTag });
1035
1091
  },
1036
1092
  burnFrom(account, amount, overrides) {
1037
1093
  const chainId = overrides?.chainId?.toString() ?? this.context.chainId.toString();
1038
- const blockTag = overrides?.blockTag?.toString() ??
1039
- this.context.blockNumber.toString(16);
1040
1094
  const address = this.context.address;
1095
+ let blockTag = "0x" + this.context.blockNumber.toString(16);
1096
+ if (overrides?.blockTag) {
1097
+ blockTag =
1098
+ typeof overrides.blockTag == "string"
1099
+ ? overrides.blockTag
1100
+ : "0x" + overrides.blockTag.toString(16);
1101
+ }
1041
1102
  return this.view.encodeCall.burnFrom(account, amount, {
1042
1103
  chainId,
1043
1104
  address,
@@ -1046,16 +1107,26 @@ export class ERC20BoundContractView extends BoundContractView {
1046
1107
  },
1047
1108
  decimals(overrides) {
1048
1109
  const chainId = overrides?.chainId?.toString() ?? this.context.chainId.toString();
1049
- const blockTag = overrides?.blockTag?.toString() ??
1050
- this.context.blockNumber.toString(16);
1051
1110
  const address = this.context.address;
1111
+ let blockTag = "0x" + this.context.blockNumber.toString(16);
1112
+ if (overrides?.blockTag) {
1113
+ blockTag =
1114
+ typeof overrides.blockTag == "string"
1115
+ ? overrides.blockTag
1116
+ : "0x" + overrides.blockTag.toString(16);
1117
+ }
1052
1118
  return this.view.encodeCall.decimals({ chainId, address, blockTag });
1053
1119
  },
1054
1120
  decreaseAllowance(spender, subtractedValue, overrides) {
1055
1121
  const chainId = overrides?.chainId?.toString() ?? this.context.chainId.toString();
1056
- const blockTag = overrides?.blockTag?.toString() ??
1057
- this.context.blockNumber.toString(16);
1058
1122
  const address = this.context.address;
1123
+ let blockTag = "0x" + this.context.blockNumber.toString(16);
1124
+ if (overrides?.blockTag) {
1125
+ blockTag =
1126
+ typeof overrides.blockTag == "string"
1127
+ ? overrides.blockTag
1128
+ : "0x" + overrides.blockTag.toString(16);
1129
+ }
1059
1130
  return this.view.encodeCall.decreaseAllowance(spender, subtractedValue, {
1060
1131
  chainId,
1061
1132
  address,
@@ -1064,9 +1135,14 @@ export class ERC20BoundContractView extends BoundContractView {
1064
1135
  },
1065
1136
  increaseAllowance(spender, addedValue, overrides) {
1066
1137
  const chainId = overrides?.chainId?.toString() ?? this.context.chainId.toString();
1067
- const blockTag = overrides?.blockTag?.toString() ??
1068
- this.context.blockNumber.toString(16);
1069
1138
  const address = this.context.address;
1139
+ let blockTag = "0x" + this.context.blockNumber.toString(16);
1140
+ if (overrides?.blockTag) {
1141
+ blockTag =
1142
+ typeof overrides.blockTag == "string"
1143
+ ? overrides.blockTag
1144
+ : "0x" + overrides.blockTag.toString(16);
1145
+ }
1070
1146
  return this.view.encodeCall.increaseAllowance(spender, addedValue, {
1071
1147
  chainId,
1072
1148
  address,
@@ -1075,30 +1151,50 @@ export class ERC20BoundContractView extends BoundContractView {
1075
1151
  },
1076
1152
  locker(overrides) {
1077
1153
  const chainId = overrides?.chainId?.toString() ?? this.context.chainId.toString();
1078
- const blockTag = overrides?.blockTag?.toString() ??
1079
- this.context.blockNumber.toString(16);
1080
1154
  const address = this.context.address;
1155
+ let blockTag = "0x" + this.context.blockNumber.toString(16);
1156
+ if (overrides?.blockTag) {
1157
+ blockTag =
1158
+ typeof overrides.blockTag == "string"
1159
+ ? overrides.blockTag
1160
+ : "0x" + overrides.blockTag.toString(16);
1161
+ }
1081
1162
  return this.view.encodeCall.locker({ chainId, address, blockTag });
1082
1163
  },
1083
1164
  name(overrides) {
1084
1165
  const chainId = overrides?.chainId?.toString() ?? this.context.chainId.toString();
1085
- const blockTag = overrides?.blockTag?.toString() ??
1086
- this.context.blockNumber.toString(16);
1087
1166
  const address = this.context.address;
1167
+ let blockTag = "0x" + this.context.blockNumber.toString(16);
1168
+ if (overrides?.blockTag) {
1169
+ blockTag =
1170
+ typeof overrides.blockTag == "string"
1171
+ ? overrides.blockTag
1172
+ : "0x" + overrides.blockTag.toString(16);
1173
+ }
1088
1174
  return this.view.encodeCall.name({ chainId, address, blockTag });
1089
1175
  },
1090
1176
  owner(overrides) {
1091
1177
  const chainId = overrides?.chainId?.toString() ?? this.context.chainId.toString();
1092
- const blockTag = overrides?.blockTag?.toString() ??
1093
- this.context.blockNumber.toString(16);
1094
1178
  const address = this.context.address;
1179
+ let blockTag = "0x" + this.context.blockNumber.toString(16);
1180
+ if (overrides?.blockTag) {
1181
+ blockTag =
1182
+ typeof overrides.blockTag == "string"
1183
+ ? overrides.blockTag
1184
+ : "0x" + overrides.blockTag.toString(16);
1185
+ }
1095
1186
  return this.view.encodeCall.owner({ chainId, address, blockTag });
1096
1187
  },
1097
1188
  renounceOwnership(overrides) {
1098
1189
  const chainId = overrides?.chainId?.toString() ?? this.context.chainId.toString();
1099
- const blockTag = overrides?.blockTag?.toString() ??
1100
- this.context.blockNumber.toString(16);
1101
1190
  const address = this.context.address;
1191
+ let blockTag = "0x" + this.context.blockNumber.toString(16);
1192
+ if (overrides?.blockTag) {
1193
+ blockTag =
1194
+ typeof overrides.blockTag == "string"
1195
+ ? overrides.blockTag
1196
+ : "0x" + overrides.blockTag.toString(16);
1197
+ }
1102
1198
  return this.view.encodeCall.renounceOwnership({
1103
1199
  chainId,
1104
1200
  address,
@@ -1107,9 +1203,14 @@ export class ERC20BoundContractView extends BoundContractView {
1107
1203
  },
1108
1204
  setLocker(_locker, overrides) {
1109
1205
  const chainId = overrides?.chainId?.toString() ?? this.context.chainId.toString();
1110
- const blockTag = overrides?.blockTag?.toString() ??
1111
- this.context.blockNumber.toString(16);
1112
1206
  const address = this.context.address;
1207
+ let blockTag = "0x" + this.context.blockNumber.toString(16);
1208
+ if (overrides?.blockTag) {
1209
+ blockTag =
1210
+ typeof overrides.blockTag == "string"
1211
+ ? overrides.blockTag
1212
+ : "0x" + overrides.blockTag.toString(16);
1213
+ }
1113
1214
  return this.view.encodeCall.setLocker(_locker, {
1114
1215
  chainId,
1115
1216
  address,
@@ -1118,23 +1219,38 @@ export class ERC20BoundContractView extends BoundContractView {
1118
1219
  },
1119
1220
  symbol(overrides) {
1120
1221
  const chainId = overrides?.chainId?.toString() ?? this.context.chainId.toString();
1121
- const blockTag = overrides?.blockTag?.toString() ??
1122
- this.context.blockNumber.toString(16);
1123
1222
  const address = this.context.address;
1223
+ let blockTag = "0x" + this.context.blockNumber.toString(16);
1224
+ if (overrides?.blockTag) {
1225
+ blockTag =
1226
+ typeof overrides.blockTag == "string"
1227
+ ? overrides.blockTag
1228
+ : "0x" + overrides.blockTag.toString(16);
1229
+ }
1124
1230
  return this.view.encodeCall.symbol({ chainId, address, blockTag });
1125
1231
  },
1126
1232
  totalSupply(overrides) {
1127
1233
  const chainId = overrides?.chainId?.toString() ?? this.context.chainId.toString();
1128
- const blockTag = overrides?.blockTag?.toString() ??
1129
- this.context.blockNumber.toString(16);
1130
1234
  const address = this.context.address;
1235
+ let blockTag = "0x" + this.context.blockNumber.toString(16);
1236
+ if (overrides?.blockTag) {
1237
+ blockTag =
1238
+ typeof overrides.blockTag == "string"
1239
+ ? overrides.blockTag
1240
+ : "0x" + overrides.blockTag.toString(16);
1241
+ }
1131
1242
  return this.view.encodeCall.totalSupply({ chainId, address, blockTag });
1132
1243
  },
1133
1244
  transfer(recipient, amount, overrides) {
1134
1245
  const chainId = overrides?.chainId?.toString() ?? this.context.chainId.toString();
1135
- const blockTag = overrides?.blockTag?.toString() ??
1136
- this.context.blockNumber.toString(16);
1137
1246
  const address = this.context.address;
1247
+ let blockTag = "0x" + this.context.blockNumber.toString(16);
1248
+ if (overrides?.blockTag) {
1249
+ blockTag =
1250
+ typeof overrides.blockTag == "string"
1251
+ ? overrides.blockTag
1252
+ : "0x" + overrides.blockTag.toString(16);
1253
+ }
1138
1254
  return this.view.encodeCall.transfer(recipient, amount, {
1139
1255
  chainId,
1140
1256
  address,
@@ -1143,9 +1259,14 @@ export class ERC20BoundContractView extends BoundContractView {
1143
1259
  },
1144
1260
  transferFrom(sender, recipient, amount, overrides) {
1145
1261
  const chainId = overrides?.chainId?.toString() ?? this.context.chainId.toString();
1146
- const blockTag = overrides?.blockTag?.toString() ??
1147
- this.context.blockNumber.toString(16);
1148
1262
  const address = this.context.address;
1263
+ let blockTag = "0x" + this.context.blockNumber.toString(16);
1264
+ if (overrides?.blockTag) {
1265
+ blockTag =
1266
+ typeof overrides.blockTag == "string"
1267
+ ? overrides.blockTag
1268
+ : "0x" + overrides.blockTag.toString(16);
1269
+ }
1149
1270
  return this.view.encodeCall.transferFrom(sender, recipient, amount, {
1150
1271
  chainId,
1151
1272
  address,
@@ -1154,9 +1275,14 @@ export class ERC20BoundContractView extends BoundContractView {
1154
1275
  },
1155
1276
  transferOwnership(newOwner, overrides) {
1156
1277
  const chainId = overrides?.chainId?.toString() ?? this.context.chainId.toString();
1157
- const blockTag = overrides?.blockTag?.toString() ??
1158
- this.context.blockNumber.toString(16);
1159
1278
  const address = this.context.address;
1279
+ let blockTag = "0x" + this.context.blockNumber.toString(16);
1280
+ if (overrides?.blockTag) {
1281
+ blockTag =
1282
+ typeof overrides.blockTag == "string"
1283
+ ? overrides.blockTag
1284
+ : "0x" + overrides.blockTag.toString(16);
1285
+ }
1160
1286
  return this.view.encodeCall.transferOwnership(newOwner, {
1161
1287
  chainId,
1162
1288
  address,