@gearbox-protocol/sdk 13.3.0-next.3 → 13.3.1

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 (216) hide show
  1. package/dist/cjs/common-utils/charts/credit-manager-payload.js +16 -0
  2. package/dist/cjs/common-utils/charts/credit-manager.js +134 -0
  3. package/dist/cjs/common-utils/charts/credit-session.js +257 -0
  4. package/dist/cjs/common-utils/charts/credit-sessions-payload.js +16 -0
  5. package/dist/cjs/common-utils/charts/graph-payload.js +16 -0
  6. package/dist/cjs/common-utils/charts/index.js +36 -0
  7. package/dist/cjs/common-utils/charts/pool-payload.js +16 -0
  8. package/dist/cjs/common-utils/charts/pool.js +199 -0
  9. package/dist/cjs/common-utils/charts/token-data.js +91 -0
  10. package/dist/cjs/common-utils/index.js +4 -0
  11. package/dist/cjs/common-utils/static/index.js +28 -0
  12. package/dist/cjs/common-utils/static/migration-config.js +16 -0
  13. package/dist/cjs/common-utils/static/pool-config.js +16 -0
  14. package/dist/cjs/common-utils/static/strategy.js +16 -0
  15. package/dist/cjs/common-utils/static/trading-pair.js +16 -0
  16. package/dist/cjs/common-utils/utils/{assetsMath.js → assets-math.js} +13 -13
  17. package/dist/cjs/common-utils/utils/{bigintMath.js → bigint-math.js} +3 -3
  18. package/dist/cjs/common-utils/utils/creditAccount/{calcHealthFactor.js → calc-health-factor.js} +9 -9
  19. package/dist/cjs/common-utils/utils/creditAccount/{calcOverallAPY.js → calc-overall-apy.js} +8 -8
  20. package/dist/cjs/common-utils/utils/creditAccount/{calcQuotaBorrowRate.js → calc-quota-borrow-rate.js} +3 -3
  21. package/dist/cjs/common-utils/utils/creditAccount/{calcRelativeBaseBorrowRate.js → calc-relative-base-borrow-rate.js} +3 -3
  22. package/dist/cjs/common-utils/utils/creditAccount/debt.js +4 -4
  23. package/dist/cjs/common-utils/utils/creditAccount/{getTimeToLiquidation.js → get-time-to-liquidation.js} +3 -3
  24. package/dist/cjs/common-utils/utils/creditAccount/index.js +16 -16
  25. package/dist/cjs/common-utils/utils/creditAccount/{liquidationPrice.js → liquidation-price.js} +3 -3
  26. package/dist/cjs/common-utils/utils/creditAccount/{quotaUtils.js → quota-utils.js} +8 -8
  27. package/dist/cjs/common-utils/utils/creditAccount/sort.js +3 -3
  28. package/dist/cjs/common-utils/utils/index.js +6 -8
  29. package/dist/cjs/common-utils/utils/{priceMath.js → price-math.js} +3 -3
  30. package/dist/cjs/dev/AccountOpener.js +5 -45
  31. package/dist/cjs/plugins/zappers/ZappersPlugin.js +144 -0
  32. package/dist/cjs/{sdk/market/ZapperRegister.js → plugins/zappers/extraZappers.js} +6 -110
  33. package/dist/cjs/plugins/zappers/index.js +26 -0
  34. package/dist/cjs/plugins/zappers/package.json +1 -0
  35. package/dist/cjs/rewards/apy/index.js +24 -0
  36. package/dist/cjs/rewards/apy/output-details.js +16 -0
  37. package/dist/cjs/rewards/apy/output.js +16 -0
  38. package/dist/cjs/rewards/index.js +24 -0
  39. package/dist/cjs/rewards/package.json +1 -0
  40. package/dist/cjs/rewards/rewards/api.js +226 -0
  41. package/dist/cjs/rewards/rewards/apy.js +177 -0
  42. package/dist/cjs/rewards/rewards/common.js +16 -0
  43. package/dist/cjs/rewards/rewards/extra-apy.js +132 -0
  44. package/dist/cjs/rewards/rewards/index.js +28 -0
  45. package/dist/cjs/rewards/rewards/merkl-api.js +52 -0
  46. package/dist/cjs/sdk/accounts/AbstractCreditAccountsService.js +104 -462
  47. package/dist/cjs/sdk/accounts/CreditAccountsServiceV310.js +5 -16
  48. package/dist/cjs/sdk/base/ChainContractsRegister.js +1 -1
  49. package/dist/cjs/sdk/base/TokensMeta.js +32 -255
  50. package/dist/cjs/sdk/base/index.js +0 -2
  51. package/dist/cjs/sdk/chain/chains.js +1 -2
  52. package/dist/cjs/sdk/constants/index.js +2 -0
  53. package/dist/cjs/sdk/{base/token-types.js → constants/phantom-tokens.js} +3 -9
  54. package/dist/cjs/sdk/market/MarketRegister.js +2 -2
  55. package/dist/cjs/sdk/market/MarketSuite.js +0 -6
  56. package/dist/cjs/sdk/market/index.js +1 -3
  57. package/dist/cjs/sdk/market/pool/PoolSuite.js +0 -3
  58. package/dist/cjs/sdk/market/pool/PoolV310Contract.js +2 -17
  59. package/dist/cjs/sdk/market/pool/index.js +0 -4
  60. package/dist/cjs/sdk/pools/AbstractPoolService.js +137 -0
  61. package/dist/cjs/{abi/iStateSerializer.js → sdk/pools/PoolServiceV310.js} +8 -14
  62. package/dist/cjs/sdk/pools/createPoolService.js +35 -0
  63. package/dist/cjs/sdk/pools/index.js +4 -2
  64. package/dist/cjs/sdk/utils/AddressMap.js +1 -1
  65. package/dist/cjs/sdk/utils/viem/sendRawTx.js +0 -16
  66. package/dist/esm/common-utils/charts/credit-manager.js +115 -0
  67. package/dist/esm/common-utils/charts/credit-session.js +233 -0
  68. package/dist/esm/common-utils/charts/credit-sessions-payload.js +0 -0
  69. package/dist/esm/common-utils/charts/graph-payload.js +0 -0
  70. package/dist/esm/common-utils/charts/index.js +8 -0
  71. package/dist/esm/common-utils/charts/pool-payload.js +0 -0
  72. package/dist/esm/common-utils/charts/pool.js +179 -0
  73. package/dist/esm/common-utils/charts/token-data.js +67 -0
  74. package/dist/esm/common-utils/index.js +2 -0
  75. package/dist/esm/common-utils/static/index.js +4 -0
  76. package/dist/esm/common-utils/static/migration-config.js +0 -0
  77. package/dist/esm/common-utils/static/pool-config.js +0 -0
  78. package/dist/esm/common-utils/static/strategy.js +0 -0
  79. package/dist/esm/common-utils/static/trading-pair.js +0 -0
  80. package/dist/esm/common-utils/utils/{assetsMath.js → assets-math.js} +2 -2
  81. package/dist/esm/common-utils/utils/creditAccount/{calcHealthFactor.js → calc-health-factor.js} +2 -2
  82. package/dist/esm/common-utils/utils/creditAccount/{calcOverallAPY.js → calc-overall-apy.js} +1 -1
  83. package/dist/esm/common-utils/utils/creditAccount/debt.js +2 -2
  84. package/dist/esm/common-utils/utils/creditAccount/index.js +8 -8
  85. package/dist/esm/common-utils/utils/creditAccount/{quotaUtils.js → quota-utils.js} +1 -1
  86. package/dist/esm/common-utils/utils/creditAccount/sort.js +1 -1
  87. package/dist/esm/common-utils/utils/index.js +3 -4
  88. package/dist/esm/dev/AccountOpener.js +6 -47
  89. package/dist/esm/plugins/zappers/ZappersPlugin.js +126 -0
  90. package/dist/esm/{sdk/market/ZapperRegister.js → plugins/zappers/extraZappers.js} +2 -109
  91. package/dist/esm/plugins/zappers/index.js +3 -0
  92. package/dist/esm/plugins/zappers/package.json +1 -0
  93. package/dist/esm/plugins/zappers/types.js +0 -0
  94. package/dist/esm/rewards/apy/index.js +2 -0
  95. package/dist/esm/rewards/apy/output-details.js +0 -0
  96. package/dist/esm/rewards/apy/output.js +0 -0
  97. package/dist/esm/rewards/index.js +2 -0
  98. package/dist/esm/rewards/package.json +1 -0
  99. package/dist/esm/rewards/rewards/api.js +204 -0
  100. package/dist/esm/rewards/rewards/apy.js +160 -0
  101. package/dist/esm/rewards/rewards/common.js +0 -0
  102. package/dist/esm/rewards/rewards/extra-apy.js +101 -0
  103. package/dist/esm/rewards/rewards/index.js +4 -0
  104. package/dist/esm/rewards/rewards/merkl-api.js +18 -0
  105. package/dist/esm/sdk/accounts/AbstractCreditAccountsService.js +104 -462
  106. package/dist/esm/sdk/accounts/CreditAccountsServiceV310.js +5 -16
  107. package/dist/esm/sdk/base/ChainContractsRegister.js +1 -1
  108. package/dist/esm/sdk/base/TokensMeta.js +32 -261
  109. package/dist/esm/sdk/base/index.js +0 -1
  110. package/dist/esm/sdk/chain/chains.js +1 -2
  111. package/dist/esm/sdk/constants/index.js +1 -0
  112. package/dist/esm/sdk/{base/token-types.js → constants/phantom-tokens.js} +0 -4
  113. package/dist/esm/sdk/market/MarketRegister.js +2 -2
  114. package/dist/esm/sdk/market/MarketSuite.js +0 -6
  115. package/dist/esm/sdk/market/index.js +0 -1
  116. package/dist/esm/sdk/market/pool/PoolSuite.js +0 -3
  117. package/dist/esm/sdk/market/pool/PoolV310Contract.js +2 -17
  118. package/dist/esm/sdk/market/pool/index.js +0 -2
  119. package/dist/esm/sdk/pools/AbstractPoolService.js +113 -0
  120. package/dist/esm/sdk/pools/PoolServiceV310.js +6 -0
  121. package/dist/esm/sdk/pools/createPoolService.js +11 -0
  122. package/dist/esm/sdk/pools/index.js +2 -1
  123. package/dist/esm/sdk/utils/AddressMap.js +1 -1
  124. package/dist/esm/sdk/utils/viem/sendRawTx.js +1 -19
  125. package/dist/types/common-utils/charts/credit-manager-payload.d.ts +50 -0
  126. package/dist/types/common-utils/charts/credit-manager.d.ts +48 -0
  127. package/dist/types/common-utils/charts/credit-session.d.ts +111 -0
  128. package/dist/types/common-utils/charts/credit-sessions-payload.d.ts +111 -0
  129. package/dist/types/common-utils/charts/graph-payload.d.ts +10 -0
  130. package/dist/types/common-utils/charts/index.d.ts +8 -0
  131. package/dist/types/common-utils/charts/pool-payload.d.ts +111 -0
  132. package/dist/types/common-utils/charts/pool.d.ts +91 -0
  133. package/dist/types/common-utils/charts/token-data.d.ts +20 -0
  134. package/dist/types/common-utils/index.d.ts +2 -0
  135. package/dist/types/common-utils/static/index.d.ts +4 -0
  136. package/dist/types/common-utils/static/migration-config.d.ts +10 -0
  137. package/dist/types/common-utils/static/pool-config.d.ts +11 -0
  138. package/dist/types/common-utils/static/strategy.d.ts +78 -0
  139. package/dist/types/common-utils/static/trading-pair.d.ts +15 -0
  140. package/dist/types/common-utils/utils/creditAccount/index.d.ts +8 -8
  141. package/dist/types/common-utils/utils/index.d.ts +3 -4
  142. package/dist/types/plugins/zappers/ZappersPlugin.d.ts +18 -0
  143. package/dist/types/plugins/zappers/extraZappers.d.ts +6 -0
  144. package/dist/types/plugins/zappers/index.d.ts +3 -0
  145. package/dist/types/plugins/zappers/types.d.ts +12 -0
  146. package/dist/types/rewards/apy/index.d.ts +2 -0
  147. package/dist/types/rewards/apy/output-details.d.ts +96 -0
  148. package/dist/types/rewards/apy/output.d.ts +22 -0
  149. package/dist/types/rewards/index.d.ts +2 -0
  150. package/dist/types/rewards/rewards/api.d.ts +49 -0
  151. package/dist/types/rewards/rewards/apy.d.ts +41 -0
  152. package/dist/types/rewards/rewards/common.d.ts +16 -0
  153. package/dist/types/rewards/rewards/extra-apy.d.ts +30 -0
  154. package/dist/types/rewards/rewards/index.d.ts +4 -0
  155. package/dist/types/rewards/rewards/merkl-api.d.ts +45 -0
  156. package/dist/types/sdk/accounts/AbstractCreditAccountsService.d.ts +27 -123
  157. package/dist/types/sdk/accounts/CreditAccountsServiceV310.d.ts +1 -1
  158. package/dist/types/sdk/accounts/types.d.ts +8 -108
  159. package/dist/types/sdk/base/TokensMeta.d.ts +18 -34
  160. package/dist/types/sdk/base/index.d.ts +0 -1
  161. package/dist/types/sdk/base/types.d.ts +1 -0
  162. package/dist/types/sdk/chain/chains.d.ts +1 -1
  163. package/dist/types/sdk/constants/index.d.ts +1 -0
  164. package/dist/types/sdk/constants/phantom-tokens.d.ts +2 -0
  165. package/dist/types/sdk/market/MarketRegister.d.ts +2 -2
  166. package/dist/types/sdk/market/MarketSuite.d.ts +0 -3
  167. package/dist/types/sdk/market/index.d.ts +0 -1
  168. package/dist/types/sdk/market/pool/PoolSuite.d.ts +0 -2
  169. package/dist/types/sdk/market/pool/PoolV310Contract.d.ts +2 -6
  170. package/dist/types/sdk/market/pool/index.d.ts +0 -2
  171. package/dist/types/sdk/pools/AbstractPoolService.d.ts +9 -0
  172. package/dist/types/sdk/pools/PoolServiceV310.d.ts +4 -0
  173. package/dist/types/sdk/pools/createPoolService.d.ts +3 -0
  174. package/dist/types/sdk/pools/index.d.ts +2 -1
  175. package/dist/types/sdk/pools/types.d.ts +63 -84
  176. package/dist/types/sdk/utils/AddressMap.d.ts +1 -1
  177. package/dist/types/sdk/utils/viem/sendRawTx.d.ts +1 -5
  178. package/package.json +6 -1
  179. package/dist/cjs/abi/310/iSecuritizeDegenNFT.js +0 -263
  180. package/dist/cjs/abi/310/iSecuritizeKYCFactory.js +0 -278
  181. package/dist/cjs/common-utils/utils/endpoints.js +0 -65
  182. package/dist/cjs/sdk/market/pool/SecuritizeKYCFactory.js +0 -97
  183. package/dist/cjs/sdk/pools/PoolService.js +0 -391
  184. package/dist/esm/abi/310/iSecuritizeDegenNFT.js +0 -239
  185. package/dist/esm/abi/310/iSecuritizeKYCFactory.js +0 -254
  186. package/dist/esm/abi/iStateSerializer.js +0 -12
  187. package/dist/esm/common-utils/utils/endpoints.js +0 -41
  188. package/dist/esm/sdk/market/pool/SecuritizeKYCFactory.js +0 -73
  189. package/dist/esm/sdk/pools/PoolService.js +0 -371
  190. package/dist/types/abi/310/iSecuritizeDegenNFT.d.ts +0 -324
  191. package/dist/types/abi/310/iSecuritizeKYCFactory.d.ts +0 -322
  192. package/dist/types/abi/iStateSerializer.d.ts +0 -11
  193. package/dist/types/common-utils/utils/endpoints.d.ts +0 -27
  194. package/dist/types/sdk/base/token-types.d.ts +0 -33
  195. package/dist/types/sdk/market/ZapperRegister.d.ts +0 -17
  196. package/dist/types/sdk/market/pool/SecuritizeKYCFactory.d.ts +0 -345
  197. package/dist/types/sdk/market/types.d.ts +0 -10
  198. package/dist/types/sdk/pools/PoolService.d.ts +0 -14
  199. /package/dist/cjs/{sdk/market → plugins/zappers}/types.js +0 -0
  200. /package/dist/esm/{sdk/market/types.js → common-utils/charts/credit-manager-payload.js} +0 -0
  201. /package/dist/esm/common-utils/utils/{bigintMath.js → bigint-math.js} +0 -0
  202. /package/dist/esm/common-utils/utils/creditAccount/{calcQuotaBorrowRate.js → calc-quota-borrow-rate.js} +0 -0
  203. /package/dist/esm/common-utils/utils/creditAccount/{calcRelativeBaseBorrowRate.js → calc-relative-base-borrow-rate.js} +0 -0
  204. /package/dist/esm/common-utils/utils/creditAccount/{getTimeToLiquidation.js → get-time-to-liquidation.js} +0 -0
  205. /package/dist/esm/common-utils/utils/creditAccount/{liquidationPrice.js → liquidation-price.js} +0 -0
  206. /package/dist/esm/common-utils/utils/{priceMath.js → price-math.js} +0 -0
  207. /package/dist/types/common-utils/utils/{assetsMath.d.ts → assets-math.d.ts} +0 -0
  208. /package/dist/types/common-utils/utils/{bigintMath.d.ts → bigint-math.d.ts} +0 -0
  209. /package/dist/types/common-utils/utils/creditAccount/{calcHealthFactor.d.ts → calc-health-factor.d.ts} +0 -0
  210. /package/dist/types/common-utils/utils/creditAccount/{calcOverallAPY.d.ts → calc-overall-apy.d.ts} +0 -0
  211. /package/dist/types/common-utils/utils/creditAccount/{calcQuotaBorrowRate.d.ts → calc-quota-borrow-rate.d.ts} +0 -0
  212. /package/dist/types/common-utils/utils/creditAccount/{calcRelativeBaseBorrowRate.d.ts → calc-relative-base-borrow-rate.d.ts} +0 -0
  213. /package/dist/types/common-utils/utils/creditAccount/{getTimeToLiquidation.d.ts → get-time-to-liquidation.d.ts} +0 -0
  214. /package/dist/types/common-utils/utils/creditAccount/{liquidationPrice.d.ts → liquidation-price.d.ts} +0 -0
  215. /package/dist/types/common-utils/utils/creditAccount/{quotaUtils.d.ts → quota-utils.d.ts} +0 -0
  216. /package/dist/types/common-utils/utils/{priceMath.d.ts → price-math.d.ts} +0 -0
