@gearbox-protocol/sdk 14.5.5 → 14.5.7

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 (27) hide show
  1. package/dist/cjs/abi/kyc/iDSRegistryService.js +265 -0
  2. package/dist/cjs/abi/kyc/iSecuritizeKYCFactory.js +53 -6
  3. package/dist/cjs/history/assembleOperations.js +18 -4
  4. package/dist/cjs/history/classifyMulticallOperations.js +20 -4
  5. package/dist/cjs/history/errors.js +12 -2
  6. package/dist/cjs/history/extractTransfers.js +12 -1
  7. package/dist/cjs/history/parseCreditAccountTransaction.js +3 -1
  8. package/dist/cjs/sdk/market/kyc/securitize/SecuritizeDegenNFT.js +41 -0
  9. package/dist/cjs/sdk/market/kyc/securitize/SecuritizeKYCFactory.js +3 -2
  10. package/dist/esm/abi/kyc/iDSRegistryService.js +265 -0
  11. package/dist/esm/abi/kyc/iSecuritizeKYCFactory.js +53 -6
  12. package/dist/esm/history/assembleOperations.js +18 -4
  13. package/dist/esm/history/classifyMulticallOperations.js +25 -5
  14. package/dist/esm/history/errors.js +10 -1
  15. package/dist/esm/history/extractTransfers.js +12 -1
  16. package/dist/esm/history/parseCreditAccountTransaction.js +3 -1
  17. package/dist/esm/sdk/market/kyc/securitize/SecuritizeDegenNFT.js +17 -0
  18. package/dist/esm/sdk/market/kyc/securitize/SecuritizeKYCFactory.js +3 -2
  19. package/dist/types/abi/kyc/iDSRegistryService.d.ts +210 -0
  20. package/dist/types/abi/kyc/iSecuritizeKYCFactory.d.ts +78 -6
  21. package/dist/types/history/assembleOperations.d.ts +2 -0
  22. package/dist/types/history/classifyMulticallOperations.d.ts +2 -0
  23. package/dist/types/history/errors.d.ts +3 -0
  24. package/dist/types/history/extractTransfers.d.ts +19 -0
  25. package/dist/types/sdk/market/kyc/securitize/SecuritizeDegenNFT.d.ts +412 -0
  26. package/dist/types/sdk/market/kyc/securitize/SecuritizeKYCFactory.d.ts +80 -7
  27. package/package.json +1 -1
@@ -188,4 +188,214 @@ export declare const iDSRegistryServiceAbi: readonly [{
188
188
  }];
189
189
  readonly outputs: readonly [];
190
190
  readonly stateMutability: "nonpayable";
