@pax2pay/model-banking 0.1.299 → 0.1.301
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/Client/Treasury.ts +2 -2
- package/Treasury/Account/index.ts +10 -20
- package/Treasury/Transaction/Creatable.ts +9 -12
- package/Treasury/Transaction/index.ts +10 -16
- package/Treasury/index.ts +3 -16
- package/dist/Client/Treasury.d.ts +1 -1
- package/dist/Client/Treasury.js.map +1 -1
- package/dist/Treasury/Account/index.d.ts +9 -13
- package/dist/Treasury/Account/index.js +3 -10
- package/dist/Treasury/Account/index.js.map +1 -1
- 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 -16
- package/dist/Treasury/index.js +4 -10
- package/dist/Treasury/index.js.map +1 -1
- package/package.json +1 -1
package/Client/Treasury.ts
CHANGED
|
@@ -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
|
}
|
|
@@ -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:
|
|
34
|
-
supplier:
|
|
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:
|
|
39
|
+
rail: Rail.Address.type.array(),
|
|
40
40
|
balance: isly.fromIs("Treasury.Account.balance", Balance.is),
|
|
41
41
|
})
|
|
42
|
-
export
|
|
43
|
-
export
|
|
44
|
-
export
|
|
45
|
-
|
|
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
|
}
|
|
@@ -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,22 +13,9 @@ 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
|
+
export import Account = TreasuryAccount
|
|
18
19
|
export type Balance = TreasuryBalance
|
|
19
20
|
export const Balance = TreasuryBalance
|
|
20
|
-
export import Snapshot = TreasurySnapshot
|
|
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
|
-
}
|
|
34
21
|
}
|
|
@@ -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,
|
|
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"}
|
|
@@ -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
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
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:
|
|
20
|
-
supplier:
|
|
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:
|
|
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":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Treasury/Account/index.ts"],"names":[],"mappings":"AACA,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;AAEpC,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;AAexD,MAAM,KAAW,OAAO,CAoBvB;AApBD,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,KAAK,CAAC,IAAI;QACjB,QAAQ,EAAE,QAAQ,CAAC,IAAI;QACvB,SAAS,EAAE,IAAI,CAAC,MAAM,EAAE;QACxB,UAAU,EAAE,IAAI,CAAC,MAAM,CAAC,6BAA6B,EAAE,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE;QACjF,IAAI,EAAE,eAAe,CAAC,IAAI;QAC1B,UAAU,EAAE,iBAAiB,CAAC,IAAI;QAClC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE;QAC/B,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,0BAA0B,EAAE,OAAO,CAAC,EAAE,CAAC;KAC5D,CAAC,CAAA;IAEY,iBAAS,GAAG,gBAAgB,CAAA;IAC5B,gBAAQ,GAAG,eAAe,CAAA;IAC1B,iBAAS,GAAG,gBAAgB,CAAA;IAC5B,gBAAQ,GAAG,eAAe,CAAA;IAC1B,kBAAU,GAAG,iBAAiB,CAAA;AAC7C,CAAC,EApBgB,OAAO,KAAP,OAAO,QAoBvB"}
|
|
@@ -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,22 +5,9 @@ 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
|
+
export import Account = TreasuryAccount;
|
|
10
11
|
type Balance = TreasuryBalance;
|
|
11
12
|
const Balance: typeof TreasuryBalance;
|
|
12
|
-
export import Snapshot = TreasurySnapshot;
|
|
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
|
-
}
|
|
26
13
|
}
|
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,16 +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;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
Account.Creatable = TreasuryAccount.Creatable;
|
|
18
|
-
Account.Storable = TreasuryAccount.Storable;
|
|
19
|
-
Account.Fetchable = TreasuryAccount.Fetchable;
|
|
20
|
-
Account.Conditions = TreasuryAccount.Conditions;
|
|
21
|
-
Account.Category = TreasuryAccount.Category;
|
|
22
|
-
Account.is = TreasuryAccount.is;
|
|
23
|
-
})(Account = Treasury.Account || (Treasury.Account = {}));
|
|
16
|
+
Treasury.Account = TreasuryAccount;
|
|
17
|
+
Treasury.Balance = TreasuryBalance;
|
|
24
18
|
})(Treasury || (Treasury = {}));
|
|
25
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;AACtD,OAAO,EAAE,QAAQ,IAAI,gBAAgB,EAAE,MAAM,YAAY,CAAA;
|
|
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;AACtD,OAAO,EAAE,QAAQ,IAAI,gBAAgB,EAAE,MAAM,YAAY,CAAA;AACzD,OAAO,EAAE,WAAW,IAAI,mBAAmB,EAAE,MAAM,eAAe,CAAA;AAElE,MAAM,KAAW,QAAQ,CAcxB;AAdD,WAAiB,QAAQ;IACxB,SAAgB,GAAG,CAAC,IAAqB;QACxC,MAAM,GAAG,GAAG,KAAK,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAA;QAChC,MAAM,MAAM,GAAG,KAAK,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,YAAY,CAAC,GAAG,CAAC,CAAA;QAC1F,OAAO,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAC7B,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,IAAI,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,EACxG,OAAO,CACP,CAAA;IACF,CAAC;IAPe,YAAG,MAOlB,CAAA;IACa,oBAAW,GAAG,mBAAmB,CAAA;IACjC,iBAAQ,GAAG,gBAAgB,CAAA;IAC3B,gBAAO,GAAG,eAAe,CAAA;IAE1B,gBAAO,GAAG,eAAe,CAAA;AACvC,CAAC,EAdgB,QAAQ,KAAR,QAAQ,QAcxB"}
|