@gearbox-protocol/sdk 14.12.0-next.73 → 14.12.0-next.75

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 (91) hide show
  1. package/dist/cjs/dev/AccountOpener.js +2 -5
  2. package/dist/cjs/plugins/accounts-counter/AccountsCounterPlugin.js +1 -1
  3. package/dist/cjs/sdk/accounts/CreditAccountsServiceV310.js +118 -974
  4. package/dist/cjs/sdk/accounts/credit-account-compressor/CreditAccountCompressor.js +280 -0
  5. package/dist/cjs/sdk/accounts/credit-account-compressor/CreditAccountCompressorV310Contract.js +141 -0
  6. package/dist/cjs/sdk/accounts/credit-account-compressor/index.js +6 -0
  7. package/dist/cjs/sdk/accounts/credit-account-compressor/types.js +1 -0
  8. package/dist/cjs/sdk/accounts/index.js +5 -4
  9. package/dist/cjs/sdk/accounts/intents/operations/unwrap-rwa-collateral/index.js +1 -1
  10. package/dist/cjs/sdk/accounts/intents/operations/wrap-rwa-collateral/index.js +1 -1
  11. package/dist/cjs/sdk/accounts/intents/testing/sdk-mock.js +2 -2
  12. package/dist/cjs/sdk/accounts/liquidations/LiquidationsService.js +3 -3
  13. package/dist/cjs/sdk/accounts/liquidations/constants.js +0 -2
  14. package/dist/cjs/sdk/accounts/liquidations/index.js +0 -2
  15. package/dist/cjs/sdk/constants/index.js +1 -0
  16. package/dist/cjs/sdk/constants/math.js +5 -0
  17. package/dist/cjs/sdk/index.js +12 -4
  18. package/dist/cjs/sdk/market/MarketRegister.js +10 -0
  19. package/dist/cjs/sdk/market/credit/CreditFacadeV310Contract.js +181 -0
  20. package/dist/cjs/sdk/market/credit/CreditSuite.js +107 -1
  21. package/dist/cjs/sdk/{accounts → market/credit}/dominantCollateral.js +18 -4
  22. package/dist/cjs/sdk/market/credit/index.js +3 -0
  23. package/dist/cjs/sdk/market/index.js +3 -0
  24. package/dist/cjs/sdk/market/math.js +59 -0
  25. package/dist/cjs/sdk/market/oracle/PriceOracleBaseContract.js +41 -1
  26. package/dist/cjs/sdk/market/oracle/PriceOracleV310Contract.js +0 -30
  27. package/dist/cjs/sdk/market/pricefeeds/PriceFeedsRegister.js +1 -1
  28. package/dist/cjs/sdk/opportunities/index.js +4 -0
  29. package/dist/esm/dev/AccountOpener.js +2 -5
  30. package/dist/esm/plugins/accounts-counter/AccountsCounterPlugin.js +1 -1
  31. package/dist/esm/sdk/accounts/CreditAccountsServiceV310.js +121 -977
  32. package/dist/esm/sdk/accounts/credit-account-compressor/CreditAccountCompressor.js +279 -0
  33. package/dist/esm/sdk/accounts/credit-account-compressor/CreditAccountCompressorV310Contract.js +141 -0
  34. package/dist/esm/sdk/accounts/credit-account-compressor/index.js +4 -0
  35. package/dist/esm/sdk/accounts/credit-account-compressor/types.js +1 -0
  36. package/dist/esm/sdk/accounts/index.js +4 -3
  37. package/dist/esm/sdk/accounts/intents/operations/unwrap-rwa-collateral/index.js +1 -1
  38. package/dist/esm/sdk/accounts/intents/operations/wrap-rwa-collateral/index.js +1 -1
  39. package/dist/esm/sdk/accounts/intents/testing/sdk-mock.js +2 -2
  40. package/dist/esm/sdk/accounts/liquidations/LiquidationsService.js +2 -2
  41. package/dist/esm/sdk/accounts/liquidations/constants.js +1 -2
  42. package/dist/esm/sdk/accounts/liquidations/index.js +1 -2
  43. package/dist/esm/sdk/constants/index.js +2 -2
  44. package/dist/esm/sdk/constants/math.js +5 -1
  45. package/dist/esm/sdk/index.js +6 -5
  46. package/dist/esm/sdk/market/MarketRegister.js +10 -0
  47. package/dist/esm/sdk/market/credit/CreditFacadeV310Contract.js +181 -0
  48. package/dist/esm/sdk/market/credit/CreditSuite.js +108 -2
  49. package/dist/esm/sdk/{accounts → market/credit}/dominantCollateral.js +18 -5
  50. package/dist/esm/sdk/market/credit/index.js +2 -1
  51. package/dist/esm/sdk/market/index.js +2 -1
  52. package/dist/esm/sdk/market/math.js +56 -1
  53. package/dist/esm/sdk/market/oracle/PriceOracleBaseContract.js +41 -1
  54. package/dist/esm/sdk/market/oracle/PriceOracleV310Contract.js +1 -31
  55. package/dist/esm/sdk/market/pricefeeds/PriceFeedsRegister.js +1 -1
  56. package/dist/esm/sdk/opportunities/index.js +2 -2
  57. package/dist/types/plugins/accounts/AccountsPlugin.d.ts +1 -1
  58. package/dist/types/sdk/OnchainSDK.d.ts +1 -1
  59. package/dist/types/sdk/accounts/CreditAccountsServiceV310.d.ts +23 -124
  60. package/dist/types/sdk/accounts/credit-account-compressor/CreditAccountCompressor.d.ts +60 -0
  61. package/dist/types/sdk/accounts/credit-account-compressor/CreditAccountCompressorV310Contract.d.ts +879 -0
  62. package/dist/types/sdk/accounts/credit-account-compressor/index.d.ts +4 -0
  63. package/dist/types/sdk/accounts/credit-account-compressor/types.d.ts +164 -0
  64. package/dist/types/sdk/accounts/index.d.ts +7 -5
  65. package/dist/types/sdk/accounts/liquidations/constants.d.ts +1 -2
  66. package/dist/types/sdk/accounts/liquidations/index.d.ts +1 -2
  67. package/dist/types/sdk/accounts/types.d.ts +46 -457
  68. package/dist/types/sdk/base/index.d.ts +2 -2
  69. package/dist/types/sdk/base/types.d.ts +6 -1
  70. package/dist/types/sdk/constants/index.d.ts +2 -2
  71. package/dist/types/sdk/constants/math.d.ts +5 -1
  72. package/dist/types/sdk/index.d.ts +16 -14
  73. package/dist/types/sdk/market/MarketRegister.d.ts +7 -0
  74. package/dist/types/sdk/market/credit/CreditFacadeV310Contract.d.ts +47 -2
  75. package/dist/types/sdk/market/credit/CreditSuite.d.ts +24 -2
  76. package/dist/types/sdk/{accounts → market/credit}/dominantCollateral.d.ts +13 -6
  77. package/dist/types/sdk/market/credit/index.d.ts +3 -2
  78. package/dist/types/sdk/market/credit/types.d.ts +112 -2
  79. package/dist/types/sdk/market/index.d.ts +4 -3
  80. package/dist/types/sdk/market/math.d.ts +60 -1
  81. package/dist/types/sdk/market/oracle/PriceOracleBaseContract.d.ts +15 -4
  82. package/dist/types/sdk/market/oracle/PriceOracleV310Contract.d.ts +0 -10
  83. package/dist/types/sdk/market/oracle/index.d.ts +2 -2
  84. package/dist/types/sdk/market/oracle/types.d.ts +30 -14
  85. package/dist/types/sdk/market/rwa/securitize/SecuritizeRWAFactory.d.ts +1 -1
  86. package/dist/types/sdk/market/rwa/types.d.ts +1 -1
  87. package/dist/types/sdk/opportunities/index.d.ts +2 -2
  88. package/package.json +1 -1
  89. package/dist/cjs/sdk/accounts/constants.js +0 -12
  90. package/dist/esm/sdk/accounts/constants.js +0 -11
  91. package/dist/types/sdk/accounts/constants.d.ts +0 -11
