@pax2pay/model-banking 0.1.300 → 0.1.302

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.
@@ -16,7 +16,7 @@ export class Treasury {
16
16
  async listTransactions(accountId: string): Promise<TreasuryModel.Transaction[] | gracely.Error> {
17
17
  return this.client.get<TreasuryModel.Transaction[]>(`/treasury/account/${accountId}/transaction`)
18
18
  }
19
- async listAccounts(): Promise<TreasuryModel.Account[] | gracely.Error> {
20
- return this.client.get<TreasuryModel.Account[]>(`/treasury/account`)
19
+ async listAccounts(): Promise<TreasuryModel.Account.Listable[] | gracely.Error> {
20
+ return this.client.get<TreasuryModel.Account.Listable[]>(`/treasury/account`)
21
21
  }
22
22
  }
@@ -0,0 +1,90 @@
1
+ export namespace Dates {
2
+ // Source for British holidays: https://www.gov.uk/bank-holidays.json
3
+ export const englandAndWales = [
4
+ "2024-01-01",
5
+ "2024-03-29",
6
+ "2024-04-01",
7
+ "2024-05-06",
8
+ "2024-05-27",
9
+ "2024-08-26",
10
+ "2024-12-25",
11
+ "2024-12-26",
12
+ "2025-01-01",
13
+ "2025-04-18",
14
+ "2025-04-21",
15
+ "2025-05-05",
16
+ "2025-05-26",
17
+ "2025-08-25",
18
+ "2025-12-25",
19
+ "2025-12-26",
20
+ "2026-01-01",
21
+ "2026-04-03",
22
+ "2026-04-06",
23
+ "2026-05-04",
24
+ "2026-05-25",
25
+ "2026-08-31",
26
+ "2026-12-25",
27
+ "2026-12-28",
28
+ ]
29
+ export const scotland = [
30
+ "2024-01-01",
31
+ "2024-01-02",
32
+ "2024-03-29",
33
+ "2024-05-06",
34
+ "2024-05-27",
35
+ "2024-08-05",
36
+ "2024-12-02",
37
+ "2024-12-25",
38
+ "2024-12-26",
39
+ "2025-01-01",
40
+ "2025-01-02",
41
+ "2025-04-18",
42
+ "2025-05-05",
43
+ "2025-05-26",
44
+ "2025-08-04",
45
+ "2025-12-01",
46
+ "2025-12-25",
47
+ "2025-12-26",
48
+ "2026-01-01",
49
+ "2026-01-02",
50
+ "2026-04-03",
51
+ "2026-05-04",
52
+ "2026-05-25",
53
+ "2026-08-03",
54
+ "2026-11-30",
55
+ "2026-12-25",
56
+ "2026-12-28",
57
+ ]
58
+ export const northernIreland = [
59
+ "2024-01-01",
60
+ "2024-03-18",
61
+ "2024-03-29",
62
+ "2024-04-01",
63
+ "2024-05-06",
64
+ "2024-05-27",
65
+ "2024-07-12",
66
+ "2024-08-26",
67
+ "2024-12-25",
68
+ "2024-12-26",
69
+ "2025-01-01",
70
+ "2025-03-17",
71
+ "2025-04-18",
72
+ "2025-04-21",
73
+ "2025-05-05",
74
+ "2025-05-26",
75
+ "2025-07-14",
76
+ "2025-08-25",
77
+ "2025-12-25",
78
+ "2025-12-26",
79
+ "2026-01-01",
80
+ "2026-03-17",
81
+ "2026-04-03",
82
+ "2026-04-06",
83
+ "2026-05-04",
84
+ "2026-05-25",
85
+ "2026-07-13",
86
+ "2026-08-31",
87
+ "2026-12-25",
88
+ "2026-12-28",
89
+ ]
90
+ }
@@ -0,0 +1,17 @@
1
+ import { isoly } from "isoly"
2
+ import { isly } from "isly"
3
+ import { Dates } from "./Dates"
4
+
5
+ export namespace Holidays {
6
+ export type Regions = typeof Regions.values[number]
7
+ export namespace Regions {
8
+ export const values = ["England", "Wales", "Scotland", "Northern Ireland"] as const
9
+ export const type = isly.string<Regions>(values)
10
+ }
11
+ export const dates: Record<Regions, Readonly<isoly.Date>[]> = {
12
+ England: Dates.englandAndWales,
13
+ Wales: Dates.englandAndWales,
14
+ Scotland: Dates.scotland,
15
+ "Northern Ireland": Dates.northernIreland,
16
+ }
17
+ }
@@ -5,6 +5,7 @@ import { Rail } from "../../Rail"
5
5
  import { Realm } from "../../Realm"
6
6
  import { Supplier } from "../../Supplier"
7
7
  import { Balance } from "../Balance"
8
+ import { Transaction } from "../Transaction"
8
9
  import { Category as AccountCategory } from "./Category"
9
10
  import { Conditions as AccountConditions } from "./Conditions"
10
11
  import { Creatable as AccountCreatable } from "./Creatable"
@@ -24,35 +25,24 @@ export interface Account {
24
25
  rail: Rail.Address[]
25
26
  balance: Balance
26
27
  }
27
-
28
28
  export namespace Account {
29
29
  export const type = isly.object<Account>({
30
30
  id: isly.string(),
31
31
  created: isly.fromIs("Treasury.Account.Created", isoly.DateTime.is),
32
32
  name: isly.string(),
33
- realm: isly.fromIs("realm", Realm.is),
34
- supplier: isly.fromIs("supplier", Supplier.is),
33
+ realm: Realm.type,
34
+ supplier: Supplier.type,
35
35
  reference: isly.string(),
36
36
  currencies: isly.fromIs("Treasury.Account.currencies", isoly.Currency.is).array(),
37
37
  type: AccountCategory.type,
38
38
  conditions: AccountConditions.type,
39
- rail: isly.fromIs("Treasury.Account.rail", Rail.Address.is).array(),
39
+ rail: Rail.Address.type.array(),
40
40
  balance: isly.fromIs("Treasury.Account.balance", Balance.is),
41
41
  })
42
- export const is = type.is
43
- export const flaw = type.flaw
44
- export function isIdentifier(value: cryptly.Identifier | any): value is cryptly.Identifier {
45
- return cryptly.Identifier.is(value, 8)
46
- }
47
-
48
- export type Creatable = AccountCreatable
49
- export const Creatable = AccountCreatable
50
- export type Storable = AccountStorable
51
- export const Storable = AccountStorable
52
- export type Fetchable = AccountFetchable
53
- export const Fetchable = AccountFetchable
54
- export type Category = AccountCategory
55
- export const Category = AccountCategory
56
- export type Conditions = AccountConditions
57
- export const Conditions = AccountConditions
42
+ export type Listable = Account & { transactions: Transaction[] }
43
+ export import Creatable = AccountCreatable
44
+ export import Storable = AccountStorable
45
+ export import Fetchable = AccountFetchable
46
+ export import Category = AccountCategory
47
+ export import Conditions = AccountConditions
58
48
  }
@@ -0,0 +1,60 @@
1
+ import { isoly } from "isoly"
2
+ import { isly } from "isly"
3
+ import { Transaction } from "../Transaction"
4
+
5
+ export namespace funding {
6
+ export type Cursor = { cursor: string; amount: number }
7
+ export namespace Cursor {
8
+ export const type = isly.object<Cursor>({
9
+ cursor: isly.string(),
10
+ amount: isly.number(),
11
+ })
12
+ export function fromTransaction(transaction: Transaction): string {
13
+ return `${transaction.currency}|${isoly.DateTime.invert(transaction.created)}|${transaction.id}`
14
+ }
15
+ export function toTimestamp(cursor: string): isoly.DateTime {
16
+ return isoly.DateTime.invert(cursor.split("|")[1])
17
+ }
18
+ }
19
+ export type Cursors = Partial<Record<isoly.Currency, Cursor>>
20
+ export namespace Cursors {
21
+ export const type = isly.record<Cursors>(isly.fromIs("isoly.Currency", isoly.Currency.is), Cursor.type)
22
+ export function updateAmount(settlement: Transaction, cursors: Cursors): Cursors {
23
+ const cursor = cursors[settlement.currency]
24
+ if (!cursor)
25
+ cursors[settlement.currency] = {
26
+ cursor: Cursor.fromTransaction(settlement),
27
+ amount: Math.abs(settlement.amount),
28
+ }
29
+ else {
30
+ cursor.amount += Math.abs(settlement.amount)
31
+ }
32
+ return cursors
33
+ }
34
+ export function updateCursors(funding: Transaction, cursors: Cursors): Cursors {
35
+ const cursor = cursors[funding.currency]
36
+ if (!cursor)
37
+ cursors[funding.currency] = {
38
+ cursor: Cursor.fromTransaction(funding),
39
+ amount: -Math.abs(funding.amount),
40
+ }
41
+ else if (cursor.amount > 0) {
42
+ cursor.amount -= Math.abs(funding.amount)
43
+ cursor.cursor = Cursor.fromTransaction(funding)
44
+ }
45
+ return cursors
46
+ }
47
+ }
48
+ export function settle(transactions: Transaction[], amountsUpdated: Cursors): Cursors {
49
+ for (let i = transactions.length - 1; i >= 0; i--) {
50
+ Cursors.updateCursors(transactions[i], amountsUpdated)
51
+ }
52
+ return amountsUpdated
53
+ }
54
+ export function isStale(cursor: Cursor, bankingDays?: number, holidays?: isoly.Date[]): boolean {
55
+ return (
56
+ isoly.Date.now() >
57
+ isoly.Date.nextBusinessDay(isoly.DateTime.getDate(Cursor.toTimestamp(cursor.cursor)), bankingDays, holidays)
58
+ )
59
+ }
60
+ }
@@ -2,14 +2,15 @@ import { isoly } from "isoly"
2
2
  import { isly } from "isly"
3
3
  import { Emoney as SnapshotEmoney } from "./Emoney"
4
4
  import { Fragment as SnapshotFragment } from "./Fragment"
5
+ import { funding as snapshotFunding } from "./funding"
5
6
  import { Warning as SnapshotWarning } from "./Warning"
6
7
 
7
8
  export type Snapshot = Partial<Record<isoly.Currency, Snapshot.Fragment>>
8
9
 
9
10
  export namespace Snapshot {
10
11
  export import Fragment = SnapshotFragment
11
- export type Warning = SnapshotWarning
12
- export const Warning = SnapshotWarning
12
+ export import Warning = SnapshotWarning
13
+ export import funding = snapshotFunding
13
14
  export type Emoney = SnapshotEmoney
14
15
  export const type = isly.record(isly.fromIs("Currency", isoly.Currency.is), Fragment.type)
15
16
  }
package/Treasury/index.ts CHANGED
@@ -15,20 +15,6 @@ export namespace Treasury {
15
15
  }
16
16
  export import Transaction = TreasuryTransaction
17
17
  export import Snapshot = TreasurySnapshot
18
- export type Balance = TreasuryBalance
19
- export const Balance = TreasuryBalance
20
- export type Account = TreasuryAccount
21
- export namespace Account {
22
- export type Creatable = TreasuryAccount.Creatable
23
- export const Creatable = TreasuryAccount.Creatable
24
- export type Storable = TreasuryAccount.Storable
25
- export const Storable = TreasuryAccount.Storable
26
- export type Fetchable = TreasuryAccount.Fetchable
27
- export const Fetchable = TreasuryAccount.Fetchable
28
- export type Conditions = TreasuryAccount.Conditions
29
- export const Conditions = TreasuryAccount.Conditions
30
- export type Category = TreasuryAccount.Category
31
- export const Category = TreasuryAccount.Category
32
- export const is = TreasuryAccount.is
33
- }
18
+ export import Account = TreasuryAccount
19
+ export import Balance = TreasuryBalance
34
20
  }