@@ -39,7 +39,6 @@ const COMPRESSORS = {
39
39
  [import_chains.chains.Mainnet.id]: "0x36F3d0Bb73CBC2E94fE24dF0f26a689409cF9023",
40
40
  [import_chains.chains.Monad.id]: "0x36F3d0Bb73CBC2E94fE24dF0f26a689409cF9023"
41
41
  };
42
- const INVESTORS = new import_utils.AddressMap([], "investors");
43
42
  function getWithdrawalCompressorAddress(chainId) {
44
43
  return COMPRESSORS[chainId];
45
44
  }
@@ -101,23 +100,6 @@ class AbstractCreditAccountService extends import_base.SDKConstruct {
101
100
  });
102
101
  return cad;
103
102
  }
104
- /**
105
- * Returns credit account data for a single account with the investor address resolved.
106
- * Loads CA via getCreditAccountData; for KYC underlyings fetches the investor from the KYC factory's getInvestor(creditAccount), otherwise uses the account owner.
107
- * @param account - Credit account address
108
- * @param blockNumber - Optional block number for the read
109
- * @returns CreditAccountDataWithInvestor (CA data + investor address), or undefined if the account is not found
110
- */
111
- async getCreditAccountDataWithInvestor(account, blockNumber) {
112
- const ca = await this.getCreditAccountData(account, blockNumber);
113
- if (!ca) return ca;
114
- const marketSuite = this.sdk.marketRegister.findByCreditManager(
115
- ca.creditManager
116
- );
117
- const factory = await marketSuite.getKYCFactory();
118
- const investor = factory ? await factory.getInvestor(ca.creditAccount, true) : void 0;
119
- return { ...ca, investor: investor ?? ca.owner };
120
- }
121
103
  /**
122
104
  * Methods to get all credit accounts with some optional filtering
123
105
  * Performs all necessary price feed updates under the hood
@@ -126,7 +108,7 @@ class AbstractCreditAccountService extends import_base.SDKConstruct {
126
108
  * @param blockNumber
127
109
  * @returns returned credit accounts are sorted by health factor in ascending order
128
110
  */
