@sentio/runtime 2.8.0 → 2.9.0-rc.1

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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sentio/runtime",
3
3
  "license": "Apache-2.0",
4
- "version": "2.8.0",
4
+ "version": "2.9.0-rc.1",
5
5
  "scripts": {
6
6
  "compile": "tsc",
7
7
  "build": "yarn compile",
@@ -13,7 +13,7 @@
13
13
  "start_js": "ts-node-esm --files ./lib/processor-runner.js $PWD/../../debug/dist/lib.js"
14
14
  },
15
15
  "dependencies": {
16
- "@sentio/protos": "^2.8.0",
16
+ "@sentio/protos": "^2.9.0-rc.1",
17
17
  "command-line-args": "^5.2.1",
18
18
  "command-line-usage": "^7.0.1",
19
19
  "fs-extra": "^11.0.0",
@@ -45,5 +45,5 @@
45
45
  "!{lib,src}/tests",
46
46
  "!**/*.test.{js,ts}"
47
47
  ],
48
- "gitHead": "e7a355fbddba85e25fc8291cc0695352edc6eef4"
48
+ "gitHead": "c20b39437140f1e2059dcc5b5f54eabadfa9bf58"
49
49
  }
@@ -134,6 +134,7 @@ export enum HandlerType {
134
134
  APT_RESOURCE = 8,
135
135
  SUI_EVENT = 3,
136
136
  SUI_CALL = 9,
137
+ SUI_OBJECT = 10,
137
138
  UNRECOGNIZED = -1,
138
139
  }
139
140
 
