@xyo-network/xl1-protocol 1.12.57 → 1.12.59

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,49 +1,109 @@
1
- import type { Hex } from '@xylabs/hex';
1
+ import z from 'zod';
2
2
  /**
3
3
  * Represents a transfer destination
4
4
  */
5
- export interface BridgeDetailsDestinationFields {
6
- /**
7
- * Destination network
8
- */
9
- dest: Hex;
10
- /**
11
- * Destination address (EOA or contract)
12
- */
13
- destAddress: Hex;
14
- /**
15
- * Token amount to bridge to destination
16
- */
17
- destAmount: Hex;
18
- /**
19
- * Token being bridged to
20
- */
21
- destToken: Hex;
22
- }
5
+ export declare const BridgeDetailsDestinationFieldsZod: z.ZodObject<{
6
+ dest: z.ZodType<import("@xylabs/typeof").Brand<Lowercase<string>, {
7
+ readonly __hex: true;
8
+ }>, unknown, z.z.core.$ZodTypeInternals<import("@xylabs/typeof").Brand<Lowercase<string>, {
9
+ readonly __hex: true;
10
+ }>, unknown>>;
11
+ destAddress: z.ZodType<import("@xylabs/typeof").Brand<Lowercase<string>, {
12
+ readonly __hex: true;
13
+ }>, unknown, z.z.core.$ZodTypeInternals<import("@xylabs/typeof").Brand<Lowercase<string>, {
14
+ readonly __hex: true;
15
+ }>, unknown>>;
16
+ destAmount: z.ZodType<import("@xylabs/typeof").Brand<Lowercase<string>, {
17
+ readonly __hex: true;
18
+ }>, unknown, z.z.core.$ZodTypeInternals<import("@xylabs/typeof").Brand<Lowercase<string>, {
19
+ readonly __hex: true;
20
+ }>, unknown>>;
21
+ destToken: z.ZodType<import("@xylabs/typeof").Brand<Lowercase<string>, {
22
+ readonly __hex: true;
23
+ }>, unknown, z.z.core.$ZodTypeInternals<import("@xylabs/typeof").Brand<Lowercase<string>, {
24
+ readonly __hex: true;
25
+ }>, unknown>>;
26
+ }, z.z.core.$strip>;
27
+ /**
28
+ * Represents a transfer destination
29
+ */
30
+ export type BridgeDetailsDestinationFields = z.infer<typeof BridgeDetailsDestinationFieldsZod>;
23
31
  /**
24
32
  * Represents a transfer source
25
33
  */
