@xyo-network/xl1-protocol 5.3.7 → 5.4.0
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/protocol-model/payload/elevatable/Claim.d.ts +43 -5
- package/dist/neutral/modules/protocol-model/payload/elevatable/Claim.d.ts.map +1 -1
- package/dist/neutral/modules/schema/payload/ClaimPayload.d.ts.map +1 -1
- package/dist/neutral/protocol-model.mjs +11 -2
- package/dist/neutral/protocol-model.mjs.map +2 -2
- package/dist/neutral/schema.mjs +8 -2
- package/dist/neutral/schema.mjs.map +2 -2
- package/package.json +1 -1
|
@@ -5,9 +5,14 @@ export declare const ClaimSchema: "network.xyo.statement.claim" & {
|
|
|
5
5
|
};
|
|
6
6
|
/** The literal type of the claim schema string. */
|
|
7
7
|
export type ClaimSchema = typeof ClaimSchema;
|
|
8
|
-
/** Upper
|
|
9
|
-
* so a single malformed claim cannot amplify unboundedly. */
|
|
8
|
+
/** Upper bounds on one claim's subject map and per-subject hash arrays.
|
|
9
|
+
* Caps per-event elevation work so a single malformed claim cannot amplify unboundedly. */
|
|
10
10
|
export declare const MAX_CLAIM_HASHES: 256;
|
|
11
|
+
export declare const ClaimSubjectZod: z.ZodMiniUnion<readonly [z.ZodMiniUnion<readonly [z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<Lowercase<string> & {
|
|
12
|
+
readonly __hex: true;
|
|
13
|
+
} & {
|
|
14
|
+
readonly __address: true;
|
|
15
|
+
}, string>>, z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<import("@xyo-network/sdk").XyoQuantAddress, string>>]>, z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<import("@ariestools/sdk").BrandedHash, string>>]>;
|
|
11
16
|
/** Zod schema for the fields specific to a claim payload. */
|
|
12
17
|
export declare const ClaimFieldsZod: z.ZodMiniObject<{
|
|
13
18
|
hashes: z.ZodMiniArray<z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<import("@ariestools/sdk").BrandedHash, string>>>;
|
|
@@ -16,6 +21,11 @@ export declare const ClaimFieldsZod: z.ZodMiniObject<{
|
|
|
16
21
|
} & {
|
|
17
22
|
readonly __address: true;
|
|
18
23
|
}, string>>, z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<import("@xyo-network/sdk").XyoQuantAddress, string>>]>;
|
|
24
|
+
subject: z.ZodMiniUnion<readonly [z.ZodMiniUnion<readonly [z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<Lowercase<string> & {
|
|
25
|
+
readonly __hex: true;
|
|
26
|
+
} & {
|
|
27
|
+
readonly __address: true;
|
|
28
|
+
}, string>>, z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<import("@xyo-network/sdk").XyoQuantAddress, string>>]>, z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<import("@ariestools/sdk").BrandedHash, string>>]>;
|
|
19
29
|
}, z.core.$strip>;
|
|
20
30
|
/** Zod schema for a complete claim payload including schema and fields. */
|
|
21
31
|
export declare const ClaimZod: z.ZodMiniObject<{
|
|
@@ -28,15 +38,21 @@ export declare const ClaimZod: z.ZodMiniObject<{
|
|
|
28
38
|
} & {
|
|
29
39
|
readonly __address: true;
|
|
30
40
|
}, string>>, z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<import("@xyo-network/sdk").XyoQuantAddress, string>>]>;
|
|
41
|
+
subject: z.ZodMiniUnion<readonly [z.ZodMiniUnion<readonly [z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<Lowercase<string> & {
|
|
42
|
+
readonly __hex: true;
|
|
43
|
+
} & {
|
|
44
|
+
readonly __address: true;
|
|
45
|
+
}, string>>, z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<import("@xyo-network/sdk").XyoQuantAddress, string>>]>, z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<import("@ariestools/sdk").BrandedHash, string>>]>;
|
|
31
46
|
}, z.core.$strip>;
|
|
32
|
-
/** A claim payload: `
|
|
47
|
+
/** A claim payload: each subject in `claims` is asserted against the
|
|
48
|
+
* content-addressed objects in its hash array.
|
|
33
49
|
* Referenced object bodies stay off-chain; only this payload is elevatable. */
|
|
34
50
|
export type Claim = z.infer<typeof ClaimZod>;
|
|
35
51
|
/**
|
|
36
52
|
* Type guard that checks if a value is a Claim payload.
|
|
37
53
|
*
|
|
38
54
|
* @deprecated Checks only the schema string — a matching payload may still be
|
|
39
|
-
* missing `
|
|
55
|
+
* missing `claims`. Use `isClaimPayload` to validate the full shape
|
|
40
56
|
* before dereferencing Claim fields.
|
|
41
57
|
*/
|
|
42
58
|
export declare const isClaim: (x?: unknown) => x is {
|
|
@@ -49,6 +65,11 @@ export declare const isClaim: (x?: unknown) => x is {
|
|
|
49
65
|
} & {
|
|
50
66
|
readonly __address: true;
|
|
51
67
|
}) | import("@xyo-network/sdk").XyoQuantAddress;
|
|
68
|
+
subject: (Lowercase<string> & {
|
|
69
|
+
readonly __hex: true;
|
|
70
|
+
} & {
|
|
71
|
+
readonly __address: true;
|
|
72
|
+
}) | import("@xyo-network/sdk").XyoQuantAddress | import("@ariestools/sdk").BrandedHash;
|
|
52
73
|
};
|
|
53
74
|
/** Type guard that validates the full Claim payload shape (schema and all fields). */
|
|
54
75
|
export declare const isClaimPayload: <T>(value: T) => value is T & {
|
|
@@ -61,8 +82,15 @@ export declare const isClaimPayload: <T>(value: T) => value is T & {
|
|
|
61
82
|
} & {
|
|
62
83
|
readonly __address: true;
|
|
63
84
|
}) | import("@xyo-network/sdk").XyoQuantAddress;
|
|
85
|
+
subject: (Lowercase<string> & {
|
|
86
|
+
readonly __hex: true;
|
|
87
|
+
} & {
|
|
88
|
+
readonly __address: true;
|
|
89
|
+
}) | import("@xyo-network/sdk").XyoQuantAddress | import("@ariestools/sdk").BrandedHash;
|
|
64
90
|
};
|
|
65
|
-
/** Casts a value to Claim or returns undefined if invalid.
|
|
91
|
+
/** Casts a value to Claim or returns undefined if invalid.
|
|
92
|
+
* @deprecated use asClaimPayload instead
|
|
93
|
+
*/
|
|
66
94
|
export declare const asClaim: import("@ariestools/sdk").AsTypeFunction<{
|
|
67
95
|
schema: "network.xyo.statement.claim" & {
|
|
68
96
|
readonly __schema: true;
|
|
@@ -73,6 +101,11 @@ export declare const asClaim: import("@ariestools/sdk").AsTypeFunction<{
|
|
|
73
101
|
} & {
|
|
74
102
|
readonly __address: true;
|
|
75
103
|
}) | import("@xyo-network/sdk").XyoQuantAddress;
|
|
104
|
+
subject: (Lowercase<string> & {
|
|
105
|
+
readonly __hex: true;
|
|
106
|
+
} & {
|
|
107
|
+
readonly __address: true;
|
|
108
|
+
}) | import("@xyo-network/sdk").XyoQuantAddress | import("@ariestools/sdk").BrandedHash;
|
|
76
109
|
}>;
|
|
77
110
|
/** Casts a value to a fully-validated Claim or returns undefined if invalid. */
|
|
78
111
|
export declare const asClaimPayload: import("@ariestools/sdk").AsTypeFunction<{
|
|
@@ -85,5 +118,10 @@ export declare const asClaimPayload: import("@ariestools/sdk").AsTypeFunction<{
|
|
|
85
118
|
} & {
|
|
86
119
|
readonly __address: true;
|
|
87
120
|
}) | import("@xyo-network/sdk").XyoQuantAddress;
|
|
121
|
+
subject: (Lowercase<string> & {
|
|
122
|
+
readonly __hex: true;
|
|
123
|
+
} & {
|
|
124
|
+
readonly __address: true;
|
|
125
|
+
}) | import("@xyo-network/sdk").XyoQuantAddress | import("@ariestools/sdk").BrandedHash;
|
|
88
126
|
}>;
|
|
89
127
|
//# sourceMappingURL=Claim.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Claim.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/protocol-model/payload/elevatable/Claim.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Claim.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/protocol-model/payload/elevatable/Claim.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,CAAC,EAAE,MAAM,UAAU,CAAA;AAE5B,sDAAsD;AACtD,eAAO,MAAM,WAAW;;CAAgD,CAAA;AACxE,mDAAmD;AACnD,MAAM,MAAM,WAAW,GAAG,OAAO,WAAW,CAAA;AAE5C;4FAC4F;AAC5F,eAAO,MAAM,gBAAgB,EAAG,GAAY,CAAA;AAE5C,eAAO,MAAM,eAAe;;;;0OAAoC,CAAA;AAEhE,6DAA6D;AAC7D,eAAO,MAAM,cAAc;;;;;;;;;;;;iBAiBzB,CAAA;AAEF,2EAA2E;AAC3E,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;iBAAkE,CAAA;AAEvF;;gFAEgF;AAChF,MAAM,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,QAAQ,CAAC,CAAA;AAE5C;;;;;;GAMG;AACH,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;CAA4C,CAAA;AAEhE,sFAAsF;AACtF,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;CAAyB,CAAA;AAEpD;;EAEE;AACF,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;EAAyC,CAAA;AAE7D,gFAAgF;AAChF,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;EAAyC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClaimPayload.d.ts","sourceRoot":"","sources":["../../../../../src/modules/schema/payload/ClaimPayload.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,KAAK,CAAA;AAEzC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AAK1C,iDAAiD;AACjD,eAAO,MAAM,sBAAsB,EAAE,cAAc,CAAC,KAAK,
|
|
1
|
+
{"version":3,"file":"ClaimPayload.d.ts","sourceRoot":"","sources":["../../../../../src/modules/schema/payload/ClaimPayload.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,KAAK,CAAA;AAEzC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AAK1C,iDAAiD;AACjD,eAAO,MAAM,sBAAsB,EAAE,cAAc,CAAC,KAAK,CAwBxD,CAAA;AAID,kGAAkG;AAClG,eAAO,MAAM,6BAA6B;;;;;;;;;;;CACe,CAAA"}
|
|
@@ -624,7 +624,10 @@ import {
|
|
|
624
624
|
import { z as z23 } from "zod/mini";
|
|
625
625
|
var ClaimSchema = asSchema13("network.xyo.statement.claim", true);
|
|
626
626
|
var MAX_CLAIM_HASHES = 256;
|
|
627
|
+
var ClaimSubjectZod = z23.union([XyoAddressZod5, HashZod4]);
|
|
627
628
|
var ClaimFieldsZod = z23.object({
|
|
629
|
+
/** The claims being made about the subject.
|
|
630
|
+
* These should be from a set of 'known' hashes of which the reducer has a complete set */
|
|
628
631
|
hashes: z23.array(HashZod4).check(
|
|
629
632
|
z23.minLength(1),
|
|
630
633
|
z23.maxLength(MAX_CLAIM_HASHES),
|
|
@@ -633,12 +636,17 @@ var ClaimFieldsZod = z23.object({
|
|
|
633
636
|
{ error: "duplicate hashes" }
|
|
634
637
|
)
|
|
635
638
|
),
|
|
636
|
-
|
|
639
|
+
/** The address making the claim
|
|
640
|
+
* We need this since we can not use the tx signer(s) because one may be a signing pool
|
|
641
|
+
*/
|
|
642
|
+
source: XyoAddressZod5,
|
|
643
|
+
/** This is the thing that the claim is being made about */
|
|
644
|
+
subject: ClaimSubjectZod
|
|
637
645
|
});
|
|
638
646
|
var ClaimZod = z23.extend(PayloadZodOfSchema(ClaimSchema), ClaimFieldsZod.shape);
|
|
639
647
|
var isClaim = isPayloadOfSchemaType2(ClaimSchema);
|
|
640
648
|
var isClaimPayload = zodIsFactory4(ClaimZod);
|
|
641
|
-
var asClaim = AsObjectFactory13.create(
|
|
649
|
+
var asClaim = AsObjectFactory13.create(isClaimPayload);
|
|
642
650
|
var asClaimPayload = AsObjectFactory13.create(isClaimPayload);
|
|
643
651
|
|
|
644
652
|
// src/modules/protocol-model/payload/elevatable/Executable.ts
|
|
@@ -2006,6 +2014,7 @@ export {
|
|
|
2006
2014
|
ChainZod,
|
|
2007
2015
|
ClaimFieldsZod,
|
|
2008
2016
|
ClaimSchema,
|
|
2017
|
+
ClaimSubjectZod,
|
|
2009
2018
|
ClaimZod,
|
|
2010
2019
|
CountZod,
|
|
2011
2020
|
DefaultProviderMoniker,
|