@defisaver/positions-sdk 0.0.198 → 0.0.199-dev-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/.mocharc.json +4 -4
- package/.nvmrc +1 -1
- package/README.md +69 -69
- package/cjs/config/contracts.d.ts +126 -4
- package/cjs/config/contracts.js +14 -0
- package/cjs/contracts.d.ts +1 -0
- package/cjs/contracts.js +2 -1
- package/cjs/helpers/index.d.ts +1 -0
- package/cjs/helpers/index.js +2 -1
- package/cjs/helpers/liquityV2Helpers/index.d.ts +12 -0
- package/cjs/helpers/liquityV2Helpers/index.js +63 -0
- package/cjs/helpers/morphoBlueHelpers/index.js +66 -66
- package/cjs/index.d.ts +2 -1
- package/cjs/index.js +3 -1
- package/cjs/liquityV2/index.d.ts +18 -0
- package/cjs/liquityV2/index.js +186 -0
- package/cjs/markets/aave/marketAssets.js +2 -4
- package/cjs/markets/index.d.ts +1 -0
- package/cjs/markets/index.js +3 -1
- package/cjs/markets/liquityV2/index.d.ts +10 -0
- package/cjs/markets/liquityV2/index.js +47 -0
- package/cjs/moneymarket/moneymarketCommonService.js +1 -1
- package/cjs/types/contracts/generated/LiquityV2CollSurplusPool.d.ts +64 -0
- package/cjs/types/contracts/generated/LiquityV2CollSurplusPool.js +5 -0
- package/cjs/types/contracts/generated/LiquityV2TroveNFT.d.ts +73 -0
- package/cjs/types/contracts/generated/LiquityV2TroveNFT.js +5 -0
- package/cjs/types/contracts/generated/LiquityV2View.d.ts +244 -0
- package/cjs/types/contracts/generated/LiquityV2View.js +5 -0
- package/cjs/types/contracts/generated/index.d.ts +3 -0
- package/cjs/types/index.d.ts +1 -0
- package/cjs/types/index.js +1 -0
- package/cjs/types/liquityV2.d.ts +111 -0
- package/cjs/types/liquityV2.js +24 -0
- package/esm/config/contracts.d.ts +126 -4
- package/esm/config/contracts.js +14 -0
- package/esm/contracts.d.ts +1 -0
- package/esm/contracts.js +1 -0
- package/esm/helpers/index.d.ts +1 -0
- package/esm/helpers/index.js +1 -0
- package/esm/helpers/liquityV2Helpers/index.d.ts +12 -0
- package/esm/helpers/liquityV2Helpers/index.js +55 -0
- package/esm/helpers/morphoBlueHelpers/index.js +66 -66
- package/esm/index.d.ts +2 -1
- package/esm/index.js +2 -1
- package/esm/liquityV2/index.d.ts +18 -0
- package/esm/liquityV2/index.js +175 -0
- package/esm/markets/aave/marketAssets.js +2 -4
- package/esm/markets/index.d.ts +1 -0
- package/esm/markets/index.js +1 -0
- package/esm/markets/liquityV2/index.d.ts +10 -0
- package/esm/markets/liquityV2/index.js +40 -0
- package/esm/moneymarket/moneymarketCommonService.js +1 -1
- package/esm/types/contracts/generated/LiquityV2CollSurplusPool.d.ts +64 -0
- package/esm/types/contracts/generated/LiquityV2CollSurplusPool.js +4 -0
- package/esm/types/contracts/generated/LiquityV2TroveNFT.d.ts +73 -0
- package/esm/types/contracts/generated/LiquityV2TroveNFT.js +4 -0
- package/esm/types/contracts/generated/LiquityV2View.d.ts +244 -0
- package/esm/types/contracts/generated/LiquityV2View.js +4 -0
- package/esm/types/contracts/generated/index.d.ts +3 -0
- package/esm/types/index.d.ts +1 -0
- package/esm/types/index.js +1 -0
- package/esm/types/liquityV2.d.ts +111 -0
- package/esm/types/liquityV2.js +21 -0
- package/package.json +49 -49
- package/src/aaveV2/index.ts +227 -227
- package/src/aaveV3/index.ts +625 -625
- package/src/assets/index.ts +60 -60
- package/src/chickenBonds/index.ts +123 -123
- package/src/compoundV2/index.ts +220 -220
- package/src/compoundV3/index.ts +291 -291
- package/src/config/contracts.js +1109 -1095
- package/src/constants/index.ts +6 -6
- package/src/contracts.ts +133 -132
- package/src/curveUsd/index.ts +229 -229
- package/src/eulerV2/index.ts +303 -303
- package/src/exchange/index.ts +17 -17
- package/src/helpers/aaveHelpers/index.ts +198 -198
- package/src/helpers/chickenBondsHelpers/index.ts +23 -23
- package/src/helpers/compoundHelpers/index.ts +246 -246
- package/src/helpers/curveUsdHelpers/index.ts +40 -40
- package/src/helpers/eulerHelpers/index.ts +232 -232
- package/src/helpers/index.ts +10 -9
- package/src/helpers/liquityV2Helpers/index.ts +80 -0
- package/src/helpers/llamaLendHelpers/index.ts +53 -53
- package/src/helpers/makerHelpers/index.ts +94 -94
- package/src/helpers/morphoBlueHelpers/index.ts +365 -365
- package/src/helpers/sparkHelpers/index.ts +150 -150
- package/src/index.ts +50 -48
- package/src/liquity/index.ts +116 -116
- package/src/liquityV2/index.ts +219 -0
- package/src/llamaLend/index.ts +275 -275
- package/src/maker/index.ts +117 -117
- package/src/markets/aave/index.ts +152 -152
- package/src/markets/aave/marketAssets.ts +44 -46
- package/src/markets/compound/index.ts +213 -213
- package/src/markets/compound/marketsAssets.ts +82 -82
- package/src/markets/curveUsd/index.ts +69 -69
- package/src/markets/euler/index.ts +26 -26
- package/src/markets/index.ts +24 -24
- package/src/markets/liquityV2/index.ts +44 -0
- package/src/markets/llamaLend/contractAddresses.ts +141 -141
- package/src/markets/llamaLend/index.ts +235 -235
- package/src/markets/morphoBlue/index.ts +895 -895
- package/src/markets/spark/index.ts +29 -29
- package/src/markets/spark/marketAssets.ts +10 -10
- package/src/moneymarket/moneymarketCommonService.ts +80 -80
- package/src/morphoAaveV2/index.ts +256 -256
- package/src/morphoAaveV3/index.ts +631 -631
- package/src/morphoBlue/index.ts +204 -204
- package/src/multicall/index.ts +22 -22
- package/src/services/dsrService.ts +15 -15
- package/src/services/priceService.ts +62 -62
- package/src/services/utils.ts +56 -56
- package/src/setup.ts +8 -8
- package/src/spark/index.ts +461 -461
- package/src/staking/staking.ts +220 -220
- package/src/types/aave.ts +271 -271
- package/src/types/chickenBonds.ts +45 -45
- package/src/types/common.ts +84 -84
- package/src/types/compound.ts +131 -131
- package/src/types/contracts/generated/LiquityV2CollSurplusPool.ts +130 -0
- package/src/types/contracts/generated/LiquityV2TroveNFT.ts +150 -0
- package/src/types/contracts/generated/LiquityV2View.ts +315 -0
- package/src/types/contracts/generated/index.ts +3 -0
- package/src/types/curveUsd.ts +118 -118
- package/src/types/euler.ts +171 -171
- package/src/types/index.ts +10 -9
- package/src/types/liquity.ts +30 -30
- package/src/types/liquityV2.ts +119 -0
- package/src/types/llamaLend.ts +155 -155
- package/src/types/maker.ts +50 -50
- package/src/types/morphoBlue.ts +192 -192
- package/src/types/spark.ts +131 -131
|
@@ -36,6 +36,9 @@ export type { IVariableDebtToken } from "./IVariableDebtToken";
|
|
|
36
36
|
export type { LendingPoolAddressesProvider } from "./LendingPoolAddressesProvider";
|
|
37
37
|
export type { Lido } from "./Lido";
|
|
38
38
|
export type { LiquityActivePool } from "./LiquityActivePool";
|
|
39
|
+
export type { LiquityV2CollSurplusPool } from "./LiquityV2CollSurplusPool";
|
|
40
|
+
export type { LiquityV2TroveNFT } from "./LiquityV2TroveNFT";
|
|
41
|
+
export type { LiquityV2View } from "./LiquityV2View";
|
|
39
42
|
export type { LiquityView } from "./LiquityView";
|
|
40
43
|
export type { LlamaLendControllerAbi } from "./LlamaLendControllerAbi";
|
|
41
44
|
export type { LlamaLendView } from "./LlamaLendView";
|
package/esm/types/index.d.ts
CHANGED
package/esm/types/index.js
CHANGED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { EthAddress, NetworkNumber } from './common';
|
|
2
|
+
export declare enum LiquityV2Versions {
|
|
3
|
+
LiquityV2Eth = "liquityv2eth",
|
|
4
|
+
LiquityV2WstEth = "liquityv2wsteth",
|
|
5
|
+
LiquityV2REth = "liquityv2reth"
|
|
6
|
+
}
|
|
7
|
+
export declare enum LIQUITY_V2_TROVE_STATUS_ENUM {
|
|
8
|
+
nonExistent = 0,
|
|
9
|
+
active = 1,
|
|
10
|
+
closedByOwner = 2,
|
|
11
|
+
closedByLiquidation = 3,
|
|
12
|
+
zombie = 4
|
|
13
|
+
}
|
|
14
|
+
export declare const LIQUITY_V2_STATUS_MAPPING: {
|
|
15
|
+
nonExistent: string;
|
|
16
|
+
active: string;
|
|
17
|
+
closedByOwner: string;
|
|
18
|
+
closedByLiquidation: string;
|
|
19
|
+
zombie: string;
|
|
20
|
+
};
|
|
21
|
+
export interface LiquityV2MarketInfo {
|
|
22
|
+
chainIds: NetworkNumber[];
|
|
23
|
+
label: string;
|
|
24
|
+
shortLabel: string;
|
|
25
|
+
url: string;
|
|
26
|
+
value: LiquityV2Versions;
|
|
27
|
+
debtToken: string;
|
|
28
|
+
collateralToken: string;
|
|
29
|
+
marketAddress: string;
|
|
30
|
+
protocolName: string;
|
|
31
|
+
}
|
|
32
|
+
export interface LiquityV2AssetData {
|
|
33
|
+
symbol: string;
|
|
34
|
+
address: string;
|
|
35
|
+
price: string;
|
|
36
|
+
incentiveSupplyApy?: string;
|
|
37
|
+
incentiveSupplyToken?: string;
|
|
38
|
+
totalSupply: string;
|
|
39
|
+
totalBorrow: string;
|
|
40
|
+
canBeSupplied: boolean;
|
|
41
|
+
canBeBorrowed: boolean;
|
|
42
|
+
leftToBorrowGlobal: string;
|
|
43
|
+
leftToWithdrawGlobal: string;
|
|
44
|
+
}
|
|
45
|
+
export type LiquityV2AssetsData = {
|
|
46
|
+
[key: string]: LiquityV2AssetData;
|
|
47
|
+
};
|
|
48
|
+
export interface InnerLiquityV2MarketData {
|
|
49
|
+
minCollRatio: string;
|
|
50
|
+
totalCollRatio: string;
|
|
51
|
+
criticalCollRatio: string;
|
|
52
|
+
isUnderCollateralized: boolean;
|
|
53
|
+
hintHelperAddress: EthAddress;
|
|
54
|
+
troveNFTAddress: EthAddress;
|
|
55
|
+
borrowerOperationsAddress: EthAddress;
|
|
56
|
+
troveManagerAddress: EthAddress;
|
|
57
|
+
stabilityPoolAddress: EthAddress;
|
|
58
|
+
collSurplusPoolAddress: EthAddress;
|
|
59
|
+
activePoolAddress: EthAddress;
|
|
60
|
+
}
|
|
61
|
+
export interface LiquityV2MarketData {
|
|
62
|
+
assetsData: LiquityV2AssetsData;
|
|
63
|
+
marketData: InnerLiquityV2MarketData;
|
|
64
|
+
}
|
|
65
|
+
export interface LiquityV2UsedAsset {
|
|
66
|
+
symbol: string;
|
|
67
|
+
collateral?: boolean;
|
|
68
|
+
supplied: string;
|
|
69
|
+
suppliedUsd: string;
|
|
70
|
+
borrowed: string;
|
|
71
|
+
borrowedUsd: string;
|
|
72
|
+
isSupplied: boolean;
|
|
73
|
+
isBorrowed: boolean;
|
|
74
|
+
}
|
|
75
|
+
export type LiquityV2UsedAssets = {
|
|
76
|
+
[key: string]: LiquityV2UsedAsset;
|
|
77
|
+
};
|
|
78
|
+
export interface LiquityV2AggregatedTroveData {
|
|
79
|
+
suppliedUsd: string;
|
|
80
|
+
borrowedUsd: string;
|
|
81
|
+
borrowLimitUsd: string;
|
|
82
|
+
leftToBorrowUsd: string;
|
|
83
|
+
netApy: string;
|
|
84
|
+
incentiveUsd: string;
|
|
85
|
+
totalInterestUsd: string;
|
|
86
|
+
leveragedType: string;
|
|
87
|
+
leveragedAsset: string;
|
|
88
|
+
liquidationPrice: string;
|
|
89
|
+
ratio: string;
|
|
90
|
+
collRatio: string;
|
|
91
|
+
}
|
|
92
|
+
export interface LiquityV2TroveData {
|
|
93
|
+
usedAssets: LiquityV2UsedAssets;
|
|
94
|
+
troveId: string;
|
|
95
|
+
ratio: string;
|
|
96
|
+
collRatio: string;
|
|
97
|
+
interestRate: string;
|
|
98
|
+
leftToBorrowUsd: string;
|
|
99
|
+
borrowLimitUsd: string;
|
|
100
|
+
suppliedUsd: string;
|
|
101
|
+
borrowedUsd: string;
|
|
102
|
+
netApy: string;
|
|
103
|
+
incentiveUsd: string;
|
|
104
|
+
totalInterestUsd: string;
|
|
105
|
+
interestBatchManager: EthAddress;
|
|
106
|
+
troveStatus: string;
|
|
107
|
+
leveragedType: string;
|
|
108
|
+
leveragedAsset: string;
|
|
109
|
+
liquidationPrice: string;
|
|
110
|
+
debtInFront: string;
|
|
111
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export var LiquityV2Versions;
|
|
2
|
+
(function (LiquityV2Versions) {
|
|
3
|
+
LiquityV2Versions["LiquityV2Eth"] = "liquityv2eth";
|
|
4
|
+
LiquityV2Versions["LiquityV2WstEth"] = "liquityv2wsteth";
|
|
5
|
+
LiquityV2Versions["LiquityV2REth"] = "liquityv2reth";
|
|
6
|
+
})(LiquityV2Versions || (LiquityV2Versions = {}));
|
|
7
|
+
export var LIQUITY_V2_TROVE_STATUS_ENUM;
|
|
8
|
+
(function (LIQUITY_V2_TROVE_STATUS_ENUM) {
|
|
9
|
+
LIQUITY_V2_TROVE_STATUS_ENUM[LIQUITY_V2_TROVE_STATUS_ENUM["nonExistent"] = 0] = "nonExistent";
|
|
10
|
+
LIQUITY_V2_TROVE_STATUS_ENUM[LIQUITY_V2_TROVE_STATUS_ENUM["active"] = 1] = "active";
|
|
11
|
+
LIQUITY_V2_TROVE_STATUS_ENUM[LIQUITY_V2_TROVE_STATUS_ENUM["closedByOwner"] = 2] = "closedByOwner";
|
|
12
|
+
LIQUITY_V2_TROVE_STATUS_ENUM[LIQUITY_V2_TROVE_STATUS_ENUM["closedByLiquidation"] = 3] = "closedByLiquidation";
|
|
13
|
+
LIQUITY_V2_TROVE_STATUS_ENUM[LIQUITY_V2_TROVE_STATUS_ENUM["zombie"] = 4] = "zombie";
|
|
14
|
+
})(LIQUITY_V2_TROVE_STATUS_ENUM || (LIQUITY_V2_TROVE_STATUS_ENUM = {}));
|
|
15
|
+
export const LIQUITY_V2_STATUS_MAPPING = {
|
|
16
|
+
nonExistent: 'Non existent',
|
|
17
|
+
active: 'Active',
|
|
18
|
+
closedByOwner: 'Closed',
|
|
19
|
+
closedByLiquidation: 'Liquidated',
|
|
20
|
+
zombie: 'Zombie',
|
|
21
|
+
};
|
package/package.json
CHANGED
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@defisaver/positions-sdk",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "",
|
|
5
|
-
"main": "./cjs/index.js",
|
|
6
|
-
"module": "./esm/index.js",
|
|
7
|
-
"types": "./esm/index.d.ts",
|
|
8
|
-
"scripts": {
|
|
9
|
-
"build:esm": "rm -rf esm && tsc -p tsconfig.esm.json",
|
|
10
|
-
"build:cjs": "rm -rf cjs && tsc -p tsconfig.cjs.json",
|
|
11
|
-
"build": "npm run lint && npm run generate-contracts && npm run build:cjs && npm run build:esm",
|
|
12
|
-
"dev": "npm run generate-contracts && tsc -p tsconfig.json --watch",
|
|
13
|
-
"lint": "eslint src/ --fix",
|
|
14
|
-
"lint-check": "eslint src/",
|
|
15
|
-
"generate-contracts": "node scripts/generateContracts.js",
|
|
16
|
-
"test": "mocha tests
|
|
17
|
-
"test-single": "mocha ./tests/$npm_config_name.ts",
|
|
18
|
-
"test:debugger": "mocha --inspect-brk tests/*",
|
|
19
|
-
"build-test": "npm run build && npm run test",
|
|
20
|
-
"version-bump": "git commit -am \"Version bump to $(npm version patch | cut -c 2-)\""
|
|
21
|
-
},
|
|
22
|
-
"keywords": [],
|
|
23
|
-
"author": "",
|
|
24
|
-
"license": "ISC",
|
|
25
|
-
"dependencies": {
|
|
26
|
-
"@defisaver/tokens": "^1.5.53",
|
|
27
|
-
"@ethersproject/bignumber": "^5.7.0",
|
|
28
|
-
"@morpho-org/morpho-aave-v3-sdk": "^1.5.3",
|
|
29
|
-
"decimal.js": "^10.4.3"
|
|
30
|
-
},
|
|
31
|
-
"devDependencies": {
|
|
32
|
-
"@defisaver/eslint-config": "^1.0.1",
|
|
33
|
-
"@types/chai": "^5.0.0",
|
|
34
|
-
"@types/mocha": "^10.0.9",
|
|
35
|
-
"@types/web3": "^1.0.20",
|
|
36
|
-
"chai": "^4.3.8",
|
|
37
|
-
"dotenv": "^16.3.1",
|
|
38
|
-
"eslint": "^8.49.0",
|
|
39
|
-
"eslint-plugin-import": "^2.31.0",
|
|
40
|
-
"mocha": "^10.2.0",
|
|
41
|
-
"ts-node": "^10.9.2",
|
|
42
|
-
"typechain": "^8.3.1",
|
|
43
|
-
"typechain-target-web3-v1-3mihai3": "^6.0.2",
|
|
44
|
-
"typescript": "^5.2.2"
|
|
45
|
-
},
|
|
46
|
-
"peerDependencies": {
|
|
47
|
-
"web3": "^1.10.2"
|
|
48
|
-
}
|
|
49
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@defisaver/positions-sdk",
|
|
3
|
+
"version": "0.0.199-dev-1",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "./cjs/index.js",
|
|
6
|
+
"module": "./esm/index.js",
|
|
7
|
+
"types": "./esm/index.d.ts",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"build:esm": "rm -rf esm && tsc -p tsconfig.esm.json",
|
|
10
|
+
"build:cjs": "rm -rf cjs && tsc -p tsconfig.cjs.json",
|
|
11
|
+
"build": "npm run lint && npm run generate-contracts && npm run build:cjs && npm run build:esm",
|
|
12
|
+
"dev": "npm run generate-contracts && tsc -p tsconfig.json --watch",
|
|
13
|
+
"lint": "eslint src/ --fix",
|
|
14
|
+
"lint-check": "eslint src/",
|
|
15
|
+
"generate-contracts": "node scripts/generateContracts.js",
|
|
16
|
+
"test": "mocha tests/liquityV2.ts",
|
|
17
|
+
"test-single": "mocha ./tests/$npm_config_name.ts",
|
|
18
|
+
"test:debugger": "mocha --inspect-brk tests/*",
|
|
19
|
+
"build-test": "npm run build && npm run test",
|
|
20
|
+
"version-bump": "git commit -am \"Version bump to $(npm version patch | cut -c 2-)\""
|
|
21
|
+
},
|
|
22
|
+
"keywords": [],
|
|
23
|
+
"author": "",
|
|
24
|
+
"license": "ISC",
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"@defisaver/tokens": "^1.5.53-dev-1",
|
|
27
|
+
"@ethersproject/bignumber": "^5.7.0",
|
|
28
|
+
"@morpho-org/morpho-aave-v3-sdk": "^1.5.3",
|
|
29
|
+
"decimal.js": "^10.4.3"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@defisaver/eslint-config": "^1.0.1",
|
|
33
|
+
"@types/chai": "^5.0.0",
|
|
34
|
+
"@types/mocha": "^10.0.9",
|
|
35
|
+
"@types/web3": "^1.0.20",
|
|
36
|
+
"chai": "^4.3.8",
|
|
37
|
+
"dotenv": "^16.3.1",
|
|
38
|
+
"eslint": "^8.49.0",
|
|
39
|
+
"eslint-plugin-import": "^2.31.0",
|
|
40
|
+
"mocha": "^10.2.0",
|
|
41
|
+
"ts-node": "^10.9.2",
|
|
42
|
+
"typechain": "^8.3.1",
|
|
43
|
+
"typechain-target-web3-v1-3mihai3": "^6.0.2",
|
|
44
|
+
"typescript": "^5.2.2"
|
|
45
|
+
},
|
|
46
|
+
"peerDependencies": {
|
|
47
|
+
"web3": "^1.10.2"
|
|
48
|
+
}
|
|
49
|
+
}
|