@xyo-network/payload-model 6.1.1 → 7.0.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.
@@ -1,15 +1,65 @@
1
- import type { Hash, JsonValue } from '@xylabs/sdk-js';
2
- import type { Payload } from './Payload.ts';
3
- import { type Schema } from './Schema.ts';
1
+ import * as z from 'zod/mini';
4
2
  export declare const ModuleErrorSchema: "network.xyo.error.module" & {
5
3
  readonly __schema: true;
6
4
  };
7
5
  export type ModuleErrorSchema = typeof ModuleErrorSchema;
8
- export type ModuleError = Payload<{
9
- details?: JsonValue;
10
- message?: string;
11
- name?: string;
12
- query?: Hash | Schema;
13
- }, ModuleErrorSchema>;
14
- export declare const isModuleError: (x?: unknown) => x is ModuleError;
6
+ export declare const ModuleErrorZod: z.ZodMiniObject<{
7
+ schema: z.ZodMiniLiteral<"network.xyo.error.module" & {
8
+ readonly __schema: true;
9
+ }>;
10
+ details: z.ZodMiniOptional<z.ZodMiniCustom<unknown, unknown>>;
11
+ message: z.ZodMiniOptional<z.ZodMiniString<string>>;
12
+ name: z.ZodMiniOptional<z.ZodMiniString<string>>;
13
+ query: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<import("@xylabs/sdk-js").BrandedHash, string>>, z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<import("./Schema.ts").BrandedSchema<string>, string>>]>>;
14
+ }, z.core.$strip>;
15
+ export type ModuleError = z.infer<typeof ModuleErrorZod>;
16
+ export declare const isModuleError: <T>(value: T) => value is T & {
17
+ schema: "network.xyo.error.module" & {
18
+ readonly __schema: true;
19
+ };
20
+ details?: unknown;
21
+ message?: string | undefined;
22
+ name?: string | undefined;
23
+ query?: import("./Schema.ts").BrandedSchema<string> | import("@xylabs/sdk-js").BrandedHash | undefined;
24
+ };
25
+ export declare const asModuleError: {
26
+ <T>(value: T): (T & {
27
+ schema: "network.xyo.error.module" & {
28
+ readonly __schema: true;
29
+ };
30
+ details?: unknown;
31
+ message?: string | undefined;
32
+ name?: string | undefined;
33
+ query?: import("./Schema.ts").BrandedSchema<string> | import("@xylabs/sdk-js").BrandedHash | undefined;
34
+ }) | undefined;
35
+ <T>(value: T, assert: import("@xylabs/sdk-js").ZodFactoryConfig): T & {
36
+ schema: "network.xyo.error.module" & {
37
+ readonly __schema: true;
38
+ };
39
+ details?: unknown;
40
+ message?: string | undefined;
41
+ name?: string | undefined;
42
+ query?: import("./Schema.ts").BrandedSchema<string> | import("@xylabs/sdk-js").BrandedHash | undefined;
43
+ };
44
+ };
45
+ export declare const toModuleError: {
46
+ <T>(value: T): (T & {
47
+ schema: "network.xyo.error.module" & {
48
+ readonly __schema: true;
49
+ };
50
+ details?: unknown;
51
+ message?: string | undefined;
52
+ name?: string | undefined;
53
+ query?: import("./Schema.ts").BrandedSchema<string> | import("@xylabs/sdk-js").BrandedHash | undefined;
54
+ }) | undefined;
55
+ <T>(value: T, assert: import("@xylabs/sdk-js").ZodFactoryConfig): T & {
56
+ schema: "network.xyo.error.module" & {
57
+ readonly __schema: true;
58
+ };
59
+ details?: unknown;
60
+ message?: string | undefined;
61
+ name?: string | undefined;
62
+ query?: import("./Schema.ts").BrandedSchema<string> | import("@xylabs/sdk-js").BrandedHash | undefined;
63
+ };
64
+ };
15
65
  //# sourceMappingURL=Error.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Error.d.ts","sourceRoot":"","sources":["../../src/Error.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAGrD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAC3C,OAAO,EAAY,KAAK,MAAM,EAAE,MAAM,aAAa,CAAA;AAEnD,eAAO,MAAM,iBAAiB;;CAA6C,CAAA;AAC3E,MAAM,MAAM,iBAAiB,GAAG,OAAO,iBAAiB,CAAA;AAExD,MAAM,MAAM,WAAW,GAAG,OAAO,CAAC;IAChC,OAAO,CAAC,EAAE,SAAS,CAAA;IACnB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,IAAI,GAAG,MAAM,CAAA;CACtB,EAAE,iBAAiB,CAAC,CAAA;AAErB,eAAO,MAAM,aAAa,mCAAwD,CAAA"}
