@xyo-network/payment-payload-plugins 6.0.3 → 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 (52) hide show
  1. package/README.md +5 -0
  2. package/dist/neutral/Amount/Iso4217Currency.d.ts.map +1 -1
  3. package/dist/neutral/Amount/Payload.d.ts +56 -15
  4. package/dist/neutral/Amount/Payload.d.ts.map +1 -1
  5. package/dist/neutral/Billing/Address/Address.d.ts +102 -32
  6. package/dist/neutral/Billing/Address/Address.d.ts.map +1 -1
  7. package/dist/neutral/Currency.d.ts +5 -1
  8. package/dist/neutral/Currency.d.ts.map +1 -1
  9. package/dist/neutral/Discount/Payload/Coupon/Coupons/FixedAmount.d.ts +81 -15
  10. package/dist/neutral/Discount/Payload/Coupon/Coupons/FixedAmount.d.ts.map +1 -1
  11. package/dist/neutral/Discount/Payload/Coupon/Coupons/FixedPercentage.d.ts +74 -15
  12. package/dist/neutral/Discount/Payload/Coupon/Coupons/FixedPercentage.d.ts.map +1 -1
  13. package/dist/neutral/Discount/Payload/Coupon/Coupons/FixedPrice.d.ts +81 -15
  14. package/dist/neutral/Discount/Payload/Coupon/Coupons/FixedPrice.d.ts.map +1 -1
  15. package/dist/neutral/Discount/Payload/Coupon/Payload.d.ts +186 -9
  16. package/dist/neutral/Discount/Payload/Coupon/Payload.d.ts.map +1 -1
  17. package/dist/neutral/Discount/Payload/Coupon/types/Condition.d.ts +91 -7
  18. package/dist/neutral/Discount/Payload/Coupon/types/Condition.d.ts.map +1 -1
  19. package/dist/neutral/Discount/Payload/Coupon/types/CouponFields.d.ts +8 -12
  20. package/dist/neutral/Discount/Payload/Coupon/types/CouponFields.d.ts.map +1 -1
  21. package/dist/neutral/Discount/Payload/Discount.d.ts +53 -14
  22. package/dist/neutral/Discount/Payload/Discount.d.ts.map +1 -1
  23. package/dist/neutral/Escrow/Outcome.d.ts +64 -17
  24. package/dist/neutral/Escrow/Outcome.d.ts.map +1 -1
  25. package/dist/neutral/Escrow/Terms/Terms.d.ts +303 -62
  26. package/dist/neutral/Escrow/Terms/Terms.d.ts.map +1 -1
  27. package/dist/neutral/Escrow/util/appraisal/getAppraisalsByAsset.d.ts.map +1 -1
  28. package/dist/neutral/Escrow/util/appraisal/getSignaturesByAppraisal.d.ts.map +1 -1
  29. package/dist/neutral/Escrow/util/secret/createEscrowIntent.d.ts +9 -1
  30. package/dist/neutral/Escrow/util/secret/createEscrowIntent.d.ts.map +1 -1
  31. package/dist/neutral/Escrow/util/secret/updateEscrowTermsWithSecret.d.ts +9 -1
  32. package/dist/neutral/Escrow/util/secret/updateEscrowTermsWithSecret.d.ts.map +1 -1
  33. package/dist/neutral/Escrow/validators/common/ModuleInstanceValidators/moduleInstanceValidators.d.ts.map +1 -1
  34. package/dist/neutral/Escrow/validators/common/SecretValidators/getPartySecretSignedValidator.d.ts.map +1 -1
  35. package/dist/neutral/Escrow/validators/escrow/appraisal.d.ts.map +1 -1
  36. package/dist/neutral/Payment/Instrument/Card/Payload.d.ts +74 -34
  37. package/dist/neutral/Payment/Instrument/Card/Payload.d.ts.map +1 -1
  38. package/dist/neutral/Payment/Payload.d.ts +57 -23
  39. package/dist/neutral/Payment/Payload.d.ts.map +1 -1
  40. package/dist/neutral/Payment/Status/Payload.d.ts +53 -22
  41. package/dist/neutral/Payment/Status/Payload.d.ts.map +1 -1
  42. package/dist/neutral/Purchase/Payload.d.ts +53 -24
  43. package/dist/neutral/Purchase/Payload.d.ts.map +1 -1
  44. package/dist/neutral/Receipt/Payload.d.ts +57 -23
  45. package/dist/neutral/Receipt/Payload.d.ts.map +1 -1
  46. package/dist/neutral/Subtotal/Diviner/Payload.d.ts +53 -14
  47. package/dist/neutral/Subtotal/Diviner/Payload.d.ts.map +1 -1
  48. package/dist/neutral/Total/Diviner/Payload.d.ts +53 -14
  49. package/dist/neutral/Total/Diviner/Payload.d.ts.map +1 -1
  50. package/dist/neutral/index.mjs +475 -275
  51. package/dist/neutral/index.mjs.map +4 -4
  52. package/package.json +20 -24
