@sovryn-zero/lib-base 0.1.0 → 0.2.0

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/dist/index.d.ts CHANGED
@@ -1,14 +1,14 @@
1
- export * from "./src/constants";
2
- export * from "./src/Decimal";
3
- export * from "./src/Trove";
4
- export * from "./src/StabilityDeposit";
5
- export * from "./src/ZEROStake";
6
- export * from "./src/Fees";
7
- export * from "./src/ReadableLiquity";
8
- export * from "./src/ObservableLiquity";
9
- export * from "./src/TransactableLiquity";
10
- export * from "./src/SendableLiquity";
11
- export * from "./src/PopulatableLiquity";
12
- export * from "./src/LiquityStore";
13
- export * from "./src/_CachedReadableLiquity";
1
+ export * from "./src/constants";
2
+ export * from "./src/Decimal";
3
+ export * from "./src/Trove";
4
+ export * from "./src/StabilityDeposit";
5
+ export * from "./src/ZEROStake";
6
+ export * from "./src/Fees";
7
+ export * from "./src/ReadableLiquity";
8
+ export * from "./src/ObservableLiquity";
9
+ export * from "./src/TransactableLiquity";
10
+ export * from "./src/SendableLiquity";
11
+ export * from "./src/PopulatableLiquity";
12
+ export * from "./src/LiquityStore";
13
+ export * from "./src/_CachedReadableLiquity";
14
14
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -1,26 +1,26 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
- }) : (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- o[k2] = m[k];
8
- }));
9
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
- };
12
- Object.defineProperty(exports, "__esModule", { value: true });
13
- __exportStar(require("./src/constants"), exports);
14
- __exportStar(require("./src/Decimal"), exports);
15
- __exportStar(require("./src/Trove"), exports);
16
- __exportStar(require("./src/StabilityDeposit"), exports);
17
- __exportStar(require("./src/ZEROStake"), exports);
18
- __exportStar(require("./src/Fees"), exports);
19
- __exportStar(require("./src/ReadableLiquity"), exports);
20
- __exportStar(require("./src/ObservableLiquity"), exports);
21
- __exportStar(require("./src/TransactableLiquity"), exports);
22
- __exportStar(require("./src/SendableLiquity"), exports);
23
- __exportStar(require("./src/PopulatableLiquity"), exports);
24
- __exportStar(require("./src/LiquityStore"), exports);
25
- __exportStar(require("./src/_CachedReadableLiquity"), exports);
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ __exportStar(require("./src/constants"), exports);
14
+ __exportStar(require("./src/Decimal"), exports);
15
+ __exportStar(require("./src/Trove"), exports);
16
+ __exportStar(require("./src/StabilityDeposit"), exports);
17
+ __exportStar(require("./src/ZEROStake"), exports);
18
+ __exportStar(require("./src/Fees"), exports);
19
+ __exportStar(require("./src/ReadableLiquity"), exports);
20
+ __exportStar(require("./src/ObservableLiquity"), exports);
21
+ __exportStar(require("./src/TransactableLiquity"), exports);
22
+ __exportStar(require("./src/SendableLiquity"), exports);
23
+ __exportStar(require("./src/PopulatableLiquity"), exports);
24
+ __exportStar(require("./src/LiquityStore"), exports);
25
+ __exportStar(require("./src/_CachedReadableLiquity"), exports);
26
26
  //# sourceMappingURL=index.js.map
