@xyo-network/xl1-cli 1.16.6 → 1.16.7

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.
Files changed (2) hide show
  1. package/dist/cli-min.mjs +201 -301
  2. package/package.json +11 -11
package/dist/cli-min.mjs CHANGED
@@ -17230,12 +17230,6 @@ var ObjectHasher = class _ObjectHasher extends ObjectWrapper {
17230
17230
  static allowSubtle = true;
17231
17231
  static createBrowserWorker;
17232
17232
  static createNodeWorker;
17233
- static initialized = (() => {
17234
- globalThis.xyo = globalThis.xyo ?? {};
17235
- if (globalThis.xyo.hashing) {
17236
- console.warn("Two static instances of PayloadHasher detected");
17237
- }
17238
- })();
17239
17233
  static subtleHashWorkerUrl;
17240
17234
  static warnIfUsingJsHash = true;
17241
17235
  static wasmHashWorkerUrl;
@@ -17471,13 +17465,13 @@ function isPayloadOfZodType(zodSchema, schema) {
17471
17465
  }
17472
17466
  var PayloadBundleSchema = "network.xyo.payload.bundle";
17473
17467
  var SchemaRegEx = /^(?:[a-z0-9]+\.)*[a-z0-9]+$/;
17474
- var SchemaZodV1 = string$2().regex(SchemaRegEx);
17475
- var SchemaZodV2 = string$2().regex(SchemaRegEx).transform((x) => x);
17476
- var SchemaZod$1 = union$1([SchemaZodV1, SchemaZodV2]);
17468
+ var SchemaZodV1 = z.string().regex(SchemaRegEx);
17469
+ var SchemaZodV2 = z.string().regex(SchemaRegEx).transform((x) => x);
17470
+ var SchemaZod = z.union([SchemaZodV1, SchemaZodV2]);
17477
17471
  var PayloadSchema = "network.xyo.payload";
17478
- literal$2(PayloadSchema);
17472
+ z.literal(PayloadSchema);
17479
17473
  var isSchema = (value) => {
17480
- return SchemaZod$1.safeParse(value).error === void 0;
17474
+ return SchemaZod.safeParse(value).error === void 0;
17481
17475
  };
17482
17476
  var isDataHashMeta = (value) => {
17483
17477
  return isHash(value?._dataHash);
@@ -17633,36 +17627,42 @@ var local = (a, b) => {
17633
17627
  };
17634
17628
  var SequenceComparer = { local};
17635
17629
  var LocalSequenceRegex$1 = new RegExp(HexRegExMinMax(SequenceConstants.localSequenceBytes, SequenceConstants.localSequenceBytes));
17636
- var LocalSequenceToStringZod$1 = string$2().regex(LocalSequenceRegex$1);
17637
- var LocalSequenceFromStringZod$1 = string$2().regex(LocalSequenceRegex$1).transform((v) => toHex(v));
17630
+ var LocalSequenceToStringZod$1 = z.string().regex(LocalSequenceRegex$1);
17631
+ var LocalSequenceFromStringZod$1 = z.string().regex(LocalSequenceRegex$1).transform((v) => toHex(v));
17638
17632
  var QualifiedSequenceRegex$1 = new RegExp(HexRegExMinMax(SequenceConstants.qualifiedSequenceBytes, SequenceConstants.qualifiedSequenceBytes));
17639
- var QualifiedSequenceToStringZod$1 = string$2().regex(QualifiedSequenceRegex$1);
17640
- var QualifiedSequenceFromStringZod$1 = string$2().regex(QualifiedSequenceRegex$1).transform((v) => toHex(v));
17641
- union$1([LocalSequenceToStringZod$1, QualifiedSequenceToStringZod$1]);
17642
- var SequenceFromStringZod = union$1([LocalSequenceFromStringZod$1, QualifiedSequenceFromStringZod$1]);
17633
+ var QualifiedSequenceToStringZod$1 = z.string().regex(QualifiedSequenceRegex$1);
17634
+ var QualifiedSequenceFromStringZod$1 = z.string().regex(QualifiedSequenceRegex$1).transform((v) => toHex(v));
17635
+ z.union([LocalSequenceToStringZod$1, QualifiedSequenceToStringZod$1]);
17636
+ var SequenceFromStringZod = z.union([LocalSequenceFromStringZod$1, QualifiedSequenceFromStringZod$1]);
17643
17637
  var isStorageMeta = (value) => {
17644
17638
  return isSequenceStorageMeta(value) && isHashMeta(value);
17645
17639
  };
17646
17640
 
17647
17641
  // src/PayloadZod.ts
17648
- object$3({
17642
+ var HashMetaZod = z.object({
17649
17643
  _hash: HashZod,
17650
17644
  _dataHash: HashZod
17651
17645
  });
17652
- object$3({ _sequence: SequenceFromStringZod });
17653
- var StorageMetaZod = object$3({
17646
+ z.object({ _sequence: SequenceFromStringZod });
17647
+ var StorageMetaZod = z.object({
17654
17648
  _hash: HashZod,
17655
17649
  _dataHash: HashZod,
17656
17650
  _sequence: SequenceFromStringZod
17657
17651
  });
17658
- var PayloadZod$1 = object$3({ schema: SchemaZod$1 });
17659
- PayloadZod$1.extend(StorageMetaZod.shape);
17660
- var AnyPayloadZod$1 = PayloadZod$1.catchall(json$3());
17661
- AnyPayloadZod$1.extend(StorageMetaZod.shape);
17662
- var PayloadZodStrict = strictObject({ schema: SchemaZod$1 });
17663
- var PayloadZodLoose = looseObject({ schema: SchemaZod$1 });
17664
- var PayloadZodStrictOfSchema = (schema) => PayloadZodStrict.extend({ schema: literal$2(schema) });
17665
- var PayloadZodLooseOfSchema = (schema) => PayloadZodLoose.extend({ schema: literal$2(schema) });
17652
+ var PayloadZod = z.object({ schema: SchemaZod });
17653
+ PayloadZod.extend(StorageMetaZod.shape);
17654
+ var AnyPayloadZod = PayloadZod.catchall(z.json());
17655
+ AnyPayloadZod.extend(StorageMetaZod.shape);
17656
+ function WithStorageMetaZod(valueZod) {
17657
+ return valueZod.extend(StorageMetaZod.shape);
17658
+ }
17659
+ function WithHashMetaZod(valueZod) {
17660
+ return valueZod.extend(HashMetaZod.shape);
17661
+ }
17662
+ var PayloadZodStrict = z.strictObject({ schema: SchemaZod });
17663
+ var PayloadZodLoose = z.looseObject({ schema: SchemaZod });
17664
+ var PayloadZodStrictOfSchema = (schema) => PayloadZodStrict.extend({ schema: z.literal(schema) });
17665
+ var PayloadZodLooseOfSchema = (schema) => PayloadZodLoose.extend({ schema: z.literal(schema) });
17666
17666
 
17667
17667
  // src/Builder.ts
17668
17668
  var omitSchema = (payload) => {
@@ -42542,6 +42542,50 @@ var asTimePayload = AsObjectFactory.create(isTimePayload);
42542
42542
  var TransferSchema = "network.xyo.transfer";
42543
42543
  var isTransfer = isPayloadOfSchemaType(TransferSchema);
42544
42544
  var asTransfer = AsObjectFactory.create(isTransfer);
42545
+ function zodAsFactory(zod) {
42546
+ function asFunc(value, assert) {
42547
+ const result = zod.safeParse(value);
42548
+ if (result.success) {
42549
+ return result.data;
42550
+ }
42551
+ return assertError(value, assert, result.error.message);
42552
+ }
42553
+ return asFunc;
42554
+ }
42555
+
42556
+ // src/model/zod/zodIsFactory.ts
42557
+ function zodIsFactory(zod) {
42558
+ return (value) => zod.safeParse(value).success;
42559
+ }
42560
+ var NumberishZod = z.union([z.number(), z.string(), z.bigint()]).transform((v) => typeof v === "bigint" ? Number(v) : typeof v === "string" ? Number(v) : v).pipe(z.number());
42561
+
42562
+ // src/model/BlockNumber/BlockNumber.ts
42563
+ var BlockNumberZod = z.number().transform((v) => v);
42564
+ var NumberishBlockNumberZod = NumberishZod.transform((v) => v);
42565
+ var asBlockNumber = zodAsFactory(BlockNumberZod);
42566
+ asBlockNumber(0);
42567
+ var EthBlockNumberZod = z.number().transform((v) => v);
42568
+ var NumberishEthBlockNumberZod = NumberishBlockNumberZod.transform((v) => v);
42569
+ var asEthBlockNumber = zodAsFactory(EthBlockNumberZod);
42570
+ asEthBlockNumber(0);
42571
+ var XL1BlockNumberZod = z.number().transform((v) => v);
42572
+ var NumberishXL1BlockNumberZod = NumberishBlockNumberZod.transform((v) => v);
42573
+ var asXL1BlockNumber = zodAsFactory(XL1BlockNumberZod);
42574
+ asXL1BlockNumber(0);
42575
+ var BlockRangeZod = z.tuple([BlockNumberZod, BlockNumberZod]);
42576
+ z.tuple([NumberishBlockNumberZod, NumberishBlockNumberZod]);
42577
+ z.tuple([EthBlockNumberZod, EthBlockNumberZod]);
42578
+ z.tuple([NumberishEthBlockNumberZod, NumberishEthBlockNumberZod]);
42579
+ var RangeZod = z.tuple([z.number(), z.number()]);
42580
+ var isRange = zodIsFactory(RangeZod);
42581
+ var asRange = zodAsFactory(RangeZod);
42582
+ var XL1BlockRangeZod = z.tuple([XL1BlockNumberZod, XL1BlockNumberZod]);
42583
+ z.tuple([NumberishXL1BlockNumberZod, NumberishXL1BlockNumberZod]);
42584
+ var asXL1BlockRange = zodAsFactory(XL1BlockRangeZod);
42585
+ var StepIdentityZod$1 = object$3({
42586
+ block: number$3().int().nonnegative(),
42587
+ step: number$3().int().nonnegative()
42588
+ });
42545
42589
  var isHydratedBoundWitness = (value) => {
42546
42590
  return Array.isArray(value) && value.length === 2 && isBoundWitness(value[0]) && Array.isArray(value[1]) && !value[1].some((item) => !isAnyPayload(item));
42547
42591
  };
@@ -42640,48 +42684,6 @@ var defaultTransactionFees = {
42640
42684
  gasLimit: AttoXL1(1000000n * AttoXL1ConvertFactor.nano),
42641
42685
  priority: minTransactionFees.priority
42642
42686
  };
42643
- function zodAsFactory(zod) {
42644
- function asFunc(value, assert) {
42645
- const result = zod.safeParse(value);
42646
- if (result.success) {
42647
- return result.data;
42648
- }
42649
- return assertError(value, assert, result.error.message);
42650
- }
42651
- return asFunc;
42652
- }
42653
-
42654
- // src/model/zod/zodIsFactory.ts
42655
- function zodIsFactory(zod) {
42656
- return (value) => zod.safeParse(value).success;
42657
- }
42658
- var NumberishZod = z.union([z.number(), z.string(), z.bigint()]).transform((v) => typeof v === "bigint" ? Number(v) : typeof v === "string" ? Number(v) : v).pipe(z.number());
42659
-
42660
- // src/model/BlockNumber/BlockNumber.ts
42661
- var BlockNumberZod = z.number().transform((v) => v);
42662
- var NumberishBlockNumberZod = NumberishZod.transform((v) => v);
42663
- var asBlockNumber = zodAsFactory(BlockNumberZod);
42664
- asBlockNumber(0);
42665
- var EthBlockNumberZod = z.number().transform((v) => v);
42666
- var NumberishEthBlockNumberZod = NumberishBlockNumberZod.transform((v) => v);
42667
- var asEthBlockNumber = zodAsFactory(EthBlockNumberZod);
42668
- asEthBlockNumber(0);
42669
- var XL1BlockNumberZod = z.number().transform((v) => v);
42670
- var NumberishXL1BlockNumberZod = NumberishBlockNumberZod.transform((v) => v);
42671
- var asXL1BlockNumber = zodAsFactory(XL1BlockNumberZod);
42672
- asXL1BlockNumber(0);
42673
- var BlockRangeZod = z.tuple([BlockNumberZod, BlockNumberZod]);
42674
- z.tuple([NumberishBlockNumberZod, NumberishBlockNumberZod]);
42675
- z.tuple([EthBlockNumberZod, EthBlockNumberZod]);
42676
- z.tuple([NumberishEthBlockNumberZod, NumberishEthBlockNumberZod]);
42677
- var RangeZod = z.tuple([z.number(), z.number()]);
42678
- var isRange = zodIsFactory(RangeZod);
42679
- var asRange = zodAsFactory(RangeZod);
42680
- var XL1BlockRangeZod = z.tuple([XL1BlockNumberZod, XL1BlockNumberZod]);
42681
- z.tuple([NumberishXL1BlockNumberZod, NumberishXL1BlockNumberZod]);
42682
- var asXL1BlockRange = zodAsFactory(XL1BlockRangeZod);
42683
-
42684
- // src/constants/StepSizes.ts
42685
42687
  var StepSizes = [
42686
42688
  asXL1BlockNumber(7, true),
42687
42689
  asXL1BlockNumber(31, true),
@@ -81753,8 +81755,9 @@ var SimpleXyoGatewayRunner = class {
81753
81755
  signedTx
81754
81756
  ];
81755
81757
  }
81758
+ /** @deprecated use connectionInstance instead */
81756
81759
  connection() {
81757
- throw new Error("Method not implemented.");
81760
+ return this.gateway.connection();
81758
81761
  }
81759
81762
  removeDataLake(index) {
81760
81763
  this._dataLakes[index] = null;
@@ -198703,6 +198706,13 @@ var getDefaultLogger = () => {
198703
198706
  return getLogger();
198704
198707
  };
198705
198708
 
198709
+ // src/Handler/RouteDefinition/addRouteDefinitions.ts
198710
+ var addRouteDefinitions = (app, routeDefinitions) => {
198711
+ for (const definition of routeDefinitions) {
198712
+ app[definition.method](definition.path, definition.handlers);
198713
+ }
198714
+ };
198715
+
198706
198716
  // src/middleware/caseInsensitiveRouting/caseInsensitiveRouting.ts
198707
198717
  var setting = "case sensitive routing";
198708
198718
  var disableCaseSensitiveRouting = (app) => {
@@ -198793,12 +198803,69 @@ var transformResponse = (body, _req, res) => {
198793
198803
  return isRawResponseFormatSet(res) ? body : res.statusCode >= 200 && res.statusCode < 300 ? { data: body, meta: getResponseMetadata(res) } : { error: body, meta: getResponseMetadata(res) };
198794
198804
  };
198795
198805
  var standardResponses = mung.json(transformResponse, { mungError: true });
198796
- object$3({}).catchall(string$2());
198797
- object$3({}).catchall(union$1([string$2(), array$1(string$2())]));
198798
- ({
198806
+ var EmptyParamsZod = object$3({}).catchall(string$2());
198807
+ var EmptyQueryParamsZod = object$3({}).catchall(union$1([string$2(), array$1(string$2())]));
198808
+ var ValidateRequestDefaults = {
198809
+ params: EmptyParamsZod,
198810
+ query: EmptyQueryParamsZod,
198799
198811
  body: json$3().optional(),
198800
198812
  response: json$3().optional()
198801
- });
198813
+ };
198814
+ function requestHandlerValidator(schemas) {
198815
+ const validators = { ...ValidateRequestDefaults, ...schemas };
198816
+ return (handler) => {
198817
+ return async (req, res, next) => {
198818
+ const originalJson = res.json.bind(res);
198819
+ try {
198820
+ const errors = [];
198821
+ const keys = ["params", "query", "body"];
198822
+ for (const key of keys) {
198823
+ const validator = validators[key];
198824
+ const result2 = validator.safeParse(req[key]);
198825
+ if (result2.success) {
198826
+ if (isDefined(result2.data)) Object.assign(req[key], result2.data);
198827
+ } else {
198828
+ errors.push(
198829
+ ...result2.error.issues.map(
198830
+ (issue) => issue.path.length === 0 ? `${key}: ${issue.message}` : `${key}.${issue.path.join(".")}: ${issue.message}`
198831
+ )
198832
+ );
198833
+ }
198834
+ }
198835
+ if (errors.length > 0) {
198836
+ const message = errors.join("; ");
198837
+ const err = new Error(message);
198838
+ err.name = ReasonPhrases.BAD_REQUEST;
198839
+ err.statusCode = StatusCodes.BAD_REQUEST;
198840
+ next(err);
198841
+ return false;
198842
+ }
198843
+ res.json = (data) => {
198844
+ const result2 = validators.response.safeParse(data);
198845
+ if (result2.success) {
198846
+ return originalJson(result2.data);
198847
+ } else {
198848
+ const message = result2.error.issues.map(
198849
+ (issue) => issue.path.length === 0 ? `response: ${issue.message}` : `response.${issue.path.join(".")}: ${issue.message}`
198850
+ ).join("; ");
198851
+ const err = new Error(message);
198852
+ err.name = ReasonPhrases.INTERNAL_SERVER_ERROR;
198853
+ err.statusCode = StatusCodes.INTERNAL_SERVER_ERROR;
198854
+ res.json = originalJson;
198855
+ throw err;
198856
+ }
198857
+ };
198858
+ const result = handler(req, res, next);
198859
+ if (result && isPromise$3(result)) {
198860
+ await result;
198861
+ }
198862
+ } catch (err) {
198863
+ res.json = originalJson;
198864
+ next(err);
198865
+ }
198866
+ };
198867
+ };
198868
+ }
198802
198869
 
198803
198870
  var compression$2 = {exports: {}};
198804
198871
 
@@ -215269,19 +215336,6 @@ var JsonToArrayBufferZod = string$2().transform((x) => {
215269
215336
  const u8 = base64Decode(x);
215270
215337
  return u8.buffer;
215271
215338
  });
215272
- var SchemaZod = string$2();
215273
- var PayloadZod = object$3({
215274
- schema: SchemaZod
215275
- }).catchall(any$1());
215276
- var PayloadWithStorageMetaZod = PayloadZod.extend(StorageMetaZod.shape);
215277
- var AnyPayloadZod = PayloadZod.catchall(json$3());
215278
- AnyPayloadZod.extend(StorageMetaZod.shape);
215279
- function WithStorageMetaZod(valueZod) {
215280
- return StorageMetaZod.extend(valueZod.shape);
215281
- }
215282
- __name$5(WithStorageMetaZod, "WithStorageMetaZod");
215283
-
215284
- // src/types/schema/common/BoundWitness.ts
215285
215339
  var BoundWitnessRequiredFieldsZod = object$3({
215286
215340
  addresses: array$1(AddressZod),
215287
215341
  payload_hashes: array$1(HashZod),
@@ -215310,7 +215364,6 @@ var UnsignedBoundWitnessWithStorageMetaZod = UnsignedBoundWitnessZod.safeExtend(
215310
215364
  var SignedBoundWitnessZod = BoundWitnessZod.refine((data) => !data.$signatures.includes(null), {
215311
215365
  message: "all $signatures must not be null"
215312
215366
  });
215313
- var SignedBoundWitnessWithStorageMetaZod = UnsignedBoundWitnessWithStorageMetaZod;
215314
215367
  UnsignedBoundWitnessZod.catchall(any$1());
215315
215368
  UnsignedBoundWitnessWithStorageMetaZod.catchall(any$1());
215316
215369
  var ChainZod = string$2().toLowerCase().regex(AddressRegEx).transform((v) => toAddress(v));
@@ -215327,16 +215380,14 @@ var BlockBoundWitnessMetaZod = object$3({
215327
215380
  $epoch: number$3()
215328
215381
  });
215329
215382
  var BlockBoundWitnessZod = UnsignedBoundWitnessZod.merge(StorageMetaZod.partial()).merge(BlockBoundWitnessFieldsZod).merge(BlockBoundWitnessMetaZod);
215330
- var BlockBoundWitnessWithStorageMetaZod = UnsignedBoundWitnessWithStorageMetaZod.merge(BlockBoundWitnessFieldsZod).merge(BlockBoundWitnessMetaZod);
215331
215383
  var SignedBlockBoundWitnessZod = SignedBoundWitnessZod.merge(StorageMetaZod.partial()).merge(BlockBoundWitnessFieldsZod).merge(BlockBoundWitnessMetaZod);
215332
- var SignedBlockBoundWitnessWithStorageMetaZod = SignedBoundWitnessWithStorageMetaZod.merge(StorageMetaZod.partial()).merge(BlockBoundWitnessFieldsZod).merge(BlockBoundWitnessMetaZod);
215333
215384
  tuple([
215334
215385
  BlockBoundWitnessZod,
215335
215386
  array$1(PayloadZod)
215336
215387
  ]);
215337
215388
  tuple([
215338
- BlockBoundWitnessWithStorageMetaZod,
215339
- array$1(PayloadWithStorageMetaZod)
215389
+ WithStorageMetaZod(BlockBoundWitnessZod),
215390
+ array$1(WithStorageMetaZod(PayloadZod))
215340
215391
  ]);
215341
215392
  var SignedHydratedBlockZod = tuple([
215342
215393
  SignedBlockBoundWitnessZod,
@@ -215347,8 +215398,8 @@ tuple([
215347
215398
  array$1(PayloadZod)
215348
215399
  ]);
215349
215400
  tuple([
215350
- SignedBlockBoundWitnessWithStorageMetaZod,
215351
- array$1(PayloadWithStorageMetaZod)
215401
+ WithStorageMetaZod(SignedBlockBoundWitnessZod),
215402
+ array$1(WithStorageMetaZod(PayloadZod))
215352
215403
  ]);
215353
215404
  var AttoZod = bigint$1();
215354
215405
  var JsonToAttoZod = JsonToBigIntZod.transform((v) => asAttoXL1(v));
@@ -215525,7 +215576,6 @@ var TransferFieldsZod = z.object({
215525
215576
  transfers: z.record(AddressZod, HexZod)
215526
215577
  });
215527
215578
  var TransferZod = PayloadZodStrictOfSchema(TransferSchema).extend(TransferFieldsZod.shape);
215528
- var TransferZodWithStorageMeta = TransferZod.extend(StorageMetaZod.shape);
215529
215579
  var TransferPairZod = z.tuple([
215530
215580
  AddressZod,
215531
215581
  AddressZod
@@ -215634,11 +215684,11 @@ var XyoViewerRpcSchemas = {
215634
215684
  xyoViewer_networkStakeStepRewardAddressReward: {
215635
215685
  params: {
215636
215686
  to: tuple([
215637
- StepIdentityZod,
215687
+ StepIdentityZod$1,
215638
215688
  AddressZod
215639
215689
  ]),
215640
215690
  from: tuple([
215641
- StepIdentityZod,
215691
+ StepIdentityZod$1,
215642
215692
  AddressZod
215643
215693
  ])
215644
215694
  },
@@ -215664,11 +215714,11 @@ var XyoViewerRpcSchemas = {
215664
215714
  xyoViewer_networkStakeStepRewardAddressShare: {
215665
215715
  params: {
215666
215716
  to: tuple([
215667
- StepIdentityZod,
215717
+ StepIdentityZod$1,
215668
215718
  AddressZod
215669
215719
  ]),
215670
215720
  from: tuple([
215671
- StepIdentityZod,
215721
+ StepIdentityZod$1,
215672
215722
  AddressZod
215673
215723
  ])
215674
215724
  },
@@ -215686,11 +215736,11 @@ var XyoViewerRpcSchemas = {
215686
215736
  xyoViewer_networkStakeStepRewardWeightForAddress: {
215687
215737
  params: {
215688
215738
  to: tuple([
215689
- StepIdentityZod,
215739
+ StepIdentityZod$1,
215690
215740
  AddressZod
215691
215741
  ]),
215692
215742
  from: tuple([
215693
- StepIdentityZod,
215743
+ StepIdentityZod$1,
215694
215744
  AddressZod
215695
215745
  ])
215696
215746
  },
@@ -215716,10 +215766,10 @@ var XyoViewerRpcSchemas = {
215716
215766
  xyoViewer_networkStakeStepRewardPoolRewards: {
215717
215767
  params: {
215718
215768
  to: tuple([
215719
- StepIdentityZod
215769
+ StepIdentityZod$1
215720
215770
  ]),
215721
215771
  from: tuple([
215722
- StepIdentityZod
215772
+ StepIdentityZod$1
215723
215773
  ])
215724
215774
  },
215725
215775
  result: {
@@ -215730,11 +215780,11 @@ var XyoViewerRpcSchemas = {
215730
215780
  xyoViewer_networkStakeStepRewardPositionWeight: {
215731
215781
  params: {
215732
215782
  to: tuple([
215733
- StepIdentityZod,
215783
+ StepIdentityZod$1,
215734
215784
  number$3()
215735
215785
  ]),
215736
215786
  from: tuple([
215737
- StepIdentityZod,
215787
+ StepIdentityZod$1,
215738
215788
  number$3()
215739
215789
  ])
215740
215790
  },
@@ -215746,11 +215796,11 @@ var XyoViewerRpcSchemas = {
215746
215796
  xyoViewer_networkStakeStepRewardPotentialPositionLoss: {
215747
215797
  params: {
215748
215798
  to: tuple([
215749
- StepIdentityZod,
215799
+ StepIdentityZod$1,
215750
215800
  number$3()
215751
215801
  ]),
215752
215802
  from: tuple([
215753
- StepIdentityZod,
215803
+ StepIdentityZod$1,
215754
215804
  number$3()
215755
215805
  ])
215756
215806
  },
@@ -215762,10 +215812,10 @@ var XyoViewerRpcSchemas = {
215762
215812
  xyoViewer_networkStakeStepRewardForStep: {
215763
215813
  params: {
215764
215814
  to: tuple([
215765
- StepIdentityZod
215815
+ StepIdentityZod$1
215766
215816
  ]),
215767
215817
  from: tuple([
215768
- StepIdentityZod
215818
+ StepIdentityZod$1
215769
215819
  ])
215770
215820
  },
215771
215821
  result: {
@@ -215776,10 +215826,10 @@ var XyoViewerRpcSchemas = {
215776
215826
  xyoViewer_networkStakeStepRewardRandomizer: {
215777
215827
  params: {
215778
215828
  to: tuple([
215779
- StepIdentityZod
215829
+ StepIdentityZod$1
215780
215830
  ]),
215781
215831
  from: tuple([
215782
- StepIdentityZod
215832
+ StepIdentityZod$1
215783
215833
  ])
215784
215834
  },
215785
215835
  result: {
@@ -215790,10 +215840,10 @@ var XyoViewerRpcSchemas = {
215790
215840
  xyoViewer_networkStakeStepRewardStakerCount: {
215791
215841
  params: {
215792
215842
  to: tuple([
215793
- StepIdentityZod
215843
+ StepIdentityZod$1
215794
215844
  ]),
215795
215845
  from: tuple([
215796
- StepIdentityZod
215846
+ StepIdentityZod$1
215797
215847
  ])
215798
215848
  },
215799
215849
  result: {
@@ -215804,10 +215854,10 @@ var XyoViewerRpcSchemas = {
215804
215854
  xyoViewer_networkStakeStepRewardPoolShares: {
215805
215855
  params: {
215806
215856
  to: tuple([
215807
- StepIdentityZod
215857
+ StepIdentityZod$1
215808
215858
  ]),
215809
215859
  from: tuple([
215810
- StepIdentityZod
215860
+ StepIdentityZod$1
215811
215861
  ])
215812
215862
  },
215813
215863
  result: {
@@ -215818,11 +215868,11 @@ var XyoViewerRpcSchemas = {
215818
215868
  xyoViewer_networkStakeStepRewardForStepForPosition: {
215819
215869
  params: {
215820
215870
  to: tuple([
215821
- StepIdentityZod,
215871
+ StepIdentityZod$1,
215822
215872
  number$3()
215823
215873
  ]),
215824
215874
  from: tuple([
215825
- StepIdentityZod,
215875
+ StepIdentityZod$1,
215826
215876
  number$3()
215827
215877
  ])
215828
215878
  },
@@ -215968,14 +216018,14 @@ var XyoViewerRpcSchemas = {
215968
216018
  },
215969
216019
  result: {
215970
216020
  to: array$1(tuple([
215971
- BlockBoundWitnessZod,
215972
- TransactionBoundWitnessZod.nullable(),
215973
- TransferZodWithStorageMeta
216021
+ WithHashMetaZod(BlockBoundWitnessZod),
216022
+ WithHashMetaZod(TransactionBoundWitnessZod).nullable(),
216023
+ WithHashMetaZod(TransferZod)
215974
216024
  ])),
215975
216025
  from: array$1(tuple([
215976
- BlockBoundWitnessZod,
215977
- TransactionBoundWitnessZod.nullable(),
215978
- TransferZodWithStorageMeta
216026
+ WithHashMetaZod(BlockBoundWitnessZod),
216027
+ WithHashMetaZod(TransactionBoundWitnessZod).nullable(),
216028
+ WithHashMetaZod(TransferZod)
215979
216029
  ]))
215980
216030
  }
215981
216031
  },
@@ -216004,20 +216054,14 @@ var XyoViewerRpcSchemas = {
216004
216054
  },
216005
216055
  result: {
216006
216056
  to: array$1(tuple([
216007
- BlockBoundWitnessWithStorageMetaZod,
216008
- union$1([
216009
- TransactionBoundWitnessZod,
216010
- _null$1()
216011
- ]),
216012
- PayloadZod
216057
+ WithHashMetaZod(BlockBoundWitnessZod),
216058
+ WithHashMetaZod(TransactionBoundWitnessZod).nullable(),
216059
+ WithHashMetaZod(PayloadZod)
216013
216060
  ])),
216014
216061
  from: array$1(tuple([
216015
- BlockBoundWitnessWithStorageMetaZod,
216016
- union$1([
216017
- TransactionBoundWitnessZod,
216018
- _null$1()
216019
- ]),
216020
- PayloadZod
216062
+ WithHashMetaZod(BlockBoundWitnessZod),
216063
+ WithHashMetaZod(TransactionBoundWitnessZod).nullable(),
216064
+ WithHashMetaZod(PayloadZod)
216021
216065
  ]))
216022
216066
  }
216023
216067
  },
@@ -216048,20 +216092,14 @@ var XyoViewerRpcSchemas = {
216048
216092
  },
216049
216093
  result: {
216050
216094
  to: array$1(tuple([
216051
- BlockBoundWitnessWithStorageMetaZod,
216052
- union$1([
216053
- TransactionBoundWitnessZod,
216054
- _null$1()
216055
- ]),
216056
- PayloadZod
216095
+ WithHashMetaZod(BlockBoundWitnessZod),
216096
+ WithHashMetaZod(TransactionBoundWitnessZod).nullable(),
216097
+ WithHashMetaZod(PayloadZod)
216057
216098
  ])),
216058
216099
  from: array$1(tuple([
216059
- BlockBoundWitnessWithStorageMetaZod,
216060
- union$1([
216061
- TransactionBoundWitnessZod,
216062
- _null$1()
216063
- ]),
216064
- PayloadZod
216100
+ WithHashMetaZod(BlockBoundWitnessZod),
216101
+ WithHashMetaZod(TransactionBoundWitnessZod).nullable(),
216102
+ WithHashMetaZod(PayloadZod)
216065
216103
  ]))
216066
216104
  }
216067
216105
  },
@@ -216330,11 +216368,11 @@ var createResponseSchema = /* @__PURE__ */ __name$5((resultSchema = _undefined()
216330
216368
  },
216331
216369
  result: {
216332
216370
  to: union$1([
216333
- PayloadZod$1,
216371
+ PayloadZod,
216334
216372
  ArrayBufferToJsonZod
216335
216373
  ]).optional(),
216336
216374
  from: union$1([
216337
- PayloadZod$1,
216375
+ PayloadZod,
216338
216376
  JsonToArrayBufferZod
216339
216377
  ]).optional()
216340
216378
  }
@@ -216350,11 +216388,11 @@ var createResponseSchema = /* @__PURE__ */ __name$5((resultSchema = _undefined()
216350
216388
  },
216351
216389
  result: {
216352
216390
  to: array$1(union$1([
216353
- PayloadZod$1,
216391
+ PayloadZod,
216354
216392
  ArrayBufferToJsonZod
216355
216393
  ])),
216356
216394
  from: array$1(union$1([
216357
- PayloadZod$1,
216395
+ PayloadZod,
216358
216396
  JsonToArrayBufferZod
216359
216397
  ]))
216360
216398
  }
@@ -216711,11 +216749,11 @@ var HttpRpcTransport = class {
216711
216749
  body.params = schemas[method].params.to.parse(params);
216712
216750
  }
216713
216751
  const res = await new AxiosJson().post(url, body);
216714
- const json2 = res.data;
216715
- if (isUndefinedOrNull(json2) || json2.error) {
216716
- throw new Error(json2.error.message);
216752
+ const json = res.data;
216753
+ if (isUndefinedOrNull(json) || json.error) {
216754
+ throw new Error(json.error.message);
216717
216755
  }
216718
- return schemas[method].result.from.parse(json2.result);
216756
+ return schemas[method].result.from.parse(json.result);
216719
216757
  } catch (ex) {
216720
216758
  let message = isError$1(ex) ? ex.message : String(ex);
216721
216759
  if (isAxiosError(ex)) {
@@ -309574,74 +309612,6 @@ var addInstrumentation$2 = /* @__PURE__ */ __name$3(() => {
309574
309612
  instrumentations
309575
309613
  });
309576
309614
  }, "addInstrumentation");
309577
- var EmptyParamsZod$1 = object$3({}).catchall(string$2());
309578
- var EmptyQueryParamsZod$1 = object$3({}).catchall(union$1([
309579
- string$2(),
309580
- array$1(string$2())
309581
- ]));
309582
- var ValidateRequestDefaults$1 = {
309583
- params: EmptyParamsZod$1,
309584
- query: EmptyQueryParamsZod$1,
309585
- body: json$3(),
309586
- response: json$3()
309587
- };
309588
- function requestHandlerValidator$1(schemas) {
309589
- const validators = {
309590
- ...ValidateRequestDefaults$1,
309591
- ...schemas
309592
- };
309593
- return (handler) => {
309594
- return async (req, res, next) => {
309595
- const originalJson = res.json.bind(res);
309596
- try {
309597
- const errors = [];
309598
- const keys = [
309599
- "params",
309600
- "query",
309601
- "body"
309602
- ];
309603
- for (const key of keys) {
309604
- const validator = validators[key];
309605
- const result2 = validator.safeParse(req[key]);
309606
- if (result2.success) {
309607
- Object.assign(req[key], result2.data);
309608
- } else {
309609
- errors.push(...result2.error.issues.map((issue) => issue.path.length === 0 ? `${key}: ${issue.message}` : `${key}.${issue.path.join(".")}: ${issue.message}`));
309610
- }
309611
- }
309612
- if (errors.length > 0) {
309613
- const message = errors.join("; ");
309614
- const err = new Error(message);
309615
- err.name = ReasonPhrases.BAD_REQUEST;
309616
- err.statusCode = StatusCodes.BAD_REQUEST;
309617
- next(err);
309618
- return false;
309619
- }
309620
- res.json = (data) => {
309621
- const result2 = validators.response.safeParse(data);
309622
- if (result2.success) {
309623
- return originalJson(result2.data);
309624
- } else {
309625
- const message = result2.error.issues.map((issue) => issue.path.length === 0 ? `response: ${issue.message}` : `response.${issue.path.join(".")}: ${issue.message}`).join("; ");
309626
- const err = new Error(message);
309627
- err.name = ReasonPhrases.INTERNAL_SERVER_ERROR;
309628
- err.statusCode = StatusCodes.INTERNAL_SERVER_ERROR;
309629
- res.json = originalJson;
309630
- throw err;
309631
- }
309632
- };
309633
- const result = handler(req, res, next);
309634
- if (result && isPromise$3(result)) {
309635
- await result;
309636
- }
309637
- } catch (err) {
309638
- res.json = originalJson;
309639
- next(err);
309640
- }
309641
- };
309642
- };
309643
- }
309644
- __name$3(requestHandlerValidator$1, "requestHandlerValidator");
309645
309615
  var remoteChainId = toAddress("0x01");
309646
309616
  var ChainIdPathParam = HexZod.refine((val) => {
309647
309617
  const chainIdHex = hexFromHexString(val, {
@@ -309661,7 +309631,7 @@ var params = object$3({
309661
309631
  nonce: string$2()
309662
309632
  });
309663
309633
  var response$1 = PayloadZodStrictOfSchema(BridgeDestinationObservationSchema).extend(BridgeDestinationObservationFieldsZod.shape);
309664
- var validateRequest$1 = requestHandlerValidator$1({
309634
+ var validateRequest$1 = requestHandlerValidator({
309665
309635
  params,
309666
309636
  response: response$1
309667
309637
  });
@@ -309699,7 +309669,7 @@ var body$1 = tuple([
309699
309669
  PayloadZodLooseOfSchema(TransferSchema)
309700
309670
  ]);
309701
309671
  var response2$1 = PayloadZodStrictOfSchema(BridgeSourceObservationSchema).extend(BridgeSourceObservationFieldsZod.shape);
309702
- var validateRequest2$1 = requestHandlerValidator$1({
309672
+ var validateRequest2$1 = requestHandlerValidator({
309703
309673
  params: params2,
309704
309674
  body: body$1,
309705
309675
  response: response2$1
@@ -309743,7 +309713,7 @@ var response3 = tuple([
309743
309713
  PayloadZodStrictOfSchema(BridgeIntentSchema).extend(BridgeIntentFieldsZod.shape),
309744
309714
  PayloadZodLooseOfSchema(TransferSchema)
309745
309715
  ]);
309746
- var validateRequest3 = requestHandlerValidator$1({
309716
+ var validateRequest3 = requestHandlerValidator({
309747
309717
  params: params3,
309748
309718
  body: body2,
309749
309719
  response: response3
@@ -309790,7 +309760,7 @@ var params4 = object$3({
309790
309760
  nonce: string$2()
309791
309761
  });
309792
309762
  var response4 = PayloadZodStrictOfSchema(BridgeDestinationObservationSchema).extend(BridgeDestinationObservationFieldsZod.shape);
309793
- var validateRequest4 = requestHandlerValidator$1({
309763
+ var validateRequest4 = requestHandlerValidator({
309794
309764
  params: params4,
309795
309765
  response: response4
309796
309766
  });
@@ -310508,7 +310478,7 @@ var addDataLakeRoutes = /* @__PURE__ */ __name$1((app) => {
310508
310478
  }));
310509
310479
  }, "addDataLakeRoutes");
310510
310480
  var StepIdentitySchema = "network.xyo.chain.step.identity";
310511
- var isStepIdentityPayload = isPayloadOfZodType(StepIdentityZod, StepIdentitySchema);
310481
+ var isStepIdentityPayload = isPayloadOfZodType(StepIdentityZod$1, StepIdentitySchema);
310512
310482
 
310513
310483
  // src/modules/ChainStepRewardsClaimSentinel/ChainStepRewardsClaimSentinel.ts
310514
310484
  var ChainStepRewardsClaimSentinelConfigSchema = "network.xyo.sentinel.chain.step.rewards.claim.config";
@@ -310779,74 +310749,6 @@ var DerivedAddressWalletTransferSentinel = class extends AbstractSentinel {
310779
310749
  if (isDefined(result)) return result[1];
310780
310750
  }, "submitRewardDistributionTransaction");
310781
310751
  };
310782
- var EmptyParamsZod = object$3({}).catchall(string$2());
310783
- var EmptyQueryParamsZod = object$3({}).catchall(union$1([
310784
- string$2(),
310785
- array$1(string$2())
310786
- ]));
310787
- var ValidateRequestDefaults = {
310788
- params: EmptyParamsZod,
310789
- query: EmptyQueryParamsZod,
310790
- body: json$3().optional(),
310791
- response: json$3().optional()
310792
- };
310793
- function requestHandlerValidator(schemas) {
310794
- const validators = {
310795
- ...ValidateRequestDefaults,
310796
- ...schemas
310797
- };
310798
- return (handler) => {
310799
- return async (req, res, next) => {
310800
- const originalJson = res.json.bind(res);
310801
- try {
310802
- const errors = [];
310803
- const keys = [
310804
- "params",
310805
- "query",
310806
- "body"
310807
- ];
310808
- for (const key of keys) {
310809
- const validator = validators[key];
310810
- const result2 = validator.safeParse(req[key]);
310811
- if (result2.success) {
310812
- if (isDefined(result2.data)) Object.assign(req[key], result2.data);
310813
- } else {
310814
- errors.push(...result2.error.issues.map((issue) => issue.path.length === 0 ? `${key}: ${issue.message}` : `${key}.${issue.path.join(".")}: ${issue.message}`));
310815
- }
310816
- }
310817
- if (errors.length > 0) {
310818
- const message = errors.join("; ");
310819
- const err = new Error(message);
310820
- err.name = ReasonPhrases.BAD_REQUEST;
310821
- err.statusCode = StatusCodes.BAD_REQUEST;
310822
- next(err);
310823
- return false;
310824
- }
310825
- res.json = (data) => {
310826
- const result2 = validators.response.safeParse(data);
310827
- if (result2.success) {
310828
- return originalJson(result2.data);
310829
- } else {
310830
- const message = result2.error.issues.map((issue) => issue.path.length === 0 ? `response: ${issue.message}` : `response.${issue.path.join(".")}: ${issue.message}`).join("; ");
310831
- const err = new Error(message);
310832
- err.name = ReasonPhrases.INTERNAL_SERVER_ERROR;
310833
- err.statusCode = StatusCodes.INTERNAL_SERVER_ERROR;
310834
- res.json = originalJson;
310835
- throw err;
310836
- }
310837
- };
310838
- const result = handler(req, res, next);
310839
- if (result && isPromise$3(result)) {
310840
- await result;
310841
- }
310842
- } catch (err) {
310843
- res.json = originalJson;
310844
- next(err);
310845
- }
310846
- };
310847
- };
310848
- }
310849
- __name$1(requestHandlerValidator, "requestHandlerValidator");
310850
310752
  var viewer;
310851
310753
  var getViewerFromConfig = /* @__PURE__ */ __name$1((config) => {
310852
310754
  if (isDefined(viewer)) return viewer;
@@ -310962,9 +310864,7 @@ var getRouteDefinitions = /* @__PURE__ */ __name$1(() => {
310962
310864
  // src/server/routes/rewardRedemption/addRewardRoutes.ts
310963
310865
  var addRewardRedemptionRoutes = /* @__PURE__ */ __name$1((app) => {
310964
310866
  const routeDefinitions = getRouteDefinitions();
310965
- for (const definition of routeDefinitions) {
310966
- app[definition.method](definition.path, definition.handlers);
310967
- }
310867
+ addRouteDefinitions(app, routeDefinitions);
310968
310868
  }, "addRewardRedemptionRoutes");
310969
310869
 
310970
310870
  // src/server/routes/addRoutes.ts
@@ -319730,7 +319630,7 @@ var waitForHostPort = /* @__PURE__ */ __name((host, port) => {
319730
319630
 
319731
319631
  // src/runCLI.ts
319732
319632
  var configuration;
319733
- var version = isDefined("1.16.5") ? "1.16.5" : "unknown";
319633
+ var version = isDefined("1.16.6") ? "1.16.6" : "unknown";
319734
319634
  var getContextFromConfig = /* @__PURE__ */ __name((configuration2) => {
319735
319635
  const logger = initLogger(configuration2);
319736
319636
  const orchestrator = new Orchestrator(logger);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/xl1-cli",
3
- "version": "1.16.6",
3
+ "version": "1.16.7",
4
4
  "description": "XYO Layer One CLI",
5
5
  "homepage": "https://xylabs.com",
6
6
  "bugs": {
@@ -78,16 +78,16 @@
78
78
  "@xylabs/typeof": "~5.0.24",
79
79
  "@xylabs/url": "~5.0.24",
80
80
  "@xylabs/vitest-extended": "~5.0.24",
81
- "@xyo-network/account-model": "~5.1.19",
82
- "@xyo-network/archivist-lmdb": "~5.1.19",
83
- "@xyo-network/archivist-memory": "~5.1.19",
84
- "@xyo-network/archivist-model": "~5.1.19",
85
- "@xyo-network/payload-builder": "~5.1.19",
86
- "@xyo-network/payload-model": "~5.1.19",
87
- "@xyo-network/wallet": "~5.1.19",
88
- "@xyo-network/wallet-model": "~5.1.19",
89
- "@xyo-network/xl1-cli-lib": "~1.16.6",
90
- "@xyo-network/xl1-protocol": "~1.13.5",
81
+ "@xyo-network/account-model": "~5.1.21",
82
+ "@xyo-network/archivist-lmdb": "~5.1.21",
83
+ "@xyo-network/archivist-memory": "~5.1.21",
84
+ "@xyo-network/archivist-model": "~5.1.21",
85
+ "@xyo-network/payload-builder": "~5.1.21",
86
+ "@xyo-network/payload-model": "~5.1.21",
87
+ "@xyo-network/wallet": "~5.1.21",
88
+ "@xyo-network/wallet-model": "~5.1.21",
89
+ "@xyo-network/xl1-cli-lib": "~1.16.7",
90
+ "@xyo-network/xl1-protocol": "~1.13.6",
91
91
  "async-mutex": "~0.5.0",
92
92
  "dotenv": "~17.2.3",
93
93
  "eslint": "^9.39.1",