@xyo-network/payment-payload-plugins 6.1.0 → 7.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/dist/neutral/Amount/Iso4217Currency.d.ts.map +1 -1
  2. package/dist/neutral/Amount/Payload.d.ts +56 -15
  3. package/dist/neutral/Amount/Payload.d.ts.map +1 -1
  4. package/dist/neutral/Billing/Address/Address.d.ts +102 -32
  5. package/dist/neutral/Billing/Address/Address.d.ts.map +1 -1
  6. package/dist/neutral/Currency.d.ts +5 -1
  7. package/dist/neutral/Currency.d.ts.map +1 -1
  8. package/dist/neutral/Discount/Payload/Coupon/Coupons/FixedAmount.d.ts +81 -15
  9. package/dist/neutral/Discount/Payload/Coupon/Coupons/FixedAmount.d.ts.map +1 -1
  10. package/dist/neutral/Discount/Payload/Coupon/Coupons/FixedPercentage.d.ts +74 -15
  11. package/dist/neutral/Discount/Payload/Coupon/Coupons/FixedPercentage.d.ts.map +1 -1
  12. package/dist/neutral/Discount/Payload/Coupon/Coupons/FixedPrice.d.ts +81 -15
  13. package/dist/neutral/Discount/Payload/Coupon/Coupons/FixedPrice.d.ts.map +1 -1
  14. package/dist/neutral/Discount/Payload/Coupon/Payload.d.ts +186 -9
  15. package/dist/neutral/Discount/Payload/Coupon/Payload.d.ts.map +1 -1
  16. package/dist/neutral/Discount/Payload/Coupon/types/Condition.d.ts +91 -7
  17. package/dist/neutral/Discount/Payload/Coupon/types/Condition.d.ts.map +1 -1
  18. package/dist/neutral/Discount/Payload/Coupon/types/CouponFields.d.ts +8 -12
  19. package/dist/neutral/Discount/Payload/Coupon/types/CouponFields.d.ts.map +1 -1
  20. package/dist/neutral/Discount/Payload/Discount.d.ts +53 -14
  21. package/dist/neutral/Discount/Payload/Discount.d.ts.map +1 -1
  22. package/dist/neutral/Escrow/Outcome.d.ts +64 -17
  23. package/dist/neutral/Escrow/Outcome.d.ts.map +1 -1
  24. package/dist/neutral/Escrow/Terms/Terms.d.ts +303 -62
  25. package/dist/neutral/Escrow/Terms/Terms.d.ts.map +1 -1
  26. package/dist/neutral/Escrow/util/appraisal/getAppraisalsByAsset.d.ts.map +1 -1
  27. package/dist/neutral/Escrow/util/appraisal/getSignaturesByAppraisal.d.ts.map +1 -1
  28. package/dist/neutral/Escrow/util/secret/createEscrowIntent.d.ts +9 -1
  29. package/dist/neutral/Escrow/util/secret/createEscrowIntent.d.ts.map +1 -1
  30. package/dist/neutral/Escrow/util/secret/updateEscrowTermsWithSecret.d.ts +9 -1
  31. package/dist/neutral/Escrow/util/secret/updateEscrowTermsWithSecret.d.ts.map +1 -1
  32. package/dist/neutral/Escrow/validators/common/ModuleInstanceValidators/moduleInstanceValidators.d.ts.map +1 -1
  33. package/dist/neutral/Escrow/validators/common/SecretValidators/getPartySecretSignedValidator.d.ts.map +1 -1
  34. package/dist/neutral/Escrow/validators/escrow/appraisal.d.ts.map +1 -1
  35. package/dist/neutral/Payment/Instrument/Card/Payload.d.ts +74 -34
  36. package/dist/neutral/Payment/Instrument/Card/Payload.d.ts.map +1 -1
  37. package/dist/neutral/Payment/Payload.d.ts +57 -23
  38. package/dist/neutral/Payment/Payload.d.ts.map +1 -1
  39. package/dist/neutral/Payment/Status/Payload.d.ts +53 -22
  40. package/dist/neutral/Payment/Status/Payload.d.ts.map +1 -1
  41. package/dist/neutral/Purchase/Payload.d.ts +53 -24
  42. package/dist/neutral/Purchase/Payload.d.ts.map +1 -1
  43. package/dist/neutral/Receipt/Payload.d.ts +57 -23
  44. package/dist/neutral/Receipt/Payload.d.ts.map +1 -1
  45. package/dist/neutral/Subtotal/Diviner/Payload.d.ts +53 -14
  46. package/dist/neutral/Subtotal/Diviner/Payload.d.ts.map +1 -1
  47. package/dist/neutral/Total/Diviner/Payload.d.ts +53 -14
  48. package/dist/neutral/Total/Diviner/Payload.d.ts.map +1 -1
  49. package/dist/neutral/index.mjs +475 -275
  50. package/dist/neutral/index.mjs.map +4 -4
  51. package/package.json +17 -20
