@sentio/sdk 2.57.9-rc.2 → 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.
Files changed (55) hide show
  1. package/lib/aptos/builtin/0x1.d.ts +155 -155
  2. package/lib/aptos/builtin/0x1.d.ts.map +1 -1
  3. package/lib/aptos/builtin/0x1.js +395 -308
  4. package/lib/aptos/builtin/0x1.js.map +1 -1
  5. package/lib/aptos/builtin/0x3.d.ts +52 -52
  6. package/lib/aptos/builtin/0x3.d.ts.map +1 -1
  7. package/lib/aptos/builtin/0x3.js +135 -102
  8. package/lib/aptos/builtin/0x3.js.map +1 -1
  9. package/lib/aptos/builtin/0x4.d.ts +12 -12
  10. package/lib/aptos/builtin/0x4.d.ts.map +1 -1
  11. package/lib/aptos/builtin/0x4.js +22 -22
  12. package/lib/aptos/builtin/0x4.js.map +1 -1
  13. package/lib/move/shared-network-codegen.js +3 -3
  14. package/lib/move/shared-network-codegen.js.map +1 -1
  15. package/lib/store/codegen.js +1 -1
  16. package/lib/store/codegen.js.map +1 -1
  17. package/lib/store/convert.d.ts +1 -0
  18. package/lib/store/convert.d.ts.map +1 -1
  19. package/lib/store/convert.js +16 -0
  20. package/lib/store/convert.js.map +1 -1
  21. package/lib/store/decorators.d.ts +1 -0
  22. package/lib/store/decorators.d.ts.map +1 -1
  23. package/lib/store/decorators.js +2 -1
  24. package/lib/store/decorators.js.map +1 -1
  25. package/lib/store/schema.js +1 -1
  26. package/lib/store/schema.js.map +1 -1
  27. package/lib/store/types.d.ts +1 -0
  28. package/lib/store/types.d.ts.map +1 -1
  29. package/lib/store/types.js +3 -0
  30. package/lib/store/types.js.map +1 -1
  31. package/lib/sui/builtin/0x1.d.ts +7 -7
  32. package/lib/sui/builtin/0x1.d.ts.map +1 -1
  33. package/lib/sui/builtin/0x1.js +12 -12
  34. package/lib/sui/builtin/0x1.js.map +1 -1
  35. package/lib/sui/builtin/0x2.d.ts +34 -34
  36. package/lib/sui/builtin/0x2.d.ts.map +1 -1
  37. package/lib/sui/builtin/0x2.js +72 -66
  38. package/lib/sui/builtin/0x2.js.map +1 -1
  39. package/lib/sui/builtin/0x3.d.ts +14 -14
  40. package/lib/sui/builtin/0x3.d.ts.map +1 -1
  41. package/lib/sui/builtin/0x3.js +44 -26
  42. package/lib/sui/builtin/0x3.js.map +1 -1
  43. package/package.json +3 -3
  44. package/src/aptos/builtin/0x1.ts +644 -155
  45. package/src/aptos/builtin/0x3.ts +208 -52
  46. package/src/aptos/builtin/0x4.ts +59 -12
  47. package/src/move/shared-network-codegen.ts +3 -3
  48. package/src/store/codegen.ts +1 -1
  49. package/src/store/convert.ts +17 -0
  50. package/src/store/decorators.ts +2 -0
  51. package/src/store/schema.ts +1 -1
  52. package/src/store/types.ts +4 -0
  53. package/src/sui/builtin/0x1.ts +33 -7
  54. package/src/sui/builtin/0x2.ts +177 -34
  55. package/src/sui/builtin/0x3.ts +45 -14
@@ -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,
@@ -106,7 +106,7 @@ async function codegenInternal(schema: GraphQLSchema, source: string, target: st
106
106
  const imports: Import[] = [
107
107
  {
108
108
  module: '@sentio/sdk/store',
109
- types: ['String', 'Int', 'BigInt', 'Float', 'ID', 'Bytes', 'Timestamp', 'Boolean'],
109
+ types: ['String', 'Int', 'BigInt', 'Float', 'ID', 'Bytes', 'Timestamp', 'Boolean', 'Int8'],
110
110
  importType: true
111
111
  },
112
112
  {
@@ -134,6 +134,22 @@ export const IntConverter: ValueConverter<Int | undefined> = {
134
134
  }
135
135
  }
136
136
 
137
+ export const Int8Converter: ValueConverter<bigint | undefined> = {
138
+ from: (value?: bigint) => {
139
+ if (value == null) {
140
+ return {
141
+ nullValue: RichValue_NullValue.NULL_VALUE
142
+ }
143
+ }
144
+ return {
145
+ int64Value: BigInt(value)
146
+ }
147
+ },
148
+ to(v) {
149
+ return v.int64Value
150
+ }
151
+ }
152
+
137
153
  export const FloatConverter: ValueConverter<Float | undefined> = {
138
154
  from: (value?: Float) => {
139
155
  if (value == null) {
@@ -291,6 +307,7 @@ export const TypeConverters: Record<string, ValueConverter<any>> = {
291
307
  ID: IDConverter,
292
308
  Bytes: BytesConverter,
293
309
  Int: IntConverter,
310
+ Int8: Int8Converter,
294
311
  Float: FloatConverter,
295
312
  Timestamp: TimestampConverter
296
313
  }
@@ -7,6 +7,7 @@ import {
7
7
  BytesConverter,
8
8
  FloatConverter,
9
9
  IDConverter,
10
+ Int8Converter,
10
11
  IntConverter,
11
12
  objectId_,
12
13
  required_,
@@ -161,6 +162,7 @@ export function column(type?: ValueConverter<any>) {
161
162
 
162
163
  export const IDColumn = column(IDConverter)
163
164
  export const IntColumn = column(IntConverter)
165
+ export const Int8Column = column(Int8Converter)
164
166
  export const FloatColumn = column(FloatConverter)
165
167
  export const BigDecimalColumn = column(BigDecimalConverter)
166
168
  export const BigIntColumn = column(BigIntConverter)
@@ -2,7 +2,7 @@ import { buildASTSchema, DocumentNode, extendSchema, GraphQLSchema, parse, valid
2
2
  import * as fs from 'node:fs'
3
3
  import { GraphQLObjectType, GraphQLOutputType, isListType, isNonNullType } from 'graphql'
4
4
 
5
- const customScalars = ['BigInt', 'BigDecimal', 'Timestamp', 'JSON', 'Bytes', 'ID']
5
+ const customScalars = ['BigInt', 'BigDecimal', 'Timestamp', 'JSON', 'Bytes', 'ID', 'Int8']
6
6
 
7
7
  const baseSchema = buildASTSchema(
8
8
  parse(`
@@ -5,6 +5,7 @@ import { getEntityName } from './store.js'
5
5
  export type ID = string | Uint8Array
6
6
  export type String = string
7
7
  export type Int = number
8
+ export type Int8 = bigint
8
9
  export type Float = number
9
10
  export type Boolean = boolean
10
11
  export type Timestamp = Date
@@ -61,5 +62,8 @@ function toJSValue(value: RichValue): any {
61
62
  if (value.listValue != null) {
62
63
  return value.listValue.values.map(toJSValue)
63
64
  }
65
+ if (value.int64Value) {
66
+ return value.int64Value
67
+ }
64
68
  throw new Error('Unknown value type:' + JSON.stringify(value))
65
69
  }
@@ -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
  }