191
+ }, {
192
+ readonly anonymous: false;
193
+ readonly inputs: readonly [{
194
+ readonly indexed: false;
195
+ readonly internalType: "string";
196
+ readonly name: "investorId";
197
+ readonly type: "string";
198
+ }, {
199
+ readonly indexed: false;
200
+ readonly internalType: "address";
201
+ readonly name: "sender";
202
+ readonly type: "address";
203
+ }];
204
+ readonly name: "DSRegistryServiceInvestorAdded";
205
+ readonly type: "event";
206
+ }, {
207
+ readonly anonymous: false;
208
+ readonly inputs: readonly [{
209
+ readonly indexed: false;
210
+ readonly internalType: "string";
211
+ readonly name: "investorId";
212
+ readonly type: "string";
213
+ }, {
214
+ readonly indexed: false;
215
+ readonly internalType: "uint256";
216
+ readonly name: "attributeId";
217
+ readonly type: "uint256";
218
+ }, {
219
+ readonly indexed: false;
220
+ readonly internalType: "uint256";
221
+ readonly name: "value";
222
+ readonly type: "uint256";
223
+ }, {
224
+ readonly indexed: false;
225
+ readonly internalType: "uint256";
226
+ readonly name: "expiry";
227
+ readonly type: "uint256";
228
+ }, {
229
+ readonly indexed: false;
230
+ readonly internalType: "string";
231
+ readonly name: "proofHash";
232
+ readonly type: "string";
233
+ }, {
234
+ readonly indexed: false;
235
+ readonly internalType: "address";
236
+ readonly name: "sender";
237
+ readonly type: "address";
238
+ }];
239
+ readonly name: "DSRegistryServiceInvestorAttributeChanged";
240
+ readonly type: "event";
241
+ }, {
242
+ readonly anonymous: false;
243
+ readonly inputs: readonly [{
244
+ readonly indexed: false;
245
+ readonly internalType: "string";
246
+ readonly name: "investorId";
247
+ readonly type: "string";
248
+ }, {
249
+ readonly indexed: false;
250
+ readonly internalType: "string";
251
+ readonly name: "country";
252
+ readonly type: "string";
253
+ }, {
254
+ readonly indexed: false;
255
+ readonly internalType: "address";
256
+ readonly name: "sender";
257
+ readonly type: "address";
258
+ }];
259
+ readonly name: "DSRegistryServiceInvestorCountryChanged";
260
+ readonly type: "event";
261
+ }, {
262
+ readonly anonymous: false;
263
+ readonly inputs: readonly [{
264
+ readonly indexed: false;
265
+ readonly internalType: "string";
266
+ readonly name: "investorId";
267
+ readonly type: "string";
268
+ }, {
269
+ readonly indexed: false;
270
+ readonly internalType: "address";
271
+ readonly name: "sender";
272
+ readonly type: "address";
273
+ }];
274
+ readonly name: "DSRegistryServiceInvestorRemoved";
275
+ readonly type: "event";
276
+ }, {
277
+ readonly anonymous: false;
278
+ readonly inputs: readonly [{
279
+ readonly indexed: false;
280
+ readonly internalType: "address";
281
+ readonly name: "omnibusWallet";
282
+ readonly type: "address";
283
+ }, {
284
+ readonly indexed: false;
285
+ readonly internalType: "string";
286
+ readonly name: "investorId";
287
+ readonly type: "string";
288
+ }, {
289
+ readonly indexed: false;
290
+ readonly internalType: "contract IDSOmnibusWalletController";
291
+ readonly name: "omnibusWalletController";
292
+ readonly type: "address";
293
+ }];
294
+ readonly name: "DSRegistryServiceOmnibusWalletAdded";
295
+ readonly type: "event";
296
+ }, {
297
+ readonly anonymous: false;
298
+ readonly inputs: readonly [{
299
+ readonly indexed: false;
300
+ readonly internalType: "address";
301
+ readonly name: "omnibusWallet";
302
+ readonly type: "address";
303
+ }, {
304
+ readonly indexed: false;
305
+ readonly internalType: "string";
306
+ readonly name: "investorId";
307
+ readonly type: "string";
308
+ }];
309
+ readonly name: "DSRegistryServiceOmnibusWalletRemoved";
310
+ readonly type: "event";
311
+ }, {
312
+ readonly anonymous: false;
313
+ readonly inputs: readonly [{
314
+ readonly indexed: false;
315
+ readonly internalType: "address";
316
+ readonly name: "wallet";
317
+ readonly type: "address";
318
+ }, {
319
+ readonly indexed: false;
320
+ readonly internalType: "string";
321
+ readonly name: "investorId";
322
+ readonly type: "string";
323
+ }, {
324
+ readonly indexed: false;
325
+ readonly internalType: "address";
326
+ readonly name: "sender";
327
+ readonly type: "address";
328
+ }];
329
+ readonly name: "DSRegistryServiceWalletAdded";
330
+ readonly type: "event";
331
+ }, {
332
+ readonly anonymous: false;
333
+ readonly inputs: readonly [{
334
+ readonly indexed: false;
335
+ readonly internalType: "address";
336
+ readonly name: "wallet";
337
+ readonly type: "address";
338
+ }, {
339
+ readonly indexed: false;
340
+ readonly internalType: "string";
341
+ readonly name: "investorId";
342
+ readonly type: "string";
343
+ }, {
344
+ readonly indexed: false;
345
+ readonly internalType: "address";
346
+ readonly name: "sender";
347
+ readonly type: "address";
348
+ }];
349
+ readonly name: "DSRegistryServiceWalletRemoved";
350
+ readonly type: "event";
351
+ }, {
352
+ readonly anonymous: false;
353
+ readonly inputs: readonly [{
354
+ readonly indexed: false;
355
+ readonly internalType: "uint256";
356
+ readonly name: "serviceId";
357
+ readonly type: "uint256";
358
+ }, {
359
+ readonly indexed: false;
360
+ readonly internalType: "address";
361
+ readonly name: "serviceAddress";
362
+ readonly type: "address";
363
+ }];
364
+ readonly name: "DSServiceSet";
365
+ readonly type: "event";
366
+ }, {
367
+ readonly anonymous: false;
368
+ readonly inputs: readonly [{
369
+ readonly indexed: false;
370
+ readonly internalType: "uint64";
371
+ readonly name: "version";
372
+ readonly type: "uint64";
373
+ }];
374
+ readonly name: "Initialized";
375
+ readonly type: "event";
376
+ }, {
377
+ readonly anonymous: false;
378
+ readonly inputs: readonly [{
379
+ readonly indexed: true;
380
+ readonly internalType: "address";
381
+ readonly name: "previousOwner";
382
+ readonly type: "address";
383
+ }, {
384
+ readonly indexed: true;
385
+ readonly internalType: "address";
386
+ readonly name: "newOwner";
387
+ readonly type: "address";
388
+ }];
389
+ readonly name: "OwnershipTransferred";
390
+ readonly type: "event";
391
+ }, {
392
+ readonly anonymous: false;
393
+ readonly inputs: readonly [{
394
+ readonly indexed: true;
395
+ readonly internalType: "address";
396
+ readonly name: "implementation";
397
+ readonly type: "address";
398
+ }];
399
+ readonly name: "Upgraded";
400
+ readonly type: "event";
191
401
  }];
