@sovryn-zero/lib-base 0.1.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/.eslintrc.json +17 -0
- package/.mocharc.yml +1 -0
- package/LICENSE +905 -0
- package/README.md +23 -0
- package/api-extractor.json +4 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +26 -0
- package/dist/index.js.map +1 -0
- package/dist/src/Decimal.d.ts +89 -0
- package/dist/src/Decimal.d.ts.map +1 -0
- package/dist/src/Decimal.js +361 -0
- package/dist/src/Decimal.js.map +1 -0
- package/dist/src/Fees.d.ts +82 -0
- package/dist/src/Fees.d.ts.map +1 -0
- package/dist/src/Fees.js +123 -0
- package/dist/src/Fees.js.map +1 -0
- package/dist/src/LiquityStore.d.ts +209 -0
- package/dist/src/LiquityStore.d.ts.map +1 -0
- package/dist/src/LiquityStore.js +209 -0
- package/dist/src/LiquityStore.js.map +1 -0
- package/dist/src/ObservableLiquity.d.ts +15 -0
- package/dist/src/ObservableLiquity.d.ts.map +1 -0
- package/dist/src/ObservableLiquity.js +3 -0
- package/dist/src/ObservableLiquity.js.map +1 -0
- package/dist/src/PopulatableLiquity.d.ts +125 -0
- package/dist/src/PopulatableLiquity.d.ts.map +1 -0
- package/dist/src/PopulatableLiquity.js +3 -0
- package/dist/src/PopulatableLiquity.js.map +1 -0
- package/dist/src/ReadableLiquity.d.ts +156 -0
- package/dist/src/ReadableLiquity.d.ts.map +1 -0
- package/dist/src/ReadableLiquity.js +3 -0
- package/dist/src/ReadableLiquity.js.map +1 -0
- package/dist/src/SendableLiquity.d.ts +156 -0
- package/dist/src/SendableLiquity.d.ts.map +1 -0
- package/dist/src/SendableLiquity.js +20 -0
- package/dist/src/SendableLiquity.js.map +1 -0
- package/dist/src/StabilityDeposit.d.ts +59 -0
- package/dist/src/StabilityDeposit.d.ts.map +1 -0
- package/dist/src/StabilityDeposit.js +80 -0
- package/dist/src/StabilityDeposit.js.map +1 -0
- package/dist/src/TransactableLiquity.d.ts +414 -0
- package/dist/src/TransactableLiquity.d.ts.map +1 -0
- package/dist/src/TransactableLiquity.js +18 -0
- package/dist/src/TransactableLiquity.js.map +1 -0
- package/dist/src/Trove.d.ts +367 -0
- package/dist/src/Trove.d.ts.map +1 -0
- package/dist/src/Trove.js +423 -0
- package/dist/src/Trove.js.map +1 -0
- package/dist/src/ZEROStake.d.ts +52 -0
- package/dist/src/ZEROStake.d.ts.map +1 -0
- package/dist/src/ZEROStake.js +74 -0
- package/dist/src/ZEROStake.js.map +1 -0
- package/dist/src/_CachedReadableLiquity.d.ts +55 -0
- package/dist/src/_CachedReadableLiquity.d.ts.map +1 -0
- package/dist/src/_CachedReadableLiquity.js +93 -0
- package/dist/src/_CachedReadableLiquity.js.map +1 -0
- package/dist/src/constants.d.ts +61 -0
- package/dist/src/constants.d.ts.map +1 -0
- package/dist/src/constants.js +64 -0
- package/dist/src/constants.js.map +1 -0
- package/dist/tsdoc-metadata.json +11 -0
- package/etc/lib-base.api.md +788 -0
- package/index.ts +13 -0
- package/package.json +52 -0
- package/src/Decimal.ts +456 -0
- package/src/Fees.ts +160 -0
- package/src/LiquityStore.ts +563 -0
- package/src/ObservableLiquity.ts +32 -0
- package/src/PopulatableLiquity.ts +280 -0
- package/src/ReadableLiquity.ts +175 -0
- package/src/SendableLiquity.ts +251 -0
- package/src/StabilityDeposit.ts +126 -0
- package/src/TransactableLiquity.ts +471 -0
- package/src/Trove.ts +824 -0
- package/src/ZEROStake.ts +99 -0
- package/src/_CachedReadableLiquity.ts +186 -0
- package/src/constants.ts +68 -0
- package/test/Decimal.test.ts +212 -0
- package/test/StabilityDeposit.test.ts +30 -0
- package/test/Trove.test.ts +143 -0
- package/test/ZEROStake.test.ts +24 -0
- package/tsconfig.dist.json +8 -0
- package/tsconfig.json +5 -0
@@ -0,0 +1,93 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports._CachedReadableLiquity = void 0;
|
4
|
+
/** @internal */
|
5
|
+
class _CachedReadableLiquity {
|
6
|
+
constructor(readable, cache) {
|
7
|
+
this._readable = readable;
|
8
|
+
this._cache = cache;
|
9
|
+
}
|
10
|
+
async getTotalRedistributed(...extraParams) {
|
11
|
+
var _a;
|
12
|
+
return ((_a = this._cache.getTotalRedistributed(...extraParams)) !== null && _a !== void 0 ? _a : this._readable.getTotalRedistributed(...extraParams));
|
13
|
+
}
|
14
|
+
async getTroveBeforeRedistribution(address, ...extraParams) {
|
15
|
+
var _a;
|
16
|
+
return ((_a = this._cache.getTroveBeforeRedistribution(address, ...extraParams)) !== null && _a !== void 0 ? _a : this._readable.getTroveBeforeRedistribution(address, ...extraParams));
|
17
|
+
}
|
18
|
+
async getTrove(address, ...extraParams) {
|
19
|
+
const [troveBeforeRedistribution, totalRedistributed] = await Promise.all([
|
20
|
+
this.getTroveBeforeRedistribution(address, ...extraParams),
|
21
|
+
this.getTotalRedistributed(...extraParams)
|
22
|
+
]);
|
23
|
+
return troveBeforeRedistribution.applyRedistribution(totalRedistributed);
|
24
|
+
}
|
25
|
+
async getNumberOfTroves(...extraParams) {
|
26
|
+
var _a;
|
27
|
+
return ((_a = this._cache.getNumberOfTroves(...extraParams)) !== null && _a !== void 0 ? _a : this._readable.getNumberOfTroves(...extraParams));
|
28
|
+
}
|
29
|
+
async getPrice(...extraParams) {
|
30
|
+
var _a;
|
31
|
+
return (_a = this._cache.getPrice(...extraParams)) !== null && _a !== void 0 ? _a : this._readable.getPrice(...extraParams);
|
32
|
+
}
|
33
|
+
async getTotal(...extraParams) {
|
34
|
+
var _a;
|
35
|
+
return (_a = this._cache.getTotal(...extraParams)) !== null && _a !== void 0 ? _a : this._readable.getTotal(...extraParams);
|
36
|
+
}
|
37
|
+
async getStabilityDeposit(address, ...extraParams) {
|
38
|
+
var _a;
|
39
|
+
return ((_a = this._cache.getStabilityDeposit(address, ...extraParams)) !== null && _a !== void 0 ? _a : this._readable.getStabilityDeposit(address, ...extraParams));
|
40
|
+
}
|
41
|
+
async getRemainingStabilityPoolZEROReward(...extraParams) {
|
42
|
+
var _a;
|
43
|
+
return ((_a = this._cache.getRemainingStabilityPoolZEROReward(...extraParams)) !== null && _a !== void 0 ? _a : this._readable.getRemainingStabilityPoolZEROReward(...extraParams));
|
44
|
+
}
|
45
|
+
async getZUSDInStabilityPool(...extraParams) {
|
46
|
+
var _a;
|
47
|
+
return ((_a = this._cache.getZUSDInStabilityPool(...extraParams)) !== null && _a !== void 0 ? _a : this._readable.getZUSDInStabilityPool(...extraParams));
|
48
|
+
}
|
49
|
+
async getZUSDBalance(address, ...extraParams) {
|
50
|
+
var _a;
|
51
|
+
return ((_a = this._cache.getZUSDBalance(address, ...extraParams)) !== null && _a !== void 0 ? _a : this._readable.getZUSDBalance(address, ...extraParams));
|
52
|
+
}
|
53
|
+
async getZEROBalance(address, ...extraParams) {
|
54
|
+
var _a;
|
55
|
+
return ((_a = this._cache.getZEROBalance(address, ...extraParams)) !== null && _a !== void 0 ? _a : this._readable.getZEROBalance(address, ...extraParams));
|
56
|
+
}
|
57
|
+
async getCollateralSurplusBalance(address, ...extraParams) {
|
58
|
+
var _a;
|
59
|
+
return ((_a = this._cache.getCollateralSurplusBalance(address, ...extraParams)) !== null && _a !== void 0 ? _a : this._readable.getCollateralSurplusBalance(address, ...extraParams));
|
60
|
+
}
|
61
|
+
async getTroves(params, ...extraParams) {
|
62
|
+
var _a;
|
63
|
+
const { beforeRedistribution, ...restOfParams } = params;
|
64
|
+
const [totalRedistributed, troves] = await Promise.all([
|
65
|
+
beforeRedistribution ? undefined : this.getTotalRedistributed(...extraParams),
|
66
|
+
(_a = this._cache.getTroves({ beforeRedistribution: true, ...restOfParams }, ...extraParams)) !== null && _a !== void 0 ? _a : this._readable.getTroves({ beforeRedistribution: true, ...restOfParams }, ...extraParams)
|
67
|
+
]);
|
68
|
+
if (totalRedistributed) {
|
69
|
+
return troves.map(trove => trove.applyRedistribution(totalRedistributed));
|
70
|
+
}
|
71
|
+
else {
|
72
|
+
return troves;
|
73
|
+
}
|
74
|
+
}
|
75
|
+
async getFees(...extraParams) {
|
76
|
+
var _a;
|
77
|
+
return (_a = this._cache.getFees(...extraParams)) !== null && _a !== void 0 ? _a : this._readable.getFees(...extraParams);
|
78
|
+
}
|
79
|
+
async getZEROStake(address, ...extraParams) {
|
80
|
+
var _a;
|
81
|
+
return ((_a = this._cache.getZEROStake(address, ...extraParams)) !== null && _a !== void 0 ? _a : this._readable.getZEROStake(address, ...extraParams));
|
82
|
+
}
|
83
|
+
async getTotalStakedZERO(...extraParams) {
|
84
|
+
var _a;
|
85
|
+
return ((_a = this._cache.getTotalStakedZERO(...extraParams)) !== null && _a !== void 0 ? _a : this._readable.getTotalStakedZERO(...extraParams));
|
86
|
+
}
|
87
|
+
async getFrontendStatus(address, ...extraParams) {
|
88
|
+
var _a;
|
89
|
+
return ((_a = this._cache.getFrontendStatus(address, ...extraParams)) !== null && _a !== void 0 ? _a : this._readable.getFrontendStatus(address, ...extraParams));
|
90
|
+
}
|
91
|
+
}
|
92
|
+
exports._CachedReadableLiquity = _CachedReadableLiquity;
|
93
|
+
//# sourceMappingURL=_CachedReadableLiquity.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"_CachedReadableLiquity.js","sourceRoot":"","sources":["../../src/_CachedReadableLiquity.ts"],"names":[],"mappings":";;;AA4CA,gBAAgB;AAChB,MAAa,sBAAsB;IAKjC,YAAY,QAA4C,EAAE,KAA2B;QACnF,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACtB,CAAC;IAED,KAAK,CAAC,qBAAqB,CAAC,GAAG,WAAc;;QAC3C,OAAO,OACL,IAAI,CAAC,MAAM,CAAC,qBAAqB,CAAC,GAAG,WAAW,CAAC,mCACjD,IAAI,CAAC,SAAS,CAAC,qBAAqB,CAAC,GAAG,WAAW,CAAC,CAC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Y,CAAC,OAAO,EAAE,GAAG,WAAW,CAAC,CACrD,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,kBAAkB,CAAC,GAAG,WAAc;;QACxC,OAAO,OACL,IAAI,CAAC,MAAM,CAAC,kBAAkB,CAAC,GAAG,WAAW,CAAC,mCAC9C,IAAI,CAAC,SAAS,CAAC,kBAAkB,CAAC,GAAG,WAAW,CAAC,CAClD,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,iBAAiB,CAAC,OAAgB,EAAE,GAAG,WAAc;;QACzD,OAAO,OACL,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,OAAO,EAAE,GAAG,WAAW,CAAC,mCACtD,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAC,OAAO,EAAE,GAAG,WAAW,CAAC,CAC1D,CAAC;IACJ,CAAC;CACF;AA5ID,wDA4IC"}
|
@@ -0,0 +1,61 @@
|
|
1
|
+
import { Decimal } from "./Decimal";
|
2
|
+
/**
|
3
|
+
* Total collateral ratio below which recovery mode is triggered.
|
4
|
+
*
|
5
|
+
* @public
|
6
|
+
*/
|
7
|
+
export declare const CRITICAL_COLLATERAL_RATIO: Decimal;
|
8
|
+
/**
|
9
|
+
* Collateral ratio below which a Trove can be liquidated in normal mode.
|
10
|
+
*
|
11
|
+
* @public
|
12
|
+
*/
|
13
|
+
export declare const MINIMUM_COLLATERAL_RATIO: Decimal;
|
14
|
+
/**
|
15
|
+
* Amount of ZUSD that's reserved for compensating the liquidator of a Trove.
|
16
|
+
*
|
17
|
+
* @public
|
18
|
+
*/
|
19
|
+
export declare const ZUSD_LIQUIDATION_RESERVE: Decimal;
|
20
|
+
/**
|
21
|
+
* A Trove must always have at least this much debt on top of the
|
22
|
+
* {@link ZUSD_LIQUIDATION_RESERVE | liquidation reserve}.
|
23
|
+
*
|
24
|
+
* @remarks
|
25
|
+
* Any transaction that would result in a Trove with less net debt than this will be reverted.
|
26
|
+
*
|
27
|
+
* @public
|
28
|
+
*/
|
29
|
+
export declare const ZUSD_MINIMUM_NET_DEBT: Decimal;
|
30
|
+
/**
|
31
|
+
* A Trove must always have at least this much debt.
|
32
|
+
*
|
33
|
+
* @remarks
|
34
|
+
* Any transaction that would result in a Trove with less debt than this will be reverted.
|
35
|
+
*
|
36
|
+
* @public
|
37
|
+
*/
|
38
|
+
export declare const ZUSD_MINIMUM_DEBT: Decimal;
|
39
|
+
/**
|
40
|
+
* Value that the {@link Fees.borrowingRate | borrowing rate} will never decay below.
|
41
|
+
*
|
42
|
+
* @remarks
|
43
|
+
* Note that the borrowing rate can still be lower than this during recovery mode, when it's
|
44
|
+
* overridden by zero.
|
45
|
+
*
|
46
|
+
* @public
|
47
|
+
*/
|
48
|
+
export declare const MINIMUM_BORROWING_RATE: Decimal;
|
49
|
+
/**
|
50
|
+
* Value that the {@link Fees.borrowingRate | borrowing rate} will never exceed.
|
51
|
+
*
|
52
|
+
* @public
|
53
|
+
*/
|
54
|
+
export declare const MAXIMUM_BORROWING_RATE: Decimal;
|
55
|
+
/**
|
56
|
+
* Value that the {@link Fees.redemptionRate | redemption rate} will never decay below.
|
57
|
+
*
|
58
|
+
* @public
|
59
|
+
*/
|
60
|
+
export declare const MINIMUM_REDEMPTION_RATE: Decimal;
|
61
|
+
//# sourceMappingURL=constants.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,SAAoB,CAAC;AAE3D;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,SAAoB,CAAC;AAE1D;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,SAAmB,CAAC;AAEzD;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB,SAAoB,CAAC;AAEvD;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,SAAsD,CAAC;AAErF;;;;;;;;GAQG;AACH,eAAO,MAAM,sBAAsB,SAAsB,CAAC;AAE1D;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,SAAqB,CAAC;AAEzD;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,SAAsB,CAAC"}
|
@@ -0,0 +1,64 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.MINIMUM_REDEMPTION_RATE = exports.MAXIMUM_BORROWING_RATE = exports.MINIMUM_BORROWING_RATE = exports.ZUSD_MINIMUM_DEBT = exports.ZUSD_MINIMUM_NET_DEBT = exports.ZUSD_LIQUIDATION_RESERVE = exports.MINIMUM_COLLATERAL_RATIO = exports.CRITICAL_COLLATERAL_RATIO = void 0;
|
4
|
+
const Decimal_1 = require("./Decimal");
|
5
|
+
/**
|
6
|
+
* Total collateral ratio below which recovery mode is triggered.
|
7
|
+
*
|
8
|
+
* @public
|
9
|
+
*/
|
10
|
+
exports.CRITICAL_COLLATERAL_RATIO = Decimal_1.Decimal.from(1.5);
|
11
|
+
/**
|
12
|
+
* Collateral ratio below which a Trove can be liquidated in normal mode.
|
13
|
+
*
|
14
|
+
* @public
|
15
|
+
*/
|
16
|
+
exports.MINIMUM_COLLATERAL_RATIO = Decimal_1.Decimal.from(1.1);
|
17
|
+
/**
|
18
|
+
* Amount of ZUSD that's reserved for compensating the liquidator of a Trove.
|
19
|
+
*
|
20
|
+
* @public
|
21
|
+
*/
|
22
|
+
exports.ZUSD_LIQUIDATION_RESERVE = Decimal_1.Decimal.from(20);
|
23
|
+
/**
|
24
|
+
* A Trove must always have at least this much debt on top of the
|
25
|
+
* {@link ZUSD_LIQUIDATION_RESERVE | liquidation reserve}.
|
26
|
+
*
|
27
|
+
* @remarks
|
28
|
+
* Any transaction that would result in a Trove with less net debt than this will be reverted.
|
29
|
+
*
|
30
|
+
* @public
|
31
|
+
*/
|
32
|
+
exports.ZUSD_MINIMUM_NET_DEBT = Decimal_1.Decimal.from(180);
|
33
|
+
/**
|
34
|
+
* A Trove must always have at least this much debt.
|
35
|
+
*
|
36
|
+
* @remarks
|
37
|
+
* Any transaction that would result in a Trove with less debt than this will be reverted.
|
38
|
+
*
|
39
|
+
* @public
|
40
|
+
*/
|
41
|
+
exports.ZUSD_MINIMUM_DEBT = exports.ZUSD_LIQUIDATION_RESERVE.add(exports.ZUSD_MINIMUM_NET_DEBT);
|
42
|
+
/**
|
43
|
+
* Value that the {@link Fees.borrowingRate | borrowing rate} will never decay below.
|
44
|
+
*
|
45
|
+
* @remarks
|
46
|
+
* Note that the borrowing rate can still be lower than this during recovery mode, when it's
|
47
|
+
* overridden by zero.
|
48
|
+
*
|
49
|
+
* @public
|
50
|
+
*/
|
51
|
+
exports.MINIMUM_BORROWING_RATE = Decimal_1.Decimal.from(0.025);
|
52
|
+
/**
|
53
|
+
* Value that the {@link Fees.borrowingRate | borrowing rate} will never exceed.
|
54
|
+
*
|
55
|
+
* @public
|
56
|
+
*/
|
57
|
+
exports.MAXIMUM_BORROWING_RATE = Decimal_1.Decimal.from(0.05);
|
58
|
+
/**
|
59
|
+
* Value that the {@link Fees.redemptionRate | redemption rate} will never decay below.
|
60
|
+
*
|
61
|
+
* @public
|
62
|
+
*/
|
63
|
+
exports.MINIMUM_REDEMPTION_RATE = Decimal_1.Decimal.from(0.025);
|
64
|
+
//# sourceMappingURL=constants.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":";;;AAAA,uCAAoC;AAEpC;;;;GAIG;AACU,QAAA,yBAAyB,GAAG,iBAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAE3D;;;;GAIG;AACU,QAAA,wBAAwB,GAAG,iBAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAE1D;;;;GAIG;AACU,QAAA,wBAAwB,GAAG,iBAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAEzD;;;;;;;;GAQG;AACU,QAAA,qBAAqB,GAAG,iBAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAEvD;;;;;;;GAOG;AACU,QAAA,iBAAiB,GAAG,gCAAwB,CAAC,GAAG,CAAC,6BAAqB,CAAC,CAAC;AAErF;;;;;;;;GAQG;AACU,QAAA,sBAAsB,GAAG,iBAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAE1D;;;;GAIG;AACU,QAAA,sBAAsB,GAAG,iBAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAEzD;;;;GAIG;AACU,QAAA,uBAAuB,GAAG,iBAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC"}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
// This file is read by tools that parse documentation comments conforming to the TSDoc standard.
|
2
|
+
// It should be published with your NPM package. It should not be tracked by Git.
|
3
|
+
{
|
4
|
+
"tsdocVersion": "0.12",
|
5
|
+
"toolPackages": [
|
6
|
+
{
|
7
|
+
"packageName": "@microsoft/api-extractor",
|
8
|
+
"packageVersion": "7.13.2"
|
9
|
+
}
|
10
|
+
]
|
11
|
+
}
|