@defisaver/positions-sdk 0.0.201-fluid-dev-9 → 0.0.201-fluid-dev-11

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 (68) hide show
  1. package/cjs/aaveV2/index.js +1 -1
  2. package/cjs/config/contracts.d.ts +87 -6
  3. package/cjs/config/contracts.js +15 -2
  4. package/cjs/fluid/index.d.ts +25 -2
  5. package/cjs/fluid/index.js +1 -1
  6. package/cjs/helpers/liquityV2Helpers/index.js +2 -2
  7. package/cjs/liquityV2/index.d.ts +9 -4
  8. package/cjs/liquityV2/index.js +69 -10
  9. package/cjs/markets/index.d.ts +1 -1
  10. package/cjs/markets/index.js +2 -1
  11. package/cjs/markets/liquityV2/index.d.ts +2 -1
  12. package/cjs/markets/liquityV2/index.js +12 -1
  13. package/cjs/markets/spark/marketAssets.js +1 -1
  14. package/cjs/morphoAaveV2/index.js +1 -1
  15. package/cjs/morphoAaveV3/index.js +1 -2
  16. package/cjs/spark/index.js +1 -2
  17. package/cjs/staking/staking.d.ts +1 -6
  18. package/cjs/staking/staking.js +20 -23
  19. package/cjs/types/contracts/generated/LiquityV2StabilityPool.d.ts +223 -0
  20. package/cjs/types/contracts/generated/LiquityV2StabilityPool.js +5 -0
  21. package/cjs/types/contracts/generated/LiquityV2View.d.ts +144 -2
  22. package/cjs/types/contracts/generated/index.d.ts +1 -0
  23. package/cjs/types/liquityV2.d.ts +1 -0
  24. package/esm/aaveV2/index.js +2 -2
  25. package/esm/config/contracts.d.ts +87 -6
  26. package/esm/config/contracts.js +15 -2
  27. package/esm/fluid/index.d.ts +25 -2
  28. package/esm/fluid/index.js +1 -1
  29. package/esm/helpers/liquityV2Helpers/index.js +2 -2
  30. package/esm/liquityV2/index.d.ts +9 -4
  31. package/esm/liquityV2/index.js +64 -10
  32. package/esm/markets/index.d.ts +1 -1
  33. package/esm/markets/index.js +1 -1
  34. package/esm/markets/liquityV2/index.d.ts +2 -1
  35. package/esm/markets/liquityV2/index.js +10 -0
  36. package/esm/markets/spark/marketAssets.js +1 -1
  37. package/esm/morphoAaveV2/index.js +2 -2
  38. package/esm/morphoAaveV3/index.js +1 -2
  39. package/esm/spark/index.js +1 -2
  40. package/esm/staking/staking.d.ts +1 -6
  41. package/esm/staking/staking.js +24 -22
  42. package/esm/types/contracts/generated/LiquityV2StabilityPool.d.ts +223 -0
  43. package/esm/types/contracts/generated/LiquityV2StabilityPool.js +4 -0
  44. package/esm/types/contracts/generated/LiquityV2View.d.ts +144 -2
  45. package/esm/types/contracts/generated/index.d.ts +1 -0
  46. package/esm/types/liquityV2.d.ts +1 -0
  47. package/package.json +2 -1
  48. package/src/aaveV2/index.ts +2 -2
  49. package/src/config/contracts.js +15 -2
  50. package/src/fluid/index.ts +1 -1
  51. package/src/helpers/liquityV2Helpers/index.ts +3 -3
  52. package/src/liquityV2/index.ts +79 -12
  53. package/src/markets/index.ts +1 -1
  54. package/src/markets/liquityV2/index.ts +13 -2
  55. package/src/markets/spark/marketAssets.ts +1 -1
  56. package/src/morphoAaveV2/index.ts +2 -2
  57. package/src/morphoAaveV3/index.ts +1 -2
  58. package/src/spark/index.ts +1 -2
  59. package/src/staking/staking.ts +22 -22
  60. package/src/types/contracts/generated/LiquityV2StabilityPool.ts +453 -0
  61. package/src/types/contracts/generated/LiquityV2View.ts +173 -2
  62. package/src/types/contracts/generated/index.ts +1 -0
  63. package/src/types/liquityV2.ts +1 -0
  64. package/cjs/services/dsrService.d.ts +0 -3
  65. package/cjs/services/dsrService.js +0 -28
  66. package/esm/services/dsrService.d.ts +0 -3
  67. package/esm/services/dsrService.js +0 -21
  68. package/src/services/dsrService.ts +0 -16
