@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
@@ -144,8 +144,10 @@ export class ERC1155ContractView extends ContractView<ERC1155> {
144
144
  context: ethCallContext,
145
145
  calldata,
146
146
  });
147
+ console.debug("looking up eth call key:", key);
147
148
  const ret = preparedData.ethCallResults[key];
148
149
  if (ret) {
150
+ console.debug("prepared eth call found:", key);
149
151
  const result = iface.decodeFunctionResult("balanceOf", ret).toArray();
150
152
  return result.length == 1 ? result[0] : result;
151
153
  }
@@ -181,8 +183,10 @@ export class ERC1155ContractView extends ContractView<ERC1155> {
181
183
  context: ethCallContext,
182
184
  calldata,
183
185
  });
186
+ console.debug("looking up eth call key:", key);
184
187
  const ret = preparedData.ethCallResults[key];
185
188
  if (ret) {
189
+ console.debug("prepared eth call found:", key);
186
190
  const result = iface
187
191
  .decodeFunctionResult("balanceOfBatch", ret)
188
192
  .toArray();
@@ -218,8 +222,10 @@ export class ERC1155ContractView extends ContractView<ERC1155> {
218
222
  context: ethCallContext,
219
223
  calldata,
220
224
  });
225
+ console.debug("looking up eth call key:", key);
221
226
  const ret = preparedData.ethCallResults[key];
222
227
  if (ret) {
228
+ console.debug("prepared eth call found:", key);
223
229
  const result = iface
224
230
  .decodeFunctionResult("isApprovedForAll", ret)
225
231
  .toArray();
@@ -253,8 +259,10 @@ export class ERC1155ContractView extends ContractView<ERC1155> {
253
259
  context: ethCallContext,
254
260
  calldata,
255
261
  });
262
+ console.debug("looking up eth call key:", key);
256
263
  const ret = preparedData.ethCallResults[key];
257
264
  if (ret) {
265
+ console.debug("prepared eth call found:", key);
258
266
  const result = iface
259
267
  .decodeFunctionResult("supportsInterface", ret)
260
268
  .toArray();
@@ -287,8 +295,10 @@ export class ERC1155ContractView extends ContractView<ERC1155> {
287
295
  context: ethCallContext,
288
296
  calldata,
289
297
  });
298
+ console.debug("looking up eth call key:", key);
290
299
  const ret = preparedData.ethCallResults[key];
291
300
  if (ret) {
301
+ console.debug("prepared eth call found:", key);
292
302
  const result = iface.decodeFunctionResult("uri", ret).toArray();
293
303
  return result.length == 1 ? result[0] : result;
294
304
  }
@@ -332,8 +342,10 @@ export class ERC1155ContractView extends ContractView<ERC1155> {
332
342
  context: ethCallContext,
333
343
  calldata,
334
344
  });
345
+ console.debug("looking up eth call key:", key);
335
346
  const ret = preparedData.ethCallResults[key];
336
347
  if (ret) {
348
+ console.debug("prepared eth call found:", key);
337
349
  const result = iface
338
350
  .decodeFunctionResult("safeBatchTransferFrom", ret)
339
351
  .toArray();
@@ -376,8 +388,10 @@ export class ERC1155ContractView extends ContractView<ERC1155> {
376
388
  context: ethCallContext,
377
389
  calldata,
378
390
  });
391
+ console.debug("looking up eth call key:", key);
379
392
  const ret = preparedData.ethCallResults[key];
380
393
  if (ret) {
394
+ console.debug("prepared eth call found:", key);
381
395
  const result = iface
382
396
  .decodeFunctionResult("safeTransferFrom", ret)
383
397
  .toArray();
@@ -414,8 +428,10 @@ export class ERC1155ContractView extends ContractView<ERC1155> {
414
428
  context: ethCallContext,
415
429
  calldata,
416
430
  });
431
+ console.debug("looking up eth call key:", key);
417
432
  const ret = preparedData.ethCallResults[key];
