@xyo-network/xl1-protocol-sdk 1.25.21 → 1.25.23
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 +5 -7
- package/dist/neutral/CreatableProvider/AbstractCreatableProvider.d.ts.map +1 -1
- package/dist/neutral/config/Actor.d.ts +6 -36
- package/dist/neutral/config/Actor.d.ts.map +1 -1
- package/dist/neutral/config/Base.d.ts +1 -6
- package/dist/neutral/config/Base.d.ts.map +1 -1
- package/dist/neutral/config/Config.d.ts +5 -30
- package/dist/neutral/config/Config.d.ts.map +1 -1
- package/dist/neutral/config/DataLake/DataLake.d.ts +4 -12
- package/dist/neutral/config/DataLake/DataLake.d.ts.map +1 -1
- package/dist/neutral/config/DataLake/DataLakeRemoteConfig.d.ts +6 -0
- package/dist/neutral/config/DataLake/DataLakeRemoteConfig.d.ts.map +1 -0
- package/dist/neutral/config/DataLake/RestDataLakeConfig.d.ts +7 -0
- package/dist/neutral/config/DataLake/RestDataLakeConfig.d.ts.map +1 -0
- package/dist/neutral/config/DataLake/RouterDataLakeConfig.d.ts +8 -0
- package/dist/neutral/config/DataLake/RouterDataLakeConfig.d.ts.map +1 -0
- package/dist/neutral/config/DataLake/index.d.ts +3 -2
- package/dist/neutral/config/DataLake/index.d.ts.map +1 -1
- package/dist/neutral/config/HostActor.d.ts +6 -36
- package/dist/neutral/config/HostActor.d.ts.map +1 -1
- package/dist/neutral/context/Actor.d.ts +6 -36
- package/dist/neutral/context/Actor.d.ts.map +1 -1
- package/dist/neutral/context/HostActor.d.ts +6 -36
- package/dist/neutral/context/HostActor.d.ts.map +1 -1
- package/dist/neutral/getFileConfig.d.ts +2 -12
- package/dist/neutral/getFileConfig.d.ts.map +1 -1
- package/dist/neutral/getFileConfig.mjs +83 -76
- package/dist/neutral/getFileConfig.mjs.map +1 -1
- package/dist/neutral/index.mjs +154 -129
- package/dist/neutral/index.mjs.map +1 -1
- package/dist/neutral/model/CreatableProviderContext.zod.d.ts +6 -36
- package/dist/neutral/model/CreatableProviderContext.zod.d.ts.map +1 -1
- package/dist/neutral/test/index.mjs +103 -78
- package/dist/neutral/test/index.mjs.map +1 -1
- package/package.json +8 -8
- package/src/CreatableProvider/AbstractCreatableProvider.ts +21 -2
- package/src/config/Base.ts +1 -1
- package/src/config/DataLake/DataLake.ts +7 -11
- package/src/config/DataLake/DataLakeRemoteConfig.ts +9 -0
- package/src/config/DataLake/RestDataLakeConfig.ts +16 -0
- package/src/config/DataLake/RouterDataLakeConfig.ts +20 -0
- package/src/config/DataLake/index.ts +3 -2
- package/dist/neutral/config/DataLake/DataLakeRemoteDriverConfig.d.ts +0 -7
- package/dist/neutral/config/DataLake/DataLakeRemoteDriverConfig.d.ts.map +0 -1
- package/dist/neutral/config/DataLake/RestDataLakeRemoteDriverConfig.d.ts +0 -7
- package/dist/neutral/config/DataLake/RestDataLakeRemoteDriverConfig.d.ts.map +0 -1
- package/src/config/DataLake/DataLakeRemoteDriverConfig.ts +0 -13
- package/src/config/DataLake/RestDataLakeRemoteDriverConfig.ts +0 -12
|
@@ -27,12 +27,7 @@ export declare const BaseConfigContextZod: z.ZodObject<{
|
|
|
27
27
|
readonly __address: true;
|
|
28
28
|
}, string>>>;
|
|
29
29
|
}, z.core.$strip>>;
|
|
30
|
-
dataLake: z.
|
|
31
|
-
drivers: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
32
|
-
url: z.ZodString;
|
|
33
|
-
protocol: z.ZodLiteral<"rest">;
|
|
34
|
-
}, z.core.$strip>]>>>;
|
|
35
|
-
}, z.core.$strip>>;
|
|
30
|
+
dataLake: z.ZodOptional<z.ZodType<import("../config/index.ts").DataLakeConfig, unknown, z.core.$ZodTypeInternals<import("../config/index.ts").DataLakeConfig, unknown>>>;
|
|
36
31
|
evm: z.ZodDefault<z.ZodObject<{
|
|
37
32
|
chainId: z.ZodOptional<z.ZodString>;
|
|
38
33
|
infura: z.ZodOptional<z.ZodObject<{
|
|
@@ -115,12 +110,6 @@ export declare const isBaseConfigContext: <T>(value: T) => value is T & {
|
|
|
115
110
|
readonly __address: true;
|
|
116
111
|
}) | undefined;
|
|
117
112
|
};
|
|
118
|
-
dataLake: {
|
|
119
|
-
drivers?: {
|
|
120
|
-
url: string;
|
|
121
|
-
protocol: "rest";
|
|
122
|
-
}[] | undefined;
|
|
123
|
-
};
|
|
124
113
|
evm: {
|
|
125
114
|
chainId?: string | undefined;
|
|
126
115
|
infura?: {
|
|
@@ -178,6 +167,7 @@ export declare const isBaseConfigContext: <T>(value: T) => value is T & {
|
|
|
178
167
|
readonly __address: true;
|
|
179
168
|
})[] | undefined;
|
|
180
169
|
};
|
|
170
|
+
dataLake?: import("../config/index.ts").DataLakeConfig | undefined;
|
|
181
171
|
};
|
|
182
172
|
logger?: import("@xylabs/sdk-js").Logger | undefined;
|
|
183
173
|
meterProvider?: import("@opentelemetry/api").MeterProvider | undefined;
|
|
@@ -199,12 +189,6 @@ export declare const asBaseConfigContext: {
|
|
|
199
189
|
readonly __address: true;
|
|
200
190
|
}) | undefined;
|
|
201
191
|
};
|
|
202
|
-
dataLake: {
|
|
203
|
-
drivers?: {
|
|
204
|
-
url: string;
|
|
205
|
-
protocol: "rest";
|
|
206
|
-
}[] | undefined;
|
|
207
|
-
};
|
|
208
192
|
evm: {
|
|
209
193
|
chainId?: string | undefined;
|
|
210
194
|
infura?: {
|
|
@@ -262,6 +246,7 @@ export declare const asBaseConfigContext: {
|
|
|
262
246
|
readonly __address: true;
|
|
263
247
|
})[] | undefined;
|
|
264
248
|
};
|
|
249
|
+
dataLake?: import("../config/index.ts").DataLakeConfig | undefined;
|
|
265
250
|
};
|
|
266
251
|
logger?: import("@xylabs/sdk-js").Logger | undefined;
|
|
267
252
|
meterProvider?: import("@opentelemetry/api").MeterProvider | undefined;
|
|
@@ -282,12 +267,6 @@ export declare const asBaseConfigContext: {
|
|
|
282
267
|
readonly __address: true;
|
|
283
268
|
}) | undefined;
|
|
284
269
|
};
|
|
285
|
-
dataLake: {
|
|
286
|
-
drivers?: {
|
|
287
|
-
url: string;
|
|
288
|
-
protocol: "rest";
|
|
289
|
-
}[] | undefined;
|
|
290
|
-
};
|
|
291
270
|
evm: {
|
|
292
271
|
chainId?: string | undefined;
|
|
293
272
|
infura?: {
|
|
@@ -345,6 +324,7 @@ export declare const asBaseConfigContext: {
|
|
|
345
324
|
readonly __address: true;
|
|
346
325
|
})[] | undefined;
|
|
347
326
|
};
|
|
327
|
+
dataLake?: import("../config/index.ts").DataLakeConfig | undefined;
|
|
348
328
|
};
|
|
349
329
|
logger?: import("@xylabs/sdk-js").Logger | undefined;
|
|
350
330
|
meterProvider?: import("@opentelemetry/api").MeterProvider | undefined;
|
|
@@ -367,12 +347,6 @@ export declare const toBaseConfigContext: {
|
|
|
367
347
|
readonly __address: true;
|
|
368
348
|
}) | undefined;
|
|
369
349
|
};
|
|
370
|
-
dataLake: {
|
|
371
|
-
drivers?: {
|
|
372
|
-
url: string;
|
|
373
|
-
protocol: "rest";
|
|
374
|
-
}[] | undefined;
|
|
375
|
-
};
|
|
376
350
|
evm: {
|
|
377
351
|
chainId?: string | undefined;
|
|
378
352
|
infura?: {
|
|
@@ -430,6 +404,7 @@ export declare const toBaseConfigContext: {
|
|
|
430
404
|
readonly __address: true;
|
|
431
405
|
})[] | undefined;
|
|
432
406
|
};
|
|
407
|
+
dataLake?: import("../config/index.ts").DataLakeConfig | undefined;
|
|
433
408
|
};
|
|
434
409
|
logger?: import("@xylabs/sdk-js").Logger | undefined;
|
|
435
410
|
meterProvider?: import("@opentelemetry/api").MeterProvider | undefined;
|
|
@@ -450,12 +425,6 @@ export declare const toBaseConfigContext: {
|
|
|
450
425
|
readonly __address: true;
|
|
451
426
|
}) | undefined;
|
|
452
427
|
};
|
|
453
|
-
dataLake: {
|
|
454
|
-
drivers?: {
|
|
455
|
-
url: string;
|
|
456
|
-
protocol: "rest";
|
|
457
|
-
}[] | undefined;
|
|
458
|
-
};
|
|
459
428
|
evm: {
|
|
460
429
|
chainId?: string | undefined;
|
|
461
430
|
infura?: {
|
|
@@ -513,6 +482,7 @@ export declare const toBaseConfigContext: {
|
|
|
513
482
|
readonly __address: true;
|
|
514
483
|
})[] | undefined;
|
|
515
484
|
};
|
|
485
|
+
dataLake?: import("../config/index.ts").DataLakeConfig | undefined;
|
|
516
486
|
};
|
|
517
487
|
logger?: import("@xylabs/sdk-js").Logger | undefined;
|
|
518
488
|
meterProvider?: import("@opentelemetry/api").MeterProvider | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreatableProviderContext.zod.d.ts","sourceRoot":"","sources":["../../../src/model/CreatableProviderContext.zod.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAE/D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,EAAE,KAAK,UAAU,EAAiB,MAAM,oBAAoB,CAAA;AACnE,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,+BAA+B,CAAA;AACnF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAA;AAE9D,eAAO,MAAM,uBAAuB,yDAAwE,CAAA;AAE5G,eAAO,MAAM,yBAAyB,EAAE,CAAC,CAAC,OAAO,CAAC,8BAA8B,CAC2C,CAAA;AAE3H,MAAM,MAAM,4BAA4B,GAAG,cAAc,GAAG;IAC1D,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,UAAU,CAAA;IAClB,OAAO,EAAE,8BAA8B,CAAA;IACvC,cAAc,CAAC,EAAE,oBAAoB,CAAA;CACtC,CAAA;AAED,eAAO,MAAM,oBAAoB
|
|
1
|
+
{"version":3,"file":"CreatableProviderContext.zod.d.ts","sourceRoot":"","sources":["../../../src/model/CreatableProviderContext.zod.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAE/D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,EAAE,KAAK,UAAU,EAAiB,MAAM,oBAAoB,CAAA;AACnE,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,+BAA+B,CAAA;AACnF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAA;AAE9D,eAAO,MAAM,uBAAuB,yDAAwE,CAAA;AAE5G,eAAO,MAAM,yBAAyB,EAAE,CAAC,CAAC,OAAO,CAAC,8BAA8B,CAC2C,CAAA;AAE3H,MAAM,MAAM,4BAA4B,GAAG,cAAc,GAAG;IAC1D,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,UAAU,CAAA;IAClB,OAAO,EAAE,8BAA8B,CAAA;IACvC,cAAc,CAAC,EAAE,oBAAoB,CAAA;CACtC,CAAA;AAED,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAG/B,CAAA;AACF,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAEpE,eAAO,MAAM,2BAA2B,EAAE,CAAC,CAAC,OAAO,CAAC,4BAA4B,CAK3E,CAAA;AAEL,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAqC,CAAA;AACrE,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAA4D,CAAA;AAC5F,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAA4D,CAAA;AAE5F,eAAO,MAAM,0BAA0B;;;;;;;;UAvB/B,MAAM;YACJ,UAAU;aACT,8BAA8B;qBACtB,oBAAoB;CAoB4C,CAAA;AACnF,eAAO,MAAM,0BAA0B;;;;;;;;;cAxB/B,MAAM;gBACJ,UAAU;iBACT,8BAA8B;yBACtB,oBAAoB;;;;;;;;;;cAH/B,MAAM;gBACJ,UAAU;iBACT,8BAA8B;yBACtB,oBAAoB;;CAqB0E,CAAA;AACjH,eAAO,MAAM,0BAA0B;;;;;;;;;cAzB/B,MAAM;gBACJ,UAAU;iBACT,8BAA8B;yBACtB,oBAAoB;;;;;;;;;;cAH/B,MAAM;gBACJ,UAAU;iBACT,8BAA8B;yBACtB,oBAAoB;;CAsB0E,CAAA"}
|
|
@@ -15,7 +15,11 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
15
15
|
import { XYO_ZERO_ADDRESS as XYO_ZERO_ADDRESS3 } from "@xyo-network/xl1-protocol";
|
|
16
16
|
|
|
17
17
|
// src/CreatableProvider/AbstractCreatableProvider.ts
|
|
18
|
-
import {
|
|
18
|
+
import {
|
|
19
|
+
AbstractCreatable,
|
|
20
|
+
assertEx as assertEx2,
|
|
21
|
+
IdLogger
|
|
22
|
+
} from "@xylabs/sdk-js";
|
|
19
23
|
|
|
20
24
|
// src/CreatableProvider/ProviderFactory.ts
|
|
21
25
|
import { assertEx } from "@xylabs/sdk-js";
|
|
@@ -109,8 +113,13 @@ var ProviderFactory = class _ProviderFactory {
|
|
|
109
113
|
var AbstractCreatableProvider = class extends AbstractCreatable {
|
|
110
114
|
dependencies = {};
|
|
111
115
|
_contextCache;
|
|
116
|
+
_logger;
|
|
112
117
|
get logger() {
|
|
113
|
-
|
|
118
|
+
if (this._logger === void 0) {
|
|
119
|
+
const providedLogger = this.params.logger ?? this.context.logger;
|
|
120
|
+
this._logger = providedLogger ? new IdLogger(providedLogger, () => `${this.moniker} [${this.constructor.name}]`) : null;
|
|
121
|
+
}
|
|
122
|
+
return this._logger ?? void 0;
|
|
114
123
|
}
|
|
115
124
|
get meter() {
|
|
116
125
|
return this.context.meterProvider?.getMeter(this.name) ?? super.meter;
|
|
@@ -147,6 +156,15 @@ var AbstractCreatableProvider = class extends AbstractCreatable {
|
|
|
147
156
|
logger: params.logger ?? context.logger
|
|
148
157
|
});
|
|
149
158
|
}
|
|
159
|
+
async createHandler() {
|
|
160
|
+
await super.createHandler();
|
|
161
|
+
if (this.tracer === void 0) {
|
|
162
|
+
this.logger?.warn("No tracer available in context");
|
|
163
|
+
}
|
|
164
|
+
if (this.meter === void 0) {
|
|
165
|
+
this.logger?.warn("No meter available in context");
|
|
166
|
+
}
|
|
167
|
+
}
|
|
150
168
|
async locateAndCreate(moniker) {
|
|
151
169
|
return await this.locator.getInstance(moniker);
|
|
152
170
|
}
|
|
@@ -365,7 +383,7 @@ import {
|
|
|
365
383
|
zodIsFactory,
|
|
366
384
|
zodToFactory
|
|
367
385
|
} from "@xylabs/sdk-js";
|
|
368
|
-
import { globalRegistry as globalRegistry12, z as
|
|
386
|
+
import { globalRegistry as globalRegistry12, z as z15 } from "zod";
|
|
369
387
|
|
|
370
388
|
// src/validation/schema/Mnemonic.ts
|
|
371
389
|
import { z } from "zod";
|
|
@@ -375,7 +393,7 @@ var MnemonicStringZod = z.string().transform((s) => s.trim().replaceAll(/\s+/g,
|
|
|
375
393
|
).describe("BIP-39 mnemonic string");
|
|
376
394
|
|
|
377
395
|
// src/config/Base.ts
|
|
378
|
-
import { z as
|
|
396
|
+
import { z as z14 } from "zod";
|
|
379
397
|
|
|
380
398
|
// src/config/Chain.ts
|
|
381
399
|
import { AddressZod, HexZod } from "@xylabs/sdk-js";
|
|
@@ -394,64 +412,71 @@ var ChainConfigZod = z2.object({
|
|
|
394
412
|
});
|
|
395
413
|
|
|
396
414
|
// src/config/DataLake/DataLake.ts
|
|
397
|
-
import {
|
|
415
|
+
import { z as z6 } from "zod";
|
|
398
416
|
|
|
399
|
-
// src/config/DataLake/
|
|
417
|
+
// src/config/DataLake/RestDataLakeConfig.ts
|
|
400
418
|
import { globalRegistry as globalRegistry3, z as z4 } from "zod";
|
|
401
419
|
|
|
402
|
-
// src/config/DataLake/
|
|
420
|
+
// src/config/DataLake/DataLakeRemoteConfig.ts
|
|
403
421
|
import { globalRegistry as globalRegistry2, z as z3 } from "zod";
|
|
404
|
-
var
|
|
405
|
-
|
|
406
|
-
description: "
|
|
407
|
-
type: "string"
|
|
408
|
-
}),
|
|
409
|
-
url: z3.string().register(globalRegistry2, {
|
|
410
|
-
description: "URL for the data lake driver",
|
|
422
|
+
var DataLakeDriverConfigBaseZod = z3.object({
|
|
423
|
+
driver: z3.string().register(globalRegistry2, {
|
|
424
|
+
description: "Driver for the data lake",
|
|
411
425
|
type: "string"
|
|
412
426
|
})
|
|
413
|
-
}).describe("Base configuration for a
|
|
427
|
+
}).describe("Base configuration for a data lake driver");
|
|
414
428
|
|
|
415
|
-
// src/config/DataLake/
|
|
416
|
-
var
|
|
417
|
-
|
|
418
|
-
description: "
|
|
429
|
+
// src/config/DataLake/RestDataLakeConfig.ts
|
|
430
|
+
var RestDataLakeConfigZod = DataLakeDriverConfigBaseZod.extend({
|
|
431
|
+
driver: z4.literal("rest").register(globalRegistry3, {
|
|
432
|
+
description: "Driver for the REST data lake",
|
|
433
|
+
type: "string"
|
|
434
|
+
}),
|
|
435
|
+
url: z4.string().register(globalRegistry3, {
|
|
436
|
+
description: "URL for the REST data lake",
|
|
419
437
|
type: "string"
|
|
420
438
|
})
|
|
421
439
|
}).describe("Configuration for the REST data lake driver");
|
|
422
440
|
|
|
423
|
-
// src/config/DataLake/
|
|
424
|
-
|
|
425
|
-
var
|
|
426
|
-
|
|
427
|
-
description: "
|
|
441
|
+
// src/config/DataLake/RouterDataLakeConfig.ts
|
|
442
|
+
import { globalRegistry as globalRegistry4, z as z5 } from "zod";
|
|
443
|
+
var RouterDataLakeConfigZod = z5.object({
|
|
444
|
+
driver: z5.literal("router").register(globalRegistry4, {
|
|
445
|
+
description: "Driver for the router data lake",
|
|
446
|
+
type: "string"
|
|
447
|
+
}),
|
|
448
|
+
children: z5.array(z5.lazy(() => DataLakeConfigZod)).register(globalRegistry4, {
|
|
449
|
+
description: "Child data lake drivers",
|
|
428
450
|
type: "array"
|
|
429
451
|
})
|
|
430
|
-
}).describe("Configuration for data lake
|
|
452
|
+
}).describe("Configuration for the router data lake driver");
|
|
453
|
+
|
|
454
|
+
// src/config/DataLake/DataLake.ts
|
|
455
|
+
var DataLakeConfigZod = z6.lazy(() => z6.union([RestDataLakeConfigZod, RouterDataLakeConfigZod])).describe("Configuration for a data lake");
|
|
431
456
|
|
|
432
457
|
// src/config/Evm.ts
|
|
433
|
-
import { globalRegistry as globalRegistry5, z as
|
|
434
|
-
var EvmInfuraConfigZod =
|
|
435
|
-
projectId:
|
|
458
|
+
import { globalRegistry as globalRegistry5, z as z7 } from "zod";
|
|
459
|
+
var EvmInfuraConfigZod = z7.object({
|
|
460
|
+
projectId: z7.string().optional().register(globalRegistry5, {
|
|
436
461
|
description: "Infura project ID",
|
|
437
462
|
title: "evm.infura.projectId",
|
|
438
463
|
type: "string"
|
|
439
464
|
}),
|
|
440
|
-
projectSecret:
|
|
465
|
+
projectSecret: z7.string().optional().register(globalRegistry5, {
|
|
441
466
|
description: "Infura project secret",
|
|
442
467
|
title: "evm.infura.projectSecret",
|
|
443
468
|
type: "string"
|
|
444
469
|
})
|
|
445
470
|
});
|
|
446
|
-
var EvmJsonRpcConfigZod =
|
|
447
|
-
url:
|
|
471
|
+
var EvmJsonRpcConfigZod = z7.object({
|
|
472
|
+
url: z7.url().optional().register(globalRegistry5, {
|
|
448
473
|
description: "JSON-RPC URL",
|
|
449
474
|
title: "evm.jsonRpc.url",
|
|
450
475
|
type: "string"
|
|
451
476
|
})
|
|
452
477
|
});
|
|
453
|
-
var EvmConfigZod =
|
|
454
|
-
chainId:
|
|
478
|
+
var EvmConfigZod = z7.object({
|
|
479
|
+
chainId: z7.string().optional().register(globalRegistry5, {
|
|
455
480
|
description: "EVM chain ID",
|
|
456
481
|
title: "evm.chainId",
|
|
457
482
|
type: "string"
|
|
@@ -462,17 +487,17 @@ var EvmConfigZod = z6.object({
|
|
|
462
487
|
|
|
463
488
|
// src/config/Log.ts
|
|
464
489
|
import { LogLevel } from "@xylabs/sdk-js";
|
|
465
|
-
import { globalRegistry as globalRegistry6, z as
|
|
490
|
+
import { globalRegistry as globalRegistry6, z as z8 } from "zod";
|
|
466
491
|
var LogLevelNames = Object.keys(LogLevel);
|
|
467
|
-
var LogConfigZod =
|
|
468
|
-
logLevel:
|
|
492
|
+
var LogConfigZod = z8.object({
|
|
493
|
+
logLevel: z8.enum(LogLevelNames).default("info").register(globalRegistry6, {
|
|
469
494
|
choices: LogLevelNames,
|
|
470
495
|
default: "info",
|
|
471
496
|
description: "Desired process verbosity",
|
|
472
497
|
title: "logLevel",
|
|
473
498
|
type: "string"
|
|
474
499
|
}),
|
|
475
|
-
silent:
|
|
500
|
+
silent: z8.boolean().default(false).register(globalRegistry6, {
|
|
476
501
|
default: false,
|
|
477
502
|
description: "Whether to run in silent mode",
|
|
478
503
|
title: "silent",
|
|
@@ -481,66 +506,66 @@ var LogConfigZod = z7.object({
|
|
|
481
506
|
});
|
|
482
507
|
|
|
483
508
|
// src/config/Remote.ts
|
|
484
|
-
import { globalRegistry as globalRegistry7, z as
|
|
485
|
-
var RpcRemoteConfigBaseZod =
|
|
486
|
-
protocol:
|
|
509
|
+
import { globalRegistry as globalRegistry7, z as z9 } from "zod";
|
|
510
|
+
var RpcRemoteConfigBaseZod = z9.object({
|
|
511
|
+
protocol: z9.string("http").register(globalRegistry7, {
|
|
487
512
|
description: "Protocol for the RPC connection",
|
|
488
513
|
type: "string"
|
|
489
514
|
})
|
|
490
515
|
}).describe("Base configuration for the remote RPC");
|
|
491
516
|
var HttpRpcRemoteConfigZod = RpcRemoteConfigBaseZod.extend({
|
|
492
|
-
protocol:
|
|
517
|
+
protocol: z9.string("http").register(globalRegistry7, {
|
|
493
518
|
description: "Protocol for the RPC connection",
|
|
494
519
|
type: "string"
|
|
495
520
|
}).default("http"),
|
|
496
|
-
url:
|
|
521
|
+
url: z9.string().register(globalRegistry7, {
|
|
497
522
|
description: "URL for the Chain RPC API",
|
|
498
523
|
type: "string"
|
|
499
524
|
})
|
|
500
525
|
}).describe("Configuration for the remote RPC using Http");
|
|
501
526
|
var PostMessageRpcRemoteConfigZod = RpcRemoteConfigBaseZod.extend({
|
|
502
|
-
protocol:
|
|
527
|
+
protocol: z9.string().register(globalRegistry7, {
|
|
503
528
|
description: "Protocol for the RPC connection",
|
|
504
529
|
type: "string"
|
|
505
530
|
}).default("postMessage"),
|
|
506
|
-
networkId:
|
|
531
|
+
networkId: z9.string().register(globalRegistry7, {
|
|
507
532
|
description: "Network ID to use for the postMessage RPC connection",
|
|
508
533
|
type: "string"
|
|
509
534
|
}),
|
|
510
|
-
sessionId:
|
|
535
|
+
sessionId: z9.string().register(globalRegistry7, {
|
|
511
536
|
description: "Session ID to use for the postMessage RPC connection",
|
|
512
537
|
type: "string"
|
|
513
538
|
})
|
|
514
539
|
}).describe("Configuration for the remote RPC using postMessage");
|
|
515
|
-
var RpcRemoteConfigZod =
|
|
516
|
-
var RemoteConfigZod =
|
|
540
|
+
var RpcRemoteConfigZod = z9.union([HttpRpcRemoteConfigZod, PostMessageRpcRemoteConfigZod]).describe("Configuration for a remote RPC connection, either Http or postMessage");
|
|
541
|
+
var RemoteConfigZod = z9.object({ rpc: RpcRemoteConfigZod.optional() }).describe("Configuration for remote connections, including RPC");
|
|
517
542
|
|
|
518
543
|
// src/config/storage/driver/Mongo.ts
|
|
519
544
|
import { isDefined, isUndefined } from "@xylabs/sdk-js";
|
|
520
|
-
import { globalRegistry as globalRegistry8, z as
|
|
521
|
-
var MongoConfigZod =
|
|
545
|
+
import { globalRegistry as globalRegistry8, z as z10 } from "zod";
|
|
546
|
+
var MongoConfigZod = z10.object({
|
|
522
547
|
// TODO: Create from other arguments
|
|
523
|
-
connectionString:
|
|
548
|
+
connectionString: z10.string().nonempty().optional().register(globalRegistry8, {
|
|
524
549
|
description: "MongoDB connection string",
|
|
525
550
|
title: "storage.mongo.connectionString",
|
|
526
551
|
type: "string"
|
|
527
552
|
}),
|
|
528
|
-
database:
|
|
553
|
+
database: z10.string().nonempty().optional().register(globalRegistry8, {
|
|
529
554
|
description: "MongoDB database name",
|
|
530
555
|
title: "storage.mongo.database",
|
|
531
556
|
type: "string"
|
|
532
557
|
}),
|
|
533
|
-
domain:
|
|
558
|
+
domain: z10.string().nonempty().optional().register(globalRegistry8, {
|
|
534
559
|
description: "MongoDB domain",
|
|
535
560
|
title: "storage.mongo.domain",
|
|
536
561
|
type: "string"
|
|
537
562
|
}),
|
|
538
|
-
password:
|
|
563
|
+
password: z10.string().nonempty().optional().register(globalRegistry8, {
|
|
539
564
|
description: "MongoDB password",
|
|
540
565
|
title: "storage.mongo.password",
|
|
541
566
|
type: "string"
|
|
542
567
|
}),
|
|
543
|
-
username:
|
|
568
|
+
username: z10.string().nonempty().optional().register(globalRegistry8, {
|
|
544
569
|
description: "MongoDB username",
|
|
545
570
|
title: "storage.mongo.username",
|
|
546
571
|
type: "string"
|
|
@@ -548,10 +573,10 @@ var MongoConfigZod = z9.object({
|
|
|
548
573
|
});
|
|
549
574
|
|
|
550
575
|
// src/config/storage/Storage.ts
|
|
551
|
-
import { globalRegistry as globalRegistry9, z as
|
|
552
|
-
var StorageConfigZod =
|
|
576
|
+
import { globalRegistry as globalRegistry9, z as z11 } from "zod";
|
|
577
|
+
var StorageConfigZod = z11.object({
|
|
553
578
|
mongo: MongoConfigZod.optional().describe("Configuration for the MongoD storage driver"),
|
|
554
|
-
root:
|
|
579
|
+
root: z11.string().optional().register(globalRegistry9, {
|
|
555
580
|
description: "Root directory for local storage",
|
|
556
581
|
title: "storage.root",
|
|
557
582
|
type: "string"
|
|
@@ -559,30 +584,30 @@ var StorageConfigZod = z10.object({
|
|
|
559
584
|
}).describe("Storage configuration options");
|
|
560
585
|
|
|
561
586
|
// src/config/Telemetry.ts
|
|
562
|
-
import { globalRegistry as globalRegistry10, z as
|
|
563
|
-
var MetricsScrapeConfigZod =
|
|
564
|
-
path:
|
|
587
|
+
import { globalRegistry as globalRegistry10, z as z12 } from "zod";
|
|
588
|
+
var MetricsScrapeConfigZod = z12.object({
|
|
589
|
+
path: z12.string().default("/metrics").register(globalRegistry10, {
|
|
565
590
|
default: "/metrics",
|
|
566
591
|
description: "Path for the metrics scrape endpoint",
|
|
567
592
|
title: "telemetry.metrics.scrape.path",
|
|
568
593
|
type: "string"
|
|
569
594
|
}),
|
|
570
|
-
port:
|
|
595
|
+
port: z12.coerce.number().int().positive().optional().register(globalRegistry10, {
|
|
571
596
|
description: "Port for the metrics scrape endpoint",
|
|
572
597
|
title: "telemetry.metrics.scrape.port",
|
|
573
598
|
type: "number"
|
|
574
599
|
})
|
|
575
600
|
}).describe("Metrics scrape configuration");
|
|
576
|
-
var MetricsConfigZod =
|
|
577
|
-
var OpenTelemetryConfigZod =
|
|
601
|
+
var MetricsConfigZod = z12.object({ scrape: MetricsScrapeConfigZod }).describe("Metrics configuration options");
|
|
602
|
+
var OpenTelemetryConfigZod = z12.object({
|
|
578
603
|
// OpenTelemetry options
|
|
579
|
-
otlpEndpoint:
|
|
604
|
+
otlpEndpoint: z12.url().optional().register(globalRegistry10, {
|
|
580
605
|
description: "OTLP endpoint for exporting telemetry data",
|
|
581
606
|
title: "telemetry.otel.otlpEndpoint",
|
|
582
607
|
type: "string"
|
|
583
608
|
})
|
|
584
609
|
});
|
|
585
|
-
var TelemetryConfigZod =
|
|
610
|
+
var TelemetryConfigZod = z12.object({
|
|
586
611
|
// Metrics configuration
|
|
587
612
|
metrics: MetricsConfigZod.optional().describe("Metrics configuration"),
|
|
588
613
|
// OpenTelemetry configuration
|
|
@@ -591,24 +616,24 @@ var TelemetryConfigZod = z11.object({
|
|
|
591
616
|
|
|
592
617
|
// src/config/Validation.ts
|
|
593
618
|
import { AddressZod as AddressZod2, asAddress } from "@xylabs/sdk-js";
|
|
594
|
-
import { globalRegistry as globalRegistry11, z as
|
|
595
|
-
var ValidationConfigZod =
|
|
596
|
-
allowedRewardRedeemers:
|
|
619
|
+
import { globalRegistry as globalRegistry11, z as z13 } from "zod";
|
|
620
|
+
var ValidationConfigZod = z13.object({
|
|
621
|
+
allowedRewardRedeemers: z13.preprocess((val) => {
|
|
597
622
|
if (typeof val === "string") {
|
|
598
623
|
return val.split(",").map((s) => asAddress(s.trim()));
|
|
599
624
|
}
|
|
600
625
|
return val;
|
|
601
|
-
},
|
|
626
|
+
}, z13.array(AddressZod2).optional().register(globalRegistry11, {
|
|
602
627
|
description: "List of allowed reward redeemer addresses, if undefined anyone can participate",
|
|
603
628
|
title: "allowedRewardRedeemers",
|
|
604
629
|
type: "array"
|
|
605
630
|
})),
|
|
606
|
-
allowedRewardEscrowAccountSigners:
|
|
631
|
+
allowedRewardEscrowAccountSigners: z13.preprocess((val) => {
|
|
607
632
|
if (typeof val === "string") {
|
|
608
633
|
return val.split(",").map((s) => asAddress(s.trim()));
|
|
609
634
|
}
|
|
610
635
|
return val;
|
|
611
|
-
},
|
|
636
|
+
}, z13.array(AddressZod2).optional().register(globalRegistry11, {
|
|
612
637
|
description: "List of allowed reward escrow account signer addresses, if undefined anyone can participate",
|
|
613
638
|
title: "allowedRewardEscrowAccountSigners",
|
|
614
639
|
type: "array"
|
|
@@ -616,9 +641,9 @@ var ValidationConfigZod = z12.object({
|
|
|
616
641
|
});
|
|
617
642
|
|
|
618
643
|
// src/config/Base.ts
|
|
619
|
-
var BaseConfigZod =
|
|
644
|
+
var BaseConfigZod = z14.object({
|
|
620
645
|
chain: ChainConfigZod.default(ChainConfigZod.parse({})).describe("Configuration for the chain"),
|
|
621
|
-
dataLake: DataLakeConfigZod.
|
|
646
|
+
dataLake: DataLakeConfigZod.optional().describe("Configuration for data lakes"),
|
|
622
647
|
evm: EvmConfigZod.default(EvmConfigZod.parse({})).describe("Configuration for EVM-backed services"),
|
|
623
648
|
log: LogConfigZod.default(LogConfigZod.parse({})).describe("Configuration for logging"),
|
|
624
649
|
remote: RemoteConfigZod.default(RemoteConfigZod.parse({})).describe("Configuration for remote services"),
|
|
@@ -629,13 +654,13 @@ var BaseConfigZod = z13.object({
|
|
|
629
654
|
|
|
630
655
|
// src/config/Actor.ts
|
|
631
656
|
var ActorConfigZod = BaseConfigZod.extend({
|
|
632
|
-
name:
|
|
657
|
+
name: z15.string(),
|
|
633
658
|
mnemonic: MnemonicStringZod.optional().register(globalRegistry12, {
|
|
634
659
|
description: "Mnemonic for the Actor wallet",
|
|
635
660
|
title: "mnemonic",
|
|
636
661
|
type: "string"
|
|
637
662
|
}),
|
|
638
|
-
healthCheckPort:
|
|
663
|
+
healthCheckPort: z15.coerce.number().optional().register(globalRegistry12, {
|
|
639
664
|
description: "Port for the Producer health checks",
|
|
640
665
|
title: "producer.healthCheckPort",
|
|
641
666
|
type: "number"
|
|
@@ -646,9 +671,9 @@ var asActorConfig = zodAsFactory(ActorConfigZod, "asActorConfig");
|
|
|
646
671
|
var toActorConfig = zodToFactory(ActorConfigZod, "toActorConfig");
|
|
647
672
|
|
|
648
673
|
// src/config/Config.ts
|
|
649
|
-
import
|
|
650
|
-
var ActorsConfigZod =
|
|
651
|
-
var ConfigZod = BaseConfigZod.extend(
|
|
674
|
+
import z16 from "zod";
|
|
675
|
+
var ActorsConfigZod = z16.array(ActorConfigZod.loose()).describe("Actor-specific configurations that override the base configuration when the actor is running").default([]);
|
|
676
|
+
var ConfigZod = BaseConfigZod.extend(z16.object({ actors: ActorsConfigZod }).describe("Actor-specific configurations that override the base configuration when the actor is running").shape);
|
|
652
677
|
|
|
653
678
|
// src/block/hydrate/allHashesPresent.ts
|
|
654
679
|
function allHashesPresent(hashes, payloads) {
|