@pax2pay/model-banking 0.1.117 → 0.1.119

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 (148) hide show
  1. package/Amount.ts +10 -0
  2. package/Amounts.ts +10 -0
  3. package/Authorization/Creatable.ts +2 -1
  4. package/Authorization/Status.ts +47 -0
  5. package/Authorization/index.ts +83 -18
  6. package/Card/Changeable.ts +2 -1
  7. package/Card/Creatable.ts +2 -1
  8. package/Card/Operation/Settlement.ts +2 -2
  9. package/Card/Preset.ts +1 -0
  10. package/Card/index.ts +3 -2
  11. package/Client/Settlements.ts +2 -2
  12. package/Identifier.ts +12 -0
  13. package/Operation/Creatable.ts +3 -2
  14. package/{Realm/index.ts → Realm.ts} +2 -1
  15. package/Rule/State/index.ts +1 -1
  16. package/Settlement/Creatable.ts +18 -0
  17. package/Settlement/Entry/Cancel.ts +34 -0
  18. package/Settlement/Entry/Capture.ts +34 -0
  19. package/Settlement/Entry/Creatable.ts +18 -0
  20. package/Settlement/Entry/Refund.ts +34 -0
  21. package/Settlement/Entry/Summary.ts +21 -0
  22. package/Settlement/Entry/Unknown.ts +29 -0
  23. package/Settlement/Entry/index.ts +49 -0
  24. package/Settlement/Fee.ts +12 -0
  25. package/Settlement/Settled.ts +19 -0
  26. package/Settlement/Status.ts +13 -0
  27. package/Settlement/Total.ts +17 -0
  28. package/Settlement/index.ts +67 -75
  29. package/Transaction/Creatable.ts +11 -11
  30. package/Transaction/Note.ts +13 -3
  31. package/Transaction/Reference.ts +12 -1
  32. package/Transaction/index.ts +18 -13
  33. package/Treasury/Balance/index.ts +5 -9
  34. package/dist/Amount.d.ts +8 -0
  35. package/dist/Amount.js +9 -0
  36. package/dist/Amount.js.map +1 -0
  37. package/dist/Amounts.d.ts +8 -0
  38. package/dist/Amounts.js +9 -0
  39. package/dist/Amounts.js.map +1 -0
  40. package/dist/Authorization/Creatable.d.ts +2 -2
  41. package/dist/Authorization/Creatable.js.map +1 -1
  42. package/dist/Authorization/Status.d.ts +16 -0
  43. package/dist/Authorization/Status.js +38 -0
  44. package/dist/Authorization/Status.js.map +1 -0
  45. package/dist/Authorization/index.d.ts +30 -9
  46. package/dist/Authorization/index.js +57 -11
  47. package/dist/Authorization/index.js.map +1 -1
  48. package/dist/Card/Changeable.d.ts +2 -2
  49. package/dist/Card/Changeable.js.map +1 -1
  50. package/dist/Card/Creatable.d.ts +2 -2
  51. package/dist/Card/Creatable.js.map +1 -1
  52. package/dist/Card/Operation/Settlement.d.ts +1 -1
  53. package/dist/Card/Operation/Settlement.js +1 -1
  54. package/dist/Card/Operation/Settlement.js.map +1 -1
  55. package/dist/Card/Preset.js.map +1 -1
  56. package/dist/Card/index.d.ts +3 -2
  57. package/dist/Card/index.js.map +1 -1
  58. package/dist/Client/Settlements.d.ts +1 -1
  59. package/dist/Client/Settlements.js.map +1 -1
  60. package/dist/Identifier.d.ts +5 -0
  61. package/dist/Identifier.js +10 -0
  62. package/dist/Identifier.js.map +1 -0
  63. package/dist/Operation/Creatable.js +3 -2
  64. package/dist/Operation/Creatable.js.map +1 -1
  65. package/dist/{Realm/index.d.ts → Realm.d.ts} +2 -1
  66. package/dist/{Realm/index.js → Realm.js} +2 -1
  67. package/dist/Realm.js.map +1 -0
  68. package/dist/Rule/State/index.d.ts +1 -1
  69. package/dist/Rule/State/index.js.map +1 -1
  70. package/dist/Settlement/Creatable.d.ts +12 -0
  71. package/dist/Settlement/Creatable.js +13 -0
  72. package/dist/Settlement/Creatable.js.map +1 -0
  73. package/dist/Settlement/Entry/Cancel.d.ts +24 -0
  74. package/dist/Settlement/Entry/Cancel.js +25 -0
  75. package/dist/Settlement/Entry/Cancel.js.map +1 -0
  76. package/dist/Settlement/Entry/Capture.d.ts +24 -0
  77. package/dist/Settlement/Entry/Capture.js +25 -0
  78. package/dist/Settlement/Entry/Capture.js.map +1 -0
  79. package/dist/Settlement/Entry/Creatable.d.ts +11 -0
  80. package/dist/Settlement/Entry/Creatable.js +12 -0
  81. package/dist/Settlement/Entry/Creatable.js.map +1 -0
  82. package/dist/Settlement/Entry/Refund.d.ts +24 -0
  83. package/dist/Settlement/Entry/Refund.js +25 -0
  84. package/dist/Settlement/Entry/Refund.js.map +1 -0
  85. package/dist/Settlement/Entry/Summary.d.ts +12 -0
  86. package/dist/Settlement/Entry/Summary.js +15 -0
  87. package/dist/Settlement/Entry/Summary.js.map +1 -0
  88. package/dist/Settlement/Entry/Unknown.d.ts +21 -0
  89. package/dist/Settlement/Entry/Unknown.js +23 -0
  90. package/dist/Settlement/Entry/Unknown.js.map +1 -0
  91. package/dist/Settlement/Entry/index.d.ts +31 -0
  92. package/dist/Settlement/Entry/index.js +33 -0
  93. package/dist/Settlement/Entry/index.js.map +1 -0
  94. package/dist/Settlement/Fee.d.ts +10 -0
  95. package/dist/Settlement/Fee.js +9 -0
  96. package/dist/Settlement/Fee.js.map +1 -0
  97. package/dist/Settlement/Settled.d.ts +13 -0
  98. package/dist/Settlement/Settled.js +14 -0
  99. package/dist/Settlement/Settled.js.map +1 -0
  100. package/dist/Settlement/Status.d.ts +7 -0
  101. package/dist/Settlement/Status.js +8 -0
  102. package/dist/Settlement/Status.js.map +1 -0
  103. package/dist/Settlement/Total.d.ts +13 -0
  104. package/dist/Settlement/Total.js +14 -0
  105. package/dist/Settlement/Total.js.map +1 -0
  106. package/dist/Settlement/index.d.ts +46 -45
  107. package/dist/Settlement/index.js +49 -47
  108. package/dist/Settlement/index.js.map +1 -1
  109. package/dist/Transaction/Creatable.d.ts +5 -1
  110. package/dist/Transaction/Creatable.js +11 -10
  111. package/dist/Transaction/Creatable.js.map +1 -1
  112. package/dist/Transaction/Note.d.ts +5 -1
  113. package/dist/Transaction/Note.js +13 -4
  114. package/dist/Transaction/Note.js.map +1 -1
  115. package/dist/Transaction/Reference.d.ts +7 -2
  116. package/dist/Transaction/Reference.js +12 -1
  117. package/dist/Transaction/Reference.js.map +1 -1
  118. package/dist/Transaction/index.d.ts +5 -1
  119. package/dist/Transaction/index.js +19 -12
  120. package/dist/Transaction/index.js.map +1 -1
  121. package/dist/Treasury/Balance/index.d.ts +5 -3
  122. package/dist/Treasury/Balance/index.js +4 -7
  123. package/dist/Treasury/Balance/index.js.map +1 -1
  124. package/dist/pax2pay.d.ts +3 -0
  125. package/dist/pax2pay.js +3 -0
  126. package/dist/pax2pay.js.map +1 -1
  127. package/global.d.ts +2 -0
  128. package/package.json +9 -8
  129. package/pax2pay.ts +3 -0
  130. package/tsconfig.json +3 -1
  131. package/verifier/index.ts +14 -0
  132. package/Authorization/Approved.ts +0 -21
  133. package/Authorization/Base.ts +0 -43
  134. package/Authorization/Failed.ts +0 -46
  135. package/Settlement/Entry.ts +0 -87
  136. package/dist/Authorization/Approved.d.ts +0 -14
  137. package/dist/Authorization/Approved.js +0 -16
  138. package/dist/Authorization/Approved.js.map +0 -1
  139. package/dist/Authorization/Base.d.ts +0 -22
  140. package/dist/Authorization/Base.js +0 -34
  141. package/dist/Authorization/Base.js.map +0 -1
  142. package/dist/Authorization/Failed.d.ts +0 -18
  143. package/dist/Authorization/Failed.js +0 -41
  144. package/dist/Authorization/Failed.js.map +0 -1
  145. package/dist/Realm/index.js.map +0 -1
  146. package/dist/Settlement/Entry.d.ts +0 -59
  147. package/dist/Settlement/Entry.js +0 -64
  148. package/dist/Settlement/Entry.js.map +0 -1
