@xyo-network/xl1-protocol-sdk 1.26.35 → 1.26.37

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.
@@ -449,22 +449,15 @@ import {
449
449
  zodIsFactory as zodIsFactory2,
450
450
  zodToFactory as zodToFactory2
451
451
  } from "@xylabs/sdk-js";
452
- import { globalRegistry as globalRegistry12, z as z17 } from "zod";
453
-
454
- // src/validation/schema/Mnemonic.ts
455
- import { z } from "zod";
456
- var MnemonicStringZod = z.string().transform((s) => s.trim().replaceAll(/\s+/g, " ")).refine(
457
- (s) => [12, 15, 18, 21, 24].includes(s.split(" ").length),
458
- { message: "Mnemonic must contain 12, 15, 18, 21, or 24 words." }
459
- ).describe("BIP-39 mnemonic string");
452
+ import { globalRegistry as globalRegistry12, z as z16 } from "zod";
460
453
 
461
454
  // src/config/Base.ts
462
- import { z as z16 } from "zod";
455
+ import { z as z15 } from "zod";
463
456
 
464
457
  // src/config/Chain.ts
465
458
  import { AddressZod, HexZod } from "@xylabs/sdk-js";
466
- import { globalRegistry, z as z2 } from "zod";
467
- var ChainConfigZod = z2.object({
459
+ import { globalRegistry, z } from "zod";
460
+ var ChainConfigZod = z.object({
468
461
  id: HexZod.optional().register(globalRegistry, {
469
462
  description: "The unique identifier for the chain. Should be the staking contract address for contract-backed chains.",
470
463
  title: "chain.id",
@@ -478,15 +471,15 @@ var ChainConfigZod = z2.object({
478
471
  });
479
472
 
480
473
  // src/config/DataLake/DataLake.ts
481
- import { z as z6 } from "zod";
474
+ import { z as z5 } from "zod";
482
475
 
483
476
  // src/config/DataLake/RestDataLakeConfig.ts
484
- import { globalRegistry as globalRegistry3, z as z4 } from "zod";
477
+ import { globalRegistry as globalRegistry3, z as z3 } from "zod";
485
478
 
486
479
  // src/config/DataLake/DataLakeRemoteConfig.ts
487
- import { globalRegistry as globalRegistry2, z as z3 } from "zod";
488
- var DataLakeDriverConfigBaseZod = z3.object({
489
- driver: z3.string().register(globalRegistry2, {
480
+ import { globalRegistry as globalRegistry2, z as z2 } from "zod";
481
+ var DataLakeDriverConfigBaseZod = z2.object({
482
+ driver: z2.string().register(globalRegistry2, {
490
483
  description: "Driver for the data lake",
491
484
  type: "string"
492
485
  })
@@ -494,55 +487,55 @@ var DataLakeDriverConfigBaseZod = z3.object({
494
487
 
495
488
  // src/config/DataLake/RestDataLakeConfig.ts
496
489
  var RestDataLakeConfigZod = DataLakeDriverConfigBaseZod.extend({
497
- driver: z4.literal("rest").register(globalRegistry3, {
490
+ driver: z3.literal("rest").register(globalRegistry3, {
498
491
  description: "Driver for the REST data lake",
499
492
  type: "string"
500
493
  }),
501
- url: z4.string().register(globalRegistry3, {
494
+ url: z3.string().register(globalRegistry3, {
502
495
  description: "URL for the REST data lake",
503
496
  type: "string"
504
497
  })
505
498
  }).describe("Configuration for the REST data lake driver");
506
499
 
507
500
  // src/config/DataLake/RouterDataLakeConfig.ts
508
- import { globalRegistry as globalRegistry4, z as z5 } from "zod";
509
- var RouterDataLakeConfigZod = z5.object({
510
- driver: z5.literal("router").register(globalRegistry4, {
501
+ import { globalRegistry as globalRegistry4, z as z4 } from "zod";
502
+ var RouterDataLakeConfigZod = z4.object({
503
+ driver: z4.literal("router").register(globalRegistry4, {
511
504
  description: "Driver for the router data lake",
512
505
  type: "string"
513
506
  }),
514
- children: z5.array(z5.lazy(() => DataLakeConfigZod)).register(globalRegistry4, {
507
+ children: z4.array(z4.lazy(() => DataLakeConfigZod)).register(globalRegistry4, {
515
508
  description: "Child data lake drivers",
516
509
  type: "array"
517
510
  })
518
511
  }).describe("Configuration for the router data lake driver");
519
512
 
520
513
  // src/config/DataLake/DataLake.ts
521
- var DataLakeConfigZod = z6.lazy(() => z6.union([RestDataLakeConfigZod, RouterDataLakeConfigZod])).describe("Configuration for a data lake");
514
+ var DataLakeConfigZod = z5.lazy(() => z5.union([RestDataLakeConfigZod, RouterDataLakeConfigZod])).describe("Configuration for a data lake");
522
515
 
523
516
  // src/config/Evm.ts
524
- import { globalRegistry as globalRegistry5, z as z7 } from "zod";
525
- var EvmInfuraConfigZod = z7.object({
526
- projectId: z7.string().optional().register(globalRegistry5, {
517
+ import { globalRegistry as globalRegistry5, z as z6 } from "zod";
518
+ var EvmInfuraConfigZod = z6.object({
519
+ projectId: z6.string().optional().register(globalRegistry5, {
527
520
  description: "Infura project ID",
528
521
  title: "evm.infura.projectId",
529
522
  type: "string"
530
523
  }),
531
- projectSecret: z7.string().optional().register(globalRegistry5, {
524
+ projectSecret: z6.string().optional().register(globalRegistry5, {
532
525
  description: "Infura project secret",
533
526
  title: "evm.infura.projectSecret",
534
527
  type: "string"
535
528
  })
536
529
  });
537
- var EvmJsonRpcConfigZod = z7.object({
538
- url: z7.url().optional().register(globalRegistry5, {
530
+ var EvmJsonRpcConfigZod = z6.object({
531
+ url: z6.url().optional().register(globalRegistry5, {
539
532
  description: "JSON-RPC URL",
540
533
  title: "evm.jsonRpc.url",
541
534
  type: "string"
542
535
  })
543
536
  });
544
- var EvmConfigZod = z7.object({
545
- chainId: z7.string().optional().register(globalRegistry5, {
537
+ var EvmConfigZod = z6.object({
538
+ chainId: z6.string().optional().register(globalRegistry5, {
546
539
  description: "EVM chain ID",
547
540
  title: "evm.chainId",
548
541
  type: "string"
@@ -553,17 +546,17 @@ var EvmConfigZod = z7.object({
553
546
 
554
547
  // src/config/Log.ts
555
548
  import { LogLevel } from "@xylabs/sdk-js";
556
- import { globalRegistry as globalRegistry6, z as z8 } from "zod";
549
+ import { globalRegistry as globalRegistry6, z as z7 } from "zod";
557
550
  var LogLevelNames = Object.keys(LogLevel);
558
- var LogConfigZod = z8.object({
559
- logLevel: z8.enum(LogLevelNames).default("info").register(globalRegistry6, {
551
+ var LogConfigZod = z7.object({
552
+ logLevel: z7.enum(LogLevelNames).default("info").register(globalRegistry6, {
560
553
  choices: LogLevelNames,
561
554
  default: "info",
562
555
  description: "Desired process verbosity",
563
556
  title: "logLevel",
564
557
  type: "string"
565
558
  }),
566
- silent: z8.boolean().default(false).register(globalRegistry6, {
559
+ silent: z7.boolean().default(false).register(globalRegistry6, {
567
560
  default: false,
568
561
  description: "Whether to run in silent mode",
569
562
  title: "silent",
@@ -572,7 +565,7 @@ var LogConfigZod = z8.object({
572
565
  });
573
566
 
574
567
  // src/config/Providers.ts
575
- import z10 from "zod";
568
+ import z9 from "zod";
576
569
 
577
570
  // src/config/Provider.ts
578
571
  import {
@@ -580,79 +573,79 @@ import {
580
573
  zodIsFactory,
581
574
  zodToFactory
582
575
  } from "@xylabs/sdk-js";
583
- import { z as z9 } from "zod";
584
- var ProviderConfigZod = z9.object({
585
- moniker: z9.string(),
586
- labels: z9.array(z9.string()).optional()
576
+ import { z as z8 } from "zod";
577
+ var ProviderConfigZod = z8.object({
578
+ moniker: z8.string(),
579
+ labels: z8.array(z8.string()).optional()
587
580
  }).describe("Configuration for a Provider");
588
581
  var isProviderConfig = zodIsFactory(ProviderConfigZod);
589
582
  var asProviderConfig = zodAsFactory(ProviderConfigZod, "asProviderConfig");
590
583
  var toProviderConfig = zodToFactory(ProviderConfigZod, "toProviderConfig");
591
584
 
592
585
  // src/config/Providers.ts
593
- var ProvidersConfigZod = z10.array(ProviderConfigZod.loose()).describe("Configuration for providers").default([]);
586
+ var ProvidersConfigZod = z9.array(ProviderConfigZod.loose()).describe("Configuration for providers").default([]);
594
587
 
595
588
  // src/config/Remote.ts
596
- import { globalRegistry as globalRegistry7, z as z11 } from "zod";
597
- var RpcRemoteConfigBaseZod = z11.object({
598
- protocol: z11.string("http").register(globalRegistry7, {
589
+ import { globalRegistry as globalRegistry7, z as z10 } from "zod";
590
+ var RpcRemoteConfigBaseZod = z10.object({
591
+ protocol: z10.string("http").register(globalRegistry7, {
599
592
  description: "Protocol for the RPC connection",
600
593
  type: "string"
601
594
  })
602
595
  }).describe("Base configuration for the remote RPC");
603
596
  var HttpRpcRemoteConfigZod = RpcRemoteConfigBaseZod.extend({
604
- protocol: z11.string("http").register(globalRegistry7, {
597
+ protocol: z10.string("http").register(globalRegistry7, {
605
598
  description: "Protocol for the RPC connection",
606
599
  type: "string"
607
600
  }).default("http"),
608
- url: z11.string().register(globalRegistry7, {
601
+ url: z10.string().register(globalRegistry7, {
609
602
  description: "URL for the Chain RPC API",
610
603
  type: "string"
611
604
  })
612
605
  }).describe("Configuration for the remote RPC using Http");
613
606
  var PostMessageRpcRemoteConfigZod = RpcRemoteConfigBaseZod.extend({
614
- protocol: z11.string().register(globalRegistry7, {
607
+ protocol: z10.string().register(globalRegistry7, {
615
608
  description: "Protocol for the RPC connection",
616
609
  type: "string"
617
610
  }).default("postMessage"),
618
- networkId: z11.string().register(globalRegistry7, {
611
+ networkId: z10.string().register(globalRegistry7, {
619
612
  description: "Network ID to use for the postMessage RPC connection",
620
613
  type: "string"
621
614
  }),
622
- sessionId: z11.string().register(globalRegistry7, {
615
+ sessionId: z10.string().register(globalRegistry7, {
623
616
  description: "Session ID to use for the postMessage RPC connection",
624
617
  type: "string"
625
618
  })
626
619
  }).describe("Configuration for the remote RPC using postMessage");
627
- var RpcRemoteConfigZod = z11.union([HttpRpcRemoteConfigZod, PostMessageRpcRemoteConfigZod]).describe("Configuration for a remote RPC connection, either Http or postMessage");
628
- var RemoteConfigZod = z11.object({ rpc: RpcRemoteConfigZod.optional() }).describe("Configuration for remote connections, including RPC");
620
+ var RpcRemoteConfigZod = z10.union([HttpRpcRemoteConfigZod, PostMessageRpcRemoteConfigZod]).describe("Configuration for a remote RPC connection, either Http or postMessage");
621
+ var RemoteConfigZod = z10.object({ rpc: RpcRemoteConfigZod.optional() }).describe("Configuration for remote connections, including RPC");
629
622
 
630
623
  // src/config/storage/driver/Mongo.ts
631
624
  import { isDefined, isUndefined } from "@xylabs/sdk-js";
632
- import { globalRegistry as globalRegistry8, z as z12 } from "zod";
633
- var MongoConfigZod = z12.object({
625
+ import { globalRegistry as globalRegistry8, z as z11 } from "zod";
626
+ var MongoConfigZod = z11.object({
634
627
  // TODO: Create from other arguments
635
- connectionString: z12.string().nonempty().optional().register(globalRegistry8, {
628
+ connectionString: z11.string().nonempty().optional().register(globalRegistry8, {
636
629
  description: "MongoDB connection string",
637
630
  title: "storage.mongo.connectionString",
638
631
  type: "string"
639
632
  }),
640
- database: z12.string().nonempty().optional().register(globalRegistry8, {
633
+ database: z11.string().nonempty().optional().register(globalRegistry8, {
641
634
  description: "MongoDB database name",
642
635
  title: "storage.mongo.database",
643
636
  type: "string"
644
637
  }),
645
- domain: z12.string().nonempty().optional().register(globalRegistry8, {
638
+ domain: z11.string().nonempty().optional().register(globalRegistry8, {
646
639
  description: "MongoDB domain",
647
640
  title: "storage.mongo.domain",
648
641
  type: "string"
649
642
  }),
650
- password: z12.string().nonempty().optional().register(globalRegistry8, {
643
+ password: z11.string().nonempty().optional().register(globalRegistry8, {
651
644
  description: "MongoDB password",
652
645
  title: "storage.mongo.password",
653
646
  type: "string"
654
647
  }),
655
- username: z12.string().nonempty().optional().register(globalRegistry8, {
648
+ username: z11.string().nonempty().optional().register(globalRegistry8, {
656
649
  description: "MongoDB username",
657
650
  title: "storage.mongo.username",
658
651
  type: "string"
@@ -660,10 +653,10 @@ var MongoConfigZod = z12.object({
660
653
  });
661
654
 
662
655
  // src/config/storage/Storage.ts
663
- import { globalRegistry as globalRegistry9, z as z13 } from "zod";
664
- var StorageConfigZod = z13.object({
656
+ import { globalRegistry as globalRegistry9, z as z12 } from "zod";
657
+ var StorageConfigZod = z12.object({
665
658
  mongo: MongoConfigZod.optional().describe("Configuration for the MongoD storage driver"),
666
- root: z13.string().optional().register(globalRegistry9, {
659
+ root: z12.string().optional().register(globalRegistry9, {
667
660
  description: "Root directory for local storage",
668
661
  title: "storage.root",
669
662
  type: "string"
@@ -671,30 +664,30 @@ var StorageConfigZod = z13.object({
671
664
  }).describe("Storage configuration options");
672
665
 
673
666
  // src/config/Telemetry.ts
674
- import { globalRegistry as globalRegistry10, z as z14 } from "zod";
675
- var MetricsScrapeConfigZod = z14.object({
676
- path: z14.string().default("/metrics").register(globalRegistry10, {
667
+ import { globalRegistry as globalRegistry10, z as z13 } from "zod";
668
+ var MetricsScrapeConfigZod = z13.object({
669
+ path: z13.string().default("/metrics").register(globalRegistry10, {
677
670
  default: "/metrics",
678
671
  description: "Path for the metrics scrape endpoint",
679
672
  title: "telemetry.metrics.scrape.path",
680
673
  type: "string"
681
674
  }),
682
- port: z14.coerce.number().int().positive().optional().register(globalRegistry10, {
675
+ port: z13.coerce.number().int().positive().optional().register(globalRegistry10, {
683
676
  description: "Port for the metrics scrape endpoint",
684
677
  title: "telemetry.metrics.scrape.port",
685
678
  type: "number"
686
679
  })
687
680
  }).describe("Metrics scrape configuration");
688
- var MetricsConfigZod = z14.object({ scrape: MetricsScrapeConfigZod }).describe("Metrics configuration options");
689
- var OpenTelemetryConfigZod = z14.object({
681
+ var MetricsConfigZod = z13.object({ scrape: MetricsScrapeConfigZod }).describe("Metrics configuration options");
682
+ var OpenTelemetryConfigZod = z13.object({
690
683
  // OpenTelemetry options
691
- otlpEndpoint: z14.url().optional().register(globalRegistry10, {
684
+ otlpEndpoint: z13.url().optional().register(globalRegistry10, {
692
685
  description: "OTLP endpoint for exporting telemetry data",
693
686
  title: "telemetry.otel.otlpEndpoint",
694
687
  type: "string"
695
688
  })
696
689
  });
697
- var TelemetryConfigZod = z14.object({
690
+ var TelemetryConfigZod = z13.object({
698
691
  // Metrics configuration
699
692
  metrics: MetricsConfigZod.optional().describe("Metrics configuration"),
700
693
  // OpenTelemetry configuration
@@ -703,7 +696,7 @@ var TelemetryConfigZod = z14.object({
703
696
 
704
697
  // src/config/Validation.ts
705
698
  import { AddressZod as AddressZod2, asAddress } from "@xylabs/sdk-js";
706
- import { globalRegistry as globalRegistry11, z as z15 } from "zod";
699
+ import { globalRegistry as globalRegistry11, z as z14 } from "zod";
707
700
 
708
701
  // src/primitives/block/rate/blockRate.ts
709
702
  import { isDefined as isDefined3, isFalsy } from "@xylabs/sdk-js";
@@ -1234,34 +1227,34 @@ var DEFAULT_MIN_CANDIDATES = 2;
1234
1227
  var DEFAULT_BACKOFF_MS = 12e4;
1235
1228
 
1236
1229
  // src/config/Validation.ts
1237
- var ValidationConfigZod = z15.object({
1238
- allowedRewardRedeemers: z15.preprocess((val) => {
1230
+ var ValidationConfigZod = z14.object({
1231
+ allowedRewardRedeemers: z14.preprocess((val) => {
1239
1232
  if (typeof val === "string") {
1240
1233
  return val.split(",").map((s) => asAddress(s.trim()));
1241
1234
  }
1242
1235
  return val;
1243
- }, z15.array(AddressZod2).optional().register(globalRegistry11, {
1236
+ }, z14.array(AddressZod2).optional().register(globalRegistry11, {
1244
1237
  description: "List of allowed reward redeemer addresses, if undefined anyone can participate",
1245
1238
  title: "allowedRewardRedeemers",
1246
1239
  type: "array"
1247
1240
  })),
1248
- allowedRewardEscrowAccountSigners: z15.preprocess((val) => {
1241
+ allowedRewardEscrowAccountSigners: z14.preprocess((val) => {
1249
1242
  if (typeof val === "string") {
1250
1243
  return val.split(",").map((s) => asAddress(s.trim()));
1251
1244
  }
1252
1245
  return val;
1253
- }, z15.array(AddressZod2).optional().register(globalRegistry11, {
1246
+ }, z14.array(AddressZod2).optional().register(globalRegistry11, {
1254
1247
  description: "List of allowed reward escrow account signer addresses, if undefined anyone can participate",
1255
1248
  title: "allowedRewardEscrowAccountSigners",
1256
1249
  type: "array"
1257
1250
  })),
1258
- minCandidates: z15.coerce.number().default(DEFAULT_MIN_CANDIDATES).register(globalRegistry11, {
1251
+ minCandidates: z14.coerce.number().default(DEFAULT_MIN_CANDIDATES).register(globalRegistry11, {
1259
1252
  default: DEFAULT_MIN_CANDIDATES,
1260
1253
  description: "Minimum number of uncle candidates before selecting the best uncle",
1261
1254
  title: "validation.minCandidates",
1262
1255
  type: "number"
1263
1256
  }),
1264
- backoffMs: z15.coerce.number().default(DEFAULT_BACKOFF_MS).register(globalRegistry11, {
1257
+ backoffMs: z14.coerce.number().default(DEFAULT_BACKOFF_MS).register(globalRegistry11, {
1265
1258
  default: DEFAULT_BACKOFF_MS,
1266
1259
  description: "Back-off timeout in ms. If head age exceeds this, minCandidates is ignored",
1267
1260
  title: "validation.backoffMs",
@@ -1270,7 +1263,7 @@ var ValidationConfigZod = z15.object({
1270
1263
  });
1271
1264
 
1272
1265
  // src/config/Base.ts
1273
- var BaseConfigZod = z16.object({
1266
+ var BaseConfigZod = z15.object({
1274
1267
  chain: ChainConfigZod.default(ChainConfigZod.parse({})).describe("Configuration for the chain"),
1275
1268
  dataLake: DataLakeConfigZod.optional().describe("Configuration for data lakes"),
1276
1269
  evm: EvmConfigZod.default(EvmConfigZod.parse({})).describe("Configuration for EVM-backed services"),
@@ -1283,14 +1276,18 @@ var BaseConfigZod = z16.object({
1283
1276
  });
1284
1277
 
1285
1278
  // src/config/Actor.ts
1279
+ var AccountPathZod = z16.string().regex(
1280
+ /^(m(\/\d+'?)+|\d+'?(\/\d+'?)*)$/,
1281
+ `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".`
1282
+ );
1286
1283
  var ActorConfigZod = BaseConfigZod.extend({
1287
- name: z17.string(),
1288
- mnemonic: MnemonicStringZod.optional().register(globalRegistry12, {
1289
- description: "Mnemonic for the Actor wallet",
1290
- title: "mnemonic",
1284
+ name: z16.string(),
1285
+ accountPath: AccountPathZod.optional().register(globalRegistry12, {
1286
+ 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.',
1287
+ title: "accountPath",
1291
1288
  type: "string"
1292
1289
  }),
1293
- healthCheckPort: z17.coerce.number().optional().register(globalRegistry12, {
1290
+ healthCheckPort: z16.coerce.number().optional().register(globalRegistry12, {
1294
1291
  description: "Port for the Producer health checks",
1295
1292
  title: "producer.healthCheckPort",
1296
1293
  type: "number"
@@ -1301,8 +1298,8 @@ var asActorConfig = zodAsFactory2(ActorConfigZod, "asActorConfig");
1301
1298
  var toActorConfig = zodToFactory2(ActorConfigZod, "toActorConfig");
1302
1299
 
1303
1300
  // src/config/Actors.ts
1304
- import z18 from "zod";
1305
- var ActorsConfigZod = z18.array(ActorConfigZod.loose()).describe("Actor-specific configurations that override the base configuration when the actor is running").default([]);
1301
+ import z17 from "zod";
1302
+ var ActorsConfigZod = z17.array(ActorConfigZod.loose()).describe("Actor-specific configurations that override the base configuration when the actor is running").default([]);
1306
1303
 
1307
1304
  // src/config/Config.ts
1308
1305
  var ConfigZod = BaseConfigZod.extend({ actors: ActorsConfigZod }).describe("The complete configuration for the protocol, including global settings and actor-specific overrides");