@@ -1,13 +1,15 @@
1
1
  import { StrategyPosition } from "../../model/positions.js";
2
2
  import "../../model/index.js";
3
3
  import { RequestableWithdrawal } from "./withdrawal-compressor/types.js";
4
- import { Asset, CreditAccountData } from "../base/types.js";
4
+ import { Asset, CreditAccountData, CreditAccountTokensSlice } from "../base/types.js";
5
+ import { RWAOpenAccountRequirements } from "../market/rwa/types.js";
6
+ import "../market/rwa/index.js";
5
7
  import { RouterCASlice } from "../router/types.js";
6
8
  import "../router/index.js";
9
+ import { GetCreditAccountsOptions, ListStrategyPositionsProps } from "./credit-account-compressor/types.js";
10
+ import "./credit-account-compressor/index.js";
7
11
  import "./withdrawal-compressor/index.js";
8
- import { AccountToCheck, AddCollateralProps, AssembleCaOperationsProps, AssembleClaimDelayedCallsProps, AssembleCloseCreditAccountCallsProps, AssembleRepayCreditAccountCallsProps, AssembleStartDelayedWithdrawalCallsProps, ChangeDeptProps, ClaimDelayedProps, ClaimFarmRewardsProps, CloseCreditAccountProps, CloseCreditAccountResult, CreditAccountOperationResult, CreditAccountTokensSlice, CreditManagerOperationResult, DefaultPartialLiquidationParams, ExecuteSwapProps, FullyLiquidateProps, FullyLiquidateResult, GetApprovalAddressProps, GetConnectedBotsResult, GetConnectedMigrationBotsResult, GetCreditAccountsOptions, GetOpenAccountRequirementsProps, GetPendingWithdrawalsProps, GetPendingWithdrawalsResult, ICreditAccountsService, ListStrategyPositionsProps, OpenCAProps, PartiallyLiquidateProps, PermitResult, PrepareUpdateQuotasProps, PreviewDelayedWithdrawalProps, RepayAndLiquidateCreditAccountProps, RepayCreditAccountProps, Rewards, SetBotProps, StartDelayedWithdrawalProps, UpdateQuotasProps, WithdrawCollateralProps } from "./types.js";
9
- import { RWAOpenAccountRequirements } from "../market/rwa/types.js";
10
- import "../market/rwa/index.js";
12
+ import { AccountToCheck, AssembleCaOperationsProps, AssembleClaimDelayedCallsProps, AssembleCloseCreditAccountCallsProps, AssembleRepayCreditAccountCallsProps, AssembleStartDelayedWithdrawalCallsProps, ClaimFarmRewardsProps, CreditAccountOperationResult, CreditManagerOperationResult, FullyLiquidateProps, FullyLiquidateResult, GetApprovalAddressProps, GetConnectedBotsResult, GetConnectedMigrationBotsResult, GetOpenAccountRequirementsProps, GetPendingWithdrawalsProps, GetPendingWithdrawalsResult, ICreditAccountsService, OpenCAProps, PartiallyLiquidateProps, PermitResult, PrepareUpdateQuotasProps, PreviewDelayedWithdrawalProps, Rewards, SetBotProps } from "./types.js";
11
13
  import { PriceUpdate } from "../market/pricefeeds/types.js";
