@gearbox-protocol/sdk 14.0.0 → 14.1.0

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/dist/cjs/abi/kyc/iDSRegistryService.js +149 -0
  2. package/dist/cjs/abi/kyc/iDSToken.js +71 -0
  3. package/dist/cjs/abi/kyc/iKYCCompressor.js +196 -0
  4. package/dist/cjs/abi/kyc/iKYCFactory.js +122 -0
  5. package/dist/cjs/abi/kyc/iKYCUnderlying.js +401 -0
  6. package/dist/cjs/abi/kyc/iSecuritizeDegenNFT.js +326 -0
  7. package/dist/cjs/abi/kyc/iSecuritizeKYCFactory.js +319 -0
  8. package/dist/cjs/dev/AccountOpener.js +45 -5
  9. package/dist/cjs/sdk/OnchainSDK.js +55 -5
  10. package/dist/cjs/sdk/accounts/AbstractCreditAccountsService.js +335 -21
  11. package/dist/cjs/sdk/accounts/CreditAccountsServiceV310.js +7 -1
  12. package/dist/cjs/sdk/base/TokensMeta.js +22 -42
  13. package/dist/cjs/sdk/base/token-types.js +9 -0
  14. package/dist/cjs/sdk/chain/chains.js +18 -1
  15. package/dist/cjs/sdk/constants/address-provider.js +3 -0
  16. package/dist/cjs/sdk/market/MarketRegister.js +70 -116
  17. package/dist/cjs/sdk/market/MarketSuite.js +3 -0
  18. package/dist/cjs/sdk/market/index.js +2 -0
  19. package/dist/cjs/sdk/market/kyc/KYCRegistry.js +269 -0
  20. package/dist/cjs/sdk/market/kyc/index.js +26 -0
  21. package/dist/cjs/sdk/market/kyc/securitize/SecuritizeKYCFactory.js +242 -0
  22. package/dist/cjs/sdk/market/kyc/securitize/constants.js +28 -0
  23. package/dist/cjs/sdk/market/kyc/securitize/index.js +26 -0
  24. package/dist/cjs/sdk/market/kyc/securitize/types.js +16 -0
  25. package/dist/cjs/sdk/{accounts/utils.js → market/kyc/types.js} +11 -15
  26. package/dist/cjs/sdk/market/pool/PoolSuite.js +3 -0
  27. package/dist/cjs/sdk/market/pool/PoolV310Contract.js +11 -2
  28. package/dist/cjs/sdk/market/pool/index.js +2 -0
  29. package/dist/cjs/sdk/market/pricefeeds/PriceFeedsRegister.js +3 -3
  30. package/dist/cjs/sdk/options.js +6 -0
  31. package/dist/cjs/sdk/pools/PoolService.js +104 -12
  32. package/dist/cjs/sdk/utils/viem/executeDelegatedMulticalls.js +38 -0
  33. package/dist/cjs/sdk/utils/viem/index.js +2 -0
  34. package/dist/esm/abi/kyc/iDSRegistryService.js +125 -0
  35. package/dist/esm/abi/kyc/iDSToken.js +47 -0
  36. package/dist/esm/abi/kyc/iKYCCompressor.js +172 -0
  37. package/dist/esm/abi/kyc/iKYCFactory.js +98 -0
  38. package/dist/esm/abi/kyc/iKYCUnderlying.js +377 -0
  39. package/dist/esm/abi/kyc/iSecuritizeDegenNFT.js +302 -0
  40. package/dist/esm/abi/kyc/iSecuritizeKYCFactory.js +295 -0
  41. package/dist/esm/dev/AccountOpener.js +47 -6
  42. package/dist/esm/sdk/OnchainSDK.js +57 -5
  43. package/dist/esm/sdk/accounts/AbstractCreditAccountsService.js +336 -22
  44. package/dist/esm/sdk/accounts/CreditAccountsServiceV310.js +7 -1
  45. package/dist/esm/sdk/base/TokensMeta.js +22 -44
  46. package/dist/esm/sdk/base/token-types.js +6 -0
  47. package/dist/esm/sdk/chain/chains.js +18 -1
  48. package/dist/esm/sdk/constants/address-provider.js +2 -0
  49. package/dist/esm/sdk/market/MarketRegister.js +74 -118
  50. package/dist/esm/sdk/market/MarketSuite.js +3 -0
  51. package/dist/esm/sdk/market/index.js +1 -0
  52. package/dist/esm/sdk/market/kyc/KYCRegistry.js +253 -0
  53. package/dist/esm/sdk/market/kyc/index.js +3 -0
  54. package/dist/esm/sdk/market/kyc/securitize/SecuritizeKYCFactory.js +218 -0
  55. package/dist/esm/sdk/market/kyc/securitize/constants.js +4 -0
  56. package/dist/esm/sdk/market/kyc/securitize/index.js +3 -0
  57. package/dist/esm/sdk/market/kyc/securitize/types.js +0 -0
  58. package/dist/esm/sdk/market/kyc/types.js +9 -0
  59. package/dist/esm/sdk/market/pool/PoolSuite.js +3 -0
  60. package/dist/esm/sdk/market/pool/PoolV310Contract.js +11 -2
  61. package/dist/esm/sdk/market/pool/index.js +1 -0
  62. package/dist/esm/sdk/market/pricefeeds/PriceFeedsRegister.js +3 -3
  63. package/dist/esm/sdk/options.js +6 -0
  64. package/dist/esm/sdk/pools/PoolService.js +109 -13
  65. package/dist/esm/sdk/utils/viem/executeDelegatedMulticalls.js +14 -0
  66. package/dist/esm/sdk/utils/viem/index.js +1 -0
  67. package/dist/types/abi/kyc/iDSRegistryService.d.ts +191 -0
  68. package/dist/types/abi/kyc/iDSToken.d.ts +67 -0
  69. package/dist/types/abi/kyc/iKYCCompressor.d.ts +228 -0
  70. package/dist/types/abi/kyc/iKYCFactory.d.ts +139 -0
  71. package/dist/types/abi/kyc/iKYCUnderlying.d.ts +548 -0
  72. package/dist/types/abi/kyc/iSecuritizeDegenNFT.d.ts +404 -0
  73. package/dist/types/abi/kyc/iSecuritizeKYCFactory.d.ts +376 -0
  74. package/dist/types/sdk/OnchainSDK.d.ts +19 -1
  75. package/dist/types/sdk/accounts/AbstractCreditAccountsService.d.ts +59 -6
  76. package/dist/types/sdk/accounts/CreditAccountsServiceV310.d.ts +1 -1
  77. package/dist/types/sdk/accounts/types.d.ts +114 -14
  78. package/dist/types/sdk/base/TokensMeta.d.ts +14 -3
  79. package/dist/types/sdk/base/token-types.d.ts +44 -4
  80. package/dist/types/sdk/base/types.d.ts +116 -2
  81. package/dist/types/sdk/chain/chains.d.ts +5 -1
  82. package/dist/types/sdk/constants/address-provider.d.ts +1 -0
  83. package/dist/types/sdk/market/MarketRegister.d.ts +6 -9
  84. package/dist/types/sdk/market/MarketSuite.d.ts +2 -0
  85. package/dist/types/sdk/market/index.d.ts +1 -0
  86. package/dist/types/sdk/market/kyc/KYCRegistry.d.ts +52 -0
  87. package/dist/types/sdk/market/kyc/index.d.ts +3 -0
  88. package/dist/types/sdk/market/kyc/securitize/SecuritizeKYCFactory.d.ts +429 -0
  89. package/dist/types/sdk/market/kyc/securitize/constants.d.ts +1 -0
  90. package/dist/types/sdk/market/kyc/securitize/index.d.ts +3 -0
  91. package/dist/types/sdk/market/kyc/securitize/types.d.ts +136 -0
  92. package/dist/types/sdk/market/kyc/types.d.ts +171 -0
  93. package/dist/types/sdk/market/oracle/PriceOracleBaseContract.d.ts +3 -2
  94. package/dist/types/sdk/market/oracle/types.d.ts +3 -10
  95. package/dist/types/sdk/market/pool/PoolSuite.d.ts +2 -0
  96. package/dist/types/sdk/market/pool/PoolV310Contract.d.ts +6 -2
  97. package/dist/types/sdk/market/pool/index.d.ts +1 -0
  98. package/dist/types/sdk/market/pricefeeds/PriceFeedsRegister.d.ts +1 -1
  99. package/dist/types/sdk/market/types.d.ts +1 -1
  100. package/dist/types/sdk/options.d.ts +1 -0
  101. package/dist/types/sdk/pools/PoolService.d.ts +8 -8
  102. package/dist/types/sdk/pools/types.d.ts +1 -1
  103. package/dist/types/sdk/types/state-human.d.ts +2 -0
  104. package/dist/types/sdk/types/state.d.ts +5 -0
  105. package/dist/types/sdk/utils/viem/executeDelegatedMulticalls.d.ts +28 -0
  106. package/dist/types/sdk/utils/viem/index.d.ts +1 -0
  107. package/package.json +1 -1
  108. package/dist/esm/sdk/accounts/utils.js +0 -14
  109. package/dist/types/sdk/accounts/utils.d.ts +0 -2
