@xyo-network/payment-payload-plugins 2.89.1 → 2.90.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 (87) hide show
  1. package/dist/browser/Escrow/Schema.d.cts +3 -0
  2. package/dist/browser/Escrow/Schema.d.cts.map +1 -0
  3. package/dist/browser/Escrow/Schema.d.mts +3 -0
  4. package/dist/browser/Escrow/Schema.d.mts.map +1 -0
  5. package/dist/browser/Escrow/Schema.d.ts +3 -0
  6. package/dist/browser/Escrow/Schema.d.ts.map +1 -0
  7. package/dist/browser/Escrow/Terms.d.cts +58 -0
  8. package/dist/browser/Escrow/Terms.d.cts.map +1 -0
  9. package/dist/browser/Escrow/Terms.d.mts +58 -0
  10. package/dist/browser/Escrow/Terms.d.mts.map +1 -0
  11. package/dist/browser/Escrow/Terms.d.ts +58 -0
  12. package/dist/browser/Escrow/Terms.d.ts.map +1 -0
  13. package/dist/browser/Escrow/createEscrowIntent.d.cts +20 -0
  14. package/dist/browser/Escrow/createEscrowIntent.d.cts.map +1 -0
  15. package/dist/browser/Escrow/createEscrowIntent.d.mts +20 -0
  16. package/dist/browser/Escrow/createEscrowIntent.d.mts.map +1 -0
  17. package/dist/browser/Escrow/createEscrowIntent.d.ts +20 -0
  18. package/dist/browser/Escrow/createEscrowIntent.d.ts.map +1 -0
  19. package/dist/browser/Escrow/getEscrowSecret.d.cts +7 -0
  20. package/dist/browser/Escrow/getEscrowSecret.d.cts.map +1 -0
  21. package/dist/browser/Escrow/getEscrowSecret.d.mts +7 -0
  22. package/dist/browser/Escrow/getEscrowSecret.d.mts.map +1 -0
  23. package/dist/browser/Escrow/getEscrowSecret.d.ts +7 -0
  24. package/dist/browser/Escrow/getEscrowSecret.d.ts.map +1 -0
  25. package/dist/browser/Escrow/index.d.cts +5 -0
  26. package/dist/browser/Escrow/index.d.cts.map +1 -0
  27. package/dist/browser/Escrow/index.d.mts +5 -0
  28. package/dist/browser/Escrow/index.d.mts.map +1 -0
  29. package/dist/browser/Escrow/index.d.ts +5 -0
  30. package/dist/browser/Escrow/index.d.ts.map +1 -0
  31. package/dist/browser/index.cjs +29 -2
  32. package/dist/browser/index.cjs.map +1 -1
  33. package/dist/browser/index.d.cts +1 -0
  34. package/dist/browser/index.d.cts.map +1 -1
  35. package/dist/browser/index.d.mts +1 -0
  36. package/dist/browser/index.d.mts.map +1 -1
  37. package/dist/browser/index.d.ts +1 -0
  38. package/dist/browser/index.d.ts.map +1 -1
  39. package/dist/browser/index.js +29 -2
  40. package/dist/browser/index.js.map +1 -1
  41. package/dist/node/Escrow/Schema.d.cts +3 -0
  42. package/dist/node/Escrow/Schema.d.cts.map +1 -0
  43. package/dist/node/Escrow/Schema.d.mts +3 -0
  44. package/dist/node/Escrow/Schema.d.mts.map +1 -0
  45. package/dist/node/Escrow/Schema.d.ts +3 -0
  46. package/dist/node/Escrow/Schema.d.ts.map +1 -0
  47. package/dist/node/Escrow/Terms.d.cts +58 -0
  48. package/dist/node/Escrow/Terms.d.cts.map +1 -0
  49. package/dist/node/Escrow/Terms.d.mts +58 -0
  50. package/dist/node/Escrow/Terms.d.mts.map +1 -0
  51. package/dist/node/Escrow/Terms.d.ts +58 -0
  52. package/dist/node/Escrow/Terms.d.ts.map +1 -0
  53. package/dist/node/Escrow/createEscrowIntent.d.cts +20 -0
  54. package/dist/node/Escrow/createEscrowIntent.d.cts.map +1 -0
  55. package/dist/node/Escrow/createEscrowIntent.d.mts +20 -0
  56. package/dist/node/Escrow/createEscrowIntent.d.mts.map +1 -0
  57. package/dist/node/Escrow/createEscrowIntent.d.ts +20 -0
  58. package/dist/node/Escrow/createEscrowIntent.d.ts.map +1 -0
  59. package/dist/node/Escrow/getEscrowSecret.d.cts +7 -0
  60. package/dist/node/Escrow/getEscrowSecret.d.cts.map +1 -0
  61. package/dist/node/Escrow/getEscrowSecret.d.mts +7 -0
  62. package/dist/node/Escrow/getEscrowSecret.d.mts.map +1 -0
  63. package/dist/node/Escrow/getEscrowSecret.d.ts +7 -0
  64. package/dist/node/Escrow/getEscrowSecret.d.ts.map +1 -0
  65. package/dist/node/Escrow/index.d.cts +5 -0
  66. package/dist/node/Escrow/index.d.cts.map +1 -0
  67. package/dist/node/Escrow/index.d.mts +5 -0
  68. package/dist/node/Escrow/index.d.mts.map +1 -0
  69. package/dist/node/Escrow/index.d.ts +5 -0
  70. package/dist/node/Escrow/index.d.ts.map +1 -0
  71. package/dist/node/index.cjs +34 -2
  72. package/dist/node/index.cjs.map +1 -1
  73. package/dist/node/index.d.cts +1 -0
  74. package/dist/node/index.d.cts.map +1 -1
  75. package/dist/node/index.d.mts +1 -0
  76. package/dist/node/index.d.mts.map +1 -1
  77. package/dist/node/index.d.ts +1 -0
  78. package/dist/node/index.d.ts.map +1 -1
  79. package/dist/node/index.js +29 -2
  80. package/dist/node/index.js.map +1 -1
  81. package/package.json +8 -4
  82. package/src/Escrow/Schema.ts +2 -0
  83. package/src/Escrow/Terms.ts +62 -0
  84. package/src/Escrow/createEscrowIntent.ts +15 -0
  85. package/src/Escrow/getEscrowSecret.ts +10 -0
  86. package/src/Escrow/index.ts +4 -0
  87. package/src/index.ts +1 -0
