@pax2pay/model-banking 0.1.595 → 0.1.596
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.
- package/Operation/Changes.ts +6 -22
- package/Rail/Address/internal.ts +1 -1
- package/Treasury/Snapshot/Emoney.ts +0 -2
- package/Treasury/Snapshot/Fiat.ts +0 -1
- package/Treasury/Snapshot/index.ts +1 -29
- package/Warning/Snapshot/index.ts +7 -12
- package/Warning/index.ts +0 -1
- package/dist/cjs/Client/Transactions/index.d.ts +2 -2
- package/dist/cjs/Operation/Changes.d.ts +8 -13
- package/dist/cjs/Operation/Changes.js +0 -14
- package/dist/cjs/Operation/Changes.js.map +1 -1
- package/dist/cjs/Rail/Address/internal.d.ts +1 -2
- package/dist/cjs/Rail/index.d.ts +2 -2
- package/dist/cjs/Treasury/Snapshot/Emoney.d.ts +0 -2
- package/dist/cjs/Treasury/Snapshot/Fiat.d.ts +0 -1
- package/dist/cjs/Treasury/Snapshot/index.d.ts +0 -15
- package/dist/cjs/Treasury/Snapshot/index.js +1 -21
- package/dist/cjs/Treasury/Snapshot/index.js.map +1 -1
- package/dist/cjs/Warning/Snapshot/index.d.ts +1 -3
- package/dist/cjs/Warning/Snapshot/index.js +1 -3
- package/dist/cjs/Warning/Snapshot/index.js.map +1 -1
- package/dist/cjs/Warning/index.d.ts +1 -1
- package/dist/cjs/Warning/index.js +0 -1
- package/dist/cjs/Warning/index.js.map +1 -1
- package/dist/cjs/pax2pay.d.ts +0 -2
- package/dist/cjs/pax2pay.js +1 -5
- package/dist/cjs/pax2pay.js.map +1 -1
- package/dist/mjs/Client/Transactions/index.d.ts +2 -2
- package/dist/mjs/Operation/Changes.d.ts +8 -13
- package/dist/mjs/Operation/Changes.js +0 -14
- package/dist/mjs/Operation/Changes.js.map +1 -1
- package/dist/mjs/Rail/Address/internal.d.ts +1 -2
- package/dist/mjs/Rail/index.d.ts +2 -2
- package/dist/mjs/Treasury/Snapshot/Emoney.d.ts +0 -2
- package/dist/mjs/Treasury/Snapshot/Fiat.d.ts +0 -1
- package/dist/mjs/Treasury/Snapshot/index.d.ts +0 -15
- package/dist/mjs/Treasury/Snapshot/index.js +1 -21
- package/dist/mjs/Treasury/Snapshot/index.js.map +1 -1
- package/dist/mjs/Warning/Snapshot/index.d.ts +1 -3
- package/dist/mjs/Warning/Snapshot/index.js +1 -3
- package/dist/mjs/Warning/Snapshot/index.js.map +1 -1
- package/dist/mjs/Warning/index.d.ts +1 -1
- package/dist/mjs/Warning/index.js +0 -1
- package/dist/mjs/Warning/index.js.map +1 -1
- package/dist/mjs/pax2pay.d.ts +0 -2
- package/dist/mjs/pax2pay.js +0 -2
- package/dist/mjs/pax2pay.js.map +1 -1
- package/package.json +1 -1
- package/pax2pay.ts +0 -2
- package/Counterbalance.ts +0 -20
- package/Counterbalances.ts +0 -12
- package/Warning/Snapshot/Counterbalance.ts +0 -16
- package/dist/cjs/Counterbalance.d.ts +0 -15
- package/dist/cjs/Counterbalance.js +0 -16
- package/dist/cjs/Counterbalance.js.map +0 -1
- package/dist/cjs/Counterbalances.d.ts +0 -7
- package/dist/cjs/Counterbalances.js +0 -11
- package/dist/cjs/Counterbalances.js.map +0 -1
- package/dist/cjs/Warning/Snapshot/Counterbalance.d.ts +0 -10
- package/dist/cjs/Warning/Snapshot/Counterbalance.js +0 -14
- package/dist/cjs/Warning/Snapshot/Counterbalance.js.map +0 -1
- package/dist/mjs/Counterbalance.d.ts +0 -15
- package/dist/mjs/Counterbalance.js +0 -13
- package/dist/mjs/Counterbalance.js.map +0 -1
- package/dist/mjs/Counterbalances.d.ts +0 -7
- package/dist/mjs/Counterbalances.js +0 -8
- package/dist/mjs/Counterbalances.js.map +0 -1
- package/dist/mjs/Warning/Snapshot/Counterbalance.d.ts +0 -10
- package/dist/mjs/Warning/Snapshot/Counterbalance.js +0 -11
- package/dist/mjs/Warning/Snapshot/Counterbalance.js.map +0 -1
package/Operation/Changes.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { isoly } from "isoly"
|
|
2
2
|
import { isly } from "isly"
|
|
3
3
|
import { Balance as AccountBalance } from "../Balance"
|
|
4
|
-
import { Counterbalance as CounterbalanceOperation } from "../Counterbalance"
|
|
5
4
|
import type { Settlement } from "../Settlement"
|
|
6
5
|
import { Change } from "./Change"
|
|
7
6
|
|
|
8
|
-
export type Changes = Partial<Record<Changes.Entry.Balance, Change>>
|
|
7
|
+
export type Changes = Partial<Record<Changes.Entry.Balance, Change>>
|
|
9
8
|
export namespace Changes {
|
|
10
9
|
export function available(changes: MaybeLegacy, currency: isoly.Currency, legacy: boolean = false): number {
|
|
11
10
|
return legacy
|
|
@@ -50,31 +49,23 @@ export namespace Changes {
|
|
|
50
49
|
0
|
|
51
50
|
)
|
|
52
51
|
}
|
|
53
|
-
export type Sum = Partial<Record<Changes.Entry.Balance, number>>
|
|
52
|
+
export type Sum = Partial<Record<Changes.Entry.Balance, number>>
|
|
54
53
|
export type MaybeLegacy = Changes | Legacy
|
|
55
|
-
export const type = isly.record<
|
|
56
|
-
export type Legacy = Partial<Record<AccountBalance.Legacy.Entry, Change>>
|
|
57
|
-
Record<Changes.Entry.Counterbalance, Change>
|
|
54
|
+
export const type = isly.record<Changes>(isly.string(), Change.type)
|
|
55
|
+
export type Legacy = Partial<Record<AccountBalance.Legacy.Entry, Change>>
|
|
58
56
|
export namespace Legacy {
|
|
59
57
|
export const type = isly.record<Legacy>(isly.string(), Change.type)
|
|
60
|
-
export type Entry = AccountBalance.Legacy.Entry
|
|
58
|
+
export type Entry = AccountBalance.Legacy.Entry
|
|
61
59
|
export namespace Entry {
|
|
62
|
-
export function split(counterbalance: Counterbalance): [isoly.DateTime, CounterbalanceOperation.Link] {
|
|
63
|
-
const split = counterbalance.split("-")
|
|
64
|
-
const hour = split.splice(-3, 3).join("-")
|
|
65
|
-
return [hour, split.join("-")]
|
|
66
|
-
}
|
|
67
60
|
export type Balance = typeof AccountBalance.Legacy.Entry.values[number]
|
|
68
61
|
export namespace Balance {
|
|
69
62
|
export const type = AccountBalance.Legacy.Entry.type
|
|
70
63
|
}
|
|
71
|
-
export type Counterbalance = `${CounterbalanceOperation.Link}-${isoly.DateTime}`
|
|
72
64
|
}
|
|
73
65
|
}
|
|
74
|
-
export type Entry = Entry.Balance
|
|
66
|
+
export type Entry = Entry.Balance
|
|
75
67
|
export namespace Entry {
|
|
76
68
|
export const type = isly.string<Entry>()
|
|
77
|
-
export type Counterbalance = `${isoly.DateTime}-${CounterbalanceOperation.Link}`
|
|
78
69
|
export function getBalanceType(key: string): string {
|
|
79
70
|
let result = ""
|
|
80
71
|
if (key.includes("net") || key.includes("fee") || key.includes("charge"))
|
|
@@ -87,13 +78,6 @@ export namespace Changes {
|
|
|
87
78
|
result = "fiat"
|
|
88
79
|
return result
|
|
89
80
|
}
|
|
90
|
-
export function split(counterbalance: Counterbalance): [isoly.DateTime, CounterbalanceOperation.Link] {
|
|
91
|
-
const split = counterbalance.split("-")
|
|
92
|
-
const hour = split.slice(0, 3).join("-")
|
|
93
|
-
return isoly.DateTime.is(hour)
|
|
94
|
-
? [hour, split.slice(3, split.length).join("-")]
|
|
95
|
-
: Legacy.Entry.split(counterbalance)
|
|
96
|
-
}
|
|
97
81
|
export type Balance = typeof Balance.values[number]
|
|
98
82
|
export namespace Balance {
|
|
99
83
|
export const values = ["available", "reserved-incoming", "reserved-outgoing", "reserved-buffer"] as const
|
package/Rail/Address/internal.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { Realm } from "../../Realm"
|
|
|
6
6
|
export interface Internal {
|
|
7
7
|
type: "internal"
|
|
8
8
|
name?: string
|
|
9
|
-
identifier: cryptly.Identifier
|
|
9
|
+
identifier: cryptly.Identifier
|
|
10
10
|
organization?: string
|
|
11
11
|
}
|
|
12
12
|
export namespace Internal {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { isoly } from "isoly"
|
|
2
2
|
import { Balances } from "../../Balances"
|
|
3
|
-
import { Counterbalances } from "../../Counterbalances"
|
|
4
3
|
import { Supplier } from "../../Supplier"
|
|
5
4
|
|
|
6
5
|
export interface Emoney {
|
|
@@ -9,5 +8,4 @@ export interface Emoney {
|
|
|
9
8
|
supplier?: Supplier
|
|
10
9
|
timestamp: isoly.DateTime
|
|
11
10
|
balances: Balances
|
|
12
|
-
counterbalances: Counterbalances
|
|
13
11
|
}
|
|
@@ -13,7 +13,6 @@ export interface Snapshot {
|
|
|
13
13
|
emoney: Balance.Extended & { total?: number }
|
|
14
14
|
currency: isoly.Currency
|
|
15
15
|
supplier: Supplier
|
|
16
|
-
counterbalance: Snapshot.Counterbalance
|
|
17
16
|
fiat: {
|
|
18
17
|
safe: number
|
|
19
18
|
unsafe: number
|
|
@@ -27,41 +26,14 @@ export namespace Snapshot {
|
|
|
27
26
|
export import funding = snapshotFunding
|
|
28
27
|
export type Emoney = SnapshotEmoney
|
|
29
28
|
export type Fiat = SnapshotFiat
|
|
30
|
-
export type Counterbalance = Record<string, { total: number; account: Record<string, { amount: number }> }>
|
|
31
|
-
export namespace Counterbalance {
|
|
32
|
-
export const type = isly.record<Counterbalance>(
|
|
33
|
-
isly.string(),
|
|
34
|
-
isly.object<Counterbalance[string]>({
|
|
35
|
-
total: isly.number(),
|
|
36
|
-
account: isly.record<Counterbalance[string]["account"]>(
|
|
37
|
-
isly.string(),
|
|
38
|
-
isly.object<Counterbalance[string]["account"][string]>({ amount: isly.number() })
|
|
39
|
-
),
|
|
40
|
-
})
|
|
41
|
-
)
|
|
42
|
-
export function sum(currency: isoly.Currency, accounts: Record<string, { amount: number }>): number {
|
|
43
|
-
return Object.values(accounts).reduce(
|
|
44
|
-
(result, account) => isoly.Currency.add(currency, result, account.amount),
|
|
45
|
-
0
|
|
46
|
-
)
|
|
47
|
-
}
|
|
48
|
-
export function validate(currency: isoly.Currency, counterbalances: Counterbalance): boolean {
|
|
49
|
-
for (const counterbalance of Object.values(counterbalances))
|
|
50
|
-
if (isoly.Currency.subtract(currency, counterbalance.total, sum(currency, counterbalance.account)))
|
|
51
|
-
return false
|
|
52
|
-
return true
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
29
|
export function validate(snapshot: Snapshot): boolean {
|
|
56
|
-
const validCounterbalance = Counterbalance.validate(snapshot.currency, snapshot.counterbalance)
|
|
57
30
|
const issuable = snapshot.fiat.total
|
|
58
31
|
const actual = snapshot.emoney.actual ?? 0
|
|
59
|
-
return
|
|
32
|
+
return issuable == actual
|
|
60
33
|
}
|
|
61
34
|
export const type = isly.object<Snapshot>({
|
|
62
35
|
warnings: Warning.Snapshot.type.array(),
|
|
63
36
|
emoney: Balance.Extended,
|
|
64
|
-
counterbalance: Counterbalance.type,
|
|
65
37
|
currency: isly.fromIs("currency", isoly.Currency.is),
|
|
66
38
|
supplier: Supplier.type,
|
|
67
39
|
fiat: isly.object({
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { isly } from "isly"
|
|
2
|
-
import { Counterbalance as WarningCounterbalance } from "./Counterbalance"
|
|
3
2
|
import { MissingBuffer as WarningMissingBuffer } from "./MissingBuffer"
|
|
4
3
|
import { MissingEmoney as WarningMissingEmoney } from "./MissingEmoney"
|
|
5
4
|
import { MissingFiat as WarningMissingFiat } from "./MissingFiat"
|
|
@@ -10,7 +9,6 @@ export type Snapshot =
|
|
|
10
9
|
| Snapshot.Overdraft
|
|
11
10
|
| Snapshot.StaleFiat
|
|
12
11
|
| Snapshot.MissingBuffer
|
|
13
|
-
| Snapshot.Counterbalance
|
|
14
12
|
| Snapshot.MissingEmoney
|
|
15
13
|
| Snapshot.MissingFiat
|
|
16
14
|
|
|
@@ -18,16 +16,13 @@ export namespace Snapshot {
|
|
|
18
16
|
export import Overdraft = WarningOverdraft
|
|
19
17
|
export import StaleFiat = WarningStaleFiat
|
|
20
18
|
export import MissingBuffer = WarningMissingBuffer
|
|
21
|
-
export import Counterbalance = WarningCounterbalance
|
|
22
19
|
export import MissingEmoney = WarningMissingEmoney
|
|
23
20
|
export import MissingFiat = WarningMissingFiat
|
|
24
|
-
export const type = isly.union<
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
MissingFiat
|
|
32
|
-
>(Overdraft.type, StaleFiat.type, MissingBuffer.type, Counterbalance.type, MissingEmoney.type, MissingFiat.type)
|
|
21
|
+
export const type = isly.union<Snapshot, Overdraft, StaleFiat, MissingBuffer, MissingEmoney, MissingFiat>(
|
|
22
|
+
Overdraft.type,
|
|
23
|
+
StaleFiat.type,
|
|
24
|
+
MissingBuffer.type,
|
|
25
|
+
MissingEmoney.type,
|
|
26
|
+
MissingFiat.type
|
|
27
|
+
)
|
|
33
28
|
}
|
package/Warning/index.ts
CHANGED
|
@@ -50,8 +50,8 @@ export declare namespace Transactions {
|
|
|
50
50
|
end: string | undefined;
|
|
51
51
|
currency: string | undefined;
|
|
52
52
|
organization: string | undefined;
|
|
53
|
-
rail: "paxgiro" | "mastercard" | "diners" | "visa" | "
|
|
54
|
-
type: "
|
|
53
|
+
rail: "paxgiro" | "mastercard" | "diners" | "visa" | "paxgiro-credit" | "internal" | "transfer" | "fasterpayments" | "chaps" | "bacs" | "credit" | undefined;
|
|
54
|
+
type: "card" | "internal" | "external" | "system" | undefined;
|
|
55
55
|
}>;
|
|
56
56
|
function parse(query: string | http.Request["search"]): Query;
|
|
57
57
|
}
|
|
@@ -1,36 +1,31 @@
|
|
|
1
1
|
import { isoly } from "isoly";
|
|
2
2
|
import { isly } from "isly";
|
|
3
3
|
import { Balance as AccountBalance } from "../Balance";
|
|
4
|
-
import { Counterbalance as CounterbalanceOperation } from "../Counterbalance";
|
|
5
4
|
import type { Settlement } from "../Settlement";
|
|
6
5
|
import { Change } from "./Change";
|
|
7
|
-
export type Changes = Partial<Record<Changes.Entry.Balance, Change
|
|
6
|
+
export type Changes = Partial<Record<Changes.Entry.Balance, Change>>;
|
|
8
7
|
export declare namespace Changes {
|
|
9
8
|
function available(changes: MaybeLegacy, currency: isoly.Currency, legacy?: boolean): number;
|
|
10
9
|
function reserved(changes: MaybeLegacy, currency: isoly.Currency): number;
|
|
11
10
|
function counterbalance(changes: Changes, currency: isoly.Currency): number;
|
|
12
|
-
type Sum = Partial<Record<Changes.Entry.Balance, number
|
|
11
|
+
type Sum = Partial<Record<Changes.Entry.Balance, number>>;
|
|
13
12
|
type MaybeLegacy = Changes | Legacy;
|
|
14
|
-
const type: isly.Type<
|
|
15
|
-
type Legacy = Partial<Record<AccountBalance.Legacy.Entry, Change
|
|
13
|
+
const type: isly.Type<Partial<Record<"available" | "reserved-incoming" | "reserved-outgoing" | "reserved-buffer", Change<"add" | "subtract">>>>;
|
|
14
|
+
type Legacy = Partial<Record<AccountBalance.Legacy.Entry, Change>>;
|
|
16
15
|
namespace Legacy {
|
|
17
|
-
const type: isly.Type<
|
|
18
|
-
type Entry = AccountBalance.Legacy.Entry
|
|
16
|
+
const type: isly.Type<Partial<Record<"actual" | "incomingReserved" | "outgoingReserved" | "bufferReserved", Change<"add" | "subtract">>>>;
|
|
17
|
+
type Entry = AccountBalance.Legacy.Entry;
|
|
19
18
|
namespace Entry {
|
|
20
|
-
function split(counterbalance: Counterbalance): [isoly.DateTime, CounterbalanceOperation.Link];
|
|
21
19
|
type Balance = typeof AccountBalance.Legacy.Entry.values[number];
|
|
22
20
|
namespace Balance {
|
|
23
21
|
const type: isly.Type<"actual" | "incomingReserved" | "outgoingReserved" | "bufferReserved">;
|
|
24
22
|
}
|
|
25
|
-
type Counterbalance = `${CounterbalanceOperation.Link}-${isoly.DateTime}`;
|
|
26
23
|
}
|
|
27
24
|
}
|
|
28
|
-
type Entry = Entry.Balance
|
|
25
|
+
type Entry = Entry.Balance;
|
|
29
26
|
namespace Entry {
|
|
30
|
-
const type: isly.Type<
|
|
31
|
-
type Counterbalance = `${isoly.DateTime}-${CounterbalanceOperation.Link}`;
|
|
27
|
+
const type: isly.Type<"available" | "reserved-incoming" | "reserved-outgoing" | "reserved-buffer">;
|
|
32
28
|
function getBalanceType(key: string): string;
|
|
33
|
-
function split(counterbalance: Counterbalance): [isoly.DateTime, CounterbalanceOperation.Link];
|
|
34
29
|
type Balance = typeof Balance.values[number];
|
|
35
30
|
namespace Balance {
|
|
36
31
|
const values: readonly ["available", "reserved-incoming", "reserved-outgoing", "reserved-buffer"];
|
|
@@ -35,12 +35,6 @@ var Changes;
|
|
|
35
35
|
Legacy.type = isly_1.isly.record(isly_1.isly.string(), Change_1.Change.type);
|
|
36
36
|
let Entry;
|
|
37
37
|
(function (Entry) {
|
|
38
|
-
function split(counterbalance) {
|
|
39
|
-
const split = counterbalance.split("-");
|
|
40
|
-
const hour = split.splice(-3, 3).join("-");
|
|
41
|
-
return [hour, split.join("-")];
|
|
42
|
-
}
|
|
43
|
-
Entry.split = split;
|
|
44
38
|
let Balance;
|
|
45
39
|
(function (Balance) {
|
|
46
40
|
Balance.type = Balance_1.Balance.Legacy.Entry.type;
|
|
@@ -63,14 +57,6 @@ var Changes;
|
|
|
63
57
|
return result;
|
|
64
58
|
}
|
|
65
59
|
Entry.getBalanceType = getBalanceType;
|
|
66
|
-
function split(counterbalance) {
|
|
67
|
-
const split = counterbalance.split("-");
|
|
68
|
-
const hour = split.slice(0, 3).join("-");
|
|
69
|
-
return isoly_1.isoly.DateTime.is(hour)
|
|
70
|
-
? [hour, split.slice(3, split.length).join("-")]
|
|
71
|
-
: Legacy.Entry.split(counterbalance);
|
|
72
|
-
}
|
|
73
|
-
Entry.split = split;
|
|
74
60
|
let Balance;
|
|
75
61
|
(function (Balance) {
|
|
76
62
|
Balance.values = ["available", "reserved-incoming", "reserved-outgoing", "reserved-buffer"];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Changes.js","sourceRoot":"","sources":["../../../Operation/Changes.ts"],"names":[],"mappings":";;;AAAA,iCAA6B;AAC7B,+BAA2B;AAC3B,wCAAsD;
|
|
1
|
+
{"version":3,"file":"Changes.js","sourceRoot":"","sources":["../../../Operation/Changes.ts"],"names":[],"mappings":";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CAAC,mBAAmB,CAAC,IAAI,CAAC;gBACrC,MAAM,EAAE,SAAS;aACjB;SACD,CAAA;IACF,CAAC;IAbe,kBAAU,aAazB,CAAA;AACF,CAAC,EAnGgB,OAAO,uBAAP,OAAO,QAmGvB"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { cryptly } from "cryptly";
|
|
2
|
-
import { Operation } from "../../Operation";
|
|
3
2
|
import { Realm } from "../../Realm";
|
|
4
3
|
export interface Internal {
|
|
5
4
|
type: "internal";
|
|
6
5
|
name?: string;
|
|
7
|
-
identifier: cryptly.Identifier
|
|
6
|
+
identifier: cryptly.Identifier;
|
|
8
7
|
organization?: string;
|
|
9
8
|
}
|
|
10
9
|
export declare namespace Internal {
|
package/dist/cjs/Rail/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { Address as RailAddress } from "./Address";
|
|
|
4
4
|
export type Rail = typeof Rail.rails[number];
|
|
5
5
|
export declare namespace Rail {
|
|
6
6
|
const rails: readonly ["internal", "paxgiro", "paxgiro-credit", "mastercard", "diners", "visa", "fasterpayments", "chaps", "bacs", "transfer", "credit"];
|
|
7
|
-
const type: isly.Type<"paxgiro" | "mastercard" | "diners" | "visa" | "
|
|
8
|
-
const type2: isly2.String<"paxgiro" | "mastercard" | "diners" | "visa" | "
|
|
7
|
+
const type: isly.Type<"paxgiro" | "mastercard" | "diners" | "visa" | "paxgiro-credit" | "internal" | "transfer" | "fasterpayments" | "chaps" | "bacs" | "credit">;
|
|
8
|
+
const type2: isly2.String<"paxgiro" | "mastercard" | "diners" | "visa" | "paxgiro-credit" | "internal" | "transfer" | "fasterpayments" | "chaps" | "bacs" | "credit">;
|
|
9
9
|
export import Address = RailAddress;
|
|
10
10
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { isoly } from "isoly";
|
|
2
2
|
import { Balances } from "../../Balances";
|
|
3
|
-
import { Counterbalances } from "../../Counterbalances";
|
|
4
3
|
import { Supplier } from "../../Supplier";
|
|
5
4
|
export interface Emoney {
|
|
6
5
|
organization: string;
|
|
@@ -8,5 +7,4 @@ export interface Emoney {
|
|
|
8
7
|
supplier?: Supplier;
|
|
9
8
|
timestamp: isoly.DateTime;
|
|
10
9
|
balances: Balances;
|
|
11
|
-
counterbalances: Counterbalances;
|
|
12
10
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { isoly } from "isoly";
|
|
2
|
-
import { isly } from "isly";
|
|
3
2
|
import { Balance } from "../../Balance";
|
|
4
3
|
import { Supplier } from "../../Supplier";
|
|
5
4
|
import { Warning } from "../../Warning";
|
|
@@ -14,7 +13,6 @@ export interface Snapshot {
|
|
|
14
13
|
};
|
|
15
14
|
currency: isoly.Currency;
|
|
16
15
|
supplier: Supplier;
|
|
17
|
-
counterbalance: Snapshot.Counterbalance;
|
|
18
16
|
fiat: {
|
|
19
17
|
safe: number;
|
|
20
18
|
unsafe: number;
|
|
@@ -28,19 +26,6 @@ export declare namespace Snapshot {
|
|
|
28
26
|
export import funding = snapshotFunding;
|
|
29
27
|
type Emoney = SnapshotEmoney;
|
|
30
28
|
type Fiat = SnapshotFiat;
|
|
31
|
-
type Counterbalance = Record<string, {
|
|
32
|
-
total: number;
|
|
33
|
-
account: Record<string, {
|
|
34
|
-
amount: number;
|
|
35
|
-
}>;
|
|
36
|
-
}>;
|
|
37
|
-
namespace Counterbalance {
|
|
38
|
-
const type: isly.Type<Counterbalance>;
|
|
39
|
-
function sum(currency: isoly.Currency, accounts: Record<string, {
|
|
40
|
-
amount: number;
|
|
41
|
-
}>): number;
|
|
42
|
-
function validate(currency: isoly.Currency, counterbalances: Counterbalance): boolean;
|
|
43
|
-
}
|
|
44
29
|
function validate(snapshot: Snapshot): boolean;
|
|
45
30
|
const type: import("isly/dist/cjs/object").IslyObject<Snapshot, object>;
|
|
46
31
|
}
|
|
@@ -11,35 +11,15 @@ const funding_1 = require("./funding");
|
|
|
11
11
|
var Snapshot;
|
|
12
12
|
(function (Snapshot) {
|
|
13
13
|
Snapshot.funding = funding_1.funding;
|
|
14
|
-
let Counterbalance;
|
|
15
|
-
(function (Counterbalance) {
|
|
16
|
-
Counterbalance.type = isly_1.isly.record(isly_1.isly.string(), isly_1.isly.object({
|
|
17
|
-
total: isly_1.isly.number(),
|
|
18
|
-
account: isly_1.isly.record(isly_1.isly.string(), isly_1.isly.object({ amount: isly_1.isly.number() })),
|
|
19
|
-
}));
|
|
20
|
-
function sum(currency, accounts) {
|
|
21
|
-
return Object.values(accounts).reduce((result, account) => isoly_1.isoly.Currency.add(currency, result, account.amount), 0);
|
|
22
|
-
}
|
|
23
|
-
Counterbalance.sum = sum;
|
|
24
|
-
function validate(currency, counterbalances) {
|
|
25
|
-
for (const counterbalance of Object.values(counterbalances))
|
|
26
|
-
if (isoly_1.isoly.Currency.subtract(currency, counterbalance.total, sum(currency, counterbalance.account)))
|
|
27
|
-
return false;
|
|
28
|
-
return true;
|
|
29
|
-
}
|
|
30
|
-
Counterbalance.validate = validate;
|
|
31
|
-
})(Counterbalance = Snapshot.Counterbalance || (Snapshot.Counterbalance = {}));
|
|
32
14
|
function validate(snapshot) {
|
|
33
|
-
const validCounterbalance = Counterbalance.validate(snapshot.currency, snapshot.counterbalance);
|
|
34
15
|
const issuable = snapshot.fiat.total;
|
|
35
16
|
const actual = snapshot.emoney.actual ?? 0;
|
|
36
|
-
return
|
|
17
|
+
return issuable == actual;
|
|
37
18
|
}
|
|
38
19
|
Snapshot.validate = validate;
|
|
39
20
|
Snapshot.type = isly_1.isly.object({
|
|
40
21
|
warnings: Warning_1.Warning.Snapshot.type.array(),
|
|
41
22
|
emoney: Balance_1.Balance.Extended,
|
|
42
|
-
counterbalance: Counterbalance.type,
|
|
43
23
|
currency: isly_1.isly.fromIs("currency", isoly_1.isoly.Currency.is),
|
|
44
24
|
supplier: Supplier_1.Supplier.type,
|
|
45
25
|
fiat: isly_1.isly.object({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../Treasury/Snapshot/index.ts"],"names":[],"mappings":";;;AAAA,iCAA6B;AAC7B,+BAA2B;AAC3B,2CAAuC;AACvC,6CAAyC;AACzC,2CAAuC;AACvC,wCAAoC;AAGpC,uCAAsD;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../Treasury/Snapshot/index.ts"],"names":[],"mappings":";;;AAAA,iCAA6B;AAC7B,+BAA2B;AAC3B,2CAAuC;AACvC,6CAAyC;AACzC,2CAAuC;AACvC,wCAAoC;AAGpC,uCAAsD;AAgBtD,IAAiB,QAAQ,CAuBxB;AAvBD,WAAiB,QAAQ;IACV,gBAAO,GAAG,iBAAe,CAAA;IAGvC,SAAgB,QAAQ,CAAC,QAAkB;QAC1C,MAAM,QAAQ,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAA;QACpC,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,CAAA;QAC1C,OAAO,QAAQ,IAAI,MAAM,CAAA;IAC1B,CAAC;IAJe,iBAAQ,WAIvB,CAAA;IACY,aAAI,GAAG,WAAI,CAAC,MAAM,CAAW;QACzC,QAAQ,EAAE,iBAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAE;QACvC,MAAM,EAAE,iBAAO,CAAC,QAAQ;QACxB,QAAQ,EAAE,WAAI,CAAC,MAAM,CAAC,UAAU,EAAE,aAAK,CAAC,QAAQ,CAAC,EAAE,CAAC;QACpD,QAAQ,EAAE,mBAAQ,CAAC,IAAI;QACvB,IAAI,EAAE,WAAI,CAAC,MAAM,CAAC;YACjB,IAAI,EAAE,WAAI,CAAC,MAAM,EAAE;YACnB,MAAM,EAAE,WAAI,CAAC,MAAM,EAAE;YACrB,KAAK,EAAE,WAAI,CAAC,MAAM,EAAE;YACpB,KAAK,EAAE,WAAI,CAAC,MAAM,EAAE;YACpB,MAAM,EAAE,WAAI,CAAC,MAAM,EAAE;YACrB,QAAQ,EAAE,iBAAO,CAAC,IAAI,CAAC,KAAK,EAAE;SAC9B,CAAC;KACF,CAAC,CAAA;AACH,CAAC,EAvBgB,QAAQ,wBAAR,QAAQ,QAuBxB"}
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import { isly } from "isly";
|
|
2
|
-
import { Counterbalance as WarningCounterbalance } from "./Counterbalance";
|
|
3
2
|
import { MissingBuffer as WarningMissingBuffer } from "./MissingBuffer";
|
|
4
3
|
import { MissingEmoney as WarningMissingEmoney } from "./MissingEmoney";
|
|
5
4
|
import { MissingFiat as WarningMissingFiat } from "./MissingFiat";
|
|
6
5
|
import { Overdraft as WarningOverdraft } from "./Overdraft";
|
|
7
6
|
import { StaleFiat as WarningStaleFiat } from "./StaleFiat";
|
|
8
|
-
export type Snapshot = Snapshot.Overdraft | Snapshot.StaleFiat | Snapshot.MissingBuffer | Snapshot.
|
|
7
|
+
export type Snapshot = Snapshot.Overdraft | Snapshot.StaleFiat | Snapshot.MissingBuffer | Snapshot.MissingEmoney | Snapshot.MissingFiat;
|
|
9
8
|
export declare namespace Snapshot {
|
|
10
9
|
export import Overdraft = WarningOverdraft;
|
|
11
10
|
export import StaleFiat = WarningStaleFiat;
|
|
12
11
|
export import MissingBuffer = WarningMissingBuffer;
|
|
13
|
-
export import Counterbalance = WarningCounterbalance;
|
|
14
12
|
export import MissingEmoney = WarningMissingEmoney;
|
|
15
13
|
export import MissingFiat = WarningMissingFiat;
|
|
16
14
|
const type: isly.Type<Snapshot>;
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Snapshot = void 0;
|
|
4
4
|
const isly_1 = require("isly");
|
|
5
|
-
const Counterbalance_1 = require("./Counterbalance");
|
|
6
5
|
const MissingBuffer_1 = require("./MissingBuffer");
|
|
7
6
|
const MissingEmoney_1 = require("./MissingEmoney");
|
|
8
7
|
const MissingFiat_1 = require("./MissingFiat");
|
|
@@ -13,9 +12,8 @@ var Snapshot;
|
|
|
13
12
|
Snapshot.Overdraft = Overdraft_1.Overdraft;
|
|
14
13
|
Snapshot.StaleFiat = StaleFiat_1.StaleFiat;
|
|
15
14
|
Snapshot.MissingBuffer = MissingBuffer_1.MissingBuffer;
|
|
16
|
-
Snapshot.Counterbalance = Counterbalance_1.Counterbalance;
|
|
17
15
|
Snapshot.MissingEmoney = MissingEmoney_1.MissingEmoney;
|
|
18
16
|
Snapshot.MissingFiat = MissingFiat_1.MissingFiat;
|
|
19
|
-
Snapshot.type = isly_1.isly.union(Snapshot.Overdraft.type, Snapshot.StaleFiat.type, Snapshot.MissingBuffer.type, Snapshot.
|
|
17
|
+
Snapshot.type = isly_1.isly.union(Snapshot.Overdraft.type, Snapshot.StaleFiat.type, Snapshot.MissingBuffer.type, Snapshot.MissingEmoney.type, Snapshot.MissingFiat.type);
|
|
20
18
|
})(Snapshot || (exports.Snapshot = Snapshot = {}));
|
|
21
19
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../Warning/Snapshot/index.ts"],"names":[],"mappings":";;;AAAA,+BAA2B;AAC3B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../Warning/Snapshot/index.ts"],"names":[],"mappings":";;;AAAA,+BAA2B;AAC3B,mDAAuE;AACvE,mDAAuE;AACvE,+CAAiE;AACjE,2CAA2D;AAC3D,2CAA2D;AAS3D,IAAiB,QAAQ,CAaxB;AAbD,WAAiB,QAAQ;IACV,kBAAS,GAAG,qBAAgB,CAAA;IAC5B,kBAAS,GAAG,qBAAgB,CAAA;IAC5B,sBAAa,GAAG,6BAAoB,CAAA;IACpC,sBAAa,GAAG,6BAAoB,CAAA;IACpC,oBAAW,GAAG,yBAAkB,CAAA;IACjC,aAAI,GAAG,WAAI,CAAC,KAAK,CAC7B,SAAA,SAAS,CAAC,IAAI,EACd,SAAA,SAAS,CAAC,IAAI,EACd,SAAA,aAAa,CAAC,IAAI,EAClB,SAAA,aAAa,CAAC,IAAI,EAClB,SAAA,WAAW,CAAC,IAAI,CAChB,CAAA;AACF,CAAC,EAbgB,QAAQ,wBAAR,QAAQ,QAaxB"}
|
|
@@ -11,7 +11,7 @@ export declare namespace Warning {
|
|
|
11
11
|
export import Issue = WarningIssue;
|
|
12
12
|
namespace Type {
|
|
13
13
|
type Snapshot = WarningSnapshot["type"];
|
|
14
|
-
const Snapshot: isly.Type<"overdraft" | "
|
|
14
|
+
const Snapshot: isly.Type<"overdraft" | "missing-buffer" | "missing-emoney" | "missing-fiat" | "stale-fiat">;
|
|
15
15
|
type Settlement = WarningSettlement["type"];
|
|
16
16
|
const Settlement: isly.Type<"missing-file" | "negative-amount" | "unknown-entry">;
|
|
17
17
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../Warning/index.ts"],"names":[],"mappings":";;;AAAA,+BAA2B;AAC3B,iCAA4C;AAC5C,mCAA+C;AAC/C,6CAA8D;AAC9D,yCAAwD;AAIxD,IAAiB,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../Warning/index.ts"],"names":[],"mappings":";;;AAAA,+BAA2B;AAC3B,iCAA4C;AAC5C,mCAA+C;AAC/C,6CAA8D;AAC9D,yCAAwD;AAIxD,IAAiB,OAAO,CAkBvB;AAlBD,WAAiB,OAAO;IACT,gBAAQ,GAAG,mBAAe,CAAA;IAC1B,kBAAU,GAAG,uBAAiB,CAAA;IAC9B,YAAI,GAAG,WAAW,CAAA;IAClB,aAAK,GAAG,aAAY,CAAA;IAClC,IAAiB,IAAI,CAWpB;IAXD,WAAiB,IAAI;QAEP,aAAQ,GAAG,WAAI,CAAC,MAAM,CAAW;YAC7C,WAAW;YACX,YAAY;YACZ,gBAAgB;YAChB,gBAAgB;YAChB,cAAc;SACd,CAAC,CAAA;QAEW,eAAU,GAAG,WAAI,CAAC,MAAM,CAAa,CAAC,iBAAiB,EAAE,cAAc,EAAE,eAAe,CAAC,CAAC,CAAA;IACxG,CAAC,EAXgB,IAAI,GAAJ,YAAI,KAAJ,YAAI,QAWpB;IACY,YAAI,GAAG,WAAI,CAAC,KAAK,CAAgC,QAAA,QAAQ,CAAC,IAAI,EAAE,QAAA,UAAU,CAAC,IAAI,CAAC,CAAA;AAC9F,CAAC,EAlBgB,OAAO,uBAAP,OAAO,QAkBvB"}
|
package/dist/cjs/pax2pay.d.ts
CHANGED
|
@@ -9,8 +9,6 @@ export { Balance } from "./Balance";
|
|
|
9
9
|
export { Balances } from "./Balances";
|
|
10
10
|
export { Card } from "./Card";
|
|
11
11
|
export { Client } from "./Client";
|
|
12
|
-
export { Counterbalance } from "./Counterbalance";
|
|
13
|
-
export { Counterbalances } from "./Counterbalances";
|
|
14
12
|
export { Exchange } from "./Exchange";
|
|
15
13
|
export { fx } from "./fx";
|
|
16
14
|
export { Holidays } from "./Holidays";
|
package/dist/cjs/pax2pay.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.zodHelper = exports.Quarter = exports.Warning = exports.User = exports.Treasury = exports.Transaction = exports.Supplier = exports.Settlement = exports.Rule = exports.reports = exports.Report = exports.Realm = exports.Rail = exports.Organization = exports.Operation = exports.Merchant = exports.Log = exports.Label = exports.Identifier = exports.Holidays = exports.fx = exports.Exchange = exports.
|
|
3
|
+
exports.zodHelper = exports.Quarter = exports.Warning = exports.User = exports.Treasury = exports.Transaction = exports.Supplier = exports.Settlement = exports.Rule = exports.reports = exports.Report = exports.Realm = exports.Rail = exports.Organization = exports.Operation = exports.Merchant = exports.Log = exports.Label = exports.Identifier = exports.Holidays = exports.fx = exports.Exchange = exports.Client = exports.Card = exports.Balances = exports.Balance = exports.Backup = exports.Authorization = exports.Audit = exports.Amounts = exports.Amount = exports.Acquirer = exports.Account = void 0;
|
|
4
4
|
var Account_1 = require("./Account");
|
|
5
5
|
Object.defineProperty(exports, "Account", { enumerable: true, get: function () { return Account_1.Account; } });
|
|
6
6
|
var Acquirer_1 = require("./Acquirer");
|
|
@@ -23,10 +23,6 @@ var Card_1 = require("./Card");
|
|
|
23
23
|
Object.defineProperty(exports, "Card", { enumerable: true, get: function () { return Card_1.Card; } });
|
|
24
24
|
var Client_1 = require("./Client");
|
|
25
25
|
Object.defineProperty(exports, "Client", { enumerable: true, get: function () { return Client_1.Client; } });
|
|
26
|
-
var Counterbalance_1 = require("./Counterbalance");
|
|
27
|
-
Object.defineProperty(exports, "Counterbalance", { enumerable: true, get: function () { return Counterbalance_1.Counterbalance; } });
|
|
28
|
-
var Counterbalances_1 = require("./Counterbalances");
|
|
29
|
-
Object.defineProperty(exports, "Counterbalances", { enumerable: true, get: function () { return Counterbalances_1.Counterbalances; } });
|
|
30
26
|
var Exchange_1 = require("./Exchange");
|
|
31
27
|
Object.defineProperty(exports, "Exchange", { enumerable: true, get: function () { return Exchange_1.Exchange; } });
|
|
32
28
|
var fx_1 = require("./fx");
|
package/dist/cjs/pax2pay.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pax2pay.js","sourceRoot":"","sources":["../../pax2pay.ts"],"names":[],"mappings":";;;AAAA,qCAAmC;AAA1B,kGAAA,OAAO,OAAA;AAChB,uCAAqC;AAA5B,oGAAA,QAAQ,OAAA;AACjB,mCAAiC;AAAxB,gGAAA,MAAM,OAAA;AACf,qCAAmC;AAA1B,kGAAA,OAAO,OAAA;AAChB,iCAA+B;AAAtB,8FAAA,KAAK,OAAA;AACd,iDAA+C;AAAtC,8GAAA,aAAa,OAAA;AACtB,mCAAiC;AAAxB,gGAAA,MAAM,OAAA;AACf,qCAAmC;AAA1B,kGAAA,OAAO,OAAA;AAChB,uCAAqC;AAA5B,oGAAA,QAAQ,OAAA;AACjB,+BAA6B;AAApB,4FAAA,IAAI,OAAA;AACb,mCAAiC;AAAxB,gGAAA,MAAM,OAA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AqC;AAA5B,oGAAA,QAAQ,OAAA;AACjB,+BAA6B;AAApB,4FAAA,IAAI,OAAA;AACb,qCAAmC;AAA1B,kGAAA,OAAO,OAAA;AAChB,qCAAmC;AAA1B,kGAAA,OAAO,OAAA;AAChB,6BAAiC;AAAxB,gGAAA,SAAS,OAAA"}
|
|
@@ -50,8 +50,8 @@ export declare namespace Transactions {
|
|
|
50
50
|
end: string | undefined;
|
|
51
51
|
currency: string | undefined;
|
|
52
52
|
organization: string | undefined;
|
|
53
|
-
rail: "paxgiro" | "mastercard" | "diners" | "visa" | "
|
|
54
|
-
type: "
|
|
53
|
+
rail: "paxgiro" | "mastercard" | "diners" | "visa" | "paxgiro-credit" | "internal" | "transfer" | "fasterpayments" | "chaps" | "bacs" | "credit" | undefined;
|
|
54
|
+
type: "card" | "internal" | "external" | "system" | undefined;
|
|
55
55
|
}>;
|
|
56
56
|
function parse(query: string | http.Request["search"]): Query;
|
|
57
57
|
}
|
|
@@ -1,36 +1,31 @@
|
|
|
1
1
|
import { isoly } from "isoly";
|
|
2
2
|
import { isly } from "isly";
|
|
3
3
|
import { Balance as AccountBalance } from "../Balance";
|
|
4
|
-
import { Counterbalance as CounterbalanceOperation } from "../Counterbalance";
|
|
5
4
|
import type { Settlement } from "../Settlement";
|
|
6
5
|
import { Change } from "./Change";
|
|
7
|
-
export type Changes = Partial<Record<Changes.Entry.Balance, Change
|
|
6
|
+
export type Changes = Partial<Record<Changes.Entry.Balance, Change>>;
|
|
8
7
|
export declare namespace Changes {
|
|
9
8
|
function available(changes: MaybeLegacy, currency: isoly.Currency, legacy?: boolean): number;
|
|
10
9
|
function reserved(changes: MaybeLegacy, currency: isoly.Currency): number;
|
|
11
10
|
function counterbalance(changes: Changes, currency: isoly.Currency): number;
|
|
12
|
-
type Sum = Partial<Record<Changes.Entry.Balance, number
|
|
11
|
+
type Sum = Partial<Record<Changes.Entry.Balance, number>>;
|
|
13
12
|
type MaybeLegacy = Changes | Legacy;
|
|
14
|
-
const type: isly.Type<
|
|
15
|
-
type Legacy = Partial<Record<AccountBalance.Legacy.Entry, Change
|
|
13
|
+
const type: isly.Type<Partial<Record<"available" | "reserved-incoming" | "reserved-outgoing" | "reserved-buffer", Change<"add" | "subtract">>>>;
|
|
14
|
+
type Legacy = Partial<Record<AccountBalance.Legacy.Entry, Change>>;
|
|
16
15
|
namespace Legacy {
|
|
17
|
-
const type: isly.Type<
|
|
18
|
-
type Entry = AccountBalance.Legacy.Entry
|
|
16
|
+
const type: isly.Type<Partial<Record<"actual" | "incomingReserved" | "outgoingReserved" | "bufferReserved", Change<"add" | "subtract">>>>;
|
|
17
|
+
type Entry = AccountBalance.Legacy.Entry;
|
|
19
18
|
namespace Entry {
|
|
20
|
-
function split(counterbalance: Counterbalance): [isoly.DateTime, CounterbalanceOperation.Link];
|
|
21
19
|
type Balance = typeof AccountBalance.Legacy.Entry.values[number];
|
|
22
20
|
namespace Balance {
|
|
23
21
|
const type: isly.Type<"actual" | "incomingReserved" | "outgoingReserved" | "bufferReserved">;
|
|
24
22
|
}
|
|
25
|
-
type Counterbalance = `${CounterbalanceOperation.Link}-${isoly.DateTime}`;
|
|
26
23
|
}
|
|
27
24
|
}
|
|
28
|
-
type Entry = Entry.Balance
|
|
25
|
+
type Entry = Entry.Balance;
|
|
29
26
|
namespace Entry {
|
|
30
|
-
const type: isly.Type<
|
|
31
|
-
type Counterbalance = `${isoly.DateTime}-${CounterbalanceOperation.Link}`;
|
|
27
|
+
const type: isly.Type<"available" | "reserved-incoming" | "reserved-outgoing" | "reserved-buffer">;
|
|
32
28
|
function getBalanceType(key: string): string;
|
|
33
|
-
function split(counterbalance: Counterbalance): [isoly.DateTime, CounterbalanceOperation.Link];
|
|
34
29
|
type Balance = typeof Balance.values[number];
|
|
35
30
|
namespace Balance {
|
|
36
31
|
const values: readonly ["available", "reserved-incoming", "reserved-outgoing", "reserved-buffer"];
|