@defisaver/positions-sdk 2.1.9-dev-spark-2 → 2.1.9-fluid-plasma1
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/CLAUDE.md +32 -0
- package/README.md +64 -64
- package/cjs/config/contracts.d.ts +12 -0
- package/cjs/config/contracts.js +7 -3
- package/cjs/fluid/index.js +44 -23
- package/cjs/helpers/morphoBlueHelpers/index.js +66 -66
- package/cjs/helpers/sparkHelpers/index.d.ts +4 -4
- package/cjs/helpers/sparkHelpers/index.js +12 -12
- package/cjs/markets/fluid/index.d.ts +46 -0
- package/cjs/markets/fluid/index.js +436 -1
- package/cjs/portfolio/index.js +1 -1
- package/cjs/services/priceService.js +1 -1
- package/cjs/spark/index.d.ts +1 -3
- package/cjs/spark/index.js +24 -24
- package/cjs/types/fluid.d.ts +30 -1
- package/cjs/types/fluid.js +31 -1
- package/cjs/types/spark.d.ts +4 -3
- package/esm/config/contracts.d.ts +12 -0
- package/esm/config/contracts.js +7 -3
- package/esm/fluid/index.js +45 -24
- package/esm/helpers/morphoBlueHelpers/index.js +66 -66
- package/esm/helpers/sparkHelpers/index.d.ts +4 -4
- package/esm/helpers/sparkHelpers/index.js +13 -13
- package/esm/markets/fluid/index.d.ts +46 -0
- package/esm/markets/fluid/index.js +415 -1
- package/esm/portfolio/index.js +1 -1
- package/esm/services/priceService.js +2 -2
- package/esm/spark/index.d.ts +1 -3
- package/esm/spark/index.js +25 -25
- package/esm/types/fluid.d.ts +30 -1
- package/esm/types/fluid.js +30 -0
- package/esm/types/spark.d.ts +4 -3
- package/package.json +47 -47
- package/src/aaveV2/index.ts +240 -240
- package/src/aaveV3/index.ts +614 -614
- package/src/aaveV3/merit.ts +97 -97
- package/src/aaveV3/merkl.ts +74 -74
- package/src/claiming/aaveV3.ts +154 -154
- package/src/claiming/compV3.ts +22 -22
- package/src/claiming/index.ts +12 -12
- package/src/claiming/king.ts +66 -66
- package/src/claiming/morphoBlue.ts +118 -118
- package/src/claiming/spark.ts +225 -225
- package/src/compoundV2/index.ts +244 -244
- package/src/compoundV3/index.ts +274 -274
- package/src/config/contracts.ts +1255 -1251
- package/src/constants/index.ts +10 -10
- package/src/contracts.ts +120 -120
- package/src/curveUsd/index.ts +254 -254
- package/src/eulerV2/index.ts +324 -324
- package/src/exchange/index.ts +25 -25
- package/src/fluid/index.ts +1693 -1668
- package/src/helpers/aaveHelpers/index.ts +187 -187
- package/src/helpers/compoundHelpers/index.ts +283 -283
- package/src/helpers/curveUsdHelpers/index.ts +40 -40
- package/src/helpers/eulerHelpers/index.ts +222 -222
- package/src/helpers/fluidHelpers/index.ts +326 -326
- package/src/helpers/index.ts +10 -10
- package/src/helpers/liquityV2Helpers/index.ts +82 -82
- package/src/helpers/llamaLendHelpers/index.ts +53 -53
- package/src/helpers/makerHelpers/index.ts +52 -52
- package/src/helpers/morphoBlueHelpers/index.ts +396 -396
- package/src/helpers/sparkHelpers/index.ts +155 -158
- package/src/index.ts +47 -47
- package/src/liquity/index.ts +159 -159
- package/src/liquityV2/index.ts +657 -657
- package/src/llamaLend/index.ts +305 -305
- package/src/maker/index.ts +223 -223
- package/src/markets/aave/index.ts +116 -116
- package/src/markets/aave/marketAssets.ts +54 -54
- package/src/markets/compound/index.ts +238 -238
- package/src/markets/compound/marketsAssets.ts +97 -97
- package/src/markets/curveUsd/index.ts +69 -69
- package/src/markets/euler/index.ts +26 -26
- package/src/markets/fluid/index.ts +2900 -2460
- package/src/markets/index.ts +25 -25
- package/src/markets/liquityV2/index.ts +102 -102
- 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 +12 -12
- package/src/moneymarket/moneymarketCommonService.ts +80 -80
- package/src/morphoBlue/index.ts +274 -274
- package/src/portfolio/index.ts +570 -570
- package/src/services/priceService.ts +159 -159
- package/src/services/utils.ts +115 -115
- package/src/services/viem.ts +34 -34
- package/src/setup.ts +8 -8
- package/src/spark/index.ts +445 -456
- package/src/staking/eligibility.ts +53 -53
- package/src/staking/index.ts +1 -1
- package/src/staking/staking.ts +170 -170
- package/src/types/aave.ts +189 -189
- package/src/types/claiming.ts +109 -109
- package/src/types/common.ts +107 -107
- package/src/types/compound.ts +136 -136
- package/src/types/curveUsd.ts +123 -123
- package/src/types/euler.ts +175 -175
- package/src/types/fluid.ts +483 -452
- package/src/types/index.ts +13 -13
- package/src/types/liquity.ts +30 -30
- package/src/types/liquityV2.ts +126 -126
- package/src/types/llamaLend.ts +159 -159
- package/src/types/maker.ts +63 -63
- package/src/types/merit.ts +1 -1
- package/src/types/merkl.ts +70 -70
- package/src/types/morphoBlue.ts +194 -194
- package/src/types/portfolio.ts +60 -60
- package/src/types/spark.ts +135 -133
- package/src/umbrella/index.ts +69 -69
- package/src/umbrella/umbrellaUtils.ts +29 -29
package/esm/spark/index.js
CHANGED
|
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
};
|
|
10
10
|
import Dec from 'decimal.js';
|
|
11
11
|
import { assetAmountInEth, assetAmountInWei, getAssetInfo } from '@defisaver/tokens';
|
|
12
|
-
import { IncentiveKind, } from '../types/common';
|
|
12
|
+
import { IncentiveKind, NetworkNumber, } from '../types/common';
|
|
13
13
|
import { ethToWeth, wethToEth, wethToEthByAddress, } from '../services/utils';
|
|
14
14
|
import { calculateNetApy, getStakingApy, STAKING_ASSETS, } from '../staking';
|
|
15
15
|
import { SparkViewContractViem, SparkIncentiveDataProviderContractViem, createViemContractFromConfigFunc, } from '../contracts';
|
|
@@ -22,6 +22,7 @@ export const sparkEmodeCategoriesMapping = (extractedState, usedAssets) => {
|
|
|
22
22
|
const usedAssetsValues = Object.values(usedAssets);
|
|
23
23
|
const categoriesMapping = {};
|
|
24
24
|
Object.values(assetsData).forEach((a) => {
|
|
25
|
+
var _a;
|
|
25
26
|
const borrowingOnlyFromCategory = a.eModeCategory === 0
|
|
26
27
|
? true
|
|
27
28
|
: !usedAssetsValues.filter(u => u.isBorrowed && u.eModeCategory !== a.eModeCategory).length;
|
|
@@ -32,6 +33,8 @@ export const sparkEmodeCategoriesMapping = (extractedState, usedAssets) => {
|
|
|
32
33
|
enteringTerms,
|
|
33
34
|
canEnterCategory: !enteringTerms.includes(false),
|
|
34
35
|
id: a.eModeCategory,
|
|
36
|
+
data: a.eModeCategoryData,
|
|
37
|
+
assets: a.eModeCategory === 0 ? [] : [...(((_a = categoriesMapping[a.eModeCategory]) === null || _a === void 0 ? void 0 : _a.assets) || []), a.symbol],
|
|
35
38
|
enabledData: {
|
|
36
39
|
ratio: afterEnteringCategory.ratio,
|
|
37
40
|
liqRatio: afterEnteringCategory.liqRatio,
|
|
@@ -46,17 +49,18 @@ export const _getSparkMarketsData = (provider, network, selectedMarket) => __awa
|
|
|
46
49
|
const marketAddress = selectedMarket.providerAddress;
|
|
47
50
|
const loanInfoContract = SparkViewContractViem(provider, network);
|
|
48
51
|
const sparkIncentivesContract = SparkIncentiveDataProviderContractViem(provider, network);
|
|
49
|
-
|
|
50
|
-
let [loanInfo, rewardInfo] = yield Promise.all([
|
|
52
|
+
const [loanInfo, _rewardInfo] = yield Promise.all([
|
|
51
53
|
loanInfoContract.read.getFullTokensInfo([marketAddress, selectedMarket.assets.map(a => getAssetInfo(ethToWeth(a)).address)]),
|
|
52
|
-
sparkIncentivesContract.read.getReservesIncentivesData([marketAddress]),
|
|
54
|
+
network === NetworkNumber.Opt ? sparkIncentivesContract.read.getReservesIncentivesData([marketAddress]) : [],
|
|
53
55
|
]);
|
|
54
|
-
rewardInfo =
|
|
55
|
-
|
|
56
|
-
all
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
56
|
+
let rewardInfo = [];
|
|
57
|
+
if (network === NetworkNumber.Opt) {
|
|
58
|
+
rewardInfo = rewardInfo.reduce((all, market) => {
|
|
59
|
+
// eslint-disable-next-line no-param-reassign
|
|
60
|
+
all[market.underlyingAsset] = market;
|
|
61
|
+
return all;
|
|
62
|
+
}, {});
|
|
63
|
+
}
|
|
60
64
|
const assetsData = yield Promise.all(loanInfo
|
|
61
65
|
.map((market, i) => __awaiter(void 0, void 0, void 0, function* () {
|
|
62
66
|
const symbol = selectedMarket.assets[i];
|
|
@@ -71,15 +75,6 @@ export const _getSparkMarketsData = (provider, network, selectedMarket) => __awa
|
|
|
71
75
|
if (new Dec(marketLiquidity).lt(0)) {
|
|
72
76
|
marketLiquidity = '0';
|
|
73
77
|
}
|
|
74
|
-
eModeCategoriesData[+market.emodeCategory.toString()] = {
|
|
75
|
-
id: +market.emodeCategory.toString(),
|
|
76
|
-
label: market.label,
|
|
77
|
-
liquidationBonus: new Dec(market.liquidationBonus).div(10000).toString(),
|
|
78
|
-
liquidationRatio: new Dec(market.liquidationThreshold).div(10000).toString(),
|
|
79
|
-
collateralFactor: new Dec(market.ltv).div(10000).toString(),
|
|
80
|
-
collateralAssets: eModeCategoriesData[+market.emodeCategory.toString()] ? [...eModeCategoriesData[+market.emodeCategory.toString()].collateralAssets, selectedMarket.assets[i]] : [selectedMarket.assets[i]],
|
|
81
|
-
borrowAssets: eModeCategoriesData[+market.emodeCategory.toString()] ? [...eModeCategoriesData[+market.emodeCategory.toString()].borrowAssets, selectedMarket.assets[i]] : [selectedMarket.assets[i]],
|
|
82
|
-
};
|
|
83
78
|
return ({
|
|
84
79
|
symbol: selectedMarket.assets[i],
|
|
85
80
|
isIsolated: new Dec(market.debtCeilingForIsolationMode.toString()).gt(0),
|
|
@@ -114,6 +109,13 @@ export const _getSparkMarketsData = (provider, network, selectedMarket) => __awa
|
|
|
114
109
|
isolationModeBorrowingEnabled: market.isolationModeBorrowingEnabled,
|
|
115
110
|
isFlashLoanEnabled: market.isFlashLoanEnabled,
|
|
116
111
|
aTokenAddress: market.aTokenAddress,
|
|
112
|
+
eModeCategoryData: {
|
|
113
|
+
label: market.label,
|
|
114
|
+
liquidationBonus: new Dec(market.liquidationBonus).div(10000).toString(),
|
|
115
|
+
liquidationRatio: new Dec(market.liquidationThreshold).div(10000).toString(),
|
|
116
|
+
collateralFactor: new Dec(market.ltv).div(10000).toString(),
|
|
117
|
+
priceSource: market.priceSource,
|
|
118
|
+
},
|
|
117
119
|
supplyIncentives: [],
|
|
118
120
|
borrowIncentives: [],
|
|
119
121
|
});
|
|
@@ -145,7 +147,7 @@ export const _getSparkMarketsData = (provider, network, selectedMarket) => __awa
|
|
|
145
147
|
return;
|
|
146
148
|
rewardForMarket.aIncentiveData.rewardsTokenInformation.forEach(supplyRewardData => {
|
|
147
149
|
if (supplyRewardData) {
|
|
148
|
-
if (
|
|
150
|
+
if (supplyRewardData.emissionEndTimestamp * 1000 < Date.now())
|
|
149
151
|
return;
|
|
150
152
|
const supplyEmissionPerSecond = supplyRewardData.emissionPerSecond;
|
|
151
153
|
const supplyRewardPrice = new Dec(supplyRewardData.rewardPriceFeed).div(Math.pow(10, supplyRewardData.priceFeedDecimals))
|
|
@@ -166,7 +168,7 @@ export const _getSparkMarketsData = (provider, network, selectedMarket) => __awa
|
|
|
166
168
|
});
|
|
167
169
|
rewardForMarket.vIncentiveData.rewardsTokenInformation.forEach(borrowRewardData => {
|
|
168
170
|
if (borrowRewardData) {
|
|
169
|
-
if (
|
|
171
|
+
if (borrowRewardData.emissionEndTimestamp * 1000 < Date.now())
|
|
170
172
|
return;
|
|
171
173
|
const supplyEmissionPerSecond = borrowRewardData.emissionPerSecond;
|
|
172
174
|
const supplyRewardPrice = new Dec(borrowRewardData.rewardPriceFeed).div(Math.pow(10, borrowRewardData.priceFeedDecimals))
|
|
@@ -198,9 +200,7 @@ export const _getSparkMarketsData = (provider, network, selectedMarket) => __awa
|
|
|
198
200
|
.forEach((assetData, i) => {
|
|
199
201
|
payload[assetData.symbol] = Object.assign(Object.assign({}, assetData), { sortIndex: i });
|
|
200
202
|
});
|
|
201
|
-
|
|
202
|
-
eModeCategoriesData[0].borrowAssets = Object.values(payload).map(a => a.symbol);
|
|
203
|
-
return { assetsData: payload, eModeCategoriesData };
|
|
203
|
+
return { assetsData: payload };
|
|
204
204
|
});
|
|
205
205
|
export const getSparkMarketsData = (provider, network, selectedMarket) => __awaiter(void 0, void 0, void 0, function* () { return _getSparkMarketsData(getViemProvider(provider, network), network, selectedMarket); });
|
|
206
206
|
export const EMPTY_SPARK_DATA = {
|
|
@@ -336,6 +336,6 @@ export const _getSparkAccountData = (provider, network, address, extractedState)
|
|
|
336
336
|
export const getSparkAccountData = (provider, network, address, extractedState) => __awaiter(void 0, void 0, void 0, function* () { return _getSparkAccountData(getViemProvider(provider, network), network, address, extractedState); });
|
|
337
337
|
export const getSparkFullPositionData = (provider, network, address, market) => __awaiter(void 0, void 0, void 0, function* () {
|
|
338
338
|
const marketData = yield getSparkMarketsData(provider, network, market);
|
|
339
|
-
const positionData = yield getSparkAccountData(provider, network, address, { assetsData: marketData.assetsData, selectedMarket: market
|
|
339
|
+
const positionData = yield getSparkAccountData(provider, network, address, { assetsData: marketData.assetsData, selectedMarket: market });
|
|
340
340
|
return positionData;
|
|
341
341
|
});
|
package/esm/types/fluid.d.ts
CHANGED
|
@@ -142,7 +142,30 @@ export declare enum FluidBaseVersions {
|
|
|
142
142
|
FLUID_LBTC_USDC_21_BASE = "FLUID_LBTC_USDC_21_BASE",
|
|
143
143
|
FLUID_LBTC_SUSDS_22_BASE = "FLUID_LBTC_SUSDS_22_BASE"
|
|
144
144
|
}
|
|
145
|
-
export
|
|
145
|
+
export declare enum FluidPlasmaVersions {
|
|
146
|
+
FLUID_ETH_USDT_1_PLASMA = "FLUID_ETH_USDT_1_PLASMA",
|
|
147
|
+
FLUID_ETH_USDE_2_PLASMA = "FLUID_ETH_USDE_2_PLASMA",
|
|
148
|
+
FLUID_WEETH_ETH_3_PLASMA = "FLUID_WEETH_ETH_3_PLASMA",
|
|
149
|
+
FLUID_SUSDE_USDT_4_PLASMA = "FLUID_SUSDE_USDT_4_PLASMA",
|
|
150
|
+
FLUID_WEETH_USDT_5_PLASMA = "FLUID_WEETH_USDT_5_PLASMA",
|
|
151
|
+
FLUID_WEETH_USDE_6_PLASMA = "FLUID_WEETH_USDE_6_PLASMA",
|
|
152
|
+
FLUID_XAUT_USDT_7_PLASMA = "FLUID_XAUT_USDT_7_PLASMA",
|
|
153
|
+
FLUID_XAUT_USDE_8_PLASMA = "FLUID_XAUT_USDE_8_PLASMA",
|
|
154
|
+
FLUID_USDE_USDT_9_PLASMA = "FLUID_USDE_USDT_9_PLASMA",
|
|
155
|
+
FLUID_USDE_USDT_10_PLASMA = "FLUID_USDE_USDT_10_PLASMA",
|
|
156
|
+
FLUID_WEETH_ETH_ETH_11_PLASMA = "FLUID_WEETH_ETH_ETH_11_PLASMA",
|
|
157
|
+
FLUID_SUSDE_USDT_USDT_12_PLASMA = "FLUID_SUSDE_USDT_USDT_12_PLASMA",
|
|
158
|
+
FLUID_USDE_USDT_USDT_13_PLASMA = "FLUID_USDE_USDT_USDT_13_PLASMA",
|
|
159
|
+
FLUID_USDAI_USDT_USDT_14_PLASMA = "FLUID_USDAI_USDT_USDT_14_PLASMA",
|
|
160
|
+
FLUID_USDT_SYRUPUSDT_USDT_15_PLASMA = "FLUID_USDT_SYRUPUSDT_USDT_15_PLASMA",
|
|
161
|
+
FLUID_XPL_USDT_16_PLASMA = "FLUID_XPL_USDT_16_PLASMA",
|
|
162
|
+
FLUID_XPL_USDE_17_PLASMA = "FLUID_XPL_USDE_17_PLASMA",
|
|
163
|
+
FLUID_WSTUSR_USDT_18_PLASMA = "FLUID_WSTUSR_USDT_18_PLASMA",
|
|
164
|
+
FLUID_WSTUSR_USDT_USDT_19_PLASMA = "FLUID_WSTUSR_USDT_USDT_19_PLASMA",
|
|
165
|
+
FLUID_SYRUPUSDT_USDT_20_PLASMA = "FLUID_SYRUPUSDT_USDT_20_PLASMA",
|
|
166
|
+
FLUID_ETH_WRSETH_ETH_21_PLASMA = "FLUID_ETH_WRSETH_ETH_21_PLASMA"
|
|
167
|
+
}
|
|
168
|
+
export type FluidVersions = FluidArbitrumVersion | FluidBaseVersions | FluidMainnetVersion | FluidPlasmaVersions;
|
|
146
169
|
export declare enum FluidMainnetDepositToken {
|
|
147
170
|
ETH = "ETH",
|
|
148
171
|
wstETH = "wstETH",
|
|
@@ -169,10 +192,16 @@ export declare enum FluidBaseDepositToken {
|
|
|
169
192
|
sUSDS = "sUSDS",
|
|
170
193
|
GHO = "GHO"
|
|
171
194
|
}
|
|
195
|
+
export declare enum FluidPlasmaDepositToken {
|
|
196
|
+
USDe = "USDe",
|
|
197
|
+
USDT = "USDT",
|
|
198
|
+
ETH = "ETH"
|
|
199
|
+
}
|
|
172
200
|
export type FluidDepositTokenByNetwork = {
|
|
173
201
|
[NetworkNumber.Eth]: FluidMainnetDepositToken;
|
|
174
202
|
[NetworkNumber.Arb]: FluidArbitrumDepositToken;
|
|
175
203
|
[NetworkNumber.Base]: FluidBaseDepositToken;
|
|
204
|
+
[NetworkNumber.Plasma]: FluidPlasmaDepositToken;
|
|
176
205
|
};
|
|
177
206
|
export declare enum FluidVaultType {
|
|
178
207
|
T1 = "T1",
|
package/esm/types/fluid.js
CHANGED
|
@@ -125,6 +125,30 @@ export var FluidBaseVersions;
|
|
|
125
125
|
FluidBaseVersions["FLUID_LBTC_USDC_21_BASE"] = "FLUID_LBTC_USDC_21_BASE";
|
|
126
126
|
FluidBaseVersions["FLUID_LBTC_SUSDS_22_BASE"] = "FLUID_LBTC_SUSDS_22_BASE";
|
|
127
127
|
})(FluidBaseVersions || (FluidBaseVersions = {}));
|
|
128
|
+
export var FluidPlasmaVersions;
|
|
129
|
+
(function (FluidPlasmaVersions) {
|
|
130
|
+
FluidPlasmaVersions["FLUID_ETH_USDT_1_PLASMA"] = "FLUID_ETH_USDT_1_PLASMA";
|
|
131
|
+
FluidPlasmaVersions["FLUID_ETH_USDE_2_PLASMA"] = "FLUID_ETH_USDE_2_PLASMA";
|
|
132
|
+
FluidPlasmaVersions["FLUID_WEETH_ETH_3_PLASMA"] = "FLUID_WEETH_ETH_3_PLASMA";
|
|
133
|
+
FluidPlasmaVersions["FLUID_SUSDE_USDT_4_PLASMA"] = "FLUID_SUSDE_USDT_4_PLASMA";
|
|
134
|
+
FluidPlasmaVersions["FLUID_WEETH_USDT_5_PLASMA"] = "FLUID_WEETH_USDT_5_PLASMA";
|
|
135
|
+
FluidPlasmaVersions["FLUID_WEETH_USDE_6_PLASMA"] = "FLUID_WEETH_USDE_6_PLASMA";
|
|
136
|
+
FluidPlasmaVersions["FLUID_XAUT_USDT_7_PLASMA"] = "FLUID_XAUT_USDT_7_PLASMA";
|
|
137
|
+
FluidPlasmaVersions["FLUID_XAUT_USDE_8_PLASMA"] = "FLUID_XAUT_USDE_8_PLASMA";
|
|
138
|
+
FluidPlasmaVersions["FLUID_USDE_USDT_9_PLASMA"] = "FLUID_USDE_USDT_9_PLASMA";
|
|
139
|
+
FluidPlasmaVersions["FLUID_USDE_USDT_10_PLASMA"] = "FLUID_USDE_USDT_10_PLASMA";
|
|
140
|
+
FluidPlasmaVersions["FLUID_WEETH_ETH_ETH_11_PLASMA"] = "FLUID_WEETH_ETH_ETH_11_PLASMA";
|
|
141
|
+
FluidPlasmaVersions["FLUID_SUSDE_USDT_USDT_12_PLASMA"] = "FLUID_SUSDE_USDT_USDT_12_PLASMA";
|
|
142
|
+
FluidPlasmaVersions["FLUID_USDE_USDT_USDT_13_PLASMA"] = "FLUID_USDE_USDT_USDT_13_PLASMA";
|
|
143
|
+
FluidPlasmaVersions["FLUID_USDAI_USDT_USDT_14_PLASMA"] = "FLUID_USDAI_USDT_USDT_14_PLASMA";
|
|
144
|
+
FluidPlasmaVersions["FLUID_USDT_SYRUPUSDT_USDT_15_PLASMA"] = "FLUID_USDT_SYRUPUSDT_USDT_15_PLASMA";
|
|
145
|
+
FluidPlasmaVersions["FLUID_XPL_USDT_16_PLASMA"] = "FLUID_XPL_USDT_16_PLASMA";
|
|
146
|
+
FluidPlasmaVersions["FLUID_XPL_USDE_17_PLASMA"] = "FLUID_XPL_USDE_17_PLASMA";
|
|
147
|
+
FluidPlasmaVersions["FLUID_WSTUSR_USDT_18_PLASMA"] = "FLUID_WSTUSR_USDT_18_PLASMA";
|
|
148
|
+
FluidPlasmaVersions["FLUID_WSTUSR_USDT_USDT_19_PLASMA"] = "FLUID_WSTUSR_USDT_USDT_19_PLASMA";
|
|
149
|
+
FluidPlasmaVersions["FLUID_SYRUPUSDT_USDT_20_PLASMA"] = "FLUID_SYRUPUSDT_USDT_20_PLASMA";
|
|
150
|
+
FluidPlasmaVersions["FLUID_ETH_WRSETH_ETH_21_PLASMA"] = "FLUID_ETH_WRSETH_ETH_21_PLASMA";
|
|
151
|
+
})(FluidPlasmaVersions || (FluidPlasmaVersions = {}));
|
|
128
152
|
export var FluidMainnetDepositToken;
|
|
129
153
|
(function (FluidMainnetDepositToken) {
|
|
130
154
|
FluidMainnetDepositToken["ETH"] = "ETH";
|
|
@@ -154,6 +178,12 @@ export var FluidBaseDepositToken;
|
|
|
154
178
|
FluidBaseDepositToken["sUSDS"] = "sUSDS";
|
|
155
179
|
FluidBaseDepositToken["GHO"] = "GHO";
|
|
156
180
|
})(FluidBaseDepositToken || (FluidBaseDepositToken = {}));
|
|
181
|
+
export var FluidPlasmaDepositToken;
|
|
182
|
+
(function (FluidPlasmaDepositToken) {
|
|
183
|
+
FluidPlasmaDepositToken["USDe"] = "USDe";
|
|
184
|
+
FluidPlasmaDepositToken["USDT"] = "USDT";
|
|
185
|
+
FluidPlasmaDepositToken["ETH"] = "ETH";
|
|
186
|
+
})(FluidPlasmaDepositToken || (FluidPlasmaDepositToken = {}));
|
|
157
187
|
export var FluidVaultType;
|
|
158
188
|
(function (FluidVaultType) {
|
|
159
189
|
FluidVaultType["T1"] = "T1";
|
package/esm/types/spark.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { EModeCategoriesData } from './aave';
|
|
2
1
|
import { EthAddress, MMAssetData, MMPositionData, MMUsedAsset, NetworkNumber } from './common';
|
|
3
2
|
export declare enum SparkVersions {
|
|
4
3
|
SparkV1 = "v1default"
|
|
@@ -14,6 +13,8 @@ export interface SparkEModeCategoryDataMapping {
|
|
|
14
13
|
enteringTerms: boolean[];
|
|
15
14
|
canEnterCategory: boolean;
|
|
16
15
|
id: number;
|
|
16
|
+
data: SparkEModeCategoryData;
|
|
17
|
+
assets: string[];
|
|
17
18
|
enabledData: {
|
|
18
19
|
ratio: string;
|
|
19
20
|
liqRatio: string;
|
|
@@ -44,6 +45,7 @@ export interface SparkAssetData extends MMAssetData {
|
|
|
44
45
|
usageAsCollateralEnabled: boolean;
|
|
45
46
|
isIsolated: boolean;
|
|
46
47
|
eModeCategory: number;
|
|
48
|
+
eModeCategoryData: SparkEModeCategoryData;
|
|
47
49
|
liquidationRatio: string;
|
|
48
50
|
}
|
|
49
51
|
export interface SparkAssetsData {
|
|
@@ -51,7 +53,6 @@ export interface SparkAssetsData {
|
|
|
51
53
|
}
|
|
52
54
|
export type SparkMarketsData = {
|
|
53
55
|
assetsData: SparkAssetsData;
|
|
54
|
-
eModeCategoriesData: EModeCategoriesData;
|
|
55
56
|
};
|
|
56
57
|
export interface SparkUsedAsset extends MMUsedAsset {
|
|
57
58
|
stableBorrowRate: string;
|
|
@@ -70,7 +71,7 @@ export interface SparkUsedAssets {
|
|
|
70
71
|
export interface SparkHelperCommon {
|
|
71
72
|
usedAssets: SparkUsedAssets;
|
|
72
73
|
eModeCategory: number;
|
|
73
|
-
|
|
74
|
+
eModeCategories?: object;
|
|
74
75
|
assetsData: SparkAssetsData;
|
|
75
76
|
selectedMarket?: SparkMarketData;
|
|
76
77
|
network?: NetworkNumber;
|
package/package.json
CHANGED
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@defisaver/positions-sdk",
|
|
3
|
-
"version": "2.1.9-
|
|
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 build:cjs && npm run build:esm",
|
|
12
|
-
"dev": "tsc -p tsconfig.json --watch",
|
|
13
|
-
"lint": "eslint src/ --fix",
|
|
14
|
-
"lint-check": "eslint src/",
|
|
15
|
-
"test": "mocha tests
|
|
16
|
-
"test-single": "mocha ./tests/$npm_config_name.ts",
|
|
17
|
-
"test:debugger": "mocha --inspect-brk tests/*",
|
|
18
|
-
"version-bump": "git commit -am \"Version bump to $(npm version patch | cut -c 2-)\""
|
|
19
|
-
},
|
|
20
|
-
"keywords": [],
|
|
21
|
-
"author": "",
|
|
22
|
-
"license": "ISC",
|
|
23
|
-
"dependencies": {
|
|
24
|
-
"@defisaver/tokens": "^1.7.
|
|
25
|
-
"@types/lodash": "^4.17.15",
|
|
26
|
-
"@types/memoizee": "^0.4.12",
|
|
27
|
-
"decimal.js": "^10.6.0",
|
|
28
|
-
"lodash": "^4.17.21",
|
|
29
|
-
"memoizee": "^0.4.17",
|
|
30
|
-
"viem": "^2.37.9"
|
|
31
|
-
},
|
|
32
|
-
"devDependencies": {
|
|
33
|
-
"@defisaver/eslint-config": "^1.0.1",
|
|
34
|
-
"@metamask/eth-json-rpc-middleware": "^15.0.1",
|
|
35
|
-
"@metamask/eth-json-rpc-provider": "^4.1.6",
|
|
36
|
-
"@types/chai": "^5.0.0",
|
|
37
|
-
"@types/mocha": "^10.0.9",
|
|
38
|
-
"chai": "^4.3.8",
|
|
39
|
-
"dotenv": "^16.3.1",
|
|
40
|
-
"eslint": "^8.49.0",
|
|
41
|
-
"eslint-plugin-import": "^2.31.0",
|
|
42
|
-
"mocha": "^10.2.0",
|
|
43
|
-
"nock": "^14.0.0",
|
|
44
|
-
"ts-node": "^10.9.2",
|
|
45
|
-
"typescript": "^5.2.2"
|
|
46
|
-
}
|
|
47
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@defisaver/positions-sdk",
|
|
3
|
+
"version": "2.1.9-fluid-plasma1",
|
|
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 build:cjs && npm run build:esm",
|
|
12
|
+
"dev": "tsc -p tsconfig.json --watch",
|
|
13
|
+
"lint": "eslint src/ --fix",
|
|
14
|
+
"lint-check": "eslint src/",
|
|
15
|
+
"test": "mocha tests/*",
|
|
16
|
+
"test-single": "mocha ./tests/$npm_config_name.ts",
|
|
17
|
+
"test:debugger": "mocha --inspect-brk tests/*",
|
|
18
|
+
"version-bump": "git commit -am \"Version bump to $(npm version patch | cut -c 2-)\""
|
|
19
|
+
},
|
|
20
|
+
"keywords": [],
|
|
21
|
+
"author": "",
|
|
22
|
+
"license": "ISC",
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"@defisaver/tokens": "^1.7.6",
|
|
25
|
+
"@types/lodash": "^4.17.15",
|
|
26
|
+
"@types/memoizee": "^0.4.12",
|
|
27
|
+
"decimal.js": "^10.6.0",
|
|
28
|
+
"lodash": "^4.17.21",
|
|
29
|
+
"memoizee": "^0.4.17",
|
|
30
|
+
"viem": "^2.37.9"
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@defisaver/eslint-config": "^1.0.1",
|
|
34
|
+
"@metamask/eth-json-rpc-middleware": "^15.0.1",
|
|
35
|
+
"@metamask/eth-json-rpc-provider": "^4.1.6",
|
|
36
|
+
"@types/chai": "^5.0.0",
|
|
37
|
+
"@types/mocha": "^10.0.9",
|
|
38
|
+
"chai": "^4.3.8",
|
|
39
|
+
"dotenv": "^16.3.1",
|
|
40
|
+
"eslint": "^8.49.0",
|
|
41
|
+
"eslint-plugin-import": "^2.31.0",
|
|
42
|
+
"mocha": "^10.2.0",
|
|
43
|
+
"nock": "^14.0.0",
|
|
44
|
+
"ts-node": "^10.9.2",
|
|
45
|
+
"typescript": "^5.2.2"
|
|
46
|
+
}
|
|
47
|
+
}
|