@@ -0,0 +1,376 @@
1
+ export declare const iSecuritizeKYCFactoryAbi: readonly [{
2
+ readonly type: "function";
3
+ readonly name: "contractType";
4
+ readonly inputs: readonly [];
5
+ readonly outputs: readonly [{
6
+ readonly name: "";
7
+ readonly type: "bytes32";
8
+ readonly internalType: "bytes32";
9
+ }];
10
+ readonly stateMutability: "view";
11
+ }, {
12
+ readonly type: "function";
13
+ readonly name: "getCreditAccounts";
14
+ readonly inputs: readonly [{
15
+ readonly name: "investor";
16
+ readonly type: "address";
17
+ readonly internalType: "address";
18
+ }];
19
+ readonly outputs: readonly [{
20
+ readonly name: "";
21
+ readonly type: "address[]";
22
+ readonly internalType: "address[]";
23
+ }];
24
+ readonly stateMutability: "view";
25
+ }, {
26
+ readonly type: "function";
27
+ readonly name: "getDegenNFT";
28
+ readonly inputs: readonly [];
29
+ readonly outputs: readonly [{
30
+ readonly name: "";
31
+ readonly type: "address";
32
+ readonly internalType: "address";
33
+ }];
34
+ readonly stateMutability: "view";
35
+ }, {
36
+ readonly type: "function";
37
+ readonly name: "getInvestor";
38
+ readonly inputs: readonly [{
39
+ readonly name: "creditAccount";
40
+ readonly type: "address";
41
+ readonly internalType: "address";
42
+ }];
43
+ readonly outputs: readonly [{
44
+ readonly name: "";
45
+ readonly type: "address";
46
+ readonly internalType: "address";
47
+ }];
48
+ readonly stateMutability: "view";
49
+ }, {
50
+ readonly type: "function";
51
+ readonly name: "getTokens";
52
+ readonly inputs: readonly [];
53
+ readonly outputs: readonly [{
54
+ readonly name: "";
55
+ readonly type: "address[]";
56
+ readonly internalType: "address[]";
57
+ }];
58
+ readonly stateMutability: "view";
59
+ }, {
60
+ readonly type: "function";
61
+ readonly name: "getWallet";
62
+ readonly inputs: readonly [{
63
+ readonly name: "creditAccount";
64
+ readonly type: "address";
65
+ readonly internalType: "address";
66
+ }];
67
+ readonly outputs: readonly [{
68
+ readonly name: "";
69
+ readonly type: "address";
70
+ readonly internalType: "address";
71
+ }];
72
+ readonly stateMutability: "view";
73
+ }, {
74
+ readonly type: "function";
75
+ readonly name: "isCreditAccount";
76
+ readonly inputs: readonly [{
77
+ readonly name: "creditAccount";
78
+ readonly type: "address";
79
+ readonly internalType: "address";
80
+ }];
81
+ readonly outputs: readonly [{
82
+ readonly name: "";
83
+ readonly type: "bool";
84
+ readonly internalType: "bool";
85
+ }];
86
+ readonly stateMutability: "view";
87
+ }, {
88
+ readonly type: "function";
89
+ readonly name: "isFrozen";
90
+ readonly inputs: readonly [{
91
+ readonly name: "creditAccount";
92
+ readonly type: "address";
93
+ readonly internalType: "address";
94
+ }];
95
+ readonly outputs: readonly [{
96
+ readonly name: "";
97
+ readonly type: "bool";
98
+ readonly internalType: "bool";
99
+ }];
100
+ readonly stateMutability: "view";
101
+ }, {
102
+ readonly type: "function";
103
+ readonly name: "multicall";
104
+ readonly inputs: readonly [{
105
+ readonly name: "creditAccount";
106
+ readonly type: "address";
107
+ readonly internalType: "address";
108
+ }, {
109
+ readonly name: "calls";
110
+ readonly type: "tuple[]";
111
+ readonly internalType: "struct MultiCall[]";
112
+ readonly components: readonly [{
113
+ readonly name: "target";
114
+ readonly type: "address";
115
+ readonly internalType: "address";
116
+ }, {
117
+ readonly name: "callData";
118
+ readonly type: "bytes";
119
+ readonly internalType: "bytes";
120
+ }];
121
+ }, {
122
+ readonly name: "tokensToRegister";
123
+ readonly type: "address[]";
124
+ readonly internalType: "address[]";
125
+ }, {
126
+ readonly name: "signaturesToCache";
127
+ readonly type: "tuple[]";
128
+ readonly internalType: "struct ISecuritizeDegenNFT.RegisterMessage[]";
129
+ readonly components: readonly [{
130
+ readonly name: "token";
131
+ readonly type: "address";
132
+ readonly internalType: "address";
133
+ }, {
134
+ readonly name: "signature";
135
+ readonly type: "tuple";
136
+ readonly internalType: "struct ISecuritizeDegenNFT.Signature";
137
+ readonly components: readonly [{
138
+ readonly name: "deadline";
139
+ readonly type: "uint256";
140
+ readonly internalType: "uint256";
141
+ }, {
142
+ readonly name: "signature";
143
+ readonly type: "bytes";
144
+ readonly internalType: "bytes";
145
+ }];
146
+ }];
147
+ }];
148
+ readonly outputs: readonly [];
149
+ readonly stateMutability: "nonpayable";
150
+ }, {
151
+ readonly type: "function";
152
+ readonly name: "openCreditAccount";
153
+ readonly inputs: readonly [{
154
+ readonly name: "creditManager";
155
+ readonly type: "address";
156
+ readonly internalType: "address";
157
+ }, {
158
+ readonly name: "calls";
159
+ readonly type: "tuple[]";
160
+ readonly internalType: "struct MultiCall[]";
161
+ readonly components: readonly [{
162
+ readonly name: "target";
163
+ readonly type: "address";
164
+ readonly internalType: "address";
165
+ }, {
166
+ readonly name: "callData";
167
+ readonly type: "bytes";
168
+ readonly internalType: "bytes";
169
+ }];
170
+ }, {
171
+ readonly name: "tokensToRegister";
172
+ readonly type: "address[]";
173
+ readonly internalType: "address[]";
174
+ }, {
175
+ readonly name: "signaturesToCache";
176
+ readonly type: "tuple[]";
177
+ readonly internalType: "struct ISecuritizeDegenNFT.RegisterMessage[]";
178
+ readonly components: readonly [{
179
+ readonly name: "token";
180
+ readonly type: "address";
181
+ readonly internalType: "address";
182
+ }, {
183
+ readonly name: "signature";
184
+ readonly type: "tuple";
185
+ readonly internalType: "struct ISecuritizeDegenNFT.Signature";
186
+ readonly components: readonly [{
187
+ readonly name: "deadline";
188
+ readonly type: "uint256";
189
+ readonly internalType: "uint256";
190
+ }, {
191
+ readonly name: "signature";
192
+ readonly type: "bytes";
193
+ readonly internalType: "bytes";
194
+ }];
195
+ }];
196
+ }];
197
+ readonly outputs: readonly [{
198
+ readonly name: "creditAccount";
199
+ readonly type: "address";
200
+ readonly internalType: "address";
201
+ }, {
202
+ readonly name: "wallet";
203
+ readonly type: "address";
204
+ readonly internalType: "address";
205
+ }];
206
+ readonly stateMutability: "nonpayable";
207
+ }, {
208
+ readonly type: "function";
209
+ readonly name: "precomputeWalletAddress";
210
+ readonly inputs: readonly [{
211
+ readonly name: "creditManager";
212
+ readonly type: "address";
213
+ readonly internalType: "address";
214
+ }, {
215
+ readonly name: "investor";
216
+ readonly type: "address";
217
+ readonly internalType: "address";
218
+ }];
219
+ readonly outputs: readonly [{
220
+ readonly name: "";
221
+ readonly type: "address";
222
+ readonly internalType: "address";
223
+ }];
224
+ readonly stateMutability: "view";
225
+ }, {
226
+ readonly type: "function";
227
+ readonly name: "serialize";
228
+ readonly inputs: readonly [];
229
+ readonly outputs: readonly [{
230
+ readonly name: "serializedData";
231
+ readonly type: "bytes";
232
+ readonly internalType: "bytes";
233
+ }];
234
+ readonly stateMutability: "view";
235
+ }, {
236
+ readonly type: "function";
237
+ readonly name: "setFrozenStatus";
238
+ readonly inputs: readonly [{
239
+ readonly name: "creditAccount";
240
+ readonly type: "address";
241
+ readonly internalType: "address";
242
+ }, {
243
+ readonly name: "frozen";
244
+ readonly type: "bool";
245
+ readonly internalType: "bool";
246
+ }];
247
+ readonly outputs: readonly [];
248
+ readonly stateMutability: "nonpayable";
249
+ }, {
250
+ readonly type: "function";
251
+ readonly name: "setInvestor";
252
+ readonly inputs: readonly [{
253
+ readonly name: "creditAccount";
254
+ readonly type: "address";
255
+ readonly internalType: "address";
256
+ }, {
257
+ readonly name: "investor";
258
+ readonly type: "address";
259
+ readonly internalType: "address";
260
+ }];
261
+ readonly outputs: readonly [];
262
+ readonly stateMutability: "nonpayable";
263
+ }, {
264
+ readonly type: "function";
265
+ readonly name: "version";
266
+ readonly inputs: readonly [];
267
+ readonly outputs: readonly [{
268
+ readonly name: "";
269
+ readonly type: "uint256";
270
+ readonly internalType: "uint256";
271
+ }];
272
+ readonly stateMutability: "view";
273
+ }, {
274
+ readonly type: "event";
275
+ readonly name: "CreateWallet";
276
+ readonly inputs: readonly [{
277
+ readonly name: "creditAccount";
278
+ readonly type: "address";
279
+ readonly indexed: true;
280
+ readonly internalType: "address";
281
+ }, {
282
+ readonly name: "wallet";
283
+ readonly type: "address";
284
+ readonly indexed: true;
285
+ readonly internalType: "address";
286
+ }, {
287
+ readonly name: "investor";
288
+ readonly type: "address";
289
+ readonly indexed: true;
290
+ readonly internalType: "address";
291
+ }];
292
+ readonly anonymous: false;
293
+ }, {
294
+ readonly type: "event";
295
+ readonly name: "SetFrozenStatus";
296
+ readonly inputs: readonly [{
297
+ readonly name: "creditAccount";
298
+ readonly type: "address";
299
+ readonly indexed: true;
300
+ readonly internalType: "address";
301
+ }, {
302
+ readonly name: "frozen";
303
+ readonly type: "bool";
304
+ readonly indexed: false;
305
+ readonly internalType: "bool";
306
+ }];
307
+ readonly anonymous: false;
308
+ }, {
309
+ readonly type: "event";
310
+ readonly name: "SetInvestor";
311
+ readonly inputs: readonly [{
312
+ readonly name: "creditAccount";
313
+ readonly type: "address";
314
+ readonly indexed: true;
315
+ readonly internalType: "address";
316
+ }, {
317
+ readonly name: "oldInvestor";
318
+ readonly type: "address";
319
+ readonly indexed: true;
320
+ readonly internalType: "address";
321
+ }, {
322
+ readonly name: "newInvestor";
323
+ readonly type: "address";
324
+ readonly indexed: true;
325
+ readonly internalType: "address";
326
+ }];
327
+ readonly anonymous: false;
328
+ }, {
329
+ readonly type: "error";
330
+ readonly name: "CallerIsNotInvestorException";
331
+ readonly inputs: readonly [{
332
+ readonly name: "caller";
333
+ readonly type: "address";
334
+ readonly internalType: "address";
335
+ }, {
336
+ readonly name: "creditAccount";
337
+ readonly type: "address";
338
+ readonly internalType: "address";
339
+ }];
340
+ }, {
341
+ readonly type: "error";
342
+ readonly name: "FrozenCreditAccountException";
343
+ readonly inputs: readonly [{
344
+ readonly name: "creditAccount";
345
+ readonly type: "address";
346
+ readonly internalType: "address";
347
+ }];
348
+ }, {
349
+ readonly type: "error";
350
+ readonly name: "InvalidCreditManagerException";
351
+ readonly inputs: readonly [{
352
+ readonly name: "creditManager";
353
+ readonly type: "address";
354
+ readonly internalType: "address";
355
+ }];
356
+ }, {
357
+ readonly type: "error";
358
+ readonly name: "InvalidUnderlyingTokenException";
359
+ readonly inputs: readonly [{
360
+ readonly name: "underlying";
361
+ readonly type: "address";
362
+ readonly internalType: "address";
363
+ }];
364
+ }, {
365
+ readonly type: "error";
366
+ readonly name: "UnknownCreditAccountException";
367
+ readonly inputs: readonly [{
368
+ readonly name: "creditAccount";
369
+ readonly type: "address";
370
+ readonly internalType: "address";
371
+ }];
372
+ }, {
373
+ readonly type: "error";
374
+ readonly name: "ZeroAddressException";
375
+ readonly inputs: readonly [];
376
+ }];
@@ -6,6 +6,7 @@ import { ChainContractsRegister } from "./base/index.js";
6
6
  import type { GearboxChain, NetworkType } from "./chain/chains.js";