129
- async getCreditAccounts(options, blockNumber, priceUpdate) {
111
+ async getCreditAccounts(options, blockNumber) {
130
112
  const {
131
113
  creditManager,
132
114
  includeZeroDebt = false,
@@ -148,7 +130,7 @@ class AbstractCreditAccountService extends import_base.SDKConstruct {
148
130
  maxHealthFactor,
149
131
  reverting: false
150
132
  };
151
- const { txs: priceUpdateTxs } = priceUpdate ?? await this.sdk.priceFeeds.generatePriceFeedsUpdateTxs(
133
+ const { txs: priceUpdateTxs } = await this.sdk.priceFeeds.generatePriceFeedsUpdateTxs(
152
134
  ignoreReservePrices ? { main: true } : void 0
153
135
  );
154
136
  const allCAs = [];
@@ -177,75 +159,6 @@ class AbstractCreditAccountService extends import_base.SDKConstruct {
177
159
  );
178
160
  return allCAs.sort((a, b) => Number(a.healthFactor - b.healthFactor));
179
161
  }
180
- /**
181
- * Returns all credit accounts matching the filter, with investor set on each item.
182
- * Delegates to getCreditAccounts; when options.owner is set, also loads KYC credit accounts for that owner and merges them into the list. Result is sorted by health factor ascending.
183
- * @param options - Filter options (owner, creditManager, health factor, etc.)
184
- * @param blockNumber - Optional block number for the read
185
- * @returns Array of credit accounts (with investor field), sorted by health factor ascending
186
- */
187
- async getCreditAccountsWithInvestor(options, blockNumber) {
188
- const { owner, ignoreReservePrices = false } = options ?? {};
189
- const priceUpdate = await this.sdk.priceFeeds.generatePriceFeedsUpdateTxs(
190
- ignoreReservePrices ? { main: true } : void 0
191
- );
192
- const { txs: priceUpdateTxs } = priceUpdate;
193
- const [common, kyc] = await Promise.all([
194
- this.getCreditAccounts(options, blockNumber),
195
- owner ? this.getKYCCreditAccountsOfOwner(owner, priceUpdateTxs, blockNumber) : void 0
196
- ]);
197
- const allCAs = common.map(
198
- (ca) => ({
199
- ...ca,
200
- investor: owner || ca.owner
201
- })
202
- );
203
- allCAs.push(...kyc || []);
204
- return allCAs.sort((a, b) => Number(a.healthFactor - b.healthFactor));
205
- }
206
- async getKYCCreditAccountsOfOwner(owner, priceUpdateTxs, blockNumber) {
207
- const suites = this.marketConfigurators.map((mc) => {
208
- const suite = this.sdk.marketRegister.markets.find(
209
- (m) => m.configurator.address === mc
210
- );
211
- return suite;
212
- });
213
- const kycCAAddresses = await this.getKYCCaOfInvestor(owner, suites);
214
- const kycCAs = await this.loadSpecifiedAccounts(
215
- kycCAAddresses,
216
- priceUpdateTxs,
217
- blockNumber
218
- );
219
- return kycCAs.map((ca) => ({
220
- ...ca,
221
- investor: owner
222
- }));
223
- }
224
- /**
225
- * Loads credit account data for the given addresses using simulateWithPriceUpdates.
226
- * Applies the provided price update txs before reading, so returned data is consistent with up-to-date prices.
227
- * @param accounts - Credit account addresses to load
228
- * @param priceUpdateTxs - Price feed update txs to simulate before the read (e.g. from generatePriceFeedsUpdateTxs)
229
- * @param blockNumber - Optional block number for the read
230
- * @returns Array of CreditAccountData in the same order as accounts (throws if any getCreditAccountData call reverts)
231
- */
232
- async loadSpecifiedAccounts(accounts, priceUpdateTxs, blockNumber) {
233
- if (accounts.length === 0) return [];
234
- const list = await (0, import_viem2.simulateWithPriceUpdates)(this.client, {
235
- priceUpdates: priceUpdateTxs,
236
- contracts: accounts.map(
237
- (account) => ({
238
- abi: import_creditAccountCompressor.creditAccountCompressorAbi,
239
- address: this.#compressor,
240
- functionName: "getCreditAccountData",
241
- args: [account]
242
- })
243
- ),
244
- blockNumber,
245
- gas: this.sdk.gasLimit
246
- });
247
- return list;
248
- }
249
162
  /**
250
163
  * Method to get all claimable rewards for credit account (ex. stkUSDS SKY rewards)
251
164
  Assosiates rewards by adapter + stakedPhantomToken
@@ -476,13 +389,6 @@ class AbstractCreditAccountService extends import_base.SDKConstruct {
476
389
  closePath
477
390
  }) {
478
391
  const cm = this.sdk.marketRegister.findCreditManager(ca.creditManager);
479
- await this.sdk.tokensMeta.loadTokenData(cm.underlying);
480
- const underlying = this.sdk.tokensMeta.mustGet(cm.underlying);
481
- if (this.sdk.tokensMeta.isKYCUnderlying(underlying)) {
482
- throw new Error(
483
- "closeCreditAccount is not supported for KYC underlying credit accounts"
484
- );
485
- }
486
392
  const routerCloseResult = closePath || await this.sdk.routerFor(ca).findBestClosePath({
487
393
  creditAccount: ca,
488
394
  creditManager: cm.creditManager,
@@ -501,12 +407,7 @@ class AbstractCreditAccountService extends import_base.SDKConstruct {
501
407
  (t) => this.prepareWithdrawToken(ca.creditFacade, t, import_constants.MAX_UINT256, to)
502
408
  )
503
409
  ];
504
- const tx = await this.closeCreditAccountTx(
505
- cm,
506
- ca.creditAccount,
507
- calls,
508
- operation
509
- );
410
+ const tx = operation === "close" ? cm.creditFacade.closeCreditAccount(ca.creditAccount, calls) : cm.creditFacade.multicall(ca.creditAccount, calls);
510
411
  return { tx, calls, routerCloseResult, creditFacade: cm.creditFacade };
511
412
  }
512
413
  /**
@@ -536,7 +437,7 @@ class AbstractCreditAccountService extends import_base.SDKConstruct {
536
437
  averageQuota
537
438
  })
538
439
  ];
539
- const tx = await this.multicallTx(cm, creditAccount.creditAccount, calls);
440
+ const tx = cm.creditFacade.multicall(creditAccount.creditAccount, calls);
540
441
  return { tx, calls, creditFacade: cm.creditFacade };
541
442
  }
542
443
  /**
@@ -578,7 +479,7 @@ class AbstractCreditAccountService extends import_base.SDKConstruct {
578
479
  averageQuota
579
480
  })
580
481
  ];
581
- const tx = await this.multicallTx(cm, creditAccount.creditAccount, calls);
482
+ const tx = cm.creditFacade.multicall(creditAccount.creditAccount, calls);
582
483
  tx.value = ethAmount.toString(10);
583
484
  return { tx, calls, creditFacade: cm.creditFacade };
584
485
  }
@@ -595,7 +496,7 @@ class AbstractCreditAccountService extends import_base.SDKConstruct {
595
496
  async changeDebt({
596
497
  creditAccount,
597
498
  amount,
598
- collateral
499
+ addCollateral
599
500
  }) {
600
501
  if (amount === 0n) {
601
502
  throw new Error("debt increase or decrease must be non-zero");
@@ -609,32 +510,22 @@ class AbstractCreditAccountService extends import_base.SDKConstruct {
609
510
  creditManager: creditAccount.creditManager,
610
511
  creditAccount
611
512
  });
612
- const addCollateralCalls = collateral && isDecrease ? this.prepareAddCollateral(
513
+ const addCollateralCalls = addCollateral && isDecrease ? this.prepareAddCollateral(
613
514
  creditAccount.creditFacade,
614
515
  [
615
516
  {
616
- token: collateral[0].token,
617
- balance: collateral[0].balance
517
+ token: creditAccount.underlying,
518
+ balance: change
618
519
  }
619
520
  ],
620
521
  {}
621
522
  ) : [];
622
- const unwrapCalls = collateral && isDecrease ? await this.getKYCUnwrapCalls(
623
- collateral[0].balance,
624
- creditAccount.creditManager
625
- ) || [] : [];
626
- if (addCollateralCalls.length > 0 && unwrapCalls.length === 0 && collateral && collateral?.[0].token !== creditAccount.underlying) {
627
- throw new Error(
628
- "Can't use collateral other than underlying for non KYC market"
629
- );
630
- }
631
523
  const calls = [
632
524
  ...priceUpdatesCalls,
633
525
  ...addCollateralCalls,
634
- ...unwrapCalls,
635
526
  this.#prepareChangeDebt(creditAccount.creditFacade, change, isDecrease)
636
527
  ];
637
- const tx = await this.multicallTx(cm, creditAccount.creditAccount, calls);
528
+ const tx = cm.creditFacade.multicall(creditAccount.creditAccount, calls);
638
529
  return { tx, calls, creditFacade: cm.creditFacade };
639
530
  }
640
531
  /**
@@ -669,7 +560,7 @@ class AbstractCreditAccountService extends import_base.SDKConstruct {
669
560
  averageQuota
670
561
  })
671
562
  ];
672
- const tx = await this.multicallTx(cm, creditAccount.creditAccount, calls);
563
+ const tx = cm.creditFacade.multicall(creditAccount.creditAccount, calls);
673
564
  return { tx, calls, creditFacade: cm.creditFacade };
674
565
  }
675
566
  /**
@@ -785,7 +676,7 @@ class AbstractCreditAccountService extends import_base.SDKConstruct {
785
676
  averageQuota
786
677
  })
787
678
  ];
788
- const tx = await this.multicallTx(cm, creditAccount.creditAccount, calls);
679
+ const tx = cm.creditFacade.multicall(creditAccount.creditAccount, calls);
789
680
  return { tx, calls, creditFacade: cm.creditFacade };
790
681
  }
791
682
  /**
@@ -850,63 +741,48 @@ class AbstractCreditAccountService extends import_base.SDKConstruct {
850
741
  compareBalances,
851
742
  ...quotaCalls
852
743
  ];
853
- const tx = await this.multicallTx(cm, creditAccount.creditAccount, calls);
744
+ const tx = cm.creditFacade.multicall(creditAccount.creditAccount, calls);
854
745
  return { tx, calls, creditFacade: cm.creditFacade };
855
746
  }
856
- /**
857
- * Returns address to which approval should be given on collateral token
858
- * It's credit manager for classical markets and special wallet for KYC markets
859
- * @param options - {@link GetApprovalAddressProps}
860
- * @returns
861
- **/
862
- async getApprovalAddress(options) {
863
- const { creditManager } = options;
864
- const suite = this.sdk.marketRegister.findCreditManager(creditManager);
865
- const marketSuite = this.sdk.marketRegister.findByPool(suite.pool);
866
- const factory = await marketSuite.getKYCFactory();
867
- if (factory) {
868
- if ("creditAccount" in options) {
869
- return factory.getWallet(options.creditAccount);
870
- }
871
- return factory.precomputeWalletAddress(creditManager, options.borrower);
872
- }
873
- return suite.creditManager.address;
874
- }
875
747
  /**
876
748
  * Executes swap specified by given calls, update quotas of affected tokens
877
- * - Open credit account is executed in the following order: price update -> increase debt -> add collateral ->
878
- * -> update quotas -> (optionally: execute swap path for trading/strategy) ->
879
- * -> (optionally: withdraw debt for lending)
880
- *- Basic open credit account: price update -> increase debt -> add collateral -> update quotas
881
- *- Lending: price update -> increase debt -> add collateral -> update quotas -> withdraw debt
882
- *- Strategy/trading: price update -> increase debt -> add collateral -> update quotas -> execute swap path
883
- *- In strategy is possible situation when collateral is added, but not swapped; the only swapped value in this case will be debt
749
+ - Open credit account is executed in the following order: price update -> increase debt -> add collateral ->
750
+ -> update quotas -> (optionally: execute swap path for trading/strategy) ->
751
+ -> (optionally: withdraw debt for lending)
752
+ - Basic open credit account: price update -> increase debt -> add collateral -> update quotas
753
+ - Lending: price update -> increase debt -> add collateral -> update quotas -> withdraw debt
754
+ - Strategy/trading: price update -> increase debt -> add collateral -> update quotas -> execute swap path
755
+ - In strategy is possible situation when collateral is added, but not swapped; the only swapped value in this case will be debt
756
+ * @param {bigint} ethAmount - native token amount to attach to tx
757
+ * @param {Address} creditManager - address of credit manager to open credit account on
758
+ * @param {Array<Asset>} collateral - array of collateral which can be just directly added or swapped using the path {@link Asset}
759
+ * @param {Record<Address, PermitResult>} permits - permits of collateral tokens (in any permittable token is present) {@link PermitResult}
760
+ * @param {bigint} debt - debt to open credit account with
761
+ * @param {boolean} withdrawDebt - flag to withdraw debt to wallet after opening credit account;
762
+ used for borrowing functionality
763
+ * @param {bigint} referralCode - referral code to open credit account with
764
+ * @param {Address} to - wallet address to transfer credit account to\
765
+ * @param {Array<MultiCall>} calls - array of MultiCall from router methods findOpenStrategyPath {@link MultiCall}.
766
+ Used for trading and strategy functionality
767
+ * @param {Array<Asset>} averageQuota - average quota for tokens after open {@link Asset}
768
+ * @param {Array<Asset>} minQuota - minimum quota for tokens after open {@link Asset}
884
769
  * @returns All necessary data to execute the transaction (call, credit facade)
885
- **/
886
- async openCA(props) {
887
- const {
888
- ethAmount,
889
- creditManager,
890
- reopenCreditAccount,
891
- collateral,
892
- permits,
893
- debt,
894
- withdrawToken,
895
- referralCode,
896
- to,
897
- calls: openPathCalls,
898
- callsAfter,
899
- minQuota,
900
- averageQuota
901
- } = props;
770
+ */
771
+ async openCA({
772
+ ethAmount,
773
+ creditManager,
774
+ collateral,
775
+ permits,
776
+ debt,
777
+ withdrawDebt,
778
+ referralCode,
779
+ to,
780
+ calls: openPathCalls,
781
+ minQuota,
782
+ averageQuota
783
+ }) {
902
784
  const cmSuite = this.sdk.marketRegister.findCreditManager(creditManager);
903
785
  const cm = cmSuite.creditManager;
904
- let tokenToWithdraw;
905
- if (withdrawToken === true) {
906
- tokenToWithdraw = cm.underlying;
907
- } else if (typeof withdrawToken === "string") {
908
- tokenToWithdraw = withdrawToken;
909
- }
910
786
  const priceUpdatesCalls = await this.getPriceUpdatesForFacade({
911
787
  creditManager: cm.address,
912
788
  desiredQuotas: averageQuota
@@ -916,27 +792,13 @@ class AbstractCreditAccountService extends import_base.SDKConstruct {
916
792
  this.#prepareIncreaseDebt(cm.creditFacade, debt),
917
793
  ...this.prepareAddCollateral(cm.creditFacade, collateral, permits),
918
794
  ...openPathCalls,
919
- // путь из underlying в withdrawal token
920
- ...tokenToWithdraw ? [
921
- this.prepareWithdrawToken(
922
- cm.creditFacade,
923
- tokenToWithdraw,
924
- import_constants.MAX_UINT256,
925
- to
926
- )
927
- ] : [],
795
+ ...withdrawDebt ? [this.prepareWithdrawToken(cm.creditFacade, cm.underlying, debt, to)] : [],
928
796
  ...this.prepareUpdateQuotas(cm.creditFacade, {
929
797
  minQuota,
930
798
  averageQuota
931
- }),
932
- ...callsAfter ?? []
799
+ })
933
800
  ];
934
- let tx;
935
- if (reopenCreditAccount) {
936
- tx = await this.multicallTx(cmSuite, reopenCreditAccount, calls);
937
- } else {
938
- tx = await this.openCreditAccountTx(cmSuite, to, calls, referralCode);
939
- }
801
+ const tx = cmSuite.creditFacade.openCreditAccount(to, calls, referralCode);
940
802
  tx.value = ethAmount.toString(10);
941
803
  return { calls, tx, creditFacade: cmSuite.creditFacade };
942
804
  }
@@ -1020,130 +882,6 @@ class AbstractCreditAccountService extends import_base.SDKConstruct {
1020
882
  );
1021
883
  return resp;
1022
884
  }
1023
- /**
1024
- * Returns multicall entries to redeem (unwrap) KYC ERC-4626 vault shares into underlying for the given credit manager.
1025
- * Used when withdrawing debt from a KYC market: redeems adapter vault shares so the underlying can be withdrawn.
1026
- * Only applies when the credit manager's underlying is KYC-gated and has an ERC-4626 adapter configured.
1027
- * @param amount - Number of vault shares (adapter tokens) to redeem
1028
- * @param creditManager - Credit manager address
1029
- * @returns Array of MultiCall to pass to credit facade multicall, or undefined if underlying is not KYC or no adapter is configured
1030
- */
1031
- async getKYCUnwrapCalls(amount, creditManager) {
1032
- const suite = this.sdk.marketRegister.findCreditManager(creditManager);
1033
- const meta = this.sdk.tokensMeta.mustGet(suite.underlying);
1034
- if (!this.sdk.tokensMeta.isKYCUnderlying(meta)) {
1035
- return void 0;
1036
- }
1037
- const adapter = suite.creditManager.adapters.get(meta.addr);
1038
- const adapterAddress = adapter?.address;
1039
- if (!adapterAddress) {
1040
- return void 0;
1041
- }
1042
- const mc = [
1043
- {
1044
- target: adapterAddress,
1045
- callData: (0, import_viem.encodeFunctionData)({
1046
- abi: ierc4626AdapterAbi,
1047
- functionName: "redeem",
1048
- args: [amount, import_constants.ADDRESS_0X0, import_constants.ADDRESS_0X0]
1049
- })
1050
- }
1051
- ];
1052
- return mc;
1053
- }
1054
- /**
1055
- * Returns multicall entries to deposit (wrap) underlying into KYC ERC-4626 vault shares for the given credit manager.
1056
- * Used when adding debt on a KYC market: deposits underlying into the adapter vault so shares are minted on the account.
1057
- * Only applies when the credit manager's underlying is KYC-gated and has an ERC-4626 adapter configured.
1058
- * @param amount - Amount of underlying assets to deposit into the vault (in underlying decimals)
1059
- * @param creditManager - Credit manager address
1060
- * @returns Array of MultiCall to pass to credit facade multicall, or undefined if underlying is not KYC or no adapter is configured
1061
- */
1062
- async getKYCWrapCalls(amount, creditManager) {
1063
- const suite = this.sdk.marketRegister.findCreditManager(creditManager);
1064
- const meta = this.sdk.tokensMeta.mustGet(suite.underlying);
1065
- if (!this.sdk.tokensMeta.isKYCUnderlying(meta)) {
1066
- return void 0;
1067
- }
1068
- const adapter = suite.creditManager.adapters.get(meta.addr);
1069
- const adapterAddress = adapter?.address;
1070
- if (!adapterAddress) {
1071
- return void 0;
1072
- }
1073
- const mc = [
1074
- {
1075
- target: adapterAddress,
1076
- callData: (0, import_viem.encodeFunctionData)({
1077
- abi: ierc4626AdapterAbi,
1078
- functionName: "deposit",
1079
- args: [amount, import_constants.ADDRESS_0X0]
1080
- })
1081
- }
1082
- ];
1083
- return mc;
1084
- }
1085
- /**
1086
- * Returns multicall entries to call redeemDiff on the KYC ERC-4626 adapter for the given credit manager.
1087
- * Redeems the leftover vault shares (e.g. after repaying debt) so the account does not hold excess KYC vault tokens.
1088
- * Only applies when the credit manager's underlying is KYC-gated and has an ERC-4626 adapter configured.
1089
- * @param amount - Leftover vault share amount to redeem (in adapter/vault decimals)
1090
- * @param creditManager - Credit manager address
1091
- * @returns Array of MultiCall to pass to credit facade multicall, or undefined if underlying is not KYC or no adapter is configured
1092
- */
1093
- async getRedeemDiffCalls(amount, creditManager) {
1094
- const suite = this.sdk.marketRegister.findCreditManager(creditManager);
1095
- const meta = this.sdk.tokensMeta.mustGet(suite.underlying);
1096
- if (!this.sdk.tokensMeta.isKYCUnderlying(meta)) {
1097
- return void 0;
1098
- }
1099
- const adapter = suite.creditManager.adapters.get(meta.addr);
1100
- const adapterAddress = adapter?.address;
1101
- if (!adapterAddress) {
1102
- return void 0;
1103
- }
1104
- const mc = [
1105
- {
1106
- target: adapterAddress,
1107
- callData: (0, import_viem.encodeFunctionData)({
1108
- abi: ierc4626AdapterAbi,
1109
- functionName: "redeemDiff",
1110
- args: [amount]
1111
- })
1112
- }
1113
- ];
1114
- return mc;
1115
- }
1116
- /**
1117
- * Returns multicall entries to call depositDiff on the KYC ERC-4626 adapter for the given credit manager.
1118
- * Deposits the leftover underlying (e.g. after decreasing debt) into the vault so the account does not hold excess underlying.
1119
- * Only applies when the credit manager's underlying is KYC-gated and has an ERC-4626 adapter configured.
1120
- * @param amount - Leftover underlying amount to deposit into the vault (in underlying decimals)
1121
- * @param creditManager - Credit manager address
1122
- * @returns Array of MultiCall to pass to credit facade multicall, or undefined if underlying is not KYC or no adapter is configured
1123
- */
1124
- async getDepositDiffCalls(amount, creditManager) {
1125
- const suite = this.sdk.marketRegister.findCreditManager(creditManager);
1126
- const meta = this.sdk.tokensMeta.mustGet(suite.underlying);
1127
- if (!this.sdk.tokensMeta.isKYCUnderlying(meta)) {
1128
- return void 0;
1129
- }
1130
- const adapter = suite.creditManager.adapters.get(meta.addr);
1131
- const adapterAddress = adapter?.address;
1132
- if (!adapterAddress) {
1133
- return void 0;
1134
- }
1135
- const mc = [
1136
- {
1137
- target: adapterAddress,
1138
- callData: (0, import_viem.encodeFunctionData)({
1139
- abi: ierc4626AdapterAbi,
1140
- functionName: "depositDiff",
1141
- args: [amount]
1142
- })
1143
- }
1144
- ];
1145
- return mc;
1146
- }
1147
885
  /**
1148
886
  * Returns raw txs that are needed to update all price feeds so that all credit accounts (possibly from different markets) compute
1149
887
  *
@@ -1371,174 +1109,78 @@ class AbstractCreditAccountService extends import_base.SDKConstruct {
1371
1109
  import_constants.VERSION_RANGE_310
1372
1110
  )[0];
1373
1111
  }
1374
- /**
1375
- * Wrapper that selects between credit facade and KYC factory
1376
- * @param suite
1377
- * @param to
1378
- * @param calls
1379
- * @param referralCode
1380
- * @returns
1381
- */
1382
- async openCreditAccountTx(suite, to, calls, referralCode) {
1383
- const marketSuite = this.sdk.marketRegister.findByPool(suite.pool);
1384
- const factory = await marketSuite.getKYCFactory();
1385
- if (factory) {
1386
- const tokensToRegister = await factory.getDSTokens();
1387
- return factory.openCreditAccount(
1388
- suite.creditManager.address,
1389
- calls,
1390
- tokensToRegister
1391
- );
1392
- }
1393
- return suite.creditFacade.openCreditAccount(to, calls, referralCode ?? 0n);
1394
- }
1395
- /**
1396
- * Wrapper that selects between credit facade and KYC factory
1397
- * @param suite
1398
- * @param creditAccount
1399
- * @param calls
1400
- * @returns
1401
- */
1402
- async multicallTx(suite, creditAccount, calls) {
1403
- const marketSuite = this.sdk.marketRegister.findByCreditManager(
1404
- suite.creditManager.address
1405
- );
1406
- const factory = await marketSuite.getKYCFactory();
1407
- if (factory) {
1408
- const tokensToRegister = [];
1409
- return factory.multicall(creditAccount, calls, tokensToRegister);
1410
- }
1411
- return suite.creditFacade.multicall(creditAccount, calls);
1412
- }
1413
- /**
1414
- * Wrapper that selects between credit facade and KYC factory
1415
- * @param suite
1416
- * @param creditAccount
1417
- * @param calls
1418
- * @param operation
1419
- * @returns
1420
- */
1421
- async closeCreditAccountTx(suite, creditAccount, calls, operation) {
1422
- const marketSuite = this.sdk.marketRegister.findByCreditManager(
1423
- suite.creditManager.address
1424
- );
1425
- const factory = await marketSuite.getKYCFactory();
1426
- if (operation === "close") {
1427
- if (factory) {
1428
- throw new Error(
1429
- "CloseOptions=close is not supported for KYC underlying credit accounts"
1430
- );
1431
- }
1432
- return suite.creditFacade.closeCreditAccount(creditAccount, calls);
1433
- }
1434
- if (factory) {
1435
- const tokensToRegister = [];
1436
- return factory.multicall(creditAccount, calls, tokensToRegister);
1437
- }
1438
- return suite.creditFacade.multicall(creditAccount, calls);
1439
- }
1440
- /**
1441
- * Returns all KYC credit account addresses for an investor across the given market suites.
1442
- * Resolves KYC factory per suite, then multicalls each factory's getCreditAccounts(investor).
1443
- * @param investor - Owner address to query
1444
- * @param suites - Market suites (KYC factories are resolved for each; undefined entries are skipped)
1445
- * @returns Flat array of credit account addresses from all KYC markets
1446
- */
1447
- async getKYCCaOfInvestor(investor, suites) {
1448
- if (suites.length === 0 || investor === import_constants.ADDRESS_0X0) return [];
1449
- const factories = await Promise.all(
1450
- suites.map((suite) => suite ? suite.getKYCFactory() : void 0)
1451
- );
1452
- const safeFactories = factories.reduce(
1453
- (acc, v) => {
1454
- if (v) {
1455
- acc.push(v);
1456
- }
1457
- return acc;
1458
- },
1459
- []
1460
- );
1461
- const allResp = await this.client.multicall({
1462
- contracts: [
1463
- ...safeFactories.map((factory) => {
1464
- return {
1465
- abi: factory.abi,
1466
- address: factory.address,
1467
- functionName: "getCreditAccounts",
1468
- args: [investor]
1469
- };
1470
- })
1471
- ],
1472
- allowFailure: true,
1473
- batchSize: 0
1474
- });
1475
- const caLists = safeFactories.reduce((acc, _, index) => {
1476
- const response = allResp[index];
1477
- acc.push(...response.result || []);
1478
- return acc;
1479
- }, []);
1480
- return caLists;
1481
- }
1482
1112
  }
1483
- const ierc4626AdapterAbi = [
1113
+ const iMellowClaimerAdapterAbi = [
1484
1114
  {
1485
- inputs: [
1486
- { name: "assets", type: "uint256", internalType: "uint256" },
1487
- { name: "receiver", type: "address", internalType: "address" }
1488
- ],
1489
- name: "deposit",
1490
- outputs: [{ name: "useSafePrices", type: "bool", internalType: "bool" }],
1491
- stateMutability: "nonpayable",
1492
- type: "function"
1493
- },
1494
- {
1495
- inputs: [
1496
- { name: "shares", type: "uint256", internalType: "uint256" },
1497
- { name: "receiver", type: "address", internalType: "address" },
1498
- { name: "owner", type: "address", internalType: "address" }
1115
+ type: "function",
1116
+ name: "getMultiVaultSubvaultIndices",
1117
+ inputs: [{ name: "multiVault", type: "address", internalType: "address" }],
1118
+ outputs: [
1119
+ {
1120
+ name: "subvaultIndices",
1121
+ type: "uint256[]",
1122
+ internalType: "uint256[]"
1123
+ },
1124
+ {
1125
+ name: "withdrawalIndices",
1126
+ type: "uint256[][]",
1127
+ internalType: "uint256[][]"
1128
+ }
1499
1129
  ],
1500
- name: "redeem",
1501
- outputs: [{ name: "useSafePrices", type: "bool", internalType: "bool" }],
1502
- stateMutability: "nonpayable",
1503
- type: "function"
1130
+ stateMutability: "view"
1504
1131
  },
1505
1132
  {
1133
+ type: "function",
1134
+ name: "getUserSubvaultIndices",
1506
1135
  inputs: [
1507
- {
1508
- name: "leftoverAmount",
1509
- type: "uint256",
1510
- internalType: "uint256"
1511
- }
1136
+ { name: "multiVault", type: "address", internalType: "address" },
1137
+ { name: "user", type: "address", internalType: "address" }
1512
1138
  ],
1513
- name: "redeemDiff",
1514
1139
  outputs: [
1515
1140
  {
1516
- name: "useSafePrices",
1517
- type: "bool",
1518
- internalType: "bool"
1141
+ name: "subvaultIndices",
1142
+ type: "uint256[]",
1143
+ internalType: "uint256[]"
1144
+ },
1145
+ {
1146
+ name: "withdrawalIndices",
1147
+ type: "uint256[][]",
1148
+ internalType: "uint256[][]"
1519
1149
  }
1520
1150
  ],
1521
- stateMutability: "nonpayable",
1522
- type: "function"
1151
+ stateMutability: "view"
1523
1152
  },
1524
1153
  {
1154
+ type: "function",
1155
+ name: "multiAccept",
1525
1156
  inputs: [
1157
+ { name: "multiVault", type: "address", internalType: "address" },
1526
1158
  {
1527
- name: "leftoverAmount",
1528
- type: "uint256",
1529
- internalType: "uint256"
1530
- }
1159
+ name: "subvaultIndices",
1160
+ type: "uint256[]",
1161
+ internalType: "uint256[]"
1162
+ },
1163
+ { name: "indices", type: "uint256[][]", internalType: "uint256[][]" }
1531
1164
  ],
1532
- name: "depositDiff",
1533
- outputs: [
1165
+ outputs: [{ name: "", type: "bool", internalType: "bool" }],
1166
+ stateMutability: "nonpayable"
1167
+ },
1168
+ {
1169
+ type: "function",
1170
+ name: "multiAcceptAndClaim",
1171
+ inputs: [
1172
+ { name: "multiVault", type: "address", internalType: "address" },
1534
1173
  {
1535
- name: "useSafePrices",
1536
- type: "bool",
1537
- internalType: "bool"
1538
- }
1174
+ name: "subvaultIndices",
1175
+ type: "uint256[]",
1176
+ internalType: "uint256[]"
1177
+ },
1178
+ { name: "indices", type: "uint256[][]", internalType: "uint256[][]" },
1179
+ { name: "", type: "address", internalType: "address" },
1180
+ { name: "maxAssets", type: "uint256", internalType: "uint256" }
1539
1181
  ],
1540
- stateMutability: "nonpayable",
1541
- type: "function"
1182
+ outputs: [{ name: "", type: "bool", internalType: "bool" }],
1183
+ stateMutability: "nonpayable"
1542
1184
  }
1543
1185
  ];
1544
1186
  // Annotate the CommonJS export names for ESM import in node: