@xyo-network/xl1-protocol-sdk 4.0.1 → 4.0.3
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/CreatableProvider/AbstractCreatableProvider.d.ts +1 -0
- package/dist/neutral/CreatableProvider/AbstractCreatableProvider.d.ts.map +1 -1
- package/dist/neutral/config/Actor.d.ts +7 -1
- package/dist/neutral/config/Actor.d.ts.map +1 -1
- package/dist/neutral/config/Actors.d.ts +1 -0
- package/dist/neutral/config/Actors.d.ts.map +1 -1
- package/dist/neutral/config/Base.d.ts +39 -34
- package/dist/neutral/config/Base.d.ts.map +1 -1
- package/dist/neutral/config/Config.d.ts +5 -1
- package/dist/neutral/config/Config.d.ts.map +1 -1
- package/dist/neutral/config/HostActor.d.ts +7 -1
- package/dist/neutral/config/HostActor.d.ts.map +1 -1
- package/dist/neutral/config/LocatorConfigFields.d.ts +109 -0
- package/dist/neutral/config/LocatorConfigFields.d.ts.map +1 -0
- package/dist/neutral/config/ProviderBinding.d.ts +2 -0
- package/dist/neutral/config/ProviderBinding.d.ts.map +1 -1
- package/dist/neutral/config/ResolvedLocatorConfig.d.ts +122 -0
- package/dist/neutral/config/ResolvedLocatorConfig.d.ts.map +1 -0
- package/dist/neutral/config/index.d.ts +2 -0
- package/dist/neutral/config/index.d.ts.map +1 -1
- package/dist/neutral/config/resolveRestConnectionEndpoint.d.ts +2 -2
- package/dist/neutral/config/resolveRestConnectionEndpoint.d.ts.map +1 -1
- package/dist/neutral/context/Actor.d.ts +7 -1
- package/dist/neutral/context/Actor.d.ts.map +1 -1
- package/dist/neutral/context/HostActor.d.ts +7 -1
- package/dist/neutral/context/HostActor.d.ts.map +1 -1
- package/dist/neutral/getFileConfig.d.ts +2 -0
- package/dist/neutral/getFileConfig.d.ts.map +1 -1
- package/dist/neutral/getFileConfig.mjs +10 -5
- package/dist/neutral/getFileConfig.mjs.map +3 -3
- package/dist/neutral/index.mjs +62 -6
- package/dist/neutral/index.mjs.map +3 -3
- package/dist/neutral/model/CreatableProviderContext.zod.d.ts +13 -7
- package/dist/neutral/model/CreatableProviderContext.zod.d.ts.map +1 -1
- package/dist/neutral/test/index.mjs +10 -5
- package/dist/neutral/test/index.mjs.map +3 -3
- package/package.json +7 -7
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResolvedLocatorConfig.d.ts","sourceRoot":"","sources":["../../../src/config/ResolvedLocatorConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAA;AAEtE,OAAO,EAAE,KAAK,aAAa,EAA0B,MAAM,0BAA0B,CAAA;AAErF,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,QAAQ,CAAC,EAAE,WAAW,CAAC,eAAe,CAAC,CAAA;IAChD,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC,eAAe,CAAC,CAAA;CAChD;AAED,OAAO,CAAC,MAAM,0BAA0B,EAAE,OAAO,MAAM,CAAA;AAEvD,wFAAwF;AACxF,MAAM,MAAM,qBAAqB,GAAG,aAAa,GAAG;IAClD,QAAQ,CAAC,CAAC,0BAA0B,CAAC,EAAE,IAAI,CAAA;CAC5C,CAAA;AAED,MAAM,WAAW,kCAAkC;IACjD,QAAQ,CAAC,KAAK,CAAC,EAAE,yBAAyB,CAAA;CAC3C;AA6BD;;;GAGG;AACH,wBAAgB,2BAA2B,CACzC,GAAG,EAAE,OAAO,EACZ,OAAO,GAAE,kCAAuC,GAC/C,qBAAqB,CAOvB;AAED,qFAAqF;AACrF,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAYnC,CAAA"}
|
|
@@ -5,10 +5,12 @@ export * from './Config.ts';
|
|
|
5
5
|
export * from './connections/index.ts';
|
|
6
6
|
export * from './DeepPartial.ts';
|
|
7
7
|
export * from './HostActor.ts';
|
|
8
|
+
export * from './LocatorConfigFields.ts';
|
|
8
9
|
export * from './normalizeConnectionsConfig.ts';
|
|
9
10
|
export * from './Provider.ts';
|
|
10
11
|
export * from './ProviderBinding.ts';
|
|
11
12
|
export * from './Providers.ts';
|
|
13
|
+
export * from './ResolvedLocatorConfig.ts';
|
|
12
14
|
export * from './resolveRestConnectionEndpoint.ts';
|
|
13
15
|
export * from './synthesizeRpcConnectionBindings.ts';
|
|
14
16
|
export { DefaultMetricsScrapePorts } from './Telemetry.ts';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/config/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA;AAC3B,cAAc,WAAW,CAAA;AACzB,cAAc,aAAa,CAAA;AAC3B,cAAc,wBAAwB,CAAA;AACtC,cAAc,kBAAkB,CAAA;AAChC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,iCAAiC,CAAA;AAC/C,cAAc,eAAe,CAAA;AAC7B,cAAc,sBAAsB,CAAA;AACpC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,oCAAoC,CAAA;AAClD,cAAc,sCAAsC,CAAA;AACpD,OAAO,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAA;AAC1D,cAAc,gBAAgB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/config/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA;AAC3B,cAAc,WAAW,CAAA;AACzB,cAAc,aAAa,CAAA;AAC3B,cAAc,wBAAwB,CAAA;AACtC,cAAc,kBAAkB,CAAA;AAChC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,0BAA0B,CAAA;AACxC,cAAc,iCAAiC,CAAA;AAC/C,cAAc,eAAe,CAAA;AAC7B,cAAc,sBAAsB,CAAA;AACpC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,4BAA4B,CAAA;AAC1C,cAAc,oCAAoC,CAAA;AAClD,cAAc,sCAAsC,CAAA;AACpD,OAAO,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAA;AAC1D,cAAc,gBAAgB,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ProviderMoniker } from '@xyo-network/xl1-protocol-lib';
|
|
2
|
-
import type {
|
|
2
|
+
import type { LocatorConfig } from './LocatorConfigFields.ts';
|
|
3
3
|
/** Resolves a REST `baseUrl` for a provider moniker from `providerBindings` + `connections`. */
|
|
4
|
-
export declare function resolveRestConnectionEndpoint(config:
|
|
4
|
+
export declare function resolveRestConnectionEndpoint(config: LocatorConfig, moniker: ProviderMoniker): string;
|
|
5
5
|
//# sourceMappingURL=resolveRestConnectionEndpoint.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveRestConnectionEndpoint.d.ts","sourceRoot":"","sources":["../../../src/config/resolveRestConnectionEndpoint.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;
|
|
1
|
+
{"version":3,"file":"resolveRestConnectionEndpoint.d.ts","sourceRoot":"","sources":["../../../src/config/resolveRestConnectionEndpoint.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAGpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAU7D,gGAAgG;AAChG,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE,eAAe,GACvB,MAAM,CAiBR"}
|
|
@@ -70,6 +70,7 @@ export declare const ActorConfigContext: z.ZodMiniObject<{
|
|
|
70
70
|
}, z.core.$strip>], "type">>>>;
|
|
71
71
|
providerBindings: z.ZodMiniDefault<import("zod").ZodDefault<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodObject<{
|
|
72
72
|
connection: import("zod").ZodOptional<import("zod").ZodString>;
|
|
73
|
+
provider: import("zod").ZodOptional<import("zod").ZodString>;
|
|
73
74
|
}, z.core.$strip>>>>;
|
|
74
75
|
providers: z.ZodMiniDefault<import("zod").ZodDefault<import("zod").ZodArray<import("zod").ZodObject<{
|
|
75
76
|
moniker: import("zod").ZodString;
|
|
@@ -108,7 +109,7 @@ export declare const ActorConfigContext: z.ZodMiniObject<{
|
|
|
108
109
|
}, z.core.$strip>>;
|
|
109
110
|
name: z.ZodMiniString<string>;
|
|
110
111
|
accountPath: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
111
|
-
}, z.core.$
|
|
112
|
+
}, z.core.$strict>;
|
|
112
113
|
}, z.core.$strip>;
|
|
113
114
|
/** ActorConfigContext type. */
|
|
114
115
|
export type ActorConfigContext = z.infer<typeof ActorConfigContext>;
|
|
@@ -168,6 +169,7 @@ export declare const isActorConfigContext: <T>(value: T) => value is T & {
|
|
|
168
169
|
}>;
|
|
169
170
|
providerBindings: Record<string, {
|
|
170
171
|
connection?: string | undefined;
|
|
172
|
+
provider?: string | undefined;
|
|
171
173
|
}>;
|
|
172
174
|
providers: {
|
|
173
175
|
[x: string]: unknown;
|
|
@@ -271,6 +273,7 @@ export declare const asActorConfigContext: {
|
|
|
271
273
|
}>;
|
|
272
274
|
providerBindings: Record<string, {
|
|
273
275
|
connection?: string | undefined;
|
|
276
|
+
provider?: string | undefined;
|
|
274
277
|
}>;
|
|
275
278
|
providers: {
|
|
276
279
|
[x: string]: unknown;
|
|
@@ -372,6 +375,7 @@ export declare const asActorConfigContext: {
|
|
|
372
375
|
}>;
|
|
373
376
|
providerBindings: Record<string, {
|
|
374
377
|
connection?: string | undefined;
|
|
378
|
+
provider?: string | undefined;
|
|
375
379
|
}>;
|
|
376
380
|
providers: {
|
|
377
381
|
[x: string]: unknown;
|
|
@@ -476,6 +480,7 @@ export declare const toActorConfigContext: {
|
|
|
476
480
|
}>;
|
|
477
481
|
providerBindings: Record<string, {
|
|
478
482
|
connection?: string | undefined;
|
|
483
|
+
provider?: string | undefined;
|
|
479
484
|
}>;
|
|
480
485
|
providers: {
|
|
481
486
|
[x: string]: unknown;
|
|
@@ -577,6 +582,7 @@ export declare const toActorConfigContext: {
|
|
|
577
582
|
}>;
|
|
578
583
|
providerBindings: Record<string, {
|
|
579
584
|
connection?: string | undefined;
|
|
585
|
+
provider?: string | undefined;
|
|
580
586
|
}>;
|
|
581
587
|
providers: {
|
|
582
588
|
[x: string]: unknown;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Actor.d.ts","sourceRoot":"","sources":["../../../src/context/Actor.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,UAAU,CAAA;AAK5B,mCAAmC;AACnC,eAAO,MAAM,kBAAkB
|
|
1
|
+
{"version":3,"file":"Actor.d.ts","sourceRoot":"","sources":["../../../src/context/Actor.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,UAAU,CAAA;AAK5B,mCAAmC;AACnC,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAA6D,CAAA;AAE5F,+BAA+B;AAC/B,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAA;AAEnE,uEAAuE;AACvE,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAmC,CAAA;AACpE,mEAAmE;AACnE,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAA2D,CAAA;AAC5F,qCAAqC;AACrC,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAA2D,CAAA"}
|
|
@@ -70,6 +70,7 @@ export declare const HostActorConfigContext: z.ZodMiniObject<{
|
|
|
70
70
|
}, z.core.$strip>], "type">>>>;
|
|
71
71
|
providerBindings: z.ZodMiniDefault<import("zod").ZodDefault<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodObject<{
|
|
72
72
|
connection: import("zod").ZodOptional<import("zod").ZodString>;
|
|
73
|
+
provider: import("zod").ZodOptional<import("zod").ZodString>;
|
|
73
74
|
}, z.core.$strip>>>>;
|
|
74
75
|
providers: z.ZodMiniDefault<import("zod").ZodDefault<import("zod").ZodArray<import("zod").ZodObject<{
|
|
75
76
|
moniker: import("zod").ZodString;
|
|
@@ -110,7 +111,7 @@ export declare const HostActorConfigContext: z.ZodMiniObject<{
|
|
|
110
111
|
accountPath: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
111
112
|
host: z.ZodMiniDefault<z.ZodMiniString<string>>;
|
|
112
113
|
port: z.ZodMiniDefault<z.ZodMiniNumber<unknown>>;
|
|
113
|
-
}, z.core.$
|
|
114
|
+
}, z.core.$strict>;
|
|
114
115
|
}, z.core.$strip>;
|
|
115
116
|
/** HostActorConfigContext type. */
|
|
116
117
|
export type HostActorConfigContext = z.infer<typeof HostActorConfigContext>;
|
|
@@ -170,6 +171,7 @@ export declare const isHostActorConfigContext: <T>(value: T) => value is T & {
|
|
|
170
171
|
}>;
|
|
171
172
|
providerBindings: Record<string, {
|
|
172
173
|
connection?: string | undefined;
|
|
174
|
+
provider?: string | undefined;
|
|
173
175
|
}>;
|
|
174
176
|
providers: {
|
|
175
177
|
[x: string]: unknown;
|
|
@@ -275,6 +277,7 @@ export declare const asHostActorConfigContext: {
|
|
|
275
277
|
}>;
|
|
276
278
|
providerBindings: Record<string, {
|
|
277
279
|
connection?: string | undefined;
|
|
280
|
+
provider?: string | undefined;
|
|
278
281
|
}>;
|
|
279
282
|
providers: {
|
|
280
283
|
[x: string]: unknown;
|
|
@@ -378,6 +381,7 @@ export declare const asHostActorConfigContext: {
|
|
|
378
381
|
}>;
|
|
379
382
|
providerBindings: Record<string, {
|
|
380
383
|
connection?: string | undefined;
|
|
384
|
+
provider?: string | undefined;
|
|
381
385
|
}>;
|
|
382
386
|
providers: {
|
|
383
387
|
[x: string]: unknown;
|
|
@@ -484,6 +488,7 @@ export declare const toHostActorConfigContext: {
|
|
|
484
488
|
}>;
|
|
485
489
|
providerBindings: Record<string, {
|
|
486
490
|
connection?: string | undefined;
|
|
491
|
+
provider?: string | undefined;
|
|
487
492
|
}>;
|
|
488
493
|
providers: {
|
|
489
494
|
[x: string]: unknown;
|
|
@@ -587,6 +592,7 @@ export declare const toHostActorConfigContext: {
|
|
|
587
592
|
}>;
|
|
588
593
|
providerBindings: Record<string, {
|
|
589
594
|
connection?: string | undefined;
|
|
595
|
+
provider?: string | undefined;
|
|
590
596
|
}>;
|
|
591
597
|
providers: {
|
|
592
598
|
[x: string]: unknown;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HostActor.d.ts","sourceRoot":"","sources":["../../../src/context/HostActor.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,UAAU,CAAA;AAK5B,uCA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mE,CAAA"}
|
|
@@ -54,6 +54,7 @@ export declare function getFileConfig(searchPlaces?: string[]): Promise<{
|
|
|
54
54
|
}>;
|
|
55
55
|
providerBindings: Record<string, {
|
|
56
56
|
connection?: string | undefined;
|
|
57
|
+
provider?: string | undefined;
|
|
57
58
|
}>;
|
|
58
59
|
providers: {
|
|
59
60
|
[x: string]: unknown;
|
|
@@ -144,6 +145,7 @@ export declare function getFileConfig(searchPlaces?: string[]): Promise<{
|
|
|
144
145
|
}>;
|
|
145
146
|
providerBindings: Record<string, {
|
|
146
147
|
connection?: string | undefined;
|
|
148
|
+
provider?: string | undefined;
|
|
147
149
|
}>;
|
|
148
150
|
providers: {
|
|
149
151
|
[x: string]: unknown;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getFileConfig.d.ts","sourceRoot":"","sources":["../../src/getFileConfig.ts"],"names":[],"mappings":"AAgBA;;;GAGG;AACH,wBAAsB,aAAa,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE
|
|
1
|
+
{"version":3,"file":"getFileConfig.d.ts","sourceRoot":"","sources":["../../src/getFileConfig.ts"],"names":[],"mappings":"AAgBA;;;GAGG;AACH,wBAAsB,aAAa,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiB1D"}
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
} from "@xylabs/sdk";
|
|
12
12
|
import { globalRegistry as globalRegistry8, z as z12 } from "zod/mini";
|
|
13
13
|
|
|
14
|
-
// src/config/
|
|
14
|
+
// src/config/LocatorConfigFields.ts
|
|
15
15
|
import { z as z11 } from "zod/mini";
|
|
16
16
|
|
|
17
17
|
// src/config/Chain.ts
|
|
@@ -193,6 +193,11 @@ var ProviderBindingConfigZod = z6.object({
|
|
|
193
193
|
description: "Named connection from the top-level connections map",
|
|
194
194
|
title: "providerBindings.connection",
|
|
195
195
|
type: "string"
|
|
196
|
+
}),
|
|
197
|
+
provider: z6.string().optional().register(globalRegistry5, {
|
|
198
|
+
description: "Winning provider descriptor id when config is compile-resolved",
|
|
199
|
+
title: "providerBindings.provider",
|
|
200
|
+
type: "string"
|
|
196
201
|
})
|
|
197
202
|
}).describe("Provider connection binding");
|
|
198
203
|
var ProviderBindingsConfigZod = z6.record(z6.string(), ProviderBindingConfigZod).default({});
|
|
@@ -278,8 +283,8 @@ var ValidationConfigZod = z10.object({
|
|
|
278
283
|
})
|
|
279
284
|
});
|
|
280
285
|
|
|
281
|
-
// src/config/
|
|
282
|
-
var
|
|
286
|
+
// src/config/LocatorConfigFields.ts
|
|
287
|
+
var LocatorConfigFieldsZod = z11.strictObject({
|
|
283
288
|
chain: z11._default(ChainConfigZod, ChainConfigZod.parse({})).check(z11.describe("Configuration for the chain")),
|
|
284
289
|
log: z11._default(LogConfigZod, LogConfigZod.parse({})).check(z11.describe("Configuration for logging")),
|
|
285
290
|
connections: z11._default(ConnectionsConfigZod, ConnectionsConfigZod.parse({})).check(z11.describe("Named connection profiles (rpc, rest, s3, lmdb, mongo, evm-rpc)")),
|
|
@@ -294,7 +299,7 @@ var AccountPathZod = z12.string().check(z12.regex(
|
|
|
294
299
|
/^(m(\/\d+'?)+|\d+'?(\/\d+'?)*)$/,
|
|
295
300
|
`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".`
|
|
296
301
|
));
|
|
297
|
-
var ActorConfigZod = z12.extend(
|
|
302
|
+
var ActorConfigZod = z12.extend(LocatorConfigFieldsZod, {
|
|
298
303
|
name: z12.string(),
|
|
299
304
|
accountPath: z12.optional(AccountPathZod).register(globalRegistry8, {
|
|
300
305
|
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.',
|
|
@@ -315,7 +320,7 @@ var ActorsConfigZod = z13._default(
|
|
|
315
320
|
|
|
316
321
|
// src/config/Config.ts
|
|
317
322
|
import { globalRegistry as globalRegistry9, z as z14 } from "zod/mini";
|
|
318
|
-
var ConfigZod = z14.extend(
|
|
323
|
+
var ConfigZod = z14.extend(LocatorConfigFieldsZod, {
|
|
319
324
|
actors: ActorsConfigZod,
|
|
320
325
|
healthCheckPort: z14.optional(z14.coerce.number()).register(globalRegistry9, {
|
|
321
326
|
description: "Port for the system-wide health, readiness, and liveness endpoints (/healthz, /livez, /readyz). Set to 0 to disable.",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../src/getFileConfig.ts", "../../src/config/Actor.ts", "../../src/config/
|
|
4
|
-
"sourcesContent": ["import { isDefined, isNull } from '@xylabs/sdk'\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'\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'\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 endpoint: z.string().nonempty().optional().describe('S3-compatible API endpoint for reads and writes; when omitted, derived from accountId as a Cloudflare R2 endpoint'),\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'\nimport { LogLevel } from '@xylabs/sdk'\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'\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 { SignerAuthorizationZod } from '@xyo-network/xl1-validation'\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 signerAuthorizations: z.array(SignerAuthorizationZod).default([]).register(globalRegistry, {\n description: 'Authorizations granting signers the right to sign for addresses derived by a given function (e.g. completed-step-reward, derived-receive). Empty = self-transfers only.',\n title: 'validation.signerAuthorizations',\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;AA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AAQC,GAAE,QAAQ,EAAE,QAAQ,KAAK,EAAE,SAASD,iBAAgB;AAAA,IAC1D,SAAS;AAAA,IACT,aAAa;AAAA,IACb,OAAO;AAAA,IACP,MAAM;AAAA,EACR,CAAC;AACH,CAAC;;;ACrBD,SAAS,kBAAAE,iBAAgB,KAAAC,UAAS;AAM3B,IAAM,2BAA2BA,GAAE,OAAO;AAAA,EAC/C,YAAYA,GAAE,OAAO,EAAE,SAAS,EAAE,SAASD,iBAAgB;AAAA,IACzD,aAAa;AAAA,IACb,OAAO;AAAA,IACP,MAAM;AAAA,EACR,CAAC;AACH,CAAC,EAAE,SAAS,6BAA6B;AAKlC,IAAM,4BAA4BC,GAAE,OAAOA,GAAE,OAAO,GAAG,wBAAwB,EAAE,QAAQ,CAAC,CAAC;;;
|
|
3
|
+
"sources": ["../../src/getFileConfig.ts", "../../src/config/Actor.ts", "../../src/config/LocatorConfigFields.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'\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'\nimport { globalRegistry, z } from 'zod/mini'\n\nimport { LocatorConfigFieldsZod } from './LocatorConfigFields.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(LocatorConfigFieldsZod, {\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/**\n * Shared locator process fields \u2014 single source of truth for connection and\n * provider binding config. Composed by `ConfigZod`, refined by\n * `ResolvedLocatorConfigZod`, and imported by orchestration run-config parsing.\n */\nexport const LocatorConfigFieldsZod = z.strictObject({\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/** Loose locator input (yaml, host config, run-config process slice). */\nexport type LocatorConfig = z.infer<typeof LocatorConfigFieldsZod>\n", "import { HexZod } from '@xylabs/sdk'\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 endpoint: z.string().nonempty().optional().describe('S3-compatible API endpoint for reads and writes; when omitted, derived from accountId as a Cloudflare R2 endpoint'),\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'\nimport { LogLevel } from '@xylabs/sdk'\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 provider: z.string().optional().register(globalRegistry, {\n description: 'Winning provider descriptor id when config is compile-resolved',\n title: 'providerBindings.provider',\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'\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 { SignerAuthorizationZod } from '@xyo-network/xl1-validation'\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 signerAuthorizations: z.array(SignerAuthorizationZod).default([]).register(globalRegistry, {\n description: 'Authorizations granting signers the right to sign for addresses derived by a given function (e.g. completed-step-reward, derived-receive). Empty = self-transfers only.',\n title: 'validation.signerAuthorizations',\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 type { DeepPartial } from './DeepPartial.ts'\nimport { LocatorConfigFieldsZod } from './LocatorConfigFields.ts'\n\n/** ConfigZod constant. */\nexport const ConfigZod = z.extend(LocatorConfigFieldsZod, {\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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cAAyB;AAC3D,QAAM,WAAW;AAAA,IACf;AAAA,IACA;AAAA,MACE,OAAO;AAAA,MACP;AAAA,IACF;AAAA,EACF;AACA,QAAM,eAAe,MAAM,SAAS,OAAO;AAC3C,QAAM,SAAkB,cAAc;AACtC,MAAI,CAAC,OAAO,MAAM,GAAG;AACnB,UAAM,UAAW,OAAmC,aAAa;AACjE,QAAI,UAAU,OAAO,KAAK,OAAO,YAAY,UAAU;AACrD,aAAOE,IAAE,YAAY,UAAU,KAAK,EAAE,MAAM,OAAO;AAAA,IACrD;AAAA,EACF;AACA,SAAO,UAAU,MAAM,CAAC,CAAC;AAC3B;",
|
|
6
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", "globalRegistry", "z", "z", "globalRegistry", "z", "z", "globalRegistry", "zodIsFactory", "zodAsFactory", "zodToFactory", "z", "z", "globalRegistry", "z", "z", "globalRegistry", "z"]
|
|
7
7
|
}
|
package/dist/neutral/index.mjs
CHANGED
|
@@ -1703,7 +1703,7 @@ import {
|
|
|
1703
1703
|
} from "@xylabs/sdk";
|
|
1704
1704
|
import { globalRegistry as globalRegistry9, z as z14 } from "zod/mini";
|
|
1705
1705
|
|
|
1706
|
-
// src/config/
|
|
1706
|
+
// src/config/LocatorConfigFields.ts
|
|
1707
1707
|
import { z as z13 } from "zod/mini";
|
|
1708
1708
|
|
|
1709
1709
|
// src/config/Chain.ts
|
|
@@ -1919,6 +1919,11 @@ var ProviderBindingConfigZod = z8.object({
|
|
|
1919
1919
|
description: "Named connection from the top-level connections map",
|
|
1920
1920
|
title: "providerBindings.connection",
|
|
1921
1921
|
type: "string"
|
|
1922
|
+
}),
|
|
1923
|
+
provider: z8.string().optional().register(globalRegistry6, {
|
|
1924
|
+
description: "Winning provider descriptor id when config is compile-resolved",
|
|
1925
|
+
title: "providerBindings.provider",
|
|
1926
|
+
type: "string"
|
|
1922
1927
|
})
|
|
1923
1928
|
}).describe("Provider connection binding");
|
|
1924
1929
|
var ProviderBindingsConfigZod = z8.record(z8.string(), ProviderBindingConfigZod).default({});
|
|
@@ -2922,8 +2927,8 @@ var ValidationConfigZod = z12.object({
|
|
|
2922
2927
|
})
|
|
2923
2928
|
});
|
|
2924
2929
|
|
|
2925
|
-
// src/config/
|
|
2926
|
-
var
|
|
2930
|
+
// src/config/LocatorConfigFields.ts
|
|
2931
|
+
var LocatorConfigFieldsZod = z13.strictObject({
|
|
2927
2932
|
chain: z13._default(ChainConfigZod, ChainConfigZod.parse({})).check(z13.describe("Configuration for the chain")),
|
|
2928
2933
|
log: z13._default(LogConfigZod, LogConfigZod.parse({})).check(z13.describe("Configuration for logging")),
|
|
2929
2934
|
connections: z13._default(ConnectionsConfigZod, ConnectionsConfigZod.parse({})).check(z13.describe("Named connection profiles (rpc, rest, s3, lmdb, mongo, evm-rpc)")),
|
|
@@ -2938,7 +2943,7 @@ var AccountPathZod = z14.string().check(z14.regex(
|
|
|
2938
2943
|
/^(m(\/\d+'?)+|\d+'?(\/\d+'?)*)$/,
|
|
2939
2944
|
`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".`
|
|
2940
2945
|
));
|
|
2941
|
-
var ActorConfigZod = z14.extend(
|
|
2946
|
+
var ActorConfigZod = z14.extend(LocatorConfigFieldsZod, {
|
|
2942
2947
|
name: z14.string(),
|
|
2943
2948
|
accountPath: z14.optional(AccountPathZod).register(globalRegistry9, {
|
|
2944
2949
|
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.',
|
|
@@ -2957,9 +2962,12 @@ var ActorsConfigZod = z15._default(
|
|
|
2957
2962
|
[]
|
|
2958
2963
|
);
|
|
2959
2964
|
|
|
2965
|
+
// src/config/Base.ts
|
|
2966
|
+
var BaseConfigZod = LocatorConfigFieldsZod;
|
|
2967
|
+
|
|
2960
2968
|
// src/config/Config.ts
|
|
2961
2969
|
import { globalRegistry as globalRegistry10, z as z16 } from "zod/mini";
|
|
2962
|
-
var ConfigZod = z16.extend(
|
|
2970
|
+
var ConfigZod = z16.extend(LocatorConfigFieldsZod, {
|
|
2963
2971
|
actors: ActorsConfigZod,
|
|
2964
2972
|
healthCheckPort: z16.optional(z16.coerce.number()).register(globalRegistry10, {
|
|
2965
2973
|
description: "Port for the system-wide health, readiness, and liveness endpoints (/healthz, /livez, /readyz). Set to 0 to disable.",
|
|
@@ -3005,6 +3013,51 @@ var isHostActorConfig = zodIsFactory3(HostActorConfigZod);
|
|
|
3005
3013
|
var asHostActorConfig = zodAsFactory4(HostActorConfigZod, "asHostActorConfig");
|
|
3006
3014
|
var toHostActorConfig = zodToFactory3(HostActorConfigZod, "toHostActorConfig");
|
|
3007
3015
|
|
|
3016
|
+
// src/config/ResolvedLocatorConfig.ts
|
|
3017
|
+
function assertConnectionReferences(config) {
|
|
3018
|
+
const connections = config.connections ?? {};
|
|
3019
|
+
for (const [moniker, binding] of Object.entries(config.providerBindings ?? {})) {
|
|
3020
|
+
const connectionName = binding?.connection;
|
|
3021
|
+
if (connectionName === void 0 || connectionName === "") continue;
|
|
3022
|
+
if (!Object.hasOwn(connections, connectionName)) {
|
|
3023
|
+
throw new Error(
|
|
3024
|
+
`Resolved locator config: providerBindings.${moniker}.connection references unknown connection "${connectionName}"`
|
|
3025
|
+
);
|
|
3026
|
+
}
|
|
3027
|
+
}
|
|
3028
|
+
}
|
|
3029
|
+
function assertRequiredBindings(config, needs) {
|
|
3030
|
+
for (const moniker of needs.required) {
|
|
3031
|
+
const binding = config.providerBindings?.[moniker];
|
|
3032
|
+
if (binding === void 0) {
|
|
3033
|
+
throw new Error(
|
|
3034
|
+
`Resolved locator config: missing providerBindings entry for required moniker "${moniker}"`
|
|
3035
|
+
);
|
|
3036
|
+
}
|
|
3037
|
+
}
|
|
3038
|
+
}
|
|
3039
|
+
function assertResolvedLocatorConfig(raw, options = {}) {
|
|
3040
|
+
const config = LocatorConfigFieldsZod.parse(raw);
|
|
3041
|
+
assertConnectionReferences(config);
|
|
3042
|
+
if (options.needs !== void 0) {
|
|
3043
|
+
assertRequiredBindings(config, options.needs);
|
|
3044
|
+
}
|
|
3045
|
+
return config;
|
|
3046
|
+
}
|
|
3047
|
+
var ResolvedLocatorConfigZod = LocatorConfigFieldsZod.check((ctx) => {
|
|
3048
|
+
try {
|
|
3049
|
+
assertConnectionReferences(ctx.value);
|
|
3050
|
+
} catch (error) {
|
|
3051
|
+
if (error instanceof Error) {
|
|
3052
|
+
ctx.issues.push({
|
|
3053
|
+
code: "custom",
|
|
3054
|
+
message: error.message,
|
|
3055
|
+
input: ctx.value
|
|
3056
|
+
});
|
|
3057
|
+
}
|
|
3058
|
+
}
|
|
3059
|
+
});
|
|
3060
|
+
|
|
3008
3061
|
// src/config/resolveRestConnectionEndpoint.ts
|
|
3009
3062
|
import { assertEx as assertEx21, isDefined as isDefined14 } from "@xylabs/sdk";
|
|
3010
3063
|
function asRestConnectionConfig(connection) {
|
|
@@ -3111,7 +3164,7 @@ import { z as z19 } from "zod/mini";
|
|
|
3111
3164
|
var SystemStatusRunnerZod = z19.custom((val) => val !== null && val !== void 0 && typeof val === "object");
|
|
3112
3165
|
var ProviderFactoryLocatorZod = z19.lazy(() => z19.custom((val) => val !== null && val !== void 0 && typeof val === "object" && "context" in val && "registry" in val));
|
|
3113
3166
|
var BaseConfigContextZod = z19.extend(CachingContextZod, {
|
|
3114
|
-
config: z19.looseObject(
|
|
3167
|
+
config: z19.looseObject(LocatorConfigFieldsZod.shape),
|
|
3115
3168
|
locator: z19.optional(ProviderFactoryLocatorZod)
|
|
3116
3169
|
});
|
|
3117
3170
|
var CreatableProviderContextZod = z19.lazy(() => z19.extend(BaseConfigContextZod, {
|
|
@@ -7962,6 +8015,7 @@ export {
|
|
|
7962
8015
|
HydratedCache,
|
|
7963
8016
|
JSONSchemaMetaSchema,
|
|
7964
8017
|
LmdbConnectionConfigZod,
|
|
8018
|
+
LocatorConfigFieldsZod,
|
|
7965
8019
|
LoggerStatusReporter,
|
|
7966
8020
|
MemoryArchivistFactory,
|
|
7967
8021
|
MemoryConnectionConfigZod,
|
|
@@ -7984,6 +8038,7 @@ export {
|
|
|
7984
8038
|
ProvidersConfigZod,
|
|
7985
8039
|
REJECTED_BLOCKS_ARCHIVIST_ROLE,
|
|
7986
8040
|
REJECTED_TRANSACTIONS_ARCHIVIST_ROLE,
|
|
8041
|
+
ResolvedLocatorConfigZod,
|
|
7987
8042
|
RestConnectionConfigZod,
|
|
7988
8043
|
RestDataLakeRunner,
|
|
7989
8044
|
RestDataLakeViewer,
|
|
@@ -8072,6 +8127,7 @@ export {
|
|
|
8072
8127
|
asSchemasStepSummaryWithStorageMeta,
|
|
8073
8128
|
asTransfersStepSummary,
|
|
8074
8129
|
asTransfersStepSummaryWithStorageMeta,
|
|
8130
|
+
assertResolvedLocatorConfig,
|
|
8075
8131
|
backedFactory,
|
|
8076
8132
|
backingsSatisfied,
|
|
8077
8133
|
balancesMaxStep,
|