@sentio/sdk 2.13.0-rc.1 → 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.
@@ -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,
@@ -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,
@@ -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,
@@ -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,
@@ -57,7 +57,7 @@ export class bcs extends SuiBaseProcessor {
57
57
 
58
58
  onEventBCS(
59
59
  func: (event: bcs.BCSInstance, ctx: SuiContext) => void,
60
- fetchConfig?: MoveFetchConfig
60
+ fetchConfig?: Partial<MoveFetchConfig>
61
61
  ): bcs {
62
62
  this.onMoveEvent(
63
63
  func,
@@ -233,7 +233,7 @@ export class coin extends SuiBaseProcessor {
233
233
 
234
234
  onEventCurrencyCreated(
235
235
  func: (event: coin.CurrencyCreatedInstance, ctx: SuiContext) => void,
236
- fetchConfig?: MoveFetchConfig
236
+ fetchConfig?: Partial<MoveFetchConfig>
237
237
  ): coin {
238
238
  this.onMoveEvent(
239
239
  func,
@@ -444,7 +444,7 @@ export class display extends SuiBaseProcessor {
444
444
 
445
445
  onEventDisplayCreated(
446
446
  func: (event: display.DisplayCreatedInstance, ctx: SuiContext) => void,
447
- fetchConfig?: MoveFetchConfig
447
+ fetchConfig?: Partial<MoveFetchConfig>
448
448
  ): display {
449
449
  this.onMoveEvent(
450
450
  func,
@@ -458,7 +458,7 @@ export class display extends SuiBaseProcessor {
458
458
 
459
459
  onEventVersionUpdated(
460
460
  func: (event: display.VersionUpdatedInstance, ctx: SuiContext) => void,
461
- fetchConfig?: MoveFetchConfig
461
+ fetchConfig?: Partial<MoveFetchConfig>
462
462
  ): display {
463
463
  this.onMoveEvent(
464
464
  func,
@@ -572,7 +572,7 @@ export class dynamic_object_field extends SuiBaseProcessor {
572
572
  event: dynamic_object_field.WrapperInstance,
573
573
  ctx: SuiContext
574
574
  ) => void,
575
- fetchConfig?: MoveFetchConfig
575
+ fetchConfig?: Partial<MoveFetchConfig>
576
576
  ): dynamic_object_field {
577
577
  this.onMoveEvent(
578
578
  func,
@@ -622,7 +622,7 @@ export class groth16 extends SuiBaseProcessor {
622
622
 
623
623
  onEventCurve(
624
624
  func: (event: groth16.CurveInstance, ctx: SuiContext) => void,
625
- fetchConfig?: MoveFetchConfig
625
+ fetchConfig?: Partial<MoveFetchConfig>
626
626
  ): groth16 {
627
627
  this.onMoveEvent(
628
628
  func,
@@ -639,7 +639,7 @@ export class groth16 extends SuiBaseProcessor {
639
639
  event: groth16.PreparedVerifyingKeyInstance,
640
640
  ctx: SuiContext
641
641
  ) => void,
642
- fetchConfig?: MoveFetchConfig
642
+ fetchConfig?: Partial<MoveFetchConfig>
643
643
  ): groth16 {
644
644
  this.onMoveEvent(
645
645
  func,
@@ -653,7 +653,7 @@ export class groth16 extends SuiBaseProcessor {
653
653
 
654
654
  onEventProofPoints(
655
655
  func: (event: groth16.ProofPointsInstance, ctx: SuiContext) => void,
656
- fetchConfig?: MoveFetchConfig
656
+ fetchConfig?: Partial<MoveFetchConfig>
657
657
  ): groth16 {
658
658
  this.onMoveEvent(
659
659
  func,
@@ -667,7 +667,7 @@ export class groth16 extends SuiBaseProcessor {
667
667
 
668
668
  onEventPublicProofInputs(
669
669
  func: (event: groth16.PublicProofInputsInstance, ctx: SuiContext) => void,
670
- fetchConfig?: MoveFetchConfig
670
+ fetchConfig?: Partial<MoveFetchConfig>
671
671
  ): groth16 {
672
672
  this.onMoveEvent(
673
673
  func,
@@ -748,7 +748,7 @@ export class kiosk extends SuiBaseProcessor {
748
748
 
749
749
  onEventItem(
750
750
  func: (event: kiosk.ItemInstance, ctx: SuiContext) => void,
751
- fetchConfig?: MoveFetchConfig
751
+ fetchConfig?: Partial<MoveFetchConfig>
752
752
  ): kiosk {
753
753
  this.onMoveEvent(
754
754
  func,
@@ -762,7 +762,7 @@ export class kiosk extends SuiBaseProcessor {
762
762
 
763
763
  onEventItemListed(
764
764
  func: (event: kiosk.ItemListedInstance, ctx: SuiContext) => void,
765
- fetchConfig?: MoveFetchConfig
765
+ fetchConfig?: Partial<MoveFetchConfig>
766
766
  ): kiosk {
767
767
  this.onMoveEvent(
768
768
  func,
@@ -776,7 +776,7 @@ export class kiosk extends SuiBaseProcessor {
776
776
 
777
777
  onEventListing(
778
778
  func: (event: kiosk.ListingInstance, ctx: SuiContext) => void,
779
- fetchConfig?: MoveFetchConfig
779
+ fetchConfig?: Partial<MoveFetchConfig>
780
780
  ): kiosk {
781
781
  this.onMoveEvent(
782
782
  func,
@@ -790,7 +790,7 @@ export class kiosk extends SuiBaseProcessor {
790
790
 
791
791
  onEventLock(
792
792
  func: (event: kiosk.LockInstance, ctx: SuiContext) => void,
793
- fetchConfig?: MoveFetchConfig
793
+ fetchConfig?: Partial<MoveFetchConfig>
794
794
  ): kiosk {
795
795
  this.onMoveEvent(
796
796
  func,
@@ -1296,7 +1296,7 @@ export class transfer_policy extends SuiBaseProcessor {
1296
1296
 
1297
1297
  onEventRuleKey(
1298
1298
  func: (event: transfer_policy.RuleKeyInstance, ctx: SuiContext) => void,
1299
- fetchConfig?: MoveFetchConfig
1299
+ fetchConfig?: Partial<MoveFetchConfig>
1300
1300
  ): transfer_policy {
1301
1301
  this.onMoveEvent(
1302
1302
  func,
@@ -1313,7 +1313,7 @@ export class transfer_policy extends SuiBaseProcessor {
1313
1313
  event: transfer_policy.TransferPolicyCreatedInstance,
1314
1314
  ctx: SuiContext
1315
1315
  ) => void,
1316
- fetchConfig?: MoveFetchConfig
1316
+ fetchConfig?: Partial<MoveFetchConfig>
1317
1317
  ): transfer_policy {
1318
1318
  this.onMoveEvent(
1319
1319
  func,
@@ -1398,7 +1398,7 @@ export class url extends SuiBaseProcessor {
1398
1398
 
1399
1399
  onEventUrl(
1400
1400
  func: (event: url.UrlInstance, ctx: SuiContext) => void,
1401
- fetchConfig?: MoveFetchConfig
1401
+ fetchConfig?: Partial<MoveFetchConfig>
1402
1402
  ): url {
1403
1403
  this.onMoveEvent(
1404
1404
  func,
@@ -1438,7 +1438,7 @@ export class vec_map extends SuiBaseProcessor {
1438
1438
 
1439
1439
  onEventEntry(
1440
1440
  func: (event: vec_map.EntryInstance, ctx: SuiContext) => void,
1441
- fetchConfig?: MoveFetchConfig
1441
+ fetchConfig?: Partial<MoveFetchConfig>
1442
1442
  ): vec_map {
1443
1443
  this.onMoveEvent(
1444
1444
  func,
@@ -1452,7 +1452,7 @@ export class vec_map extends SuiBaseProcessor {
1452
1452
 
1453
1453
  onEventVecMap(
1454
1454
  func: (event: vec_map.VecMapInstance, ctx: SuiContext) => void,
1455
- fetchConfig?: MoveFetchConfig
1455
+ fetchConfig?: Partial<MoveFetchConfig>
1456
1456
  ): vec_map {
1457
1457
  this.onMoveEvent(
1458
1458
  func,
@@ -1503,7 +1503,7 @@ export class vec_set extends SuiBaseProcessor {
1503
1503
 
1504
1504
  onEventVecSet(
1505
1505
  func: (event: vec_set.VecSetInstance, ctx: SuiContext) => void,
1506
- fetchConfig?: MoveFetchConfig
1506
+ fetchConfig?: Partial<MoveFetchConfig>
1507
1507
  ): vec_set {
1508
1508
  this.onMoveEvent(
1509
1509
  func,
@@ -39,7 +39,7 @@ export class genesis extends SuiBaseProcessor {
39
39
  event: genesis.GenesisChainParametersInstance,
40
40
  ctx: SuiContext
41
41
  ) => void,
42
- fetchConfig?: MoveFetchConfig
42
+ fetchConfig?: Partial<MoveFetchConfig>
43
43
  ): genesis {
44
44
  this.onMoveEvent(
45
45
  func,
@@ -56,7 +56,7 @@ export class genesis extends SuiBaseProcessor {
56
56
  event: genesis.GenesisValidatorMetadataInstance,
57
57
  ctx: SuiContext
58
58
  ) => void,
59
- fetchConfig?: MoveFetchConfig
59
+ fetchConfig?: Partial<MoveFetchConfig>
60
60
  ): genesis {
61
61
  this.onMoveEvent(
62
62
  func,
@@ -193,7 +193,7 @@ export class staking_pool extends SuiBaseProcessor {
193
193
  event: staking_pool.PoolTokenExchangeRateInstance,
194
194
  ctx: SuiContext
195
195
  ) => void,
196
- fetchConfig?: MoveFetchConfig
196
+ fetchConfig?: Partial<MoveFetchConfig>
197
197
  ): staking_pool {
198
198
  this.onMoveEvent(
199
199
  func,
@@ -1210,7 +1210,7 @@ export class sui_system_state_inner extends SuiBaseProcessor {
1210
1210
  event: sui_system_state_inner.SystemEpochInfoEventInstance,
1211
1211
  ctx: SuiContext
1212
1212
  ) => void,
1213
- fetchConfig?: MoveFetchConfig
1213
+ fetchConfig?: Partial<MoveFetchConfig>
1214
1214
  ): sui_system_state_inner {
1215
1215
  this.onMoveEvent(
1216
1216
  func,
@@ -1300,7 +1300,7 @@ export class validator extends SuiBaseProcessor {
1300
1300
  event: validator.StakingRequestEventInstance,
1301
1301
  ctx: SuiContext
1302
1302
  ) => void,
1303
- fetchConfig?: MoveFetchConfig
1303
+ fetchConfig?: Partial<MoveFetchConfig>
1304
1304
  ): validator {
1305
1305
  this.onMoveEvent(
1306
1306
  func,
@@ -1317,7 +1317,7 @@ export class validator extends SuiBaseProcessor {
1317
1317
  event: validator.UnstakingRequestEventInstance,
1318
1318
  ctx: SuiContext
1319
1319
  ) => void,
1320
- fetchConfig?: MoveFetchConfig
1320
+ fetchConfig?: Partial<MoveFetchConfig>
1321
1321
  ): validator {
1322
1322
  this.onMoveEvent(
1323
1323
  func,
@@ -1435,7 +1435,7 @@ export class validator_set extends SuiBaseProcessor {
1435
1435
  event: validator_set.ValidatorEpochInfoEventInstance,
1436
1436
  ctx: SuiContext
1437
1437
  ) => void,
1438
- fetchConfig?: MoveFetchConfig
1438
+ fetchConfig?: Partial<MoveFetchConfig>
1439
1439
  ): validator_set {
1440
1440
  this.onMoveEvent(
1441
1441
  func,
@@ -1452,7 +1452,7 @@ export class validator_set extends SuiBaseProcessor {
1452
1452
  event: validator_set.ValidatorJoinEventInstance,
1453
1453
  ctx: SuiContext
1454
1454
  ) => void,
1455
- fetchConfig?: MoveFetchConfig
1455
+ fetchConfig?: Partial<MoveFetchConfig>
1456
1456
  ): validator_set {
1457
1457
  this.onMoveEvent(
1458
1458
  func,
@@ -1469,7 +1469,7 @@ export class validator_set extends SuiBaseProcessor {
1469
1469
  event: validator_set.ValidatorLeaveEventInstance,
1470
1470
  ctx: SuiContext
1471
1471
  ) => void,
1472
- fetchConfig?: MoveFetchConfig
1472
+ fetchConfig?: Partial<MoveFetchConfig>
1473
1473
  ): validator_set {
1474
1474
  this.onMoveEvent(
1475
1475
  func,
@@ -10,6 +10,7 @@ export class SuiContext extends BaseContext {
10
10
  timestamp: Date
11
11
  slot: bigint
12
12
  transaction: SuiTransactionBlockResponse
13
+ eventIndex: number
13
14
 
14
15
  constructor(
15
16
  moduleName: string,
@@ -17,7 +18,8 @@ export class SuiContext extends BaseContext {
17
18
  address: string,
18
19
  timestamp: Date,
19
20
  slot: bigint,
20
- transaction?: SuiTransactionBlockResponse
21
+ transaction: SuiTransactionBlockResponse,
22
+ eventIndex: number
21
23
  ) {
22
24
  super()
23
25
  this.address = address.toLowerCase()
@@ -25,6 +27,7 @@ export class SuiContext extends BaseContext {
25
27
  this.moduleName = moduleName
26
28
  this.timestamp = timestamp
27
29
  this.slot = slot
30
+ this.eventIndex = eventIndex
28
31
  if (transaction) {
29
32
  this.transaction = transaction
30
33
  }
@@ -7,7 +7,7 @@ import {
7
7
  MoveOnIntervalConfig_OwnerType,
8
8
  ProcessResult,
9
9
  } from '@sentio/protos'
10
- import { ListStateStorage } from '@sentio/runtime'
10
+ import { ListStateStorage, mergeProcessResults } from '@sentio/runtime'
11
11
  import { getChainId, SuiNetwork } from './network.js'
12
12
  import { ServerError, Status } from 'nice-grpc'
13
13
  import { SuiContext, SuiObjectsContext } from './context.js'
@@ -19,7 +19,7 @@ import {
19
19
  SuiMoveObject,
20
20
  SuiTransactionBlockResponse,
21
21
  } from '@mysten/sui.js'
22
- import { CallHandler, EventFilter, EventHandler, FunctionNameAndCallFilter } from '../move/index.js'
22
+ import { CallHandler, EventFilter, EventHandler, FunctionNameAndCallFilter, parseMoveType } from '../move/index.js'
23
23
  import { getMoveCalls } from './utils.js'
24
24
  import { defaultMoveCoder } from './move-coder.js'
25
25
  // import { dynamic_field } from './builtin/0x2.js'
@@ -81,6 +81,7 @@ export class SuiBaseProcessor {
81
81
  // const moduleName = this.moduleName
82
82
 
83
83
  const processor = this
84
+ const allEventType = new Set(_filters.map((f) => processor.config.address + '::' + f.type))
84
85
 
85
86
  this.eventHandlers.push({
86
87
  handler: async function (data) {
@@ -92,26 +93,29 @@ export class SuiBaseProcessor {
92
93
  throw new ServerError(Status.INVALID_ARGUMENT, 'no event in the transactions')
93
94
  }
94
95
 
95
- const ctx = new SuiContext(
96
- processor.moduleName,
97
- processor.config.network,
98
- processor.config.address,
99
- data.timestamp || new Date(0),
100
- data.slot,
101
- txn
102
- )
96
+ const processResults = []
97
+ for (const [idx, evt] of (txn.events as SuiEvent[]).entries()) {
98
+ const typeQname = parseMoveType(evt.type).qname
99
+ if (!allEventType.has(typeQname)) {
100
+ continue
101
+ }
102
+
103
+ const ctx = new SuiContext(
104
+ processor.moduleName,
105
+ processor.config.network,
106
+ processor.config.address,
107
+ data.timestamp || new Date(0),
108
+ data.slot,
109
+ txn,
110
+ idx
111
+ )
103
112
 
104
- const events = txn.events
105
- txn.events = []
106
- for (const evt of events) {
107
- // if ('moveEvent' in evt) {
108
- // const eventInstance = evt.moveEvent as SuiEvent
109
113
  const decoded = defaultMoveCoder().decodeEvent<any>(evt)
110
114
  await handler(decoded || evt, ctx)
111
- // }
115
+ processResults.push(ctx.getProcessResult())
112
116
  }
113
117
 
114
- return ctx.getProcessResult()
118
+ return mergeProcessResults(processResults)
115
119
  },
116
120
  filters: _filters,
117
121
  fetchConfig: _fetchConfig,
@@ -150,7 +154,8 @@ export class SuiBaseProcessor {
150
154
  processor.config.address,
151
155
  data.timestamp || new Date(0),
152
156
  data.slot,
153
- tx
157
+ tx,
158
+ 0
154
159
  )
155
160
  if (tx) {
156
161
  const calls: MoveCallSuiTransaction[] = getMoveCalls(tx)
@@ -1,4 +1,4 @@
1
- import { SuiEvent, SuiTransactionBlockResponse, MoveCallSuiTransaction } from '@mysten/sui.js'
1
+ import { SuiTransactionBlockResponse, MoveCallSuiTransaction } from '@mysten/sui.js'
2
2
  import { DataBinding, HandlerType } from '@sentio/protos'
3
3
  import { getChainId } from '../sui/network.js'
4
4
  import { TestProcessorServer } from './test-processor-server.js'
@@ -66,19 +66,8 @@ export class SuiFacet {
66
66
  return undefined
67
67
  }
68
68
 
69
- testEvent(
70
- transaction: SuiTransactionBlockResponse,
71
- event: number | SuiEvent,
72
- network: SuiNetwork = SuiNetwork.MAIN_NET
73
- ) {
74
- if (typeof event !== 'number') {
75
- const transaction2: SuiTransactionBlockResponse = {} as any
76
- Object.assign(transaction2, transaction)
77
- transaction = transaction2
78
- transaction.events = [event]
79
- event = 0
80
- }
81
- const binding = this.buildEventBinding(transaction, event, network)
69
+ testEvent(transaction: SuiTransactionBlockResponse, network: SuiNetwork = SuiNetwork.MAIN_NET) {
70
+ const binding = this.buildEventBinding(transaction, network)
82
71
  if (!binding) {
83
72
  throw Error('Invalid test event: ' + JSON.stringify(transaction))
84
73
  }
@@ -87,14 +76,9 @@ export class SuiFacet {
87
76
 
88
77
  private buildEventBinding(
89
78
  transaction: SuiTransactionBlockResponse,
90
- eventIdx: number,
91
79
  network: SuiNetwork = SuiNetwork.MAIN_NET
92
80
  ): DataBinding | undefined {
93
81
  // const allEvents = new Set(transaction.events.map(e => e.type))
94
- const event = transaction.events?.[eventIdx]
95
- if (!event) {
96
- throw Error('Invaild test transaction, no event located')
97
- }
98
82
 
99
83
  for (const config of this.server.contractConfigs) {
100
84
  if (config.contract?.chainId !== getChainId(network)) {
@@ -102,18 +86,19 @@ export class SuiFacet {
102
86
  }
103
87
  for (const eventConfig of config.moveEventConfigs) {
104
88
  for (const eventFilter of eventConfig.filters) {
105
- if (config.contract.address + '::' + eventFilter.type === parseMoveType(event.type).qname) {
106
- transaction.events = [event]
107
- return {
108
- data: {
109
- suiEvent: {
110
- transaction,
111
- timestamp: new Date(transaction.timestampMs || 0),
112
- slot: 10000n,
89
+ for (const event of transaction.events || []) {
90
+ if (config.contract.address + '::' + eventFilter.type === parseMoveType(event.type).qname) {
91
+ return {
92
+ data: {
93
+ suiEvent: {
94
+ transaction,
95
+ timestamp: new Date(transaction.timestampMs || 0),
96
+ slot: 10000n,
97
+ },
113
98
  },
114
- },
115
- handlerIds: [eventConfig.handlerId],
116
- handlerType: HandlerType.SUI_EVENT,
99
+ handlerIds: [eventConfig.handlerId],
100
+ handlerType: HandlerType.SUI_EVENT,
101
+ }
117
102
  }
118
103
  }
119
104
  }