26
- export interface BridgeDetailsSourceFields {
27
- /**
28
- * Source network
29
- */
30
- src: Hex;
31
- /**
32
- * Source address (EOA or contract)
33
- */
34
- srcAddress: Hex;
35
- /**
36
- * Token amount to bridge form source
37
- */
38
- srcAmount: Hex;
39
- /**
40
- * Token being bridged from
41
- */
42
- srcToken: Hex;
43
- }
34
+ export declare const BridgeDetailsSourceFieldsZod: z.ZodObject<{
35
+ src: z.ZodType<import("@xylabs/typeof").Brand<Lowercase<string>, {
36
+ readonly __hex: true;
37
+ }>, unknown, z.z.core.$ZodTypeInternals<import("@xylabs/typeof").Brand<Lowercase<string>, {
38
+ readonly __hex: true;
39
+ }>, unknown>>;
40
+ srcAddress: z.ZodType<import("@xylabs/typeof").Brand<Lowercase<string>, {
41
+ readonly __hex: true;
42
+ }>, unknown, z.z.core.$ZodTypeInternals<import("@xylabs/typeof").Brand<Lowercase<string>, {
43
+ readonly __hex: true;
44
+ }>, unknown>>;
45
+ srcAmount: z.ZodType<import("@xylabs/typeof").Brand<Lowercase<string>, {
46
+ readonly __hex: true;
47
+ }>, unknown, z.z.core.$ZodTypeInternals<import("@xylabs/typeof").Brand<Lowercase<string>, {
48
+ readonly __hex: true;
49
+ }>, unknown>>;
50
+ srcToken: z.ZodType<import("@xylabs/typeof").Brand<Lowercase<string>, {
51
+ readonly __hex: true;
52
+ }>, unknown, z.z.core.$ZodTypeInternals<import("@xylabs/typeof").Brand<Lowercase<string>, {
53
+ readonly __hex: true;
54
+ }>, unknown>>;
55
+ }, z.z.core.$strip>;
56
+ /**
57
+ * Represents a transfer source
58
+ */
59
+ export type BridgeDetailsSourceFields = z.infer<typeof BridgeDetailsSourceFieldsZod>;
60
+ /**
61
+ * Represents a transfer from a source chain/token/address/amount to a destination chain/token/address/amount.
62
+ */
63
+ export declare const BridgeDetailsFieldsZod: z.ZodObject<{
64
+ src: z.ZodType<import("@xylabs/typeof").Brand<Lowercase<string>, {
65
+ readonly __hex: true;
66
+ }>, unknown, z.z.core.$ZodTypeInternals<import("@xylabs/typeof").Brand<Lowercase<string>, {
67
+ readonly __hex: true;
68
+ }>, unknown>>;
69
+ srcAddress: z.ZodType<import("@xylabs/typeof").Brand<Lowercase<string>, {
70
+ readonly __hex: true;
71
+ }>, unknown, z.z.core.$ZodTypeInternals<import("@xylabs/typeof").Brand<Lowercase<string>, {
72
+ readonly __hex: true;
73
+ }>, unknown>>;
74
+ srcAmount: z.ZodType<import("@xylabs/typeof").Brand<Lowercase<string>, {
75
+ readonly __hex: true;
76
+ }>, unknown, z.z.core.$ZodTypeInternals<import("@xylabs/typeof").Brand<Lowercase<string>, {
77
+ readonly __hex: true;
78
+ }>, unknown>>;
79
+ srcToken: z.ZodType<import("@xylabs/typeof").Brand<Lowercase<string>, {
80
+ readonly __hex: true;
81
+ }>, unknown, z.z.core.$ZodTypeInternals<import("@xylabs/typeof").Brand<Lowercase<string>, {
82
+ readonly __hex: true;
83
+ }>, unknown>>;
84
+ dest: z.ZodType<import("@xylabs/typeof").Brand<Lowercase<string>, {
85
+ readonly __hex: true;
86
+ }>, unknown, z.z.core.$ZodTypeInternals<import("@xylabs/typeof").Brand<Lowercase<string>, {
87
+ readonly __hex: true;
88
+ }>, unknown>>;
89
+ destAddress: z.ZodType<import("@xylabs/typeof").Brand<Lowercase<string>, {
90
+ readonly __hex: true;
91
+ }>, unknown, z.z.core.$ZodTypeInternals<import("@xylabs/typeof").Brand<Lowercase<string>, {
92
+ readonly __hex: true;
93
+ }>, unknown>>;
94
+ destAmount: z.ZodType<import("@xylabs/typeof").Brand<Lowercase<string>, {
95
+ readonly __hex: true;
96
+ }>, unknown, z.z.core.$ZodTypeInternals<import("@xylabs/typeof").Brand<Lowercase<string>, {
97
+ readonly __hex: true;
98
+ }>, unknown>>;
99
+ destToken: z.ZodType<import("@xylabs/typeof").Brand<Lowercase<string>, {
100
+ readonly __hex: true;
101
+ }>, unknown, z.z.core.$ZodTypeInternals<import("@xylabs/typeof").Brand<Lowercase<string>, {
102
+ readonly __hex: true;
103
+ }>, unknown>>;
104
+ }, z.z.core.$strip>;
44
105
  /**
45
106
  * Represents a transfer from a source chain/token/address/amount to a destination chain/token/address/amount.
46
107
  */
