@gearbox-protocol/sdk 13.5.0-next.1 → 13.5.0-next.2
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.
- package/dist/cjs/dev/AccountOpener.js +5 -45
- package/dist/cjs/sdk/accounts/AbstractCreditAccountsService.js +6 -339
- package/dist/cjs/sdk/accounts/CreditAccountsServiceV310.js +1 -13
- package/dist/cjs/sdk/base/TokensMeta.js +7 -151
- package/dist/cjs/sdk/base/token-types.js +0 -6
- package/dist/cjs/sdk/chain/chains.js +1 -2
- package/dist/cjs/sdk/constants/addresses.js +3 -0
- package/dist/cjs/sdk/market/MarketRegister.js +0 -3
- package/dist/cjs/sdk/market/MarketSuite.js +0 -3
- package/dist/cjs/sdk/market/ZapperRegister.js +0 -4
- package/dist/cjs/sdk/market/pool/PoolSuite.js +0 -3
- package/dist/cjs/sdk/market/pool/PoolV310Contract.js +2 -17
- package/dist/cjs/sdk/market/pool/index.js +0 -4
- package/dist/cjs/sdk/pools/PoolService.js +43 -122
- package/dist/cjs/sdk/pools/constants.js +37 -0
- package/dist/esm/dev/AccountOpener.js +6 -47
- package/dist/esm/sdk/accounts/AbstractCreditAccountsService.js +6 -339
- package/dist/esm/sdk/accounts/CreditAccountsServiceV310.js +1 -13
- package/dist/esm/sdk/base/TokensMeta.js +7 -155
- package/dist/esm/sdk/base/token-types.js +0 -4
- package/dist/esm/sdk/chain/chains.js +1 -2
- package/dist/esm/sdk/constants/addresses.js +2 -0
- package/dist/esm/sdk/market/MarketRegister.js +0 -3
- package/dist/esm/sdk/market/MarketSuite.js +0 -3
- package/dist/esm/sdk/market/ZapperRegister.js +0 -4
- package/dist/esm/sdk/market/pool/PoolSuite.js +0 -3
- package/dist/esm/sdk/market/pool/PoolV310Contract.js +2 -17
- package/dist/esm/sdk/market/pool/index.js +0 -2
- package/dist/esm/sdk/pools/PoolService.js +32 -115
- package/dist/esm/sdk/pools/constants.js +13 -0
- package/dist/types/sdk/accounts/AbstractCreditAccountsService.d.ts +5 -103
- package/dist/types/sdk/accounts/CreditAccountsServiceV310.d.ts +2 -4
- package/dist/types/sdk/accounts/types.d.ts +6 -130
- package/dist/types/sdk/base/TokensMeta.d.ts +3 -20
- package/dist/types/sdk/base/token-types.d.ts +1 -21
- package/dist/types/sdk/base/types.d.ts +3 -0
- package/dist/types/sdk/chain/chains.d.ts +1 -1
- package/dist/types/sdk/constants/addresses.d.ts +4 -0
- package/dist/types/sdk/market/MarketSuite.d.ts +0 -2
- package/dist/types/sdk/market/pool/PoolSuite.d.ts +0 -2
- package/dist/types/sdk/market/pool/PoolV310Contract.d.ts +2 -6
- package/dist/types/sdk/market/pool/index.d.ts +0 -2
- package/dist/types/sdk/market/types.d.ts +1 -1
- package/dist/types/sdk/pools/PoolService.d.ts +24 -0
- package/dist/types/sdk/pools/constants.d.ts +7 -0
- package/dist/types/sdk/pools/types.d.ts +9 -8
- package/package.json +1 -1
- package/dist/cjs/abi/310/iSecuritizeDegenNFT.js +0 -263
- package/dist/cjs/abi/310/iSecuritizeKYCFactory.js +0 -278
- package/dist/cjs/sdk/market/pool/SecuritizeKYCFactory.js +0 -97
- package/dist/esm/abi/310/iSecuritizeDegenNFT.js +0 -239
- package/dist/esm/abi/310/iSecuritizeKYCFactory.js +0 -254
- package/dist/esm/sdk/market/pool/SecuritizeKYCFactory.js +0 -73
- package/dist/types/abi/310/iSecuritizeDegenNFT.d.ts +0 -324
- package/dist/types/abi/310/iSecuritizeKYCFactory.d.ts +0 -322
- package/dist/types/sdk/market/pool/SecuritizeKYCFactory.d.ts +0 -345
|
@@ -2,11 +2,11 @@ import type { Address } from "viem";
|
|
|
2
2
|
import type { CreditAccountData } from "../base/index.js";
|
|
3
3
|
import { SDKConstruct } from "../base/index.js";
|
|
4
4
|
import type { GearboxSDK } from "../GearboxSDK.js";
|
|
5
|
-
import type { CreditSuite
|
|
5
|
+
import type { CreditSuite } from "../market/index.js";
|
|
6
6
|
import { type PriceUpdate, type UpdatePriceFeedsResult } from "../market/index.js";
|
|
7
7
|
import { type Asset, type RouterCASlice } from "../router/index.js";
|
|
8
|
-
import type {
|
|
9
|
-
import type { AccountToCheck, AddCollateralProps, ChangeDeptProps, ClaimDelayedProps, CloseCreditAccountProps, CloseCreditAccountResult, CloseOptions,
|
|
8
|
+
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
10
|
/**
|
|
11
11
|
* Options for configuring the credit account service.
|
|
12
12
|
**/
|
|
@@ -33,42 +33,10 @@ export declare abstract class AbstractCreditAccountService extends SDKConstruct
|
|
|
33
33
|
* {@inheritDoc ICreditAccountsService.getCreditAccountData}
|
|
34
34
|
**/
|
|
35
35
|
getCreditAccountData(account: Address, blockNumber?: bigint): Promise<CreditAccountData | undefined>;
|
|
36
|
-
/**
|
|
37
|
-
* Returns credit account data for a single account with the investor address resolved.
|
|
38
|
-
* Loads CA via getCreditAccountData; for KYC underlyings fetches the investor from the KYC factory's getInvestor(creditAccount), otherwise uses the account owner.
|
|
39
|
-
* @param account - Credit account address
|
|
40
|
-
* @param blockNumber - Optional block number for the read
|
|
41
|
-
* @returns CreditAccountDataWithInvestor (CA data + investor address), or undefined if the account is not found
|
|
42
|
-
*/
|
|
43
|
-
getCreditAccountDataWithInvestor(account: Address, blockNumber?: bigint): Promise<CreditAccountDataWithInvestor | undefined>;
|
|
44
36
|
/**
|
|
45
37
|
* {@inheritDoc ICreditAccountsService.getCreditAccounts}
|
|
46
38
|
**/
|
|
47
39
|
getCreditAccounts(options?: GetCreditAccountsOptions, blockNumber?: bigint): Promise<Array<CreditAccountData>>;
|
|
48
|
-
/**
|
|
49
|
-
* Returns all credit accounts matching the filter, with investor set on each item.
|
|
50
|
-
* 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.
|
|
51
|
-
* @param options - Filter options (owner, creditManager, health factor, etc.)
|
|
52
|
-
* @param blockNumber - Optional block number for the read
|
|
53
|
-
* @returns Array of credit accounts (with investor field), sorted by health factor ascending
|
|
54
|
-
*/
|
|
55
|
-
getCreditAccountsWithInvestor(options?: GetCreditAccountsOptions, blockNumber?: bigint): Promise<Array<CreditAccountDataWithInvestor>>;
|
|
56
|
-
protected getKYCCreditAccountsOfOwner(owner: Address, priceUpdateTxs: IPriceUpdateTx<{
|
|
57
|
-
priceFeed: `0x${string}`;
|
|
58
|
-
timestamp: number;
|
|
59
|
-
}>[], blockNumber?: bigint): Promise<Array<CreditAccountDataWithInvestor>>;
|
|
60
|
-
/**
|
|
61
|
-
* Loads credit account data for the given addresses using simulateWithPriceUpdates.
|
|
62
|
-
* Applies the provided price update txs before reading, so returned data is consistent with up-to-date prices.
|
|
63
|
-
* @param accounts - Credit account addresses to load
|
|
64
|
-
* @param priceUpdateTxs - Price feed update txs to simulate before the read (e.g. from generatePriceFeedsUpdateTxs)
|
|
65
|
-
* @param blockNumber - Optional block number for the read
|
|
66
|
-
* @returns Array of CreditAccountData in the same order as accounts (throws if any getCreditAccountData call reverts)
|
|
67
|
-
*/
|
|
68
|
-
loadSpecifiedAccounts(accounts: Address[], priceUpdateTxs: IPriceUpdateTx<{
|
|
69
|
-
priceFeed: `0x${string}`;
|
|
70
|
-
timestamp: number;
|
|
71
|
-
}>[], blockNumber?: bigint): Promise<Array<CreditAccountData>>;
|
|
72
40
|
/**
|
|
73
41
|
* {@inheritDoc ICreditAccountsService.getRewards}
|
|
74
42
|
**/
|
|
@@ -81,8 +49,6 @@ export declare abstract class AbstractCreditAccountService extends SDKConstruct
|
|
|
81
49
|
legacyMigration: GetConnectedMigrationBotsResult;
|
|
82
50
|
additionalBots: Array<Omit<NonNullable<GetConnectedMigrationBotsResult>, "botAddress">>;
|
|
83
51
|
}>;
|
|
84
|
-
private getActiveBots;
|
|
85
|
-
private getActiveMigrationBots;
|
|
86
52
|
/**
|
|
87
53
|
* {@inheritDoc ICreditAccountsService.fullyLiquidate}
|
|
88
54
|
**/
|
|
@@ -123,13 +89,6 @@ export declare abstract class AbstractCreditAccountService extends SDKConstruct
|
|
|
123
89
|
* {@inheritDoc ICreditAccountsService.claimDelayed}
|
|
124
90
|
**/
|
|
125
91
|
claimDelayed({ creditAccount, minQuota, averageQuota, claimableNow, }: ClaimDelayedProps): Promise<CreditAccountOperationResult>;
|
|
126
|
-
/**
|
|
127
|
-
* Returns address to which approval should be given on collateral token
|
|
128
|
-
* It's credit manager for classical markets and special wallet for KYC markets
|
|
129
|
-
* @param options - {@link GetApprovalAddressProps}
|
|
130
|
-
* @returns
|
|
131
|
-
**/
|
|
132
|
-
getApprovalAddress(options: GetApprovalAddressProps): Promise<Address>;
|
|
133
92
|
/**
|
|
134
93
|
* {@inheritDoc ICreditAccountsService.openCA}
|
|
135
94
|
**/
|
|
@@ -143,43 +102,6 @@ export declare abstract class AbstractCreditAccountService extends SDKConstruct
|
|
|
143
102
|
**/
|
|
144
103
|
getOptimalHFForPartialLiquidation(ca: CreditAccountData): bigint;
|
|
145
104
|
/**
|
|
146
|
-
* Returns multicall entries to redeem (unwrap) KYC ERC-4626 vault shares into underlying for the given credit manager.
|
|
147
|
-
* Used when withdrawing debt from a KYC market: redeems adapter vault shares so the underlying can be withdrawn.
|
|
148
|
-
* Only applies when the credit manager's underlying is KYC-gated and has an ERC-4626 adapter configured.
|
|
149
|
-
* @param amount - Number of vault shares (adapter tokens) to redeem
|
|
150
|
-
* @param creditManager - Credit manager address
|
|
151
|
-
* @returns Array of MultiCall to pass to credit facade multicall, or undefined if underlying is not KYC or no adapter is configured
|
|
152
|
-
*/
|
|
153
|
-
getKYCUnwrapCalls(amount: bigint, creditManager: Address): Promise<Array<MultiCall> | undefined>;
|
|
154
|
-
/**
|
|
155
|
-
* Returns multicall entries to deposit (wrap) underlying into KYC ERC-4626 vault shares for the given credit manager.
|
|
156
|
-
* Used when adding debt on a KYC market: deposits underlying into the adapter vault so shares are minted on the account.
|
|
157
|
-
* Only applies when the credit manager's underlying is KYC-gated and has an ERC-4626 adapter configured.
|
|
158
|
-
* @param amount - Amount of underlying assets to deposit into the vault (in underlying decimals)
|
|
159
|
-
* @param creditManager - Credit manager address
|
|
160
|
-
* @returns Array of MultiCall to pass to credit facade multicall, or undefined if underlying is not KYC or no adapter is configured
|
|
161
|
-
*/
|
|
162
|
-
getKYCWrapCalls(amount: bigint, creditManager: Address): Promise<Array<MultiCall> | undefined>;
|
|
163
|
-
/**
|
|
164
|
-
* Returns multicall entries to call redeemDiff on the KYC ERC-4626 adapter for the given credit manager.
|
|
165
|
-
* Redeems the leftover vault shares (e.g. after repaying debt) so the account does not hold excess KYC vault tokens.
|
|
166
|
-
* Only applies when the credit manager's underlying is KYC-gated and has an ERC-4626 adapter configured.
|
|
167
|
-
* @param amount - Leftover vault share amount to redeem (in adapter/vault decimals)
|
|
168
|
-
* @param creditManager - Credit manager address
|
|
169
|
-
* @returns Array of MultiCall to pass to credit facade multicall, or undefined if underlying is not KYC or no adapter is configured
|
|
170
|
-
*/
|
|
171
|
-
getRedeemDiffCalls(amount: bigint, creditManager: Address): Promise<Array<MultiCall> | undefined>;
|
|
172
|
-
/**
|
|
173
|
-
* Returns multicall entries to call depositDiff on the KYC ERC-4626 adapter for the given credit manager.
|
|
174
|
-
* Deposits the leftover underlying (e.g. after decreasing debt) into the vault so the account does not hold excess underlying.
|
|
175
|
-
* Only applies when the credit manager's underlying is KYC-gated and has an ERC-4626 adapter configured.
|
|
176
|
-
* @param amount - Leftover underlying amount to deposit into the vault (in underlying decimals)
|
|
177
|
-
* @param creditManager - Credit manager address
|
|
178
|
-
* @returns Array of MultiCall to pass to credit facade multicall, or undefined if underlying is not KYC or no adapter is configured
|
|
179
|
-
*/
|
|
180
|
-
getDepositDiffCalls(amount: bigint, creditManager: Address): Promise<Array<MultiCall> | undefined>;
|
|
181
|
-
/**
|
|
182
|
-
* Returns raw txs that are needed to update all price feeds so that all credit accounts (possibly from different markets) compute
|
|
183
105
|
* {@inheritDoc ICreditAccountsService.getOnDemandPriceUpdates}
|
|
184
106
|
**/
|
|
185
107
|
getOnDemandPriceUpdates(account: CreditAccountTokensSlice, ignoreReservePrices?: boolean): Promise<PriceUpdate[]>;
|
|
@@ -200,25 +122,13 @@ export declare abstract class AbstractCreditAccountService extends SDKConstruct
|
|
|
200
122
|
}): Promise<MultiCall[]>;
|
|
201
123
|
protected getUpdateForAccount(account: CreditAccountTokensSlice, ignoreReservePrices?: boolean): Promise<UpdatePriceFeedsResult>;
|
|
202
124
|
/**
|
|
203
|
-
*
|
|
204
|
-
* necessary on-demand price feed updates.
|
|
205
|
-
*
|
|
206
|
-
* @param creditAccount - Credit account to execute multicall on
|
|
207
|
-
* @param calls - Array of multicall operations (price updates will be inferred)
|
|
208
|
-
* @param options - Optional settings for price update generation
|
|
209
|
-
* @returns Raw transaction ready to be signed and sent
|
|
125
|
+
* {@inheritDoc ICreditAccountsService.multicall}
|
|
210
126
|
*/
|
|
211
127
|
multicall(creditAccount: RouterCASlice, calls: MultiCall[], options?: {
|
|
212
128
|
ignoreReservePrices?: boolean;
|
|
213
129
|
}): Promise<RawTx>;
|
|
214
130
|
/**
|
|
215
|
-
*
|
|
216
|
-
* necessary on-demand price feed updates.
|
|
217
|
-
*
|
|
218
|
-
* @param creditAccount - Credit account to execute bot multicall on
|
|
219
|
-
* @param calls - Array of multicall operations (price updates will be inferred)
|
|
220
|
-
* @param options - Optional settings for price update generation
|
|
221
|
-
* @returns Raw transaction ready to be signed and sent
|
|
131
|
+
* {@inheritDoc ICreditAccountsService.botMulticall}
|
|
222
132
|
*/
|
|
223
133
|
botMulticall(creditAccount: RouterCASlice, calls: MultiCall[], options?: {
|
|
224
134
|
ignoreReservePrices?: boolean;
|
|
@@ -260,12 +170,4 @@ export declare abstract class AbstractCreditAccountService extends SDKConstruct
|
|
|
260
170
|
* @returns
|
|
261
171
|
*/
|
|
262
172
|
protected closeCreditAccountTx(suite: CreditSuite, creditAccount: Address, calls: MultiCall[], operation: CloseOptions): Promise<RawTx>;
|
|
263
|
-
/**
|
|
264
|
-
* Returns all KYC credit account addresses for an investor across the given market suites.
|
|
265
|
-
* Resolves KYC factory per suite, then multicalls each factory's getCreditAccounts(investor).
|
|
266
|
-
* @param investor - Owner address to query
|
|
267
|
-
* @param suites - Market suites (KYC factories are resolved for each; undefined entries are skipped)
|
|
268
|
-
* @returns Flat array of credit account addresses from all KYC markets
|
|
269
|
-
*/
|
|
270
|
-
protected getKYCCaOfInvestor(investor: Address, suites: Array<MarketSuite | undefined>): Promise<`0x${string}`[]>;
|
|
271
173
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AbstractCreditAccountService } from "./AbstractCreditAccountsService.js";
|
|
2
|
-
import type { ClaimFarmRewardsProps, CreditAccountOperationResult, CreditManagerOperationResult, ICreditAccountsService,
|
|
2
|
+
import type { ClaimFarmRewardsProps, CreditAccountOperationResult, CreditManagerOperationResult, ICreditAccountsService, RepayAndLiquidateCreditAccountProps, RepayCreditAccountProps, SetBotProps, WithdrawCollateralProps } from "./types.js";
|
|
3
3
|
/**
|
|
4
4
|
* Service for querying and operating on Gearbox credit accounts.
|
|
5
5
|
*
|
|
@@ -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,
|
|
24
|
+
repayCreditAccount({ operation, collateralAssets, assetsToWithdraw, creditAccount: ca, permits, to, tokensToClaim, }: RepayCreditAccountProps): Promise<CreditAccountOperationResult>;
|
|
25
25
|
/**
|
|
26
26
|
* {@inheritDoc ICreditAccountsService.repayAndLiquidateCreditAccount}
|
|
27
27
|
*/
|
|
@@ -30,6 +30,4 @@ export declare class CreditAccountServiceV310 extends AbstractCreditAccountServi
|
|
|
30
30
|
* {@inheritDoc ICreditAccountsService.claimFarmRewards}
|
|
31
31
|
*/
|
|
32
32
|
claimFarmRewards({ calls: externalCalls, creditAccount: ca, minQuota, averageQuota, tokensToClaim, }: ClaimFarmRewardsProps): Promise<CreditAccountOperationResult>;
|
|
33
|
-
previewWithdrawLlamathenaProportionally(_: PreviewWithdrawLlamathenaProportionallyProps): Promise<PreviewWithdrawLlamathenaProportionallyResult>;
|
|
34
|
-
withdrawLlamathenaProportionally(_: LlamathenaProportionalWithdrawProps): Promise<CreditAccountOperationResult>;
|
|
35
33
|
}
|
|
@@ -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 {
|
|
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
|
-
* @
|
|
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
|
|
632
|
+
* @returns
|
|
712
633
|
*/
|
|
713
|
-
fullyLiquidate(props: FullyLiquidateProps): Promise<
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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"
|
|
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(
|
|
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[];
|
|
@@ -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" | "
|
|
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
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AddressMap } from "../utils/index.js";
|
|
2
|
+
/**
|
|
3
|
+
* TODO: is it still needed after v3.0 deprecation?
|
|
4
|
+
* This map is used to filter out zappers with tokenIn === v2 diesel tokens
|
|
5
|
+
* such zappers are returned by compressor but useless for v3 pools on deposit step
|
|
6
|
+
*/
|
|
7
|
+
export declare const POOL_TOKENS_TO_MIGRATE: AddressMap<string>;
|