@defisaver/positions-sdk 1.0.11-dev → 1.0.11-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.
Files changed (109) hide show
  1. package/.mocharc.json +4 -4
  2. package/.nvmrc +1 -1
  3. package/README.md +69 -69
  4. package/cjs/config/contracts.d.ts +113 -49
  5. package/cjs/config/contracts.js +10 -2
  6. package/cjs/contracts.d.ts +1 -0
  7. package/cjs/contracts.js +2 -1
  8. package/cjs/fluid/index.d.ts +2 -0
  9. package/cjs/fluid/index.js +636 -13
  10. package/cjs/helpers/fluidHelpers/index.d.ts +59 -2
  11. package/cjs/helpers/fluidHelpers/index.js +142 -4
  12. package/cjs/helpers/morphoBlueHelpers/index.js +66 -66
  13. package/cjs/markets/fluid/index.js +276 -245
  14. package/cjs/services/priceService.d.ts +23 -0
  15. package/cjs/services/priceService.js +44 -5
  16. package/cjs/types/contracts/generated/FluidView.d.ts +220 -3
  17. package/cjs/types/contracts/generated/WeETHPriceFeed.d.ts +135 -0
  18. package/cjs/types/contracts/generated/WeETHPriceFeed.js +5 -0
  19. package/cjs/types/contracts/generated/index.d.ts +1 -0
  20. package/cjs/types/fluid.d.ts +39 -10
  21. package/esm/config/contracts.d.ts +113 -49
  22. package/esm/config/contracts.js +10 -2
  23. package/esm/contracts.d.ts +1 -0
  24. package/esm/contracts.js +1 -0
  25. package/esm/fluid/index.d.ts +2 -0
  26. package/esm/fluid/index.js +639 -16
  27. package/esm/helpers/fluidHelpers/index.d.ts +59 -2
  28. package/esm/helpers/fluidHelpers/index.js +137 -3
  29. package/esm/helpers/morphoBlueHelpers/index.js +66 -66
  30. package/esm/markets/fluid/index.js +276 -245
  31. package/esm/services/priceService.d.ts +23 -0
  32. package/esm/services/priceService.js +40 -5
  33. package/esm/types/contracts/generated/FluidView.d.ts +220 -3
  34. package/esm/types/contracts/generated/WeETHPriceFeed.d.ts +135 -0
  35. package/esm/types/contracts/generated/WeETHPriceFeed.js +4 -0
  36. package/esm/types/contracts/generated/index.d.ts +1 -0
  37. package/esm/types/fluid.d.ts +39 -10
  38. package/package.json +54 -54
  39. package/src/aaveV2/index.ts +227 -227
  40. package/src/aaveV3/index.ts +624 -624
  41. package/src/assets/index.ts +60 -60
  42. package/src/chickenBonds/index.ts +123 -123
  43. package/src/compoundV2/index.ts +220 -220
  44. package/src/compoundV3/index.ts +291 -291
  45. package/src/config/contracts.js +1155 -1147
  46. package/src/constants/index.ts +6 -6
  47. package/src/contracts.ts +135 -134
  48. package/src/curveUsd/index.ts +239 -239
  49. package/src/eulerV2/index.ts +303 -303
  50. package/src/exchange/index.ts +17 -17
  51. package/src/fluid/index.ts +1216 -354
  52. package/src/helpers/aaveHelpers/index.ts +203 -203
  53. package/src/helpers/chickenBondsHelpers/index.ts +23 -23
  54. package/src/helpers/compoundHelpers/index.ts +248 -248
  55. package/src/helpers/curveUsdHelpers/index.ts +40 -40
  56. package/src/helpers/eulerHelpers/index.ts +234 -234
  57. package/src/helpers/fluidHelpers/index.ts +295 -57
  58. package/src/helpers/index.ts +11 -11
  59. package/src/helpers/liquityV2Helpers/index.ts +80 -80
  60. package/src/helpers/llamaLendHelpers/index.ts +53 -53
  61. package/src/helpers/makerHelpers/index.ts +94 -94
  62. package/src/helpers/morphoBlueHelpers/index.ts +367 -367
  63. package/src/helpers/sparkHelpers/index.ts +154 -154
  64. package/src/index.ts +52 -52
  65. package/src/liquity/index.ts +116 -116
  66. package/src/liquityV2/index.ts +295 -295
  67. package/src/llamaLend/index.ts +275 -275
  68. package/src/maker/index.ts +117 -117
  69. package/src/markets/aave/index.ts +152 -152
  70. package/src/markets/aave/marketAssets.ts +46 -46
  71. package/src/markets/compound/index.ts +213 -213
  72. package/src/markets/compound/marketsAssets.ts +82 -82
  73. package/src/markets/curveUsd/index.ts +69 -69
  74. package/src/markets/euler/index.ts +26 -26
  75. package/src/markets/fluid/index.ts +2043 -2012
  76. package/src/markets/index.ts +27 -27
  77. package/src/markets/liquityV2/index.ts +54 -54
  78. package/src/markets/llamaLend/contractAddresses.ts +141 -141
  79. package/src/markets/llamaLend/index.ts +235 -235
  80. package/src/markets/morphoBlue/index.ts +895 -895
  81. package/src/markets/spark/index.ts +29 -29
  82. package/src/markets/spark/marketAssets.ts +10 -10
  83. package/src/moneymarket/moneymarketCommonService.ts +80 -80
  84. package/src/morphoAaveV2/index.ts +256 -256
  85. package/src/morphoAaveV3/index.ts +630 -630
  86. package/src/morphoBlue/index.ts +202 -202
  87. package/src/multicall/index.ts +33 -33
  88. package/src/services/priceService.ts +130 -91
  89. package/src/services/utils.ts +59 -59
  90. package/src/setup.ts +8 -8
  91. package/src/spark/index.ts +460 -460
  92. package/src/staking/staking.ts +217 -217
  93. package/src/types/aave.ts +275 -275
  94. package/src/types/chickenBonds.ts +45 -45
  95. package/src/types/common.ts +84 -84
  96. package/src/types/compound.ts +133 -133
  97. package/src/types/contracts/generated/FluidView.ts +263 -2
  98. package/src/types/contracts/generated/WeETHPriceFeed.ts +202 -0
  99. package/src/types/contracts/generated/index.ts +1 -0
  100. package/src/types/curveUsd.ts +119 -119
  101. package/src/types/euler.ts +173 -173
  102. package/src/types/fluid.ts +299 -268
  103. package/src/types/index.ts +11 -11
  104. package/src/types/liquity.ts +30 -30
  105. package/src/types/liquityV2.ts +119 -119
  106. package/src/types/llamaLend.ts +155 -155
  107. package/src/types/maker.ts +50 -50
  108. package/src/types/morphoBlue.ts +194 -194
  109. package/src/types/spark.ts +135 -135
