@gearbox-protocol/sdk 17.9.0 → 17.10.1-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/dev/AccountOpener.js +3 -3
- package/dist/cjs/onchain/accounts/index.js +2 -0
- package/dist/cjs/onchain/accounts/intents/guards.js +4 -2
- package/dist/cjs/onchain/accounts/intents/index.js +41 -7
- package/dist/cjs/onchain/accounts/intents/math.js +3 -44
- package/dist/cjs/onchain/accounts/intents/maxBorrow.js +7 -1
- package/dist/cjs/onchain/accounts/intents/open-strategy.js +12 -7
- package/dist/cjs/onchain/accounts/intents/plan.js +4 -4
- package/dist/cjs/onchain/accounts/intents/realize.js +11 -5
- package/dist/cjs/onchain/accounts/intents/strategyLimits.js +159 -0
- package/dist/cjs/onchain/accounts/intents/tail.js +5 -1
- package/dist/cjs/onchain/accounts/intents/testing/market.js +5 -1
- package/dist/cjs/onchain/accounts/intents/testing/sdk-mock.js +5 -0
- package/dist/cjs/onchain/accounts/intents/utils/index.js +2 -0
- package/dist/cjs/onchain/accounts/intents/utils/quotas-for-update.js +69 -0
- package/dist/cjs/onchain/accounts/quota-utils.js +15 -0
- package/dist/cjs/onchain/chain/chains.js +12 -0
- package/dist/cjs/onchain/chain/index.js +1 -0
- package/dist/cjs/onchain/index.js +3 -0
- package/dist/cjs/onchain/market/oracle/PriceOracleBaseContract.js +8 -6
- package/dist/cjs/onchain/validation/checks/checkBorrowLimit.js +2 -3
- package/dist/cjs/onchain/validation/checks/checkDebtLimits.js +3 -4
- package/dist/cjs/onchain/validation/checks/checkQuotaLimit.js +2 -1
- package/dist/esm/dev/AccountOpener.js +2 -2
- package/dist/esm/dev/withdrawalUtils.js +1 -1
- package/dist/esm/history/trace/extractTransfers.js +1 -1
- package/dist/esm/onchain/accounts/CreditAccountsServiceV310.js +2 -2
- package/dist/esm/onchain/accounts/index.js +2 -2
- package/dist/esm/onchain/accounts/intents/guards.js +4 -2
- package/dist/esm/onchain/accounts/intents/index.js +41 -7
- package/dist/esm/onchain/accounts/intents/math.js +5 -45
- package/dist/esm/onchain/accounts/intents/maxBorrow.js +7 -1
- package/dist/esm/onchain/accounts/intents/open-strategy.js +13 -8
- package/dist/esm/onchain/accounts/intents/plan.js +4 -4
- package/dist/esm/onchain/accounts/intents/realize.js +12 -6
- package/dist/esm/onchain/accounts/intents/strategyLimits.js +158 -0
- package/dist/esm/onchain/accounts/intents/tail.js +5 -1
- package/dist/esm/onchain/accounts/intents/testing/market.js +5 -1
- package/dist/esm/onchain/accounts/intents/testing/sdk-mock.js +5 -0
- package/dist/esm/onchain/accounts/intents/utils/index.js +2 -2
- package/dist/esm/onchain/accounts/intents/utils/quotas-for-update.js +70 -3
- package/dist/esm/onchain/accounts/liquidations/LiquidationsService.js +1 -1
- package/dist/esm/onchain/accounts/quota-utils.js +14 -1
- package/dist/esm/onchain/accounts/withdrawal-compressor/RedemptionLoggerV310Contract.js +1 -1
- package/dist/esm/onchain/accounts/withdrawal-compressor/WithdrawalCompressorV310Contract.js +1 -1
- package/dist/esm/onchain/accounts/withdrawal-compressor/WithdrawalCompressorV311Contract.js +1 -1
- package/dist/esm/onchain/accounts/withdrawal-compressor/WithdrawalCompressorV313Contract.js +1 -1
- package/dist/esm/onchain/base/TokensMeta.js +3 -3
- package/dist/esm/onchain/chain/chains.js +12 -1
- package/dist/esm/onchain/chain/index.js +2 -2
- package/dist/esm/onchain/core/createAddressProvider.js +1 -1
- package/dist/esm/onchain/index.js +3 -3
- package/dist/esm/onchain/market/adapters/contracts/AccountMigratorAdapterContract.js +1 -1
- package/dist/esm/onchain/market/adapters/contracts/ERC4626AdapterContract.js +1 -1
- package/dist/esm/onchain/market/credit/CreditFacadeV310BaseContract.js +1 -1
- package/dist/esm/onchain/market/oracle/PriceOracleBaseContract.js +8 -6
- package/dist/esm/onchain/market/pool/PoolV310Contract.js +1 -1
- package/dist/esm/onchain/market/rwa/createDegenNFT.js +1 -1
- package/dist/esm/onchain/market/zapper/IETHZapperContract.js +1 -1
- package/dist/esm/onchain/market/zapper/ZapperContract.js +1 -1
- package/dist/esm/onchain/preview/preview/previewPoolPositionOperation.js +2 -2
- package/dist/esm/onchain/utils/viem/simulateWithPriceUpdates.js +1 -1
- package/dist/esm/onchain/validation/checks/checkBorrowLimit.js +2 -3
- package/dist/esm/onchain/validation/checks/checkDebtLimits.js +3 -4
- package/dist/esm/onchain/validation/checks/checkQuotaLimit.js +2 -1
- package/dist/types/model/errors/index.d.ts +2 -2
- package/dist/types/model/errors/liquidation-errors.d.ts +4 -0
- package/dist/types/model/errors/operation-errors.d.ts +38 -14
- package/dist/types/model/errors/oracle-errors.d.ts +2 -0
- package/dist/types/model/index.d.ts +2 -2
- package/dist/types/onchain/accounts/index.d.ts +2 -2
- package/dist/types/onchain/accounts/intents/guards.d.ts +12 -12
- package/dist/types/onchain/accounts/intents/math.d.ts +7 -16
- package/dist/types/onchain/accounts/intents/plan.d.ts +2 -0
- package/dist/types/onchain/accounts/intents/realize.d.ts +3 -0
- package/dist/types/onchain/accounts/intents/strategyLimits.d.ts +33 -0
- package/dist/types/onchain/accounts/intents/tail.d.ts +13 -9
- package/dist/types/onchain/accounts/intents/testing/market.d.ts +4 -0
- package/dist/types/onchain/accounts/intents/utils/index.d.ts +2 -2
- package/dist/types/onchain/accounts/intents/utils/quotas-for-update.d.ts +21 -1
- package/dist/types/onchain/accounts/quota-utils.d.ts +16 -1
- package/dist/types/onchain/chain/chains.d.ts +15 -1
- package/dist/types/onchain/chain/index.d.ts +2 -2
- package/dist/types/onchain/index.d.ts +3 -3
- package/dist/types/onchain/market/oracle/PriceOracleBaseContract.d.ts +0 -3
- package/dist/types/onchain/market/oracle/types.d.ts +4 -3
- package/dist/types/onchain/validation/checks/checkBorrowLimit.d.ts +2 -3
- package/dist/types/onchain/validation/checks/checkDebtLimits.d.ts +2 -3
- package/dist/types/onchain/validation/checks/checkQuotaLimit.d.ts +2 -2
- package/package.json +1 -1
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { OperationLimitOptions } from "../../../model/errors/operation-errors.js";
|
|
2
|
+
import "../../../model/index.js";
|
|
1
3
|
import { MultiCall } from "../../types/transactions.js";
|
|
2
4
|
import { OnchainSDK } from "../../OnchainSDK.js";
|
|
3
5
|
import { AccountCalculatorOperation } from "./operations.js";
|
|
@@ -7,6 +9,7 @@ import { Step } from "./plan.js";
|
|
|
7
9
|
import { RouterPaths } from "./utils/router-path.js";
|
|
8
10
|
//#region src/onchain/accounts/intents/realize.d.ts
|
|
9
11
|
interface RealizeProps {
|
|
12
|
+
limits?: OperationLimitOptions;
|
|
10
13
|
creditAccount: CreditAccountSlice;
|
|
11
14
|
sdk: OnchainSDK;
|
|
12
15
|
/** Router slippage in PERCENTAGE_FORMAT (100% = 10_000). */
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { OperationLimitOptions } from "../../../model/errors/operation-errors.js";
|
|
2
|
+
import "../../../model/index.js";
|
|
3
|
+
import { Asset } from "../../base/types.js";
|
|
4
|
+
import { CreditSuite } from "../../market/credit/CreditSuite.js";
|
|
5
|
+
import "../../base/index.js";
|
|
6
|
+
import { AdjustLeverageIntent, CreditAccountSlice, DepositStrategyIntent } from "./types.js";
|
|
7
|
+
import { AccountView } from "./plan.js";
|
|
8
|
+
import { Address } from "viem";
|
|
9
|
+
//#region src/onchain/accounts/intents/strategyLimits.d.ts
|
|
10
|
+
interface BaseLimitsProps {
|
|
11
|
+
suite: CreditSuite;
|
|
12
|
+
quotaReserve: number | undefined;
|
|
13
|
+
}
|
|
14
|
+
interface OpenLimitsProps extends BaseLimitsProps {
|
|
15
|
+
type: "OPEN";
|
|
16
|
+
collateral: readonly Asset[];
|
|
17
|
+
leverage: bigint;
|
|
18
|
+
targetToken: Address;
|
|
19
|
+
}
|
|
20
|
+
interface AccountLimitsProps extends BaseLimitsProps {
|
|
21
|
+
view: AccountView;
|
|
22
|
+
initialQuotas: CreditAccountSlice["tokens"];
|
|
23
|
+
}
|
|
24
|
+
interface DepositLimitsProps extends AccountLimitsProps, DepositStrategyIntent {}
|
|
25
|
+
interface LeverageLimitsProps extends AccountLimitsProps, AdjustLeverageIntent {
|
|
26
|
+
/** Additional ceiling imposed by the selected delayed route. */
|
|
27
|
+
maxLeverage?: bigint;
|
|
28
|
+
}
|
|
29
|
+
type StrategyLimitsProps = OpenLimitsProps | DepositLimitsProps | LeverageLimitsProps;
|
|
30
|
+
/** Independent input bounds supplied to debt, liquidity and quota errors. */
|
|
31
|
+
declare function strategyLimits(props: StrategyLimitsProps): OperationLimitOptions;
|
|
32
|
+
//#endregion
|
|
33
|
+
export { strategyLimits };
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { OperationLimitOptions } from "../../../model/errors/operation-errors.js";
|
|
2
|
+
import "../../../model/index.js";
|
|
1
3
|
import { ClaimableWithdrawal } from "../withdrawal-compressor/types.js";
|
|
2
4
|
import { OnchainSDK } from "../../OnchainSDK.js";
|
|
3
5
|
import { AccountCalculatorOperation, StartDelayedWithdrawalOperation } from "./operations.js";
|
|
@@ -28,6 +30,16 @@ declare function planTail(args: {
|
|
|
28
30
|
claimable: ClaimableWithdrawal;
|
|
29
31
|
view: AccountView;
|
|
30
32
|
}): TailPlan;
|
|
33
|
+
interface ProjectTailProps {
|
|
34
|
+
/** The request as realised: the source spent, the phantom it produced. */
|
|
35
|
+
request: StartDelayedWithdrawalOperation;
|
|
36
|
+
delayed: DelayedStart;
|
|
37
|
+
/** The account the request was previewed against, for masks and market. */
|
|
38
|
+
creditAccount: CreditAccountSlice;
|
|
39
|
+
sdk: OnchainSDK;
|
|
40
|
+
quotaReserve: number | undefined;
|
|
41
|
+
limits?: OperationLimitOptions;
|
|
42
|
+
}
|
|
31
43
|
/**
|
|
32
44
|
* Where a delayed intent ends up, worked out at the moment it is started.
|
|
33
45
|
*
|
|
@@ -46,15 +58,7 @@ declare function planTail(args: {
|
|
|
46
58
|
* that would strand the account is refused before it is sent rather than
|
|
47
59
|
* discovered days later.
|
|
48
60
|
*/
|
|
49
|
-
declare function projectTail(args: {
|
|
50
|
-
/** The request as realised: the source spent, the phantom it produced. */
|
|
51
|
-
request: StartDelayedWithdrawalOperation;
|
|
52
|
-
delayed: DelayedStart;
|
|
53
|
-
/** The account the request was previewed against, for masks and market. */
|
|
54
|
-
creditAccount: CreditAccountSlice;
|
|
55
|
-
sdk: OnchainSDK;
|
|
56
|
-
quotaReserve: number | undefined;
|
|
57
|
-
}): Promise<{
|
|
61
|
+
declare function projectTail(args: ProjectTailProps): Promise<{
|
|
58
62
|
state: OperationState;
|
|
59
63
|
operations: AccountCalculatorOperation[];
|
|
60
64
|
}>;
|
|
@@ -50,6 +50,8 @@ interface MarketSdkExtras {
|
|
|
50
50
|
reservePrices?: Record<Address, bigint>;
|
|
51
51
|
/** Additional / overriding token decimals. */
|
|
52
52
|
extraDecimals?: Record<Address, number>;
|
|
53
|
+
/** Additional / overriding liquidation thresholds. */
|
|
54
|
+
extraLiquidationThresholds?: Record<Address, number>;
|
|
53
55
|
/** Tokens the registry should report as phantoms. */
|
|
54
56
|
phantoms?: Address[];
|
|
55
57
|
/** Facade `minDebt`; 0n when omitted. */
|
|
@@ -60,6 +62,8 @@ interface MarketSdkExtras {
|
|
|
60
62
|
delayed?: Record<Address, MockDelayedVenue[]>;
|
|
61
63
|
/** Quota params replacing the fixture's, e.g. a token with no room left. */
|
|
62
64
|
quotas?: Record<Address, MockQuotaEntry>;
|
|
65
|
+
/** Credit manager's enabled token cap; the mock's default when omitted. */
|
|
66
|
+
maxEnabledTokens?: number;
|
|
63
67
|
/** Facade pause flag. */
|
|
64
68
|
facadePaused?: boolean;
|
|
65
69
|
/** Pool pause flag, which pauses the suite with it. */
|
|
@@ -7,5 +7,5 @@ import { assembleOperationCalls } from "./assemble-operation-calls.js";
|
|
|
7
7
|
import { calcBorrowedAmountPlusInterestAndFees } from "./borrowed-amount-plus-interest-and-fees.js";
|
|
8
8
|
import { eq, resolveCreditManager, toRouterCaSlice, toTargetDecimals } from "./common.js";
|
|
9
9
|
import { LedgerSnapshot, OperationLedger } from "./ledger.js";
|
|
10
|
-
import { clearedQuotas, getQuotasForUpdate, quotasAfterUpdate } from "./quotas-for-update.js";
|
|
11
|
-
export { CandidateToken, LedgerSnapshot, LegProbe, OpenStrategyLeg, OperationLedger, RouterPaths, SwapLeg, adjustStateToSnapshot, assembleOperationCalls, calcBorrowedAmountPlusInterestAndFees, clearedQuotas, collectPriceImpact, createOraclePaths, createRouterPaths, eq, fetchCreditAccountSlice, getQuotasForUpdate, isPhantomToken, isRedemptionPhantomToken, lossRate, pickFattestNonPhantomToken, quotasAfterUpdate, rankAccountTokens, resolveCreditManager, startProbe, toCreditAccountSlice, toRouterCaSlice, toTargetDecimals, unopenedAccountSlice };
|
|
10
|
+
import { clearedQuotas, getQuotasForUpdate, quotaIncreaseLimit, quotasAfterUpdate, withDirectTransferQuota } from "./quotas-for-update.js";
|
|
11
|
+
export { CandidateToken, LedgerSnapshot, LegProbe, OpenStrategyLeg, OperationLedger, RouterPaths, SwapLeg, adjustStateToSnapshot, assembleOperationCalls, calcBorrowedAmountPlusInterestAndFees, clearedQuotas, collectPriceImpact, createOraclePaths, createRouterPaths, eq, fetchCreditAccountSlice, getQuotasForUpdate, isPhantomToken, isRedemptionPhantomToken, lossRate, pickFattestNonPhantomToken, quotaIncreaseLimit, quotasAfterUpdate, rankAccountTokens, resolveCreditManager, startProbe, toCreditAccountSlice, toRouterCaSlice, toTargetDecimals, unopenedAccountSlice, withDirectTransferQuota };
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
+
import { UnpriceableTokenError } from "../../../../model/errors/oracle-errors.js";
|
|
2
|
+
import { SafeValue } from "../../../../model/result.js";
|
|
3
|
+
import "../../../../model/index.js";
|
|
1
4
|
import { AddressMap } from "../../../utils/AddressMap.js";
|
|
2
5
|
import { Asset } from "../../../base/types.js";
|
|
3
6
|
import { ConvertFn } from "../../../market/oracle/types.js";
|
|
7
|
+
import { CreditSuite } from "../../../market/credit/CreditSuite.js";
|
|
4
8
|
import { QuotaUpdateState } from "../operations.js";
|
|
5
9
|
import "../../../index.js";
|
|
6
10
|
import { Address } from "viem";
|
|
@@ -29,6 +33,14 @@ interface GetQuotasForUpdateProps {
|
|
|
29
33
|
maxDebt: bigint;
|
|
30
34
|
convert: ConvertFn;
|
|
31
35
|
}
|
|
36
|
+
interface QuotaIncreaseLimitProps {
|
|
37
|
+
suite: CreditSuite;
|
|
38
|
+
token: Address;
|
|
39
|
+
balance: bigint;
|
|
40
|
+
initialQuotas: readonly InitialQuota[];
|
|
41
|
+
quotaReserve?: number;
|
|
42
|
+
rwaAsset?: Address;
|
|
43
|
+
}
|
|
32
44
|
declare function getQuotasForUpdate({ assetsBefore, assetsAfter, initialQuotas, quotaReserve, liquidationThresholds: liquidationThresholdsMap, quotas: quotasMap, maxDebt, underlyingToken, convert }: GetQuotasForUpdateProps): QuotaUpdateState;
|
|
33
45
|
/**
|
|
34
46
|
* The update that leaves the account holding no quota at all.
|
|
@@ -42,6 +54,12 @@ declare function getQuotasForUpdate({ assetsBefore, assetsAfter, initialQuotas,
|
|
|
42
54
|
* "all of it" instead of naming an amount that interest may have moved.
|
|
43
55
|
*/
|
|
44
56
|
declare function clearedQuotas(initialQuotas: Array<InitialQuota> | readonly InitialQuota[]): QuotaUpdateState;
|
|
57
|
+
/**
|
|
58
|
+
* Raises `directTransfer`'s quota to at least {@link DIRECT_TRANSFERS_QUOTA};
|
|
59
|
+
* skips a token absent from the credit manager, one the pool can't quote, or
|
|
60
|
+
* one the account has no free enabled token slot for.
|
|
61
|
+
*/
|
|
62
|
+
declare function withDirectTransferQuota(update: QuotaUpdateState, directTransfer: Address | undefined, initialQuotas: Array<InitialQuota> | readonly InitialQuota[], quotas: AddressMap<Quota>, maxEnabledTokens: number, collateralTokens: readonly Address[]): QuotaUpdateState;
|
|
45
63
|
/**
|
|
46
64
|
* The quotas the account stands at once an update lands: the ones it came with,
|
|
47
65
|
* with the ones the update names written over them.
|
|
@@ -52,5 +70,7 @@ declare function clearedQuotas(initialQuotas: Array<InitialQuota> | readonly Ini
|
|
|
52
70
|
* are dropped: a token with no quota is a token the account is not quoted for.
|
|
53
71
|
*/
|
|
54
72
|
declare function quotasAfterUpdate(initialQuotas: Array<InitialQuota> | readonly InitialQuota[], desiredQuota: Record<Address, Asset>): Record<Address, Asset>;
|
|
73
|
+
/** Largest additional underlying amount whose purchase fits this token's quota. */
|
|
74
|
+
declare function quotaIncreaseLimit({ suite, token, balance, initialQuotas, quotaReserve, rwaAsset }: QuotaIncreaseLimitProps): SafeValue<bigint | undefined, UnpriceableTokenError>;
|
|
55
75
|
//#endregion
|
|
56
|
-
export { clearedQuotas, getQuotasForUpdate, quotasAfterUpdate };
|
|
76
|
+
export { clearedQuotas, getQuotasForUpdate, quotaIncreaseLimit, quotasAfterUpdate, withDirectTransferQuota };
|
|
@@ -13,6 +13,14 @@ interface CalcRecommendedQuotaProps {
|
|
|
13
13
|
lt: bigint;
|
|
14
14
|
quotaReserve: bigint;
|
|
15
15
|
}
|
|
16
|
+
interface MaxAmountForQuotaProps {
|
|
17
|
+
available: bigint;
|
|
18
|
+
initialQuota: bigint;
|
|
19
|
+
totalInitialQuota: bigint;
|
|
20
|
+
maxDebt: bigint;
|
|
21
|
+
lt: bigint;
|
|
22
|
+
quotaReserve: bigint;
|
|
23
|
+
}
|
|
16
24
|
interface CalcQuotaUpdateProps {
|
|
17
25
|
quotas: Record<Address, QuotaSlice | undefined>;
|
|
18
26
|
initialQuotas: Record<Address, {
|
|
@@ -34,6 +42,11 @@ interface CalcQuotaUpdateReturnType {
|
|
|
34
42
|
quotaIncrease: Array<Asset>;
|
|
35
43
|
quotaDecrease: Array<Asset>;
|
|
36
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* Quota that keeps a directly transferred token enabled, so a liquidation
|
|
47
|
+
* counts it.
|
|
48
|
+
*/
|
|
49
|
+
declare const DIRECT_TRANSFERS_QUOTA = 10000n;
|
|
37
50
|
/**
|
|
38
51
|
* Rounds quota deltas to protocol precision step (`PERCENTAGE_FACTOR`).
|
|
39
52
|
*
|
|
@@ -64,6 +77,8 @@ declare function calcRecommendedQuota({ amount, debt, lt, quotaReserve }: CalcRe
|
|
|
64
77
|
* @returns Default rounded quota.
|
|
65
78
|
*/
|
|
66
79
|
declare function calcDefaultQuota({ amount, lt, quotaReserve }: CalcDefaultQuotaProps): bigint;
|
|
80
|
+
/** Inverse of default quota rounding, including the account-wide increase cap. */
|
|
81
|
+
declare function maxAmountForQuota({ available, initialQuota, totalInitialQuota, maxDebt, lt, quotaReserve }: MaxAmountForQuotaProps): bigint | undefined;
|
|
67
82
|
/**
|
|
68
83
|
* Produces desired quota state and explicit increase/decrease actions.
|
|
69
84
|
*
|
|
@@ -80,4 +95,4 @@ declare function calcDefaultQuota({ amount, lt, quotaReserve }: CalcDefaultQuota
|
|
|
80
95
|
*/
|
|
81
96
|
declare function calcQuotaUpdate(props: CalcQuotaUpdateProps): CalcQuotaUpdateReturnType;
|
|
82
97
|
//#endregion
|
|
83
|
-
export { CalcDefaultQuotaProps, CalcQuotaUpdateProps, CalcRecommendedQuotaProps, calcDefaultQuota, calcQuotaUpdate, calcRecommendedQuota, roundUpQuota };
|
|
98
|
+
export { CalcDefaultQuotaProps, CalcQuotaUpdateProps, CalcRecommendedQuotaProps, DIRECT_TRANSFERS_QUOTA, MaxAmountForQuotaProps, calcDefaultQuota, calcQuotaUpdate, calcRecommendedQuota, maxAmountForQuota, roundUpQuota };
|
|
@@ -44,6 +44,12 @@ interface GearboxChain extends Chain {
|
|
|
44
44
|
* accepts one of them as collateral is reported as an RWA opportunity.
|
|
45
45
|
**/
|
|
46
46
|
rwaTokens?: AddressSet;
|
|
47
|
+
/**
|
|
48
|
+
* Collateral whose sale pays part of the proceeds later, as a direct
|
|
49
|
+
* transfer of another token to the credit account. Maps collateral → the
|
|
50
|
+
* token transferred.
|
|
51
|
+
**/
|
|
52
|
+
directTransfers?: AddressMap<Address>;
|
|
47
53
|
/**
|
|
48
54
|
* Pools being wound down. Curated, and unrelated to any on-chain flag.
|
|
49
55
|
**/
|
|
@@ -210,6 +216,14 @@ declare function isSunsetPool(pool: Address, network: NetworkType): boolean;
|
|
|
210
216
|
* @param network - Network the credit manager lives on.
|
|
211
217
|
**/
|
|
212
218
|
declare function isSunsetStrategy(creditManager: Address, network: NetworkType): boolean;
|
|
219
|
+
/**
|
|
220
|
+
* Token a collateral's sale later transfers directly to the credit account,
|
|
221
|
+
* or `undefined` when the collateral is not in the table.
|
|
222
|
+
*
|
|
223
|
+
* @param collateral - Collateral token address.
|
|
224
|
+
* @param network - Chain id or {@link NetworkType} label.
|
|
225
|
+
**/
|
|
226
|
+
declare function getDirectTransferToken(collateral: Address, network: number | bigint | NetworkType): Address | undefined;
|
|
213
227
|
/**
|
|
214
228
|
* Hardcoded target collateral of a legacy credit manager, or `undefined` when
|
|
215
229
|
* the manager is not in the table and the on-chain rule should apply.
|
|
@@ -228,4 +242,4 @@ declare function getLegacyStrategyTarget(creditManager: Address, network: number
|
|
|
228
242
|
**/
|
|
229
243
|
declare function getAccountTargetCollateral(creditAccount: Address, network: number | bigint | NetworkType): Address | undefined;
|
|
230
244
|
//#endregion
|
|
231
|
-
export { GearboxChain, NetworkType, SUPPORTED_NETWORKS, chains, findCuratorMarketConfigurator, getAccountTargetCollateral, getAssetType, getChain, getCuratorName, getLegacyStrategyTarget, getNetworkType, isPublicNetwork, isRWAToken, isSunsetPool, isSunsetStrategy, isSupportedNetwork, toChainIds };
|
|
245
|
+
export { GearboxChain, NetworkType, SUPPORTED_NETWORKS, chains, findCuratorMarketConfigurator, getAccountTargetCollateral, getAssetType, getChain, getCuratorName, getDirectTransferToken, getLegacyStrategyTarget, getNetworkType, isPublicNetwork, isRWAToken, isSunsetPool, isSunsetStrategy, isSupportedNetwork, toChainIds };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { GearboxChain, NetworkType, SUPPORTED_NETWORKS, chains, findCuratorMarketConfigurator, getAccountTargetCollateral, getAssetType, getChain, getCuratorName, getLegacyStrategyTarget, getNetworkType, isPublicNetwork, isRWAToken, isSunsetPool, isSunsetStrategy, isSupportedNetwork, toChainIds } from "./chains.js";
|
|
1
|
+
import { GearboxChain, NetworkType, SUPPORTED_NETWORKS, chains, findCuratorMarketConfigurator, getAccountTargetCollateral, getAssetType, getChain, getCuratorName, getDirectTransferToken, getLegacyStrategyTarget, getNetworkType, isPublicNetwork, isRWAToken, isSunsetPool, isSunsetStrategy, isSupportedNetwork, toChainIds } from "./chains.js";
|
|
2
2
|
import { detectNetwork } from "./detectNetwork.js";
|
|
3
|
-
export { GearboxChain, NetworkType, SUPPORTED_NETWORKS, chains, detectNetwork, findCuratorMarketConfigurator, getAccountTargetCollateral, getAssetType, getChain, getCuratorName, getLegacyStrategyTarget, getNetworkType, isPublicNetwork, isRWAToken, isSunsetPool, isSunsetStrategy, isSupportedNetwork, toChainIds };
|
|
3
|
+
export { GearboxChain, NetworkType, SUPPORTED_NETWORKS, chains, detectNetwork, findCuratorMarketConfigurator, getAccountTargetCollateral, getAssetType, getChain, getCuratorName, getDirectTransferToken, getLegacyStrategyTarget, getNetworkType, isPublicNetwork, isRWAToken, isSunsetPool, isSunsetStrategy, isSupportedNetwork, toChainIds };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ILogger, LogFn } from "./types/logger.js";
|
|
2
2
|
import { AddressMap } from "./utils/AddressMap.js";
|
|
3
3
|
import { AddressSet } from "./utils/AddressSet.js";
|
|
4
|
-
import { GearboxChain, NetworkType, SUPPORTED_NETWORKS, chains, findCuratorMarketConfigurator, getAccountTargetCollateral, getAssetType, getChain, getCuratorName, getLegacyStrategyTarget, getNetworkType, isPublicNetwork, isRWAToken, isSunsetPool, isSunsetStrategy, isSupportedNetwork, toChainIds } from "./chain/chains.js";
|
|
4
|
+
import { GearboxChain, NetworkType, SUPPORTED_NETWORKS, chains, findCuratorMarketConfigurator, getAccountTargetCollateral, getAssetType, getChain, getCuratorName, getDirectTransferToken, getLegacyStrategyTarget, getNetworkType, isPublicNetwork, isRWAToken, isSunsetPool, isSunsetStrategy, isSupportedNetwork, toChainIds } from "./chain/chains.js";
|
|
5
5
|
import { BlockNumberProps, MultichainChainIdsProps, MultichainNetworkProps, WithBlock, WithMultichain } from "./types/multichain.js";
|
|
6
6
|
import { generateCastTraceCall, getCastTraceArgs } from "./utils/viem/cast.js";
|
|
7
7
|
import { DelegatedMulticall, executeDelegatedMulticalls } from "./utils/viem/executeDelegatedMulticalls.js";
|
|
@@ -260,7 +260,7 @@ import { AccountBotsService } from "./accounts/bots/AccountBotsService.js";
|
|
|
260
260
|
import { PeripheryCompressorV310Contract } from "./accounts/bots/PeripheryCompressorV310Contract.js";
|
|
261
261
|
import { CreditAccountsServiceV310 } from "./accounts/CreditAccountsServiceV310.js";
|
|
262
262
|
import { IntentValidationError, raise } from "./validation/raise.js";
|
|
263
|
-
import { CalcDefaultQuotaProps, CalcQuotaUpdateProps, CalcRecommendedQuotaProps, calcDefaultQuota, calcQuotaUpdate, calcRecommendedQuota, roundUpQuota } from "./accounts/quota-utils.js";
|
|
263
|
+
import { CalcDefaultQuotaProps, CalcQuotaUpdateProps, CalcRecommendedQuotaProps, DIRECT_TRANSFERS_QUOTA, MaxAmountForQuotaProps, calcDefaultQuota, calcQuotaUpdate, calcRecommendedQuota, maxAmountForQuota, roundUpQuota } from "./accounts/quota-utils.js";
|
|
264
264
|
import { AccountCalculatorOperation } from "./accounts/intents/operations.js";
|
|
265
265
|
import { AddCollateralIntent, AdjustLeverageIntent, ClaimRemainder, CreditAccountSlice, DelayableIntent, DelayedRoute, DelayedStart, DelayedStartResult, DepositStrategyIntent, ExecutionCost, FinishIntentProps, FinishIntentResult, InstantRoute, IntentPreviewResult, IntentRoutesResult, OperationState, PathLossRate, RefusedIntent, RepayStrategyIntent, ResumableIntent, RouteErrors, StartIntent, WithPartialState, WithdrawAssetIntent, WithdrawCeilings, WithdrawStrategyIntent } from "./accounts/intents/types.js";
|
|
266
266
|
import { BorrowProps, BorrowState } from "./accounts/intents/borrow.js";
|
|
@@ -339,4 +339,4 @@ import { amountOf } from "./validation/helpers/amount.js";
|
|
|
339
339
|
import { MIN_HEALTH_FACTOR_FACADE, MIN_HEALTH_FACTOR_FORM, MIN_HF_LIMITED, MIN_SAFE_HEALTH_FACTOR_FORM } from "./validation/helpers/health-factor-limits.js";
|
|
340
340
|
import { toToken, toTokenAmount } from "./validation/helpers/token.js";
|
|
341
341
|
import "./validation/index.js";
|
|
342
|
-
export { ADDRESS_0X0, ADDRESS_PROVIDER_V310, AP_ACCOUNT_FACTORY, AP_ACL, AP_BOT_LIST, AP_BYTECODE_REPOSITORY, AP_CONTRACTS_REGISTER, AP_CONTROLLER_TIMELOCK, AP_CREDIT_ACCOUNT_COMPRESSOR, AP_CREDIT_SUITE_COMPRESSOR, AP_DATA_COMPRESSOR, AP_DELEVERAGE_BOT_HV, AP_DELEVERAGE_BOT_LV, AP_DELEVERAGE_BOT_PEGGED, AP_GAUGE_COMPRESSOR, AP_GEAR_STAKING, AP_GEAR_TOKEN, AP_INFLATION_ATTACK_BLOCKER, AP_INSOLVENCY_CHECKER, AP_MARKET_COMPRESSOR, AP_MARKET_CONFIGURATOR, AP_PARTIAL_LIQUIDATION_BOT, AP_PERIPHERY_COMPRESSOR, AP_PRICE_FEED_COMPRESSOR, AP_PRICE_FEED_STORE, AP_PRICE_ORACLE, AP_REDEMPTION_LOGGER, AP_REWARDS_COMPRESSOR, AP_ROUTER, AP_TOKEN_COMPRESSOR, AP_TREASURY, AP_WETH_GATEWAY, AP_WETH_TOKEN, AP_ZAPPER_REGISTER, AP_ZERO_PRICE_FEED, AbstractAdapterContract, AbstractAdapterContractOptions, AbstractLPPriceFeedContract, AbstractPriceFeedContract, AbstractWithdrawalCompressorContract, AccountBotsService, type AccountCalculatorOperation, AccountMigratorAdapterContract, AccountSnapshot, AccountToCheck, AdapterContractStateHuman, AdapterContractType, AdapterData, AdapterFactoryArgs, AdapterOperation, AdapterOperationBase, AdapterProtocolOperation, AdapterType, type AddCollateralIntent, AddCollateralOp, AddLiquidityProps, AddressMap, AddressProviderAddresses, AddressProviderState, AddressProviderV310Contract, type AddressProviderV3StateHuman, AddressSet, type AdjustLeverageIntent, type AliasLossPolicyStateHuman, AssembleCaOperationsProps, AssembleClaimDelayedCallsProps, AssembleCloseCreditAccountCallsProps, AssembleRepayCreditAccountCallsProps, AssembleStartDelayedWithdrawalCallsProps, AssertAssignable, Asset, type AssetPriceFeedStateHuman, AssetWithAmountInTarget, AssetsMap, AttachOptions, BLOCKS_PER_WEEK_BY_NETWORK, BalanceDelta, BalancerStablePriceFeedContract, BalancerSwap, BalancerV3Pool, BalancerV3PoolStatus, BalancerV3RouterAdapterContract, BalancerV3WrapperAdapterContract, BalancerWeightedPriceFeedContract, type BalancerWeightedPriceFeedStateHuman, BaseContract, BaseContractArgs, type BaseContractStateHuman, BaseParams, BasePlugin, type BasePriceFeedStateHuman, BaseState, BasicSwapCall, BigIntMath, type BlockNumberProps, BorrowLimitArgs, BorrowPreviewResult, type BorrowProps, type BorrowState, type BotListStateHuman, BotPermissions, BotStatusCall, BotsDirectResponse, type BoundedOracleStateHuman, BoundedPriceFeedContract, BuildLiquidationTxProps, BuildLiquidationTxPropsBase, CMSlice, CalcBorrowRateProps, CalcDefaultQuotaProps, CalcHealthFactorProps, CalcLiquidationPriceForTargetProps, CalcLiquidationPriceProps, CalcQuotaUpdateProps, CalcRecommendedQuotaProps, CallTrace, CamelotPool, CamelotV3AdapterContract, ChainBlock, ChainBlockPin, ChainBlockSource, ChainConfig, ChainContractsRegister, ChainNotConfiguredError, ChainQueryOneProps, ChainQueryProps, CheckCollateralFundingInput, CheckLiquidationEligibilityInput, CheckLiquidationFundingInput, CheckLiquidationInput, CheckLiquidationOptions, CheckMidasAccountGreenlistInput, CheckOperationInput, CheckOperationOptions, CheckPoolFundingInput, CheckRWAOpenRequirementsInput, CheckRWAOpeningInput, CheckSimulationInput, CheckWalletAllowanceInput, CheckWalletBalanceInput, CheckWalletInput, ClaimFarmRewardsProps, type ClaimRemainder, ClaimableWithdrawal, ClassifyInnerOperationsProps, ClientOptions, CloseCreditAccountOperation, CloseCreditAccountResult, CloseOrRepayOperation, ClosePathBalances, CollateralFundingPreview, CollateralisedArgs, CompareBalancesOp, CompositePriceFeedContract, CompressorZapperData, ConcreteAdapterContractOptions, ConnectedBotData, ConnectedBotsCall, ConnectedBotsPerAccount, type ConstantOracleStateHuman, ConstantPriceFeedContract, Construct, ConstructOptions, type ContractMethod, ContractOrInterface, ContractParseError, ContractParseErrorOptions, ConvertFn, ConvexDeposit, ConvexDepositAndStake, ConvexStake, ConvexV1BaseRewardPoolAdapterContract, ConvexV1BoosterAdapterContract, ConvexWithdraw, ConvexWithdrawAndClaim, type CoreStateHuman, CreditAccountCompressor, CreditAccountCompressorV310Contract, CreditAccountData, CreditAccountDataCall, CreditAccountDataPayload, CreditAccountFilter, CreditAccountFrozenArgs, CreditAccountOperation, CreditAccountOperationResult, CreditAccountOperationsService, CreditAccountReadOptions, type CreditAccountSlice, CreditAccountState, CreditAccountStateProps, CreditAccountTokenQuota, CreditAccountTokensSlice, CreditAccountsCall, CreditAccountsQuery, CreditAccountsReadOptions, CreditAccountsServiceV310, CreditAccountsTarget, CreditConfiguratorState, type CreditConfiguratorStateHuman, CreditConfiguratorV310Contract, CreditFacadeState, type CreditFacadeStateHuman, type abi as CreditFacadeV310Abi, abi as creditFacadeV310Abi, CreditFacadeV310BaseContract, CreditFacadeV310Contract, CreditManagerDebtParams, type CreditManagerDebtParamsHuman, CreditManagerFilter, CreditManagerOperationResult, CreditManagerPausedArgs, CreditManagerState, type CreditManagerStateHuman, CreditManagerV310Contract, CreditOperationArgs, CreditOperationError, CreditOperationPreview, CreditSimulationInput, CreditSuite, CreditSuiteState, type CreditSuiteStateHuman, CreditSuiteStrategy, CurrentWithdrawals, Curve2AssetsAdapterContract, Curve3AssetsAdapterContract, Curve4AssetsAdapterContract, CurveAddLiquidity, CurveClaims, CurveCryptoPriceFeedContract, CurveExchange, CurveRemoveLiquidity, CurveRemoveLiquidityOneCoin, CurveStablePriceFeedContract, CurveUSDPriceFeedContract, CurveV1AdapterStETHContract, CurveV1StableNGAdapterContract, CurveWithdrawal, DEFAULT_QUOTA_BUFFER_BPS, DEGEN_NFT_MIDAS, DEGEN_NFT_SECURITIZE, DELAYED_INTENT_TYPES, DELAYED_INTENT_VERSION, DStokenData, DUST_THRESHOLD, DaiUsdsAdapterContract, DebtLimitsArgs, DecreaseDebtOp, type DelayableIntent, DelayedIntentExtended, type DelayedRoute, type DelayedStart, type DelayedStartResult, DelayedWithdrawalClaim, DelayedWithdrawalRequest, DelegatedMulticall, DepositMetadata, type DepositStrategyIntent, DetectedDelayedClaim, DetectedDelayedOperation, DirectTokenTransferOperation, ERC4626AdapterContract, ERC4626ReferralAdapterContract, EXECUTE_BYTES_SELECTOR, EmergencyLiquidatorArgs, EmptyAccountPreviewResult, EncodableCreditAccountOperation, Erc4626PriceFeedContract, EstimateRawTxGasParameters, EtherscanURLParam, ExecuteMulticallBatchesOptions, type ExecutionCost, ExpectedBalanceDeltasProps, ExpectedOutput, ExternalPriceFeedContract, FacadeOperationMetadata, FilterDustUSDOptions, FindBestClosePathProps, FindClaimAllRewardsProps, FindManyToOnePathProps, FindOneTokenPathProps, FindOpenStrategyPathProps, type FinishIntentProps, type FinishIntentResult, FluidDexAdapterContract, ForbiddenTokenArgs, FormatBNOptions, FullyLiquidateProps, FullyLiquidateResult, GaugeContract, GaugeData, GaugeParams, type GaugeParamsHuman, type GaugeStateHuman, type GearStakingV3StateHuman, GearboxChain, type GearboxState, type GearboxStateHuman, GetApprovalAddressProps, GetConnectedBotsResponse, GetConnectedBotsResult, GetConnectedMigrationBotsResult, GetCreditAccountsArgs, GetCreditAccountsOptions, GetCurrentWithdrawalsProps, GetCurrentWithdrawalsPropsBase, GetExternalAccountCurrentWithdrawalsProps, GetInvestorOptions, GetLiquidatableAccountsProps, GetLiquidationDetailsProps, GetLiquidationDetailsPropsBase, GetLiquidationPositionsProps, GetLiquidationPositionsPropsBase, GetOpenAccountRequirementsProps, GetReward, GetWithdrawalRequestResultProps, HealthFactorThresholds, HydrateOptions, IAdapterContract, IAddressProviderContract, IBaseContract, ICreditAccountsService, ICreditConfiguratorContract, ICreditFacadeContract, ICreditManagerContract, IDegenNFT, IERC20ZapperContract, IETHZapperContract, IInterestRateModelContract, type ILogger, IMultichainOpportunitiesService, IMultichainPositionsService, IOnchainSDKPlugin, IOnchainSDKPluginConstructor, IPluginState, IPoolContract, IPoolsService, IPriceFeedContract, IPriceOracleContract, type IPriceUpdateTask, type IPriceUpdateTx, type IPriceUpdater, IRWAFactory, IRateKeeperContract, IRedemptionLoggerContract, IRouterContract, type IUpdatablePriceFeedContract, IWithdrawalCompressorContract, IZapperContract, IncreaseDebtOp, InfinifiGatewayAdapterContract, InfinifiUnwindingGatewayAdapterContract, InnerFacadeOperation, InnerOperation, type InstantRoute, type IntentPreviewResult, type IntentRoutesResult, type IntentValidationError, type InterestRateModelStateHuman, InterestRateModelType, IsDustOptions, KelpLRTDepositPoolAdapterContract, KelpLRTWithdrawalManagerAdapterContract, LEVERAGE_DECIMALS, LIQUIDATION_APPROVAL_BUFFER, LIQUIDATION_COMPRESSOR_V313_ADDRESS, LPMonopolizedPoolMeta, type LPPriceFeedStateHuman, type LatestUpdate, LegacyAdapterOperation, LeverageArgs, type LeverageBand, LidoSubmit, LidoV1AdapterContract, LinearInterestRateModelContract, type LinearInterestRateModelStateHuman, LiquidateCreditAccountOperation, LiquidationEligibilityError, LiquidationFees, LiquidationValidationError, LiquidationsService, LiquidatorEligibleArgs, ListPoolPositionsProps, ListPositionsProps, ListPositionsPropsBase, ListStrategyPositionsProps, LoadRWALiquidatorsProps, type LogFn, type LossPolicyStateHuman, MAX_INT, MAX_LEVERAGE_BUFFER_BPS, MAX_UINT16, MAX_UINT256, MIN_HEALTH_FACTOR_FACADE, MIN_HEALTH_FACTOR_FORM, MIN_HF_LIMITED, MIN_INT96, MIN_SAFE_HEALTH_FACTOR_FORM, MULTICALL_ADDRESS, MakerDeposit, MakerRedeem, MarketData, MarketExpiredArgs, MarketFilter, MarketRegister, MarketRegistryState, MarketRegistryStateHuman, MarketStateError, type MarketStateHuman, MarketSuite, MarketType, MaxBorrowAmount, MellowClaimerAdapterContract, MellowDVVAdapterContract, MellowERC4626VaultAdapterContract, MellowLRTPriceFeedContract, MellowWrapperAdapterContract, Methods, MidasDegenNFT, MidasGatewayAdapterContract, MidasIssuanceVaultAdapterContract, MidasLiquidatorContract, MidasRedemptionVaultAdapterContract, MissingSerializedParamsError, type MultiCall, MulticallBatch, MulticallOperation, MulticallWithFailure, MultichainAttachOptions, type MultichainChainIdsProps, MultichainConstruct, MultichainHydrateOptions, MultichainLiquidationsService, type MultichainNetworkProps, MultichainOpportunitiesService, MultichainPositionsService, MultichainSDK, MultichainSDKOptions, type MultichainState, type MultichainStateHuman, MultichainSyncStateOptions, NATIVE_ADDRESS, NON_STRATEGY_PHANTOM_TOKEN_TYPES, NOT_DEPLOYED, NO_VERSION, NetworkType, OnchainLiquidationCall, OnchainLiquidationData, OnchainLiquidationOutput, OnchainRequestableWithdrawal, OnchainSDK, OnchainSDKOptions, OpenCAProps, OpenCreditAccountOperation, OpenStrategyPreviewResult, type OpenStrategyProps, OpenStrategyResult, type OpenStrategyState, Operation, OperationMetadata, type OperationState, OperationValidationError, OpportunitiesService, OptimalRepaidAmountProps, OuterFacadeOperation, PARTIAL_LIQUIDATION_BUFFER_BPS, PERCENTAGE_DECIMALS, PERCENTAGE_FACTOR, PERCENTAGE_FACTOR_1KK, PERIPHERY_CONTRACTS, PHANTOM_TOKEN_CONTRACT_TYPES, PHANTOM_TOKEN_MIDAS_REDEMPTION, PHANTOM_TOKEN_SECURITIZE_REDEMPTION, PRICE_DECIMALS, PRICE_DECIMALS_POW, ParsedCall, ParsedCallArgs, ParsedCallV2, ParsedZapperDeposit, ParsedZapperOperation, ParsedZapperRedeem, PartialLiquidationOperation, PartialLiquidationParams, PartialPriceFeedInitError, PartialPriceFeedTreeNode, PartialRecord, PartiallyLiquidateProps, type PathLossRate, PendingWithdrawal, PendlePair, PendlePairStatus, PendleRouterAdapterContract, PendleTWAPPTPriceFeed, PendleTokenType, PeripheryCompressorV310Contract, PeripheryContract, PermitResult, PhantomTokenContractType, PhantomTokenMeta, PickSomeRequired, PluginFactoriesMap, PluginFactory, PluginState, PluginStateVersionError, PluginStatesMap, PluginsMap, PoolDepositOperation, PoolLiquidityArgs, PoolMintOperation, PoolOperation, PoolOperationArgs, PoolOperationError, PoolPausedArgs, PoolQuotaKeeperContract, type PoolQuotaKeeperStateHuman, PoolRedeemOperation, PoolService, PoolServiceCall, PoolServiceCallResult, PoolSimulation, PoolState, type PoolStateHuman, PoolSuite, type PoolSuiteStateHuman, PoolSunsetArgs, PoolV310Contract, PoolWithdrawOperation, PositionsService, PrepareUpdateQuotasProps, PreviewDelayedWithdrawalProps, PreviewOperationError, PriceFeedAnswer, PriceFeedConstructorArgs, PriceFeedContractType, PriceFeedMapEntry, PriceFeedRef, PriceFeedRegistry, type PriceFeedStateHuman, PriceFeedTreeNode, PriceFeedUsageType, PriceFeedsForAccountOptions, PriceFeedsForTokensOptions, PriceOracleData, type PriceOracleStateHuman, PriceOracleV310Contract, PriceUpdate, PriceUpdatesCache, ProjectedPoolOptions, PythPriceFeed, QuotaCountArgs, QuotaKeeperState, QuotaLimitArgs, QuotaMode, type QuotaParamsHuman, QuotaSlice, QuotaState, RAMP_DURATION_BY_NETWORK, RAY, RAY_DECIMALS_POW, RWACompressorCall, RWACompressorInvestorData, RWACompressorResponse, RWADefaultTokenMeta, RWAFactoryData, RWAFactoryProtocol, RWAFactoryStateHuman, RWAInvestorData, RWALiquidatorInfo, RWAMulticallOperation, RWAOnDemandLPMeta, RWAOnDemandLPMonopolizedMeta, RWAOnDemandLpContractType, RWAOnDemandTokenMeta, RWAOpenCreditAccountOperation, RWAOpeningError, RWAOperation, RWAOperationMetadata, RWARegistry, RWAState, RWAStateHuman, RWATokenMeta, RWAUnderlyingContractType, RWAUnderlyingData, RWA_COMPRESSOR_ADDRESS, RWA_LIQUIDATOR_MIDAS, RWA_LIQUIDATOR_SECURITIZE, RWA_ON_DEMAND_LP_MONOPOLIZED, RWA_UNDERLYING_DEFAULT, RWA_UNDERLYING_ON_DEMAND, RampEvent, RateKeeperState, type RateKeeperStateHuman, RateKeeperType, type RawTx, RedemptionLog, RedemptionLoggerV310Contract, RedemptionPhantomRename, RedstonePriceFeedContract, type RedstonePriceFeedStateHuman, type RefusedIntent, RelaxedBaseParams, RemoveLiquidityProps, type RepayStrategyIntent, ReplayMulticallResult, ReplayState, ReplayableOperation, RequestableWithdrawal, ReservePriceLimitedArgs, type ResumableIntent, RetryOptions, RewardInfo, Rewards, type RouteErrors, RouterCASlice, RouterCMSlice, RouterCloseResult, RouterResult, RouterRewardsResult, RouterV310Contract, SDKConstruct, SDKOptions, SECONDS_PER_YEAR, SLIPPAGE_DECIMALS, STATE_VERSION, SUPPORTED_NETWORKS, SdkAlreadyAttachedError, SdkChainMismatchError, SdkMissingChainStateError, SdkNotAttachedError, SdkRWADataNotLoadedError, SdkStateVersionMismatchError, SdkSyncFailedError, SecuritizeCreditAccountData, SecuritizeDegenNFT, SecuritizeInvestorData, SecuritizeLiquidatorContract, SecuritizeOnRampAdapterContract, SecuritizeRWAFactory, SecuritizeRWAFactoryStateHuman, SecuritizeRedemptionGatewayAdapterContract, SendRawTxParameters, SetBotProps, SetBotResult, SimpleTokenMeta, SimulateCallOptions, SimulateCallParameters, SimulateCallReturnType, SimulateMulticallParameters, SimulateMulticallReturnType, SimulatePoolOperationProps, SimulateWithPriceUpdatesError, SimulateWithPriceUpdatesErrorParams, SimulateWithPriceUpdatesErrorType, SimulateWithPriceUpdatesParameters, SimulateWithPriceUpdatesReturnType, SimulationError, SimulationErrorType, SimulationValidationError, StakingRewardsAdapterContract, type StartIntent, StoreExpectedBalancesOp, StrategyCollateralProps, StrategyRateInputs, SupportedValue, Swap, SwapOperation, SyncStateOptions, type TimestampedCalldata, TokenAmount, TokenInfo, TokenMetaData, TokenTransfer, TokensMeta, TokensMetaState, TraceAdapterExt, TraderJoePool, TraderJoePoolVersion, TraderJoeRouterAdapterContract, Transfers, type TumblerStateHuman, TypedObjectUtils, Unarray, UniswapSwap, UniswapV2AdapterContract, UniswapV3AdapterContract, UniswapV4AdapterContract, UpdatablePriceFeedRegistry, type UpdatablePriceFeedRegistryHooks, type UpdatePriceFeedsResult, UpdateQuotaOp, UpshiftVaultAdapterContract, VERSION_RANGE_310, VaultDeposit, VelodromeV2RouterAdapterContract, VersionRange, VersionedAbi, VotingContractStatus, WAD, WAD_DECIMALS_POW, WalletFundingError, WatchBlocksAsyncParameters, WatchBlocksAsyncReturnType, WeighedFactors, type WithBlock, type WithMultichain, type WithPartialState, type WithdrawAssetIntent, type WithdrawCeilings, WithdrawCollateral, WithdrawCollateralOp, type WithdrawStrategyIntent, WithdrawableAsset, WithdrawalCompressorLocation, WithdrawalCompressorV310Contract, WithdrawalCompressorV311Contract, WithdrawalCompressorV313Contract, WithdrawalCompressorVersion, WithdrawalMetadata, WithdrawalOutput, WithdrawalStatus, WithdrawalsState, WstETHPriceFeedContract, WstETHUnwrap, WstETHV1AdapterContract, WstETHWrap, YearnPriceFeedContract, ZapperContract, ZapperData, type ZapperStateHuman, ZeroPriceFeedContract, ZodAddress, ZodBigInt, ZodHex, accountSnapshotFromCreditAccountData, adapterActionAbi, adapterActionSelectors, adapterActionSignatures, adapterConstructorAbi, allTransfersAsTokenAmounts, amountOf, assetsMap, attachOptionsSchema, botPermissionsToString, bpsToRay, buildDelayedStrategyPositionOperationPreview, bytes32ToString, calcBorrowApy, calcBorrowRate, calcDefaultQuota, calcEffectiveBorrowApy, calcHealthFactor, calcLiquidationPrice, calcLiquidationPriceForTarget, calcMaxLeverage, calcNetStrategyApy, calcPositionLeverage, calcQuotaRate, calcQuotaUpdate, calcRecommendedQuota, calcTimeToLiquidationMs, calcUtilization, calcUtilizationRaw, chains, checkAccountQuotas, checkBorrowLimit, checkCollateralFunding, checkCollateralised, checkCreditAccountFrozen, checkCreditManagerPaused, checkCreditOperation, checkDebtLimits, checkEmergencyLiquidator, checkForbiddenToken, checkHealthFactors, checkIncreaseDebt, checkIncreaseQuota, checkLeverage, checkLiquidation, checkLiquidationEligibility, checkLiquidationFunding, checkLiquidatorEligible, checkMarket, checkMarketExpired, checkMidasAccountGreenlist, checkObtained, checkOperation, checkPoolFunding, checkPoolLiquidity, checkPoolOperation, checkPoolPaused, checkPoolSunset, checkQuotaCount, checkQuotaLimit, checkRWAOpenRequirements, checkRWAOpening, checkReservePriceLimited, checkSimulation, checkWallet, checkWalletAllowance, checkWalletBalance, childLogger, classifyCloseOrRepay, classifyCurveOperation, classifyInnerOperations, collateralPriceInUnderlying, collectTraces, createAdapter, createAddressProvider, createPriceOracle, createRawTx, createRedemptionLogger, createRouter, createWithdrawalCompressor, createZapper, curveAddLiquidityFromTransfers, curveRemoveLiquidityFromTransfers, decodeDelayedIntent, detectDelayedClaim, detectDelayedOperation, detectNetwork, dominantCollateral, encodeDelayedIntent, erc4626ReferralAdapterAbi, estimateClaimableAt, estimateRawTxGas, etherscanApiUrl, etherscanUrl, executeDelegatedMulticalls, executeMulticallBatches, expectedBalanceDeltas, fetchCreditAccountSlice, filterDust, filterDustUSD, findCallTo, findCallWithInput, findCuratorMarketConfigurator, findExecuteBytes, fmtBinaryMask, fnSigToName, formatBN, formatBNvalue, formatDuration, formatLeverage, formatNumberToString_, formatPercentage, formatTimestamp, functionArgsToMap, functionArgsToRecord, generateCastTraceCall, getAccountTargetCollateral, getAdapterActionAbi, getAdapterDeployParamsAbi, getAdapterType, getAssetType, getCastTraceArgs, getChain, getCuratorName, getFunctionSignature, getLegacyStrategyTarget, getNetworkType, getRawPriceUpdates, getSimulateWithPriceUpdatesError, getWithdrawalCompressorAddress, halfRAY, hasAdapterDeployParamsAbi, healthFactorBps, hexEq, hydrateAddressProvider, iBalancerV3RouterAbi, iBalancerV3RouterAdapterAbi, iBalancerV3WrapperAbi, iBalancerV3WrapperAdapterAbi, iBaseOnRampAbi, iBaseRewardPoolAbi, iBoosterAbi, iCamelotV3AdapterAbi, iCamelotV3RouterAbi, iConvexV1BaseRewardPoolAdapterAbi, iConvexV1BoosterAdapterAbi, iCreditAccountAbi, iCurvePoolAbi, iCurvePoolStableNGAbi, iCurvePool_2Abi, iCurvePool_3Abi, iCurvePool_4Abi, iCurveV1StableNgAdapterAbi, iCurveV1_2AssetsAdapterAbi, iCurveV1_3AssetsAdapterAbi, iCurveV1_4AssetsAdapterAbi, iDaiUsdsAbi, iDaiUsdsAdapterAbi, iERC4626Abi, iERC4626ReferralAbi, iFluidDexAbi, iFluidDexAdapterAbi, iInfinifiGatewayAbi, iInfinifiGatewayAdapterAbi, iInfinifiUnwindingGatewayAbi, iInfinifiUnwindingGatewayAdapterAbi, iKelpLRTDepositPoolGatewayAbi, iKelpLRTWithdrawalManagerGatewayAbi, iKelpLrtDepositPoolAdapterAbi, iKelpLrtDepositPoolGatewayAbi, iKelpLrtWithdrawalManagerAdapterAbi, iKelpLrtWithdrawalManagerGatewayAbi, iLidoV1AdapterAbi, iMellow4626VaultAdapterAbi, iMellowClaimerAbi, iMellowClaimerAdapterAbi, iMellowWrapperAbi, iMellowWrapperAdapterAbi, iMidasGatewayAdapterV311Abi, iMidasGatewayV311Abi, iMidasIssuanceVaultAdapterV310Abi, iMidasIssuanceVaultV310Abi, iMidasRedemptionVaultAdapterV310Abi, iMidasRedemptionVaultGatewayV310Abi, iPendleRouterAbi, iPendleRouterAdapterAbi, iSecuritizeOnRampAbi, iSecuritizeOnRampAdapterV310Abi, iSecuritizeRedemptionGatewayAdapterV311Abi, iSecuritizeRedemptionGatewayV311Abi, iStakingRewardsAbi, iStakingRewardsAdapterAbi, iTraderJoeRouterAbi, iTraderJoeRouterAdapterAbi, iUniswapV2AdapterAbi, iUniswapV2Router02Abi, iUniswapV3Abi, iUniswapV3AdapterAbi, iUniswapV4AdapterAbi, iUniswapV4GatewayAbi, iUpshiftVaultAdapterAbi, iUpshiftVaultGatewayAbi, iVelodromeV2RouterAbi, iVelodromeV2RouterAdapterAbi, isCloseOrRepay, isDust, isLPPriceFeed, isPhantomToken, isPoolOperation, isPublicNetwork, isRWAFactory, isRWAOperation, isRWAToken, isStrategyCollateral, isSunsetPool, isSunsetStrategy, isSupportedNetwork, isUpdatablePriceFeed, isV310, isVersionRange, isZeroBalance, iwstETHAbi, iwstEthv1AdapterAbi, json_parse, json_stringify, lidoV1_WETHGatewayAbi, makeReplayState, mellowDvvAdapterAbi, midasGreenlistsAccount, minSeizedAmount, numberWithCommas, onchainSDKOptionsSchema, optimalHFForPartialLiquidation, optimalRepaidAmount, parseAdapterAction, parseAdapterDeployParams, parseFacadeOperationCalldata, parseOperationCalldata, parsePoolOperationCalldata, parsePosNegAmount, parseRWAFactoryOperationCalldata, percentFmt, pickStrategyTargetCollateral, previewAdjustStrategyPosition, previewExitOrRepayStrategyPosition, previewOperation, raise, rayToBps, rayToNumber, replayInnerOperations, replayMulticall, resolveDelayedClaimIntent, resolveProtocolCall, retry, rewardsFromTransfers, roundUpQuota, sendRawTx, shortAddress, shortHash, simulateCall, simulateMulticall, simulateWithPriceUpdates, soleNonUnderlyingCollateral, strategyName, swapFromTransfers, toAddress, toBN, toBigInt, toChainIds, toClaimableWithdrawal, toCreditAccountSlice, toNetTransfers, toPendingWithdrawal, toRequestableWithdrawal, toSignificant, toToken, toTokenAmount, toWithdrawalStatus, updatableDependencies, usdToNumber, watchBlocksAsync };
|
|
342
|
+
export { ADDRESS_0X0, ADDRESS_PROVIDER_V310, AP_ACCOUNT_FACTORY, AP_ACL, AP_BOT_LIST, AP_BYTECODE_REPOSITORY, AP_CONTRACTS_REGISTER, AP_CONTROLLER_TIMELOCK, AP_CREDIT_ACCOUNT_COMPRESSOR, AP_CREDIT_SUITE_COMPRESSOR, AP_DATA_COMPRESSOR, AP_DELEVERAGE_BOT_HV, AP_DELEVERAGE_BOT_LV, AP_DELEVERAGE_BOT_PEGGED, AP_GAUGE_COMPRESSOR, AP_GEAR_STAKING, AP_GEAR_TOKEN, AP_INFLATION_ATTACK_BLOCKER, AP_INSOLVENCY_CHECKER, AP_MARKET_COMPRESSOR, AP_MARKET_CONFIGURATOR, AP_PARTIAL_LIQUIDATION_BOT, AP_PERIPHERY_COMPRESSOR, AP_PRICE_FEED_COMPRESSOR, AP_PRICE_FEED_STORE, AP_PRICE_ORACLE, AP_REDEMPTION_LOGGER, AP_REWARDS_COMPRESSOR, AP_ROUTER, AP_TOKEN_COMPRESSOR, AP_TREASURY, AP_WETH_GATEWAY, AP_WETH_TOKEN, AP_ZAPPER_REGISTER, AP_ZERO_PRICE_FEED, AbstractAdapterContract, AbstractAdapterContractOptions, AbstractLPPriceFeedContract, AbstractPriceFeedContract, AbstractWithdrawalCompressorContract, AccountBotsService, type AccountCalculatorOperation, AccountMigratorAdapterContract, AccountSnapshot, AccountToCheck, AdapterContractStateHuman, AdapterContractType, AdapterData, AdapterFactoryArgs, AdapterOperation, AdapterOperationBase, AdapterProtocolOperation, AdapterType, type AddCollateralIntent, AddCollateralOp, AddLiquidityProps, AddressMap, AddressProviderAddresses, AddressProviderState, AddressProviderV310Contract, type AddressProviderV3StateHuman, AddressSet, type AdjustLeverageIntent, type AliasLossPolicyStateHuman, AssembleCaOperationsProps, AssembleClaimDelayedCallsProps, AssembleCloseCreditAccountCallsProps, AssembleRepayCreditAccountCallsProps, AssembleStartDelayedWithdrawalCallsProps, AssertAssignable, Asset, type AssetPriceFeedStateHuman, AssetWithAmountInTarget, AssetsMap, AttachOptions, BLOCKS_PER_WEEK_BY_NETWORK, BalanceDelta, BalancerStablePriceFeedContract, BalancerSwap, BalancerV3Pool, BalancerV3PoolStatus, BalancerV3RouterAdapterContract, BalancerV3WrapperAdapterContract, BalancerWeightedPriceFeedContract, type BalancerWeightedPriceFeedStateHuman, BaseContract, BaseContractArgs, type BaseContractStateHuman, BaseParams, BasePlugin, type BasePriceFeedStateHuman, BaseState, BasicSwapCall, BigIntMath, type BlockNumberProps, BorrowLimitArgs, BorrowPreviewResult, type BorrowProps, type BorrowState, type BotListStateHuman, BotPermissions, BotStatusCall, BotsDirectResponse, type BoundedOracleStateHuman, BoundedPriceFeedContract, BuildLiquidationTxProps, BuildLiquidationTxPropsBase, CMSlice, CalcBorrowRateProps, CalcDefaultQuotaProps, CalcHealthFactorProps, CalcLiquidationPriceForTargetProps, CalcLiquidationPriceProps, CalcQuotaUpdateProps, CalcRecommendedQuotaProps, CallTrace, CamelotPool, CamelotV3AdapterContract, ChainBlock, ChainBlockPin, ChainBlockSource, ChainConfig, ChainContractsRegister, ChainNotConfiguredError, ChainQueryOneProps, ChainQueryProps, CheckCollateralFundingInput, CheckLiquidationEligibilityInput, CheckLiquidationFundingInput, CheckLiquidationInput, CheckLiquidationOptions, CheckMidasAccountGreenlistInput, CheckOperationInput, CheckOperationOptions, CheckPoolFundingInput, CheckRWAOpenRequirementsInput, CheckRWAOpeningInput, CheckSimulationInput, CheckWalletAllowanceInput, CheckWalletBalanceInput, CheckWalletInput, ClaimFarmRewardsProps, type ClaimRemainder, ClaimableWithdrawal, ClassifyInnerOperationsProps, ClientOptions, CloseCreditAccountOperation, CloseCreditAccountResult, CloseOrRepayOperation, ClosePathBalances, CollateralFundingPreview, CollateralisedArgs, CompareBalancesOp, CompositePriceFeedContract, CompressorZapperData, ConcreteAdapterContractOptions, ConnectedBotData, ConnectedBotsCall, ConnectedBotsPerAccount, type ConstantOracleStateHuman, ConstantPriceFeedContract, Construct, ConstructOptions, type ContractMethod, ContractOrInterface, ContractParseError, ContractParseErrorOptions, ConvertFn, ConvexDeposit, ConvexDepositAndStake, ConvexStake, ConvexV1BaseRewardPoolAdapterContract, ConvexV1BoosterAdapterContract, ConvexWithdraw, ConvexWithdrawAndClaim, type CoreStateHuman, CreditAccountCompressor, CreditAccountCompressorV310Contract, CreditAccountData, CreditAccountDataCall, CreditAccountDataPayload, CreditAccountFilter, CreditAccountFrozenArgs, CreditAccountOperation, CreditAccountOperationResult, CreditAccountOperationsService, CreditAccountReadOptions, type CreditAccountSlice, CreditAccountState, CreditAccountStateProps, CreditAccountTokenQuota, CreditAccountTokensSlice, CreditAccountsCall, CreditAccountsQuery, CreditAccountsReadOptions, CreditAccountsServiceV310, CreditAccountsTarget, CreditConfiguratorState, type CreditConfiguratorStateHuman, CreditConfiguratorV310Contract, CreditFacadeState, type CreditFacadeStateHuman, type abi as CreditFacadeV310Abi, abi as creditFacadeV310Abi, CreditFacadeV310BaseContract, CreditFacadeV310Contract, CreditManagerDebtParams, type CreditManagerDebtParamsHuman, CreditManagerFilter, CreditManagerOperationResult, CreditManagerPausedArgs, CreditManagerState, type CreditManagerStateHuman, CreditManagerV310Contract, CreditOperationArgs, CreditOperationError, CreditOperationPreview, CreditSimulationInput, CreditSuite, CreditSuiteState, type CreditSuiteStateHuman, CreditSuiteStrategy, CurrentWithdrawals, Curve2AssetsAdapterContract, Curve3AssetsAdapterContract, Curve4AssetsAdapterContract, CurveAddLiquidity, CurveClaims, CurveCryptoPriceFeedContract, CurveExchange, CurveRemoveLiquidity, CurveRemoveLiquidityOneCoin, CurveStablePriceFeedContract, CurveUSDPriceFeedContract, CurveV1AdapterStETHContract, CurveV1StableNGAdapterContract, CurveWithdrawal, DEFAULT_QUOTA_BUFFER_BPS, DEGEN_NFT_MIDAS, DEGEN_NFT_SECURITIZE, DELAYED_INTENT_TYPES, DELAYED_INTENT_VERSION, DIRECT_TRANSFERS_QUOTA, DStokenData, DUST_THRESHOLD, DaiUsdsAdapterContract, DebtLimitsArgs, DecreaseDebtOp, type DelayableIntent, DelayedIntentExtended, type DelayedRoute, type DelayedStart, type DelayedStartResult, DelayedWithdrawalClaim, DelayedWithdrawalRequest, DelegatedMulticall, DepositMetadata, type DepositStrategyIntent, DetectedDelayedClaim, DetectedDelayedOperation, DirectTokenTransferOperation, ERC4626AdapterContract, ERC4626ReferralAdapterContract, EXECUTE_BYTES_SELECTOR, EmergencyLiquidatorArgs, EmptyAccountPreviewResult, EncodableCreditAccountOperation, Erc4626PriceFeedContract, EstimateRawTxGasParameters, EtherscanURLParam, ExecuteMulticallBatchesOptions, type ExecutionCost, ExpectedBalanceDeltasProps, ExpectedOutput, ExternalPriceFeedContract, FacadeOperationMetadata, FilterDustUSDOptions, FindBestClosePathProps, FindClaimAllRewardsProps, FindManyToOnePathProps, FindOneTokenPathProps, FindOpenStrategyPathProps, type FinishIntentProps, type FinishIntentResult, FluidDexAdapterContract, ForbiddenTokenArgs, FormatBNOptions, FullyLiquidateProps, FullyLiquidateResult, GaugeContract, GaugeData, GaugeParams, type GaugeParamsHuman, type GaugeStateHuman, type GearStakingV3StateHuman, GearboxChain, type GearboxState, type GearboxStateHuman, GetApprovalAddressProps, GetConnectedBotsResponse, GetConnectedBotsResult, GetConnectedMigrationBotsResult, GetCreditAccountsArgs, GetCreditAccountsOptions, GetCurrentWithdrawalsProps, GetCurrentWithdrawalsPropsBase, GetExternalAccountCurrentWithdrawalsProps, GetInvestorOptions, GetLiquidatableAccountsProps, GetLiquidationDetailsProps, GetLiquidationDetailsPropsBase, GetLiquidationPositionsProps, GetLiquidationPositionsPropsBase, GetOpenAccountRequirementsProps, GetReward, GetWithdrawalRequestResultProps, HealthFactorThresholds, HydrateOptions, IAdapterContract, IAddressProviderContract, IBaseContract, ICreditAccountsService, ICreditConfiguratorContract, ICreditFacadeContract, ICreditManagerContract, IDegenNFT, IERC20ZapperContract, IETHZapperContract, IInterestRateModelContract, type ILogger, IMultichainOpportunitiesService, IMultichainPositionsService, IOnchainSDKPlugin, IOnchainSDKPluginConstructor, IPluginState, IPoolContract, IPoolsService, IPriceFeedContract, IPriceOracleContract, type IPriceUpdateTask, type IPriceUpdateTx, type IPriceUpdater, IRWAFactory, IRateKeeperContract, IRedemptionLoggerContract, IRouterContract, type IUpdatablePriceFeedContract, IWithdrawalCompressorContract, IZapperContract, IncreaseDebtOp, InfinifiGatewayAdapterContract, InfinifiUnwindingGatewayAdapterContract, InnerFacadeOperation, InnerOperation, type InstantRoute, type IntentPreviewResult, type IntentRoutesResult, type IntentValidationError, type InterestRateModelStateHuman, InterestRateModelType, IsDustOptions, KelpLRTDepositPoolAdapterContract, KelpLRTWithdrawalManagerAdapterContract, LEVERAGE_DECIMALS, LIQUIDATION_APPROVAL_BUFFER, LIQUIDATION_COMPRESSOR_V313_ADDRESS, LPMonopolizedPoolMeta, type LPPriceFeedStateHuman, type LatestUpdate, LegacyAdapterOperation, LeverageArgs, type LeverageBand, LidoSubmit, LidoV1AdapterContract, LinearInterestRateModelContract, type LinearInterestRateModelStateHuman, LiquidateCreditAccountOperation, LiquidationEligibilityError, LiquidationFees, LiquidationValidationError, LiquidationsService, LiquidatorEligibleArgs, ListPoolPositionsProps, ListPositionsProps, ListPositionsPropsBase, ListStrategyPositionsProps, LoadRWALiquidatorsProps, type LogFn, type LossPolicyStateHuman, MAX_INT, MAX_LEVERAGE_BUFFER_BPS, MAX_UINT16, MAX_UINT256, MIN_HEALTH_FACTOR_FACADE, MIN_HEALTH_FACTOR_FORM, MIN_HF_LIMITED, MIN_INT96, MIN_SAFE_HEALTH_FACTOR_FORM, MULTICALL_ADDRESS, MakerDeposit, MakerRedeem, MarketData, MarketExpiredArgs, MarketFilter, MarketRegister, MarketRegistryState, MarketRegistryStateHuman, MarketStateError, type MarketStateHuman, MarketSuite, MarketType, MaxAmountForQuotaProps, MaxBorrowAmount, MellowClaimerAdapterContract, MellowDVVAdapterContract, MellowERC4626VaultAdapterContract, MellowLRTPriceFeedContract, MellowWrapperAdapterContract, Methods, MidasDegenNFT, MidasGatewayAdapterContract, MidasIssuanceVaultAdapterContract, MidasLiquidatorContract, MidasRedemptionVaultAdapterContract, MissingSerializedParamsError, type MultiCall, MulticallBatch, MulticallOperation, MulticallWithFailure, MultichainAttachOptions, type MultichainChainIdsProps, MultichainConstruct, MultichainHydrateOptions, MultichainLiquidationsService, type MultichainNetworkProps, MultichainOpportunitiesService, MultichainPositionsService, MultichainSDK, MultichainSDKOptions, type MultichainState, type MultichainStateHuman, MultichainSyncStateOptions, NATIVE_ADDRESS, NON_STRATEGY_PHANTOM_TOKEN_TYPES, NOT_DEPLOYED, NO_VERSION, NetworkType, OnchainLiquidationCall, OnchainLiquidationData, OnchainLiquidationOutput, OnchainRequestableWithdrawal, OnchainSDK, OnchainSDKOptions, OpenCAProps, OpenCreditAccountOperation, OpenStrategyPreviewResult, type OpenStrategyProps, OpenStrategyResult, type OpenStrategyState, Operation, OperationMetadata, type OperationState, OperationValidationError, OpportunitiesService, OptimalRepaidAmountProps, OuterFacadeOperation, PARTIAL_LIQUIDATION_BUFFER_BPS, PERCENTAGE_DECIMALS, PERCENTAGE_FACTOR, PERCENTAGE_FACTOR_1KK, PERIPHERY_CONTRACTS, PHANTOM_TOKEN_CONTRACT_TYPES, PHANTOM_TOKEN_MIDAS_REDEMPTION, PHANTOM_TOKEN_SECURITIZE_REDEMPTION, PRICE_DECIMALS, PRICE_DECIMALS_POW, ParsedCall, ParsedCallArgs, ParsedCallV2, ParsedZapperDeposit, ParsedZapperOperation, ParsedZapperRedeem, PartialLiquidationOperation, PartialLiquidationParams, PartialPriceFeedInitError, PartialPriceFeedTreeNode, PartialRecord, PartiallyLiquidateProps, type PathLossRate, PendingWithdrawal, PendlePair, PendlePairStatus, PendleRouterAdapterContract, PendleTWAPPTPriceFeed, PendleTokenType, PeripheryCompressorV310Contract, PeripheryContract, PermitResult, PhantomTokenContractType, PhantomTokenMeta, PickSomeRequired, PluginFactoriesMap, PluginFactory, PluginState, PluginStateVersionError, PluginStatesMap, PluginsMap, PoolDepositOperation, PoolLiquidityArgs, PoolMintOperation, PoolOperation, PoolOperationArgs, PoolOperationError, PoolPausedArgs, PoolQuotaKeeperContract, type PoolQuotaKeeperStateHuman, PoolRedeemOperation, PoolService, PoolServiceCall, PoolServiceCallResult, PoolSimulation, PoolState, type PoolStateHuman, PoolSuite, type PoolSuiteStateHuman, PoolSunsetArgs, PoolV310Contract, PoolWithdrawOperation, PositionsService, PrepareUpdateQuotasProps, PreviewDelayedWithdrawalProps, PreviewOperationError, PriceFeedAnswer, PriceFeedConstructorArgs, PriceFeedContractType, PriceFeedMapEntry, PriceFeedRef, PriceFeedRegistry, type PriceFeedStateHuman, PriceFeedTreeNode, PriceFeedUsageType, PriceFeedsForAccountOptions, PriceFeedsForTokensOptions, PriceOracleData, type PriceOracleStateHuman, PriceOracleV310Contract, PriceUpdate, PriceUpdatesCache, ProjectedPoolOptions, PythPriceFeed, QuotaCountArgs, QuotaKeeperState, QuotaLimitArgs, QuotaMode, type QuotaParamsHuman, QuotaSlice, QuotaState, RAMP_DURATION_BY_NETWORK, RAY, RAY_DECIMALS_POW, RWACompressorCall, RWACompressorInvestorData, RWACompressorResponse, RWADefaultTokenMeta, RWAFactoryData, RWAFactoryProtocol, RWAFactoryStateHuman, RWAInvestorData, RWALiquidatorInfo, RWAMulticallOperation, RWAOnDemandLPMeta, RWAOnDemandLPMonopolizedMeta, RWAOnDemandLpContractType, RWAOnDemandTokenMeta, RWAOpenCreditAccountOperation, RWAOpeningError, RWAOperation, RWAOperationMetadata, RWARegistry, RWAState, RWAStateHuman, RWATokenMeta, RWAUnderlyingContractType, RWAUnderlyingData, RWA_COMPRESSOR_ADDRESS, RWA_LIQUIDATOR_MIDAS, RWA_LIQUIDATOR_SECURITIZE, RWA_ON_DEMAND_LP_MONOPOLIZED, RWA_UNDERLYING_DEFAULT, RWA_UNDERLYING_ON_DEMAND, RampEvent, RateKeeperState, type RateKeeperStateHuman, RateKeeperType, type RawTx, RedemptionLog, RedemptionLoggerV310Contract, RedemptionPhantomRename, RedstonePriceFeedContract, type RedstonePriceFeedStateHuman, type RefusedIntent, RelaxedBaseParams, RemoveLiquidityProps, type RepayStrategyIntent, ReplayMulticallResult, ReplayState, ReplayableOperation, RequestableWithdrawal, ReservePriceLimitedArgs, type ResumableIntent, RetryOptions, RewardInfo, Rewards, type RouteErrors, RouterCASlice, RouterCMSlice, RouterCloseResult, RouterResult, RouterRewardsResult, RouterV310Contract, SDKConstruct, SDKOptions, SECONDS_PER_YEAR, SLIPPAGE_DECIMALS, STATE_VERSION, SUPPORTED_NETWORKS, SdkAlreadyAttachedError, SdkChainMismatchError, SdkMissingChainStateError, SdkNotAttachedError, SdkRWADataNotLoadedError, SdkStateVersionMismatchError, SdkSyncFailedError, SecuritizeCreditAccountData, SecuritizeDegenNFT, SecuritizeInvestorData, SecuritizeLiquidatorContract, SecuritizeOnRampAdapterContract, SecuritizeRWAFactory, SecuritizeRWAFactoryStateHuman, SecuritizeRedemptionGatewayAdapterContract, SendRawTxParameters, SetBotProps, SetBotResult, SimpleTokenMeta, SimulateCallOptions, SimulateCallParameters, SimulateCallReturnType, SimulateMulticallParameters, SimulateMulticallReturnType, SimulatePoolOperationProps, SimulateWithPriceUpdatesError, SimulateWithPriceUpdatesErrorParams, SimulateWithPriceUpdatesErrorType, SimulateWithPriceUpdatesParameters, SimulateWithPriceUpdatesReturnType, SimulationError, SimulationErrorType, SimulationValidationError, StakingRewardsAdapterContract, type StartIntent, StoreExpectedBalancesOp, StrategyCollateralProps, StrategyRateInputs, SupportedValue, Swap, SwapOperation, SyncStateOptions, type TimestampedCalldata, TokenAmount, TokenInfo, TokenMetaData, TokenTransfer, TokensMeta, TokensMetaState, TraceAdapterExt, TraderJoePool, TraderJoePoolVersion, TraderJoeRouterAdapterContract, Transfers, type TumblerStateHuman, TypedObjectUtils, Unarray, UniswapSwap, UniswapV2AdapterContract, UniswapV3AdapterContract, UniswapV4AdapterContract, UpdatablePriceFeedRegistry, type UpdatablePriceFeedRegistryHooks, type UpdatePriceFeedsResult, UpdateQuotaOp, UpshiftVaultAdapterContract, VERSION_RANGE_310, VaultDeposit, VelodromeV2RouterAdapterContract, VersionRange, VersionedAbi, VotingContractStatus, WAD, WAD_DECIMALS_POW, WalletFundingError, WatchBlocksAsyncParameters, WatchBlocksAsyncReturnType, WeighedFactors, type WithBlock, type WithMultichain, type WithPartialState, type WithdrawAssetIntent, type WithdrawCeilings, WithdrawCollateral, WithdrawCollateralOp, type WithdrawStrategyIntent, WithdrawableAsset, WithdrawalCompressorLocation, WithdrawalCompressorV310Contract, WithdrawalCompressorV311Contract, WithdrawalCompressorV313Contract, WithdrawalCompressorVersion, WithdrawalMetadata, WithdrawalOutput, WithdrawalStatus, WithdrawalsState, WstETHPriceFeedContract, WstETHUnwrap, WstETHV1AdapterContract, WstETHWrap, YearnPriceFeedContract, ZapperContract, ZapperData, type ZapperStateHuman, ZeroPriceFeedContract, ZodAddress, ZodBigInt, ZodHex, accountSnapshotFromCreditAccountData, adapterActionAbi, adapterActionSelectors, adapterActionSignatures, adapterConstructorAbi, allTransfersAsTokenAmounts, amountOf, assetsMap, attachOptionsSchema, botPermissionsToString, bpsToRay, buildDelayedStrategyPositionOperationPreview, bytes32ToString, calcBorrowApy, calcBorrowRate, calcDefaultQuota, calcEffectiveBorrowApy, calcHealthFactor, calcLiquidationPrice, calcLiquidationPriceForTarget, calcMaxLeverage, calcNetStrategyApy, calcPositionLeverage, calcQuotaRate, calcQuotaUpdate, calcRecommendedQuota, calcTimeToLiquidationMs, calcUtilization, calcUtilizationRaw, chains, checkAccountQuotas, checkBorrowLimit, checkCollateralFunding, checkCollateralised, checkCreditAccountFrozen, checkCreditManagerPaused, checkCreditOperation, checkDebtLimits, checkEmergencyLiquidator, checkForbiddenToken, checkHealthFactors, checkIncreaseDebt, checkIncreaseQuota, checkLeverage, checkLiquidation, checkLiquidationEligibility, checkLiquidationFunding, checkLiquidatorEligible, checkMarket, checkMarketExpired, checkMidasAccountGreenlist, checkObtained, checkOperation, checkPoolFunding, checkPoolLiquidity, checkPoolOperation, checkPoolPaused, checkPoolSunset, checkQuotaCount, checkQuotaLimit, checkRWAOpenRequirements, checkRWAOpening, checkReservePriceLimited, checkSimulation, checkWallet, checkWalletAllowance, checkWalletBalance, childLogger, classifyCloseOrRepay, classifyCurveOperation, classifyInnerOperations, collateralPriceInUnderlying, collectTraces, createAdapter, createAddressProvider, createPriceOracle, createRawTx, createRedemptionLogger, createRouter, createWithdrawalCompressor, createZapper, curveAddLiquidityFromTransfers, curveRemoveLiquidityFromTransfers, decodeDelayedIntent, detectDelayedClaim, detectDelayedOperation, detectNetwork, dominantCollateral, encodeDelayedIntent, erc4626ReferralAdapterAbi, estimateClaimableAt, estimateRawTxGas, etherscanApiUrl, etherscanUrl, executeDelegatedMulticalls, executeMulticallBatches, expectedBalanceDeltas, fetchCreditAccountSlice, filterDust, filterDustUSD, findCallTo, findCallWithInput, findCuratorMarketConfigurator, findExecuteBytes, fmtBinaryMask, fnSigToName, formatBN, formatBNvalue, formatDuration, formatLeverage, formatNumberToString_, formatPercentage, formatTimestamp, functionArgsToMap, functionArgsToRecord, generateCastTraceCall, getAccountTargetCollateral, getAdapterActionAbi, getAdapterDeployParamsAbi, getAdapterType, getAssetType, getCastTraceArgs, getChain, getCuratorName, getDirectTransferToken, getFunctionSignature, getLegacyStrategyTarget, getNetworkType, getRawPriceUpdates, getSimulateWithPriceUpdatesError, getWithdrawalCompressorAddress, halfRAY, hasAdapterDeployParamsAbi, healthFactorBps, hexEq, hydrateAddressProvider, iBalancerV3RouterAbi, iBalancerV3RouterAdapterAbi, iBalancerV3WrapperAbi, iBalancerV3WrapperAdapterAbi, iBaseOnRampAbi, iBaseRewardPoolAbi, iBoosterAbi, iCamelotV3AdapterAbi, iCamelotV3RouterAbi, iConvexV1BaseRewardPoolAdapterAbi, iConvexV1BoosterAdapterAbi, iCreditAccountAbi, iCurvePoolAbi, iCurvePoolStableNGAbi, iCurvePool_2Abi, iCurvePool_3Abi, iCurvePool_4Abi, iCurveV1StableNgAdapterAbi, iCurveV1_2AssetsAdapterAbi, iCurveV1_3AssetsAdapterAbi, iCurveV1_4AssetsAdapterAbi, iDaiUsdsAbi, iDaiUsdsAdapterAbi, iERC4626Abi, iERC4626ReferralAbi, iFluidDexAbi, iFluidDexAdapterAbi, iInfinifiGatewayAbi, iInfinifiGatewayAdapterAbi, iInfinifiUnwindingGatewayAbi, iInfinifiUnwindingGatewayAdapterAbi, iKelpLRTDepositPoolGatewayAbi, iKelpLRTWithdrawalManagerGatewayAbi, iKelpLrtDepositPoolAdapterAbi, iKelpLrtDepositPoolGatewayAbi, iKelpLrtWithdrawalManagerAdapterAbi, iKelpLrtWithdrawalManagerGatewayAbi, iLidoV1AdapterAbi, iMellow4626VaultAdapterAbi, iMellowClaimerAbi, iMellowClaimerAdapterAbi, iMellowWrapperAbi, iMellowWrapperAdapterAbi, iMidasGatewayAdapterV311Abi, iMidasGatewayV311Abi, iMidasIssuanceVaultAdapterV310Abi, iMidasIssuanceVaultV310Abi, iMidasRedemptionVaultAdapterV310Abi, iMidasRedemptionVaultGatewayV310Abi, iPendleRouterAbi, iPendleRouterAdapterAbi, iSecuritizeOnRampAbi, iSecuritizeOnRampAdapterV310Abi, iSecuritizeRedemptionGatewayAdapterV311Abi, iSecuritizeRedemptionGatewayV311Abi, iStakingRewardsAbi, iStakingRewardsAdapterAbi, iTraderJoeRouterAbi, iTraderJoeRouterAdapterAbi, iUniswapV2AdapterAbi, iUniswapV2Router02Abi, iUniswapV3Abi, iUniswapV3AdapterAbi, iUniswapV4AdapterAbi, iUniswapV4GatewayAbi, iUpshiftVaultAdapterAbi, iUpshiftVaultGatewayAbi, iVelodromeV2RouterAbi, iVelodromeV2RouterAdapterAbi, isCloseOrRepay, isDust, isLPPriceFeed, isPhantomToken, isPoolOperation, isPublicNetwork, isRWAFactory, isRWAOperation, isRWAToken, isStrategyCollateral, isSunsetPool, isSunsetStrategy, isSupportedNetwork, isUpdatablePriceFeed, isV310, isVersionRange, isZeroBalance, iwstETHAbi, iwstEthv1AdapterAbi, json_parse, json_stringify, lidoV1_WETHGatewayAbi, makeReplayState, maxAmountForQuota, mellowDvvAdapterAbi, midasGreenlistsAccount, minSeizedAmount, numberWithCommas, onchainSDKOptionsSchema, optimalHFForPartialLiquidation, optimalRepaidAmount, parseAdapterAction, parseAdapterDeployParams, parseFacadeOperationCalldata, parseOperationCalldata, parsePoolOperationCalldata, parsePosNegAmount, parseRWAFactoryOperationCalldata, percentFmt, pickStrategyTargetCollateral, previewAdjustStrategyPosition, previewExitOrRepayStrategyPosition, previewOperation, raise, rayToBps, rayToNumber, replayInnerOperations, replayMulticall, resolveDelayedClaimIntent, resolveProtocolCall, retry, rewardsFromTransfers, roundUpQuota, sendRawTx, shortAddress, shortHash, simulateCall, simulateMulticall, simulateWithPriceUpdates, soleNonUnderlyingCollateral, strategyName, swapFromTransfers, toAddress, toBN, toBigInt, toChainIds, toClaimableWithdrawal, toCreditAccountSlice, toNetTransfers, toPendingWithdrawal, toRequestableWithdrawal, toSignificant, toToken, toTokenAmount, toWithdrawalStatus, updatableDependencies, usdToNumber, watchBlocksAsync };
|
|
@@ -95,9 +95,6 @@ declare abstract class PriceOracleBaseContract<abi extends Abi | readonly unknow
|
|
|
95
95
|
* {@inheritDoc IPriceOracleContract.convertFromUSD}
|
|
96
96
|
**/
|
|
97
97
|
convertFromUSD(to: Address, amount: bigint, reserve?: boolean): bigint;
|
|
98
|
-
/**
|
|
99
|
-
* {@inheritDoc IPriceOracleContract.safeConvert}
|
|
100
|
-
**/
|
|
101
98
|
safeConvert(from: Address, to: Address, amount: bigint): SafeValue<bigint, UnpriceableTokenError>;
|
|
102
99
|
/**
|
|
103
100
|
* {@inheritDoc IPriceOracleContract.safeConvertToUSD}
|
|
@@ -139,9 +139,10 @@ interface IPriceOracleContract extends IBaseContract {
|
|
|
139
139
|
**/
|
|
140
140
|
convert: (from: Address, to: Address, amount: bigint, reserve?: boolean) => bigint;
|
|
141
141
|
/**
|
|
142
|
-
*
|
|
143
|
-
*
|
|
144
|
-
*
|
|
142
|
+
* Values the amount with rounding UP to a target-token unit, unlike the
|
|
143
|
+
* floor-rounded contract-compatible {@link convert}.
|
|
144
|
+
* Never throws: main feed, then reserve, else `{ value: 0n, error }`.
|
|
145
|
+
* Fallback only on a missing or failed feed, not on a successful 0 price.
|
|
145
146
|
**/
|
|
146
147
|
safeConvert: (from: Address, to: Address, amount: bigint) => SafeValue<bigint, UnpriceableTokenError>;
|
|
147
148
|
/**
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { Token } from "../../../model/primitives.js";
|
|
2
|
-
import { BorrowLimitCause, InsufficientPoolLiquidityError } from "../../../model/errors/operation-errors.js";
|
|
2
|
+
import { BorrowLimitCause, InsufficientPoolLiquidityError, OperationLimitOptions } from "../../../model/errors/operation-errors.js";
|
|
3
3
|
import "../../../model/index.js";
|
|
4
4
|
//#region src/onchain/validation/checks/checkBorrowLimit.d.ts
|
|
5
|
-
interface BorrowLimitArgs {
|
|
5
|
+
interface BorrowLimitArgs extends OperationLimitOptions {
|
|
6
6
|
requested: bigint;
|
|
7
7
|
available: bigint;
|
|
8
8
|
limit: BorrowLimitCause;
|
|
9
9
|
underlying: Token;
|
|
10
|
-
getCollateralLimits?: () => InsufficientPoolLiquidityError["collateralLimits"];
|
|
11
10
|
maxBorrowAmount?: bigint;
|
|
12
11
|
}
|
|
13
12
|
/**
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { Token } from "../../../model/primitives.js";
|
|
2
|
-
import { DebtOutOfRangeError } from "../../../model/errors/operation-errors.js";
|
|
2
|
+
import { DebtOutOfRangeError, OperationLimitOptions } from "../../../model/errors/operation-errors.js";
|
|
3
3
|
import "../../../model/index.js";
|
|
4
4
|
import { MaxBorrowAmount } from "../../market/credit/types.js";
|
|
5
5
|
import "../../market/index.js";
|
|
6
6
|
//#region src/onchain/validation/checks/checkDebtLimits.d.ts
|
|
7
|
-
interface DebtLimitsArgs {
|
|
7
|
+
interface DebtLimitsArgs extends OperationLimitOptions {
|
|
8
8
|
debt: bigint;
|
|
9
9
|
minDebt: bigint;
|
|
10
10
|
maxDebt: bigint;
|
|
11
11
|
underlying: Token;
|
|
12
|
-
getCollateralLimits?: () => DebtOutOfRangeError["collateralLimits"];
|
|
13
12
|
/**
|
|
14
13
|
* Whether ending with no loan at all is acceptable. The one place the two
|
|
15
14
|
* callers genuinely disagree: an account being adjusted may end owing
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Token } from "../../../model/primitives.js";
|
|
2
|
-
import { QuotaLimitReachedError } from "../../../model/errors/operation-errors.js";
|
|
2
|
+
import { OperationLimitOptions, QuotaLimitReachedError } from "../../../model/errors/operation-errors.js";
|
|
3
3
|
import "../../../model/index.js";
|
|
4
4
|
//#region src/onchain/validation/checks/checkQuotaLimit.d.ts
|
|
5
|
-
interface QuotaLimitArgs {
|
|
5
|
+
interface QuotaLimitArgs extends OperationLimitOptions {
|
|
6
6
|
token: Token;
|
|
7
7
|
/**
|
|
8
8
|
* Absent for a token the market opened no quota for at all — nothing is
|