@@ -9,5 +9,5 @@ export declare class Treasury {
9
9
  change(currency: isoly.Currency, changes: Result[]): Promise<gracely.Result>;
10
10
  fetch(hour?: isoly.DateTime): Promise<TreasuryModel.Snapshot | gracely.Error>;
11
11
  listTransactions(accountId: string): Promise<TreasuryModel.Transaction[] | gracely.Error>;
12
- listAccounts(): Promise<TreasuryModel.Account[] | gracely.Error>;
12
+ listAccounts(): Promise<TreasuryModel.Account.Listable[] | gracely.Error>;
13
13
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Treasury.js","sourceRoot":"../","sources":["Client/Treasury.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAK7B,MAAM,OAAO,QAAQ;IACpB,YAA6B,MAAmB;QAAnB,WAAM,GAAN,MAAM,CAAa;IAAG,CAAC;IACpD,KAAK,CAAC,MAAM,CAAC,QAAwB,EAAE,OAAiB;QACvD,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,aAAa,QAAQ,EAAE,EAAE,OAAO,CAAC,CAAA;IAC3D,CAAC;IACD,KAAK,CAAC,KAAK,CAAC,IAAqB;QAChC,MAAM,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;QACrE,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAyB,qBAAqB,IAAI,EAAE,CAAC,CAAA;IAC5E,CAAC;IACD,KAAK,CAAC,gBAAgB,CAAC,SAAiB;QACvC,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAA8B,qBAAqB,SAAS,cAAc,CAAC,CAAA;IAClG,CAAC;IACD,KAAK,CAAC,YAAY;QACjB,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAA0B,mBAAmB,CAAC,CAAA;IACrE,CAAC;CACD"}
1
+ {"version":3,"file":"Treasury.js","sourceRoot":"../","sources":["Client/Treasury.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAK7B,MAAM,OAAO,QAAQ;IACpB,YAA6B,MAAmB;QAAnB,WAAM,GAAN,MAAM,CAAa;IAAG,CAAC;IACpD,KAAK,CAAC,MAAM,CAAC,QAAwB,EAAE,OAAiB;QACvD,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,aAAa,QAAQ,EAAE,EAAE,OAAO,CAAC,CAAA;IAC3D,CAAC;IACD,KAAK,CAAC,KAAK,CAAC,IAAqB;QAChC,MAAM,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;QACrE,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAyB,qBAAqB,IAAI,EAAE,CAAC,CAAA;IAC5E,CAAC;IACD,KAAK,CAAC,gBAAgB,CAAC,SAAiB;QACvC,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAA8B,qBAAqB,SAAS,cAAc,CAAC,CAAA;IAClG,CAAC;IACD,KAAK,CAAC,YAAY;QACjB,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAmC,mBAAmB,CAAC,CAAA;IAC9E,CAAC;CACD"}
@@ -0,0 +1,5 @@
1
+ export declare namespace Dates {
2
+ const englandAndWales: string[];
3
+ const scotland: string[];
4
+ const northernIreland: string[];
5
+ }
@@ -0,0 +1,91 @@
1
+ export var Dates;
2
+ (function (Dates) {
3
+ Dates.englandAndWales = [
4
+ "2024-01-01",
5
+ "2024-03-29",
6
+ "2024-04-01",
7
+ "2024-05-06",
8
+ "2024-05-27",
9
+ "2024-08-26",
10
+ "2024-12-25",
11
+ "2024-12-26",
12
+ "2025-01-01",
13
+ "2025-04-18",
14
+ "2025-04-21",
15
+ "2025-05-05",
16
+ "2025-05-26",
17
+ "2025-08-25",
18
+ "2025-12-25",
19
+ "2025-12-26",
20
+ "2026-01-01",
21
+ "2026-04-03",
22
+ "2026-04-06",
23
+ "2026-05-04",
24
+ "2026-05-25",
25
+ "2026-08-31",
26
+ "2026-12-25",
27
+ "2026-12-28",
28
+ ];
29
+ Dates.scotland = [
30
+ "2024-01-01",
31
+ "2024-01-02",
32
+ "2024-03-29",
33
+ "2024-05-06",
34
+ "2024-05-27",
35
+ "2024-08-05",
36
+ "2024-12-02",
37
+ "2024-12-25",
38
+ "2024-12-26",
39
+ "2025-01-01",
40
+ "2025-01-02",
41
+ "2025-04-18",
42
+ "2025-05-05",
43
+ "2025-05-26",
44
+ "2025-08-04",
45
+ "2025-12-01",
46
+ "2025-12-25",
47
+ "2025-12-26",
48
+ "2026-01-01",
49
+ "2026-01-02",
50
+ "2026-04-03",
51
+ "2026-05-04",
52
+ "2026-05-25",
53
+ "2026-08-03",
54
+ "2026-11-30",
55
+ "2026-12-25",
56
+ "2026-12-28",
57
+ ];
58
+ Dates.northernIreland = [
59
+ "2024-01-01",
60
+ "2024-03-18",
61
+ "2024-03-29",
62
+ "2024-04-01",
63
+ "2024-05-06",
64
+ "2024-05-27",
65
+ "2024-07-12",
66
+ "2024-08-26",
67
+ "2024-12-25",
68
+ "2024-12-26",
69
+ "2025-01-01",
70
+ "2025-03-17",
71
+ "2025-04-18",
72
+ "2025-04-21",
73
+ "2025-05-05",
74
+ "2025-05-26",
75
+ "2025-07-14",
76
+ "2025-08-25",
77
+ "2025-12-25",
78
+ "2025-12-26",
79
+ "2026-01-01",
80
+ "2026-03-17",
81
+ "2026-04-03",
82
+ "2026-04-06",
83
+ "2026-05-04",
84
+ "2026-05-25",
85
+ "2026-07-13",
86
+ "2026-08-31",
87
+ "2026-12-25",
88
+ "2026-12-28",
89
+ ];
90
+ })(Dates || (Dates = {}));
91
+ //# sourceMappingURL=Dates.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Dates.js","sourceRoot":"../","sources":["Holidays/Dates.ts"],"names":[],"mappings":"AAAA,MAAM,KAAW,KAAK,CAyFrB;AAzFD,WAAiB,KAAK;IAER,qBAAe,GAAG;QAC9B,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,YAAY;KACZ,CAAA;IACY,cAAQ,GAAG;QACvB,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,YAAY;KACZ,CAAA;IACY,qBAAe,GAAG;QAC9B,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,YAAY;KACZ,CAAA;AACF,CAAC,EAzFgB,KAAK,KAAL,KAAK,QAyFrB"}
@@ -0,0 +1,10 @@
1
+ import { isoly } from "isoly";
2
+ import { isly } from "isly";
3
+ export declare namespace Holidays {
4
+ type Regions = typeof Regions.values[number];
5
+ namespace Regions {
6
+ const values: readonly ["England", "Wales", "Scotland", "Northern Ireland"];
7
+ const type: isly.Type<"England" | "Wales" | "Scotland" | "Northern Ireland">;
8
+ }
9
+ const dates: Record<Regions, Readonly<isoly.Date>[]>;
10
+ }
@@ -0,0 +1,17 @@
1
+ import { isly } from "isly";
2
+ import { Dates } from "./Dates";
3
+ export var Holidays;
4
+ (function (Holidays) {
5
+ let Regions;
6
+ (function (Regions) {
7
+ Regions.values = ["England", "Wales", "Scotland", "Northern Ireland"];
8
+ Regions.type = isly.string(Regions.values);
9
+ })(Regions = Holidays.Regions || (Holidays.Regions = {}));
10
+ Holidays.dates = {
11
+ England: Dates.englandAndWales,
12
+ Wales: Dates.englandAndWales,
13
+ Scotland: Dates.scotland,
14
+ "Northern Ireland": Dates.northernIreland,
15
+ };
16
+ })(Holidays || (Holidays = {}));
17
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"../","sources":["Holidays/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAE/B,MAAM,KAAW,QAAQ,CAYxB;AAZD,WAAiB,QAAQ;IAExB,IAAiB,OAAO,CAGvB;IAHD,WAAiB,OAAO;QACV,cAAM,GAAG,CAAC,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,kBAAkB,CAAU,CAAA;QACtE,YAAI,GAAG,IAAI,CAAC,MAAM,CAAU,QAAA,MAAM,CAAC,CAAA;IACjD,CAAC,EAHgB,OAAO,GAAP,gBAAO,KAAP,gBAAO,QAGvB;IACY,cAAK,GAA4C;QAC7D,OAAO,EAAE,KAAK,CAAC,eAAe;QAC9B,KAAK,EAAE,KAAK,CAAC,eAAe;QAC5B,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,kBAAkB,EAAE,KAAK,CAAC,eAAe;KACzC,CAAA;AACF,CAAC,EAZgB,QAAQ,KAAR,QAAQ,QAYxB"}
@@ -5,6 +5,7 @@ import { Rail } from "../../Rail";
5
5
  import { Realm } from "../../Realm";
6
6
  import { Supplier } from "../../Supplier";
7
7
  import { Balance } from "../Balance";
8
+ import { Transaction } from "../Transaction";
8
9
  import { Category as AccountCategory } from "./Category";
9
10
  import { Conditions as AccountConditions } from "./Conditions";
10
11
  import { Creatable as AccountCreatable } from "./Creatable";
@@ -27,17 +28,12 @@ export interface Account {
27
28
  }
28
29
  export declare namespace Account {
29
30
  const type: isly.object.ExtendableType<Account>;
30
- const is: isly.Type.IsFunction<Account>;
31
- const flaw: isly.Type.FlawFunction;
32
- function isIdentifier(value: cryptly.Identifier | any): value is cryptly.Identifier;
33
- type Creatable = AccountCreatable;
34
- const Creatable: typeof AccountCreatable;
35
- type Storable = AccountStorable;
36
- const Storable: typeof AccountStorable;
37
- type Fetchable = AccountFetchable;
38
- const Fetchable: typeof AccountFetchable;
39
- type Category = AccountCategory;
40
- const Category: typeof AccountCategory;
41
- type Conditions = AccountConditions;
42
- const Conditions: typeof AccountConditions;
31
+ type Listable = Account & {
32
+ transactions: Transaction[];
33
+ };
34
+ export import Creatable = AccountCreatable;
35
+ export import Storable = AccountStorable;
36
+ export import Fetchable = AccountFetchable;
37
+ export import Category = AccountCategory;
38
+ export import Conditions = AccountConditions;
43
39
  }
@@ -1,4 +1,3 @@
1
- import { cryptly } from "cryptly";
2
1
  import { isoly } from "isoly";
3
2
  import { isly } from "isly";
4
3
  import { Rail } from "../../Rail";
@@ -16,21 +15,15 @@ export var Account;
16
15
  id: isly.string(),
17
16
  created: isly.fromIs("Treasury.Account.Created", isoly.DateTime.is),
18
17
  name: isly.string(),
19
- realm: isly.fromIs("realm", Realm.is),
20
- supplier: isly.fromIs("supplier", Supplier.is),
18
+ realm: Realm.type,
19
+ supplier: Supplier.type,
21
20
  reference: isly.string(),
22
21
  currencies: isly.fromIs("Treasury.Account.currencies", isoly.Currency.is).array(),
23
22
  type: AccountCategory.type,
24
23
  conditions: AccountConditions.type,
25
- rail: isly.fromIs("Treasury.Account.rail", Rail.Address.is).array(),
24
+ rail: Rail.Address.type.array(),
26
25
  balance: isly.fromIs("Treasury.Account.balance", Balance.is),
27
26
  });