@@ -1,16 +1,193 @@
1
- import type { FixedAmountCoupon, FixedPercentageCoupon, FixedPriceCoupon } from './Coupons/index.ts';
1
+ import * as z from 'zod/mini';
2
2
  /**
3
3
  * The type of coupons
4
4
  */
5
- export type Coupon = FixedAmountCoupon | FixedPercentageCoupon | FixedPriceCoupon;
5
+ export declare const CouponZod: z.ZodMiniUnion<readonly [z.ZodMiniObject<{
6
+ schema: z.ZodMiniLiteral<string & {
7
+ readonly __schema: true;
8
+ }>;
9
+ amount: z.ZodMiniNumber<number>;
10
+ currency: z.ZodMiniCustom<import("../../../index.ts").Iso4217AlphabeticalCode, import("../../../index.ts").Iso4217AlphabeticalCode>;
11
+ conditions: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<import("@xylabs/sdk-js").BrandedHash, string>>>>;
12
+ exp: z.ZodMiniNumber<number>;
13
+ nbf: z.ZodMiniNumber<number>;
14
+ stackable: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
15
+ }, z.core.$strip>, z.ZodMiniObject<{
16
+ schema: z.ZodMiniLiteral<string & {
17
+ readonly __schema: true;
18
+ }>;
19
+ percentage: z.ZodMiniNumber<number>;
20
+ conditions: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<import("@xylabs/sdk-js").BrandedHash, string>>>>;
21
+ exp: z.ZodMiniNumber<number>;
22
+ nbf: z.ZodMiniNumber<number>;
23
+ stackable: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
24
+ }, z.core.$strip>, z.ZodMiniObject<{
25
+ schema: z.ZodMiniLiteral<string & {
26
+ readonly __schema: true;
27
+ }>;
28
+ amount: z.ZodMiniNumber<number>;
29
+ currency: z.ZodMiniCustom<import("../../../index.ts").Iso4217AlphabeticalCode, import("../../../index.ts").Iso4217AlphabeticalCode>;
30
+ conditions: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<import("@xylabs/sdk-js").BrandedHash, string>>>>;
31
+ exp: z.ZodMiniNumber<number>;
32
+ nbf: z.ZodMiniNumber<number>;
33
+ stackable: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
34
+ }, z.core.$strip>]>;
35
+ export type Coupon = z.infer<typeof CouponZod>;
6
36
  /**
7
37
  * Identity function for determining if an object is an Coupon
8
38
  */
