@xyo-network/xl1-protocol 5.8.0 → 5.8.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.
Files changed (41) hide show
  1. package/dist/neutral/modules/network-model/icons/local/index.d.ts +2 -1
  2. package/dist/neutral/modules/network-model/icons/local/index.d.ts.map +1 -1
  3. package/dist/neutral/modules/network-model/icons/mainnet/index.d.ts +2 -1
  4. package/dist/neutral/modules/network-model/icons/mainnet/index.d.ts.map +1 -1
  5. package/dist/neutral/modules/network-model/icons/sequence/index.d.ts +2 -1
  6. package/dist/neutral/modules/network-model/icons/sequence/index.d.ts.map +1 -1
  7. package/dist/neutral/modules/network-model/lib/PayloadHashVariances.d.ts +51 -0
  8. package/dist/neutral/modules/network-model/lib/PayloadHashVariances.d.ts.map +1 -0
  9. package/dist/neutral/modules/network-model/lib/index.d.ts +1 -0
  10. package/dist/neutral/modules/network-model/lib/index.d.ts.map +1 -1
  11. package/dist/neutral/modules/network-model/staticRest/layout/chainParamsRules.d.ts.map +1 -1
  12. package/dist/neutral/modules/protocol-lib/providers/signer/XyoSigner.d.ts.map +1 -1
  13. package/dist/neutral/modules/protocol-lib/summary/stepPlacement.d.ts.map +1 -1
  14. package/dist/neutral/modules/protocol-lib/transaction/elevatedPayloads.d.ts +3 -1
  15. package/dist/neutral/modules/protocol-lib/transaction/elevatedPayloads.d.ts.map +1 -1
  16. package/dist/neutral/modules/protocol-lib/validation/boundwitness/error.d.ts.map +1 -1
  17. package/dist/neutral/modules/protocol-lib/validation/payload/error.d.ts.map +1 -1
  18. package/dist/neutral/modules/protocol-lib/validation/payload/ruleGate.d.ts.map +1 -1
  19. package/dist/neutral/modules/protocol-lib/validation/transaction/error.d.ts.map +1 -1
  20. package/dist/neutral/modules/protocol-lib/viewers/StakeEvents.d.ts.map +1 -1
  21. package/dist/neutral/modules/protocol-model/Step/StepIdentity.d.ts.map +1 -1
  22. package/dist/neutral/modules/protocol-model/Step/StepSizes.d.ts.map +1 -1
  23. package/dist/neutral/modules/protocol-model/model/Context/BlockContext.zod.d.ts +4 -4
  24. package/dist/neutral/modules/protocol-model/model/Context/BlockContext.zod.d.ts.map +1 -1
  25. package/dist/neutral/modules/protocol-model/model/Context/HeadContext.zod.d.ts +5 -5
  26. package/dist/neutral/modules/protocol-model/model/Context/HeadContext.zod.d.ts.map +1 -1
  27. package/dist/neutral/modules/protocol-model/signature/canonicalSignature.d.ts.map +1 -1
  28. package/dist/neutral/modules/protocol-model/xl1/isXl1Factory.d.ts.map +1 -1
  29. package/dist/neutral/modules/schema/mergeJsonSchemaRequired.d.ts.map +1 -1
  30. package/dist/neutral/modules/validation/transaction/validators/TransactionBoundWitnessValidator.d.ts.map +1 -1
  31. package/dist/neutral/network-model.mjs +93 -13
  32. package/dist/neutral/network-model.mjs.map +3 -3
  33. package/dist/neutral/protocol-lib.mjs +21 -29
  34. package/dist/neutral/protocol-lib.mjs.map +2 -2
  35. package/dist/neutral/protocol-model.mjs +11 -17
  36. package/dist/neutral/protocol-model.mjs.map +2 -2
  37. package/dist/neutral/schema.mjs +1 -2
  38. package/dist/neutral/schema.mjs.map +2 -2
  39. package/dist/neutral/validation.mjs +2 -1
  40. package/dist/neutral/validation.mjs.map +2 -2
  41. package/package.json +7 -7
@@ -141,8 +141,7 @@ var xl1MaxValue = (places) => 10n ** (32n - places) - 1n;
141
141
 
142
142
  // src/modules/protocol-model/xl1/isXl1Factory.ts
143
143
  var isXL1Factory = (places) => (val) => {
144
- if (typeof val !== "bigint") return false;
145
- return val >= 0n && val <= xl1MaxValue(places);
144
+ return typeof val === "bigint" && val >= 0n && val <= xl1MaxValue(places);
146
145
  };