@@ -0,0 +1,3 @@
1
+ export type EscrowSchema = 'network.xyo.escrow';
2
+ export declare const EscrowSchema: EscrowSchema;
3
+ //# sourceMappingURL=Schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Schema.d.ts","sourceRoot":"","sources":["../../../src/Escrow/Schema.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG,oBAAoB,CAAA;AAC/C,eAAO,MAAM,YAAY,EAAE,YAAmC,CAAA"}
@@ -0,0 +1,3 @@
1
+ export type EscrowSchema = 'network.xyo.escrow';
2
+ export declare const EscrowSchema: EscrowSchema;
3
+ //# sourceMappingURL=Schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Schema.d.ts","sourceRoot":"","sources":["../../../src/Escrow/Schema.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG,oBAAoB,CAAA;AAC/C,eAAO,MAAM,YAAY,EAAE,YAAmC,CAAA"}
@@ -0,0 +1,3 @@
1
+ export type EscrowSchema = 'network.xyo.escrow';
2
+ export declare const EscrowSchema: EscrowSchema;
3
+ //# sourceMappingURL=Schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Schema.d.ts","sourceRoot":"","sources":["../../../src/Escrow/Schema.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG,oBAAoB,CAAA;AAC/C,eAAO,MAAM,YAAY,EAAE,YAAmC,CAAA"}
@@ -0,0 +1,58 @@
1
+ import { Address, Hash } from '@xylabs/hex';
2
+ import { Payload } from '@xyo-network/payload-model';
3
+ export declare const EscrowTermsSchema: "network.xyo.escrow.terms";
4
+ export type EscrowTermsSchema = typeof EscrowTermsSchema;
5
+ export interface EscrowTermsFields {
6
+ /**
7
+ * The trusted estimators for the worth of the things being sold
8
+ */
9
+ appraisalAuthorities: Address[];
10
+ /**
11
+ * The estimated worths of the things being sold
12
+ */
13
+ appraisals: Hash[];
14
+ /**
15
+ * The things being sold
16
+ */
17
+ assets: Hash[];
18
+ /**
19
+ * The buyer
20
+ */
21
+ buyer: Address[];
22
+ /**
23
+ * The buyer
24
+ */
25
+ buyerSecret: Hash;
26
+ /**
27
+ * The escrow agent responsible for the escrow
28
+ */
29
+ escrowAgent: Address;
30
+ /**
31
+ * The time the escrow expires
32
+ */
33
+ exp: number;
34
+ /**
35
+ * The time the escrow starts
36
+ */
37
+ nbf: number;
38
+ /**
39
+ * The trusted payment authorities
40
+ */
41
+ paymentAuthorities: Address[];
42
+ /**
43
+ * The seller
44
+ */
45
+ seller: Address[];
46
+ /**
47
+ * The seller
48
+ */
49
+ sellerSecret: Hash;
50
+ }
51
+ /**
52
+ * The terms of an escrow
53
+ */
54
+ export type EscrowTerms = Payload<Partial<EscrowTermsFields>, EscrowTermsSchema>;
55
+ export declare const isEscrowTerms: (x?: unknown) => x is import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & Partial<EscrowTermsFields> & {
56
+ schema: "network.xyo.escrow.terms";
57
+ };
58
+ //# sourceMappingURL=Terms.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Terms.d.ts","sourceRoot":"","sources":["../../../src/Escrow/Terms.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAyB,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAI3E,eAAO,MAAM,iBAAiB,4BAAmC,CAAA;AACjE,MAAM,MAAM,iBAAiB,GAAG,OAAO,iBAAiB,CAAA;AAGxD,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,oBAAoB,EAAE,OAAO,EAAE,CAAA;IAC/B;;OAEG;IACH,UAAU,EAAE,IAAI,EAAE,CAAA;IAClB;;OAEG;IACH,MAAM,EAAE,IAAI,EAAE,CAAA;IACd;;OAEG;IACH,KAAK,EAAE,OAAO,EAAE,CAAA;IAChB;;OAEG;IACH,WAAW,EAAE,IAAI,CAAA;IACjB;;OAEG;IACH,WAAW,EAAE,OAAO,CAAA;IACpB;;OAEG;IACH,GAAG,EAAE,MAAM,CAAA;IACX;;OAEG;IACH,GAAG,EAAE,MAAM,CAAA;IACX;;OAEG;IACH,kBAAkB,EAAE,OAAO,EAAE,CAAA;IAC7B;;OAEG;IACH,MAAM,EAAE,OAAO,EAAE,CAAA;IACjB;;OAEG;IACH,YAAY,EAAE,IAAI,CAAA;CACnB;AAED;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,iBAAiB,CAAC,EAAE,iBAAiB,CAAC,CAAA;AAEhF,eAAO,MAAM,aAAa;;CAAwD,CAAA"}
@@ -0,0 +1,58 @@
1
+ import { Address, Hash } from '@xylabs/hex';
2
+ import { Payload } from '@xyo-network/payload-model';
3
+ export declare const EscrowTermsSchema: "network.xyo.escrow.terms";
4
+ export type EscrowTermsSchema = typeof EscrowTermsSchema;
5
+ export interface EscrowTermsFields {
6
+ /**
7
+ * The trusted estimators for the worth of the things being sold
8
+ */
9
+ appraisalAuthorities: Address[];
10
+ /**
11
+ * The estimated worths of the things being sold
12
+ */
13
+ appraisals: Hash[];
14
+ /**
15
+ * The things being sold
16
+ */
17
+ assets: Hash[];
18
+ /**
19
+ * The buyer
20
+ */
21
+ buyer: Address[];
22
+ /**
23
+ * The buyer
24
+ */
25
+ buyerSecret: Hash;
26
+ /**
27
+ * The escrow agent responsible for the escrow
28
+ */
29
+ escrowAgent: Address;
30
+ /**
31
+ * The time the escrow expires
32
+ */
33
+ exp: number;
34
+ /**
35
+ * The time the escrow starts
36
+ */
37
+ nbf: number;
38
+ /**
39
+ * The trusted payment authorities
40
+ */
41
+ paymentAuthorities: Address[];
42
+ /**
43
+ * The seller
44
+ */
45
+ seller: Address[];
46
+ /**
47
+ * The seller
48
+ */
49
+ sellerSecret: Hash;
50
+ }
51
+ /**
52
+ * The terms of an escrow
53
+ */
54
+ export type EscrowTerms = Payload<Partial<EscrowTermsFields>, EscrowTermsSchema>;
55
+ export declare const isEscrowTerms: (x?: unknown) => x is import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & Partial<EscrowTermsFields> & {
56
+ schema: "network.xyo.escrow.terms";
57
+ };
58
+ //# sourceMappingURL=Terms.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Terms.d.ts","sourceRoot":"","sources":["../../../src/Escrow/Terms.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAyB,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAI3E,eAAO,MAAM,iBAAiB,4BAAmC,CAAA;AACjE,MAAM,MAAM,iBAAiB,GAAG,OAAO,iBAAiB,CAAA;AAGxD,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,oBAAoB,EAAE,OAAO,EAAE,CAAA;IAC/B;;OAEG;IACH,UAAU,EAAE,IAAI,EAAE,CAAA;IAClB;;OAEG;IACH,MAAM,EAAE,IAAI,EAAE,CAAA;IACd;;OAEG;IACH,KAAK,EAAE,OAAO,EAAE,CAAA;IAChB;;OAEG;IACH,WAAW,EAAE,IAAI,CAAA;IACjB;;OAEG;IACH,WAAW,EAAE,OAAO,CAAA;IACpB;;OAEG;IACH,GAAG,EAAE,MAAM,CAAA;IACX;;OAEG;IACH,GAAG,EAAE,MAAM,CAAA;IACX;;OAEG;IACH,kBAAkB,EAAE,OAAO,EAAE,CAAA;IAC7B;;OAEG;IACH,MAAM,EAAE,OAAO,EAAE,CAAA;IACjB;;OAEG;IACH,YAAY,EAAE,IAAI,CAAA;CACnB;AAED;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,iBAAiB,CAAC,EAAE,iBAAiB,CAAC,CAAA;AAEhF,eAAO,MAAM,aAAa;;CAAwD,CAAA"}
@@ -0,0 +1,58 @@
1
+ import { Address, Hash } from '@xylabs/hex';
2
+ import { Payload } from '@xyo-network/payload-model';
3
+ export declare const EscrowTermsSchema: "network.xyo.escrow.terms";
4
+ export type EscrowTermsSchema = typeof EscrowTermsSchema;
5
+ export interface EscrowTermsFields {
6
+ /**
7
+ * The trusted estimators for the worth of the things being sold
8
+ */
9
+ appraisalAuthorities: Address[];
10
+ /**
11
+ * The estimated worths of the things being sold
12
+ */
13
+ appraisals: Hash[];
14
+ /**
15
+ * The things being sold
16
+ */
17
+ assets: Hash[];
18
+ /**
19
+ * The buyer
20
+ */
21
+ buyer: Address[];
22
+ /**
23
+ * The buyer
24
+ */
25
+ buyerSecret: Hash;
26
+ /**
27
+ * The escrow agent responsible for the escrow
28
+ */
29
+ escrowAgent: Address;
30
+ /**
31
+ * The time the escrow expires
32
+ */
33
+ exp: number;
34
+ /**
35
+ * The time the escrow starts
36
+ */
37
+ nbf: number;
38
+ /**
39
+ * The trusted payment authorities
40
+ */
41
+ paymentAuthorities: Address[];
42
+ /**
43
+ * The seller
44
+ */
45
+ seller: Address[];
46
+ /**
47
+ * The seller
48
+ */
49
+ sellerSecret: Hash;
50
+ }
51
+ /**
52
+ * The terms of an escrow
53
+ */
54
+ export type EscrowTerms = Payload<Partial<EscrowTermsFields>, EscrowTermsSchema>;
55
+ export declare const isEscrowTerms: (x?: unknown) => x is import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & Partial<EscrowTermsFields> & {
56
+ schema: "network.xyo.escrow.terms";
57
+ };
58
+ //# sourceMappingURL=Terms.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Terms.d.ts","sourceRoot":"","sources":["../../../src/Escrow/Terms.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAyB,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAI3E,eAAO,MAAM,iBAAiB,4BAAmC,CAAA;AACjE,MAAM,MAAM,iBAAiB,GAAG,OAAO,iBAAiB,CAAA;AAGxD,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,oBAAoB,EAAE,OAAO,EAAE,CAAA;IAC/B;;OAEG;IACH,UAAU,EAAE,IAAI,EAAE,CAAA;IAClB;;OAEG;IACH,MAAM,EAAE,IAAI,EAAE,CAAA;IACd;;OAEG;IACH,KAAK,EAAE,OAAO,EAAE,CAAA;IAChB;;OAEG;IACH,WAAW,EAAE,IAAI,CAAA;IACjB;;OAEG;IACH,WAAW,EAAE,OAAO,CAAA;IACpB;;OAEG;IACH,GAAG,EAAE,MAAM,CAAA;IACX;;OAEG;IACH,GAAG,EAAE,MAAM,CAAA;IACX;;OAEG;IACH,kBAAkB,EAAE,OAAO,EAAE,CAAA;IAC7B;;OAEG;IACH,MAAM,EAAE,OAAO,EAAE,CAAA;IACjB;;OAEG;IACH,YAAY,EAAE,IAAI,CAAA;CACnB;AAED;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,iBAAiB,CAAC,EAAE,iBAAiB,CAAC,CAAA;AAEhF,eAAO,MAAM,aAAa;;CAAwD,CAAA"}
@@ -0,0 +1,20 @@
1
+ import { AccountInstance } from '@xyo-network/account-model';
2
+ import { EscrowTerms } from './Terms';
3
+ /**
4
+ * Creates an escrow intent
5
+ * @param terms The payloads describing the terms for the escrow
6
+ * @param account The account to create the escrow intent with
7
+ * @returns The escrow intent
8
+ */
9
+ export declare const createEscrowIntent: (terms: EscrowTerms[], account: AccountInstance) => Promise<[import("@xyo-network/payload-model").WithMeta<import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & import("@xyo-network/boundwitness-model").BoundWitnessFields & {
10
+ schema: "network.xyo.boundwitness";
11
+ }>, import("@xyo-network/payload-model").WithMeta<{
12
+ schema: string;
13
+ } & import("@xyo-network/payload-model").PayloadFields>[], import("@xyo-network/payload-model").WithMeta<import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & {
14
+ message?: string | undefined;
15
+ name?: string | undefined;
16
+ query?: Lowercase<string> | undefined;
17
+ schema: "network.xyo.error.module";
18
+ sources?: Lowercase<string>[] | undefined;
19
+ }>[]]>;
20
+ //# sourceMappingURL=createEscrowIntent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createEscrowIntent.d.ts","sourceRoot":"","sources":["../../../src/Escrow/createEscrowIntent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAG5D,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAErC;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,UAAiB,WAAW,EAAE,WAAW,eAAe;;;;;;;;;;MAGtF,CAAA"}
@@ -0,0 +1,20 @@
1
+ import { AccountInstance } from '@xyo-network/account-model';
2
+ import { EscrowTerms } from './Terms';
3
+ /**
4
+ * Creates an escrow intent
5
+ * @param terms The payloads describing the terms for the escrow
6
+ * @param account The account to create the escrow intent with
7
+ * @returns The escrow intent
8
+ */
9
+ export declare const createEscrowIntent: (terms: EscrowTerms[], account: AccountInstance) => Promise<[import("@xyo-network/payload-model").WithMeta<import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & import("@xyo-network/boundwitness-model").BoundWitnessFields & {
10
+ schema: "network.xyo.boundwitness";
11
+ }>, import("@xyo-network/payload-model").WithMeta<{
12
+ schema: string;
13
+ } & import("@xyo-network/payload-model").PayloadFields>[], import("@xyo-network/payload-model").WithMeta<import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & {
14
+ message?: string | undefined;
15
+ name?: string | undefined;
16
+ query?: Lowercase<string> | undefined;
17
+ schema: "network.xyo.error.module";
18
+ sources?: Lowercase<string>[] | undefined;
19
+ }>[]]>;
20
+ //# sourceMappingURL=createEscrowIntent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createEscrowIntent.d.ts","sourceRoot":"","sources":["../../../src/Escrow/createEscrowIntent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAG5D,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAErC;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,UAAiB,WAAW,EAAE,WAAW,eAAe;;;;;;;;;;MAGtF,CAAA"}
@@ -0,0 +1,20 @@
1
+ import { AccountInstance } from '@xyo-network/account-model';
2
+ import { EscrowTerms } from './Terms';
3
+ /**
4
+ * Creates an escrow intent
5
+ * @param terms The payloads describing the terms for the escrow
6
+ * @param account The account to create the escrow intent with
7
+ * @returns The escrow intent
8
+ */
9
+ export declare const createEscrowIntent: (terms: EscrowTerms[], account: AccountInstance) => Promise<[import("@xyo-network/payload-model").WithMeta<import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & import("@xyo-network/boundwitness-model").BoundWitnessFields & {
10
+ schema: "network.xyo.boundwitness";
11
+ }>, import("@xyo-network/payload-model").WithMeta<{
12
+ schema: string;
13
+ } & import("@xyo-network/payload-model").PayloadFields>[], import("@xyo-network/payload-model").WithMeta<import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & {
14
+ message?: string | undefined;
15
+ name?: string | undefined;
16
+ query?: Lowercase<string> | undefined;
17
+ schema: "network.xyo.error.module";
18
+ sources?: Lowercase<string>[] | undefined;
19
+ }>[]]>;
20
+ //# sourceMappingURL=createEscrowIntent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createEscrowIntent.d.ts","sourceRoot":"","sources":["../../../src/Escrow/createEscrowIntent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAG5D,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAErC;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,UAAiB,WAAW,EAAE,WAAW,eAAe;;;;;;;;;;MAGtF,CAAA"}
@@ -0,0 +1,7 @@
1
+ import { IdPayload } from '@xyo-network/id-payload-plugin';
2
+ /**
3
+ * Returns a cryptographically random secret to use for escrow
4
+ * @returns The escrow secret
5
+ */
6
+ export declare const getEscrowSecret: () => IdPayload;
7
+ //# sourceMappingURL=getEscrowSecret.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getEscrowSecret.d.ts","sourceRoot":"","sources":["../../../src/Escrow/getEscrowSecret.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAY,MAAM,gCAAgC,CAAA;AAEpE;;;GAGG;AACH,eAAO,MAAM,eAAe,QAAO,SAElC,CAAA"}
@@ -0,0 +1,7 @@
1
+ import { IdPayload } from '@xyo-network/id-payload-plugin';
2
+ /**
3
+ * Returns a cryptographically random secret to use for escrow
4
+ * @returns The escrow secret
5
+ */
6
+ export declare const getEscrowSecret: () => IdPayload;
7
+ //# sourceMappingURL=getEscrowSecret.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getEscrowSecret.d.ts","sourceRoot":"","sources":["../../../src/Escrow/getEscrowSecret.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAY,MAAM,gCAAgC,CAAA;AAEpE;;;GAGG;AACH,eAAO,MAAM,eAAe,QAAO,SAElC,CAAA"}
@@ -0,0 +1,7 @@
1
+ import { IdPayload } from '@xyo-network/id-payload-plugin';
2
+ /**
3
+ * Returns a cryptographically random secret to use for escrow
4
+ * @returns The escrow secret
5
+ */
6
+ export declare const getEscrowSecret: () => IdPayload;
7
+ //# sourceMappingURL=getEscrowSecret.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getEscrowSecret.d.ts","sourceRoot":"","sources":["../../../src/Escrow/getEscrowSecret.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAY,MAAM,gCAAgC,CAAA;AAEpE;;;GAGG;AACH,eAAO,MAAM,eAAe,QAAO,SAElC,CAAA"}
@@ -0,0 +1,5 @@
1
+ export * from './createEscrowIntent';
2
+ export * from './getEscrowSecret';
3
+ export * from './Schema';
4
+ export * from './Terms';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Escrow/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAA;AACpC,cAAc,mBAAmB,CAAA;AACjC,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA"}
@@ -0,0 +1,5 @@
1
+ export * from './createEscrowIntent';
2
+ export * from './getEscrowSecret';
3
+ export * from './Schema';
4
+ export * from './Terms';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Escrow/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAA;AACpC,cAAc,mBAAmB,CAAA;AACjC,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA"}
@@ -0,0 +1,5 @@
1
+ export * from './createEscrowIntent';
2
+ export * from './getEscrowSecret';
3
+ export * from './Schema';
4
+ export * from './Terms';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Escrow/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAA;AACpC,cAAc,mBAAmB,CAAA;AACjC,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA"}
@@ -20,16 +20,43 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // src/index.ts
21
21
  var src_exports = {};