@@ -1,89 +1,89 @@
1
- /**
2
- * Types that can be converted into a Decimal.
3
- *
4
- * @public
5
- */
6
- export declare type Decimalish = Decimal | number | string;
7
- /**
8
- * Fixed-point decimal bignumber with 18 digits of precision.
9
- *
10
- * @remarks
11
- * Used by Zero libraries to precisely represent native currency (e.g. Ether), ZUSD and ZERO
12
- * amounts, as well as derived metrics like collateral ratios.
13
- *
14
- * @public
15
- */
16
- export declare class Decimal {
17
- static readonly INFINITY: Decimal;
18
- static readonly ZERO: Decimal;
19
- static readonly HALF: Decimal;
20
- static readonly ONE: Decimal;
21
- private readonly _bigNumber;
22
- /** @internal */
23
- get hex(): string;
24
- /** @internal */
25
- get bigNumber(): string;
26
- private constructor();
27
- static fromBigNumberString(bigNumberString: string): Decimal;
28
- private static _fromString;
29
- static from(decimalish: Decimalish): Decimal;
30
- private _toStringWithAutomaticPrecision;
31
- private _roundUp;
32
- private _toStringWithPrecision;
33
- toString(precision?: number): string;
34
- prettify(precision?: number): string;
35
- shorten(): string;
36
- add(addend: Decimalish): Decimal;
37
- sub(subtrahend: Decimalish): Decimal;
38
- mul(multiplier: Decimalish): Decimal;
39
- div(divider: Decimalish): Decimal;
40
- /** @internal */
41
- _divCeil(divider: Decimalish): Decimal;
42
- mulDiv(multiplier: Decimalish, divider: Decimalish): Decimal;
43
- pow(exponent: number): Decimal;
44
- get isZero(): boolean;
45
- get zero(): this | undefined;
46
- get nonZero(): this | undefined;
47
- get infinite(): this | undefined;
48
- get finite(): this | undefined;
49
- /** @internal */
50
- get absoluteValue(): this;
51
- lt(that: Decimalish): boolean;
52
- eq(that: Decimalish): boolean;
53
- gt(that: Decimalish): boolean;
54
- gte(that: Decimalish): boolean;
55
- lte(that: Decimalish): boolean;
56
- static min(a: Decimalish, b: Decimalish): Decimal;
57
- static max(a: Decimalish, b: Decimalish): Decimal;
58
- }
59
- /** @alpha */
60
- export declare class Difference {
61
- private _number?;
62
- private constructor();
63
- static between(d1: Decimalish | undefined, d2: Decimalish | undefined): Difference;
64
- toString(precision?: number): string;
65
- prettify(precision?: number): string;
66
- mul(multiplier: Decimalish): Difference;
67
- get nonZero(): this | undefined;
68
- get positive(): this | undefined;
69
- get negative(): this | undefined;
70
- get absoluteValue(): Decimal | undefined;
71
- get infinite(): this | undefined;
72
- get finite(): this | undefined;
73
- }
74
- /** @alpha */
75
- export declare class Percent<T extends {
76
- infinite?: T | undefined;
77
- absoluteValue?: A | undefined;
78
- mul?(hundred: 100): T;
79
- toString(precision?: number): string;
80
- }, A extends {
81
- gte(n: string): boolean;
82
- }> {
83
- private _percent;
84
- constructor(ratio: T);
85
- nonZeroish(precision: number): this | undefined;
86
- toString(precision: number): string;
87
- prettify(): string;
88
- }
1
+ /**
2
+ * Types that can be converted into a Decimal.
3
+ *
4
+ * @public
5
+ */
6
+ export declare type Decimalish = Decimal | number | string;
7
+ /**
8
+ * Fixed-point decimal bignumber with 18 digits of precision.
9
+ *
10
+ * @remarks
11
+ * Used by Zero libraries to precisely represent native currency (e.g. Ether), ZUSD and ZERO
12
+ * amounts, as well as derived metrics like collateral ratios.
13
+ *
14
+ * @public
15
+ */
16
+ export declare class Decimal {
17
+ static readonly INFINITY: Decimal;
18
+ static readonly ZERO: Decimal;
19
+ static readonly HALF: Decimal;
20
+ static readonly ONE: Decimal;
21
+ private readonly _bigNumber;
22
+ /** @internal */
23
+ get hex(): string;
24
+ /** @internal */
25
+ get bigNumber(): string;
26
+ private constructor();
27
+ static fromBigNumberString(bigNumberString: string): Decimal;
28
+ private static _fromString;
29
+ static from(decimalish: Decimalish): Decimal;
30
+ private _toStringWithAutomaticPrecision;
31
+ private _roundUp;
32
+ private _toStringWithPrecision;
33
+ toString(precision?: number): string;
34
+ prettify(precision?: number): string;
35
+ shorten(): string;
36
+ add(addend: Decimalish): Decimal;
37
+ sub(subtrahend: Decimalish): Decimal;
38
+ mul(multiplier: Decimalish): Decimal;
39
+ div(divider: Decimalish): Decimal;
40
+ /** @internal */
41
+ _divCeil(divider: Decimalish): Decimal;
42
+ mulDiv(multiplier: Decimalish, divider: Decimalish): Decimal;
43
+ pow(exponent: number): Decimal;
44
+ get isZero(): boolean;
45
+ get zero(): this | undefined;
46
+ get nonZero(): this | undefined;
47
+ get infinite(): this | undefined;
48
+ get finite(): this | undefined;
49
+ /** @internal */
50
+ get absoluteValue(): this;
51
+ lt(that: Decimalish): boolean;
52
+ eq(that: Decimalish): boolean;
53
+ gt(that: Decimalish): boolean;
54
+ gte(that: Decimalish): boolean;
55
+ lte(that: Decimalish): boolean;
56
+ static min(a: Decimalish, b: Decimalish): Decimal;
57
+ static max(a: Decimalish, b: Decimalish): Decimal;
58
+ }
59
+ /** @alpha */
60
+ export declare class Difference {
61
+ private _number?;
62
+ private constructor();
63
+ static between(d1: Decimalish | undefined, d2: Decimalish | undefined): Difference;
64
+ toString(precision?: number): string;
65
+ prettify(precision?: number): string;
66
+ mul(multiplier: Decimalish): Difference;
67
+ get nonZero(): this | undefined;
68
+ get positive(): this | undefined;
69
+ get negative(): this | undefined;
70
+ get absoluteValue(): Decimal | undefined;
71
+ get infinite(): this | undefined;
72
+ get finite(): this | undefined;
73
+ }
74
+ /** @alpha */
75
+ export declare class Percent<T extends {
76
+ infinite?: T | undefined;
77
+ absoluteValue?: A | undefined;
78
+ mul?(hundred: 100): T;
79
+ toString(precision?: number): string;
80
+ }, A extends {
81
+ gte(n: string): boolean;
82
+ }> {
83
+ private _percent;
84
+ constructor(ratio: T);
85
+ nonZeroish(precision: number): this | undefined;
86
+ toString(precision: number): string;
87
+ prettify(): string;
88
+ }
89
89
  //# sourceMappingURL=Decimal.d.ts.map