@@ -21,6 +21,85 @@ export interface EventOptions {
21
21
  topics?: string[];
22
22
  }
23
23
 
24
+ export declare namespace IBorrowerOperations {
25
+ export type InterestBatchManagerStruct =
26
+ | [number | string | BN, number | string | BN, number | string | BN]
27
+ | {
28
+ minInterestRate: number | string | BN;
29
+ maxInterestRate: number | string | BN;
30
+ minInterestRateChangePeriod: number | string | BN;
31
+ };
32
+
33
+ export type InterestBatchManagerStructOutputArray = [string, string, string];
34
+ export type InterestBatchManagerStructOutputStruct = {
35
+ minInterestRate: string;
36
+ maxInterestRate: string;
37
+ minInterestRateChangePeriod: string;
38
+ };
39
+ export type InterestBatchManagerStructOutput =
40
+ InterestBatchManagerStructOutputArray &
41
+ InterestBatchManagerStructOutputStruct;
42
+ }
43
+
44
+ export declare namespace ITroveManager {
45
+ export type LatestBatchDataStruct =
46
+ | [
47
+ number | string | BN,
48
+ number | string | BN,
49
+ number | string | BN,
50
+ number | string | BN,
51
+ number | string | BN,
52
+ number | string | BN,
53
+ number | string | BN,
54
+ number | string | BN,
55
+ number | string | BN,
56
+ number | string | BN,
57
+ number | string | BN
58
+ ]
59
+ | {
60
+ entireDebtWithoutRedistribution: number | string | BN;
61
+ entireCollWithoutRedistribution: number | string | BN;
62
+ accruedInterest: number | string | BN;
63
+ recordedDebt: number | string | BN;
64
+ annualInterestRate: number | string | BN;
65
+ weightedRecordedDebt: number | string | BN;
66
+ annualManagementFee: number | string | BN;
67
+ accruedManagementFee: number | string | BN;
68
+ weightedRecordedBatchManagementFee: number | string | BN;
69
+ lastDebtUpdateTime: number | string | BN;
70
+ lastInterestRateAdjTime: number | string | BN;
71
+ };
72
+
73
+ export type LatestBatchDataStructOutputArray = [
74
+ string,
75
+ string,
76
+ string,
77
+ string,
78
+ string,
79
+ string,
80
+ string,
81
+ string,
82
+ string,
83
+ string,
84
+ string
85
+ ];
86
+ export type LatestBatchDataStructOutputStruct = {
87
+ entireDebtWithoutRedistribution: string;
88
+ entireCollWithoutRedistribution: string;
89
+ accruedInterest: string;
90
+ recordedDebt: string;
91
+ annualInterestRate: string;
92
+ weightedRecordedDebt: string;
93
+ annualManagementFee: string;
94
+ accruedManagementFee: string;
95
+ weightedRecordedBatchManagementFee: string;
96
+ lastDebtUpdateTime: string;
97
+ lastInterestRateAdjTime: string;
98
+ };
99
+ export type LatestBatchDataStructOutput = LatestBatchDataStructOutputArray &
100
+ LatestBatchDataStructOutputStruct;
101
+ }
102
+
24
103
  export declare namespace LiquityV2View {
25
104
  export type MarketDataStruct =
26
105
  | [
@@ -43,7 +122,8 @@ export declare namespace LiquityV2View {
43
122
  string,
44
123
  string,
45
124
  number | string | BN,
46
- boolean
125
+ boolean,
126
+ number | string | BN
47
127
  ]
48
128
  | {
49
129
  market: string;
@@ -66,6 +146,7 @@ export declare namespace LiquityV2View {
66
146
  priceFeed: string;
67
147
  collPrice: number | string | BN;
68
148
  isShutDown: boolean;
149
+ boldDepositInSp: number | string | BN;
69
150
  };
70
151
 
71
152
  export type MarketDataStructOutputArray = [
@@ -88,7 +169,8 @@ export declare namespace LiquityV2View {
88
169
  string,
89
170
  string,
90
171
  string,
91
- boolean
172
+ boolean,
173
+ string
92
174
  ];
93
175
  export type MarketDataStructOutputStruct = {
94
176
  market: string;
@@ -111,6 +193,7 @@ export declare namespace LiquityV2View {
111
193
  priceFeed: string;
112
194
  collPrice: string;
113
195
  isShutDown: boolean;
196
+ boldDepositInSp: string;
114
197
  };
115
198
  export type MarketDataStructOutput = MarketDataStructOutputArray &
116
199
  MarketDataStructOutputStruct;
@@ -127,6 +210,7 @@ export declare namespace LiquityV2View {
127
210
  number | string | BN,
128
211
  number | string | BN,
129
212
  string,
213
+ number | string | BN,
130
214
  number | string | BN
131
215
  ]
132
216
  | {
@@ -141,6 +225,7 @@ export declare namespace LiquityV2View {
141
225
  annualInterestRate: number | string | BN;
142
226
  interestBatchManager: string;
143
227
  batchDebtShares: number | string | BN;
228
+ lastInterestRateAdjTime: number | string | BN;
144
229
  };
145
230
 
146
231
  export type TroveDataStructOutputArray = [
@@ -154,6 +239,7 @@ export declare namespace LiquityV2View {
154
239
  string,
155
240
  string,
156
241
  string,
242
+ string,
157
243
  string
158
244
  ];
159
245
  export type TroveDataStructOutputStruct = {
@@ -168,6 +254,7 @@ export declare namespace LiquityV2View {
168
254
  annualInterestRate: string;
169
255
  interestBatchManager: string;
170
256
  batchDebtShares: string;
257
+ lastInterestRateAdjTime: string;
171
258
  };
172
259
  export type TroveDataStructOutput = TroveDataStructOutputArray &
173
260
  TroveDataStructOutputStruct;
@@ -185,6 +272,69 @@ export declare namespace LiquityV2View {
185
272
  ExistingTroveStructOutputStruct;
186
273
  }
187
274
 
275
+ export declare namespace IMultiTroveGetter {
276
+ export type CombinedTroveDataStruct =
277
+ | [
278
+ number | string | BN,
279
+ number | string | BN,
280
+ number | string | BN,
281
+ number | string | BN,
282
+ number | string | BN,
283
+ number | string | BN,
284
+ number | string | BN,
285
+ string,
286
+ number | string | BN,
287
+ number | string | BN,
288
+ number | string | BN,
289
+ number | string | BN
290
+ ]
291
+ | {
292
+ id: number | string | BN;
293
+ debt: number | string | BN;
294
+ coll: number | string | BN;
295
+ stake: number | string | BN;
296
+ annualInterestRate: number | string | BN;
297
+ lastDebtUpdateTime: number | string | BN;
298
+ lastInterestRateAdjTime: number | string | BN;
299
+ interestBatchManager: string;
300
+ batchDebtShares: number | string | BN;
301
+ batchCollShares: number | string | BN;
302
+ snapshotETH: number | string | BN;
303
+ snapshotBoldDebt: number | string | BN;
304
+ };
305
+
306
+ export type CombinedTroveDataStructOutputArray = [
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
+ export type CombinedTroveDataStructOutputStruct = {
321
+ id: string;
322
+ debt: string;
323
+ coll: string;
324
+ stake: string;
325
+ annualInterestRate: string;
326
+ lastDebtUpdateTime: string;
327
+ lastInterestRateAdjTime: string;
328
+ interestBatchManager: string;
329
+ batchDebtShares: string;
330
+ batchCollShares: string;
331
+ snapshotETH: string;
332
+ snapshotBoldDebt: string;
333
+ };
334
+ export type CombinedTroveDataStructOutput =
335
+ CombinedTroveDataStructOutputArray & CombinedTroveDataStructOutputStruct;
336
+ }
337
+
188
338
  export interface LiquityV2View extends BaseContract {
189
339
  constructor(
190
340
  jsonInterface: any[],
@@ -216,6 +366,19 @@ export interface LiquityV2View extends BaseContract {
216
366
  }
217
367
  >;
218
368
 
369
+ getBatchManagerInfo(
370
+ _market: string,
371
+ _manager: string
372
+ ): NonPayableTransactionObject<
373
+ [
374
+ IBorrowerOperations.InterestBatchManagerStructOutput,
375
+ ITroveManager.LatestBatchDataStructOutput
376
+ ] & {
377
+ managerData: IBorrowerOperations.InterestBatchManagerStructOutput;
378
+ batchData: ITroveManager.LatestBatchDataStructOutput;
379
+ }
380
+ >;
381
+
219
382
  getDebtInFront(
220
383
  _market: string,
221
384
  _troveId: number | string | BN,
@@ -265,6 +428,14 @@ export interface LiquityV2View extends BaseContract {
265
428
  _market: string
266
429
  ): NonPayableTransactionObject<LiquityV2View.MarketDataStructOutput>;
267
430
 
431
+ getMultipleSortedTroves(
432
+ _market: string,
433
+ _startIdx: number | string | BN,
434
+ _count: number | string | BN
435
+ ): NonPayableTransactionObject<
436
+ IMultiTroveGetter.CombinedTroveDataStructOutput[]
437
+ >;
438
+
268
439
  getNumOfTrovesInFrontOfTrove(
269
440
  _market: string,
270
441
  _troveId: number | string | BN,
@@ -41,6 +41,7 @@ export type { LendingPoolAddressesProvider } from "./LendingPoolAddressesProvide
41
41
  export type { Lido } from "./Lido";
42
42
  export type { LiquityActivePool } from "./LiquityActivePool";
43
43
  export type { LiquityV2CollSurplusPool } from "./LiquityV2CollSurplusPool";
44
+ export type { LiquityV2StabilityPool } from "./LiquityV2StabilityPool";
44
45
  export type { LiquityV2TroveNFT } from "./LiquityV2TroveNFT";
45
46
  export type { LiquityV2View } from "./LiquityV2View";
46
47
  export type { LiquityView } from "./LiquityView";
@@ -116,4 +116,5 @@ export interface LiquityV2TroveData {
116
116
  leveragedAsset: string,
117
117
  liquidationPrice: string,
118
118
  debtInFront: string,
119
+ lastInterestRateAdjTime: string,
119
120
  }
@@ -1,3 +0,0 @@
1
- import Web3 from 'web3';
2
- import { NetworkNumber } from '../types/common';
3
- export declare const getDsrApy: (web3: Web3, network: NetworkNumber) => Promise<string>;
@@ -1,28 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.getDsrApy = void 0;
16
- const decimal_js_1 = __importDefault(require("decimal.js"));
17
- const constants_1 = require("../constants");
18
- const contracts_1 = require("../contracts");
19
- const getDsrApy = (web3, network) => __awaiter(void 0, void 0, void 0, function* () {
20
- const potContract = (0, contracts_1.PotContract)(web3, network);
21
- return new decimal_js_1.default(yield potContract.methods.dsr().call())
22
- .div(new decimal_js_1.default(1e27))
23
- .pow(constants_1.SECONDS_PER_YEAR)
24
- .sub(1)
25
- .mul(100)
26
- .toString();
27
- });
28
- exports.getDsrApy = getDsrApy;
@@ -1,3 +0,0 @@
1
- import Web3 from 'web3';
2
- import { NetworkNumber } from '../types/common';
3
- export declare const getDsrApy: (web3: Web3, network: NetworkNumber) => Promise<string>;
@@ -1,21 +0,0 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- import Dec from 'decimal.js';
11
- import { SECONDS_PER_YEAR } from '../constants';
12
- import { PotContract } from '../contracts';
13
- export const getDsrApy = (web3, network) => __awaiter(void 0, void 0, void 0, function* () {
14
- const potContract = PotContract(web3, network);
15
- return new Dec(yield potContract.methods.dsr().call())
16
- .div(new Dec(1e27))
17
- .pow(SECONDS_PER_YEAR)
18
- .sub(1)
19
- .mul(100)
20
- .toString();
21
- });
@@ -1,16 +0,0 @@
1
- import Dec from 'decimal.js';
2
- import Web3 from 'web3';
3
- import { NetworkNumber } from '../types/common';
4
- import { SECONDS_PER_YEAR } from '../constants';
5
- import { PotContract } from '../contracts';
6
-
7
-
8
- export const getDsrApy = async (web3: Web3, network: NetworkNumber) => {
9
- const potContract = PotContract(web3, network);
10
- return new Dec(await potContract.methods.dsr().call())
11
- .div(new Dec(1e27))
12
- .pow(SECONDS_PER_YEAR)
13
- .sub(1)
14
- .mul(100)
15
- .toString();
16
- };