28
- Account.is = Account.type.is;
29
- Account.flaw = Account.type.flaw;
30
- function isIdentifier(value) {
31
- return cryptly.Identifier.is(value, 8);
32
- }
33
- Account.isIdentifier = isIdentifier;
34
27
  Account.Creatable = AccountCreatable;
35
28
  Account.Storable = AccountStorable;
36
29
  Account.Fetchable = AccountFetchable;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"../","sources":["Treasury/Account/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACjC,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AACjC,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AACpC,OAAO,EAAE,QAAQ,IAAI,eAAe,EAAE,MAAM,YAAY,CAAA;AACxD,OAAO,EAAE,UAAU,IAAI,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAC9D,OAAO,EAAE,SAAS,IAAI,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAC3D,OAAO,EAAE,SAAS,IAAI,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAC3D,OAAO,EAAE,QAAQ,IAAI,eAAe,EAAE,MAAM,YAAY,CAAA;AAgBxD,MAAM,KAAW,OAAO,CA8BvB;AA9BD,WAAiB,OAAO;IACV,YAAI,GAAG,IAAI,CAAC,MAAM,CAAU;QACxC,EAAE,EAAE,IAAI,CAAC,MAAM,EAAE;QACjB,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,0BAA0B,EAAE,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC;QACnE,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE;QACnB,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC;QACrC,QAAQ,EAAE,IAAI,CAAC,MA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gBAAgB,CAAA;IAC5B,gBAAQ,GAAG,eAAe,CAAA;IAC1B,kBAAU,GAAG,iBAAiB,CAAA;AAC7C,CAAC,EApBgB,OAAO,KAAP,OAAO,QAoBvB"}
