@xyo-network/xl1-protocol-sdk 3.0.10 → 3.0.12
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/Archivists/ArchivistFactory.d.ts +3 -3
- package/dist/neutral/Archivists/ArchivistFactory.d.ts.map +1 -1
- package/dist/neutral/Archivists/MemoryArchivistFactory.d.ts +3 -3
- package/dist/neutral/Archivists/MemoryArchivistFactory.d.ts.map +1 -1
- package/dist/neutral/Archivists/archivistFactoryRegistry.d.ts +3 -3
- package/dist/neutral/Archivists/archivistFactoryRegistry.d.ts.map +1 -1
- package/dist/neutral/CreatableProvider/AbstractCreatableProvider.d.ts +0 -2
- package/dist/neutral/CreatableProvider/AbstractCreatableProvider.d.ts.map +1 -1
- package/dist/neutral/CreatableProvider/CreatableProvider.d.ts +3 -3
- package/dist/neutral/CreatableProvider/CreatableProvider.d.ts.map +1 -1
- package/dist/neutral/capabilities/connectionTypes.d.ts +2 -2
- package/dist/neutral/capabilities/connectionTypes.d.ts.map +1 -1
- package/dist/neutral/capabilities/needsFromProviderBindings.d.ts +2 -2
- package/dist/neutral/capabilities/needsFromProviderBindings.d.ts.map +1 -1
- package/dist/neutral/capabilities/resolveProviders.d.ts +2 -3
- package/dist/neutral/capabilities/resolveProviders.d.ts.map +1 -1
- package/dist/neutral/config/Actor.d.ts +0 -12
- package/dist/neutral/config/Actor.d.ts.map +1 -1
- package/dist/neutral/config/Actors.d.ts +0 -2
- package/dist/neutral/config/Actors.d.ts.map +1 -1
- package/dist/neutral/config/Base.d.ts +0 -2
- package/dist/neutral/config/Base.d.ts.map +1 -1
- package/dist/neutral/config/Config.d.ts +0 -8
- package/dist/neutral/config/Config.d.ts.map +1 -1
- package/dist/neutral/config/HostActor.d.ts +0 -12
- package/dist/neutral/config/HostActor.d.ts.map +1 -1
- package/dist/neutral/config/ProviderBinding.d.ts +0 -2
- package/dist/neutral/config/ProviderBinding.d.ts.map +1 -1
- package/dist/neutral/config/{transports/Transport.d.ts → connections/Connection.d.ts} +29 -29
- package/dist/neutral/config/connections/Connection.d.ts.map +1 -0
- package/dist/neutral/config/connections/Mongo.d.ts.map +1 -0
- package/dist/neutral/config/{transports/Rpc.d.ts → connections/RpcRemote.d.ts} +1 -1
- package/dist/neutral/config/connections/RpcRemote.d.ts.map +1 -0
- package/dist/neutral/config/connections/S3.d.ts.map +1 -0
- package/dist/neutral/config/connections/index.d.ts +4 -5
- package/dist/neutral/config/connections/index.d.ts.map +1 -1
- package/dist/neutral/config/index.d.ts +1 -2
- package/dist/neutral/config/index.d.ts.map +1 -1
- package/dist/neutral/config/normalizeConnectionsConfig.d.ts +2 -2
- package/dist/neutral/config/normalizeConnectionsConfig.d.ts.map +1 -1
- package/dist/neutral/config/resolveRestConnectionEndpoint.d.ts +5 -0
- package/dist/neutral/config/resolveRestConnectionEndpoint.d.ts.map +1 -0
- package/dist/neutral/context/Actor.d.ts +0 -12
- package/dist/neutral/context/Actor.d.ts.map +1 -1
- package/dist/neutral/context/HostActor.d.ts +0 -12
- package/dist/neutral/context/HostActor.d.ts.map +1 -1
- package/dist/neutral/getFileConfig.d.ts +0 -4
- package/dist/neutral/getFileConfig.d.ts.map +1 -1
- package/dist/neutral/getFileConfig.mjs +87 -136
- package/dist/neutral/getFileConfig.mjs.map +4 -4
- package/dist/neutral/index.mjs +365 -406
- package/dist/neutral/index.mjs.map +4 -4
- package/dist/neutral/model/CreatableProviderContext.zod.d.ts +0 -12
- package/dist/neutral/model/CreatableProviderContext.zod.d.ts.map +1 -1
- package/dist/neutral/simple/datalake/AbstractRestDataLake.d.ts +11 -1
- package/dist/neutral/simple/datalake/AbstractRestDataLake.d.ts.map +1 -1
- package/dist/neutral/test/index.mjs +85 -134
- package/dist/neutral/test/index.mjs.map +4 -4
- package/package.json +6 -6
- package/dist/neutral/config/DataLake/DataLake.d.ts +0 -8
- package/dist/neutral/config/DataLake/DataLake.d.ts.map +0 -1
- package/dist/neutral/config/DataLake/DataLakeRemoteConfig.d.ts +0 -8
- package/dist/neutral/config/DataLake/DataLakeRemoteConfig.d.ts.map +0 -1
- package/dist/neutral/config/DataLake/RestDataLakeConfig.d.ts +0 -9
- package/dist/neutral/config/DataLake/RestDataLakeConfig.d.ts.map +0 -1
- package/dist/neutral/config/DataLake/RouterDataLakeConfig.d.ts +0 -10
- package/dist/neutral/config/DataLake/RouterDataLakeConfig.d.ts.map +0 -1
- package/dist/neutral/config/DataLake/index.d.ts +0 -5
- package/dist/neutral/config/DataLake/index.d.ts.map +0 -1
- package/dist/neutral/config/transports/Mongo.d.ts.map +0 -1
- package/dist/neutral/config/transports/Rpc.d.ts.map +0 -1
- package/dist/neutral/config/transports/S3.d.ts.map +0 -1
- package/dist/neutral/config/transports/Transport.d.ts.map +0 -1
- package/dist/neutral/config/transports/index.d.ts +0 -5
- package/dist/neutral/config/transports/index.d.ts.map +0 -1
- /package/dist/neutral/config/{transports → connections}/Mongo.d.ts +0 -0
- /package/dist/neutral/config/{transports → connections}/S3.d.ts +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// src/getFileConfig.ts
|
|
2
2
|
import { isDefined, isNull } from "@xylabs/sdk-js";
|
|
3
3
|
import { cosmiconfig } from "cosmiconfig";
|
|
4
|
-
import { z as
|
|
4
|
+
import { z as z15 } from "zod/mini";
|
|
5
5
|
|
|
6
6
|
// src/config/Actor.ts
|
|
7
7
|
import {
|
|
@@ -9,10 +9,10 @@ import {
|
|
|
9
9
|
zodIsFactory as zodIsFactory2,
|
|
10
10
|
zodToFactory as zodToFactory2
|
|
11
11
|
} from "@xylabs/sdk-js";
|
|
12
|
-
import { globalRegistry as
|
|
12
|
+
import { globalRegistry as globalRegistry8, z as z12 } from "zod/mini";
|
|
13
13
|
|
|
14
14
|
// src/config/Base.ts
|
|
15
|
-
import { z as
|
|
15
|
+
import { z as z11 } from "zod/mini";
|
|
16
16
|
|
|
17
17
|
// src/config/Chain.ts
|
|
18
18
|
import { HexZod } from "@xylabs/sdk-js";
|
|
@@ -31,10 +31,10 @@ var ChainConfigZod = z.object({
|
|
|
31
31
|
})
|
|
32
32
|
});
|
|
33
33
|
|
|
34
|
-
// src/config/
|
|
34
|
+
// src/config/connections/Connection.ts
|
|
35
35
|
import { globalRegistry as globalRegistry3, z as z4 } from "zod";
|
|
36
36
|
|
|
37
|
-
// src/config/
|
|
37
|
+
// src/config/connections/Mongo.ts
|
|
38
38
|
import { globalRegistry as globalRegistry2, z as z2 } from "zod";
|
|
39
39
|
var MongoConfigZod = z2.object({
|
|
40
40
|
// TODO: Create from other arguments
|
|
@@ -65,7 +65,7 @@ var MongoConfigZod = z2.object({
|
|
|
65
65
|
})
|
|
66
66
|
});
|
|
67
67
|
|
|
68
|
-
// src/config/
|
|
68
|
+
// src/config/connections/S3.ts
|
|
69
69
|
import { z as z3 } from "zod";
|
|
70
70
|
var S3BucketConfigZod = z3.object({
|
|
71
71
|
accessKeyId: z3.string().nonempty().optional().describe("S3-compatible access key id for this bucket (overrides the shared default)"),
|
|
@@ -76,151 +76,108 @@ var S3BucketConfigZod = z3.object({
|
|
|
76
76
|
secretAccessKey: z3.string().nonempty().optional().describe("S3-compatible secret access key for this bucket (overrides the shared default)")
|
|
77
77
|
});
|
|
78
78
|
|
|
79
|
-
// src/config/
|
|
80
|
-
var
|
|
79
|
+
// src/config/connections/Connection.ts
|
|
80
|
+
var LmdbConnectionConfigZod = z4.object({
|
|
81
81
|
access: z4.enum(["read", "write"]).optional().register(globalRegistry3, {
|
|
82
82
|
description: "Access mode for this LMDB connection (read or write)",
|
|
83
|
-
title: "
|
|
83
|
+
title: "connections.lmdb.access",
|
|
84
84
|
type: "string"
|
|
85
85
|
}),
|
|
86
86
|
root: z4.string().register(globalRegistry3, {
|
|
87
87
|
description: "Root directory for local LMDB storage",
|
|
88
|
-
title: "
|
|
88
|
+
title: "connections.lmdb.root",
|
|
89
89
|
type: "string"
|
|
90
90
|
}),
|
|
91
91
|
store: z4.string().optional().register(globalRegistry3, {
|
|
92
92
|
description: "Logical store name within the LMDB root (e.g. finalized-chain, mempool)",
|
|
93
|
-
title: "
|
|
93
|
+
title: "connections.lmdb.store",
|
|
94
94
|
type: "string"
|
|
95
95
|
}),
|
|
96
96
|
type: z4.literal("lmdb")
|
|
97
|
-
}).describe("LMDB local storage
|
|
98
|
-
var
|
|
97
|
+
}).describe("LMDB local storage connection");
|
|
98
|
+
var MongoConnectionConfigZod = z4.object({
|
|
99
99
|
type: z4.literal("mongo"),
|
|
100
100
|
connectionString: MongoConfigZod.shape.connectionString,
|
|
101
101
|
database: MongoConfigZod.shape.database,
|
|
102
102
|
domain: MongoConfigZod.shape.domain,
|
|
103
103
|
password: MongoConfigZod.shape.password,
|
|
104
104
|
username: MongoConfigZod.shape.username
|
|
105
|
-
}).describe("MongoDB storage
|
|
106
|
-
var
|
|
105
|
+
}).describe("MongoDB storage connection");
|
|
106
|
+
var RpcConnectionConfigZod = z4.object({
|
|
107
107
|
type: z4.literal("rpc"),
|
|
108
108
|
protocol: z4.string().default("http").register(globalRegistry3, {
|
|
109
109
|
description: "Protocol for the RPC connection (http or postMessage)",
|
|
110
|
-
title: "
|
|
110
|
+
title: "connections.rpc.protocol",
|
|
111
111
|
type: "string"
|
|
112
112
|
}),
|
|
113
113
|
url: z4.string().optional().register(globalRegistry3, {
|
|
114
114
|
description: "URL for the Chain RPC API (http protocol)",
|
|
115
|
-
title: "
|
|
115
|
+
title: "connections.rpc.url",
|
|
116
116
|
type: "string"
|
|
117
117
|
}),
|
|
118
118
|
networkId: z4.string().optional().register(globalRegistry3, {
|
|
119
119
|
description: "Network ID for the postMessage RPC connection",
|
|
120
|
-
title: "
|
|
120
|
+
title: "connections.rpc.networkId",
|
|
121
121
|
type: "string"
|
|
122
122
|
}),
|
|
123
123
|
sessionId: z4.string().optional().register(globalRegistry3, {
|
|
124
124
|
description: "Session ID for the postMessage RPC connection",
|
|
125
|
-
title: "
|
|
125
|
+
title: "connections.rpc.sessionId",
|
|
126
126
|
type: "string"
|
|
127
127
|
})
|
|
128
|
-
}).describe("XL1 JSON-RPC
|
|
129
|
-
var
|
|
128
|
+
}).describe("XL1 JSON-RPC connection");
|
|
129
|
+
var RestConnectionConfigZod = z4.object({
|
|
130
130
|
type: z4.literal("rest"),
|
|
131
131
|
baseUrl: z4.string().register(globalRegistry3, {
|
|
132
132
|
description: "HTTP base URL for REST reads",
|
|
133
|
-
title: "
|
|
133
|
+
title: "connections.rest.baseUrl",
|
|
134
134
|
type: "string"
|
|
135
135
|
})
|
|
136
|
-
}).describe("HTTP REST read
|
|
137
|
-
var
|
|
136
|
+
}).describe("HTTP REST read connection");
|
|
137
|
+
var S3ConnectionConfigZod = S3BucketConfigZod.extend({
|
|
138
138
|
type: z4.literal("s3"),
|
|
139
139
|
accessKeyId: z4.string().optional(),
|
|
140
140
|
accountId: z4.string().optional(),
|
|
141
141
|
secretAccessKey: z4.string().optional()
|
|
142
|
-
}).describe("S3-compatible object storage
|
|
143
|
-
var
|
|
142
|
+
}).describe("S3-compatible object storage connection");
|
|
143
|
+
var EvmRpcConnectionConfigZod = z4.object({
|
|
144
144
|
type: z4.literal("evm-rpc"),
|
|
145
145
|
url: z4.string().register(globalRegistry3, {
|
|
146
146
|
description: "EVM JSON-RPC URL",
|
|
147
|
-
title: "
|
|
147
|
+
title: "connections.evm-rpc.url",
|
|
148
148
|
type: "string"
|
|
149
149
|
}),
|
|
150
150
|
chainId: z4.string().optional().register(globalRegistry3, {
|
|
151
151
|
description: "EVM chain ID for this RPC endpoint; auto-detected from the endpoint when omitted",
|
|
152
|
-
title: "
|
|
152
|
+
title: "connections.evm-rpc.chainId",
|
|
153
153
|
type: "string"
|
|
154
154
|
})
|
|
155
|
-
}).describe("EVM JSON-RPC
|
|
156
|
-
var
|
|
157
|
-
var
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
155
|
+
}).describe("EVM JSON-RPC connection");
|
|
156
|
+
var MemoryConnectionConfigZod = z4.object({ type: z4.literal("memory") }).describe("In-process memory connection");
|
|
157
|
+
var ConnectionConfigZod = z4.discriminatedUnion("type", [
|
|
158
|
+
LmdbConnectionConfigZod,
|
|
159
|
+
MongoConnectionConfigZod,
|
|
160
|
+
RpcConnectionConfigZod,
|
|
161
|
+
RestConnectionConfigZod,
|
|
162
|
+
S3ConnectionConfigZod,
|
|
163
|
+
EvmRpcConnectionConfigZod,
|
|
164
|
+
MemoryConnectionConfigZod
|
|
165
165
|
]);
|
|
166
|
-
var
|
|
167
|
-
|
|
168
|
-
// src/config/DataLake/DataLake.ts
|
|
169
|
-
import { z as z8 } from "zod";
|
|
170
|
-
|
|
171
|
-
// src/config/DataLake/RestDataLakeConfig.ts
|
|
172
|
-
import { globalRegistry as globalRegistry5, z as z6 } from "zod";
|
|
173
|
-
|
|
174
|
-
// src/config/DataLake/DataLakeRemoteConfig.ts
|
|
175
|
-
import { globalRegistry as globalRegistry4, z as z5 } from "zod";
|
|
176
|
-
var DataLakeDriverConfigBaseZod = z5.object({
|
|
177
|
-
driver: z5.string().register(globalRegistry4, {
|
|
178
|
-
description: "Driver for the data lake",
|
|
179
|
-
type: "string"
|
|
180
|
-
})
|
|
181
|
-
}).describe("Base configuration for a data lake driver");
|
|
182
|
-
|
|
183
|
-
// src/config/DataLake/RestDataLakeConfig.ts
|
|
184
|
-
var RestDataLakeConfigZod = DataLakeDriverConfigBaseZod.extend({
|
|
185
|
-
driver: z6.literal("rest").register(globalRegistry5, {
|
|
186
|
-
description: "Driver for the REST data lake",
|
|
187
|
-
type: "string"
|
|
188
|
-
}),
|
|
189
|
-
url: z6.string().register(globalRegistry5, {
|
|
190
|
-
description: "URL for the REST data lake",
|
|
191
|
-
type: "string"
|
|
192
|
-
})
|
|
193
|
-
}).describe("Configuration for the REST data lake driver");
|
|
194
|
-
|
|
195
|
-
// src/config/DataLake/RouterDataLakeConfig.ts
|
|
196
|
-
import { globalRegistry as globalRegistry6, z as z7 } from "zod";
|
|
197
|
-
var RouterDataLakeConfigZod = z7.object({
|
|
198
|
-
driver: z7.literal("router").register(globalRegistry6, {
|
|
199
|
-
description: "Driver for the router data lake",
|
|
200
|
-
type: "string"
|
|
201
|
-
}),
|
|
202
|
-
children: z7.array(z7.lazy(() => DataLakeConfigZod)).register(globalRegistry6, {
|
|
203
|
-
description: "Child data lake drivers",
|
|
204
|
-
type: "array"
|
|
205
|
-
})
|
|
206
|
-
}).describe("Configuration for the router data lake driver");
|
|
207
|
-
|
|
208
|
-
// src/config/DataLake/DataLake.ts
|
|
209
|
-
var DataLakeConfigZod = z8.lazy(() => z8.union([RestDataLakeConfigZod, RouterDataLakeConfigZod])).describe("Configuration for a data lake");
|
|
166
|
+
var ConnectionsConfigZod = z4.record(z4.string(), ConnectionConfigZod).default({});
|
|
210
167
|
|
|
211
168
|
// src/config/Log.ts
|
|
212
169
|
import { LogLevel } from "@xylabs/sdk-js";
|
|
213
|
-
import { globalRegistry as
|
|
170
|
+
import { globalRegistry as globalRegistry4, z as z5 } from "zod";
|
|
214
171
|
var LogLevelNames = Object.keys(LogLevel);
|
|
215
|
-
var LogConfigZod =
|
|
216
|
-
logLevel:
|
|
172
|
+
var LogConfigZod = z5.object({
|
|
173
|
+
logLevel: z5.enum(LogLevelNames).default("info").register(globalRegistry4, {
|
|
217
174
|
choices: LogLevelNames,
|
|
218
175
|
default: "info",
|
|
219
176
|
description: "Desired process verbosity",
|
|
220
177
|
title: "logLevel",
|
|
221
178
|
type: "string"
|
|
222
179
|
}),
|
|
223
|
-
silent:
|
|
180
|
+
silent: z5.boolean().default(false).register(globalRegistry4, {
|
|
224
181
|
default: false,
|
|
225
182
|
description: "Whether to run in silent mode",
|
|
226
183
|
title: "silent",
|
|
@@ -229,23 +186,18 @@ var LogConfigZod = z9.object({
|
|
|
229
186
|
});
|
|
230
187
|
|
|
231
188
|
// src/config/ProviderBinding.ts
|
|
232
|
-
import { globalRegistry as
|
|
233
|
-
var ProviderBindingConfigZod =
|
|
234
|
-
connection:
|
|
189
|
+
import { globalRegistry as globalRegistry5, z as z6 } from "zod";
|
|
190
|
+
var ProviderBindingConfigZod = z6.object({
|
|
191
|
+
connection: z6.string().optional().register(globalRegistry5, {
|
|
235
192
|
description: "Named connection from the top-level connections map",
|
|
236
193
|
title: "providerBindings.connection",
|
|
237
194
|
type: "string"
|
|
238
|
-
}),
|
|
239
|
-
transport: z10.string().optional().register(globalRegistry8, {
|
|
240
|
-
description: "Deprecated alias for connection (kept in sync during migration)",
|
|
241
|
-
title: "providerBindings.transport",
|
|
242
|
-
type: "string"
|
|
243
195
|
})
|
|
244
196
|
}).describe("Provider connection binding");
|
|
245
|
-
var ProviderBindingsConfigZod =
|
|
197
|
+
var ProviderBindingsConfigZod = z6.record(z6.string(), ProviderBindingConfigZod).default({});
|
|
246
198
|
|
|
247
199
|
// src/config/Providers.ts
|
|
248
|
-
import
|
|
200
|
+
import z8 from "zod";
|
|
249
201
|
|
|
250
202
|
// src/config/Provider.ts
|
|
251
203
|
import {
|
|
@@ -253,43 +205,43 @@ import {
|
|
|
253
205
|
zodIsFactory,
|
|
254
206
|
zodToFactory
|
|
255
207
|
} from "@xylabs/sdk-js";
|
|
256
|
-
import { z as
|
|
257
|
-
var ProviderConfigZod =
|
|
258
|
-
moniker:
|
|
259
|
-
labels:
|
|
208
|
+
import { z as z7 } from "zod";
|
|
209
|
+
var ProviderConfigZod = z7.object({
|
|
210
|
+
moniker: z7.string(),
|
|
211
|
+
labels: z7.array(z7.string()).optional()
|
|
260
212
|
}).describe("Configuration for a Provider");
|
|
261
213
|
var isProviderConfig = zodIsFactory(ProviderConfigZod);
|
|
262
214
|
var asProviderConfig = zodAsFactory(ProviderConfigZod, "asProviderConfig");
|
|
263
215
|
var toProviderConfig = zodToFactory(ProviderConfigZod, "toProviderConfig");
|
|
264
216
|
|
|
265
217
|
// src/config/Providers.ts
|
|
266
|
-
var ProvidersConfigZod =
|
|
218
|
+
var ProvidersConfigZod = z8.array(ProviderConfigZod.loose()).describe("Configuration for providers").default([]);
|
|
267
219
|
|
|
268
220
|
// src/config/Telemetry.ts
|
|
269
|
-
import { globalRegistry as
|
|
270
|
-
var MetricsScrapeConfigZod =
|
|
271
|
-
path:
|
|
221
|
+
import { globalRegistry as globalRegistry6, z as z9 } from "zod";
|
|
222
|
+
var MetricsScrapeConfigZod = z9.object({
|
|
223
|
+
path: z9.string().default("/metrics").register(globalRegistry6, {
|
|
272
224
|
default: "/metrics",
|
|
273
225
|
description: "Path for the metrics scrape endpoint",
|
|
274
226
|
title: "telemetry.metrics.scrape.path",
|
|
275
227
|
type: "string"
|
|
276
228
|
}),
|
|
277
|
-
port:
|
|
229
|
+
port: z9.coerce.number().int().nonnegative().optional().register(globalRegistry6, {
|
|
278
230
|
description: "Port for the metrics scrape endpoint (0 disables the scrape endpoint)",
|
|
279
231
|
title: "telemetry.metrics.scrape.port",
|
|
280
232
|
type: "number"
|
|
281
233
|
})
|
|
282
234
|
}).describe("Metrics scrape configuration");
|
|
283
|
-
var MetricsConfigZod =
|
|
284
|
-
var OpenTelemetryConfigZod =
|
|
235
|
+
var MetricsConfigZod = z9.object({ scrape: MetricsScrapeConfigZod }).describe("Metrics configuration options");
|
|
236
|
+
var OpenTelemetryConfigZod = z9.object({
|
|
285
237
|
// OpenTelemetry options
|
|
286
|
-
otlpEndpoint:
|
|
238
|
+
otlpEndpoint: z9.url().optional().register(globalRegistry6, {
|
|
287
239
|
description: "OTLP endpoint for exporting telemetry data",
|
|
288
240
|
title: "telemetry.otel.otlpEndpoint",
|
|
289
241
|
type: "string"
|
|
290
242
|
})
|
|
291
243
|
});
|
|
292
|
-
var TelemetryConfigZod =
|
|
244
|
+
var TelemetryConfigZod = z9.object({
|
|
293
245
|
// Metrics configuration
|
|
294
246
|
metrics: MetricsConfigZod.optional().describe("Metrics configuration"),
|
|
295
247
|
// OpenTelemetry configuration
|
|
@@ -298,31 +250,31 @@ var TelemetryConfigZod = z13.object({
|
|
|
298
250
|
|
|
299
251
|
// src/config/Validation.ts
|
|
300
252
|
import { XyoAddressZod as XyoAddressZod2 } from "@xyo-network/sdk-js";
|
|
301
|
-
import { globalRegistry as
|
|
253
|
+
import { globalRegistry as globalRegistry7, z as z10 } from "zod";
|
|
302
254
|
|
|
303
255
|
// src/primitives/uncle/findBestUncle.ts
|
|
304
256
|
var DEFAULT_MIN_CANDIDATES = 1;
|
|
305
257
|
var DEFAULT_BACKOFF_MS = 12e4;
|
|
306
258
|
|
|
307
259
|
// src/config/Validation.ts
|
|
308
|
-
var ValidationConfigZod =
|
|
309
|
-
allowedRewardRedeemers:
|
|
260
|
+
var ValidationConfigZod = z10.object({
|
|
261
|
+
allowedRewardRedeemers: z10.array(XyoAddressZod2).optional().register(globalRegistry7, {
|
|
310
262
|
description: "List of allowed reward redeemer addresses, if undefined anyone can participate",
|
|
311
263
|
title: "allowedRewardRedeemers",
|
|
312
264
|
type: "array"
|
|
313
265
|
}),
|
|
314
|
-
allowedRewardEscrowAccountSigners:
|
|
266
|
+
allowedRewardEscrowAccountSigners: z10.array(XyoAddressZod2).optional().register(globalRegistry7, {
|
|
315
267
|
description: "List of allowed reward escrow account signer addresses, if undefined anyone can participate",
|
|
316
268
|
title: "allowedRewardEscrowAccountSigners",
|
|
317
269
|
type: "array"
|
|
318
270
|
}),
|
|
319
|
-
minCandidates:
|
|
271
|
+
minCandidates: z10.coerce.number().default(DEFAULT_MIN_CANDIDATES).register(globalRegistry7, {
|
|
320
272
|
default: DEFAULT_MIN_CANDIDATES,
|
|
321
273
|
description: "Minimum number of uncle candidates before selecting the best uncle",
|
|
322
274
|
title: "validation.minCandidates",
|
|
323
275
|
type: "number"
|
|
324
276
|
}),
|
|
325
|
-
backoffMs:
|
|
277
|
+
backoffMs: z10.coerce.number().default(DEFAULT_BACKOFF_MS).register(globalRegistry7, {
|
|
326
278
|
default: DEFAULT_BACKOFF_MS,
|
|
327
279
|
description: "Back-off timeout in ms. If head age exceeds this, minCandidates is ignored",
|
|
328
280
|
title: "validation.backoffMs",
|
|
@@ -331,25 +283,24 @@ var ValidationConfigZod = z14.object({
|
|
|
331
283
|
});
|
|
332
284
|
|
|
333
285
|
// src/config/Base.ts
|
|
334
|
-
var BaseConfigZod =
|
|
335
|
-
chain:
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
validation: z15._default(ValidationConfigZod, ValidationConfigZod.parse({})).check(z15.describe("Configuration for validation"))
|
|
286
|
+
var BaseConfigZod = z11.object({
|
|
287
|
+
chain: z11._default(ChainConfigZod, ChainConfigZod.parse({})).check(z11.describe("Configuration for the chain")),
|
|
288
|
+
log: z11._default(LogConfigZod, LogConfigZod.parse({})).check(z11.describe("Configuration for logging")),
|
|
289
|
+
connections: z11._default(ConnectionsConfigZod, ConnectionsConfigZod.parse({})).check(z11.describe("Named connection profiles (rpc, rest, s3, lmdb, mongo, evm-rpc)")),
|
|
290
|
+
providerBindings: z11._default(ProviderBindingsConfigZod, ProviderBindingsConfigZod.parse({})).check(z11.describe("Per-moniker provider connection bindings")),
|
|
291
|
+
providers: z11._default(ProvidersConfigZod, ProvidersConfigZod.parse([])).check(z11.describe("Configuration for providers")),
|
|
292
|
+
telemetry: z11._default(TelemetryConfigZod, TelemetryConfigZod.parse({})).check(z11.describe("Configuration for telemetry")),
|
|
293
|
+
validation: z11._default(ValidationConfigZod, ValidationConfigZod.parse({})).check(z11.describe("Configuration for validation"))
|
|
343
294
|
});
|
|
344
295
|
|
|
345
296
|
// src/config/Actor.ts
|
|
346
|
-
var AccountPathZod =
|
|
297
|
+
var AccountPathZod = z12.string().check(z12.regex(
|
|
347
298
|
/^(m(\/\d+'?)+|\d+'?(\/\d+'?)*)$/,
|
|
348
299
|
`Invalid BIP-32 derivation path. Use either an absolute path like "m/44'/60'/0'/0/0" or a relative path like "0", "0/1", or "44'/60'/0'/0/0".`
|
|
349
300
|
));
|
|
350
|
-
var ActorConfigZod =
|
|
351
|
-
name:
|
|
352
|
-
accountPath:
|
|
301
|
+
var ActorConfigZod = z12.extend(BaseConfigZod, {
|
|
302
|
+
name: z12.string(),
|
|
303
|
+
accountPath: z12.optional(AccountPathZod).register(globalRegistry8, {
|
|
353
304
|
description: 'BIP-32 derivation path for the actor wallet. Absolute when it starts with "m/"; otherwise relative to the root wallet base path. Each actor must derive to a distinct path.',
|
|
354
305
|
title: "accountPath",
|
|
355
306
|
type: "string"
|
|
@@ -360,22 +311,22 @@ var asActorConfig = zodAsFactory2(ActorConfigZod, "asActorConfig");
|
|
|
360
311
|
var toActorConfig = zodToFactory2(ActorConfigZod, "toActorConfig");
|
|
361
312
|
|
|
362
313
|
// src/config/Actors.ts
|
|
363
|
-
import { z as
|
|
364
|
-
var ActorsConfigZod =
|
|
365
|
-
|
|
314
|
+
import { z as z13 } from "zod/mini";
|
|
315
|
+
var ActorsConfigZod = z13._default(
|
|
316
|
+
z13.array(z13.looseObject(ActorConfigZod.shape)).check(z13.describe("Actor-specific configurations that override the base configuration when the actor is running")),
|
|
366
317
|
[]
|
|
367
318
|
);
|
|
368
319
|
|
|
369
320
|
// src/config/Config.ts
|
|
370
|
-
import { globalRegistry as
|
|
371
|
-
var ConfigZod =
|
|
321
|
+
import { globalRegistry as globalRegistry9, z as z14 } from "zod/mini";
|
|
322
|
+
var ConfigZod = z14.extend(BaseConfigZod, {
|
|
372
323
|
actors: ActorsConfigZod,
|
|
373
|
-
healthCheckPort:
|
|
324
|
+
healthCheckPort: z14.optional(z14.coerce.number()).register(globalRegistry9, {
|
|
374
325
|
description: "Port for the system-wide health, readiness, and liveness endpoints (/healthz, /livez, /readyz). Set to 0 to disable.",
|
|
375
326
|
title: "healthCheckPort",
|
|
376
327
|
type: "number"
|
|
377
328
|
})
|
|
378
|
-
}).check(
|
|
329
|
+
}).check(z14.describe("The complete configuration for the protocol, including global settings and actor-specific overrides"));
|
|
379
330
|
|
|
380
331
|
// src/getFileConfig.ts
|
|
381
332
|
var configName = "xyo";
|
|
@@ -393,7 +344,7 @@ async function getFileConfig(searchPlaces) {
|
|
|
393
344
|
if (!isNull(result)) {
|
|
394
345
|
const section = result[configSection];
|
|
395
346
|
if (isDefined(section) && typeof section === "object") {
|
|
396
|
-
return
|
|
347
|
+
return z15.looseObject(ConfigZod.shape).parse(section);
|
|
397
348
|
}
|
|
398
349
|
}
|
|
399
350
|
return ConfigZod.parse({});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../src/getFileConfig.ts", "../../src/config/Actor.ts", "../../src/config/Base.ts", "../../src/config/Chain.ts", "../../src/config/
|
|
4
|
-
"sourcesContent": ["import { isDefined, isNull } from '@xylabs/sdk-js'\nimport { cosmiconfig } from 'cosmiconfig'\nimport { z } from 'zod/mini'\n\nimport { ConfigZod } from './config/index.ts'\n\n/**\n * The name of the configuration file to search for.\n */\nconst configName = 'xyo'\n\n/**\n * The name of the section within the configuration file to parse.\n */\nconst configSection = 'xl1' // Default section in the config file\n\n/**\n * Attempts to parse the configuration from a file using cosmiconfig.\n * @returns The parsed configuration object if found and valid, otherwise undefined.\n */\nexport async function getFileConfig(searchPlaces?: string[]) {\n const explorer = cosmiconfig(\n configName,\n {\n cache: true,\n searchPlaces,\n },\n )\n const searchResult = await explorer.search()\n const result: unknown = searchResult?.config\n if (!isNull(result)) {\n const section = (result as Record<string, unknown>)[configSection]\n if (isDefined(section) && typeof section === 'object') {\n return z.looseObject(ConfigZod.shape).parse(section)\n }\n }\n return ConfigZod.parse({})\n}\n", "import {\n zodAsFactory, zodIsFactory, zodToFactory,\n} from '@xylabs/sdk-js'\nimport { globalRegistry, z } from 'zod/mini'\n\nimport { BaseConfigZod } from './Base.ts'\n\n/**\n * BIP-32 derivation path for an actor wallet.\n *\n * - Absolute form: starts with `m/` (e.g. `m/44'/60'/0'/0/0`). The full path is used as-is,\n * giving the caller complete control over coin type, account, and hardening.\n * - Relative form: a segment list without the `m/` prefix (e.g. `0`, `0/1`, `44'/60'/0'/0/0`).\n * The consumer appends this to its configured root base path.\n *\n * Each segment is a non-negative integer, optionally suffixed with `'` to mark it as hardened.\n */\nexport const AccountPathZod = z.string().check(z.regex(\n /^(m(\\/\\d+'?)+|\\d+'?(\\/\\d+'?)*)$/,\n 'Invalid BIP-32 derivation path. Use either an absolute path like \"m/44\\'/60\\'/0\\'/0/0\" or a relative path like \"0\", \"0/1\", or \"44\\'/60\\'/0\\'/0/0\".',\n))\n\n/** ActorConfigZod constant. */\nexport const ActorConfigZod = z.extend(BaseConfigZod, {\n name: z.string(),\n accountPath: z.optional(AccountPathZod).register(globalRegistry, {\n description: 'BIP-32 derivation path for the actor wallet. Absolute when it starts with \"m/\"; otherwise relative to the root wallet base path. Each actor must derive to a distinct path.',\n title: 'accountPath',\n type: 'string',\n }),\n})\n\n/** ActorConfig type. */\nexport type ActorConfig = z.infer<typeof ActorConfigZod>\n\n/** Type guard that checks if a value is a valid ActorConfig. */\nexport const isActorConfig = zodIsFactory(ActorConfigZod)\n/** Converts a value to ActorConfig, throwing if invalid. */\nexport const asActorConfig = zodAsFactory(ActorConfigZod, 'asActorConfig')\n/** toActorConfig constant. */\nexport const toActorConfig = zodToFactory(ActorConfigZod, 'toActorConfig')\n", "import { z } from 'zod/mini'\n\nimport { ChainConfigZod } from './Chain.ts'\nimport { ConnectionsConfigZod } from './connections/index.ts'\nimport { DataLakeConfigZod } from './DataLake/index.ts'\nimport { LogConfigZod } from './Log.ts'\nimport { ProviderBindingsConfigZod } from './ProviderBinding.ts'\nimport { ProvidersConfigZod } from './Providers.ts'\nimport { TelemetryConfigZod } from './Telemetry.ts'\nimport { ValidationConfigZod } from './Validation.ts'\n\n/** BaseConfigZod constant. */\nexport const BaseConfigZod = z.object({\n chain: z._default(ChainConfigZod, ChainConfigZod.parse({})).check(z.describe('Configuration for the chain')),\n dataLake: z.optional(DataLakeConfigZod).check(z.describe('Configuration for data lakes')),\n log: z._default(LogConfigZod, LogConfigZod.parse({})).check(z.describe('Configuration for logging')),\n connections: z._default(ConnectionsConfigZod, ConnectionsConfigZod.parse({})).check(z.describe('Named connection profiles (rpc, rest, s3, lmdb, mongo, evm-rpc)')),\n providerBindings: z._default(ProviderBindingsConfigZod, ProviderBindingsConfigZod.parse({})).check(z.describe('Per-moniker provider connection bindings')),\n providers: z._default(ProvidersConfigZod, ProvidersConfigZod.parse([])).check(z.describe('Configuration for providers')),\n telemetry: z._default(TelemetryConfigZod, TelemetryConfigZod.parse({})).check(z.describe('Configuration for telemetry')),\n validation: z._default(ValidationConfigZod, ValidationConfigZod.parse({})).check(z.describe('Configuration for validation')),\n})\n\n/** BaseConfig type. */\nexport type BaseConfig = z.infer<typeof BaseConfigZod>\n", "import { HexZod } from '@xylabs/sdk-js'\nimport { XyoAddressZod } from '@xyo-network/sdk-js'\nimport { globalRegistry, z } from 'zod/mini'\n\n/** ChainConfigZod constant. */\nexport const ChainConfigZod = z.object({\n id: z.optional(HexZod)\n .register(globalRegistry, {\n description:\n 'The unique identifier for the chain. Should be the staking contract address for contract-backed chains.',\n title: 'chain.id',\n type: 'string',\n }),\n genesisRewardAddress: z.optional(XyoAddressZod)\n .register(globalRegistry, {\n description:\n 'Address to send the initial genesis rewards to, if a new chain is being created.',\n title: 'chain.genesisRewardAddress',\n type: 'Address',\n }),\n})\n\n/** ChainConfig type. */\nexport type ChainConfig = z.infer<typeof ChainConfigZod>\n", "import { globalRegistry, z } from 'zod'\n\nimport { MongoConfigZod } from './Mongo.ts'\nimport { S3BucketConfigZod } from './S3.ts'\n\n/** Named LMDB backing-store transport. */\nexport const LmdbTransportConfigZod = z.object({\n access: z.enum(['read', 'write']).optional().register(globalRegistry, {\n description: 'Access mode for this LMDB connection (read or write)',\n title: 'transports.lmdb.access',\n type: 'string',\n }),\n root: z.string().register(globalRegistry, {\n description: 'Root directory for local LMDB storage',\n title: 'transports.lmdb.root',\n type: 'string',\n }),\n store: z.string().optional().register(globalRegistry, {\n description: 'Logical store name within the LMDB root (e.g. finalized-chain, mempool)',\n title: 'transports.lmdb.store',\n type: 'string',\n }),\n type: z.literal('lmdb'),\n}).describe('LMDB local storage transport')\n\n/** MongoDB backing-store transport. */\nexport const MongoTransportConfigZod = z.object({\n type: z.literal('mongo'),\n connectionString: MongoConfigZod.shape.connectionString,\n database: MongoConfigZod.shape.database,\n domain: MongoConfigZod.shape.domain,\n password: MongoConfigZod.shape.password,\n username: MongoConfigZod.shape.username,\n}).describe('MongoDB storage transport')\n\n/** JSON-RPC wire transport (HTTP or postMessage). */\nexport const RpcTransportConfigZod = z.object({\n type: z.literal('rpc'),\n protocol: z.string().default('http').register(globalRegistry, {\n description: 'Protocol for the RPC connection (http or postMessage)',\n title: 'transports.rpc.protocol',\n type: 'string',\n }),\n url: z.string().optional().register(globalRegistry, {\n description: 'URL for the Chain RPC API (http protocol)',\n title: 'transports.rpc.url',\n type: 'string',\n }),\n networkId: z.string().optional().register(globalRegistry, {\n description: 'Network ID for the postMessage RPC connection',\n title: 'transports.rpc.networkId',\n type: 'string',\n }),\n sessionId: z.string().optional().register(globalRegistry, {\n description: 'Session ID for the postMessage RPC connection',\n title: 'transports.rpc.sessionId',\n type: 'string',\n }),\n}).describe('XL1 JSON-RPC transport')\n\n/** HTTP REST read transport (CDN / public read base URL). */\nexport const RestTransportConfigZod = z.object({\n type: z.literal('rest'),\n baseUrl: z.string().register(globalRegistry, {\n description: 'HTTP base URL for REST reads',\n title: 'transports.rest.baseUrl',\n type: 'string',\n }),\n}).describe('HTTP REST read transport')\n\n/** S3-compatible object storage transport (API + optional public read URL). */\nexport const S3TransportConfigZod = S3BucketConfigZod.extend({\n type: z.literal('s3'),\n accessKeyId: z.string().optional(),\n accountId: z.string().optional(),\n secretAccessKey: z.string().optional(),\n}).describe('S3-compatible object storage transport')\n\n/** EVM JSON-RPC transport. */\nexport const EvmRpcTransportConfigZod = z.object({\n type: z.literal('evm-rpc'),\n url: z.string().register(globalRegistry, {\n description: 'EVM JSON-RPC URL',\n title: 'transports.evm-rpc.url',\n type: 'string',\n }),\n chainId: z.string().optional().register(globalRegistry, {\n description: 'EVM chain ID for this RPC endpoint; auto-detected from the endpoint when omitted',\n title: 'transports.evm-rpc.chainId',\n type: 'string',\n }),\n}).describe('EVM JSON-RPC transport')\n\n/** In-process shared-memory transport (ephemeral; backed by a MemoryArchivist). */\nexport const MemoryTransportConfigZod = z.object({ type: z.literal('memory') }).describe('In-process memory transport')\n\n/** Discriminated union of all supported transport kinds. */\nexport const TransportConfigZod = z.discriminatedUnion('type', [\n LmdbTransportConfigZod,\n MongoTransportConfigZod,\n RpcTransportConfigZod,\n RestTransportConfigZod,\n S3TransportConfigZod,\n EvmRpcTransportConfigZod,\n MemoryTransportConfigZod,\n])\n\nexport type LmdbTransportConfig = z.infer<typeof LmdbTransportConfigZod>\nexport type MongoTransportConfig = z.infer<typeof MongoTransportConfigZod>\nexport type RpcTransportConfig = z.infer<typeof RpcTransportConfigZod>\nexport type RestTransportConfig = z.infer<typeof RestTransportConfigZod>\nexport type S3TransportConfig = z.infer<typeof S3TransportConfigZod>\nexport type EvmRpcTransportConfig = z.infer<typeof EvmRpcTransportConfigZod>\nexport type MemoryTransportConfig = z.infer<typeof MemoryTransportConfigZod>\nexport type TransportConfig = z.infer<typeof TransportConfigZod>\n\n/** Map of transport name \u2192 transport configuration. */\nexport const TransportsConfigZod = z.record(z.string(), TransportConfigZod).default({})\n\nexport type TransportsConfig = z.infer<typeof TransportsConfigZod>\n\nexport type TransportKind = TransportConfig['type']\n", "import { globalRegistry, z } from 'zod'\n\n/** MongoConfigZod constant. */\nexport const MongoConfigZod = z.object({\n // TODO: Create from other arguments\n connectionString: z.string().nonempty().optional().register(globalRegistry, {\n description: 'MongoDB connection string',\n title: 'storage.mongo.connectionString',\n type: 'string',\n }),\n database: z.string().nonempty().optional().register(globalRegistry, {\n description: 'MongoDB database name',\n title: 'storage.mongo.database',\n type: 'string',\n }),\n domain: z.string().nonempty().optional().register(globalRegistry, {\n description: 'MongoDB domain',\n title: 'storage.mongo.domain',\n type: 'string',\n }),\n password: z.string().nonempty().optional().register(globalRegistry, {\n description: 'MongoDB password',\n title: 'storage.mongo.password',\n type: 'string',\n }),\n username: z.string().nonempty().optional().register(globalRegistry, {\n description: 'MongoDB username',\n title: 'storage.mongo.username',\n type: 'string',\n }),\n})\n\n/** MongoConfig type. */\nexport type MongoConfig = z.infer<typeof MongoConfigZod>\n", "import { z } from 'zod'\n\n/**\n * Per-bucket S3 configuration: the bucket name, an optional public read URL (CDN), and optional\n * credential/prefix overrides. Any omitted credential or prefix falls back to the shared top-level\n * S3 config; an omitted bucket name falls back to the finalized bucket.\n *\n * \"S3\" is the S3-compatible object-storage protocol; Cloudflare R2 is one such implementation.\n */\nexport const S3BucketConfigZod = z.object({\n accessKeyId: z.string().nonempty().optional().describe('S3-compatible access key id for this bucket (overrides the shared default)'),\n accountId: z.string().nonempty().optional().describe('Account id for this bucket; on Cloudflare R2 it forms the endpoint (overrides the shared default)'),\n bucket: z.string().nonempty().optional().describe('S3-compatible bucket name'),\n prefix: z.string().nonempty().optional().describe('Optional key prefix within the bucket'),\n readUrl: z.string().nonempty().optional().describe('Public HTTP/CDN base URL for anonymous reads of this bucket'),\n secretAccessKey: z.string().nonempty().optional().describe('S3-compatible secret access key for this bucket (overrides the shared default)'),\n})\n\n/** S3BucketConfig type. */\nexport type S3BucketConfig = z.infer<typeof S3BucketConfigZod>\n", "import { z } from 'zod'\n\nimport { type RestDataLakeConfig, RestDataLakeConfigZod } from './RestDataLakeConfig.ts'\n// eslint-disable-next-line import-x/no-cycle -- intentional cycle for z.lazy recursive type\nimport { type RouterDataLakeConfig, RouterDataLakeConfigZod } from './RouterDataLakeConfig.ts'\n\n/** DataLakeConfig type. */\nexport type DataLakeConfig = RestDataLakeConfig | RouterDataLakeConfig\n\n// z.lazy handles the circular reference between DataLakeConfigZod and RouterDataLakeZod\n/** DataLakeConfigZod constant. */\nexport const DataLakeConfigZod: z.ZodType<DataLakeConfig> = z.lazy(() =>\n z.union([RestDataLakeConfigZod, RouterDataLakeConfigZod])).describe('Configuration for a data lake')\n", "import { globalRegistry, z } from 'zod'\n\nimport { DataLakeDriverConfigBaseZod } from './DataLakeRemoteConfig.ts'\n\n/** RestDataLakeConfigZod constant. */\nexport const RestDataLakeConfigZod = DataLakeDriverConfigBaseZod.extend({\n driver: z.literal('rest').register(globalRegistry, {\n description: 'Driver for the REST data lake',\n type: 'string',\n }),\n url: z.string().register(globalRegistry, {\n description: 'URL for the REST data lake',\n type: 'string',\n }),\n}).describe('Configuration for the REST data lake driver')\n\n/** RestDataLakeConfig type. */\nexport type RestDataLakeConfig = z.infer<typeof RestDataLakeConfigZod>\n", "import { globalRegistry, z } from 'zod'\n\n/** DataLakeDriverConfigBaseZod constant. */\nexport const DataLakeDriverConfigBaseZod = z.object({\n driver: z.string().register(globalRegistry, {\n description: 'Driver for the data lake',\n type: 'string',\n }),\n}).describe('Base configuration for a data lake driver')\n/** DataLakeDriverConfigBase type. */\nexport type DataLakeDriverConfigBase = z.infer<typeof DataLakeDriverConfigBaseZod>\n", "import { globalRegistry, z } from 'zod'\n\nimport type { DataLakeConfig } from './DataLake.ts'\n// eslint-disable-next-line import-x/no-cycle -- intentional cycle for z.lazy recursive type\nimport { DataLakeConfigZod } from './DataLake.ts'\n\n/** Configuration for RouterDataLake. */\nexport interface RouterDataLakeConfig {\n children: DataLakeConfig[]\n driver: 'router'\n}\n\n/** RouterDataLakeConfigZod constant. */\nexport const RouterDataLakeConfigZod: z.ZodType<RouterDataLakeConfig> = z.object({\n driver: z.literal('router').register(globalRegistry, {\n description: 'Driver for the router data lake',\n type: 'string',\n }),\n children: z.array(z.lazy(() => DataLakeConfigZod)).register(globalRegistry, {\n description: 'Child data lake drivers',\n type: 'array',\n }),\n}).describe('Configuration for the router data lake driver')\n", "import type { LogLevelKey } from '@xylabs/sdk-js'\nimport { LogLevel } from '@xylabs/sdk-js'\nimport { globalRegistry, z } from 'zod'\n\nconst LogLevelNames = Object.keys(LogLevel) as [LogLevelKey]\n\n/** LogConfigZod constant. */\nexport const LogConfigZod = z.object({\n logLevel: z.enum(LogLevelNames).default('info').register(globalRegistry, {\n choices: LogLevelNames,\n default: 'info',\n description: 'Desired process verbosity',\n title: 'logLevel',\n type: 'string',\n }),\n silent: z.boolean().default(false).register(globalRegistry, {\n default: false,\n description: 'Whether to run in silent mode',\n title: 'silent',\n type: 'boolean',\n }),\n})\n\n/** LogConfig type. */\nexport type LogConfig = z.infer<typeof LogConfigZod>\n", "import { globalRegistry, z } from 'zod'\n\n/**\n * Binds a capability moniker to a named connection profile.\n * Keys in `providerBindings` use the provider moniker (e.g. `BlockViewer`).\n */\nexport const ProviderBindingConfigZod = z.object({\n connection: z.string().optional().register(globalRegistry, {\n description: 'Named connection from the top-level connections map',\n title: 'providerBindings.connection',\n type: 'string',\n }),\n transport: z.string().optional().register(globalRegistry, {\n description: 'Deprecated alias for connection (kept in sync during migration)',\n title: 'providerBindings.transport',\n type: 'string',\n }),\n}).describe('Provider connection binding')\n\nexport type ProviderBindingConfig = z.infer<typeof ProviderBindingConfigZod>\n\n/** Map of provider moniker \u2192 binding. */\nexport const ProviderBindingsConfigZod = z.record(z.string(), ProviderBindingConfigZod).default({})\n\nexport type ProviderBindingsConfig = z.infer<typeof ProviderBindingsConfigZod>\n", "import z from 'zod'\n\nimport { ProviderConfigZod } from './Provider.ts'\n\n/** ProvidersConfigZod constant. */\nexport const ProvidersConfigZod = z.array(ProviderConfigZod.loose()).describe('Configuration for providers').default([])\n\n/** ProvidersConfig type. */\nexport type ProvidersConfig = z.infer<typeof ProvidersConfigZod>\n", "import {\n zodAsFactory, zodIsFactory, zodToFactory,\n} from '@xylabs/sdk-js'\nimport { z } from 'zod'\n\n/** ProviderConfigZod constant. */\nexport const ProviderConfigZod = z.object({\n moniker: z.string(),\n labels: z.array(z.string()).optional(),\n}).describe('Configuration for a Provider')\n\n/** ProviderConfig type. */\nexport type ProviderConfig = z.infer<typeof ProviderConfigZod>\n\n/** Type guard that checks if a value is a valid ProviderConfig. */\nexport const isProviderConfig = zodIsFactory(ProviderConfigZod)\n/** Converts a value to ProviderConfig, throwing if invalid. */\nexport const asProviderConfig = zodAsFactory(ProviderConfigZod, 'asProviderConfig')\n/** toProviderConfig constant. */\nexport const toProviderConfig = zodToFactory(ProviderConfigZod, 'toProviderConfig')\n", "import { globalRegistry, z } from 'zod'\n\n/** DefaultMetricsScrapePorts constant. */\nexport const DefaultMetricsScrapePorts = {\n api: 9465,\n bridge: 9468,\n mempool: 9466,\n producer: 9464,\n rewardRedemptionApi: 9467,\n}\n\n/** MetricsScrapeConfigZod constant. */\nexport const MetricsScrapeConfigZod = z.object({\n path: z.string().default('/metrics').register(globalRegistry, {\n default: '/metrics',\n description: 'Path for the metrics scrape endpoint',\n title: 'telemetry.metrics.scrape.path',\n type: 'string',\n }),\n port: z.coerce.number().int().nonnegative().optional().register(globalRegistry, {\n description: 'Port for the metrics scrape endpoint (0 disables the scrape endpoint)',\n title: 'telemetry.metrics.scrape.port',\n type: 'number',\n }),\n}).describe('Metrics scrape configuration')\n\n/** MetricsConfigZod constant. */\nexport const MetricsConfigZod = z.object({ scrape: MetricsScrapeConfigZod }).describe('Metrics configuration options')\n\n/** OpenTelemetryConfigZod constant. */\nexport const OpenTelemetryConfigZod = z.object({\n // OpenTelemetry options\n otlpEndpoint: z.url().optional().register(globalRegistry, {\n description: 'OTLP endpoint for exporting telemetry data',\n title: 'telemetry.otel.otlpEndpoint',\n type: 'string',\n }),\n})\n\n/** TelemetryConfigZod constant. */\nexport const TelemetryConfigZod = z.object({\n // Metrics configuration\n metrics: MetricsConfigZod.optional().describe('Metrics configuration'),\n // OpenTelemetry configuration\n otel: OpenTelemetryConfigZod.optional().describe('OpenTelemetry configuration'),\n}).describe('Telemetry configuration options')\n\n/** TelemetryConfig type. */\nexport type TelemetryConfig = z.infer<typeof TelemetryConfigZod>\n", "import { XyoAddressZod } from '@xyo-network/sdk-js'\nimport { globalRegistry, z } from 'zod'\n\nimport { DEFAULT_BACKOFF_MS, DEFAULT_MIN_CANDIDATES } from '../primitives/index.ts'\n\n/** ValidationConfigZod constant. */\nexport const ValidationConfigZod = z.object({\n allowedRewardRedeemers: z.array(XyoAddressZod).optional().register(globalRegistry, {\n description: 'List of allowed reward redeemer addresses, if undefined anyone can participate',\n title: 'allowedRewardRedeemers',\n type: 'array',\n }),\n allowedRewardEscrowAccountSigners: z.array(XyoAddressZod).optional().register(globalRegistry, {\n description: 'List of allowed reward escrow account signer addresses, if undefined anyone can participate',\n title: 'allowedRewardEscrowAccountSigners',\n type: 'array',\n }),\n minCandidates: z.coerce.number().default(DEFAULT_MIN_CANDIDATES).register(globalRegistry, {\n default: DEFAULT_MIN_CANDIDATES,\n description: 'Minimum number of uncle candidates before selecting the best uncle',\n title: 'validation.minCandidates',\n type: 'number',\n }),\n backoffMs: z.coerce.number().default(DEFAULT_BACKOFF_MS).register(globalRegistry, {\n default: DEFAULT_BACKOFF_MS,\n description: 'Back-off timeout in ms. If head age exceeds this, minCandidates is ignored',\n title: 'validation.backoffMs',\n type: 'number',\n }),\n})\n\n/** ValidationConfig type. */\nexport type ValidationConfig = z.infer<typeof ValidationConfigZod>\n", "import type { SignedHydratedBlockWithHashMeta } from '@xyo-network/xl1-protocol-lib'\n\nimport { scoreUncle } from './scoreUncle.ts'\n\n/** Default minimum number of uncle candidates before selecting. */\nexport const DEFAULT_MIN_CANDIDATES = 1\n\n/** Default back-off timeout in milliseconds. If the head has not changed for this long, minCandidates is ignored. */\nexport const DEFAULT_BACKOFF_MS = 120_000\n\n/** Options for findBestUncle block selection. */\nexport interface FindBestUncleOptions {\n /** Back-off timeout in ms. If head age exceeds this, minCandidates is ignored. Default: 120_000. */\n backoffMs?: number\n /** Minimum number of uncle candidates before selecting. Default: 1. */\n minCandidates?: number\n /** Current timestamp in ms. Injectable for testing. Default: Date.now(). */\n now?: number\n}\n\n/** Selects the best uncle chain from candidates using Proof of Perfect scoring. */\nexport function findBestUncle(\n finalizedWindowedChain: SignedHydratedBlockWithHashMeta[],\n uncles: SignedHydratedBlockWithHashMeta[][],\n options?: FindBestUncleOptions,\n): SignedHydratedBlockWithHashMeta[] | undefined {\n if (uncles.length === 0) return undefined\n\n const minCandidates = options?.minCandidates ?? DEFAULT_MIN_CANDIDATES\n const backoffMs = options?.backoffMs ?? DEFAULT_BACKOFF_MS\n const now = options?.now ?? Date.now()\n\n if (uncles.length < minCandidates) {\n const headEpoch = finalizedWindowedChain.at(-1)?.[0].$epoch ?? 0\n const headAge = now - headEpoch\n if (headAge < backoffMs) {\n return undefined\n }\n }\n\n const scores = uncles.map(uncle => ([scoreUncle(finalizedWindowedChain, uncle), uncle] as const)).toSorted((a, b) => b[0] - a[0])\n return scores[0]?.[1]\n}\n", "import { z } from 'zod/mini'\n\nimport { ActorConfigZod } from './Actor.ts'\n\n/** ActorsConfigZod constant. */\nexport const ActorsConfigZod = z._default(\n z.array(z.looseObject(ActorConfigZod.shape)).check(z.describe('Actor-specific configurations that override the base configuration when the actor is running')),\n [],\n)\n\n/** ActorsConfig type. */\nexport type ActorsConfig = z.infer<typeof ActorsConfigZod>\n", "import { globalRegistry, z } from 'zod/mini'\n\nimport { ActorConfigZod } from './Actor.ts'\nimport { ActorsConfigZod } from './Actors.ts'\nimport { BaseConfigZod } from './Base.ts'\nimport type { DeepPartial } from './DeepPartial.ts'\n\n/** ConfigZod constant. */\nexport const ConfigZod = z.extend(BaseConfigZod, {\n actors: ActorsConfigZod,\n healthCheckPort: z.optional(z.coerce.number()).register(globalRegistry, {\n description: 'Port for the system-wide health, readiness, and liveness endpoints (/healthz, /livez, /readyz). Set to 0 to disable.',\n title: 'healthCheckPort',\n type: 'number',\n }),\n}).check(z.describe('The complete configuration for the protocol, including global settings and actor-specific overrides'))\n\n/** Config type. */\nexport type Config = z.infer<typeof ConfigZod>\n\n/** ResolveConfig helper function. */\nexport function resolveConfig(\n config: DeepPartial<Config>,\n) {\n const parsedConfig = ConfigZod.parse(config)\n const {\n actors, healthCheckPort: _healthCheckPort, ...rootConfig\n } = parsedConfig\n parsedConfig.actors = actors.map((actorConfig: z.infer<typeof ActorConfigZod>) => {\n return z.looseObject(ActorConfigZod.shape).parse({ ...rootConfig, ...actorConfig })\n })\n return parsedConfig\n}\n"],
|
|
5
|
-
"mappings": ";AAAA,SAAS,WAAW,cAAc;AAClC,SAAS,mBAAmB;AAC5B,SAAS,KAAAA,WAAS;;;ACFlB;AAAA,EACE,gBAAAC;AAAA,EAAc,gBAAAC;AAAA,EAAc,gBAAAC;AAAA,OACvB;AACP,SAAS,kBAAAC,
|
|
6
|
-
"names": ["z", "zodAsFactory", "zodIsFactory", "zodToFactory", "globalRegistry", "z", "z", "globalRegistry", "z", "globalRegistry", "z", "z", "z", "globalRegistry", "
|
|
3
|
+
"sources": ["../../src/getFileConfig.ts", "../../src/config/Actor.ts", "../../src/config/Base.ts", "../../src/config/Chain.ts", "../../src/config/connections/Connection.ts", "../../src/config/connections/Mongo.ts", "../../src/config/connections/S3.ts", "../../src/config/Log.ts", "../../src/config/ProviderBinding.ts", "../../src/config/Providers.ts", "../../src/config/Provider.ts", "../../src/config/Telemetry.ts", "../../src/config/Validation.ts", "../../src/primitives/uncle/findBestUncle.ts", "../../src/config/Actors.ts", "../../src/config/Config.ts"],
|
|
4
|
+
"sourcesContent": ["import { isDefined, isNull } from '@xylabs/sdk-js'\nimport { cosmiconfig } from 'cosmiconfig'\nimport { z } from 'zod/mini'\n\nimport { ConfigZod } from './config/index.ts'\n\n/**\n * The name of the configuration file to search for.\n */\nconst configName = 'xyo'\n\n/**\n * The name of the section within the configuration file to parse.\n */\nconst configSection = 'xl1' // Default section in the config file\n\n/**\n * Attempts to parse the configuration from a file using cosmiconfig.\n * @returns The parsed configuration object if found and valid, otherwise undefined.\n */\nexport async function getFileConfig(searchPlaces?: string[]) {\n const explorer = cosmiconfig(\n configName,\n {\n cache: true,\n searchPlaces,\n },\n )\n const searchResult = await explorer.search()\n const result: unknown = searchResult?.config\n if (!isNull(result)) {\n const section = (result as Record<string, unknown>)[configSection]\n if (isDefined(section) && typeof section === 'object') {\n return z.looseObject(ConfigZod.shape).parse(section)\n }\n }\n return ConfigZod.parse({})\n}\n", "import {\n zodAsFactory, zodIsFactory, zodToFactory,\n} from '@xylabs/sdk-js'\nimport { globalRegistry, z } from 'zod/mini'\n\nimport { BaseConfigZod } from './Base.ts'\n\n/**\n * BIP-32 derivation path for an actor wallet.\n *\n * - Absolute form: starts with `m/` (e.g. `m/44'/60'/0'/0/0`). The full path is used as-is,\n * giving the caller complete control over coin type, account, and hardening.\n * - Relative form: a segment list without the `m/` prefix (e.g. `0`, `0/1`, `44'/60'/0'/0/0`).\n * The consumer appends this to its configured root base path.\n *\n * Each segment is a non-negative integer, optionally suffixed with `'` to mark it as hardened.\n */\nexport const AccountPathZod = z.string().check(z.regex(\n /^(m(\\/\\d+'?)+|\\d+'?(\\/\\d+'?)*)$/,\n 'Invalid BIP-32 derivation path. Use either an absolute path like \"m/44\\'/60\\'/0\\'/0/0\" or a relative path like \"0\", \"0/1\", or \"44\\'/60\\'/0\\'/0/0\".',\n))\n\n/** ActorConfigZod constant. */\nexport const ActorConfigZod = z.extend(BaseConfigZod, {\n name: z.string(),\n accountPath: z.optional(AccountPathZod).register(globalRegistry, {\n description: 'BIP-32 derivation path for the actor wallet. Absolute when it starts with \"m/\"; otherwise relative to the root wallet base path. Each actor must derive to a distinct path.',\n title: 'accountPath',\n type: 'string',\n }),\n})\n\n/** ActorConfig type. */\nexport type ActorConfig = z.infer<typeof ActorConfigZod>\n\n/** Type guard that checks if a value is a valid ActorConfig. */\nexport const isActorConfig = zodIsFactory(ActorConfigZod)\n/** Converts a value to ActorConfig, throwing if invalid. */\nexport const asActorConfig = zodAsFactory(ActorConfigZod, 'asActorConfig')\n/** toActorConfig constant. */\nexport const toActorConfig = zodToFactory(ActorConfigZod, 'toActorConfig')\n", "import { z } from 'zod/mini'\n\nimport { ChainConfigZod } from './Chain.ts'\nimport { ConnectionsConfigZod } from './connections/index.ts'\nimport { LogConfigZod } from './Log.ts'\nimport { ProviderBindingsConfigZod } from './ProviderBinding.ts'\nimport { ProvidersConfigZod } from './Providers.ts'\nimport { TelemetryConfigZod } from './Telemetry.ts'\nimport { ValidationConfigZod } from './Validation.ts'\n\n/** BaseConfigZod constant. */\nexport const BaseConfigZod = z.object({\n chain: z._default(ChainConfigZod, ChainConfigZod.parse({})).check(z.describe('Configuration for the chain')),\n log: z._default(LogConfigZod, LogConfigZod.parse({})).check(z.describe('Configuration for logging')),\n connections: z._default(ConnectionsConfigZod, ConnectionsConfigZod.parse({})).check(z.describe('Named connection profiles (rpc, rest, s3, lmdb, mongo, evm-rpc)')),\n providerBindings: z._default(ProviderBindingsConfigZod, ProviderBindingsConfigZod.parse({})).check(z.describe('Per-moniker provider connection bindings')),\n providers: z._default(ProvidersConfigZod, ProvidersConfigZod.parse([])).check(z.describe('Configuration for providers')),\n telemetry: z._default(TelemetryConfigZod, TelemetryConfigZod.parse({})).check(z.describe('Configuration for telemetry')),\n validation: z._default(ValidationConfigZod, ValidationConfigZod.parse({})).check(z.describe('Configuration for validation')),\n})\n\n/** BaseConfig type. */\nexport type BaseConfig = z.infer<typeof BaseConfigZod>\n", "import { HexZod } from '@xylabs/sdk-js'\nimport { XyoAddressZod } from '@xyo-network/sdk-js'\nimport { globalRegistry, z } from 'zod/mini'\n\n/** ChainConfigZod constant. */\nexport const ChainConfigZod = z.object({\n id: z.optional(HexZod)\n .register(globalRegistry, {\n description:\n 'The unique identifier for the chain. Should be the staking contract address for contract-backed chains.',\n title: 'chain.id',\n type: 'string',\n }),\n genesisRewardAddress: z.optional(XyoAddressZod)\n .register(globalRegistry, {\n description:\n 'Address to send the initial genesis rewards to, if a new chain is being created.',\n title: 'chain.genesisRewardAddress',\n type: 'Address',\n }),\n})\n\n/** ChainConfig type. */\nexport type ChainConfig = z.infer<typeof ChainConfigZod>\n", "import { globalRegistry, z } from 'zod'\n\nimport { MongoConfigZod } from './Mongo.ts'\nimport { S3BucketConfigZod } from './S3.ts'\n\n/** Named LMDB backing-store connection. */\nexport const LmdbConnectionConfigZod = z.object({\n access: z.enum(['read', 'write']).optional().register(globalRegistry, {\n description: 'Access mode for this LMDB connection (read or write)',\n title: 'connections.lmdb.access',\n type: 'string',\n }),\n root: z.string().register(globalRegistry, {\n description: 'Root directory for local LMDB storage',\n title: 'connections.lmdb.root',\n type: 'string',\n }),\n store: z.string().optional().register(globalRegistry, {\n description: 'Logical store name within the LMDB root (e.g. finalized-chain, mempool)',\n title: 'connections.lmdb.store',\n type: 'string',\n }),\n type: z.literal('lmdb'),\n}).describe('LMDB local storage connection')\n\n/** MongoDB backing-store connection. */\nexport const MongoConnectionConfigZod = z.object({\n type: z.literal('mongo'),\n connectionString: MongoConfigZod.shape.connectionString,\n database: MongoConfigZod.shape.database,\n domain: MongoConfigZod.shape.domain,\n password: MongoConfigZod.shape.password,\n username: MongoConfigZod.shape.username,\n}).describe('MongoDB storage connection')\n\n/** JSON-RPC wire connection (HTTP or postMessage). */\nexport const RpcConnectionConfigZod = z.object({\n type: z.literal('rpc'),\n protocol: z.string().default('http').register(globalRegistry, {\n description: 'Protocol for the RPC connection (http or postMessage)',\n title: 'connections.rpc.protocol',\n type: 'string',\n }),\n url: z.string().optional().register(globalRegistry, {\n description: 'URL for the Chain RPC API (http protocol)',\n title: 'connections.rpc.url',\n type: 'string',\n }),\n networkId: z.string().optional().register(globalRegistry, {\n description: 'Network ID for the postMessage RPC connection',\n title: 'connections.rpc.networkId',\n type: 'string',\n }),\n sessionId: z.string().optional().register(globalRegistry, {\n description: 'Session ID for the postMessage RPC connection',\n title: 'connections.rpc.sessionId',\n type: 'string',\n }),\n}).describe('XL1 JSON-RPC connection')\n\n/** HTTP REST read connection (CDN / public read base URL). */\nexport const RestConnectionConfigZod = z.object({\n type: z.literal('rest'),\n baseUrl: z.string().register(globalRegistry, {\n description: 'HTTP base URL for REST reads',\n title: 'connections.rest.baseUrl',\n type: 'string',\n }),\n}).describe('HTTP REST read connection')\n\n/** S3-compatible object storage connection (API + optional public read URL). */\nexport const S3ConnectionConfigZod = S3BucketConfigZod.extend({\n type: z.literal('s3'),\n accessKeyId: z.string().optional(),\n accountId: z.string().optional(),\n secretAccessKey: z.string().optional(),\n}).describe('S3-compatible object storage connection')\n\n/** EVM JSON-RPC connection. */\nexport const EvmRpcConnectionConfigZod = z.object({\n type: z.literal('evm-rpc'),\n url: z.string().register(globalRegistry, {\n description: 'EVM JSON-RPC URL',\n title: 'connections.evm-rpc.url',\n type: 'string',\n }),\n chainId: z.string().optional().register(globalRegistry, {\n description: 'EVM chain ID for this RPC endpoint; auto-detected from the endpoint when omitted',\n title: 'connections.evm-rpc.chainId',\n type: 'string',\n }),\n}).describe('EVM JSON-RPC connection')\n\n/** In-process shared-memory connection (ephemeral; backed by a MemoryArchivist). */\nexport const MemoryConnectionConfigZod = z.object({ type: z.literal('memory') }).describe('In-process memory connection')\n\n/** Discriminated union of all supported connection kinds. */\nexport const ConnectionConfigZod = z.discriminatedUnion('type', [\n LmdbConnectionConfigZod,\n MongoConnectionConfigZod,\n RpcConnectionConfigZod,\n RestConnectionConfigZod,\n S3ConnectionConfigZod,\n EvmRpcConnectionConfigZod,\n MemoryConnectionConfigZod,\n])\n\nexport type LmdbConnectionConfig = z.infer<typeof LmdbConnectionConfigZod>\nexport type MongoConnectionConfig = z.infer<typeof MongoConnectionConfigZod>\nexport type RpcConnectionConfig = z.infer<typeof RpcConnectionConfigZod>\nexport type RestConnectionConfig = z.infer<typeof RestConnectionConfigZod>\nexport type S3ConnectionConfig = z.infer<typeof S3ConnectionConfigZod>\nexport type EvmRpcConnectionConfig = z.infer<typeof EvmRpcConnectionConfigZod>\nexport type MemoryConnectionConfig = z.infer<typeof MemoryConnectionConfigZod>\nexport type ConnectionConfig = z.infer<typeof ConnectionConfigZod>\n\n/** Map of connection name \u2192 connection configuration. */\nexport const ConnectionsConfigZod = z.record(z.string(), ConnectionConfigZod).default({})\n\nexport type ConnectionsConfig = z.infer<typeof ConnectionsConfigZod>\n\nexport type ConnectionKind = ConnectionConfig['type']\n", "import { globalRegistry, z } from 'zod'\n\n/** MongoConfigZod constant. */\nexport const MongoConfigZod = z.object({\n // TODO: Create from other arguments\n connectionString: z.string().nonempty().optional().register(globalRegistry, {\n description: 'MongoDB connection string',\n title: 'storage.mongo.connectionString',\n type: 'string',\n }),\n database: z.string().nonempty().optional().register(globalRegistry, {\n description: 'MongoDB database name',\n title: 'storage.mongo.database',\n type: 'string',\n }),\n domain: z.string().nonempty().optional().register(globalRegistry, {\n description: 'MongoDB domain',\n title: 'storage.mongo.domain',\n type: 'string',\n }),\n password: z.string().nonempty().optional().register(globalRegistry, {\n description: 'MongoDB password',\n title: 'storage.mongo.password',\n type: 'string',\n }),\n username: z.string().nonempty().optional().register(globalRegistry, {\n description: 'MongoDB username',\n title: 'storage.mongo.username',\n type: 'string',\n }),\n})\n\n/** MongoConfig type. */\nexport type MongoConfig = z.infer<typeof MongoConfigZod>\n", "import { z } from 'zod'\n\n/**\n * Per-bucket S3 configuration: the bucket name, an optional public read URL (CDN), and optional\n * credential/prefix overrides. Any omitted credential or prefix falls back to the shared top-level\n * S3 config; an omitted bucket name falls back to the finalized bucket.\n *\n * \"S3\" is the S3-compatible object-storage protocol; Cloudflare R2 is one such implementation.\n */\nexport const S3BucketConfigZod = z.object({\n accessKeyId: z.string().nonempty().optional().describe('S3-compatible access key id for this bucket (overrides the shared default)'),\n accountId: z.string().nonempty().optional().describe('Account id for this bucket; on Cloudflare R2 it forms the endpoint (overrides the shared default)'),\n bucket: z.string().nonempty().optional().describe('S3-compatible bucket name'),\n prefix: z.string().nonempty().optional().describe('Optional key prefix within the bucket'),\n readUrl: z.string().nonempty().optional().describe('Public HTTP/CDN base URL for anonymous reads of this bucket'),\n secretAccessKey: z.string().nonempty().optional().describe('S3-compatible secret access key for this bucket (overrides the shared default)'),\n})\n\n/** S3BucketConfig type. */\nexport type S3BucketConfig = z.infer<typeof S3BucketConfigZod>\n", "import type { LogLevelKey } from '@xylabs/sdk-js'\nimport { LogLevel } from '@xylabs/sdk-js'\nimport { globalRegistry, z } from 'zod'\n\nconst LogLevelNames = Object.keys(LogLevel) as [LogLevelKey]\n\n/** LogConfigZod constant. */\nexport const LogConfigZod = z.object({\n logLevel: z.enum(LogLevelNames).default('info').register(globalRegistry, {\n choices: LogLevelNames,\n default: 'info',\n description: 'Desired process verbosity',\n title: 'logLevel',\n type: 'string',\n }),\n silent: z.boolean().default(false).register(globalRegistry, {\n default: false,\n description: 'Whether to run in silent mode',\n title: 'silent',\n type: 'boolean',\n }),\n})\n\n/** LogConfig type. */\nexport type LogConfig = z.infer<typeof LogConfigZod>\n", "import { globalRegistry, z } from 'zod'\n\n/**\n * Binds a capability moniker to a named connection profile.\n * Keys in `providerBindings` use the provider moniker (e.g. `BlockViewer`).\n */\nexport const ProviderBindingConfigZod = z.object({\n connection: z.string().optional().register(globalRegistry, {\n description: 'Named connection from the top-level connections map',\n title: 'providerBindings.connection',\n type: 'string',\n }),\n}).describe('Provider connection binding')\n\nexport type ProviderBindingConfig = z.infer<typeof ProviderBindingConfigZod>\n\n/** Map of provider moniker \u2192 binding. */\nexport const ProviderBindingsConfigZod = z.record(z.string(), ProviderBindingConfigZod).default({})\n\nexport type ProviderBindingsConfig = z.infer<typeof ProviderBindingsConfigZod>\n", "import z from 'zod'\n\nimport { ProviderConfigZod } from './Provider.ts'\n\n/** ProvidersConfigZod constant. */\nexport const ProvidersConfigZod = z.array(ProviderConfigZod.loose()).describe('Configuration for providers').default([])\n\n/** ProvidersConfig type. */\nexport type ProvidersConfig = z.infer<typeof ProvidersConfigZod>\n", "import {\n zodAsFactory, zodIsFactory, zodToFactory,\n} from '@xylabs/sdk-js'\nimport { z } from 'zod'\n\n/** ProviderConfigZod constant. */\nexport const ProviderConfigZod = z.object({\n moniker: z.string(),\n labels: z.array(z.string()).optional(),\n}).describe('Configuration for a Provider')\n\n/** ProviderConfig type. */\nexport type ProviderConfig = z.infer<typeof ProviderConfigZod>\n\n/** Type guard that checks if a value is a valid ProviderConfig. */\nexport const isProviderConfig = zodIsFactory(ProviderConfigZod)\n/** Converts a value to ProviderConfig, throwing if invalid. */\nexport const asProviderConfig = zodAsFactory(ProviderConfigZod, 'asProviderConfig')\n/** toProviderConfig constant. */\nexport const toProviderConfig = zodToFactory(ProviderConfigZod, 'toProviderConfig')\n", "import { globalRegistry, z } from 'zod'\n\n/** DefaultMetricsScrapePorts constant. */\nexport const DefaultMetricsScrapePorts = {\n api: 9465,\n bridge: 9468,\n mempool: 9466,\n producer: 9464,\n rewardRedemptionApi: 9467,\n}\n\n/** MetricsScrapeConfigZod constant. */\nexport const MetricsScrapeConfigZod = z.object({\n path: z.string().default('/metrics').register(globalRegistry, {\n default: '/metrics',\n description: 'Path for the metrics scrape endpoint',\n title: 'telemetry.metrics.scrape.path',\n type: 'string',\n }),\n port: z.coerce.number().int().nonnegative().optional().register(globalRegistry, {\n description: 'Port for the metrics scrape endpoint (0 disables the scrape endpoint)',\n title: 'telemetry.metrics.scrape.port',\n type: 'number',\n }),\n}).describe('Metrics scrape configuration')\n\n/** MetricsConfigZod constant. */\nexport const MetricsConfigZod = z.object({ scrape: MetricsScrapeConfigZod }).describe('Metrics configuration options')\n\n/** OpenTelemetryConfigZod constant. */\nexport const OpenTelemetryConfigZod = z.object({\n // OpenTelemetry options\n otlpEndpoint: z.url().optional().register(globalRegistry, {\n description: 'OTLP endpoint for exporting telemetry data',\n title: 'telemetry.otel.otlpEndpoint',\n type: 'string',\n }),\n})\n\n/** TelemetryConfigZod constant. */\nexport const TelemetryConfigZod = z.object({\n // Metrics configuration\n metrics: MetricsConfigZod.optional().describe('Metrics configuration'),\n // OpenTelemetry configuration\n otel: OpenTelemetryConfigZod.optional().describe('OpenTelemetry configuration'),\n}).describe('Telemetry configuration options')\n\n/** TelemetryConfig type. */\nexport type TelemetryConfig = z.infer<typeof TelemetryConfigZod>\n", "import { XyoAddressZod } from '@xyo-network/sdk-js'\nimport { globalRegistry, z } from 'zod'\n\nimport { DEFAULT_BACKOFF_MS, DEFAULT_MIN_CANDIDATES } from '../primitives/index.ts'\n\n/** ValidationConfigZod constant. */\nexport const ValidationConfigZod = z.object({\n allowedRewardRedeemers: z.array(XyoAddressZod).optional().register(globalRegistry, {\n description: 'List of allowed reward redeemer addresses, if undefined anyone can participate',\n title: 'allowedRewardRedeemers',\n type: 'array',\n }),\n allowedRewardEscrowAccountSigners: z.array(XyoAddressZod).optional().register(globalRegistry, {\n description: 'List of allowed reward escrow account signer addresses, if undefined anyone can participate',\n title: 'allowedRewardEscrowAccountSigners',\n type: 'array',\n }),\n minCandidates: z.coerce.number().default(DEFAULT_MIN_CANDIDATES).register(globalRegistry, {\n default: DEFAULT_MIN_CANDIDATES,\n description: 'Minimum number of uncle candidates before selecting the best uncle',\n title: 'validation.minCandidates',\n type: 'number',\n }),\n backoffMs: z.coerce.number().default(DEFAULT_BACKOFF_MS).register(globalRegistry, {\n default: DEFAULT_BACKOFF_MS,\n description: 'Back-off timeout in ms. If head age exceeds this, minCandidates is ignored',\n title: 'validation.backoffMs',\n type: 'number',\n }),\n})\n\n/** ValidationConfig type. */\nexport type ValidationConfig = z.infer<typeof ValidationConfigZod>\n", "import type { SignedHydratedBlockWithHashMeta } from '@xyo-network/xl1-protocol-lib'\n\nimport { scoreUncle } from './scoreUncle.ts'\n\n/** Default minimum number of uncle candidates before selecting. */\nexport const DEFAULT_MIN_CANDIDATES = 1\n\n/** Default back-off timeout in milliseconds. If the head has not changed for this long, minCandidates is ignored. */\nexport const DEFAULT_BACKOFF_MS = 120_000\n\n/** Options for findBestUncle block selection. */\nexport interface FindBestUncleOptions {\n /** Back-off timeout in ms. If head age exceeds this, minCandidates is ignored. Default: 120_000. */\n backoffMs?: number\n /** Minimum number of uncle candidates before selecting. Default: 1. */\n minCandidates?: number\n /** Current timestamp in ms. Injectable for testing. Default: Date.now(). */\n now?: number\n}\n\n/** Selects the best uncle chain from candidates using Proof of Perfect scoring. */\nexport function findBestUncle(\n finalizedWindowedChain: SignedHydratedBlockWithHashMeta[],\n uncles: SignedHydratedBlockWithHashMeta[][],\n options?: FindBestUncleOptions,\n): SignedHydratedBlockWithHashMeta[] | undefined {\n if (uncles.length === 0) return undefined\n\n const minCandidates = options?.minCandidates ?? DEFAULT_MIN_CANDIDATES\n const backoffMs = options?.backoffMs ?? DEFAULT_BACKOFF_MS\n const now = options?.now ?? Date.now()\n\n if (uncles.length < minCandidates) {\n const headEpoch = finalizedWindowedChain.at(-1)?.[0].$epoch ?? 0\n const headAge = now - headEpoch\n if (headAge < backoffMs) {\n return undefined\n }\n }\n\n const scores = uncles.map(uncle => ([scoreUncle(finalizedWindowedChain, uncle), uncle] as const)).toSorted((a, b) => b[0] - a[0])\n return scores[0]?.[1]\n}\n", "import { z } from 'zod/mini'\n\nimport { ActorConfigZod } from './Actor.ts'\n\n/** ActorsConfigZod constant. */\nexport const ActorsConfigZod = z._default(\n z.array(z.looseObject(ActorConfigZod.shape)).check(z.describe('Actor-specific configurations that override the base configuration when the actor is running')),\n [],\n)\n\n/** ActorsConfig type. */\nexport type ActorsConfig = z.infer<typeof ActorsConfigZod>\n", "import { globalRegistry, z } from 'zod/mini'\n\nimport { ActorConfigZod } from './Actor.ts'\nimport { ActorsConfigZod } from './Actors.ts'\nimport { BaseConfigZod } from './Base.ts'\nimport type { DeepPartial } from './DeepPartial.ts'\n\n/** ConfigZod constant. */\nexport const ConfigZod = z.extend(BaseConfigZod, {\n actors: ActorsConfigZod,\n healthCheckPort: z.optional(z.coerce.number()).register(globalRegistry, {\n description: 'Port for the system-wide health, readiness, and liveness endpoints (/healthz, /livez, /readyz). Set to 0 to disable.',\n title: 'healthCheckPort',\n type: 'number',\n }),\n}).check(z.describe('The complete configuration for the protocol, including global settings and actor-specific overrides'))\n\n/** Config type. */\nexport type Config = z.infer<typeof ConfigZod>\n\n/** ResolveConfig helper function. */\nexport function resolveConfig(\n config: DeepPartial<Config>,\n) {\n const parsedConfig = ConfigZod.parse(config)\n const {\n actors, healthCheckPort: _healthCheckPort, ...rootConfig\n } = parsedConfig\n parsedConfig.actors = actors.map((actorConfig: z.infer<typeof ActorConfigZod>) => {\n return z.looseObject(ActorConfigZod.shape).parse({ ...rootConfig, ...actorConfig })\n })\n return parsedConfig\n}\n"],
|
|
5
|
+
"mappings": ";AAAA,SAAS,WAAW,cAAc;AAClC,SAAS,mBAAmB;AAC5B,SAAS,KAAAA,WAAS;;;ACFlB;AAAA,EACE,gBAAAC;AAAA,EAAc,gBAAAC;AAAA,EAAc,gBAAAC;AAAA,OACvB;AACP,SAAS,kBAAAC,iBAAgB,KAAAC,WAAS;;;ACHlC,SAAS,KAAAC,WAAS;;;ACAlB,SAAS,cAAc;AACvB,SAAS,qBAAqB;AAC9B,SAAS,gBAAgB,SAAS;AAG3B,IAAM,iBAAiB,EAAE,OAAO;AAAA,EACrC,IAAI,EAAE,SAAS,MAAM,EAClB,SAAS,gBAAgB;AAAA,IACxB,aACA;AAAA,IACA,OAAO;AAAA,IACP,MAAM;AAAA,EACR,CAAC;AAAA,EACH,sBAAsB,EAAE,SAAS,aAAa,EAC3C,SAAS,gBAAgB;AAAA,IACxB,aACA;AAAA,IACA,OAAO;AAAA,IACP,MAAM;AAAA,EACR,CAAC;AACL,CAAC;;;ACpBD,SAAS,kBAAAC,iBAAgB,KAAAC,UAAS;;;ACAlC,SAAS,kBAAAC,iBAAgB,KAAAC,UAAS;AAG3B,IAAM,iBAAiBA,GAAE,OAAO;AAAA;AAAA,EAErC,kBAAkBA,GAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,SAASD,iBAAgB;AAAA,IAC1E,aAAa;AAAA,IACb,OAAO;AAAA,IACP,MAAM;AAAA,EACR,CAAC;AAAA,EACD,UAAUC,GAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,SAASD,iBAAgB;AAAA,IAClE,aAAa;AAAA,IACb,OAAO;AAAA,IACP,MAAM;AAAA,EACR,CAAC;AAAA,EACD,QAAQC,GAAE,OAAO,EAAE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ACF;AACA,SAAO,UAAU,MAAM,CAAC,CAAC;AAC3B;",
|
|
6
|
+
"names": ["z", "zodAsFactory", "zodIsFactory", "zodToFactory", "globalRegistry", "z", "z", "globalRegistry", "z", "globalRegistry", "z", "z", "z", "globalRegistry", "globalRegistry", "z", "globalRegistry", "z", "z", "z", "z", "globalRegistry", "z", "z", "globalRegistry", "XyoAddressZod", "globalRegistry", "z", "z", "XyoAddressZod", "globalRegistry", "z", "z", "globalRegistry", "zodIsFactory", "zodAsFactory", "zodToFactory", "z", "z", "globalRegistry", "z", "z", "globalRegistry", "z"]
|
|
7
7
|
}
|