@xyo-network/xl1-protocol-sdk 1.16.23 → 1.16.24
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/dist/neutral/config/Config.d.ts +9 -4
- package/dist/neutral/config/Config.d.ts.map +1 -1
- package/dist/neutral/config/Producer.d.ts +0 -1
- package/dist/neutral/config/Producer.d.ts.map +1 -1
- package/dist/neutral/config/Services.d.ts +6 -0
- package/dist/neutral/config/Services.d.ts.map +1 -0
- package/dist/neutral/config/Telemetry.d.ts +16 -0
- package/dist/neutral/config/Telemetry.d.ts.map +1 -1
- package/dist/neutral/index.mjs +83 -70
- package/dist/neutral/index.mjs.map +1 -1
- package/dist/neutral/provider/viewer/XyoViewer.d.ts +2 -2
- package/dist/neutral/provider/viewer/XyoViewer.d.ts.map +1 -1
- package/dist/neutral/viewers/AccountBalance.d.ts +2 -2
- package/dist/neutral/viewers/AccountBalance.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/config/Config.ts +2 -2
- package/src/config/Producer.ts +0 -6
- package/src/config/Services.ts +12 -0
- package/src/config/Telemetry.ts +19 -0
- package/src/provider/viewer/XyoViewer.ts +2 -1
- package/src/viewers/AccountBalance.ts +4 -4
- package/dist/neutral/config/App.d.ts +0 -6
- package/dist/neutral/config/App.d.ts.map +0 -1
- package/src/config/App.ts +0 -13
|
@@ -17,9 +17,6 @@ export declare const ConfigZod: z.ZodObject<{
|
|
|
17
17
|
mnemonic: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
18
18
|
port: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
19
19
|
}, z.core.$strip>>;
|
|
20
|
-
app: z.ZodDefault<z.ZodObject<{
|
|
21
|
-
port: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
22
|
-
}, z.core.$strip>>;
|
|
23
20
|
bridge: z.ZodDefault<z.ZodObject<{
|
|
24
21
|
host: z.ZodDefault<z.ZodString>;
|
|
25
22
|
mnemonic: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
@@ -47,7 +44,6 @@ export declare const ConfigZod: z.ZodObject<{
|
|
|
47
44
|
}, z.core.$strip>>;
|
|
48
45
|
producer: z.ZodDefault<z.ZodObject<{
|
|
49
46
|
allowlist: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/hex").Address, string>>>>>;
|
|
50
|
-
apiEndpoint: z.ZodOptional<z.ZodString>;
|
|
51
47
|
disableIntentRedeclaration: z.ZodOptional<z.ZodBoolean>;
|
|
52
48
|
healthCheckPort: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
53
49
|
heartbeatInterval: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
@@ -62,6 +58,9 @@ export declare const ConfigZod: z.ZodObject<{
|
|
|
62
58
|
mnemonic: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
63
59
|
port: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
64
60
|
}, z.core.$strip>>;
|
|
61
|
+
services: z.ZodDefault<z.ZodObject<{
|
|
62
|
+
accountBalanceViewerEndpoint: z.ZodOptional<z.ZodString>;
|
|
63
|
+
}, z.core.$strip>>;
|
|
65
64
|
storage: z.ZodDefault<z.ZodObject<{
|
|
66
65
|
mongo: z.ZodOptional<z.ZodObject<{
|
|
67
66
|
connectionString: z.ZodOptional<z.ZodString>;
|
|
@@ -73,6 +72,12 @@ export declare const ConfigZod: z.ZodObject<{
|
|
|
73
72
|
root: z.ZodOptional<z.ZodString>;
|
|
74
73
|
}, z.core.$strip>>;
|
|
75
74
|
telemetry: z.ZodDefault<z.ZodObject<{
|
|
75
|
+
metrics: z.ZodOptional<z.ZodObject<{
|
|
76
|
+
scrape: z.ZodObject<{
|
|
77
|
+
path: z.ZodDefault<z.ZodString>;
|
|
78
|
+
port: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
79
|
+
}, z.core.$strip>;
|
|
80
|
+
}, z.core.$strip>>;
|
|
76
81
|
otel: z.ZodOptional<z.ZodObject<{
|
|
77
82
|
otlpEndpoint: z.ZodOptional<z.ZodURL>;
|
|
78
83
|
}, z.core.$strip>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../../../src/config/Config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAexB,eAAO,MAAM,qBAAqB;;;;;;;;;;iBAAmF,CAAA;AAErH,eAAO,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../../../src/config/Config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAexB,eAAO,MAAM,qBAAqB;;;;;;;;;;iBAAmF,CAAA;AAErH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAapB,CAAA;AAEF,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC,CAAA;AAE9C,eAAO,MAAM,gBAAgB,QAAO,MAA6B,CAAA"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as z from 'zod';
|
|
2
2
|
export declare const ProducerConfigZod: z.ZodObject<{
|
|
3
3
|
allowlist: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/sdk-js").Address, string>>>>>;
|
|
4
|
-
apiEndpoint: z.ZodOptional<z.ZodString>;
|
|
5
4
|
disableIntentRedeclaration: z.ZodOptional<z.ZodBoolean>;
|
|
6
5
|
healthCheckPort: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
7
6
|
heartbeatInterval: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Producer.d.ts","sourceRoot":"","sources":["../../../src/config/Producer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAIxB,eAAO,MAAM,iBAAiB
|
|
1
|
+
{"version":3,"file":"Producer.d.ts","sourceRoot":"","sources":["../../../src/config/Producer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAIxB,eAAO,MAAM,iBAAiB;;;;;;;;;iBAoD5B,CAAA;AAEF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Services.d.ts","sourceRoot":"","sources":["../../../src/config/Services.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAExB,eAAO,MAAM,iBAAiB;;iBAM5B,CAAA;AAEF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAA"}
|
|
@@ -1,8 +1,24 @@
|
|
|
1
1
|
import * as z from 'zod';
|
|
2
|
+
export declare const MetricsScrapeConfigZod: z.ZodObject<{
|
|
3
|
+
path: z.ZodDefault<z.ZodString>;
|
|
4
|
+
port: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
5
|
+
}, z.core.$strip>;
|
|
6
|
+
export declare const MetricsConfigZod: z.ZodObject<{
|
|
7
|
+
scrape: z.ZodObject<{
|
|
8
|
+
path: z.ZodDefault<z.ZodString>;
|
|
9
|
+
port: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
10
|
+
}, z.core.$strip>;
|
|
11
|
+
}, z.core.$strip>;
|
|
2
12
|
export declare const OpenTelemetryConfigZod: z.ZodObject<{
|
|
3
13
|
otlpEndpoint: z.ZodOptional<z.ZodURL>;
|
|
4
14
|
}, z.core.$strip>;
|
|
5
15
|
export declare const TelemetryConfigZod: z.ZodObject<{
|
|
16
|
+
metrics: z.ZodOptional<z.ZodObject<{
|
|
17
|
+
scrape: z.ZodObject<{
|
|
18
|
+
path: z.ZodDefault<z.ZodString>;
|
|
19
|
+
port: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
20
|
+
}, z.core.$strip>;
|
|
21
|
+
}, z.core.$strip>>;
|
|
6
22
|
otel: z.ZodOptional<z.ZodObject<{
|
|
7
23
|
otlpEndpoint: z.ZodOptional<z.ZodURL>;
|
|
8
24
|
}, z.core.$strip>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Telemetry.d.ts","sourceRoot":"","sources":["../../../src/config/Telemetry.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAExB,eAAO,MAAM,sBAAsB;;iBAOjC,CAAA;AAEF,eAAO,MAAM,kBAAkB
|
|
1
|
+
{"version":3,"file":"Telemetry.d.ts","sourceRoot":"","sources":["../../../src/config/Telemetry.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAExB,eAAO,MAAM,sBAAsB;;;iBAaQ,CAAA;AAE3C,eAAO,MAAM,gBAAgB;;;;;iBAAyF,CAAA;AAEtH,eAAO,MAAM,sBAAsB;;iBAOjC,CAAA;AAEF,eAAO,MAAM,kBAAkB;;;;;;;;;;iBAKe,CAAA;AAE9C,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAA"}
|
package/dist/neutral/index.mjs
CHANGED
|
@@ -1040,34 +1040,22 @@ var ApiConfigZod = z2.object({
|
|
|
1040
1040
|
})
|
|
1041
1041
|
});
|
|
1042
1042
|
|
|
1043
|
-
// src/config/
|
|
1043
|
+
// src/config/Bridge.ts
|
|
1044
1044
|
import { globalRegistry as globalRegistry2 } from "zod";
|
|
1045
1045
|
import * as z3 from "zod";
|
|
1046
|
-
var
|
|
1047
|
-
|
|
1048
|
-
default: 3e3,
|
|
1049
|
-
description: "Port for the application",
|
|
1050
|
-
title: "app.port",
|
|
1051
|
-
type: "number"
|
|
1052
|
-
})
|
|
1053
|
-
});
|
|
1054
|
-
|
|
1055
|
-
// src/config/Bridge.ts
|
|
1056
|
-
import { globalRegistry as globalRegistry3 } from "zod";
|
|
1057
|
-
import * as z4 from "zod";
|
|
1058
|
-
var BridgeConfigZod = z4.object({
|
|
1059
|
-
host: z4.string().default("localhost").register(globalRegistry3, {
|
|
1046
|
+
var BridgeConfigZod = z3.object({
|
|
1047
|
+
host: z3.string().default("localhost").register(globalRegistry2, {
|
|
1060
1048
|
default: "localhost",
|
|
1061
1049
|
description: "Host for the Bridge",
|
|
1062
1050
|
title: "api.host",
|
|
1063
1051
|
type: "string"
|
|
1064
1052
|
}),
|
|
1065
|
-
mnemonic: MnemonicStringZod.optional().register(
|
|
1053
|
+
mnemonic: MnemonicStringZod.optional().register(globalRegistry2, {
|
|
1066
1054
|
description: "Mnemonic for the Bridge wallet",
|
|
1067
1055
|
title: "api.mnemonic",
|
|
1068
1056
|
type: "string"
|
|
1069
1057
|
}),
|
|
1070
|
-
port:
|
|
1058
|
+
port: z3.coerce.number().default(8081).register(globalRegistry2, {
|
|
1071
1059
|
default: 8081,
|
|
1072
1060
|
description: "Port for the Bridge",
|
|
1073
1061
|
title: "api.port",
|
|
@@ -1077,15 +1065,15 @@ var BridgeConfigZod = z4.object({
|
|
|
1077
1065
|
|
|
1078
1066
|
// src/config/Chain.ts
|
|
1079
1067
|
import { AddressZod } from "@xylabs/sdk-js";
|
|
1080
|
-
import { globalRegistry as
|
|
1081
|
-
import * as
|
|
1082
|
-
var ChainConfigZod =
|
|
1083
|
-
id:
|
|
1068
|
+
import { globalRegistry as globalRegistry3 } from "zod";
|
|
1069
|
+
import * as z4 from "zod";
|
|
1070
|
+
var ChainConfigZod = z4.object({
|
|
1071
|
+
id: z4.string().optional().register(globalRegistry3, {
|
|
1084
1072
|
description: "The unique identifier for the chain. Should be the staking contract address for contract-backed chains.",
|
|
1085
1073
|
title: "chain.id",
|
|
1086
1074
|
type: "string"
|
|
1087
1075
|
}),
|
|
1088
|
-
genesisRewardAddress: AddressZod.optional().register(
|
|
1076
|
+
genesisRewardAddress: AddressZod.optional().register(globalRegistry3, {
|
|
1089
1077
|
description: "Address to send the initial genesis rewards to, if a new chain is being created.",
|
|
1090
1078
|
title: "chain.genesisRewardAddress",
|
|
1091
1079
|
type: "Address"
|
|
@@ -1093,29 +1081,29 @@ var ChainConfigZod = z5.object({
|
|
|
1093
1081
|
});
|
|
1094
1082
|
|
|
1095
1083
|
// src/config/Evm.ts
|
|
1096
|
-
import { globalRegistry as
|
|
1097
|
-
import * as
|
|
1098
|
-
var EvmInfuraConfigZod =
|
|
1099
|
-
projectId:
|
|
1084
|
+
import { globalRegistry as globalRegistry4 } from "zod";
|
|
1085
|
+
import * as z5 from "zod";
|
|
1086
|
+
var EvmInfuraConfigZod = z5.object({
|
|
1087
|
+
projectId: z5.string().optional().register(globalRegistry4, {
|
|
1100
1088
|
description: "Infura project ID",
|
|
1101
1089
|
title: "evm.infura.projectId",
|
|
1102
1090
|
type: "string"
|
|
1103
1091
|
}),
|
|
1104
|
-
projectSecret:
|
|
1092
|
+
projectSecret: z5.string().optional().register(globalRegistry4, {
|
|
1105
1093
|
description: "Infura project secret",
|
|
1106
1094
|
title: "evm.infura.projectSecret",
|
|
1107
1095
|
type: "string"
|
|
1108
1096
|
})
|
|
1109
1097
|
});
|
|
1110
|
-
var EvmJsonRpcConfigZod =
|
|
1111
|
-
url:
|
|
1098
|
+
var EvmJsonRpcConfigZod = z5.object({
|
|
1099
|
+
url: z5.url().optional().register(globalRegistry4, {
|
|
1112
1100
|
description: "JSON-RPC URL",
|
|
1113
1101
|
title: "evm.jsonRpc.url",
|
|
1114
1102
|
type: "string"
|
|
1115
1103
|
})
|
|
1116
1104
|
});
|
|
1117
|
-
var EvmConfigZod =
|
|
1118
|
-
chainId:
|
|
1105
|
+
var EvmConfigZod = z5.object({
|
|
1106
|
+
chainId: z5.string().optional().register(globalRegistry4, {
|
|
1119
1107
|
description: "EVM chain ID",
|
|
1120
1108
|
title: "evm.chainId",
|
|
1121
1109
|
type: "string"
|
|
@@ -1126,18 +1114,18 @@ var EvmConfigZod = z6.object({
|
|
|
1126
1114
|
|
|
1127
1115
|
// src/config/Log.ts
|
|
1128
1116
|
import { LogLevel } from "@xylabs/sdk-js";
|
|
1129
|
-
import { globalRegistry as
|
|
1130
|
-
import * as
|
|
1117
|
+
import { globalRegistry as globalRegistry5 } from "zod";
|
|
1118
|
+
import * as z6 from "zod";
|
|
1131
1119
|
var LogLevels = Object.keys(LogLevel);
|
|
1132
|
-
var LogConfigZod =
|
|
1133
|
-
logLevel:
|
|
1120
|
+
var LogConfigZod = z6.object({
|
|
1121
|
+
logLevel: z6.enum(LogLevels).default("info").register(globalRegistry5, {
|
|
1134
1122
|
choices: LogLevels,
|
|
1135
1123
|
default: "info",
|
|
1136
1124
|
description: "Desired process verbosity",
|
|
1137
1125
|
title: "logLevel",
|
|
1138
1126
|
type: "string"
|
|
1139
1127
|
}),
|
|
1140
|
-
silent:
|
|
1128
|
+
silent: z6.boolean().default(false).register(globalRegistry5, {
|
|
1141
1129
|
default: false,
|
|
1142
1130
|
description: "Whether to run in silent mode",
|
|
1143
1131
|
title: "silent",
|
|
@@ -1146,10 +1134,10 @@ var LogConfigZod = z7.object({
|
|
|
1146
1134
|
});
|
|
1147
1135
|
|
|
1148
1136
|
// src/config/Mempool.ts
|
|
1149
|
-
import { globalRegistry as
|
|
1150
|
-
import * as
|
|
1151
|
-
var MempoolConfigZod =
|
|
1152
|
-
enabled:
|
|
1137
|
+
import { globalRegistry as globalRegistry6 } from "zod";
|
|
1138
|
+
import * as z7 from "zod";
|
|
1139
|
+
var MempoolConfigZod = z7.object({
|
|
1140
|
+
enabled: z7.string().default("false").transform((val, ctx) => {
|
|
1153
1141
|
const normalized = val.toLowerCase().trim();
|
|
1154
1142
|
if ([
|
|
1155
1143
|
"true",
|
|
@@ -1168,25 +1156,25 @@ var MempoolConfigZod = z8.object({
|
|
|
1168
1156
|
expected: "boolean",
|
|
1169
1157
|
message: `Invalid boolean value: "${val}". Use true/false, 1/0, yes/no.`
|
|
1170
1158
|
});
|
|
1171
|
-
return
|
|
1172
|
-
}).register(
|
|
1159
|
+
return z7.NEVER;
|
|
1160
|
+
}).register(globalRegistry6, {
|
|
1173
1161
|
default: "false",
|
|
1174
1162
|
description: "Enable the Mempool",
|
|
1175
1163
|
title: "mempool.enabled",
|
|
1176
1164
|
type: "boolean"
|
|
1177
1165
|
}),
|
|
1178
|
-
host:
|
|
1166
|
+
host: z7.string().default("localhost").register(globalRegistry6, {
|
|
1179
1167
|
default: "localhost",
|
|
1180
1168
|
description: "Host for the Mempool",
|
|
1181
1169
|
title: "mempool.host",
|
|
1182
1170
|
type: "string"
|
|
1183
1171
|
}),
|
|
1184
|
-
mnemonic: MnemonicStringZod.optional().register(
|
|
1172
|
+
mnemonic: MnemonicStringZod.optional().register(globalRegistry6, {
|
|
1185
1173
|
description: "Mnemonic for the Mempool wallet",
|
|
1186
1174
|
title: "mempool.mnemonic",
|
|
1187
1175
|
type: "string"
|
|
1188
1176
|
}),
|
|
1189
|
-
port:
|
|
1177
|
+
port: z7.coerce.number().default(8083).register(globalRegistry6, {
|
|
1190
1178
|
default: 8083,
|
|
1191
1179
|
description: "Port for the Mempool",
|
|
1192
1180
|
title: "mempool.port",
|
|
@@ -1196,60 +1184,55 @@ var MempoolConfigZod = z8.object({
|
|
|
1196
1184
|
|
|
1197
1185
|
// src/config/Producer.ts
|
|
1198
1186
|
import { AddressZod as AddressZod2, asAddress as asAddress3 } from "@xylabs/sdk-js";
|
|
1199
|
-
import { globalRegistry as
|
|
1200
|
-
import * as
|
|
1201
|
-
var ProducerConfigZod =
|
|
1202
|
-
allowlist:
|
|
1187
|
+
import { globalRegistry as globalRegistry7 } from "zod";
|
|
1188
|
+
import * as z8 from "zod";
|
|
1189
|
+
var ProducerConfigZod = z8.object({
|
|
1190
|
+
allowlist: z8.preprocess((val) => {
|
|
1203
1191
|
if (typeof val === "string") {
|
|
1204
1192
|
return val.split(",").map((s) => asAddress3(s.trim()));
|
|
1205
1193
|
}
|
|
1206
1194
|
return val;
|
|
1207
|
-
},
|
|
1195
|
+
}, z8.array(AddressZod2).optional().register(globalRegistry7, {
|
|
1208
1196
|
description: "List of allowed producer addresses, if undefined anyone can participate",
|
|
1209
1197
|
title: "allowlist",
|
|
1210
1198
|
type: "array"
|
|
1211
1199
|
})),
|
|
1212
|
-
|
|
1213
|
-
description: "Endpoint of the API to use for chain data",
|
|
1214
|
-
title: "producer.apiEndpoint",
|
|
1215
|
-
type: "string"
|
|
1216
|
-
}),
|
|
1217
|
-
disableIntentRedeclaration: z9.boolean().optional().register(globalRegistry8, {
|
|
1200
|
+
disableIntentRedeclaration: z8.boolean().optional().register(globalRegistry7, {
|
|
1218
1201
|
description: "Should the producer skip redeclaring their intent to continue producing blocks",
|
|
1219
1202
|
title: "producer.disableIntentRedeclaration",
|
|
1220
1203
|
type: "boolean"
|
|
1221
1204
|
}),
|
|
1222
1205
|
// TODO: Port schema
|
|
1223
|
-
healthCheckPort:
|
|
1206
|
+
healthCheckPort: z8.coerce.number().optional().register(globalRegistry7, {
|
|
1224
1207
|
description: "Port for the Producer health checks",
|
|
1225
1208
|
title: "producer.healthCheckPort",
|
|
1226
1209
|
type: "number"
|
|
1227
1210
|
}),
|
|
1228
|
-
heartbeatInterval:
|
|
1211
|
+
heartbeatInterval: z8.coerce.number().default(36e5).register(globalRegistry7, {
|
|
1229
1212
|
description: "The number of milliseconds between heartbeats if no blocks are produced",
|
|
1230
1213
|
title: "producer.heartbeatInterval",
|
|
1231
1214
|
type: "number"
|
|
1232
1215
|
}),
|
|
1233
1216
|
// TODO: BigInt schema
|
|
1234
|
-
minStake:
|
|
1217
|
+
minStake: z8.coerce.number().default(1).register(globalRegistry7, {
|
|
1235
1218
|
description: "Minimum stake required to be a Producer",
|
|
1236
1219
|
title: "producer.minStake",
|
|
1237
1220
|
type: "number"
|
|
1238
1221
|
}),
|
|
1239
|
-
mnemonic: MnemonicStringZod.optional().register(
|
|
1222
|
+
mnemonic: MnemonicStringZod.optional().register(globalRegistry7, {
|
|
1240
1223
|
description: "Mnemonic for the Producer wallet",
|
|
1241
1224
|
title: "producer.mnemonic",
|
|
1242
1225
|
type: "string"
|
|
1243
1226
|
}),
|
|
1244
1227
|
// TODO: Port schema
|
|
1245
|
-
port:
|
|
1228
|
+
port: z8.coerce.number().default(8081).register(globalRegistry7, {
|
|
1246
1229
|
default: 8081,
|
|
1247
1230
|
description: "Port for the Producer",
|
|
1248
1231
|
title: "producer.port",
|
|
1249
1232
|
type: "number"
|
|
1250
1233
|
}),
|
|
1251
1234
|
// TODO: Address schema
|
|
1252
|
-
rewardAddress:
|
|
1235
|
+
rewardAddress: z8.string().optional().register(globalRegistry7, {
|
|
1253
1236
|
description: "Address to receive block rewards",
|
|
1254
1237
|
title: "producer.rewardAddress",
|
|
1255
1238
|
type: "string"
|
|
@@ -1257,27 +1240,27 @@ var ProducerConfigZod = z9.object({
|
|
|
1257
1240
|
});
|
|
1258
1241
|
|
|
1259
1242
|
// src/config/RewardRedemptionApi.ts
|
|
1260
|
-
import { globalRegistry as
|
|
1261
|
-
import * as
|
|
1262
|
-
var RewardRedemptionApiConfigZod =
|
|
1263
|
-
chainRpcApiUrl:
|
|
1243
|
+
import { globalRegistry as globalRegistry8 } from "zod";
|
|
1244
|
+
import * as z9 from "zod";
|
|
1245
|
+
var RewardRedemptionApiConfigZod = z9.object({
|
|
1246
|
+
chainRpcApiUrl: z9.string().default("http://localhost:8080/rpc").register(globalRegistry8, {
|
|
1264
1247
|
default: "http://localhost:8080/rpc",
|
|
1265
1248
|
description: "URL for the Chain RPC API",
|
|
1266
1249
|
title: "rewardRedemptionApi.chainRpcApiUrl",
|
|
1267
1250
|
type: "string"
|
|
1268
1251
|
}),
|
|
1269
|
-
host:
|
|
1252
|
+
host: z9.string().default("localhost").register(globalRegistry8, {
|
|
1270
1253
|
default: "localhost",
|
|
1271
1254
|
description: "Host for the Redemption API",
|
|
1272
1255
|
title: "rewardRedemptionApi.host",
|
|
1273
1256
|
type: "string"
|
|
1274
1257
|
}),
|
|
1275
|
-
mnemonic: MnemonicStringZod.optional().register(
|
|
1258
|
+
mnemonic: MnemonicStringZod.optional().register(globalRegistry8, {
|
|
1276
1259
|
description: "Mnemonic for the Redemption API wallet",
|
|
1277
1260
|
title: "rewardRedemptionApi.mnemonic",
|
|
1278
1261
|
type: "string"
|
|
1279
1262
|
}),
|
|
1280
|
-
port:
|
|
1263
|
+
port: z9.coerce.number().default(8082).register(globalRegistry8, {
|
|
1281
1264
|
default: 8082,
|
|
1282
1265
|
description: "Port for the Redemption API",
|
|
1283
1266
|
title: "rewardRedemptionApi.port",
|
|
@@ -1285,6 +1268,17 @@ var RewardRedemptionApiConfigZod = z10.object({
|
|
|
1285
1268
|
})
|
|
1286
1269
|
});
|
|
1287
1270
|
|
|
1271
|
+
// src/config/Services.ts
|
|
1272
|
+
import { globalRegistry as globalRegistry9 } from "zod";
|
|
1273
|
+
import * as z10 from "zod";
|
|
1274
|
+
var ServicesConfigZod = z10.object({
|
|
1275
|
+
accountBalanceViewerEndpoint: z10.string().optional().register(globalRegistry9, {
|
|
1276
|
+
description: "Endpoint of the API to use for instantiating an external AccountBalanceViewer",
|
|
1277
|
+
title: "services.accountBalanceViewerEndpoint",
|
|
1278
|
+
type: "string"
|
|
1279
|
+
})
|
|
1280
|
+
});
|
|
1281
|
+
|
|
1288
1282
|
// src/config/storage/driver/Mongo.ts
|
|
1289
1283
|
import { isDefined as isDefined8, isUndefined as isUndefined2 } from "@xylabs/sdk-js";
|
|
1290
1284
|
import { globalRegistry as globalRegistry10 } from "zod";
|
|
@@ -1337,6 +1331,23 @@ var StorageConfigZod = z12.object({
|
|
|
1337
1331
|
// src/config/Telemetry.ts
|
|
1338
1332
|
import { globalRegistry as globalRegistry12 } from "zod";
|
|
1339
1333
|
import * as z13 from "zod";
|
|
1334
|
+
var MetricsScrapeConfigZod = z13.object({
|
|
1335
|
+
path: z13.string().default("/metrics").register(globalRegistry12, {
|
|
1336
|
+
default: "/metrics",
|
|
1337
|
+
description: "Path for the metrics scrape endpoint",
|
|
1338
|
+
title: "telemetry.metrics.scrape.path",
|
|
1339
|
+
type: "string"
|
|
1340
|
+
}),
|
|
1341
|
+
port: z13.coerce.number().default(9464).register(globalRegistry12, {
|
|
1342
|
+
default: 9464,
|
|
1343
|
+
description: "Port for the metrics scrape endpoint",
|
|
1344
|
+
title: "telemetry.metrics.scrape.port",
|
|
1345
|
+
type: "number"
|
|
1346
|
+
})
|
|
1347
|
+
}).describe("Metrics scrape configuration");
|
|
1348
|
+
var MetricsConfigZod = z13.object({
|
|
1349
|
+
scrape: MetricsScrapeConfigZod
|
|
1350
|
+
}).describe("Metrics configuration options");
|
|
1340
1351
|
var OpenTelemetryConfigZod = z13.object({
|
|
1341
1352
|
// OpenTelemetry options
|
|
1342
1353
|
otlpEndpoint: z13.url().optional().register(globalRegistry12, {
|
|
@@ -1346,6 +1357,8 @@ var OpenTelemetryConfigZod = z13.object({
|
|
|
1346
1357
|
})
|
|
1347
1358
|
});
|
|
1348
1359
|
var TelemetryConfigZod = z13.object({
|
|
1360
|
+
// Metrics configuration
|
|
1361
|
+
metrics: MetricsConfigZod.optional().describe("Metrics configuration"),
|
|
1349
1362
|
// OpenTelemetry configuration
|
|
1350
1363
|
otel: OpenTelemetryConfigZod.optional().describe("OpenTelemetry configuration")
|
|
1351
1364
|
}).describe("Telemetry configuration options");
|
|
@@ -1384,13 +1397,13 @@ var Xl1CommonConfigSchema = z15.object({
|
|
|
1384
1397
|
var ConfigZod = z15.object({
|
|
1385
1398
|
...Xl1CommonConfigSchema.shape,
|
|
1386
1399
|
api: ApiConfigZod.default(ApiConfigZod.parse({})).describe("Configuration for the API node"),
|
|
1387
|
-
app: AppConfigZod.default(AppConfigZod.parse({})).describe("Configuration for the application"),
|
|
1388
1400
|
bridge: BridgeConfigZod.default(BridgeConfigZod.parse({})).describe("Configuration for the Bridge node"),
|
|
1389
1401
|
chain: ChainConfigZod.default(ChainConfigZod.parse({})).describe("Configuration for the chain"),
|
|
1390
1402
|
evm: EvmConfigZod.default(EvmConfigZod.parse({})).describe("Configuration for EVM-backed services"),
|
|
1391
1403
|
mempool: MempoolConfigZod.default(MempoolConfigZod.parse({})).describe("Configuration for the mempool"),
|
|
1392
1404
|
producer: ProducerConfigZod.default(ProducerConfigZod.parse({})).describe("Configuration for the producer"),
|
|
1393
1405
|
rewardRedemptionApi: RewardRedemptionApiConfigZod.default(RewardRedemptionApiConfigZod.parse({})).describe("Configuration for the rewards redemption API"),
|
|
1406
|
+
services: ServicesConfigZod.default(ServicesConfigZod.parse({})).describe("Configuration for the global services"),
|
|
1394
1407
|
storage: StorageConfigZod.default(StorageConfigZod.parse({})).describe("Configuration for the storage"),
|
|
1395
1408
|
telemetry: TelemetryConfigZod.default(TelemetryConfigZod.parse({})).describe("Configuration for telemetry"),
|
|
1396
1409
|
validation: ValidationConfigZod.default(ValidationConfigZod.parse({})).describe("Configuration for validation")
|