@gearbox-protocol/sdk 13.5.0-next.1 → 13.5.0-next.3

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 (53) hide show
  1. package/dist/cjs/dev/AccountOpener.js +5 -45
  2. package/dist/cjs/sdk/accounts/AbstractCreditAccountsService.js +6 -339
  3. package/dist/cjs/sdk/accounts/CreditAccountsServiceV310.js +1 -13
  4. package/dist/cjs/sdk/base/TokensMeta.js +7 -151
  5. package/dist/cjs/sdk/base/token-types.js +0 -6
  6. package/dist/cjs/sdk/chain/chains.js +1 -2
  7. package/dist/cjs/sdk/constants/addresses.js +3 -0
  8. package/dist/cjs/sdk/market/MarketRegister.js +0 -3
  9. package/dist/cjs/sdk/market/MarketSuite.js +0 -3
  10. package/dist/cjs/sdk/market/ZapperRegister.js +0 -123
  11. package/dist/cjs/sdk/market/pool/PoolSuite.js +0 -3
  12. package/dist/cjs/sdk/market/pool/PoolV310Contract.js +2 -17
  13. package/dist/cjs/sdk/market/pool/index.js +0 -4
  14. package/dist/cjs/sdk/pools/PoolService.js +84 -132
  15. package/dist/esm/dev/AccountOpener.js +6 -47
  16. package/dist/esm/sdk/accounts/AbstractCreditAccountsService.js +6 -339
  17. package/dist/esm/sdk/accounts/CreditAccountsServiceV310.js +1 -13
  18. package/dist/esm/sdk/base/TokensMeta.js +7 -155
  19. package/dist/esm/sdk/base/token-types.js +0 -4
  20. package/dist/esm/sdk/chain/chains.js +1 -2
  21. package/dist/esm/sdk/constants/addresses.js +2 -0
  22. package/dist/esm/sdk/market/MarketRegister.js +0 -3
  23. package/dist/esm/sdk/market/MarketSuite.js +0 -3
  24. package/dist/esm/sdk/market/ZapperRegister.js +0 -123
  25. package/dist/esm/sdk/market/pool/PoolSuite.js +0 -3
  26. package/dist/esm/sdk/market/pool/PoolV310Contract.js +2 -17
  27. package/dist/esm/sdk/market/pool/index.js +0 -2
  28. package/dist/esm/sdk/pools/PoolService.js +75 -127
  29. package/dist/types/sdk/accounts/AbstractCreditAccountsService.d.ts +5 -103
  30. package/dist/types/sdk/accounts/CreditAccountsServiceV310.d.ts +2 -4
  31. package/dist/types/sdk/accounts/types.d.ts +6 -130
  32. package/dist/types/sdk/base/TokensMeta.d.ts +3 -20
  33. package/dist/types/sdk/base/token-types.d.ts +1 -21
  34. package/dist/types/sdk/base/types.d.ts +3 -0
  35. package/dist/types/sdk/chain/chains.d.ts +1 -1
  36. package/dist/types/sdk/constants/addresses.d.ts +4 -0
  37. package/dist/types/sdk/market/MarketSuite.d.ts +0 -2
  38. package/dist/types/sdk/market/pool/PoolSuite.d.ts +0 -2
  39. package/dist/types/sdk/market/pool/PoolV310Contract.d.ts +2 -6
  40. package/dist/types/sdk/market/pool/index.d.ts +0 -2
  41. package/dist/types/sdk/market/types.d.ts +1 -1
  42. package/dist/types/sdk/pools/PoolService.d.ts +24 -0
  43. package/dist/types/sdk/pools/types.d.ts +9 -8
  44. package/package.json +1 -1
  45. package/dist/cjs/abi/310/iSecuritizeDegenNFT.js +0 -263
  46. package/dist/cjs/abi/310/iSecuritizeKYCFactory.js +0 -278
  47. package/dist/cjs/sdk/market/pool/SecuritizeKYCFactory.js +0 -97
  48. package/dist/esm/abi/310/iSecuritizeDegenNFT.js +0 -239
  49. package/dist/esm/abi/310/iSecuritizeKYCFactory.js +0 -254
  50. package/dist/esm/sdk/market/pool/SecuritizeKYCFactory.js +0 -73
  51. package/dist/types/abi/310/iSecuritizeDegenNFT.d.ts +0 -324
  52. package/dist/types/abi/310/iSecuritizeKYCFactory.d.ts +0 -322
  53. package/dist/types/sdk/market/pool/SecuritizeKYCFactory.d.ts +0 -345