147
146
  var XL1ZodFactory = (places, name) => {
148
147
  const is = isXL1Factory(places);
@@ -158,7 +157,10 @@ var XL1ZodFactory = (places, name) => {
158
157
  var XL1TransformZodFactory = (places, name) => {
159
158
  const is = isXL1Factory(places);
160
159
  const message = `Invalid value for ${name}, must be between 0 and ${xl1MaxValue(places)}`;
161
- return z8.union([z8.bigint(), z8.number(), z8.string(), z8.boolean()]).transform((val) => BigInt(val)).refine(
160
+ return z8.union([z8.bigint(), z8.number(), z8.string(), z8.boolean()]).transform((val) => {
161
+ const amount = BigInt(val);
162
+ return amount;
163
+ }).refine(
162
164
  (x) => {
163
165
  const result = is(x);
164
166
  return result;
@@ -1069,10 +1071,7 @@ var asStepIdentity = (stepIdentityString) => {
1069
1071
  }
1070
1072
  const step = tryParseInt(stepString);
1071
1073
  const block = toXL1BlockNumber(blockNumberString);
1072
- if (isUndefined(block) || isUndefined(step)) {
1073
- return void 0;
1074
- }
1075
- return { block, step };
1074
+ return isUndefined(block) || isUndefined(step) ? void 0 : { block, step };
1076
1075
  } catch {
1077
1076
  return void 0;
1078
1077
  }
@@ -1092,10 +1091,7 @@ var StepSizes = [
1092
1091
  asXL1BlockNumber(6469693231, true)
1093
1092
  ];
1094
1093
  function isValidStep(step) {
1095
- if (typeof step === "number" && Number.isSafeInteger(step)) {
1096
- return step >= 0 && step < StepSizes.length;
1097
- }
1098
- return false;
1094
+ return typeof step === "number" && Number.isSafeInteger(step) && step >= 0 && step < StepSizes.length;
1099
1095
  }
1100
1096
  var asValidStep = AsTypeFactory.create(isValidStep);
1101
1097
  function stepSize(step) {
@@ -1234,8 +1230,7 @@ var AllowedBlockPayloadSchemas = [
1234
1230
  var AllowedBlockPayloadSchemaZod = z39.enum(AllowedBlockPayloadSchemas);
1235
1231
  var isAllowedBlockPayloadSchema = zodIsFactory29(AllowedBlockPayloadSchemaZod);
1236
1232
  var isAllowedBlockPayload = (value) => {
1237
- if (!isXl1PayloadVersionSupported(value)) return false;
1238
- return isTransferPayload(value) || isBridgeDestinationObservation(value) || isBridgeIntent(value) || isBridgeSourceObservation(value) || isChainStakeIntent(value) || isClaimPayload(value) || isHashPayload(value) || isSchemaPayload(value) || isSlashAdjudication(value) || isSlashChallenge(value) || isSlashCommit(value) || isSlashEvidence(value) || isSlashRequest(value) || isStepWitness(value) || isStepComplete(value) || isTimePayload(value) || isTransactionBoundWitness(value);
1233
+ return isXl1PayloadVersionSupported(value) && (isTransferPayload(value) || isBridgeDestinationObservation(value) || isBridgeIntent(value) || isBridgeSourceObservation(value) || isChainStakeIntent(value) || isClaimPayload(value) || isHashPayload(value) || isSchemaPayload(value) || isSlashAdjudication(value) || isSlashChallenge(value) || isSlashCommit(value) || isSlashEvidence(value) || isSlashRequest(value) || isStepWitness(value) || isStepComplete(value) || isTimePayload(value) || isTransactionBoundWitness(value));
1239
1234
  };
1240
1235
  var isAllowedBlockPayloadWithHashMeta = (value) => {
1241
1236
  return isAllowedBlockPayload(value) && isHashMeta(value);
@@ -1792,7 +1787,7 @@ var BaseContextZod = z59.object({
1792
1787
  });
1793
1788
 
1794
1789
  // src/modules/protocol-model/model/Context/BlockContext.zod.ts
1795
- import z60 from "zod";
1790
+ import { z as z60 } from "zod";
1796
1791
 
1797
1792
  // src/modules/protocol-model/model/Context/CachingContext.zod.ts
1798
1793
  var CachingContextZod = BaseContextZod.extend({ caches: CachesZod });
@@ -1808,7 +1803,7 @@ var BlockContextZod = BlockContextWriteZod;
1808
1803
 
1809
1804
  // src/modules/protocol-model/model/Context/HeadContext.zod.ts
1810
1805
  import { WithHashMetaZod as WithHashMetaZod6 } from "@xyo-network/sdk";
1811
- import z61 from "zod";
1806
+ import { z as z61 } from "zod";
1812
1807
  var HeadContextBaseZod = z61.object(
1813
1808
  { head: WithHashMetaZod6(BlockBoundWitnessZod) }
1814
1809
  );
@@ -2215,8 +2210,7 @@ function stripPrefix(signature) {
2215
2210
  }
2216
2211
  function signatureS(signature) {
2217
2212
  const hex = stripPrefix(signature);
2218
- if (hex.length !== COMPACT_SIGNATURE_HEX_LENGTH || !/^[0-9a-f]+$/i.test(hex)) return void 0;
2219
- return BigInt(`0x${hex.slice(S_HEX_OFFSET)}`);
2213
+ return hex.length !== COMPACT_SIGNATURE_HEX_LENGTH || !/^[0-9a-f]+$/i.test(hex) ? void 0 : BigInt(`0x${hex.slice(S_HEX_OFFSET)}`);
2220
2214
  }
2221
2215
  function isCanonicalSignature(signature) {
2222
2216
  if (typeof signature !== "string") return false;