@@ -0,0 +1,22 @@
1
+ import { isoly } from "isoly";
2
+ import { isly } from "isly";
3
+ import { Transaction } from "../Transaction";
4
+ export declare namespace funding {
5
+ type Cursor = {
6
+ cursor: string;
7
+ amount: number;
8
+ };
9
+ namespace Cursor {
10
+ const type: isly.object.ExtendableType<Cursor>;
11
+ function fromTransaction(transaction: Transaction): string;
12
+ function toTimestamp(cursor: string): isoly.DateTime;
13
+ }
14
+ type Cursors = Partial<Record<isoly.Currency, Cursor>>;
15
+ namespace Cursors {
16
+ 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", Cursor>>>;
17
+ function updateAmount(settlement: Transaction, cursors: Cursors): Cursors;
18
+ function updateCursors(funding: Transaction, cursors: Cursors): Cursors;
19
+ }
20
+ function settle(transactions: Transaction[], amountsUpdated: Cursors): Cursors;
21
+ function isStale(cursor: Cursor, bankingDays?: number, holidays?: isoly.Date[]): boolean;
22
+ }
@@ -0,0 +1,64 @@
1
+ import { isoly } from "isoly";
2
+ import { isly } from "isly";
3
+ export var funding;
4
+ (function (funding_1) {
5
+ let Cursor;
6
+ (function (Cursor) {
7
+ Cursor.type = isly.object({
8
+ cursor: isly.string(),
9
+ amount: isly.number(),
10
+ });
11
+ function fromTransaction(transaction) {
12
+ return `${transaction.currency}|${isoly.DateTime.invert(transaction.created)}|${transaction.id}`;
13
+ }
14
+ Cursor.fromTransaction = fromTransaction;
15
+ function toTimestamp(cursor) {
16
+ return isoly.DateTime.invert(cursor.split("|")[1]);
17
+ }
18
+ Cursor.toTimestamp = toTimestamp;
19
+ })(Cursor = funding_1.Cursor || (funding_1.Cursor = {}));
20
+ let Cursors;
21
+ (function (Cursors) {
22
+ Cursors.type = isly.record(isly.fromIs("isoly.Currency", isoly.Currency.is), Cursor.type);
23
+ function updateAmount(settlement, cursors) {
24
+ const cursor = cursors[settlement.currency];
25
+ if (!cursor)
26
+ cursors[settlement.currency] = {
27
+ cursor: Cursor.fromTransaction(settlement),
28
+ amount: Math.abs(settlement.amount),
29
+ };
30
+ else {
31
+ cursor.amount += Math.abs(settlement.amount);
32
+ }
33
+ return cursors;
34
+ }
35
+ Cursors.updateAmount = updateAmount;
36
+ function updateCursors(funding, cursors) {
37
+ const cursor = cursors[funding.currency];
38
+ if (!cursor)
39
+ cursors[funding.currency] = {
40
+ cursor: Cursor.fromTransaction(funding),
41
+ amount: -Math.abs(funding.amount),
42
+ };
43
+ else if (cursor.amount > 0) {
44
+ cursor.amount -= Math.abs(funding.amount);
45
+ cursor.cursor = Cursor.fromTransaction(funding);
46
+ }
47
+ return cursors;
48
+ }
49
+ Cursors.updateCursors = updateCursors;
50
+ })(Cursors = funding_1.Cursors || (funding_1.Cursors = {}));
51
+ function settle(transactions, amountsUpdated) {
52
+ for (let i = transactions.length - 1; i >= 0; i--) {
53
+ Cursors.updateCursors(transactions[i], amountsUpdated);
54
+ }
55
+ return amountsUpdated;
56
+ }
57
+ funding_1.settle = settle;
58
+ function isStale(cursor, bankingDays, holidays) {
59
+ return (isoly.Date.now() >
60
+ isoly.Date.nextBusinessDay(isoly.DateTime.getDate(Cursor.toTimestamp(cursor.cursor)), bankingDays, holidays));
61
+ }
62
+ funding_1.isStale = isStale;
63
+ })(funding || (funding = {}));
64
+ //# sourceMappingURL=funding.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"funding.js","sourceRoot":"../","sources":["Treasury/Snapshot/funding.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAG3B,MAAM,KAAW,OAAO,CAuDvB;AAvDD,WAAiB,SAAO;IAEvB,IAAiB,MAAM,CAWtB;IAXD,WAAiB,MAAM;QACT,WA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M,CAAC,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,WAAW,EAAE,QAAQ,CAAC,CAC5G,CAAA;IACF,CAAC;IALe,iBAAO,UAKtB,CAAA;AACF,CAAC,EAvDgB,OAAO,KAAP,OAAO,QAuDvB"}
@@ -2,12 +2,13 @@ import { isoly } from "isoly";
2
2
  import { isly } from "isly";
