@sentio/sdk 2.57.9-rc.3 → 2.57.9-rc.4

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.
@@ -4,7 +4,7 @@
4
4
 
5
5
  /* Generated types for 0x4, original address 0x4 */
6
6
 
7
- import { CallFilter, MoveFetchConfig } from "@sentio/sdk/move";
7
+ import { CallFilter, MoveFetchConfig, EventFilter } from "@sentio/sdk/move";
8
8
  import {
9
9
  AptosBindOptions,
10
10
  AptosBaseProcessor,
@@ -45,16 +45,26 @@ export class token extends AptosBaseProcessor {
45
45
  onEventMutation(
46
46
  func: (event: token.MutationInstance, ctx: AptosContext) => void,
47
47
  fetchConfig?: Partial<MoveFetchConfig>,
48
+ eventFilter?: Omit<EventFilter, "type" | "account">,
48
49
  ): token {
49
- this.onMoveEvent(func, { type: "token::Mutation" }, fetchConfig);
50
+ this.onMoveEvent(
51
+ func,
52
+ { ...(eventFilter ?? {}), type: "token::Mutation" },
53
+ fetchConfig,
54
+ );
50
55
  return this;
51
56
  }
52
57
 
53
58
  onEventMutationEvent(
54
59
  func: (event: token.MutationEventInstance, ctx: AptosContext) => void,
55
60
  fetchConfig?: Partial<MoveFetchConfig>,
61
+ eventFilter?: Omit<EventFilter, "type" | "account">,
56
62
  ): token {
57
- this.onMoveEvent(func, { type: "token::MutationEvent" }, fetchConfig);
63
+ this.onMoveEvent(
64
+ func,
65
+ { ...(eventFilter ?? {}), type: "token::MutationEvent" },
66
+ fetchConfig,
67
+ );
58
68
  return this;
59
69
  }
60
70
  }
@@ -436,16 +446,26 @@ export class collection extends AptosBaseProcessor {
436
446
  onEventBurn(
437
447
  func: (event: collection.BurnInstance, ctx: AptosContext) => void,
438
448
  fetchConfig?: Partial<MoveFetchConfig>,
449
+ eventFilter?: Omit<EventFilter, "type" | "account">,
439
450
  ): collection {
440
- this.onMoveEvent(func, { type: "collection::Burn" }, fetchConfig);
451
+ this.onMoveEvent(
452
+ func,
453
+ { ...(eventFilter ?? {}), type: "collection::Burn" },
454
+ fetchConfig,
455
+ );
441
456
  return this;
442
457
  }
443
458
 
444
459
  onEventBurnEvent(
445
460
  func: (event: collection.BurnEventInstance, ctx: AptosContext) => void,
446
461
  fetchConfig?: Partial<MoveFetchConfig>,
462
+ eventFilter?: Omit<EventFilter, "type" | "account">,
447
463
  ): collection {
448
- this.onMoveEvent(func, { type: "collection::BurnEvent" }, fetchConfig);
464
+ this.onMoveEvent(
465
+ func,
466
+ { ...(eventFilter ?? {}), type: "collection::BurnEvent" },
467
+ fetchConfig,
468
+ );
449
469
  return this;
450
470
  }
451
471
 
@@ -455,10 +475,11 @@ export class collection extends AptosBaseProcessor {
455
475
  ctx: AptosContext,
456
476
  ) => void,
457
477
  fetchConfig?: Partial<MoveFetchConfig>,
478
+ eventFilter?: Omit<EventFilter, "type" | "account">,
458
479
  ): collection {
459
480
  this.onMoveEvent(
460
481
  func,
461
- { type: "collection::ConcurrentBurnEvent" },
482
+ { ...(eventFilter ?? {}), type: "collection::ConcurrentBurnEvent" },
462
483
  fetchConfig,
463
484
  );
464
485
  return this;
@@ -470,10 +491,11 @@ export class collection extends AptosBaseProcessor {
470
491
  ctx: AptosContext,
471
492
  ) => void,
472
493
  fetchConfig?: Partial<MoveFetchConfig>,
494
+ eventFilter?: Omit<EventFilter, "type" | "account">,
473
495
  ): collection {
474
496
  this.onMoveEvent(
475
497
  func,
476
- { type: "collection::ConcurrentMintEvent" },
498
+ { ...(eventFilter ?? {}), type: "collection::ConcurrentMintEvent" },
477
499
  fetchConfig,
478
500
  );
479
501
  return this;
@@ -482,40 +504,65 @@ export class collection extends AptosBaseProcessor {
482
504
  onEventMint(
483
505
  func: (event: collection.MintInstance, ctx: AptosContext) => void,
484
506
  fetchConfig?: Partial<MoveFetchConfig>,
507
+ eventFilter?: Omit<EventFilter, "type" | "account">,
485
508
  ): collection {
486
- this.onMoveEvent(func, { type: "collection::Mint" }, fetchConfig);
509
+ this.onMoveEvent(
510
+ func,
511
+ { ...(eventFilter ?? {}), type: "collection::Mint" },
512
+ fetchConfig,
513
+ );
487
514
  return this;
488
515
  }
489
516
 
490
517
  onEventMintEvent(
491
518
  func: (event: collection.MintEventInstance, ctx: AptosContext) => void,
492
519
  fetchConfig?: Partial<MoveFetchConfig>,
520
+ eventFilter?: Omit<EventFilter, "type" | "account">,
493
521
  ): collection {
494
- this.onMoveEvent(func, { type: "collection::MintEvent" }, fetchConfig);
522
+ this.onMoveEvent(
523
+ func,
524
+ { ...(eventFilter ?? {}), type: "collection::MintEvent" },
525
+ fetchConfig,
526
+ );
495
527
  return this;
496
528
  }
497
529
 
498
530
  onEventMutation(
499
531
  func: (event: collection.MutationInstance, ctx: AptosContext) => void,
500
532
  fetchConfig?: Partial<MoveFetchConfig>,
533
+ eventFilter?: Omit<EventFilter, "type" | "account">,
501
534
  ): collection {
502
- this.onMoveEvent(func, { type: "collection::Mutation" }, fetchConfig);
535
+ this.onMoveEvent(
536
+ func,
537
+ { ...(eventFilter ?? {}), type: "collection::Mutation" },
538
+ fetchConfig,
539
+ );
503
540
  return this;
504
541
  }
505
542
 
506
543
  onEventMutationEvent(
507
544
  func: (event: collection.MutationEventInstance, ctx: AptosContext) => void,
508
545
  fetchConfig?: Partial<MoveFetchConfig>,
546
+ eventFilter?: Omit<EventFilter, "type" | "account">,
509
547
  ): collection {
510
- this.onMoveEvent(func, { type: "collection::MutationEvent" }, fetchConfig);
548
+ this.onMoveEvent(
549
+ func,
550
+ { ...(eventFilter ?? {}), type: "collection::MutationEvent" },
551
+ fetchConfig,
552
+ );
511
553
  return this;
512
554
  }
513
555
 
514
556
  onEventSetMaxSupply(
515
557
  func: (event: collection.SetMaxSupplyInstance, ctx: AptosContext) => void,
516
558
  fetchConfig?: Partial<MoveFetchConfig>,
559
+ eventFilter?: Omit<EventFilter, "type" | "account">,
517
560
  ): collection {
518
- this.onMoveEvent(func, { type: "collection::SetMaxSupply" }, fetchConfig);
561
+ this.onMoveEvent(
562
+ func,
563
+ { ...(eventFilter ?? {}), type: "collection::SetMaxSupply" },
564
+ fetchConfig,
565
+ );
519
566
  return this;
520
567
  }
521
568
  }
@@ -113,8 +113,8 @@ export abstract class SharedNetworkCodegen<NetworkType, ModuleTypes, StructType>
113
113
  const source = `
114
114
  onEvent${struct.name}(func: (event: ${moduleName}.${normalizeToJSName(struct.name)}Instance, ctx: ${
115
115
  this.PREFIX
116
- }Context) => void, fetchConfig?: Partial<MoveFetchConfig>): ${moduleName} {
117
- this.onMoveEvent(func, { type: '${module.name}::${struct.name}' }, fetchConfig)
116
+ }Context) => void, fetchConfig?: Partial<MoveFetchConfig>, eventFilter?: Omit<EventFilter, "type"|"account">): ${moduleName} {
117
+ this.onMoveEvent(func, {...eventFilter ?? {}, type: '${module.name}::${struct.name}' }, fetchConfig)
118
118
  return this
119
119
  }`
120
120
  return source
@@ -122,7 +122,7 @@ onEvent${struct.name}(func: (event: ${moduleName}.${normalizeToJSName(struct.nam
122
122
 
123
123
  generateImports() {
124
124
  return `
125
- import { CallFilter, MoveFetchConfig } from "@sentio/sdk/move"
125
+ import { CallFilter, MoveFetchConfig, EventFilter } from "@sentio/sdk/move"
126
126
  import {
127
127
  ${this.PREFIX}BindOptions, ${this.PREFIX}BaseProcessor,
128
128
  ${this.PREFIX}Network, TypedFunctionPayload,
@@ -35,7 +35,7 @@ import {
35
35
  transactionArgumentOrPureAddress,
36
36
  } from "@typemove/sui";
37
37
 
38
- import { CallFilter, MoveFetchConfig } from "@sentio/sdk/move";
38
+ import { CallFilter, MoveFetchConfig, EventFilter } from "@sentio/sdk/move";
39
39
  import {
40
40
  SuiBindOptions,
41
41
  SuiBaseProcessor,
@@ -723,8 +723,13 @@ export class bit_vector extends SuiBaseProcessor {
723
723
  onEventBitVector(
724
724
  func: (event: bit_vector.BitVectorInstance, ctx: SuiContext) => void,
725
725
  fetchConfig?: Partial<MoveFetchConfig>,
726
+ eventFilter?: Omit<EventFilter, "type" | "account">,
726
727
  ): bit_vector {
727
- this.onMoveEvent(func, { type: "bit_vector::BitVector" }, fetchConfig);
728
+ this.onMoveEvent(
729
+ func,
730
+ { ...(eventFilter ?? {}), type: "bit_vector::BitVector" },
731
+ fetchConfig,
732
+ );
728
733
  return this;
729
734
  }
730
735
  }
@@ -1057,10 +1062,11 @@ export class fixed_point32 extends SuiBaseProcessor {
1057
1062
  onEventFixedPoint32(
1058
1063
  func: (event: fixed_point32.FixedPoint32Instance, ctx: SuiContext) => void,
1059
1064
  fetchConfig?: Partial<MoveFetchConfig>,
1065
+ eventFilter?: Omit<EventFilter, "type" | "account">,
1060
1066
  ): fixed_point32 {
1061
1067
  this.onMoveEvent(
1062
1068
  func,
1063
- { type: "fixed_point32::FixedPoint32" },
1069
+ { ...(eventFilter ?? {}), type: "fixed_point32::FixedPoint32" },
1064
1070
  fetchConfig,
1065
1071
  );
1066
1072
  return this;
@@ -1993,8 +1999,13 @@ export class string$ extends SuiBaseProcessor {
1993
1999
  onEventString(
1994
2000
  func: (event: string$.StringInstance, ctx: SuiContext) => void,
1995
2001
  fetchConfig?: Partial<MoveFetchConfig>,
2002
+ eventFilter?: Omit<EventFilter, "type" | "account">,
1996
2003
  ): string$ {
1997
- this.onMoveEvent(func, { type: "string::String" }, fetchConfig);
2004
+ this.onMoveEvent(
2005
+ func,
2006
+ { ...(eventFilter ?? {}), type: "string::String" },
2007
+ fetchConfig,
2008
+ );
1998
2009
  return this;
1999
2010
  }
2000
2011
  }
@@ -2494,8 +2505,13 @@ export class type_name extends SuiBaseProcessor {
2494
2505
  onEventTypeName(
2495
2506
  func: (event: type_name.TypeNameInstance, ctx: SuiContext) => void,
2496
2507
  fetchConfig?: Partial<MoveFetchConfig>,
2508
+ eventFilter?: Omit<EventFilter, "type" | "account">,
2497
2509
  ): type_name {
2498
- this.onMoveEvent(func, { type: "type_name::TypeName" }, fetchConfig);
2510
+ this.onMoveEvent(
2511
+ func,
2512
+ { ...(eventFilter ?? {}), type: "type_name::TypeName" },
2513
+ fetchConfig,
2514
+ );
2499
2515
  return this;
2500
2516
  }
2501
2517
  }
@@ -4558,8 +4574,13 @@ export class uq32_32 extends SuiBaseProcessor {
4558
4574
  onEventUQ32_32(
4559
4575
  func: (event: uq32_32.UQ32_32Instance, ctx: SuiContext) => void,
4560
4576
  fetchConfig?: Partial<MoveFetchConfig>,
4577
+ eventFilter?: Omit<EventFilter, "type" | "account">,
4561
4578
  ): uq32_32 {
4562
- this.onMoveEvent(func, { type: "uq32_32::UQ32_32" }, fetchConfig);
4579
+ this.onMoveEvent(
4580
+ func,
4581
+ { ...(eventFilter ?? {}), type: "uq32_32::UQ32_32" },
4582
+ fetchConfig,
4583
+ );
4563
4584
  return this;
4564
4585
  }
4565
4586
  }
@@ -5067,8 +5088,13 @@ export class uq64_64 extends SuiBaseProcessor {
5067
5088
  onEventUQ64_64(
5068
5089
  func: (event: uq64_64.UQ64_64Instance, ctx: SuiContext) => void,
5069
5090
  fetchConfig?: Partial<MoveFetchConfig>,
5091
+ eventFilter?: Omit<EventFilter, "type" | "account">,
5070
5092
  ): uq64_64 {
5071
- this.onMoveEvent(func, { type: "uq64_64::UQ64_64" }, fetchConfig);
5093
+ this.onMoveEvent(
5094
+ func,
5095
+ { ...(eventFilter ?? {}), type: "uq64_64::UQ64_64" },
5096
+ fetchConfig,
5097
+ );
5072
5098
  return this;
5073
5099
  }
5074
5100
  }