@morpho-org/morpho-sdk 6.0.0-next.0 → 6.0.0-next.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/MIGRATION-v5-to-v6.md +329 -15
- package/README.md +93 -47
- package/lib/cjs/abis.d.ts +227 -2
- package/lib/cjs/abis.js +156 -3
- package/lib/cjs/actions/blue/borrow.d.ts +1 -1
- package/lib/cjs/actions/blue/borrow.js +1 -1
- package/lib/cjs/actions/blue/common.d.ts +6 -19
- package/lib/cjs/actions/blue/common.js +28 -162
- package/lib/cjs/actions/blue/refinance.d.ts +1 -1
- package/lib/cjs/actions/blue/refinance.js +1 -1
- package/lib/cjs/actions/blue/repay.d.ts +3 -3
- package/lib/cjs/actions/blue/repay.js +1 -1
- package/lib/cjs/actions/blue/repayWithdrawCollateral.d.ts +3 -3
- package/lib/cjs/actions/blue/repayWithdrawCollateral.js +1 -1
- package/lib/cjs/actions/blue/supply.d.ts +3 -3
- package/lib/cjs/actions/blue/supply.js +3 -8
- package/lib/cjs/actions/blue/supplyCollateral.d.ts +3 -3
- package/lib/cjs/actions/blue/supplyCollateral.js +1 -1
- package/lib/cjs/actions/blue/supplyCollateralBorrow.d.ts +3 -3
- package/lib/cjs/actions/blue/supplyCollateralBorrow.js +1 -1
- package/lib/cjs/actions/blue/withdraw.d.ts +1 -1
- package/lib/cjs/actions/blue/withdraw.js +1 -1
- package/lib/cjs/actions/blue/withdrawCollateral.d.ts +1 -1
- package/lib/cjs/actions/blue/withdrawCollateral.js +1 -1
- package/lib/cjs/actions/bundles/common.d.ts +230 -0
- package/lib/cjs/actions/bundles/common.js +507 -0
- package/lib/cjs/actions/bundles/index.d.ts +3 -0
- package/lib/cjs/actions/bundles/index.js +23 -0
- package/lib/cjs/actions/bundles/resolveBundlesTokenRequirements.d.ts +76 -0
- package/lib/cjs/actions/bundles/resolveBundlesTokenRequirements.js +125 -0
- package/lib/cjs/actions/index.d.ts +1 -0
- package/lib/cjs/actions/index.js +1 -0
- package/lib/cjs/actions/midnight/supplyCollateralTakeBorrow.d.ts +2 -2
- package/lib/cjs/actions/midnight/supplyCollateralTakeBorrow.js +2 -2
- package/lib/cjs/actions/midnight/takeBorrow.d.ts +2 -2
- package/lib/cjs/actions/midnight/takeBorrow.js +2 -2
- package/lib/cjs/actions/midnight/takeLend.d.ts +2 -2
- package/lib/cjs/actions/midnight/takeLend.js +2 -2
- package/lib/cjs/actions/requirements/blue/getBlueAuthorizationRequirement.d.ts +3 -0
- package/lib/cjs/actions/requirements/blue/getBlueAuthorizationRequirement.js +6 -10
- package/lib/cjs/actions/requirements/blue/index.d.ts +0 -2
- package/lib/cjs/actions/requirements/blue/index.js +0 -2
- package/lib/cjs/actions/requirements/encode/encodeBlueSignatureAuthorization.d.ts +15 -8
- package/lib/cjs/actions/requirements/encode/encodeBlueSignatureAuthorization.js +21 -21
- package/lib/cjs/actions/requirements/encode/encodeErc20Approval.d.ts +1 -1
- package/lib/cjs/actions/requirements/encode/encodeErc20Approval.js +2 -1
- package/lib/cjs/actions/requirements/encode/encodeErc20Permit.d.ts +19 -10
- package/lib/cjs/actions/requirements/encode/encodeErc20Permit.js +43 -31
- package/lib/cjs/actions/requirements/encode/encodeErc20Permit2Approve.d.ts +4 -2
- package/lib/cjs/actions/requirements/encode/encodeErc20Permit2Approve.js +15 -10
- package/lib/{esm/actions/requirements/encode/encodeErc20Permit2TransferFrom.d.ts → cjs/actions/requirements/encode/encodeErc20Permit2SignatureTransfer.d.ts} +16 -14
- package/lib/cjs/actions/requirements/encode/{encodeErc20Permit2TransferFrom.js → encodeErc20Permit2SignatureTransfer.js} +27 -22
- package/lib/cjs/actions/requirements/encode/encodeVaultSharesPermit.d.ts +12 -9
- package/lib/cjs/actions/requirements/encode/encodeVaultSharesPermit.js +27 -21
- package/lib/cjs/actions/requirements/encode/index.d.ts +1 -1
- package/lib/cjs/actions/requirements/encode/index.js +1 -1
- package/lib/cjs/actions/requirements/generalAdapter/getGeneralAdapterRequirements.js +1 -0
- package/lib/cjs/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit.d.ts +4 -1
- package/lib/cjs/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit.js +5 -2
- package/lib/cjs/actions/requirements/getRequirementsApproval.d.ts +4 -3
- package/lib/cjs/actions/requirements/getRequirementsApproval.js +4 -3
- package/lib/cjs/actions/signatures/getTokenRequirementActions.js +2 -2
- package/lib/cjs/actions/signatures/getVaultExitBundlesV1PermitStruct.d.ts +28 -30
- package/lib/cjs/actions/signatures/getVaultExitBundlesV1PermitStruct.js +20 -66
- package/lib/cjs/actions/vaultV1/deposit.d.ts +73 -57
- package/lib/cjs/actions/vaultV1/deposit.js +110 -109
- package/lib/cjs/actions/vaultV1/inKindRedeem.d.ts +1 -0
- package/lib/cjs/actions/vaultV1/inKindRedeem.js +3 -2
- package/lib/cjs/actions/vaultV1/migrateToV2.d.ts +43 -66
- package/lib/cjs/actions/vaultV1/migrateToV2.js +91 -104
- package/lib/cjs/actions/vaultV1/redeem.d.ts +30 -23
- package/lib/cjs/actions/vaultV1/redeem.js +56 -33
- package/lib/cjs/actions/vaultV1/withdraw.d.ts +58 -24
- package/lib/cjs/actions/vaultV1/withdraw.js +86 -34
- package/lib/cjs/actions/vaultV2/deposit.d.ts +74 -57
- package/lib/cjs/actions/vaultV2/deposit.js +111 -109
- package/lib/cjs/actions/vaultV2/forceWithdraw.d.ts +58 -39
- package/lib/cjs/actions/vaultV2/forceWithdraw.js +87 -60
- package/lib/cjs/actions/vaultV2/inKindRedeem.d.ts +1 -0
- package/lib/cjs/actions/vaultV2/inKindRedeem.js +3 -2
- package/lib/cjs/actions/vaultV2/redeem.d.ts +30 -24
- package/lib/cjs/actions/vaultV2/redeem.js +56 -34
- package/lib/cjs/actions/vaultV2/withdraw.d.ts +58 -25
- package/lib/cjs/actions/vaultV2/withdraw.js +86 -35
- package/lib/cjs/augment/VaultMarketPublicAllocatorConfig.d.ts +4 -1
- package/lib/cjs/blue/abis.d.ts +5 -1
- package/lib/cjs/blue/abis.js +2 -0
- package/lib/cjs/blue/entities.d.ts +8 -2
- package/lib/cjs/blue/entities.js +1 -0
- package/lib/cjs/blue/errors.d.ts +1 -1
- package/lib/cjs/blue/errors.js +2 -1
- package/lib/cjs/blue/fetch.d.ts +3 -1
- package/lib/cjs/blue/fetch.js +1 -0
- package/lib/cjs/entities/blue/blue.d.ts +29 -20
- package/lib/cjs/entities/blue/blue.js +6 -1
- package/lib/cjs/entities/index.d.ts +9 -2
- package/lib/cjs/entities/index.js +16 -0
- package/lib/cjs/entities/midnight/midnight.d.ts +2 -2
- package/lib/cjs/entities/midnight/midnight.js +20 -24
- package/lib/cjs/{actions/requirements/blue/getBlueBundlesV1TokenRequirements.d.ts → entities/requirements/getBundlesTokenRequirements.d.ts} +27 -19
- package/lib/cjs/{actions/requirements/blue/getBlueBundlesV1TokenRequirements.js → entities/requirements/getBundlesTokenRequirements.js} +76 -75
- package/lib/{esm/actions/requirements/blue → cjs/entities/requirements}/getUnusedPermit2Nonce.d.ts +1 -1
- package/lib/cjs/{actions/requirements/blue → entities/requirements}/getUnusedPermit2Nonce.js +4 -4
- package/lib/cjs/entities/requirements/getVaultBundlesSharesRequirements.d.ts +28 -0
- package/lib/cjs/entities/requirements/getVaultBundlesSharesRequirements.js +74 -0
- package/lib/cjs/entities/requirements/index.d.ts +2 -0
- package/lib/cjs/entities/requirements/index.js +18 -0
- package/lib/cjs/entities/vaultV1/vaultV1.d.ts +356 -101
- package/lib/cjs/entities/vaultV1/vaultV1.js +334 -120
- package/lib/cjs/entities/vaultV1ReallocationData.d.ts +6 -0
- package/lib/cjs/entities/vaultV1ReallocationData.js +20 -5
- package/lib/cjs/entities/vaultV2/vaultV2.d.ts +359 -100
- package/lib/cjs/entities/vaultV2/vaultV2.js +448 -93
- package/lib/cjs/entities/vaultV2BlueReallocationData.d.ts +8 -1
- package/lib/cjs/entities/vaultV2BlueReallocationData.js +46 -13
- package/lib/cjs/errors.d.ts +1 -1
- package/lib/cjs/errors.js +3 -2
- package/lib/cjs/fetch.d.ts +3 -1
- package/lib/cjs/fetch.js +1 -0
- package/lib/cjs/helpers/computeVaultV1Reallocations.d.ts +2 -0
- package/lib/cjs/helpers/computeVaultV1Reallocations.js +2 -0
- package/lib/cjs/helpers/index.d.ts +4 -1
- package/lib/cjs/helpers/index.js +14 -1
- package/lib/cjs/helpers/metadata.d.ts +3 -5
- package/lib/cjs/helpers/metadata.js +4 -6
- package/lib/cjs/helpers/previewVaultV2ForceWithdraw.d.ts +107 -0
- package/lib/cjs/helpers/previewVaultV2ForceWithdraw.js +164 -0
- package/lib/cjs/helpers/previewVaultV2InKindRedeem.d.ts +1 -0
- package/lib/cjs/helpers/previewVaultV2InKindRedeem.js +2 -0
- package/lib/cjs/helpers/referralFee.d.ts +21 -0
- package/lib/cjs/helpers/referralFee.js +35 -0
- package/lib/cjs/helpers/slippage.d.ts +136 -1
- package/lib/cjs/helpers/slippage.js +188 -0
- package/lib/cjs/helpers/validate.d.ts +67 -8
- package/lib/cjs/helpers/validate.js +94 -9
- package/lib/cjs/helpers/validateRequirementSpender.d.ts +1 -1
- package/lib/cjs/helpers/validateRequirementSpender.js +1 -0
- package/lib/cjs/helpers/vaultV2ForceWithdrawPlan.d.ts +274 -0
- package/lib/cjs/helpers/vaultV2ForceWithdrawPlan.js +369 -0
- package/lib/cjs/index.d.ts +1 -0
- package/lib/cjs/index.js +1 -0
- package/lib/cjs/types/action.d.ts +273 -82
- package/lib/cjs/types/action.js +12 -12
- package/lib/cjs/types/error.d.ts +349 -23
- package/lib/cjs/types/error.js +393 -39
- package/lib/cjs/types/sharedLiquidity.d.ts +2 -2
- package/lib/cjs/utils.d.ts +3 -1
- package/lib/cjs/utils.js +10 -1
- package/lib/esm/abis.d.ts +227 -2
- package/lib/esm/abis.js +157 -2
- package/lib/esm/actions/blue/borrow.d.ts +1 -1
- package/lib/esm/actions/blue/borrow.js +1 -1
- package/lib/esm/actions/blue/common.d.ts +6 -19
- package/lib/esm/actions/blue/common.js +30 -164
- package/lib/esm/actions/blue/refinance.d.ts +1 -1
- package/lib/esm/actions/blue/refinance.js +1 -1
- package/lib/esm/actions/blue/repay.d.ts +3 -3
- package/lib/esm/actions/blue/repay.js +1 -1
- package/lib/esm/actions/blue/repayWithdrawCollateral.d.ts +3 -3
- package/lib/esm/actions/blue/repayWithdrawCollateral.js +1 -1
- package/lib/esm/actions/blue/supply.d.ts +3 -3
- package/lib/esm/actions/blue/supply.js +5 -10
- package/lib/esm/actions/blue/supplyCollateral.d.ts +3 -3
- package/lib/esm/actions/blue/supplyCollateral.js +1 -1
- package/lib/esm/actions/blue/supplyCollateralBorrow.d.ts +3 -3
- package/lib/esm/actions/blue/supplyCollateralBorrow.js +1 -1
- package/lib/esm/actions/blue/withdraw.d.ts +1 -1
- package/lib/esm/actions/blue/withdraw.js +1 -1
- package/lib/esm/actions/blue/withdrawCollateral.d.ts +1 -1
- package/lib/esm/actions/blue/withdrawCollateral.js +1 -1
- package/lib/esm/actions/bundles/common.d.ts +230 -0
- package/lib/esm/actions/bundles/common.js +494 -0
- package/lib/esm/actions/bundles/index.d.ts +3 -0
- package/lib/esm/actions/bundles/index.js +2 -0
- package/lib/esm/actions/bundles/resolveBundlesTokenRequirements.d.ts +76 -0
- package/lib/esm/actions/bundles/resolveBundlesTokenRequirements.js +121 -0
- package/lib/esm/actions/index.d.ts +1 -0
- package/lib/esm/actions/index.js +1 -0
- package/lib/esm/actions/midnight/supplyCollateralTakeBorrow.d.ts +2 -2
- package/lib/esm/actions/midnight/supplyCollateralTakeBorrow.js +2 -2
- package/lib/esm/actions/midnight/takeBorrow.d.ts +2 -2
- package/lib/esm/actions/midnight/takeBorrow.js +2 -2
- package/lib/esm/actions/midnight/takeLend.d.ts +2 -2
- package/lib/esm/actions/midnight/takeLend.js +2 -2
- package/lib/esm/actions/requirements/blue/getBlueAuthorizationRequirement.d.ts +3 -0
- package/lib/esm/actions/requirements/blue/getBlueAuthorizationRequirement.js +8 -12
- package/lib/esm/actions/requirements/blue/index.d.ts +0 -2
- package/lib/esm/actions/requirements/blue/index.js +0 -2
- package/lib/esm/actions/requirements/encode/encodeBlueSignatureAuthorization.d.ts +15 -8
- package/lib/esm/actions/requirements/encode/encodeBlueSignatureAuthorization.js +22 -22
- package/lib/esm/actions/requirements/encode/encodeErc20Approval.d.ts +1 -1
- package/lib/esm/actions/requirements/encode/encodeErc20Approval.js +2 -1
- package/lib/esm/actions/requirements/encode/encodeErc20Permit.d.ts +19 -10
- package/lib/esm/actions/requirements/encode/encodeErc20Permit.js +44 -32
- package/lib/esm/actions/requirements/encode/encodeErc20Permit2Approve.d.ts +4 -2
- package/lib/esm/actions/requirements/encode/encodeErc20Permit2Approve.js +15 -10
- package/lib/{cjs/actions/requirements/encode/encodeErc20Permit2TransferFrom.d.ts → esm/actions/requirements/encode/encodeErc20Permit2SignatureTransfer.d.ts} +16 -14
- package/lib/esm/actions/requirements/encode/{encodeErc20Permit2TransferFrom.js → encodeErc20Permit2SignatureTransfer.js} +25 -20
- package/lib/esm/actions/requirements/encode/encodeVaultSharesPermit.d.ts +12 -9
- package/lib/esm/actions/requirements/encode/encodeVaultSharesPermit.js +27 -21
- package/lib/esm/actions/requirements/encode/index.d.ts +1 -1
- package/lib/esm/actions/requirements/encode/index.js +1 -1
- package/lib/esm/actions/requirements/generalAdapter/getGeneralAdapterRequirements.js +1 -0
- package/lib/esm/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit.d.ts +4 -1
- package/lib/esm/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit.js +5 -2
- package/lib/esm/actions/requirements/getRequirementsApproval.d.ts +4 -3
- package/lib/esm/actions/requirements/getRequirementsApproval.js +4 -3
- package/lib/esm/actions/signatures/getTokenRequirementActions.js +3 -3
- package/lib/esm/actions/signatures/getVaultExitBundlesV1PermitStruct.d.ts +28 -30
- package/lib/esm/actions/signatures/getVaultExitBundlesV1PermitStruct.js +21 -67
- package/lib/esm/actions/vaultV1/deposit.d.ts +73 -57
- package/lib/esm/actions/vaultV1/deposit.js +112 -111
- package/lib/esm/actions/vaultV1/inKindRedeem.d.ts +1 -0
- package/lib/esm/actions/vaultV1/inKindRedeem.js +3 -2
- package/lib/esm/actions/vaultV1/migrateToV2.d.ts +43 -66
- package/lib/esm/actions/vaultV1/migrateToV2.js +93 -106
- package/lib/esm/actions/vaultV1/redeem.d.ts +30 -23
- package/lib/esm/actions/vaultV1/redeem.js +56 -33
- package/lib/esm/actions/vaultV1/withdraw.d.ts +58 -24
- package/lib/esm/actions/vaultV1/withdraw.js +86 -34
- package/lib/esm/actions/vaultV2/deposit.d.ts +74 -57
- package/lib/esm/actions/vaultV2/deposit.js +113 -111
- package/lib/esm/actions/vaultV2/forceWithdraw.d.ts +58 -39
- package/lib/esm/actions/vaultV2/forceWithdraw.js +89 -62
- package/lib/esm/actions/vaultV2/inKindRedeem.d.ts +1 -0
- package/lib/esm/actions/vaultV2/inKindRedeem.js +3 -2
- package/lib/esm/actions/vaultV2/redeem.d.ts +30 -24
- package/lib/esm/actions/vaultV2/redeem.js +56 -34
- package/lib/esm/actions/vaultV2/withdraw.d.ts +58 -25
- package/lib/esm/actions/vaultV2/withdraw.js +86 -35
- package/lib/esm/augment/VaultMarketPublicAllocatorConfig.d.ts +4 -1
- package/lib/esm/augment/VaultMarketPublicAllocatorConfig.js +3 -1
- package/lib/esm/blue/abis.d.ts +5 -1
- package/lib/esm/blue/abis.js +5 -1
- package/lib/esm/blue/entities.d.ts +8 -2
- package/lib/esm/blue/entities.js +3 -1
- package/lib/esm/blue/errors.d.ts +1 -1
- package/lib/esm/blue/errors.js +1 -1
- package/lib/esm/blue/fetch.d.ts +3 -1
- package/lib/esm/blue/fetch.js +3 -1
- package/lib/esm/entities/blue/blue.d.ts +29 -20
- package/lib/esm/entities/blue/blue.js +7 -2
- package/lib/esm/entities/index.d.ts +9 -2
- package/lib/esm/entities/index.js +4 -1
- package/lib/esm/entities/midnight/midnight.d.ts +2 -2
- package/lib/esm/entities/midnight/midnight.js +20 -24
- package/lib/esm/{actions/requirements/blue/getBlueBundlesV1TokenRequirements.d.ts → entities/requirements/getBundlesTokenRequirements.d.ts} +27 -19
- package/lib/esm/{actions/requirements/blue/getBlueBundlesV1TokenRequirements.js → entities/requirements/getBundlesTokenRequirements.js} +67 -66
- package/lib/{cjs/actions/requirements/blue → esm/entities/requirements}/getUnusedPermit2Nonce.d.ts +1 -1
- package/lib/esm/{actions/requirements/blue → entities/requirements}/getUnusedPermit2Nonce.js +4 -4
- package/lib/esm/entities/requirements/getVaultBundlesSharesRequirements.d.ts +28 -0
- package/lib/esm/entities/requirements/getVaultBundlesSharesRequirements.js +70 -0
- package/lib/esm/entities/requirements/index.d.ts +2 -0
- package/lib/esm/entities/requirements/index.js +2 -0
- package/lib/esm/entities/vaultV1/vaultV1.d.ts +356 -101
- package/lib/esm/entities/vaultV1/vaultV1.js +338 -124
- package/lib/esm/entities/vaultV1ReallocationData.d.ts +6 -0
- package/lib/esm/entities/vaultV1ReallocationData.js +20 -5
- package/lib/esm/entities/vaultV2/vaultV2.d.ts +359 -100
- package/lib/esm/entities/vaultV2/vaultV2.js +452 -97
- package/lib/esm/entities/vaultV2BlueReallocationData.d.ts +8 -1
- package/lib/esm/entities/vaultV2BlueReallocationData.js +46 -13
- package/lib/esm/errors.d.ts +1 -1
- package/lib/esm/errors.js +1 -1
- package/lib/esm/fetch.d.ts +3 -1
- package/lib/esm/fetch.js +3 -1
- package/lib/esm/helpers/computeVaultV1Reallocations.d.ts +2 -0
- package/lib/esm/helpers/computeVaultV1Reallocations.js +2 -0
- package/lib/esm/helpers/index.d.ts +4 -1
- package/lib/esm/helpers/index.js +4 -1
- package/lib/esm/helpers/metadata.d.ts +3 -5
- package/lib/esm/helpers/metadata.js +4 -6
- package/lib/esm/helpers/previewVaultV2ForceWithdraw.d.ts +107 -0
- package/lib/esm/helpers/previewVaultV2ForceWithdraw.js +161 -0
- package/lib/esm/helpers/previewVaultV2InKindRedeem.d.ts +1 -0
- package/lib/esm/helpers/previewVaultV2InKindRedeem.js +2 -0
- package/lib/esm/helpers/referralFee.d.ts +21 -0
- package/lib/esm/helpers/referralFee.js +31 -0
- package/lib/esm/helpers/slippage.d.ts +136 -1
- package/lib/esm/helpers/slippage.js +186 -2
- package/lib/esm/helpers/validate.d.ts +67 -8
- package/lib/esm/helpers/validate.js +92 -10
- package/lib/esm/helpers/validateRequirementSpender.d.ts +1 -1
- package/lib/esm/helpers/validateRequirementSpender.js +1 -0
- package/lib/esm/helpers/vaultV2ForceWithdrawPlan.d.ts +274 -0
- package/lib/esm/helpers/vaultV2ForceWithdrawPlan.js +362 -0
- package/lib/esm/index.d.ts +1 -0
- package/lib/esm/index.js +1 -0
- package/lib/esm/types/action.d.ts +273 -82
- package/lib/esm/types/action.js +11 -11
- package/lib/esm/types/error.d.ts +349 -23
- package/lib/esm/types/error.js +377 -31
- package/lib/esm/types/sharedLiquidity.d.ts +2 -2
- package/lib/esm/utils.d.ts +3 -1
- package/lib/esm/utils.js +3 -1
- package/package.json +7 -7
package/lib/cjs/types/error.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.
|
|
5
|
-
exports.RefinanceSharesMissingBorrowAssetsError = exports.RefinanceExceedsBorrowAssetsError = exports.RefinanceExceedsBorrowSharesError = exports.RefinanceExceedsCollateralError = exports.BorrowAmountAndSharesExclusiveError = exports.RefinanceTokenMismatchError = exports.RefinanceSameMarketError = exports.VaultAssetMismatchError = exports.ReallocationWithdrawExceedsMarketSupplyError = exports.WithdrawSharesExceedSupplyError = exports.WithdrawExceedsSupplyError = exports.MutuallyExclusiveWithdrawAmountsError = exports.InsufficientMidnightWithdrawableLiquidityError = exports.MidnightRedeemExceedsCreditError = exports.NoMidnightCreditToRedeemError = exports.UnpreparedMidnightOfferRootSignatureError = exports.MidnightOfferRootOfferCountMismatchError = exports.MidnightOfferRootRatifierMismatchError = exports.MidnightOfferRootOwnerMismatchError = exports.MidnightOfferRootMismatchError = exports.MissingMidnightOfferRootSignatureError = exports.UnknownMidnightRatifierError = exports.MidnightTakeableOfferMarketMismatchError = exports.MidnightOfferMarketLoanTokenMismatchError = exports.MidnightMarketAddressMismatchError = exports.MidnightOfferMarketAddressMismatchError = exports.MidnightOfferMarketChainMismatchError = exports.MidnightOfferMakerMismatchError = exports.MidnightOfferSideMismatchError = exports.EmptyMidnightTakeableOffersError = exports.MidnightAmountExceedsMaxOfferCapError = exports.ReallocationAdapterSupplySharesUnderflowError = exports.ReallocationAllocationUnderflowError = exports.UnknownReallocationAdapterError = void 0;
|
|
3
|
+
exports.ZeroSupplyAmountError = exports.NonPositiveWithdrawCollateralAmountError = exports.NonPositiveRepayMaxSharePriceError = exports.NonPositiveRepayAmountError = exports.NonPositiveReallocationAmountError = exports.ZeroCollateralAmountError = exports.NonPositiveBorrowAmountError = exports.ZeroDepositAmountError = exports.NonPositiveMaxSharePriceError = exports.NonPositiveSharesAmountError = exports.NonPositiveAssetAmountError = exports.MaxRepayAssetsBelowRepayAssetsError = exports.ReallocationsRequireBorrowError = exports.UnsupportedAuthorizationOperatorError = exports.ReallocationLoanTokenMismatchError = exports.SameVaultMigrationError = exports.AmountAndSharesExclusiveError = exports.MixedBundlesFundingError = exports.ReferralFeePctExceededError = exports.MissingReferralFeeRecipientError = exports.ReferralFeeRecipientMissingError = exports.NativeFundingAmountMismatchError = exports.Permit2TransferFromNonceAlreadyUsedError = exports.NoUnusedPermit2NonceError = exports.Permit2SignatureTransferNonceAlreadyUsedError = exports.BlueBundlesV1RequirementSignatureMismatchError = exports.BundlesRequirementSignatureMismatchError = exports.VaultExitBundlesV1PermitMismatchError = exports.BundlesPermitMismatchError = exports.VaultIsBlueFeeRecipientError = exports.VaultMorphoMismatchError = exports.InsufficientBlueBalanceForInKindRedeemError = exports.InKindRedeemCoverageError = exports.InKindRedeemZeroDeallocationError = exports.VaultV2ForceWithdrawFeeSharesExceedBurnError = exports.VaultV2ForceWithdrawZeroSharePriceError = exports.VaultV2ForceWithdrawZeroWithdrawalError = exports.VaultV2ForceWithdrawCoverageError = exports.VaultV2UndecodableLiquidityDataError = exports.VaultV2UnsupportedLiquidityAdapterError = exports.UnsupportedInKindAdapterError = exports.VaultV2UnsupportedExitAdapterError = exports.AdapterNotPartOfVaultError = exports.InKindRedeemRequiresSingleAdapterError = exports.VaultV2SingleAdapterRequiredError = exports.ExpiredDeadlineError = exports.EmptyMarketParamsListError = exports.InputExceedsMaxError = exports.NonPositiveInputError = exports.NegativeInputError = void 0;
|
|
4
|
+
exports.WithdrawMakesPositionUnhealthyError = exports.WithdrawExceedsCollateralError = exports.MutuallyExclusiveRepayAmountsError = exports.TransferAmountNotEqualToAssetsError = exports.UnsortedReallocationWithdrawalsError = exports.InconsistentReallocationPenaltyError = exports.InvalidReallocationSourceTypeError = exports.InvalidReallocationAddressError = exports.MixedReallocationVersionsError = exports.InvalidReallocationShapeError = exports.ReallocationWithdrawalOnTargetMarketError = exports.EmptyReallocationWithdrawalsError = exports.AccrualPositionUserMismatchError = exports.MarketIdMismatchError = exports.MissingMarketPriceError = exports.BorrowExceedsSafeLtvError = exports.NativeAmountOnNonWNativeCollateralError = exports.NativeAmountOnNonWNativeAssetError = exports.VaultAddressMismatchError = exports.ChainWNativeMissingError = exports.NativeAmountOnNonWNativeVaultError = exports.Permit2ExpirationMissingError = exports.DepositSpenderMismatchError = exports.DepositOwnerMismatchError = exports.DepositAssetMismatchError = exports.DepositAmountMismatchError = exports.EmptyDeallocationsError = exports.ExcessiveSlippageToleranceError = exports.MissingAccrualPositionError = exports.UnsupportedMidnightAuthorizationTargetError = exports.UnsupportedErc20ApprovalSpenderError = exports.ApprovalAmountLessThanSpendAmountError = exports.MissingClientPropertyError = exports.CryptoUnavailableError = exports.ChainIdMismatchError = exports.AddressMismatchError = exports.UnexpectedRequirementSignatureError = exports.AmbiguousRequirementSignaturesError = exports.BundlerErrors = exports.NegativeMaxRepaySharePriceError = exports.NegativeBorrowSharesError = exports.NegativeMinSharePriceError = exports.NegativeWithdrawMinSharePriceError = exports.NegativeSupplyMaxSharePriceError = exports.NegativeSupplyAmountError = exports.NonPositiveMinBorrowSharePriceError = exports.NegativeReallocationFeeError = exports.NegativeNativeAmountError = exports.NegativeSlippageToleranceError = exports.NonPositiveWithdrawAmountError = void 0;
|
|
5
|
+
exports.RefinanceSharesMissingBorrowAssetsError = exports.RefinanceExceedsBorrowAssetsError = exports.RefinanceExceedsBorrowSharesError = exports.RefinanceExceedsCollateralError = exports.BorrowAmountAndSharesExclusiveError = exports.RefinanceTokenMismatchError = exports.RefinanceSameMarketError = exports.VaultAssetMismatchError = exports.ReallocationWithdrawExceedsMarketSupplyError = exports.WithdrawSharesExceedSupplyError = exports.WithdrawExceedsSupplyError = exports.MutuallyExclusiveWithdrawAmountsError = exports.InsufficientMidnightWithdrawableLiquidityError = exports.MidnightRedeemExceedsCreditError = exports.NoMidnightCreditToRedeemError = exports.UnpreparedMidnightOfferRootSignatureError = exports.MidnightOfferRootOfferCountMismatchError = exports.MidnightOfferRootRatifierMismatchError = exports.MidnightOfferRootOwnerMismatchError = exports.MidnightOfferRootMismatchError = exports.MissingMidnightOfferRootSignatureError = exports.UnknownMidnightRatifierError = exports.MidnightTakeableOfferMarketMismatchError = exports.MidnightOfferMarketLoanTokenMismatchError = exports.MidnightMarketAddressMismatchError = exports.MidnightOfferMarketAddressMismatchError = exports.MidnightOfferMarketChainMismatchError = exports.MidnightOfferMakerMismatchError = exports.MidnightOfferSideMismatchError = exports.EmptyMidnightTakeableOffersError = exports.MidnightAmountExceedsMaxOfferCapError = exports.ReallocationAdapterSupplySharesUnderflowError = exports.ReallocationAllocationUnderflowError = exports.UnknownReallocationAdapterError = exports.UnknownReallocationMarketPublicAllocatorConfigError = exports.UnknownReallocationActiveAdaptersError = exports.UnknownReallocationPublicAllocatorConfigError = exports.UnknownReallocationAllocationError = exports.UnknownReallocationPositionError = exports.UnknownReallocationVaultMarketConfigError = exports.UnknownReallocationVaultError = exports.UnknownReallocationMarketError = exports.InsufficientSharedLiquidityError = exports.DisabledReallocationMarketError = exports.MissingPublicAllocatorConfigError = exports.RepaySharesExceedDebtError = exports.InvalidSignatureError = exports.RepayExceedsDebtError = exports.ShareDivideByZeroError = void 0;
|
|
6
6
|
const blue_sdk_1 = require("@morpho-org/blue-sdk");
|
|
7
7
|
/**
|
|
8
8
|
* Thrown when a morpho-sdk input that must be non-negative is negative.
|
|
@@ -107,8 +107,23 @@ class ExpiredDeadlineError extends Error {
|
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
exports.ExpiredDeadlineError = ExpiredDeadlineError;
|
|
110
|
-
/**
|
|
111
|
-
|
|
110
|
+
/**
|
|
111
|
+
* Thrown when a VaultExitBundlesV1 Vault V2 exit targets a vault without exactly one adapter.
|
|
112
|
+
*
|
|
113
|
+
* Both `vaultExitBundlesV1InKindRedemptionVaultV2` and
|
|
114
|
+
* `vaultExitBundlesV1ForceWithdrawVaultV2` require `adaptersLength() == 1`.
|
|
115
|
+
*
|
|
116
|
+
* @example
|
|
117
|
+
* ```ts
|
|
118
|
+
* import { VaultV2SingleAdapterRequiredError } from "@morpho-org/morpho-sdk";
|
|
119
|
+
*
|
|
120
|
+
* const error = new VaultV2SingleAdapterRequiredError(vault, 2);
|
|
121
|
+
* if (error instanceof VaultV2SingleAdapterRequiredError) {
|
|
122
|
+
* console.error(error.vault, error.adapters);
|
|
123
|
+
* }
|
|
124
|
+
* ```
|
|
125
|
+
*/
|
|
126
|
+
class VaultV2SingleAdapterRequiredError extends Error {
|
|
112
127
|
vault;
|
|
113
128
|
adapters;
|
|
114
129
|
/**
|
|
@@ -116,13 +131,15 @@ class InKindRedeemRequiresSingleAdapterError extends Error {
|
|
|
116
131
|
* @param adapters - Number of adapters in the supplied vault snapshot.
|
|
117
132
|
*/
|
|
118
133
|
constructor(vault, adapters) {
|
|
119
|
-
super(`Vault "${vault}" has "${adapters}" adapters.
|
|
134
|
+
super(`Vault "${vault}" has "${adapters}" adapters. VaultExitBundlesV1 exits require exactly one MorphoMarketV1AdapterV2.`);
|
|
120
135
|
this.vault = vault;
|
|
121
136
|
this.adapters = adapters;
|
|
122
|
-
this.name = "
|
|
137
|
+
this.name = "VaultV2SingleAdapterRequiredError";
|
|
123
138
|
}
|
|
124
139
|
}
|
|
125
|
-
exports.
|
|
140
|
+
exports.VaultV2SingleAdapterRequiredError = VaultV2SingleAdapterRequiredError;
|
|
141
|
+
/** @deprecated Use {@link VaultV2SingleAdapterRequiredError}. */
|
|
142
|
+
exports.InKindRedeemRequiresSingleAdapterError = VaultV2SingleAdapterRequiredError;
|
|
126
143
|
/** Thrown when a requested in-kind redemption adapter is not part of the Vault V2 snapshot. */
|
|
127
144
|
class AdapterNotPartOfVaultError extends Error {
|
|
128
145
|
vault;
|
|
@@ -139,19 +156,299 @@ class AdapterNotPartOfVaultError extends Error {
|
|
|
139
156
|
}
|
|
140
157
|
}
|
|
141
158
|
exports.AdapterNotPartOfVaultError = AdapterNotPartOfVaultError;
|
|
142
|
-
/**
|
|
143
|
-
|
|
159
|
+
/**
|
|
160
|
+
* Thrown when the Vault V2 adapter cannot expose MorphoMarketV1AdapterV2 market shares.
|
|
161
|
+
*
|
|
162
|
+
* VaultExitBundlesV1 casts the adapter to `IMorphoMarketV1AdapterV2`, so a legacy
|
|
163
|
+
* positions-based `MorphoMarketV1Adapter` or a `MorphoVaultV1Adapter` cannot be exited.
|
|
164
|
+
*
|
|
165
|
+
* @example
|
|
166
|
+
* ```ts
|
|
167
|
+
* import { VaultV2UnsupportedExitAdapterError } from "@morpho-org/morpho-sdk";
|
|
168
|
+
*
|
|
169
|
+
* const error = new VaultV2UnsupportedExitAdapterError(adapter);
|
|
170
|
+
* if (error instanceof VaultV2UnsupportedExitAdapterError) {
|
|
171
|
+
* console.error(error.adapter);
|
|
172
|
+
* }
|
|
173
|
+
* ```
|
|
174
|
+
*/
|
|
175
|
+
class VaultV2UnsupportedExitAdapterError extends Error {
|
|
144
176
|
adapter;
|
|
145
177
|
/**
|
|
146
178
|
* @param adapter - Unsupported Vault V2 adapter address.
|
|
147
179
|
*/
|
|
148
180
|
constructor(adapter) {
|
|
149
|
-
super(`Adapter "${adapter}" does not support Vault V2
|
|
181
|
+
super(`Adapter "${adapter}" does not support Vault V2 exits through VaultExitBundlesV1. Use a MorphoMarketV1AdapterV2-backed vault.`);
|
|
150
182
|
this.adapter = adapter;
|
|
151
|
-
this.name = "
|
|
183
|
+
this.name = "VaultV2UnsupportedExitAdapterError";
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
exports.VaultV2UnsupportedExitAdapterError = VaultV2UnsupportedExitAdapterError;
|
|
187
|
+
/** @deprecated Use {@link VaultV2UnsupportedExitAdapterError}. */
|
|
188
|
+
exports.UnsupportedInKindAdapterError = VaultV2UnsupportedExitAdapterError;
|
|
189
|
+
/**
|
|
190
|
+
* Thrown when a Vault V2 exit cannot resolve the vault's configured liquidity adapter.
|
|
191
|
+
*
|
|
192
|
+
* `VaultExitBundlesV1.vaultExitBundlesV1ForceWithdrawVaultV2` casts `liquidityAdapter` to
|
|
193
|
+
* `IMorphoMarketV1AdapterV2` and ABI-decodes `liquidityData` as `MarketParams`. Because the exit
|
|
194
|
+
* also requires `adaptersLength() == 1`, the only resolvable configurations are an unset
|
|
195
|
+
* liquidity adapter or the vault's sole adapter.
|
|
196
|
+
*
|
|
197
|
+
* @example
|
|
198
|
+
* ```ts
|
|
199
|
+
* import { VaultV2UnsupportedLiquidityAdapterError } from "@morpho-org/morpho-sdk";
|
|
200
|
+
*
|
|
201
|
+
* const error = new VaultV2UnsupportedLiquidityAdapterError({
|
|
202
|
+
* vault,
|
|
203
|
+
* liquidityAdapter,
|
|
204
|
+
* adapter,
|
|
205
|
+
* });
|
|
206
|
+
* if (error instanceof VaultV2UnsupportedLiquidityAdapterError) {
|
|
207
|
+
* console.error(error.liquidityAdapter, error.adapter);
|
|
208
|
+
* }
|
|
209
|
+
* ```
|
|
210
|
+
*/
|
|
211
|
+
class VaultV2UnsupportedLiquidityAdapterError extends Error {
|
|
212
|
+
/** Vault V2 address. */
|
|
213
|
+
vault;
|
|
214
|
+
/** Liquidity adapter configured on the vault. */
|
|
215
|
+
liquidityAdapter;
|
|
216
|
+
/** Sole adapter the exit targets. */
|
|
217
|
+
adapter;
|
|
218
|
+
/**
|
|
219
|
+
* @param params - Liquidity-adapter mismatch details.
|
|
220
|
+
* @param params.vault - Vault V2 address.
|
|
221
|
+
* @param params.liquidityAdapter - Liquidity adapter configured on the vault.
|
|
222
|
+
* @param params.adapter - Sole adapter the exit targets.
|
|
223
|
+
*/
|
|
224
|
+
constructor(params) {
|
|
225
|
+
super(`Vault "${params.vault}" routes liquidity through "${params.liquidityAdapter}", which is neither unset nor its sole adapter "${params.adapter}". Use another exit path until the vault routes liquidity through its sole MorphoMarketV1AdapterV2.`);
|
|
226
|
+
this.vault = params.vault;
|
|
227
|
+
this.liquidityAdapter = params.liquidityAdapter;
|
|
228
|
+
this.adapter = params.adapter;
|
|
229
|
+
this.name = "VaultV2UnsupportedLiquidityAdapterError";
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
exports.VaultV2UnsupportedLiquidityAdapterError = VaultV2UnsupportedLiquidityAdapterError;
|
|
233
|
+
/**
|
|
234
|
+
* Thrown when a Vault V2 exit cannot ABI-decode the vault's `liquidityData` as `MarketParams`.
|
|
235
|
+
*
|
|
236
|
+
* Distinct from {@link VaultV2UnsupportedLiquidityAdapterError}: the liquidity adapter *is* the
|
|
237
|
+
* vault's sole adapter, but the market params stored alongside it are unusable, so the contract's
|
|
238
|
+
* `abi.decode` would revert. Only the vault curator can repair this by re-setting the liquidity
|
|
239
|
+
* adapter and data.
|
|
240
|
+
*
|
|
241
|
+
* @example
|
|
242
|
+
* ```ts
|
|
243
|
+
* import { VaultV2UndecodableLiquidityDataError } from "@morpho-org/morpho-sdk";
|
|
244
|
+
*
|
|
245
|
+
* try {
|
|
246
|
+
* vault.forceWithdraw({ exitAssets: 1_000_000n, vaultData, userAddress });
|
|
247
|
+
* } catch (error) {
|
|
248
|
+
* if (error instanceof VaultV2UndecodableLiquidityDataError) {
|
|
249
|
+
* console.error(error.liquidityData, error.cause);
|
|
250
|
+
* }
|
|
251
|
+
* }
|
|
252
|
+
* ```
|
|
253
|
+
*/
|
|
254
|
+
class VaultV2UndecodableLiquidityDataError extends Error {
|
|
255
|
+
/** Vault V2 address. */
|
|
256
|
+
vault;
|
|
257
|
+
/** Liquidity adapter configured on the vault. */
|
|
258
|
+
liquidityAdapter;
|
|
259
|
+
/** Raw `liquidityData` that failed to decode. */
|
|
260
|
+
liquidityData;
|
|
261
|
+
/**
|
|
262
|
+
* @param params - Undecodable liquidity-data details.
|
|
263
|
+
* @param params.vault - Vault V2 address.
|
|
264
|
+
* @param params.liquidityAdapter - Liquidity adapter configured on the vault.
|
|
265
|
+
* @param params.liquidityData - Raw `liquidityData` that failed to decode.
|
|
266
|
+
* @param params.cause - Underlying decode failure.
|
|
267
|
+
*/
|
|
268
|
+
constructor(params) {
|
|
269
|
+
super(`Vault "${params.vault}" stores liquidity data "${params.liquidityData}" for adapter "${params.liquidityAdapter}" that does not decode as MarketParams. Use another exit path until the vault curator re-sets its liquidity adapter and data.`, { cause: params.cause });
|
|
270
|
+
this.vault = params.vault;
|
|
271
|
+
this.liquidityAdapter = params.liquidityAdapter;
|
|
272
|
+
this.liquidityData = params.liquidityData;
|
|
273
|
+
this.name = "VaultV2UndecodableLiquidityDataError";
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
exports.VaultV2UndecodableLiquidityDataError = VaultV2UndecodableLiquidityDataError;
|
|
277
|
+
/**
|
|
278
|
+
* Thrown when the adapter's markets cannot cover a Vault V2 force withdrawal.
|
|
279
|
+
*
|
|
280
|
+
* `vaultExitBundlesV1ForceWithdrawVaultV2` loops over the adapter's market list without a bound,
|
|
281
|
+
* so an under-covered request reverts on-chain with a raw `panic 0x32`. This error surfaces that
|
|
282
|
+
* failure before submission.
|
|
283
|
+
*
|
|
284
|
+
* @example
|
|
285
|
+
* ```ts
|
|
286
|
+
* import { VaultV2ForceWithdrawCoverageError } from "@morpho-org/morpho-sdk";
|
|
287
|
+
*
|
|
288
|
+
* const error = new VaultV2ForceWithdrawCoverageError({
|
|
289
|
+
* required: 100n,
|
|
290
|
+
* covered: 40n,
|
|
291
|
+
* maxExitAssets: 60n,
|
|
292
|
+
* });
|
|
293
|
+
* if (error instanceof VaultV2ForceWithdrawCoverageError) {
|
|
294
|
+
* console.error(error.maxExitAssets);
|
|
295
|
+
* }
|
|
296
|
+
* ```
|
|
297
|
+
*/
|
|
298
|
+
class VaultV2ForceWithdrawCoverageError extends Error {
|
|
299
|
+
/** Assets that must be force-deallocated from the adapter's markets. */
|
|
300
|
+
required;
|
|
301
|
+
/** Assets the adapter's markets can actually release. */
|
|
302
|
+
covered;
|
|
303
|
+
/** Largest penalty-inclusive `exitAssets` the current vault state supports. */
|
|
304
|
+
maxExitAssets;
|
|
305
|
+
/**
|
|
306
|
+
* @param params - Coverage values used to explain the rejected exit.
|
|
307
|
+
* @param params.required - Assets that must be force-deallocated.
|
|
308
|
+
* @param params.covered - Assets the adapter's markets can release.
|
|
309
|
+
* @param params.maxExitAssets - Largest supported penalty-inclusive `exitAssets`.
|
|
310
|
+
*/
|
|
311
|
+
constructor(params) {
|
|
312
|
+
super(`Force withdrawal requires "${params.required}" force-deallocated assets but the adapter's markets only release "${params.covered}". Reduce exitAssets to at most "${params.maxExitAssets}" or wait for market liquidity.`);
|
|
313
|
+
this.required = params.required;
|
|
314
|
+
this.covered = params.covered;
|
|
315
|
+
this.maxExitAssets = params.maxExitAssets;
|
|
316
|
+
this.name = "VaultV2ForceWithdrawCoverageError";
|
|
152
317
|
}
|
|
153
318
|
}
|
|
154
|
-
exports.
|
|
319
|
+
exports.VaultV2ForceWithdrawCoverageError = VaultV2ForceWithdrawCoverageError;
|
|
320
|
+
/**
|
|
321
|
+
* Thrown when a Vault V2 force withdrawal would withdraw nothing while still consuming its permit.
|
|
322
|
+
*
|
|
323
|
+
* Happens on a dust `exitAssets` when the vault has no penalty-free liquidity and the
|
|
324
|
+
* penalty-adjusted remainder rounds down to zero.
|
|
325
|
+
*
|
|
326
|
+
* @example
|
|
327
|
+
* ```ts
|
|
328
|
+
* import { VaultV2ForceWithdrawZeroWithdrawalError } from "@morpho-org/morpho-sdk";
|
|
329
|
+
*
|
|
330
|
+
* const error = new VaultV2ForceWithdrawZeroWithdrawalError({
|
|
331
|
+
* vault,
|
|
332
|
+
* exitAssets: 1n,
|
|
333
|
+
* penalty: 20_000000000000000n,
|
|
334
|
+
* });
|
|
335
|
+
* if (error instanceof VaultV2ForceWithdrawZeroWithdrawalError) {
|
|
336
|
+
* console.error(error.exitAssets, error.penalty);
|
|
337
|
+
* }
|
|
338
|
+
* ```
|
|
339
|
+
*/
|
|
340
|
+
class VaultV2ForceWithdrawZeroWithdrawalError extends Error {
|
|
341
|
+
/** Vault V2 address. */
|
|
342
|
+
vault;
|
|
343
|
+
/** Positive penalty-inclusive amount requested by the caller. */
|
|
344
|
+
exitAssets;
|
|
345
|
+
/** WAD-scaled force-deallocation penalty applied by the adapter. */
|
|
346
|
+
penalty;
|
|
347
|
+
/**
|
|
348
|
+
* @param params - Values that caused the exit to withdraw nothing.
|
|
349
|
+
* @param params.vault - Vault V2 address.
|
|
350
|
+
* @param params.exitAssets - Positive penalty-inclusive amount requested by the caller.
|
|
351
|
+
* @param params.penalty - WAD-scaled force-deallocation penalty applied by the adapter.
|
|
352
|
+
*/
|
|
353
|
+
constructor(params) {
|
|
354
|
+
super(`Vault "${params.vault}" has no penalty-free liquidity, and force-withdraw exitAssets "${params.exitAssets}" rounds to zero withdrawn assets after applying penalty "${params.penalty}". Increase exitAssets or use another exit path.`);
|
|
355
|
+
this.vault = params.vault;
|
|
356
|
+
this.exitAssets = params.exitAssets;
|
|
357
|
+
this.penalty = params.penalty;
|
|
358
|
+
this.name = "VaultV2ForceWithdrawZeroWithdrawalError";
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
exports.VaultV2ForceWithdrawZeroWithdrawalError = VaultV2ForceWithdrawZeroWithdrawalError;
|
|
362
|
+
/**
|
|
363
|
+
* Thrown when a Vault V2 force withdrawal's derived share-price floor rounds down to zero.
|
|
364
|
+
*
|
|
365
|
+
* VaultExitBundlesV1 reads `minSharePriceE27 == 0` as "no bound at all", so emitting a rounded-down
|
|
366
|
+
* zero would silently ship an exit with none of the slippage protection this path exists to add.
|
|
367
|
+
* Reaching it means the exit burns more shares than `withdrawnAssets` can price at RAY scale — a
|
|
368
|
+
* vault whose share price has collapsed below `1e-27` assets per share, or a dust exit against one.
|
|
369
|
+
*
|
|
370
|
+
* @example
|
|
371
|
+
* ```ts
|
|
372
|
+
* import { VaultV2ForceWithdrawZeroSharePriceError } from "@morpho-org/morpho-sdk";
|
|
373
|
+
*
|
|
374
|
+
* try {
|
|
375
|
+
* vault.forceWithdraw({ exitAssets, vaultData, userAddress });
|
|
376
|
+
* } catch (error) {
|
|
377
|
+
* if (error instanceof VaultV2ForceWithdrawZeroSharePriceError) {
|
|
378
|
+
* console.error(error.withdrawnAssets, error.sharesBurnt);
|
|
379
|
+
* }
|
|
380
|
+
* }
|
|
381
|
+
* ```
|
|
382
|
+
*/
|
|
383
|
+
class VaultV2ForceWithdrawZeroSharePriceError extends Error {
|
|
384
|
+
/** Assets the exit withdraws in total, before the referral fee. */
|
|
385
|
+
withdrawnAssets;
|
|
386
|
+
/** Upper bound of the vault shares the exit burns. */
|
|
387
|
+
sharesBurnt;
|
|
388
|
+
/** WAD-scaled slippage tolerance applied to the floor. */
|
|
389
|
+
slippageTolerance;
|
|
390
|
+
/**
|
|
391
|
+
* @param params - Values whose ratio rounded down to a zero share-price floor.
|
|
392
|
+
* @param params.withdrawnAssets - Assets the exit withdraws in total, before the referral fee.
|
|
393
|
+
* @param params.sharesBurnt - Upper bound of the vault shares the exit burns.
|
|
394
|
+
* @param params.slippageTolerance - WAD-scaled slippage tolerance applied to the floor.
|
|
395
|
+
*/
|
|
396
|
+
constructor(params) {
|
|
397
|
+
super(`Force-withdraw share-price floor rounds to zero: withdrawnAssets "${params.withdrawnAssets}" over sharesBurnt "${params.sharesBurnt}" at slippageTolerance "${params.slippageTolerance}". The contract reads a zero floor as no bound at all, so this exit cannot be built safely — increase exitAssets or use another exit path.`);
|
|
398
|
+
this.withdrawnAssets = params.withdrawnAssets;
|
|
399
|
+
this.sharesBurnt = params.sharesBurnt;
|
|
400
|
+
this.slippageTolerance = params.slippageTolerance;
|
|
401
|
+
this.name = "VaultV2ForceWithdrawZeroSharePriceError";
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
exports.VaultV2ForceWithdrawZeroSharePriceError = VaultV2ForceWithdrawZeroSharePriceError;
|
|
405
|
+
/**
|
|
406
|
+
* Thrown when fee shares projected to the accepted deadline reach the lower force-withdraw
|
|
407
|
+
* burn bound at that time.
|
|
408
|
+
*
|
|
409
|
+
* VaultExitBundlesV1 measures shares burned after its first withdrawal accrues fees. If the
|
|
410
|
+
* recipient's fee shares are at least the measured burn bound, its share-price check is skipped or
|
|
411
|
+
* reverts due to an underflow.
|
|
412
|
+
*
|
|
413
|
+
* @example
|
|
414
|
+
* ```ts
|
|
415
|
+
* import { VaultV2ForceWithdrawFeeSharesExceedBurnError } from "@morpho-org/morpho-sdk";
|
|
416
|
+
*
|
|
417
|
+
* try {
|
|
418
|
+
* vault.forceWithdraw({ exitAssets, vaultData, userAddress });
|
|
419
|
+
* } catch (error) {
|
|
420
|
+
* if (error instanceof VaultV2ForceWithdrawFeeSharesExceedBurnError) {
|
|
421
|
+
* console.error(error.sharesBurnt, error.feeShares);
|
|
422
|
+
* }
|
|
423
|
+
* }
|
|
424
|
+
* ```
|
|
425
|
+
*/
|
|
426
|
+
class VaultV2ForceWithdrawFeeSharesExceedBurnError extends Error {
|
|
427
|
+
/** Vault V2 address being exited. */
|
|
428
|
+
vault;
|
|
429
|
+
/** Fee-recipient account submitting the exit. */
|
|
430
|
+
userAddress;
|
|
431
|
+
/** Lower bound of shares measured as burned by VaultExitBundlesV1. */
|
|
432
|
+
sharesBurnt;
|
|
433
|
+
/** Fee shares projected for `userAddress` at the accepted deadline. */
|
|
434
|
+
feeShares;
|
|
435
|
+
/**
|
|
436
|
+
* @param params - Fee-share and burn-bound values that make the exit unsafe.
|
|
437
|
+
* @param params.vault - Vault V2 address being exited.
|
|
438
|
+
* @param params.userAddress - Fee-recipient account submitting the exit.
|
|
439
|
+
* @param params.sharesBurnt - Lower bound of shares measured as burned by VaultExitBundlesV1.
|
|
440
|
+
* @param params.feeShares - Fee shares projected for `userAddress` at the accepted deadline.
|
|
441
|
+
*/
|
|
442
|
+
constructor(params) {
|
|
443
|
+
super(`Vault V2 "${params.vault}" fee-recipient account "${params.userAddress}" accrues "${params.feeShares}" fee shares, reaching the lower force-withdraw share-burn bound "${params.sharesBurnt}". VaultExitBundlesV1's share-price check would be skipped or revert. Increase exitAssets or let the vault accrue first.`);
|
|
444
|
+
this.vault = params.vault;
|
|
445
|
+
this.userAddress = params.userAddress;
|
|
446
|
+
this.sharesBurnt = params.sharesBurnt;
|
|
447
|
+
this.feeShares = params.feeShares;
|
|
448
|
+
this.name = "VaultV2ForceWithdrawFeeSharesExceedBurnError";
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
exports.VaultV2ForceWithdrawFeeSharesExceedBurnError = VaultV2ForceWithdrawFeeSharesExceedBurnError;
|
|
155
452
|
/** Thrown when a Vault V2 in-kind redemption rounds to no deallocated assets. */
|
|
156
453
|
class InKindRedeemZeroDeallocationError extends Error {
|
|
157
454
|
/**
|
|
@@ -248,8 +545,8 @@ class VaultIsBlueFeeRecipientError extends Error {
|
|
|
248
545
|
}
|
|
249
546
|
}
|
|
250
547
|
exports.VaultIsBlueFeeRecipientError = VaultIsBlueFeeRecipientError;
|
|
251
|
-
/** Thrown when a vault-shares requirement cannot be safely encoded as
|
|
252
|
-
class
|
|
548
|
+
/** Thrown when a vault-shares requirement cannot be safely encoded as a bundles permit. */
|
|
549
|
+
class BundlesPermitMismatchError extends Error {
|
|
253
550
|
/**
|
|
254
551
|
* @param params - Permit mismatch values used to explain the rejection.
|
|
255
552
|
* @param params.field - Permit field that does not match the exit.
|
|
@@ -261,19 +558,32 @@ class VaultExitBundlesV1PermitMismatchError extends Error {
|
|
|
261
558
|
expected;
|
|
262
559
|
actual;
|
|
263
560
|
constructor(params) {
|
|
264
|
-
super(`
|
|
561
|
+
super(`Bundles permit ${params.field} mismatch: expected "${params.expected}", got "${params.actual}". Resolve and sign the requirements returned by this prepared operation.`, { cause: params.cause });
|
|
265
562
|
this.field = params.field;
|
|
266
563
|
this.expected = params.expected;
|
|
267
564
|
this.actual = params.actual;
|
|
565
|
+
this.name = "BundlesPermitMismatchError";
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
exports.BundlesPermitMismatchError = BundlesPermitMismatchError;
|
|
569
|
+
/**
|
|
570
|
+
* Thrown by the deprecated VaultExitBundlesV1 permit compatibility helper.
|
|
571
|
+
*
|
|
572
|
+
* @deprecated Use {@link BundlesPermitMismatchError} with `getBundlesSharesPermit`.
|
|
573
|
+
*/
|
|
574
|
+
class VaultExitBundlesV1PermitMismatchError extends BundlesPermitMismatchError {
|
|
575
|
+
constructor(params) {
|
|
576
|
+
super(params);
|
|
577
|
+
this.message = `VaultExitBundlesV1 permit ${params.field} mismatch: expected "${params.expected}", got "${params.actual}". Rebuild and sign the vault-exit permit.`;
|
|
268
578
|
this.name = "VaultExitBundlesV1PermitMismatchError";
|
|
269
579
|
}
|
|
270
580
|
}
|
|
271
581
|
exports.VaultExitBundlesV1PermitMismatchError = VaultExitBundlesV1PermitMismatchError;
|
|
272
|
-
/** Thrown when a signed requirement cannot be safely encoded for
|
|
273
|
-
class
|
|
274
|
-
/** Field whose signed value or encoding is invalid for the
|
|
582
|
+
/** Thrown when a signed requirement cannot be safely encoded for a fixed bundles call. */
|
|
583
|
+
class BundlesRequirementSignatureMismatchError extends Error {
|
|
584
|
+
/** Field whose signed value or encoding is invalid for the fixed bundles call. */
|
|
275
585
|
field;
|
|
276
|
-
/** Value required by
|
|
586
|
+
/** Value required by the fixed bundles call. */
|
|
277
587
|
expected;
|
|
278
588
|
/** Value supplied by the signed requirement. */
|
|
279
589
|
actual;
|
|
@@ -285,24 +595,17 @@ class BlueBundlesV1RequirementSignatureMismatchError extends Error {
|
|
|
285
595
|
* @param params.cause - Original signature parser failure, when applicable.
|
|
286
596
|
*/
|
|
287
597
|
constructor(params) {
|
|
288
|
-
super(`
|
|
598
|
+
super(`Bundles requirement ${params.field} mismatch: expected "${params.expected}", got "${params.actual}". Resolve and sign the requirements returned by this prepared operation.`, { cause: params.cause });
|
|
289
599
|
this.field = params.field;
|
|
290
600
|
this.expected = params.expected;
|
|
291
601
|
this.actual = params.actual;
|
|
292
|
-
this.name = "
|
|
602
|
+
this.name = "BundlesRequirementSignatureMismatchError";
|
|
293
603
|
}
|
|
294
604
|
}
|
|
295
|
-
exports.
|
|
296
|
-
|
|
297
|
-
class MissingPermit2TransferFromNonceError extends Error {
|
|
298
|
-
constructor() {
|
|
299
|
-
super("Permit2 SignatureTransfer requires an explicit unused permit2Nonce. Generate a unique uint256 nonce, pass it to getRequirements(), and resolve the requirements again.");
|
|
300
|
-
this.name = "MissingPermit2TransferFromNonceError";
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
exports.MissingPermit2TransferFromNonceError = MissingPermit2TransferFromNonceError;
|
|
605
|
+
exports.BundlesRequirementSignatureMismatchError = BundlesRequirementSignatureMismatchError;
|
|
606
|
+
exports.BlueBundlesV1RequirementSignatureMismatchError = BundlesRequirementSignatureMismatchError;
|
|
304
607
|
/** Thrown when an explicit Permit2 SignatureTransfer unordered nonce is already consumed. */
|
|
305
|
-
class
|
|
608
|
+
class Permit2SignatureTransferNonceAlreadyUsedError extends Error {
|
|
306
609
|
owner;
|
|
307
610
|
nonce;
|
|
308
611
|
/**
|
|
@@ -313,10 +616,11 @@ class Permit2TransferFromNonceAlreadyUsedError extends Error {
|
|
|
313
616
|
super(`Permit2 nonce "${nonce}" is already used for owner "${owner}". Generate a different uint256 permit2Nonce and resolve the requirements again.`);
|
|
314
617
|
this.owner = owner;
|
|
315
618
|
this.nonce = nonce;
|
|
316
|
-
this.name = "
|
|
619
|
+
this.name = "Permit2SignatureTransferNonceAlreadyUsedError";
|
|
317
620
|
}
|
|
318
621
|
}
|
|
319
|
-
exports.
|
|
622
|
+
exports.Permit2SignatureTransferNonceAlreadyUsedError = Permit2SignatureTransferNonceAlreadyUsedError;
|
|
623
|
+
exports.Permit2TransferFromNonceAlreadyUsedError = Permit2SignatureTransferNonceAlreadyUsedError;
|
|
320
624
|
/** Thrown when no unused Permit2 unordered nonce exists at or after the requested start nonce. */
|
|
321
625
|
class NoUnusedPermit2NonceError extends Error {
|
|
322
626
|
owner;
|
|
@@ -350,13 +654,63 @@ class NativeFundingAmountMismatchError extends Error {
|
|
|
350
654
|
}
|
|
351
655
|
exports.NativeFundingAmountMismatchError = NativeFundingAmountMismatchError;
|
|
352
656
|
/** Thrown when a positive referral fee has no recipient. */
|
|
353
|
-
class
|
|
657
|
+
class ReferralFeeRecipientMissingError extends Error {
|
|
354
658
|
constructor() {
|
|
355
659
|
super("A positive referralFeePct requires referralFeeRecipient. Provide the recipient or set referralFeePct to zero.");
|
|
356
|
-
this.name = "
|
|
660
|
+
this.name = "ReferralFeeRecipientMissingError";
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
exports.ReferralFeeRecipientMissingError = ReferralFeeRecipientMissingError;
|
|
664
|
+
/** @deprecated Use {@link ReferralFeeRecipientMissingError}. */
|
|
665
|
+
exports.MissingReferralFeeRecipientError = ReferralFeeRecipientMissingError;
|
|
666
|
+
/**
|
|
667
|
+
* Thrown when a referral fee percentage is outside the contract's `[0, WAD)` range.
|
|
668
|
+
*
|
|
669
|
+
* Extends {@link InputExceedsMaxError} — and reports the same `field`, `value`, and `max` the
|
|
670
|
+
* generic bound error used to carry for this input — so integrators already pattern-matching
|
|
671
|
+
* `InputExceedsMaxError` keep catching this failure.
|
|
672
|
+
*/
|
|
673
|
+
class ReferralFeePctExceededError extends InputExceedsMaxError {
|
|
674
|
+
referralFeePct;
|
|
675
|
+
/** @param referralFeePct - WAD-scaled referral fee percentage supplied by the caller. */
|
|
676
|
+
constructor(referralFeePct) {
|
|
677
|
+
super({
|
|
678
|
+
field: "referralFeePct",
|
|
679
|
+
value: referralFeePct,
|
|
680
|
+
max: blue_sdk_1.MathLib.WAD - 1n,
|
|
681
|
+
});
|
|
682
|
+
this.referralFeePct = referralFeePct;
|
|
683
|
+
this.message = `Referral fee percentage "${referralFeePct}" must be below WAD. Reduce referralFeePct or disable the referral fee.`;
|
|
684
|
+
this.name = "ReferralFeePctExceededError";
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
exports.ReferralFeePctExceededError = ReferralFeePctExceededError;
|
|
688
|
+
/** Thrown when a fixed bundles call mixes ERC-20 and native funding. */
|
|
689
|
+
class MixedBundlesFundingError extends Error {
|
|
690
|
+
constructor() {
|
|
691
|
+
super("Bundles funding accepts either amount or nativeAmount, not both. Choose one funding source and rebuild the transaction.");
|
|
692
|
+
this.name = "MixedBundlesFundingError";
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
exports.MixedBundlesFundingError = MixedBundlesFundingError;
|
|
696
|
+
/** Thrown when a vault migration specifies both assets and shares, or neither. */
|
|
697
|
+
class AmountAndSharesExclusiveError extends Error {
|
|
698
|
+
constructor() {
|
|
699
|
+
super("Vault migration requires exactly one of assets or shares. Choose the desired withdrawal mode and rebuild the transaction.");
|
|
700
|
+
this.name = "AmountAndSharesExclusiveError";
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
exports.AmountAndSharesExclusiveError = AmountAndSharesExclusiveError;
|
|
704
|
+
/** Thrown when a vault migration selects the same source and destination vault. */
|
|
705
|
+
class SameVaultMigrationError extends Error {
|
|
706
|
+
vault;
|
|
707
|
+
constructor(vault) {
|
|
708
|
+
super(`Source and destination vault are both "${vault}". Select a different destination vault.`);
|
|
709
|
+
this.vault = vault;
|
|
710
|
+
this.name = "SameVaultMigrationError";
|
|
357
711
|
}
|
|
358
712
|
}
|
|
359
|
-
exports.
|
|
713
|
+
exports.SameVaultMigrationError = SameVaultMigrationError;
|
|
360
714
|
/** Thrown when a BlueBundlesV1 reallocation source uses another loan token. */
|
|
361
715
|
class ReallocationLoanTokenMismatchError extends Error {
|
|
362
716
|
expected;
|
|
@@ -1293,10 +1647,10 @@ class MidnightOfferRootOfferCountMismatchError extends Error {
|
|
|
1293
1647
|
}
|
|
1294
1648
|
}
|
|
1295
1649
|
exports.MidnightOfferRootOfferCountMismatchError = MidnightOfferRootOfferCountMismatchError;
|
|
1296
|
-
/** Thrown when a Midnight offer-root signature
|
|
1650
|
+
/** Thrown when a Midnight offer-root signature carries no encoded payload. */
|
|
1297
1651
|
class UnpreparedMidnightOfferRootSignatureError extends Error {
|
|
1298
1652
|
constructor() {
|
|
1299
|
-
super("Midnight offer root signature
|
|
1653
|
+
super("Midnight offer root signature carries no encoded payload. Sign the offer-root requirement (its signature already includes the payload) before building the submit transaction.");
|
|
1300
1654
|
}
|
|
1301
1655
|
}
|
|
1302
1656
|
exports.UnpreparedMidnightOfferRootSignatureError = UnpreparedMidnightOfferRootSignatureError;
|
|
@@ -24,8 +24,8 @@ export interface PublicAllocatorOptions {
|
|
|
24
24
|
* The maximum utilization each source market may reach when withdrawing
|
|
25
25
|
* shared liquidity, scaled by WAD.
|
|
26
26
|
*
|
|
27
|
-
* @deprecated
|
|
28
|
-
* Use `
|
|
27
|
+
* @deprecated Vault V1 shared-liquidity planning will be removed in the next major.
|
|
28
|
+
* Use `VaultV2BluePublicAllocatorOptions.maxWithdrawalUtilization` with the Vault V2 planner.
|
|
29
29
|
*/
|
|
30
30
|
readonly maxWithdrawalUtilization?: Readonly<Record<MarketId, bigint | undefined>>;
|
|
31
31
|
/**
|
package/lib/cjs/utils.d.ts
CHANGED
|
@@ -34,6 +34,8 @@ export type { ArrayElementType, DeepPartial, DottedKeys, FieldType, PartialDotte
|
|
|
34
34
|
export { bigIntComparator, createGetValue, createHasValue, deepFreeze, entries, filterDefined, fromEntries, getLast, getLastDefined, getSubdomainBaseUrl, getValue, hasValue, isDefined, isNotNull, isNotUndefined, keys, mergeEntries, retryPromiseLinearBackoff, Time, transformValue, values, } from "@morpho-org/morpho-ts";
|
|
35
35
|
export { computeReallocations, computeVaultV1Reallocations, } from "./helpers/computeVaultV1Reallocations.js";
|
|
36
36
|
export { addTransactionMetadata } from "./helpers/metadata.js";
|
|
37
|
+
export { type PreviewVaultV2ForceWithdrawParams, previewVaultV2ForceWithdraw, type VaultV2ForceWithdrawPreview, } from "./helpers/previewVaultV2ForceWithdraw.js";
|
|
37
38
|
export { type PreviewVaultV2InKindRedeemParams, previewVaultV2InKindRedeem, type VaultV2InKindRedeemMarketPreview, } from "./helpers/previewVaultV2InKindRedeem.js";
|
|
38
|
-
export { computeMaxRepaySharePrice, computeMinBorrowSharePrice, } from "./helpers/slippage.js";
|
|
39
|
+
export { computeMaxRepaySharePrice, computeMinBorrowSharePrice, computeMinForceWithdrawSharePrice, } from "./helpers/slippage.js";
|
|
39
40
|
export { validateAccrualPosition, validateChainId, validateNativeAsset, validatePositionHealth, validatePositionHealthAfterWithdraw, validateReallocations, validateRepayAmount, validateRepayShares, validateSlippageTolerance, validateUserAddress, } from "./helpers/validate.js";
|
|
41
|
+
export { computeVaultV2ForceWithdrawFeeSharesMinted, computeVaultV2ForceWithdrawMinSharesBurnt, computeVaultV2ForceWithdrawPlan, computeVaultV2ForceWithdrawSharesBurnt, resolveVaultV2ForceWithdrawEligibility, type VaultV2ForceWithdrawEligibility, type VaultV2ForceWithdrawPlan, } from "./helpers/vaultV2ForceWithdrawPlan.js";
|
package/lib/cjs/utils.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TreeUtils = exports.MidnightTreeUtils = exports.TickLib = exports.MidnightTickLib = exports.TakeAmountsLib = exports.MidnightTakeAmountsLib = exports.SetterRatifierUtils = exports.MidnightSetterRatifierUtils = exports.RatifierUtils = exports.MidnightRatifierUtils = exports.MidnightPositionUtils = exports.Payload = exports.MidnightPayload = exports.OfferUtils = exports.MidnightOfferUtils = exports.MidnightOfferChainUtils = exports.MidnightMarketUtils = exports.GroupUtils = exports.MidnightGroupUtils = exports.eip712Digest = exports.EcrecoverRatifierUtils = exports.MidnightEcrecoverRatifierUtils = exports.safeParseUnits = exports.safeParseNumber = exports.safeGetAddress = exports.restructure = exports.readContractRestructured = exports.optionalBoolean = exports.BlueMetaMorphoAction = exports.getPermitTypedData = exports.getPermit2TransferFromTypedData = exports.getPermit2PermitTypedData = exports.getDaiPermitTypedData = exports.getAuthorizationTypedData = exports.getBlueAuthorizationTypedData = exports.decodeBytes32String = exports.VaultV2Utils = exports.VaultV2BluePublicAllocatorConfigUtils = exports.VaultV2BlueMarketPublicAllocatorConfigUtils = exports.VaultUtils = exports.SharesMath = exports.BlueSharesMath = exports.MathLib = exports.MarketUtils = exports.BlueMarketUtils = exports.getBlueDefaultPreLiquidationParams = exports.blueDefaultPreLiquidationParamsRegistry = exports.CapacityLimitReason = exports.AdaptiveCurveIrmLib = exports.BlueAdaptiveCurveIrmLib = void 0;
|
|
4
|
-
exports.validateUserAddress = exports.validateSlippageTolerance = exports.validateRepayShares = exports.validateRepayAmount = exports.validateReallocations = exports.validatePositionHealthAfterWithdraw = exports.validatePositionHealth = exports.validateNativeAsset = exports.validateChainId = exports.validateAccrualPosition = exports.computeMinBorrowSharePrice = exports.computeMaxRepaySharePrice = exports.previewVaultV2InKindRedeem = exports.addTransactionMetadata = exports.computeVaultV1Reallocations = exports.computeReallocations = exports.values = exports.transformValue = exports.Time = exports.retryPromiseLinearBackoff = exports.mergeEntries = exports.keys = exports.isNotUndefined = exports.isNotNull = exports.isDefined = exports.hasValue = exports.getValue = exports.getSubdomainBaseUrl = exports.getLastDefined = exports.getLast = exports.fromEntries = exports.filterDefined = exports.entries = exports.deepFreeze = exports.createHasValue = exports.createGetValue = exports.bigIntComparator = void 0;
|
|
4
|
+
exports.resolveVaultV2ForceWithdrawEligibility = exports.computeVaultV2ForceWithdrawSharesBurnt = exports.computeVaultV2ForceWithdrawPlan = exports.computeVaultV2ForceWithdrawMinSharesBurnt = exports.computeVaultV2ForceWithdrawFeeSharesMinted = exports.validateUserAddress = exports.validateSlippageTolerance = exports.validateRepayShares = exports.validateRepayAmount = exports.validateReallocations = exports.validatePositionHealthAfterWithdraw = exports.validatePositionHealth = exports.validateNativeAsset = exports.validateChainId = exports.validateAccrualPosition = exports.computeMinForceWithdrawSharePrice = exports.computeMinBorrowSharePrice = exports.computeMaxRepaySharePrice = exports.previewVaultV2InKindRedeem = exports.previewVaultV2ForceWithdraw = exports.addTransactionMetadata = exports.computeVaultV1Reallocations = exports.computeReallocations = exports.values = exports.transformValue = exports.Time = exports.retryPromiseLinearBackoff = exports.mergeEntries = exports.keys = exports.isNotUndefined = exports.isNotNull = exports.isDefined = exports.hasValue = exports.getValue = exports.getSubdomainBaseUrl = exports.getLastDefined = exports.getLast = exports.fromEntries = exports.filterDefined = exports.entries = exports.deepFreeze = exports.createHasValue = exports.createGetValue = exports.bigIntComparator = void 0;
|
|
5
5
|
var blue_sdk_1 = require("@morpho-org/blue-sdk");
|
|
6
6
|
Object.defineProperty(exports, "BlueAdaptiveCurveIrmLib", { enumerable: true, get: function () { return blue_sdk_1.AdaptiveCurveIrmLib; } });
|
|
7
7
|
/** @deprecated Use BlueAdaptiveCurveIrmLib or the raw protocol subpath. */
|
|
@@ -96,11 +96,14 @@ Object.defineProperty(exports, "computeReallocations", { enumerable: true, get:
|
|
|
96
96
|
Object.defineProperty(exports, "computeVaultV1Reallocations", { enumerable: true, get: function () { return computeVaultV1Reallocations_js_1.computeVaultV1Reallocations; } });
|
|
97
97
|
var metadata_js_1 = require("./helpers/metadata.js");
|
|
98
98
|
Object.defineProperty(exports, "addTransactionMetadata", { enumerable: true, get: function () { return metadata_js_1.addTransactionMetadata; } });
|
|
99
|
+
var previewVaultV2ForceWithdraw_js_1 = require("./helpers/previewVaultV2ForceWithdraw.js");
|
|
100
|
+
Object.defineProperty(exports, "previewVaultV2ForceWithdraw", { enumerable: true, get: function () { return previewVaultV2ForceWithdraw_js_1.previewVaultV2ForceWithdraw; } });
|
|
99
101
|
var previewVaultV2InKindRedeem_js_1 = require("./helpers/previewVaultV2InKindRedeem.js");
|
|
100
102
|
Object.defineProperty(exports, "previewVaultV2InKindRedeem", { enumerable: true, get: function () { return previewVaultV2InKindRedeem_js_1.previewVaultV2InKindRedeem; } });
|
|
101
103
|
var slippage_js_1 = require("./helpers/slippage.js");
|
|
102
104
|
Object.defineProperty(exports, "computeMaxRepaySharePrice", { enumerable: true, get: function () { return slippage_js_1.computeMaxRepaySharePrice; } });
|
|
103
105
|
Object.defineProperty(exports, "computeMinBorrowSharePrice", { enumerable: true, get: function () { return slippage_js_1.computeMinBorrowSharePrice; } });
|
|
106
|
+
Object.defineProperty(exports, "computeMinForceWithdrawSharePrice", { enumerable: true, get: function () { return slippage_js_1.computeMinForceWithdrawSharePrice; } });
|
|
104
107
|
var validate_js_1 = require("./helpers/validate.js");
|
|
105
108
|
Object.defineProperty(exports, "validateAccrualPosition", { enumerable: true, get: function () { return validate_js_1.validateAccrualPosition; } });
|
|
106
109
|
Object.defineProperty(exports, "validateChainId", { enumerable: true, get: function () { return validate_js_1.validateChainId; } });
|
|
@@ -112,3 +115,9 @@ Object.defineProperty(exports, "validateRepayAmount", { enumerable: true, get: f
|
|
|
112
115
|
Object.defineProperty(exports, "validateRepayShares", { enumerable: true, get: function () { return validate_js_1.validateRepayShares; } });
|
|
113
116
|
Object.defineProperty(exports, "validateSlippageTolerance", { enumerable: true, get: function () { return validate_js_1.validateSlippageTolerance; } });
|
|
114
117
|
Object.defineProperty(exports, "validateUserAddress", { enumerable: true, get: function () { return validate_js_1.validateUserAddress; } });
|
|
118
|
+
var vaultV2ForceWithdrawPlan_js_1 = require("./helpers/vaultV2ForceWithdrawPlan.js");
|
|
119
|
+
Object.defineProperty(exports, "computeVaultV2ForceWithdrawFeeSharesMinted", { enumerable: true, get: function () { return vaultV2ForceWithdrawPlan_js_1.computeVaultV2ForceWithdrawFeeSharesMinted; } });
|
|
120
|
+
Object.defineProperty(exports, "computeVaultV2ForceWithdrawMinSharesBurnt", { enumerable: true, get: function () { return vaultV2ForceWithdrawPlan_js_1.computeVaultV2ForceWithdrawMinSharesBurnt; } });
|
|
121
|
+
Object.defineProperty(exports, "computeVaultV2ForceWithdrawPlan", { enumerable: true, get: function () { return vaultV2ForceWithdrawPlan_js_1.computeVaultV2ForceWithdrawPlan; } });
|
|
122
|
+
Object.defineProperty(exports, "computeVaultV2ForceWithdrawSharesBurnt", { enumerable: true, get: function () { return vaultV2ForceWithdrawPlan_js_1.computeVaultV2ForceWithdrawSharesBurnt; } });
|
|
123
|
+
Object.defineProperty(exports, "resolveVaultV2ForceWithdrawEligibility", { enumerable: true, get: function () { return vaultV2ForceWithdrawPlan_js_1.resolveVaultV2ForceWithdrawEligibility; } });
|