47
- export interface BridgeDetailsFields extends BridgeDetailsSourceFields, BridgeDetailsDestinationFields {
48
- }
108
+ export type BridgeDetailsFields = z.infer<typeof BridgeDetailsFieldsZod>;
49
109
  //# sourceMappingURL=BridgeDetails.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BridgeDetails.d.ts","sourceRoot":"","sources":["../../../../../src/payload/elevatable/Bridge/BridgeDetails.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AAEtC;;GAEG;AACH,MAAM,WAAW,8BAA8B;IAC7C;;OAEG;IACH,IAAI,EAAE,GAAG,CAAA;IAET;;OAEG;IACH,WAAW,EAAE,GAAG,CAAA;IAEhB;;OAEG;IACH,UAAU,EAAE,GAAG,CAAA;IAEf;;OAEG;IACH,SAAS,EAAE,GAAG,CAAA;CACf;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC;;OAEG;IACH,GAAG,EAAE,GAAG,CAAA;IAER;;OAEG;IACH,UAAU,EAAE,GAAG,CAAA;IAEf;;OAEG;IACH,SAAS,EAAE,GAAG,CAAA;IAEd;;OAEG;IACH,QAAQ,EAAE,GAAG,CAAA;CACd;AAED;;GAEG;AACH,MAAM,WAAW,mBAAoB,SAAQ,yBAAyB,EAAE,8BAA8B;CAAG"}
1
+ {"version":3,"file":"BridgeDetails.d.ts","sourceRoot":"","sources":["../../../../../src/payload/elevatable/Bridge/BridgeDetails.ts"],"names":[],"mappings":"AACA,OAAO,CAAC,MAAM,KAAK,CAAA;AAEnB;;GAEG;AACH,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;;mBAiB5C,CAAA;AAEF;;GAEG;AACH,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAA;AAE9F;;GAEG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;mBAkBvC,CAAA;AAEF;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAA;AAEpF;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAElC,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAA"}
@@ -1,16 +1,54 @@
1
1
  import type { Payload } from '@xyo-network/payload-model';
2
- import type { BridgeDetailsFields } from './BridgeDetails.ts';
2
+ import z from 'zod';
3
3
  export declare const BridgeIntentSchema: "network.xyo.chain.bridge.intent";
4
4
  export type BridgeIntentSchema = typeof BridgeIntentSchema;
5
5
  /**
6
- * Represents an Addresses intent to initiate a token bridge.
6
+ * Represents an Address's intent to initiate a token bridge.
7
7
  */
8
- export interface BridgeIntentFields extends BridgeDetailsFields {
9
- /**
10
- * Unique identifier for replay protection
11
- */
12
- nonce: string;
13
- }
8
+ export declare const BridgeIntentFieldsZod: z.ZodObject<{
9
+ src: z.ZodType<import("@xylabs/typeof").Brand<Lowercase<string>, {
10
+ readonly __hex: true;
11
+ }>, unknown, z.z.core.$ZodTypeInternals<import("@xylabs/typeof").Brand<Lowercase<string>, {
12
+ readonly __hex: true;
13
+ }>, unknown>>;
14
+ srcAddress: z.ZodType<import("@xylabs/typeof").Brand<Lowercase<string>, {
15
+ readonly __hex: true;
16
+ }>, unknown, z.z.core.$ZodTypeInternals<import("@xylabs/typeof").Brand<Lowercase<string>, {
17
+ readonly __hex: true;
18
+ }>, unknown>>;
19
+ srcAmount: z.ZodType<import("@xylabs/typeof").Brand<Lowercase<string>, {
20
+ readonly __hex: true;
21
+ }>, unknown, z.z.core.$ZodTypeInternals<import("@xylabs/typeof").Brand<Lowercase<string>, {
22
+ readonly __hex: true;
23
+ }>, unknown>>;
24
+ srcToken: z.ZodType<import("@xylabs/typeof").Brand<Lowercase<string>, {
25
+ readonly __hex: true;
26
+ }>, unknown, z.z.core.$ZodTypeInternals<import("@xylabs/typeof").Brand<Lowercase<string>, {
27
+ readonly __hex: true;
28
+ }>, unknown>>;
29
+ dest: z.ZodType<import("@xylabs/typeof").Brand<Lowercase<string>, {
30
+ readonly __hex: true;
31
+ }>, unknown, z.z.core.$ZodTypeInternals<import("@xylabs/typeof").Brand<Lowercase<string>, {
32
+ readonly __hex: true;
33
+ }>, unknown>>;
34
+ destAddress: z.ZodType<import("@xylabs/typeof").Brand<Lowercase<string>, {
35
+ readonly __hex: true;
36
+ }>, unknown, z.z.core.$ZodTypeInternals<import("@xylabs/typeof").Brand<Lowercase<string>, {
37
+ readonly __hex: true;
38
+ }>, unknown>>;
39
+ destAmount: z.ZodType<import("@xylabs/typeof").Brand<Lowercase<string>, {
40
+ readonly __hex: true;
41
+ }>, unknown, z.z.core.$ZodTypeInternals<import("@xylabs/typeof").Brand<Lowercase<string>, {
42
+ readonly __hex: true;
43
+ }>, unknown>>;
44
+ destToken: z.ZodType<import("@xylabs/typeof").Brand<Lowercase<string>, {
45
+ readonly __hex: true;
46
+ }>, unknown, z.z.core.$ZodTypeInternals<import("@xylabs/typeof").Brand<Lowercase<string>, {
47
+ readonly __hex: true;
48
+ }>, unknown>>;
49
+ nonce: z.ZodString;
50
+ }, z.z.core.$strip>;
51
+ export type BridgeIntentFields = z.infer<typeof BridgeIntentFieldsZod>;
14
52
  export type BridgeIntent = Payload<BridgeIntentFields, BridgeIntentSchema>;