3
3
  import { Emoney as SnapshotEmoney } from "./Emoney";
4
4
  import { Fragment as SnapshotFragment } from "./Fragment";
5
+ import { funding as snapshotFunding } from "./funding";
5
6
  import { Warning as SnapshotWarning } from "./Warning";
6
7
  export type Snapshot = Partial<Record<isoly.Currency, Snapshot.Fragment>>;
7
8
  export declare namespace Snapshot {
8
9
  export import Fragment = SnapshotFragment;
9
- type Warning = SnapshotWarning;
10
- const Warning: typeof SnapshotWarning;
10
+ export import Warning = SnapshotWarning;
11
+ export import funding = snapshotFunding;
11
12
  type Emoney = SnapshotEmoney;
12
13
  const type: isly.Type<{
13
14
  BTN: any;
@@ -1,11 +1,13 @@
1
1
  import { isoly } from "isoly";
2
2
  import { isly } from "isly";
3
3
  import { Fragment as SnapshotFragment } from "./Fragment";
4
+ import { funding as snapshotFunding } from "./funding";
4
5
  import { Warning as SnapshotWarning } from "./Warning";
5
6
  export var Snapshot;
6
7
  (function (Snapshot) {
7
8
  Snapshot.Fragment = SnapshotFragment;
8
9
  Snapshot.Warning = SnapshotWarning;
10
+ Snapshot.funding = snapshotFunding;
9
11
  Snapshot.type = isly.record(isly.fromIs("Currency", isoly.Currency.is), Snapshot.Fragment.type);
10
12
  })(Snapshot || (Snapshot = {}));
11
13
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"../","sources":["Treasury/Snapshot/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAE3B,OAAO,EAAE,QAAQ,IAAI,gBAAgB,EAAE,MAAM,YAAY,CAAA;AACzD,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,WAAW,CAAA;AAItD,MAAM,KAAW,QAAQ,CAMxB;AAND,WAAiB,QAAQ;IACV,iBAAQ,GAAG,gBAAgB,CAAA;IAE5B,gBAAO,GAAG,eAAe,CAAA;IAEzB,aAAI,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,SAAA,QAAQ,CAAC,IAAI,CAAC,CAAA;AAC3F,CAAC,EANgB,QAAQ,KAAR,QAAQ,QAMxB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"../","sources":["Treasury/Snapshot/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAE3B,OAAO,EAAE,QAAQ,IAAI,gBAAgB,EAAE,MAAM,YAAY,CAAA;AACzD,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,WAAW,CAAA;AACtD,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,WAAW,CAAA;AAItD,MAAM,KAAW,QAAQ,CAMxB;AAND,WAAiB,QAAQ;IACV,iBAAQ,GAAG,gBAAgB,CAAA;IAC3B,gBAAO,GAAG,eAAe,CAAA;IACzB,gBAAO,GAAG,eAAe,CAAA;IAE1B,aAAI,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,SAAA,QAAQ,CAAC,IAAI,CAAC,CAAA;AAC3F,CAAC,EANgB,QAAQ,KAAR,QAAQ,QAMxB"}
@@ -7,20 +7,6 @@ export declare namespace Treasury {
7
7
  function key(hour?: isoly.DateTime): isoly.DateTime;
8
8
  export import Transaction = TreasuryTransaction;
9
9
  export import Snapshot = TreasurySnapshot;
10
- type Balance = TreasuryBalance;
11
- const Balance: typeof TreasuryBalance;
12
- type Account = TreasuryAccount;
13
- namespace Account {
14
- type Creatable = TreasuryAccount.Creatable;
15
- const Creatable: typeof import("./Account/Creatable").Creatable;
16
- type Storable = TreasuryAccount.Storable;
17
- const Storable: typeof import("./Account/Storable").Storable;
18
- type Fetchable = TreasuryAccount.Fetchable;
19
- const Fetchable: typeof import("./Account/Fetchable").Fetchable;
20
- type Conditions = TreasuryAccount.Conditions;
21
- const Conditions: typeof import("./Account/Conditions").Conditions;
22
- type Category = TreasuryAccount.Category;
23
- const Category: typeof import("./Account/Category").Category;
24
- const is: import("isly/dist/cjs/Type").Type.IsFunction<TreasuryAccount>;
25
- }
10
+ export import Account = TreasuryAccount;
11
+ export import Balance = TreasuryBalance;
26
12
  }
@@ -13,15 +13,7 @@ export var Treasury;
13
13
  Treasury.key = key;
14
14
  Treasury.Transaction = TreasuryTransaction;
15
15
  Treasury.Snapshot = TreasurySnapshot;
16
+ Treasury.Account = TreasuryAccount;
16
17
  Treasury.Balance = TreasuryBalance;
17
- let Account;
18
- (function (Account) {
19
- Account.Creatable = TreasuryAccount.Creatable;
20
- Account.Storable = TreasuryAccount.Storable;
21
- Account.Fetchable = TreasuryAccount.Fetchable;
22
- Account.Conditions = TreasuryAccount.Conditions;
23
- Account.Category = TreasuryAccount.Category;
24
- Account.is = TreasuryAccount.is;
25
- })(Account = Treasury.Account || (Treasury.Account = {}));
26
18
  })(Treasury || (Treasury = {}));
27
19
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"../","sources":["Treasury/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7B,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,WAAW,CAAA;AACtD,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,WAAW,CAAA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AC,EAbgB,QAAQ,KAAR,QAAQ,QAaxB"}
package/dist/pax2pay.d.ts CHANGED
@@ -3,6 +3,7 @@ export { Acquirer } from "./Acquirer";
3
3
  export { Balances } from "./Balances";
4
4
  export { Card } from "./Card";
5
5
  export { Event } from "./Event";
6
+ export { Holidays } from "./Holidays";
6
7
  export { Operation } from "./Operation";
7
8
  export { Organization } from "./Organization";
8
9
  export { Rail } from "./Rail";
package/dist/pax2pay.js CHANGED
@@ -3,6 +3,7 @@ export { Acquirer } from "./Acquirer";
3
3
  export { Balances } from "./Balances";
4
4
  export { Card } from "./Card";
5
5
  export { Event } from "./Event";
6
+ export { Holidays } from "./Holidays";
6
7
  export { Operation } from "./Operation";
7
8
  export { Organization } from "./Organization";
8
9
  export { Rail } from "./Rail";
@@ -1 +1 @@
1
- {"version":3,"file":"pax2pay.js","sourceRoot":"../","sources":["pax2pay.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAC7B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAC7B,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,UAAU,E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AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAEnD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAC3B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pax2pay/model-banking",
3
- "version": "0.1.300",
3
+ "version": "0.1.302",
4
4
  "description": "Library containing data model types and functions for the Pax2Pay Banking API.",
5
5
  "author": "Pax2Pay Ltd",
6
6
  "license": "MIT",
package/pax2pay.ts CHANGED
@@ -3,6 +3,7 @@ export { Acquirer } from "./Acquirer"
3
3
  export { Balances } from "./Balances"
4
4
  export { Card } from "./Card"
5
5
  export { Event } from "./Event"
6
+ export { Holidays } from "./Holidays"
6
7
  export { Operation } from "./Operation"
7
8
  export { Organization } from "./Organization"
8
9
  export { Rail } from "./Rail"