@@ -169,6 +170,9 @@ export function handlerTypeFromJSON(object: any): HandlerType {
169
170
  case 9:
170
171
  case "SUI_CALL":
171
172
  return HandlerType.SUI_CALL;
173
+ case 10:
174
+ case "SUI_OBJECT":
175
+ return HandlerType.SUI_OBJECT;
172
176
  case -1:
173
177
  case "UNRECOGNIZED":
174
178
  default:
@@ -198,6 +202,8 @@ export function handlerTypeToJSON(object: HandlerType): string {
198
202
  return "SUI_EVENT";
199
203
  case HandlerType.SUI_CALL:
200
204
  return "SUI_CALL";
205
+ case HandlerType.SUI_OBJECT:
206
+ return "SUI_OBJECT";
201
207
  case HandlerType.UNRECOGNIZED:
202
208
  default:
203
209
  return "UNRECOGNIZED";
@@ -364,6 +370,7 @@ export interface AccountConfig {
364
370
  startBlock: bigint;
365
371
  intervalConfigs: OnIntervalConfig[];
366
372
  aptosIntervalConfigs: AptosOnIntervalConfig[];
373
+ suiIntervalConfigs: SuiOnIntervalConfig[];
367
374
  logConfigs: LogHandlerConfig[];
368
375
  }
369
376
 
@@ -385,6 +392,10 @@ export interface AptosOnIntervalConfig {
385
392
  type: string;
386
393
  }
387
394
 
395
+ export interface SuiOnIntervalConfig {
396
+ intervalConfig: OnIntervalConfig | undefined;
397
+ }
398
+
388
399
  export interface ContractInfo {
389
400
  name: string;
390
401
  chainId: string;
@@ -496,6 +507,7 @@ export interface Data {
496
507
  aptResource?: Data_AptResource | undefined;
497
508
  suiEvent?: Data_SuiEvent | undefined;
498
509
  suiCall?: Data_SuiCall | undefined;
510
+ suiObject?: Data_SuiObject | undefined;
499
511
  }
500
512
 
501
513
  export interface Data_EthLog {
@@ -559,6 +571,12 @@ export interface Data_SuiCall {
559
571
  slot: bigint;
560
572
  }
561
573
 
574
+ export interface Data_SuiObject {
575
+ objects: { [key: string]: any } | undefined;
576
+ timestamp: Date | undefined;
577
+ slot: bigint;
578
+ }
579
+
562
580
  export interface DataBinding {
563
581
  data: Data | undefined;
564
582
  handlerType: HandlerType;
@@ -1629,6 +1647,7 @@ function createBaseAccountConfig(): AccountConfig {
1629
1647
  startBlock: BigInt("0"),
1630
1648
  intervalConfigs: [],
1631
1649
  aptosIntervalConfigs: [],
1650
+ suiIntervalConfigs: [],
1632
1651
  logConfigs: [],
1633
1652
  };
1634
1653
  }
@@ -1650,6 +1669,9 @@ export const AccountConfig = {
1650
1669
  for (const v of message.aptosIntervalConfigs) {
1651
1670
  AptosOnIntervalConfig.encode(v!, writer.uint32(42).fork()).ldelim();
1652
1671
  }
1672
+ for (const v of message.suiIntervalConfigs) {
1673
+ SuiOnIntervalConfig.encode(v!, writer.uint32(58).fork()).ldelim();
1674
+ }
1653
1675
  for (const v of message.logConfigs) {
1654
1676
  LogHandlerConfig.encode(v!, writer.uint32(50).fork()).ldelim();
1655
1677
  }
@@ -1678,6 +1700,9 @@ export const AccountConfig = {
1678
1700
  case 5:
1679
1701
  message.aptosIntervalConfigs.push(AptosOnIntervalConfig.decode(reader, reader.uint32()));
1680
1702
  break;
1703
+ case 7:
1704
+ message.suiIntervalConfigs.push(SuiOnIntervalConfig.decode(reader, reader.uint32()));
1705
+ break;
1681
1706
  case 6:
1682
1707
  message.logConfigs.push(LogHandlerConfig.decode(reader, reader.uint32()));
1683
1708
  break;
@@ -1700,6 +1725,9 @@ export const AccountConfig = {
1700
1725
  aptosIntervalConfigs: Array.isArray(object?.aptosIntervalConfigs)
1701
1726
  ? object.aptosIntervalConfigs.map((e: any) => AptosOnIntervalConfig.fromJSON(e))
1702
1727
  : [],
1728
+ suiIntervalConfigs: Array.isArray(object?.suiIntervalConfigs)
1729
+ ? object.suiIntervalConfigs.map((e: any) => SuiOnIntervalConfig.fromJSON(e))
1730
+ : [],
1703
1731
  logConfigs: Array.isArray(object?.logConfigs)
1704
1732
  ? object.logConfigs.map((e: any) => LogHandlerConfig.fromJSON(e))
1705
1733
  : [],
@@ -1723,6 +1751,11 @@ export const AccountConfig = {
1723
1751
  } else {
1724
1752
  obj.aptosIntervalConfigs = [];
1725
1753
  }
1754
+ if (message.suiIntervalConfigs) {
1755
+ obj.suiIntervalConfigs = message.suiIntervalConfigs.map((e) => e ? SuiOnIntervalConfig.toJSON(e) : undefined);
1756
+ } else {
1757
+ obj.suiIntervalConfigs = [];
1758
+ }
1726
1759
  if (message.logConfigs) {
1727
1760
  obj.logConfigs = message.logConfigs.map((e) => e ? LogHandlerConfig.toJSON(e) : undefined);
1728
1761
  } else {
@@ -1742,6 +1775,7 @@ export const AccountConfig = {
1742
1775
  message.startBlock = object.startBlock ?? BigInt("0");
1743
1776
  message.intervalConfigs = object.intervalConfigs?.map((e) => OnIntervalConfig.fromPartial(e)) || [];
1744
1777
  message.aptosIntervalConfigs = object.aptosIntervalConfigs?.map((e) => AptosOnIntervalConfig.fromPartial(e)) || [];
1778
+ message.suiIntervalConfigs = object.suiIntervalConfigs?.map((e) => SuiOnIntervalConfig.fromPartial(e)) || [];
1745
1779
  message.logConfigs = object.logConfigs?.map((e) => LogHandlerConfig.fromPartial(e)) || [];
1746
1780
  return message;
1747
1781
  },
@@ -1969,6 +2003,62 @@ export const AptosOnIntervalConfig = {
1969
2003
  },
1970
2004
  };
1971
2005
 
2006
+ function createBaseSuiOnIntervalConfig(): SuiOnIntervalConfig {
2007
+ return { intervalConfig: undefined };
2008
+ }
2009
+
2010
+ export const SuiOnIntervalConfig = {
2011
+ encode(message: SuiOnIntervalConfig, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
2012
+ if (message.intervalConfig !== undefined) {
2013
+ OnIntervalConfig.encode(message.intervalConfig, writer.uint32(10).fork()).ldelim();
2014
+ }
2015
+ return writer;
2016
+ },
2017
+
2018
+ decode(input: _m0.Reader | Uint8Array, length?: number): SuiOnIntervalConfig {
2019
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
2020
+ let end = length === undefined ? reader.len : reader.pos + length;
2021
+ const message = createBaseSuiOnIntervalConfig();
2022
+ while (reader.pos < end) {
2023
+ const tag = reader.uint32();
2024
+ switch (tag >>> 3) {
2025
+ case 1:
2026
+ message.intervalConfig = OnIntervalConfig.decode(reader, reader.uint32());
2027
+ break;
2028
+ default:
2029
+ reader.skipType(tag & 7);
2030
+ break;
2031
+ }
2032
+ }
2033
+ return message;
2034
+ },
2035
+
2036
+ fromJSON(object: any): SuiOnIntervalConfig {
2037
+ return {
2038
+ intervalConfig: isSet(object.intervalConfig) ? OnIntervalConfig.fromJSON(object.intervalConfig) : undefined,
2039
+ };
2040
+ },
2041
+
2042
+ toJSON(message: SuiOnIntervalConfig): unknown {
2043
+ const obj: any = {};
2044
+ message.intervalConfig !== undefined &&
2045
+ (obj.intervalConfig = message.intervalConfig ? OnIntervalConfig.toJSON(message.intervalConfig) : undefined);
2046
+ return obj;
2047
+ },
2048
+
2049
+ create(base?: DeepPartial<SuiOnIntervalConfig>): SuiOnIntervalConfig {
2050
+ return SuiOnIntervalConfig.fromPartial(base ?? {});
2051
+ },
2052
+
2053
+ fromPartial(object: DeepPartial<SuiOnIntervalConfig>): SuiOnIntervalConfig {
2054
+ const message = createBaseSuiOnIntervalConfig();
2055
+ message.intervalConfig = (object.intervalConfig !== undefined && object.intervalConfig !== null)
2056
+ ? OnIntervalConfig.fromPartial(object.intervalConfig)
2057
+ : undefined;
2058
+ return message;
2059
+ },
2060
+ };
2061
+
1972
2062
  function createBaseContractInfo(): ContractInfo {
1973
2063
  return { name: "", chainId: "", address: "", abi: "" };
1974
2064
  }
@@ -3219,6 +3309,7 @@ function createBaseData(): Data {
3219
3309
  aptResource: undefined,
3220
3310
  suiEvent: undefined,
3221
3311
  suiCall: undefined,
3312
+ suiObject: undefined,
3222
3313
  };
3223
3314
  }
3224
3315
 
@@ -3257,6 +3348,9 @@ export const Data = {
3257
3348
  if (message.suiCall !== undefined) {
3258
3349
  Data_SuiCall.encode(message.suiCall, writer.uint32(90).fork()).ldelim();
3259
3350
  }
3351
+ if (message.suiObject !== undefined) {
3352
+ Data_SuiObject.encode(message.suiObject, writer.uint32(98).fork()).ldelim();
3353
+ }
3260
3354
  return writer;
3261
3355
  },
3262
3356
 
@@ -3300,6 +3394,9 @@ export const Data = {
3300
3394
  case 11:
3301
3395
  message.suiCall = Data_SuiCall.decode(reader, reader.uint32());
3302
3396
  break;
3397
+ case 12:
3398
+ message.suiObject = Data_SuiObject.decode(reader, reader.uint32());
3399
+ break;
3303
3400
  default:
3304
3401
  reader.skipType(tag & 7);
3305
3402
  break;
@@ -3321,6 +3418,7 @@ export const Data = {
3321
3418
  aptResource: isSet(object.aptResource) ? Data_AptResource.fromJSON(object.aptResource) : undefined,
3322
3419
  suiEvent: isSet(object.suiEvent) ? Data_SuiEvent.fromJSON(object.suiEvent) : undefined,
3323
3420
  suiCall: isSet(object.suiCall) ? Data_SuiCall.fromJSON(object.suiCall) : undefined,
3421
+ suiObject: isSet(object.suiObject) ? Data_SuiObject.fromJSON(object.suiObject) : undefined,
3324
3422
  };
3325
3423
  },
3326
3424
 
@@ -3345,6 +3443,8 @@ export const Data = {
3345
3443
  message.suiEvent !== undefined &&
3346
3444
  (obj.suiEvent = message.suiEvent ? Data_SuiEvent.toJSON(message.suiEvent) : undefined);
3347
3445
  message.suiCall !== undefined && (obj.suiCall = message.suiCall ? Data_SuiCall.toJSON(message.suiCall) : undefined);
3446
+ message.suiObject !== undefined &&
3447
+ (obj.suiObject = message.suiObject ? Data_SuiObject.toJSON(message.suiObject) : undefined);
3348
3448
  return obj;
3349
3449
  },
3350
3450
 
@@ -3385,6 +3485,9 @@ export const Data = {
3385
3485
  message.suiCall = (object.suiCall !== undefined && object.suiCall !== null)
3386
3486
  ? Data_SuiCall.fromPartial(object.suiCall)
3387
3487
  : undefined;
3488
+ message.suiObject = (object.suiObject !== undefined && object.suiObject !== null)
3489
+ ? Data_SuiObject.fromPartial(object.suiObject)
3490
+ : undefined;
3388
3491
  return message;
3389
3492
  },
3390
3493
  };
@@ -4122,6 +4225,77 @@ export const Data_SuiCall = {
4122
4225
  },
4123
4226
  };
4124
4227
 
4228
+ function createBaseData_SuiObject(): Data_SuiObject {
4229
+ return { objects: undefined, timestamp: undefined, slot: BigInt("0") };
4230
+ }
4231
+
4232
+ export const Data_SuiObject = {
4233
+ encode(message: Data_SuiObject, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
4234
+ if (message.objects !== undefined) {
4235
+ Struct.encode(Struct.wrap(message.objects), writer.uint32(10).fork()).ldelim();
4236
+ }
4237
+ if (message.timestamp !== undefined) {
4238
+ Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(18).fork()).ldelim();
4239
+ }
4240
+ if (message.slot !== BigInt("0")) {
4241
+ writer.uint32(24).uint64(message.slot.toString());
4242
+ }
4243
+ return writer;
4244
+ },
4245
+
4246
+ decode(input: _m0.Reader | Uint8Array, length?: number): Data_SuiObject {
4247
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
4248
+ let end = length === undefined ? reader.len : reader.pos + length;
4249
+ const message = createBaseData_SuiObject();
4250
+ while (reader.pos < end) {
4251
+ const tag = reader.uint32();
4252
+ switch (tag >>> 3) {
4253
+ case 1:
4254
+ message.objects = Struct.unwrap(Struct.decode(reader, reader.uint32()));
4255
+ break;
4256
+ case 2:
4257
+ message.timestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
4258
+ break;
4259
+ case 3:
4260
+ message.slot = longToBigint(reader.uint64() as Long);
4261
+ break;
4262
+ default:
4263
+ reader.skipType(tag & 7);
4264
+ break;
4265
+ }
4266
+ }
4267
+ return message;
4268
+ },
4269
+
4270
+ fromJSON(object: any): Data_SuiObject {
4271
+ return {
4272
+ objects: isObject(object.objects) ? object.objects : undefined,
4273
+ timestamp: isSet(object.timestamp) ? fromJsonTimestamp(object.timestamp) : undefined,
4274
+ slot: isSet(object.slot) ? BigInt(object.slot) : BigInt("0"),
4275
+ };
4276
+ },
4277
+
4278
+ toJSON(message: Data_SuiObject): unknown {
4279
+ const obj: any = {};
4280
+ message.objects !== undefined && (obj.objects = message.objects);
4281
+ message.timestamp !== undefined && (obj.timestamp = message.timestamp.toISOString());
4282
+ message.slot !== undefined && (obj.slot = message.slot.toString());
4283
+ return obj;
4284
+ },
4285
+
4286
+ create(base?: DeepPartial<Data_SuiObject>): Data_SuiObject {
4287
+ return Data_SuiObject.fromPartial(base ?? {});
4288
+ },
4289
+
4290
+ fromPartial(object: DeepPartial<Data_SuiObject>): Data_SuiObject {
4291
+ const message = createBaseData_SuiObject();
4292
+ message.objects = object.objects ?? undefined;
4293
+ message.timestamp = object.timestamp ?? undefined;
4294
+ message.slot = object.slot ?? BigInt("0");
4295
+ return message;
4296
+ },
4297
+ };
4298
+
4125
4299
  function createBaseDataBinding(): DataBinding {
4126
4300
  return { data: undefined, handlerType: 0, handlerIds: [] };
4127
4301
  }