@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.
- package/lib/core/meter.d.ts +2 -8
- package/lib/core/meter.js +15 -18
- package/lib/core/meter.js.map +1 -1
- package/lib/core/numberish.js +10 -2
- package/lib/core/numberish.js.map +1 -1
- package/lib/gen/chainquery/protos/chainquery.d.ts +25 -2
- package/lib/gen/chainquery/protos/chainquery.js +49 -9
- package/lib/gen/chainquery/protos/chainquery.js.map +1 -1
- package/lib/gen/processor/protos/processor.d.ts +10 -0
- package/lib/gen/processor/protos/processor.js +57 -2
- package/lib/gen/processor/protos/processor.js.map +1 -1
- package/lib/service.js +1 -1
- package/lib/service.js.map +1 -1
- package/lib/utils/chain.js +1 -0
- package/lib/utils/chain.js.map +1 -1
- package/package.json +1 -1
- package/src/core/meter.ts +16 -18
- package/src/core/numberish.ts +11 -2
- package/src/gen/chainquery/protos/chainquery.ts +60 -11
- package/src/gen/processor/protos/processor.ts +56 -0
- package/src/service.ts +1 -2
- package/src/utils/chain.ts +1 -0
|
@@ -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.
|
|
120
|
+
...metric.config,
|
|
122
121
|
})
|
|
123
122
|
}
|
|
124
123
|
|