7
7
  import type { VersionRange } from "./constants/index.js";
8
8
  import type { IAddressProviderContract } from "./core/index.js";
9
+ import { KYCRegistry } from "./market/index.js";
9
10
  import { MarketRegister } from "./market/MarketRegister.js";
10
11
  import { PriceFeedRegister } from "./market/pricefeeds/index.js";
11
12
  import type { PythOptions, RedstoneOptions } from "./market/pricefeeds/updates/index.js";
@@ -90,6 +91,10 @@ export interface AttachOptions {
90
91
  * Addresses of market configurator contracts to load.
91
92
  **/
92
93
  marketConfigurators?: Address[];
94
+ /**
95
+ * Addresses of KYC factory contracts to load.
96
+ **/
97
+ kycFactories?: Address[];
93
98
  /**
94
99
  * Pin SDK to a specific block number during attach.
95
100
  **/
@@ -246,9 +251,22 @@ export declare class OnchainSDK<const Plugins extends PluginsMap = {}> extends C
246
251
  */
247
252
  get marketRegister(): MarketRegister;
248
253
  /**
254
+ * KYC register for KYC-wrapped underlying tokens and factories.
255
+ *
256
+ * @throws If the SDK has not been attached or hydrated yet.
257
+ **/
258
+ get kyc(): KYCRegistry;
259
+ /**
260
+ * @internal
249
261
  * Resolves the appropriate router contract for a given credit manager,
250
262
  * credit facade, or explicit version range.
251
- */
263
+ *
264
+ * @param params - Identifies the context: a credit manager address/state,
265
+ * a credit facade address/state, or a {@link VersionRange}.
266
+ * @returns The matching router contract instance.
267
+ * @throws If the credit facade version is unsupported or no router is
268
+ * registered for the resolved version range.
269
+ **/
252
270
  routerFor(params: {
253
271
  creditManager: Address | BaseState | IBaseContract;
254
272
  } | {
@@ -1,12 +1,13 @@
1
1
  import type { Address } from "viem";
2
2
  import type { CreditAccountData } from "../base/index.js";
3
3
  import { SDKConstruct } from "../base/index.js";
4
- import type { CreditSuite } from "../market/index.js";
4
+ import type { CreditSuite, KYCOperationParams } from "../market/index.js";
5
5
  import { type PriceUpdate, type UpdatePriceFeedsResult } from "../market/index.js";
6
+ import { type KYCOpenAccountRequirements } from "../market/kyc/index.js";
6
7
  import type { OnchainSDK } from "../OnchainSDK.js";
7
8
  import { type Asset, type RouterCASlice } from "../router/index.js";
8
9
  import type { MultiCall, RawTx } from "../types/index.js";
9
- import type { AccountToCheck, AddCollateralProps, ChangeDeptProps, ClaimDelayedProps, CloseCreditAccountProps, CloseCreditAccountResult, CloseOptions, CreditAccountOperationResult, CreditAccountTokensSlice, ExecuteSwapProps, FullyLiquidateProps, FullyLiquidateResult, GetConnectedBotsResult, GetConnectedMigrationBotsResult, GetCreditAccountsOptions, GetPendingWithdrawalsProps, GetPendingWithdrawalsResult, OpenCAProps, PermitResult, PrepareUpdateQuotasProps, PreviewDelayedWithdrawalProps, PreviewDelayedWithdrawalResult, Rewards, StartDelayedWithdrawalProps, UpdateQuotasProps } from "./types.js";
10
+ import type { AccountToCheck, AddCollateralProps, ChangeDeptProps, ClaimDelayedProps, CloseCreditAccountProps, CloseCreditAccountResult, CloseOptions, CreditAccountOperationResult, CreditAccountTokensSlice, ExecuteSwapProps, FullyLiquidateProps, FullyLiquidateResult, GetApprovalAddressProps, GetConnectedBotsResult, GetConnectedMigrationBotsResult, GetCreditAccountsOptions, GetOpenAccountRequirementsProps, GetPendingWithdrawalsProps, GetPendingWithdrawalsResult, OpenCAProps, PermitResult, PrepareUpdateQuotasProps, PreviewDelayedWithdrawalProps, PreviewDelayedWithdrawalResult, Rewards, StartDelayedWithdrawalProps, UpdateQuotasProps } from "./types.js";
10
11
  /**
11
12
  * Options for configuring the credit account service.
12
13
  **/
@@ -32,11 +33,15 @@ export declare abstract class AbstractCreditAccountService extends SDKConstruct
32
33
  /**
33
34
  * {@inheritDoc ICreditAccountsService.getCreditAccountData}
34
35
  **/
35
- getCreditAccountData(account: Address, blockNumber?: bigint): Promise<CreditAccountData | undefined>;
36
+ getCreditAccountData(account: Address, blockNumber?: bigint): Promise<CreditAccountData<true> | undefined>;
36
37
  /**
37
38
  * {@inheritDoc ICreditAccountsService.getCreditAccounts}
38
39
  **/
39
40
  getCreditAccounts(options?: GetCreditAccountsOptions, blockNumber?: bigint): Promise<Array<CreditAccountData>>;
41
+ /**
42
+ * {@inheritDoc ICreditAccountsService.getBorrowerCreditAccounts}
43
+ **/
44
+ getBorrowerCreditAccounts(borrower: Address, options?: GetCreditAccountsOptions, blockNumber?: bigint): Promise<Array<CreditAccountData<true>>>;
40
45
  /**
41
46
  * {@inheritDoc ICreditAccountsService.getRewards}
42
47
  **/
@@ -89,6 +94,14 @@ export declare abstract class AbstractCreditAccountService extends SDKConstruct
89
94
  * {@inheritDoc ICreditAccountsService.claimDelayed}
90
95
  **/
91
96
  claimDelayed({ creditAccount, minQuota, averageQuota, claimableNow, }: ClaimDelayedProps): Promise<CreditAccountOperationResult>;
97
+ /**
98
+ * {@inheritDoc ICreditAccountsService.getApprovalAddress}
99
+ **/
100
+ getApprovalAddress(options: GetApprovalAddressProps): Promise<Address>;
101
+ /**
102
+ * {@inheritDoc ICreditAccountsService.getOpenAccountRequirements}
103
+ */
104
+ getOpenAccountRequirements(borrower: Address, creditManager: Address, props: GetOpenAccountRequirementsProps): Promise<KYCOpenAccountRequirements | undefined>;
92
105
  /**
93
106
  * {@inheritDoc ICreditAccountsService.openCA}
94
107
  **/
@@ -102,6 +115,43 @@ export declare abstract class AbstractCreditAccountService extends SDKConstruct
102
115
  **/
103
116
  getOptimalHFForPartialLiquidation(ca: CreditAccountData): bigint;
104
117
  /**
118
+ * Returns multicall entries to redeem (unwrap) KYC ERC-4626 vault shares into underlying for the given credit manager.
119
+ * Used when withdrawing debt from a KYC market: redeems adapter vault shares so the underlying can be withdrawn.
120
+ * Only applies when the credit manager's underlying is KYC-gated and has an ERC-4626 adapter configured.
121
+ * @param amount - Number of vault shares (adapter tokens) to redeem
122
+ * @param creditManager - Credit manager address
123
+ * @returns Array of MultiCall to pass to credit facade multicall, or undefined if underlying is not KYC or no adapter is configured
124
+ */
125
+ getKYCUnwrapCalls(amount: bigint, creditManager: Address): Promise<Array<MultiCall> | undefined>;
126
+ /**
127
+ * Returns multicall entries to deposit (wrap) underlying into KYC ERC-4626 vault shares for the given credit manager.
128
+ * Used when adding debt on a KYC market: deposits underlying into the adapter vault so shares are minted on the account.
129
+ * Only applies when the credit manager's underlying is KYC-gated and has an ERC-4626 adapter configured.
130
+ * @param amount - Amount of underlying assets to deposit into the vault (in underlying decimals)
131
+ * @param creditManager - Credit manager address
132
+ * @returns Array of MultiCall to pass to credit facade multicall, or undefined if underlying is not KYC or no adapter is configured
133
+ */
134
+ getKYCWrapCalls(amount: bigint, creditManager: Address): Promise<Array<MultiCall> | undefined>;
135
+ /**
136
+ * Returns multicall entries to call redeemDiff on the KYC ERC-4626 adapter for the given credit manager.
137
+ * Redeems the leftover vault shares (e.g. after repaying debt) so the account does not hold excess KYC vault tokens.
138
+ * Only applies when the credit manager's underlying is KYC-gated and has an ERC-4626 adapter configured.
139
+ * @param amount - Leftover vault share amount to redeem (in adapter/vault decimals)
140
+ * @param creditManager - Credit manager address
141
+ * @returns Array of MultiCall to pass to credit facade multicall, or undefined if underlying is not KYC or no adapter is configured
142
+ */
143
+ getRedeemDiffCalls(amount: bigint, creditManager: Address): Promise<Array<MultiCall> | undefined>;
144
+ /**
145
+ * Returns multicall entries to call depositDiff on the KYC ERC-4626 adapter for the given credit manager.
146
+ * Deposits the leftover underlying (e.g. after decreasing debt) into the vault so the account does not hold excess underlying.
147
+ * Only applies when the credit manager's underlying is KYC-gated and has an ERC-4626 adapter configured.
148
+ * @param amount - Leftover underlying amount to deposit into the vault (in underlying decimals)
149
+ * @param creditManager - Credit manager address
150
+ * @returns Array of MultiCall to pass to credit facade multicall, or undefined if underlying is not KYC or no adapter is configured
151
+ */
152
+ getDepositDiffCalls(amount: bigint, creditManager: Address): Promise<Array<MultiCall> | undefined>;
153
+ /**
154
+ * Returns raw txs that are needed to update all price feeds so that all credit accounts (possibly from different markets) compute
105
155
  * {@inheritDoc ICreditAccountsService.getOnDemandPriceUpdates}
106
156
  **/
107
157
  getOnDemandPriceUpdates(account: CreditAccountTokensSlice, ignoreReservePrices?: boolean): Promise<PriceUpdate[]>;
@@ -150,24 +200,27 @@ export declare abstract class AbstractCreditAccountService extends SDKConstruct
150
200
  * @param to
151
201
  * @param calls
152
202
  * @param referralCode
203
+ * @param kycOptions
153
204
  * @returns
154
205
  */
155
- protected openCreditAccountTx(suite: CreditSuite, to: Address, calls: MultiCall[], referralCode?: bigint): Promise<RawTx>;
206
+ protected openCreditAccountTx(suite: CreditSuite, to: Address, calls: MultiCall[], referralCode?: bigint, kycOptions?: KYCOperationParams): Promise<RawTx>;
156
207
  /**
157
208
  * Wrapper that selects between credit facade and KYC factory
158
209
  * @param suite
159
210
  * @param creditAccount
160
211
  * @param calls
212
+ * @param kycOptions
161
213
  * @returns
162
214
  */
163
- protected multicallTx(suite: CreditSuite, creditAccount: Address, calls: MultiCall[]): Promise<RawTx>;
215
+ protected multicallTx(suite: CreditSuite, creditAccount: Address, calls: MultiCall[], kycOptions?: KYCOperationParams): Promise<RawTx>;
164
216
  /**
165
217
  * Wrapper that selects between credit facade and KYC factory
166
218
  * @param suite
167
219
  * @param creditAccount
168
220
  * @param calls
169
221
  * @param operation
222
+ * @param kycOptions
170
223
  * @returns
171
224
  */
172
- protected closeCreditAccountTx(suite: CreditSuite, creditAccount: Address, calls: MultiCall[], operation: CloseOptions): Promise<RawTx>;
225
+ protected closeCreditAccountTx(suite: CreditSuite, creditAccount: Address, calls: MultiCall[], operation: CloseOptions, kycOptions?: KYCOperationParams): Promise<RawTx>;
173
226
  }
@@ -21,7 +21,7 @@ export declare class CreditAccountServiceV310 extends AbstractCreditAccountServi
21
21
  /**
22
22
  * {@inheritDoc ICreditAccountsService.repayCreditAccount}
23
23
  */
24
- repayCreditAccount({ operation, collateralAssets, assetsToWithdraw, creditAccount: ca, permits, to, tokensToClaim, }: RepayCreditAccountProps): Promise<CreditAccountOperationResult>;
24
+ repayCreditAccount({ operation, collateralAssets, assetsToWithdraw, creditAccount: ca, permits, to, tokensToClaim, calls: wrapCalls, }: RepayCreditAccountProps): Promise<CreditAccountOperationResult>;
25
25
  /**
26
26
  * {@inheritDoc ICreditAccountsService.repayAndLiquidateCreditAccount}
27
27
  */