22
22
  __export(src_exports, {
23
+ EscrowSchema: () => EscrowSchema,
24
+ EscrowTermsSchema: () => EscrowTermsSchema,
23
25
  PaymentSchema: () => PaymentSchema,
24
26
  PurchaseSchema: () => PurchaseSchema,
27
+ createEscrowIntent: () => createEscrowIntent,
28
+ getEscrowSecret: () => getEscrowSecret,
29
+ isEscrowTerms: () => isEscrowTerms,
25
30
  isPayment: () => isPayment
26
31
  });
27
32
  module.exports = __toCommonJS(src_exports);
28
33
 
29
- // src/Payment.ts
34
+ // src/Escrow/createEscrowIntent.ts
35
+ var import_boundwitness_builder = require("@xyo-network/boundwitness-builder");
36
+ var createEscrowIntent = async (terms, account) => {
37
+ const result = await new import_boundwitness_builder.BoundWitnessBuilder({ accounts: [account] }).payloads([...terms]).build();
38
+ return result;
39
+ };
40
+
41
+ // src/Escrow/getEscrowSecret.ts
42
+ var import_crypto = require("@xylabs/crypto");
43
+ var import_id_payload_plugin = require("@xyo-network/id-payload-plugin");
44
+ var getEscrowSecret = () => {
45
+ return { salt: import_crypto.Crypto.randomUUID(), schema: import_id_payload_plugin.IdSchema };
46
+ };
47
+
48
+ // src/Escrow/Schema.ts
49
+ var EscrowSchema = "network.xyo.escrow";
50
+
51
+ // src/Escrow/Terms.ts
30
52
  var import_payload_model = require("@xyo-network/payload-model");