12
14
  import "../market/index.js";
13
15
  import { MultiCall, RawTx } from "../types/transactions.js";
@@ -17,16 +19,6 @@ import { SDKConstruct } from "../base/SDKConstruct.js";
17
19
  import "../base/index.js";
18
20
  import { Address } from "viem";
19
21
  //#region src/sdk/accounts/CreditAccountsServiceV310.d.ts
20
- /**
21
- * Options for configuring the credit account service.
22
- **/
23
- interface CreditAccountServiceOptions {
24
- /**
25
- * Maximum number of credit accounts to fetch per compressor call.
26
- * When set, accounts are loaded in batches of this size until all are fetched.
27
- **/
28
- batchSize?: number;
29
- }
30
22
  /**
31
23
  * Service for querying and operating on Gearbox credit accounts.
32
24
  *
@@ -38,8 +30,7 @@ interface CreditAccountServiceOptions {
38
30
  **/
39
31
  declare class CreditAccountsServiceV310 extends SDKConstruct implements ICreditAccountsService {
40
32
  #private;
41
- constructor(sdk: OnchainSDK, options?: CreditAccountServiceOptions);
42
- setBatchSize(batchSize: number): void;
33
+ constructor(sdk: OnchainSDK);
43
34
  /**
44
35
  * {@inheritDoc ICreditAccountsService.getCreditAccountData}
45
36
  **/
@@ -72,38 +63,14 @@ declare class CreditAccountsServiceV310 extends SDKConstruct implements ICreditA
72
63
  * {@inheritDoc ICreditAccountsService.fullyLiquidate}
73
64
  **/
74
65
  fullyLiquidate(props: FullyLiquidateProps): Promise<FullyLiquidateResult>;
75
- /**
76
- * {@inheritDoc ICreditAccountsService.defaultPartialLiquidationParams}
77
- */
78
- defaultPartialLiquidationParams(ca: CreditAccountData): DefaultPartialLiquidationParams;
79
66
  /**
80
67
  * {@inheritDoc ICreditAccountsService.partiallyLiquidate}
81
68
  */
82
69
  partiallyLiquidate(props: PartiallyLiquidateProps): Promise<RawTx>;
83
- /**
84
- * {@inheritDoc ICreditAccountsService.closeCreditAccount}
85
- **/
86
- closeCreditAccount({ operation, assetsToWithdraw, creditAccount: ca, to, slippage, closePath }: CloseCreditAccountProps): Promise<CloseCreditAccountResult>;
87
70
  /**
88
71
  * {@inheritDoc ICreditAccountsService.assembleCloseCreditAccountCalls}
89
72
  */
90
73
  assembleCloseCreditAccountCalls({ creditAccount: ca, routerCalls, assetsToWithdraw, to }: AssembleCloseCreditAccountCallsProps): Promise<Array<MultiCall>>;
91
- /**
92
- * {@inheritDoc ICreditAccountsService.updateQuotas}
93
- **/
94
- updateQuotas({ minQuota, averageQuota, creditAccount }: UpdateQuotasProps): Promise<CreditAccountOperationResult>;
95
- /**
96
- * {@inheritDoc ICreditAccountsService.addCollateral}
97
- **/
98
- addCollateral({ creditAccount, asset, permit, ethAmount, minQuota, averageQuota }: AddCollateralProps): Promise<CreditAccountOperationResult>;
99
- /**
100
- * {@inheritDoc ICreditAccountsService.changeDebt}
101
- **/
102
- changeDebt({ creditAccount, amount, collateral }: ChangeDeptProps): Promise<CreditAccountOperationResult>;
103
- /**
104
- * {@inheritDoc ICreditAccountsService.executeSwap}
105
- **/
106
- executeSwap({ creditAccount, calls: swapCalls, minQuota, averageQuota }: ExecuteSwapProps): Promise<CreditAccountOperationResult>;
107
74
  /**
108
75
  * {@inheritDoc ICreditAccountsService.previewDelayedWithdrawal}
109
76
  **/
@@ -112,18 +79,10 @@ declare class CreditAccountsServiceV310 extends SDKConstruct implements ICreditA
112
79
  * {@inheritDoc ICreditAccountsService.getPendingWithdrawals}
113
80
  **/
114
81
  getPendingWithdrawals({ creditAccount }: GetPendingWithdrawalsProps): Promise<GetPendingWithdrawalsResult>;
115
- /**
116
- * {@inheritDoc ICreditAccountsService.startDelayedWithdrawal}
117
- **/
118
- startDelayedWithdrawal({ creditAccount, minQuota, averageQuota, preview }: StartDelayedWithdrawalProps): Promise<CreditAccountOperationResult>;
119
82
  /**
120
83
  * {@inheritDoc ICreditAccountsService.assembleStartDelayedWithdrawalCalls}
121
84
  **/
122
85
  assembleStartDelayedWithdrawalCalls({ creditFacade, preview }: AssembleStartDelayedWithdrawalCallsProps): Array<MultiCall>;
123
- /**
124
- * {@inheritDoc ICreditAccountsService.claimDelayed}
125
- **/
126
- claimDelayed({ creditAccount, minQuota, averageQuota, claimableNow }: ClaimDelayedProps): Promise<CreditAccountOperationResult>;
127
86
  /**
128
87
  * {@inheritDoc ICreditAccountsService.assembleClaimDelayedCalls}
129
88
  **/
@@ -139,92 +98,40 @@ declare class CreditAccountsServiceV310 extends SDKConstruct implements ICreditA
139
98
  /**
140
99
  * {@inheritDoc ICreditAccountsService.openCA}
141
100
  **/
142
- openCA(props: OpenCAProps): Promise<CreditAccountOperationResult>;
101
+ openCA(props: OpenCAProps): Promise<RawTx>;
143
102
  /**
144
- * {@inheritDoc ICreditAccountsService.getBorrowRate}
145
- **/
146
- getBorrowRate(ca: CreditAccountData): bigint;
147
- /**
148
- * {@inheritDoc ICreditAccountsService.getOptimalHFForPartialLiquidation}
149
- **/
150
- getOptimalHFForPartialLiquidation(ca: CreditAccountData): bigint;
151
- /**
152
- * Returns multicall entries to redeem (unwrap) RWA ERC-4626 vault shares into underlying for the given credit manager.
153
- * Used when withdrawing debt from a RWA market: redeems adapter vault shares so the underlying can be withdrawn.
154
- * Only applies when the credit manager's underlying is RWA-gated and has an ERC-4626 adapter configured.
155
- * @param amount - Number of vault shares (adapter tokens) to redeem
156
- * @param creditManager - Credit manager address
157
- * @returns Array of MultiCall to pass to credit facade multicall, or undefined if underlying is not RWA or no adapter is configured
103
+ * {@inheritDoc ICreditAccountsService.assembleRWAUnwrapCalls}
158
104
  */
159
- getRWAUnwrapCalls(amount: bigint, creditManager: Address): Promise<Array<MultiCall> | undefined>;
160
- /**
161
- * Returns multicall entries to deposit (wrap) underlying into RWA ERC-4626 vault shares for the given credit manager.
162
- * Used when adding debt on a RWA market: deposits underlying into the adapter vault so shares are minted on the account.
163
- * Only applies when the credit manager's underlying is RWA-gated and has an ERC-4626 adapter configured.
164
- * @param amount - Amount of underlying assets to deposit into the vault (in underlying decimals)
165
- * @param creditManager - Credit manager address
166
- * @returns Array of MultiCall to pass to credit facade multicall, or undefined if underlying is not RWA or no adapter is configured
167
- */
168
- getRWAWrapCalls(amount: bigint, creditManager: Address): Promise<Array<MultiCall> | undefined>;
169
- /**
170
- * Returns multicall entries to call redeemDiff on the RWA ERC-4626 adapter for the given credit manager.
171
- * Redeems the leftover vault shares (e.g. after repaying debt) so the account does not hold excess RWA vault tokens.
172
- * Only applies when the credit manager's underlying is RWA-gated and has an ERC-4626 adapter configured.
173
- * @param amount - Leftover vault share amount to redeem (in adapter/vault decimals)
174
- * @param creditManager - Credit manager address
175
- * @returns Array of MultiCall to pass to credit facade multicall, or undefined if underlying is not RWA or no adapter is configured
176
- */
177
- getRedeemDiffCalls(amount: bigint, creditManager: Address): Promise<Array<MultiCall> | undefined>;
178
- /**
179
- * Returns multicall entries to call depositDiff on the RWA ERC-4626 adapter for the given credit manager.
180
- * Deposits the leftover underlying (e.g. after decreasing debt) into the vault so the account does not hold excess underlying.
181
- * Only applies when the credit manager's underlying is RWA-gated and has an ERC-4626 adapter configured.
182
- * @param amount - Leftover underlying amount to deposit into the vault (in underlying decimals)
183
- * @param creditManager - Credit manager address
184
- * @returns Array of MultiCall to pass to credit facade multicall, or undefined if underlying is not RWA or no adapter is configured
105
+ assembleRWAUnwrapCalls(amount: bigint, creditManager: Address): Promise<Array<MultiCall> | undefined>;
106
+ /**
107
+ * {@inheritDoc ICreditAccountsService.assembleRWAWrapCalls}
185
108
  */
186
- getDepositDiffCalls(amount: bigint, creditManager: Address): Promise<Array<MultiCall> | undefined>;
109
+ assembleRWAWrapCalls(amount: bigint, creditManager: Address): Promise<Array<MultiCall> | undefined>;
187
110
  /**
188
- * {@inheritDoc ICreditAccountsService.setBot}
111
+ * {@inheritDoc ICreditAccountsService.assembleRedeemDiffCalls}
189
112
  */
190
- setBot({ botAddress, permissions: defaultPermissions, targetContract }: SetBotProps): Promise<CreditAccountOperationResult | CreditManagerOperationResult>;
113
+ assembleRedeemDiffCalls(amount: bigint, creditManager: Address): Promise<Array<MultiCall> | undefined>;
191
114
  /**
192
- * {@inheritDoc ICreditAccountsService.withdrawCollateral}
115
+ * {@inheritDoc ICreditAccountsService.assembleDepositDiffCalls}
193
116
  */
194
- withdrawCollateral({ creditAccount, assetsToWithdraw, to, minQuota, averageQuota }: WithdrawCollateralProps): Promise<CreditAccountOperationResult>;
117
+ assembleDepositDiffCalls(amount: bigint, creditManager: Address): Promise<Array<MultiCall> | undefined>;
195
118
  /**
196
- * {@inheritDoc ICreditAccountsService.repayCreditAccount}
119
+ * {@inheritDoc ICreditAccountsService.setBot}
197
120
  */
198
- repayCreditAccount(props: RepayCreditAccountProps): Promise<CreditAccountOperationResult>;
121
+ setBot({ botAddress, permissions: defaultPermissions, targetContract }: SetBotProps): Promise<CreditAccountOperationResult | CreditManagerOperationResult>;
199
122
  /**
200
123
  * {@inheritDoc ICreditAccountsService.assembleRepayCreditAccountCalls}
201
124
  */
202
125
  assembleRepayCreditAccountCalls({ collateralAssets, assetsToWithdraw, creditAccount: ca, permits, to, tokensToClaim, calls: wrapCalls }: AssembleRepayCreditAccountCallsProps): Promise<Array<MultiCall>>;
203
- /**
204
- * {@inheritDoc ICreditAccountsService.repayAndLiquidateCreditAccount}
205
- */
206
- repayAndLiquidateCreditAccount({ collateralAssets, assetsToWithdraw, creditAccount: ca, permits, to, tokensToClaim }: RepayAndLiquidateCreditAccountProps): Promise<CreditAccountOperationResult>;
207
126
  /**
208
127
  * {@inheritDoc ICreditAccountsService.claimFarmRewards}
209
128
  */
210
- claimFarmRewards({ calls: externalCalls, creditAccount: ca, minQuota, averageQuota, tokensToClaim }: ClaimFarmRewardsProps): Promise<CreditAccountOperationResult>;
129
+ claimFarmRewards({ calls: externalCalls, creditAccount: ca, minQuota, averageQuota, tokensToClaim }: ClaimFarmRewardsProps): Promise<RawTx>;
211
130
  /**
212
131
  * Returns raw txs that are needed to update all price feeds so that all credit accounts (possibly from different markets) compute
213
132
  * {@inheritDoc ICreditAccountsService.getOnDemandPriceUpdates}
214
133
  **/
215
134
  getOnDemandPriceUpdates(account: CreditAccountTokensSlice, ignoreReservePrices?: boolean): Promise<PriceUpdate[]>;
216
- /**
217
- * {@inheritDoc ICreditAccountsService.multicall}
218
- */
219
- multicall(creditAccount: RouterCASlice, calls: MultiCall[], options?: {
220
- ignoreReservePrices?: boolean;
221
- }): Promise<RawTx>;
222
- /**
223
- * {@inheritDoc ICreditAccountsService.botMulticall}
224
- */
225
- botMulticall(creditAccount: RouterCASlice, calls: MultiCall[], options?: {
226
- ignoreReservePrices?: boolean;
227
- }): Promise<RawTx>;
228
135
  /**
229
136
  * {@inheritDoc ICreditAccountsService.prependPriceUpdates}
230
137
  */
@@ -241,14 +148,11 @@ declare class CreditAccountsServiceV310 extends SDKConstruct implements ICreditA
241
148
  executeCaUpdate(creditAccount: RouterCASlice, calls: MultiCall[], options?: {
242
149
  ignoreReservePrices?: boolean;
243
150
  ethAmount?: bigint;
244
- }): Promise<{
245
- tx: RawTx;
246
- calls: MultiCall[];
247
- }>;
151
+ }): Promise<RawTx>;
248
152
  /**
249
153
  * {@inheritDoc ICreditAccountsService.prepareUpdateQuotas}
250
154
  */
