@sentio/runtime 2.39.0-rc.1 → 2.39.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentio/runtime",
3
- "version": "2.39.0-rc.1",
3
+ "version": "2.39.0-rc.2",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "exports": {
@@ -32,7 +32,7 @@
32
32
  "rxjs": "^7.8.1",
33
33
  "utility-types": "^3.11.0",
34
34
  "winston": "^3.11.0",
35
- "@sentio/protos": "2.39.0-rc.1"
35
+ "@sentio/protos": "2.39.0-rc.2"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@types/command-line-args": "^5.2.3",
@@ -202,6 +202,7 @@ export enum HandlerType {
202
202
  SUI_OBJECT = 10,
203
203
  SUI_OBJECT_CHANGE = 12,
204
204
  FUEL_CALL = 13,
205
+ COSMOS_CALL = 14,
205
206
  UNRECOGNIZED = -1,
206
207
  }
207
208
 
@@ -249,6 +250,9 @@ export function handlerTypeFromJSON(object: any): HandlerType {
249
250
  case 13:
250
251
  case "FUEL_CALL":
251
252
  return HandlerType.FUEL_CALL;
253
+ case 14:
254
+ case "COSMOS_CALL":
255
+ return HandlerType.COSMOS_CALL;
252
256
  case -1:
253
257
  case "UNRECOGNIZED":
254
258
  default:
@@ -286,6 +290,8 @@ export function handlerTypeToJSON(object: HandlerType): string {
286
290
  return "SUI_OBJECT_CHANGE";
287
291
  case HandlerType.FUEL_CALL:
288
292
  return "FUEL_CALL";
293
+ case HandlerType.COSMOS_CALL:
294
+ return "COSMOS_CALL";
289
295
  case HandlerType.UNRECOGNIZED:
290
296
  default:
291
297
  return "UNRECOGNIZED";
@@ -382,6 +388,7 @@ export interface ContractConfig {
382
388
  fuelCallConfigs: FuelCallHandlerConfig[];
383
389
  assetConfigs: FuelAssetHandlerConfig[];
384
390
  fuelLogConfigs: FuelLogHandlerConfig[];
391
+ cosmosLogConfigs: CosmosLogHandlerConfig[];
385
392
  instructionConfig: InstructionHandlerConfig | undefined;
386
393
  startBlock: bigint;
387
394
  endBlock: bigint;
@@ -638,6 +645,11 @@ export interface FuelLogHandlerConfig {
638
645
  handlerId: number;
639
646
  }
640
647
 
648
+ export interface CosmosLogHandlerConfig {
649
+ logFilters: string[];
650
+ handlerId: number;
651
+ }
652
+
641
653
  export interface LogFilter {
642
654
  topics: Topic[];
643
655
  address?: string | undefined;
@@ -792,6 +804,7 @@ export interface Data {
792
804
  suiObject?: Data_SuiObject | undefined;
793
805
  suiObjectChange?: Data_SuiObjectChange | undefined;
794
806
  fuelCall?: Data_FuelCall | undefined;
807
+ cosmosCall?: Data_CosmosCall | undefined;
795
808
  }
796
809
 
797
810
  export interface Data_EthLog {
@@ -875,6 +888,11 @@ export interface Data_FuelCall {
875
888
  timestamp: Date | undefined;
876
889
  }
877
890
 
891
+ export interface Data_CosmosCall {
892
+ transaction: { [key: string]: any } | undefined;
893
+ timestamp: Date | undefined;
894
+ }
895
+
878
896
  export interface DataBinding {
879
897
  data: Data | undefined;
880
898
  handlerType: HandlerType;
@@ -1412,6 +1430,7 @@ function createBaseContractConfig(): ContractConfig {
1412
1430
  fuelCallConfigs: [],
1413
1431
  assetConfigs: [],
1414
1432
  fuelLogConfigs: [],
1433
+ cosmosLogConfigs: [],
1415
1434
  instructionConfig: undefined,
1416
1435
  startBlock: BigInt("0"),
1417
1436
  endBlock: BigInt("0"),
@@ -1454,6 +1473,9 @@ export const ContractConfig = {
1454
1473
  for (const v of message.fuelLogConfigs) {
1455
1474
  FuelLogHandlerConfig.encode(v!, writer.uint32(122).fork()).ldelim();
1456
1475
  }
1476
+ for (const v of message.cosmosLogConfigs) {
1477
+ CosmosLogHandlerConfig.encode(v!, writer.uint32(130).fork()).ldelim();
1478
+ }
1457
1479
  if (message.instructionConfig !== undefined) {
1458
1480
  InstructionHandlerConfig.encode(message.instructionConfig, writer.uint32(50).fork()).ldelim();
1459
1481
  }
@@ -1559,6 +1581,13 @@ export const ContractConfig = {
1559
1581
 
1560
1582
  message.fuelLogConfigs.push(FuelLogHandlerConfig.decode(reader, reader.uint32()));
1561
1583
  continue;
1584
+ case 16:
1585
+ if (tag !== 130) {
1586
+ break;
1587
+ }
1588
+
1589
+ message.cosmosLogConfigs.push(CosmosLogHandlerConfig.decode(reader, reader.uint32()));
1590
+ continue;
1562
1591
  case 6:
1563
1592
  if (tag !== 50) {
1564
1593
  break;
@@ -1629,6 +1658,9 @@ export const ContractConfig = {
1629
1658
  fuelLogConfigs: globalThis.Array.isArray(object?.fuelLogConfigs)
1630
1659
  ? object.fuelLogConfigs.map((e: any) => FuelLogHandlerConfig.fromJSON(e))
1631
1660
  : [],
1661
+ cosmosLogConfigs: globalThis.Array.isArray(object?.cosmosLogConfigs)
1662
+ ? object.cosmosLogConfigs.map((e: any) => CosmosLogHandlerConfig.fromJSON(e))
1663
+ : [],
1632
1664
  instructionConfig: isSet(object.instructionConfig)
1633
1665
  ? InstructionHandlerConfig.fromJSON(object.instructionConfig)
1634
1666
  : undefined,
@@ -1673,6 +1705,9 @@ export const ContractConfig = {
1673
1705
  if (message.fuelLogConfigs?.length) {
1674
1706
  obj.fuelLogConfigs = message.fuelLogConfigs.map((e) => FuelLogHandlerConfig.toJSON(e));
1675
1707
  }
1708
+ if (message.cosmosLogConfigs?.length) {
1709
+ obj.cosmosLogConfigs = message.cosmosLogConfigs.map((e) => CosmosLogHandlerConfig.toJSON(e));
1710
+ }
1676
1711
  if (message.instructionConfig !== undefined) {
1677
1712
  obj.instructionConfig = InstructionHandlerConfig.toJSON(message.instructionConfig);
1678
1713
  }
@@ -1707,6 +1742,7 @@ export const ContractConfig = {
1707
1742
  message.fuelCallConfigs = object.fuelCallConfigs?.map((e) => FuelCallHandlerConfig.fromPartial(e)) || [];
1708
1743
  message.assetConfigs = object.assetConfigs?.map((e) => FuelAssetHandlerConfig.fromPartial(e)) || [];
1709
1744
  message.fuelLogConfigs = object.fuelLogConfigs?.map((e) => FuelLogHandlerConfig.fromPartial(e)) || [];
1745
+ message.cosmosLogConfigs = object.cosmosLogConfigs?.map((e) => CosmosLogHandlerConfig.fromPartial(e)) || [];
1710
1746
  message.instructionConfig = (object.instructionConfig !== undefined && object.instructionConfig !== null)
1711
1747
  ? InstructionHandlerConfig.fromPartial(object.instructionConfig)
1712
1748
  : undefined;
@@ -4207,6 +4243,82 @@ export const FuelLogHandlerConfig = {
4207
4243
  },
4208
4244
  };
4209
4245
 
4246
+ function createBaseCosmosLogHandlerConfig(): CosmosLogHandlerConfig {
4247
+ return { logFilters: [], handlerId: 0 };
4248
+ }
4249
+
4250
+ export const CosmosLogHandlerConfig = {
4251
+ encode(message: CosmosLogHandlerConfig, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
4252
+ for (const v of message.logFilters) {
4253
+ writer.uint32(10).string(v!);
4254
+ }
4255
+ if (message.handlerId !== 0) {
4256
+ writer.uint32(16).int32(message.handlerId);
4257
+ }
4258
+ return writer;
4259
+ },
4260
+
4261
+ decode(input: _m0.Reader | Uint8Array, length?: number): CosmosLogHandlerConfig {
4262
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
4263
+ let end = length === undefined ? reader.len : reader.pos + length;
4264
+ const message = createBaseCosmosLogHandlerConfig();
4265
+ while (reader.pos < end) {
4266
+ const tag = reader.uint32();
4267
+ switch (tag >>> 3) {
4268
+ case 1:
4269
+ if (tag !== 10) {
4270
+ break;
4271
+ }
4272
+
4273
+ message.logFilters.push(reader.string());
4274
+ continue;
4275
+ case 2:
4276
+ if (tag !== 16) {
4277
+ break;
4278
+ }
4279
+
4280
+ message.handlerId = reader.int32();
4281
+ continue;
4282
+ }
4283
+ if ((tag & 7) === 4 || tag === 0) {
4284
+ break;
4285
+ }
4286
+ reader.skipType(tag & 7);
4287
+ }
4288
+ return message;
4289
+ },
4290
+
4291
+ fromJSON(object: any): CosmosLogHandlerConfig {
4292
+ return {
4293
+ logFilters: globalThis.Array.isArray(object?.logFilters)
4294
+ ? object.logFilters.map((e: any) => globalThis.String(e))
4295
+ : [],
4296
+ handlerId: isSet(object.handlerId) ? globalThis.Number(object.handlerId) : 0,
4297
+ };
4298
+ },
4299
+
4300
+ toJSON(message: CosmosLogHandlerConfig): unknown {
4301
+ const obj: any = {};
4302
+ if (message.logFilters?.length) {
4303
+ obj.logFilters = message.logFilters;
4304
+ }
4305
+ if (message.handlerId !== 0) {
4306
+ obj.handlerId = Math.round(message.handlerId);
4307
+ }
4308
+ return obj;
4309
+ },
4310
+
4311
+ create(base?: DeepPartial<CosmosLogHandlerConfig>): CosmosLogHandlerConfig {
4312
+ return CosmosLogHandlerConfig.fromPartial(base ?? {});
4313
+ },
4314
+ fromPartial(object: DeepPartial<CosmosLogHandlerConfig>): CosmosLogHandlerConfig {
4315
+ const message = createBaseCosmosLogHandlerConfig();
4316
+ message.logFilters = object.logFilters?.map((e) => e) || [];
4317
+ message.handlerId = object.handlerId ?? 0;
4318
+ return message;
4319
+ },
4320
+ };
4321
+
4210
4322
  function createBaseLogFilter(): LogFilter {
4211
4323
  return { topics: [], address: undefined, addressType: undefined };
4212
4324
  }
@@ -6271,6 +6383,7 @@ function createBaseData(): Data {
6271
6383
  suiObject: undefined,
6272
6384
  suiObjectChange: undefined,
6273
6385
  fuelCall: undefined,
6386
+ cosmosCall: undefined,
6274
6387
  };
6275
6388
  }
6276
6389
 
@@ -6318,6 +6431,9 @@ export const Data = {
6318
6431
  if (message.fuelCall !== undefined) {
6319
6432
  Data_FuelCall.encode(message.fuelCall, writer.uint32(114).fork()).ldelim();
6320
6433
  }
6434
+ if (message.cosmosCall !== undefined) {
6435
+ Data_CosmosCall.encode(message.cosmosCall, writer.uint32(122).fork()).ldelim();
6436
+ }
6321
6437
  return writer;
6322
6438
  },
6323
6439
 
@@ -6426,6 +6542,13 @@ export const Data = {
6426
6542
 
6427
6543
  message.fuelCall = Data_FuelCall.decode(reader, reader.uint32());
6428
6544
  continue;
6545
+ case 15:
6546
+ if (tag !== 122) {
6547
+ break;
6548
+ }
6549
+
6550
+ message.cosmosCall = Data_CosmosCall.decode(reader, reader.uint32());
6551
+ continue;
6429
6552
  }
6430
6553
  if ((tag & 7) === 4 || tag === 0) {
6431
6554
  break;
@@ -6453,6 +6576,7 @@ export const Data = {
6453
6576
  ? Data_SuiObjectChange.fromJSON(object.suiObjectChange)
6454
6577
  : undefined,
6455
6578
  fuelCall: isSet(object.fuelCall) ? Data_FuelCall.fromJSON(object.fuelCall) : undefined,
6579
+ cosmosCall: isSet(object.cosmosCall) ? Data_CosmosCall.fromJSON(object.cosmosCall) : undefined,
6456
6580
  };
6457
6581
  },
6458
6582
 
@@ -6500,6 +6624,9 @@ export const Data = {
6500
6624
  if (message.fuelCall !== undefined) {
6501
6625
  obj.fuelCall = Data_FuelCall.toJSON(message.fuelCall);
6502
6626
  }
6627
+ if (message.cosmosCall !== undefined) {
6628
+ obj.cosmosCall = Data_CosmosCall.toJSON(message.cosmosCall);
6629
+ }
6503
6630
  return obj;
6504
6631
  },
6505
6632
 
@@ -6548,6 +6675,9 @@ export const Data = {
6548
6675
  message.fuelCall = (object.fuelCall !== undefined && object.fuelCall !== null)
6549
6676
  ? Data_FuelCall.fromPartial(object.fuelCall)
6550
6677
  : undefined;
6678
+ message.cosmosCall = (object.cosmosCall !== undefined && object.cosmosCall !== null)
6679
+ ? Data_CosmosCall.fromPartial(object.cosmosCall)
6680
+ : undefined;
6551
6681
  return message;
6552
6682
  },
6553
6683
  };
@@ -7787,6 +7917,80 @@ export const Data_FuelCall = {
7787
7917
  },
7788
7918
  };
7789
7919
 
7920
+ function createBaseData_CosmosCall(): Data_CosmosCall {
7921
+ return { transaction: undefined, timestamp: undefined };
7922
+ }
7923
+
7924
+ export const Data_CosmosCall = {
7925
+ encode(message: Data_CosmosCall, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
7926
+ if (message.transaction !== undefined) {
7927
+ Struct.encode(Struct.wrap(message.transaction), writer.uint32(10).fork()).ldelim();
7928
+ }
7929
+ if (message.timestamp !== undefined) {
7930
+ Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(18).fork()).ldelim();
7931
+ }
7932
+ return writer;
7933
+ },
7934
+
7935
+ decode(input: _m0.Reader | Uint8Array, length?: number): Data_CosmosCall {
7936
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
7937
+ let end = length === undefined ? reader.len : reader.pos + length;
7938
+ const message = createBaseData_CosmosCall();
7939
+ while (reader.pos < end) {
7940
+ const tag = reader.uint32();
7941
+ switch (tag >>> 3) {
7942
+ case 1:
7943
+ if (tag !== 10) {
7944
+ break;
7945
+ }
7946
+
7947
+ message.transaction = Struct.unwrap(Struct.decode(reader, reader.uint32()));
7948
+ continue;
7949
+ case 2:
7950
+ if (tag !== 18) {
7951
+ break;
7952
+ }
7953
+
7954
+ message.timestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
7955
+ continue;
7956
+ }
7957
+ if ((tag & 7) === 4 || tag === 0) {
7958
+ break;
7959
+ }
7960
+ reader.skipType(tag & 7);
7961
+ }
7962
+ return message;
7963
+ },
7964
+
7965
+ fromJSON(object: any): Data_CosmosCall {
7966
+ return {
7967
+ transaction: isObject(object.transaction) ? object.transaction : undefined,
7968
+ timestamp: isSet(object.timestamp) ? fromJsonTimestamp(object.timestamp) : undefined,
7969
+ };
7970
+ },
7971
+
7972
+ toJSON(message: Data_CosmosCall): unknown {
7973
+ const obj: any = {};
7974
+ if (message.transaction !== undefined) {
7975
+ obj.transaction = message.transaction;
7976
+ }
7977
+ if (message.timestamp !== undefined) {
7978
+ obj.timestamp = message.timestamp.toISOString();
7979
+ }
7980
+ return obj;
7981
+ },
7982
+
7983
+ create(base?: DeepPartial<Data_CosmosCall>): Data_CosmosCall {
7984
+ return Data_CosmosCall.fromPartial(base ?? {});
7985
+ },
7986
+ fromPartial(object: DeepPartial<Data_CosmosCall>): Data_CosmosCall {
7987
+ const message = createBaseData_CosmosCall();
7988
+ message.transaction = object.transaction ?? undefined;
7989
+ message.timestamp = object.timestamp ?? undefined;
7990
+ return message;
7991
+ },
7992
+ };
7993
+
7790
7994
  function createBaseDataBinding(): DataBinding {
7791
7995
  return { data: undefined, handlerType: 0, handlerIds: [] };
7792
7996
  }