@sentio/runtime 1.37.5-rc.1 → 1.37.5-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.
@@ -222,6 +222,7 @@ export interface Data_EthLog {
222
222
  log: {
223
223
  [key: string]: any;
224
224
  } | undefined;
225
+ timestamp: Date | undefined;
225
226
  transaction?: {
226
227
  [key: string]: any;
227
228
  } | undefined;
@@ -235,6 +236,7 @@ export interface Data_EthTransaction {
235
236
  transaction: {
236
237
  [key: string]: any;
237
238
  } | undefined;
239
+ timestamp: Date | undefined;
238
240
  transactionReceipt?: {
239
241
  [key: string]: any;
240
242
  } | undefined;
@@ -243,6 +245,7 @@ export interface Data_EthTrace {
243
245
  trace: {
244
246
  [key: string]: any;
245
247
  } | undefined;
248
+ timestamp: Date | undefined;
246
249
  transaction?: {
247
250
  [key: string]: any;
248
251
  } | undefined;
@@ -260,12 +263,12 @@ export interface Data_SolInstruction {
260
263
  } | undefined;
261
264
  }
262
265
  export interface Data_AptEvent {
263
- event: {
266
+ transaction: {
264
267
  [key: string]: any;
265
268
  } | undefined;
266
269
  }
267
270
  export interface Data_AptCall {
268
- call: {
271
+ transaction: {
269
272
  [key: string]: any;
270
273
  } | undefined;
271
274
  }
@@ -10,6 +10,7 @@ const long_1 = __importDefault(require("long"));
10
10
  const minimal_1 = __importDefault(require("protobufjs/minimal"));
11
11
  const empty_1 = require("../../google/protobuf/empty");
12
12
  const struct_1 = require("../../google/protobuf/struct");
13
+ const timestamp_1 = require("../../google/protobuf/timestamp");
13
14
  var MetricType;
14
15
  (function (MetricType) {
15
16
  MetricType[MetricType["UNKNOWN_TYPE"] = 0] = "UNKNOWN_TYPE";
@@ -2523,13 +2524,16 @@ exports.Data = {
2523
2524
  },
2524
2525
  };
2525
2526
  function createBaseData_EthLog() {
2526
- return { log: undefined, transaction: undefined };
2527
+ return { log: undefined, timestamp: undefined, transaction: undefined };
2527
2528
  }
2528
2529
  exports.Data_EthLog = {
2529
2530
  encode(message, writer = minimal_1.default.Writer.create()) {
2530
2531
  if (message.log !== undefined) {
2531
2532
  struct_1.Struct.encode(struct_1.Struct.wrap(message.log), writer.uint32(26).fork()).ldelim();
2532
2533
  }
2534
+ if (message.timestamp !== undefined) {
2535
+ timestamp_1.Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(34).fork()).ldelim();
2536
+ }
2533
2537
  if (message.transaction !== undefined) {
2534
2538
  struct_1.Struct.encode(struct_1.Struct.wrap(message.transaction), writer.uint32(18).fork()).ldelim();
2535
2539
  }
@@ -2545,6 +2549,9 @@ exports.Data_EthLog = {
2545
2549
  case 3:
2546
2550
  message.log = struct_1.Struct.unwrap(struct_1.Struct.decode(reader, reader.uint32()));
2547
2551
  break;
2552
+ case 4:
2553
+ message.timestamp = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
2554
+ break;
2548
2555
  case 2:
2549
2556
  message.transaction = struct_1.Struct.unwrap(struct_1.Struct.decode(reader, reader.uint32()));
2550
2557
  break;
@@ -2558,18 +2565,21 @@ exports.Data_EthLog = {
2558
2565
  fromJSON(object) {
2559
2566
  return {
2560
2567
  log: isObject(object.log) ? object.log : undefined,
2568
+ timestamp: isSet(object.timestamp) ? fromJsonTimestamp(object.timestamp) : undefined,
2561
2569
  transaction: isObject(object.transaction) ? object.transaction : undefined,
2562
2570
  };
2563
2571
  },
2564
2572
  toJSON(message) {
2565
2573
  const obj = {};
2566
2574
  message.log !== undefined && (obj.log = message.log);
2575
+ message.timestamp !== undefined && (obj.timestamp = message.timestamp.toISOString());
2567
2576
  message.transaction !== undefined && (obj.transaction = message.transaction);
2568
2577
  return obj;
2569
2578
  },
2570
2579
  fromPartial(object) {
2571
2580
  const message = createBaseData_EthLog();
2572
2581
  message.log = object.log ?? undefined;
2582
+ message.timestamp = object.timestamp ?? undefined;
2573
2583
  message.transaction = object.transaction ?? undefined;
2574
2584
  return message;
2575
2585
  },
@@ -2616,13 +2626,16 @@ exports.Data_EthBlock = {
2616
2626
  },
2617
2627
  };
2618
2628
  function createBaseData_EthTransaction() {
2619
- return { transaction: undefined, transactionReceipt: undefined };
2629
+ return { transaction: undefined, timestamp: undefined, transactionReceipt: undefined };
2620
2630
  }
2621
2631
  exports.Data_EthTransaction = {
2622
2632
  encode(message, writer = minimal_1.default.Writer.create()) {
2623
2633
  if (message.transaction !== undefined) {
2624
2634
  struct_1.Struct.encode(struct_1.Struct.wrap(message.transaction), writer.uint32(34).fork()).ldelim();
2625
2635
  }
2636
+ if (message.timestamp !== undefined) {
2637
+ timestamp_1.Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(42).fork()).ldelim();
2638
+ }
2626
2639
  if (message.transactionReceipt !== undefined) {
2627
2640
  struct_1.Struct.encode(struct_1.Struct.wrap(message.transactionReceipt), writer.uint32(26).fork()).ldelim();
2628
2641
  }
@@ -2638,6 +2651,9 @@ exports.Data_EthTransaction = {
2638
2651
  case 4:
2639
2652
  message.transaction = struct_1.Struct.unwrap(struct_1.Struct.decode(reader, reader.uint32()));
2640
2653
  break;
2654
+ case 5:
2655
+ message.timestamp = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
2656
+ break;
2641
2657
  case 3:
2642
2658
  message.transactionReceipt = struct_1.Struct.unwrap(struct_1.Struct.decode(reader, reader.uint32()));
2643
2659
  break;
@@ -2651,30 +2667,36 @@ exports.Data_EthTransaction = {
2651
2667
  fromJSON(object) {
2652
2668
  return {
2653
2669
  transaction: isObject(object.transaction) ? object.transaction : undefined,
2670
+ timestamp: isSet(object.timestamp) ? fromJsonTimestamp(object.timestamp) : undefined,
2654
2671
  transactionReceipt: isObject(object.transactionReceipt) ? object.transactionReceipt : undefined,
2655
2672
  };
2656
2673
  },
2657
2674
  toJSON(message) {
2658
2675
  const obj = {};
2659
2676
  message.transaction !== undefined && (obj.transaction = message.transaction);
2677
+ message.timestamp !== undefined && (obj.timestamp = message.timestamp.toISOString());
2660
2678
  message.transactionReceipt !== undefined && (obj.transactionReceipt = message.transactionReceipt);
2661
2679
  return obj;
2662
2680
  },
2663
2681
  fromPartial(object) {
2664
2682
  const message = createBaseData_EthTransaction();
2665
2683
  message.transaction = object.transaction ?? undefined;
2684
+ message.timestamp = object.timestamp ?? undefined;
2666
2685
  message.transactionReceipt = object.transactionReceipt ?? undefined;
2667
2686
  return message;
2668
2687
  },
2669
2688
  };
2670
2689
  function createBaseData_EthTrace() {
2671
- return { trace: undefined, transaction: undefined, transactionReceipt: undefined };
2690
+ return { trace: undefined, timestamp: undefined, transaction: undefined, transactionReceipt: undefined };
2672
2691
  }
2673
2692
  exports.Data_EthTrace = {
2674
2693
  encode(message, writer = minimal_1.default.Writer.create()) {
2675
2694
  if (message.trace !== undefined) {
2676
2695
  struct_1.Struct.encode(struct_1.Struct.wrap(message.trace), writer.uint32(34).fork()).ldelim();
2677
2696
  }
2697
+ if (message.timestamp !== undefined) {
2698
+ timestamp_1.Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(42).fork()).ldelim();
2699
+ }
2678
2700
  if (message.transaction !== undefined) {
2679
2701
  struct_1.Struct.encode(struct_1.Struct.wrap(message.transaction), writer.uint32(18).fork()).ldelim();
2680
2702
  }
@@ -2693,6 +2715,9 @@ exports.Data_EthTrace = {
2693
2715
  case 4:
2694
2716
  message.trace = struct_1.Struct.unwrap(struct_1.Struct.decode(reader, reader.uint32()));
2695
2717
  break;
2718
+ case 5:
2719
+ message.timestamp = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
2720
+ break;
2696
2721
  case 2:
2697
2722
  message.transaction = struct_1.Struct.unwrap(struct_1.Struct.decode(reader, reader.uint32()));
2698
2723
  break;
@@ -2709,6 +2734,7 @@ exports.Data_EthTrace = {
2709
2734
  fromJSON(object) {
2710
2735
  return {
2711
2736
  trace: isObject(object.trace) ? object.trace : undefined,
2737
+ timestamp: isSet(object.timestamp) ? fromJsonTimestamp(object.timestamp) : undefined,
2712
2738
  transaction: isObject(object.transaction) ? object.transaction : undefined,
2713
2739
  transactionReceipt: isObject(object.transactionReceipt) ? object.transactionReceipt : undefined,
2714
2740
  };
@@ -2716,6 +2742,7 @@ exports.Data_EthTrace = {
2716
2742
  toJSON(message) {
2717
2743
  const obj = {};
2718
2744
  message.trace !== undefined && (obj.trace = message.trace);
2745
+ message.timestamp !== undefined && (obj.timestamp = message.timestamp.toISOString());
2719
2746
  message.transaction !== undefined && (obj.transaction = message.transaction);
2720
2747
  message.transactionReceipt !== undefined && (obj.transactionReceipt = message.transactionReceipt);
2721
2748
  return obj;
@@ -2723,6 +2750,7 @@ exports.Data_EthTrace = {
2723
2750
  fromPartial(object) {
2724
2751
  const message = createBaseData_EthTrace();
2725
2752
  message.trace = object.trace ?? undefined;
2753
+ message.timestamp = object.timestamp ?? undefined;
2726
2754
  message.transaction = object.transaction ?? undefined;
2727
2755
  message.transactionReceipt = object.transactionReceipt ?? undefined;
2728
2756
  return message;
@@ -2813,12 +2841,12 @@ exports.Data_SolInstruction = {
2813
2841
  },
2814
2842
  };
2815
2843
  function createBaseData_AptEvent() {
2816
- return { event: undefined };
2844
+ return { transaction: undefined };
2817
2845
  }
2818
2846
  exports.Data_AptEvent = {
2819
2847
  encode(message, writer = minimal_1.default.Writer.create()) {
2820
- if (message.event !== undefined) {
2821
- struct_1.Struct.encode(struct_1.Struct.wrap(message.event), writer.uint32(18).fork()).ldelim();
2848
+ if (message.transaction !== undefined) {
2849
+ struct_1.Struct.encode(struct_1.Struct.wrap(message.transaction), writer.uint32(18).fork()).ldelim();
2822
2850
  }
2823
2851
  return writer;
2824
2852
  },
@@ -2830,7 +2858,7 @@ exports.Data_AptEvent = {
2830
2858
  const tag = reader.uint32();
2831
2859
  switch (tag >>> 3) {
2832
2860
  case 2:
2833
- message.event = struct_1.Struct.unwrap(struct_1.Struct.decode(reader, reader.uint32()));
2861
+ message.transaction = struct_1.Struct.unwrap(struct_1.Struct.decode(reader, reader.uint32()));
2834
2862
  break;
2835
2863
  default:
2836
2864
  reader.skipType(tag & 7);
@@ -2840,26 +2868,26 @@ exports.Data_AptEvent = {
2840
2868
  return message;
2841
2869
  },
2842
2870
  fromJSON(object) {
2843
- return { event: isObject(object.event) ? object.event : undefined };
2871
+ return { transaction: isObject(object.transaction) ? object.transaction : undefined };
2844
2872
  },
2845
2873
  toJSON(message) {
2846
2874
  const obj = {};
2847
- message.event !== undefined && (obj.event = message.event);
2875
+ message.transaction !== undefined && (obj.transaction = message.transaction);
2848
2876
  return obj;
2849
2877
  },
2850
2878
  fromPartial(object) {
2851
2879
  const message = createBaseData_AptEvent();
2852
- message.event = object.event ?? undefined;
2880
+ message.transaction = object.transaction ?? undefined;
2853
2881
  return message;
2854
2882
  },
2855
2883
  };
2856
2884
  function createBaseData_AptCall() {
2857
- return { call: undefined };
2885
+ return { transaction: undefined };
2858
2886
  }
2859
2887
  exports.Data_AptCall = {
2860
2888
  encode(message, writer = minimal_1.default.Writer.create()) {
2861
- if (message.call !== undefined) {
2862
- struct_1.Struct.encode(struct_1.Struct.wrap(message.call), writer.uint32(18).fork()).ldelim();
2889
+ if (message.transaction !== undefined) {
2890
+ struct_1.Struct.encode(struct_1.Struct.wrap(message.transaction), writer.uint32(18).fork()).ldelim();
2863
2891
  }
2864
2892
  return writer;
2865
2893
  },
@@ -2871,7 +2899,7 @@ exports.Data_AptCall = {
2871
2899
  const tag = reader.uint32();
2872
2900
  switch (tag >>> 3) {
2873
2901
  case 2:
2874
- message.call = struct_1.Struct.unwrap(struct_1.Struct.decode(reader, reader.uint32()));
2902
+ message.transaction = struct_1.Struct.unwrap(struct_1.Struct.decode(reader, reader.uint32()));
2875
2903
  break;
2876
2904
  default:
2877
2905
  reader.skipType(tag & 7);
@@ -2881,16 +2909,16 @@ exports.Data_AptCall = {
2881
2909
  return message;
2882
2910
  },
2883
2911
  fromJSON(object) {
2884
- return { call: isObject(object.call) ? object.call : undefined };
2912
+ return { transaction: isObject(object.transaction) ? object.transaction : undefined };
2885
2913
  },
2886
2914
  toJSON(message) {
2887
2915
  const obj = {};
2888
- message.call !== undefined && (obj.call = message.call);
2916
+ message.transaction !== undefined && (obj.transaction = message.transaction);
2889
2917
  return obj;
2890
2918
  },
2891
2919
  fromPartial(object) {
2892
2920
  const message = createBaseData_AptCall();
2893
- message.call = object.call ?? undefined;
2921
+ message.transaction = object.transaction ?? undefined;
2894
2922
  return message;
2895
2923
  },
2896
2924
  };
@@ -3953,6 +3981,27 @@ function base64FromBytes(arr) {
3953
3981
  return tsProtoGlobalThis.btoa(bin.join(""));
3954
3982
  }
3955
3983
  }
3984
+ function toTimestamp(date) {
3985
+ const seconds = BigInt(Math.trunc(date.getTime() / 1_000));
3986
+ const nanos = (date.getTime() % 1_000) * 1_000_000;
3987
+ return { seconds, nanos };
3988
+ }
3989
+ function fromTimestamp(t) {
3990
+ let millis = Number(t.seconds.toString()) * 1_000;
3991
+ millis += t.nanos / 1_000_000;
3992
+ return new Date(millis);
3993
+ }
3994
+ function fromJsonTimestamp(o) {
3995
+ if (o instanceof Date) {
3996
+ return o;
3997
+ }
3998
+ else if (typeof o === "string") {
3999
+ return new Date(o);
4000
+ }
4001
+ else {
4002
+ return fromTimestamp(timestamp_1.Timestamp.fromJSON(o));
4003
+ }
4004
+ }
3956
4005
  function longToBigint(long) {
3957
4006
  return BigInt(long.toString());
3958
4007
  }