251
- prepareUpdateQuotas(creditFacade: Address, { averageQuota, minQuota }: PrepareUpdateQuotasProps): Array<MultiCall>;
155
+ prepareUpdateQuotas(creditFacade: Address, props: PrepareUpdateQuotasProps): Array<MultiCall>;
252
156
  /**
253
157
  * {@inheritDoc ICreditAccountsService.prepareWithdrawToken}
254
158
  */
@@ -265,13 +169,8 @@ declare class CreditAccountsServiceV310 extends SDKConstruct implements ICreditA
265
169
  * {@inheritDoc ICreditAccountsService.prepareAddCollateral}
266
170
  */
267
171
  prepareAddCollateral(creditFacade: Address, assets: Array<Asset>, permits: Record<string, PermitResult>): Array<MultiCall>;
268
- /**
269
- * Returns addresses of market configurators
270
- */
271
- private get marketConfigurators();
272
172
  private get rewardCompressor();
273
173
  private get peripheryCompressor();
274
- private get compressor();
275
174
  }
276
175
  //#endregion
277
- export { CreditAccountServiceOptions, CreditAccountsServiceV310 };
176
+ export { CreditAccountsServiceV310 };
@@ -0,0 +1,60 @@
1
+ import { StrategyPosition } from "../../../model/positions.js";
2
+ import "../../../model/index.js";
3
+ import { CreditAccountData } from "../../base/types.js";
4
+ import { GetCreditAccountsOptions, ListStrategyPositionsProps } from "./types.js";
5
+ import { SDKConstruct } from "../../base/SDKConstruct.js";
6
+ import "../../base/index.js";
7
+ import { Address } from "viem";
8
+ //#region src/sdk/accounts/credit-account-compressor/CreditAccountCompressor.d.ts
9
+ /**
10
+ * Reads credit accounts of the current chain.
11
+ *
12
+ * Stitches the credit account compressor together with the RWA factories (for
13
+ * accounts owned via an investor EOA) and with the withdrawal compressor (for
14
+ * assets that are on their way out of an account), and describes the result
15
+ * either as raw account data or as {@link StrategyPosition}s.
16
+ *
17
+ * TODO: create and deploy new compressor contract onchain to avoid all this stitching
18
+ **/
19
+ declare class CreditAccountCompressor extends SDKConstruct {
20
+ #private;
21
+ /**
22
+ * Reads data of a single credit account.
23
+ *
24
+ * When the compressor cannot value the account with current prices, the read
25
+ * is retried with price feed updates applied.
26
+ *
27
+ * @param account - Credit account address.
28
+ * @param blockNumber - Block to read at, defaults to the latest block.
29
+ * @returns Account data, or `undefined` if the account does not exist.
30
+ **/
31
+ getCreditAccountData(account: Address, blockNumber?: bigint): Promise<CreditAccountData<true> | undefined>;
32
+ /**
33
+ * Reads all credit accounts matching the options, sorted by health factor
34
+ * ascending.
35
+ *
36
+ * @param options - {@link GetCreditAccountsOptions}
37
+ * @param blockNumber - Block to read at, defaults to the latest block.
38
+ **/
39
+ getCreditAccounts(options?: GetCreditAccountsOptions, blockNumber?: bigint): Promise<CreditAccountData[]>;
40
+ /**
41
+ * Reads all credit accounts of a borrower, sorted by health factor
42
+ * ascending.
43
+ *
44
+ * Covers accounts the borrower owns directly and RWA accounts they own as an
45
+ * investor, which are owned on-chain by an RWA factory.
46
+ *
47
+ * @param borrower - Wallet address.
48
+ * @param options - {@link GetCreditAccountsOptions}
49
+ * @param blockNumber - Block to read at, defaults to the latest block.
50
+ **/
51
+ getBorrowerCreditAccounts(borrower: Address, options?: GetCreditAccountsOptions, blockNumber?: bigint): Promise<CreditAccountData<true>[]>;
52
+ /**
53
+ * Describes all credit accounts of a wallet as strategy positions.
54
+ *
55
+ * @param props - {@link ListStrategyPositionsProps}
56
+ **/
57
+ listPositions(props: ListStrategyPositionsProps): Promise<StrategyPosition[]>;
58
+ }
59
+ //#endregion
60
+ export { CreditAccountCompressor };