@@ -1,30 +1,64 @@
1
- import type { PayloadWithSources, WithSources } from '@xyo-network/sdk-js';
2
- import type { SupportedCurrency } from '../Currency.ts';
3
- import { PaymentSchema } from './Schema.ts';
4
- export interface PaymentFields {
5
- /**
6
- * The amount paid
7
- */
8
- amount: number;
9
- /**
10
- * The currency of the amount paid
11
- */
12
- currency: SupportedCurrency;
13
- }
1
+ import * as z from 'zod/mini';
2
+ export declare const PaymentFieldsZod: z.ZodMiniObject<{
3
+ amount: z.ZodMiniNumber<number>;
4
+ currency: z.ZodMiniEnum<{
5
+ USD: "USD";
6
+ }>;
7
+ }, z.core.$strip>;
8
+ export type PaymentFields = z.infer<typeof PaymentFieldsZod>;
14
9
  /**
15
10
  * A payment is a record of an amount to be paid
16
11
  */
17
- export type Payment = PayloadWithSources<PaymentFields, PaymentSchema>;
12
+ export declare const PaymentZod: z.ZodMiniObject<{
13
+ schema: z.ZodMiniLiteral<string & {
14
+ readonly __schema: true;
15
+ }>;
16
+ amount: z.ZodMiniNumber<number>;
17
+ currency: z.ZodMiniEnum<{
18
+ USD: "USD";
19
+ }>;
20
+ }, z.core.$strip>;
21
+ export type Payment = z.infer<typeof PaymentZod>;
18
22
  /**
19
23
  * Identity function for determine if an object is a Payment
20
24
  */
21
- export declare const isPayment: (x?: unknown) => x is Payment;
22
- export declare const asPayment: import("@xylabs/sdk-js").AsTypeFunction<Payment>;
23
- export declare const asOptionalPayment: (value: import("@xylabs/sdk-js").AnyNonPromise) => Payment | undefined;
24
- /**
25
- * Identity function for determine if an object is a Payment with sources
26
- */
27
- export declare const isPaymentWithSources: (x?: unknown) => x is WithSources<Payment>;
28
- export declare const asPaymentWithSources: import("@xylabs/sdk-js").AsTypeFunction<WithSources<Payment>>;
29
- export declare const asOptionalPaymentWithSources: (value: import("@xylabs/sdk-js").AnyNonPromise) => WithSources<Payment> | undefined;
25
+ export declare const isPayment: <T>(value: T) => value is T & {
26
+ schema: string & {
27
+ readonly __schema: true;
28
+ };
29
+ amount: number;
30
+ currency: "USD";
31
+ };
32
+ export declare const asPayment: {
33
+ <T>(value: T): (T & {
34
+ schema: string & {
35
+ readonly __schema: true;
36
+ };
37
+ amount: number;
38
+ currency: "USD";
39
+ }) | undefined;
40
+ <T>(value: T, assert: import("@xylabs/sdk-js").ZodFactoryConfig): T & {
41
+ schema: string & {
42
+ readonly __schema: true;
43
+ };
44
+ amount: number;
45
+ currency: "USD";
46
+ };
47
+ };
48
+ export declare const toPayment: {
49
+ <T>(value: T): (T & {
50
+ schema: string & {
51
+ readonly __schema: true;
52
+ };
53
+ amount: number;
54
+ currency: "USD";
55
+ }) | undefined;
56
+ <T>(value: T, assert: import("@xylabs/sdk-js").ZodFactoryConfig): T & {
57
+ schema: string & {
58
+ readonly __schema: true;
59
+ };
60
+ amount: number;
61
+ currency: "USD";
62
+ };
63
+ };
30
64
  //# sourceMappingURL=Payload.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Payload.d.ts","sourceRoot":"","sources":["../../../src/Payment/Payload.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAM1E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAE3C,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,MAAM,EAAE,MAAM,CAAA;IACd;;OAEG;IACH,QAAQ,EAAE,iBAAiB,CAAA;CAC5B;AAED;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG,kBAAkB,CAAC,aAAa,EAAE,aAAa,CAAC,CAAA;AAEtE;;GAEG;AACH,eAAO,MAAM,SAAS,+BAAgD,CAAA;AACtE,eAAO,MAAM,SAAS,kDAA6C,CAAA;AACnE,eAAO,MAAM,iBAAiB,wEAAqD,CAAA;AAEnF;;GAEG;AACH,eAAO,MAAM,oBAAoB,4CAA2D,CAAA;AAC5F,eAAO,MAAM,oBAAoB,+DAAqE,CAAA;AACtG,eAAO,MAAM,4BAA4B,qFAA6E,CAAA"}