@@ -5,7 +5,7 @@ import type { ConnectedBotData, Construct, CreditAccountData } from "../base/ind
5
5
  import type { GearboxSDK } from "../GearboxSDK.js";
6
6
  import type { CreditSuite, PriceUpdate } from "../market/index.js";
7
7
  import type { Asset, RouterCASlice, RouterCloseResult } from "../router/index.js";
8
- import type { IPriceUpdateTx, MultiCall, RawTx } from "../types/index.js";
8
+ import type { MultiCall, RawTx } from "../types/index.js";
9
9
  /**
10
10
  * @internal
11
11
  * Arguments tuple for the credit account compressor's `getCreditAccounts` view method.
@@ -182,10 +182,6 @@ export interface CloseCreditAccountProps {
182
182
  closePath?: RouterCloseResult;
183
183
  }
184
184
  export interface RepayCreditAccountProps extends RepayAndLiquidateCreditAccountProps {
185
- /**
186
- * Swap calls for repay
187
- */
188
- calls?: Array<MultiCall>;
189
185
  /**
190
186
  * close or zeroDebt
191
187
  */
@@ -443,10 +439,6 @@ export interface ChangeDeptProps {
443
439
  * Assets to add as collateral
444
440
  */
445
441
  collateral?: [Asset];
446
- /**
447
- * Assets to wrap
448
- */
449
- wrapAsset?: [Asset];
450
442
  }