@@ -1,87 +1,79 @@
1
+ import { cryptly } from "cryptly"
1
2
  import { isoly } from "isoly"
2
3
  import { isly } from "isly"
4
+ import { Creatable as SettlementCreatable } from "./Creatable"
3
5
  import { Entry as SettlementEntry } from "./Entry"
6
+ import { Fee as SettlementFee } from "./Fee"
7
+ import { Settled } from "./Settled"
8
+ import { Status } from "./Status"
9
+ import { Total as SettlementTotal } from "./Total"
10
+
11
+ export interface Settlement {
12
+ id: string
13
+ by?: string
14
+ created: isoly.DateTime
15
+ reference: string
16
+ processor: string
17
+ status: Status
18
+ expected: Settlement.Total
19
+ outcome?: Settlement.Total
20
+ settled?: Settled
21
+ entries?: Settlement.Entry.Summary
22
+ }
4
23
 
5
- export type Settlement = Settlement.Succeeded | Settlement.Failed | Settlement.Ongoing
6
24
  export namespace Settlement {
7
- export type Summary = Omit<Settlement.Succeeded, "entries"> | Settlement.Failed | Omit<Settlement.Ongoing, "entries">
8
- export interface Base {
9
- id: string
10
- created: [string, isoly.DateTime]
11
- regarding: isoly.Date
12
- configuration: string
13
- status: string
14
- }
15
- export interface Succeeded extends Base {
16
- status: "succeeded"
17
- amount: Partial<Record<isoly.Currency, number>>
18
- fee: Partial<Record<isoly.Currency, number>>
19
- entries: SettlementEntry[]
20
- settled: { user: string; created: isoly.DateTime; transactions: Record<string, [isoly.Currency, number]> }
25
+ export const Total = SettlementTotal
26
+ export type Total = SettlementTotal
27
+ export const Fee = SettlementFee
28
+ export type Fee = SettlementFee
29
+ export type Creatable = SettlementCreatable
30
+ export const Creatable = SettlementCreatable
31
+ export type Entry = SettlementEntry
32
+ export namespace Entry {
33
+ export type Summary = SettlementEntry.Summary
34
+ export const Summary = SettlementEntry.Summary
35
+ export type Creatable = SettlementEntry.Creatable
36
+ export const Creatable = SettlementEntry.Creatable
37
+ export type Refund = SettlementEntry.Refund
38
+ export const Refund = SettlementEntry.Refund
39
+ export type Cancel = SettlementEntry.Cancel
40
+ export const Cancel = SettlementEntry.Cancel
41
+ export type Capture = SettlementEntry.Capture
42
+ export const Capture = SettlementEntry.Capture
43
+ export type Unknown = SettlementEntry.Unknown
44
+ export const Unknown = SettlementEntry.Unknown
45
+ export const from = SettlementEntry.from
46
+ export const type = SettlementEntry.type
47
+ export const is = SettlementEntry.is
48
+ export const flaw = SettlementEntry.flaw
21
49
  }
22
- export interface Failed extends Base {
23
- status: "failed"
24
- reason: string
50
+ export function from(id: cryptly.Identifier, creatable: Settlement.Creatable, by: string): Settlement {
51
+ return { id, status: "ongoing", by, expected: Total.initiate(), ...creatable, created: isoly.DateTime.now() }
25
52
  }
26
- export interface Ongoing extends Base {
27
- status: "ongoing"
28
- amount: Partial<Record<isoly.Currency, number>>
29
- fee: Partial<Record<isoly.Currency, number>>
30
- entries: SettlementEntry[]
53
+ export function toFailed(id: string, creatable: Settlement.Creatable, by: string, reason: string): Settlement {
54
+ return {
55
+ id,
56
+ created: isoly.DateTime.now(),
57
+ status: ["failed", reason],
58
+ by,
59
+ processor: creatable.processor,
60
+ reference: creatable.reference,
61
+ expected: Total.initiate(),
62
+ }
31
63
  }
32
64
 
33
- export namespace Succeeded {
34
- export const type = isly.object<Succeeded>({
35
- id: isly.string(),
36
- created: isly.tuple(isly.string(), isly.fromIs("Settlement.created", isoly.DateTime.is)),
37
- regarding: isly.fromIs("Settlement.regarding", isoly.Date.is),
38
- configuration: isly.string(),
39
- settled: isly.object<{
40
- user: string
41
- created: isoly.DateTime
42
- transactions: Record<string, [isoly.Currency, number]>
43
- }>({
44
- user: isly.string(),
45
- created: isly.fromIs("Settlement.settled.created", isoly.DateTime.is),
46
- transactions: isly.record(
47
- isly.string(),
48
- isly.tuple(isly.fromIs("Settlement.settled.transactions.currency", isoly.Currency.is), isly.number())
49
- ),
50
- }),
51
- amount: isly.record(isly.fromIs("Settlement.entries.amount", isoly.Currency.is), isly.number()),
52
- fee: isly.record(isly.fromIs("Settlement.entries.fee", isoly.Currency.is), isly.number()),
53
- entries: SettlementEntry.type.array(),
54
- status: isly.string("succeeded"),
55
- })
56
- export const is = type.is
57
- }
58
- export namespace Failed {
59
- export const type = isly.object<Failed>({
60
- id: isly.string(),
61
- created: isly.tuple(isly.string(), isly.fromIs("Settlement.created", isoly.DateTime.is)),
62
- regarding: isly.fromIs("Settlement.regarding", isoly.Date.is),
63
- configuration: isly.string(),
64
- status: isly.string("failed"),
65
- reason: isly.string(),
66
- })
67
- export const is = type.is
68
- }
69
- export namespace Ongoing {
70
- export const type = isly.object<Ongoing>({
71
- id: isly.string(),
72
- created: isly.tuple(isly.string(), isly.fromIs("Settlement.created", isoly.DateTime.is)),
73
- regarding: isly.fromIs("Settlement.regarding", isoly.Date.is),
74
- configuration: isly.string(),
75
- amount: isly.record(isly.fromIs("Settlement.entries.amount", isoly.Currency.is), isly.number()),
76
- fee: isly.record(isly.fromIs("Settlement.entries.fee", isoly.Currency.is), isly.number()),
77
- entries: SettlementEntry.type.array(),
78
- status: isly.string("ongoing"),
79
- })
80
- export const is = type.is
81
- }
82
- export const type = isly.union<Settlement, Succeeded, Failed, Ongoing>(Succeeded.type, Failed.type, Ongoing.type)
65
+ export const type = isly.object({
66
+ id: isly.string(),
67
+ by: isly.string().optional(),
68
+ created: isly.fromIs("isoly.DateTime", isoly.DateTime.is),
69
+ reference: isly.string(),
70
+ processor: isly.string(),
71
+ status: Status.type,
72
+ expected: Settlement.Total.type,
73
+ outcome: Settlement.Total.type.optional(),
74
+ settled: Settled.type.optional(),
75
+ entries: Settlement.Entry.Summary.type.optional(),
76
+ })
83
77
  export const is = type.is
84
78
  export const flaw = type.flaw
85
- export const Entry = SettlementEntry
86
- export type Entry = SettlementEntry
87
79
  }
@@ -1,4 +1,5 @@
1
1
  import { isoly } from "isoly"
2
+ import { isly } from "isly"
2
3
  import { Operation } from "../Operation"
3
4
  import { Rail } from "../Rail"
4
5
 
@@ -11,15 +12,14 @@ export interface Creatable {
11
12
  }
12
13
 
13
14
  export namespace Creatable {
14
- export function is(value: any | Creatable): value is Creatable {
15
- return (
16
- typeof value == "object" &&
17
- Rail.is(value.counterpart) &&
18
- isoly.Currency.is(value.currency) &&
19
- typeof value.amount == "number" &&
20
- typeof value.description == "string" &&
21
- (value.operations == undefined ||
22
- (Array.isArray(value.operations) && value.operations.every(Operation.Creatable.is)))
23
- )
24
- }
15
+ export const type = isly.object<Creatable>({
16
+ counterpart: isly.fromIs("Rail", Rail.is),
17
+ currency: isly.fromIs("isoly.Currency", isoly.Currency.is),
18
+ amount: isly.number(),
19
+ description: isly.string(),
20
+ operations: isly.array(isly.fromIs("Operation.Creatable", Operation.Creatable.is)),
21
+ })
22
+ export const is = type.is
23
+ export const flaw = type.flaw
24
+ export const get = type.get
25
25
  }
@@ -1,4 +1,5 @@
1
1
  import { isoly } from "isoly"
2
+ import { isly } from "isly"
2
3
 
3
4
  export interface Note extends Note.Creatable {
4
5
  author: string
@@ -14,8 +15,17 @@ export namespace Note {
14
15
  action?: "approve" | "reject"
15
16
  }
16
17
  export namespace Creatable {
17
- export function is(value: Creatable | any): value is Creatable {
18
- return true
19
- }
18
+ export const type = isly.object<Creatable>({
19
+ text: isly.string().optional(),
20
+ action: isly.string(["approve", "reject"]).optional(),
21
+ })
22
+ export const is = type.is
20
23
  }
24
+ export const type = isly.object<Note>({
25
+ author: isly.string(),
26
+ created: isly.string(),
27
+ text: isly.string().optional(),
28
+ action: isly.string(["approve", "reject"]).optional(),
29
+ })
30
+ export const is = type.is
21
31
  }
@@ -1,8 +1,19 @@
1
+ import { isly } from "isly"
1
2
  import { Supplier } from "../Supplier"
2
3
 
3
- export type Reference = {
4
+ export interface Reference {
4
5
  supplier?: Supplier
5
6
  reference?: string
6
7
  returnId?: string
7
8
  endToEndId?: string
8
9
  }
10
+
11
+ export namespace Reference {
12
+ export const type = isly.object<Reference>({
13
+ supplier: isly.fromIs("Supplier", Supplier.is).optional(),
14
+ reference: isly.string().optional(),
15
+ returnId: isly.string().optional(),
16
+ endToEndId: isly.string().optional(),
17
+ })
18
+ export const is = type.is
19
+ }
@@ -1,5 +1,6 @@
1
1
  import * as cryptly from "cryptly"
2
2
  import { isoly } from "isoly"
3
+ import { isly } from "isly"
3
4
  import { Operation } from "../Operation"
4
5
  import { Rail } from "../Rail"
5
6
  import { Creatable as TransactionCreatable } from "./Creatable"
@@ -23,19 +24,23 @@ export interface Transaction extends TransactionCreatable {
23
24
  }
24
25
 
25
26
  export namespace Transaction {
26
- export function is(value: any | Transaction): value is Transaction {
27
- return (
28
- typeof value == "object" &&
29
- typeof value.organization == "string" &&
30
- typeof value.accountId == "string" &&
31
- cryptly.Identifier.is(value.id, 8) &&
32
- Rail.is(value.account) &&
33
- Rail.is(value.counterpart) &&
34
- isoly.DateTime.is(value.posted) &&
35
- typeof value.balance == "number" &&
36
- Array.isArray(value.operations)
37
- )
38
- }
27
+ export const type = TransactionCreatable.type.extend<Transaction>({
28
+ organization: isly.string(),
29
+ accountId: isly.string(),
30
+ account: isly.fromIs("Rail", Rail.is),
31
+ id: isly.fromIs("cryptly.Identifier", cryptly.Identifier.is).readonly(),
32
+ reference: isly.fromIs("TransactionReference", TransactionReference.is).readonly().optional(),
33
+ posted: isly.string(),
34
+ transacted: isly.string().optional(),
35
+ balance: isly.number(),
36
+ operations: isly.array(isly.fromIs("Operation", Operation.is)),
37
+ status: isly.string(["created", "approved", "rejected", "processing", "finalized"]),
38
+ flags: isly.array(isly.string() || "review"),
39
+ notes: isly.array(isly.fromIs("TransactionNote", TransactionNote.is)),
40
+ })
41
+ export const is = type.is
42
+ export const flaw = type.flaw
43
+ export const get = type.get
39
44
  export function fromCreatable(
40
45
  organization: string,
41
46
  accountId: string,
@@ -1,17 +1,13 @@
1
- import { isoly } from "isoly"
1
+ import { Amounts } from "../../Amounts"
2
2
 
3
- export type Balance = Partial<Record<isoly.Currency, number>>
3
+ export type Balance = Amounts
4
4
 
5
5
  export type Result = { account: string; balance: number }
6
6
 
7
7
  export namespace Balance {
8
- export function is(value: Balance | any): value is Balance {
9
- return (
10
- value &&
11
- typeof value == "object" &&
12
- Object.entries(value).every(([k, v]) => isoly.Currency.is(k) && typeof v == "number")
13
- )
14
- }
8
+ export const type = Amounts.type
9
+ export const is = Amounts.is
10
+ export const flaw = Amounts.flaw
15
11
  }
16
12
  export namespace Result {
17
13
  export function is(value: Result | any): value is Result {
@@ -0,0 +1,8 @@
1
+ import { isoly } from "isoly";
2
+ import { isly } from "isly";
3
+ export type Amount = [isoly.Currency, number];
4
+ export declare namespace Amount {
5
+ const type: isly.Type<Amount>;
6
+ const is: isly.Type.IsFunction<Amount>;
7
+ const flaw: isly.Type.FlawFunction;
8
+ }
package/dist/Amount.js ADDED
@@ -0,0 +1,9 @@
1
+ import { isoly } from "isoly";
2
+ import { isly } from "isly";
3
+ export var Amount;
4
+ (function (Amount) {
5
+ Amount.type = isly.tuple(isly.string(isoly.Currency.types), isly.number());
6
+ Amount.is = Amount.type.is;
7
+ Amount.flaw = Amount.type.flaw;
8
+ })(Amount || (Amount = {}));
9
+ //# sourceMappingURL=Amount.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Amount.js","sourceRoot":"../","sources":["Amount.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAI3B,MAAM,KAAW,MAAM,CAItB;AAJD,WAAiB,MAAM;IACT,WAAI,GAAG,IAAI,CAAC,KAAK,CAAS,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,CAAA;IAC3E,SAAE,GAAG,OAAA,IAAI,CAAC,EAAE,CAAA;IACZ,WAAI,GAAG,OAAA,IAAI,CAAC,IAAI,CAAA;AAC9B,CAAC,EAJgB,MAAM,KAAN,MAAM,QAItB"}
@@ -0,0 +1,8 @@
1
+ import { isoly } from "isoly";
2
+ import { isly } from "isly";
3
+ export type Amounts = Partial<Record<isoly.Currency, number>>;
4
+ export declare namespace Amounts {
5
+ const type: isly.Type<Partial<Record<"BTN" | "CHE" | "MKD" | "AED" | "AFN" | "ALL" | "AMD" | "ANG" | "AOA" | "ARS" | "AUD" | "AWG" | "AZN" | "BAM" | "BBD" | "BDT" | "BGN" | "BHD" | "BIF" | "BMD" | "BND" | "BOB" | "BOV" | "BRL" | "BSD" | "BWP" | "BYN" | "BZD" | "CAD" | "CDF" | "CHF" | "CHW" | "CLF" | "CLP" | "CNY" | "COP" | "COU" | "CRC" | "CUC" | "CUP" | "CVE" | "CZK" | "DJF" | "DKK" | "DOP" | "DZD" | "EGP" | "ERN" | "ETB" | "EUR" | "FJD" | "FKP" | "GBP" | "GEL" | "GHS" | "GIP" | "GMD" | "GNF" | "GTQ" | "GYD" | "HKD" | "HNL" | "HRK" | "HTG" | "HUF" | "IDR" | "ILS" | "INR" | "IQD" | "IRR" | "ISK" | "JMD" | "JOD" | "JPY" | "KES" | "KGS" | "KHR" | "KMF" | "KPW" | "KRW" | "KWD" | "KYD" | "KZT" | "LAK" | "LBP" | "LKR" | "LRD" | "LSL" | "LYD" | "MAD" | "MDL" | "MGA" | "MMK" | "MNT" | "MOP" | "MRU" | "MUR" | "MVR" | "MWK" | "MXN" | "MXV" | "MYR" | "MZN" | "NAD" | "NGN" | "NIO" | "NOK" | "NPR" | "NZD" | "OMR" | "PAB" | "PEN" | "PGK" | "PHP" | "PKR" | "PLN" | "PYG" | "QAR" | "RON" | "RSD" | "RUB" | "RWF" | "SAR" | "SBD" | "SCR" | "SDG" | "SEK" | "SGD" | "SHP" | "SLL" | "SOS" | "SRD" | "SSP" | "STN" | "SVC" | "SYP" | "SZL" | "THB" | "TJS" | "TMT" | "TND" | "TOP" | "TRY" | "TTD" | "TWD" | "TZS" | "UAH" | "UGX" | "USD" | "USN" | "UYI" | "UYU" | "UYW" | "UZS" | "VES" | "VND" | "VUV" | "WST" | "XAF" | "XAG" | "XAU" | "XBA" | "XBB" | "XBC" | "XBD" | "XCD" | "XDR" | "XOF" | "XPD" | "XPF" | "XPT" | "XSU" | "XTS" | "XUA" | "XXX" | "YER" | "ZAR" | "ZMW" | "ZWL", number>>>;
6
+ const is: isly.Type.IsFunction<Partial<Record<"BTN" | "CHE" | "MKD" | "AED" | "AFN" | "ALL" | "AMD" | "ANG" | "AOA" | "ARS" | "AUD" | "AWG" | "AZN" | "BAM" | "BBD" | "BDT" | "BGN" | "BHD" | "BIF" | "BMD" | "BND" | "BOB" | "BOV" | "BRL" | "BSD" | "BWP" | "BYN" | "BZD" | "CAD" | "CDF" | "CHF" | "CHW" | "CLF" | "CLP" | "CNY" | "COP" | "COU" | "CRC" | "CUC" | "CUP" | "CVE" | "CZK" | "DJF" | "DKK" | "DOP" | "DZD" | "EGP" | "ERN" | "ETB" | "EUR" | "FJD" | "FKP" | "GBP" | "GEL" | "GHS" | "GIP" | "GMD" | "GNF" | "GTQ" | "GYD" | "HKD" | "HNL" | "HRK" | "HTG" | "HUF" | "IDR" | "ILS" | "INR" | "IQD" | "IRR" | "ISK" | "JMD" | "JOD" | "JPY" | "KES" | "KGS" | "KHR" | "KMF" | "KPW" | "KRW" | "KWD" | "KYD" | "KZT" | "LAK" | "LBP" | "LKR" | "LRD" | "LSL" | "LYD" | "MAD" | "MDL" | "MGA" | "MMK" | "MNT" | "MOP" | "MRU" | "MUR" | "MVR" | "MWK" | "MXN" | "MXV" | "MYR" | "MZN" | "NAD" | "NGN" | "NIO" | "NOK" | "NPR" | "NZD" | "OMR" | "PAB" | "PEN" | "PGK" | "PHP" | "PKR" | "PLN" | "PYG" | "QAR" | "RON" | "RSD" | "RUB" | "RWF" | "SAR" | "SBD" | "SCR" | "SDG" | "SEK" | "SGD" | "SHP" | "SLL" | "SOS" | "SRD" | "SSP" | "STN" | "SVC" | "SYP" | "SZL" | "THB" | "TJS" | "TMT" | "TND" | "TOP" | "TRY" | "TTD" | "TWD" | "TZS" | "UAH" | "UGX" | "USD" | "USN" | "UYI" | "UYU" | "UYW" | "UZS" | "VES" | "VND" | "VUV" | "WST" | "XAF" | "XAG" | "XAU" | "XBA" | "XBB" | "XBC" | "XBD" | "XCD" | "XDR" | "XOF" | "XPD" | "XPF" | "XPT" | "XSU" | "XTS" | "XUA" | "XXX" | "YER" | "ZAR" | "ZMW" | "ZWL", number>>>;
7
+ const flaw: isly.Type.FlawFunction;
8
+ }
@@ -0,0 +1,9 @@
1
+ import { isoly } from "isoly";
2
+ import { isly } from "isly";
3
+ export var Amounts;
4
+ (function (Amounts) {
5
+ Amounts.type = isly.record(isly.string(isoly.Currency.types), isly.number());
6
+ Amounts.is = Amounts.type.is;
7
+ Amounts.flaw = Amounts.type.flaw;
8
+ })(Amounts || (Amounts = {}));
9
+ //# sourceMappingURL=Amounts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Amounts.js","sourceRoot":"../","sources":["Amounts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAI3B,MAAM,KAAW,OAAO,CAIvB;AAJD,WAAiB,OAAO;IACV,YAAI,GAAG,IAAI,CAAC,MAAM,CAAU,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,CAAA;IAC7E,UAAE,GAAG,QAAA,IAAI,CAAC,EAAE,CAAA;IACZ,YAAI,GAAG,QAAA,IAAI,CAAC,IAAI,CAAA;AAC9B,CAAC,EAJgB,OAAO,KAAP,OAAO,QAIvB"}
@@ -1,10 +1,10 @@
1
- import { isoly } from "isoly";
2
1
  import { isly } from "isly";
3
2
  import { Acquirer } from "../Acquirer";
3
+ import { Amount } from "../Amount";
4
4
  import { Merchant } from "../Merchant";
5
5
  export interface Creatable {
6
6
  card: string;
7
- amount: [isoly.Currency, number];
7
+ amount: Amount;
8
8
  merchant: Merchant;
9
9
  acquirer: Acquirer;
10
10
  reference: string;
@@ -1 +1 @@
1
- {"version":3,"file":"Creatable.js","sourceRoot":"../","sources":["Authorization/Creatable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAUtC,MAAM,KAAW,SAAS,CAWzB;AAXD,WAAiB,SAAS;IACZ,cAAI,GAAG,IAAI,CAAC,MAAM,CAAY;QAC1C,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE;QACnB,MAAM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IAAI,CAAC,EAAE,CAAA;IACZ,cAAI,GAAG,UAAA,IAAI,CAAC,IAAI,CAAA;AAC9B,CAAC,EAXgB,SAAS,KAAT,SAAS,QAWzB"}
@@ -0,0 +1,16 @@
1
+ import { gracely } from "gracely";
2
+ import { isly } from "isly";
3
+ export type Status = "approved" | Status.Failed;
4
+ export declare namespace Status {
5
+ interface Failed {
6
+ code: string;
7
+ reason: string | string[];
8
+ error?: gracely.Error;
9
+ }
10
+ namespace Failed {
11
+ function from(error: gracely.Error): Failed;
12
+ }
13
+ const type: isly.Type<"approved" | Failed>;
14
+ const is: isly.Type.IsFunction<"approved" | Failed>;
15
+ const flaw: isly.Type.FlawFunction;
16
+ }
@@ -0,0 +1,38 @@
1
+ import { gracely } from "gracely";
2
+ import { isly } from "isly";
3
+ export var Status;
4
+ (function (Status) {
5
+ let Failed;
6
+ (function (Failed) {
7
+ function from(error) {
8
+ let result;
9
+ if (error.error?.includes("Card with id"))
10
+ result = { code: "14", reason: "Invalid card number" };
11
+ else if (error.error?.includes("must correspond to card limit")) {
12
+ result = { code: "13", reason: "Invalid amount" };
13
+ }
14
+ else if (error.error?.includes("Failed to reach account")) {
15
+ result = { code: "78", reason: "Invalid/nonexistent account specified (general)" };
16
+ }
17
+ else if (gracely.client.InvalidContent.is(error) && error.content.description.includes("rules")) {
18
+ const reasons = error.content.details?.notes.reduce((a, c) => [...a, `${c.created} ${c.author}: ${c.text ?? ""}`], []);
19
+ result = {
20
+ code: "62",
21
+ reason: ["Restricted card.", ...reasons],
22
+ };
23
+ }
24
+ else
25
+ result = { code: "05", reason: "Do not honor" };
26
+ return result;
27
+ }
28
+ Failed.from = from;
29
+ })(Failed = Status.Failed || (Status.Failed = {}));
30
+ Status.type = isly.union(isly.string("approved"), isly.object({
31
+ code: isly.string(),
32
+ reason: isly.union(isly.string(), isly.string().array()),
33
+ error: isly.fromIs("gracely.Error", gracely.Error.is).optional(),
34
+ }));
35
+ Status.is = Status.type.is;
36
+ Status.flaw = Status.type.flaw;
37
+ })(Status || (Status = {}));
38
+ //# sourceMappingURL=Status.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Status.js","sourceRoot":"../","sources":["Authorization/Status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAK3B,MAAM,KAAW,MAAM,CAwCtB;AAxCD,WAAiB,MAAM;IAMtB,IAAiB,MAAM,CAuBtB;IAvBD,WAAiB,MAAM;QACtB,SAAgB,IAAI,CAAC,KAAoB;YACxC,IAAI,MAAc,CAAA;YAClB,IAAI,KAAK,CAAC,KAAK,EAAE,QAAQ,CAAC,cAAc,CAAC;gBACxC,MAAM,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,qBAAqB,EAAE,CAAA;iBAClD,IAAI,KAAK,CAAC,KAAK,EAAE,QAAQ,CAAC,+BAA+B,CAAC,EAAE;gBAChE,MAAM,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,gBAAgB,EAAE,CAAA;aACjD;iBAAM,IAAI,KAAK,CAAC,KAAK,EAAE,QAAQ,CAAC,yBAAyB,CAAC,EAAE;gBAC5D,MAAM,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,iDAAiD,EAAE,CAAA;aAClF;iBAAM,IAAI,OAAO,CAAC,MAAM,CAAC,cAAc,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE;gBAClG,MAAM,OAAO,GAAa,KAAK,CAAC,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,MAAM,CAC5D,CAAC,CAAW,EAAE,CAAmB,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,IAAI,IAAI,EAAE,EAAE,CAAC,EACzF,EAAE,CACF,CAAA;gBACD,MAAM,GAAG;oBACR,IAAI,EAAE,IAAI;oBAEV,MAAM,EAAE,CAAC,kBAAkB,EAAE,GAAG,OAAO,CAAC;iBACxC,CAAA;aACD;;gBACA,MAAM,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,cAAc,EAAE,CAAA;YAChD,OAAO,MAAM,CAAA;QACd,CAAC;QArBe,WAAI,OAqBnB,CAAA;IACF,CAAC,EAvBgB,MAAM,GAAN,aAAM,KAAN,aAAM,QAuBtB;IACY,WAAI,GAAG,IAAI,CAAC,KAAK,CAC7B,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,EACvB,IAAI,CAAC,MAAM,CAAgB;QAC1B,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE;QACnB,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,CAAC;QACxD,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,eAAe,EAAE,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE;KAChE,CAAC,CACF,CAAA;IACY,SAAE,GAAG,OAAA,IAAI,CAAC,EAAE,CAAA;IACZ,WAAI,GAAG,OAAA,IAAI,CAAC,IAAI,CAAA;AAC9B,CAAC,EAxCgB,MAAM,KAAN,MAAM,QAwCtB"}
@@ -1,21 +1,42 @@
1
+ import { cryptly } from "cryptly";
1
2
  import { gracely } from "gracely";
3
+ import { isoly } from "isoly";
2
4
  import { isly } from "isly";
5
+ import { Acquirer } from "../Acquirer";
6
+ import { Amount } from "../Amount";
3
7
  import { Card } from "../Card";
8
+ import { Merchant } from "../Merchant";
4
9
  import { Transaction } from "../Transaction";
5
- import { Approved as AuthorizationApproved } from "./Approved";
6
10
  import { Creatable as AuthorizationCreatable } from "./Creatable";
7
- import { Failed as AuthorizationFailed } from "./Failed";
8
- export type Authorization = Authorization.Failed | Authorization.Approved;
11
+ import { Status } from "./Status";
12
+ export interface Authorization {
13
+ id: cryptly.Identifier;
14
+ created: isoly.DateTime;
15
+ status: Status;
16
+ reference: string;
17
+ amount: Amount;
18
+ card: {
19
+ id: string;
20
+ token?: string;
21
+ iin?: string;
22
+ last4?: string;
23
+ };
24
+ transaction?: {
25
+ id: string;
26
+ posted: isoly.DateTime;
27
+ description: string;
28
+ };
29
+ account?: string;
30
+ merchant: Merchant;
31
+ acquirer: Acquirer;
32
+ description: string;
33
+ }
9
34
  export declare namespace Authorization {
10
- type Approved = AuthorizationApproved;
11
- const Approved: typeof AuthorizationApproved;
12
- type Failed = AuthorizationFailed;
13
- const Failed: typeof AuthorizationFailed;
14
35
  type Creatable = AuthorizationCreatable;
15
36
  const Creatable: typeof AuthorizationCreatable;
16
- function fromCreatable(authorization: Authorization.Creatable, transaction: Transaction | gracely.Error): Authorization;
17
- const type: isly.Type<Authorization>;
37
+ const type: isly.object.ExtendableType<Authorization>;
18
38
  const is: isly.Type.IsFunction<Authorization>;
19
39
  const flaw: isly.Type.FlawFunction;
40
+ function fromCreatable(creatable: Creatable, card: Card | gracely.Error, transaction?: Transaction | gracely.Error): Authorization;
20
41
  function toTransaction(authorization: Authorization, card: Card): Transaction.Creatable;
21
42
  }
@@ -1,22 +1,68 @@
1
+ import { cryptly } from "cryptly";
1
2
  import { gracely } from "gracely";
3
+ import { isoly } from "isoly";
2
4
  import { isly } from "isly";
3
- import { Approved as AuthorizationApproved } from "./Approved";
5
+ import { Acquirer } from "../Acquirer";
6
+ import { Identifier } from "../Identifier";
7
+ import { Merchant } from "../Merchant";
4
8
  import { Creatable as AuthorizationCreatable } from "./Creatable";
5
- import { Failed as AuthorizationFailed } from "./Failed";
9
+ import { Status } from "./Status";
6
10
  export var Authorization;
7
11
  (function (Authorization) {
8
- Authorization.Approved = AuthorizationApproved;
9
- Authorization.Failed = AuthorizationFailed;
10
12
  Authorization.Creatable = AuthorizationCreatable;
11
- function fromCreatable(authorization, transaction) {
12
- return gracely.Error.is(transaction)
13
- ? Authorization.Failed.fromCreatable(authorization, transaction)
14
- : Authorization.Approved.fromCreatable(authorization, transaction);
15
- }
16
- Authorization.fromCreatable = fromCreatable;
17
- Authorization.type = isly.union(Authorization.Failed.type, Authorization.Approved.type);
13
+ Authorization.type = isly.object({
14
+ id: isly.fromIs("Authorization.id", cryptly.Identifier.is),
15
+ status: Status.type,
16
+ transaction: isly
17
+ .object({
18
+ id: isly.string(),
19
+ posted: isly.fromIs("isoly.DateTime", isoly.DateTime.is),
20
+ description: isly.string(),
21
+ })
22
+ .optional(),
23
+ card: isly.object({
24
+ id: isly.string(),
25
+ token: isly.string().optional(),
26
+ iin: isly.string().optional(),
27
+ last4: isly.string().optional(),
28
+ }),
29
+ created: isly.fromIs("Authorization.created", isoly.DateTime.is),
30
+ amount: isly.tuple(isly.fromIs("isoly.Currency", isoly.Currency.is), isly.number()),
31
+ account: isly.string().optional(),
32
+ merchant: Merchant.type,
33
+ acquirer: Acquirer.type,
34
+ reference: isly.string(),
35
+ description: isly.string(),
36
+ });
18
37
  Authorization.is = Authorization.type.is;
19
38
  Authorization.flaw = Authorization.type.flaw;
39
+ function fromCreatable(creatable, card, transaction) {
40
+ return {
41
+ id: Identifier.generate(),
42
+ ...{ status: "approved" },
43
+ ...(gracely.Error.is(card)
44
+ ? { card: { id: creatable.card }, status: { ...Status.Failed.from(card), error: card } }
45
+ : {
46
+ card: { id: card.id, iin: card.details.iin, last4: card.details.last4, token: card.details.token },
47
+ account: card.account,
48
+ }),
49
+ created: isoly.DateTime.now(),
50
+ amount: creatable.amount,
51
+ merchant: creatable.merchant,
52
+ acquirer: creatable.acquirer,
53
+ reference: creatable.reference,
54
+ description: creatable.description,
55
+ ...(!transaction
56
+ ? {}
57
+ : gracely.Error.is(transaction)
58
+ ? { ...Status.Failed.from(transaction), error: transaction }
59
+ : {
60
+ id: transaction.id,
61
+ transaction: { id: transaction?.id, posted: transaction?.posted, description: transaction.description },
62
+ }),
63
+ };
64
+ }
65
+ Authorization.fromCreatable = fromCreatable;
20
66
  function toTransaction(authorization, card) {
21
67
  return {
22
68
  amount: authorization.amount[1],
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"../","sources":["Authorization/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAG3B,OAAO,EAAE,QAAQ,IAAI,qBAAqB,EAAE,MAAM,YAAY,CAAA;AAC9D,OAAO,EAAE,SAAS,IAAI,sBAAsB,EAAE,MAAM,aAAa,CAAA;AACjE,OAAO,EAAE,MAAM,IAAI,mBAAmB,EAAE,MAAM,UAAU,CAAA;AAGxD,MAAM,KAAW,aAAa,CAwC7B;AAxCD,WAAiB,aAAa;IAEhB,sBAAQ,GAAG,qBAAqB,CAAA;IAEhC,oBAAM,GAAG,mBAAmB,CAAA;IAE5B,uBAAS,GAAG,sBAAsB,CAAA;IAC/C,SAAgB,aAAa,CAC5B,aAAsC,EACtC,WAAwC;QAExC,OAAO,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,WAAW,CAAC;YACnC,CAAC,CAAC,aAAa,CAAC,MAAM,CAAC,aAAa,CAAC,aAAa,EAAE,WAAW,CAAC;YAChE,CAAC,CAAC,aAAa,CAAC,QAAQ,CAAC,aAAa,CAAC,aAAa,EAAE,WAAW,CAAC,CAAA;IACpE,CAAC;IAPe,2BAAa,gBAO5B,CAAA;IACY,kBAAI,GAAG,IAAI,CAAC,KAAK,CAC7B,aAAa,CAAC,MAAM,CAAC,IAAI,EACzB,aAAa,CAAC,QAAQ,CAAC,IAAI,CAC3B,CAAA;IACY,gBAAE,GAAG,cAAA,IAAI,CAAC,EAAE,CAAA;IACZ,kBAAI,GAAG,cAAA,IAAI,CAAC,IAAI,CAAA;IAE7B,SAAgB,aAAa,CAAC,aAA4B,EAAE,IAAU;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C,EAAE,KAAK,EAAE,WAAW,EAAE;oBAC5D,CAAC,CAAC;wBACA,EAAE,EAAE,WAAW,CAAC,EAAE;wBAClB,WAAW,EAAE,EAAE,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW,CAAC,WAAW,EAAE;qBACtG,CAAC;SACL,CAAA;IACF,CAAC;IA7Be,2BAAa,gBA6B5B,CAAA;IAED,SAAgB,aAAa,CAAC,aAA4B,EAAE,IAAU;QACrE,OAAO;YACN,MAAM,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC;YAC/B,QAAQ,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC;YACjC,WAAW,EAAE,aAAa,CAAC,WAAW;YACtC,WAAW,EAAE;gBACZ,IAAI,EAAE,MAAM;gBACZ,MAAM,EAAE,YAAY;gBACpB,GAAG,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG;gBACrB,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM;gBAC3B,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK;gBACzB,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM;gBAC3B,EAAE,EAAE,IAAI,CAAC,EAAE;gBACX,QAAQ,EAAE,aAAa,CAAC,QAAQ;gBAChC,QAAQ,EAAE,aAAa,CAAC,QAAQ;aAChC;SACD,CAAA;IACF,CAAC;IAjBe,2BAAa,gBAiB5B,CAAA;AACF,CAAC,EA/EgB,aAAa,KAAb,aAAa,QA+E7B"}
@@ -1,8 +1,8 @@
1
- import { isoly } from "isoly";
2
1
  import { isly } from "isly";
2
+ import { Amount } from "../Amount";
3
3
  import { Meta } from "./Meta";
4
4
  export type Changeable = {
5
- limit?: [isoly.Currency, number];
5
+ limit?: Amount;
6
6
  meta?: Meta;
7
7
  };
8
8
  export declare namespace Changeable {
@@ -1 +1 @@
1
- {"version":3,"file":"Changeable.js","sourceRoot":"../","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,EAAE;QAC7F,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE;KAClD,CAAC,CAAA;IACW,aAAE,GAAG,WAAA,IAAI,CAAC,EAAE,CAAA;IACZ,eAAI,GAAG,WAAA,IAAI,CAAC,IAAI,CAAA;IAChB,cAAG,GAAG,WAAA,IAAI,CAAC,GAAG,CAAA;AAC5B,CAAC,EARgB,UAAU,KAAV,UAAU,QAQ1B"}
@@ -1,5 +1,5 @@
1
- import { isoly } from "isoly";
2
1
  import { isly } from "isly";
2
+ import { Amount } from "../Amount";
3
3
  import { Rule } from "../Rule/Rule";
4
4
  import { Expiry } from "./Expiry";
5
5
  import { Meta } from "./Meta";
@@ -12,7 +12,7 @@ export interface Creatable {
12
12
  expiry: Expiry;
13
13
  holder: string;
14
14
  };
15
- limit: [isoly.Currency, number];
15
+ limit: Amount;
16
16
  rules?: Rule[];
17
17
  meta?: Meta;
18
18
  }