1
+ {"version":3,"file":"Payload.d.ts","sourceRoot":"","sources":["../../../src/Payment/Payload.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,UAAU,CAAA;AAK7B,eAAO,MAAM,gBAAgB;;;;;iBAS3B,CAAA;AAEF,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAA;AAE5D;;GAEG;AACH,eAAO,MAAM,UAAU;;;;;;;;iBAA6E,CAAA;AAEpG,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAA;AAEhD;;GAEG;AACH,eAAO,MAAM,SAAS;;;;;;CAA2B,CAAA;AACjD,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;CAAwC,CAAA;AAC9D,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;CAAwC,CAAA"}
@@ -1,29 +1,60 @@
1
- import type { PayloadWithSources, WithSources } from '@xyo-network/sdk-js';
2
- import { PaymentStatusSchema } from './Schema.ts';
3
- export interface PaymentStatusFields {
4
- /**
5
- * The result of the payment (i.e. declined)
6
- */
7
- result?: string;
8
- /**
9
- * The status of the payment (i.e. completed)
10
- */
11
- status: string;
12
- }
1
+ import * as z from 'zod/mini';
2
+ export declare const PaymentStatusFieldsZod: z.ZodMiniObject<{
3
+ result: z.ZodMiniOptional<z.ZodMiniString<string>>;
4
+ status: z.ZodMiniString<string>;
5
+ }, z.core.$strip>;
6
+ export type PaymentStatusFields = z.infer<typeof PaymentStatusFieldsZod>;
13
7
  /**
14
8
  * A payment status is the outcome of a payment attempt
15
9
  */
16
- export type PaymentStatus = PayloadWithSources<PaymentStatusFields, PaymentStatusSchema>;
10
+ export declare const PaymentStatusZod: z.ZodMiniObject<{
11
+ schema: z.ZodMiniLiteral<string & {
12
+ readonly __schema: true;
13
+ }>;
14
+ result: z.ZodMiniOptional<z.ZodMiniString<string>>;
15
+ status: z.ZodMiniString<string>;
16
+ }, z.core.$strip>;
17
+ export type PaymentStatus = z.infer<typeof PaymentStatusZod>;
17
18
  /**
18
19
  * Identity function for determine if an object is a PaymentStatus
19
20
  */
20
- export declare const isPaymentStatus: (x?: unknown) => x is PaymentStatus;
21
- export declare const asPaymentStatus: import("@xylabs/sdk-js").AsTypeFunction<PaymentStatus>;
22
- export declare const asOptionalPaymentStatus: (value: import("@xylabs/sdk-js").AnyNonPromise) => PaymentStatus | undefined;
23
- /**
24
- * Identity function for determine if an object is a PaymentStatus with sources
25
- */
26
- export declare const isPaymentStatusWithSources: (x?: unknown) => x is WithSources<PaymentStatus>;
27
- export declare const asPaymentStatusWithSources: import("@xylabs/sdk-js").AsTypeFunction<WithSources<PaymentStatus>>;
28
- export declare const asOptionalPaymentStatusWithSources: (value: import("@xylabs/sdk-js").AnyNonPromise) => WithSources<PaymentStatus> | undefined;
21
+ export declare const isPaymentStatus: <T>(value: T) => value is T & {
22
+ schema: string & {
23
+ readonly __schema: true;
24
+ };
25
+ status: string;
26
+ result?: string | undefined;
27
+ };
28
+ export declare const asPaymentStatus: {
29
+ <T>(value: T): (T & {
30
+ schema: string & {
31
+ readonly __schema: true;
32
+ };
33
+ status: string;
34
+ result?: string | undefined;
35
+ }) | undefined;
36
+ <T>(value: T, assert: import("@xylabs/sdk-js").ZodFactoryConfig): T & {
37
+ schema: string & {
38
+ readonly __schema: true;
39
+ };
40
+ status: string;
41
+ result?: string | undefined;
42
+ };
43
+ };
44
+ export declare const toPaymentStatus: {
45
+ <T>(value: T): (T & {
46
+ schema: string & {
47
+ readonly __schema: true;
48
+ };
49
+ status: string;
50
+ result?: string | undefined;
51
+ }) | undefined;
52
+ <T>(value: T, assert: import("@xylabs/sdk-js").ZodFactoryConfig): T & {
53
+ schema: string & {
54
+ readonly __schema: true;
55
+ };
56
+ status: string;
57
+ result?: string | undefined;
58
+ };
59
+ };
29
60
  //# sourceMappingURL=Payload.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Payload.d.ts","sourceRoot":"","sources":["../../../../src/Payment/Status/Payload.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAM1E,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAEjD,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IAEf;;OAEG;IACH,MAAM,EAAE,MAAM,CAAA;CACf;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,qEAAiF,CAAA;AACxH,eAAO,MAAM,kCAAkC,2FAAyF,CAAA"}
1
+ {"version":3,"file":"Payload.d.ts","sourceRoot":"","sources":["../../../../src/Payment/Status/Payload.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,UAAU,CAAA;AAI7B,eAAO,MAAM,sBAAsB;;;iBASjC,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"}
@@ -1,31 +1,60 @@
1
- import type { Hash } from '@xylabs/sdk-js';
2
- import type { PayloadWithSources, WithSources } from '@xyo-network/sdk-js';
3
- import { PurchaseSchema } from './Schema.ts';
4
- export interface PurchaseFields {
5
- /**
6
- * The things that were purchased
7
- */
8
- assets: Hash[];
9
- /**
10
- * The receipts for payments for this purchase. Array to allow for multiple payments
11
- * for a single quote.
12
- */
13
- receipts: Hash[];
14
- }
1
+ import * as z from 'zod/mini';
2
+ export declare const PurchaseFieldsZod: z.ZodMiniObject<{
3
+ assets: z.ZodMiniArray<z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<import("@xylabs/sdk-js").BrandedHash, string>>>;
4
+ receipts: z.ZodMiniArray<z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<import("@xylabs/sdk-js").BrandedHash, string>>>;
5
+ }, z.core.$strip>;
6
+ export type PurchaseFields = z.infer<typeof PurchaseFieldsZod>;
15
7
  /**
16
8
  * A purchase ties a payment made to a quote
17
9
  */
18
- export type Purchase = PayloadWithSources<PurchaseFields, PurchaseSchema>;
10
+ export declare const PurchaseZod: z.ZodMiniObject<{
11
+ schema: z.ZodMiniLiteral<string & {
12
+ readonly __schema: true;
13
+ }>;
14
+ assets: z.ZodMiniArray<z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<import("@xylabs/sdk-js").BrandedHash, string>>>;
15
+ receipts: z.ZodMiniArray<z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<import("@xylabs/sdk-js").BrandedHash, string>>>;
16
+ }, z.core.$strip>;
17
+ export type Purchase = z.infer<typeof PurchaseZod>;
19
18
  /**
20
19
  * Identity function for determine if an object is a Purchase
21
20
  */
22
- export declare const isPurchase: (x?: unknown) => x is Purchase;
23
- export declare const asPurchase: import("@xylabs/sdk-js").AsTypeFunction<Purchase>;
24
- export declare const asOptionalPurchase: (value: import("@xylabs/sdk-js").AnyNonPromise) => Purchase | undefined;
25
- /**
26
- * Identity function for determine if an object is a Purchase with sources
27
- */
28
- export declare const isPurchaseWithSources: (x?: unknown) => x is WithSources<Purchase>;
29
- export declare const asPurchaseWithSources: import("@xylabs/sdk-js").AsTypeFunction<WithSources<Purchase>>;
30
- export declare const asOptionalPurchaseWithSources: (value: import("@xylabs/sdk-js").AnyNonPromise) => WithSources<Purchase> | undefined;
21
+ export declare const isPurchase: <T>(value: T) => value is T & {
22
+ schema: string & {
23
+ readonly __schema: true;
24
+ };
25
+ assets: import("@xylabs/sdk-js").BrandedHash[];
26
+ receipts: import("@xylabs/sdk-js").BrandedHash[];
27
+ };
28
+ export declare const asPurchase: {
29
+ <T>(value: T): (T & {
30
+ schema: string & {
31
+ readonly __schema: true;
32
+ };
33
+ assets: import("@xylabs/sdk-js").BrandedHash[];
34
+ receipts: import("@xylabs/sdk-js").BrandedHash[];
35
+ }) | undefined;
36
+ <T>(value: T, assert: import("@xylabs/sdk-js").ZodFactoryConfig): T & {
37
+ schema: string & {
38
+ readonly __schema: true;
39
+ };
40
+ assets: import("@xylabs/sdk-js").BrandedHash[];
41
+ receipts: import("@xylabs/sdk-js").BrandedHash[];
42
+ };
43
+ };
44
+ export declare const toPurchase: {
45
+ <T>(value: T): (T & {
46
+ schema: string & {
47
+ readonly __schema: true;
48
+ };
49
+ assets: import("@xylabs/sdk-js").BrandedHash[];
50
+ receipts: import("@xylabs/sdk-js").BrandedHash[];
51
+ }) | undefined;
52
+ <T>(value: T, assert: import("@xylabs/sdk-js").ZodFactoryConfig): T & {
53
+ schema: string & {
54
+ readonly __schema: true;
55
+ };
56
+ assets: import("@xylabs/sdk-js").BrandedHash[];
57
+ receipts: import("@xylabs/sdk-js").BrandedHash[];
58
+ };
59
+ };
31
60
  //# sourceMappingURL=Payload.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Payload.d.ts","sourceRoot":"","sources":["../../../src/Purchase/Payload.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAE1C,OAAO,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAM1E,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAE5C,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,MAAM,EAAE,IAAI,EAAE,CAAA;IACd;;;OAGG;IACH,QAAQ,EAAE,IAAI,EAAE,CAAA;CACjB;AAED;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,kBAAkB,CAAC,cAAc,EAAE,cAAc,CAAC,CAAA;AAEzE;;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":"Payload.d.ts","sourceRoot":"","sources":["../../../src/Purchase/Payload.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,UAAU,CAAA;AAI7B,eAAO,MAAM,iBAAiB;;;iBAU5B,CAAA;AAEF,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,30 +1,64 @@
1
- import type { PayloadWithSources, WithSources } from '@xyo-network/sdk-js';
2
- import type { SupportedCurrency } from '../Currency.ts';
3
- import { ReceiptSchema } from './Schema.ts';
4
- export interface ReceiptFields {
5
- /**
6
- * The amount paid
7
- */
8
- amount: number;
9
- /**
10
- * The currency of the amount paid
11
- */
12
- currency: SupportedCurrency;
13
- }
1
+ import * as z from 'zod/mini';
2
+ export declare const ReceiptFieldsZod: z.ZodMiniObject<{
3
+ amount: z.ZodMiniNumber<number>;
4
+ currency: z.ZodMiniEnum<{
5
+ USD: "USD";
6
+ }>;
7
+ }, z.core.$strip>;
8
+ export type ReceiptFields = z.infer<typeof ReceiptFieldsZod>;
14
9
  /**
15
10
  * A receipt is a record of a payment made
16
11
  */
17
- export type Receipt = PayloadWithSources<ReceiptFields, ReceiptSchema>;
12
+ export declare const ReceiptZod: z.ZodMiniObject<{
13
+ schema: z.ZodMiniLiteral<string & {
14
+ readonly __schema: true;
15
+ }>;
16
+ amount: z.ZodMiniNumber<number>;
17
+ currency: z.ZodMiniEnum<{
18
+ USD: "USD";
19
+ }>;
20
+ }, z.core.$strip>;
21
+ export type Receipt = z.infer<typeof ReceiptZod>;
18
22
  /**
19
23
  * Identity function for determine if an object is a Receipt
20
24
  */
21
- export declare const isReceipt: (x?: unknown) => x is Receipt;
22
- export declare const asReceipt: import("@xylabs/sdk-js").AsTypeFunction<Receipt>;
23
- export declare const asOptionalReceipt: (value: import("@xylabs/sdk-js").AnyNonPromise) => Receipt | undefined;
24
- /**
25
- * Identity function for determine if an object is a Receipt with sources
26
- */
27
- export declare const isReceiptWithSources: (x?: unknown) => x is WithSources<Receipt>;
28
- export declare const asReceiptWithSources: import("@xylabs/sdk-js").AsTypeFunction<WithSources<Receipt>>;
29
- export declare const asOptionalReceiptWithSources: (value: import("@xylabs/sdk-js").AnyNonPromise) => WithSources<Receipt> | undefined;
25
+ export declare const isReceipt: <T>(value: T) => value is T & {
26
+ schema: string & {
27
+ readonly __schema: true;
28
+ };
29
+ amount: number;
30
+ currency: "USD";
31
+ };
32
+ export declare const asReceipt: {
33
+ <T>(value: T): (T & {
34
+ schema: string & {
35
+ readonly __schema: true;
36
+ };
37
+ amount: number;
38
+ currency: "USD";
39
+ }) | undefined;
40
+ <T>(value: T, assert: import("@xylabs/sdk-js").ZodFactoryConfig): T & {
41
+ schema: string & {
42
+ readonly __schema: true;
43
+ };
44
+ amount: number;
45
+ currency: "USD";
46
+ };
47
+ };
48
+ export declare const toReceipt: {
49
+ <T>(value: T): (T & {
50
+ schema: string & {
51
+ readonly __schema: true;
52
+ };
53
+ amount: number;
54
+ currency: "USD";
55
+ }) | undefined;
56
+ <T>(value: T, assert: import("@xylabs/sdk-js").ZodFactoryConfig): T & {
57
+ schema: string & {
58
+ readonly __schema: true;
59
+ };
60
+ amount: number;
61
+ currency: "USD";
62
+ };
63
+ };
30
64
  //# sourceMappingURL=Payload.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Payload.d.ts","sourceRoot":"","sources":["../../../src/Receipt/Payload.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAM1E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAE3C,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,MAAM,EAAE,MAAM,CAAA;IACd;;OAEG;IACH,QAAQ,EAAE,iBAAiB,CAAA;CAC5B;AAED;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG,kBAAkB,CAAC,aAAa,EAAE,aAAa,CAAC,CAAA;AAEtE;;GAEG;AACH,eAAO,MAAM,SAAS,+BAAgD,CAAA;AACtE,eAAO,MAAM,SAAS,kDAA6C,CAAA;AACnE,eAAO,MAAM,iBAAiB,wEAAqD,CAAA;AAEnF;;GAEG;AACH,eAAO,MAAM,oBAAoB,4CAA2D,CAAA;AAC5F,eAAO,MAAM,oBAAoB,+DAAqE,CAAA;AACtG,eAAO,MAAM,4BAA4B,qFAA6E,CAAA"}
1
+ {"version":3,"file":"Payload.d.ts","sourceRoot":"","sources":["../../../src/Receipt/Payload.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,UAAU,CAAA;AAK7B,eAAO,MAAM,gBAAgB;;;;;iBAS3B,CAAA;AAEF,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAA;AAE5D;;GAEG;AACH,eAAO,MAAM,UAAU;;;;;;;;iBAA6E,CAAA;AAEpG,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAA;AAEhD;;GAEG;AACH,eAAO,MAAM,SAAS;;;;;;CAA2B,CAAA;AACjD,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;CAAwC,CAAA;AAC9D,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;CAAwC,CAAA"}
@@ -1,25 +1,64 @@
1
- import type { PayloadWithSources, 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 SubtotalSchema: "network.xyo.payments.subtotal" & {
4
3
  readonly __schema: true;
5
4
  };
6
5
  export type SubtotalSchema = typeof SubtotalSchema;
7
- export interface SubtotalFields extends AmountFields {
8
- }
6
+ export declare const SubtotalFieldsZod: 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 SubtotalFields = z.infer<typeof SubtotalFieldsZod>;
9
11
  /**
10
12
  * The result of a subtotal
11
13
  */
12
- export type Subtotal = PayloadWithSources<SubtotalFields, SubtotalSchema>;
14
+ export declare const SubtotalZod: z.ZodMiniObject<{
15
+ schema: z.ZodMiniLiteral<"network.xyo.payments.subtotal" & {
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 Subtotal = z.infer<typeof SubtotalZod>;
13
22
  /**
14
23
  * Identity function for determining if an object is an Subtotal
15
24
  */
16
- export declare const isSubtotal: (x?: unknown) => x is Subtotal;
17
- export declare const asSubtotal: import("@xylabs/sdk-js").AsTypeFunction<Subtotal>;
18
- export declare const asOptionalSubtotal: (value: import("@xylabs/sdk-js").AnyNonPromise) => Subtotal | undefined;
19
- /**
20
- * Identity function for determining if an object is an Subtotal with sources
21
- */
22
- export declare const isSubtotalWithSources: (x?: unknown) => x is WithSources<Subtotal>;
23
- export declare const asSubtotalWithSources: import("@xylabs/sdk-js").AsTypeFunction<WithSources<Subtotal>>;
24
- export declare const asOptionalSubtotalWithSources: (value: import("@xylabs/sdk-js").AnyNonPromise) => WithSources<Subtotal> | undefined;
25
+ export declare const isSubtotal: <T>(value: T) => value is T & {
26
+ schema: "network.xyo.payments.subtotal" & {
27
+ readonly __schema: true;
28
+ };
29
+ amount: number;
30
+ currency: import("../../Amount/Iso4217Currency.ts").Iso4217AlphabeticalCode;
31
+ };
32
+ export declare const asSubtotal: {
33
+ <T>(value: T): (T & {
34
+ schema: "network.xyo.payments.subtotal" & {
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.subtotal" & {
42
+ readonly __schema: true;
43
+ };
44
+ amount: number;
45
+ currency: import("../../Amount/Iso4217Currency.ts").Iso4217AlphabeticalCode;
46
+ };
47
+ };
48
+ export declare const toSubtotal: {
49
+ <T>(value: T): (T & {
50
+ schema: "network.xyo.payments.subtotal" & {
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.subtotal" & {
58
+ readonly __schema: true;
59
+ };
60
+ amount: number;
61
+ currency: import("../../Amount/Iso4217Currency.ts").Iso4217AlphabeticalCode;
62
+ };
63
+ };
25
64
  //# sourceMappingURL=Payload.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Payload.d.ts","sourceRoot":"","sources":["../../../../src/Subtotal/Diviner/Payload.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAO1E,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;CAAG;AAEvD;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,kBAAkB,CAAC,cAAc,EAAE,cAAc,CAAC,CAAA;AAEzE;;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":"Payload.d.ts","sourceRoot":"","sources":["../../../../src/Subtotal/Diviner/Payload.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,25 +1,64 @@
1
- import type { PayloadWithSources, 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 TotalSchema: "network.xyo.payments.total" & {
4
3
  readonly __schema: true;
5
4
  };
6
5
  export type TotalSchema = typeof TotalSchema;
7
- export interface TotalFields extends AmountFields {
8
- }
6
+ export declare const TotalFieldsZod: 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 TotalFields = z.infer<typeof TotalFieldsZod>;
9
11
  /**
10
12
  * The result of a total
11
13
  */
12
- export type Total = PayloadWithSources<TotalFields, TotalSchema>;
14
+ export declare const TotalZod: z.ZodMiniObject<{
15
+ schema: z.ZodMiniLiteral<"network.xyo.payments.total" & {
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 Total = z.infer<typeof TotalZod>;
13
22
  /**
14
23
  * Identity function for determining if an object is an Total
15
24
  */
16
- export declare const isTotal: (x?: unknown) => x is Total;
17
- export declare const asTotal: import("@xylabs/sdk-js").AsTypeFunction<Total>;
18
- export declare const asOptionalTotal: (value: import("@xylabs/sdk-js").AnyNonPromise) => Total | undefined;
19
- /**
20
- * Identity function for determining if an object is an Total with sources
21
- */
22
- export declare const isTotalWithSources: (x?: unknown) => x is WithSources<Total>;
23
- export declare const asTotalWithSources: import("@xylabs/sdk-js").AsTypeFunction<WithSources<Total>>;
24
- export declare const asOptionalTotalWithSources: (value: import("@xylabs/sdk-js").AnyNonPromise) => WithSources<Total> | undefined;
25
+ export declare const isTotal: <T>(value: T) => value is T & {
26
+ schema: "network.xyo.payments.total" & {
27
+ readonly __schema: true;
28
+ };
29
+ amount: number;
30
+ currency: import("../../Amount/Iso4217Currency.ts").Iso4217AlphabeticalCode;
31
+ };
32
+ export declare const asTotal: {
33
+ <T>(value: T): (T & {
34
+ schema: "network.xyo.payments.total" & {
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.total" & {
42
+ readonly __schema: true;
43
+ };
44
+ amount: number;
45
+ currency: import("../../Amount/Iso4217Currency.ts").Iso4217AlphabeticalCode;
46
+ };
47
+ };
48
+ export declare const toTotal: {
49
+ <T>(value: T): (T & {
50
+ schema: "network.xyo.payments.total" & {
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.total" & {
58
+ readonly __schema: true;
59
+ };
60
+ amount: number;
61
+ currency: import("../../Amount/Iso4217Currency.ts").Iso4217AlphabeticalCode;
62
+ };
63
+ };
25
64
  //# sourceMappingURL=Payload.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Payload.d.ts","sourceRoot":"","sources":["../../../../src/Total/Diviner/Payload.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAO1E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAEzD,eAAO,MAAM,WAAW;;CAA+C,CAAA;AACvE,MAAM,MAAM,WAAW,GAAG,OAAO,WAAW,CAAA;AAE5C,MAAM,WAAW,WAAY,SAAQ,YAAY;CAAG;AAEpD;;GAEG;AACH,MAAM,MAAM,KAAK,GAAG,kBAAkB,CAAC,WAAW,EAAE,WAAW,CAAC,CAAA;AAEhE;;GAEG;AACH,eAAO,MAAM,OAAO,6BAA4C,CAAA;AAChE,eAAO,MAAM,OAAO,gDAAyC,CAAA;AAC7D,eAAO,MAAM,eAAe,sEAAiD,CAAA;AAE7E;;GAEG;AACH,eAAO,MAAM,kBAAkB,0CAAuD,CAAA;AACtF,eAAO,MAAM,kBAAkB,6DAAiE,CAAA;AAChG,eAAO,MAAM,0BAA0B,mFAAyE,CAAA"}
1
+ {"version":3,"file":"Payload.d.ts","sourceRoot":"","sources":["../../../../src/Total/Diviner/Payload.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,UAAU,CAAA;AAI7B,eAAO,MAAM,WAAW;;CAA+C,CAAA;AACvE,MAAM,MAAM,WAAW,GAAG,OAAO,WAAW,CAAA;AAE5C,eAAO,MAAM,cAAc;;;iBAAyC,CAAA;AAEpE,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAA;AAExD;;GAEG;AACH,eAAO,MAAM,QAAQ;;;;;;iBAAyE,CAAA;AAE9F,MAAM,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,QAAQ,CAAC,CAAA;AAE5C;;GAEG;AACH,eAAO,MAAM,OAAO;;;;;;CAAyB,CAAA;AAC7C,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;CAAoC,CAAA;AACxD,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;CAAoC,CAAA"}