@@ -234,9 +234,13 @@ export declare const iSecuritizeKYCFactoryAbi: readonly [{
234
234
  readonly stateMutability: "view";
235
235
  }, {
236
236
  readonly type: "function";
237
- readonly name: "setFrozenStatus";
237
+ readonly name: "setAllCreditAccountsFrozenStatus";
238
238
  readonly inputs: readonly [{
239
- readonly name: "creditAccount";
239
+ readonly name: "creditManager";
240
+ readonly type: "address";
241
+ readonly internalType: "address";
242
+ }, {
243
+ readonly name: "investor";
240
244
  readonly type: "address";
241
245
  readonly internalType: "address";
242
246
  }, {
@@ -248,15 +252,75 @@ export declare const iSecuritizeKYCFactoryAbi: readonly [{
248
252
  readonly stateMutability: "nonpayable";
249
253
  }, {
250
254
  readonly type: "function";
251
- readonly name: "setInvestor";
255
+ readonly name: "setAllCreditAccountsFrozenStatus";
256
+ readonly inputs: readonly [{
257
+ readonly name: "investor";
258
+ readonly type: "address";
259
+ readonly internalType: "address";
260
+ }, {
261
+ readonly name: "frozen";
262
+ readonly type: "bool";
263
+ readonly internalType: "bool";
264
+ }];
265
+ readonly outputs: readonly [];
266
+ readonly stateMutability: "nonpayable";
267
+ }, {
268
+ readonly type: "function";
269
+ readonly name: "setCreditAccountFrozenStatus";
252
270
  readonly inputs: readonly [{
253
271
  readonly name: "creditAccount";
254
272
  readonly type: "address";
255
273
  readonly internalType: "address";
256
274
  }, {
275
+ readonly name: "frozen";
276
+ readonly type: "bool";
277
+ readonly internalType: "bool";
278
+ }];
279
+ readonly outputs: readonly [];
280
+ readonly stateMutability: "nonpayable";
281
+ }, {
282
+ readonly type: "function";
283
+ readonly name: "transferAllCreditAccounts";
284
+ readonly inputs: readonly [{
257
285
  readonly name: "investor";
258
286
  readonly type: "address";
259
287
  readonly internalType: "address";
288
+ }, {
289
+ readonly name: "newInvestor";
290
+ readonly type: "address";
291
+ readonly internalType: "address";
292
+ }];
293
+ readonly outputs: readonly [];
294
+ readonly stateMutability: "nonpayable";
295
+ }, {
296
+ readonly type: "function";
297
+ readonly name: "transferAllCreditAccounts";
298
+ readonly inputs: readonly [{
299
+ readonly name: "creditManager";
300
+ readonly type: "address";
301
+ readonly internalType: "address";
302
+ }, {
303
+ readonly name: "investor";
304
+ readonly type: "address";
305
+ readonly internalType: "address";
306
+ }, {
307
+ readonly name: "newInvestor";
308
+ readonly type: "address";
309
+ readonly internalType: "address";
310
+ }];
311
+ readonly outputs: readonly [];
312
+ readonly stateMutability: "nonpayable";
313
+ }, {
314
+ readonly type: "function";
315
+ readonly name: "transferCreditAccount";
316
+ readonly inputs: readonly [{
317
+ readonly name: "creditAccount";
318
+ readonly type: "address";
319
+ readonly internalType: "address";
320
+ }, {
321
+ readonly name: "newInvestor";
322
+ readonly type: "address";
323
+ readonly internalType: "address";
260
324
  }];
261
325
  readonly outputs: readonly [];
262
326
  readonly stateMutability: "nonpayable";
@@ -272,7 +336,7 @@ export declare const iSecuritizeKYCFactoryAbi: readonly [{
272
336
  readonly stateMutability: "view";
273
337
  }, {
274
338
  readonly type: "event";
275
- readonly name: "CreateWallet";
339
+ readonly name: "OpenKYCCreditAccount";
276
340
  readonly inputs: readonly [{
277
341
  readonly name: "creditAccount";
278
342
  readonly type: "address";
@@ -292,7 +356,7 @@ export declare const iSecuritizeKYCFactoryAbi: readonly [{
292
356
  readonly anonymous: false;
293
357
  }, {
294
358
  readonly type: "event";
295
- readonly name: "SetFrozenStatus";
359
+ readonly name: "SetCreditAccountFrozenStatus";
296
360
  readonly inputs: readonly [{
297
361
  readonly name: "creditAccount";
298
362
  readonly type: "address";
@@ -307,7 +371,7 @@ export declare const iSecuritizeKYCFactoryAbi: readonly [{
307
371
  readonly anonymous: false;
308
372
  }, {
309
373
  readonly type: "event";
310
- readonly name: "SetInvestor";
374
+ readonly name: "TransferCreditAccount";
311
375
  readonly inputs: readonly [{
312
376
  readonly name: "creditAccount";
313
377
  readonly type: "address";
@@ -361,6 +425,14 @@ export declare const iSecuritizeKYCFactoryAbi: readonly [{
361
425
  readonly type: "address";
362
426
  readonly internalType: "address";
363
427
  }];
428
+ }, {
429
+ readonly type: "error";
430
+ readonly name: "TooManyCreditAccountsException";
431
+ readonly inputs: readonly [{
432
+ readonly name: "investor";
433
+ readonly type: "address";
434
+ readonly internalType: "address";
435
+ }];
364
436
  }, {
365
437
  readonly type: "error";
366
438
  readonly name: "UnknownCreditAccountException";
@@ -1,5 +1,6 @@
1
1
  import type { Address } from "viem";
2
2
  import type { AddressMap, ChainContractsRegister } from "../sdk/index.js";
3
+ import type { WithdrawCollateralEventInfo } from "./extractTransfers.js";
3
4
  import type { ExecuteResult, FacadeParsedCall } from "./internal-types.js";
4
5
  import type { FacadeOperationMetadata, OuterFacadeOperation } from "./types.js";
5
6
  export interface AssembleOperationsInput {
@@ -9,6 +10,7 @@ export interface AssembleOperationsInput {
9
10
  underlying: Address;
10
11
  liquidationRemainingFunds?: bigint;
11
12
  phantomTokens?: AddressMap<Address>;
13
+ withdrawCollateralEvents?: WithdrawCollateralEventInfo[];
12
14
  strict?: boolean;
13
15
  }
14
16
  /**
@@ -1,5 +1,6 @@
1
1
  import { type Address, type Hex } from "viem";
2
2
  import type { AddressMap, ChainContractsRegister, ParsedCallV2 } from "../sdk/index.js";
3
+ import type { WithdrawCollateralEventInfo } from "./extractTransfers.js";
3
4
  import type { InnerOperation } from "./inner-operations.js";
4
5
  import type { ExecuteResult } from "./internal-types.js";
5
6
  export interface ClassifyMulticallOperationsInput {
@@ -11,6 +12,7 @@ export interface ClassifyMulticallOperationsInput {
11
12
  underlying: Address;
12
13
  strict?: boolean;
13
14
  phantomTokens?: AddressMap<Address>;
15
+ withdrawCollateralEvents?: WithdrawCollateralEventInfo[];
14
16
  }
15
17
  /**
16
18
  * Classifies each multicall inner call into a {@link InnerOperation}:
@@ -6,6 +6,9 @@ export declare class UnknownAdapterError extends Error {
6
6
  export declare class TransferAlignmentError extends Error {
7
7
  constructor(expected: number, actual: number);
8
8
  }
9
+ export declare class WithdrawCollateralAlignmentError extends Error {
10
+ constructor(expected: number, actual: number);
11
+ }
9
12
  export declare class ProtocolCallNotFoundError extends Error {
10
13
  readonly targetContract: Address;
11
14
  readonly executeIndex: number;
@@ -3,6 +3,19 @@ import { AddressMap } from "../sdk/index.js";
3
3
  import type { ExecuteResult } from "./internal-types.js";
4
4
  import type { DirectTransferInfo } from "./types.js";
5
5
  type RawLog = Log<bigint | number, number, false>;
6
+ /**
7
+ * Effective `withdrawCollateral` outcome decoded from the facade's
8
+ * `WithdrawCollateral` event.
9
+ */
10
+ export interface WithdrawCollateralEventInfo {
11
+ /**
12
+ * For regular withdrawals: the calldata token.
13
+ * For phantom withdrawals: the deposited (resolved) token.
14
+ */
15
+ token: Address;
16
+ amount: bigint;
17
+ to: Address;
18
+ }
6
19
  /**
7
20
  * Extracts per-adapter-call token balance changes and detects direct
8
21
  * incoming transfers to the credit account.
@@ -17,6 +30,12 @@ export interface ExtractTransfersResult {
17
30
  liquidationRemainingFunds?: bigint;
18
31
  /** Maps phantom token address to its deposited (underlying) token address. */
19
32
  phantomTokens: AddressMap<Address>;
33
+ /**
34
+ * One entry per facade `WithdrawCollateral` event targeting `creditAccount`,
35
+ * in transaction order. Used to recover the effective amount when the
36
+ * calldata uses the `type(uint256).max` "withdraw all" sentinel.
37
+ */
38
+ withdrawCollateralEvents: WithdrawCollateralEventInfo[];
20
39
  }
21
40
  export declare function extractTransfers(logs: RawLog[], creditAccount: Address, pool: Address, creditFacade: Address): ExtractTransfersResult;
22
41
  export {};