53
+ var EscrowTermsSchema = `${EscrowSchema}.terms`;
54
+ var isEscrowTerms = (0, import_payload_model.isPayloadOfSchemaType)(EscrowTermsSchema);
55
+
56
+ // src/Payment.ts
57
+ var import_payload_model2 = require("@xyo-network/payload-model");
31
58
  var PaymentSchema = "network.xyo.payments.payment";
32
- var isPayment = (0, import_payload_model.isPayloadOfSchemaType)(PaymentSchema);
59
+ var isPayment = (0, import_payload_model2.isPayloadOfSchemaType)(PaymentSchema);
33
60
 
34
61
  // src/Purchase.ts
35
62
  var PurchaseSchema = "network.xyo.payments.purchase";
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.ts","../../src/Payment.ts","../../src/Purchase.ts"],"sourcesContent":["export * from './Currency'\nexport * from './Payment'\nexport * from './Purchase'\n","import { isPayloadOfSchemaType, PayloadWithSources } from '@xyo-network/payload-model'\n\nimport { SupportedCurrency } from './Currency'\n\nexport type PaymentSchema = 'network.xyo.payments.payment'\nexport const PaymentSchema: PaymentSchema = 'network.xyo.payments.payment'\n\nexport interface PaymentFields {\n /**\n * The amount paid\n */\n amount: number\n /**\n * The currency of the amount paid\n */\n currency: SupportedCurrency\n}\n\n/**\n * A payment is a record of a payment made\n */\nexport type Payment = PayloadWithSources<PaymentFields, PaymentSchema>\n\nexport const isPayment = isPayloadOfSchemaType<Payment>(PaymentSchema)\n","import { Hash } from '@xylabs/hex'\nimport { PayloadWithSources } from '@xyo-network/payload-model'\n\nexport type PurchaseSchema = 'network.xyo.payments.purchase'\nexport const PurchaseSchema: PurchaseSchema = 'network.xyo.payments.purchase'\n\nexport interface PurchaseFields {\n /**\n * The hashes that were purchased\n */\n hashes: Hash[]\n /**\n * The payments for this purchase. Array to allow for multiple payments\n * for a single quote.\n */\n payments: Hash[]\n}\n\n/**\n * A purchase ties a payment made to a quote\n */\nexport type Purchase = PayloadWithSources<PurchaseFields, PurchaseSchema>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,2BAA0D;AAKnD,IAAM,gBAA+B;AAkBrC,IAAM,gBAAY,4CAA+B,aAAa;;;ACnB9D,IAAM,iBAAiC;","names":[]}
1
+ {"version":3,"sources":["../../src/index.ts","../../src/Escrow/createEscrowIntent.ts","../../src/Escrow/getEscrowSecret.ts","../../src/Escrow/Schema.ts","../../src/Escrow/Terms.ts","../../src/Payment.ts","../../src/Purchase.ts"],"sourcesContent":["export * from './Currency'\nexport * from './Escrow'\nexport * from './Payment'\nexport * from './Purchase'\n","import { AccountInstance } from '@xyo-network/account-model'\nimport { BoundWitnessBuilder } from '@xyo-network/boundwitness-builder'\n\nimport { EscrowTerms } from './Terms'\n\n/**\n * Creates an escrow intent\n * @param terms The payloads describing the terms for the escrow\n * @param account The account to create the escrow intent with\n * @returns The escrow intent\n */\nexport const createEscrowIntent = async (terms: EscrowTerms[], account: AccountInstance) => {\n const result = await new BoundWitnessBuilder({ accounts: [account] }).payloads([...terms]).build()\n return result\n}\n","import { Crypto } from '@xylabs/crypto'\nimport { IdPayload, IdSchema } from '@xyo-network/id-payload-plugin'\n\n/**\n * Returns a cryptographically random secret to use for escrow\n * @returns The escrow secret\n */\nexport const getEscrowSecret = (): IdPayload => {\n return { salt: Crypto.randomUUID(), schema: IdSchema }\n}\n","export type EscrowSchema = 'network.xyo.escrow'\nexport const EscrowSchema: EscrowSchema = 'network.xyo.escrow'\n","import { Address, Hash } from '@xylabs/hex'\nimport { isPayloadOfSchemaType, Payload } from '@xyo-network/payload-model'\n\nimport { EscrowSchema } from './Schema'\n\nexport const EscrowTermsSchema = `${EscrowSchema}.terms` as const\nexport type EscrowTermsSchema = typeof EscrowTermsSchema\n\n// TODO: Include escrow agent in escrow terms\nexport interface EscrowTermsFields {\n /**\n * The trusted estimators for the worth of the things being sold\n */\n appraisalAuthorities: Address[]\n /**\n * The estimated worths of the things being sold\n */\n appraisals: Hash[]\n /**\n * The things being sold\n */\n assets: Hash[]\n /**\n * The buyer\n */\n buyer: Address[]\n /**\n * The buyer\n */\n buyerSecret: Hash\n /**\n * The escrow agent responsible for the escrow\n */\n escrowAgent: Address\n /**\n * The time the escrow expires\n */\n exp: number\n /**\n * The time the escrow starts\n */\n nbf: number\n /**\n * The trusted payment authorities\n */\n paymentAuthorities: Address[]\n /**\n * The seller\n */\n seller: Address[]\n /**\n * The seller\n */\n sellerSecret: Hash\n}\n\n/**\n * The terms of an escrow\n */\nexport type EscrowTerms = Payload<Partial<EscrowTermsFields>, EscrowTermsSchema>\n\nexport const isEscrowTerms = isPayloadOfSchemaType<EscrowTerms>(EscrowTermsSchema)\n","import { isPayloadOfSchemaType, PayloadWithSources } from '@xyo-network/payload-model'\n\nimport { SupportedCurrency } from './Currency'\n\nexport type PaymentSchema = 'network.xyo.payments.payment'\nexport const PaymentSchema: PaymentSchema = 'network.xyo.payments.payment'\n\nexport interface PaymentFields {\n /**\n * The amount paid\n */\n amount: number\n /**\n * The currency of the amount paid\n */\n currency: SupportedCurrency\n}\n\n/**\n * A payment is a record of a payment made\n */\nexport type Payment = PayloadWithSources<PaymentFields, PaymentSchema>\n\nexport const isPayment = isPayloadOfSchemaType<Payment>(PaymentSchema)\n","import { Hash } from '@xylabs/hex'\nimport { PayloadWithSources } from '@xyo-network/payload-model'\n\nexport type PurchaseSchema = 'network.xyo.payments.purchase'\nexport const PurchaseSchema: PurchaseSchema = 'network.xyo.payments.purchase'\n\nexport interface PurchaseFields {\n /**\n * The hashes that were purchased\n */\n hashes: Hash[]\n /**\n * The payments for this purchase. Array to allow for multiple payments\n * for a single quote.\n */\n payments: Hash[]\n}\n\n/**\n * A purchase ties a payment made to a quote\n */\nexport type Purchase = PayloadWithSources<PurchaseFields, PurchaseSchema>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACCA,kCAAoC;AAU7B,IAAM,qBAAqB,OAAO,OAAsB,YAA6B;AAC1F,QAAM,SAAS,MAAM,IAAI,gDAAoB,EAAE,UAAU,CAAC,OAAO,EAAE,CAAC,EAAE,SAAS,CAAC,GAAG,KAAK,CAAC,EAAE,MAAM;AACjG,SAAO;AACT;;;ACdA,oBAAuB;AACvB,+BAAoC;AAM7B,IAAM,kBAAkB,MAAiB;AAC9C,SAAO,EAAE,MAAM,qBAAO,WAAW,GAAG,QAAQ,kCAAS;AACvD;;;ACRO,IAAM,eAA6B;;;ACA1C,2BAA+C;AAIxC,IAAM,oBAAoB,GAAG,YAAY;AAwDzC,IAAM,oBAAgB,4CAAmC,iBAAiB;;;AC7DjF,IAAAA,wBAA0D;AAKnD,IAAM,gBAA+B;AAkBrC,IAAM,gBAAY,6CAA+B,aAAa;;;ACnB9D,IAAM,iBAAiC;","names":["import_payload_model"]}
@@ -1,4 +1,5 @@
1
1
  export * from './Currency';
2
+ export * from './Escrow';
2
3
  export * from './Payment';
3
4
  export * from './Purchase';
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAA;AACzB,cAAc,YAAY,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,YAAY,CAAA"}
@@ -1,4 +1,5 @@
1
1
  export * from './Currency';
2
+ export * from './Escrow';
2
3
  export * from './Payment';
3
4
  export * from './Purchase';
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAA;AACzB,cAAc,YAAY,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,YAAY,CAAA"}
@@ -1,4 +1,5 @@
1
1
  export * from './Currency';
2
+ export * from './Escrow';
2
3
  export * from './Payment';
3
4
  export * from './Purchase';
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAA;AACzB,cAAc,YAAY,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,YAAY,CAAA"}
@@ -1,13 +1,40 @@
1
- // src/Payment.ts
1
+ // src/Escrow/createEscrowIntent.ts
2
+ import { BoundWitnessBuilder } from "@xyo-network/boundwitness-builder";
3
+ var createEscrowIntent = async (terms, account) => {
4
+ const result = await new BoundWitnessBuilder({ accounts: [account] }).payloads([...terms]).build();
5
+ return result;
6
+ };
7
+
8
+ // src/Escrow/getEscrowSecret.ts
9
+ import { Crypto } from "@xylabs/crypto";
10
+ import { IdSchema } from "@xyo-network/id-payload-plugin";
11
+ var getEscrowSecret = () => {
12
+ return { salt: Crypto.randomUUID(), schema: IdSchema };
13
+ };
14
+
15
+ // src/Escrow/Schema.ts
16
+ var EscrowSchema = "network.xyo.escrow";
17
+
18
+ // src/Escrow/Terms.ts
2
19
  import { isPayloadOfSchemaType } from "@xyo-network/payload-model";
20
+ var EscrowTermsSchema = `${EscrowSchema}.terms`;
21
+ var isEscrowTerms = isPayloadOfSchemaType(EscrowTermsSchema);
22
+
23
+ // src/Payment.ts
24
+ import { isPayloadOfSchemaType as isPayloadOfSchemaType2 } from "@xyo-network/payload-model";
3
25
  var PaymentSchema = "network.xyo.payments.payment";
4
- var isPayment = isPayloadOfSchemaType(PaymentSchema);
26
+ var isPayment = isPayloadOfSchemaType2(PaymentSchema);
5
27
 
6
28
  // src/Purchase.ts
7
29
  var PurchaseSchema = "network.xyo.payments.purchase";
8
30
  export {
31
+ EscrowSchema,
32
+ EscrowTermsSchema,
9
33
  PaymentSchema,
10
34
  PurchaseSchema,
35
+ createEscrowIntent,
36
+ getEscrowSecret,
37
+ isEscrowTerms,
11
38
  isPayment
12
39
  };
13
40
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Payment.ts","../../src/Purchase.ts"],"sourcesContent":["import { isPayloadOfSchemaType, PayloadWithSources } from '@xyo-network/payload-model'\n\nimport { SupportedCurrency } from './Currency'\n\nexport type PaymentSchema = 'network.xyo.payments.payment'\nexport const PaymentSchema: PaymentSchema = 'network.xyo.payments.payment'\n\nexport interface PaymentFields {\n /**\n * The amount paid\n */\n amount: number\n /**\n * The currency of the amount paid\n */\n currency: SupportedCurrency\n}\n\n/**\n * A payment is a record of a payment made\n */\nexport type Payment = PayloadWithSources<PaymentFields, PaymentSchema>\n\nexport const isPayment = isPayloadOfSchemaType<Payment>(PaymentSchema)\n","import { Hash } from '@xylabs/hex'\nimport { PayloadWithSources } from '@xyo-network/payload-model'\n\nexport type PurchaseSchema = 'network.xyo.payments.purchase'\nexport const PurchaseSchema: PurchaseSchema = 'network.xyo.payments.purchase'\n\nexport interface PurchaseFields {\n /**\n * The hashes that were purchased\n */\n hashes: Hash[]\n /**\n * The payments for this purchase. Array to allow for multiple payments\n * for a single quote.\n */\n payments: Hash[]\n}\n\n/**\n * A purchase ties a payment made to a quote\n */\nexport type Purchase = PayloadWithSources<PurchaseFields, PurchaseSchema>\n"],"mappings":";AAAA,SAAS,6BAAiD;AAKnD,IAAM,gBAA+B;AAkBrC,IAAM,YAAY,sBAA+B,aAAa;;;ACnB9D,IAAM,iBAAiC;","names":[]}
1
+ {"version":3,"sources":["../../src/Escrow/createEscrowIntent.ts","../../src/Escrow/getEscrowSecret.ts","../../src/Escrow/Schema.ts","../../src/Escrow/Terms.ts","../../src/Payment.ts","../../src/Purchase.ts"],"sourcesContent":["import { AccountInstance } from '@xyo-network/account-model'\nimport { BoundWitnessBuilder } from '@xyo-network/boundwitness-builder'\n\nimport { EscrowTerms } from './Terms'\n\n/**\n * Creates an escrow intent\n * @param terms The payloads describing the terms for the escrow\n * @param account The account to create the escrow intent with\n * @returns The escrow intent\n */\nexport const createEscrowIntent = async (terms: EscrowTerms[], account: AccountInstance) => {\n const result = await new BoundWitnessBuilder({ accounts: [account] }).payloads([...terms]).build()\n return result\n}\n","import { Crypto } from '@xylabs/crypto'\nimport { IdPayload, IdSchema } from '@xyo-network/id-payload-plugin'\n\n/**\n * Returns a cryptographically random secret to use for escrow\n * @returns The escrow secret\n */\nexport const getEscrowSecret = (): IdPayload => {\n return { salt: Crypto.randomUUID(), schema: IdSchema }\n}\n","export type EscrowSchema = 'network.xyo.escrow'\nexport const EscrowSchema: EscrowSchema = 'network.xyo.escrow'\n","import { Address, Hash } from '@xylabs/hex'\nimport { isPayloadOfSchemaType, Payload } from '@xyo-network/payload-model'\n\nimport { EscrowSchema } from './Schema'\n\nexport const EscrowTermsSchema = `${EscrowSchema}.terms` as const\nexport type EscrowTermsSchema = typeof EscrowTermsSchema\n\n// TODO: Include escrow agent in escrow terms\nexport interface EscrowTermsFields {\n /**\n * The trusted estimators for the worth of the things being sold\n */\n appraisalAuthorities: Address[]\n /**\n * The estimated worths of the things being sold\n */\n appraisals: Hash[]\n /**\n * The things being sold\n */\n assets: Hash[]\n /**\n * The buyer\n */\n buyer: Address[]\n /**\n * The buyer\n */\n buyerSecret: Hash\n /**\n * The escrow agent responsible for the escrow\n */\n escrowAgent: Address\n /**\n * The time the escrow expires\n */\n exp: number\n /**\n * The time the escrow starts\n */\n nbf: number\n /**\n * The trusted payment authorities\n */\n paymentAuthorities: Address[]\n /**\n * The seller\n */\n seller: Address[]\n /**\n * The seller\n */\n sellerSecret: Hash\n}\n\n/**\n * The terms of an escrow\n */\nexport type EscrowTerms = Payload<Partial<EscrowTermsFields>, EscrowTermsSchema>\n\nexport const isEscrowTerms = isPayloadOfSchemaType<EscrowTerms>(EscrowTermsSchema)\n","import { isPayloadOfSchemaType, PayloadWithSources } from '@xyo-network/payload-model'\n\nimport { SupportedCurrency } from './Currency'\n\nexport type PaymentSchema = 'network.xyo.payments.payment'\nexport const PaymentSchema: PaymentSchema = 'network.xyo.payments.payment'\n\nexport interface PaymentFields {\n /**\n * The amount paid\n */\n amount: number\n /**\n * The currency of the amount paid\n */\n currency: SupportedCurrency\n}\n\n/**\n * A payment is a record of a payment made\n */\nexport type Payment = PayloadWithSources<PaymentFields, PaymentSchema>\n\nexport const isPayment = isPayloadOfSchemaType<Payment>(PaymentSchema)\n","import { Hash } from '@xylabs/hex'\nimport { PayloadWithSources } from '@xyo-network/payload-model'\n\nexport type PurchaseSchema = 'network.xyo.payments.purchase'\nexport const PurchaseSchema: PurchaseSchema = 'network.xyo.payments.purchase'\n\nexport interface PurchaseFields {\n /**\n * The hashes that were purchased\n */\n hashes: Hash[]\n /**\n * The payments for this purchase. Array to allow for multiple payments\n * for a single quote.\n */\n payments: Hash[]\n}\n\n/**\n * A purchase ties a payment made to a quote\n */\nexport type Purchase = PayloadWithSources<PurchaseFields, PurchaseSchema>\n"],"mappings":";AACA,SAAS,2BAA2B;AAU7B,IAAM,qBAAqB,OAAO,OAAsB,YAA6B;AAC1F,QAAM,SAAS,MAAM,IAAI,oBAAoB,EAAE,UAAU,CAAC,OAAO,EAAE,CAAC,EAAE,SAAS,CAAC,GAAG,KAAK,CAAC,EAAE,MAAM;AACjG,SAAO;AACT;;;ACdA,SAAS,cAAc;AACvB,SAAoB,gBAAgB;AAM7B,IAAM,kBAAkB,MAAiB;AAC9C,SAAO,EAAE,MAAM,OAAO,WAAW,GAAG,QAAQ,SAAS;AACvD;;;ACRO,IAAM,eAA6B;;;ACA1C,SAAS,6BAAsC;AAIxC,IAAM,oBAAoB,GAAG,YAAY;AAwDzC,IAAM,gBAAgB,sBAAmC,iBAAiB;;;AC7DjF,SAAS,yBAAAA,8BAAiD;AAKnD,IAAM,gBAA+B;AAkBrC,IAAM,YAAYA,uBAA+B,aAAa;;;ACnB9D,IAAM,iBAAiC;","names":["isPayloadOfSchemaType"]}
@@ -0,0 +1,3 @@
1
+ export type EscrowSchema = 'network.xyo.escrow';
2
+ export declare const EscrowSchema: EscrowSchema;
3
+ //# sourceMappingURL=Schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Schema.d.ts","sourceRoot":"","sources":["../../../src/Escrow/Schema.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG,oBAAoB,CAAA;AAC/C,eAAO,MAAM,YAAY,EAAE,YAAmC,CAAA"}
@@ -0,0 +1,3 @@
1
+ export type EscrowSchema = 'network.xyo.escrow';
2
+ export declare const EscrowSchema: EscrowSchema;
3
+ //# sourceMappingURL=Schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Schema.d.ts","sourceRoot":"","sources":["../../../src/Escrow/Schema.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG,oBAAoB,CAAA;AAC/C,eAAO,MAAM,YAAY,EAAE,YAAmC,CAAA"}
@@ -0,0 +1,3 @@
1
+ export type EscrowSchema = 'network.xyo.escrow';
2
+ export declare const EscrowSchema: EscrowSchema;
3
+ //# sourceMappingURL=Schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Schema.d.ts","sourceRoot":"","sources":["../../../src/Escrow/Schema.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG,oBAAoB,CAAA;AAC/C,eAAO,MAAM,YAAY,EAAE,YAAmC,CAAA"}
@@ -0,0 +1,58 @@
1
+ import { Address, Hash } from '@xylabs/hex';
2
+ import { Payload } from '@xyo-network/payload-model';
3
+ export declare const EscrowTermsSchema: "network.xyo.escrow.terms";
4
+ export type EscrowTermsSchema = typeof EscrowTermsSchema;
5
+ export interface EscrowTermsFields {
6
+ /**
7
+ * The trusted estimators for the worth of the things being sold
8
+ */
9
+ appraisalAuthorities: Address[];
10
+ /**
11
+ * The estimated worths of the things being sold
12
+ */
13
+ appraisals: Hash[];
14
+ /**
15
+ * The things being sold
16
+ */
17
+ assets: Hash[];
18
+ /**
19
+ * The buyer
20
+ */
21
+ buyer: Address[];
22
+ /**
23
+ * The buyer
24
+ */
25
+ buyerSecret: Hash;
26
+ /**
27
+ * The escrow agent responsible for the escrow
28
+ */
29
+ escrowAgent: Address;
30
+ /**
31
+ * The time the escrow expires
32
+ */
33
+ exp: number;
34
+ /**
35
+ * The time the escrow starts
36
+ */
37
+ nbf: number;
38
+ /**
39
+ * The trusted payment authorities
40
+ */
41
+ paymentAuthorities: Address[];
42
+ /**
43
+ * The seller
44
+ */
45
+ seller: Address[];
46
+ /**
47
+ * The seller
48
+ */
49
+ sellerSecret: Hash;
50
+ }
51
+ /**
52
+ * The terms of an escrow
53
+ */
54
+ export type EscrowTerms = Payload<Partial<EscrowTermsFields>, EscrowTermsSchema>;
55
+ export declare const isEscrowTerms: (x?: unknown) => x is import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & Partial<EscrowTermsFields> & {
56
+ schema: "network.xyo.escrow.terms";
57
+ };
58
+ //# sourceMappingURL=Terms.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Terms.d.ts","sourceRoot":"","sources":["../../../src/Escrow/Terms.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAyB,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAI3E,eAAO,MAAM,iBAAiB,4BAAmC,CAAA;AACjE,MAAM,MAAM,iBAAiB,GAAG,OAAO,iBAAiB,CAAA;AAGxD,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,oBAAoB,EAAE,OAAO,EAAE,CAAA;IAC/B;;OAEG;IACH,UAAU,EAAE,IAAI,EAAE,CAAA;IAClB;;OAEG;IACH,MAAM,EAAE,IAAI,EAAE,CAAA;IACd;;OAEG;IACH,KAAK,EAAE,OAAO,EAAE,CAAA;IAChB;;OAEG;IACH,WAAW,EAAE,IAAI,CAAA;IACjB;;OAEG;IACH,WAAW,EAAE,OAAO,CAAA;IACpB;;OAEG;IACH,GAAG,EAAE,MAAM,CAAA;IACX;;OAEG;IACH,GAAG,EAAE,MAAM,CAAA;IACX;;OAEG;IACH,kBAAkB,EAAE,OAAO,EAAE,CAAA;IAC7B;;OAEG;IACH,MAAM,EAAE,OAAO,EAAE,CAAA;IACjB;;OAEG;IACH,YAAY,EAAE,IAAI,CAAA;CACnB;AAED;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,iBAAiB,CAAC,EAAE,iBAAiB,CAAC,CAAA;AAEhF,eAAO,MAAM,aAAa;;CAAwD,CAAA"}