@sovryn-zero/lib-base 0.1.0 → 0.2.1
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 +13 -13
- package/dist/index.js +25 -25
- package/dist/src/Decimal.d.ts +88 -88
- package/dist/src/Decimal.js +360 -360
- package/dist/src/Fees.d.ts +81 -81
- package/dist/src/Fees.js +122 -122
- package/dist/src/LiquityStore.d.ts +208 -208
- package/dist/src/LiquityStore.js +208 -208
- package/dist/src/ObservableLiquity.d.ts +14 -14
- package/dist/src/ObservableLiquity.js +2 -2
- package/dist/src/PopulatableLiquity.d.ts +124 -124
- package/dist/src/PopulatableLiquity.js +2 -2
- package/dist/src/ReadableLiquity.d.ts +155 -155
- package/dist/src/ReadableLiquity.js +2 -2
- package/dist/src/SendableLiquity.d.ts +155 -155
- package/dist/src/SendableLiquity.js +19 -19
- package/dist/src/StabilityDeposit.d.ts +58 -58
- package/dist/src/StabilityDeposit.js +79 -79
- package/dist/src/TransactableLiquity.d.ts +413 -413
- package/dist/src/TransactableLiquity.js +17 -17
- package/dist/src/Trove.d.ts +366 -366
- package/dist/src/Trove.js +422 -422
- package/dist/src/ZEROStake.d.ts +51 -51
- package/dist/src/ZEROStake.js +73 -73
- package/dist/src/_CachedReadableLiquity.d.ts +54 -54
- package/dist/src/_CachedReadableLiquity.js +92 -92
- package/dist/src/constants.d.ts +60 -60
- package/dist/src/constants.d.ts.map +1 -1
- package/dist/src/constants.js +63 -63
- package/dist/src/constants.js.map +1 -1
- package/package.json +2 -2
- package/src/constants.ts +3 -3
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
|
package/dist/src/Decimal.d.ts
CHANGED
@@ -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
|