@xyo-network/xl1-protocol 5.8.0 → 5.8.2
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/modules/network-model/icons/local/index.d.ts +2 -1
- package/dist/neutral/modules/network-model/icons/local/index.d.ts.map +1 -1
- package/dist/neutral/modules/network-model/icons/mainnet/index.d.ts +2 -1
- package/dist/neutral/modules/network-model/icons/mainnet/index.d.ts.map +1 -1
- package/dist/neutral/modules/network-model/icons/sequence/index.d.ts +2 -1
- package/dist/neutral/modules/network-model/icons/sequence/index.d.ts.map +1 -1
- package/dist/neutral/modules/network-model/lib/PayloadHashVariances.d.ts +51 -0
- package/dist/neutral/modules/network-model/lib/PayloadHashVariances.d.ts.map +1 -0
- package/dist/neutral/modules/network-model/lib/index.d.ts +1 -0
- package/dist/neutral/modules/network-model/lib/index.d.ts.map +1 -1
- package/dist/neutral/modules/network-model/staticRest/layout/chainParamsRules.d.ts.map +1 -1
- package/dist/neutral/modules/protocol-lib/providers/signer/XyoSigner.d.ts.map +1 -1
- package/dist/neutral/modules/protocol-lib/summary/stepPlacement.d.ts.map +1 -1
- package/dist/neutral/modules/protocol-lib/transaction/elevatedPayloads.d.ts +3 -1
- package/dist/neutral/modules/protocol-lib/transaction/elevatedPayloads.d.ts.map +1 -1
- package/dist/neutral/modules/protocol-lib/validation/boundwitness/error.d.ts.map +1 -1
- package/dist/neutral/modules/protocol-lib/validation/payload/error.d.ts.map +1 -1
- package/dist/neutral/modules/protocol-lib/validation/payload/ruleGate.d.ts.map +1 -1
- package/dist/neutral/modules/protocol-lib/validation/transaction/error.d.ts.map +1 -1
- package/dist/neutral/modules/protocol-lib/viewers/StakeEvents.d.ts.map +1 -1
- package/dist/neutral/modules/protocol-model/Step/StepIdentity.d.ts.map +1 -1
- package/dist/neutral/modules/protocol-model/Step/StepSizes.d.ts.map +1 -1
- package/dist/neutral/modules/protocol-model/model/Context/BlockContext.zod.d.ts +4 -4
- package/dist/neutral/modules/protocol-model/model/Context/BlockContext.zod.d.ts.map +1 -1
- package/dist/neutral/modules/protocol-model/model/Context/HeadContext.zod.d.ts +5 -5
- package/dist/neutral/modules/protocol-model/model/Context/HeadContext.zod.d.ts.map +1 -1
- package/dist/neutral/modules/protocol-model/signature/canonicalSignature.d.ts.map +1 -1
- package/dist/neutral/modules/protocol-model/xl1/isXl1Factory.d.ts.map +1 -1
- package/dist/neutral/modules/schema/mergeJsonSchemaRequired.d.ts.map +1 -1
- package/dist/neutral/modules/validation/transaction/validators/TransactionBoundWitnessValidator.d.ts.map +1 -1
- package/dist/neutral/network-model.mjs +93 -13
- package/dist/neutral/network-model.mjs.map +3 -3
- package/dist/neutral/protocol-lib.mjs +21 -29
- package/dist/neutral/protocol-lib.mjs.map +2 -2
- package/dist/neutral/protocol-model.mjs +11 -17
- package/dist/neutral/protocol-model.mjs.map +2 -2
- package/dist/neutral/schema.mjs +1 -2
- package/dist/neutral/schema.mjs.map +2 -2
- package/dist/neutral/validation.mjs +2 -1
- package/dist/neutral/validation.mjs.map +2 -2
- package/package.json +6 -6
|
@@ -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
|
-
|
|
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) =>
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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;
|