@gearbox-protocol/sdk 16.0.0-next.30 → 16.0.0-next.32
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/onchain/accounts/intents/utils/credit-account-slice.js +1 -1
- package/dist/cjs/onchain/accounts/intents/utils/quotas-for-update.js +1 -1
- package/dist/cjs/preview/index.js +6 -6
- package/dist/cjs/preview/preview/{buildDelayedStrategyVerify.js → buildDelayedStrategyPositionOperationPreview.js} +3 -3
- package/dist/cjs/preview/preview/index.js +6 -6
- package/dist/cjs/preview/preview/{previewAdjustStrategyVerify.js → previewAdjustStrategyPosition.js} +3 -3
- package/dist/cjs/preview/preview/{previewExitOrRepayStrategyVerify.js → previewExitOrRepayStrategyPosition.js} +3 -3
- package/dist/cjs/preview/preview/{previewOpenStrategyVerify.js → previewOpenStrategyPosition.js} +3 -3
- package/dist/cjs/preview/preview/previewOperation.js +10 -10
- package/dist/cjs/preview/preview/{previewLpVerify.js → previewPoolPositionOperation.js} +3 -3
- package/dist/cjs/sdk/execute/ExecuteApi.js +3 -3
- package/dist/cjs/sdk/prepare/PrepareApi.js +1 -1
- package/dist/esm/onchain/accounts/intents/utils/credit-account-slice.js +1 -1
- package/dist/esm/onchain/accounts/intents/utils/quotas-for-update.js +1 -1
- package/dist/esm/preview/index.js +4 -4
- package/dist/esm/preview/preview/{buildDelayedStrategyVerify.js → buildDelayedStrategyPositionOperationPreview.js} +3 -3
- package/dist/esm/preview/preview/index.js +4 -4
- package/dist/esm/preview/preview/{previewAdjustStrategyVerify.js → previewAdjustStrategyPosition.js} +3 -3
- package/dist/esm/preview/preview/{previewExitOrRepayStrategyVerify.js → previewExitOrRepayStrategyPosition.js} +3 -3
- package/dist/esm/preview/preview/{previewOpenStrategyVerify.js → previewOpenStrategyPosition.js} +3 -3
- package/dist/esm/preview/preview/previewOperation.js +10 -10
- package/dist/esm/preview/preview/{previewLpVerify.js → previewPoolPositionOperation.js} +3 -3
- package/dist/esm/sdk/execute/ExecuteApi.js +3 -3
- package/dist/esm/sdk/prepare/PrepareApi.js +1 -1
- package/dist/types/model/index.d.ts +2 -2
- package/dist/types/model/previews.d.ts +13 -13
- package/dist/types/onchain/accounts/intents/open-strategy.d.ts +2 -2
- package/dist/types/onchain/accounts/intents/types.d.ts +4 -4
- package/dist/types/onchain/accounts/intents/utils/credit-account-slice.d.ts +1 -1
- package/dist/types/preview/index.d.ts +4 -4
- package/dist/types/preview/preview/{buildDelayedStrategyVerify.d.ts → buildDelayedStrategyPositionOperationPreview.d.ts} +4 -4
- package/dist/types/preview/preview/index.d.ts +4 -4
- package/dist/types/preview/preview/{previewAdjustStrategyVerify.d.ts → previewAdjustStrategyPosition.d.ts} +4 -4
- package/dist/types/preview/preview/{previewExitOrRepayStrategyVerify.d.ts → previewExitOrRepayStrategyPosition.d.ts} +4 -4
- package/dist/types/preview/preview/previewOpenStrategyPosition.d.ts +12 -0
- package/dist/types/preview/preview/previewPoolPositionOperation.d.ts +11 -0
- package/dist/types/sdk/execute/types.d.ts +13 -13
- package/dist/types/sdk/index.d.ts +2 -2
- package/dist/types/sdk/opportunities/types.d.ts +2 -1
- package/dist/types/sdk/prepare/PrepareApi.d.ts +14 -14
- package/dist/types/sdk/prepare/index.d.ts +2 -2
- package/dist/types/sdk/prepare/types.d.ts +41 -41
- package/package.json +1 -1
- package/dist/types/preview/preview/previewLpVerify.d.ts +0 -11
- package/dist/types/preview/preview/previewOpenStrategyVerify.d.ts +0 -12
|
@@ -5,7 +5,7 @@ import { BorrowRateBreakdown } from "./positions.js";
|
|
|
5
5
|
import { Address, Hex } from "viem";
|
|
6
6
|
//#region src/model/previews.d.ts
|
|
7
7
|
/**
|
|
8
|
-
* ERC4626 pool operation kind, as surfaced on a {@link
|
|
8
|
+
* ERC4626 pool operation kind, as surfaced on a {@link PoolPositionOperationPreview}.
|
|
9
9
|
**/
|
|
10
10
|
type PoolOperationType = "Deposit" | "Mint" | "Withdraw" | "Redeem";
|
|
11
11
|
/**
|
|
@@ -102,7 +102,7 @@ interface OperationPreviewError {
|
|
|
102
102
|
* `prepare.deposit`, `prepare.withdraw` and `prepare.redeem`, read off calldata
|
|
103
103
|
* rather than planned into it.
|
|
104
104
|
**/
|
|
105
|
-
interface
|
|
105
|
+
interface PoolPositionOperationPreview {
|
|
106
106
|
operation: PoolOperationType;
|
|
107
107
|
/**
|
|
108
108
|
* Pool address
|
|
@@ -367,7 +367,7 @@ interface AccountStateChange {
|
|
|
367
367
|
* counterpart of `prepare.openNewStrategy`, read off calldata rather than
|
|
368
368
|
* planned into it.
|
|
369
369
|
**/
|
|
370
|
-
interface
|
|
370
|
+
interface OpenStrategyPositionPreview extends EstimatedProjection {
|
|
371
371
|
operation: "OpenCreditAccount" | "RWAOpenCreditAccount";
|
|
372
372
|
/**
|
|
373
373
|
* Collateral token this position is a strategy in: the first quoted token,
|
|
@@ -397,7 +397,7 @@ interface PreviewOpenStrategyVerify extends EstimatedProjection {
|
|
|
397
397
|
* `addCollateral`, `withdrawCollateral`, `adjustLeverage`), read off calldata
|
|
398
398
|
* rather than planned into it.
|
|
399
399
|
**/
|
|
400
|
-
interface
|
|
400
|
+
interface AdjustStrategyPositionPreview extends EstimatedProjection, AccountStateChange {
|
|
401
401
|
operation: "AdjustCreditAccount";
|
|
402
402
|
/**
|
|
403
403
|
* Credit account that is being adjusted
|
|
@@ -436,7 +436,7 @@ interface PreviewAdjustStrategyVerify extends EstimatedProjection, AccountStateC
|
|
|
436
436
|
* so there is no position left to weigh — what a caller wants to know is the
|
|
437
437
|
* payout. The market it happened in is still named, as everywhere else.
|
|
438
438
|
**/
|
|
439
|
-
interface
|
|
439
|
+
interface ExitStrategyPositionPreview extends CreditOperationMarket {
|
|
440
440
|
operation: "CloseCreditAccount";
|
|
441
441
|
/**
|
|
442
442
|
* True when the account is closed permanently (facade `closeCreditAccount`
|
|
@@ -476,7 +476,7 @@ interface PreviewExitStrategyVerify extends CreditOperationMarket {
|
|
|
476
476
|
* Carries no {@link AccountProjection} for the same reason the exit does not:
|
|
477
477
|
* the loan ends here, so the risk metrics have nothing left to describe.
|
|
478
478
|
**/
|
|
479
|
-
interface
|
|
479
|
+
interface RepayStrategyPositionPreview extends CreditOperationMarket {
|
|
480
480
|
operation: "RepayCreditAccount";
|
|
481
481
|
/**
|
|
482
482
|
* True when the account is closed permanently (facade `closeCreditAccount`
|
|
@@ -504,7 +504,7 @@ interface PreviewRepayStrategyVerify extends CreditOperationMarket {
|
|
|
504
504
|
/**
|
|
505
505
|
* Total debt repaid: principal + accrued interest + fees, in underlying.
|
|
506
506
|
*
|
|
507
|
-
* The same quantity a {@link
|
|
507
|
+
* The same quantity a {@link AdjustStrategyPositionPreview} reports as
|
|
508
508
|
* `totalDebtChange`, with the sign a repayment screen reads: positive for
|
|
509
509
|
* what the wallet parted with.
|
|
510
510
|
*/
|
|
@@ -526,14 +526,14 @@ interface PreviewRepayStrategyVerify extends CreditOperationMarket {
|
|
|
526
526
|
* account: what the transaction does in the same block, before any delayed
|
|
527
527
|
* withdrawal is claimed.
|
|
528
528
|
*/
|
|
529
|
-
type
|
|
529
|
+
type InstantStrategyPositionOperationPreview = AdjustStrategyPositionPreview | ExitStrategyPositionPreview | RepayStrategyPositionPreview;
|
|
530
530
|
/**
|
|
531
531
|
* Preview of a multicall that requests a delayed withdrawal (e.g. Securitize
|
|
532
532
|
* redemption): the source token is spent now and a withdrawal phantom token is received;
|
|
533
533
|
* the actual claim token materializes later, when the withdrawal is claimed and
|
|
534
534
|
* the recorded (if any) is resumed
|
|
535
535
|
*/
|
|
536
|
-
interface
|
|
536
|
+
interface DelayedStrategyPositionOperationPreview extends CreditOperationMarket {
|
|
537
537
|
operation: "DelayedCreditAccountOperation";
|
|
538
538
|
/**
|
|
539
539
|
* Credit account the operation is performed on
|
|
@@ -548,19 +548,19 @@ interface PreviewDelayedStrategyVerify extends CreditOperationMarket {
|
|
|
548
548
|
* What this transaction does right now: the delayed withdrawal is
|
|
549
549
|
* represented by the phantom token among the account's assets
|
|
550
550
|
*/
|
|
551
|
-
instantPreview:
|
|
551
|
+
instantPreview: InstantStrategyPositionOperationPreview;
|
|
552
552
|
/**
|
|
553
553
|
* Best-effort state after the withdrawal is claimed and the intent is
|
|
554
554
|
* resumed; claim-only (phantom burned, claim token received) when
|
|
555
555
|
* `intent` is undefined
|
|
556
556
|
*/
|
|
557
|
-
delayedPreview:
|
|
557
|
+
delayedPreview: InstantStrategyPositionOperationPreview;
|
|
558
558
|
}
|
|
559
559
|
/**
|
|
560
560
|
* Result of previewing a raw operation calldata: currently pool operations and
|
|
561
561
|
* credit account opening, adjustment, closure, repayment and delayed
|
|
562
562
|
* withdrawal operations are supported.
|
|
563
563
|
*/
|
|
564
|
-
type OperationPreview =
|
|
564
|
+
type OperationPreview = PoolPositionOperationPreview | OpenStrategyPositionPreview | AdjustStrategyPositionPreview | ExitStrategyPositionPreview | RepayStrategyPositionPreview | DelayedStrategyPositionOperationPreview;
|
|
565
565
|
//#endregion
|
|
566
|
-
export { AccountHoldings, AccountMetrics, AccountProjection, AccountStateChange, CreditOperationMarket, ERROR_ADAPTER_CALL_OUTSIDE_BRACKET, ERROR_INVALID_TRANSACTION_VALUE, ERROR_MALFORMED_BRACKET, ERROR_NON_ADAPTER_CALL_IN_BRACKET, ERROR_UNPREVIEWABLE_ADAPTER_CALL, ERROR_UNPRICEABLE_TOKEN, ERROR_UNSUPPORTED_OUT_OF_BRACKET_CALL, Estimated, EstimatedProjection,
|
|
566
|
+
export { AccountHoldings, AccountMetrics, AccountProjection, AccountStateChange, AdjustStrategyPositionPreview, CreditOperationMarket, DelayedStrategyPositionOperationPreview, ERROR_ADAPTER_CALL_OUTSIDE_BRACKET, ERROR_INVALID_TRANSACTION_VALUE, ERROR_MALFORMED_BRACKET, ERROR_NON_ADAPTER_CALL_IN_BRACKET, ERROR_UNPREVIEWABLE_ADAPTER_CALL, ERROR_UNPRICEABLE_TOKEN, ERROR_UNSUPPORTED_OUT_OF_BRACKET_CALL, Estimated, EstimatedProjection, ExitStrategyPositionPreview, InstantStrategyPositionOperationPreview, OpenStrategyPositionPreview, OperationPreview, OperationPreviewError, PoolOperationType, PoolPositionOperationPreview, PreviewOperationInput, PreviewOperationOptions, RepayStrategyPositionPreview, RoutedField, asEstimated };
|
|
@@ -4,7 +4,7 @@ import "../../../model/index.js";
|
|
|
4
4
|
import { Asset } from "../../base/types.js";
|
|
5
5
|
import { MultiCall } from "../../types/transactions.js";
|
|
6
6
|
import { OnchainSDK } from "../../OnchainSDK.js";
|
|
7
|
-
import {
|
|
7
|
+
import { PreparedPrices } from "./types.js";
|
|
8
8
|
import "../../index.js";
|
|
9
9
|
import { Address } from "viem";
|
|
10
10
|
//#region src/onchain/accounts/intents/open-strategy.d.ts
|
|
@@ -32,7 +32,7 @@ interface OpenStrategyProps {
|
|
|
32
32
|
* hands back expected and floor balances from a single call, and `openCA` wants
|
|
33
33
|
* both `minQuota` and `averageQuota`, so there is nothing to gain by dropping one.
|
|
34
34
|
*/
|
|
35
|
-
interface OpenStrategyState extends Omit<AccountProjection, "assets" | "quotas">,
|
|
35
|
+
interface OpenStrategyState extends Omit<AccountProjection, "assets" | "quotas">, PreparedPrices {
|
|
36
36
|
/** Expected post-open balances. */
|
|
37
37
|
averageAssets: TokenAmount[];
|
|
38
38
|
/** Floor post-open balances after slippage. */
|
|
@@ -31,14 +31,14 @@ interface PathLossRate {
|
|
|
31
31
|
totalValuePriceImpact: bigint;
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
34
|
-
* The two prices only a planned walk can quote, carried by every
|
|
34
|
+
* The two prices only a planned walk can quote, carried by every `prepare`
|
|
35
35
|
* result beside its projection.
|
|
36
36
|
*
|
|
37
37
|
* A calldata preview is asked for neither: it reads a transaction that already
|
|
38
38
|
* names its amounts, and it reports what that transaction does rather than what
|
|
39
39
|
* the market charges while a form is open.
|
|
40
40
|
*/
|
|
41
|
-
interface
|
|
41
|
+
interface PreparedPrices {
|
|
42
42
|
/**
|
|
43
43
|
* What the routed legs lost to market depth. `undefined` where nothing was
|
|
44
44
|
* routed or nothing could be measured — never a manufactured zero.
|
|
@@ -60,7 +60,7 @@ interface SimulationPrices {
|
|
|
60
60
|
* {@link AccountProjection} vocabulary, plus the prices only a routed walk can
|
|
61
61
|
* report.
|
|
62
62
|
*/
|
|
63
|
-
interface OperationState extends AccountProjection,
|
|
63
|
+
interface OperationState extends AccountProjection, PreparedPrices {}
|
|
64
64
|
/**
|
|
65
65
|
* What a preview yields: the operation chain, the state it projects, and the
|
|
66
66
|
* calldata that realises it — or the reason the request is not viable.
|
|
@@ -395,4 +395,4 @@ type FinishIntentProps = StartIntentProps & {
|
|
|
395
395
|
claimable: ClaimableWithdrawal;
|
|
396
396
|
};
|
|
397
397
|
//#endregion
|
|
398
|
-
export { AddCollateralIntent, AdjustLeverageIntent, CreditAccountSlice, DelayableIntent, DelayedRoute, DelayedStart, DelayedStartResult, DepositStrategyIntent, FinishIntentProps, InstantRoute, IntentPreviewResult, IntentRoutesResult, OperationState, PathLossRate, RepayStrategyIntent, ResumableIntent, RouteRefusals,
|
|
398
|
+
export { AddCollateralIntent, AdjustLeverageIntent, CreditAccountSlice, DelayableIntent, DelayedRoute, DelayedStart, DelayedStartResult, DepositStrategyIntent, FinishIntentProps, InstantRoute, IntentPreviewResult, IntentRoutesResult, OperationState, PathLossRate, PreparedPrices, RepayStrategyIntent, ResumableIntent, RouteRefusals, StartIntent, StartIntentProps, WithdrawAssetIntent, WithdrawStrategyIntent };
|
|
@@ -19,7 +19,7 @@ declare function toCreditAccountSlice(ca: CreditAccountDataPayload): CreditAccou
|
|
|
19
19
|
* Reads an account by address and narrows it to {@link CreditAccountSlice}.
|
|
20
20
|
*
|
|
21
21
|
* The shared read model's `StrategyPosition` carries neither `tokens` nor
|
|
22
|
-
* `enabledTokensMask` / `creditFacade` / `totalDebtUSD`, so
|
|
22
|
+
* `enabledTokensMask` / `creditFacade` / `totalDebtUSD`, so preparing against
|
|
23
23
|
* an existing position costs one account read.
|
|
24
24
|
*
|
|
25
25
|
* @throws When the account is not found in the connected markets.
|
|
@@ -28,12 +28,12 @@ import { checkPrerequisites } from "./prerequisites/checkPrerequisites.js";
|
|
|
28
28
|
import "./prerequisites/index.js";
|
|
29
29
|
import { CreditAccountState, CreditAccountStateProps } from "./preview/CreditAccountState.js";
|
|
30
30
|
import { DetectedDelayedOperation, detectDelayedOperation } from "./preview/detectDelayedOperation.js";
|
|
31
|
-
import {
|
|
31
|
+
import { buildDelayedStrategyPositionOperationPreview } from "./preview/buildDelayedStrategyPositionOperationPreview.js";
|
|
32
32
|
import { classifyCloseOrRepay, isCloseOrRepay } from "./preview/detectCloseOrRepay.js";
|
|
33
33
|
import { DetectedDelayedClaim, detectDelayedClaim, resolveDelayedClaimIntent } from "./preview/detectDelayedClaim.js";
|
|
34
34
|
import { UnsupportedOperationError } from "./preview/errors.js";
|
|
35
|
-
import {
|
|
36
|
-
import { CloseOrRepayOperation,
|
|
35
|
+
import { previewAdjustStrategyPosition } from "./preview/previewAdjustStrategyPosition.js";
|
|
36
|
+
import { CloseOrRepayOperation, previewExitOrRepayStrategyPosition } from "./preview/previewExitOrRepayStrategyPosition.js";
|
|
37
37
|
import { previewOperation } from "./preview/previewOperation.js";
|
|
38
38
|
import { ReplayState, makeReplayState, replayInnerOperations } from "./preview/replayInnerOperations.js";
|
|
39
39
|
import { ReplayMulticallResult, ReplayableOperation, replayMulticall } from "./preview/replayMulticall.js";
|
|
@@ -41,4 +41,4 @@ import "./preview/index.js";
|
|
|
41
41
|
import { CheckOperationOptions, WeighedFactors, checkOperation, collateralIssue, marketIssues, quotaCountIssue } from "./validate/checkOperation.js";
|
|
42
42
|
import { checkSimulation } from "./validate/checkSimulation.js";
|
|
43
43
|
import "./validate/index.js";
|
|
44
|
-
export { AdapterOperation, AdapterOperationBase, AddCollateralOp, AllowanceDetail, AllowancePrerequisite, AllowanceResult, BalanceDetail, BalancePrerequisite, BalanceResult, BorrowLimitBinding, CheckOperationOptions, ClassifyInnerOperationsProps, CloseCreditAccountOperation, CloseOrRepayOperation, CompareBalancesOp, CreditAccountOperation, CreditAccountState, CreditAccountStateProps, DecreaseDebtOp, DetectedDelayedClaim, DetectedDelayedOperation, DirectTokenTransferOperation, ExtractTransfersResult, FacadeCallType, FacadeOperationMetadata, FacadeParsedCall, IncreaseDebtOp, InnerFacadeOperation, InnerOperation, IntentPreviewError, LiquidateCreditAccountOperation, MulticallOperation, OpenCreditAccountOperation, Operation, OperationMetadata, OuterFacadeOperation, PartialLiquidationOperation, PoolDepositOperation, PoolMintOperation, PoolOperation, PoolRedeemOperation, PoolWithdrawOperation, Prerequisite, PrerequisiteContext, PrerequisiteError, PrerequisiteKind, PrerequisiteOutcome, PrerequisiteResult, PreviewErrorDetails, PreviewErrorReason, PreviewIssue, PreviewOperationInput, PreviewOperationOptions, PreviewRefusal, RWAMulticallOperation, RWAOpenCreditAccountOperation, RWAOpenRequirementsDetail, RWAOpenRequirementsPrerequisite, RWAOpenRequirementsResult, RWAOperation, RWAOperationMetadata, ReplayMulticallResult, ReplayState, ReplayableOperation, StoreExpectedBalancesOp, TokenTransfer, TraceAdapterExt, TransferAlignmentError, UnexpectedFacadeEventOrderError, UnknownAdapterError, UnknownFacadeCallError, UnsupportedOperationError, UnsupportedPoolFunctionError, UnsupportedTargetError, UnsupportedZapperFunctionError, UpdateQuotaOp, WeighedFactors, WithdrawCollateralAlignmentError, WithdrawCollateralEventInfo, WithdrawCollateralOp,
|
|
44
|
+
export { AdapterOperation, AdapterOperationBase, AddCollateralOp, AllowanceDetail, AllowancePrerequisite, AllowanceResult, BalanceDetail, BalancePrerequisite, BalanceResult, BorrowLimitBinding, CheckOperationOptions, ClassifyInnerOperationsProps, CloseCreditAccountOperation, CloseOrRepayOperation, CompareBalancesOp, CreditAccountOperation, CreditAccountState, CreditAccountStateProps, DecreaseDebtOp, DetectedDelayedClaim, DetectedDelayedOperation, DirectTokenTransferOperation, ExtractTransfersResult, FacadeCallType, FacadeOperationMetadata, FacadeParsedCall, IncreaseDebtOp, InnerFacadeOperation, InnerOperation, IntentPreviewError, LiquidateCreditAccountOperation, MulticallOperation, OpenCreditAccountOperation, Operation, OperationMetadata, OuterFacadeOperation, PartialLiquidationOperation, PoolDepositOperation, PoolMintOperation, PoolOperation, PoolRedeemOperation, PoolWithdrawOperation, Prerequisite, PrerequisiteContext, PrerequisiteError, PrerequisiteKind, PrerequisiteOutcome, PrerequisiteResult, PreviewErrorDetails, PreviewErrorReason, PreviewIssue, PreviewOperationInput, PreviewOperationOptions, PreviewRefusal, RWAMulticallOperation, RWAOpenCreditAccountOperation, RWAOpenRequirementsDetail, RWAOpenRequirementsPrerequisite, RWAOpenRequirementsResult, RWAOperation, RWAOperationMetadata, ReplayMulticallResult, ReplayState, ReplayableOperation, StoreExpectedBalancesOp, TokenTransfer, TraceAdapterExt, TransferAlignmentError, UnexpectedFacadeEventOrderError, UnknownAdapterError, UnknownFacadeCallError, UnsupportedOperationError, UnsupportedPoolFunctionError, UnsupportedTargetError, UnsupportedZapperFunctionError, UpdateQuotaOp, WeighedFactors, WithdrawCollateralAlignmentError, WithdrawCollateralEventInfo, WithdrawCollateralOp, buildDelayedStrategyPositionOperationPreview, checkOperation, checkPrerequisites, checkSimulation, classifyCloseOrRepay, classifyInnerOperations, collateralIssue, detectDelayedClaim, detectDelayedOperation, extractAdapterCallTraces, extractTransfers, findFacadeCalls, isCloseOrRepay, isPoolOperation, isRWAOperation, makeReplayState, marketIssues, parseFacadeOperationCalldata, parseOperationCalldata, parsePoolOperationCalldata, parseRWAFactoryOperationCalldata, previewAdjustStrategyPosition, previewExitOrRepayStrategyPosition, previewOperation, quotaCountIssue, raise, refuse, replayInnerOperations, replayMulticall, resolveDelayedClaimIntent };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { InstantStrategyPositionOperationPreview } from "../../model/previews.js";
|
|
2
2
|
import "../../model/index.js";
|
|
3
3
|
import { ConvertFn } from "../../onchain/market/oracle/types.js";
|
|
4
4
|
import { OnchainSDK } from "../../onchain/OnchainSDK.js";
|
|
@@ -6,7 +6,7 @@ import "../../onchain/index.js";
|
|
|
6
6
|
import { CreditAccountState } from "./CreditAccountState.js";
|
|
7
7
|
import { DetectedDelayedOperation } from "./detectDelayedOperation.js";
|
|
8
8
|
import { Address } from "viem";
|
|
9
|
-
//#region src/preview/preview/
|
|
9
|
+
//#region src/preview/preview/buildDelayedStrategyPositionOperationPreview.d.ts
|
|
10
10
|
/**
|
|
11
11
|
* Builds the best-effort preview of the account state after the detected
|
|
12
12
|
* delayed withdrawal is claimed and its intent (if any) is resumed:
|
|
@@ -29,6 +29,6 @@ import { Address } from "viem";
|
|
|
29
29
|
* @param sdk - Market data source for the position metrics of the resulting
|
|
30
30
|
* state; read synchronously, no network access.
|
|
31
31
|
*/
|
|
32
|
-
declare function
|
|
32
|
+
declare function buildDelayedStrategyPositionOperationPreview(afterInstant: CreditAccountState, before: CreditAccountState, detected: DetectedDelayedOperation, convert: ConvertFn, receivedToken: Address, sdk: OnchainSDK): InstantStrategyPositionOperationPreview;
|
|
33
33
|
//#endregion
|
|
34
|
-
export {
|
|
34
|
+
export { buildDelayedStrategyPositionOperationPreview };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { CreditAccountState, CreditAccountStateProps } from "./CreditAccountState.js";
|
|
2
2
|
import { DetectedDelayedOperation, detectDelayedOperation } from "./detectDelayedOperation.js";
|
|
3
|
-
import {
|
|
3
|
+
import { buildDelayedStrategyPositionOperationPreview } from "./buildDelayedStrategyPositionOperationPreview.js";
|
|
4
4
|
import { classifyCloseOrRepay, isCloseOrRepay } from "./detectCloseOrRepay.js";
|
|
5
5
|
import { DetectedDelayedClaim, detectDelayedClaim, resolveDelayedClaimIntent } from "./detectDelayedClaim.js";
|
|
6
6
|
import { UnsupportedOperationError } from "./errors.js";
|
|
7
|
-
import {
|
|
8
|
-
import { CloseOrRepayOperation,
|
|
7
|
+
import { previewAdjustStrategyPosition } from "./previewAdjustStrategyPosition.js";
|
|
8
|
+
import { CloseOrRepayOperation, previewExitOrRepayStrategyPosition } from "./previewExitOrRepayStrategyPosition.js";
|
|
9
9
|
import { previewOperation } from "./previewOperation.js";
|
|
10
10
|
import { ReplayState, makeReplayState, replayInnerOperations } from "./replayInnerOperations.js";
|
|
11
11
|
import { ReplayMulticallResult, ReplayableOperation, replayMulticall } from "./replayMulticall.js";
|
|
12
|
-
export { CloseOrRepayOperation, CreditAccountState, CreditAccountStateProps, DetectedDelayedClaim, DetectedDelayedOperation, ReplayMulticallResult, ReplayState, ReplayableOperation, UnsupportedOperationError,
|
|
12
|
+
export { CloseOrRepayOperation, CreditAccountState, CreditAccountStateProps, DetectedDelayedClaim, DetectedDelayedOperation, ReplayMulticallResult, ReplayState, ReplayableOperation, UnsupportedOperationError, buildDelayedStrategyPositionOperationPreview, classifyCloseOrRepay, detectDelayedClaim, detectDelayedOperation, isCloseOrRepay, makeReplayState, previewAdjustStrategyPosition, previewExitOrRepayStrategyPosition, previewOperation, replayInnerOperations, replayMulticall, resolveDelayedClaimIntent };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AdjustStrategyPositionPreview } from "../../model/previews.js";
|
|
2
2
|
import "../../model/index.js";
|
|
3
3
|
import { PluginsMap } from "../../onchain/plugins/types.js";
|
|
4
4
|
import "../../onchain/index.js";
|
|
@@ -6,7 +6,7 @@ import { MulticallOperation } from "../parse/types-facades.js";
|
|
|
6
6
|
import { RWAMulticallOperation } from "../parse/types-rwa.js";
|
|
7
7
|
import { PreviewOperationInput, PreviewOperationOptions } from "../types.js";
|
|
8
8
|
import "../parse/index.js";
|
|
9
|
-
//#region src/preview/preview/
|
|
9
|
+
//#region src/preview/preview/previewAdjustStrategyPosition.d.ts
|
|
10
10
|
/**
|
|
11
11
|
* Previews a `multicall`/`botMulticall` operation on an existing credit
|
|
12
12
|
* account: threads the multicall through {@link replayMulticall} over the
|
|
@@ -14,6 +14,6 @@ import "../parse/index.js";
|
|
|
14
14
|
* minimal guaranteed post-state alongside the changes relative to the
|
|
15
15
|
* pre-state.
|
|
16
16
|
*/
|
|
17
|
-
declare function
|
|
17
|
+
declare function previewAdjustStrategyPosition<P extends PluginsMap>(input: PreviewOperationInput<P>, operation: MulticallOperation | RWAMulticallOperation, options: PreviewOperationOptions<true>): Promise<AdjustStrategyPositionPreview>;
|
|
18
18
|
//#endregion
|
|
19
|
-
export {
|
|
19
|
+
export { previewAdjustStrategyPosition };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ExitStrategyPositionPreview, RepayStrategyPositionPreview } from "../../model/previews.js";
|
|
2
2
|
import "../../model/index.js";
|
|
3
3
|
import { PluginsMap } from "../../onchain/plugins/types.js";
|
|
4
4
|
import "../../onchain/index.js";
|
|
@@ -6,13 +6,13 @@ import { CloseCreditAccountOperation, MulticallOperation } from "../parse/types-
|
|
|
6
6
|
import { RWAMulticallOperation } from "../parse/types-rwa.js";
|
|
7
7
|
import { PreviewOperationInput, PreviewOperationOptions } from "../types.js";
|
|
8
8
|
import "../parse/index.js";
|
|
9
|
-
//#region src/preview/preview/
|
|
9
|
+
//#region src/preview/preview/previewExitOrRepayStrategyPosition.d.ts
|
|
10
10
|
/**
|
|
11
11
|
* Any parsed operation that fully closes or repays a credit account: the
|
|
12
12
|
* facade `closeCreditAccount` entry point (permanent closure) or a plain
|
|
13
13
|
* multicall detected by `isCloseOrRepay` (`decreaseDebt(MAX)`).
|
|
14
14
|
*/
|
|
15
15
|
type CloseOrRepayOperation = CloseCreditAccountOperation | MulticallOperation | RWAMulticallOperation;
|
|
16
|
-
declare function
|
|
16
|
+
declare function previewExitOrRepayStrategyPosition<P extends PluginsMap>(input: PreviewOperationInput<P>, operation: CloseOrRepayOperation, permanent: boolean, options: PreviewOperationOptions<true>): Promise<ExitStrategyPositionPreview | RepayStrategyPositionPreview>;
|
|
17
17
|
//#endregion
|
|
18
|
-
export { CloseOrRepayOperation,
|
|
18
|
+
export { CloseOrRepayOperation, previewExitOrRepayStrategyPosition };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { OpenStrategyPositionPreview } from "../../model/previews.js";
|
|
2
|
+
import "../../model/index.js";
|
|
3
|
+
import { PluginsMap } from "../../onchain/plugins/types.js";
|
|
4
|
+
import "../../onchain/index.js";
|
|
5
|
+
import { OpenCreditAccountOperation } from "../parse/types-facades.js";
|
|
6
|
+
import { RWAOpenCreditAccountOperation } from "../parse/types-rwa.js";
|
|
7
|
+
import { PreviewOperationInput } from "../types.js";
|
|
8
|
+
import "../parse/index.js";
|
|
9
|
+
//#region src/preview/preview/previewOpenStrategyPosition.d.ts
|
|
10
|
+
declare function previewOpenStrategyPosition<P extends PluginsMap>(input: PreviewOperationInput<P>, operation: OpenCreditAccountOperation | RWAOpenCreditAccountOperation): Promise<OpenStrategyPositionPreview>;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { previewOpenStrategyPosition };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { PoolPositionOperationPreview } from "../../model/previews.js";
|
|
2
|
+
import "../../model/index.js";
|
|
3
|
+
import { PluginsMap } from "../../onchain/plugins/types.js";
|
|
4
|
+
import "../../onchain/index.js";
|
|
5
|
+
import { PoolOperation } from "../parse/types-pools.js";
|
|
6
|
+
import { PreviewOperationInput, PreviewOperationOptions } from "../types.js";
|
|
7
|
+
import "../parse/index.js";
|
|
8
|
+
//#region src/preview/preview/previewPoolPositionOperation.d.ts
|
|
9
|
+
declare function previewPoolPositionOperation<P extends PluginsMap>(input: PreviewOperationInput<P>, operation: PoolOperation, options?: PreviewOperationOptions): Promise<PoolPositionOperationPreview>;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { previewPoolPositionOperation };
|
|
@@ -4,15 +4,15 @@ import { Asset } from "../../onchain/base/types.js";
|
|
|
4
4
|
import { SecuritizeRegisterMessage } from "../../onchain/market/rwa/securitize/types.js";
|
|
5
5
|
import { RawTx } from "../../onchain/types/transactions.js";
|
|
6
6
|
import "../../onchain/index.js";
|
|
7
|
-
import {
|
|
7
|
+
import { LpPrepare, OpenStrategyPrepare, StrategyPrepare } from "../prepare/types.js";
|
|
8
8
|
import "../prepare/index.js";
|
|
9
9
|
import { Address } from "viem";
|
|
10
10
|
//#region src/sdk/execute/types.d.ts
|
|
11
11
|
/**
|
|
12
12
|
* A pool deposit, withdrawal or redemption, as
|
|
13
13
|
* {@link IOpportunitiesPrepare.deposit} / {@link IOpportunitiesPrepare.withdraw}
|
|
14
|
-
* / {@link IOpportunitiesPrepare.redeem} priced it. The
|
|
15
|
-
* tokens on both sides and the zapper, so nothing else is needed to encode
|
|
14
|
+
* / {@link IOpportunitiesPrepare.redeem} priced it. The prepared state carries
|
|
15
|
+
* the tokens on both sides and the zapper, so nothing else is needed to encode
|
|
16
16
|
* the call.
|
|
17
17
|
**/
|
|
18
18
|
interface PoolPrepareRequest {
|
|
@@ -21,13 +21,13 @@ interface PoolPrepareRequest {
|
|
|
21
21
|
pool: Address;
|
|
22
22
|
wallet: Address;
|
|
23
23
|
op: "deposit" | "withdraw" | "redeem";
|
|
24
|
-
sim: Extract<
|
|
24
|
+
sim: Extract<LpPrepare, {
|
|
25
25
|
ok: true;
|
|
26
26
|
}>;
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
29
29
|
* Opening a new position, from a viable
|
|
30
|
-
* {@link IOpportunitiesPrepare.openNewStrategy} result. The
|
|
30
|
+
* {@link IOpportunitiesPrepare.openNewStrategy} result. The prepared state
|
|
31
31
|
* values collateral in underlying only, so the wallet's actual collateral
|
|
32
32
|
* assets and the native value to attach come from the caller.
|
|
33
33
|
**/
|
|
@@ -36,7 +36,7 @@ interface OpenPrepareRequest {
|
|
|
36
36
|
chainId: ChainId;
|
|
37
37
|
creditManager: Address;
|
|
38
38
|
wallet: Address;
|
|
39
|
-
sim: Extract<
|
|
39
|
+
sim: Extract<OpenStrategyPrepare, {
|
|
40
40
|
ok: true;
|
|
41
41
|
}>;
|
|
42
42
|
/** What leaves the wallet, token by token. */
|
|
@@ -56,20 +56,20 @@ interface OpenPrepareRequest {
|
|
|
56
56
|
}
|
|
57
57
|
/**
|
|
58
58
|
* Any of the five operations on an existing account, from a viable
|
|
59
|
-
* {@link
|
|
59
|
+
* {@link StrategyPrepare}: the facade multicall is the result's `calls`.
|
|
60
60
|
**/
|
|
61
61
|
interface AccountPrepareRequest {
|
|
62
62
|
kind: "account";
|
|
63
63
|
chainId: ChainId;
|
|
64
64
|
creditAccount: Address;
|
|
65
65
|
wallet: Address;
|
|
66
|
-
sim: Extract<
|
|
66
|
+
sim: Extract<StrategyPrepare, {
|
|
67
67
|
ok: true;
|
|
68
68
|
}>;
|
|
69
69
|
}
|
|
70
70
|
/**
|
|
71
71
|
* What {@link IOpportunitiesExecute.buildTx} turns into a transaction: a
|
|
72
|
-
* `prepare` result plus the few facts about the wallet the
|
|
72
|
+
* `prepare` result plus the few facts about the wallet the preparation does not
|
|
73
73
|
* carry.
|
|
74
74
|
**/
|
|
75
75
|
type PrepareRequest = PoolPrepareRequest | OpenPrepareRequest | AccountPrepareRequest;
|
|
@@ -82,11 +82,11 @@ type PrepareRequest = PoolPrepareRequest | OpenPrepareRequest | AccountPrepareRe
|
|
|
82
82
|
interface IOpportunitiesExecute {
|
|
83
83
|
/**
|
|
84
84
|
* The transaction to sign, from a `prepare` result. No second round of math:
|
|
85
|
-
* `account` requests submit the
|
|
86
|
-
*
|
|
87
|
-
*
|
|
85
|
+
* `account` requests submit the result's own multicall, `open` requests hand
|
|
86
|
+
* the state's router path and quotas to `openCA`, `pool` requests encode the
|
|
87
|
+
* deposit / redeem the result priced.
|
|
88
88
|
*
|
|
89
|
-
* @throws on a
|
|
89
|
+
* @throws on a `prepare` result that is not `ok`; when a `pool` request names a
|
|
90
90
|
* route the pool has no metadata for, or one the pool does not accept a
|
|
91
91
|
* transaction for (RWA on-demand deposits)
|
|
92
92
|
**/
|
|
@@ -2,7 +2,7 @@ import { BorrowLimitBinding, IntentPreviewError, PreviewErrorDetails, PreviewErr
|
|
|
2
2
|
import { LeverageBand } from "../onchain/accounts/intents/leverage-band.js";
|
|
3
3
|
import { OperationState, PathLossRate } from "../onchain/accounts/intents/types.js";
|
|
4
4
|
import { ILiquidations, ILiquidationsByMode } from "./liquidations/types.js";
|
|
5
|
-
import { AddCollateralParams, AdjustLeverageParams,
|
|
5
|
+
import { AddCollateralParams, AdjustLeverageParams, DelayedStrategyPrepare, DepositStrategyParams, FinalizeParams, IOpportunitiesPrepare, LpParams, LpPrepare, LpRedeemParams, OpenStrategyParams, OpenStrategyPrepare, PoolInput, PositionInput, PrepareOptions, RepayStrategyParams, StrategyInput, StrategyPrepare, StrategyRoutesPrepare, WithdrawCollateralParams, WithdrawStrategyParams } from "./prepare/types.js";
|
|
6
6
|
import { ChainOf, PrepareApi } from "./prepare/PrepareApi.js";
|
|
7
7
|
import "./prepare/index.js";
|
|
8
8
|
import { AccountPrepareRequest, IOpportunitiesExecute, OpenPrepareRequest, PoolPrepareRequest, PrepareRequest } from "./execute/types.js";
|
|
@@ -34,4 +34,4 @@ import { SourceUnavailableError } from "./errors/SourceUnavailableError.js";
|
|
|
34
34
|
import { assertSameChains } from "./errors/assertSameChains.js";
|
|
35
35
|
import { everyChainFailed } from "./errors/everyChainFailed.js";
|
|
36
36
|
import "./errors/index.js";
|
|
37
|
-
export { AbstractNamespace, AccountPrepareRequest, AddCollateralParams, AdjustLeverageParams, AllSourcesFailedError, BorrowLimitBinding, ChainOf, ChainRef, DEFAULT_MAX_OFFCHAIN_LAG, DEFAULT_MAX_STATE_AGE,
|
|
37
|
+
export { AbstractNamespace, AccountPrepareRequest, AddCollateralParams, AdjustLeverageParams, AllSourcesFailedError, BorrowLimitBinding, ChainOf, ChainRef, DEFAULT_MAX_OFFCHAIN_LAG, DEFAULT_MAX_STATE_AGE, DelayedStrategyPrepare, DepositStrategyParams, EnsureFreshChains, type EntityMerger, ExecuteApi, type FilterResult, FinalizeParams, GearboxSDK, GearboxSDKOptions, IGearboxSDK, ILiquidations, ILiquidationsByMode, INotices, INoticesByMode, IOpportunities, IOpportunitiesBase, IOpportunitiesByMode, IOpportunitiesExecute, IOpportunitiesOffchainBranch, IOpportunitiesOffchainOnly, IOpportunitiesOnchainBranch, IOpportunitiesOnchainOnly, IOpportunitiesPrepare, IOpportunityMergers, IPositionMergers, IPositions, IPositionsBase, IPositionsByMode, IPositionsOffchainBranch, IPositionsOffchainOnly, IPositionsOnchainBranch, IPositionsOnchainOnly, IPreview, IPreviewByMode, IntentPreviewError, type LeverageBand, LiquidationsNamespace, type ListMerger, LpParams, LpPrepare, LpRedeemParams, type MergeListResult, MergedQuery, MissingSourceError, Mode, NamespaceOptions, NoSourceServedError, OffchainByMode, OffchainSource, OnchainByMode, OnchainSource, OpenPrepareRequest, OpenStrategyParams, OpenStrategyPrepare, type OperationState, OpportunitiesNamespace, type PathLossRate, PlainMultichainSDKOptions, PoolInput, PoolPrepareRequest, PositionInput, PositionsNamespace, PrepareApi, PrepareOptions, PrepareRequest, PreviewErrorDetails, PreviewErrorReason, PreviewIssue, PreviewNamespace, PreviewRefusal, RepayStrategyParams, SourceChainMismatchError, SourceUnavailableError, StrategyInput, StrategyPrepare, StrategyRoutesPrepare, WithdrawCollateralParams, WithdrawStrategyParams, assertSameChains, everyChainFailed, filterResponse, mergeChainList, mergeChainOne, raise, refuse };
|
|
@@ -72,7 +72,8 @@ interface IOpportunitiesOffchainOnly {
|
|
|
72
72
|
**/
|
|
73
73
|
interface IOpportunitiesOnchainOnly {
|
|
74
74
|
/**
|
|
75
|
-
*
|
|
75
|
+
* What a deposit, withdrawal or leverage change would do, and the calldata
|
|
76
|
+
* that does it.
|
|
76
77
|
*
|
|
77
78
|
* Absent in `offchain` mode: every one of them reads live account and pool
|
|
78
79
|
* state, and the strategy flows additionally need the pathfinder for real swap
|
|
@@ -8,14 +8,14 @@ import { MultichainSDK } from "../../onchain/MultichainSDK.js";
|
|
|
8
8
|
import { ChainQueryOneProps, MultichainConstruct } from "../../onchain/base/MultichainConstruct.js";
|
|
9
9
|
import { LeverageBand } from "../../onchain/accounts/intents/leverage-band.js";
|
|
10
10
|
import "../../onchain/index.js";
|
|
11
|
-
import { AddCollateralParams, AdjustLeverageParams, DepositStrategyParams, FinalizeParams, IOpportunitiesPrepare, LpParams,
|
|
11
|
+
import { AddCollateralParams, AdjustLeverageParams, DepositStrategyParams, FinalizeParams, IOpportunitiesPrepare, LpParams, LpPrepare, LpRedeemParams, OpenStrategyParams, OpenStrategyPrepare, PoolInput, PositionInput, RepayStrategyParams, StrategyInput, StrategyPrepare, StrategyRoutesPrepare, WithdrawCollateralParams, WithdrawStrategyParams } from "./types.js";
|
|
12
12
|
import { EnsureFreshChains } from "../types.js";
|
|
13
13
|
import { Address } from "viem";
|
|
14
14
|
//#region src/sdk/prepare/PrepareApi.d.ts
|
|
15
15
|
/**
|
|
16
16
|
* The chain's SDK, resolved on the spot.
|
|
17
17
|
*
|
|
18
|
-
* The LP
|
|
18
|
+
* The LP methods need it synchronously, because they only do arithmetic on
|
|
19
19
|
* loaded state and have nothing to await; the execute namespace resolves its
|
|
20
20
|
* chain the same way.
|
|
21
21
|
**/
|
|
@@ -28,7 +28,7 @@ type ChainOf = (chainId: ChainId) => OnchainSDK;
|
|
|
28
28
|
* protocol knowledge stays in `CreditAccountOperationsService` and
|
|
29
29
|
* `PoolService`.
|
|
30
30
|
*
|
|
31
|
-
* A
|
|
31
|
+
* A prepared operation names one chain, so it reads through
|
|
32
32
|
* {@link MultichainConstruct.queryChain}: there is no second source to fall back
|
|
33
33
|
* to, hence a chain the SDK does not cover, or one that fails the read, throws
|
|
34
34
|
* rather than answering with empty metadata.
|
|
@@ -40,31 +40,31 @@ declare class PrepareApi extends MultichainConstruct implements IOpportunitiesPr
|
|
|
40
40
|
/**
|
|
41
41
|
* {@inheritDoc IOpportunitiesPrepare.finalize}
|
|
42
42
|
**/
|
|
43
|
-
finalize(position: PositionInput, params: FinalizeParams): Promise<DataResponse<
|
|
43
|
+
finalize(position: PositionInput, params: FinalizeParams): Promise<DataResponse<StrategyPrepare>>;
|
|
44
44
|
/**
|
|
45
45
|
* {@inheritDoc IOpportunitiesPrepare.deposit}
|
|
46
46
|
**/
|
|
47
|
-
deposit(pool: PoolInput, params: LpParams):
|
|
47
|
+
deposit(pool: PoolInput, params: LpParams): LpPrepare;
|
|
48
48
|
/**
|
|
49
49
|
* {@inheritDoc IOpportunitiesPrepare.withdraw}
|
|
50
50
|
**/
|
|
51
|
-
withdraw(pool: PoolInput, params: LpParams):
|
|
51
|
+
withdraw(pool: PoolInput, params: LpParams): LpPrepare;
|
|
52
52
|
/**
|
|
53
53
|
* {@inheritDoc IOpportunitiesPrepare.redeem}
|
|
54
54
|
**/
|
|
55
|
-
redeem(pool: PoolInput, params: LpRedeemParams):
|
|
55
|
+
redeem(pool: PoolInput, params: LpRedeemParams): LpPrepare;
|
|
56
56
|
/**
|
|
57
57
|
* {@inheritDoc IOpportunitiesPrepare.openNewStrategy}
|
|
58
58
|
**/
|
|
59
|
-
openNewStrategy(strategy: StrategyInput, params: OpenStrategyParams): Promise<DataResponse<
|
|
59
|
+
openNewStrategy(strategy: StrategyInput, params: OpenStrategyParams): Promise<DataResponse<OpenStrategyPrepare>>;
|
|
60
60
|
/**
|
|
61
61
|
* {@inheritDoc IOpportunitiesPrepare.depositStrategy}
|
|
62
62
|
**/
|
|
63
|
-
depositStrategy(position: PositionInput, params: DepositStrategyParams): Promise<DataResponse<
|
|
63
|
+
depositStrategy(position: PositionInput, params: DepositStrategyParams): Promise<DataResponse<StrategyPrepare>>;
|
|
64
64
|
/**
|
|
65
65
|
* {@inheritDoc IOpportunitiesPrepare.withdrawStrategy}
|
|
66
66
|
**/
|
|
67
|
-
withdrawStrategy(position: PositionInput, params: WithdrawStrategyParams): Promise<DataResponse<
|
|
67
|
+
withdrawStrategy(position: PositionInput, params: WithdrawStrategyParams): Promise<DataResponse<StrategyRoutesPrepare>>;
|
|
68
68
|
/**
|
|
69
69
|
* {@inheritDoc IOpportunitiesPrepare.maxWithdraw}
|
|
70
70
|
**/
|
|
@@ -72,7 +72,7 @@ declare class PrepareApi extends MultichainConstruct implements IOpportunitiesPr
|
|
|
72
72
|
/**
|
|
73
73
|
* {@inheritDoc IOpportunitiesPrepare.repayStrategy}
|
|
74
74
|
**/
|
|
75
|
-
repayStrategy(position: PositionInput, params: RepayStrategyParams): Promise<DataResponse<
|
|
75
|
+
repayStrategy(position: PositionInput, params: RepayStrategyParams): Promise<DataResponse<StrategyPrepare>>;
|
|
76
76
|
/**
|
|
77
77
|
* {@inheritDoc IOpportunitiesPrepare.maxRepay}
|
|
78
78
|
**/
|
|
@@ -80,15 +80,15 @@ declare class PrepareApi extends MultichainConstruct implements IOpportunitiesPr
|
|
|
80
80
|
/**
|
|
81
81
|
* {@inheritDoc IOpportunitiesPrepare.adjustLeverage}
|
|
82
82
|
**/
|
|
83
|
-
adjustLeverage(position: PositionInput, params: AdjustLeverageParams): Promise<DataResponse<
|
|
83
|
+
adjustLeverage(position: PositionInput, params: AdjustLeverageParams): Promise<DataResponse<StrategyRoutesPrepare>>;
|
|
84
84
|
/**
|
|
85
85
|
* {@inheritDoc IOpportunitiesPrepare.addCollateral}
|
|
86
86
|
**/
|
|
87
|
-
addCollateral(position: PositionInput, params: AddCollateralParams): Promise<DataResponse<
|
|
87
|
+
addCollateral(position: PositionInput, params: AddCollateralParams): Promise<DataResponse<StrategyPrepare>>;
|
|
88
88
|
/**
|
|
89
89
|
* {@inheritDoc IOpportunitiesPrepare.withdrawCollateral}
|
|
90
90
|
**/
|
|
91
|
-
withdrawCollateral(position: PositionInput, params: WithdrawCollateralParams): Promise<DataResponse<
|
|
91
|
+
withdrawCollateral(position: PositionInput, params: WithdrawCollateralParams): Promise<DataResponse<StrategyPrepare>>;
|
|
92
92
|
/**
|
|
93
93
|
* {@inheritDoc IOpportunitiesPrepare.leverageBand}
|
|
94
94
|
**/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BorrowLimitBinding, IntentPreviewError, PreviewErrorDetails, PreviewErrorReason, PreviewIssue, PreviewRefusal, raise, refuse } from "../../onchain/validation/refusal.js";
|
|
2
2
|
import { LeverageBand } from "../../onchain/accounts/intents/leverage-band.js";
|
|
3
3
|
import { OperationState, PathLossRate } from "../../onchain/accounts/intents/types.js";
|
|
4
|
-
import { AddCollateralParams, AdjustLeverageParams,
|
|
4
|
+
import { AddCollateralParams, AdjustLeverageParams, DelayedStrategyPrepare, DepositStrategyParams, FinalizeParams, IOpportunitiesPrepare, LpParams, LpPrepare, LpRedeemParams, OpenStrategyParams, OpenStrategyPrepare, PoolInput, PositionInput, PrepareOptions, RepayStrategyParams, StrategyInput, StrategyPrepare, StrategyRoutesPrepare, WithdrawCollateralParams, WithdrawStrategyParams } from "./types.js";
|
|
5
5
|
import { ChainOf, PrepareApi } from "./PrepareApi.js";
|
|
6
|
-
export { AddCollateralParams, AdjustLeverageParams, BorrowLimitBinding, ChainOf,
|
|
6
|
+
export { AddCollateralParams, AdjustLeverageParams, BorrowLimitBinding, ChainOf, DelayedStrategyPrepare, DepositStrategyParams, FinalizeParams, IOpportunitiesPrepare, IntentPreviewError, type LeverageBand, LpParams, LpPrepare, LpRedeemParams, OpenStrategyParams, OpenStrategyPrepare, type OperationState, type PathLossRate, PoolInput, PositionInput, PrepareApi, PrepareOptions, PreviewErrorDetails, PreviewErrorReason, PreviewIssue, PreviewRefusal, RepayStrategyParams, StrategyInput, StrategyPrepare, StrategyRoutesPrepare, WithdrawCollateralParams, WithdrawStrategyParams, raise, refuse };
|