451
443
  export interface FullyLiquidateProps {
452
444
  /**
@@ -590,51 +582,6 @@ export type GetConnectedMigrationBotsResult = {
590
582
  })[];
591
583
  botAddress: Address;
592
584
  } | undefined;
593
- /**
594
- * Input for previewing a proportional Llamathena withdrawal.
595
- **/
596
- export interface PreviewWithdrawLlamathenaProportionallyProps {
597
- /**
598
- * Llamathena token and amount to withdraw.
599
- **/
600
- llamathena: Asset;
601
- }
602
- /**
603
- * Result of a proportional Llamathena withdrawal preview.
604
- **/
605
- export interface PreviewWithdrawLlamathenaProportionallyResult {
606
- /**
607
- * Underlying assets received from the withdrawal.
608
- **/
609
- assets: [Asset];
610
- /**
611
- * Staked Llamathena token consumed.
612
- **/
613
- stkLlamathena: [Asset];
614
- }
615
- export interface LlamathenaProportionalWithdrawProps extends PrepareUpdateQuotasProps {
616
- /**
617
- * Preview of the withdrawal
618
- */
619
- preview: PreviewWithdrawLlamathenaProportionallyResult;
620
- /**
621
- * Minimal credit account data on which operation is performed.
622
- */
623
- creditAccount: RouterCASlice;
624
- }
625
- /**
626
- * Options to get approval address for collateral token
627
- */
628
- export type GetApprovalAddressProps = {
629
- creditManager: Address;
630
- borrower: Address;
631
- } | {
632
- creditManager: Address;
633
- creditAccount: Address;
634
- };
635
- export type CreditAccountDataWithInvestor = CreditAccountData & {
636
- investor: Address;
637
- };
638
585
  export interface ICreditAccountsService extends Construct {
639
586
  sdk: GearboxSDK;
640
587
  /**
@@ -645,41 +592,15 @@ export interface ICreditAccountsService extends Construct {
645
592
  * @returns
646
593
  */
647
594
  getCreditAccountData(account: Address, blockNumber?: bigint): Promise<CreditAccountData | undefined>;
648
- /**
649
- * Returns credit account data for a single account with the investor address resolved (from KYC factory when applicable).
650
- * @param account - Credit account address
651
- * @param blockNumber - Optional block number for the read
652
- * @returns CreditAccountDataWithInvestor, or undefined if the account is not found
653
- */
654
- getCreditAccountDataWithInvestor(account: Address, blockNumber?: bigint): Promise<CreditAccountDataWithInvestor | undefined>;
655
595
  /**
656
596
  * Methods to get all credit accounts with some optional filtering
657
597
  * Performs all necessary price feed updates under the hood
658
598
  *
659
599
  * @param options
660
600
  * @param blockNumber
661
- * @param priceUpdate - Optional pre-computed price feed update (e.g. from generatePriceFeedsUpdateTxs)
662
- * @returns Credit accounts sorted by health factor ascending
601
+ * @returns returned credit accounts are sorted by health factor in ascending order
663
602
  */
664
603
  getCreditAccounts(options?: GetCreditAccountsOptions, blockNumber?: bigint): Promise<Array<CreditAccountData>>;
665
- /**
666
- * Returns all credit accounts matching the filter with investor set on each; when options.owner is set, includes KYC CAs for that owner.
667
- * @param options - Filter options (owner, creditManager, health factor, etc.)
668
- * @param blockNumber - Optional block number for the read
669
- * @returns Credit accounts (with investor) sorted by health factor ascending
670
- */
671
- getCreditAccountsWithInvestor(options?: GetCreditAccountsOptions, blockNumber?: bigint): Promise<Array<CreditAccountDataWithInvestor>>;
672
- /**
673
- * Loads credit account data for the given addresses using simulateWithPriceUpdates (with price updates applied before the read).
674
- * @param accounts - Credit account addresses to load
675
- * @param priceUpdateTxs - Price feed update txs to simulate before the read (e.g. from generatePriceFeedsUpdateTxs)
676
- * @param blockNumber - Optional block number for the read
677
- * @returns Array of CreditAccountData in the same order as accounts
678
- */
679
- loadSpecifiedAccounts(accounts: Address[], priceUpdateTxs: IPriceUpdateTx<{
680
- priceFeed: `0x${string}`;
681
- timestamp: number;
682
- }>[], blockNumber?: bigint): Promise<Array<CreditAccountData>>;
683
604
  /**
684
605
  * Method to get all claimable rewards for credit account (ex. stkUSDS SKY rewards).
685
606
  * Associates rewards by adapter + stakedPhantomToken.
@@ -708,9 +629,9 @@ export interface ICreditAccountsService extends Construct {
708
629
  /**
709
630
  * Generates transaction to liquidate credit account
710
631
  * @param props - {@link FullyLiquidateProps}
711
- * @returns Transaction data and optional loss policy data
632
+ * @returns
712
633
  */
713
- fullyLiquidate(props: FullyLiquidateProps): Promise<FullyLiquidateResult>;
634
+ fullyLiquidate(props: FullyLiquidateProps): Promise<CloseCreditAccountResult>;
714
635
  /**
715
636
  * Closes credit account or closes credit account and keeps it open with zero debt.
716
637
  * - Ca is closed in the following order: price update -> close path to swap all tokens into underlying ->
@@ -773,13 +694,6 @@ export interface ICreditAccountsService extends Construct {
773
694
  * @returns
774
695
  */
775
696
  claimDelayed(props: ClaimDelayedProps): Promise<CreditAccountOperationResult>;
776
- /**
777
- * Returns address to which approval should be given on collateral token
778
- * It's credit manager for classical markets and special wallet for KYC markets
779
- * @param props - {@link GetApprovalAddressProps}
780
- * @returns
781
- */
782
- getApprovalAddress(props: GetApprovalAddressProps): Promise<Address>;
783
697
  /**
784
698
  * Executes swap specified by given calls, update quotas of affected tokens
785
699
  * - Open credit account is executed in the following order: price update -> increase debt -> add collateral ->
@@ -813,7 +727,7 @@ export interface ICreditAccountsService extends Construct {
813
727
  getOnDemandPriceUpdates(account: CreditAccountTokensSlice, ignoreReservePrices?: boolean): Promise<PriceUpdate[]>;
814
728
  /**
815
729
  * Executes a multicall on a credit account, automatically prepending
816
- * necessary on-demand price feed updates inferred from the calls array.
730
+ * necessary on-demand price feed updates.
817
731
  *
818
732
  * @param creditAccount - Credit account to execute multicall on
819
733
  * @param calls - Array of multicall operations (price updates will be inferred)
@@ -825,7 +739,7 @@ export interface ICreditAccountsService extends Construct {
825
739
  }): Promise<RawTx>;
826
740
  /**
827
741
  * Executes a bot multicall on a credit account, automatically prepending
828
- * necessary on-demand price feed updates inferred from the calls array.
742
+ * necessary on-demand price feed updates.
829
743
  *
830
744
  * @param creditAccount - Credit account to execute bot multicall on
831
745
  * @param calls - Array of multicall operations (price updates will be inferred)
@@ -835,42 +749,6 @@ export interface ICreditAccountsService extends Construct {
835
749
  botMulticall(creditAccount: RouterCASlice, calls: Array<MultiCall>, options?: {
836
750
  ignoreReservePrices?: boolean;
837
751
  }): Promise<RawTx>;
838
- /**
839
- * Returns multicall entries to redeem (unwrap) KYC ERC-4626 vault shares into underlying for the given credit manager.
840
- * Used when withdrawing debt from a KYC market: redeems adapter vault shares so the underlying can be withdrawn.
841
- * Only applies when the credit manager's underlying is KYC-gated and has an ERC-4626 adapter configured.
842
- * @param amount - Number of vault shares (adapter tokens) to redeem
843
- * @param creditManager - Credit manager address
844
- * @returns Array of MultiCall to pass to credit facade multicall, or undefined if underlying is not KYC or no adapter is configured
845
- */
846
- getKYCUnwrapCalls(amount: bigint, creditManager: Address): Promise<Array<MultiCall> | undefined>;
847
- /**
848
- * Returns multicall entries to deposit (wrap) underlying into KYC ERC-4626 vault shares for the given credit manager.
849
- * Used when adding debt on a KYC market: deposits underlying into the adapter vault so shares are minted on the account.
850
- * Only applies when the credit manager's underlying is KYC-gated and has an ERC-4626 adapter configured.
851
- * @param amount - Amount of underlying assets to deposit into the vault (in underlying decimals)
852
- * @param creditManager - Credit manager address
853
- * @returns Array of MultiCall to pass to credit facade multicall, or undefined if underlying is not KYC or no adapter is configured
854
- */
855
- getKYCWrapCalls(amount: bigint, creditManager: Address): Promise<Array<MultiCall> | undefined>;
856
- /**
857
- * Returns multicall entries to call redeemDiff on the KYC ERC-4626 adapter for the given credit manager.
858
- * Redeems the leftover vault shares (e.g. after repaying debt) so the account does not hold excess KYC vault tokens.
859
- * Only applies when the credit manager's underlying is KYC-gated and has an ERC-4626 adapter configured.
860
- * @param amount - Leftover vault share amount to redeem (in adapter/vault decimals)
861
- * @param creditManager - Credit manager address
862
- * @returns Array of MultiCall to pass to credit facade multicall, or undefined if underlying is not KYC or no adapter is configured
863
- */
864
- getRedeemDiffCalls(amount: bigint, creditManager: Address): Promise<Array<MultiCall> | undefined>;
865
- /**
866
- * Returns multicall entries to call depositDiff on the KYC ERC-4626 adapter for the given credit manager.
867
- * Deposits the leftover underlying (e.g. after decreasing debt) into the vault so the account does not hold excess underlying.
868
- * Only applies when the credit manager's underlying is KYC-gated and has an ERC-4626 adapter configured.
869
- * @param amount - Leftover underlying amount to deposit into the vault (in underlying decimals)
870
- * @param creditManager - Credit manager address
871
- * @returns Array of MultiCall to pass to credit facade multicall, or undefined if underlying is not KYC or no adapter is configured
872
- */
873
- getDepositDiffCalls(amount: bigint, creditManager: Address): Promise<Array<MultiCall> | undefined>;
874
752
  /**
875
753
  * Withdraws a single collateral from credit account to wallet to and updates quotas;
876
754
  * technically can withdraw several tokens at once
@@ -903,7 +781,5 @@ export interface ICreditAccountsService extends Construct {
903
781
  * @return All necessary data to execute the transaction (call, credit facade)
904
782
  */
905
783
  claimFarmRewards(props: ClaimFarmRewardsProps): Promise<CreditAccountOperationResult>;
906
- previewWithdrawLlamathenaProportionally(props: PreviewWithdrawLlamathenaProportionallyProps): Promise<PreviewWithdrawLlamathenaProportionallyResult>;
907
- withdrawLlamathenaProportionally(props: LlamathenaProportionalWithdrawProps): Promise<CreditAccountOperationResult>;
908
784
  }
909
785
  export {};
@@ -2,7 +2,7 @@ import { type Address, type Chain, type PublicClient, type Transport } from "vie
2
2
  import type { Asset } from "../router/index.js";
3
3
  import type { ILogger } from "../types/logger.js";
4
4
  import { AddressMap } from "../utils/index.js";
5
- import { type DSTokenMeta, type KYCTokenMeta, type PhantomTokenMeta, type TokenMetaData } from "./token-types.js";
5
+ import type { PhantomTokenMeta, TokenMetaData } from "./token-types.js";
6
6
  /**
7
7
  * Options for {@link TokensMeta.formatBN}.
8
8
  **/
@@ -50,29 +50,11 @@ export declare class TokensMeta extends AddressMap<TokenMetaData> {
50
50
  * @returns
51
51
  */
52
52
  isPhantomToken(t: TokenMetaData): t is PhantomTokenMeta;
53
- /**
54
- * Returns true if the token is a KYC underlying token, throws if the token data is not loaded
55
- * @param t
56
- * @returns
57
- */
58
- isKYCUnderlying(t: TokenMetaData): t is KYCTokenMeta;
59
- /**
60
- * Returns true if the token is a DSToken, throws if the token data is not loaded
61
- * @param t
62
- * @returns
63
- */
64
- isDSToken(t: TokenMetaData): t is DSTokenMeta;
65
53
  /**
66
54
  * Returns a map of all phantom tokens
67
55
  * Throws if token data is not loaded
68
56
  */
69
57
  get phantomTokens(): AddressMap<PhantomTokenMeta>;
70
- /**
71
- * Returns a map of all KYC underlying tokens
72
- * Throws if token data is not loaded
73
- */
74
- get kycUnderlyings(): AddressMap<KYCTokenMeta>;
75
- get dsTokens(): AddressMap<DSTokenMeta>;
76
58
  /**
77
59
  * Formats a raw token amount into a human-readable decimal string,
78
60
  * dividing by `10^decimals` for the token.
@@ -102,7 +84,8 @@ export declare class TokensMeta extends AddressMap<TokenMetaData> {
102
84
  */
103
85
  mustFindBySymbol(symbol: string): TokenMetaData;
104
86
  /**
105
- * Loads token information about phantom tokens, KYC underlying tokens and DSTokens
87
+ * Loads token information about phantom tokens
88
+ * Other special tokens may be loaded here in the future
106
89
  *
107
90
  * @param tokens - tokens to load data for, defaults to all tokens
108
91
  */
@@ -1,10 +1,6 @@
1
- import type { Address } from "viem";
2
1
  import type { MarketData, Unarray } from "./types.js";
3
2
  type TokenData = Unarray<MarketData["tokens"]>;
4
3
  export declare const PHANTOM_TOKEN_CONTRACT_TYPES: readonly ["PHANTOM_TOKEN::CONVEX", "PHANTOM_TOKEN::INFINIFI_UNWIND", "PHANTOM_TOKEN::INFRARED", "PHANTOM_TOKEN::MELLOW_WITHDRAWAL", "PHANTOM_TOKEN::MIDAS_REDEMPTION", "PHANTOM_TOKEN::STAKING_REWARDS", "PHANTOM_TOKEN::UPSHIFT_WITHDRAW"];
5
- export declare const KYC_UNDERLYING_DEFAULT = "KYC_UNDERLYING::DEFAULT";
6
- export declare const KYC_UNDERLYING_ON_DEMAND = "KYC_UNDERLYING::ON_DEMAND";
7
- export type KYCUnderlyingContractType = typeof KYC_UNDERLYING_DEFAULT | typeof KYC_UNDERLYING_ON_DEMAND;
8
4
  export type PhantomTokenContractType = (typeof PHANTOM_TOKEN_CONTRACT_TYPES)[number];
9
5
  export type SimpleTokenMeta = TokenData & {
10
6
  isDSToken?: boolean;
@@ -13,21 +9,5 @@ export type SimpleTokenMeta = TokenData & {
13
9
  export type PhantomTokenMeta = SimpleTokenMeta & {
14
10
  contractType: PhantomTokenContractType;
15
11
  };
16
- export type KYCDefaultTokenMeta = SimpleTokenMeta & {
17
- contractType: typeof KYC_UNDERLYING_DEFAULT;
18
- kycFactory: Address;
19
- asset: Address;
20
- };
21
- export type KYCOnDemandTokenMeta = SimpleTokenMeta & {
22
- contractType: typeof KYC_UNDERLYING_ON_DEMAND;
23
- kycFactory: Address;
24
- asset: Address;
25
- pool: Address;
26
- liquidityProvider: Address;
27
- };
28
- export type DSTokenMeta = Omit<SimpleTokenMeta, "isDSToken"> & {
29
- isDSToken: true;
30
- };
31
- export type KYCTokenMeta = KYCDefaultTokenMeta | KYCOnDemandTokenMeta;
32
- export type TokenMetaData = SimpleTokenMeta | PhantomTokenMeta | KYCTokenMeta | DSTokenMeta;
12
+ export type TokenMetaData = SimpleTokenMeta | PhantomTokenMeta;
33
13
  export {};
@@ -102,6 +102,9 @@ export type CreditConfiguratorState = CreditSuiteState["creditConfigurator"];
102
102
  * Adapter contract data for a credit suite.
103
103
  **/
104
104
  export type AdapterData = Unarray<CreditSuiteState["adapters"]>;
105
+ /**
106
+ * On-chain state of a lending pool.
107
+ **/
105
108
  export type PoolState = MarketData["pool"];
106
109
  /**
107
110
  * On-chain state of a quota keeper.
@@ -4,7 +4,7 @@ import { z } from "zod/v4";
4
4
  * Known curator names that manage Gearbox markets.
5
5
  *
6
6
  **/
7
- export type Curator = "Chaos Labs" | "K3" | "cp0x" | "Re7" | "Invariant Group" | "Tulipa" | "M11 Credit" | "kpk" | "Hyperithm" | "UltraYield" | "TelosC" | "Gami Labs" | "Securitize";
7
+ export type Curator = "Chaos Labs" | "K3" | "cp0x" | "Re7" | "Invariant Group" | "Tulipa" | "M11 Credit" | "kpk" | "Hyperithm" | "UltraYield" | "TelosC" | "Gami Labs";
8
8
  /**
9
9
  * Extended viem {@link Chain} with Gearbox-specific metadata.
10
10
  *
@@ -8,3 +8,7 @@ export declare const ADDRESS_0X0: Address;
8
8
  * Dummy address to satisfy `0x${string}` typecheck, but fail on `isAddress` check
9
9
  */
10
10
  export declare const NOT_DEPLOYED = "0xNOT DEPLOYED";
11
+ /**
12
+ * Constant used in router to represent native token address
13
+ */
14
+ export declare const NATIVE_ADDRESS: Address;
@@ -8,7 +8,6 @@ import { type ILossPolicyContract } from "./loss-policy/index.js";
8
8
  import { MarketConfiguratorContract } from "./MarketConfiguratorContract.js";
9
9
  import type { IPriceOracleContract } from "./oracle/index.js";
10
10
  import { PoolSuite } from "./pool/index.js";
11
- import type { SecuritizeKYCFactory } from "./pool/SecuritizeKYCFactory.js";
12
11
  export declare class MarketSuite extends SDKConstruct {
13
12
  readonly acl: Address;
14
13
  readonly treasury: Address;
@@ -23,7 +22,6 @@ export declare class MarketSuite extends SDKConstruct {
23
22
  readonly state: MarketData;
24
23
  constructor(sdk: GearboxSDK, marketData: MarketData);
25
24
  get underlying(): Address;
26
- getKYCFactory(): Promise<SecuritizeKYCFactory | undefined>;
27
25
  get dirty(): boolean;
28
26
  get watchAddresses(): Set<Address>;
29
27
  stateHuman(raw?: boolean): MarketStateHuman;
@@ -6,7 +6,6 @@ import type { PoolSuiteStateHuman } from "../../types/index.js";
6
6
  import type { MarketConfiguratorContract } from "../MarketConfiguratorContract.js";
7
7
  import { GaugeContract } from "./GaugeContract.js";
8
8
  import { LinearInterestRateModelContract } from "./LinearInterestRateModelContract.js";
9
- import type { SecuritizeKYCFactory } from "./SecuritizeKYCFactory.js";
10
9
  import { TumblerContract } from "./TumblerContract.js";
11
10
  import type { IInterestRateModelContract, IRateKeeperContract, PoolContract, PoolQuotaKeeperContract } from "./types.js";
12
11
  export declare class PoolSuite extends SDKConstruct {
@@ -21,7 +20,6 @@ export declare class PoolSuite extends SDKConstruct {
21
20
  get linearModel(): LinearInterestRateModelContract;
22
21
  get marketConfigurator(): MarketConfiguratorContract;
23
22
  get underlying(): Address;
24
- getKYCFactory(): Promise<SecuritizeKYCFactory | undefined>;
25
23
  get dirty(): boolean;
26
24
  get watchAddresses(): Set<Address>;
27
25
  stateHuman(raw?: boolean): PoolSuiteStateHuman;
@@ -1,10 +1,8 @@
1
1
  import type { ContractEventName, DecodeFunctionDataReturnType, Log } from "viem";
2
- import type { CreditManagerDebtParams, PoolState } from "../../base/index.js";
2
+ import type { ConstructOptions, CreditManagerDebtParams, PoolState } from "../../base/index.js";
3
3
  import { BaseContract } from "../../base/index.js";
4
- import type { GearboxSDK } from "../../GearboxSDK.js";
5
4
  import type { PoolStateHuman } from "../../types/index.js";
6
5
  import { AddressMap } from "../../utils/index.js";
7
- import { SecuritizeKYCFactory } from "./SecuritizeKYCFactory.js";
8
6
  declare const abi: readonly [{
9
7
  readonly type: "function";
10
8
  readonly inputs: readonly [];
@@ -1132,10 +1130,8 @@ type abi = typeof abi;
1132
1130
  export interface PoolV310Contract extends Omit<PoolState, "baseParams" | "creditManagerDebtParams" | "name">, BaseContract<abi> {
1133
1131
  }
1134
1132
  export declare class PoolV310Contract extends BaseContract<abi> {
1135
- #private;
1136
1133
  readonly creditManagerDebtParams: AddressMap<CreditManagerDebtParams>;
1137
- constructor(sdk: GearboxSDK, data: PoolState);
1138
- getKYCFactory(): Promise<SecuritizeKYCFactory | undefined>;
1134
+ constructor(options: ConstructOptions, data: PoolState);
1139
1135
  stateHuman(raw?: boolean): PoolStateHuman;
1140
1136
  processLog(log: Log<bigint, number, false, undefined, undefined, abi, ContractEventName<abi>>): void;
1141
1137
  protected stringifyFunctionParams(params: DecodeFunctionDataReturnType<abi>): string[];
@@ -1,6 +1,4 @@
1
1
  export * from "./GaugeContract.js";
2
2
  export * from "./LinearInterestRateModelContract.js";
3
3
  export * from "./PoolSuite.js";
4
- export * from "./PoolV310Contract.js";
5
- export * from "./SecuritizeKYCFactory.js";
6
4
  export * from "./types.js";
@@ -5,6 +5,6 @@ import type { Unarray } from "../base/index.js";
5
5
  type CompressorZapperData = Unarray<AbiParametersToPrimitiveTypes<ExtractAbiFunction<typeof peripheryCompressorAbi, "getZappers">["outputs"]>>;
6
6
  export interface ZapperData extends CompressorZapperData {
7
7
  pool: Address;
8
- type: "migration" | "kyc" | "base";
8
+ type: "migration" | "base";
9
9
  }
10
10
  export {};
@@ -3,12 +3,36 @@ import { SDKConstruct } from "../base/index.js";
3
3
  import type { AddLiquidityProps, DepositMetadata, IPoolsService, PoolServiceCall, RemoveLiquidityProps, WithdrawalMetadata } from "./types.js";
4
4
  export declare class PoolService extends SDKConstruct implements IPoolsService {
5
5
  #private;
6
+ /**
7
+ * @inheritdoc IPoolsService.getDepositTokensIn
8
+ */
6
9
  getDepositTokensIn(pool: Address): Address[];
10
+ /**
11
+ * @inheritdoc IPoolsService.getDepositTokensOut
12
+ */
7
13
  getDepositTokensOut(pool: Address, tokenIn: Address): Address[];
14
+ /**
15
+ * @inheritdoc IPoolsService.getDepositMetadata
16
+ */
8
17
  getDepositMetadata(pool: Address, tokenIn: Address, tokenOut?: Address): DepositMetadata;
18
+ /**
19
+ * @inheritdoc IPoolsService.addLiquidity
20
+ */
9
21
  addLiquidity(props: AddLiquidityProps): PoolServiceCall | undefined;
22
+ /**
23
+ * @inheritdoc IPoolsService.getWithdrawalTokensIn
24
+ */
10
25
  getWithdrawalTokensIn(pool: Address): Address[];
26
+ /**
27
+ * @inheritdoc IPoolsService.getWithdrawalTokensOut
28
+ */
11
29
  getWithdrawalTokensOut(pool: Address, tokenIn: Address): Address[];
30
+ /**
31
+ * @inheritdoc IPoolsService.removeLiquidity
32
+ */
12
33
  removeLiquidity(props: RemoveLiquidityProps): PoolServiceCall;
34
+ /**
35
+ * @inheritdoc IPoolsService.getWithdrawalMetadata
36
+ */
13
37
  getWithdrawalMetadata(pool: Address, tokenIn: Address, tokenOut?: Address): WithdrawalMetadata;
14
38
  }
@@ -53,6 +53,7 @@ export interface RemoveLiquidityProps {
53
53
  permit: PermitResult | undefined;
54
54
  meta: WithdrawalMetadata;
55
55
  }
56
+ export type MarketType = "classic";
56
57
  export interface DepositMetadata {
57
58
  /**
58
59
  * Zapper that will perform the deposit, undefined in case of direct pool underlying deposit
@@ -61,7 +62,6 @@ export interface DepositMetadata {
61
62
  /**
62
63
  * Before deposit user will nedd to call approve method on token that he wants to deposit,
63
64
  * this is the spender address that will be used to call approve method.
64
- *
65
65
  */
66
66
  approveTarget: Address;
67
67
  /**
@@ -70,28 +70,29 @@ export interface DepositMetadata {
70
70
  permissible: boolean;
71
71
  /**
72
72
  * Type of deposit
73
+ * @default "classic"
73
74
  */
74
- type: "kyc-on-demand" | "kyc-default" | "classic";
75
+ type?: MarketType;
75
76
  }
76
77
  export interface WithdrawalMetadata {
77
78
  /**
78
- * Zapper that will perform the deposit, undefined in case of direct pool underlying deposit
79
+ * Zapper that will perform the withdrawal, undefined in case of direct pool underlying withdrawal
79
80
  */
80
81
  zapper?: ZapperData;
81
82
  /**
82
- * Before deposit user will nedd to call approve method on token that he wants to deposit,
83
+ * Before withdrawal user will need to call approve method on token that he wants to withdraw (diesel token),
83
84
  * this is the spender address that will be used to call approve method.
84
- *
85
85
  */
86
86
  approveTarget?: Address;
87
87
  /**
88
- * If true, user can avoid approval step and deposit with permit
88
+ * If true, user can avoid approval step and withdrawal with permit
89
89
  */
90
90
  permissible: boolean;
91
91
  /**
92
- * Type of deposit
92
+ * Type of withdrawal
93
+ * @default "classic"
93
94
  */
94
- type: "kyc-on-demand" | "kyc-default" | "classic";
95
+ type?: MarketType;
95
96
  }
96
97
  /**
97
98
  * Service interface for pool liquidity operations.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/sdk",
3
- "version": "13.5.0-next.1",
3
+ "version": "13.5.0-next.3",
4
4
  "description": "Gearbox SDK",
5
5
  "license": "MIT",
6
6
  "main": "./dist/cjs/sdk/index.js",