@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/src/markets/index.ts
CHANGED
|
@@ -20,5 +20,6 @@ export { SparkMarkets } from './spark';
|
|
|
20
20
|
export { CrvUsdMarkets } from './curveUsd';
|
|
21
21
|
export { MorphoBlueMarkets, findMorphoBlueMarket } from './morphoBlue';
|
|
22
22
|
export { LlamaLendMarkets } from './llamaLend';
|
|
23
|
-
|
|
24
|
-
export { EulerV2Markets } from './euler';
|
|
23
|
+
export { LiquityV2Markets } from './liquityV2';
|
|
24
|
+
export { EulerV2Markets } from './euler';
|
|
25
|
+
export { FluidMarkets } from './fluid';
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { NetworkNumber } from '../../types/common';
|
|
2
|
+
import { LiquityV2MarketInfo, LiquityV2Versions } from '../../types/liquityV2';
|
|
3
|
+
|
|
4
|
+
export const LIQUITY_V2_ETH_MARKET = (networkId: NetworkNumber = NetworkNumber.Eth): LiquityV2MarketInfo => ({
|
|
5
|
+
chainIds: [NetworkNumber.Eth],
|
|
6
|
+
label: 'Liquity V2 ETH',
|
|
7
|
+
shortLabel: 'ETH',
|
|
8
|
+
value: LiquityV2Versions.LiquityV2Eth,
|
|
9
|
+
url: 'eth',
|
|
10
|
+
debtToken: 'BOLD',
|
|
11
|
+
collateralToken: 'ETH',
|
|
12
|
+
marketAddress: '0x38e1f07b954cfab7239d7acab49997fbaad96476',
|
|
13
|
+
protocolName: 'liquity-v2',
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export const LIQUITY_V2_WSTETH_MARKET = (networkId: NetworkNumber = NetworkNumber.Eth): LiquityV2MarketInfo => ({
|
|
17
|
+
chainIds: [NetworkNumber.Eth],
|
|
18
|
+
label: 'Liquity V2 wstETH',
|
|
19
|
+
shortLabel: 'wstETH',
|
|
20
|
+
value: LiquityV2Versions.LiquityV2WstEth,
|
|
21
|
+
url: 'wsteth',
|
|
22
|
+
debtToken: 'BOLD',
|
|
23
|
+
collateralToken: 'wstETH',
|
|
24
|
+
marketAddress: '0x2d4ef56cb626e9a4c90c156018ba9ce269573c61',
|
|
25
|
+
protocolName: 'liquity-v2',
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
export const LIQUITY_V2_RETH_MARKET = (networkId: NetworkNumber = NetworkNumber.Eth): LiquityV2MarketInfo => ({
|
|
29
|
+
chainIds: [NetworkNumber.Eth],
|
|
30
|
+
label: 'Liquity V2 rETH',
|
|
31
|
+
shortLabel: 'rETH',
|
|
32
|
+
value: LiquityV2Versions.LiquityV2REth,
|
|
33
|
+
url: 'reth',
|
|
34
|
+
debtToken: 'BOLD',
|
|
35
|
+
collateralToken: 'rETH',
|
|
36
|
+
marketAddress: '0x3b48169809dd827f22c9e0f2d71ff12ea7a94a2f',
|
|
37
|
+
protocolName: 'liquity-v2',
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
export const LiquityV2Markets = (networkId: NetworkNumber) => ({
|
|
41
|
+
[LiquityV2Versions.LiquityV2Eth]: LIQUITY_V2_ETH_MARKET(networkId),
|
|
42
|
+
[LiquityV2Versions.LiquityV2WstEth]: LIQUITY_V2_WSTETH_MARKET(networkId),
|
|
43
|
+
[LiquityV2Versions.LiquityV2REth]: LIQUITY_V2_RETH_MARKET(networkId),
|
|
44
|
+
}) as const;
|
|
@@ -20,7 +20,7 @@ export const calcLeverageLiqPrice = (leverageType: string, assetPrice: string, b
|
|
|
20
20
|
|
|
21
21
|
export const calculateBorrowingAssetLimit = (assetBorrowedUsd: string, borrowLimitUsd: string) => new Dec(assetBorrowedUsd).div(borrowLimitUsd).times(100).toString();
|
|
22
22
|
|
|
23
|
-
export const STABLE_ASSETS = ['DAI', 'USDC', 'USDT', 'TUSD', 'USDP', 'GUSD', 'BUSD', 'SUSD', 'FRAX', 'LUSD', 'USDC.e', 'GHO', 'sDAI', 'crvUSD'];
|
|
23
|
+
export const STABLE_ASSETS = ['DAI', 'USDC', 'USDT', 'TUSD', 'USDP', 'GUSD', 'BUSD', 'SUSD', 'FRAX', 'LUSD', 'USDC.e', 'GHO', 'sDAI', 'crvUSD', 'BOLD'];
|
|
24
24
|
|
|
25
25
|
export const isLeveragedPos = (usedAssets: MMUsedAssets, dustLimit = 5) => {
|
|
26
26
|
let borrowUnstable = 0;
|
|
@@ -0,0 +1,399 @@
|
|
|
1
|
+
/* Autogenerated file. Do not edit manually. */
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
|
|
5
|
+
import type BN from "bn.js";
|
|
6
|
+
import type { ContractOptions } from "web3-eth-contract";
|
|
7
|
+
import type { EventLog } from "web3-core";
|
|
8
|
+
import type { EventEmitter } from "events";
|
|
9
|
+
import type {
|
|
10
|
+
Callback,
|
|
11
|
+
PayableTransactionObject,
|
|
12
|
+
NonPayableTransactionObject,
|
|
13
|
+
BlockType,
|
|
14
|
+
ContractEventLog,
|
|
15
|
+
BaseContract,
|
|
16
|
+
} from "./types";
|
|
17
|
+
|
|
18
|
+
export interface EventOptions {
|
|
19
|
+
filter?: object;
|
|
20
|
+
fromBlock?: BlockType;
|
|
21
|
+
topics?: string[];
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export declare namespace FluidView {
|
|
25
|
+
export type UserPositionStruct =
|
|
26
|
+
| [
|
|
27
|
+
number | string | BN,
|
|
28
|
+
string,
|
|
29
|
+
boolean,
|
|
30
|
+
boolean,
|
|
31
|
+
number | string | BN,
|
|
32
|
+
number | string | BN,
|
|
33
|
+
number | string | BN,
|
|
34
|
+
number | string | BN,
|
|
35
|
+
number | string | BN
|
|
36
|
+
]
|
|
37
|
+
| {
|
|
38
|
+
nftId: number | string | BN;
|
|
39
|
+
owner: string;
|
|
40
|
+
isLiquidated: boolean;
|
|
41
|
+
isSupplyPosition: boolean;
|
|
42
|
+
supply: number | string | BN;
|
|
43
|
+
borrow: number | string | BN;
|
|
44
|
+
ratio: number | string | BN;
|
|
45
|
+
tick: number | string | BN;
|
|
46
|
+
tickId: number | string | BN;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export type UserPositionStructOutputArray = [
|
|
50
|
+
string,
|
|
51
|
+
string,
|
|
52
|
+
boolean,
|
|
53
|
+
boolean,
|
|
54
|
+
string,
|
|
55
|
+
string,
|
|
56
|
+
string,
|
|
57
|
+
string,
|
|
58
|
+
string
|
|
59
|
+
];
|
|
60
|
+
export type UserPositionStructOutputStruct = {
|
|
61
|
+
nftId: string;
|
|
62
|
+
owner: string;
|
|
63
|
+
isLiquidated: boolean;
|
|
64
|
+
isSupplyPosition: boolean;
|
|
65
|
+
supply: string;
|
|
66
|
+
borrow: string;
|
|
67
|
+
ratio: string;
|
|
68
|
+
tick: string;
|
|
69
|
+
tickId: string;
|
|
70
|
+
};
|
|
71
|
+
export type UserPositionStructOutput = UserPositionStructOutputArray &
|
|
72
|
+
UserPositionStructOutputStruct;
|
|
73
|
+
|
|
74
|
+
export type VaultDataStruct =
|
|
75
|
+
| [
|
|
76
|
+
string,
|
|
77
|
+
number | string | BN,
|
|
78
|
+
number | string | BN,
|
|
79
|
+
boolean,
|
|
80
|
+
boolean,
|
|
81
|
+
string,
|
|
82
|
+
string,
|
|
83
|
+
string,
|
|
84
|
+
string,
|
|
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
|
+
string,
|
|
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
|
+
number | string | BN,
|
|
109
|
+
number | string | BN,
|
|
110
|
+
number | string | BN,
|
|
111
|
+
number | string | BN,
|
|
112
|
+
number | string | BN,
|
|
113
|
+
number | string | BN,
|
|
114
|
+
number | string | BN,
|
|
115
|
+
number | string | BN,
|
|
116
|
+
number | string | BN,
|
|
117
|
+
number | string | BN,
|
|
118
|
+
number | string | BN,
|
|
119
|
+
number | string | BN,
|
|
120
|
+
number | string | BN,
|
|
121
|
+
number | string | BN,
|
|
122
|
+
number | string | BN,
|
|
123
|
+
number | string | BN,
|
|
124
|
+
number | string | BN,
|
|
125
|
+
number | string | BN
|
|
126
|
+
]
|
|
127
|
+
| {
|
|
128
|
+
vault: string;
|
|
129
|
+
vaultId: number | string | BN;
|
|
130
|
+
vaultType: number | string | BN;
|
|
131
|
+
isSmartColl: boolean;
|
|
132
|
+
isSmartDebt: boolean;
|
|
133
|
+
supplyToken0: string;
|
|
134
|
+
supplyToken1: string;
|
|
135
|
+
borrowToken0: string;
|
|
136
|
+
borrowToken1: string;
|
|
137
|
+
supplyToken0Decimals: number | string | BN;
|
|
138
|
+
supplyToken1Decimals: number | string | BN;
|
|
139
|
+
borrowToken0Decimals: number | string | BN;
|
|
140
|
+
borrowToken1Decimals: number | string | BN;
|
|
141
|
+
collateralFactor: number | string | BN;
|
|
142
|
+
liquidationThreshold: number | string | BN;
|
|
143
|
+
liquidationMaxLimit: number | string | BN;
|
|
144
|
+
withdrawalGap: number | string | BN;
|
|
145
|
+
liquidationPenalty: number | string | BN;
|
|
146
|
+
borrowFee: number | string | BN;
|
|
147
|
+
oracle: string;
|
|
148
|
+
oraclePriceOperate: number | string | BN;
|
|
149
|
+
oraclePriceLiquidate: number | string | BN;
|
|
150
|
+
priceOfSupplyToken0InUSD: number | string | BN;
|
|
151
|
+
priceOfSupplyToken1InUSD: number | string | BN;
|
|
152
|
+
priceOfBorrowToken0InUSD: number | string | BN;
|
|
153
|
+
priceOfBorrowToken1InUSD: number | string | BN;
|
|
154
|
+
vaultSupplyExchangePrice: number | string | BN;
|
|
155
|
+
vaultBorrowExchangePrice: number | string | BN;
|
|
156
|
+
supplyRateVault: number | string | BN;
|
|
157
|
+
borrowRateVault: number | string | BN;
|
|
158
|
+
rewardsOrFeeRateSupply: number | string | BN;
|
|
159
|
+
rewardsOrFeeRateBorrow: number | string | BN;
|
|
160
|
+
totalPositions: number | string | BN;
|
|
161
|
+
totalSupplyVault: number | string | BN;
|
|
162
|
+
totalBorrowVault: number | string | BN;
|
|
163
|
+
withdrawalLimit: number | string | BN;
|
|
164
|
+
withdrawableUntilLimit: number | string | BN;
|
|
165
|
+
withdrawable: number | string | BN;
|
|
166
|
+
baseWithdrawalLimit: number | string | BN;
|
|
167
|
+
withdrawExpandPercent: number | string | BN;
|
|
168
|
+
withdrawExpandDuration: number | string | BN;
|
|
169
|
+
borrowLimit: number | string | BN;
|
|
170
|
+
borrowableUntilLimit: number | string | BN;
|
|
171
|
+
borrowable: number | string | BN;
|
|
172
|
+
borrowLimitUtilization: number | string | BN;
|
|
173
|
+
maxBorrowLimit: number | string | BN;
|
|
174
|
+
borrowExpandPercent: number | string | BN;
|
|
175
|
+
borrowExpandDuration: number | string | BN;
|
|
176
|
+
baseBorrowLimit: number | string | BN;
|
|
177
|
+
minimumBorrowing: number | string | BN;
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
export type VaultDataStructOutputArray = [
|
|
181
|
+
string,
|
|
182
|
+
string,
|
|
183
|
+
string,
|
|
184
|
+
boolean,
|
|
185
|
+
boolean,
|
|
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
|
+
string,
|
|
212
|
+
string,
|
|
213
|
+
string,
|
|
214
|
+
string,
|
|
215
|
+
string,
|
|
216
|
+
string,
|
|
217
|
+
string,
|
|
218
|
+
string,
|
|
219
|
+
string,
|
|
220
|
+
string,
|
|
221
|
+
string,
|
|
222
|
+
string,
|
|
223
|
+
string,
|
|
224
|
+
string,
|
|
225
|
+
string,
|
|
226
|
+
string,
|
|
227
|
+
string,
|
|
228
|
+
string,
|
|
229
|
+
string,
|
|
230
|
+
string
|
|
231
|
+
];
|
|
232
|
+
export type VaultDataStructOutputStruct = {
|
|
233
|
+
vault: string;
|
|
234
|
+
vaultId: string;
|
|
235
|
+
vaultType: string;
|
|
236
|
+
isSmartColl: boolean;
|
|
237
|
+
isSmartDebt: boolean;
|
|
238
|
+
supplyToken0: string;
|
|
239
|
+
supplyToken1: string;
|
|
240
|
+
borrowToken0: string;
|
|
241
|
+
borrowToken1: string;
|
|
242
|
+
supplyToken0Decimals: string;
|
|
243
|
+
supplyToken1Decimals: string;
|
|
244
|
+
borrowToken0Decimals: string;
|
|
245
|
+
borrowToken1Decimals: string;
|
|
246
|
+
collateralFactor: string;
|
|
247
|
+
liquidationThreshold: string;
|
|
248
|
+
liquidationMaxLimit: string;
|
|
249
|
+
withdrawalGap: string;
|
|
250
|
+
liquidationPenalty: string;
|
|
251
|
+
borrowFee: string;
|
|
252
|
+
oracle: string;
|
|
253
|
+
oraclePriceOperate: string;
|
|
254
|
+
oraclePriceLiquidate: string;
|
|
255
|
+
priceOfSupplyToken0InUSD: string;
|
|
256
|
+
priceOfSupplyToken1InUSD: string;
|
|
257
|
+
priceOfBorrowToken0InUSD: string;
|
|
258
|
+
priceOfBorrowToken1InUSD: string;
|
|
259
|
+
vaultSupplyExchangePrice: string;
|
|
260
|
+
vaultBorrowExchangePrice: string;
|
|
261
|
+
supplyRateVault: string;
|
|
262
|
+
borrowRateVault: string;
|
|
263
|
+
rewardsOrFeeRateSupply: string;
|
|
264
|
+
rewardsOrFeeRateBorrow: string;
|
|
265
|
+
totalPositions: string;
|
|
266
|
+
totalSupplyVault: string;
|
|
267
|
+
totalBorrowVault: string;
|
|
268
|
+
withdrawalLimit: string;
|
|
269
|
+
withdrawableUntilLimit: string;
|
|
270
|
+
withdrawable: string;
|
|
271
|
+
baseWithdrawalLimit: string;
|
|
272
|
+
withdrawExpandPercent: string;
|
|
273
|
+
withdrawExpandDuration: string;
|
|
274
|
+
borrowLimit: string;
|
|
275
|
+
borrowableUntilLimit: string;
|
|
276
|
+
borrowable: string;
|
|
277
|
+
borrowLimitUtilization: string;
|
|
278
|
+
maxBorrowLimit: string;
|
|
279
|
+
borrowExpandPercent: string;
|
|
280
|
+
borrowExpandDuration: string;
|
|
281
|
+
baseBorrowLimit: string;
|
|
282
|
+
minimumBorrowing: string;
|
|
283
|
+
};
|
|
284
|
+
export type VaultDataStructOutput = VaultDataStructOutputArray &
|
|
285
|
+
VaultDataStructOutputStruct;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
export interface FluidView extends BaseContract {
|
|
289
|
+
constructor(
|
|
290
|
+
jsonInterface: any[],
|
|
291
|
+
address?: string,
|
|
292
|
+
options?: ContractOptions
|
|
293
|
+
): FluidView;
|
|
294
|
+
clone(): FluidView;
|
|
295
|
+
methods: {
|
|
296
|
+
feedRegistry(): NonPayableTransactionObject<string>;
|
|
297
|
+
|
|
298
|
+
getAaveTokenPriceInETH(
|
|
299
|
+
_tokenAddr: string
|
|
300
|
+
): NonPayableTransactionObject<string>;
|
|
301
|
+
|
|
302
|
+
getAaveTokenPriceInUSD(
|
|
303
|
+
_tokenAddr: string
|
|
304
|
+
): NonPayableTransactionObject<string>;
|
|
305
|
+
|
|
306
|
+
getAaveV3TokenPriceInETH(
|
|
307
|
+
_tokenAddr: string
|
|
308
|
+
): NonPayableTransactionObject<string>;
|
|
309
|
+
|
|
310
|
+
getAaveV3TokenPriceInUSD(
|
|
311
|
+
_tokenAddr: string
|
|
312
|
+
): NonPayableTransactionObject<string>;
|
|
313
|
+
|
|
314
|
+
getAddrForChainlinkOracle(
|
|
315
|
+
_inputTokenAddr: string
|
|
316
|
+
): NonPayableTransactionObject<string>;
|
|
317
|
+
|
|
318
|
+
getChainlinkPriceInETH(
|
|
319
|
+
_inputTokenAddr: string
|
|
320
|
+
): NonPayableTransactionObject<string>;
|
|
321
|
+
|
|
322
|
+
getChainlinkPriceInUSD(
|
|
323
|
+
_inputTokenAddr: string,
|
|
324
|
+
_useFallback: boolean
|
|
325
|
+
): NonPayableTransactionObject<string>;
|
|
326
|
+
|
|
327
|
+
getPositionByNftId(
|
|
328
|
+
_nftId: number | string | BN
|
|
329
|
+
): NonPayableTransactionObject<
|
|
330
|
+
[FluidView.UserPositionStructOutput, FluidView.VaultDataStructOutput] & {
|
|
331
|
+
position: FluidView.UserPositionStructOutput;
|
|
332
|
+
vault: FluidView.VaultDataStructOutput;
|
|
333
|
+
}
|
|
334
|
+
>;
|
|
335
|
+
|
|
336
|
+
getPriceInETH(_inputTokenAddr: string): NonPayableTransactionObject<string>;
|
|
337
|
+
|
|
338
|
+
getPriceInUSD(_inputTokenAddr: string): NonPayableTransactionObject<string>;
|
|
339
|
+
|
|
340
|
+
getRatio(_nftId: number | string | BN): NonPayableTransactionObject<string>;
|
|
341
|
+
|
|
342
|
+
"getRoundInfo(address,uint80,address)"(
|
|
343
|
+
_inputTokenAddr: string,
|
|
344
|
+
_roundId: number | string | BN,
|
|
345
|
+
aggregator: string
|
|
346
|
+
): NonPayableTransactionObject<
|
|
347
|
+
[string, string] & { updateTimestamp: string }
|
|
348
|
+
>;
|
|
349
|
+
|
|
350
|
+
"getRoundInfo(address,uint80)"(
|
|
351
|
+
_inputTokenAddr: string,
|
|
352
|
+
_roundId: number | string | BN
|
|
353
|
+
): NonPayableTransactionObject<
|
|
354
|
+
[string, string] & { updateTimestamp: string }
|
|
355
|
+
>;
|
|
356
|
+
|
|
357
|
+
getSparkTokenPriceInETH(
|
|
358
|
+
_tokenAddr: string
|
|
359
|
+
): NonPayableTransactionObject<string>;
|
|
360
|
+
|
|
361
|
+
getSparkTokenPriceInUSD(
|
|
362
|
+
_tokenAddr: string
|
|
363
|
+
): NonPayableTransactionObject<string>;
|
|
364
|
+
|
|
365
|
+
getUserNftIds(_user: string): NonPayableTransactionObject<string[]>;
|
|
366
|
+
|
|
367
|
+
getUserPositions(
|
|
368
|
+
_user: string
|
|
369
|
+
): NonPayableTransactionObject<
|
|
370
|
+
[
|
|
371
|
+
FluidView.UserPositionStructOutput[],
|
|
372
|
+
FluidView.VaultDataStructOutput[]
|
|
373
|
+
] & {
|
|
374
|
+
positions: FluidView.UserPositionStructOutput[];
|
|
375
|
+
vaults: FluidView.VaultDataStructOutput[];
|
|
376
|
+
}
|
|
377
|
+
>;
|
|
378
|
+
|
|
379
|
+
getVaultAddresses(
|
|
380
|
+
_ids: number | string | BN[],
|
|
381
|
+
_fetchAll: boolean
|
|
382
|
+
): NonPayableTransactionObject<string[]>;
|
|
383
|
+
|
|
384
|
+
getVaultData(
|
|
385
|
+
_vault: string
|
|
386
|
+
): NonPayableTransactionObject<FluidView.VaultDataStructOutput>;
|
|
387
|
+
|
|
388
|
+
getWBtcPrice(
|
|
389
|
+
_btcPrice: number | string | BN
|
|
390
|
+
): NonPayableTransactionObject<string>;
|
|
391
|
+
|
|
392
|
+
getWStEthPrice(
|
|
393
|
+
_stEthPrice: number | string | BN
|
|
394
|
+
): NonPayableTransactionObject<string>;
|
|
395
|
+
};
|
|
396
|
+
events: {
|
|
397
|
+
allEvents(options?: EventOptions, cb?: Callback<EventLog>): EventEmitter;
|
|
398
|
+
};
|
|
399
|
+
}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/* Autogenerated file. Do not edit manually. */
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
|
|
5
|
+
import type BN from "bn.js";
|
|
6
|
+
import type { ContractOptions } from "web3-eth-contract";
|
|
7
|
+
import type { EventLog } from "web3-core";
|
|
8
|
+
import type { EventEmitter } from "events";
|
|
9
|
+
import type {
|
|
10
|
+
Callback,
|
|
11
|
+
PayableTransactionObject,
|
|
12
|
+
NonPayableTransactionObject,
|
|
13
|
+
BlockType,
|
|
14
|
+
ContractEventLog,
|
|
15
|
+
BaseContract,
|
|
16
|
+
} from "./types";
|
|
17
|
+
|
|
18
|
+
export interface EventOptions {
|
|
19
|
+
filter?: object;
|
|
20
|
+
fromBlock?: BlockType;
|
|
21
|
+
topics?: string[];
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export type BorrowerOperationsAddressChanged = ContractEventLog<{
|
|
25
|
+
_newBorrowerOperationsAddress: string;
|
|
26
|
+
0: string;
|
|
27
|
+
}>;
|
|
28
|
+
export type CollBalanceUpdated = ContractEventLog<{
|
|
29
|
+
_account: string;
|
|
30
|
+
_newBalance: string;
|
|
31
|
+
0: string;
|
|
32
|
+
1: string;
|
|
33
|
+
}>;
|
|
34
|
+
export type CollSent = ContractEventLog<{
|
|
35
|
+
_to: string;
|
|
36
|
+
_amount: string;
|
|
37
|
+
0: string;
|
|
38
|
+
1: string;
|
|
39
|
+
}>;
|
|
40
|
+
export type TroveManagerAddressChanged = ContractEventLog<{
|
|
41
|
+
_newTroveManagerAddress: string;
|
|
42
|
+
0: string;
|
|
43
|
+
}>;
|
|
44
|
+
|
|
45
|
+
export interface LiquityV2CollSurplusPool extends BaseContract {
|
|
46
|
+
constructor(
|
|
47
|
+
jsonInterface: any[],
|
|
48
|
+
address?: string,
|
|
49
|
+
options?: ContractOptions
|
|
50
|
+
): LiquityV2CollSurplusPool;
|
|
51
|
+
clone(): LiquityV2CollSurplusPool;
|
|
52
|
+
methods: {
|
|
53
|
+
NAME(): NonPayableTransactionObject<string>;
|
|
54
|
+
|
|
55
|
+
accountSurplus(
|
|
56
|
+
_account: string,
|
|
57
|
+
_amount: number | string | BN
|
|
58
|
+
): NonPayableTransactionObject<void>;
|
|
59
|
+
|
|
60
|
+
borrowerOperationsAddress(): NonPayableTransactionObject<string>;
|
|
61
|
+
|
|
62
|
+
claimColl(_account: string): NonPayableTransactionObject<void>;
|
|
63
|
+
|
|
64
|
+
collToken(): NonPayableTransactionObject<string>;
|
|
65
|
+
|
|
66
|
+
getCollBalance(): NonPayableTransactionObject<string>;
|
|
67
|
+
|
|
68
|
+
getCollateral(_account: string): NonPayableTransactionObject<string>;
|
|
69
|
+
|
|
70
|
+
troveManagerAddress(): NonPayableTransactionObject<string>;
|
|
71
|
+
};
|
|
72
|
+
events: {
|
|
73
|
+
BorrowerOperationsAddressChanged(
|
|
74
|
+
cb?: Callback<BorrowerOperationsAddressChanged>
|
|
75
|
+
): EventEmitter;
|
|
76
|
+
BorrowerOperationsAddressChanged(
|
|
77
|
+
options?: EventOptions,
|
|
78
|
+
cb?: Callback<BorrowerOperationsAddressChanged>
|
|
79
|
+
): EventEmitter;
|
|
80
|
+
|
|
81
|
+
CollBalanceUpdated(cb?: Callback<CollBalanceUpdated>): EventEmitter;
|
|
82
|
+
CollBalanceUpdated(
|
|
83
|
+
options?: EventOptions,
|
|
84
|
+
cb?: Callback<CollBalanceUpdated>
|
|
85
|
+
): EventEmitter;
|
|
86
|
+
|
|
87
|
+
CollSent(cb?: Callback<CollSent>): EventEmitter;
|
|
88
|
+
CollSent(options?: EventOptions, cb?: Callback<CollSent>): EventEmitter;
|
|
89
|
+
|
|
90
|
+
TroveManagerAddressChanged(
|
|
91
|
+
cb?: Callback<TroveManagerAddressChanged>
|
|
92
|
+
): EventEmitter;
|
|
93
|
+
TroveManagerAddressChanged(
|
|
94
|
+
options?: EventOptions,
|
|
95
|
+
cb?: Callback<TroveManagerAddressChanged>
|
|
96
|
+
): EventEmitter;
|
|
97
|
+
|
|
98
|
+
allEvents(options?: EventOptions, cb?: Callback<EventLog>): EventEmitter;
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
once(
|
|
102
|
+
event: "BorrowerOperationsAddressChanged",
|
|
103
|
+
cb: Callback<BorrowerOperationsAddressChanged>
|
|
104
|
+
): void;
|
|
105
|
+
once(
|
|
106
|
+
event: "BorrowerOperationsAddressChanged",
|
|
107
|
+
options: EventOptions,
|
|
108
|
+
cb: Callback<BorrowerOperationsAddressChanged>
|
|
109
|
+
): void;
|
|
110
|
+
|
|
111
|
+
once(event: "CollBalanceUpdated", cb: Callback<CollBalanceUpdated>): void;
|
|
112
|
+
once(
|
|
113
|
+
event: "CollBalanceUpdated",
|
|
114
|
+
options: EventOptions,
|
|
115
|
+
cb: Callback<CollBalanceUpdated>
|
|
116
|
+
): void;
|
|
117
|
+
|
|
118
|
+
once(event: "CollSent", cb: Callback<CollSent>): void;
|
|
119
|
+
once(event: "CollSent", options: EventOptions, cb: Callback<CollSent>): void;
|
|
120
|
+
|
|
121
|
+
once(
|
|
122
|
+
event: "TroveManagerAddressChanged",
|
|
123
|
+
cb: Callback<TroveManagerAddressChanged>
|
|
124
|
+
): void;
|
|
125
|
+
once(
|
|
126
|
+
event: "TroveManagerAddressChanged",
|
|
127
|
+
options: EventOptions,
|
|
128
|
+
cb: Callback<TroveManagerAddressChanged>
|
|
129
|
+
): void;
|
|
130
|
+
}
|