@pax2pay/model-banking 0.1.299 → 0.1.300
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/Treasury/Transaction/Creatable.ts +9 -12
- package/Treasury/Transaction/index.ts +10 -16
- package/Treasury/index.ts +3 -3
- package/dist/Treasury/Transaction/Creatable.d.ts +3 -1
- package/dist/Treasury/Transaction/Creatable.js +8 -10
- package/dist/Treasury/Transaction/Creatable.js.map +1 -1
- package/dist/Treasury/Transaction/index.d.ts +6 -7
- package/dist/Treasury/Transaction/index.js +7 -10
- package/dist/Treasury/Transaction/index.js.map +1 -1
- package/dist/Treasury/index.d.ts +3 -3
- package/dist/Treasury/index.js +3 -1
- package/dist/Treasury/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { isoly } from "isoly"
|
|
2
|
+
import { isly } from "isly"
|
|
2
3
|
import { Rail } from "../../Rail"
|
|
3
4
|
|
|
4
5
|
export interface Creatable {
|
|
@@ -6,18 +7,14 @@ export interface Creatable {
|
|
|
6
7
|
currency: isoly.Currency
|
|
7
8
|
amount: number
|
|
8
9
|
description: string
|
|
10
|
+
external?: string
|
|
9
11
|
}
|
|
10
|
-
|
|
11
12
|
export namespace Creatable {
|
|
12
|
-
export
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
typeof value.amount == "number" &&
|
|
20
|
-
typeof value.description == "string"
|
|
21
|
-
)
|
|
22
|
-
}
|
|
13
|
+
export const type = isly.object<Creatable>({
|
|
14
|
+
creditor: Rail.Address.type,
|
|
15
|
+
currency: isly.fromIs("transaction.currency", isoly.Currency.is),
|
|
16
|
+
amount: isly.number(),
|
|
17
|
+
description: isly.string(),
|
|
18
|
+
external: isly.string().optional(),
|
|
19
|
+
})
|
|
23
20
|
}
|
|
@@ -1,25 +1,17 @@
|
|
|
1
1
|
import { cryptly } from "cryptly"
|
|
2
2
|
import { isoly } from "isoly"
|
|
3
|
+
import { isly } from "isly"
|
|
3
4
|
import { Rail } from "../../Rail"
|
|
4
5
|
import { Creatable as TransactionCreatable } from "./Creatable"
|
|
5
6
|
|
|
6
7
|
export interface Transaction extends TransactionCreatable {
|
|
8
|
+
id: cryptly.Identifier
|
|
9
|
+
created: string
|
|
7
10
|
debtor: Rail.Address
|
|
8
|
-
readonly id: cryptly.Identifier
|
|
9
|
-
readonly created: isoly.DateTime
|
|
10
11
|
}
|
|
11
12
|
export namespace Transaction {
|
|
12
|
-
export
|
|
13
|
-
|
|
14
|
-
value &&
|
|
15
|
-
typeof value == "object" &&
|
|
16
|
-
Rail.Address.is(value.debtor) &&
|
|
17
|
-
cryptly.Identifier.is(value.id) &&
|
|
18
|
-
isoly.DateTime.is(value.created) &&
|
|
19
|
-
Creatable.is({ ...value })
|
|
20
|
-
)
|
|
21
|
-
}
|
|
22
|
-
export function fromCreatable(transaction: TransactionCreatable, debtor: Rail.Address): Transaction {
|
|
13
|
+
export import Creatable = TransactionCreatable
|
|
14
|
+
export function fromCreatable(transaction: Creatable, debtor: Rail.Address): Transaction {
|
|
23
15
|
return {
|
|
24
16
|
debtor,
|
|
25
17
|
id: cryptly.Identifier.generate(8),
|
|
@@ -27,7 +19,9 @@ export namespace Transaction {
|
|
|
27
19
|
...transaction,
|
|
28
20
|
}
|
|
29
21
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
22
|
+
export const type = Creatable.type.extend<Transaction>({
|
|
23
|
+
id: isly.string(),
|
|
24
|
+
created: isly.string(),
|
|
25
|
+
debtor: Rail.Address.type,
|
|
26
|
+
})
|
|
33
27
|
}
|
package/Treasury/index.ts
CHANGED
|
@@ -13,11 +13,11 @@ export namespace Treasury {
|
|
|
13
13
|
"hours"
|
|
14
14
|
)
|
|
15
15
|
}
|
|
16
|
-
export
|
|
17
|
-
export
|
|
16
|
+
export import Transaction = TreasuryTransaction
|
|
17
|
+
export import Snapshot = TreasurySnapshot
|
|
18
18
|
export type Balance = TreasuryBalance
|
|
19
19
|
export const Balance = TreasuryBalance
|
|
20
|
-
export
|
|
20
|
+
export type Account = TreasuryAccount
|
|
21
21
|
export namespace Account {
|
|
22
22
|
export type Creatable = TreasuryAccount.Creatable
|
|
23
23
|
export const Creatable = TreasuryAccount.Creatable
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { isoly } from "isoly";
|
|
2
|
+
import { isly } from "isly";
|
|
2
3
|
import { Rail } from "../../Rail";
|
|
3
4
|
export interface Creatable {
|
|
4
5
|
creditor: Rail.Address;
|
|
5
6
|
currency: isoly.Currency;
|
|
6
7
|
amount: number;
|
|
7
8
|
description: string;
|
|
9
|
+
external?: string;
|
|
8
10
|
}
|
|
9
11
|
export declare namespace Creatable {
|
|
10
|
-
|
|
12
|
+
const type: isly.object.ExtendableType<Creatable>;
|
|
11
13
|
}
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import { isoly } from "isoly";
|
|
2
|
+
import { isly } from "isly";
|
|
2
3
|
import { Rail } from "../../Rail";
|
|
3
4
|
export var Creatable;
|
|
4
5
|
(function (Creatable) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
typeof value.description == "string");
|
|
13
|
-
}
|
|
14
|
-
Creatable.is = is;
|
|
6
|
+
Creatable.type = isly.object({
|
|
7
|
+
creditor: Rail.Address.type,
|
|
8
|
+
currency: isly.fromIs("transaction.currency", isoly.Currency.is),
|
|
9
|
+
amount: isly.number(),
|
|
10
|
+
description: isly.string(),
|
|
11
|
+
external: isly.string().optional(),
|
|
12
|
+
});
|
|
15
13
|
})(Creatable || (Creatable = {}));
|
|
16
14
|
//# sourceMappingURL=Creatable.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Creatable.js","sourceRoot":"../","sources":["Treasury/Transaction/Creatable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AASjC,MAAM,KAAW,SAAS,
|
|
1
|
+
{"version":3,"file":"Creatable.js","sourceRoot":"../","sources":["Treasury/Transaction/Creatable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AASjC,MAAM,KAAW,SAAS,CAQzB;AARD,WAAiB,SAAS;IACZ,cAAI,GAAG,IAAI,CAAC,MAAM,CAAY;QAC1C,QAAQ,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI;QAC3B,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,sBAAsB,EAAE,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC;QAChE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE;QACrB,WAAW,EAAE,IAAI,CAAC,MAAM,EAAE;QAC1B,QAAQ,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KAClC,CAAC,CAAA;AACH,CAAC,EARgB,SAAS,KAAT,SAAS,QAQzB"}
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { cryptly } from "cryptly";
|
|
2
|
-
import {
|
|
2
|
+
import { isly } from "isly";
|
|
3
3
|
import { Rail } from "../../Rail";
|
|
4
4
|
import { Creatable as TransactionCreatable } from "./Creatable";
|
|
5
5
|
export interface Transaction extends TransactionCreatable {
|
|
6
|
+
id: cryptly.Identifier;
|
|
7
|
+
created: string;
|
|
6
8
|
debtor: Rail.Address;
|
|
7
|
-
readonly id: cryptly.Identifier;
|
|
8
|
-
readonly created: isoly.DateTime;
|
|
9
9
|
}
|
|
10
10
|
export declare namespace Transaction {
|
|
11
|
-
|
|
12
|
-
function fromCreatable(transaction:
|
|
13
|
-
const
|
|
14
|
-
type Creatable = TransactionCreatable;
|
|
11
|
+
export import Creatable = TransactionCreatable;
|
|
12
|
+
function fromCreatable(transaction: Creatable, debtor: Rail.Address): Transaction;
|
|
13
|
+
const type: isly.object.ExtendableType<Transaction>;
|
|
15
14
|
}
|
|
@@ -1,18 +1,11 @@
|
|
|
1
1
|
import { cryptly } from "cryptly";
|
|
2
2
|
import { isoly } from "isoly";
|
|
3
|
+
import { isly } from "isly";
|
|
3
4
|
import { Rail } from "../../Rail";
|
|
4
5
|
import { Creatable as TransactionCreatable } from "./Creatable";
|
|
5
6
|
export var Transaction;
|
|
6
7
|
(function (Transaction) {
|
|
7
|
-
|
|
8
|
-
return (value &&
|
|
9
|
-
typeof value == "object" &&
|
|
10
|
-
Rail.Address.is(value.debtor) &&
|
|
11
|
-
cryptly.Identifier.is(value.id) &&
|
|
12
|
-
isoly.DateTime.is(value.created) &&
|
|
13
|
-
Transaction.Creatable.is({ ...value }));
|
|
14
|
-
}
|
|
15
|
-
Transaction.is = is;
|
|
8
|
+
Transaction.Creatable = TransactionCreatable;
|
|
16
9
|
function fromCreatable(transaction, debtor) {
|
|
17
10
|
return {
|
|
18
11
|
debtor,
|
|
@@ -22,6 +15,10 @@ export var Transaction;
|
|
|
22
15
|
};
|
|
23
16
|
}
|
|
24
17
|
Transaction.fromCreatable = fromCreatable;
|
|
25
|
-
Transaction.
|
|
18
|
+
Transaction.type = Transaction.Creatable.type.extend({
|
|
19
|
+
id: isly.string(),
|
|
20
|
+
created: isly.string(),
|
|
21
|
+
debtor: Rail.Address.type,
|
|
22
|
+
});
|
|
26
23
|
})(Transaction || (Transaction = {}));
|
|
27
24
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Treasury/Transaction/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,YAAY,CAAA;AACjC,OAAO,EAAE,SAAS,IAAI,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAO/D,MAAM,KAAW,WAAW,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Treasury/Transaction/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,SAAS,IAAI,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAO/D,MAAM,KAAW,WAAW,CAe3B;AAfD,WAAiB,WAAW;IACb,qBAAS,GAAG,oBAAoB,CAAA;IAC9C,SAAgB,aAAa,CAAC,WAAsB,EAAE,MAAoB;QACzE,OAAO;YACN,MAAM;YACN,EAAE,EAAE,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC;YAClC,OAAO,EAAE,KAAK,CAAC,QAAQ,CAAC,GAAG,EAAE;YAC7B,GAAG,WAAW;SACd,CAAA;IACF,CAAC;IAPe,yBAAa,gBAO5B,CAAA;IACY,gBAAI,GAAG,YAAA,SAAS,CAAC,IAAI,CAAC,MAAM,CAAc;QACtD,EAAE,EAAE,IAAI,CAAC,MAAM,EAAE;QACjB,OAAO,EAAE,IAAI,CAAC,MAAM,EAAE;QACtB,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI;KACzB,CAAC,CAAA;AACH,CAAC,EAfgB,WAAW,KAAX,WAAW,QAe3B"}
|
package/dist/Treasury/index.d.ts
CHANGED
|
@@ -5,11 +5,11 @@ import { Snapshot as TreasurySnapshot } from "./Snapshot";
|
|
|
5
5
|
import { Transaction as TreasuryTransaction } from "./Transaction";
|
|
6
6
|
export declare namespace Treasury {
|
|
7
7
|
function key(hour?: isoly.DateTime): isoly.DateTime;
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
export import Transaction = TreasuryTransaction;
|
|
9
|
+
export import Snapshot = TreasurySnapshot;
|
|
10
10
|
type Balance = TreasuryBalance;
|
|
11
11
|
const Balance: typeof TreasuryBalance;
|
|
12
|
-
|
|
12
|
+
type Account = TreasuryAccount;
|
|
13
13
|
namespace Account {
|
|
14
14
|
type Creatable = TreasuryAccount.Creatable;
|
|
15
15
|
const Creatable: typeof import("./Account/Creatable").Creatable;
|
package/dist/Treasury/index.js
CHANGED
|
@@ -2,6 +2,7 @@ import { isoly } from "isoly";
|
|
|
2
2
|
import { Account as TreasuryAccount } from "./Account";
|
|
3
3
|
import { Balance as TreasuryBalance } from "./Balance";
|
|
4
4
|
import { Snapshot as TreasurySnapshot } from "./Snapshot";
|
|
5
|
+
import { Transaction as TreasuryTransaction } from "./Transaction";
|
|
5
6
|
export var Treasury;
|
|
6
7
|
(function (Treasury) {
|
|
7
8
|
function key(hour) {
|
|
@@ -10,8 +11,9 @@ export var Treasury;
|
|
|
10
11
|
return isoly.DateTime.truncate(isoly.DateTime.invert(hour && isoly.DateTime.epoch(latest) > isoly.DateTime.epoch(hour) ? hour : latest), "hours");
|
|
11
12
|
}
|
|
12
13
|
Treasury.key = key;
|
|
13
|
-
Treasury.
|
|
14
|
+
Treasury.Transaction = TreasuryTransaction;
|
|
14
15
|
Treasury.Snapshot = TreasurySnapshot;
|
|
16
|
+
Treasury.Balance = TreasuryBalance;
|
|
15
17
|
let Account;
|
|
16
18
|
(function (Account) {
|
|
17
19
|
Account.Creatable = TreasuryAccount.Creatable;
|
|
@@ -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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