1
+ {"version":3,"file":"Error.d.ts","sourceRoot":"","sources":["../../src/Error.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,UAAU,CAAA;AAK7B,eAAO,MAAM,iBAAiB;;CAA6C,CAAA;AAC3E,MAAM,MAAM,iBAAiB,GAAG,OAAO,iBAAiB,CAAA;AAExD,eAAO,MAAM,cAAc;;;;;;;;iBAKzB,CAAA;AAEF,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAA;AAExD,eAAO,MAAM,aAAa;;;;;;;;CAA+B,CAAA;AACzD,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;CAAgD,CAAA;AAC1E,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;CAAgD,CAAA"}
@@ -1,8 +1,54 @@
1
- import type { Payload } from '../Payload.ts';
2
- import type { PayloadSetSchema } from './PayloadSetSchema.ts';
3
- export interface PayloadSet {
4
- optional?: Record<string, number>;
5
- required?: Record<string, number>;
6
- }
7
- export type PayloadSetPayload = Payload<PayloadSet, PayloadSetSchema>;
1
+ import * as z from 'zod/mini';
2
+ export declare const PayloadSetZod: z.ZodMiniObject<{
3
+ optional: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniNumber<number>>>;
4
+ required: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniNumber<number>>>;
5
+ }, z.core.$strip>;
6
+ export type PayloadSet = z.infer<typeof PayloadSetZod>;
7
+ export declare const PayloadSetPayloadZod: z.ZodMiniObject<{
8
+ schema: z.ZodMiniLiteral<"network.xyo.payload.set" & {
9
+ readonly __schema: true;
10
+ }>;
11
+ optional: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniNumber<number>>>;
12
+ required: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniNumber<number>>>;
13
+ }, z.core.$strip>;
14
+ export type PayloadSetPayload = z.infer<typeof PayloadSetPayloadZod>;
15
+ export declare const isPayloadSetPayload: <T>(value: T) => value is T & {
16
+ schema: "network.xyo.payload.set" & {
17
+ readonly __schema: true;
18
+ };
19
+ optional?: Record<string, number> | undefined;
20
+ required?: Record<string, number> | undefined;
21
+ };
22
+ export declare const asPayloadSetPayload: {
23
+ <T>(value: T): (T & {
24
+ schema: "network.xyo.payload.set" & {
25
+ readonly __schema: true;
26
+ };
27
+ optional?: Record<string, number> | undefined;
28
+ required?: Record<string, number> | undefined;
29
+ }) | undefined;
30
+ <T>(value: T, assert: import("@xylabs/sdk-js").ZodFactoryConfig): T & {
31
+ schema: "network.xyo.payload.set" & {
32
+ readonly __schema: true;
33
+ };
34
+ optional?: Record<string, number> | undefined;
35
+ required?: Record<string, number> | undefined;
36
+ };
37
+ };
38
+ export declare const toPayloadSetPayload: {
39
+ <T>(value: T): (T & {
40
+ schema: "network.xyo.payload.set" & {
41
+ readonly __schema: true;
42
+ };
43
+ optional?: Record<string, number> | undefined;
44
+ required?: Record<string, number> | undefined;
45
+ }) | undefined;
46
+ <T>(value: T, assert: import("@xylabs/sdk-js").ZodFactoryConfig): T & {
47
+ schema: "network.xyo.payload.set" & {
48
+ readonly __schema: true;
49
+ };
50
+ optional?: Record<string, number> | undefined;
51
+ required?: Record<string, number> | undefined;
52
+ };
53
+ };
8
54
  //# sourceMappingURL=PayloadSetPayload.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PayloadSetPayload.d.ts","sourceRoot":"","sources":["../../../src/PayloadSet/PayloadSetPayload.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAC5C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAE7D,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACjC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAClC;AAED,MAAM,MAAM,iBAAiB,GAAG,OAAO,CAAC,UAAU,EAAE,gBAAgB,CAAC,CAAA"}
1
+ {"version":3,"file":"PayloadSetPayload.d.ts","sourceRoot":"","sources":["../../../src/PayloadSet/PayloadSetPayload.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,CAAC,MAAM,UAAU,CAAA;AAO7B,eAAO,MAAM,aAAa;;;iBAGxB,CAAA;AAEF,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAA;AAEtD,eAAO,MAAM,oBAAoB;;;;;;iBAAsE,CAAA;AAEvG,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAEpE,eAAO,MAAM,mBAAmB;;;;;;CAAqC,CAAA;AACrE,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;CAA4D,CAAA;AAC5F,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;CAA4D,CAAA"}
@@ -155,6 +155,12 @@ export declare const PayloadZodStrict: z.ZodMiniObject<{
155
155
  export type PayloadZodStrict = typeof PayloadZodStrict;
156
156
  export declare const PayloadZodLoose: PayloadZodStrict;
157
157
  export type PayloadZodLoose = typeof PayloadZodLoose;
158
+ export declare const WithHashMetaPayloadZodLoose: z.ZodMiniObject<{
159
+ schema: z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<import("./Schema.ts").BrandedSchema<string>, string>>;
160
+ _hash: z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<import("@xylabs/sdk-js").BrandedHash, string>>;
161
+ _dataHash: z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<import("@xylabs/sdk-js").BrandedHash, string>>;
162
+ }, z.core.$strict>;
163
+ export type WithHashMetaPayloadZodLoose = typeof WithHashMetaPayloadZodLoose;
158
164
  export declare const PayloadZodOfSchema: <S extends Schema>(schema: S) => z.ZodMiniObject<{
159
165
  schema: z.ZodMiniLiteral<S>;
160
166
  }, z.core.$strip>;
@@ -1 +1 @@
1
- {"version":3,"file":"PayloadZod.d.ts","sourceRoot":"","sources":["../../src/PayloadZod.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,UAAU,CAAA;AAE7B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAC3C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAIzC,eAAO,MAAM,WAAW;;;iBAGtB,CAAA;AAEF,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAA;AAElD,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,OAAO,IAAI,CAAC,GAAG,QAAQ,CAAA;AAE1D,eAAO,MAAM,UAAU;;;CAA4B,CAAA;AACnD,eAAO,MAAM,UAAU;;;;;;;;;CAA0C,CAAA;AACjE,eAAO,MAAM,UAAU;;;;;;;;;CAA0C,CAAA;AAEjE,eAAO,MAAM,eAAe;;iBAAiD,CAAA;AAE7E,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAA;AAE1D,eAAO,MAAM,cAAc;;CAAgC,CAAA;AAC3D,eAAO,MAAM,cAAc;;;;;;;CAAkD,CAAA;AAC7E,eAAO,MAAM,cAAc;;;;;;;CAAkD,CAAA;AAE7E,eAAO,MAAM,cAAc;;;;iBAIzB,CAAA;AAEF,M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tH,eAAO,MAAM,wBAAwB,GAAI,CAAC,SAAS,MAAM,EAAE,QAAQ,CAAC;;kBAA8D,CAAA;AAClI,eAAO,MAAM,uBAAuB,GAAI,CAAC,SAAS,MAAM,EAAE,QAAQ,CAAC;;kBAA6D,CAAA"}
@@ -1,16 +1,21 @@
1
1
  import type { EmptyObject } from '@xylabs/sdk-js';
2
- import type { XyoAddress } from '@xyo-network/address';
2
+ import * as z from 'zod/mini';
3
3
  import type { Payload, SchemaField } from './Payload.ts';
4
4
  import type { Schema } from './Schema.ts';
5
- export interface QueryFields {
6
- /** @field The addresses of the intended handlers */
7
- address?: XyoAddress | XyoAddress[];
8
- /** @field The maximum XYO that can be spent executing the query */
9
- budget?: number;
10
- /** @field The frequency on which this query can be rerun */
11
- maxFrequency?: 'once' | 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'year';
12
- /** @field The starting point for the bidding on the query */
13
- minBid?: number;
14
- }
5
+ export declare const QueryFieldsZod: z.ZodMiniObject<{
6
+ address: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniUnion<readonly [z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<Lowercase<string> & {
7
+ readonly __hex: true;
8
+ } & {
9
+ readonly __address: true;
10
+ }, string>>, z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<import("@xyo-network/address").XyoQuantAddress, string>>]>, z.ZodMiniArray<z.ZodMiniUnion<readonly [z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<Lowercase<string> & {
11
+ readonly __hex: true;
12
+ } & {
13
+ readonly __address: true;
14
+ }, string>>, z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<import("@xyo-network/address").XyoQuantAddress, string>>]>>]>>;
15
+ budget: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
16
+ maxFrequency: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniLiteral<"once">, z.ZodMiniLiteral<"second">, z.ZodMiniLiteral<"minute">, z.ZodMiniLiteral<"hour">, z.ZodMiniLiteral<"day">, z.ZodMiniLiteral<"week">, z.ZodMiniLiteral<"month">, z.ZodMiniLiteral<"year">]>>;
17
+ minBid: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
18
+ }, z.core.$strip>;
19
+ export type QueryFields = z.infer<typeof QueryFieldsZod>;
15
20
  export type Query<T extends void | EmptyObject | SchemaField = void, S extends Schema | void = void> = Payload<T extends void ? QueryFields : T & QueryFields, S extends void ? T extends SchemaField ? T['schema'] : T extends void ? Schema : void : S>;
16
21
  //# sourceMappingURL=Query.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Query.d.ts","sourceRoot":"","sources":["../../src/Query.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAEtD,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AACxD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEzC,MAAM,WAAW,WAAW;IAC1B,oDAAoD;IACpD,OAAO,CAAC,EAAE,UAAU,GAAG,UAAU,EAAE,CAAA;IAEnC,mEAAmE;IACnE,MAAM,CAAC,EAAE,MAAM,CAAA;IAEf,4DAA4D;IAC5D,YAAY,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAA;IAExF,6DAA6D;IAC7D,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,MAAM,KAAK,CAAC,CAAC,SAAS,IAAI,GAAG,WAAW,GAAG,WAAW,GAAG,IAAI,EAAE,CAAC,SAAS,MAAM,GAAG,IAAI,GAAG,IAAI,IAAI,OAAO,CAC5G,CAAC,SAAS,IAAI,GAAG,WAAW,GAAG,CAAC,GAAG,WAAW,EAC9C,CAAC,SAAS,IAAI,GACV,CAAC,SAAS,WAAW,GAAG,CAAC,CAAC,QAAQ,CAAC,GACjC,CAAC,SAAS,IAAI,GAAG,MAAM,GACrB,IAAI,GACR,CAAC,CACN,CAAA"}
1
+ {"version":3,"file":"Query.d.ts","sourceRoot":"","sources":["../../src/Query.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAEjD,OAAO,KAAK,CAAC,MAAM,UAAU,CAAA;AAE7B,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AACxD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAczC,eAAO,MAAM,cAAc;;;;;;;;;;;;;iBASzB,CAAA;AAEF,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAA;AAExD,MAAM,MAAM,KAAK,CAAC,CAAC,SAAS,IAAI,GAAG,WAAW,GAAG,WAAW,GAAG,IAAI,EAAE,CAAC,SAAS,MAAM,GAAG,IAAI,GAAG,IAAI,IAAI,OAAO,CAC5G,CAAC,SAAS,IAAI,GAAG,WAAW,GAAG,CAAC,GAAG,WAAW,EAC9C,CAAC,SAAS,IAAI,GACV,CAAC,SAAS,WAAW,GAAG,CAAC,CAAC,QAAQ,CAAC,GACjC,CAAC,SAAS,IAAI,GAAG,MAAM,GACrB,IAAI,GACR,CAAC,CACN,CAAA"}
@@ -5,11 +5,6 @@ export declare class SequenceParser {
5
5
  protected static privateConstructorKey: string;
6
6
  private readonly data;
7
7
  protected constructor(privateConstructorKey: string, hex: Hex);
8
- get address(): XyoLegacyAddress;
9
- get epoch(): Epoch;
10
- get localSequence(): LocalSequence;
11
- get nonce(): Nonce;
12
- get qualifiedSequence(): QualifiedSequence;
13
8
  static from(sequence: Sequence, address?: XyoLegacyAddress): SequenceParser;
14
9
  static from(timestamp: Hex, hash: Hash, address?: XyoLegacyAddress): SequenceParser;
15
10
  static from(timestamp: Hex, hash: Hex, address?: XyoLegacyAddress): SequenceParser;
@@ -26,5 +21,11 @@ export declare class SequenceParser {
26
21
  static parse(value: Hex | string | ArrayBufferLike): SequenceParser;
27
22
  static toEpoch(value: number | Hex | Epoch): Epoch;
28
23
  static toNonce(value: Hash | Hex, index?: number): Nonce;
24
+ private static create;
25
+ get address(): XyoLegacyAddress;
26
+ get epoch(): Epoch;
27
+ get localSequence(): LocalSequence;
28
+ get nonce(): Nonce;
29
+ get qualifiedSequence(): QualifiedSequence;
29
30
  }
30
31
  //# sourceMappingURL=Parser.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Parser.d.ts","sourceRoot":"","sources":["../../../../src/StorageMeta/sequence/Parser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAA;AAI/C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAE5D,OAAO,KAAK,EACV,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,iBAAiB,EAC9C,QAAQ,EACT,MAAM,eAAe,CAAA;AAMtB,qBAAa,cAAc;IACzB,SAAS,CAAC,MAAM,CAAC,qBAAqB,SAAwB;IAE9D,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAsB;IAE3C,SAAS,aAAa,qBAAqB,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG;IAW7D,IAAI,OAAO,IAAI,gBAAgB,CAI9B;IAED,IAAI,KAAK,IAAI,KAAK,CAIjB;IAED,IAAI,aAAa,IAAI,aAAa,CAIjC;IAED,IAAI,KAAK,IAAI,KAAK,CAIjB;IAED,IAAI,iBAAiB,IAAI,iBAAiB,CAIzC;IAED,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,cAAc;IAC3E,MAAM,CAAC,IAAI,CAAC,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G,cAAc;IACtG,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,cAAc;IACrG,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,cAAc;IA0BxG,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,GAAG,MAAM,GAAG,eAAe,GAAG,cAAc;IASnE,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,GAAG,KAAK,GAAG,KAAK;IAgBlD,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,GAAG,GAAG,EAAE,KAAK,SAAI,GAAG,KAAK;IAcnD,OAAO,CAAC,MAAM,CAAC,MAAM;IAKrB,IAAI,OAAO,IAAI,gBAAgB,CAI9B;IAED,IAAI,KAAK,IAAI,KAAK,CAIjB;IAED,IAAI,aAAa,IAAI,aAAa,CAIjC;IAED,IAAI,KAAK,IAAI,KAAK,CAIjB;IAED,IAAI,iBAAiB,IAAI,iBAAiB,CAIzC;CACF"}
@@ -1,3 +1,12 @@
1
+ // src/Error.ts
2
+ import {
3
+ HashZod as HashZod2,
4
+ zodAsFactory as zodAsFactory3,
5
+ zodIsFactory as zodIsFactory3,
6
+ zodToFactory as zodToFactory2
7
+ } from "@xylabs/sdk-js";
8
+ import * as z4 from "zod/mini";
9
+
1
10
  // src/PayloadZod.ts
2
11
  import {
3
12
  HashZod,
@@ -98,64 +107,40 @@ var SequenceParser = class _SequenceParser {
98
107
  assertEx(_SequenceParser.privateConstructorKey === privateConstructorKey, () => "Use create function instead of constructor");
99
108
  const paddedHex = toHex(hex, {
100
109
  prefix: false,
101
- bitLength: hex.length <= SequenceConstants.localSequenceBytes * 2 ? SequenceConstants.localSequenceBytes * 8 : SequenceConstants.qualifiedSequenceBytes * 8
110
+ bitLength: SequenceConstants[hex.length <= SequenceConstants.localSequenceBytes * 2 ? "localSequenceBytes" : "qualifiedSequenceBytes"] * 8
102
111
  });
103
112
  this.data = toUint8Array(paddedHex);
104
113
  }
105
- get address() {
106
- const start = SequenceConstants.localSequenceBytes;
107
- const end = SequenceConstants.qualifiedSequenceBytes;
108
- return toAddress(this.data.slice(start, end).buffer, { prefix: false });
109
- }
110
- get epoch() {
111
- const start = 0;
112
- const end = SequenceConstants.epochBytes;
113
- return toHex(this.data.slice(start, end).buffer, { prefix: false });
114
- }
115
- get localSequence() {
116
- const start = 0;
117
- const end = SequenceConstants.localSequenceBytes;
118
- return toHex(this.data.slice(start, end).buffer, { prefix: false });
119
- }
120
- get nonce() {
121
- const start = SequenceConstants.epochBytes;
122
- const end = SequenceConstants.localSequenceBytes;
123
- return toHex(this.data.slice(start, end).buffer, { prefix: false });
124
- }
125
- get qualifiedSequence() {
126
- const start = 0;
127
- const end = SequenceConstants.qualifiedSequenceBytes;
128
- return toHex(this.data.slice(start, end).buffer, { prefix: false });
129
- }
130
114
  static from(timestampOrSequence, nonceOrAddress, addressOrIndex, addressOnly) {
131
- const address = typeof addressOrIndex === "number" ? addressOnly : addressOrIndex;
132
- const index = typeof addressOrIndex === "number" ? addressOrIndex : void 0;
133
115
  if (isSequence(timestampOrSequence)) {
134
116
  if (nonceOrAddress) {
135
117
  assertEx(!isQualifiedSequence(timestampOrSequence), () => "Providing both a qualified sequence and a address is not allowed");
136
118
  assertEx(isAddress(nonceOrAddress), () => "Invalid address provided");
137
- return new this(_SequenceParser.privateConstructorKey, timestampOrSequence + address);
119
+ const combined = timestampOrSequence + nonceOrAddress;
120
+ return this.create(combined);
138
121
  }
139
- return new this(_SequenceParser.privateConstructorKey, timestampOrSequence);
122
+ return this.create(timestampOrSequence);
140
123
  }
141
- const epoch = _SequenceParser.toEpoch(timestampOrSequence);
142
- const nonce = nonceOrAddress === void 0 ? void 0 : _SequenceParser.toNonce(nonceOrAddress, index);
124
+ const address = typeof addressOrIndex === "number" ? addressOnly : addressOrIndex;
125
+ const index = typeof addressOrIndex === "number" ? addressOrIndex : void 0;
126
+ const epoch = this.toEpoch(timestampOrSequence);
127
+ const nonce = nonceOrAddress === void 0 ? void 0 : this.toNonce(nonceOrAddress, index);
143
128
  const addressHex = address ? toHex(address, { bitLength: SequenceConstants.addressBytes * 8 }) : SequenceConstants.minAddress;
144
129
  const hexString = epoch + nonce + addressHex;
145
130
  assertEx(isSequence(hexString), () => `Invalid sequence [${hexString}] [${epoch}, ${nonce}, ${addressHex}]`);
146
- return new this(_SequenceParser.privateConstructorKey, hexString);
131
+ return this.create(hexString);
147
132
  }
148
133
  static parse(value) {
149
134
  const hex = toHex(value);
150
135
  if (isSequence(hex)) {
151
- return new this(_SequenceParser.privateConstructorKey, hex);
136
+ return this.create(hex);
152
137
  }
153
138
  throw new Error(`Invalid sequence [${hex}]`);
154
139
  }
155
140
  // can convert a short number/hex to an epoch (treats it as the whole value) or extract an epoch from a sequence
156
141
  static toEpoch(value) {
157
142
  assertEx(
158
- typeof value !== "number" || Number.isInteger(value),
143
+ typeof value !== "number" || Number.isSafeInteger(value),
159
144
  () => "Value must be in integer"
160
145
  );
161
146
  const hex = toHex(value, { prefix: false });
@@ -170,7 +155,7 @@ var SequenceParser = class _SequenceParser {
170
155
  // can convert a short number/hex to a nonce (treats it as the whole value) or extract an nonce from a sequence
171
156
  static toNonce(value, index = 0) {
172
157
  assertEx(
173
- typeof value !== "number" || Number.isInteger(value),
158
+ typeof value !== "number" || Number.isSafeInteger(value),
174
159
  () => "Value must be in integer"
175
160
  );
176
161
  const hex = toHex(value, { prefix: false });
@@ -181,6 +166,34 @@ var SequenceParser = class _SequenceParser {
181
166
  const indexHex = toHex(index, { prefix: false, bitLength: SequenceConstants.nonceIndexBytes * 8 }).slice(-SequenceConstants.nonceIndexBytes * 2);
182
167
  return (indexHex + hashHex).slice(-SequenceConstants.nonceBytes * 2);
183
168
  }
169
+ static create(hex) {
170
+ return new _SequenceParser(this.privateConstructorKey, hex);
171
+ }
172
+ get address() {
173
+ const start = SequenceConstants.localSequenceBytes;
174
+ const end = SequenceConstants.qualifiedSequenceBytes;
175
+ return toAddress(this.data.slice(start, end).buffer, { prefix: false });
176
+ }
177
+ get epoch() {
178
+ const start = 0;
179
+ const end = SequenceConstants.epochBytes;
180
+ return toHex(this.data.slice(start, end).buffer, { prefix: false });
181
+ }
182
+ get localSequence() {
183
+ const start = 0;
184
+ const end = SequenceConstants.localSequenceBytes;
185
+ return toHex(this.data.slice(start, end).buffer, { prefix: false });
186
+ }
187
+ get nonce() {
188
+ const start = SequenceConstants.epochBytes;
189
+ const end = SequenceConstants.localSequenceBytes;
190
+ return toHex(this.data.slice(start, end).buffer, { prefix: false });
191
+ }
192
+ get qualifiedSequence() {
193
+ const start = 0;
194
+ const end = SequenceConstants.qualifiedSequenceBytes;
195
+ return toHex(this.data.slice(start, end).buffer, { prefix: false });
196
+ }
184
197
  };
185
198
 
186
199
  // src/StorageMeta/sequence/Comparer.ts
@@ -250,10 +263,23 @@ function WithHashMetaZod(valueZod) {
250
263
  }
251
264
  var PayloadZodStrict = z3.strictObject({ schema: SchemaZod });
252
265
  var PayloadZodLoose = z3.looseObject({ schema: SchemaZod });
266
+ var WithHashMetaPayloadZodLoose = z3.extend(PayloadZodLoose, HashMetaZod.shape);
253
267
  var PayloadZodOfSchema = (schema) => z3.extend(PayloadZod, { schema: z3.literal(schema) });
254
268
  var PayloadZodStrictOfSchema = (schema) => z3.extend(PayloadZodStrict, { schema: z3.literal(schema) });
255
269
  var PayloadZodLooseOfSchema = (schema) => z3.extend(PayloadZodLoose, { schema: z3.literal(schema) });
256
270
 
271
+ // src/Error.ts
272
+ var ModuleErrorSchema = asSchema("network.xyo.error.module", true);
273
+ var ModuleErrorZod = z4.extend(PayloadZodOfSchema(ModuleErrorSchema), {
274
+ details: z4.optional(z4.custom()),
275
+ message: z4.optional(z4.string()),
276
+ name: z4.optional(z4.string()),
277
+ query: z4.optional(z4.union([HashZod2, SchemaZod]))
278
+ });
279
+ var isModuleError = zodIsFactory3(ModuleErrorZod);
280
+ var asModuleError = zodAsFactory3(ModuleErrorZod, "asModuleError");
281
+ var toModuleError = zodToFactory2(ModuleErrorZod, "toModuleError");
282
+
257
283
  // src/isPayloadOfSchemaType.ts
258
284
  function isPayloadOfSchemaType(schema) {
259
285
  return (x) => isAnyPayload(x) && x?.schema === schema;
@@ -265,42 +291,82 @@ var notPayloadOfSchemaType = (schema) => {
265
291
  return (x) => !isAnyPayload(x) || x?.schema !== schema;
266
292
  };
267
293
 
268
- // src/Error.ts
269
- var ModuleErrorSchema = asSchema("network.xyo.error.module", true);
270
- var isModuleError = isPayloadOfSchemaType(ModuleErrorSchema);
271
-
272
294
  // src/isPayloadOfZodType.ts
273
295
  import { isDefined } from "@xylabs/sdk-js";
274
- import * as z4 from "zod/mini";
296
+ import * as z5 from "zod/mini";
275
297
  function isPayloadOfZodType(zodSchema, schema) {
276
298
  return (x) => {
277
299
  if (!isAnyPayload(x)) return false;
278
300
  if (isDefined(schema) && x.schema !== schema) return false;
279
301
  const { schema: _, ...data } = x;
280
- return z4.safeParse(zodSchema, data).success;
302
+ return z5.safeParse(zodSchema, data).success;
281
303
  };
282
304
  }
283
305
 
284
306
  // src/PayloadBundle.ts
285
307
  import {
286
- HashZod as HashZod2,
287
- zodAsFactory as zodAsFactory3,
288
- zodIsFactory as zodIsFactory3,
289
- zodToFactory as zodToFactory2
308
+ HashZod as HashZod3,
309
+ zodAsFactory as zodAsFactory4,
310
+ zodIsFactory as zodIsFactory4,
311
+ zodToFactory as zodToFactory3
290
312
  } from "@xylabs/sdk-js";
291
- import * as z5 from "zod/mini";
313
+ import * as z6 from "zod/mini";
292
314
  var PayloadBundleSchema = asSchema("network.xyo.payload.bundle", true);
293
- var PayloadBundleFieldsZod = z5.object({
294
- payloads: z5.array(PayloadZodLoose),
295
- root: HashZod2
315
+ var PayloadBundleFieldsZod = z6.object({
316
+ payloads: z6.array(PayloadZodLoose),
317
+ root: HashZod3
296
318
  });
297
- var PayloadBundleZod = z5.extend(PayloadZodOfSchema(PayloadBundleSchema), PayloadBundleFieldsZod.shape);
298
- var isPayloadBundle = zodIsFactory3(PayloadBundleZod);
299
- var asPayloadBundle = zodAsFactory3(PayloadBundleZod, "asPayloadBundle");
300
- var asOptionalPayloadBundle = zodToFactory2(PayloadBundleZod, "asPayloadBundle");
319
+ var PayloadBundleZod = z6.extend(PayloadZodOfSchema(PayloadBundleSchema), PayloadBundleFieldsZod.shape);
320
+ var isPayloadBundle = zodIsFactory4(PayloadBundleZod);
321
+ var asPayloadBundle = zodAsFactory4(PayloadBundleZod, "asPayloadBundle");
322
+ var asOptionalPayloadBundle = zodToFactory3(PayloadBundleZod, "asPayloadBundle");
323
+
324
+ // src/PayloadSet/PayloadSetPayload.ts
325
+ import {
326
+ zodAsFactory as zodAsFactory5,
327
+ zodIsFactory as zodIsFactory5,
328
+ zodToFactory as zodToFactory4
329
+ } from "@xylabs/sdk-js";
330
+ import * as z7 from "zod/mini";
301
331
 
302
332
  // src/PayloadSet/PayloadSetSchema.ts
303
333
  var PayloadSetSchema = asSchema("network.xyo.payload.set", true);
334
+
335
+ // src/PayloadSet/PayloadSetPayload.ts
336
+ var stringNumberRecordZod = z7.record(z7.string(), z7.number());
337
+ var PayloadSetZod = z7.object({
338
+ optional: z7.optional(stringNumberRecordZod),
339
+ required: z7.optional(stringNumberRecordZod)
340
+ });
341
+ var PayloadSetPayloadZod = z7.extend(PayloadZodOfSchema(PayloadSetSchema), PayloadSetZod.shape);
342
+ var isPayloadSetPayload = zodIsFactory5(PayloadSetPayloadZod);
343
+ var asPayloadSetPayload = zodAsFactory5(PayloadSetPayloadZod, "asPayloadSetPayload");
344
+ var toPayloadSetPayload = zodToFactory4(PayloadSetPayloadZod, "toPayloadSetPayload");
345
+
346
+ // src/Query.ts
347
+ import { XyoAddressZod } from "@xyo-network/address";
348
+ import * as z8 from "zod/mini";
349
+ var queryAddressZod = z8.union([XyoAddressZod, z8.array(XyoAddressZod)]);
350
+ var maxFrequencyZod = z8.union([
351
+ z8.literal("once"),
352
+ z8.literal("second"),
353
+ z8.literal("minute"),
354
+ z8.literal("hour"),
355
+ z8.literal("day"),
356
+ z8.literal("week"),
357
+ z8.literal("month"),
358
+ z8.literal("year")
359
+ ]);
360
+ var QueryFieldsZod = z8.object({
361
+ /** @field The addresses of the intended handlers */
362
+ address: z8.optional(queryAddressZod),
363
+ /** @field The maximum XYO that can be spent executing the query */
364
+ budget: z8.optional(z8.number()),
365
+ /** @field The frequency on which this query can be rerun */
366
+ maxFrequency: z8.optional(maxFrequencyZod),
367
+ /** @field The starting point for the bidding on the query */
368
+ minBid: z8.optional(z8.number())
369
+ });
304
370
  export {
305
371
  AnyPayloadZod,
306
372
  HashMetaZod,
@@ -308,12 +374,15 @@ export {
308
374
  LocalSequenceFromStringZod,
309
375
  LocalSequenceToStringZod,
310
376
  ModuleErrorSchema,
377
+ ModuleErrorZod,
311
378
  PayloadBundleFieldsZod,
312
379
  PayloadBundleSchema,
313
380
  PayloadBundleZod,
314
381
  PayloadSchema,
315
382
  PayloadSchemaZod,
383
+ PayloadSetPayloadZod,
316
384
  PayloadSetSchema,
385
+ PayloadSetZod,
317
386
  PayloadZod,
318
387
  PayloadZodLoose,
319
388
  PayloadZodLooseOfSchema,
@@ -323,6 +392,7 @@ export {
323
392
  QualifiedSequenceConstants,
324
393
  QualifiedSequenceFromStringZod,
325
394
  QualifiedSequenceToStringZod,
395
+ QueryFieldsZod,
326
396
  SchemaRegEx,
327
397
  SchemaZod,
328
398
  SequenceComparer,
@@ -335,14 +405,17 @@ export {
335
405
  SequenceParser,
336
406
  SequenceToStringZod,
337
407
  StorageMetaZod,
408
+ WithHashMetaPayloadZodLoose,
338
409
  WithHashMetaZod,
339
410
  WithStorageMetaZod,
340
411
  asAnyPayload,
341
412
  asHashMeta,
413
+ asModuleError,
342
414
  asOptionalPayloadBundle,
343
415
  asOptionalSequenceStorageMeta,
344
416
  asPayload,
345
417
  asPayloadBundle,
418
+ asPayloadSetPayload,
346
419
  asSchema,
347
420
  asSequenceMeta,
348
421
  asSequenceStorageMeta,
@@ -358,6 +431,7 @@ export {
358
431
  isPayloadOfSchemaType,
359
432
  isPayloadOfSchemaTypeWithSources,
360
433
  isPayloadOfZodType,
434
+ isPayloadSetPayload,
361
435
  isQualifiedSequence,
362
436
  isSchema,
363
437
  isSequence,
@@ -368,7 +442,9 @@ export {
368
442
  notPayloadOfSchemaType,
369
443
  toAnyPayload,
370
444
  toHashMeta,
445
+ toModuleError,
371
446
  toPayload,
447
+ toPayloadSetPayload,
372
448
  toSchema,
373
449
  toSequenceMeta,
374
450
  toStorageMeta
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../src/PayloadZod.ts", "../../src/Schema.ts", "../../src/StorageMeta/Sequence.ts", "../../src/StorageMeta/sequence/Parser.ts", "../../src/StorageMeta/sequence/Sequence.ts", "../../src/StorageMeta/sequence/Comparer.ts", "../../src/StorageMeta/sequence/SequenceZod.ts", "../../src/isPayloadOfSchemaType.ts", "../../src/Error.ts", "../../src/isPayloadOfZodType.ts", "../../src/PayloadBundle.ts", "../../src/PayloadSet/PayloadSetSchema.ts"],
4
- "sourcesContent": ["import {\n HashZod,\n zodAsFactory, zodIsFactory, zodToFactory,\n} from '@xylabs/sdk-js'\nimport * as z from 'zod/mini'\n\nimport type { Payload } from './Payload.ts'\nimport type { Schema } from './Schema.ts'\nimport { SchemaZod } from './Schema.ts'\nimport { SequenceFromStringZod } from './StorageMeta/index.ts'\n\nexport const HashMetaZod = z.object({\n _hash: HashZod,\n _dataHash: HashZod,\n})\n\nexport type HashMeta = z.infer<typeof HashMetaZod>\n\nexport type WithHashMeta<T extends Payload> = T & HashMeta\n\nexport const isHashMeta = zodIsFactory(HashMetaZod)\nexport const asHashMeta = zodAsFactory(HashMetaZod, 'asHashMeta')\nexport const toHashMeta = zodToFactory(HashMetaZod, 'toHashMeta')\n\nexport const SequenceMetaZod = z.object({ _sequence: SequenceFromStringZod })\n\nexport type SequenceMeta = z.infer<typeof SequenceMetaZod>\n\nexport const isSequenceMeta = zodIsFactory(SequenceMetaZod)\nexport const asSequenceMeta = zodAsFactory(SequenceMetaZod, 'asSequenceMeta')\nexport const toSequenceMeta = zodToFactory(SequenceMetaZod, 'toSequenceMeta')\n\nexport const StorageMetaZod = z.object({\n _hash: HashZod,\n _dataHash: HashZod,\n _sequence: SequenceFromStringZod,\n})\n\nexport type StorageMeta = z.infer<typeof StorageMetaZod>\n\nexport type WithStorageMeta<T extends Payload = Payload> = T & StorageMeta\n\nexport const isStorageMeta = zodIsFactory(StorageMetaZod)\nexport const asStorageMeta = zodAsFactory(StorageMetaZod, 'asStorageMeta')\nexport const toStorageMeta = zodToFactory(StorageMetaZod, 'toStorageMeta')\n\nexport const PayloadZod = z.object({ schema: SchemaZod })\n\nexport const isPayload = zodIsFactory(PayloadZod)\nexport const asPayload = zodAsFactory(PayloadZod, 'asPayload')\nexport const toPayload = zodToFactory(PayloadZod, 'toPayload')\n\nexport const AnyPayloadZod = z.looseObject({ schema: SchemaZod })\n\nexport const isAnyPayload = zodIsFactory(AnyPayloadZod)\nexport const asAnyPayload = zodAsFactory(AnyPayloadZod, 'asAnyPayload')\nexport const toAnyPayload = zodToFactory(AnyPayloadZod, 'toAnyPayload')\n\nexport type AnyPayload = z.infer<typeof AnyPayloadZod>\n\nexport function WithStorageMetaZod<T extends z.core.$ZodLooseShape>(valueZod: z.ZodMiniObject<T>) {\n return z.object({ ...valueZod.shape, ...StorageMetaZod.shape })\n}\n\nexport function WithHashMetaZod<T extends z.core.$ZodLooseShape>(valueZod: z.ZodMiniObject<T>) {\n return z.object({ ...valueZod.shape, ...HashMetaZod.shape })\n}\n\nexport const PayloadZodStrict = z.strictObject({ schema: SchemaZod })\nexport type PayloadZodStrict = typeof PayloadZodStrict\n\nexport const PayloadZodLoose: PayloadZodStrict = z.looseObject({ schema: SchemaZod })\nexport type PayloadZodLoose = typeof PayloadZodLoose\n\nexport const PayloadZodOfSchema = <S extends Schema>(schema: S) => z.extend(PayloadZod, { schema: z.literal(schema) })\nexport const PayloadZodStrictOfSchema = <S extends Schema>(schema: S) => z.extend(PayloadZodStrict, { schema: z.literal(schema) })\nexport const PayloadZodLooseOfSchema = <S extends Schema>(schema: S) => z.extend(PayloadZodLoose, { schema: z.literal(schema) })\n", "import type { Brand } from '@xylabs/sdk-js'\nimport { zodAsFactory, zodIsFactory } from '@xylabs/sdk-js'\nimport * as z from 'zod/mini'\n\nexport type BrandedSchema<T extends string = string> = Brand<T, { readonly __schema: true }>\nexport const SchemaRegEx = /^(?:[a-z0-9]+\\.)*[a-z0-9]+$/\n\nexport const SchemaZod = z.pipe(z.string().check(z.regex(SchemaRegEx)), z.transform((v: string): BrandedSchema => v as BrandedSchema))\nexport type Schema<T extends string = string> = z.infer<typeof SchemaZod> & BrandedSchema<T>\n\nexport const makeSchema = <T extends string>(value: T) => {\n return z.pipe(z.literal(value), z.transform((x: T): T & { __schema: true } => x as T & { __schema: true }))\n}\n\nexport const isSchema = zodIsFactory(SchemaZod)\nexport const asSchema = zodAsFactory(SchemaZod, 'asSchema')\nexport const toSchema = zodAsFactory(SchemaZod, 'toSchema')\n\nexport const PayloadSchema = asSchema('network.xyo.payload', true)\nexport const PayloadSchemaZod = z.literal(PayloadSchema)\nexport type PayloadSchema = z.infer<typeof PayloadSchemaZod>\n", "import { AsObjectFactory } from '@xylabs/sdk-js'\n\nimport type { Payload } from '../Payload.ts'\nimport type { Sequence } from './sequence/index.ts'\n\nexport interface SequenceStorageMeta {\n _sequence: Sequence\n}\n\nexport type WithSequenceStorageMeta<T extends Payload = Payload> = T & SequenceStorageMeta\nexport type WithPartialSequenceStorageMeta<T extends Payload = Payload> = Partial<WithSequenceStorageMeta<T>>\n\nexport const isSequenceStorageMeta = (value: unknown): value is SequenceStorageMeta => {\n return (value as WithSequenceStorageMeta)?._sequence != undefined\n}\n\nexport const asSequenceStorageMeta = AsObjectFactory.create(isSequenceStorageMeta)\nexport const asOptionalSequenceStorageMeta = AsObjectFactory.createOptional(isSequenceStorageMeta)\n", "import type { Hash, Hex } from '@xylabs/sdk-js'\nimport {\n assertEx, isAddress, toAddress, toHex, toUint8Array,\n} from '@xylabs/sdk-js'\nimport type { XyoLegacyAddress } from '@xyo-network/address'\n\nimport type {\n Epoch, LocalSequence, Nonce, QualifiedSequence,\n Sequence,\n} from './Sequence.ts'\nimport {\n isQualifiedSequence, isSequence,\n SequenceConstants,\n} from './Sequence.ts'\n\nexport class SequenceParser {\n protected static privateConstructorKey = Date.now().toString()\n\n private readonly data: Readonly<Uint8Array>\n\n protected constructor(privateConstructorKey: string, hex: Hex) {\n assertEx(SequenceParser.privateConstructorKey === privateConstructorKey, () => 'Use create function instead of constructor')\n const paddedHex = toHex(hex, {\n prefix: false,\n bitLength: (hex.length <= SequenceConstants.localSequenceBytes * 2)\n ? SequenceConstants.localSequenceBytes * 8\n : SequenceConstants.qualifiedSequenceBytes * 8,\n })\n this.data = toUint8Array(paddedHex)\n }\n\n get address(): XyoLegacyAddress {\n const start = SequenceConstants.localSequenceBytes\n const end = SequenceConstants.qualifiedSequenceBytes\n return toAddress(this.data.slice(start, end).buffer, { prefix: false })\n }\n\n get epoch(): Epoch {\n const start = 0\n const end = SequenceConstants.epochBytes\n return toHex(this.data.slice(start, end).buffer, { prefix: false }) as Epoch\n }\n\n get localSequence(): LocalSequence {\n const start = 0\n const end = SequenceConstants.localSequenceBytes\n return toHex(this.data.slice(start, end).buffer, { prefix: false }) as LocalSequence\n }\n\n get nonce(): Nonce {\n const start = SequenceConstants.epochBytes\n const end = SequenceConstants.localSequenceBytes\n return toHex(this.data.slice(start, end).buffer, { prefix: false }) as Nonce\n }\n\n get qualifiedSequence(): QualifiedSequence {\n const start = 0\n const end = SequenceConstants.qualifiedSequenceBytes\n return toHex(this.data.slice(start, end).buffer, { prefix: false }) as QualifiedSequence\n }\n\n static from(sequence: Sequence, address?: XyoLegacyAddress): SequenceParser\n static from(timestamp: Hex, hash: Hash, address?: XyoLegacyAddress): SequenceParser\n static from(timestamp: Hex, hash: Hex, address?: XyoLegacyAddress): SequenceParser\n static from(timestamp: Hex, nonce: Nonce, address?: XyoLegacyAddress): SequenceParser\n static from(timestamp: Hex, hash: Hash, index?: number, address?: XyoLegacyAddress): SequenceParser\n static from(timestamp: Hex, hash: Hex, index?: number, address?: XyoLegacyAddress): SequenceParser\n static from(timestamp: Hex, nonce: Nonce, index?: number, address?: XyoLegacyAddress): SequenceParser\n static from(timestamp: number, hash: Hash, address?: XyoLegacyAddress): SequenceParser\n static from(timestamp: number, hash: Hex, address?: XyoLegacyAddress): SequenceParser\n static from(timestamp: number, nonce: Nonce, address?: XyoLegacyAddress): SequenceParser\n static from(timestamp: number, hash: Hash, index?: number, address?: XyoLegacyAddress): SequenceParser\n static from(timestamp: number, hash: Hex, index?: number, address?: XyoLegacyAddress): SequenceParser\n static from(timestamp: number, nonce: Nonce, index?: number, address?: XyoLegacyAddress): SequenceParser\n static from(\n timestampOrSequence: Hex | number,\n nonceOrAddress?: Hex,\n addressOrIndex?: XyoLegacyAddress | number,\n addressOnly?: XyoLegacyAddress,\n ): SequenceParser {\n const address = typeof addressOrIndex === 'number' ? addressOnly : addressOrIndex\n const index = typeof addressOrIndex === 'number' ? addressOrIndex : undefined\n if (isSequence(timestampOrSequence)) {\n if (nonceOrAddress) {\n assertEx(!isQualifiedSequence(timestampOrSequence), () => 'Providing both a qualified sequence and a address is not allowed')\n assertEx(isAddress(nonceOrAddress), () => 'Invalid address provided')\n return new this(SequenceParser.privateConstructorKey, (timestampOrSequence + address) as Hex)\n }\n return new this(SequenceParser.privateConstructorKey, timestampOrSequence)\n }\n const epoch = SequenceParser.toEpoch(timestampOrSequence)\n const nonce = nonceOrAddress === undefined ? undefined : SequenceParser.toNonce(nonceOrAddress, index)\n const addressHex: Hex = address ? toHex(address, { bitLength: SequenceConstants.addressBytes * 8 }) : SequenceConstants.minAddress\n const hexString = (epoch + nonce + addressHex) as Hex\n assertEx(isSequence(hexString), () => `Invalid sequence [${hexString}] [${epoch}, ${nonce}, ${addressHex}]`)\n return new this(SequenceParser.privateConstructorKey, hexString)\n }\n\n static parse(value: Hex | string | ArrayBufferLike): SequenceParser {\n const hex = toHex(value)\n if (isSequence(hex)) {\n return new this(SequenceParser.privateConstructorKey, hex)\n }\n throw new Error(`Invalid sequence [${hex}]`)\n }\n\n // can convert a short number/hex to an epoch (treats it as the whole value) or extract an epoch from a sequence\n static toEpoch(value: number | Hex | Epoch): Epoch {\n assertEx(\n typeof value !== 'number' || Number.isInteger(value),\n () => 'Value must be in integer',\n )\n const hex = toHex(value, { prefix: false })\n if (hex.length <= SequenceConstants.epochBytes * 2) {\n return toHex(value, { prefix: false, bitLength: SequenceConstants.epochBytes * 8 }) as Epoch\n }\n if (isSequence(hex)) {\n return hex.slice(0, SequenceConstants.epochBytes * 2) as Epoch\n }\n throw new Error(`Value could not be converted to epoch [${hex}]`)\n }\n\n // can convert a short number/hex to a nonce (treats it as the whole value) or extract an nonce from a sequence\n static toNonce(value: Hash | Hex, index = 0): Nonce {\n assertEx(\n typeof value !== 'number' || Number.isInteger(value),\n () => 'Value must be in integer',\n )\n const hex = toHex(value, { prefix: false })\n if (isSequence(hex)) {\n return hex.slice(SequenceConstants.epochBytes * 2, SequenceConstants.localSequenceBytes * 2) as Nonce\n }\n const hashHex = toHex(hex, { prefix: false, bitLength: SequenceConstants.nonceHashBytes * 8 }).slice(-SequenceConstants.nonceHashBytes * 2)\n const indexHex = toHex(index, { prefix: false, bitLength: SequenceConstants.nonceIndexBytes * 8 }).slice(-SequenceConstants.nonceIndexBytes * 2)\n return (indexHex + hashHex).slice(-SequenceConstants.nonceBytes * 2) as Nonce\n }\n}\n", "import type { Brand, Hex } from '@xylabs/sdk-js'\nimport { isHex } from '@xylabs/sdk-js'\nimport type { XyoLegacyAddress } from '@xyo-network/address'\n\n// we use Exclude to intentionally make the type not equal to string\nexport type LocalSequence = Brand<Hex, { __localSequence: true }>\nexport type QualifiedSequence = Brand<Hex, { __qualifiedSequence: true }>\nexport type Sequence = LocalSequence | QualifiedSequence\n\nexport type Epoch = Brand<Hex, { __epoch: true }>\n\nexport const isEpoch = (value: unknown): value is Epoch => {\n return isHex(value) && (value as string).length === SequenceConstants.epochBytes * 2\n}\n\nexport type Nonce = Brand<Hex, { __nonce: true }>\n\nexport const isNonce = (value: unknown): value is Nonce => {\n return isHex(value) && (value as string).length === SequenceConstants.nonceBytes * 2\n}\n\nexport const isLocalSequence = (value: unknown): value is LocalSequence => {\n return isHex(value) && (value as string).length === SequenceConstants.localSequenceBytes * 2\n}\n\nexport const isQualifiedSequence = (value: unknown): value is QualifiedSequence => {\n return isHex(value) && (value as string).length === SequenceConstants.qualifiedSequenceBytes * 2\n}\n\nexport const isSequence = (value: unknown): value is Sequence => {\n return isLocalSequence(value) || isQualifiedSequence(value)\n}\n\nexport const SequenceNonceComponentLengths = {\n nonceIndexBytes: 4,\n nonceHashBytes: 4,\n}\n\nexport const SequenceComponentLengths = {\n ...SequenceNonceComponentLengths,\n epochBytes: 8,\n nonceBytes: SequenceNonceComponentLengths.nonceIndexBytes + SequenceNonceComponentLengths.nonceHashBytes,\n addressBytes: 20,\n}\n\nexport const SequenceComponentMinMax = {\n minEpoch: '0'.repeat(SequenceComponentLengths.epochBytes * 2) as Epoch,\n maxEpoch: 'f'.repeat(SequenceComponentLengths.epochBytes * 2) as Epoch,\n minNonce: '0'.repeat(SequenceComponentLengths.nonceBytes * 2) as Nonce,\n maxNonce: 'f'.repeat(SequenceComponentLengths.nonceBytes * 2) as Nonce,\n minAddress: '0'.repeat(SequenceComponentLengths.addressBytes * 2) as XyoLegacyAddress,\n maxAddress: 'f'.repeat(SequenceComponentLengths.addressBytes * 2) as XyoLegacyAddress,\n}\n\nexport const LocalSequenceConstants = {\n ...SequenceComponentLengths,\n ...SequenceComponentMinMax,\n localSequenceBytes: SequenceComponentLengths.epochBytes + SequenceComponentLengths.nonceBytes,\n minLocalSequence: SequenceComponentMinMax.minEpoch + SequenceComponentMinMax.minNonce as LocalSequence,\n maxLocalSequence: SequenceComponentMinMax.maxEpoch + SequenceComponentMinMax.maxNonce as LocalSequence,\n}\n\nexport const QualifiedSequenceConstants = {\n qualifiedSequenceBytes: LocalSequenceConstants.localSequenceBytes + SequenceComponentLengths.addressBytes,\n minQualifiedSequence: LocalSequenceConstants.minLocalSequence + SequenceComponentMinMax.minAddress as QualifiedSequence,\n maxQualifiedSequence: LocalSequenceConstants.maxLocalSequence + SequenceComponentMinMax.maxAddress as QualifiedSequence,\n}\n\nexport const SequenceConstants = {\n ...LocalSequenceConstants,\n ...QualifiedSequenceConstants,\n}\n\n// \"11111111111111112222222222222222\" is and example of a local sequence string\n\n// \"111111111111111122222222222222223333333333333333333333333333333333333333\" is and example of a local sequence string\n// epoch = \"1111111111111111\"\n// nonce = \"2222222222222222\"\n// address = \"3333333333333333333333333333333333333333\"\n", "import type { Compare } from '@xylabs/sdk-js'\n\nimport { SequenceParser } from './Parser.ts'\nimport type { Sequence } from './Sequence.ts'\n\nconst local: Compare<Sequence> = (a, b) => {\n const aa = SequenceParser.from(a)\n const bb = SequenceParser.from(b)\n return aa.localSequence > bb.localSequence ? 1 : aa.localSequence < bb.localSequence ? -1 : 0\n}\n\nconst qualified: Compare<Sequence> = (a, b) => {\n const aa = SequenceParser.from(a)\n const bb = SequenceParser.from(b)\n return aa.qualifiedSequence > bb.qualifiedSequence ? 1 : aa.qualifiedSequence < bb.qualifiedSequence ? -1 : 0\n}\n\nexport const SequenceComparer = { local, qualified }\n", "import { HexRegExMinMax, toHex } from '@xylabs/sdk-js'\nimport * as z from 'zod/mini'\n\nimport type { LocalSequence, QualifiedSequence } from './Sequence.ts'\nimport { SequenceConstants } from './Sequence.ts'\n\nconst LocalSequenceRegex = new RegExp(HexRegExMinMax(SequenceConstants.localSequenceBytes, SequenceConstants.localSequenceBytes))\nexport const LocalSequenceToStringZod = z.string().check(z.regex(LocalSequenceRegex))\nexport const LocalSequenceFromStringZod = z.pipe(\n z.string().check(z.regex(LocalSequenceRegex)),\n z.transform((v: string): LocalSequence => toHex(v) as LocalSequence),\n)\n\nconst QualifiedSequenceRegex = new RegExp(HexRegExMinMax(SequenceConstants.qualifiedSequenceBytes, SequenceConstants.qualifiedSequenceBytes))\nexport const QualifiedSequenceToStringZod = z.string().check(z.regex(QualifiedSequenceRegex))\nexport const QualifiedSequenceFromStringZod = z.pipe(\n z.string().check(z.regex(QualifiedSequenceRegex)),\n z.transform((v: string): QualifiedSequence => toHex(v) as QualifiedSequence),\n)\n\nexport const SequenceToStringZod = z.union([LocalSequenceToStringZod, QualifiedSequenceToStringZod])\nexport const SequenceFromStringZod = z.union([LocalSequenceFromStringZod, QualifiedSequenceFromStringZod])\n", "import type { Payload, WithSources } from './Payload.ts'\nimport { isAnyPayload } from './PayloadZod.ts'\n\nexport function isPayloadOfSchemaType<T extends Payload = never>(schema: T['schema']) {\n return (x?: unknown): x is T => isAnyPayload(x) && x?.schema === schema\n}\n\nexport const isPayloadOfSchemaTypeWithSources = <T extends Payload = never>(schema: T['schema']) => {\n return (x?: unknown): x is WithSources<T> =>\n isPayloadOfSchemaType<WithSources<T>>(schema)(x) && x.$sources != undefined && Array.isArray(x.$sources)\n}\n\nexport const notPayloadOfSchemaType = <T extends Payload = never>(schema: T['schema']) => {\n return (x?: unknown): x is T => !isAnyPayload(x) || x?.schema !== schema\n}\n\n// test types -- keep for future validation, but comment out\n\n/*\ntype TestSchema = 'network.xyo.test'\nconst TestSchema: TestSchema = 'network.xyo.test'\n\ntype Test = Payload<{ field: string }, TestSchema>\n\nconst testPayload: Test = { field: 'test', schema: TestSchema }\n\nconst testPayloads: Payload[] = [testPayload]\n\nconst isTest: Test[] = testPayloads.filter(isPayloadOfSchemaType<Payload>(TestSchema))\n\nconst isTestFromMetaTyped = testMetaPayloads.filter(isPayloadOfSchemaType<Test>(TestSchema))\n*/\n", "import type { Hash, JsonValue } from '@xylabs/sdk-js'\n\nimport { isPayloadOfSchemaType } from './isPayloadOfSchemaType.ts'\nimport type { Payload } from './Payload.ts'\nimport { asSchema, type Schema } from './Schema.ts'\n\nexport const ModuleErrorSchema = asSchema('network.xyo.error.module', true)\nexport type ModuleErrorSchema = typeof ModuleErrorSchema\n\nexport type ModuleError = Payload<{\n details?: JsonValue\n message?: string\n name?: string\n query?: Hash | Schema\n}, ModuleErrorSchema>\n\nexport const isModuleError = isPayloadOfSchemaType<ModuleError>(ModuleErrorSchema)\n", "import { isDefined } from '@xylabs/sdk-js'\nimport * as z from 'zod/mini'\n\nimport type { Payload } from './Payload.ts'\nimport { isAnyPayload } from './PayloadZod.ts'\n\n/**\n * Checks if a value is a payload of a specific Zod type.\n * @param zodSchema The Zod schema to validate against\n * @param schema The schema string to match against the payload. Optional in\n * case you want to validate any payload matching the Zod schema or in case\n * schema is part of the Zod schema.\n * @returns A function that checks if a value is a payload of the specified Zod type\n */\nexport function isPayloadOfZodType<\n T extends Payload = never,\n S extends z.core.$ZodObject = z.core.$ZodObject,\n>(zodSchema: S, schema?: T['schema']) {\n return (x?: unknown): x is T => {\n if (!isAnyPayload(x)) return false\n if (isDefined(schema) && x.schema !== schema) return false\n const { schema: _, ...data } = x\n return z.safeParse(zodSchema, data).success\n }\n}\n", "import {\n HashZod,\n zodAsFactory, zodIsFactory, zodToFactory,\n} from '@xylabs/sdk-js'\nimport * as z from 'zod/mini'\n\nimport { PayloadZodLoose, PayloadZodOfSchema } from './PayloadZod.ts'\nimport { asSchema } from './Schema.ts'\n\n// payload that wraps a complete boundwitness with its payloads for use in systems such as submission queues\nexport const PayloadBundleSchema = asSchema('network.xyo.payload.bundle', true)\nexport type PayloadBundleSchema = typeof PayloadBundleSchema\n\nexport const PayloadBundleFieldsZod = z.object({\n payloads: z.array(PayloadZodLoose),\n root: HashZod,\n})\n\nexport type PayloadBundleFields = z.infer<typeof PayloadBundleFieldsZod>\n\nexport const PayloadBundleZod = z.extend(PayloadZodOfSchema(PayloadBundleSchema), PayloadBundleFieldsZod.shape)\n\nexport type PayloadBundle = z.infer<typeof PayloadBundleZod>\n\nexport const isPayloadBundle = zodIsFactory(PayloadBundleZod)\nexport const asPayloadBundle = zodAsFactory(PayloadBundleZod, 'asPayloadBundle')\nexport const asOptionalPayloadBundle = zodToFactory(PayloadBundleZod, 'asPayloadBundle')\n", "import { asSchema } from '../Schema.ts'\n\nexport const PayloadSetSchema = asSchema('network.xyo.payload.set', true)\nexport type PayloadSetSchema = typeof PayloadSetSchema\n"],
5
- "mappings": ";AAAA;AAAA,EACE;AAAA,EACA,gBAAAA;AAAA,EAAc,gBAAAC;AAAA,EAAc;AAAA,OACvB;AACP,YAAYC,QAAO;;;ACHnB,SAAS,cAAc,oBAAoB;AAC3C,YAAY,OAAO;AAGZ,IAAM,cAAc;AAEpB,IAAM,YAAc,OAAO,SAAO,EAAE,MAAQ,QAAM,WAAW,CAAC,GAAK,YAAU,CAAC,MAA6B,CAAkB,CAAC;AAG9H,IAAM,aAAa,CAAmB,UAAa;AACxD,SAAS,OAAO,UAAQ,KAAK,GAAK,YAAU,CAAC,MAAiC,CAA2B,CAAC;AAC5G;AAEO,IAAM,WAAW,aAAa,SAAS;AACvC,IAAM,WAAW,aAAa,WAAW,UAAU;AACnD,IAAM,WAAW,aAAa,WAAW,UAAU;AAEnD,IAAM,gBAAgB,SAAS,uBAAuB,IAAI;AAC1D,IAAM,mBAAqB,UAAQ,aAAa;;;ACnBvD,SAAS,uBAAuB;AAYzB,IAAM,wBAAwB,CAAC,UAAiD;AACrF,SAAQ,OAAmC,aAAa;AAC1D;AAEO,IAAM,wBAAwB,gBAAgB,OAAO,qBAAqB;AAC1E,IAAM,gCAAgC,gBAAgB,eAAe,qBAAqB;;;AChBjG;AAAA,EACE;AAAA,EAAU;AAAA,EAAW;AAAA,EAAW;AAAA,EAAO;AAAA,OAClC;;;ACFP,SAAS,aAAa;AAUf,IAAM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z", "toHex", "zodIsFactory", "zodAsFactory", "z", "HashZod", "zodAsFactory", "zodIsFactory", "zodToFactory", "z", "HashZod", "zodIsFactory", "zodAsFactory", "zodToFactory"]
3
+ "sources": ["../../src/Error.ts", "../../src/PayloadZod.ts", "../../src/Schema.ts", "../../src/StorageMeta/Sequence.ts", "../../src/StorageMeta/sequence/Parser.ts", "../../src/StorageMeta/sequence/Sequence.ts", "../../src/StorageMeta/sequence/Comparer.ts", "../../src/StorageMeta/sequence/SequenceZod.ts", "../../src/isPayloadOfSchemaType.ts", "../../src/isPayloadOfZodType.ts", "../../src/PayloadBundle.ts", "../../src/PayloadSet/PayloadSetPayload.ts", "../../src/PayloadSet/PayloadSetSchema.ts", "../../src/Query.ts"],
4
+ "sourcesContent": ["import type { JsonValue } from '@xylabs/sdk-js'\nimport {\n HashZod, zodAsFactory, zodIsFactory, zodToFactory,\n} from '@xylabs/sdk-js'\nimport * as z from 'zod/mini'\n\nimport { PayloadZodOfSchema } from './PayloadZod.ts'\nimport { asSchema, SchemaZod } from './Schema.ts'\n\nexport const ModuleErrorSchema = asSchema('network.xyo.error.module', true)\nexport type ModuleErrorSchema = typeof ModuleErrorSchema\n\nexport const ModuleErrorZod = z.extend(PayloadZodOfSchema(ModuleErrorSchema), {\n details: z.optional(z.custom<JsonValue>()),\n message: z.optional(z.string()),\n name: z.optional(z.string()),\n query: z.optional(z.union([HashZod, SchemaZod])),\n})\n\nexport type ModuleError = z.infer<typeof ModuleErrorZod>\n\nexport const isModuleError = zodIsFactory(ModuleErrorZod)\nexport const asModuleError = zodAsFactory(ModuleErrorZod, 'asModuleError')\nexport const toModuleError = zodToFactory(ModuleErrorZod, 'toModuleError')\n", "import {\n HashZod,\n zodAsFactory, zodIsFactory, zodToFactory,\n} from '@xylabs/sdk-js'\nimport * as z from 'zod/mini'\n\nimport type { Payload } from './Payload.ts'\nimport type { Schema } from './Schema.ts'\nimport { SchemaZod } from './Schema.ts'\nimport { SequenceFromStringZod } from './StorageMeta/index.ts'\n\nexport const HashMetaZod = z.object({\n _hash: HashZod,\n _dataHash: HashZod,\n})\n\nexport type HashMeta = z.infer<typeof HashMetaZod>\n\nexport type WithHashMeta<T extends Payload> = T & HashMeta\n\nexport const isHashMeta = zodIsFactory(HashMetaZod)\nexport const asHashMeta = zodAsFactory(HashMetaZod, 'asHashMeta')\nexport const toHashMeta = zodToFactory(HashMetaZod, 'toHashMeta')\n\nexport const SequenceMetaZod = z.object({ _sequence: SequenceFromStringZod })\n\nexport type SequenceMeta = z.infer<typeof SequenceMetaZod>\n\nexport const isSequenceMeta = zodIsFactory(SequenceMetaZod)\nexport const asSequenceMeta = zodAsFactory(SequenceMetaZod, 'asSequenceMeta')\nexport const toSequenceMeta = zodToFactory(SequenceMetaZod, 'toSequenceMeta')\n\nexport const StorageMetaZod = z.object({\n _hash: HashZod,\n _dataHash: HashZod,\n _sequence: SequenceFromStringZod,\n})\n\nexport type StorageMeta = z.infer<typeof StorageMetaZod>\n\nexport type WithStorageMeta<T extends Payload = Payload> = T & StorageMeta\n\nexport const isStorageMeta = zodIsFactory(StorageMetaZod)\nexport const asStorageMeta = zodAsFactory(StorageMetaZod, 'asStorageMeta')\nexport const toStorageMeta = zodToFactory(StorageMetaZod, 'toStorageMeta')\n\nexport const PayloadZod = z.object({ schema: SchemaZod })\n\nexport const isPayload = zodIsFactory(PayloadZod)\nexport const asPayload = zodAsFactory(PayloadZod, 'asPayload')\nexport const toPayload = zodToFactory(PayloadZod, 'toPayload')\n\nexport const AnyPayloadZod = z.looseObject({ schema: SchemaZod })\n\nexport const isAnyPayload = zodIsFactory(AnyPayloadZod)\nexport const asAnyPayload = zodAsFactory(AnyPayloadZod, 'asAnyPayload')\nexport const toAnyPayload = zodToFactory(AnyPayloadZod, 'toAnyPayload')\n\nexport type AnyPayload = z.infer<typeof AnyPayloadZod>\n\nexport function WithStorageMetaZod<T extends z.core.$ZodLooseShape>(valueZod: z.ZodMiniObject<T>) {\n return z.object({ ...valueZod.shape, ...StorageMetaZod.shape })\n}\n\nexport function WithHashMetaZod<T extends z.core.$ZodLooseShape>(valueZod: z.ZodMiniObject<T>) {\n return z.object({ ...valueZod.shape, ...HashMetaZod.shape })\n}\n\nexport const PayloadZodStrict = z.strictObject({ schema: SchemaZod })\nexport type PayloadZodStrict = typeof PayloadZodStrict\n\nexport const PayloadZodLoose: PayloadZodStrict = z.looseObject({ schema: SchemaZod })\nexport type PayloadZodLoose = typeof PayloadZodLoose\n\nexport const WithHashMetaPayloadZodLoose = z.extend(PayloadZodLoose, HashMetaZod.shape)\nexport type WithHashMetaPayloadZodLoose = typeof WithHashMetaPayloadZodLoose\n\nexport const PayloadZodOfSchema = <S extends Schema>(schema: S) => z.extend(PayloadZod, { schema: z.literal(schema) })\nexport const PayloadZodStrictOfSchema = <S extends Schema>(schema: S) => z.extend(PayloadZodStrict, { schema: z.literal(schema) })\nexport const PayloadZodLooseOfSchema = <S extends Schema>(schema: S) => z.extend(PayloadZodLoose, { schema: z.literal(schema) })\n", "import type { Brand } from '@xylabs/sdk-js'\nimport { zodAsFactory, zodIsFactory } from '@xylabs/sdk-js'\nimport * as z from 'zod/mini'\n\nexport type BrandedSchema<T extends string = string> = Brand<T, { readonly __schema: true }>\nexport const SchemaRegEx = /^(?:[a-z0-9]+\\.)*[a-z0-9]+$/\n\nexport const SchemaZod = z.pipe(z.string().check(z.regex(SchemaRegEx)), z.transform((v: string): BrandedSchema => v as BrandedSchema))\nexport type Schema<T extends string = string> = z.infer<typeof SchemaZod> & BrandedSchema<T>\n\nexport const makeSchema = <T extends string>(value: T) => {\n return z.pipe(z.literal(value), z.transform((x: T): T & { __schema: true } => x as T & { __schema: true }))\n}\n\nexport const isSchema = zodIsFactory(SchemaZod)\nexport const asSchema = zodAsFactory(SchemaZod, 'asSchema')\nexport const toSchema = zodAsFactory(SchemaZod, 'toSchema')\n\nexport const PayloadSchema = asSchema('network.xyo.payload', true)\nexport const PayloadSchemaZod = z.literal(PayloadSchema)\nexport type PayloadSchema = z.infer<typeof PayloadSchemaZod>\n", "import { AsObjectFactory } from '@xylabs/sdk-js'\n\nimport type { Payload } from '../Payload.ts'\nimport type { Sequence } from './sequence/index.ts'\n\nexport interface SequenceStorageMeta {\n _sequence: Sequence\n}\n\nexport type WithSequenceStorageMeta<T extends Payload = Payload> = T & SequenceStorageMeta\nexport type WithPartialSequenceStorageMeta<T extends Payload = Payload> = Partial<WithSequenceStorageMeta<T>>\n\nexport const isSequenceStorageMeta = (value: unknown): value is SequenceStorageMeta => {\n return (value as WithSequenceStorageMeta)?._sequence != undefined\n}\n\nexport const asSequenceStorageMeta = AsObjectFactory.create(isSequenceStorageMeta)\nexport const asOptionalSequenceStorageMeta = AsObjectFactory.createOptional(isSequenceStorageMeta)\n", "import type { Hash, Hex } from '@xylabs/sdk-js'\nimport {\n assertEx, isAddress, toAddress, toHex, toUint8Array,\n} from '@xylabs/sdk-js'\nimport type { XyoLegacyAddress } from '@xyo-network/address'\n\nimport type {\n Epoch, LocalSequence, Nonce, QualifiedSequence,\n Sequence,\n} from './Sequence.ts'\nimport {\n isQualifiedSequence, isSequence,\n SequenceConstants,\n} from './Sequence.ts'\n\nexport class SequenceParser {\n protected static privateConstructorKey = Date.now().toString()\n\n private readonly data: Readonly<Uint8Array>\n\n protected constructor(privateConstructorKey: string, hex: Hex) {\n assertEx(SequenceParser.privateConstructorKey === privateConstructorKey, () => 'Use create function instead of constructor')\n const paddedHex = toHex(hex, {\n prefix: false,\n bitLength: SequenceConstants[hex.length <= SequenceConstants.localSequenceBytes * 2 ? 'localSequenceBytes' : 'qualifiedSequenceBytes'] * 8,\n })\n this.data = toUint8Array(paddedHex)\n }\n\n static from(sequence: Sequence, address?: XyoLegacyAddress): SequenceParser\n static from(timestamp: Hex, hash: Hash, address?: XyoLegacyAddress): SequenceParser\n static from(timestamp: Hex, hash: Hex, address?: XyoLegacyAddress): SequenceParser\n static from(timestamp: Hex, nonce: Nonce, address?: XyoLegacyAddress): SequenceParser\n static from(timestamp: Hex, hash: Hash, index?: number, address?: XyoLegacyAddress): SequenceParser\n static from(timestamp: Hex, hash: Hex, index?: number, address?: XyoLegacyAddress): SequenceParser\n static from(timestamp: Hex, nonce: Nonce, index?: number, address?: XyoLegacyAddress): SequenceParser\n static from(timestamp: number, hash: Hash, address?: XyoLegacyAddress): SequenceParser\n static from(timestamp: number, hash: Hex, address?: XyoLegacyAddress): SequenceParser\n static from(timestamp: number, nonce: Nonce, address?: XyoLegacyAddress): SequenceParser\n static from(timestamp: number, hash: Hash, index?: number, address?: XyoLegacyAddress): SequenceParser\n static from(timestamp: number, hash: Hex, index?: number, address?: XyoLegacyAddress): SequenceParser\n static from(timestamp: number, nonce: Nonce, index?: number, address?: XyoLegacyAddress): SequenceParser\n static from(\n timestampOrSequence: Hex | number,\n nonceOrAddress?: Hex,\n addressOrIndex?: XyoLegacyAddress | number,\n addressOnly?: XyoLegacyAddress,\n ): SequenceParser {\n if (isSequence(timestampOrSequence)) {\n if (nonceOrAddress) {\n assertEx(!isQualifiedSequence(timestampOrSequence), () => 'Providing both a qualified sequence and a address is not allowed')\n assertEx(isAddress(nonceOrAddress), () => 'Invalid address provided')\n const combined = (timestampOrSequence + nonceOrAddress) as Hex\n return this.create(combined)\n }\n return this.create(timestampOrSequence)\n }\n const address = typeof addressOrIndex === 'number' ? addressOnly : addressOrIndex\n const index = typeof addressOrIndex === 'number' ? addressOrIndex : undefined\n const epoch = this.toEpoch(timestampOrSequence)\n const nonce = nonceOrAddress === undefined ? undefined : this.toNonce(nonceOrAddress, index)\n const addressHex: Hex = address ? toHex(address, { bitLength: SequenceConstants.addressBytes * 8 }) : SequenceConstants.minAddress\n const hexString = (epoch + nonce + addressHex) as Hex\n assertEx(isSequence(hexString), () => `Invalid sequence [${hexString}] [${epoch}, ${nonce}, ${addressHex}]`)\n return this.create(hexString)\n }\n\n static parse(value: Hex | string | ArrayBufferLike): SequenceParser {\n const hex = toHex(value)\n if (isSequence(hex)) {\n return this.create(hex)\n }\n throw new Error(`Invalid sequence [${hex}]`)\n }\n\n // can convert a short number/hex to an epoch (treats it as the whole value) or extract an epoch from a sequence\n static toEpoch(value: number | Hex | Epoch): Epoch {\n assertEx(\n typeof value !== 'number' || Number.isSafeInteger(value),\n () => 'Value must be in integer',\n )\n const hex = toHex(value, { prefix: false })\n if (hex.length <= SequenceConstants.epochBytes * 2) {\n return toHex(value, { prefix: false, bitLength: SequenceConstants.epochBytes * 8 }) as Epoch\n }\n if (isSequence(hex)) {\n return hex.slice(0, SequenceConstants.epochBytes * 2) as Epoch\n }\n throw new Error(`Value could not be converted to epoch [${hex}]`)\n }\n\n // can convert a short number/hex to a nonce (treats it as the whole value) or extract an nonce from a sequence\n static toNonce(value: Hash | Hex, index = 0): Nonce {\n assertEx(\n typeof value !== 'number' || Number.isSafeInteger(value),\n () => 'Value must be in integer',\n )\n const hex = toHex(value, { prefix: false })\n if (isSequence(hex)) {\n return hex.slice(SequenceConstants.epochBytes * 2, SequenceConstants.localSequenceBytes * 2) as Nonce\n }\n const hashHex = toHex(hex, { prefix: false, bitLength: SequenceConstants.nonceHashBytes * 8 }).slice(-SequenceConstants.nonceHashBytes * 2)\n const indexHex = toHex(index, { prefix: false, bitLength: SequenceConstants.nonceIndexBytes * 8 }).slice(-SequenceConstants.nonceIndexBytes * 2)\n return (indexHex + hashHex).slice(-SequenceConstants.nonceBytes * 2) as Nonce\n }\n\n private static create(hex: Hex): SequenceParser {\n // `new this()` is not a readable constructor per unicorn/no-unreadable-new-expression\n return new SequenceParser(this.privateConstructorKey, hex)\n }\n\n get address(): XyoLegacyAddress {\n const start = SequenceConstants.localSequenceBytes\n const end = SequenceConstants.qualifiedSequenceBytes\n return toAddress(this.data.slice(start, end).buffer, { prefix: false })\n }\n\n get epoch(): Epoch {\n const start = 0\n const end = SequenceConstants.epochBytes\n return toHex(this.data.slice(start, end).buffer, { prefix: false }) as Epoch\n }\n\n get localSequence(): LocalSequence {\n const start = 0\n const end = SequenceConstants.localSequenceBytes\n return toHex(this.data.slice(start, end).buffer, { prefix: false }) as LocalSequence\n }\n\n get nonce(): Nonce {\n const start = SequenceConstants.epochBytes\n const end = SequenceConstants.localSequenceBytes\n return toHex(this.data.slice(start, end).buffer, { prefix: false }) as Nonce\n }\n\n get qualifiedSequence(): QualifiedSequence {\n const start = 0\n const end = SequenceConstants.qualifiedSequenceBytes\n return toHex(this.data.slice(start, end).buffer, { prefix: false }) as QualifiedSequence\n }\n}\n", "import type { Brand, Hex } from '@xylabs/sdk-js'\nimport { isHex } from '@xylabs/sdk-js'\nimport type { XyoLegacyAddress } from '@xyo-network/address'\n\n// we use Exclude to intentionally make the type not equal to string\nexport type LocalSequence = Brand<Hex, { __localSequence: true }>\nexport type QualifiedSequence = Brand<Hex, { __qualifiedSequence: true }>\nexport type Sequence = LocalSequence | QualifiedSequence\n\nexport type Epoch = Brand<Hex, { __epoch: true }>\n\nexport const isEpoch = (value: unknown): value is Epoch => {\n return isHex(value) && (value as string).length === SequenceConstants.epochBytes * 2\n}\n\nexport type Nonce = Brand<Hex, { __nonce: true }>\n\nexport const isNonce = (value: unknown): value is Nonce => {\n return isHex(value) && (value as string).length === SequenceConstants.nonceBytes * 2\n}\n\nexport const isLocalSequence = (value: unknown): value is LocalSequence => {\n return isHex(value) && (value as string).length === SequenceConstants.localSequenceBytes * 2\n}\n\nexport const isQualifiedSequence = (value: unknown): value is QualifiedSequence => {\n return isHex(value) && (value as string).length === SequenceConstants.qualifiedSequenceBytes * 2\n}\n\nexport const isSequence = (value: unknown): value is Sequence => {\n return isLocalSequence(value) || isQualifiedSequence(value)\n}\n\nexport const SequenceNonceComponentLengths = {\n nonceIndexBytes: 4,\n nonceHashBytes: 4,\n}\n\nexport const SequenceComponentLengths = {\n ...SequenceNonceComponentLengths,\n epochBytes: 8,\n nonceBytes: SequenceNonceComponentLengths.nonceIndexBytes + SequenceNonceComponentLengths.nonceHashBytes,\n addressBytes: 20,\n}\n\nexport const SequenceComponentMinMax = {\n minEpoch: '0'.repeat(SequenceComponentLengths.epochBytes * 2) as Epoch,\n maxEpoch: 'f'.repeat(SequenceComponentLengths.epochBytes * 2) as Epoch,\n minNonce: '0'.repeat(SequenceComponentLengths.nonceBytes * 2) as Nonce,\n maxNonce: 'f'.repeat(SequenceComponentLengths.nonceBytes * 2) as Nonce,\n minAddress: '0'.repeat(SequenceComponentLengths.addressBytes * 2) as XyoLegacyAddress,\n maxAddress: 'f'.repeat(SequenceComponentLengths.addressBytes * 2) as XyoLegacyAddress,\n}\n\nexport const LocalSequenceConstants = {\n ...SequenceComponentLengths,\n ...SequenceComponentMinMax,\n localSequenceBytes: SequenceComponentLengths.epochBytes + SequenceComponentLengths.nonceBytes,\n minLocalSequence: SequenceComponentMinMax.minEpoch + SequenceComponentMinMax.minNonce as LocalSequence,\n maxLocalSequence: SequenceComponentMinMax.maxEpoch + SequenceComponentMinMax.maxNonce as LocalSequence,\n}\n\nexport const QualifiedSequenceConstants = {\n qualifiedSequenceBytes: LocalSequenceConstants.localSequenceBytes + SequenceComponentLengths.addressBytes,\n minQualifiedSequence: LocalSequenceConstants.minLocalSequence + SequenceComponentMinMax.minAddress as QualifiedSequence,\n maxQualifiedSequence: LocalSequenceConstants.maxLocalSequence + SequenceComponentMinMax.maxAddress as QualifiedSequence,\n}\n\nexport const SequenceConstants = {\n ...LocalSequenceConstants,\n ...QualifiedSequenceConstants,\n}\n\n// \"11111111111111112222222222222222\" is and example of a local sequence string\n\n// \"111111111111111122222222222222223333333333333333333333333333333333333333\" is and example of a local sequence string\n// epoch = \"1111111111111111\"\n// nonce = \"2222222222222222\"\n// address = \"3333333333333333333333333333333333333333\"\n", "import type { Compare } from '@xylabs/sdk-js'\n\nimport { SequenceParser } from './Parser.ts'\nimport type { Sequence } from './Sequence.ts'\n\nconst local: Compare<Sequence> = (a, b) => {\n const aa = SequenceParser.from(a)\n const bb = SequenceParser.from(b)\n return aa.localSequence > bb.localSequence ? 1 : aa.localSequence < bb.localSequence ? -1 : 0\n}\n\nconst qualified: Compare<Sequence> = (a, b) => {\n const aa = SequenceParser.from(a)\n const bb = SequenceParser.from(b)\n return aa.qualifiedSequence > bb.qualifiedSequence ? 1 : aa.qualifiedSequence < bb.qualifiedSequence ? -1 : 0\n}\n\nexport const SequenceComparer = { local, qualified }\n", "import { HexRegExMinMax, toHex } from '@xylabs/sdk-js'\nimport * as z from 'zod/mini'\n\nimport type { LocalSequence, QualifiedSequence } from './Sequence.ts'\nimport { SequenceConstants } from './Sequence.ts'\n\nconst LocalSequenceRegex = new RegExp(HexRegExMinMax(SequenceConstants.localSequenceBytes, SequenceConstants.localSequenceBytes))\nexport const LocalSequenceToStringZod = z.string().check(z.regex(LocalSequenceRegex))\nexport const LocalSequenceFromStringZod = z.pipe(\n z.string().check(z.regex(LocalSequenceRegex)),\n z.transform((v: string): LocalSequence => toHex(v) as LocalSequence),\n)\n\nconst QualifiedSequenceRegex = new RegExp(HexRegExMinMax(SequenceConstants.qualifiedSequenceBytes, SequenceConstants.qualifiedSequenceBytes))\nexport const QualifiedSequenceToStringZod = z.string().check(z.regex(QualifiedSequenceRegex))\nexport const QualifiedSequenceFromStringZod = z.pipe(\n z.string().check(z.regex(QualifiedSequenceRegex)),\n z.transform((v: string): QualifiedSequence => toHex(v) as QualifiedSequence),\n)\n\nexport const SequenceToStringZod = z.union([LocalSequenceToStringZod, QualifiedSequenceToStringZod])\nexport const SequenceFromStringZod = z.union([LocalSequenceFromStringZod, QualifiedSequenceFromStringZod])\n", "import type { Payload, WithSources } from './Payload.ts'\nimport { isAnyPayload } from './PayloadZod.ts'\n\nexport function isPayloadOfSchemaType<T extends Payload = never>(schema: T['schema']) {\n return (x?: unknown): x is T => isAnyPayload(x) && x?.schema === schema\n}\n\nexport const isPayloadOfSchemaTypeWithSources = <T extends Payload = never>(schema: T['schema']) => {\n return (x?: unknown): x is WithSources<T> =>\n isPayloadOfSchemaType<WithSources<T>>(schema)(x) && x.$sources != undefined && Array.isArray(x.$sources)\n}\n\nexport const notPayloadOfSchemaType = <T extends Payload = never>(schema: T['schema']) => {\n return (x?: unknown): x is T => !isAnyPayload(x) || x?.schema !== schema\n}\n\n// test types -- keep for future validation, but comment out\n\n/*\ntype TestSchema = 'network.xyo.test'\nconst TestSchema: TestSchema = 'network.xyo.test'\n\ntype Test = Payload<{ field: string }, TestSchema>\n\nconst testPayload: Test = { field: 'test', schema: TestSchema }\n\nconst testPayloads: Payload[] = [testPayload]\n\nconst isTest: Test[] = testPayloads.filter(isPayloadOfSchemaType<Payload>(TestSchema))\n\nconst isTestFromMetaTyped = testMetaPayloads.filter(isPayloadOfSchemaType<Test>(TestSchema))\n*/\n", "import { isDefined } from '@xylabs/sdk-js'\nimport * as z from 'zod/mini'\n\nimport type { Payload } from './Payload.ts'\nimport { isAnyPayload } from './PayloadZod.ts'\n\n/**\n * Checks if a value is a payload of a specific Zod type.\n * @param zodSchema The Zod schema to validate against\n * @param schema The schema string to match against the payload. Optional in\n * case you want to validate any payload matching the Zod schema or in case\n * schema is part of the Zod schema.\n * @returns A function that checks if a value is a payload of the specified Zod type\n */\nexport function isPayloadOfZodType<\n T extends Payload = never,\n S extends z.core.$ZodObject = z.core.$ZodObject,\n>(zodSchema: S, schema?: T['schema']) {\n return (x?: unknown): x is T => {\n if (!isAnyPayload(x)) return false\n if (isDefined(schema) && x.schema !== schema) return false\n const { schema: _, ...data } = x\n return z.safeParse(zodSchema, data).success\n }\n}\n", "import {\n HashZod,\n zodAsFactory, zodIsFactory, zodToFactory,\n} from '@xylabs/sdk-js'\nimport * as z from 'zod/mini'\n\nimport { PayloadZodLoose, PayloadZodOfSchema } from './PayloadZod.ts'\nimport { asSchema } from './Schema.ts'\n\n// payload that wraps a complete boundwitness with its payloads for use in systems such as submission queues\nexport const PayloadBundleSchema = asSchema('network.xyo.payload.bundle', true)\nexport type PayloadBundleSchema = typeof PayloadBundleSchema\n\nexport const PayloadBundleFieldsZod = z.object({\n payloads: z.array(PayloadZodLoose),\n root: HashZod,\n})\n\nexport type PayloadBundleFields = z.infer<typeof PayloadBundleFieldsZod>\n\nexport const PayloadBundleZod = z.extend(PayloadZodOfSchema(PayloadBundleSchema), PayloadBundleFieldsZod.shape)\n\nexport type PayloadBundle = z.infer<typeof PayloadBundleZod>\n\nexport const isPayloadBundle = zodIsFactory(PayloadBundleZod)\nexport const asPayloadBundle = zodAsFactory(PayloadBundleZod, 'asPayloadBundle')\nexport const asOptionalPayloadBundle = zodToFactory(PayloadBundleZod, 'asPayloadBundle')\n", "import {\n zodAsFactory, zodIsFactory, zodToFactory,\n} from '@xylabs/sdk-js'\nimport * as z from 'zod/mini'\n\nimport { PayloadZodOfSchema } from '../PayloadZod.ts'\nimport { PayloadSetSchema } from './PayloadSetSchema.ts'\n\nconst stringNumberRecordZod = z.record(z.string(), z.number())\n\nexport const PayloadSetZod = z.object({\n optional: z.optional(stringNumberRecordZod),\n required: z.optional(stringNumberRecordZod),\n})\n\nexport type PayloadSet = z.infer<typeof PayloadSetZod>\n\nexport const PayloadSetPayloadZod = z.extend(PayloadZodOfSchema(PayloadSetSchema), PayloadSetZod.shape)\n\nexport type PayloadSetPayload = z.infer<typeof PayloadSetPayloadZod>\n\nexport const isPayloadSetPayload = zodIsFactory(PayloadSetPayloadZod)\nexport const asPayloadSetPayload = zodAsFactory(PayloadSetPayloadZod, 'asPayloadSetPayload')\nexport const toPayloadSetPayload = zodToFactory(PayloadSetPayloadZod, 'toPayloadSetPayload')\n", "import { asSchema } from '../Schema.ts'\n\nexport const PayloadSetSchema = asSchema('network.xyo.payload.set', true)\nexport type PayloadSetSchema = typeof PayloadSetSchema\n", "import type { EmptyObject } from '@xylabs/sdk-js'\nimport { XyoAddressZod } from '@xyo-network/address'\nimport * as z from 'zod/mini'\n\nimport type { Payload, SchemaField } from './Payload.ts'\nimport type { Schema } from './Schema.ts'\n\nconst queryAddressZod = z.union([XyoAddressZod, z.array(XyoAddressZod)])\nconst maxFrequencyZod = z.union([\n z.literal('once'),\n z.literal('second'),\n z.literal('minute'),\n z.literal('hour'),\n z.literal('day'),\n z.literal('week'),\n z.literal('month'),\n z.literal('year'),\n])\n\nexport const QueryFieldsZod = z.object({\n /** @field The addresses of the intended handlers */\n address: z.optional(queryAddressZod),\n /** @field The maximum XYO that can be spent executing the query */\n budget: z.optional(z.number()),\n /** @field The frequency on which this query can be rerun */\n maxFrequency: z.optional(maxFrequencyZod),\n /** @field The starting point for the bidding on the query */\n minBid: z.optional(z.number()),\n})\n\nexport type QueryFields = z.infer<typeof QueryFieldsZod>\n\nexport type Query<T extends void | EmptyObject | SchemaField = void, S extends Schema | void = void> = Payload<\n T extends void ? QueryFields : T & QueryFields,\n S extends void\n ? T extends SchemaField ? T['schema']\n : T extends void ? Schema\n : void\n : S\n>\n"],
5
+ "mappings": ";AACA;AAAA,EACE,WAAAA;AAAA,EAAS,gBAAAC;AAAA,EAAc,gBAAAC;AAAA,EAAc,gBAAAC;AAAA,OAChC;AACP,YAAYC,QAAO;;;ACJnB;AAAA,EACE;AAAA,EACA,gBAAAC;AAAA,EAAc,gBAAAC;AAAA,EAAc;AAAA,OACvB;AACP,YAAYC,QAAO;;;ACHnB,SAAS,cAAc,oBAAoB;AAC3C,YAAY,OAAO;AAGZ,IAAM,cAAc;AAEpB,IAAM,YAAc,OAAO,SAAO,EAAE,MAAQ,QAAM,WAAW,CAAC,GAAK,YAAU,CAAC,MAA6B,CAAkB,CAAC;AAG9H,IAAM,aAAa,CAAmB,UAAa;AACxD,SAAS,OAAO,UAAQ,KAAK,GAAK,YAAU,CAAC,MAAiC,CAA2B,CAAC;AAC5G;AAEO,IAAM,WAAW,aAAa,SAAS;AACvC,IAAM,WAAW,aAAa,WAAW,UAAU;AACnD,IAAM,WAAW,aAAa,WAAW,UAAU;AAEnD,IAAM,gBAAgB,SAAS,uBAAuB,IAAI;AAC1D,IAAM,mBAAqB,UAAQ,aAAa;;;ACnBvD,SAAS,uBAAuB;AAYzB,IAAM,wBAAwB,CAAC,UAAiD;AACrF,SAAQ,OAAmC,aAAa;AAC1D;AAEO,IAAM,wBAA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M;AAAA,EACd,WAAQ,KAAK;AAAA,EACb,WAAQ,MAAM;AAAA,EACd,WAAQ,OAAO;AAAA,EACf,WAAQ,MAAM;AAClB,CAAC;AAEM,IAAM,iBAAmB,UAAO;AAAA;AAAA,EAErC,SAAW,YAAS,eAAe;AAAA;AAAA,EAEnC,QAAU,YAAW,UAAO,CAAC;AAAA;AAAA,EAE7B,cAAgB,YAAS,eAAe;AAAA;AAAA,EAExC,QAAU,YAAW,UAAO,CAAC;AAC/B,CAAC;",
6
+ "names": ["HashZod", "zodAsFactory", "zodIsFactory", "zodToFactory", "z", "zodAsFactory", "zodIsFactory", "z", "toHex", "z", "toHex", "zodIsFactory", "zodAsFactory", "HashZod", "zodIsFactory", "zodAsFactory", "zodToFactory", "z", "HashZod", "zodAsFactory", "zodIsFactory", "zodToFactory", "z", "HashZod", "zodIsFactory", "zodAsFactory", "zodToFactory", "zodAsFactory", "zodIsFactory", "zodToFactory", "z", "zodIsFactory", "zodAsFactory", "zodToFactory", "z"]
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/payload-model",
3
- "version": "6.1.1",
3
+ "version": "7.0.2",
4
4
  "description": "Primary SDK for using XYO Protocol 2.0",
5
5
  "homepage": "https://xyo.network",
6
6
  "bugs": {
@@ -34,21 +34,21 @@
34
34
  "README.md"
35
35
  ],
36
36
  "dependencies": {
37
- "@xyo-network/address": "~6.1.1"
37
+ "@xyo-network/address": "~7.0.2"
38
38
  },
39
39
  "devDependencies": {
40
40
  "@opentelemetry/api": "^1.9.1",
41
41
  "@opentelemetry/sdk-trace-base": "^2.8.0",
42
42
  "@scure/base": "~2.2.0",
43
- "@xylabs/sdk-js": "^6.1.1",
44
- "@xylabs/toolchain": "~8.1.20",
45
- "@xylabs/tsconfig": "~8.1.20",
46
- "@xylabs/vitest-extended": "^6.1.1",
43
+ "@xylabs/sdk-js": "^6.1.4",
44
+ "@xylabs/toolchain": "~8.3.0",
45
+ "@xylabs/tsconfig": "~8.3.0",
46
+ "@xylabs/vitest-extended": "^6.1.4",
47
47
  "async-mutex": "^0.5.0",
48
- "eslint": "^10.4.1",
48
+ "eslint": "^10.5.0",
49
49
  "typescript": "~6.0.3",
50
- "vite": "^8.0.16",
51
- "vitest": "~4.1.8",
50
+ "vite": "^8.1.0",
51
+ "vitest": "~4.1.9",
52
52
  "zod": "^4.4.3"
53
53
  },
54
54
  "peerDependencies": {