@defisaver/positions-sdk 0.0.199 → 0.0.201-fluid-dev
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/cjs/config/contracts.d.ts +169 -4
- package/cjs/config/contracts.js +20 -0
- package/cjs/contracts.d.ts +2 -0
- package/cjs/contracts.js +3 -1
- package/cjs/fluid/index.d.ts +38 -0
- package/cjs/fluid/index.js +163 -0
- package/cjs/helpers/fluidHelpers/index.d.ts +6 -0
- package/cjs/helpers/fluidHelpers/index.js +40 -0
- package/cjs/helpers/index.d.ts +2 -0
- package/cjs/helpers/index.js +3 -1
- package/cjs/helpers/liquityV2Helpers/index.d.ts +12 -0
- package/cjs/helpers/liquityV2Helpers/index.js +63 -0
- package/cjs/index.d.ts +3 -1
- package/cjs/index.js +5 -1
- package/cjs/liquityV2/index.d.ts +18 -0
- package/cjs/liquityV2/index.js +194 -0
- package/cjs/markets/aave/marketAssets.js +1 -1
- package/cjs/markets/fluid/index.d.ts +174 -0
- package/cjs/markets/fluid/index.js +1286 -0
- package/cjs/markets/index.d.ts +2 -0
- package/cjs/markets/index.js +5 -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/FluidView.d.ts +318 -0
- package/cjs/types/contracts/generated/FluidView.js +5 -0
- 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 +4 -0
- package/cjs/types/fluid.d.ts +225 -0
- package/cjs/types/fluid.js +129 -0
- package/cjs/types/index.d.ts +2 -0
- package/cjs/types/index.js +2 -0
- package/cjs/types/liquityV2.d.ts +111 -0
- package/cjs/types/liquityV2.js +24 -0
- package/esm/config/contracts.d.ts +169 -4
- package/esm/config/contracts.js +20 -0
- package/esm/contracts.d.ts +2 -0
- package/esm/contracts.js +2 -0
- package/esm/fluid/index.d.ts +38 -0
- package/esm/fluid/index.js +153 -0
- package/esm/helpers/fluidHelpers/index.d.ts +6 -0
- package/esm/helpers/fluidHelpers/index.js +33 -0
- package/esm/helpers/index.d.ts +2 -0
- package/esm/helpers/index.js +2 -0
- package/esm/helpers/liquityV2Helpers/index.d.ts +12 -0
- package/esm/helpers/liquityV2Helpers/index.js +55 -0
- package/esm/index.d.ts +3 -1
- package/esm/index.js +3 -1
- package/esm/liquityV2/index.d.ts +18 -0
- package/esm/liquityV2/index.js +183 -0
- package/esm/markets/aave/marketAssets.js +1 -1
- package/esm/markets/fluid/index.d.ts +174 -0
- package/esm/markets/fluid/index.js +1196 -0
- package/esm/markets/index.d.ts +2 -0
- package/esm/markets/index.js +2 -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/FluidView.d.ts +318 -0
- package/esm/types/contracts/generated/FluidView.js +4 -0
- 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 +4 -0
- package/esm/types/fluid.d.ts +225 -0
- package/esm/types/fluid.js +126 -0
- package/esm/types/index.d.ts +2 -0
- package/esm/types/index.js +2 -0
- package/esm/types/liquityV2.d.ts +111 -0
- package/esm/types/liquityV2.js +21 -0
- package/package.json +2 -2
- package/src/config/contracts.js +20 -0
- package/src/contracts.ts +2 -0
- package/src/fluid/index.ts +220 -0
- package/src/helpers/fluidHelpers/index.ts +54 -0
- package/src/helpers/index.ts +3 -1
- package/src/helpers/liquityV2Helpers/index.ts +80 -0
- package/src/index.ts +4 -0
- package/src/liquityV2/index.ts +228 -0
- package/src/markets/aave/marketAssets.ts +1 -1
- package/src/markets/fluid/index.ts +1290 -0
- package/src/markets/index.ts +3 -2
- package/src/markets/liquityV2/index.ts +44 -0
- package/src/moneymarket/moneymarketCommonService.ts +1 -1
- package/src/types/contracts/generated/FluidView.ts +399 -0
- 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 +4 -0
- package/src/types/fluid.ts +240 -0
- package/src/types/index.ts +3 -1
- package/src/types/liquityV2.ts +119 -0
package/cjs/markets/index.d.ts
CHANGED
|
@@ -4,4 +4,6 @@ export { SparkMarkets } from './spark';
|
|
|
4
4
|
export { CrvUsdMarkets } from './curveUsd';
|
|
5
5
|
export { MorphoBlueMarkets, findMorphoBlueMarket } from './morphoBlue';
|
|
6
6
|
export { LlamaLendMarkets } from './llamaLend';
|
|
7
|
+
export { LiquityV2Markets } from './liquityV2';
|
|
7
8
|
export { EulerV2Markets } from './euler';
|
|
9
|
+
export { FluidMarkets } from './fluid';
|
package/cjs/markets/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EulerV2Markets = exports.LlamaLendMarkets = exports.findMorphoBlueMarket = exports.MorphoBlueMarkets = exports.CrvUsdMarkets = exports.SparkMarkets = exports.v3USDTCollAssets = exports.v3USDCeCollAssets = exports.v3USDCCollAssets = exports.v3USDbCCollAssets = exports.v3ETHCollAssets = exports.compoundV2CollateralAssets = exports.CompoundMarkets = exports.getAaveV3MarketByMarketAddress = exports.morphoAaveV3AssetEthMarket = exports.morphoAaveV2AssetDefaultMarket = exports.aaveV3AssetsDefaultMarket = exports.aaveV2AssetsDefaultMarket = exports.aaveV1AssetsDefaultMarket = exports.AaveMarkets = void 0;
|
|
3
|
+
exports.FluidMarkets = exports.EulerV2Markets = exports.LiquityV2Markets = exports.LlamaLendMarkets = exports.findMorphoBlueMarket = exports.MorphoBlueMarkets = exports.CrvUsdMarkets = exports.SparkMarkets = exports.v3USDTCollAssets = exports.v3USDCeCollAssets = exports.v3USDCCollAssets = exports.v3USDbCCollAssets = exports.v3ETHCollAssets = exports.compoundV2CollateralAssets = exports.CompoundMarkets = exports.getAaveV3MarketByMarketAddress = exports.morphoAaveV3AssetEthMarket = exports.morphoAaveV2AssetDefaultMarket = exports.aaveV3AssetsDefaultMarket = exports.aaveV2AssetsDefaultMarket = exports.aaveV1AssetsDefaultMarket = exports.AaveMarkets = void 0;
|
|
4
4
|
var aave_1 = require("./aave");
|
|
5
5
|
Object.defineProperty(exports, "AaveMarkets", { enumerable: true, get: function () { return aave_1.AaveMarkets; } });
|
|
6
6
|
Object.defineProperty(exports, "aaveV1AssetsDefaultMarket", { enumerable: true, get: function () { return aave_1.aaveV1AssetsDefaultMarket; } });
|
|
@@ -26,5 +26,9 @@ Object.defineProperty(exports, "MorphoBlueMarkets", { enumerable: true, get: fun
|
|
|
26
26
|
Object.defineProperty(exports, "findMorphoBlueMarket", { enumerable: true, get: function () { return morphoBlue_1.findMorphoBlueMarket; } });
|
|
27
27
|
var llamaLend_1 = require("./llamaLend");
|
|
28
28
|
Object.defineProperty(exports, "LlamaLendMarkets", { enumerable: true, get: function () { return llamaLend_1.LlamaLendMarkets; } });
|
|
29
|
+
var liquityV2_1 = require("./liquityV2");
|
|
30
|
+
Object.defineProperty(exports, "LiquityV2Markets", { enumerable: true, get: function () { return liquityV2_1.LiquityV2Markets; } });
|
|
29
31
|
var euler_1 = require("./euler");
|
|
30
32
|
Object.defineProperty(exports, "EulerV2Markets", { enumerable: true, get: function () { return euler_1.EulerV2Markets; } });
|
|
33
|
+
var fluid_1 = require("./fluid");
|
|
34
|
+
Object.defineProperty(exports, "FluidMarkets", { enumerable: true, get: function () { return fluid_1.FluidMarkets; } });
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { NetworkNumber } from '../../types/common';
|
|
2
|
+
import { LiquityV2MarketInfo } from '../../types/liquityV2';
|
|
3
|
+
export declare const LIQUITY_V2_ETH_MARKET: (networkId?: NetworkNumber) => LiquityV2MarketInfo;
|
|
4
|
+
export declare const LIQUITY_V2_WSTETH_MARKET: (networkId?: NetworkNumber) => LiquityV2MarketInfo;
|
|
5
|
+
export declare const LIQUITY_V2_RETH_MARKET: (networkId?: NetworkNumber) => LiquityV2MarketInfo;
|
|
6
|
+
export declare const LiquityV2Markets: (networkId: NetworkNumber) => {
|
|
7
|
+
readonly liquityv2eth: LiquityV2MarketInfo;
|
|
8
|
+
readonly liquityv2wsteth: LiquityV2MarketInfo;
|
|
9
|
+
readonly liquityv2reth: LiquityV2MarketInfo;
|
|
10
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LiquityV2Markets = exports.LIQUITY_V2_RETH_MARKET = exports.LIQUITY_V2_WSTETH_MARKET = exports.LIQUITY_V2_ETH_MARKET = void 0;
|
|
4
|
+
const common_1 = require("../../types/common");
|
|
5
|
+
const liquityV2_1 = require("../../types/liquityV2");
|
|
6
|
+
const LIQUITY_V2_ETH_MARKET = (networkId = common_1.NetworkNumber.Eth) => ({
|
|
7
|
+
chainIds: [common_1.NetworkNumber.Eth],
|
|
8
|
+
label: 'Liquity V2 ETH',
|
|
9
|
+
shortLabel: 'ETH',
|
|
10
|
+
value: liquityV2_1.LiquityV2Versions.LiquityV2Eth,
|
|
11
|
+
url: 'eth',
|
|
12
|
+
debtToken: 'BOLD',
|
|
13
|
+
collateralToken: 'ETH',
|
|
14
|
+
marketAddress: '0x38e1f07b954cfab7239d7acab49997fbaad96476',
|
|
15
|
+
protocolName: 'liquity-v2',
|
|
16
|
+
});
|
|
17
|
+
exports.LIQUITY_V2_ETH_MARKET = LIQUITY_V2_ETH_MARKET;
|
|
18
|
+
const LIQUITY_V2_WSTETH_MARKET = (networkId = common_1.NetworkNumber.Eth) => ({
|
|
19
|
+
chainIds: [common_1.NetworkNumber.Eth],
|
|
20
|
+
label: 'Liquity V2 wstETH',
|
|
21
|
+
shortLabel: 'wstETH',
|
|
22
|
+
value: liquityV2_1.LiquityV2Versions.LiquityV2WstEth,
|
|
23
|
+
url: 'wsteth',
|
|
24
|
+
debtToken: 'BOLD',
|
|
25
|
+
collateralToken: 'wstETH',
|
|
26
|
+
marketAddress: '0x2d4ef56cb626e9a4c90c156018ba9ce269573c61',
|
|
27
|
+
protocolName: 'liquity-v2',
|
|
28
|
+
});
|
|
29
|
+
exports.LIQUITY_V2_WSTETH_MARKET = LIQUITY_V2_WSTETH_MARKET;
|
|
30
|
+
const LIQUITY_V2_RETH_MARKET = (networkId = common_1.NetworkNumber.Eth) => ({
|
|
31
|
+
chainIds: [common_1.NetworkNumber.Eth],
|
|
32
|
+
label: 'Liquity V2 rETH',
|
|
33
|
+
shortLabel: 'rETH',
|
|
34
|
+
value: liquityV2_1.LiquityV2Versions.LiquityV2REth,
|
|
35
|
+
url: 'reth',
|
|
36
|
+
debtToken: 'BOLD',
|
|
37
|
+
collateralToken: 'rETH',
|
|
38
|
+
marketAddress: '0x3b48169809dd827f22c9e0f2d71ff12ea7a94a2f',
|
|
39
|
+
protocolName: 'liquity-v2',
|
|
40
|
+
});
|
|
41
|
+
exports.LIQUITY_V2_RETH_MARKET = LIQUITY_V2_RETH_MARKET;
|
|
42
|
+
const LiquityV2Markets = (networkId) => ({
|
|
43
|
+
[liquityV2_1.LiquityV2Versions.LiquityV2Eth]: (0, exports.LIQUITY_V2_ETH_MARKET)(networkId),
|
|
44
|
+
[liquityV2_1.LiquityV2Versions.LiquityV2WstEth]: (0, exports.LIQUITY_V2_WSTETH_MARKET)(networkId),
|
|
45
|
+
[liquityV2_1.LiquityV2Versions.LiquityV2REth]: (0, exports.LIQUITY_V2_RETH_MARKET)(networkId),
|
|
46
|
+
});
|
|
47
|
+
exports.LiquityV2Markets = LiquityV2Markets;
|
|
@@ -27,7 +27,7 @@ const calcLeverageLiqPrice = (leverageType, assetPrice, borrowedUsd, borrowLimit
|
|
|
27
27
|
exports.calcLeverageLiqPrice = calcLeverageLiqPrice;
|
|
28
28
|
const calculateBorrowingAssetLimit = (assetBorrowedUsd, borrowLimitUsd) => new decimal_js_1.default(assetBorrowedUsd).div(borrowLimitUsd).times(100).toString();
|
|
29
29
|
exports.calculateBorrowingAssetLimit = calculateBorrowingAssetLimit;
|
|
30
|
-
exports.STABLE_ASSETS = ['DAI', 'USDC', 'USDT', 'TUSD', 'USDP', 'GUSD', 'BUSD', 'SUSD', 'FRAX', 'LUSD', 'USDC.e', 'GHO', 'sDAI', 'crvUSD'];
|
|
30
|
+
exports.STABLE_ASSETS = ['DAI', 'USDC', 'USDT', 'TUSD', 'USDP', 'GUSD', 'BUSD', 'SUSD', 'FRAX', 'LUSD', 'USDC.e', 'GHO', 'sDAI', 'crvUSD', 'BOLD'];
|
|
31
31
|
const isLeveragedPos = (usedAssets, dustLimit = 5) => {
|
|
32
32
|
let borrowUnstable = 0;
|
|
33
33
|
let supplyStable = 0;
|
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import type BN from "bn.js";
|
|
3
|
+
import type { ContractOptions } from "web3-eth-contract";
|
|
4
|
+
import type { EventLog } from "web3-core";
|
|
5
|
+
import type { EventEmitter } from "events";
|
|
6
|
+
import type { Callback, NonPayableTransactionObject, BlockType, BaseContract } from "./types";
|
|
7
|
+
export interface EventOptions {
|
|
8
|
+
filter?: object;
|
|
9
|
+
fromBlock?: BlockType;
|
|
10
|
+
topics?: string[];
|
|
11
|
+
}
|
|
12
|
+
export declare namespace FluidView {
|
|
13
|
+
type UserPositionStruct = [
|
|
14
|
+
number | string | BN,
|
|
15
|
+
string,
|
|
16
|
+
boolean,
|
|
17
|
+
boolean,
|
|
18
|
+
number | string | BN,
|
|
19
|
+
number | string | BN,
|
|
20
|
+
number | string | BN,
|
|
21
|
+
number | string | BN,
|
|
22
|
+
number | string | BN
|
|
23
|
+
] | {
|
|
24
|
+
nftId: number | string | BN;
|
|
25
|
+
owner: string;
|
|
26
|
+
isLiquidated: boolean;
|
|
27
|
+
isSupplyPosition: boolean;
|
|
28
|
+
supply: number | string | BN;
|
|
29
|
+
borrow: number | string | BN;
|
|
30
|
+
ratio: number | string | BN;
|
|
31
|
+
tick: number | string | BN;
|
|
32
|
+
tickId: number | string | BN;
|
|
33
|
+
};
|
|
34
|
+
type UserPositionStructOutputArray = [
|
|
35
|
+
string,
|
|
36
|
+
string,
|
|
37
|
+
boolean,
|
|
38
|
+
boolean,
|
|
39
|
+
string,
|
|
40
|
+
string,
|
|
41
|
+
string,
|
|
42
|
+
string,
|
|
43
|
+
string
|
|
44
|
+
];
|
|
45
|
+
type UserPositionStructOutputStruct = {
|
|
46
|
+
nftId: string;
|
|
47
|
+
owner: string;
|
|
48
|
+
isLiquidated: boolean;
|
|
49
|
+
isSupplyPosition: boolean;
|
|
50
|
+
supply: string;
|
|
51
|
+
borrow: string;
|
|
52
|
+
ratio: string;
|
|
53
|
+
tick: string;
|
|
54
|
+
tickId: string;
|
|
55
|
+
};
|
|
56
|
+
type UserPositionStructOutput = UserPositionStructOutputArray & UserPositionStructOutputStruct;
|
|
57
|
+
type VaultDataStruct = [
|
|
58
|
+
string,
|
|
59
|
+
number | string | BN,
|
|
60
|
+
number | string | BN,
|
|
61
|
+
boolean,
|
|
62
|
+
boolean,
|
|
63
|
+
string,
|
|
64
|
+
string,
|
|
65
|
+
string,
|
|
66
|
+
string,
|
|
67
|
+
number | string | BN,
|
|
68
|
+
number | string | BN,
|
|
69
|
+
number | string | BN,
|
|
70
|
+
number | string | BN,
|
|
71
|
+
number | string | BN,
|
|
72
|
+
number | string | BN,
|
|
73
|
+
number | string | BN,
|
|
74
|
+
number | string | BN,
|
|
75
|
+
number | string | BN,
|
|
76
|
+
number | string | BN,
|
|
77
|
+
string,
|
|
78
|
+
number | string | BN,
|
|
79
|
+
number | string | BN,
|
|
80
|
+
number | string | BN,
|
|
81
|
+
number | string | BN,
|
|
82
|
+
number | string | BN,
|
|
83
|
+
number | string | BN,
|
|
84
|
+
number | string | BN,
|
|
85
|
+
number | string | BN,
|
|
86
|
+
number | string | BN,
|
|
87
|
+
number | string | BN,
|
|
88
|
+
number | string | BN,
|
|
89
|
+
number | string | BN,
|
|
90
|
+
number | string | BN,
|
|
91
|
+
number | string | BN,
|
|
92
|
+
number | string | BN,
|
|
93
|
+
number | string | BN,
|
|
94
|
+
number | string | BN,
|
|
95
|
+
number | string | BN,
|
|
96
|
+
number | string | BN,
|
|
97
|
+
number | string | BN,
|
|
98
|
+
number | string | BN,
|
|
99
|
+
number | string | BN,
|
|
100
|
+
number | string | BN,
|
|
101
|
+
number | string | BN,
|
|
102
|
+
number | string | BN,
|
|
103
|
+
number | string | BN,
|
|
104
|
+
number | string | BN,
|
|
105
|
+
number | string | BN,
|
|
106
|
+
number | string | BN,
|
|
107
|
+
number | string | BN
|
|
108
|
+
] | {
|
|
109
|
+
vault: string;
|
|
110
|
+
vaultId: number | string | BN;
|
|
111
|
+
vaultType: number | string | BN;
|
|
112
|
+
isSmartColl: boolean;
|
|
113
|
+
isSmartDebt: boolean;
|
|
114
|
+
supplyToken0: string;
|
|
115
|
+
supplyToken1: string;
|
|
116
|
+
borrowToken0: string;
|
|
117
|
+
borrowToken1: string;
|
|
118
|
+
supplyToken0Decimals: number | string | BN;
|
|
119
|
+
supplyToken1Decimals: number | string | BN;
|
|
120
|
+
borrowToken0Decimals: number | string | BN;
|
|
121
|
+
borrowToken1Decimals: number | string | BN;
|
|
122
|
+
collateralFactor: number | string | BN;
|
|
123
|
+
liquidationThreshold: number | string | BN;
|
|
124
|
+
liquidationMaxLimit: number | string | BN;
|
|
125
|
+
withdrawalGap: number | string | BN;
|
|
126
|
+
liquidationPenalty: number | string | BN;
|
|
127
|
+
borrowFee: number | string | BN;
|
|
128
|
+
oracle: string;
|
|
129
|
+
oraclePriceOperate: number | string | BN;
|
|
130
|
+
oraclePriceLiquidate: number | string | BN;
|
|
131
|
+
priceOfSupplyToken0InUSD: number | string | BN;
|
|
132
|
+
priceOfSupplyToken1InUSD: number | string | BN;
|
|
133
|
+
priceOfBorrowToken0InUSD: number | string | BN;
|
|
134
|
+
priceOfBorrowToken1InUSD: number | string | BN;
|
|
135
|
+
vaultSupplyExchangePrice: number | string | BN;
|
|
136
|
+
vaultBorrowExchangePrice: number | string | BN;
|
|
137
|
+
supplyRateVault: number | string | BN;
|
|
138
|
+
borrowRateVault: number | string | BN;
|
|
139
|
+
rewardsOrFeeRateSupply: number | string | BN;
|
|
140
|
+
rewardsOrFeeRateBorrow: number | string | BN;
|
|
141
|
+
totalPositions: number | string | BN;
|
|
142
|
+
totalSupplyVault: number | string | BN;
|
|
143
|
+
totalBorrowVault: number | string | BN;
|
|
144
|
+
withdrawalLimit: number | string | BN;
|
|
145
|
+
withdrawableUntilLimit: number | string | BN;
|
|
146
|
+
withdrawable: number | string | BN;
|
|
147
|
+
baseWithdrawalLimit: number | string | BN;
|
|
148
|
+
withdrawExpandPercent: number | string | BN;
|
|
149
|
+
withdrawExpandDuration: number | string | BN;
|
|
150
|
+
borrowLimit: number | string | BN;
|
|
151
|
+
borrowableUntilLimit: number | string | BN;
|
|
152
|
+
borrowable: number | string | BN;
|
|
153
|
+
borrowLimitUtilization: number | string | BN;
|
|
154
|
+
maxBorrowLimit: number | string | BN;
|
|
155
|
+
borrowExpandPercent: number | string | BN;
|
|
156
|
+
borrowExpandDuration: number | string | BN;
|
|
157
|
+
baseBorrowLimit: number | string | BN;
|
|
158
|
+
minimumBorrowing: number | string | BN;
|
|
159
|
+
};
|
|
160
|
+
type VaultDataStructOutputArray = [
|
|
161
|
+
string,
|
|
162
|
+
string,
|
|
163
|
+
string,
|
|
164
|
+
boolean,
|
|
165
|
+
boolean,
|
|
166
|
+
string,
|
|
167
|
+
string,
|
|
168
|
+
string,
|
|
169
|
+
string,
|
|
170
|
+
string,
|
|
171
|
+
string,
|
|
172
|
+
string,
|
|
173
|
+
string,
|
|
174
|
+
string,
|
|
175
|
+
string,
|
|
176
|
+
string,
|
|
177
|
+
string,
|
|
178
|
+
string,
|
|
179
|
+
string,
|
|
180
|
+
string,
|
|
181
|
+
string,
|
|
182
|
+
string,
|
|
183
|
+
string,
|
|
184
|
+
string,
|
|
185
|
+
string,
|
|
186
|
+
string,
|
|
187
|
+
string,
|
|
188
|
+
string,
|
|
189
|
+
string,
|
|
190
|
+
string,
|
|
191
|
+
string,
|
|
192
|
+
string,
|
|
193
|
+
string,
|
|
194
|
+
string,
|
|
195
|
+
string,
|
|
196
|
+
string,
|
|
197
|
+
string,
|
|
198
|
+
string,
|
|
199
|
+
string,
|
|
200
|
+
string,
|
|
201
|
+
string,
|
|
202
|
+
string,
|
|
203
|
+
string,
|
|
204
|
+
string,
|
|
205
|
+
string,
|
|
206
|
+
string,
|
|
207
|
+
string,
|
|
208
|
+
string,
|
|
209
|
+
string,
|
|
210
|
+
string
|
|
211
|
+
];
|
|
212
|
+
type VaultDataStructOutputStruct = {
|
|
213
|
+
vault: string;
|
|
214
|
+
vaultId: string;
|
|
215
|
+
vaultType: string;
|
|
216
|
+
isSmartColl: boolean;
|
|
217
|
+
isSmartDebt: boolean;
|
|
218
|
+
supplyToken0: string;
|
|
219
|
+
supplyToken1: string;
|
|
220
|
+
borrowToken0: string;
|
|
221
|
+
borrowToken1: string;
|
|
222
|
+
supplyToken0Decimals: string;
|
|
223
|
+
supplyToken1Decimals: string;
|
|
224
|
+
borrowToken0Decimals: string;
|
|
225
|
+
borrowToken1Decimals: string;
|
|
226
|
+
collateralFactor: string;
|
|
227
|
+
liquidationThreshold: string;
|
|
228
|
+
liquidationMaxLimit: string;
|
|
229
|
+
withdrawalGap: string;
|
|
230
|
+
liquidationPenalty: string;
|
|
231
|
+
borrowFee: string;
|
|
232
|
+
oracle: string;
|
|
233
|
+
oraclePriceOperate: string;
|
|
234
|
+
oraclePriceLiquidate: string;
|
|
235
|
+
priceOfSupplyToken0InUSD: string;
|
|
236
|
+
priceOfSupplyToken1InUSD: string;
|
|
237
|
+
priceOfBorrowToken0InUSD: string;
|
|
238
|
+
priceOfBorrowToken1InUSD: string;
|
|
239
|
+
vaultSupplyExchangePrice: string;
|
|
240
|
+
vaultBorrowExchangePrice: string;
|
|
241
|
+
supplyRateVault: string;
|
|
242
|
+
borrowRateVault: string;
|
|
243
|
+
rewardsOrFeeRateSupply: string;
|
|
244
|
+
rewardsOrFeeRateBorrow: string;
|
|
245
|
+
totalPositions: string;
|
|
246
|
+
totalSupplyVault: string;
|
|
247
|
+
totalBorrowVault: string;
|
|
248
|
+
withdrawalLimit: string;
|
|
249
|
+
withdrawableUntilLimit: string;
|
|
250
|
+
withdrawable: string;
|
|
251
|
+
baseWithdrawalLimit: string;
|
|
252
|
+
withdrawExpandPercent: string;
|
|
253
|
+
withdrawExpandDuration: string;
|
|
254
|
+
borrowLimit: string;
|
|
255
|
+
borrowableUntilLimit: string;
|
|
256
|
+
borrowable: string;
|
|
257
|
+
borrowLimitUtilization: string;
|
|
258
|
+
maxBorrowLimit: string;
|
|
259
|
+
borrowExpandPercent: string;
|
|
260
|
+
borrowExpandDuration: string;
|
|
261
|
+
baseBorrowLimit: string;
|
|
262
|
+
minimumBorrowing: string;
|
|
263
|
+
};
|
|
264
|
+
type VaultDataStructOutput = VaultDataStructOutputArray & VaultDataStructOutputStruct;
|
|
265
|
+
}
|
|
266
|
+
export interface FluidView extends BaseContract {
|
|
267
|
+
constructor(jsonInterface: any[], address?: string, options?: ContractOptions): FluidView;
|
|
268
|
+
clone(): FluidView;
|
|
269
|
+
methods: {
|
|
270
|
+
feedRegistry(): NonPayableTransactionObject<string>;
|
|
271
|
+
getAaveTokenPriceInETH(_tokenAddr: string): NonPayableTransactionObject<string>;
|
|
272
|
+
getAaveTokenPriceInUSD(_tokenAddr: string): NonPayableTransactionObject<string>;
|
|
273
|
+
getAaveV3TokenPriceInETH(_tokenAddr: string): NonPayableTransactionObject<string>;
|
|
274
|
+
getAaveV3TokenPriceInUSD(_tokenAddr: string): NonPayableTransactionObject<string>;
|
|
275
|
+
getAddrForChainlinkOracle(_inputTokenAddr: string): NonPayableTransactionObject<string>;
|
|
276
|
+
getChainlinkPriceInETH(_inputTokenAddr: string): NonPayableTransactionObject<string>;
|
|
277
|
+
getChainlinkPriceInUSD(_inputTokenAddr: string, _useFallback: boolean): NonPayableTransactionObject<string>;
|
|
278
|
+
getPositionByNftId(_nftId: number | string | BN): NonPayableTransactionObject<[
|
|
279
|
+
FluidView.UserPositionStructOutput,
|
|
280
|
+
FluidView.VaultDataStructOutput
|
|
281
|
+
] & {
|
|
282
|
+
position: FluidView.UserPositionStructOutput;
|
|
283
|
+
vault: FluidView.VaultDataStructOutput;
|
|
284
|
+
}>;
|
|
285
|
+
getPriceInETH(_inputTokenAddr: string): NonPayableTransactionObject<string>;
|
|
286
|
+
getPriceInUSD(_inputTokenAddr: string): NonPayableTransactionObject<string>;
|
|
287
|
+
getRatio(_nftId: number | string | BN): NonPayableTransactionObject<string>;
|
|
288
|
+
"getRoundInfo(address,uint80,address)"(_inputTokenAddr: string, _roundId: number | string | BN, aggregator: string): NonPayableTransactionObject<[
|
|
289
|
+
string,
|
|
290
|
+
string
|
|
291
|
+
] & {
|
|
292
|
+
updateTimestamp: string;
|
|
293
|
+
}>;
|
|
294
|
+
"getRoundInfo(address,uint80)"(_inputTokenAddr: string, _roundId: number | string | BN): NonPayableTransactionObject<[
|
|
295
|
+
string,
|
|
296
|
+
string
|
|
297
|
+
] & {
|
|
298
|
+
updateTimestamp: string;
|
|
299
|
+
}>;
|
|
300
|
+
getSparkTokenPriceInETH(_tokenAddr: string): NonPayableTransactionObject<string>;
|
|
301
|
+
getSparkTokenPriceInUSD(_tokenAddr: string): NonPayableTransactionObject<string>;
|
|
302
|
+
getUserNftIds(_user: string): NonPayableTransactionObject<string[]>;
|
|
303
|
+
getUserPositions(_user: string): NonPayableTransactionObject<[
|
|
304
|
+
FluidView.UserPositionStructOutput[],
|
|
305
|
+
FluidView.VaultDataStructOutput[]
|
|
306
|
+
] & {
|
|
307
|
+
positions: FluidView.UserPositionStructOutput[];
|
|
308
|
+
vaults: FluidView.VaultDataStructOutput[];
|
|
309
|
+
}>;
|
|
310
|
+
getVaultAddresses(_ids: number | string | BN[], _fetchAll: boolean): NonPayableTransactionObject<string[]>;
|
|
311
|
+
getVaultData(_vault: string): NonPayableTransactionObject<FluidView.VaultDataStructOutput>;
|
|
312
|
+
getWBtcPrice(_btcPrice: number | string | BN): NonPayableTransactionObject<string>;
|
|
313
|
+
getWStEthPrice(_stEthPrice: number | string | BN): NonPayableTransactionObject<string>;
|
|
314
|
+
};
|
|
315
|
+
events: {
|
|
316
|
+
allEvents(options?: EventOptions, cb?: Callback<EventLog>): EventEmitter;
|
|
317
|
+
};
|
|
318
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import type BN from "bn.js";
|
|
3
|
+
import type { ContractOptions } from "web3-eth-contract";
|
|
4
|
+
import type { EventLog } from "web3-core";
|
|
5
|
+
import type { EventEmitter } from "events";
|
|
6
|
+
import type { Callback, NonPayableTransactionObject, BlockType, ContractEventLog, BaseContract } from "./types";
|
|
7
|
+
export interface EventOptions {
|
|
8
|
+
filter?: object;
|
|
9
|
+
fromBlock?: BlockType;
|
|
10
|
+
topics?: string[];
|
|
11
|
+
}
|
|
12
|
+
export type BorrowerOperationsAddressChanged = ContractEventLog<{
|
|
13
|
+
_newBorrowerOperationsAddress: string;
|
|
14
|
+
0: string;
|
|
15
|
+
}>;
|
|
16
|
+
export type CollBalanceUpdated = ContractEventLog<{
|
|
17
|
+
_account: string;
|
|
18
|
+
_newBalance: string;
|
|
19
|
+
0: string;
|
|
20
|
+
1: string;
|
|
21
|
+
}>;
|
|
22
|
+
export type CollSent = ContractEventLog<{
|
|
23
|
+
_to: string;
|
|
24
|
+
_amount: string;
|
|
25
|
+
0: string;
|
|
26
|
+
1: string;
|
|
27
|
+
}>;
|
|
28
|
+
export type TroveManagerAddressChanged = ContractEventLog<{
|
|
29
|
+
_newTroveManagerAddress: string;
|
|
30
|
+
0: string;
|
|
31
|
+
}>;
|
|
32
|
+
export interface LiquityV2CollSurplusPool extends BaseContract {
|
|
33
|
+
constructor(jsonInterface: any[], address?: string, options?: ContractOptions): LiquityV2CollSurplusPool;
|
|
34
|
+
clone(): LiquityV2CollSurplusPool;
|
|
35
|
+
methods: {
|
|
36
|
+
NAME(): NonPayableTransactionObject<string>;
|
|
37
|
+
accountSurplus(_account: string, _amount: number | string | BN): NonPayableTransactionObject<void>;
|
|
38
|
+
borrowerOperationsAddress(): NonPayableTransactionObject<string>;
|
|
39
|
+
claimColl(_account: string): NonPayableTransactionObject<void>;
|
|
40
|
+
collToken(): NonPayableTransactionObject<string>;
|
|
41
|
+
getCollBalance(): NonPayableTransactionObject<string>;
|
|
42
|
+
getCollateral(_account: string): NonPayableTransactionObject<string>;
|
|
43
|
+
troveManagerAddress(): NonPayableTransactionObject<string>;
|
|
44
|
+
};
|
|
45
|
+
events: {
|
|
46
|
+
BorrowerOperationsAddressChanged(cb?: Callback<BorrowerOperationsAddressChanged>): EventEmitter;
|
|
47
|
+
BorrowerOperationsAddressChanged(options?: EventOptions, cb?: Callback<BorrowerOperationsAddressChanged>): EventEmitter;
|
|
48
|
+
CollBalanceUpdated(cb?: Callback<CollBalanceUpdated>): EventEmitter;
|
|
49
|
+
CollBalanceUpdated(options?: EventOptions, cb?: Callback<CollBalanceUpdated>): EventEmitter;
|
|
50
|
+
CollSent(cb?: Callback<CollSent>): EventEmitter;
|
|
51
|
+
CollSent(options?: EventOptions, cb?: Callback<CollSent>): EventEmitter;
|
|
52
|
+
TroveManagerAddressChanged(cb?: Callback<TroveManagerAddressChanged>): EventEmitter;
|
|
53
|
+
TroveManagerAddressChanged(options?: EventOptions, cb?: Callback<TroveManagerAddressChanged>): EventEmitter;
|
|
54
|
+
allEvents(options?: EventOptions, cb?: Callback<EventLog>): EventEmitter;
|
|
55
|
+
};
|
|
56
|
+
once(event: "BorrowerOperationsAddressChanged", cb: Callback<BorrowerOperationsAddressChanged>): void;
|
|
57
|
+
once(event: "BorrowerOperationsAddressChanged", options: EventOptions, cb: Callback<BorrowerOperationsAddressChanged>): void;
|
|
58
|
+
once(event: "CollBalanceUpdated", cb: Callback<CollBalanceUpdated>): void;
|
|
59
|
+
once(event: "CollBalanceUpdated", options: EventOptions, cb: Callback<CollBalanceUpdated>): void;
|
|
60
|
+
once(event: "CollSent", cb: Callback<CollSent>): void;
|
|
61
|
+
once(event: "CollSent", options: EventOptions, cb: Callback<CollSent>): void;
|
|
62
|
+
once(event: "TroveManagerAddressChanged", cb: Callback<TroveManagerAddressChanged>): void;
|
|
63
|
+
once(event: "TroveManagerAddressChanged", options: EventOptions, cb: Callback<TroveManagerAddressChanged>): void;
|
|
64
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import type BN from "bn.js";
|
|
3
|
+
import type { ContractOptions } from "web3-eth-contract";
|
|
4
|
+
import type { EventLog } from "web3-core";
|
|
5
|
+
import type { EventEmitter } from "events";
|
|
6
|
+
import type { Callback, NonPayableTransactionObject, BlockType, ContractEventLog, BaseContract } from "./types";
|
|
7
|
+
export interface EventOptions {
|
|
8
|
+
filter?: object;
|
|
9
|
+
fromBlock?: BlockType;
|
|
10
|
+
topics?: string[];
|
|
11
|
+
}
|
|
12
|
+
export type Approval = ContractEventLog<{
|
|
13
|
+
owner: string;
|
|
14
|
+
approved: string;
|
|
15
|
+
tokenId: string;
|
|
16
|
+
0: string;
|
|
17
|
+
1: string;
|
|
18
|
+
2: string;
|
|
19
|
+
}>;
|
|
20
|
+
export type ApprovalForAll = ContractEventLog<{
|
|
21
|
+
owner: string;
|
|
22
|
+
operator: string;
|
|
23
|
+
approved: boolean;
|
|
24
|
+
0: string;
|
|
25
|
+
1: string;
|
|
26
|
+
2: boolean;
|
|
27
|
+
}>;
|
|
28
|
+
export type Transfer = ContractEventLog<{
|
|
29
|
+
from: string;
|
|
30
|
+
to: string;
|
|
31
|
+
tokenId: string;
|
|
32
|
+
0: string;
|
|
33
|
+
1: string;
|
|
34
|
+
2: string;
|
|
35
|
+
}>;
|
|
36
|
+
export interface LiquityV2TroveNFT extends BaseContract {
|
|
37
|
+
constructor(jsonInterface: any[], address?: string, options?: ContractOptions): LiquityV2TroveNFT;
|
|
38
|
+
clone(): LiquityV2TroveNFT;
|
|
39
|
+
methods: {
|
|
40
|
+
approve(to: string, tokenId: number | string | BN): NonPayableTransactionObject<void>;
|
|
41
|
+
balanceOf(owner: string): NonPayableTransactionObject<string>;
|
|
42
|
+
burn(_troveId: number | string | BN): NonPayableTransactionObject<void>;
|
|
43
|
+
getApproved(tokenId: number | string | BN): NonPayableTransactionObject<string>;
|
|
44
|
+
isApprovedForAll(owner: string, operator: string): NonPayableTransactionObject<boolean>;
|
|
45
|
+
metadataNFT(): NonPayableTransactionObject<string>;
|
|
46
|
+
mint(_owner: string, _troveId: number | string | BN): NonPayableTransactionObject<void>;
|
|
47
|
+
name(): NonPayableTransactionObject<string>;
|
|
48
|
+
ownerOf(tokenId: number | string | BN): NonPayableTransactionObject<string>;
|
|
49
|
+
"safeTransferFrom(address,address,uint256)"(from: string, to: string, tokenId: number | string | BN): NonPayableTransactionObject<void>;
|
|
50
|
+
"safeTransferFrom(address,address,uint256,bytes)"(from: string, to: string, tokenId: number | string | BN, data: string | number[]): NonPayableTransactionObject<void>;
|
|
51
|
+
setApprovalForAll(operator: string, approved: boolean): NonPayableTransactionObject<void>;
|
|
52
|
+
supportsInterface(interfaceId: string | number[]): NonPayableTransactionObject<boolean>;
|
|
53
|
+
symbol(): NonPayableTransactionObject<string>;
|
|
54
|
+
tokenURI(_tokenId: number | string | BN): NonPayableTransactionObject<string>;
|
|
55
|
+
transferFrom(from: string, to: string, tokenId: number | string | BN): NonPayableTransactionObject<void>;
|
|
56
|
+
troveManager(): NonPayableTransactionObject<string>;
|
|
57
|
+
};
|
|
58
|
+
events: {
|
|
59
|
+
Approval(cb?: Callback<Approval>): EventEmitter;
|
|
60
|
+
Approval(options?: EventOptions, cb?: Callback<Approval>): EventEmitter;
|
|
61
|
+
ApprovalForAll(cb?: Callback<ApprovalForAll>): EventEmitter;
|
|
62
|
+
ApprovalForAll(options?: EventOptions, cb?: Callback<ApprovalForAll>): EventEmitter;
|
|
63
|
+
Transfer(cb?: Callback<Transfer>): EventEmitter;
|
|
64
|
+
Transfer(options?: EventOptions, cb?: Callback<Transfer>): EventEmitter;
|
|
65
|
+
allEvents(options?: EventOptions, cb?: Callback<EventLog>): EventEmitter;
|
|
66
|
+
};
|
|
67
|
+
once(event: "Approval", cb: Callback<Approval>): void;
|
|
68
|
+
once(event: "Approval", options: EventOptions, cb: Callback<Approval>): void;
|
|
69
|
+
once(event: "ApprovalForAll", cb: Callback<ApprovalForAll>): void;
|
|
70
|
+
once(event: "ApprovalForAll", options: EventOptions, cb: Callback<ApprovalForAll>): void;
|
|
71
|
+
once(event: "Transfer", cb: Callback<Transfer>): void;
|
|
72
|
+
once(event: "Transfer", options: EventOptions, cb: Callback<Transfer>): void;
|
|
73
|
+
}
|