@sentio/sdk 2.59.0-rc.24 → 2.59.0-rc.25

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 (200) hide show
  1. package/lib/aptos/aptos-plugin.d.ts +6 -5
  2. package/lib/aptos/aptos-plugin.d.ts.map +1 -1
  3. package/lib/aptos/aptos-plugin.js +31 -33
  4. package/lib/aptos/aptos-plugin.js.map +1 -1
  5. package/lib/aptos/aptos-processor.d.ts +18 -18
  6. package/lib/aptos/aptos-processor.d.ts.map +1 -1
  7. package/lib/aptos/aptos-processor.js +83 -38
  8. package/lib/aptos/aptos-processor.js.map +1 -1
  9. package/lib/aptos/aptos-resource-processor-template.d.ts +5 -4
  10. package/lib/aptos/aptos-resource-processor-template.d.ts.map +1 -1
  11. package/lib/aptos/aptos-resource-processor-template.js +8 -8
  12. package/lib/aptos/aptos-resource-processor-template.js.map +1 -1
  13. package/lib/aptos/builtin/0x1.d.ts +334 -333
  14. package/lib/aptos/builtin/0x1.d.ts.map +1 -1
  15. package/lib/aptos/builtin/0x1.js +348 -348
  16. package/lib/aptos/builtin/0x1.js.map +1 -1
  17. package/lib/aptos/builtin/0x3.d.ts +67 -66
  18. package/lib/aptos/builtin/0x3.d.ts.map +1 -1
  19. package/lib/aptos/builtin/0x3.js +28 -28
  20. package/lib/aptos/builtin/0x3.js.map +1 -1
  21. package/lib/aptos/builtin/0x4.d.ts +30 -29
  22. package/lib/aptos/builtin/0x4.d.ts.map +1 -1
  23. package/lib/aptos/builtin/0x4.js +34 -34
  24. package/lib/aptos/builtin/0x4.js.map +1 -1
  25. package/lib/aptos/codegen/codegen.js +19 -2
  26. package/lib/aptos/codegen/codegen.js.map +1 -1
  27. package/lib/aptos/data.d.ts +28 -3
  28. package/lib/aptos/data.d.ts.map +1 -1
  29. package/lib/aptos/data.js +61 -0
  30. package/lib/aptos/data.js.map +1 -1
  31. package/lib/aptos/models.d.ts +1 -5
  32. package/lib/aptos/models.d.ts.map +1 -1
  33. package/lib/btc/btc-plugin.d.ts +4 -1
  34. package/lib/btc/btc-plugin.d.ts.map +1 -1
  35. package/lib/btc/btc-plugin.js +27 -0
  36. package/lib/btc/btc-plugin.js.map +1 -1
  37. package/lib/btc/btc-processor.d.ts +6 -5
  38. package/lib/btc/btc-processor.d.ts.map +1 -1
  39. package/lib/btc/btc-processor.js +35 -9
  40. package/lib/btc/btc-processor.js.map +1 -1
  41. package/lib/btc/types.d.ts +2 -1
  42. package/lib/btc/types.d.ts.map +1 -1
  43. package/lib/core/handler-options.d.ts +25 -0
  44. package/lib/core/handler-options.d.ts.map +1 -0
  45. package/lib/core/handler-options.js +21 -0
  46. package/lib/core/handler-options.js.map +1 -0
  47. package/lib/core/index.d.ts +2 -0
  48. package/lib/core/index.d.ts.map +1 -1
  49. package/lib/core/index.js +2 -0
  50. package/lib/core/index.js.map +1 -1
  51. package/lib/core/partition-handler-manager.d.ts +44 -0
  52. package/lib/core/partition-handler-manager.d.ts.map +1 -0
  53. package/lib/core/partition-handler-manager.js +76 -0
  54. package/lib/core/partition-handler-manager.js.map +1 -0
  55. package/lib/cosmos/cosmos-processor.d.ts +3 -2
  56. package/lib/cosmos/cosmos-processor.d.ts.map +1 -1
  57. package/lib/cosmos/cosmos-processor.js +11 -1
  58. package/lib/cosmos/cosmos-processor.js.map +1 -1
  59. package/lib/cosmos/types.d.ts +1 -0
  60. package/lib/cosmos/types.d.ts.map +1 -1
  61. package/lib/eth/base-processor.d.ts +18 -17
  62. package/lib/eth/base-processor.d.ts.map +1 -1
  63. package/lib/eth/base-processor.js +147 -26
  64. package/lib/eth/base-processor.js.map +1 -1
  65. package/lib/eth/builtin/internal/eacaggregatorproxy-processor.d.ts +32 -31
  66. package/lib/eth/builtin/internal/eacaggregatorproxy-processor.d.ts.map +1 -1
  67. package/lib/eth/builtin/internal/eacaggregatorproxy-processor.js +62 -62
  68. package/lib/eth/builtin/internal/eacaggregatorproxy-processor.js.map +1 -1
  69. package/lib/eth/builtin/internal/erc1155-processor.d.ts +17 -16
  70. package/lib/eth/builtin/internal/erc1155-processor.d.ts.map +1 -1
  71. package/lib/eth/builtin/internal/erc1155-processor.js +32 -32
  72. package/lib/eth/builtin/internal/erc1155-processor.js.map +1 -1
  73. package/lib/eth/builtin/internal/erc20-processor.d.ts +25 -24
  74. package/lib/eth/builtin/internal/erc20-processor.d.ts.map +1 -1
  75. package/lib/eth/builtin/internal/erc20-processor.js +48 -48
  76. package/lib/eth/builtin/internal/erc20-processor.js.map +1 -1
  77. package/lib/eth/builtin/internal/erc20bytes-processor.d.ts +14 -13
  78. package/lib/eth/builtin/internal/erc20bytes-processor.d.ts.map +1 -1
  79. package/lib/eth/builtin/internal/erc20bytes-processor.js +26 -26
  80. package/lib/eth/builtin/internal/erc20bytes-processor.js.map +1 -1
  81. package/lib/eth/builtin/internal/erc721-processor.d.ts +21 -20
  82. package/lib/eth/builtin/internal/erc721-processor.d.ts.map +1 -1
  83. package/lib/eth/builtin/internal/erc721-processor.js +40 -40
  84. package/lib/eth/builtin/internal/erc721-processor.js.map +1 -1
  85. package/lib/eth/builtin/internal/weth9-processor.d.ts +20 -19
  86. package/lib/eth/builtin/internal/weth9-processor.d.ts.map +1 -1
  87. package/lib/eth/builtin/internal/weth9-processor.js +38 -38
  88. package/lib/eth/builtin/internal/weth9-processor.js.map +1 -1
  89. package/lib/eth/codegen/event-handler.js +2 -2
  90. package/lib/eth/codegen/event-handler.js.map +1 -1
  91. package/lib/eth/codegen/file.d.ts.map +1 -1
  92. package/lib/eth/codegen/file.js +1 -0
  93. package/lib/eth/codegen/file.js.map +1 -1
  94. package/lib/eth/codegen/functions-handler.js +2 -2
  95. package/lib/eth/codegen/functions-handler.js.map +1 -1
  96. package/lib/eth/eth-plugin.d.ts +4 -1
  97. package/lib/eth/eth-plugin.d.ts.map +1 -1
  98. package/lib/eth/eth-plugin.js +42 -1
  99. package/lib/eth/eth-plugin.js.map +1 -1
  100. package/lib/eth/eth.d.ts +2 -7
  101. package/lib/eth/eth.d.ts.map +1 -1
  102. package/lib/eth/eth.js +8 -1
  103. package/lib/eth/eth.js.map +1 -1
  104. package/lib/fuel/codegen/codegen.js +5 -5
  105. package/lib/fuel/codegen/codegen.js.map +1 -1
  106. package/lib/fuel/fuel-plugin.d.ts +4 -1
  107. package/lib/fuel/fuel-plugin.d.ts.map +1 -1
  108. package/lib/fuel/fuel-plugin.js +41 -0
  109. package/lib/fuel/fuel-plugin.js.map +1 -1
  110. package/lib/fuel/fuel-processor-template.d.ts +7 -4
  111. package/lib/fuel/fuel-processor-template.d.ts.map +1 -1
  112. package/lib/fuel/fuel-processor-template.js +11 -9
  113. package/lib/fuel/fuel-processor-template.js.map +1 -1
  114. package/lib/fuel/fuel-processor.d.ts +7 -7
  115. package/lib/fuel/fuel-processor.d.ts.map +1 -1
  116. package/lib/fuel/fuel-processor.js +90 -19
  117. package/lib/fuel/fuel-processor.js.map +1 -1
  118. package/lib/fuel/types.d.ts +3 -0
  119. package/lib/fuel/types.d.ts.map +1 -1
  120. package/lib/move/filter.d.ts +4 -0
  121. package/lib/move/filter.d.ts.map +1 -1
  122. package/lib/move/filter.js +4 -0
  123. package/lib/move/filter.js.map +1 -1
  124. package/lib/move/shared-network-codegen.js +5 -5
  125. package/lib/move/shared-network-codegen.js.map +1 -1
  126. package/lib/solana/solana-processor.d.ts +10 -4
  127. package/lib/solana/solana-processor.d.ts.map +1 -1
  128. package/lib/solana/solana-processor.js +13 -4
  129. package/lib/solana/solana-processor.js.map +1 -1
  130. package/lib/stark/starknet-processor.d.ts +3 -1
  131. package/lib/stark/starknet-processor.d.ts.map +1 -1
  132. package/lib/stark/starknet-processor.js +27 -2
  133. package/lib/stark/starknet-processor.js.map +1 -1
  134. package/lib/sui/builtin/0x1.d.ts +7 -6
  135. package/lib/sui/builtin/0x1.d.ts.map +1 -1
  136. package/lib/sui/builtin/0x1.js +12 -12
  137. package/lib/sui/builtin/0x1.js.map +1 -1
  138. package/lib/sui/builtin/0x2.d.ts +61 -60
  139. package/lib/sui/builtin/0x2.d.ts.map +1 -1
  140. package/lib/sui/builtin/0x2.js +120 -120
  141. package/lib/sui/builtin/0x2.js.map +1 -1
  142. package/lib/sui/builtin/0x3.d.ts +49 -48
  143. package/lib/sui/builtin/0x3.d.ts.map +1 -1
  144. package/lib/sui/builtin/0x3.js +96 -96
  145. package/lib/sui/builtin/0x3.js.map +1 -1
  146. package/lib/sui/models.d.ts +1 -5
  147. package/lib/sui/models.d.ts.map +1 -1
  148. package/lib/sui/sui-plugin.d.ts +6 -3
  149. package/lib/sui/sui-plugin.d.ts.map +1 -1
  150. package/lib/sui/sui-plugin.js +59 -20
  151. package/lib/sui/sui-plugin.js.map +1 -1
  152. package/lib/sui/sui-processor.d.ts +5 -4
  153. package/lib/sui/sui-processor.d.ts.map +1 -1
  154. package/lib/sui/sui-processor.js +47 -11
  155. package/lib/sui/sui-processor.js.map +1 -1
  156. package/package.json +3 -3
  157. package/src/aptos/aptos-plugin.ts +35 -39
  158. package/src/aptos/aptos-processor.ts +94 -54
  159. package/src/aptos/aptos-resource-processor-template.ts +9 -8
  160. package/src/aptos/builtin/0x1.ts +1407 -507
  161. package/src/aptos/builtin/0x3.ts +251 -80
  162. package/src/aptos/builtin/0x4.ts +112 -46
  163. package/src/aptos/codegen/codegen.ts +23 -2
  164. package/src/aptos/data.ts +78 -3
  165. package/src/aptos/models.ts +1 -6
  166. package/src/btc/btc-plugin.ts +38 -0
  167. package/src/btc/btc-processor.ts +35 -10
  168. package/src/btc/types.ts +2 -1
  169. package/src/core/handler-options.ts +40 -0
  170. package/src/core/index.ts +5 -0
  171. package/src/core/partition-handler-manager.ts +94 -0
  172. package/src/cosmos/cosmos-processor.ts +12 -1
  173. package/src/cosmos/types.ts +1 -0
  174. package/src/eth/base-processor.ts +139 -33
  175. package/src/eth/builtin/internal/eacaggregatorproxy-processor.ts +118 -62
  176. package/src/eth/builtin/internal/erc1155-processor.ts +76 -32
  177. package/src/eth/builtin/internal/erc20-processor.ts +79 -48
  178. package/src/eth/builtin/internal/erc20bytes-processor.ts +47 -26
  179. package/src/eth/builtin/internal/erc721-processor.ts +77 -40
  180. package/src/eth/builtin/internal/weth9-processor.ts +79 -38
  181. package/src/eth/codegen/event-handler.ts +2 -2
  182. package/src/eth/codegen/file.ts +1 -0
  183. package/src/eth/codegen/functions-handler.ts +2 -2
  184. package/src/eth/eth-plugin.ts +55 -3
  185. package/src/eth/eth.ts +12 -1
  186. package/src/fuel/codegen/codegen.ts +5 -5
  187. package/src/fuel/fuel-plugin.ts +56 -0
  188. package/src/fuel/fuel-processor-template.ts +17 -10
  189. package/src/fuel/fuel-processor.ts +89 -13
  190. package/src/fuel/types.ts +3 -0
  191. package/src/move/filter.ts +4 -0
  192. package/src/move/shared-network-codegen.ts +5 -5
  193. package/src/solana/solana-processor.ts +28 -6
  194. package/src/stark/starknet-processor.ts +28 -2
  195. package/src/sui/builtin/0x1.ts +22 -13
  196. package/src/sui/builtin/0x2.ts +220 -121
  197. package/src/sui/builtin/0x3.ts +241 -97
  198. package/src/sui/models.ts +1 -6
  199. package/src/sui/sui-plugin.ts +68 -22
  200. package/src/sui/sui-processor.ts +48 -11