15
53
  export declare const isBridgeIntent: (x?: unknown | null) => x is BridgeIntent;
16
54
  export declare const asBridgeIntent: import("@xylabs/object").AsTypeFunction<BridgeIntent>;
@@ -1 +1 @@
1
- {"version":3,"file":"BridgeIntent.d.ts","sourceRoot":"","sources":["../../../../../src/payload/elevatable/Bridge/BridgeIntent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAGzD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAE7D,eAAO,MAAM,kBAAkB,EAAG,iCAA0C,CAAA;AAC5E,MAAM,MAAM,kBAAkB,GAAG,OAAO,kBAAkB,CAAA;AAE1D;;GAEG;AACH,MAAM,WAAW,kBAAmB,SAAQ,mBAAmB;IAC7D;;OAEG;IACH,KAAK,EAAE,MAAM,CAAA;CACd;AAED,MAAM,MAAM,YAAY,GAAG,OAAO,CAAC,kBAAkB,EAAE,kBAAkB,CAAC,CAAA;AAE1E,eAAO,MAAM,cAAc,2CAA0D,CAAA;AAErF,eAAO,MAAM,cAAc,uDAAyC,CAAA"}
1
+ {"version":3,"file":"BridgeIntent.d.ts","sourceRoot":"","sources":["../../../../../src/payload/elevatable/Bridge/BridgeIntent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAEzD,OAAO,CAAC,MAAM,KAAK,CAAA;AAInB,eAAO,MAAM,kBAAkB,EAAG,iCAA0C,CAAA;AAC5E,MAAM,MAAM,kBAAkB,GAAG,OAAO,kBAAkB,CAAA;AAE1D;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAKhC,CAAA;AAEF,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAA;AAEtE,MAAM,MAAM,YAAY,GAAG,OAAO,CAAC,kBAAkB,EAAE,kBAAkB,CAAC,CAAA;AAE1E,eAAO,MAAM,cAAc,2CAG1B,CAAA;AAED,eAAO,MAAM,cAAc,uDAAyC,CAAA"}
@@ -1,17 +1,58 @@
1
- import type { Hex } from '@xylabs/hex';
2
1
  import type { Payload } from '@xyo-network/payload-model';
3
- import type { BridgeDetailsFields } from './BridgeDetails.ts';
2
+ import type z from 'zod';
4
3
  export declare const BridgeSourceObservationSchema: "network.xyo.chain.bridge.observation.source";
5
4
  export type BridgeSourceObservationSchema = typeof BridgeSourceObservationSchema;
6
5
  /**
7
6
  * Represents an observation that confirms a bridge action occurred on the source chain.
8
7
  */
9
- export interface BridgeSourceObservationFields extends BridgeDetailsFields {
10
- /**
11
- * Source chain confirmation
12
- */
13
- srcConfirmation?: Hex;
14
- }
8
+ export declare const BridgeSourceObservationFieldsZod: z.ZodObject<{
9
+ src: z.ZodType<import("@xylabs/typeof").Brand<Lowercase<string>, {
10
+ readonly __hex: true;
11
+ }>, unknown, z.z.core.$ZodTypeInternals<import("@xylabs/typeof").Brand<Lowercase<string>, {
12
+ readonly __hex: true;
13
+ }>, unknown>>;
14
+ srcAddress: z.ZodType<import("@xylabs/typeof").Brand<Lowercase<string>, {
15
+ readonly __hex: true;
16
+ }>, unknown, z.z.core.$ZodTypeInternals<import("@xylabs/typeof").Brand<Lowercase<string>, {
17
+ readonly __hex: true;
18
+ }>, unknown>>;
19
+ srcAmount: z.ZodType<import("@xylabs/typeof").Brand<Lowercase<string>, {
20
+ readonly __hex: true;
21
+ }>, unknown, z.z.core.$ZodTypeInternals<import("@xylabs/typeof").Brand<Lowercase<string>, {
22
+ readonly __hex: true;
23
+ }>, unknown>>;
24
+ srcToken: z.ZodType<import("@xylabs/typeof").Brand<Lowercase<string>, {
25
+ readonly __hex: true;
26
+ }>, unknown, z.z.core.$ZodTypeInternals<import("@xylabs/typeof").Brand<Lowercase<string>, {
27
+ readonly __hex: true;
28
+ }>, unknown>>;
29
+ dest: z.ZodType<import("@xylabs/typeof").Brand<Lowercase<string>, {
30
+ readonly __hex: true;
31
+ }>, unknown, z.z.core.$ZodTypeInternals<import("@xylabs/typeof").Brand<Lowercase<string>, {
32
+ readonly __hex: true;
33
+ }>, unknown>>;
34
+ destAddress: z.ZodType<import("@xylabs/typeof").Brand<Lowercase<string>, {
35
+ readonly __hex: true;
36
+ }>, unknown, z.z.core.$ZodTypeInternals<import("@xylabs/typeof").Brand<Lowercase<string>, {
37
+ readonly __hex: true;
38
+ }>, unknown>>;
39
+ destAmount: z.ZodType<import("@xylabs/typeof").Brand<Lowercase<string>, {
40
+ readonly __hex: true;
41
+ }>, unknown, z.z.core.$ZodTypeInternals<import("@xylabs/typeof").Brand<Lowercase<string>, {
42
+ readonly __hex: true;
43
+ }>, unknown>>;
44
+ destToken: z.ZodType<import("@xylabs/typeof").Brand<Lowercase<string>, {
45
+ readonly __hex: true;
46
+ }>, unknown, z.z.core.$ZodTypeInternals<import("@xylabs/typeof").Brand<Lowercase<string>, {
47
+ readonly __hex: true;
48
+ }>, unknown>>;
49
+ srcConfirmation: z.ZodOptional<z.ZodType<import("@xylabs/typeof").Brand<Lowercase<string>, {
50
+ readonly __hex: true;
51
+ }>, unknown, z.z.core.$ZodTypeInternals<import("@xylabs/typeof").Brand<Lowercase<string>, {
52
+ readonly __hex: true;
53
+ }>, unknown>>>;
54
+ }, z.z.core.$strip>;
55
+ export type BridgeSourceObservationFields = z.infer<typeof BridgeSourceObservationFieldsZod>;
15
56
  /**
16
57
  * Represents an observation that confirms a bridge action occurred on the source chain.
17
58
  */
@@ -1 +1 @@
1
- {"version":3,"file":"BridgeSourceObservation.d.ts","sourceRoot":"","sources":["../../../../../src/payload/elevatable/Bridge/BridgeSourceObservation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AAEtC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAGzD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAE7D,eAAO,MAAM,6BAA6B,EAAG,6CAAsD,CAAA;AACnG,MAAM,MAAM,6BAA6B,GAAG,OAAO,6BAA6B,CAAA;AAEhF;;GAEG;AACH,MAAM,WAAW,6BAA8B,SAAQ,mBAAmB;IACxE;;OAEG;IACH,eAAe,CAAC,EAAE,GAAG,CAAA;CACtB;AAED;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG,OAAO,CAAC,6BAA6B,EAAE,6BAA6B,CAAC,CAAA;AAE3G,eAAO,MAAM,yBAAyB,sDAAgF,CAAA;AAEtH,eAAO,MAAM,yBAAyB,kEAAoD,CAAA"}
1
+ {"version":3,"file":"BridgeSourceObservation.d.ts","sourceRoot":"","sources":["../../../../../src/payload/elevatable/Bridge/BridgeSourceObservation.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAEzD,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAIxB,eAAO,MAAM,6BAA6B,EAAG,6CAAsD,CAAA;AACnG,MAAM,MAAM,6BAA6B,GAAG,OAAO,6BAA6B,CAAA;AAEhF;;GAEG;AACH,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAK3C,CAAA;AAEF,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAA;AAC5F;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG,OAAO,CAAC,6BAA6B,EAAE,6BAA6B,CAAC,CAAA;AAE3G,eAAO,MAAM,yBAAyB,sDAGrC,CAAA;AAED,eAAO,MAAM,yBAAyB,kEAAoD,CAAA"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "http://json.schemastore.org/package.json",
3
3
  "name": "@xyo-network/xl1-protocol",
4
- "version": "1.12.57",
4
+ "version": "1.12.59",
5
5
  "description": "XYO Layer One Protocol",
6
6
  "homepage": "https://xylabs.com",
7
7
  "bugs": {
@@ -45,10 +45,10 @@
45
45
  "@xylabs/object": "~5.0.11",
46
46
  "@xylabs/promise": "~5.0.11",
47
47
  "@xylabs/typeof": "~5.0.11",
48
- "@xyo-network/archivist-model": "~5.1.3",
49
- "@xyo-network/boundwitness-model": "~5.1.3",
50
- "@xyo-network/payload-model": "~5.1.3",
51
- "@xyo-network/schema-payload-plugin": "~5.1.3",
48
+ "@xyo-network/archivist-model": "~5.1.5",
49
+ "@xyo-network/boundwitness-model": "~5.1.5",
50
+ "@xyo-network/payload-model": "~5.1.5",
51
+ "@xyo-network/schema-payload-plugin": "~5.1.5",
52
52
  "zod": "~4.1.12"
53
53
  },
54
54
  "devDependencies": {
@@ -58,7 +58,7 @@
58
58
  "@xylabs/eslint-config-flat": "~7.1.8",
59
59
  "@xylabs/ts-scripts-yarn3": "~7.1.8",
60
60
  "@xylabs/tsconfig": "~7.1.8",
61
- "@xyo-network/account-model": "~5.1.3",
61
+ "@xyo-network/account-model": "~5.1.5",
62
62
  "dependency-cruiser": "~17.0.2",
63
63
  "dotenv": "~17.2.3",
64
64
  "eslint": "~9.37.0",
@@ -1,9 +1,10 @@
1
- import type { Hex } from '@xylabs/hex'
1
+ import { HexZod } from '@xylabs/hex'
2
2
  import { AsObjectFactory } from '@xylabs/object'
3
3
  import type { Payload } from '@xyo-network/payload-model'
4
- import { isPayloadOfSchemaType } from '@xyo-network/payload-model'
4
+ import { isPayloadOfZodType } from '@xyo-network/payload-model'
5
+ import type z from 'zod'
5
6
 
6
- import type { BridgeDetailsFields } from './BridgeDetails.ts'
7
+ import { BridgeDetailsFieldsZod } from './BridgeDetails.ts'
7
8
 
8
9
  export const BridgeDestinationObservationSchema = 'network.xyo.chain.bridge.observation.destination' as const
9
10
  export type BridgeDestinationObservationSchema = typeof BridgeDestinationObservationSchema
@@ -11,18 +12,23 @@ export type BridgeDestinationObservationSchema = typeof BridgeDestinationObserva
11
12
  /**
12
13
  * Represents an observation that confirms a bridge action occurred on the destination chain.
13
14
  */
14
- export interface BridgeDestinationObservationFields extends BridgeDetailsFields {
15
+ export const BridgeDestinationObservationFieldsZod = BridgeDetailsFieldsZod.extend({
15
16
  /**
16
17
  * Destination chain confirmation
17
18
  */
18
- destConfirmation?: Hex
19
- }
19
+ destConfirmation: HexZod.optional().describe('Destination chain confirmation'),
20
+ })
21
+
22
+ export type BridgeDestinationObservationFields = z.infer<typeof BridgeDestinationObservationFieldsZod>
20
23
 
21
24
  /**
22
25
  * Represents an observation that confirms a bridge action occurred on the destination chain.
23
26
  */
24
27
  export type BridgeDestinationObservation = Payload<BridgeDestinationObservationFields, BridgeDestinationObservationSchema>
25
28
 
26
- export const isBridgeDestinationObservation = isPayloadOfSchemaType<BridgeDestinationObservation>(BridgeDestinationObservationSchema)
29
+ export const isBridgeDestinationObservation = isPayloadOfZodType<BridgeDestinationObservation>(
30
+ BridgeDestinationObservationFieldsZod,
31
+ BridgeDestinationObservationSchema,
32
+ )
27
33
 
28
34
  export const asBridgeDestinationObservation = AsObjectFactory.create(isBridgeDestinationObservation)
@@ -1,56 +1,69 @@
1
- import type { Hex } from '@xylabs/hex'
1
+ import { HexZod } from '@xylabs/hex'
2
+ import z from 'zod'
2
3
 
3
4
  /**
4
5
  * Represents a transfer destination
5
6
  */
6
- export interface BridgeDetailsDestinationFields {
7
+ export const BridgeDetailsDestinationFieldsZod = z.object({
7
8
  /**
8
9
  * Destination network
9
10
  */
10
- dest: Hex
11
-
11
+ dest: HexZod.describe('The destination network identifier'),
12
12
  /**
13
13
  * Destination address (EOA or contract)
14
14
  */
15
- destAddress: Hex
16
-
15
+ destAddress: HexZod.describe('The destination address (EOA or contract)'),
17
16
  /**
18
17
  * Token amount to bridge to destination
19
18
  */
20
- destAmount: Hex
21
-
19
+ destAmount: HexZod.describe('The token amount to bridge to destination'),
22
20
  /**
23
21
  * Token being bridged to
24
22
  */
25
- destToken: Hex
26
- }
23
+ destToken: HexZod.describe('The token being bridged to'),
24
+ })
25
+
26
+ /**
27
+ * Represents a transfer destination
28
+ */
29
+ export type BridgeDetailsDestinationFields = z.infer<typeof BridgeDetailsDestinationFieldsZod>
27
30
 
28
31
  /**
29
32
  * Represents a transfer source
30
33
  */
31
- export interface BridgeDetailsSourceFields {
34
+ export const BridgeDetailsSourceFieldsZod = z.object({
32
35
  /**
33
36
  * Source network
34
37
  */
35
- src: Hex
38
+ src: HexZod.describe('The source network identifier'),
36
39
 
37
40
  /**
38
41
  * Source address (EOA or contract)
39
42
  */
40
- srcAddress: Hex
41
-
43
+ srcAddress: HexZod.describe('The source address (EOA or contract)'),
42
44
  /**
43
- * Token amount to bridge form source
45
+ * Token amount to bridge from source
44
46
  */
45
- srcAmount: Hex
46
-
47
+ srcAmount: HexZod.describe('The token amount to bridge from source'),
47
48
  /**
48
49
  * Token being bridged from
49
50
  */
50
- srcToken: Hex
51
- }
51
+ srcToken: HexZod.describe('The token being bridged from'),
52
+ })
53
+
54
+ /**
55
+ * Represents a transfer source
56
+ */
57
+ export type BridgeDetailsSourceFields = z.infer<typeof BridgeDetailsSourceFieldsZod>
58
+
59
+ /**
60
+ * Represents a transfer from a source chain/token/address/amount to a destination chain/token/address/amount.
61
+ */
62
+ export const BridgeDetailsFieldsZod = BridgeDetailsSourceFieldsZod.extend(
63
+ BridgeDetailsDestinationFieldsZod.shape,
64
+ )
52
65
 
53
66
  /**
54
67
  * Represents a transfer from a source chain/token/address/amount to a destination chain/token/address/amount.
55
68
  */
56
- export interface BridgeDetailsFields extends BridgeDetailsSourceFields, BridgeDetailsDestinationFields {}
69
+ export type BridgeDetailsFields = z.infer<typeof BridgeDetailsFieldsZod>
@@ -1,24 +1,30 @@
1
1
  import { AsObjectFactory } from '@xylabs/object'
2
2
  import type { Payload } from '@xyo-network/payload-model'
3
- import { isPayloadOfSchemaType } from '@xyo-network/payload-model'
3
+ import { isPayloadOfZodType } from '@xyo-network/payload-model'
4
+ import z from 'zod'
4
5
 
5
- import type { BridgeDetailsFields } from './BridgeDetails.ts'
6
+ import { BridgeDetailsFieldsZod } from './BridgeDetails.ts'
6
7
 
7
8
  export const BridgeIntentSchema = 'network.xyo.chain.bridge.intent' as const
8
9
  export type BridgeIntentSchema = typeof BridgeIntentSchema
9
10
 
10
11
  /**
11
- * Represents an Addresses intent to initiate a token bridge.
12
+ * Represents an Address's intent to initiate a token bridge.
12
13
  */
13
- export interface BridgeIntentFields extends BridgeDetailsFields {
14
+ export const BridgeIntentFieldsZod = BridgeDetailsFieldsZod.extend({
14
15
  /**
15
16
  * Unique identifier for replay protection
16
17
  */
17
- nonce: string
18
- }
18
+ nonce: z.string().describe('Unique identifier for replay protection'),
19
+ })
20
+
21
+ export type BridgeIntentFields = z.infer<typeof BridgeIntentFieldsZod>
19
22
 
20
23
  export type BridgeIntent = Payload<BridgeIntentFields, BridgeIntentSchema>
21
24
 
22
- export const isBridgeIntent = isPayloadOfSchemaType<BridgeIntent>(BridgeIntentSchema)
25
+ export const isBridgeIntent = isPayloadOfZodType<BridgeIntent>(
26
+ BridgeIntentFieldsZod,
27
+ BridgeIntentSchema,
28
+ )
23
29
 
24
30
  export const asBridgeIntent = AsObjectFactory.create(isBridgeIntent)
@@ -1,9 +1,10 @@
1
- import type { Hex } from '@xylabs/hex'
1
+ import { HexZod } from '@xylabs/hex'
2
2
  import { AsObjectFactory } from '@xylabs/object'
3
3
  import type { Payload } from '@xyo-network/payload-model'
4
- import { isPayloadOfSchemaType } from '@xyo-network/payload-model'
4
+ import { isPayloadOfZodType } from '@xyo-network/payload-model'
5
+ import type z from 'zod'
5
6
 
6
- import type { BridgeDetailsFields } from './BridgeDetails.ts'
7
+ import { BridgeDetailsFieldsZod } from './BridgeDetails.ts'
7
8
 
8
9
  export const BridgeSourceObservationSchema = 'network.xyo.chain.bridge.observation.source' as const
9
10
  export type BridgeSourceObservationSchema = typeof BridgeSourceObservationSchema
@@ -11,18 +12,22 @@ export type BridgeSourceObservationSchema = typeof BridgeSourceObservationSchema
11
12
  /**
12
13
  * Represents an observation that confirms a bridge action occurred on the source chain.
13
14
  */
14
- export interface BridgeSourceObservationFields extends BridgeDetailsFields {
15
+ export const BridgeSourceObservationFieldsZod = BridgeDetailsFieldsZod.extend({
15
16
  /**
16
17
  * Source chain confirmation
17
18
  */
18
- srcConfirmation?: Hex
19
- }
19
+ srcConfirmation: HexZod.optional().describe('Source chain confirmation'),
20
+ })
20
21
 
22
+ export type BridgeSourceObservationFields = z.infer<typeof BridgeSourceObservationFieldsZod>
21
23
  /**
22
24
  * Represents an observation that confirms a bridge action occurred on the source chain.
23
25
  */
24
26
  export type BridgeSourceObservation = Payload<BridgeSourceObservationFields, BridgeSourceObservationSchema>
25
27
 
26
- export const isBridgeSourceObservation = isPayloadOfSchemaType<BridgeSourceObservation>(BridgeSourceObservationSchema)
28
+ export const isBridgeSourceObservation = isPayloadOfZodType<BridgeSourceObservation>(
29
+ BridgeSourceObservationFieldsZod,
30
+ BridgeSourceObservationSchema,
31
+ )
27
32
 
28
33
  export const asBridgeSourceObservation = AsObjectFactory.create(isBridgeSourceObservation)