418
433
  if (ret) {
434
+ console.debug("prepared eth call found:", key);
419
435
  const result = iface
420
436
  .decodeFunctionResult("setApprovalForAll", ret)
421
437
  .toArray();
@@ -617,7 +633,7 @@ export class ERC1155BoundContractView extends BoundContractView<
617
633
  ): Promise<bigint> {
618
634
  const ethCallContext = {
619
635
  chainId: this.context.chainId,
620
- blockTag: this.context.blockNumber.toString(16),
636
+ blockTag: "0x" + this.context.blockNumber.toString(16),
621
637
  address: this.context.address,
622
638
  };
623
639
  return await this.view.balanceOf(
@@ -639,7 +655,7 @@ export class ERC1155BoundContractView extends BoundContractView<
639
655
  ): Promise<bigint[]> {
640
656
  const ethCallContext = {
641
657
  chainId: this.context.chainId,
642
- blockTag: this.context.blockNumber.toString(16),
658
+ blockTag: "0x" + this.context.blockNumber.toString(16),
643
659
  address: this.context.address,
644
660
  };
645
661
  return await this.view.balanceOfBatch(
@@ -661,7 +677,7 @@ export class ERC1155BoundContractView extends BoundContractView<
661
677
  ): Promise<boolean> {
662
678
  const ethCallContext = {
663
679
  chainId: this.context.chainId,
664
- blockTag: this.context.blockNumber.toString(16),
680
+ blockTag: "0x" + this.context.blockNumber.toString(16),
665
681
  address: this.context.address,
666
682
  };
667
683
  return await this.view.isApprovedForAll(
@@ -682,7 +698,7 @@ export class ERC1155BoundContractView extends BoundContractView<
682
698
  ): Promise<boolean> {
683
699
  const ethCallContext = {
684
700
  chainId: this.context.chainId,
685
- blockTag: this.context.blockNumber.toString(16),
701
+ blockTag: "0x" + this.context.blockNumber.toString(16),
686
702
  address: this.context.address,
687
703
  };
688
704
  return await this.view.supportsInterface(
@@ -699,7 +715,7 @@ export class ERC1155BoundContractView extends BoundContractView<
699
715
  async uri(id: BigNumberish, overrides?: Overrides): Promise<string> {
700
716
  const ethCallContext = {
701
717
  chainId: this.context.chainId,
702
- blockTag: this.context.blockNumber.toString(16),
718
+ blockTag: "0x" + this.context.blockNumber.toString(16),
703
719
  address: this.context.address,
704
720
  };
705
721
  return await this.view.uri(
@@ -727,7 +743,7 @@ export class ERC1155BoundContractView extends BoundContractView<
727
743
  ): Promise<void> {
728
744
  const ethCallContext = {
729
745
  chainId: this.context.chainId,
730
- blockTag: this.context.blockNumber.toString(16),
746
+ blockTag: "0x" + this.context.blockNumber.toString(16),
731
747
  address: this.context.address,
732
748
  };
733
749
  return await this.view.callStatic.safeBatchTransferFrom(
@@ -754,7 +770,7 @@ export class ERC1155BoundContractView extends BoundContractView<
754
770
  ): Promise<void> {
755
771
  const ethCallContext = {
756
772
  chainId: this.context.chainId,
757
- blockTag: this.context.blockNumber.toString(16),
773
+ blockTag: "0x" + this.context.blockNumber.toString(16),
758
774
  address: this.context.address,
759
775
  };
760
776
  return await this.view.callStatic.safeTransferFrom(
@@ -778,7 +794,7 @@ export class ERC1155BoundContractView extends BoundContractView<
778
794
  ): Promise<void> {
779
795
  const ethCallContext = {
780
796
  chainId: this.context.chainId,
781
- blockTag: this.context.blockNumber.toString(16),
797
+ blockTag: "0x" + this.context.blockNumber.toString(16),
782
798
  address: this.context.address,
783
799
  };
784
800
  return await this.view.callStatic.setApprovalForAll(
@@ -805,10 +821,14 @@ export class ERC1155BoundContractView extends BoundContractView<
805
821
  ): EthCallParam {
806
822
  const chainId =
807
823
  overrides?.chainId?.toString() ?? this.context.chainId.toString();
808
- const blockTag =
809
- overrides?.blockTag?.toString() ??
810
- this.context.blockNumber.toString(16);
811
824
  const address = this.context.address;
825
+ let blockTag = "0x" + this.context.blockNumber.toString(16);
826
+ if (overrides?.blockTag) {
827
+ blockTag =
828
+ typeof overrides.blockTag == "string"
829
+ ? overrides.blockTag
830
+ : "0x" + overrides.blockTag.toString(16);
831
+ }
812
832
 
813
833
  return this.view.encodeCall.balanceOf(account, id, {
814
834
  chainId,
@@ -823,10 +843,14 @@ export class ERC1155BoundContractView extends BoundContractView<
823
843
  ): EthCallParam {
824
844
  const chainId =
825
845
  overrides?.chainId?.toString() ?? this.context.chainId.toString();
826
- const blockTag =
827
- overrides?.blockTag?.toString() ??
828
- this.context.blockNumber.toString(16);
829
846
  const address = this.context.address;
847
+ let blockTag = "0x" + this.context.blockNumber.toString(16);
848
+ if (overrides?.blockTag) {
849
+ blockTag =
850
+ typeof overrides.blockTag == "string"
851
+ ? overrides.blockTag
852
+ : "0x" + overrides.blockTag.toString(16);
853
+ }
830
854
 
831
855
  return this.view.encodeCall.balanceOfBatch(accounts, ids, {
832
856
  chainId,
@@ -841,10 +865,14 @@ export class ERC1155BoundContractView extends BoundContractView<
841
865
  ): EthCallParam {
842
866
  const chainId =
843
867
  overrides?.chainId?.toString() ?? this.context.chainId.toString();
844
- const blockTag =
845
- overrides?.blockTag?.toString() ??
846
- this.context.blockNumber.toString(16);
847
868
  const address = this.context.address;
869
+ let blockTag = "0x" + this.context.blockNumber.toString(16);
870
+ if (overrides?.blockTag) {
871
+ blockTag =
872
+ typeof overrides.blockTag == "string"
873
+ ? overrides.blockTag
874
+ : "0x" + overrides.blockTag.toString(16);
875
+ }
848
876
 
849
877
  return this.view.encodeCall.isApprovedForAll(account, operator, {
850
878
  chainId,
@@ -862,10 +890,14 @@ export class ERC1155BoundContractView extends BoundContractView<
862
890
  ): EthCallParam {
863
891
  const chainId =
864
892
  overrides?.chainId?.toString() ?? this.context.chainId.toString();
865
- const blockTag =
866
- overrides?.blockTag?.toString() ??
867
- this.context.blockNumber.toString(16);
868
893
  const address = this.context.address;
894
+ let blockTag = "0x" + this.context.blockNumber.toString(16);
895
+ if (overrides?.blockTag) {
896
+ blockTag =
897
+ typeof overrides.blockTag == "string"
898
+ ? overrides.blockTag
899
+ : "0x" + overrides.blockTag.toString(16);
900
+ }
869
901
 
870
902
  return this.view.encodeCall.safeBatchTransferFrom(
871
903
  from,
@@ -886,10 +918,14 @@ export class ERC1155BoundContractView extends BoundContractView<
886
918
  ): EthCallParam {
887
919
  const chainId =
888
920
  overrides?.chainId?.toString() ?? this.context.chainId.toString();
889
- const blockTag =
890
- overrides?.blockTag?.toString() ??
891
- this.context.blockNumber.toString(16);
892
921
  const address = this.context.address;
922
+ let blockTag = "0x" + this.context.blockNumber.toString(16);
923
+ if (overrides?.blockTag) {
924
+ blockTag =
925
+ typeof overrides.blockTag == "string"
926
+ ? overrides.blockTag
927
+ : "0x" + overrides.blockTag.toString(16);
928
+ }
893
929
 
894
930
  return this.view.encodeCall.safeTransferFrom(from, to, id, amount, data, {
895
931
  chainId,
@@ -904,10 +940,14 @@ export class ERC1155BoundContractView extends BoundContractView<
904
940
  ): EthCallParam {
905
941
  const chainId =
906
942
  overrides?.chainId?.toString() ?? this.context.chainId.toString();
907
- const blockTag =
908
- overrides?.blockTag?.toString() ??
909
- this.context.blockNumber.toString(16);
910
943
  const address = this.context.address;
944
+ let blockTag = "0x" + this.context.blockNumber.toString(16);
945
+ if (overrides?.blockTag) {
946
+ blockTag =
947
+ typeof overrides.blockTag == "string"
948
+ ? overrides.blockTag
949
+ : "0x" + overrides.blockTag.toString(16);
950
+ }
911
951
 
912
952
  return this.view.encodeCall.setApprovalForAll(operator, approved, {
913
953
  chainId,
@@ -921,10 +961,14 @@ export class ERC1155BoundContractView extends BoundContractView<
921
961
  ): EthCallParam {
922
962
  const chainId =
923
963
  overrides?.chainId?.toString() ?? this.context.chainId.toString();
924
- const blockTag =
925
- overrides?.blockTag?.toString() ??
926
- this.context.blockNumber.toString(16);
927
964
  const address = this.context.address;
965
+ let blockTag = "0x" + this.context.blockNumber.toString(16);
966
+ if (overrides?.blockTag) {
967
+ blockTag =
968
+ typeof overrides.blockTag == "string"
969
+ ? overrides.blockTag
970
+ : "0x" + overrides.blockTag.toString(16);
971
+ }
928
972
 
929
973
  return this.view.encodeCall.supportsInterface(interfaceId, {
930
974
  chainId,
@@ -935,10 +979,14 @@ export class ERC1155BoundContractView extends BoundContractView<
935
979
  uri(id: BigNumberish, overrides?: Overrides): EthCallParam {
936
980
  const chainId =
937
981
  overrides?.chainId?.toString() ?? this.context.chainId.toString();
938
- const blockTag =
939
- overrides?.blockTag?.toString() ??
940
- this.context.blockNumber.toString(16);
941
982
  const address = this.context.address;
983
+ let blockTag = "0x" + this.context.blockNumber.toString(16);
984
+ if (overrides?.blockTag) {
985
+ blockTag =
986
+ typeof overrides.blockTag == "string"
987
+ ? overrides.blockTag
988
+ : "0x" + overrides.blockTag.toString(16);
989
+ }
942
990
 
943
991
  return this.view.encodeCall.uri(id, { chainId, address, blockTag });
944
992
  },