@@ -1,8 +1,31 @@
1
1
  import Web3 from 'web3';
2
+ import Dec from 'decimal.js';
2
3
  import { NetworkNumber } from '../types/common';
3
4
  export declare const getEthPrice: (web3: Web3) => Promise<string>;
4
5
  export declare const getUSDCPrice: (web3: Web3) => Promise<string>;
5
6
  export declare const getCompPrice: (web3: Web3) => Promise<string>;
6
7
  export declare const getWstETHPrice: (web3: Web3) => Promise<string>;
8
+ export declare const getWstETHChainLinkPriceCalls: (web3: Web3, network: NetworkNumber) => {
9
+ target: string;
10
+ abiItem: import("web3-utils").AbiItem | undefined;
11
+ params: never[];
12
+ }[];
13
+ export declare const getWeETHChainLinkPriceCalls: (web3: Web3, network: NetworkNumber) => {
14
+ target: string;
15
+ abiItem: import("web3-utils").AbiItem | undefined;
16
+ params: never[];
17
+ }[];
18
+ export declare const parseWstETHPriceCalls: (_ethPrice: string, wstETHrate: {
19
+ answer: string;
20
+ }, decimals: string) => {
21
+ ethPrice: Dec;
22
+ wstETHRate: string;
23
+ };
24
+ export declare const parseWeETHPriceCalls: (_ethPrice: string, weETHrate: {
25
+ answer: string;
26
+ }, decimals: string) => {
27
+ ethPrice: Dec;
28
+ weETHRate: string;
29
+ };
7
30
  export declare const getWstETHPriceFluid: (web3: Web3, network: NetworkNumber) => Promise<string>;
8
31
  export declare const getChainlinkAssetAddress: (symbol: string, network: NetworkNumber) => string;
