@pax2pay/model-banking 0.1.8 → 0.1.9

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/Realm/index.ts CHANGED
@@ -2,10 +2,12 @@ export const Realms = ["test", "uk", "eu"] as const
2
2
  export type Realm = typeof Realms[number]
3
3
 
4
4
  export namespace Realm {
5
+ export const realms: Realm[] = [...Realms]
6
+
5
7
  export function is(value: any | Realm): value is Realm {
6
8
  return value && (value == "test" || value == "uk" || value == "eu")
9
+ //return value && realms.includes(value)
7
10
  }
8
-
9
11
  export function toString(): string {
10
12
  let result = ""
11
13
  for (const v of Realms) {
@@ -14,7 +14,7 @@ export class Treasury extends rest.Collection<gracely.Error> {
14
14
  return this.client.patch(`/treasury/${currency}/fiat`, changes)
15
15
  }
16
16
  async fetch(hour?: isoly.DateTime): Promise<TreasuryModel | gracely.Error> {
17
- const path = hour ? `?hour=${isoly.DateTime.truncate(hour, "hours")}` : ""
17
+ const path = hour ? `?time=${hour}` : ""
18
18
  return this.client.get<TreasuryModel>(`/treasury${path}`)
19
19
  }
20
20
  }
@@ -3,6 +3,7 @@ import { Account } from "../Account"
3
3
  export interface Fiat {
4
4
  safe: number
5
5
  unsafe: number
6
+ other: number
6
7
  total: number
7
8
  accounts: Account[]
8
9
  }
@@ -1,6 +1,7 @@
1
1
  export declare const Realms: readonly ["test", "uk", "eu"];
2
2
  export type Realm = typeof Realms[number];
3
3
  export declare namespace Realm {
4
+ const realms: Realm[];
4
5
  function is(value: any | Realm): value is Realm;
5
6
  function toString(): string;
6
7
  }
@@ -1,6 +1,7 @@
1
1
  export const Realms = ["test", "uk", "eu"];
2
2
  export var Realm;
3
3
  (function (Realm) {
4
+ Realm.realms = [...Realms];
4
5
  function is(value) {
5
6
  return value && (value == "test" || value == "uk" || value == "eu");
6
7
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"../","sources":["Realm/index.ts"],"names":[],"mappings":"AAAA,MAAM,C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AAL,KAAK,QAcrB"}
@@ -1,4 +1,3 @@
1
- import * as isoly from "isoly";
2
1
  import * as rest from "cloudly-rest";
3
2
  export class Treasury extends rest.Collection {
4
3
  constructor(client) {
@@ -8,7 +7,7 @@ export class Treasury extends rest.Collection {
8
7
  return this.client.patch(`/treasury/${currency}/fiat`, changes);
9
8
  }
10
9
  async fetch(hour) {
11
- const path = hour ? `?hour=${isoly.DateTime.truncate(hour, "hours")}` : "";
10
+ const path = hour ? `?time=${hour}` : "";
12
11
  return this.client.get(`/treasury${path}`);
13
12
  }
14
13
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Treasury.js","sourceRoot":"../","sources":["Treasury/Client/Treasury.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,KAAK,IAAI,MAAM,cAAc,CAAA;AAIpC,MAAM,OAAO,QAAS,SAAQ,IAAI,CAAC,UAAyB;IAC3D,YAAY,MAAmB;QAC9B,KAAK,CAAC,MAAM,CAAC,CAAA;IACd,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,QAAwB,EAAE,OAAiB;QACvD,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,aAAa,QAAQ,OAAO,EAAE,OAAO,CAAC,CAAA;IAChE,CAAC;IACD,KAAK,CAAC,KAAK,CAAC,IAAqB;QAChC,MAAM,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,SAAS,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;QAC1E,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAgB,YAAY,IAAI,EAAE,CAAC,CAAA;IAC1D,CAAC;CACD"}
1
+ {"version":3,"file":"Treasury.js","sourceRoot":"../","sources":["Treasury/Client/Treasury.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,IAAI,MAAM,cAAc,CAAA;AAIpC,MAAM,OAAO,QAAS,SAAQ,IAAI,CAAC,UAAyB;IAC3D,YAAY,MAAmB;QAC9B,KAAK,CAAC,MAAM,CAAC,CAAA;IACd,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,QAAwB,EAAE,OAAiB;QACvD,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,aAAa,QAAQ,OAAO,EAAE,OAAO,CAAC,CAAA;IAChE,CAAC;IACD,KAAK,CAAC,KAAK,CAAC,IAAqB;QAChC,MAAM,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;QACxC,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAgB,YAAY,IAAI,EAAE,CAAC,CAAA;IAC1D,CAAC;CACD"}
@@ -2,6 +2,7 @@ import { Account } from "../Account";
2
2
  export interface Fiat {
3
3
  safe: number;
4
4
  unsafe: number;
5
+ other: number;
5
6
  total: number;
6
7
  accounts: Account[];
7
8
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pax2pay/model-banking",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "description": "Library containing data model types and functions for the Pax2Pay Banking API.",
5
5
  "author": "Pax2Pay Ltd",
6
6
  "license": "MIT",