9
- export declare const isCoupon: (x?: unknown) => x is FixedAmountCoupon | FixedPercentageCoupon | FixedPriceCoupon;
10
- export declare const asCoupon: import("@xylabs/sdk-js").AsTypeFunction<FixedAmountCoupon | FixedPercentageCoupon | FixedPriceCoupon>;
11
- /**
12
- * Identity function for determining if an object is an Coupon with sources
13
- */
14
- export declare const isCouponWithSources: (x?: unknown) => x is import("@xyo-network/sdk-protocol-js").WithSources<import("@xyo-network/sdk-protocol-js").WithSources<FixedAmountCoupon>> | import("@xyo-network/sdk-protocol-js").WithSources<import("@xyo-network/sdk-protocol-js").WithSources<FixedPercentageCoupon>> | import("@xyo-network/sdk-protocol-js").WithSources<import("@xyo-network/sdk-protocol-js").WithSources<FixedPriceCoupon>>;
15
- export declare const asCouponWithSources: import("@xylabs/sdk-js").AsTypeFunction<import("@xyo-network/sdk-protocol-js").WithSources<import("@xyo-network/sdk-protocol-js").WithSources<FixedAmountCoupon>> | import("@xyo-network/sdk-protocol-js").WithSources<import("@xyo-network/sdk-protocol-js").WithSources<FixedPercentageCoupon>> | import("@xyo-network/sdk-protocol-js").WithSources<import("@xyo-network/sdk-protocol-js").WithSources<FixedPriceCoupon>>>;
39
+ export declare const isCoupon: <T>(value: T) => value is T & ({
40
+ schema: string & {
41
+ readonly __schema: true;
42
+ };
43
+ amount: number;
44
+ currency: import("../../../index.ts").Iso4217AlphabeticalCode;
45
+ exp: number;
46
+ nbf: number;
47
+ conditions?: import("@xylabs/sdk-js").BrandedHash[] | undefined;
48
+ stackable?: boolean | undefined;
49
+ } | {
50
+ schema: string & {
51
+ readonly __schema: true;
52
+ };
53
+ percentage: number;
54
+ exp: number;
55
+ nbf: number;
56
+ conditions?: import("@xylabs/sdk-js").BrandedHash[] | undefined;
57
+ stackable?: boolean | undefined;
58
+ } | {
59
+ schema: string & {
60
+ readonly __schema: true;
61
+ };
62
+ amount: number;
63
+ currency: import("../../../index.ts").Iso4217AlphabeticalCode;
64
+ exp: number;
65
+ nbf: number;
66
+ conditions?: import("@xylabs/sdk-js").BrandedHash[] | undefined;
67
+ stackable?: boolean | undefined;
68
+ });
69
+ export declare const asCoupon: {
70
+ <T>(value: T): (T & ({
71
+ schema: string & {
72
+ readonly __schema: true;
73
+ };
74
+ amount: number;
75
+ currency: import("../../../index.ts").Iso4217AlphabeticalCode;
76
+ exp: number;
77
+ nbf: number;
78
+ conditions?: import("@xylabs/sdk-js").BrandedHash[] | undefined;
79
+ stackable?: boolean | undefined;
80
+ } | {
81
+ schema: string & {
82
+ readonly __schema: true;
83
+ };
84
+ percentage: number;
85
+ exp: number;
86
+ nbf: number;
87
+ conditions?: import("@xylabs/sdk-js").BrandedHash[] | undefined;
88
+ stackable?: boolean | undefined;
89
+ } | {
90
+ schema: string & {
91
+ readonly __schema: true;
92
+ };
93
+ amount: number;
94
+ currency: import("../../../index.ts").Iso4217AlphabeticalCode;
95
+ exp: number;
96
+ nbf: number;
97
+ conditions?: import("@xylabs/sdk-js").BrandedHash[] | undefined;
98
+ stackable?: boolean | undefined;
99
+ })) | undefined;
100
+ <T>(value: T, assert: import("@xylabs/sdk-js").ZodFactoryConfig): T & ({
101
+ schema: string & {
102
+ readonly __schema: true;
103
+ };
104
+ amount: number;
105
+ currency: import("../../../index.ts").Iso4217AlphabeticalCode;
106
+ exp: number;
107
+ nbf: number;
108
+ conditions?: import("@xylabs/sdk-js").BrandedHash[] | undefined;
109
+ stackable?: boolean | undefined;
110
+ } | {
111
+ schema: string & {
112
+ readonly __schema: true;
113
+ };
114
+ percentage: number;
115
+ exp: number;
116
+ nbf: number;
117
+ conditions?: import("@xylabs/sdk-js").BrandedHash[] | undefined;
118
+ stackable?: boolean | undefined;
119
+ } | {
120
+ schema: string & {
121
+ readonly __schema: true;
122
+ };
123
+ amount: number;
124
+ currency: import("../../../index.ts").Iso4217AlphabeticalCode;
125
+ exp: number;
126
+ nbf: number;
127
+ conditions?: import("@xylabs/sdk-js").BrandedHash[] | undefined;
128
+ stackable?: boolean | undefined;
129
+ });
130
+ };
131
+ export declare const toCoupon: {
132
+ <T>(value: T): (T & ({
133
+ schema: string & {
134
+ readonly __schema: true;
135
+ };
136
+ amount: number;
137
+ currency: import("../../../index.ts").Iso4217AlphabeticalCode;
138
+ exp: number;
139
+ nbf: number;
140
+ conditions?: import("@xylabs/sdk-js").BrandedHash[] | undefined;
141
+ stackable?: boolean | undefined;
142
+ } | {
143
+ schema: string & {
144
+ readonly __schema: true;
145
+ };
146
+ percentage: number;
147
+ exp: number;
148
+ nbf: number;
149
+ conditions?: import("@xylabs/sdk-js").BrandedHash[] | undefined;
150
+ stackable?: boolean | undefined;
151
+ } | {
152
+ schema: string & {
153
+ readonly __schema: true;
154
+ };
155
+ amount: number;
156
+ currency: import("../../../index.ts").Iso4217AlphabeticalCode;
157
+ exp: number;
158
+ nbf: number;
159
+ conditions?: import("@xylabs/sdk-js").BrandedHash[] | undefined;
160
+ stackable?: boolean | undefined;
161
+ })) | undefined;
162
+ <T>(value: T, assert: import("@xylabs/sdk-js").ZodFactoryConfig): T & ({
163
+ schema: string & {
164
+ readonly __schema: true;
165
+ };
166
+ amount: number;
167
+ currency: import("../../../index.ts").Iso4217AlphabeticalCode;
168
+ exp: number;
169
+ nbf: number;
170
+ conditions?: import("@xylabs/sdk-js").BrandedHash[] | undefined;
171
+ stackable?: boolean | undefined;
172
+ } | {
173
+ schema: string & {
174
+ readonly __schema: true;
175
+ };
176
+ percentage: number;
177
+ exp: number;
178
+ nbf: number;
179
+ conditions?: import("@xylabs/sdk-js").BrandedHash[] | undefined;
180
+ stackable?: boolean | undefined;
181
+ } | {
182
+ schema: string & {
183
+ readonly __schema: true;
184
+ };
185
+ amount: number;
186
+ currency: import("../../../index.ts").Iso4217AlphabeticalCode;
187
+ exp: number;
188
+ nbf: number;
189
+ conditions?: import("@xylabs/sdk-js").BrandedHash[] | undefined;
190
+ stackable?: boolean | undefined;
191
+ });
192
+ };
16
193
  //# sourceMappingURL=Payload.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Payload.d.ts","sourceRoot":"","sources":["../../../../../src/Discount/Payload/Coupon/Payload.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,iBAAiB,EAAE,qBAAqB,EAAE,gBAAgB,EAC3D,MAAM,oBAAoB,CAAA;AAQ3B;;GAEG;AACH,MAAM,MAAM,MAAM,GACd,iBAAiB,GACf,qBAAqB,GACrB,gBAAgB,CAAA;AAEtB;;GAEG;AACH,eAAO,MAAM,QAAQ,GAAI,IAAI,OAAO,sEAGV,CAAA;AAC1B,eAAO,MAAM,QAAQ,uGAAmC,CAAA;AAExD;;GAEG;AACH,eAAO,MAAM,mBAAmB,GAAI,IAAI,OAAO,8XAGV,CAAA;AACrC,eAAO,MAAM,mBAAmB,+ZAA8C,CAAA"}
