@sentio/sdk 2.12.3 → 2.13.0-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/lib/aptos/aptos-processor.d.ts +3 -3
  2. package/lib/aptos/aptos-processor.js +17 -12
  3. package/lib/aptos/aptos-processor.js.map +1 -1
  4. package/lib/aptos/builtin/0x1.d.ts +168 -168
  5. package/lib/aptos/builtin/0x1.js.map +1 -1
  6. package/lib/aptos/builtin/0x3.d.ts +35 -35
  7. package/lib/aptos/builtin/0x3.js.map +1 -1
  8. package/lib/aptos/context.d.ts +2 -1
  9. package/lib/aptos/context.js +4 -2
  10. package/lib/aptos/context.js.map +1 -1
  11. package/lib/move/abstract-codegen.js +2 -2
  12. package/lib/move/abstract-codegen.js.map +1 -1
  13. package/lib/sui/builtin/0x1.d.ts +6 -6
  14. package/lib/sui/builtin/0x1.js.map +1 -1
  15. package/lib/sui/builtin/0x2.d.ts +43 -43
  16. package/lib/sui/builtin/0x2.js.map +1 -1
  17. package/lib/sui/builtin/0x3.d.ts +43 -43
  18. package/lib/sui/builtin/0x3.js.map +1 -1
  19. package/lib/sui/context.d.ts +2 -1
  20. package/lib/sui/context.js +3 -1
  21. package/lib/sui/context.js.map +1 -1
  22. package/lib/sui/sui-processor.d.ts +2 -2
  23. package/lib/sui/sui-processor.js +15 -12
  24. package/lib/sui/sui-processor.js.map +1 -1
  25. package/lib/testing/aptos-facet.d.ts +2 -2
  26. package/lib/testing/aptos-facet.js +14 -21
  27. package/lib/testing/aptos-facet.js.map +1 -1
  28. package/lib/testing/sui-facet.d.ts +2 -2
  29. package/lib/testing/sui-facet.js +16 -26
  30. package/lib/testing/sui-facet.js.map +1 -1
  31. package/package.json +4 -4
  32. package/src/aptos/aptos-processor.ts +30 -23
  33. package/src/aptos/builtin/0x1.ts +168 -168
  34. package/src/aptos/builtin/0x3.ts +35 -35
  35. package/src/aptos/context.ts +5 -2
  36. package/src/move/abstract-codegen.ts +2 -2
  37. package/src/sui/builtin/0x1.ts +6 -6
  38. package/src/sui/builtin/0x2.ts +43 -43
  39. package/src/sui/builtin/0x3.ts +43 -43
  40. package/src/sui/context.ts +4 -1
  41. package/src/sui/sui-processor.ts +27 -22
  42. package/src/testing/aptos-facet.ts +13 -27
  43. package/src/testing/sui-facet.ts +15 -30