@@ -5,12 +5,12 @@
5
5
  /* Generated types for 0x4, original address 0x4 */
6
6
 
7
7
  import { CallFilter, MoveFetchConfig, EventFilter } from "@sentio/sdk/move";
8
+ import { HandlerOptions } from "@sentio/sdk";
8
9
  import {
9
10
  AptosBindOptions,
10
11
  AptosBaseProcessor,
11
12
  AptosNetwork,
12
13
  TypedFunctionPayload,
13
- HandlerOptions,
14
14
  AptosContext,
15
15
  } from "@sentio/sdk/aptos";
16
16
 
@@ -46,7 +46,7 @@ export class token extends AptosBaseProcessor {
46
46
 
47
47
  onEventMutation(
48
48
  func: (event: token.MutationInstance, ctx: AptosContext) => void,
49
- handlerOptions?: HandlerOptions<token.MutationInstance>,
49
+ handlerOptions?: HandlerOptions<MoveFetchConfig, token.MutationInstance>,
50
50
  eventFilter?: Omit<EventFilter, "type" | "account">,
51
51
  ): token {
52
52
  this.onMoveEvent(
@@ -59,7 +59,10 @@ export class token extends AptosBaseProcessor {
59
59
 
60
60
  onEventMutationEvent(
61
61
  func: (event: token.MutationEventInstance, ctx: AptosContext) => void,
62
- handlerOptions?: HandlerOptions<token.MutationEventInstance>,
62
+ handlerOptions?: HandlerOptions<
63
+ MoveFetchConfig,
64
+ token.MutationEventInstance
65
+ >,
63
66
  eventFilter?: Omit<EventFilter, "type" | "account">,
64
67
  ): token {
65
68
  this.onMoveEvent(
@@ -447,7 +450,7 @@ export class collection extends AptosBaseProcessor {
447
450
 
448
451
  onEventBurn(
449
452
  func: (event: collection.BurnInstance, ctx: AptosContext) => void,
450
- handlerOptions?: HandlerOptions<collection.BurnInstance>,
453
+ handlerOptions?: HandlerOptions<MoveFetchConfig, collection.BurnInstance>,
451
454
  eventFilter?: Omit<EventFilter, "type" | "account">,
452
455
  ): collection {
453
456
  this.onMoveEvent(
@@ -460,7 +463,10 @@ export class collection extends AptosBaseProcessor {
460
463
 
461
464
  onEventBurnEvent(
462
465
  func: (event: collection.BurnEventInstance, ctx: AptosContext) => void,
463
- handlerOptions?: HandlerOptions<collection.BurnEventInstance>,
466
+ handlerOptions?: HandlerOptions<
467
+ MoveFetchConfig,
468
+ collection.BurnEventInstance
469
+ >,
464
470
  eventFilter?: Omit<EventFilter, "type" | "account">,
465
471
  ): collection {
466
472
  this.onMoveEvent(
@@ -476,7 +482,10 @@ export class collection extends AptosBaseProcessor {
476
482
  event: collection.ConcurrentBurnEventInstance,
477
483
  ctx: AptosContext,
478
484
  ) => void,
479
- handlerOptions?: HandlerOptions<collection.ConcurrentBurnEventInstance>,
485
+ handlerOptions?: HandlerOptions<
486
+ MoveFetchConfig,
487
+ collection.ConcurrentBurnEventInstance
488
+ >,
480
489
  eventFilter?: Omit<EventFilter, "type" | "account">,
481
490
  ): collection {
482
491
  this.onMoveEvent(
@@ -492,7 +501,10 @@ export class collection extends AptosBaseProcessor {
492
501
  event: collection.ConcurrentMintEventInstance,
493
502
  ctx: AptosContext,
494
503
  ) => void,
495
- handlerOptions?: HandlerOptions<collection.ConcurrentMintEventInstance>,
504
+ handlerOptions?: HandlerOptions<
505
+ MoveFetchConfig,
506
+ collection.ConcurrentMintEventInstance
507
+ >,
496
508
  eventFilter?: Omit<EventFilter, "type" | "account">,
497
509
  ): collection {
498
510
  this.onMoveEvent(
@@ -505,7 +517,7 @@ export class collection extends AptosBaseProcessor {
505
517
 
506
518
  onEventMint(
507
519
  func: (event: collection.MintInstance, ctx: AptosContext) => void,
508
- handlerOptions?: HandlerOptions<collection.MintInstance>,
520
+ handlerOptions?: HandlerOptions<MoveFetchConfig, collection.MintInstance>,
509
521
  eventFilter?: Omit<EventFilter, "type" | "account">,
510
522
  ): collection {
511
523
  this.onMoveEvent(
@@ -518,7 +530,10 @@ export class collection extends AptosBaseProcessor {
518
530
 
519
531
  onEventMintEvent(
520
532
  func: (event: collection.MintEventInstance, ctx: AptosContext) => void,
521
- handlerOptions?: HandlerOptions<collection.MintEventInstance>,
533
+ handlerOptions?: HandlerOptions<
534
+ MoveFetchConfig,
535
+ collection.MintEventInstance
536
+ >,
522
537
  eventFilter?: Omit<EventFilter, "type" | "account">,
523
538
  ): collection {
524
539
  this.onMoveEvent(
@@ -531,7 +546,10 @@ export class collection extends AptosBaseProcessor {
531
546
 
532
547
  onEventMutation(
533
548
  func: (event: collection.MutationInstance, ctx: AptosContext) => void,
534
- handlerOptions?: HandlerOptions<collection.MutationInstance>,
549
+ handlerOptions?: HandlerOptions<
550
+ MoveFetchConfig,
551
+ collection.MutationInstance
552
+ >,
535
553
  eventFilter?: Omit<EventFilter, "type" | "account">,
536
554
  ): collection {
537
555
  this.onMoveEvent(
@@ -544,7 +562,10 @@ export class collection extends AptosBaseProcessor {
544
562
 
545
563
  onEventMutationEvent(
546
564
  func: (event: collection.MutationEventInstance, ctx: AptosContext) => void,
547
- handlerOptions?: HandlerOptions<collection.MutationEventInstance>,
565
+ handlerOptions?: HandlerOptions<
566
+ MoveFetchConfig,
567
+ collection.MutationEventInstance
568
+ >,
548
569
  eventFilter?: Omit<EventFilter, "type" | "account">,
549
570
  ): collection {
550
571
  this.onMoveEvent(
@@ -557,7 +578,10 @@ export class collection extends AptosBaseProcessor {
557
578
 
558
579
  onEventSetMaxSupply(
559
580
  func: (event: collection.SetMaxSupplyInstance, ctx: AptosContext) => void,
560
- handlerOptions?: HandlerOptions<collection.SetMaxSupplyInstance>,
581
+ handlerOptions?: HandlerOptions<
582
+ MoveFetchConfig,
583
+ collection.SetMaxSupplyInstance
584
+ >,
561
585
  eventFilter?: Omit<EventFilter, "type" | "account">,
562
586
  ): collection {
563
587
  this.onMoveEvent(
@@ -976,7 +1000,7 @@ export class aptos_token extends AptosBaseProcessor {
976
1000
  onEntryBurn(
977
1001
  func: (call: aptos_token.BurnPayload, ctx: AptosContext) => void,
978
1002
  filter?: CallFilter,
979
- fetchConfig?: Partial<MoveFetchConfig>,
1003
+ handlerOptions?: HandlerOptions<MoveFetchConfig, aptos_token.BurnPayload>,
980
1004
  ): aptos_token {
981
1005
  this.onEntryFunctionCall(
982
1006
  func,
@@ -984,7 +1008,7 @@ export class aptos_token extends AptosBaseProcessor {
984
1008
  ...filter,
985
1009
  function: "aptos_token::burn",
986
1010
  },
987
- fetchConfig,
1011
+ handlerOptions,
988
1012
  );
989
1013
  return this;
990
1014
  }
@@ -992,7 +1016,7 @@ export class aptos_token extends AptosBaseProcessor {
992
1016
  onEntryMint(
993
1017
  func: (call: aptos_token.MintPayload, ctx: AptosContext) => void,
994
1018
  filter?: CallFilter,
995
- fetchConfig?: Partial<MoveFetchConfig>,
1019
+ handlerOptions?: HandlerOptions<MoveFetchConfig, aptos_token.MintPayload>,
996
1020
  ): aptos_token {
997
1021
  this.onEntryFunctionCall(
998
1022
  func,
@@ -1000,7 +1024,7 @@ export class aptos_token extends AptosBaseProcessor {
1000
1024
  ...filter,
1001
1025
  function: "aptos_token::mint",
1002
1026
  },
1003
- fetchConfig,
1027
+ handlerOptions,
1004
1028
  );
1005
1029
  return this;
1006
1030
  }
@@ -1008,7 +1032,10 @@ export class aptos_token extends AptosBaseProcessor {
1008
1032
  onEntrySetDescription(
1009
1033
  func: (call: aptos_token.SetDescriptionPayload, ctx: AptosContext) => void,
1010
1034
  filter?: CallFilter,
1011
- fetchConfig?: Partial<MoveFetchConfig>,
1035
+ handlerOptions?: HandlerOptions<
1036
+ MoveFetchConfig,
1037
+ aptos_token.SetDescriptionPayload
1038
+ >,
1012
1039
  ): aptos_token {
1013
1040
  this.onEntryFunctionCall(
1014
1041
  func,
@@ -1016,7 +1043,7 @@ export class aptos_token extends AptosBaseProcessor {
1016
1043
  ...filter,
1017
1044
  function: "aptos_token::set_description",
1018
1045
  },
1019
- fetchConfig,
1046
+ handlerOptions,
1020
1047
  );
1021
1048
  return this;
1022
1049
  }
@@ -1024,7 +1051,10 @@ export class aptos_token extends AptosBaseProcessor {
1024
1051
  onEntrySetName(
1025
1052
  func: (call: aptos_token.SetNamePayload, ctx: AptosContext) => void,
1026
1053
  filter?: CallFilter,
1027
- fetchConfig?: Partial<MoveFetchConfig>,
1054
+ handlerOptions?: HandlerOptions<
1055
+ MoveFetchConfig,
1056
+ aptos_token.SetNamePayload
1057
+ >,
1028
1058
  ): aptos_token {
1029
1059
  this.onEntryFunctionCall(
1030
1060
  func,
@@ -1032,7 +1062,7 @@ export class aptos_token extends AptosBaseProcessor {
1032
1062
  ...filter,
1033
1063
  function: "aptos_token::set_name",
1034
1064
  },
1035
- fetchConfig,
1065
+ handlerOptions,
1036
1066
  );
1037
1067
  return this;
1038
1068
  }
@@ -1040,7 +1070,7 @@ export class aptos_token extends AptosBaseProcessor {
1040
1070
  onEntrySetUri(
1041
1071
  func: (call: aptos_token.SetUriPayload, ctx: AptosContext) => void,
1042
1072
  filter?: CallFilter,
1043
- fetchConfig?: Partial<MoveFetchConfig>,
1073
+ handlerOptions?: HandlerOptions<MoveFetchConfig, aptos_token.SetUriPayload>,
1044
1074
  ): aptos_token {
1045
1075
  this.onEntryFunctionCall(
1046
1076
  func,
@@ -1048,7 +1078,7 @@ export class aptos_token extends AptosBaseProcessor {
1048
1078
  ...filter,
1049
1079
  function: "aptos_token::set_uri",
1050
1080
  },
1051
- fetchConfig,
1081
+ handlerOptions,
1052
1082
  );
1053
1083
  return this;
1054
1084
  }
@@ -1056,7 +1086,10 @@ export class aptos_token extends AptosBaseProcessor {
1056
1086
  onEntryAddProperty(
1057
1087
  func: (call: aptos_token.AddPropertyPayload, ctx: AptosContext) => void,
1058
1088
  filter?: CallFilter,
1059
- fetchConfig?: Partial<MoveFetchConfig>,
1089
+ handlerOptions?: HandlerOptions<
1090
+ MoveFetchConfig,
1091
+ aptos_token.AddPropertyPayload
1092
+ >,
1060
1093
  ): aptos_token {
1061
1094
  this.onEntryFunctionCall(
1062
1095
  func,
@@ -1064,7 +1097,7 @@ export class aptos_token extends AptosBaseProcessor {
1064
1097
  ...filter,
1065
1098
  function: "aptos_token::add_property",
1066
1099
  },
1067
- fetchConfig,
1100
+ handlerOptions,
1068
1101
  );
1069
1102
  return this;
1070
1103
  }
@@ -1075,7 +1108,10 @@ export class aptos_token extends AptosBaseProcessor {
1075
1108
  ctx: AptosContext,
1076
1109
  ) => void,
1077
1110
  filter?: CallFilter,
1078
- fetchConfig?: Partial<MoveFetchConfig>,
1111
+ handlerOptions?: HandlerOptions<
1112
+ MoveFetchConfig,
1113
+ aptos_token.AddTypedPropertyPayload
1114
+ >,
1079
1115
  ): aptos_token {
1080
1116
  this.onEntryFunctionCall(
1081
1117
  func,
@@ -1083,7 +1119,7 @@ export class aptos_token extends AptosBaseProcessor {
1083
1119
  ...filter,
1084
1120
  function: "aptos_token::add_typed_property",
1085
1121
  },
1086
- fetchConfig,
1122
+ handlerOptions,
1087
1123
  );
1088
1124
  return this;
1089
1125
  }
@@ -1094,7 +1130,10 @@ export class aptos_token extends AptosBaseProcessor {
1094
1130
  ctx: AptosContext,
1095
1131
  ) => void,
1096
1132
  filter?: CallFilter,
1097
- fetchConfig?: Partial<MoveFetchConfig>,
1133
+ handlerOptions?: HandlerOptions<
1134
+ MoveFetchConfig,
1135
+ aptos_token.CreateCollectionPayload
1136
+ >,
1098
1137
  ): aptos_token {
1099
1138
  this.onEntryFunctionCall(
1100
1139
  func,
@@ -1102,7 +1141,7 @@ export class aptos_token extends AptosBaseProcessor {
1102
1141
  ...filter,
1103
1142
  function: "aptos_token::create_collection",
1104
1143
  },
1105
- fetchConfig,
1144
+ handlerOptions,
1106
1145
  );
1107
1146
  return this;
1108
1147
  }
@@ -1110,7 +1149,10 @@ export class aptos_token extends AptosBaseProcessor {
1110
1149
  onEntryFreezeTransfer(
1111
1150
  func: (call: aptos_token.FreezeTransferPayload, ctx: AptosContext) => void,
1112
1151
  filter?: CallFilter,
1113
- fetchConfig?: Partial<MoveFetchConfig>,
1152
+ handlerOptions?: HandlerOptions<
1153
+ MoveFetchConfig,
1154
+ aptos_token.FreezeTransferPayload
1155
+ >,
1114
1156
  ): aptos_token {
1115
1157
  this.onEntryFunctionCall(
1116
1158
  func,
@@ -1118,7 +1160,7 @@ export class aptos_token extends AptosBaseProcessor {
1118
1160
  ...filter,
1119
1161
  function: "aptos_token::freeze_transfer",
1120
1162
  },
1121
- fetchConfig,
1163
+ handlerOptions,
1122
1164
  );
1123
1165
  return this;
1124
1166
  }
@@ -1126,7 +1168,10 @@ export class aptos_token extends AptosBaseProcessor {
1126
1168
  onEntryMintSoulBound(
1127
1169
  func: (call: aptos_token.MintSoulBoundPayload, ctx: AptosContext) => void,
1128
1170
  filter?: CallFilter,
1129
- fetchConfig?: Partial<MoveFetchConfig>,
1171
+ handlerOptions?: HandlerOptions<
1172
+ MoveFetchConfig,
1173
+ aptos_token.MintSoulBoundPayload
1174
+ >,
1130
1175
  ): aptos_token {
1131
1176
  this.onEntryFunctionCall(
1132
1177
  func,
@@ -1134,7 +1179,7 @@ export class aptos_token extends AptosBaseProcessor {
1134
1179
  ...filter,
1135
1180
  function: "aptos_token::mint_soul_bound",
1136
1181
  },
1137
- fetchConfig,
1182
+ handlerOptions,
1138
1183
  );
1139
1184
  return this;
1140
1185
  }
@@ -1142,7 +1187,10 @@ export class aptos_token extends AptosBaseProcessor {
1142
1187
  onEntryRemoveProperty(
1143
1188
  func: (call: aptos_token.RemovePropertyPayload, ctx: AptosContext) => void,
1144
1189
  filter?: CallFilter,
1145
- fetchConfig?: Partial<MoveFetchConfig>,
1190
+ handlerOptions?: HandlerOptions<
1191
+ MoveFetchConfig,
1192
+ aptos_token.RemovePropertyPayload
1193
+ >,
1146
1194
  ): aptos_token {
1147
1195
  this.onEntryFunctionCall(
1148
1196
  func,
@@ -1150,7 +1198,7 @@ export class aptos_token extends AptosBaseProcessor {
1150
1198
  ...filter,
1151
1199
  function: "aptos_token::remove_property",
1152
1200
  },
1153
- fetchConfig,
1201
+ handlerOptions,
1154
1202
  );
1155
1203
  return this;
1156
1204
  }
@@ -1161,7 +1209,10 @@ export class aptos_token extends AptosBaseProcessor {
1161
1209
  ctx: AptosContext,
1162
1210
  ) => void,
1163
1211
  filter?: CallFilter,
1164
- fetchConfig?: Partial<MoveFetchConfig>,
1212
+ handlerOptions?: HandlerOptions<
1213
+ MoveFetchConfig,
1214
+ aptos_token.SetCollectionDescriptionPayload
1215
+ >,
1165
1216
  ): aptos_token {
1166
1217
  this.onEntryFunctionCall(
1167
1218
  func,
@@ -1169,7 +1220,7 @@ export class aptos_token extends AptosBaseProcessor {
1169
1220
  ...filter,
1170
1221
  function: "aptos_token::set_collection_description",
1171
1222
  },
1172
- fetchConfig,
1223
+ handlerOptions,
1173
1224
  );
1174
1225
  return this;
1175
1226
  }
@@ -1180,7 +1231,10 @@ export class aptos_token extends AptosBaseProcessor {
1180
1231
  ctx: AptosContext,
1181
1232
  ) => void,
1182
1233
  filter?: CallFilter,
1183
- fetchConfig?: Partial<MoveFetchConfig>,
1234
+ handlerOptions?: HandlerOptions<
1235
+ MoveFetchConfig,
1236
+ aptos_token.SetCollectionRoyaltiesCallPayload
1237
+ >,
1184
1238
  ): aptos_token {
1185
1239
  this.onEntryFunctionCall(
1186
1240
  func,
@@ -1188,7 +1242,7 @@ export class aptos_token extends AptosBaseProcessor {
1188
1242
  ...filter,
1189
1243
  function: "aptos_token::set_collection_royalties_call",
1190
1244
  },
1191
- fetchConfig,
1245
+ handlerOptions,
1192
1246
  );
1193
1247
  return this;
1194
1248
  }
@@ -1199,7 +1253,10 @@ export class aptos_token extends AptosBaseProcessor {
1199
1253
  ctx: AptosContext,
1200
1254
  ) => void,
1201
1255
  filter?: CallFilter,
1202
- fetchConfig?: Partial<MoveFetchConfig>,
1256
+ handlerOptions?: HandlerOptions<
1257
+ MoveFetchConfig,
1258
+ aptos_token.SetCollectionUriPayload
1259
+ >,
1203
1260
  ): aptos_token {
1204
1261
  this.onEntryFunctionCall(
1205
1262
  func,
@@ -1207,7 +1264,7 @@ export class aptos_token extends AptosBaseProcessor {
1207
1264
  ...filter,
1208
1265
  function: "aptos_token::set_collection_uri",
1209
1266
  },
1210
- fetchConfig,
1267
+ handlerOptions,
1211
1268
  );
1212
1269
  return this;
1213
1270
  }
@@ -1218,7 +1275,10 @@ export class aptos_token extends AptosBaseProcessor {
1218
1275
  ctx: AptosContext,
1219
1276
  ) => void,
1220
1277
  filter?: CallFilter,
1221
- fetchConfig?: Partial<MoveFetchConfig>,
1278
+ handlerOptions?: HandlerOptions<
1279
+ MoveFetchConfig,
1280
+ aptos_token.UnfreezeTransferPayload
1281
+ >,
1222
1282
  ): aptos_token {
1223
1283
  this.onEntryFunctionCall(
1224
1284
  func,
@@ -1226,7 +1286,7 @@ export class aptos_token extends AptosBaseProcessor {
1226
1286
  ...filter,
1227
1287
  function: "aptos_token::unfreeze_transfer",
1228
1288
  },
1229
- fetchConfig,
1289
+ handlerOptions,
1230
1290
  );
1231
1291
  return this;
1232
1292
  }
@@ -1234,7 +1294,10 @@ export class aptos_token extends AptosBaseProcessor {
1234
1294
  onEntryUpdateProperty(
1235
1295
  func: (call: aptos_token.UpdatePropertyPayload, ctx: AptosContext) => void,
1236
1296
  filter?: CallFilter,
1237
- fetchConfig?: Partial<MoveFetchConfig>,
1297
+ handlerOptions?: HandlerOptions<
1298
+ MoveFetchConfig,
1299
+ aptos_token.UpdatePropertyPayload
1300
+ >,
1238
1301
  ): aptos_token {
1239
1302
  this.onEntryFunctionCall(
1240
1303
  func,
@@ -1242,7 +1305,7 @@ export class aptos_token extends AptosBaseProcessor {
1242
1305
  ...filter,
1243
1306
  function: "aptos_token::update_property",
1244
1307
  },
1245
- fetchConfig,
1308
+ handlerOptions,
1246
1309
  );
1247
1310
  return this;
1248
1311
  }
@@ -1253,7 +1316,10 @@ export class aptos_token extends AptosBaseProcessor {
1253
1316
  ctx: AptosContext,
1254
1317
  ) => void,
1255
1318
  filter?: CallFilter,
1256
- fetchConfig?: Partial<MoveFetchConfig>,
1319
+ handlerOptions?: HandlerOptions<
1320
+ MoveFetchConfig,
1321
+ aptos_token.UpdateTypedPropertyPayload
1322
+ >,
1257
1323
  ): aptos_token {
1258
1324
  this.onEntryFunctionCall(
1259
1325
  func,
@@ -1261,7 +1327,7 @@ export class aptos_token extends AptosBaseProcessor {
1261
1327
  ...filter,
1262
1328
  function: "aptos_token::update_typed_property",
1263
1329
  },
1264
- fetchConfig,
1330
+ handlerOptions,
1265
1331
  );
1266
1332
  return this;
1267
1333
  }
@@ -2,7 +2,7 @@ import * as fs from 'fs'
2
2
  import chalk from 'chalk'
3
3
  import path, { join } from 'path'
4
4
  import { AptosCodegen as BaseAptosCodegen } from '@typemove/aptos/codegen'
5
- import { InternalMoveModule, InternalMoveStruct, normalizeToJSName } from '@typemove/move'
5
+ import { InternalMoveModule, InternalMoveStruct, normalizeToJSName, camel, upperFirst } from '@typemove/move'
6
6
  import { AptosNetwork, getRpcEndpoint } from '../network.js'
7
7
  import { Event, MoveModuleBytecode, MoveResource } from '@aptos-labs/ts-sdk'
8
8
  import { SharedNetworkCodegen } from '../../move/shared-network-codegen.js'
@@ -54,12 +54,33 @@ class AptosNetworkCodegen extends BaseAptosCodegen {
54
54
  const source = `
55
55
  onEvent${struct.name}(func: (event: ${moduleName}.${normalizeToJSName(struct.name)}Instance, ctx: ${
56
56
  this.PREFIX
57
- }Context) => void, handlerOptions?: HandlerOptions<${moduleName}.${normalizeToJSName(struct.name)}Instance>, eventFilter?: Omit<EventFilter, "type"|"account">): ${moduleName} {
57
+ }Context) => void, handlerOptions?: HandlerOptions<MoveFetchConfig, ${moduleName}.${normalizeToJSName(struct.name)}Instance>, eventFilter?: Omit<EventFilter, "type"|"account">): ${moduleName} {
58
58
  this.onMoveEvent(func, {...eventFilter ?? {}, type: '${module.name}::${struct.name}' }, handlerOptions)
59
59
  return this
60
60
  }`
61
61
  return source
62
62
  }
63
+
64
+ generateForEntryFunctions(module: InternalMoveModule, func: any): string {
65
+ if (!func.isEntry) {
66
+ return ''
67
+ }
68
+
69
+ const moduleName = normalizeToJSName(module.name)
70
+ const camelFuncName = upperFirst(camel(func.name))
71
+
72
+ const source = `
73
+ onEntry${camelFuncName}(func: (call: ${moduleName}.${camelFuncName}Payload, ctx: ${this.PREFIX}Context) => void, filter?: CallFilter, handlerOptions?: HandlerOptions<MoveFetchConfig, ${moduleName}.${camelFuncName}Payload>): ${moduleName} {
74
+ this.onEntryFunctionCall(func, {
75
+ ...filter,
76
+ function: '${module.name}::${func.name}'
77
+ },
78
+ handlerOptions)
79
+ return this
80
+ }`
81
+
82
+ return source
83
+ }
63
84
  })(network, this.chainAdapter)
64
85
  }
65
86
 
package/src/aptos/data.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { Data_AptEvent } from '@sentio/protos'
2
- import { UserTransactionResponse } from '@aptos-labs/ts-sdk'
3
- import { MoveCoder } from '@typemove/aptos'
1
+ import { Data_AptEvent, Data_AptCall, Data_AptResource } from '@sentio/protos'
2
+ import { UserTransactionResponse, MoveResource } from '@aptos-labs/ts-sdk'
3
+ import { MoveCoder, decodeResourceChange, ResourceChange } from '@typemove/aptos'
4
4
 
5
5
  type Data_AptEvent_Ext = Data_AptEvent & {
6
6
  _tx?: UserTransactionResponse
@@ -8,6 +8,16 @@ type Data_AptEvent_Ext = Data_AptEvent & {
8
8
  _decodedEvent?: any
9
9
  }
10
10
 
11
+ type Data_AptCall_Ext = Data_AptCall & {
12
+ _tx?: UserTransactionResponse
13
+ _decodedCall?: any
14
+ }
15
+
16
+ type Data_AptResource_Ext = Data_AptResource & {
17
+ _resources?: MoveResource[]
18
+ _decodedResources?: ResourceChange<any>[]
19
+ }
20
+
11
21
  export class AptEvent implements Data_AptEvent {
12
22
  constructor(readonly data: Data_AptEvent_Ext) {}
13
23
 
@@ -46,3 +56,68 @@ export class AptEvent implements Data_AptEvent {
46
56
  return this.data._decodedEvent
47
57
  }
48
58
  }
59
+
60
+ export class AptCall implements Data_AptCall {
61
+ constructor(readonly data: Data_AptCall_Ext) {}
62
+
63
+ get rawTransaction(): string {
64
+ return this.data.rawTransaction
65
+ }
66
+
67
+ get transaction() {
68
+ if (!this.data._tx) {
69
+ this.data._tx = JSON.parse(this.data.rawTransaction) as UserTransactionResponse
70
+ if (this.data._tx.events == null) {
71
+ this.data._tx.events = []
72
+ }
73
+ }
74
+ return this.data._tx
75
+ }
76
+
77
+ async decodeCall(coder: MoveCoder) {
78
+ if (!this.data._decodedCall) {
79
+ const tx = this.transaction
80
+ let payload = tx.payload
81
+ if (payload.type === 'multisig_payload') {
82
+ payload = (payload as any).transaction_payload ?? payload
83
+ }
84
+ this.data._decodedCall = await coder.decodeFunctionPayload(payload as any)
85
+ return this.data._decodedCall
86
+ }
87
+ return this.data._decodedCall
88
+ }
89
+ }
90
+
91
+ export class AptResource implements Data_AptResource {
92
+ constructor(readonly data: Data_AptResource_Ext) {}
93
+
94
+ get version(): bigint {
95
+ return this.data.version
96
+ }
97
+
98
+ get timestampMicros(): bigint {
99
+ return this.data.timestampMicros
100
+ }
101
+
102
+ get rawResources(): string[] {
103
+ return this.data.rawResources
104
+ }
105
+
106
+ get resources(): MoveResource[] {
107
+ if (!this.data._resources) {
108
+ this.data._resources = this.data.rawResources.map((r) => JSON.parse(r) as MoveResource)
109
+ }
110
+ return this.data._resources
111
+ }
112
+
113
+ get timestamp(): Date {
114
+ return new Date(Number(this.data.timestampMicros) / 1000)
115
+ }
116
+
117
+ async decodeResources<T>(coder: MoveCoder): Promise<ResourceChange<T>[]> {
118
+ if (!this.data._decodedResources) {
119
+ this.data._decodedResources = await decodeResourceChange<T>(this.resources, coder)
120
+ }
121
+ return this.data._decodedResources as ResourceChange<T>[]
122
+ }
123
+ }
@@ -9,7 +9,6 @@ import {
9
9
  ValidatorTransactionResponse,
10
10
  BlockEpilogueTransactionResponse
11
11
  } from '@aptos-labs/ts-sdk'
12
- import { MoveFetchConfig } from '@sentio/protos'
13
12
 
14
13
  export type GeneralTransactionResponse =
15
14
  | UserTransactionResponse
@@ -29,8 +28,4 @@ export type TypedFunctionPayload<T extends Array<any>> = EntryFunctionPayloadRes
29
28
  arguments_decoded: T
30
29
  }
31
30
 
32
- export type PartitionHandler<D> = (data: D) => string | Promise<string>
33
-
34
- export type HandlerOptions<D> = Partial<MoveFetchConfig> & {
35
- partitionKey?: string | PartitionHandler<D>
36
- }
31
+ export type { PartitionHandler, HandlerOptions } from '../core/index.js'