1
+ {"version":3,"file":"Payload.d.ts","sourceRoot":"","sources":["../../../../../src/Discount/Payload/Coupon/Payload.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,CAAC,MAAM,UAAU,CAAA;AAM7B;;GAEG;AACH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAIpB,CAAA;AAEF,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC,CAAA;AAE9C;;GAEG;AACH,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAA0B,CAAA;AAC/C,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAsC,CAAA;AAC3D,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAsC,CAAA"}
@@ -1,4 +1,31 @@
1
1
  import type { SchemaPayload } from '@xyo-network/sdk-js';
2
+ import * as z from 'zod/mini';
3
+ /**
4
+ * The payloads that can be used as conditions for a coupon
5
+ */
6
+ export declare const ConditionZod: z.ZodMiniCustom<{
7
+ schema: "network.xyo.schema" & {
8
+ readonly __schema: true;
9
+ };
10
+ definition: {
11
+ [x: string]: unknown;
12
+ $id?: string | undefined;
13
+ };
14
+ extends?: string | undefined;
15
+ name?: string | undefined;
16
+ version?: number | undefined;
17
+ }, {
18
+ schema: "network.xyo.schema" & {
19
+ readonly __schema: true;
20
+ };
21
+ definition: {
22
+ [x: string]: unknown;
23
+ $id?: string | undefined;
24
+ };
25
+ extends?: string | undefined;
26
+ name?: string | undefined;
27
+ version?: number | undefined;
28
+ }>;
2
29
  /**
3
30
  * The payloads that can be used as conditions for a coupon
4
31
  */
@@ -6,11 +33,68 @@ export type Condition = SchemaPayload;
6
33
  /**
7
34
  * Identity function for determining if an object is a Condition payload
8
35
  */
9
- export declare const isCondition: (x?: unknown) => x is SchemaPayload;
10
- export declare const asCondition: import("@xylabs/sdk-js").AsTypeFunction<SchemaPayload>;
11
- /**
12
- * Identity function for determining if an object is a Condition payload with sources
13
- */
14
- export declare const isConditionWithSources: (x?: unknown) => x is import("@xyo-network/sdk-js").WithSources<SchemaPayload>;
15
- export declare const asConditionWithSources: import("@xylabs/sdk-js").AsTypeFunction<import("@xyo-network/sdk-js").WithSources<SchemaPayload>>;
36
+ export declare const isCondition: <T>(value: T) => value is T & {
37
+ schema: "network.xyo.schema" & {
38
+ readonly __schema: true;
39
+ };
40
+ definition: {
41
+ [x: string]: unknown;
42
+ $id?: string | undefined;
43
+ };
44
+ extends?: string | undefined;
45
+ name?: string | undefined;
46
+ version?: number | undefined;
47
+ };
48
+ export declare const asCondition: {
49
+ <T>(value: T): (T & {
50
+ schema: "network.xyo.schema" & {
51
+ readonly __schema: true;
52
+ };
53
+ definition: {
54
+ [x: string]: unknown;
55
+ $id?: string | undefined;
56
+ };
57
+ extends?: string | undefined;
58
+ name?: string | undefined;
59
+ version?: number | undefined;
60
+ }) | undefined;
61
+ <T>(value: T, assert: import("@xylabs/sdk-js").ZodFactoryConfig): T & {
62
+ schema: "network.xyo.schema" & {
63
+ readonly __schema: true;
64
+ };
65
+ definition: {
66
+ [x: string]: unknown;
67
+ $id?: string | undefined;
68
+ };
69
+ extends?: string | undefined;
70
+ name?: string | undefined;
71
+ version?: number | undefined;
72
+ };
73
+ };
74
+ export declare const toCondition: {
75
+ <T>(value: T): (T & {
76
+ schema: "network.xyo.schema" & {
77
+ readonly __schema: true;
78
+ };
79
+ definition: {
80
+ [x: string]: unknown;
81
+ $id?: string | undefined;
82
+ };
83
+ extends?: string | undefined;
84
+ name?: string | undefined;
85
+ version?: number | undefined;
86
+ }) | undefined;
87
+ <T>(value: T, assert: import("@xylabs/sdk-js").ZodFactoryConfig): T & {
88
+ schema: "network.xyo.schema" & {
89
+ readonly __schema: true;
90
+ };
91
+ definition: {
92
+ [x: string]: unknown;
93
+ $id?: string | undefined;
94
+ };
95
+ extends?: string | undefined;
96
+ name?: string | undefined;
97
+ version?: number | undefined;
98
+ };
99
+ };
16
100
  //# sourceMappingURL=Condition.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Condition.d.ts","sourceRoot":"","sources":["../../../../../../src/Discount/Payload/Coupon/types/Condition.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAKxD;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,aAAa,CAAA;AAErC;;GAEG;AACH,eAAO,MAAM,WAAW,qCAAiD,CAAA;AACzE,eAAO,MAAM,WAAW,wDAAsC,CAAA;AAE9D;;EAEE;AACF,eAAO,MAAM,sBAAsB,gFAA4D,CAAA;AAC/F,eAAO,MAAM,sBAAsB,mGAAiD,CAAA"}
1
+ {"version":3,"file":"Condition.d.ts","sourceRoot":"","sources":["../../../../../../src/Discount/Payload/Coupon/types/Condition.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAExD,OAAO,KAAK,CAAC,MAAM,UAAU,CAAA;AAE7B;;GAEG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;EACiF,CAAA;AAE1G;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,aAAa,CAAA;AAErC;;GAEG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;CAA6B,CAAA;AACrD,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;CAA4C,CAAA;AACpE,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;CAA4C,CAAA"}
@@ -1,16 +1,12 @@
1
- import type { Hash } from '@xylabs/sdk-js';
2
- import type { DurationFields } from '@xyo-network/xns-record-payload-plugins';
1
+ import * as z from 'zod/mini';
3
2
  /**
4
3
  * The fields that are common across all coupons
5
4
  */
6
- export interface CouponFields extends DurationFields {
7
- /**
8
- * The conditions that must be met in order for this coupon to be applied
9
- */
10
- conditions?: Hash[];
11
- /**
12
- * Whether or not this discount can be stacked with other discounts
13
- */
14
- stackable?: boolean;
15
- }
5
+ export declare const CouponFieldsZod: z.ZodMiniObject<{
6
+ conditions: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<import("@xylabs/sdk-js").BrandedHash, string>>>>;
7
+ exp: z.ZodMiniNumber<number>;
8
+ nbf: z.ZodMiniNumber<number>;
9
+ stackable: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
10
+ }, z.core.$strip>;
11
+ export type CouponFields = z.infer<typeof CouponFieldsZod>;
16
12
  //# sourceMappingURL=CouponFields.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CouponFields.d.ts","sourceRoot":"","sources":["../../../../../../src/Discount/Payload/Coupon/types/CouponFields.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAA;AAE7E;;GAEG;AACH,MAAM,WAAW,YAAa,SAAQ,cAAc;IAClD;;OAEG;IACH,UAAU,CAAC,EAAE,IAAI,EAAE,CAAA;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB"}
1
+ {"version":3,"file":"CouponFields.d.ts","sourceRoot":"","sources":["../../../../../../src/Discount/Payload/Coupon/types/CouponFields.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,UAAU,CAAA;AAE7B;;GAEG;AACH,eAAO,MAAM,eAAe;;;;;iBAiB1B,CAAA;AAEF,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAA"}
@@ -1,25 +1,64 @@
1
- import type { Payload, WithSources } from '@xyo-network/sdk-js';
2
- import type { AmountFields } from '../../Amount/index.ts';
1
+ import * as z from 'zod/mini';
3
2
  export declare const DiscountSchema: "network.xyo.payments.discount" & {
4
3
  readonly __schema: true;
5
4
  };
6
5
  export type DiscountSchema = typeof DiscountSchema;
7
- export interface DiscountFields extends AmountFields {
8
- }
6
+ export declare const DiscountFieldsZod: z.ZodMiniObject<{
7
+ amount: z.ZodMiniNumber<number>;
8
+ currency: z.ZodMiniCustom<import("../../Amount/Iso4217Currency.ts").Iso4217AlphabeticalCode, import("../../Amount/Iso4217Currency.ts").Iso4217AlphabeticalCode>;
9
+ }, z.core.$strip>;
10
+ export type DiscountFields = z.infer<typeof DiscountFieldsZod>;
9
11
  /**
10
12
  * The result of a discount
11
13
  */
12
- export type Discount = Payload<DiscountFields, DiscountSchema>;
14
+ export declare const DiscountZod: z.ZodMiniObject<{
15
+ schema: z.ZodMiniLiteral<"network.xyo.payments.discount" & {
16
+ readonly __schema: true;
17
+ }>;
18
+ amount: z.ZodMiniNumber<number>;
19
+ currency: z.ZodMiniCustom<import("../../Amount/Iso4217Currency.ts").Iso4217AlphabeticalCode, import("../../Amount/Iso4217Currency.ts").Iso4217AlphabeticalCode>;
20
+ }, z.core.$strip>;
21
+ export type Discount = z.infer<typeof DiscountZod>;
13
22
  /**
14
23
  * Identity function for determining if an object is an Discount
15
24
  */
16
- export declare const isDiscount: (x?: unknown) => x is Discount;
17
- export declare const asDiscount: import("@xylabs/sdk-js").AsTypeFunction<Discount>;
18
- export declare const asOptionalDiscount: (value: import("@xylabs/sdk-js").AnyNonPromise) => Discount | undefined;
19
- /**
20
- * Identity function for determining if an object is an Discount with sources
21
- */
22
- export declare const isDiscountWithSources: (x?: unknown) => x is WithSources<Discount>;
23
- export declare const asDiscountWithSources: import("@xylabs/sdk-js").AsTypeFunction<WithSources<Discount>>;
24
- export declare const asOptionalDiscountWithSources: (value: import("@xylabs/sdk-js").AnyNonPromise) => WithSources<Discount> | undefined;
25
+ export declare const isDiscount: <T>(value: T) => value is T & {
26
+ schema: "network.xyo.payments.discount" & {
27
+ readonly __schema: true;
28
+ };
29
+ amount: number;
30
+ currency: import("../../Amount/Iso4217Currency.ts").Iso4217AlphabeticalCode;
31
+ };
32
+ export declare const asDiscount: {
33
+ <T>(value: T): (T & {
34
+ schema: "network.xyo.payments.discount" & {
35
+ readonly __schema: true;
36
+ };
37
+ amount: number;
38
+ currency: import("../../Amount/Iso4217Currency.ts").Iso4217AlphabeticalCode;
39
+ }) | undefined;
40
+ <T>(value: T, assert: import("@xylabs/sdk-js").ZodFactoryConfig): T & {
41
+ schema: "network.xyo.payments.discount" & {
42
+ readonly __schema: true;
43
+ };
44
+ amount: number;
45
+ currency: import("../../Amount/Iso4217Currency.ts").Iso4217AlphabeticalCode;
46
+ };
47
+ };
48
+ export declare const toDiscount: {
49
+ <T>(value: T): (T & {
50
+ schema: "network.xyo.payments.discount" & {
51
+ readonly __schema: true;
52
+ };
53
+ amount: number;
54
+ currency: import("../../Amount/Iso4217Currency.ts").Iso4217AlphabeticalCode;
55
+ }) | undefined;
56
+ <T>(value: T, assert: import("@xylabs/sdk-js").ZodFactoryConfig): T & {
57
+ schema: "network.xyo.payments.discount" & {
58
+ readonly __schema: true;
59
+ };
60
+ amount: number;
61
+ currency: import("../../Amount/Iso4217Currency.ts").Iso4217AlphabeticalCode;
62
+ };
63
+ };
25
64
  //# sourceMappingURL=Discount.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Discount.d.ts","sourceRoot":"","sources":["../../../../src/Discount/Payload/Discount.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAO/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAEzD,eAAO,MAAM,cAAc;;CAAkD,CAAA;AAC7E,MAAM,MAAM,cAAc,GAAG,OAAO,cAAc,CAAA;AAElD,MAAM,WAAW,cAAe,SAAQ,YAAY;CAAI;AAExD;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,OAAO,CAAC,cAAc,EAAE,cAAc,CAAC,CAAA;AAE9D;;GAEG;AACH,eAAO,MAAM,UAAU,gCAAkD,CAAA;AACzE,eAAO,MAAM,UAAU,mDAA+C,CAAA;AACtE,eAAO,MAAM,kBAAkB,yEAAuD,CAAA;AAEtF;;GAEG;AACH,eAAO,MAAM,qBAAqB,6CAA6D,CAAA;AAC/F,eAAO,MAAM,qBAAqB,gEAAuE,CAAA;AACzG,eAAO,MAAM,6BAA6B,sFAA+E,CAAA"}
1
+ {"version":3,"file":"Discount.d.ts","sourceRoot":"","sources":["../../../../src/Discount/Payload/Discount.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,UAAU,CAAA;AAI7B,eAAO,MAAM,cAAc;;CAAkD,CAAA;AAC7E,MAAM,MAAM,cAAc,GAAG,OAAO,cAAc,CAAA;AAElD,eAAO,MAAM,iBAAiB;;;iBAAyC,CAAA;AAEvE,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAA;AAE9D;;GAEG;AACH,eAAO,MAAM,WAAW;;;;;;iBAA+E,CAAA;AAEvG,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAA;AAElD;;GAEG;AACH,eAAO,MAAM,UAAU;;;;;;CAA4B,CAAA;AACnD,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;CAA0C,CAAA;AACjE,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;CAA0C,CAAA"}
@@ -1,5 +1,4 @@
1
- import type { Hash } from '@xylabs/sdk-js';
2
- import type { PayloadWithSources, WithSources } from '@xyo-network/sdk-js';
1
+ import * as z from 'zod/mini';
3
2
  export declare const EscrowOutcomeSchema: string & {
4
3
  readonly __schema: true;
5
4
  };
@@ -7,25 +6,73 @@ export type EscrowOutcomeSchema = typeof EscrowOutcomeSchema;
7
6
  /**
8
7
  * The possible outcomes for an escrow
9
8
  */
10
- export type EscrowOutcomes = 'fulfilled' | 'expired';
11
- export interface EscrowOutcomeFields {
12
- outcome: EscrowOutcomes;
13
- terms: Hash;
14
- }
9
+ export declare const EscrowOutcomesZod: z.ZodMiniEnum<{
10
+ fulfilled: "fulfilled";
11
+ expired: "expired";
12
+ }>;
13
+ export type EscrowOutcomes = z.infer<typeof EscrowOutcomesZod>;
14
+ export declare const EscrowOutcomeFieldsZod: z.ZodMiniObject<{
15
+ outcome: z.ZodMiniEnum<{
16
+ fulfilled: "fulfilled";
17
+ expired: "expired";
18
+ }>;
19
+ terms: z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<import("@xylabs/sdk-js").BrandedHash, string>>;
20
+ }, z.core.$strip>;
21
+ export type EscrowOutcomeFields = z.infer<typeof EscrowOutcomeFieldsZod>;
15
22
  /**
16
23
  * The terms of an escrow
17
24
  */
18
- export type EscrowOutcome = PayloadWithSources<EscrowOutcomeFields, EscrowOutcomeSchema>;
25
+ export declare const EscrowOutcomeZod: z.ZodMiniObject<{
26
+ schema: z.ZodMiniLiteral<string & {
27
+ readonly __schema: true;
28
+ }>;
29
+ outcome: z.ZodMiniEnum<{
30
+ fulfilled: "fulfilled";
31
+ expired: "expired";
32
+ }>;
33
+ terms: z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<import("@xylabs/sdk-js").BrandedHash, string>>;
34
+ }, z.core.$strip>;
35
+ export type EscrowOutcome = z.infer<typeof EscrowOutcomeZod>;
19
36
  /**
20
37
  * Identity function for determining if an object is an EscrowOutcome
21
38
  */
22
- export declare const isEscrowOutcome: (x?: unknown) => x is EscrowOutcome;
23
- export declare const asEscrowOutcome: import("@xylabs/sdk-js").AsTypeFunction<EscrowOutcome>;
24
- export declare const asOptionalEscrowOutcome: (value: import("@xylabs/sdk-js").AnyNonPromise) => EscrowOutcome | undefined;
25
- /**
26
- * Identity function for determining if an object is an EscrowOutcome with sources
27
- */
28
- export declare const isEscrowOutcomeWithSources: (x?: unknown) => x is WithSources<EscrowOutcome>;
29
- export declare const asEscrowOutcomeWithSources: (value: import("@xylabs/sdk-js").AnyNonPromise) => WithSources<EscrowOutcome> | undefined;
30
- export declare const asOptionalEscrowOutcomeWithSources: (value: import("@xylabs/sdk-js").AnyNonPromise) => WithSources<EscrowOutcome> | undefined;
39
+ export declare const isEscrowOutcome: <T>(value: T) => value is T & {
40
+ schema: string & {
41
+ readonly __schema: true;
42
+ };
43
+ outcome: "fulfilled" | "expired";
44
+ terms: import("@xylabs/sdk-js").BrandedHash;
45
+ };
46
+ export declare const asEscrowOutcome: {
47
+ <T>(value: T): (T & {
48
+ schema: string & {
49
+ readonly __schema: true;
50
+ };
51
+ outcome: "fulfilled" | "expired";
52
+ terms: import("@xylabs/sdk-js").BrandedHash;
53
+ }) | undefined;
54
+ <T>(value: T, assert: import("@xylabs/sdk-js").ZodFactoryConfig): T & {
55
+ schema: string & {
56
+ readonly __schema: true;
57
+ };
58
+ outcome: "fulfilled" | "expired";
59
+ terms: import("@xylabs/sdk-js").BrandedHash;
60
+ };
61
+ };
62
+ export declare const toEscrowOutcome: {
63
+ <T>(value: T): (T & {
64
+ schema: string & {
65
+ readonly __schema: true;
66
+ };
67
+ outcome: "fulfilled" | "expired";
68
+ terms: import("@xylabs/sdk-js").BrandedHash;
69
+ }) | undefined;
70
+ <T>(value: T, assert: import("@xylabs/sdk-js").ZodFactoryConfig): T & {
71
+ schema: string & {
72
+ readonly __schema: true;
73
+ };
74
+ outcome: "fulfilled" | "expired";
75
+ terms: import("@xylabs/sdk-js").BrandedHash;
76
+ };
77
+ };
31
78
  //# sourceMappingURL=Outcome.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Outcome.d.ts","sourceRoot":"","sources":["../../../src/Escrow/Outcome.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAE1C,OAAO,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAS1E,eAAO,MAAM,mBAAmB;;CAA4C,CAAA;AAC5E,MAAM,MAAM,mBAAmB,GAAG,OAAO,mBAAmB,CAAA;AAE5D;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,WAAW,GAAG,SAAS,CAAA;AAEpD,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,cAAc,CAAA;IACvB,KAAK,EAAE,IAAI,CAAA;CACZ;AAED;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,kBAAkB,CAAC,mBAAmB,EAAE,mBAAmB,CAAC,CAAA;AAExF;;GAEG;AACH,eAAO,MAAM,eAAe,qCAA4D,CAAA;AACxF,eAAO,MAAM,eAAe,wDAAyD,CAAA;AACrF,eAAO,MAAM,uBAAuB,8EAAiE,CAAA;AAErG;;GAEG;AACH,eAAO,MAAM,0BAA0B,kDAAuE,CAAA;AAC9G,eAAO,MAAM,0BAA0B,2FAAyF,CAAA;AAChI,eAAO,MAAM,kCAAkC,2FAAyF,CAAA"}
1
+ {"version":3,"file":"Outcome.d.ts","sourceRoot":"","sources":["../../../src/Escrow/Outcome.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,UAAU,CAAA;AAI7B,eAAO,MAAM,mBAAmB;;CAA4C,CAAA;AAC5E,MAAM,MAAM,mBAAmB,GAAG,OAAO,mBAAmB,CAAA;AAE5D;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;EAAmC,CAAA;AAEjE,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAA;AAE9D,eAAO,MAAM,sBAAsB;;;;;;iBAGjC,CAAA;AAEF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAA;AAExE;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;iBAAyF,CAAA;AAEtH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAA;AAE5D;;GAEG;AACH,eAAO,MAAM,eAAe;;;;;;CAAiC,CAAA;AAC7D,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;CAAoD,CAAA;AAChF,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;CAAoD,CAAA"}