@morpho-org/morpho-sdk 9.8.0 → 10.0.0
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/MIGRATION-v9-to-v10.md +114 -0
- package/README.md +109 -13
- package/lib/cjs/actions/blue/common.js +4 -2
- package/lib/cjs/actions/blue/withdrawBuyCallback.js +2 -1
- package/lib/cjs/actions/bundles/common.js +20 -14
- package/lib/cjs/actions/bundles/resolveBundlesTokenRequirements.d.ts +3 -4
- package/lib/cjs/actions/bundles/resolveBundlesTokenRequirements.js +3 -2
- package/lib/cjs/actions/midnight/cancelAndMake.d.ts +2 -1
- package/lib/cjs/actions/midnight/cancelAndMake.js +2 -1
- package/lib/cjs/actions/midnight/cancelOffers.d.ts +54 -0
- package/lib/cjs/actions/midnight/cancelOffers.js +108 -0
- package/lib/cjs/actions/midnight/index.d.ts +1 -0
- package/lib/cjs/actions/midnight/index.js +1 -0
- package/lib/cjs/actions/midnight/supplyCollateralBatch.js +4 -2
- package/lib/cjs/actions/midnight/supplyCollateralTakeBorrow.d.ts +1 -1
- package/lib/cjs/actions/midnight/supplyCollateralTakeBorrow.js +3 -2
- package/lib/cjs/actions/midnight/takeBorrow.d.ts +1 -1
- package/lib/cjs/actions/midnight/takeBorrow.js +3 -2
- package/lib/cjs/actions/midnight/takeLend.d.ts +1 -1
- package/lib/cjs/actions/midnight/takeLend.js +3 -2
- package/lib/cjs/actions/midnight/takeRepayWithdrawCollateral.d.ts +1 -1
- package/lib/cjs/actions/midnight/takeRepayWithdrawCollateral.js +3 -2
- package/lib/cjs/actions/midnight/takeWithdraw.d.ts +1 -1
- package/lib/cjs/actions/midnight/takeWithdraw.js +3 -2
- package/lib/cjs/actions/midnight/withdrawCollateralBatch.js +4 -2
- package/lib/cjs/actions/requirements/blue/getBlueAuthorizationRequirement.d.ts +3 -4
- package/lib/cjs/actions/requirements/blue/getBlueAuthorizationRequirement.js +1 -1
- package/lib/cjs/actions/requirements/encode/encodeBlueSignatureAuthorization.d.ts +4 -6
- package/lib/cjs/actions/requirements/encode/encodeBlueSignatureAuthorization.js +3 -3
- package/lib/cjs/actions/requirements/encode/encodeErc20Permit.d.ts +4 -6
- package/lib/cjs/actions/requirements/encode/encodeErc20Permit.js +3 -3
- package/lib/cjs/actions/requirements/encode/encodeErc20Permit2SignatureTransfer.d.ts +5 -6
- package/lib/cjs/actions/requirements/encode/encodeErc20Permit2SignatureTransfer.js +5 -13
- package/lib/cjs/actions/requirements/encode/encodeVaultSharesPermit.d.ts +3 -5
- package/lib/cjs/actions/requirements/encode/encodeVaultSharesPermit.js +26 -23
- package/lib/cjs/actions/requirements/midnight/getMidnightApprovalRequirements.js +2 -1
- package/lib/cjs/actions/requirements/midnight/getMidnightAuthorizationRequirement.js +2 -1
- package/lib/cjs/actions/vaultV1/inKindRedeem.js +6 -3
- package/lib/cjs/actions/vaultV1/migrateToV2.js +1 -1
- package/lib/cjs/actions/vaultV2/forceWithdraw.js +4 -2
- package/lib/cjs/actions/vaultV2/inKindRedeem.js +4 -2
- package/lib/cjs/entities/blue/blue.d.ts +34 -28
- package/lib/cjs/entities/blue/blue.js +107 -77
- package/lib/cjs/entities/midnight/deadline.d.ts +2 -2
- package/lib/cjs/entities/midnight/deadline.js +4 -3
- package/lib/cjs/entities/midnight/midnight.d.ts +49 -51
- package/lib/cjs/entities/midnight/midnight.js +158 -138
- package/lib/cjs/entities/midnight/publication.d.ts +2 -0
- package/lib/cjs/entities/midnight/publication.js +193 -138
- package/lib/cjs/entities/midnight/types.d.ts +4 -4
- package/lib/cjs/entities/requirements/assertContractCode.js +4 -2
- package/lib/cjs/entities/requirements/getBundlesTokenRequirements.d.ts +3 -5
- package/lib/cjs/entities/requirements/getBundlesTokenRequirements.js +24 -28
- package/lib/cjs/entities/requirements/getErc2612Permit.js +10 -5
- package/lib/cjs/entities/requirements/getVaultBundlesSharesRequirements.d.ts +5 -4
- package/lib/cjs/entities/requirements/getVaultBundlesSharesRequirements.js +8 -2
- package/lib/cjs/entities/requirements/getVaultV1InKindRedeemRequirements.d.ts +21 -0
- package/lib/cjs/entities/requirements/getVaultV1InKindRedeemRequirements.js +111 -0
- package/lib/cjs/entities/requirements/getVaultV2ForceWithdrawRequirements.d.ts +20 -0
- package/lib/cjs/entities/requirements/getVaultV2ForceWithdrawRequirements.js +76 -0
- package/lib/cjs/entities/requirements/getVaultV2InKindRedeemRequirements.d.ts +21 -0
- package/lib/cjs/entities/requirements/getVaultV2InKindRedeemRequirements.js +93 -0
- package/lib/cjs/entities/vaultV1/inKindRedeemQuote.d.ts +25 -0
- package/lib/cjs/entities/vaultV1/inKindRedeemQuote.js +85 -0
- package/lib/cjs/entities/vaultV1/migrateToV2Quote.d.ts +20 -0
- package/lib/cjs/entities/vaultV1/migrateToV2Quote.js +37 -0
- package/lib/cjs/entities/vaultV1/vaultV1.d.ts +12 -12
- package/lib/cjs/entities/vaultV1/vaultV1.js +90 -194
- package/lib/cjs/entities/vaultV2/forceWithdrawQuote.d.ts +25 -0
- package/lib/cjs/entities/vaultV2/forceWithdrawQuote.js +189 -0
- package/lib/cjs/entities/vaultV2/inKindRedeemQuote.d.ts +28 -0
- package/lib/cjs/entities/vaultV2/inKindRedeemQuote.js +110 -0
- package/lib/cjs/entities/vaultV2/vaultV2.d.ts +16 -16
- package/lib/cjs/entities/vaultV2/vaultV2.js +94 -385
- package/lib/cjs/entities/vaultV2BlueReallocationData.d.ts +14 -0
- package/lib/cjs/entities/vaultV2BlueReallocationData.js +1599 -883
- package/lib/cjs/errors.d.ts +1 -1
- package/lib/cjs/errors.js +2 -1
- package/lib/cjs/helpers/deadShares.js +83 -47
- package/lib/cjs/helpers/encodeMidnightCalldata.js +4 -2
- package/lib/cjs/helpers/metadata.d.ts +14 -2
- package/lib/cjs/helpers/metadata.js +49 -8
- package/lib/cjs/helpers/previewVaultV2ForceWithdraw.js +44 -27
- package/lib/cjs/helpers/previewVaultV2InKindRedeem.js +11 -2
- package/lib/cjs/helpers/utilization.js +10 -5
- package/lib/cjs/helpers/validate.js +88 -67
- package/lib/cjs/helpers/validateMidnightBounds.js +2 -1
- package/lib/cjs/helpers/validateMidnightCollateralBatch.js +2 -1
- package/lib/cjs/helpers/validateMidnightPublication.js +4 -2
- package/lib/cjs/helpers/validateMidnightTakeFeasibility.js +177 -104
- package/lib/cjs/helpers/validatePositiveInput.js +2 -1
- package/lib/cjs/helpers/validateTakeableOffers.js +2 -1
- package/lib/cjs/helpers/vaultV2ForceWithdrawPlan.js +40 -22
- package/lib/cjs/index.d.ts +2 -2
- package/lib/cjs/index.js +10 -1
- package/lib/cjs/transactionPlan/approval.js +12 -1
- package/lib/cjs/transactionPlan/deposit.d.ts +22 -0
- package/lib/cjs/transactionPlan/deposit.js +139 -0
- package/lib/cjs/transactionPlan/error.d.ts +10 -8
- package/lib/cjs/transactionPlan/error.js +10 -8
- package/lib/cjs/transactionPlan/getTokenPermit.js +2 -1
- package/lib/cjs/transactionPlan/index.d.ts +18 -0
- package/lib/cjs/transactionPlan/index.js +23 -5
- package/lib/cjs/transactionPlan/intent.d.ts +3 -3
- package/lib/cjs/transactionPlan/intent.js +14 -7
- package/lib/cjs/transactionPlan/permit.d.ts +1 -1
- package/lib/cjs/transactionPlan/permit.js +86 -20
- package/lib/cjs/transactionPlan/plan.d.ts +16 -6
- package/lib/cjs/transactionPlan/plan.js +77 -24
- package/lib/cjs/transactionPlan/redeem.d.ts +18 -0
- package/lib/cjs/transactionPlan/redeem.js +63 -0
- package/lib/cjs/transactionPlan/requirements.d.ts +4 -3
- package/lib/cjs/transactionPlan/requirements.js +12 -6
- package/lib/cjs/transactionPlan/serde.d.ts +2 -2
- package/lib/cjs/transactionPlan/serde.js +45 -19
- package/lib/cjs/transactionPlan/shareSpending.d.ts +18 -0
- package/lib/cjs/transactionPlan/shareSpending.js +50 -0
- package/lib/cjs/transactionPlan/types.d.ts +117 -11
- package/lib/cjs/transactionPlan/validateActions.js +11 -1
- package/lib/cjs/transactionPlan/validation.js +6 -3
- package/lib/cjs/transactionPlan/vaultv1/deposit.d.ts +93 -0
- package/lib/cjs/transactionPlan/vaultv1/deposit.js +94 -0
- package/lib/cjs/transactionPlan/vaultv1/inKindRedeem.d.ts +96 -0
- package/lib/cjs/transactionPlan/vaultv1/inKindRedeem.js +203 -0
- package/lib/cjs/transactionPlan/vaultv1/migrateToV2.d.ts +94 -0
- package/lib/cjs/transactionPlan/vaultv1/migrateToV2.js +217 -0
- package/lib/cjs/transactionPlan/vaultv1/redeem.d.ts +69 -0
- package/lib/cjs/transactionPlan/vaultv1/redeem.js +78 -0
- package/lib/cjs/transactionPlan/vaultv1/withdraw.d.ts +77 -0
- package/lib/cjs/transactionPlan/vaultv1/withdraw.js +88 -0
- package/lib/cjs/transactionPlan/vaultv2/deposit.d.ts +18 -33
- package/lib/cjs/transactionPlan/vaultv2/deposit.js +19 -143
- package/lib/cjs/transactionPlan/vaultv2/forceRedeem.d.ts +74 -0
- package/lib/cjs/transactionPlan/vaultv2/forceRedeem.js +155 -0
- package/lib/cjs/transactionPlan/vaultv2/forceWithdraw.d.ts +98 -0
- package/lib/cjs/transactionPlan/vaultv2/forceWithdraw.js +206 -0
- package/lib/cjs/transactionPlan/vaultv2/inKindRedeem.d.ts +113 -0
- package/lib/cjs/transactionPlan/vaultv2/inKindRedeem.js +206 -0
- package/lib/cjs/transactionPlan/vaultv2/redeem.d.ts +84 -0
- package/lib/cjs/transactionPlan/vaultv2/redeem.js +86 -0
- package/lib/cjs/transactionPlan/vaultv2/withdraw.d.ts +18 -29
- package/lib/cjs/transactionPlan/vaultv2/withdraw.js +21 -126
- package/lib/cjs/transactionPlan/version.js +2 -1
- package/lib/cjs/transactionPlan/withdraw.d.ts +18 -0
- package/lib/cjs/transactionPlan/withdraw.js +94 -0
- package/lib/cjs/types/action.d.ts +26 -2
- package/lib/cjs/types/action.js +17 -9
- package/lib/cjs/types/error.d.ts +8 -1
- package/lib/cjs/types/error.js +21 -6
- package/lib/cjs/types/metadata.d.ts +12 -2
- package/lib/cjs/version.d.ts +1 -1
- package/lib/cjs/version.js +1 -1
- package/lib/esm/actions/blue/common.js +4 -2
- package/lib/esm/actions/blue/withdrawBuyCallback.js +2 -1
- package/lib/esm/actions/bundles/common.js +20 -14
- package/lib/esm/actions/bundles/resolveBundlesTokenRequirements.d.ts +3 -4
- package/lib/esm/actions/bundles/resolveBundlesTokenRequirements.js +3 -2
- package/lib/esm/actions/midnight/cancelAndMake.d.ts +2 -1
- package/lib/esm/actions/midnight/cancelAndMake.js +2 -1
- package/lib/esm/actions/midnight/cancelOffers.d.ts +54 -0
- package/lib/esm/actions/midnight/cancelOffers.js +104 -0
- package/lib/esm/actions/midnight/index.d.ts +1 -0
- package/lib/esm/actions/midnight/index.js +1 -0
- package/lib/esm/actions/midnight/supplyCollateralBatch.js +4 -2
- package/lib/esm/actions/midnight/supplyCollateralTakeBorrow.d.ts +1 -1
- package/lib/esm/actions/midnight/supplyCollateralTakeBorrow.js +3 -2
- package/lib/esm/actions/midnight/takeBorrow.d.ts +1 -1
- package/lib/esm/actions/midnight/takeBorrow.js +3 -2
- package/lib/esm/actions/midnight/takeLend.d.ts +1 -1
- package/lib/esm/actions/midnight/takeLend.js +3 -2
- package/lib/esm/actions/midnight/takeRepayWithdrawCollateral.d.ts +1 -1
- package/lib/esm/actions/midnight/takeRepayWithdrawCollateral.js +3 -2
- package/lib/esm/actions/midnight/takeWithdraw.d.ts +1 -1
- package/lib/esm/actions/midnight/takeWithdraw.js +3 -2
- package/lib/esm/actions/midnight/withdrawCollateralBatch.js +4 -2
- package/lib/esm/actions/requirements/blue/getBlueAuthorizationRequirement.d.ts +3 -4
- package/lib/esm/actions/requirements/blue/getBlueAuthorizationRequirement.js +1 -1
- package/lib/esm/actions/requirements/encode/encodeBlueSignatureAuthorization.d.ts +4 -6
- package/lib/esm/actions/requirements/encode/encodeBlueSignatureAuthorization.js +3 -3
- package/lib/esm/actions/requirements/encode/encodeErc20Permit.d.ts +4 -6
- package/lib/esm/actions/requirements/encode/encodeErc20Permit.js +3 -3
- package/lib/esm/actions/requirements/encode/encodeErc20Permit2SignatureTransfer.d.ts +5 -6
- package/lib/esm/actions/requirements/encode/encodeErc20Permit2SignatureTransfer.js +7 -15
- package/lib/esm/actions/requirements/encode/encodeVaultSharesPermit.d.ts +3 -5
- package/lib/esm/actions/requirements/encode/encodeVaultSharesPermit.js +26 -23
- package/lib/esm/actions/requirements/midnight/getMidnightApprovalRequirements.js +2 -1
- package/lib/esm/actions/requirements/midnight/getMidnightAuthorizationRequirement.js +2 -1
- package/lib/esm/actions/vaultV1/inKindRedeem.js +6 -3
- package/lib/esm/actions/vaultV1/migrateToV2.js +1 -1
- package/lib/esm/actions/vaultV2/forceWithdraw.js +4 -2
- package/lib/esm/actions/vaultV2/inKindRedeem.js +4 -2
- package/lib/esm/entities/blue/blue.d.ts +34 -28
- package/lib/esm/entities/blue/blue.js +107 -77
- package/lib/esm/entities/midnight/deadline.d.ts +2 -2
- package/lib/esm/entities/midnight/deadline.js +4 -3
- package/lib/esm/entities/midnight/midnight.d.ts +49 -51
- package/lib/esm/entities/midnight/midnight.js +159 -139
- package/lib/esm/entities/midnight/publication.d.ts +2 -0
- package/lib/esm/entities/midnight/publication.js +193 -138
- package/lib/esm/entities/midnight/types.d.ts +4 -4
- package/lib/esm/entities/requirements/assertContractCode.js +4 -2
- package/lib/esm/entities/requirements/getBundlesTokenRequirements.d.ts +3 -5
- package/lib/esm/entities/requirements/getBundlesTokenRequirements.js +25 -29
- package/lib/esm/entities/requirements/getErc2612Permit.js +10 -5
- package/lib/esm/entities/requirements/getVaultBundlesSharesRequirements.d.ts +5 -4
- package/lib/esm/entities/requirements/getVaultBundlesSharesRequirements.js +8 -2
- package/lib/esm/entities/requirements/getVaultV1InKindRedeemRequirements.d.ts +21 -0
- package/lib/esm/entities/requirements/getVaultV1InKindRedeemRequirements.js +108 -0
- package/lib/esm/entities/requirements/getVaultV2ForceWithdrawRequirements.d.ts +20 -0
- package/lib/esm/entities/requirements/getVaultV2ForceWithdrawRequirements.js +73 -0
- package/lib/esm/entities/requirements/getVaultV2InKindRedeemRequirements.d.ts +21 -0
- package/lib/esm/entities/requirements/getVaultV2InKindRedeemRequirements.js +90 -0
- package/lib/esm/entities/vaultV1/inKindRedeemQuote.d.ts +25 -0
- package/lib/esm/entities/vaultV1/inKindRedeemQuote.js +82 -0
- package/lib/esm/entities/vaultV1/migrateToV2Quote.d.ts +20 -0
- package/lib/esm/entities/vaultV1/migrateToV2Quote.js +34 -0
- package/lib/esm/entities/vaultV1/vaultV1.d.ts +12 -12
- package/lib/esm/entities/vaultV1/vaultV1.js +96 -200
- package/lib/esm/entities/vaultV2/forceWithdrawQuote.d.ts +25 -0
- package/lib/esm/entities/vaultV2/forceWithdrawQuote.js +186 -0
- package/lib/esm/entities/vaultV2/inKindRedeemQuote.d.ts +28 -0
- package/lib/esm/entities/vaultV2/inKindRedeemQuote.js +107 -0
- package/lib/esm/entities/vaultV2/vaultV2.d.ts +16 -16
- package/lib/esm/entities/vaultV2/vaultV2.js +102 -393
- package/lib/esm/entities/vaultV2BlueReallocationData.d.ts +14 -0
- package/lib/esm/entities/vaultV2BlueReallocationData.js +1599 -883
- package/lib/esm/errors.d.ts +1 -1
- package/lib/esm/errors.js +1 -1
- package/lib/esm/helpers/deadShares.js +83 -47
- package/lib/esm/helpers/encodeMidnightCalldata.js +4 -2
- package/lib/esm/helpers/metadata.d.ts +14 -2
- package/lib/esm/helpers/metadata.js +48 -8
- package/lib/esm/helpers/previewVaultV2ForceWithdraw.js +44 -27
- package/lib/esm/helpers/previewVaultV2InKindRedeem.js +11 -2
- package/lib/esm/helpers/utilization.js +10 -5
- package/lib/esm/helpers/validate.js +88 -67
- package/lib/esm/helpers/validateMidnightBounds.js +2 -1
- package/lib/esm/helpers/validateMidnightCollateralBatch.js +2 -1
- package/lib/esm/helpers/validateMidnightPublication.js +4 -2
- package/lib/esm/helpers/validateMidnightTakeFeasibility.js +176 -103
- package/lib/esm/helpers/validatePositiveInput.js +2 -1
- package/lib/esm/helpers/validateTakeableOffers.js +2 -1
- package/lib/esm/helpers/vaultV2ForceWithdrawPlan.js +40 -22
- package/lib/esm/index.d.ts +2 -2
- package/lib/esm/index.js +1 -1
- package/lib/esm/transactionPlan/approval.js +13 -2
- package/lib/esm/transactionPlan/deposit.d.ts +22 -0
- package/lib/esm/transactionPlan/deposit.js +135 -0
- package/lib/esm/transactionPlan/error.d.ts +10 -8
- package/lib/esm/transactionPlan/error.js +10 -8
- package/lib/esm/transactionPlan/getTokenPermit.js +2 -1
- package/lib/esm/transactionPlan/index.d.ts +18 -0
- package/lib/esm/transactionPlan/index.js +9 -0
- package/lib/esm/transactionPlan/intent.d.ts +3 -3
- package/lib/esm/transactionPlan/intent.js +14 -7
- package/lib/esm/transactionPlan/permit.d.ts +1 -1
- package/lib/esm/transactionPlan/permit.js +86 -20
- package/lib/esm/transactionPlan/plan.d.ts +16 -6
- package/lib/esm/transactionPlan/plan.js +73 -20
- package/lib/esm/transactionPlan/redeem.d.ts +18 -0
- package/lib/esm/transactionPlan/redeem.js +59 -0
- package/lib/esm/transactionPlan/requirements.d.ts +4 -3
- package/lib/esm/transactionPlan/requirements.js +12 -6
- package/lib/esm/transactionPlan/serde.d.ts +2 -2
- package/lib/esm/transactionPlan/serde.js +45 -19
- package/lib/esm/transactionPlan/shareSpending.d.ts +18 -0
- package/lib/esm/transactionPlan/shareSpending.js +47 -0
- package/lib/esm/transactionPlan/types.d.ts +117 -11
- package/lib/esm/transactionPlan/validateActions.js +11 -1
- package/lib/esm/transactionPlan/validation.js +6 -3
- package/lib/esm/transactionPlan/vaultv1/deposit.d.ts +93 -0
- package/lib/esm/transactionPlan/vaultv1/deposit.js +90 -0
- package/lib/esm/transactionPlan/vaultv1/inKindRedeem.d.ts +96 -0
- package/lib/esm/transactionPlan/vaultv1/inKindRedeem.js +198 -0
- package/lib/esm/transactionPlan/vaultv1/migrateToV2.d.ts +94 -0
- package/lib/esm/transactionPlan/vaultv1/migrateToV2.js +212 -0
- package/lib/esm/transactionPlan/vaultv1/redeem.d.ts +69 -0
- package/lib/esm/transactionPlan/vaultv1/redeem.js +74 -0
- package/lib/esm/transactionPlan/vaultv1/withdraw.d.ts +77 -0
- package/lib/esm/transactionPlan/vaultv1/withdraw.js +84 -0
- package/lib/esm/transactionPlan/vaultv2/deposit.d.ts +18 -33
- package/lib/esm/transactionPlan/vaultv2/deposit.js +21 -144
- package/lib/esm/transactionPlan/vaultv2/forceRedeem.d.ts +74 -0
- package/lib/esm/transactionPlan/vaultv2/forceRedeem.js +150 -0
- package/lib/esm/transactionPlan/vaultv2/forceWithdraw.d.ts +98 -0
- package/lib/esm/transactionPlan/vaultv2/forceWithdraw.js +201 -0
- package/lib/esm/transactionPlan/vaultv2/inKindRedeem.d.ts +113 -0
- package/lib/esm/transactionPlan/vaultv2/inKindRedeem.js +201 -0
- package/lib/esm/transactionPlan/vaultv2/redeem.d.ts +84 -0
- package/lib/esm/transactionPlan/vaultv2/redeem.js +82 -0
- package/lib/esm/transactionPlan/vaultv2/withdraw.d.ts +18 -29
- package/lib/esm/transactionPlan/vaultv2/withdraw.js +23 -127
- package/lib/esm/transactionPlan/version.js +2 -1
- package/lib/esm/transactionPlan/withdraw.d.ts +18 -0
- package/lib/esm/transactionPlan/withdraw.js +90 -0
- package/lib/esm/types/action.d.ts +26 -2
- package/lib/esm/types/action.js +17 -9
- package/lib/esm/types/error.d.ts +8 -1
- package/lib/esm/types/error.js +21 -6
- package/lib/esm/types/metadata.d.ts +12 -2
- package/lib/esm/version.d.ts +1 -1
- package/lib/esm/version.js +1 -1
- package/package.json +15 -14
|
@@ -77,8 +77,9 @@ const common_js_1 = require("../bundles/common.js");
|
|
|
77
77
|
* ```
|
|
78
78
|
*/
|
|
79
79
|
const vaultV2ForceWithdraw = ({ vault, args, metadata, }) => {
|
|
80
|
-
if (args.exitAssets <= 0n)
|
|
80
|
+
if (args.exitAssets <= 0n) {
|
|
81
81
|
throw new index_js_2.NonPositiveInputError("exitAssets", args.exitAssets);
|
|
82
|
+
}
|
|
82
83
|
(0, validate_js_1.validateUint256Field)("exitAssets", args.exitAssets);
|
|
83
84
|
(0, validate_js_1.validateDeadline)(args.deadline);
|
|
84
85
|
// `0n` stays valid — it is the intentional "no on-chain bound" opt-out — but a value the uint256
|
|
@@ -112,8 +113,9 @@ const vaultV2ForceWithdraw = ({ vault, args, metadata, }) => {
|
|
|
112
113
|
],
|
|
113
114
|
}),
|
|
114
115
|
};
|
|
115
|
-
if (metadata)
|
|
116
|
+
if (metadata) {
|
|
116
117
|
tx = (0, index_js_1.addTransactionMetadata)(tx, metadata);
|
|
118
|
+
}
|
|
117
119
|
return (0, morpho_ts_1.deepFreeze)({
|
|
118
120
|
...tx,
|
|
119
121
|
action: {
|
|
@@ -48,8 +48,9 @@ const common_js_1 = require("../bundles/common.js");
|
|
|
48
48
|
* ```
|
|
49
49
|
*/
|
|
50
50
|
const vaultV2InKindRedeem = ({ vault, args, metadata, }) => {
|
|
51
|
-
if (args.amount <= 0n)
|
|
51
|
+
if (args.amount <= 0n) {
|
|
52
52
|
throw new index_js_2.NonPositiveInputError("amount", args.amount);
|
|
53
|
+
}
|
|
53
54
|
(0, validate_js_1.validateDeadline)(args.deadline);
|
|
54
55
|
const to = (0, morpho_ts_1.getChainAddress)(vault.chainId, "bundles.vaultExitBundlesV1");
|
|
55
56
|
const marketParamsList = args.marketParamsList.map((marketParams) => ({
|
|
@@ -82,8 +83,9 @@ const vaultV2InKindRedeem = ({ vault, args, metadata, }) => {
|
|
|
82
83
|
],
|
|
83
84
|
}),
|
|
84
85
|
};
|
|
85
|
-
if (metadata)
|
|
86
|
+
if (metadata) {
|
|
86
87
|
tx = (0, index_js_1.addTransactionMetadata)(tx, metadata);
|
|
88
|
+
}
|
|
87
89
|
return (0, morpho_ts_1.deepFreeze)({
|
|
88
90
|
...tx,
|
|
89
91
|
action: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type AccrualPosition, type Market, type MarketParams } from "@morpho-org/blue-sdk";
|
|
2
2
|
import { type Address } from "viem";
|
|
3
3
|
import type { FetchParameters } from "../../types/data.js";
|
|
4
|
-
import { type ActionOutput, type ActionRequirement, type AssetsOrSharesArgs, type BlueBorrowAction, type BlueRefinanceAction, type BlueRepayAction, type BlueRepayWithdrawCollateralAction, type BlueSupplyAction, type BlueSupplyCollateralAction, type BlueSupplyCollateralBorrowAction, type BlueWithdrawAction, type BlueWithdrawBuyCallbackAction, type BlueWithdrawCollateralAction, type MorphoClientType, type RequirementSignature, type VaultV2BluePublicAllocatorOptions, type VaultV2BlueReallocation } from "../../types/index.js";
|
|
4
|
+
import { type ActionOutput, type ActionRequirement, type AssetsOrSharesArgs, type BlueBorrowAction, type BlueRefinanceAction, type BlueRepayAction, type BlueRepayWithdrawCollateralAction, type BlueSupplyAction, type BlueSupplyCollateralAction, type BlueSupplyCollateralBorrowAction, type BlueWithdrawAction, type BlueWithdrawBuyCallbackAction, type BlueWithdrawCollateralAction, type MorphoClientType, type ReferenceTimestampParams, type RequirementSignature, type VaultV2BluePublicAllocatorOptions, type VaultV2BlueReallocation } from "../../types/index.js";
|
|
5
5
|
import { VaultV2BlueReallocationData } from "../vaultV2BlueReallocationData.js";
|
|
6
6
|
type VaultV2BlueReallocationsParams = {
|
|
7
7
|
readonly reallocationData: VaultV2BlueReallocationData;
|
|
@@ -138,7 +138,7 @@ export interface BlueActions {
|
|
|
138
138
|
readonly deadline: bigint;
|
|
139
139
|
readonly referralFeePct?: bigint;
|
|
140
140
|
readonly referralFeeRecipient?: Address;
|
|
141
|
-
}) => ActionOutput<BlueSupplyCollateralAction, readonly RequirementSignature[], BlueTokenRequirementsParams>;
|
|
141
|
+
} & ReferenceTimestampParams) => ActionOutput<BlueSupplyCollateralAction, readonly RequirementSignature[], BlueTokenRequirementsParams>;
|
|
142
142
|
/**
|
|
143
143
|
* Prepares a direct BlueBundlesV1 loan-asset supply.
|
|
144
144
|
*
|
|
@@ -202,7 +202,8 @@ export interface BlueActions {
|
|
|
202
202
|
* userAddress,
|
|
203
203
|
* marketData: await market.getMarketData(),
|
|
204
204
|
* assets: 1_000_000n,
|
|
205
|
-
*
|
|
205
|
+
* now: (await client.getBlock()).timestamp,
|
|
206
|
+
* deadline: (await client.getBlock()).timestamp + 3_600n,
|
|
206
207
|
* });
|
|
207
208
|
* const requirements = await action.getRequirements();
|
|
208
209
|
* const tx = action.buildTx();
|
|
@@ -218,7 +219,7 @@ export interface BlueActions {
|
|
|
218
219
|
readonly deadline: bigint;
|
|
219
220
|
readonly referralFeePct?: bigint;
|
|
220
221
|
readonly referralFeeRecipient?: Address;
|
|
221
|
-
}): ActionOutput<BlueSupplyAction, readonly RequirementSignature[], BlueTokenRequirementsParams>;
|
|
222
|
+
} & ReferenceTimestampParams): ActionOutput<BlueSupplyAction, readonly RequirementSignature[], BlueTokenRequirementsParams>;
|
|
222
223
|
/**
|
|
223
224
|
* @deprecated Pass `marketData` from `getMarketData()`; the snapshot-free overload is removed in the next major.
|
|
224
225
|
*/
|
|
@@ -229,7 +230,7 @@ export interface BlueActions {
|
|
|
229
230
|
readonly deadline: bigint;
|
|
230
231
|
readonly referralFeePct?: bigint;
|
|
231
232
|
readonly referralFeeRecipient?: Address;
|
|
232
|
-
}): ActionOutput<BlueSupplyAction, readonly RequirementSignature[], BlueTokenRequirementsParams>;
|
|
233
|
+
} & ReferenceTimestampParams): ActionOutput<BlueSupplyAction, readonly RequirementSignature[], BlueTokenRequirementsParams>;
|
|
233
234
|
};
|
|
234
235
|
/**
|
|
235
236
|
* Prepares a direct BlueBundlesV1 loan-asset withdrawal by assets or shares.
|
|
@@ -297,7 +298,8 @@ export interface BlueActions {
|
|
|
297
298
|
* userAddress,
|
|
298
299
|
* positionData,
|
|
299
300
|
* shares: 1n,
|
|
300
|
-
*
|
|
301
|
+
* now: (await client.getBlock()).timestamp,
|
|
302
|
+
* deadline: (await client.getBlock()).timestamp + 3_600n,
|
|
301
303
|
* });
|
|
302
304
|
* const requirements = await action.getRequirements();
|
|
303
305
|
* const tx = action.buildTx();
|
|
@@ -311,7 +313,7 @@ export interface BlueActions {
|
|
|
311
313
|
readonly deadline: bigint;
|
|
312
314
|
readonly referralFeePct?: bigint;
|
|
313
315
|
readonly referralFeeRecipient?: Address;
|
|
314
|
-
} & AssetsOrSharesArgs) => ActionOutput<BlueWithdrawAction, readonly RequirementSignature[], undefined>;
|
|
316
|
+
} & ReferenceTimestampParams & AssetsOrSharesArgs) => ActionOutput<BlueWithdrawAction, readonly RequirementSignature[], undefined>;
|
|
315
317
|
/**
|
|
316
318
|
* Prepares a direct Morpho Blue withdrawal of a BlueBuyCallback's whole supply position to its
|
|
317
319
|
* owner.
|
|
@@ -381,7 +383,7 @@ export interface BlueActions {
|
|
|
381
383
|
readonly userAddress: Address;
|
|
382
384
|
readonly callbackAddress: Address;
|
|
383
385
|
readonly positionData: AccrualPosition;
|
|
384
|
-
}) => ActionOutput<BlueWithdrawBuyCallbackAction, undefined, undefined>;
|
|
386
|
+
} & ReferenceTimestampParams) => ActionOutput<BlueWithdrawBuyCallbackAction, undefined, undefined>;
|
|
385
387
|
/**
|
|
386
388
|
* Prepares a direct BlueBundlesV1 loan-asset borrow.
|
|
387
389
|
*
|
|
@@ -460,7 +462,7 @@ export interface BlueActions {
|
|
|
460
462
|
readonly deadline: bigint;
|
|
461
463
|
readonly referralFeePct?: bigint;
|
|
462
464
|
readonly referralFeeRecipient?: Address;
|
|
463
|
-
}) => ActionOutput<BlueBorrowAction, readonly RequirementSignature[], undefined>;
|
|
465
|
+
} & ReferenceTimestampParams) => ActionOutput<BlueBorrowAction, readonly RequirementSignature[], undefined>;
|
|
464
466
|
/**
|
|
465
467
|
* Prepares a direct BlueBundlesV1 loan-asset repayment.
|
|
466
468
|
*
|
|
@@ -545,7 +547,7 @@ export interface BlueActions {
|
|
|
545
547
|
readonly deadline: bigint;
|
|
546
548
|
readonly referralFeePct?: bigint;
|
|
547
549
|
readonly referralFeeRecipient?: Address;
|
|
548
|
-
} & ({
|
|
550
|
+
} & ReferenceTimestampParams & ({
|
|
549
551
|
readonly repayAssets: bigint;
|
|
550
552
|
readonly repayShares?: never;
|
|
551
553
|
} | {
|
|
@@ -623,7 +625,7 @@ export interface BlueActions {
|
|
|
623
625
|
readonly deadline: bigint;
|
|
624
626
|
readonly referralFeePct?: bigint;
|
|
625
627
|
readonly referralFeeRecipient?: Address;
|
|
626
|
-
}) => ActionOutput<BlueWithdrawCollateralAction, readonly RequirementSignature[], undefined>;
|
|
628
|
+
} & ReferenceTimestampParams) => ActionOutput<BlueWithdrawCollateralAction, readonly RequirementSignature[], undefined>;
|
|
627
629
|
/**
|
|
628
630
|
* Prepares a direct BlueBundlesV1 repay, collateral withdrawal, or atomic combination.
|
|
629
631
|
*
|
|
@@ -706,7 +708,8 @@ export interface BlueActions {
|
|
|
706
708
|
* positionData,
|
|
707
709
|
* repayShares: maxUint256,
|
|
708
710
|
* collateralAssets: 1n,
|
|
709
|
-
*
|
|
711
|
+
* now: (await client.getBlock()).timestamp,
|
|
712
|
+
* deadline: (await client.getBlock()).timestamp + 3_600n,
|
|
710
713
|
* });
|
|
711
714
|
* const requirements = await action.getRequirements(); // Satisfy these first.
|
|
712
715
|
* const tx = action.buildTx(); // For a client configured with supportSignature: false.
|
|
@@ -721,7 +724,7 @@ export interface BlueActions {
|
|
|
721
724
|
readonly deadline: bigint;
|
|
722
725
|
readonly referralFeePct?: bigint;
|
|
723
726
|
readonly referralFeeRecipient?: Address;
|
|
724
|
-
} & ({
|
|
727
|
+
} & ReferenceTimestampParams & ({
|
|
725
728
|
readonly repayAssets: bigint;
|
|
726
729
|
readonly repayShares?: never;
|
|
727
730
|
} | {
|
|
@@ -807,7 +810,8 @@ export interface BlueActions {
|
|
|
807
810
|
* positionData,
|
|
808
811
|
* collateralAssets: 100_000_000n,
|
|
809
812
|
* borrowAssets: 1_000_000n,
|
|
810
|
-
*
|
|
813
|
+
* now: (await client.getBlock()).timestamp,
|
|
814
|
+
* deadline: (await client.getBlock()).timestamp + 3_600n,
|
|
811
815
|
* });
|
|
812
816
|
* const requirements = await action.getRequirements(); // Satisfy these first.
|
|
813
817
|
* const tx = action.buildTx(); // For a client configured with supportSignature: false.
|
|
@@ -824,7 +828,7 @@ export interface BlueActions {
|
|
|
824
828
|
readonly deadline: bigint;
|
|
825
829
|
readonly referralFeePct?: bigint;
|
|
826
830
|
readonly referralFeeRecipient?: Address;
|
|
827
|
-
}) => ActionOutput<BlueSupplyCollateralBorrowAction, readonly RequirementSignature[], BlueTokenRequirementsParams>;
|
|
831
|
+
} & ReferenceTimestampParams) => ActionOutput<BlueSupplyCollateralBorrowAction, readonly RequirementSignature[], BlueTokenRequirementsParams>;
|
|
828
832
|
/**
|
|
829
833
|
* Prepares a direct BlueBundlesV1 full borrow-position migration.
|
|
830
834
|
*
|
|
@@ -903,7 +907,8 @@ export interface BlueActions {
|
|
|
903
907
|
* userAddress,
|
|
904
908
|
* positionData: source,
|
|
905
909
|
* destination: { marketParams: destinationParams, positionData: destination },
|
|
906
|
-
*
|
|
910
|
+
* now: (await client.getBlock()).timestamp,
|
|
911
|
+
* deadline: (await client.getBlock()).timestamp + 3_600n,
|
|
907
912
|
* });
|
|
908
913
|
* const requirements = await action.getRequirements(); // Satisfy these first.
|
|
909
914
|
* const tx = action.buildTx(); // For a client configured with supportSignature: false.
|
|
@@ -921,7 +926,7 @@ export interface BlueActions {
|
|
|
921
926
|
readonly deadline: bigint;
|
|
922
927
|
readonly referralFeePct?: bigint;
|
|
923
928
|
readonly referralFeeRecipient?: Address;
|
|
924
|
-
}) => ActionOutput<BlueRefinanceAction, readonly RequirementSignature[], undefined>;
|
|
929
|
+
} & ReferenceTimestampParams) => ActionOutput<BlueRefinanceAction, readonly RequirementSignature[], undefined>;
|
|
925
930
|
/**
|
|
926
931
|
* Fetches Vault V2 BluePublicAllocator state for this target market.
|
|
927
932
|
*
|
|
@@ -1044,6 +1049,7 @@ export declare class MorphoBlue implements BlueActions {
|
|
|
1044
1049
|
private assertWriteTargets;
|
|
1045
1050
|
private getMaxLtv;
|
|
1046
1051
|
private getBlueBundlesV1QuoteTimestamp;
|
|
1052
|
+
private quoteRepay;
|
|
1047
1053
|
private getTokenRequirements;
|
|
1048
1054
|
private getAuthorizationRequirements;
|
|
1049
1055
|
getMarketData(parameters?: FetchParameters): Promise<Market>;
|
|
@@ -1057,7 +1063,7 @@ export declare class MorphoBlue implements BlueActions {
|
|
|
1057
1063
|
readonly deadline: bigint;
|
|
1058
1064
|
readonly referralFeePct?: bigint;
|
|
1059
1065
|
readonly referralFeeRecipient?: Address;
|
|
1060
|
-
}): ActionOutput<BlueSupplyAction, readonly RequirementSignature[], BlueTokenRequirementsParams>;
|
|
1066
|
+
} & ReferenceTimestampParams): ActionOutput<BlueSupplyAction, readonly RequirementSignature[], BlueTokenRequirementsParams>;
|
|
1061
1067
|
/**
|
|
1062
1068
|
* @deprecated Pass `marketData` from `getMarketData()`; the snapshot-free overload is removed in the next major.
|
|
1063
1069
|
*/
|
|
@@ -1068,7 +1074,7 @@ export declare class MorphoBlue implements BlueActions {
|
|
|
1068
1074
|
readonly deadline: bigint;
|
|
1069
1075
|
readonly referralFeePct?: bigint;
|
|
1070
1076
|
readonly referralFeeRecipient?: Address;
|
|
1071
|
-
}): ActionOutput<BlueSupplyAction, readonly RequirementSignature[], BlueTokenRequirementsParams>;
|
|
1077
|
+
} & ReferenceTimestampParams): ActionOutput<BlueSupplyAction, readonly RequirementSignature[], BlueTokenRequirementsParams>;
|
|
1072
1078
|
/** {@inheritDoc BlueActions.withdraw} */
|
|
1073
1079
|
withdraw(params: {
|
|
1074
1080
|
readonly userAddress: Address;
|
|
@@ -1077,7 +1083,7 @@ export declare class MorphoBlue implements BlueActions {
|
|
|
1077
1083
|
readonly deadline: bigint;
|
|
1078
1084
|
readonly referralFeePct?: bigint;
|
|
1079
1085
|
readonly referralFeeRecipient?: Address;
|
|
1080
|
-
} & AssetsOrSharesArgs): {
|
|
1086
|
+
} & ReferenceTimestampParams & AssetsOrSharesArgs): {
|
|
1081
1087
|
getRequirements: () => Promise<readonly ActionRequirement[]>;
|
|
1082
1088
|
buildTx: (signatures?: readonly RequirementSignature[]) => Readonly<import("../../index.js").Transaction<BlueWithdrawAction>>;
|
|
1083
1089
|
};
|
|
@@ -1086,7 +1092,7 @@ export declare class MorphoBlue implements BlueActions {
|
|
|
1086
1092
|
readonly userAddress: Address;
|
|
1087
1093
|
readonly callbackAddress: Address;
|
|
1088
1094
|
readonly positionData: AccrualPosition;
|
|
1089
|
-
}): ActionOutput<BlueWithdrawBuyCallbackAction, undefined, undefined>;
|
|
1095
|
+
} & ReferenceTimestampParams): ActionOutput<BlueWithdrawBuyCallbackAction, undefined, undefined>;
|
|
1090
1096
|
/** {@inheritDoc BlueActions.supplyCollateral} */
|
|
1091
1097
|
supplyCollateral(params: {
|
|
1092
1098
|
readonly userAddress: Address;
|
|
@@ -1095,7 +1101,7 @@ export declare class MorphoBlue implements BlueActions {
|
|
|
1095
1101
|
readonly deadline: bigint;
|
|
1096
1102
|
readonly referralFeePct?: bigint;
|
|
1097
1103
|
readonly referralFeeRecipient?: Address;
|
|
1098
|
-
}): ActionOutput<BlueSupplyCollateralAction, readonly RequirementSignature[], BlueTokenRequirementsParams>;
|
|
1104
|
+
} & ReferenceTimestampParams): ActionOutput<BlueSupplyCollateralAction, readonly RequirementSignature[], BlueTokenRequirementsParams>;
|
|
1099
1105
|
/** {@inheritDoc BlueActions.borrow} */
|
|
1100
1106
|
borrow(params: {
|
|
1101
1107
|
readonly userAddress: Address;
|
|
@@ -1105,7 +1111,7 @@ export declare class MorphoBlue implements BlueActions {
|
|
|
1105
1111
|
readonly deadline: bigint;
|
|
1106
1112
|
readonly referralFeePct?: bigint;
|
|
1107
1113
|
readonly referralFeeRecipient?: Address;
|
|
1108
|
-
}): ActionOutput<BlueBorrowAction, readonly RequirementSignature[], undefined>;
|
|
1114
|
+
} & ReferenceTimestampParams): ActionOutput<BlueBorrowAction, readonly RequirementSignature[], undefined>;
|
|
1109
1115
|
/** {@inheritDoc BlueActions.repay} */
|
|
1110
1116
|
repay(params: {
|
|
1111
1117
|
readonly userAddress: Address;
|
|
@@ -1114,7 +1120,7 @@ export declare class MorphoBlue implements BlueActions {
|
|
|
1114
1120
|
readonly deadline: bigint;
|
|
1115
1121
|
readonly referralFeePct?: bigint;
|
|
1116
1122
|
readonly referralFeeRecipient?: Address;
|
|
1117
|
-
} & ({
|
|
1123
|
+
} & ReferenceTimestampParams & ({
|
|
1118
1124
|
readonly repayAssets: bigint;
|
|
1119
1125
|
readonly repayShares?: never;
|
|
1120
1126
|
} | {
|
|
@@ -1129,7 +1135,7 @@ export declare class MorphoBlue implements BlueActions {
|
|
|
1129
1135
|
readonly deadline: bigint;
|
|
1130
1136
|
readonly referralFeePct?: bigint;
|
|
1131
1137
|
readonly referralFeeRecipient?: Address;
|
|
1132
|
-
}): ActionOutput<BlueWithdrawCollateralAction, readonly RequirementSignature[], undefined>;
|
|
1138
|
+
} & ReferenceTimestampParams): ActionOutput<BlueWithdrawCollateralAction, readonly RequirementSignature[], undefined>;
|
|
1133
1139
|
/** {@inheritDoc BlueActions.repayWithdrawCollateral} */
|
|
1134
1140
|
repayWithdrawCollateral(params: {
|
|
1135
1141
|
readonly userAddress: Address;
|
|
@@ -1139,7 +1145,7 @@ export declare class MorphoBlue implements BlueActions {
|
|
|
1139
1145
|
readonly deadline: bigint;
|
|
1140
1146
|
readonly referralFeePct?: bigint;
|
|
1141
1147
|
readonly referralFeeRecipient?: Address;
|
|
1142
|
-
} & ({
|
|
1148
|
+
} & ReferenceTimestampParams & ({
|
|
1143
1149
|
readonly repayAssets: bigint;
|
|
1144
1150
|
readonly repayShares?: never;
|
|
1145
1151
|
} | {
|
|
@@ -1163,7 +1169,7 @@ export declare class MorphoBlue implements BlueActions {
|
|
|
1163
1169
|
readonly deadline: bigint;
|
|
1164
1170
|
readonly referralFeePct?: bigint;
|
|
1165
1171
|
readonly referralFeeRecipient?: Address;
|
|
1166
|
-
}): {
|
|
1172
|
+
} & ReferenceTimestampParams): {
|
|
1167
1173
|
getRequirements: (requirementsParams?: BlueTokenRequirementsParams) => Promise<readonly ActionRequirement[]>;
|
|
1168
1174
|
buildTx: (signatures?: readonly RequirementSignature[]) => Readonly<import("../../index.js").Transaction<BlueSupplyCollateralBorrowAction>>;
|
|
1169
1175
|
};
|
|
@@ -1179,7 +1185,7 @@ export declare class MorphoBlue implements BlueActions {
|
|
|
1179
1185
|
readonly deadline: bigint;
|
|
1180
1186
|
readonly referralFeePct?: bigint;
|
|
1181
1187
|
readonly referralFeeRecipient?: Address;
|
|
1182
|
-
}): {
|
|
1188
|
+
} & ReferenceTimestampParams): {
|
|
1183
1189
|
getRequirements: () => Promise<readonly ActionRequirement[]>;
|
|
1184
1190
|
buildTx: (signatures?: readonly RequirementSignature[]) => Readonly<import("../../index.js").Transaction<BlueRefinanceAction>>;
|
|
1185
1191
|
};
|