@sentio/sdk 1.33.1 → 1.33.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.
@@ -4,6 +4,51 @@ import Long from "long";
4
4
  import { Empty } from "../../google/protobuf/empty";
5
5
  import _m0 from "protobufjs/minimal";
6
6
 
7
+ export enum MetricType {
8
+ UNKNOWN_TYPE = 0,
9
+ COUNTER = 1,
10
+ GAUGE = 2,
11
+ HISTOGRAM = 3,
12
+ UNRECOGNIZED = -1,
13
+ }
14
+
15
+ export function metricTypeFromJSON(object: any): MetricType {
16
+ switch (object) {
17
+ case 0:
18
+ case "UNKNOWN_TYPE":
19
+ return MetricType.UNKNOWN_TYPE;
20
+ case 1:
21
+ case "COUNTER":
22
+ return MetricType.COUNTER;
23
+ case 2:
24
+ case "GAUGE":
25
+ return MetricType.GAUGE;
26
+ case 3:
27
+ case "HISTOGRAM":
28
+ return MetricType.HISTOGRAM;
29
+ case -1:
30
+ case "UNRECOGNIZED":
31
+ default:
32
+ return MetricType.UNRECOGNIZED;
33
+ }
34
+ }
35
+
36
+ export function metricTypeToJSON(object: MetricType): string {
37
+ switch (object) {
38
+ case MetricType.UNKNOWN_TYPE:
39
+ return "UNKNOWN_TYPE";
40
+ case MetricType.COUNTER:
41
+ return "COUNTER";
42
+ case MetricType.GAUGE:
43
+ return "GAUGE";
44
+ case MetricType.HISTOGRAM:
45
+ return "HISTOGRAM";
46
+ case MetricType.UNRECOGNIZED:
47
+ default:
48
+ return "UNRECOGNIZED";
49
+ }
50
+ }
51
+
7
52
  export enum AggregationType {
8
53
  COUNT = 0,
9
54
  SUM = 1,
@@ -297,6 +342,7 @@ export interface MetricConfig {
297
342
  unit: string;
298
343
  sparse: boolean;
299
344
  resolutionInSeconds: number;
345
+ type: MetricType;
300
346
  aggregationConfig: AggregationConfig | undefined;
301
347
  }
302
348
 
@@ -1443,6 +1489,7 @@ function createBaseMetricConfig(): MetricConfig {
1443
1489
  unit: "",
1444
1490
  sparse: false,
1445
1491
  resolutionInSeconds: 0,
1492
+ type: 0,
1446
1493
  aggregationConfig: undefined,
1447
1494
  };
1448
1495
  }
@@ -1467,6 +1514,9 @@ export const MetricConfig = {
1467
1514
  if (message.resolutionInSeconds !== 0) {
1468
1515
  writer.uint32(40).int32(message.resolutionInSeconds);
1469
1516
  }
1517
+ if (message.type !== 0) {
1518
+ writer.uint32(56).int32(message.type);
1519
+ }
1470
1520
  if (message.aggregationConfig !== undefined) {
1471
1521
  AggregationConfig.encode(
1472
1522
  message.aggregationConfig,
@@ -1498,6 +1548,9 @@ export const MetricConfig = {
1498
1548
  case 5:
1499
1549
  message.resolutionInSeconds = reader.int32();
1500
1550
  break;
1551
+ case 7:
1552
+ message.type = reader.int32() as any;
1553
+ break;
1501
1554
  case 6:
1502
1555
  message.aggregationConfig = AggregationConfig.decode(
1503
1556
  reader,
@@ -1521,6 +1574,7 @@ export const MetricConfig = {
1521
1574
  resolutionInSeconds: isSet(object.resolutionInSeconds)
1522
1575
  ? Number(object.resolutionInSeconds)
1523
1576
  : 0,
1577
+ type: isSet(object.type) ? metricTypeFromJSON(object.type) : 0,
1524
1578
  aggregationConfig: isSet(object.aggregationConfig)
1525
1579
  ? AggregationConfig.fromJSON(object.aggregationConfig)
1526
1580
  : undefined,
@@ -1536,6 +1590,7 @@ export const MetricConfig = {
1536
1590
  message.sparse !== undefined && (obj.sparse = message.sparse);
1537
1591
  message.resolutionInSeconds !== undefined &&
1538
1592
  (obj.resolutionInSeconds = Math.round(message.resolutionInSeconds));
1593
+ message.type !== undefined && (obj.type = metricTypeToJSON(message.type));
1539
1594
  message.aggregationConfig !== undefined &&
1540
1595
  (obj.aggregationConfig = message.aggregationConfig
1541
1596
  ? AggregationConfig.toJSON(message.aggregationConfig)
@@ -1550,6 +1605,7 @@ export const MetricConfig = {
1550
1605
  message.unit = object.unit ?? "";
1551
1606
  message.sparse = object.sparse ?? false;
1552
1607
  message.resolutionInSeconds = object.resolutionInSeconds ?? 0;
1608
+ message.type = object.type ?? 0;
1553
1609
  message.aggregationConfig =
1554
1610
  object.aggregationConfig !== undefined &&
1555
1611
  object.aggregationConfig !== null
package/src/service.ts CHANGED
@@ -46,7 +46,6 @@ import { AccountProcessorState } from './core/account-processor'
46
46
  import { SuiProcessorState } from './core/sui-processor'
47
47
  import { SolanaProcessorState } from './core/solana-processor'
48
48
  import { ProcessorState } from './binds'
49
-
50
49
  ;(BigInt.prototype as any).toJSON = function () {
51
50
  return this.toString()
52
51
  }
@@ -118,7 +117,7 @@ export class ProcessorServiceImpl implements ProcessorServiceImplementation {
118
117
  // part 0, prepare metrics and event tracking configs
119
118
  for (const metric of MetricState.INSTANCE.getValues()) {
120
119
  this.metricConfigs.push({
121
- ...metric.descriptor,
120
+ ...metric.config,
122
121
  })
123
122
  }
124
123
 
@@ -73,6 +73,7 @@ export const CHAIN_MAP: Record<string, string> = {
73
73
  71402: 'godwoken',
74
74
  200625: 'akroma',
75
75
  333999: 'polis',
76
+ 421613: 'arbitrum test',
76
77
  11155111: 'sepolia',
77
78
  1313161554: 'aurora',
78
79
  1666600000: 'harmony',