@@ -36,7 +36,7 @@ export class token extends AptosBaseProcessor {
36
36
  onEntryBurn(
37
37
  func: (call: token.BurnPayload, ctx: AptosContext) => void,
38
38
  filter?: CallFilter,
39
- fetchConfig?: MoveFetchConfig
39
+ fetchConfig?: Partial<MoveFetchConfig>
40
40
  ): token {
41
41
  this.onEntryFunctionCall(
42
42
  func,
@@ -52,7 +52,7 @@ export class token extends AptosBaseProcessor {
52
52
  onEntryBurnByCreator(
53
53
  func: (call: token.BurnByCreatorPayload, ctx: AptosContext) => void,
54
54
  filter?: CallFilter,
55
- fetchConfig?: MoveFetchConfig
55
+ fetchConfig?: Partial<MoveFetchConfig>
56
56
  ): token {
57
57
  this.onEntryFunctionCall(
58
58
  func,
@@ -71,7 +71,7 @@ export class token extends AptosBaseProcessor {
71
71
  ctx: AptosContext
72
72
  ) => void,
73
73
  filter?: CallFilter,
74
- fetchConfig?: MoveFetchConfig
74
+ fetchConfig?: Partial<MoveFetchConfig>
75
75
  ): token {
76
76
  this.onEntryFunctionCall(
77
77
  func,
@@ -87,7 +87,7 @@ export class token extends AptosBaseProcessor {
87
87
  onEntryCreateTokenScript(
88
88
  func: (call: token.CreateTokenScriptPayload, ctx: AptosContext) => void,
89
89
  filter?: CallFilter,
90
- fetchConfig?: MoveFetchConfig
90
+ fetchConfig?: Partial<MoveFetchConfig>
91
91
  ): token {
92
92
  this.onEntryFunctionCall(
93
93
  func,
@@ -103,7 +103,7 @@ export class token extends AptosBaseProcessor {
103
103
  onEntryDirectTransferScript(
104
104
  func: (call: token.DirectTransferScriptPayload, ctx: AptosContext) => void,
105
105
  filter?: CallFilter,
106
- fetchConfig?: MoveFetchConfig
106
+ fetchConfig?: Partial<MoveFetchConfig>
107
107
  ): token {
108
108
  this.onEntryFunctionCall(
109
109
  func,
@@ -119,7 +119,7 @@ export class token extends AptosBaseProcessor {
119
119
  onEntryInitializeTokenScript(
120
120
  func: (call: token.InitializeTokenScriptPayload, ctx: AptosContext) => void,
121
121
  filter?: CallFilter,
122
- fetchConfig?: MoveFetchConfig
122
+ fetchConfig?: Partial<MoveFetchConfig>
123
123
  ): token {
124
124
  this.onEntryFunctionCall(
125
125
  func,
@@ -135,7 +135,7 @@ export class token extends AptosBaseProcessor {
135
135
  onEntryMintScript(
136
136
  func: (call: token.MintScriptPayload, ctx: AptosContext) => void,
137
137
  filter?: CallFilter,
138
- fetchConfig?: MoveFetchConfig
138
+ fetchConfig?: Partial<MoveFetchConfig>
139
139
  ): token {
140
140
  this.onEntryFunctionCall(
141
141
  func,
@@ -151,7 +151,7 @@ export class token extends AptosBaseProcessor {
151
151
  onEntryMutateTokenProperties(
152
152
  func: (call: token.MutateTokenPropertiesPayload, ctx: AptosContext) => void,
153
153
  filter?: CallFilter,
154
- fetchConfig?: MoveFetchConfig
154
+ fetchConfig?: Partial<MoveFetchConfig>
155
155
  ): token {
156
156
  this.onEntryFunctionCall(
157
157
  func,
@@ -167,7 +167,7 @@ export class token extends AptosBaseProcessor {
167
167
  onEntryOptInDirectTransfer(
168
168
  func: (call: token.OptInDirectTransferPayload, ctx: AptosContext) => void,
169
169
  filter?: CallFilter,
170
- fetchConfig?: MoveFetchConfig
170
+ fetchConfig?: Partial<MoveFetchConfig>
171
171
  ): token {
172
172
  this.onEntryFunctionCall(
173
173
  func,
@@ -183,7 +183,7 @@ export class token extends AptosBaseProcessor {
183
183
  onEntryTransferWithOptIn(
184
184
  func: (call: token.TransferWithOptInPayload, ctx: AptosContext) => void,
185
185
  filter?: CallFilter,
186
- fetchConfig?: MoveFetchConfig
186
+ fetchConfig?: Partial<MoveFetchConfig>
187
187
  ): token {
188
188
  this.onEntryFunctionCall(
189
189
  func,
@@ -201,7 +201,7 @@ export class token extends AptosBaseProcessor {
201
201
  event: token.CreateCollectionEventInstance,
202
202
  ctx: AptosContext
203
203
  ) => void,
204
- fetchConfig?: MoveFetchConfig
204
+ fetchConfig?: Partial<MoveFetchConfig>
205
205
  ): token {
206
206
  this.onMoveEvent(
207
207
  func,
@@ -218,7 +218,7 @@ export class token extends AptosBaseProcessor {
218
218
  event: token.CreateTokenDataEventInstance,
219
219
  ctx: AptosContext
220
220
  ) => void,
221
- fetchConfig?: MoveFetchConfig
221
+ fetchConfig?: Partial<MoveFetchConfig>
222
222
  ): token {
223
223
  this.onMoveEvent(
224
224
  func,
@@ -232,7 +232,7 @@ export class token extends AptosBaseProcessor {
232
232
 
233
233
  onEventMintTokenEvent(
234
234
  func: (event: token.MintTokenEventInstance, ctx: AptosContext) => void,
235
- fetchConfig?: MoveFetchConfig
235
+ fetchConfig?: Partial<MoveFetchConfig>
236
236
  ): token {
237
237
  this.onMoveEvent(
238
238
  func,
@@ -246,7 +246,7 @@ export class token extends AptosBaseProcessor {
246
246
 
247
247
  onEventDepositEvent(
248
248
  func: (event: token.DepositEventInstance, ctx: AptosContext) => void,
249
- fetchConfig?: MoveFetchConfig
249
+ fetchConfig?: Partial<MoveFetchConfig>
250
250
  ): token {
251
251
  this.onMoveEvent(
252
252
  func,
@@ -260,7 +260,7 @@ export class token extends AptosBaseProcessor {
260
260
 
261
261
  onEventWithdrawEvent(
262
262
  func: (event: token.WithdrawEventInstance, ctx: AptosContext) => void,
263
- fetchConfig?: MoveFetchConfig
263
+ fetchConfig?: Partial<MoveFetchConfig>
264
264
  ): token {
265
265
  this.onMoveEvent(
266
266
  func,
@@ -274,7 +274,7 @@ export class token extends AptosBaseProcessor {
274
274
 
275
275
  onEventBurnTokenEvent(
276
276
  func: (event: token.BurnTokenEventInstance, ctx: AptosContext) => void,
277
- fetchConfig?: MoveFetchConfig
277
+ fetchConfig?: Partial<MoveFetchConfig>
278
278
  ): token {
279
279
  this.onMoveEvent(
280
280
  func,
@@ -291,7 +291,7 @@ export class token extends AptosBaseProcessor {
291
291
  event: token.MutateTokenPropertyMapEventInstance,
292
292
  ctx: AptosContext
293
293
  ) => void,
294
- fetchConfig?: MoveFetchConfig
294
+ fetchConfig?: Partial<MoveFetchConfig>
295
295
  ): token {
296
296
  this.onMoveEvent(
297
297
  func,
@@ -650,7 +650,7 @@ export class token_coin_swap extends AptosBaseProcessor {
650
650
  ctx: AptosContext
651
651
  ) => void,
652
652
  filter?: CallFilter,
653
- fetchConfig?: MoveFetchConfig
653
+ fetchConfig?: Partial<MoveFetchConfig>
654
654
  ): token_coin_swap {
655
655
  this.onEntryFunctionCall(
656
656
  func,
@@ -668,7 +668,7 @@ export class token_coin_swap extends AptosBaseProcessor {
668
668
  event: token_coin_swap.TokenListingEventInstance,
669
669
  ctx: AptosContext
670
670
  ) => void,
671
- fetchConfig?: MoveFetchConfig
671
+ fetchConfig?: Partial<MoveFetchConfig>
672
672
  ): token_coin_swap {
673
673
  this.onMoveEvent(
674
674
  func,
@@ -685,7 +685,7 @@ export class token_coin_swap extends AptosBaseProcessor {
685
685
  event: token_coin_swap.TokenSwapEventInstance,
686
686
  ctx: AptosContext
687
687
  ) => void,
688
- fetchConfig?: MoveFetchConfig
688
+ fetchConfig?: Partial<MoveFetchConfig>
689
689
  ): token_coin_swap {
690
690
  this.onMoveEvent(
691
691
  func,
@@ -795,7 +795,7 @@ export class token_transfers extends AptosBaseProcessor {
795
795
  ctx: AptosContext
796
796
  ) => void,
797
797
  filter?: CallFilter,
798
- fetchConfig?: MoveFetchConfig
798
+ fetchConfig?: Partial<MoveFetchConfig>
799
799
  ): token_transfers {
800
800
  this.onEntryFunctionCall(
801
801
  func,
@@ -811,7 +811,7 @@ export class token_transfers extends AptosBaseProcessor {
811
811
  onEntryClaimScript(
812
812
  func: (call: token_transfers.ClaimScriptPayload, ctx: AptosContext) => void,
813
813
  filter?: CallFilter,
814
- fetchConfig?: MoveFetchConfig
814
+ fetchConfig?: Partial<MoveFetchConfig>
815
815
  ): token_transfers {
816
816
  this.onEntryFunctionCall(
817
817
  func,
@@ -827,7 +827,7 @@ export class token_transfers extends AptosBaseProcessor {
827
827
  onEntryOfferScript(
828
828
  func: (call: token_transfers.OfferScriptPayload, ctx: AptosContext) => void,
829
829
  filter?: CallFilter,
830
- fetchConfig?: MoveFetchConfig
830
+ fetchConfig?: Partial<MoveFetchConfig>
831
831
  ): token_transfers {
832
832
  this.onEntryFunctionCall(
833
833
  func,
@@ -845,7 +845,7 @@ export class token_transfers extends AptosBaseProcessor {
845
845
  event: token_transfers.TokenOfferEventInstance,
846
846
  ctx: AptosContext
847
847
  ) => void,
848
- fetchConfig?: MoveFetchConfig
848
+ fetchConfig?: Partial<MoveFetchConfig>
849
849
  ): token_transfers {
850
850
  this.onMoveEvent(
851
851
  func,
@@ -862,7 +862,7 @@ export class token_transfers extends AptosBaseProcessor {
862
862
  event: token_transfers.TokenCancelOfferEventInstance,
863
863
  ctx: AptosContext
864
864
  ) => void,
865
- fetchConfig?: MoveFetchConfig
865
+ fetchConfig?: Partial<MoveFetchConfig>
866
866
  ): token_transfers {
867
867
  this.onMoveEvent(
868
868
  func,
@@ -879,7 +879,7 @@ export class token_transfers extends AptosBaseProcessor {
879
879
  event: token_transfers.TokenClaimEventInstance,
880
880
  ctx: AptosContext
881
881
  ) => void,
882
- fetchConfig?: MoveFetchConfig
882
+ fetchConfig?: Partial<MoveFetchConfig>
883
883
  ): token_transfers {
884
884
  this.onMoveEvent(
885
885
  func,
@@ -1000,7 +1000,7 @@ export class token_event_store extends AptosBaseProcessor {
1000
1000
  event: token_event_store.CollectionUriMutateEventInstance,
1001
1001
  ctx: AptosContext
1002
1002
  ) => void,
1003
- fetchConfig?: MoveFetchConfig
1003
+ fetchConfig?: Partial<MoveFetchConfig>
1004
1004
  ): token_event_store {
1005
1005
  this.onMoveEvent(
1006
1006
  func,
@@ -1017,7 +1017,7 @@ export class token_event_store extends AptosBaseProcessor {
1017
1017
  event: token_event_store.CollectionMaxiumMutateEventInstance,
1018
1018
  ctx: AptosContext
1019
1019
  ) => void,
1020
- fetchConfig?: MoveFetchConfig
1020
+ fetchConfig?: Partial<MoveFetchConfig>
1021
1021
  ): token_event_store {
1022
1022
  this.onMoveEvent(
1023
1023
  func,
@@ -1034,7 +1034,7 @@ export class token_event_store extends AptosBaseProcessor {
1034
1034
  event: token_event_store.CollectionDescriptionMutateEventInstance,
1035
1035
  ctx: AptosContext
1036
1036
  ) => void,
1037
- fetchConfig?: MoveFetchConfig
1037
+ fetchConfig?: Partial<MoveFetchConfig>
1038
1038
  ): token_event_store {
1039
1039
  this.onMoveEvent(
1040
1040
  func,
@@ -1051,7 +1051,7 @@ export class token_event_store extends AptosBaseProcessor {
1051
1051
  event: token_event_store.OptInTransferEventInstance,
1052
1052
  ctx: AptosContext
1053
1053
  ) => void,
1054
- fetchConfig?: MoveFetchConfig
1054
+ fetchConfig?: Partial<MoveFetchConfig>
1055
1055
  ): token_event_store {
1056
1056
  this.onMoveEvent(
1057
1057
  func,
@@ -1068,7 +1068,7 @@ export class token_event_store extends AptosBaseProcessor {
1068
1068
  event: token_event_store.UriMutationEventInstance,
1069
1069
  ctx: AptosContext
1070
1070
  ) => void,
1071
- fetchConfig?: MoveFetchConfig
1071
+ fetchConfig?: Partial<MoveFetchConfig>
1072
1072
  ): token_event_store {
1073
1073
  this.onMoveEvent(
1074
1074
  func,
@@ -1085,7 +1085,7 @@ export class token_event_store extends AptosBaseProcessor {
1085
1085
  event: token_event_store.DefaultPropertyMutateEventInstance,
1086
1086
  ctx: AptosContext
1087
1087
  ) => void,
1088
- fetchConfig?: MoveFetchConfig
1088
+ fetchConfig?: Partial<MoveFetchConfig>
1089
1089
  ): token_event_store {
1090
1090
  this.onMoveEvent(
1091
1091
  func,
@@ -1102,7 +1102,7 @@ export class token_event_store extends AptosBaseProcessor {
1102
1102
  event: token_event_store.DescriptionMutateEventInstance,
1103
1103
  ctx: AptosContext
1104
1104
  ) => void,
1105
- fetchConfig?: MoveFetchConfig
1105
+ fetchConfig?: Partial<MoveFetchConfig>
1106
1106
  ): token_event_store {
1107
1107
  this.onMoveEvent(
1108
1108
  func,
@@ -1119,7 +1119,7 @@ export class token_event_store extends AptosBaseProcessor {
1119
1119
  event: token_event_store.RoyaltyMutateEventInstance,
1120
1120
  ctx: AptosContext
1121
1121
  ) => void,
1122
- fetchConfig?: MoveFetchConfig
1122
+ fetchConfig?: Partial<MoveFetchConfig>
1123
1123
  ): token_event_store {
1124
1124
  this.onMoveEvent(
1125
1125
  func,
@@ -1136,7 +1136,7 @@ export class token_event_store extends AptosBaseProcessor {
1136
1136
  event: token_event_store.MaxiumMutateEventInstance,
1137
1137
  ctx: AptosContext
1138
1138
  ) => void,
1139
- fetchConfig?: MoveFetchConfig
1139
+ fetchConfig?: Partial<MoveFetchConfig>
1140
1140
  ): token_event_store {
1141
1141
  this.onMoveEvent(
1142
1142
  func,
@@ -9,19 +9,22 @@ export class AptosContext extends BaseContext {
9
9
  moduleName: string
10
10
  version: bigint
11
11
  transaction: Transaction_UserTransaction
12
+ eventIndex: number
12
13
 
13
14
  constructor(
14
15
  moduleName: string,
15
16
  network: AptosNetwork,
16
17
  address: string,
17
18
  version: bigint,
18
- transaction?: Transaction_UserTransaction
19
+ transaction: Transaction_UserTransaction,
20
+ eventIndex: number
19
21
  ) {
20
22
  super()
21
23
  this.address = address.toLowerCase()
22
24
  this.network = network
23
25
  this.moduleName = moduleName
24
26
  this.version = version
27
+ this.eventIndex = eventIndex
25
28
  if (transaction) {
26
29
  this.transaction = transaction
27
30
  }
@@ -38,7 +41,7 @@ export class AptosContext extends BaseContext {
38
41
  blockNumber: this.version,
39
42
  transactionIndex: 0,
40
43
  transactionHash: this.transaction?.hash || '', // TODO
41
- logIndex: 0,
44
+ logIndex: this.eventIndex,
42
45
  chainId: this.getChainId(),
43
46
  name: name,
44
47
  labels: normalizeLabels(labels),
@@ -335,7 +335,7 @@ export abstract class AbstractCodegen<ModuleTypes, NetworkType> {
335
335
 
336
336
  const camelFuncName = upperFirst(camelCase(func.name))
337
337
  const source = `
338
- onEntry${camelFuncName}(func: (call: ${moduleName}.${camelFuncName}Payload, ctx: ${this.PREFIX}Context) => void, filter?: CallFilter, fetchConfig?: MoveFetchConfig): ${moduleName} {
338
+ onEntry${camelFuncName}(func: (call: ${moduleName}.${camelFuncName}Payload, ctx: ${this.PREFIX}Context) => void, filter?: CallFilter, fetchConfig?: Partial<MoveFetchConfig>): ${moduleName} {
339
339
  this.onEntryFunctionCall(func, {
340
340
  ...filter,
341
341
  function: '${module.name}::${func.name}'
@@ -359,7 +359,7 @@ export abstract class AbstractCodegen<ModuleTypes, NetworkType> {
359
359
  const source = `
360
360
  onEvent${struct.name}(func: (event: ${moduleName}.${normalizeToJSName(struct.name)}Instance, ctx: ${
361
361
  this.PREFIX
362
- }Context) => void, fetchConfig?: MoveFetchConfig): ${moduleName} {
362
+ }Context) => void, fetchConfig?: Partial<MoveFetchConfig>): ${moduleName} {
363
363
  this.onMoveEvent(func, {
364
364
  type: '${module.name}::${struct.name}'
365
365
  },
@@ -35,7 +35,7 @@ export class ascii extends SuiBaseProcessor {
35
35
 
36
36
  onEventChar(
37
37
  func: (event: ascii.CharInstance, ctx: SuiContext) => void,
38
- fetchConfig?: MoveFetchConfig
38
+ fetchConfig?: Partial<MoveFetchConfig>
39
39
  ): ascii {
40
40
  this.onMoveEvent(
41
41
  func,
@@ -49,7 +49,7 @@ export class ascii extends SuiBaseProcessor {
49
49
 
50
50
  onEventString(
51
51
  func: (event: ascii.StringInstance, ctx: SuiContext) => void,
52
- fetchConfig?: MoveFetchConfig
52
+ fetchConfig?: Partial<MoveFetchConfig>
53
53
  ): ascii {
54
54
  this.onMoveEvent(
55
55
  func,
@@ -101,7 +101,7 @@ export class bit_vector extends SuiBaseProcessor {
101
101
 
102
102
  onEventBitVector(
103
103
  func: (event: bit_vector.BitVectorInstance, ctx: SuiContext) => void,
104
- fetchConfig?: MoveFetchConfig
104
+ fetchConfig?: Partial<MoveFetchConfig>
105
105
  ): bit_vector {
106
106
  this.onMoveEvent(
107
107
  func,
@@ -144,7 +144,7 @@ export class fixed_point32 extends SuiBaseProcessor {
144
144
 
145
145
  onEventFixedPoint32(
146
146
  func: (event: fixed_point32.FixedPoint32Instance, ctx: SuiContext) => void,
147
- fetchConfig?: MoveFetchConfig
147
+ fetchConfig?: Partial<MoveFetchConfig>
148
148
  ): fixed_point32 {
149
149
  this.onMoveEvent(
150
150
  func,
@@ -191,7 +191,7 @@ export class string_ extends SuiBaseProcessor {
191
191
 
192
192
  onEventString(
193
193
  func: (event: string_.StringInstance, ctx: SuiContext) => void,
194
- fetchConfig?: MoveFetchConfig
194
+ fetchConfig?: Partial<MoveFetchConfig>
195
195
  ): string_ {
196
196
  this.onMoveEvent(
197
197
  func,
@@ -231,7 +231,7 @@ export class type_name extends SuiBaseProcessor {
231
231
 
232
232
  onEventTypeName(
233
233
  func: (event: type_name.TypeNameInstance, ctx: SuiContext) => void,
234
- fetchConfig?: MoveFetchConfig
234
+ fetchConfig?: Partial<MoveFetchConfig>
235
235
  ): type_name {
236
236
  this.onMoveEvent(
237
237
  func,