@@ -12,7 +12,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
12
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.getChainlinkAssetAddress = exports.getWstETHPriceFluid = exports.getWstETHPrice = exports.getCompPrice = exports.getUSDCPrice = exports.getEthPrice = void 0;
15
+ exports.getChainlinkAssetAddress = exports.getWstETHPriceFluid = exports.parseWeETHPriceCalls = exports.parseWstETHPriceCalls = exports.getWeETHChainLinkPriceCalls = exports.getWstETHChainLinkPriceCalls = exports.getWstETHPrice = exports.getCompPrice = exports.getUSDCPrice = exports.getEthPrice = void 0;
16
16
  const decimal_js_1 = __importDefault(require("decimal.js"));
17
17
  const tokens_1 = require("@defisaver/tokens");
18
18
  const contracts_1 = require("../contracts");
@@ -58,8 +58,7 @@ const getWstETHPrice = (web3) => __awaiter(void 0, void 0, void 0, function* ()
58
58
  return new decimal_js_1.default(ethPrice).mul(wstETHRate).toString();
59
59
  });
60
60
  exports.getWstETHPrice = getWstETHPrice;
61
- // this is a fixed version, the original version is above but requires to refactor comp v3 function, so it's easier to just copy the function for now
62
- const getWstETHPriceFluid = (web3, network) => __awaiter(void 0, void 0, void 0, function* () {
61
+ const getWstETHChainLinkPriceCalls = (web3, network) => {
63
62
  const wstETHFeedContract = (0, contracts_1.WstETHPriceFeedContract)(web3, network);
64
63
  const ethFeedContract = (0, contracts_1.ETHPriceFeedContract)(web3, network);
65
64
  const calls = [
@@ -79,9 +78,49 @@ const getWstETHPriceFluid = (web3, network) => __awaiter(void 0, void 0, void 0,
79
78
  params: [],
80
79
  },
81
80
  ];
81
+ return calls;
82
+ };
83
+ exports.getWstETHChainLinkPriceCalls = getWstETHChainLinkPriceCalls;
84
+ const getWeETHChainLinkPriceCalls = (web3, network) => {
85
+ const weETHFeedContract = (0, contracts_1.WeETHPriceFeedContract)(web3, network);
86
+ const ethFeedContract = (0, contracts_1.ETHPriceFeedContract)(web3, network);
87
+ const calls = [
88
+ {
89
+ target: ethFeedContract.options.address,
90
+ abiItem: ethFeedContract.options.jsonInterface.find(({ name }) => name === 'latestAnswer'),
91
+ params: [],
92
+ },
93
+ {
94
+ target: weETHFeedContract.options.address,
95
+ abiItem: weETHFeedContract.options.jsonInterface.find(({ name }) => name === 'latestRoundData'),
96
+ params: [],
97
+ },
98
+ {
99
+ target: weETHFeedContract.options.address,
100
+ abiItem: weETHFeedContract.options.jsonInterface.find(({ name }) => name === 'decimals'),
101
+ params: [],
102
+ },
103
+ ];
104
+ return calls;
105
+ };
106
+ exports.getWeETHChainLinkPriceCalls = getWeETHChainLinkPriceCalls;
107
+ const parseWstETHPriceCalls = (_ethPrice, wstETHrate, decimals) => {
108
+ const ethPrice = new decimal_js_1.default(_ethPrice).div(1e8);
109
+ const wstETHRate = (0, utils_1.getEthAmountForDecimals)(wstETHrate.answer, decimals);
110
+ return { ethPrice, wstETHRate };
111
+ };
112
+ exports.parseWstETHPriceCalls = parseWstETHPriceCalls;
113
+ const parseWeETHPriceCalls = (_ethPrice, weETHrate, decimals) => {
114
+ const ethPrice = new decimal_js_1.default(_ethPrice).div(1e8);
115
+ const weETHRate = (0, utils_1.getEthAmountForDecimals)(weETHrate.answer, decimals);
116
+ return { ethPrice, weETHRate };
117
+ };
118
+ exports.parseWeETHPriceCalls = parseWeETHPriceCalls;
119
+ // this is a fixed version, the original version is above but requires to refactor comp v3 function, so it's easier to just copy the function for now
120
+ const getWstETHPriceFluid = (web3, network) => __awaiter(void 0, void 0, void 0, function* () {
121
+ const calls = (0, exports.getWstETHChainLinkPriceCalls)(web3, network);
82
122
  const multicallRes = yield (0, multicall_1.multicall)(calls, web3, network);
83
- const ethPrice = new decimal_js_1.default(multicallRes[0][0]).div(1e8);
84
- const wstETHRate = (0, utils_1.getEthAmountForDecimals)(multicallRes[1].answer, multicallRes[2][0]);
123
+ const { ethPrice, wstETHRate } = (0, exports.parseWstETHPriceCalls)(multicallRes[0][0], multicallRes[1], multicallRes[2][0]);
85
124
  return new decimal_js_1.default(ethPrice).mul(wstETHRate).toString();
86
125
  });
87
126
  exports.getWstETHPriceFluid = getWstETHPriceFluid;
@@ -3,7 +3,7 @@ import type BN from "bn.js";
3
3
  import type { ContractOptions } from "web3-eth-contract";
4
4
  import type { EventLog } from "web3-core";
5
5
  import type { EventEmitter } from "events";
6
- import type { Callback, NonPayableTransactionObject, BlockType, BaseContract } from "./types";
6
+ import type { Callback, PayableTransactionObject, NonPayableTransactionObject, BlockType, BaseContract } from "./types";
7
7
  export interface EventOptions {
8
8
  filter?: object;
9
9
  fromBlock?: BlockType;
@@ -150,6 +150,198 @@ export declare namespace FluidView {
150
150
  tickId: string;
151
151
  };
152
152
  type UserPositionStructOutput = UserPositionStructOutputArray & UserPositionStructOutputStruct;
153
+ type DexSupplyDataStruct = [
154
+ string,
155
+ number | string | BN,
156
+ number | string | BN,
157
+ number | string | BN,
158
+ number | string | BN,
159
+ number | string | BN,
160
+ number | string | BN,
161
+ number | string | BN,
162
+ number | string | BN,
163
+ number | string | BN,
164
+ number | string | BN,
165
+ number | string | BN,
166
+ number | string | BN,
167
+ number | string | BN,
168
+ number | string | BN,
169
+ number | string | BN,
170
+ number | string | BN,
171
+ number | string | BN,
172
+ string,
173
+ number | string | BN,
174
+ number | string | BN,
175
+ number | string | BN
176
+ ] | {
177
+ dexPool: string;
178
+ dexId: number | string | BN;
179
+ fee: number | string | BN;
180
+ lastStoredPrice: number | string | BN;
181
+ centerPrice: number | string | BN;
182
+ token0Utilization: number | string | BN;
183
+ token1Utilization: number | string | BN;
184
+ totalSupplyShares: number | string | BN;
185
+ maxSupplyShares: number | string | BN;
186
+ token0Supplied: number | string | BN;
187
+ token1Supplied: number | string | BN;
188
+ sharesWithdrawable: number | string | BN;
189
+ token0Withdrawable: number | string | BN;
190
+ token1Withdrawable: number | string | BN;
191
+ token0PerSupplyShare: number | string | BN;
192
+ token1PerSupplyShare: number | string | BN;
193
+ token0SupplyRate: number | string | BN;
194
+ token1SupplyRate: number | string | BN;
195
+ quoteToken: string;
196
+ quoteTokensPerShare: number | string | BN;
197
+ supplyToken0Reserves: number | string | BN;
198
+ supplyToken1Reserves: number | string | BN;
199
+ };
200
+ type DexSupplyDataStructOutputArray = [
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
+ ];
224
+ type DexSupplyDataStructOutputStruct = {
225
+ dexPool: string;
226
+ dexId: string;
227
+ fee: string;
228
+ lastStoredPrice: string;
229
+ centerPrice: string;
230
+ token0Utilization: string;
231
+ token1Utilization: string;
232
+ totalSupplyShares: string;
233
+ maxSupplyShares: string;
234
+ token0Supplied: string;
235
+ token1Supplied: string;
236
+ sharesWithdrawable: string;
237
+ token0Withdrawable: string;
238
+ token1Withdrawable: string;
239
+ token0PerSupplyShare: string;
240
+ token1PerSupplyShare: string;
241
+ token0SupplyRate: string;
242
+ token1SupplyRate: string;
243
+ quoteToken: string;
244
+ quoteTokensPerShare: string;
245
+ supplyToken0Reserves: string;
246
+ supplyToken1Reserves: string;
247
+ };
248
+ type DexSupplyDataStructOutput = DexSupplyDataStructOutputArray & DexSupplyDataStructOutputStruct;
249
+ type DexBorrowDataStruct = [
250
+ string,
251
+ number | string | BN,
252
+ number | string | BN,
253
+ number | string | BN,
254
+ number | string | BN,
255
+ number | string | BN,
256
+ number | string | BN,
257
+ number | string | BN,
258
+ number | string | BN,
259
+ number | string | BN,
260
+ number | string | BN,
261
+ number | string | BN,
262
+ number | string | BN,
263
+ number | string | BN,
264
+ number | string | BN,
265
+ number | string | BN,
266
+ number | string | BN,
267
+ number | string | BN,
268
+ string,
269
+ number | string | BN,
270
+ number | string | BN,
271
+ number | string | BN
272
+ ] | {
273
+ dexPool: string;
274
+ dexId: number | string | BN;
275
+ fee: number | string | BN;
276
+ lastStoredPrice: number | string | BN;
277
+ centerPrice: number | string | BN;
278
+ token0Utilization: number | string | BN;
279
+ token1Utilization: number | string | BN;
280
+ totalBorrowShares: number | string | BN;
281
+ maxBorrowShares: number | string | BN;
282
+ token0Borrowed: number | string | BN;
283
+ token1Borrowed: number | string | BN;
284
+ sharesBorrowable: number | string | BN;
285
+ token0Borrowable: number | string | BN;
286
+ token1Borrowable: number | string | BN;
287
+ token0PerBorrowShare: number | string | BN;
288
+ token1PerBorrowShare: number | string | BN;
289
+ token0BorrowRate: number | string | BN;
290
+ token1BorrowRate: number | string | BN;
291
+ quoteToken: string;
292
+ quoteTokensPerShare: number | string | BN;
293
+ borrowToken0Reserves: number | string | BN;
294
+ borrowToken1Reserves: number | string | BN;
295
+ };
296
+ type DexBorrowDataStructOutputArray = [
297
+ string,
298
+ string,
299
+ string,
300
+ string,
301
+ string,
302
+ string,
303
+ string,
304
+ string,
305
+ string,
306
+ string,
307
+ string,
308
+ string,
309
+ string,
310
+ string,
311
+ string,
312
+ string,
313
+ string,
314
+ string,
315
+ string,
316
+ string,
317
+ string,
318
+ string
319
+ ];
320
+ type DexBorrowDataStructOutputStruct = {
321
+ dexPool: string;
322
+ dexId: string;
323
+ fee: string;
324
+ lastStoredPrice: string;
325
+ centerPrice: string;
326
+ token0Utilization: string;
327
+ token1Utilization: string;
328
+ totalBorrowShares: string;
329
+ maxBorrowShares: string;
330
+ token0Borrowed: string;
331
+ token1Borrowed: string;
332
+ sharesBorrowable: string;
333
+ token0Borrowable: string;
334
+ token1Borrowable: string;
335
+ token0PerBorrowShare: string;
336
+ token1PerBorrowShare: string;
337
+ token0BorrowRate: string;
338
+ token1BorrowRate: string;
339
+ quoteToken: string;
340
+ quoteTokensPerShare: string;
341
+ borrowToken0Reserves: string;
342
+ borrowToken1Reserves: string;
343
+ };
344
+ type DexBorrowDataStructOutput = DexBorrowDataStructOutputArray & DexBorrowDataStructOutputStruct;
153
345
  type VaultDataStruct = [
154
346
  string,
155
347
  number | string | BN,
@@ -196,7 +388,9 @@ export declare namespace FluidView {
196
388
  number | string | BN,
197
389
  number | string | BN,
198
390
  number | string | BN,
199
- number | string | BN
391
+ number | string | BN,
392
+ FluidView.DexSupplyDataStruct,
393
+ FluidView.DexBorrowDataStruct
200
394
  ] | {
201
395
  vault: string;
202
396
  vaultId: number | string | BN;
@@ -244,6 +438,8 @@ export declare namespace FluidView {
244
438
  borrowExpandDuration: number | string | BN;
245
439
  baseBorrowLimit: number | string | BN;
246
440
  minimumBorrowing: number | string | BN;
441
+ dexSupplyData: FluidView.DexSupplyDataStruct;
442
+ dexBorrowData: FluidView.DexBorrowDataStruct;
247
443
  };
248
444
  type VaultDataStructOutputArray = [
249
445
  string,
@@ -291,7 +487,9 @@ export declare namespace FluidView {
291
487
  string,
292
488
  string,
293
489
  string,
294
- string
490
+ string,
491
+ FluidView.DexSupplyDataStructOutput,
492
+ FluidView.DexBorrowDataStructOutput
295
493
  ];
296
494
  type VaultDataStructOutputStruct = {
297
495
  vault: string;
@@ -340,6 +538,8 @@ export declare namespace FluidView {
340
538
  borrowExpandDuration: string;
341
539
  baseBorrowLimit: string;
342
540
  minimumBorrowing: string;
541
+ dexSupplyData: FluidView.DexSupplyDataStructOutput;
542
+ dexBorrowData: FluidView.DexBorrowDataStructOutput;
343
543
  };
344
544
  type VaultDataStructOutput = VaultDataStructOutputArray & VaultDataStructOutputStruct;
345
545
  type NftWithVaultStruct = [number | string | BN, number | string | BN, string] | {
@@ -359,6 +559,12 @@ export interface FluidView extends BaseContract {
359
559
  constructor(jsonInterface: any[], address?: string, options?: ContractOptions): FluidView;
360
560
  clone(): FluidView;
361
561
  methods: {
562
+ estimateBorrow(_vault: string, _token0Amount: number | string | BN, _token1Amount: number | string | BN, _maxSharesAmount: number | string | BN): NonPayableTransactionObject<string>;
563
+ estimateDeposit(_vault: string, _token0Amount: number | string | BN, _token1Amount: number | string | BN, _minSharesAmount: number | string | BN): PayableTransactionObject<string>;
564
+ estimateDexPositionCollateralInOneToken(_nftId: number | string | BN, _minToken0AmountToAccept: number | string | BN, _minToken1AmountToAccept: number | string | BN): NonPayableTransactionObject<string>;
565
+ estimateDexPositionDebtInOneToken(_nftId: number | string | BN, _maxToken0AmountToPayback: number | string | BN, _maxToken1AmountToPayback: number | string | BN): NonPayableTransactionObject<string>;
566
+ estimatePayback(_vault: string, _token0Amount: number | string | BN, _token1Amount: number | string | BN, _minSharesAmount: number | string | BN): NonPayableTransactionObject<string>;
567
+ estimateWithdraw(_vault: string, _token0Amount: number | string | BN, _token1Amount: number | string | BN, _maxSharesAmount: number | string | BN): NonPayableTransactionObject<string>;
362
568
  getAllFTokens(): NonPayableTransactionObject<string[]>;
363
569
  getAllFTokensData(): NonPayableTransactionObject<FluidView.FTokenDataStructOutput[]>;
364
570
  getAllUserEarnPositionsWithFTokens(_user: string): NonPayableTransactionObject<[
@@ -368,6 +574,17 @@ export interface FluidView extends BaseContract {
368
574
  userPositions: FluidView.UserEarnPositionStructOutput[];
369
575
  fTokensData: FluidView.FTokenDataStructOutput[];
370
576
  }>;
577
+ getDexShareRates(_vault: string): NonPayableTransactionObject<[
578
+ string,
579
+ string,
580
+ string,
581
+ string
582
+ ] & {
583
+ token0PerSupplyShare: string;
584
+ token1PerSupplyShare: string;
585
+ token0PerBorrowShare: string;
586
+ token1PerBorrowShare: string;
587
+ }>;
371
588
  getFTokenData(_fToken: string): NonPayableTransactionObject<FluidView.FTokenDataStructOutput>;
372
589
  getPositionByNftId(_nftId: number | string | BN): NonPayableTransactionObject<[
373
590
  FluidView.UserPositionStructOutput,
@@ -0,0 +1,135 @@
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 AnswerUpdated = ContractEventLog<{
13
+ current: string;
14
+ roundId: string;
15
+ updatedAt: string;
16
+ 0: string;
17
+ 1: string;
18
+ 2: string;
19
+ }>;
20
+ export type NewRound = ContractEventLog<{
21
+ roundId: string;
22
+ startedBy: string;
23
+ startedAt: string;
24
+ 0: string;
25
+ 1: string;
26
+ 2: string;
27
+ }>;
28
+ export type OwnershipTransferRequested = ContractEventLog<{
29
+ from: string;
30
+ to: string;
31
+ 0: string;
32
+ 1: string;
33
+ }>;
34
+ export type OwnershipTransferred = ContractEventLog<{
35
+ from: string;
36
+ to: string;
37
+ 0: string;
38
+ 1: string;
39
+ }>;
40
+ export interface WeETHPriceFeed extends BaseContract {
41
+ constructor(jsonInterface: any[], address?: string, options?: ContractOptions): WeETHPriceFeed;
42
+ clone(): WeETHPriceFeed;
43
+ methods: {
44
+ acceptOwnership(): NonPayableTransactionObject<void>;
45
+ accessController(): NonPayableTransactionObject<string>;
46
+ aggregator(): NonPayableTransactionObject<string>;
47
+ confirmAggregator(_aggregator: string): NonPayableTransactionObject<void>;
48
+ decimals(): NonPayableTransactionObject<string>;
49
+ description(): NonPayableTransactionObject<string>;
50
+ getAnswer(_roundId: number | string | BN): NonPayableTransactionObject<string>;
51
+ getRoundData(_roundId: number | string | BN): NonPayableTransactionObject<[
52
+ string,
53
+ string,
54
+ string,
55
+ string,
56
+ string
57
+ ] & {
58
+ roundId: string;
59
+ answer: string;
60
+ startedAt: string;
61
+ updatedAt: string;
62
+ answeredInRound: string;
63
+ }>;
64
+ getTimestamp(_roundId: number | string | BN): NonPayableTransactionObject<string>;
65
+ latestAnswer(): NonPayableTransactionObject<string>;
66
+ latestRound(): NonPayableTransactionObject<string>;
67
+ latestRoundData(): NonPayableTransactionObject<[
68
+ string,
69
+ string,
70
+ string,
71
+ string,
72
+ string
73
+ ] & {
74
+ roundId: string;
75
+ answer: string;
76
+ startedAt: string;
77
+ updatedAt: string;
78
+ answeredInRound: string;
79
+ }>;
80
+ latestTimestamp(): NonPayableTransactionObject<string>;
81
+ owner(): NonPayableTransactionObject<string>;
82
+ phaseAggregators(arg0: number | string | BN): NonPayableTransactionObject<string>;
83
+ phaseId(): NonPayableTransactionObject<string>;
84
+ proposeAggregator(_aggregator: string): NonPayableTransactionObject<void>;
85
+ proposedAggregator(): NonPayableTransactionObject<string>;
86
+ proposedGetRoundData(_roundId: number | string | BN): NonPayableTransactionObject<[
87
+ string,
88
+ string,
89
+ string,
90
+ string,
91
+ string
92
+ ] & {
93
+ roundId: string;
94
+ answer: string;
95
+ startedAt: string;
96
+ updatedAt: string;
97
+ answeredInRound: string;
98
+ }>;
99
+ proposedLatestRoundData(): NonPayableTransactionObject<[
100
+ string,
101
+ string,
102
+ string,
103
+ string,
104
+ string
105
+ ] & {
106
+ roundId: string;
107
+ answer: string;
108
+ startedAt: string;
109
+ updatedAt: string;
110
+ answeredInRound: string;
111
+ }>;
112
+ setController(_accessController: string): NonPayableTransactionObject<void>;
113
+ transferOwnership(_to: string): NonPayableTransactionObject<void>;
114
+ version(): NonPayableTransactionObject<string>;
115
+ };
116
+ events: {
117
+ AnswerUpdated(cb?: Callback<AnswerUpdated>): EventEmitter;
118
+ AnswerUpdated(options?: EventOptions, cb?: Callback<AnswerUpdated>): EventEmitter;
119
+ NewRound(cb?: Callback<NewRound>): EventEmitter;
120
+ NewRound(options?: EventOptions, cb?: Callback<NewRound>): EventEmitter;
121
+ OwnershipTransferRequested(cb?: Callback<OwnershipTransferRequested>): EventEmitter;
122
+ OwnershipTransferRequested(options?: EventOptions, cb?: Callback<OwnershipTransferRequested>): EventEmitter;
123
+ OwnershipTransferred(cb?: Callback<OwnershipTransferred>): EventEmitter;
124
+ OwnershipTransferred(options?: EventOptions, cb?: Callback<OwnershipTransferred>): EventEmitter;
125
+ allEvents(options?: EventOptions, cb?: Callback<EventLog>): EventEmitter;
126
+ };
127
+ once(event: "AnswerUpdated", cb: Callback<AnswerUpdated>): void;
128
+ once(event: "AnswerUpdated", options: EventOptions, cb: Callback<AnswerUpdated>): void;
129
+ once(event: "NewRound", cb: Callback<NewRound>): void;
130
+ once(event: "NewRound", options: EventOptions, cb: Callback<NewRound>): void;
131
+ once(event: "OwnershipTransferRequested", cb: Callback<OwnershipTransferRequested>): void;
132
+ once(event: "OwnershipTransferRequested", options: EventOptions, cb: Callback<OwnershipTransferRequested>): void;
133
+ once(event: "OwnershipTransferred", cb: Callback<OwnershipTransferred>): void;
134
+ once(event: "OwnershipTransferred", options: EventOptions, cb: Callback<OwnershipTransferred>): void;
135
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /* Autogenerated file. Do not edit manually. */
3
+ /* tslint:disable */
4
+ /* eslint-disable */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -64,6 +64,7 @@ export type { SparkView } from "./SparkView";
64
64
  export type { TroveManager } from "./TroveManager";
65
65
  export type { USDCPriceFeed } from "./USDCPriceFeed";
66
66
  export type { UniMulticall } from "./UniMulticall";
67
+ export type { WeETHPriceFeed } from "./WeETHPriceFeed";
67
68
  export type { WstETHPriceFeed } from "./WstETHPriceFeed";
68
69
  export type { CETHv3 } from "./CETHv3";
69
70
  export type { CUSDCev3 } from "./CUSDCev3";
@@ -9,8 +9,10 @@ export interface FluidMarketInfo {
9
9
  marketAddress: string;
10
10
  hasSmartCollateral: boolean;
11
11
  hasSmartDebt: boolean;
12
- collateralAsset: string;
13
- debtAsset: string;
12
+ collateralAsset0: string;
13
+ collateralAsset1?: string;
14
+ debtAsset0: string;
15
+ debtAsset1?: string;
14
16
  ethBased?: boolean;
15
17
  btcBased?: boolean;
16
18
  wstETHBased?: boolean;
@@ -167,6 +169,13 @@ export interface FluidAssetData {
167
169
  canBeBorrowed: boolean;
168
170
  supplyRate: string;
169
171
  borrowRate: string;
172
+ utilization?: string;
173
+ withdrawable?: string;
174
+ borrowable?: string;
175
+ tokenPerSupplyShare?: string;
176
+ tokenPerBorrowShare?: string;
177
+ supplyReserves?: string;
178
+ borrowReserves?: string;
170
179
  }
171
180
  export type FluidAssetsData = {
172
181
  [key: string]: FluidAssetData;
@@ -193,19 +202,37 @@ export interface InnerFluidMarketData {
193
202
  totalSupplyVaultUsd: string;
194
203
  totalBorrowVault: string;
195
204
  totalBorrowVaultUsd: string;
196
- withdrawalLimit: string;
197
- withdrawableUntilLimit: string;
205
+ withdrawalLimit?: string;
206
+ withdrawableUntilLimit?: string;
198
207
  withdrawable: string;
199
- borrowLimit: string;
200
- borrowableUntilLimit: string;
208
+ withdrawableDex?: string;
209
+ borrowLimit?: string;
210
+ borrowableUntilLimit?: string;
201
211
  borrowable: string;
202
- borrowLimitUtilization: string;
203
- maxBorrowLimit: string;
204
- baseBorrowLimit: string;
205
- minimumBorrowing: string;
212
+ borrowableDex?: string;
213
+ borrowLimitUtilization?: string;
214
+ maxBorrowLimit?: string;
215
+ baseBorrowLimit?: string;
216
+ minimumBorrowing?: string;
206
217
  supplyRate: string;
207
218
  borrowRate: string;
208
219
  liquidationMaxLimit: string;
220
+ collSharePrice?: string;
221
+ maxSupplyShares?: string;
222
+ withdrawableUSD?: string;
223
+ totalSupplyToken0?: string;
224
+ totalSupplyToken1?: string;
225
+ withdrawableToken0?: string;
226
+ withdrawableToken1?: string;
227
+ collDexFee?: string;
228
+ debtSharePrice?: string;
229
+ maxBorrowShares?: string;
230
+ borrowableUSD?: string;
231
+ borrowableToken0?: string;
232
+ borrowableToken1?: string;
233
+ totalBorrowToken0?: string;
234
+ totalBorrowToken1?: string;
235
+ borrowDexFee?: string;
209
236
  }
210
237
  export interface FluidMarketData {
211
238
  assetsData: FluidAssetsData;
@@ -250,5 +277,7 @@ export interface BaseFluidVaultData {
250
277
  isSubscribedToAutomation: boolean;
251
278
  automationResubscribeRequired: boolean;
252
279
  lastUpdated: number;
280
+ supplyShares?: string;
281
+ borrowShares?: string;
253
282
  }
254
283
  export type FluidVaultData = FluidAggregatedVaultData & BaseFluidVaultData;