@morpho-org/morpho-sdk 6.0.0-next.1 → 6.0.0-next.3
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 +199 -34
- package/README.md +23 -15
- package/lib/cjs/abis.d.ts +3 -2829
- package/lib/cjs/abis.js +1 -1938
- package/lib/cjs/actions/blue/borrow.d.ts +3 -2
- package/lib/cjs/actions/blue/borrow.js +3 -2
- package/lib/cjs/actions/blue/common.js +6 -35
- package/lib/cjs/actions/blue/refinance.d.ts +2 -2
- package/lib/cjs/actions/blue/refinance.js +2 -2
- package/lib/cjs/actions/blue/repay.d.ts +1 -1
- package/lib/cjs/actions/blue/repay.js +1 -1
- package/lib/cjs/actions/blue/repayWithdrawCollateral.d.ts +2 -2
- package/lib/cjs/actions/blue/repayWithdrawCollateral.js +2 -2
- package/lib/cjs/actions/blue/supply.d.ts +2 -2
- package/lib/cjs/actions/blue/supply.js +4 -9
- package/lib/cjs/actions/blue/supplyCollateral.d.ts +2 -2
- package/lib/cjs/actions/blue/supplyCollateral.js +2 -2
- package/lib/cjs/actions/blue/supplyCollateralBorrow.d.ts +3 -2
- package/lib/cjs/actions/blue/supplyCollateralBorrow.js +3 -2
- package/lib/cjs/actions/blue/withdraw.d.ts +3 -3
- package/lib/cjs/actions/blue/withdraw.js +3 -3
- package/lib/cjs/actions/blue/withdrawCollateral.d.ts +2 -2
- package/lib/cjs/actions/blue/withdrawCollateral.js +2 -2
- package/lib/cjs/actions/bundles/common.d.ts +38 -4
- package/lib/cjs/actions/bundles/common.js +91 -35
- package/lib/cjs/actions/index.d.ts +0 -1
- package/lib/cjs/actions/index.js +0 -1
- package/lib/cjs/actions/requirements/blue/getBlueAuthorizationRequirement.d.ts +9 -8
- package/lib/cjs/actions/requirements/blue/getBlueAuthorizationRequirement.js +17 -26
- package/lib/cjs/actions/requirements/blue/index.d.ts +0 -1
- package/lib/cjs/actions/requirements/blue/index.js +0 -1
- package/lib/cjs/actions/requirements/encode/encodeBlueSignatureAuthorization.d.ts +20 -14
- package/lib/cjs/actions/requirements/encode/encodeBlueSignatureAuthorization.js +24 -25
- package/lib/cjs/actions/requirements/encode/encodeErc20Approval.d.ts +4 -4
- package/lib/cjs/actions/requirements/encode/encodeErc20Approval.js +4 -5
- package/lib/cjs/actions/requirements/encode/encodeErc20Permit.d.ts +21 -12
- package/lib/cjs/actions/requirements/encode/encodeErc20Permit.js +39 -38
- package/lib/cjs/actions/requirements/encode/encodeErc20Permit2SignatureTransfer.d.ts +4 -2
- package/lib/cjs/actions/requirements/encode/encodeErc20Permit2SignatureTransfer.js +14 -9
- package/lib/cjs/actions/requirements/encode/encodeVaultSharesPermit.d.ts +9 -6
- package/lib/cjs/actions/requirements/encode/encodeVaultSharesPermit.js +22 -17
- package/lib/cjs/actions/requirements/encode/index.d.ts +0 -1
- package/lib/cjs/actions/requirements/encode/index.js +0 -1
- package/lib/cjs/actions/requirements/getRequirementsApproval.d.ts +5 -6
- package/lib/cjs/actions/requirements/getRequirementsApproval.js +5 -6
- package/lib/cjs/actions/requirements/index.d.ts +0 -1
- package/lib/cjs/actions/requirements/index.js +0 -1
- package/lib/cjs/actions/vaultV1/deposit.d.ts +1 -2
- package/lib/cjs/actions/vaultV1/deposit.js +1 -2
- package/lib/cjs/actions/vaultV1/inKindRedeem.d.ts +6 -4
- package/lib/cjs/actions/vaultV1/inKindRedeem.js +12 -8
- package/lib/cjs/actions/vaultV2/deposit.d.ts +1 -2
- package/lib/cjs/actions/vaultV2/deposit.js +1 -2
- 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 +6 -4
- package/lib/cjs/actions/vaultV2/inKindRedeem.js +12 -8
- package/lib/cjs/augment.d.ts +0 -1
- package/lib/cjs/augment.js +0 -1
- package/lib/cjs/blue/abis.d.ts +1 -1
- package/lib/cjs/blue/abis.js +1 -5
- package/lib/cjs/blue/entities.d.ts +2 -2
- package/lib/cjs/blue/entities.js +1 -2
- package/lib/cjs/blue/errors.d.ts +1 -1
- package/lib/cjs/blue/errors.js +2 -1
- package/lib/cjs/blue/fetch.d.ts +1 -1
- package/lib/cjs/blue/fetch.js +1 -2
- package/lib/cjs/blue/types.d.ts +2 -4
- package/lib/cjs/blue/utils.d.ts +1 -3
- package/lib/cjs/blue/utils.js +1 -3
- package/lib/cjs/client/morphoViemExtension.d.ts +1 -1
- package/lib/cjs/client/morphoViemExtension.js +1 -1
- package/lib/cjs/constants.d.ts +3 -37
- package/lib/cjs/constants.js +1 -39
- package/lib/cjs/entities/blue/blue.d.ts +38 -264
- package/lib/cjs/entities/blue/blue.js +2 -203
- package/lib/cjs/entities/index.d.ts +3 -60
- package/lib/cjs/entities/index.js +1 -20
- package/lib/cjs/entities/midnight/midnight.js +20 -24
- package/lib/cjs/entities/requirements/getBundlesTokenRequirements.d.ts +7 -6
- package/lib/cjs/entities/requirements/getBundlesTokenRequirements.js +19 -14
- package/lib/cjs/{actions/requirements/blue → entities/requirements}/getUnusedPermit2Nonce.js +3 -3
- package/lib/cjs/entities/requirements/index.d.ts +1 -0
- package/lib/cjs/entities/requirements/index.js +1 -0
- package/lib/cjs/entities/vaultV1/vaultV1.d.ts +18 -6
- package/lib/cjs/entities/vaultV1/vaultV1.js +25 -8
- package/lib/cjs/entities/vaultV2/vaultV2.d.ts +154 -35
- package/lib/cjs/entities/vaultV2/vaultV2.js +249 -23
- package/lib/cjs/entities/vaultV2BlueReallocationData.d.ts +8 -1
- package/lib/cjs/entities/vaultV2BlueReallocationData.js +50 -34
- package/lib/cjs/errors.d.ts +2 -46
- package/lib/cjs/errors.js +2 -46
- package/lib/cjs/fetch.d.ts +1 -15
- package/lib/cjs/fetch.js +1 -16
- package/lib/cjs/helpers/constant.d.ts +0 -2
- package/lib/cjs/helpers/constant.js +0 -2
- package/lib/cjs/helpers/index.d.ts +4 -3
- package/lib/cjs/helpers/index.js +10 -9
- 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/slippage.d.ts +34 -90
- package/lib/cjs/helpers/slippage.js +52 -137
- package/lib/cjs/helpers/utilization.d.ts +12 -10
- package/lib/cjs/helpers/utilization.js +27 -12
- package/lib/cjs/helpers/validate.d.ts +66 -32
- package/lib/cjs/helpers/validate.js +84 -57
- package/lib/cjs/helpers/validateRequirementSpender.d.ts +1 -1
- package/lib/cjs/helpers/validateRequirementSpender.js +1 -3
- package/lib/cjs/helpers/vaultV2ForceWithdrawPlan.d.ts +274 -0
- package/lib/cjs/helpers/vaultV2ForceWithdrawPlan.js +369 -0
- package/lib/cjs/types/action.d.ts +102 -68
- package/lib/cjs/types/action.js +11 -4
- package/lib/cjs/types/error.d.ts +332 -385
- package/lib/cjs/types/error.js +369 -412
- package/lib/cjs/types/sharedLiquidity.d.ts +1 -117
- package/lib/cjs/types.d.ts +2 -18
- package/lib/cjs/utils.d.ts +8 -35
- package/lib/cjs/utils.js +11 -36
- package/lib/esm/abis.d.ts +3 -2829
- package/lib/esm/abis.js +3 -1935
- package/lib/esm/actions/blue/borrow.d.ts +3 -2
- package/lib/esm/actions/blue/borrow.js +3 -2
- package/lib/esm/actions/blue/common.js +8 -37
- package/lib/esm/actions/blue/refinance.d.ts +2 -2
- package/lib/esm/actions/blue/refinance.js +2 -2
- package/lib/esm/actions/blue/repay.d.ts +1 -1
- package/lib/esm/actions/blue/repay.js +1 -1
- package/lib/esm/actions/blue/repayWithdrawCollateral.d.ts +2 -2
- package/lib/esm/actions/blue/repayWithdrawCollateral.js +2 -2
- package/lib/esm/actions/blue/supply.d.ts +2 -2
- package/lib/esm/actions/blue/supply.js +6 -11
- package/lib/esm/actions/blue/supplyCollateral.d.ts +2 -2
- package/lib/esm/actions/blue/supplyCollateral.js +2 -2
- package/lib/esm/actions/blue/supplyCollateralBorrow.d.ts +3 -2
- package/lib/esm/actions/blue/supplyCollateralBorrow.js +3 -2
- package/lib/esm/actions/blue/withdraw.d.ts +3 -3
- package/lib/esm/actions/blue/withdraw.js +3 -3
- package/lib/esm/actions/blue/withdrawCollateral.d.ts +2 -2
- package/lib/esm/actions/blue/withdrawCollateral.js +2 -2
- package/lib/esm/actions/bundles/common.d.ts +38 -4
- package/lib/esm/actions/bundles/common.js +91 -36
- package/lib/esm/actions/index.d.ts +0 -1
- package/lib/esm/actions/index.js +0 -1
- package/lib/esm/actions/requirements/blue/getBlueAuthorizationRequirement.d.ts +9 -8
- package/lib/esm/actions/requirements/blue/getBlueAuthorizationRequirement.js +20 -29
- package/lib/esm/actions/requirements/blue/index.d.ts +0 -1
- package/lib/esm/actions/requirements/blue/index.js +0 -1
- package/lib/esm/actions/requirements/encode/encodeBlueSignatureAuthorization.d.ts +20 -14
- package/lib/esm/actions/requirements/encode/encodeBlueSignatureAuthorization.js +25 -26
- package/lib/esm/actions/requirements/encode/encodeErc20Approval.d.ts +4 -4
- package/lib/esm/actions/requirements/encode/encodeErc20Approval.js +4 -5
- package/lib/esm/actions/requirements/encode/encodeErc20Permit.d.ts +21 -12
- package/lib/esm/actions/requirements/encode/encodeErc20Permit.js +40 -39
- package/lib/esm/actions/requirements/encode/encodeErc20Permit2SignatureTransfer.d.ts +4 -2
- package/lib/esm/actions/requirements/encode/encodeErc20Permit2SignatureTransfer.js +14 -9
- package/lib/esm/actions/requirements/encode/encodeVaultSharesPermit.d.ts +9 -6
- package/lib/esm/actions/requirements/encode/encodeVaultSharesPermit.js +22 -17
- package/lib/esm/actions/requirements/encode/index.d.ts +0 -1
- package/lib/esm/actions/requirements/encode/index.js +0 -1
- package/lib/esm/actions/requirements/getRequirementsApproval.d.ts +5 -6
- package/lib/esm/actions/requirements/getRequirementsApproval.js +5 -6
- package/lib/esm/actions/requirements/index.d.ts +0 -1
- package/lib/esm/actions/requirements/index.js +0 -1
- package/lib/esm/actions/vaultV1/deposit.d.ts +1 -2
- package/lib/esm/actions/vaultV1/deposit.js +1 -2
- package/lib/esm/actions/vaultV1/inKindRedeem.d.ts +6 -4
- package/lib/esm/actions/vaultV1/inKindRedeem.js +12 -8
- package/lib/esm/actions/vaultV2/deposit.d.ts +1 -2
- package/lib/esm/actions/vaultV2/deposit.js +1 -2
- 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 +6 -4
- package/lib/esm/actions/vaultV2/inKindRedeem.js +12 -8
- package/lib/esm/augment.d.ts +0 -1
- package/lib/esm/augment.js +0 -1
- package/lib/esm/blue/abis.d.ts +1 -1
- package/lib/esm/blue/abis.js +1 -1
- package/lib/esm/blue/entities.d.ts +2 -2
- package/lib/esm/blue/entities.js +1 -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 +1 -1
- package/lib/esm/blue/fetch.js +1 -1
- package/lib/esm/blue/types.d.ts +2 -4
- package/lib/esm/blue/utils.d.ts +1 -3
- package/lib/esm/blue/utils.js +1 -3
- package/lib/esm/client/morphoViemExtension.d.ts +1 -1
- package/lib/esm/client/morphoViemExtension.js +1 -1
- package/lib/esm/constants.d.ts +3 -37
- package/lib/esm/constants.js +3 -37
- package/lib/esm/entities/blue/blue.d.ts +38 -264
- package/lib/esm/entities/blue/blue.js +5 -206
- package/lib/esm/entities/index.d.ts +3 -60
- package/lib/esm/entities/index.js +1 -16
- package/lib/esm/entities/midnight/midnight.js +20 -24
- package/lib/esm/entities/requirements/getBundlesTokenRequirements.d.ts +7 -6
- package/lib/esm/entities/requirements/getBundlesTokenRequirements.js +20 -15
- package/lib/esm/{actions/requirements/blue → entities/requirements}/getUnusedPermit2Nonce.js +3 -3
- package/lib/esm/entities/requirements/index.d.ts +1 -0
- package/lib/esm/entities/requirements/index.js +1 -0
- package/lib/esm/entities/vaultV1/vaultV1.d.ts +18 -6
- package/lib/esm/entities/vaultV1/vaultV1.js +29 -12
- package/lib/esm/entities/vaultV2/vaultV2.d.ts +154 -35
- package/lib/esm/entities/vaultV2/vaultV2.js +256 -30
- package/lib/esm/entities/vaultV2BlueReallocationData.d.ts +8 -1
- package/lib/esm/entities/vaultV2BlueReallocationData.js +48 -32
- package/lib/esm/errors.d.ts +2 -46
- package/lib/esm/errors.js +2 -46
- package/lib/esm/fetch.d.ts +1 -15
- package/lib/esm/fetch.js +1 -15
- package/lib/esm/helpers/constant.d.ts +0 -2
- package/lib/esm/helpers/constant.js +0 -2
- package/lib/esm/helpers/index.d.ts +4 -3
- package/lib/esm/helpers/index.js +4 -3
- 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/slippage.d.ts +34 -90
- package/lib/esm/helpers/slippage.js +52 -134
- package/lib/esm/helpers/utilization.d.ts +12 -10
- package/lib/esm/helpers/utilization.js +26 -11
- package/lib/esm/helpers/validate.d.ts +66 -32
- package/lib/esm/helpers/validate.js +83 -57
- package/lib/esm/helpers/validateRequirementSpender.d.ts +1 -1
- package/lib/esm/helpers/validateRequirementSpender.js +1 -3
- package/lib/esm/helpers/vaultV2ForceWithdrawPlan.d.ts +274 -0
- package/lib/esm/helpers/vaultV2ForceWithdrawPlan.js +362 -0
- package/lib/esm/types/action.d.ts +102 -68
- package/lib/esm/types/action.js +12 -5
- package/lib/esm/types/error.d.ts +332 -385
- package/lib/esm/types/error.js +355 -392
- package/lib/esm/types/sharedLiquidity.d.ts +1 -117
- package/lib/esm/types.d.ts +2 -18
- package/lib/esm/utils.d.ts +8 -35
- package/lib/esm/utils.js +7 -34
- package/package.json +7 -15
- package/lib/cjs/actions/requirements/encode/encodeErc20Permit2Approve.d.ts +0 -42
- package/lib/cjs/actions/requirements/encode/encodeErc20Permit2Approve.js +0 -83
- package/lib/cjs/actions/requirements/generalAdapter/getGeneralAdapterRequirements.d.ts +0 -88
- package/lib/cjs/actions/requirements/generalAdapter/getGeneralAdapterRequirements.js +0 -151
- package/lib/cjs/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit.d.ts +0 -37
- package/lib/cjs/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit.js +0 -50
- package/lib/cjs/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit2.d.ts +0 -57
- package/lib/cjs/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit2.js +0 -74
- package/lib/cjs/actions/requirements/generalAdapter/index.d.ts +0 -3
- package/lib/cjs/actions/requirements/generalAdapter/index.js +0 -19
- package/lib/cjs/actions/signatures/getBlueAuthorizationAction.d.ts +0 -29
- package/lib/cjs/actions/signatures/getBlueAuthorizationAction.js +0 -48
- package/lib/cjs/actions/signatures/getTokenRequirementActions.d.ts +0 -58
- package/lib/cjs/actions/signatures/getTokenRequirementActions.js +0 -119
- package/lib/cjs/actions/signatures/getVaultExitBundlesV1PermitStruct.d.ts +0 -44
- package/lib/cjs/actions/signatures/getVaultExitBundlesV1PermitStruct.js +0 -43
- package/lib/cjs/actions/signatures/index.d.ts +0 -3
- package/lib/cjs/actions/signatures/index.js +0 -19
- package/lib/cjs/augment/VaultMarketPublicAllocatorConfig.d.ts +0 -8
- package/lib/cjs/augment/VaultMarketPublicAllocatorConfig.js +0 -8
- package/lib/cjs/bundler/actions.d.ts +0 -797
- package/lib/cjs/bundler/actions.js +0 -1371
- package/lib/cjs/bundler/index.d.ts +0 -2
- package/lib/cjs/bundler/index.js +0 -18
- package/lib/cjs/bundler/types.d.ts +0 -235
- package/lib/cjs/bundler/types.js +0 -2
- package/lib/cjs/entities/vaultV1ReallocationData.d.ts +0 -326
- package/lib/cjs/entities/vaultV1ReallocationData.js +0 -542
- package/lib/cjs/helpers/computeVaultV1Reallocations.d.ts +0 -78
- package/lib/cjs/helpers/computeVaultV1Reallocations.js +0 -243
- package/lib/esm/actions/requirements/encode/encodeErc20Permit2Approve.d.ts +0 -42
- package/lib/esm/actions/requirements/encode/encodeErc20Permit2Approve.js +0 -79
- package/lib/esm/actions/requirements/generalAdapter/getGeneralAdapterRequirements.d.ts +0 -88
- package/lib/esm/actions/requirements/generalAdapter/getGeneralAdapterRequirements.js +0 -147
- package/lib/esm/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit.d.ts +0 -37
- package/lib/esm/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit.js +0 -46
- package/lib/esm/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit2.d.ts +0 -57
- package/lib/esm/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit2.js +0 -70
- package/lib/esm/actions/requirements/generalAdapter/index.d.ts +0 -3
- package/lib/esm/actions/requirements/generalAdapter/index.js +0 -3
- package/lib/esm/actions/signatures/getBlueAuthorizationAction.d.ts +0 -29
- package/lib/esm/actions/signatures/getBlueAuthorizationAction.js +0 -44
- package/lib/esm/actions/signatures/getTokenRequirementActions.d.ts +0 -58
- package/lib/esm/actions/signatures/getTokenRequirementActions.js +0 -115
- package/lib/esm/actions/signatures/getVaultExitBundlesV1PermitStruct.d.ts +0 -44
- package/lib/esm/actions/signatures/getVaultExitBundlesV1PermitStruct.js +0 -39
- package/lib/esm/actions/signatures/index.d.ts +0 -3
- package/lib/esm/actions/signatures/index.js +0 -3
- package/lib/esm/augment/VaultMarketPublicAllocatorConfig.d.ts +0 -8
- package/lib/esm/augment/VaultMarketPublicAllocatorConfig.js +0 -5
- package/lib/esm/bundler/actions.d.ts +0 -797
- package/lib/esm/bundler/actions.js +0 -1368
- package/lib/esm/bundler/index.d.ts +0 -2
- package/lib/esm/bundler/index.js +0 -2
- package/lib/esm/bundler/types.d.ts +0 -235
- package/lib/esm/bundler/types.js +0 -1
- package/lib/esm/entities/vaultV1ReallocationData.d.ts +0 -326
- package/lib/esm/entities/vaultV1ReallocationData.js +0 -544
- package/lib/esm/helpers/computeVaultV1Reallocations.d.ts +0 -78
- package/lib/esm/helpers/computeVaultV1Reallocations.js +0 -239
- /package/lib/cjs/{actions/requirements/blue → entities/requirements}/getUnusedPermit2Nonce.d.ts +0 -0
- /package/lib/esm/{actions/requirements/blue → entities/requirements}/getUnusedPermit2Nonce.d.ts +0 -0
|
@@ -52,8 +52,7 @@ export interface VaultV2DepositParams {
|
|
|
52
52
|
* @throws {ReferralFeePctExceededError} when `referralFeePct` is at least WAD; it extends
|
|
53
53
|
* {@link InputExceedsMaxError}, so either class catches it.
|
|
54
54
|
* @throws {ReferralFeeRecipientMissingError} when a positive `referralFeePct` has no recipient.
|
|
55
|
-
* @throws {UnexpectedRequirementSignatureError} when native funding carries a token permit
|
|
56
|
-
* Permit2 AllowanceTransfer signature is supplied.
|
|
55
|
+
* @throws {UnexpectedRequirementSignatureError} when native funding carries a token permit.
|
|
57
56
|
* @throws {InputExceedsMaxError} when funding, `maxSharePrice`, or `deadline` exceeds uint256.
|
|
58
57
|
* @throws {DepositOwnerMismatchError} when the signed owner differs from `userAddress`.
|
|
59
58
|
* @throws {DepositAssetMismatchError} when the signed asset differs from the vault asset.
|
|
@@ -41,8 +41,7 @@ const common_js_1 = require("../bundles/common.js");
|
|
|
41
41
|
* @throws {ReferralFeePctExceededError} when `referralFeePct` is at least WAD; it extends
|
|
42
42
|
* {@link InputExceedsMaxError}, so either class catches it.
|
|
43
43
|
* @throws {ReferralFeeRecipientMissingError} when a positive `referralFeePct` has no recipient.
|
|
44
|
-
* @throws {UnexpectedRequirementSignatureError} when native funding carries a token permit
|
|
45
|
-
* Permit2 AllowanceTransfer signature is supplied.
|
|
44
|
+
* @throws {UnexpectedRequirementSignatureError} when native funding carries a token permit.
|
|
46
45
|
* @throws {InputExceedsMaxError} when funding, `maxSharePrice`, or `deadline` exceeds uint256.
|
|
47
46
|
* @throws {DepositOwnerMismatchError} when the signed owner differs from `userAddress`.
|
|
48
47
|
* @throws {DepositAssetMismatchError} when the signed asset differs from the vault asset.
|
|
@@ -1,58 +1,77 @@
|
|
|
1
1
|
import { type Address } from "viem";
|
|
2
|
-
import { type
|
|
2
|
+
import { type Metadata, type PermitRequirementSignature, type Transaction, type VaultV2ForceWithdrawAction } from "../../types/index.js";
|
|
3
3
|
/** Parameters for {@link vaultV2ForceWithdraw}. */
|
|
4
4
|
export interface VaultV2ForceWithdrawParams {
|
|
5
|
-
vault: {
|
|
6
|
-
|
|
5
|
+
readonly vault: {
|
|
6
|
+
readonly chainId: number;
|
|
7
|
+
readonly address: Address;
|
|
7
8
|
};
|
|
8
|
-
args: {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
readonly args: {
|
|
10
|
+
readonly adapter: Address;
|
|
11
|
+
readonly exitAssets: bigint;
|
|
12
|
+
readonly minSharePriceE27: bigint;
|
|
13
|
+
readonly userAddress: Address;
|
|
14
|
+
readonly deadline: bigint;
|
|
15
|
+
readonly referralFeePct?: bigint;
|
|
16
|
+
readonly referralFeeRecipient?: Address;
|
|
17
|
+
readonly requirementSignature?: PermitRequirementSignature;
|
|
15
18
|
};
|
|
16
|
-
metadata?: Metadata;
|
|
19
|
+
readonly metadata?: Metadata;
|
|
17
20
|
}
|
|
18
21
|
/**
|
|
19
|
-
* Prepares a
|
|
22
|
+
* Prepares a Vault V2 force withdrawal through VaultExitBundlesV1.
|
|
20
23
|
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
+
* The contract first withdraws everything the vault can pay without a penalty — its idle assets
|
|
25
|
+
* plus the liquidity available through its liquidity adapter — then force-deallocates the remainder
|
|
26
|
+
* by looping over the adapter's markets.
|
|
24
27
|
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
+
* `exitAssets` is **penalty-inclusive**: it is what the contract debits from the user's position,
|
|
29
|
+
* while the assets actually delivered are
|
|
30
|
+
* `assetsToWithdraw + floor((exitAssets - assetsToWithdraw) * WAD / (WAD + penalty))` minus the
|
|
31
|
+
* referral fee. Use `previewVaultV2ForceWithdraw` to quote the split.
|
|
28
32
|
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
* @param params
|
|
33
|
-
*
|
|
34
|
-
* @param params.
|
|
35
|
-
* @param params.args.
|
|
36
|
-
*
|
|
37
|
-
* @param params.
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
* @
|
|
41
|
-
*
|
|
42
|
-
*
|
|
33
|
+
* Without a signature this embeds the empty-permit sentinel and requires a sufficient vault-share
|
|
34
|
+
* approval to VaultExitBundlesV1.
|
|
35
|
+
*
|
|
36
|
+
* @param params - Force withdrawal parameters.
|
|
37
|
+
* @param params.vault.chainId - Chain containing the target Vault V2 and VaultExitBundlesV1.
|
|
38
|
+
* @param params.vault.address - Target Vault V2 address.
|
|
39
|
+
* @param params.args.adapter - Vault's sole MorphoMarketV1AdapterV2.
|
|
40
|
+
* @param params.args.exitAssets - Penalty-inclusive, asset-denominated amount to exit.
|
|
41
|
+
* @param params.args.minSharePriceE27 - RAY-scaled lower bound on the realized exit share price
|
|
42
|
+
* (withdrawn assets per share burned). `0n` disables the on-chain bound; prefer the value the
|
|
43
|
+
* entity computes.
|
|
44
|
+
* @param params.args.userAddress - Expected transaction sender, recorded in action metadata only.
|
|
45
|
+
* VaultExitBundlesV1 burns `msg.sender`'s vault shares and pays out to `msg.sender`, so the
|
|
46
|
+
* submitting account must equal this address.
|
|
47
|
+
* @param params.args.deadline - Permit and bundle deadline.
|
|
48
|
+
* @param params.args.referralFeePct - Optional WAD-scaled share of the withdrawn assets routed to
|
|
49
|
+
* `referralFeeRecipient`. Defaults to `0n`. Deducted *after* the `minSharePriceE27` check, so it
|
|
50
|
+
* is outside that bound's protection.
|
|
51
|
+
* @param params.args.referralFeeRecipient - Optional referral fee recipient. Defaults to the zero
|
|
52
|
+
* address, which is only valid alongside a zero `referralFeePct`.
|
|
53
|
+
* @param params.args.requirementSignature - Optional bounded Vault V2 shares permit.
|
|
54
|
+
* @param params.metadata - Optional analytics metadata.
|
|
55
|
+
* @returns A deep-frozen `Readonly<Transaction<VaultV2ForceWithdrawAction>>` with `to`, `value`,
|
|
56
|
+
* `data`, and the typed action discriminator.
|
|
57
|
+
* @throws {NonPositiveInputError} when `exitAssets` or `deadline` is not positive.
|
|
58
|
+
* @throws {NegativeInputError} when `referralFeePct` or `minSharePriceE27` is negative.
|
|
59
|
+
* @throws {InputExceedsMaxError} when `referralFeePct` is not below WAD (the contract rejects it
|
|
60
|
+
* with `PctExceeded`), or when `exitAssets`, `deadline`, or `minSharePriceE27` exceeds `uint256`.
|
|
61
|
+
* @throws {ReferralFeeRecipientMissingError} when a positive `referralFeePct` has no recipient.
|
|
62
|
+
* @throws {UnsupportedChainIdError} when no address registry exists for the target chain.
|
|
63
|
+
* @throws {UnknownAddressError} when VaultExitBundlesV1 is not registered on the target chain.
|
|
64
|
+
* @throws {BundlesPermitMismatchError} when the requirement has the wrong permit kind,
|
|
65
|
+
* asset, owner, spender, or signature encoding.
|
|
43
66
|
* @example
|
|
44
67
|
* ```ts
|
|
45
68
|
* import { vaultV2ForceWithdraw } from "@morpho-org/morpho-sdk";
|
|
46
69
|
*
|
|
47
70
|
* const tx = vaultV2ForceWithdraw({
|
|
48
|
-
* vault: { address:
|
|
49
|
-
* args: {
|
|
50
|
-
* deallocations: [{ adapter, marketParams, amount: 500_000n }],
|
|
51
|
-
* withdraw: { amount: 500_000n, recipient },
|
|
52
|
-
* onBehalf,
|
|
53
|
-
* },
|
|
71
|
+
* vault: { chainId: 1, address: vault },
|
|
72
|
+
* args: { adapter, exitAssets: 1_000_000n, minSharePriceE27, userAddress, deadline },
|
|
54
73
|
* });
|
|
55
74
|
* // tx satisfies Readonly<Transaction<VaultV2ForceWithdrawAction>>
|
|
56
75
|
* ```
|
|
57
76
|
*/
|
|
58
|
-
export declare const vaultV2ForceWithdraw: ({ vault
|
|
77
|
+
export declare const vaultV2ForceWithdraw: ({ vault, args, metadata, }: VaultV2ForceWithdrawParams) => Readonly<Transaction<VaultV2ForceWithdrawAction>>;
|
|
@@ -1,93 +1,120 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.vaultV2ForceWithdraw = void 0;
|
|
4
|
-
const blue_sdk_viem_1 = require("@morpho-org/blue-sdk-viem");
|
|
5
4
|
const morpho_ts_1 = require("@morpho-org/morpho-ts");
|
|
6
5
|
const viem_1 = require("viem");
|
|
7
|
-
const
|
|
6
|
+
const abis_js_1 = require("../../abis.js");
|
|
8
7
|
const index_js_1 = require("../../helpers/index.js");
|
|
8
|
+
const validate_js_1 = require("../../helpers/validate.js");
|
|
9
9
|
const index_js_2 = require("../../types/index.js");
|
|
10
|
+
const common_js_1 = require("../bundles/common.js");
|
|
10
11
|
/**
|
|
11
|
-
* Prepares a
|
|
12
|
+
* Prepares a Vault V2 force withdrawal through VaultExitBundlesV1.
|
|
12
13
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
14
|
+
* The contract first withdraws everything the vault can pay without a penalty — its idle assets
|
|
15
|
+
* plus the liquidity available through its liquidity adapter — then force-deallocates the remainder
|
|
16
|
+
* by looping over the adapter's markets.
|
|
16
17
|
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
18
|
+
* `exitAssets` is **penalty-inclusive**: it is what the contract debits from the user's position,
|
|
19
|
+
* while the assets actually delivered are
|
|
20
|
+
* `assetsToWithdraw + floor((exitAssets - assetsToWithdraw) * WAD / (WAD + penalty))` minus the
|
|
21
|
+
* referral fee. Use `previewVaultV2ForceWithdraw` to quote the split.
|
|
20
22
|
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* @param params
|
|
25
|
-
*
|
|
26
|
-
* @param params.
|
|
27
|
-
* @param params.args.
|
|
28
|
-
*
|
|
29
|
-
* @param params.
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
* @
|
|
33
|
-
*
|
|
34
|
-
*
|
|
23
|
+
* Without a signature this embeds the empty-permit sentinel and requires a sufficient vault-share
|
|
24
|
+
* approval to VaultExitBundlesV1.
|
|
25
|
+
*
|
|
26
|
+
* @param params - Force withdrawal parameters.
|
|
27
|
+
* @param params.vault.chainId - Chain containing the target Vault V2 and VaultExitBundlesV1.
|
|
28
|
+
* @param params.vault.address - Target Vault V2 address.
|
|
29
|
+
* @param params.args.adapter - Vault's sole MorphoMarketV1AdapterV2.
|
|
30
|
+
* @param params.args.exitAssets - Penalty-inclusive, asset-denominated amount to exit.
|
|
31
|
+
* @param params.args.minSharePriceE27 - RAY-scaled lower bound on the realized exit share price
|
|
32
|
+
* (withdrawn assets per share burned). `0n` disables the on-chain bound; prefer the value the
|
|
33
|
+
* entity computes.
|
|
34
|
+
* @param params.args.userAddress - Expected transaction sender, recorded in action metadata only.
|
|
35
|
+
* VaultExitBundlesV1 burns `msg.sender`'s vault shares and pays out to `msg.sender`, so the
|
|
36
|
+
* submitting account must equal this address.
|
|
37
|
+
* @param params.args.deadline - Permit and bundle deadline.
|
|
38
|
+
* @param params.args.referralFeePct - Optional WAD-scaled share of the withdrawn assets routed to
|
|
39
|
+
* `referralFeeRecipient`. Defaults to `0n`. Deducted *after* the `minSharePriceE27` check, so it
|
|
40
|
+
* is outside that bound's protection.
|
|
41
|
+
* @param params.args.referralFeeRecipient - Optional referral fee recipient. Defaults to the zero
|
|
42
|
+
* address, which is only valid alongside a zero `referralFeePct`.
|
|
43
|
+
* @param params.args.requirementSignature - Optional bounded Vault V2 shares permit.
|
|
44
|
+
* @param params.metadata - Optional analytics metadata.
|
|
45
|
+
* @returns A deep-frozen `Readonly<Transaction<VaultV2ForceWithdrawAction>>` with `to`, `value`,
|
|
46
|
+
* `data`, and the typed action discriminator.
|
|
47
|
+
* @throws {NonPositiveInputError} when `exitAssets` or `deadline` is not positive.
|
|
48
|
+
* @throws {NegativeInputError} when `referralFeePct` or `minSharePriceE27` is negative.
|
|
49
|
+
* @throws {InputExceedsMaxError} when `referralFeePct` is not below WAD (the contract rejects it
|
|
50
|
+
* with `PctExceeded`), or when `exitAssets`, `deadline`, or `minSharePriceE27` exceeds `uint256`.
|
|
51
|
+
* @throws {ReferralFeeRecipientMissingError} when a positive `referralFeePct` has no recipient.
|
|
52
|
+
* @throws {UnsupportedChainIdError} when no address registry exists for the target chain.
|
|
53
|
+
* @throws {UnknownAddressError} when VaultExitBundlesV1 is not registered on the target chain.
|
|
54
|
+
* @throws {BundlesPermitMismatchError} when the requirement has the wrong permit kind,
|
|
55
|
+
* asset, owner, spender, or signature encoding.
|
|
35
56
|
* @example
|
|
36
57
|
* ```ts
|
|
37
58
|
* import { vaultV2ForceWithdraw } from "@morpho-org/morpho-sdk";
|
|
38
59
|
*
|
|
39
60
|
* const tx = vaultV2ForceWithdraw({
|
|
40
|
-
* vault: { address:
|
|
41
|
-
* args: {
|
|
42
|
-
* deallocations: [{ adapter, marketParams, amount: 500_000n }],
|
|
43
|
-
* withdraw: { amount: 500_000n, recipient },
|
|
44
|
-
* onBehalf,
|
|
45
|
-
* },
|
|
61
|
+
* vault: { chainId: 1, address: vault },
|
|
62
|
+
* args: { adapter, exitAssets: 1_000_000n, minSharePriceE27, userAddress, deadline },
|
|
46
63
|
* });
|
|
47
64
|
* // tx satisfies Readonly<Transaction<VaultV2ForceWithdrawAction>>
|
|
48
65
|
* ```
|
|
49
66
|
*/
|
|
50
|
-
const vaultV2ForceWithdraw = ({ vault
|
|
51
|
-
if (
|
|
52
|
-
throw new index_js_2.
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
+
const vaultV2ForceWithdraw = ({ vault, args, metadata, }) => {
|
|
68
|
+
if (args.exitAssets <= 0n)
|
|
69
|
+
throw new index_js_2.NonPositiveInputError("exitAssets", args.exitAssets);
|
|
70
|
+
(0, validate_js_1.validateUint256Field)("exitAssets", args.exitAssets);
|
|
71
|
+
(0, validate_js_1.validateDeadline)(args.deadline);
|
|
72
|
+
// `0n` stays valid — it is the intentional "no on-chain bound" opt-out — but a value the uint256
|
|
73
|
+
// slot cannot hold must fail with a dedicated error instead of viem's `IntegerOutOfRangeError`.
|
|
74
|
+
// The entity never emits these (it forbids a non-positive override); this guards direct callers.
|
|
75
|
+
(0, validate_js_1.validateUint256Field)("minSharePriceE27", args.minSharePriceE27);
|
|
76
|
+
const { referralFeePct, referralFeeRecipient } = (0, validate_js_1.validateReferralFee)(args);
|
|
77
|
+
const to = (0, morpho_ts_1.getChainAddress)(vault.chainId, "bundles.vaultExitBundlesV1");
|
|
78
|
+
const sharesPermit = (0, common_js_1.getBundlesSharesPermit)({
|
|
79
|
+
vault: vault.address,
|
|
80
|
+
deadline: args.deadline,
|
|
81
|
+
owner: args.userAddress,
|
|
82
|
+
spender: to,
|
|
83
|
+
requirementSignature: args.requirementSignature,
|
|
84
|
+
});
|
|
67
85
|
let tx = {
|
|
68
|
-
to
|
|
86
|
+
to,
|
|
87
|
+
value: 0n,
|
|
69
88
|
data: (0, viem_1.encodeFunctionData)({
|
|
70
|
-
abi:
|
|
71
|
-
functionName: "
|
|
72
|
-
args: [
|
|
89
|
+
abi: abis_js_1.vaultExitBundlesV1Abi,
|
|
90
|
+
functionName: "vaultExitBundlesV1ForceWithdrawVaultV2",
|
|
91
|
+
args: [
|
|
92
|
+
vault.address,
|
|
93
|
+
args.adapter,
|
|
94
|
+
args.exitAssets,
|
|
95
|
+
args.minSharePriceE27,
|
|
96
|
+
sharesPermit,
|
|
97
|
+
referralFeePct,
|
|
98
|
+
referralFeeRecipient,
|
|
99
|
+
args.deadline,
|
|
100
|
+
],
|
|
73
101
|
}),
|
|
74
|
-
value: 0n,
|
|
75
102
|
};
|
|
76
|
-
if (metadata)
|
|
103
|
+
if (metadata)
|
|
77
104
|
tx = (0, index_js_1.addTransactionMetadata)(tx, metadata);
|
|
78
|
-
}
|
|
79
105
|
return (0, morpho_ts_1.deepFreeze)({
|
|
80
106
|
...tx,
|
|
81
107
|
action: {
|
|
82
108
|
type: "vaultV2ForceWithdraw",
|
|
83
109
|
args: {
|
|
84
|
-
vault:
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
onBehalf,
|
|
110
|
+
vault: vault.address,
|
|
111
|
+
adapter: args.adapter,
|
|
112
|
+
exitAssets: args.exitAssets,
|
|
113
|
+
minSharePriceE27: args.minSharePriceE27,
|
|
114
|
+
referralFeePct,
|
|
115
|
+
referralFeeRecipient,
|
|
116
|
+
onBehalf: args.userAddress,
|
|
117
|
+
deadline: args.deadline,
|
|
91
118
|
},
|
|
92
119
|
},
|
|
93
120
|
});
|
|
@@ -30,18 +30,20 @@ export interface VaultV2InKindRedeemParams {
|
|
|
30
30
|
* @param params.args.amount - Penalty-inclusive, asset-denominated amount to exit.
|
|
31
31
|
* @param params.args.marketParamsList - Ordered markets consumed greedily after idle assets. May be
|
|
32
32
|
* empty when the vault's idle balance covers `amount`.
|
|
33
|
-
* @param params.args.userAddress -
|
|
34
|
-
*
|
|
35
|
-
* address.
|
|
33
|
+
* @param params.args.userAddress - Redeeming account, recorded in action metadata and validated as
|
|
34
|
+
* the expected owner of an optional `requirementSignature` permit. VaultExitBundlesV1 burns
|
|
35
|
+
* `msg.sender`'s vault shares, so the submitting account must equal this address.
|
|
36
36
|
* @param params.args.deadline - Permit and bundle deadline.
|
|
37
37
|
* @param params.args.requirementSignature - Optional bounded Vault V2 shares permit.
|
|
38
38
|
* @param params.metadata - Optional analytics metadata.
|
|
39
39
|
* @returns A deep-frozen `Readonly<Transaction<VaultV2InKindRedeemAction>>` with `to`, `value`,
|
|
40
40
|
* `data`, and the typed action discriminator.
|
|
41
41
|
* @throws {NonPositiveInputError} when `amount` or `deadline` is not positive.
|
|
42
|
+
* @throws {InputExceedsMaxError} when the bundle or permit deadline exceeds `uint256`.
|
|
42
43
|
* @throws {UnsupportedChainIdError} when no address registry exists for the target chain.
|
|
43
44
|
* @throws {UnknownAddressError} when VaultExitBundlesV1 is not registered on the target chain.
|
|
44
|
-
* @throws {
|
|
45
|
+
* @throws {BundlesPermitMismatchError} when the requirement has the wrong permit kind, asset, owner,
|
|
46
|
+
* spender, or signature encoding, or when its signed and action amounts or deadlines disagree.
|
|
45
47
|
* @example
|
|
46
48
|
* ```ts
|
|
47
49
|
* import { vaultV2InKindRedeem } from "@morpho-org/morpho-sdk";
|
|
@@ -5,8 +5,9 @@ const morpho_ts_1 = require("@morpho-org/morpho-ts");
|
|
|
5
5
|
const viem_1 = require("viem");
|
|
6
6
|
const abis_js_1 = require("../../abis.js");
|
|
7
7
|
const index_js_1 = require("../../helpers/index.js");
|
|
8
|
+
const validate_js_1 = require("../../helpers/validate.js");
|
|
8
9
|
const index_js_2 = require("../../types/index.js");
|
|
9
|
-
const
|
|
10
|
+
const common_js_1 = require("../bundles/common.js");
|
|
10
11
|
/**
|
|
11
12
|
* Prepares a Vault V2 in-kind redemption into idle assets and Morpho Blue supply positions.
|
|
12
13
|
*
|
|
@@ -20,18 +21,20 @@ const getVaultExitBundlesV1PermitStruct_js_1 = require("../signatures/getVaultEx
|
|
|
20
21
|
* @param params.args.amount - Penalty-inclusive, asset-denominated amount to exit.
|
|
21
22
|
* @param params.args.marketParamsList - Ordered markets consumed greedily after idle assets. May be
|
|
22
23
|
* empty when the vault's idle balance covers `amount`.
|
|
23
|
-
* @param params.args.userAddress -
|
|
24
|
-
*
|
|
25
|
-
* address.
|
|
24
|
+
* @param params.args.userAddress - Redeeming account, recorded in action metadata and validated as
|
|
25
|
+
* the expected owner of an optional `requirementSignature` permit. VaultExitBundlesV1 burns
|
|
26
|
+
* `msg.sender`'s vault shares, so the submitting account must equal this address.
|
|
26
27
|
* @param params.args.deadline - Permit and bundle deadline.
|
|
27
28
|
* @param params.args.requirementSignature - Optional bounded Vault V2 shares permit.
|
|
28
29
|
* @param params.metadata - Optional analytics metadata.
|
|
29
30
|
* @returns A deep-frozen `Readonly<Transaction<VaultV2InKindRedeemAction>>` with `to`, `value`,
|
|
30
31
|
* `data`, and the typed action discriminator.
|
|
31
32
|
* @throws {NonPositiveInputError} when `amount` or `deadline` is not positive.
|
|
33
|
+
* @throws {InputExceedsMaxError} when the bundle or permit deadline exceeds `uint256`.
|
|
32
34
|
* @throws {UnsupportedChainIdError} when no address registry exists for the target chain.
|
|
33
35
|
* @throws {UnknownAddressError} when VaultExitBundlesV1 is not registered on the target chain.
|
|
34
|
-
* @throws {
|
|
36
|
+
* @throws {BundlesPermitMismatchError} when the requirement has the wrong permit kind, asset, owner,
|
|
37
|
+
* spender, or signature encoding, or when its signed and action amounts or deadlines disagree.
|
|
35
38
|
* @example
|
|
36
39
|
* ```ts
|
|
37
40
|
* import { vaultV2InKindRedeem } from "@morpho-org/morpho-sdk";
|
|
@@ -46,8 +49,7 @@ const getVaultExitBundlesV1PermitStruct_js_1 = require("../signatures/getVaultEx
|
|
|
46
49
|
const vaultV2InKindRedeem = ({ vault, args, metadata, }) => {
|
|
47
50
|
if (args.amount <= 0n)
|
|
48
51
|
throw new index_js_2.NonPositiveInputError("amount", args.amount);
|
|
49
|
-
|
|
50
|
-
throw new index_js_2.NonPositiveInputError("deadline", args.deadline);
|
|
52
|
+
(0, validate_js_1.validateDeadline)(args.deadline);
|
|
51
53
|
const to = (0, morpho_ts_1.getChainAddress)(vault.chainId, "bundles.vaultExitBundlesV1");
|
|
52
54
|
const marketParamsList = args.marketParamsList.map((marketParams) => ({
|
|
53
55
|
loanToken: marketParams.loanToken,
|
|
@@ -56,9 +58,11 @@ const vaultV2InKindRedeem = ({ vault, args, metadata, }) => {
|
|
|
56
58
|
irm: marketParams.irm,
|
|
57
59
|
lltv: marketParams.lltv,
|
|
58
60
|
}));
|
|
59
|
-
const sharesPermit = (0,
|
|
61
|
+
const sharesPermit = (0, common_js_1.getBundlesSharesPermit)({
|
|
60
62
|
vault: vault.address,
|
|
61
63
|
deadline: args.deadline,
|
|
64
|
+
owner: args.userAddress,
|
|
65
|
+
spender: to,
|
|
62
66
|
requirementSignature: args.requirementSignature,
|
|
63
67
|
});
|
|
64
68
|
let tx = {
|
package/lib/cjs/augment.d.ts
CHANGED
package/lib/cjs/augment.js
CHANGED
package/lib/cjs/blue/abis.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { marketParamsAbi } from "@morpho-org/blue-sdk";
|
|
2
|
-
export { adaptiveCurveIrmAbi, blueAbi, blueOracleAbi, erc2612Abi, erc5267Abi, metaMorphoAbi, metaMorphoFactoryAbi, morphoMarketV1AdapterAbi, morphoMarketV1AdapterFactoryAbi, morphoMarketV1AdapterV2Abi, morphoMarketV1AdapterV2FactoryAbi, morphoVaultV1AdapterAbi, morphoVaultV1AdapterFactoryAbi, permissionedErc20WrapperAbi, permit2Abi, preLiquidationAbi, preLiquidationFactoryAbi,
|
|
2
|
+
export { adaptiveCurveIrmAbi, blueAbi, blueOracleAbi, erc2612Abi, erc5267Abi, metaMorphoAbi, metaMorphoFactoryAbi, morphoMarketV1AdapterAbi, morphoMarketV1AdapterFactoryAbi, morphoMarketV1AdapterV2Abi, morphoMarketV1AdapterV2FactoryAbi, morphoVaultV1AdapterAbi, morphoVaultV1AdapterFactoryAbi, permissionedErc20WrapperAbi, permit2Abi, preLiquidationAbi, preLiquidationFactoryAbi, vaultV2Abi, vaultV2BluePublicAllocatorAbi, vaultV2FactoryAbi, whitelistControllerAggregatorV2Abi, wrappedBackedTokenAbi, wstEthAbi, } from "@morpho-org/blue-sdk-viem";
|
package/lib/cjs/blue/abis.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.wstEthAbi = exports.wrappedBackedTokenAbi = exports.whitelistControllerAggregatorV2Abi = exports.vaultV2FactoryAbi = exports.vaultV2BluePublicAllocatorAbi = exports.vaultV2Abi = exports.
|
|
3
|
+
exports.wstEthAbi = exports.wrappedBackedTokenAbi = exports.whitelistControllerAggregatorV2Abi = exports.vaultV2FactoryAbi = exports.vaultV2BluePublicAllocatorAbi = exports.vaultV2Abi = exports.preLiquidationFactoryAbi = exports.preLiquidationAbi = exports.permit2Abi = exports.permissionedErc20WrapperAbi = exports.morphoVaultV1AdapterFactoryAbi = exports.morphoVaultV1AdapterAbi = exports.morphoMarketV1AdapterV2FactoryAbi = exports.morphoMarketV1AdapterV2Abi = exports.morphoMarketV1AdapterFactoryAbi = exports.morphoMarketV1AdapterAbi = exports.metaMorphoFactoryAbi = exports.metaMorphoAbi = exports.erc5267Abi = exports.erc2612Abi = exports.blueOracleAbi = exports.blueAbi = exports.adaptiveCurveIrmAbi = exports.marketParamsAbi = void 0;
|
|
4
4
|
var blue_sdk_1 = require("@morpho-org/blue-sdk");
|
|
5
5
|
Object.defineProperty(exports, "marketParamsAbi", { enumerable: true, get: function () { return blue_sdk_1.marketParamsAbi; } });
|
|
6
6
|
var blue_sdk_viem_1 = require("@morpho-org/blue-sdk-viem");
|
|
@@ -21,10 +21,6 @@ Object.defineProperty(exports, "permissionedErc20WrapperAbi", { enumerable: true
|
|
|
21
21
|
Object.defineProperty(exports, "permit2Abi", { enumerable: true, get: function () { return blue_sdk_viem_1.permit2Abi; } });
|
|
22
22
|
Object.defineProperty(exports, "preLiquidationAbi", { enumerable: true, get: function () { return blue_sdk_viem_1.preLiquidationAbi; } });
|
|
23
23
|
Object.defineProperty(exports, "preLiquidationFactoryAbi", { enumerable: true, get: function () { return blue_sdk_viem_1.preLiquidationFactoryAbi; } });
|
|
24
|
-
Object.defineProperty(exports, "publicAllocatorAbi", { enumerable: true, get: function () { return blue_sdk_viem_1.publicAllocatorAbi; } });
|
|
25
|
-
Object.defineProperty(exports, "vaultV1AdapterAbi", { enumerable: true, get: function () { return blue_sdk_viem_1.vaultV1AdapterAbi; } });
|
|
26
|
-
Object.defineProperty(exports, "vaultV1AdapterFactoryAbi", { enumerable: true, get: function () { return blue_sdk_viem_1.vaultV1AdapterFactoryAbi; } });
|
|
27
|
-
Object.defineProperty(exports, "vaultV1PublicAllocatorAbi", { enumerable: true, get: function () { return blue_sdk_viem_1.vaultV1PublicAllocatorAbi; } });
|
|
28
24
|
Object.defineProperty(exports, "vaultV2Abi", { enumerable: true, get: function () { return blue_sdk_viem_1.vaultV2Abi; } });
|
|
29
25
|
Object.defineProperty(exports, "vaultV2BluePublicAllocatorAbi", { enumerable: true, get: function () { return blue_sdk_viem_1.vaultV2BluePublicAllocatorAbi; } });
|
|
30
26
|
Object.defineProperty(exports, "vaultV2FactoryAbi", { enumerable: true, get: function () { return blue_sdk_viem_1.vaultV2FactoryAbi; } });
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type { IAccrualPosition, IAccrualVault, IAccrualVaultV2, IAccrualVaultV2Adapter, IAccrualVaultV2MorphoMarketV1Adapter, IAccrualVaultV2MorphoMarketV1AdapterV2, IAccrualVaultV2MorphoVaultV1Adapter, IAssetBalances, IEip5267Domain, IHolding, IMarket, IMarketParams, IPosition, IPreLiquidationParams, IPreLiquidationPosition, IToken, IVault, IVaultConfig, IVaultMarketAllocation, IVaultMarketConfig,
|
|
2
|
-
export { AccrualPosition, AccrualVault, AccrualVaultV2, AccrualVaultV2MorphoMarketV1Adapter, AccrualVaultV2MorphoMarketV1AdapterV2, AccrualVaultV2MorphoVaultV1Adapter, AssetBalances, ConstantWrappedToken, Eip5267Domain, ExchangeRateWrappedToken, Holding, Market, MarketParams, Position, PreLiquidationParams, PreLiquidationPosition, Token, User, Vault, VaultConfig, VaultMarketAllocation, VaultMarketConfig,
|
|
1
|
+
export type { IAccrualPosition, IAccrualVault, IAccrualVaultV2, IAccrualVaultV2Adapter, IAccrualVaultV2MorphoMarketV1Adapter, IAccrualVaultV2MorphoMarketV1AdapterV2, IAccrualVaultV2MorphoVaultV1Adapter, IAssetBalances, IEip5267Domain, IHolding, IMarket, IMarketParams, IPosition, IPreLiquidationParams, IPreLiquidationPosition, IToken, IVault, IVaultConfig, IVaultMarketAllocation, IVaultMarketConfig, IVaultToken, IVaultUser, IVaultV2, IVaultV2Adapter, IVaultV2Allocation, IVaultV2BlueMarketPublicAllocatorConfig, IVaultV2BluePublicAllocatorConfig, IVaultV2MorphoMarketV1Adapter, IVaultV2MorphoMarketV1AdapterV2, IVaultV2MorphoVaultV1Adapter, PeripheralBalance, PeripheralBalanceType, } from "@morpho-org/blue-sdk";
|
|
2
|
+
export { AccrualPosition, AccrualVault, AccrualVaultV2, AccrualVaultV2MorphoMarketV1Adapter, AccrualVaultV2MorphoMarketV1AdapterV2, AccrualVaultV2MorphoVaultV1Adapter, AssetBalances, ConstantWrappedToken, Eip5267Domain, ExchangeRateWrappedToken, Holding, Market, MarketParams, Position, PreLiquidationParams, PreLiquidationPosition, Token, User, Vault, VaultConfig, VaultMarketAllocation, VaultMarketConfig, VaultToken, VaultUser, VaultV2, VaultV2Adapter, VaultV2BlueMarketPublicAllocatorConfig, VaultV2BluePublicAllocatorConfig, VaultV2MorphoMarketV1Adapter, VaultV2MorphoMarketV1AdapterV2, VaultV2MorphoVaultV1Adapter, WrappedToken, } from "@morpho-org/blue-sdk";
|
package/lib/cjs/blue/entities.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WrappedToken = exports.VaultV2MorphoVaultV1Adapter = exports.VaultV2MorphoMarketV1AdapterV2 = exports.VaultV2MorphoMarketV1Adapter = exports.VaultV2BluePublicAllocatorConfig = exports.VaultV2BlueMarketPublicAllocatorConfig = exports.VaultV2Adapter = exports.VaultV2 = exports.VaultUser = exports.VaultToken = exports.
|
|
3
|
+
exports.WrappedToken = exports.VaultV2MorphoVaultV1Adapter = exports.VaultV2MorphoMarketV1AdapterV2 = exports.VaultV2MorphoMarketV1Adapter = exports.VaultV2BluePublicAllocatorConfig = exports.VaultV2BlueMarketPublicAllocatorConfig = exports.VaultV2Adapter = exports.VaultV2 = exports.VaultUser = exports.VaultToken = exports.VaultMarketConfig = exports.VaultMarketAllocation = exports.VaultConfig = exports.Vault = exports.User = exports.Token = exports.PreLiquidationPosition = exports.PreLiquidationParams = exports.Position = exports.MarketParams = exports.Market = exports.Holding = exports.ExchangeRateWrappedToken = exports.Eip5267Domain = exports.ConstantWrappedToken = exports.AssetBalances = exports.AccrualVaultV2MorphoVaultV1Adapter = exports.AccrualVaultV2MorphoMarketV1AdapterV2 = exports.AccrualVaultV2MorphoMarketV1Adapter = exports.AccrualVaultV2 = exports.AccrualVault = exports.AccrualPosition = void 0;
|
|
4
4
|
var blue_sdk_1 = require("@morpho-org/blue-sdk");
|
|
5
5
|
Object.defineProperty(exports, "AccrualPosition", { enumerable: true, get: function () { return blue_sdk_1.AccrualPosition; } });
|
|
6
6
|
Object.defineProperty(exports, "AccrualVault", { enumerable: true, get: function () { return blue_sdk_1.AccrualVault; } });
|
|
@@ -24,7 +24,6 @@ Object.defineProperty(exports, "Vault", { enumerable: true, get: function () { r
|
|
|
24
24
|
Object.defineProperty(exports, "VaultConfig", { enumerable: true, get: function () { return blue_sdk_1.VaultConfig; } });
|
|
25
25
|
Object.defineProperty(exports, "VaultMarketAllocation", { enumerable: true, get: function () { return blue_sdk_1.VaultMarketAllocation; } });
|
|
26
26
|
Object.defineProperty(exports, "VaultMarketConfig", { enumerable: true, get: function () { return blue_sdk_1.VaultMarketConfig; } });
|
|
27
|
-
Object.defineProperty(exports, "VaultMarketPublicAllocatorConfig", { enumerable: true, get: function () { return blue_sdk_1.VaultMarketPublicAllocatorConfig; } });
|
|
28
27
|
Object.defineProperty(exports, "VaultToken", { enumerable: true, get: function () { return blue_sdk_1.VaultToken; } });
|
|
29
28
|
Object.defineProperty(exports, "VaultUser", { enumerable: true, get: function () { return blue_sdk_1.VaultUser; } });
|
|
30
29
|
Object.defineProperty(exports, "VaultV2", { enumerable: true, get: function () { return blue_sdk_1.VaultV2; } });
|
package/lib/cjs/blue/errors.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { BlueErrors, DivisionByZeroError, IncompleteChainRegistryError, InvalidBitLengthError, InvalidMarketParamsError, RegistryValueAlreadyRegisteredError, UnknownAddressError, UnknownDataError, UnknownFactory, UnknownMarketAllocationError, UnknownMarketParamsError, UnknownOfFactory, UnknownTokenError, UnknownTokenPriceError, UnknownVaultConfigError, UnsupportedChainIdError, UnsupportedPreLiquidationParamsError, UnsupportedVaultV2AdapterError, VaultV2Errors, } from "@morpho-org/blue-sdk";
|
|
1
|
+
export { BlueErrors, DivisionByZeroError, IncompleteChainRegistryError, InvalidBitLengthError, InvalidMarketParamsError, RegistryValueAlreadyRegisteredError, UnknownAddressError, UnknownDataError, UnknownFactory, UnknownMarketAllocationError, UnknownMarketParamsError, UnknownOfFactory, UnknownTokenError, UnknownTokenPriceError, UnknownVaultConfigError, UnsupportedChainIdError, UnsupportedMarketIrmError, UnsupportedPreLiquidationParamsError, UnsupportedVaultV2AdapterError, VaultV2Errors, } from "@morpho-org/blue-sdk";
|
|
2
2
|
export { getUnsupportedVaultV2Adapter, InvalidPermitDomainChainIdError, InvalidPermitDomainVerifyingContractError, isUnknownOfFactoryError, UnsupportedPermitDomainExtensionsError, } from "@morpho-org/blue-sdk-viem";
|
package/lib/cjs/blue/errors.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UnsupportedPermitDomainExtensionsError = exports.isUnknownOfFactoryError = exports.InvalidPermitDomainVerifyingContractError = exports.InvalidPermitDomainChainIdError = exports.getUnsupportedVaultV2Adapter = exports.VaultV2Errors = exports.UnsupportedVaultV2AdapterError = exports.UnsupportedPreLiquidationParamsError = exports.UnsupportedChainIdError = exports.UnknownVaultConfigError = exports.UnknownTokenPriceError = exports.UnknownTokenError = exports.UnknownOfFactory = exports.UnknownMarketParamsError = exports.UnknownMarketAllocationError = exports.UnknownFactory = exports.UnknownDataError = exports.UnknownAddressError = exports.RegistryValueAlreadyRegisteredError = exports.InvalidMarketParamsError = exports.InvalidBitLengthError = exports.IncompleteChainRegistryError = exports.DivisionByZeroError = exports.BlueErrors = void 0;
|
|
3
|
+
exports.UnsupportedPermitDomainExtensionsError = exports.isUnknownOfFactoryError = exports.InvalidPermitDomainVerifyingContractError = exports.InvalidPermitDomainChainIdError = exports.getUnsupportedVaultV2Adapter = exports.VaultV2Errors = exports.UnsupportedVaultV2AdapterError = exports.UnsupportedPreLiquidationParamsError = exports.UnsupportedMarketIrmError = exports.UnsupportedChainIdError = exports.UnknownVaultConfigError = exports.UnknownTokenPriceError = exports.UnknownTokenError = exports.UnknownOfFactory = exports.UnknownMarketParamsError = exports.UnknownMarketAllocationError = exports.UnknownFactory = exports.UnknownDataError = exports.UnknownAddressError = exports.RegistryValueAlreadyRegisteredError = exports.InvalidMarketParamsError = exports.InvalidBitLengthError = exports.IncompleteChainRegistryError = exports.DivisionByZeroError = exports.BlueErrors = void 0;
|
|
4
4
|
var blue_sdk_1 = require("@morpho-org/blue-sdk");
|
|
5
5
|
Object.defineProperty(exports, "BlueErrors", { enumerable: true, get: function () { return blue_sdk_1.BlueErrors; } });
|
|
6
6
|
Object.defineProperty(exports, "DivisionByZeroError", { enumerable: true, get: function () { return blue_sdk_1.DivisionByZeroError; } });
|
|
@@ -18,6 +18,7 @@ Object.defineProperty(exports, "UnknownTokenError", { enumerable: true, get: fun
|
|
|
18
18
|
Object.defineProperty(exports, "UnknownTokenPriceError", { enumerable: true, get: function () { return blue_sdk_1.UnknownTokenPriceError; } });
|
|
19
19
|
Object.defineProperty(exports, "UnknownVaultConfigError", { enumerable: true, get: function () { return blue_sdk_1.UnknownVaultConfigError; } });
|
|
20
20
|
Object.defineProperty(exports, "UnsupportedChainIdError", { enumerable: true, get: function () { return blue_sdk_1.UnsupportedChainIdError; } });
|
|
21
|
+
Object.defineProperty(exports, "UnsupportedMarketIrmError", { enumerable: true, get: function () { return blue_sdk_1.UnsupportedMarketIrmError; } });
|
|
21
22
|
Object.defineProperty(exports, "UnsupportedPreLiquidationParamsError", { enumerable: true, get: function () { return blue_sdk_1.UnsupportedPreLiquidationParamsError; } });
|
|
22
23
|
Object.defineProperty(exports, "UnsupportedVaultV2AdapterError", { enumerable: true, get: function () { return blue_sdk_1.UnsupportedVaultV2AdapterError; } });
|
|
23
24
|
Object.defineProperty(exports, "VaultV2Errors", { enumerable: true, get: function () { return blue_sdk_1.VaultV2Errors; } });
|
package/lib/cjs/blue/fetch.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { fetchAccrualPosition, fetchAccrualVault, fetchAccrualVaultV2, fetchAccrualVaultV2Adapter, fetchAccrualVaultV2MorphoMarketV1Adapter, fetchAccrualVaultV2MorphoMarketV1AdapterV2, fetchAccrualVaultV2MorphoVaultV1Adapter, fetchHolding, fetchMarket, fetchMarketParams, fetchPosition, fetchPreLiquidationParams, fetchPreLiquidationPosition, fetchToken, fetchUser, fetchVault, fetchVaultConfig, fetchVaultMarketAllocation, fetchVaultMarketConfig,
|
|
1
|
+
export { fetchAccrualPosition, fetchAccrualVault, fetchAccrualVaultV2, fetchAccrualVaultV2Adapter, fetchAccrualVaultV2MorphoMarketV1Adapter, fetchAccrualVaultV2MorphoMarketV1AdapterV2, fetchAccrualVaultV2MorphoVaultV1Adapter, fetchHolding, fetchMarket, fetchMarketParams, fetchPosition, fetchPreLiquidationParams, fetchPreLiquidationPosition, fetchToken, fetchUser, fetchVault, fetchVaultConfig, fetchVaultMarketAllocation, fetchVaultMarketConfig, fetchVaultUser, fetchVaultV2, fetchVaultV2Adapter, fetchVaultV2BlueMarketPublicAllocatorConfig, fetchVaultV2BluePublicAllocatorConfig, fetchVaultV2BluePublicAllocatorData, fetchVaultV2MorphoMarketV1Adapter, fetchVaultV2MorphoMarketV1AdapterV2, fetchVaultV2MorphoVaultV1Adapter, } from "@morpho-org/blue-sdk-viem";
|
package/lib/cjs/blue/fetch.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fetchVaultV2MorphoVaultV1Adapter = exports.fetchVaultV2MorphoMarketV1AdapterV2 = exports.fetchVaultV2MorphoMarketV1Adapter = exports.fetchVaultV2BluePublicAllocatorData = exports.fetchVaultV2BluePublicAllocatorConfig = exports.fetchVaultV2BlueMarketPublicAllocatorConfig = exports.fetchVaultV2Adapter = exports.fetchVaultV2 = exports.fetchVaultUser = exports.
|
|
3
|
+
exports.fetchVaultV2MorphoVaultV1Adapter = exports.fetchVaultV2MorphoMarketV1AdapterV2 = exports.fetchVaultV2MorphoMarketV1Adapter = exports.fetchVaultV2BluePublicAllocatorData = exports.fetchVaultV2BluePublicAllocatorConfig = exports.fetchVaultV2BlueMarketPublicAllocatorConfig = exports.fetchVaultV2Adapter = exports.fetchVaultV2 = exports.fetchVaultUser = exports.fetchVaultMarketConfig = exports.fetchVaultMarketAllocation = exports.fetchVaultConfig = exports.fetchVault = exports.fetchUser = exports.fetchToken = exports.fetchPreLiquidationPosition = exports.fetchPreLiquidationParams = exports.fetchPosition = exports.fetchMarketParams = exports.fetchMarket = exports.fetchHolding = exports.fetchAccrualVaultV2MorphoVaultV1Adapter = exports.fetchAccrualVaultV2MorphoMarketV1AdapterV2 = exports.fetchAccrualVaultV2MorphoMarketV1Adapter = exports.fetchAccrualVaultV2Adapter = exports.fetchAccrualVaultV2 = exports.fetchAccrualVault = exports.fetchAccrualPosition = void 0;
|
|
4
4
|
var blue_sdk_viem_1 = require("@morpho-org/blue-sdk-viem");
|
|
5
5
|
Object.defineProperty(exports, "fetchAccrualPosition", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchAccrualPosition; } });
|
|
6
6
|
Object.defineProperty(exports, "fetchAccrualVault", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchAccrualVault; } });
|
|
@@ -21,7 +21,6 @@ Object.defineProperty(exports, "fetchVault", { enumerable: true, get: function (
|
|
|
21
21
|
Object.defineProperty(exports, "fetchVaultConfig", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchVaultConfig; } });
|
|
22
22
|
Object.defineProperty(exports, "fetchVaultMarketAllocation", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchVaultMarketAllocation; } });
|
|
23
23
|
Object.defineProperty(exports, "fetchVaultMarketConfig", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchVaultMarketConfig; } });
|
|
24
|
-
Object.defineProperty(exports, "fetchVaultMarketPublicAllocatorConfig", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchVaultMarketPublicAllocatorConfig; } });
|
|
25
24
|
Object.defineProperty(exports, "fetchVaultUser", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchVaultUser; } });
|
|
26
25
|
Object.defineProperty(exports, "fetchVaultV2", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchVaultV2; } });
|
|
27
26
|
Object.defineProperty(exports, "fetchVaultV2Adapter", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchVaultV2Adapter; } });
|
package/lib/cjs/blue/types.d.ts
CHANGED
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
export type { BigIntish, CollateralAllocation, Eip712Field, Erc20AllowanceRecipient, Failable, Fetchable, InputMarketParams,
|
|
2
|
-
export type { AuthorizationArgs,
|
|
3
|
-
/** @deprecated Args for the deprecated getDaiPermitTypedData; scheduled for removal in the next major. */
|
|
4
|
-
DaiPermitArgs, DeploylessFetchParameters, FetchParameters, InputAllocation, MetaMorphoCall, Permit2PermitArgs, Permit2TransferFromArgs, PermitArgs, } from "@morpho-org/blue-sdk-viem";
|
|
1
|
+
export type { BigIntish, CollateralAllocation, Eip712Field, Erc20AllowanceRecipient, Failable, Fetchable, InputMarketParams, Loadable, MarketId, MaxBorrowOptions, MaxPositionCapacities, MaxWithdrawCollateralOptions, Pending, } from "@morpho-org/blue-sdk";
|
|
2
|
+
export type { AuthorizationArgs, DeploylessFetchParameters, FetchParameters, InputAllocation, MetaMorphoCall, Permit2PermitArgs, Permit2TransferFromArgs, PermitArgs, } from "@morpho-org/blue-sdk-viem";
|
package/lib/cjs/blue/utils.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
1
|
export type { CapacityLimit, RoundingDirection } from "@morpho-org/blue-sdk";
|
|
2
2
|
export { AdaptiveCurveIrmLib, CapacityLimitReason, defaultPreLiquidationParamsRegistry, getDefaultPreLiquidationParams, MarketUtils, MathLib, SharesMath, VaultUtils, VaultV2BlueMarketPublicAllocatorConfigUtils, VaultV2BluePublicAllocatorConfigUtils, VaultV2Utils, } from "@morpho-org/blue-sdk";
|
|
3
|
-
export { decodeBytes32String, getAuthorizationTypedData,
|
|
4
|
-
/** @deprecated DAI is routed through Permit2 internally; scheduled for removal in the next major. */
|
|
5
|
-
getDaiPermitTypedData, getPermit2PermitTypedData, getPermit2TransferFromTypedData, getPermitTypedData, MetaMorphoAction, optionalBoolean, readContractRestructured, restructure, safeGetAddress, safeParseNumber, safeParseUnits, } from "@morpho-org/blue-sdk-viem";
|
|
3
|
+
export { decodeBytes32String, getAuthorizationTypedData, getPermit2PermitTypedData, getPermit2TransferFromTypedData, getPermitTypedData, MetaMorphoAction, optionalBoolean, readContractRestructured, restructure, safeGetAddress, safeParseNumber, safeParseUnits, } from "@morpho-org/blue-sdk-viem";
|
package/lib/cjs/blue/utils.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.safeParseUnits = exports.safeParseNumber = exports.safeGetAddress = exports.restructure = exports.readContractRestructured = exports.optionalBoolean = exports.MetaMorphoAction = exports.getPermitTypedData = exports.getPermit2TransferFromTypedData = exports.getPermit2PermitTypedData = exports.
|
|
3
|
+
exports.safeParseUnits = exports.safeParseNumber = exports.safeGetAddress = exports.restructure = exports.readContractRestructured = exports.optionalBoolean = exports.MetaMorphoAction = exports.getPermitTypedData = exports.getPermit2TransferFromTypedData = exports.getPermit2PermitTypedData = exports.getAuthorizationTypedData = exports.decodeBytes32String = exports.VaultV2Utils = exports.VaultV2BluePublicAllocatorConfigUtils = exports.VaultV2BlueMarketPublicAllocatorConfigUtils = exports.VaultUtils = exports.SharesMath = exports.MathLib = exports.MarketUtils = exports.getDefaultPreLiquidationParams = exports.defaultPreLiquidationParamsRegistry = exports.CapacityLimitReason = exports.AdaptiveCurveIrmLib = void 0;
|
|
4
4
|
var blue_sdk_1 = require("@morpho-org/blue-sdk");
|
|
5
5
|
Object.defineProperty(exports, "AdaptiveCurveIrmLib", { enumerable: true, get: function () { return blue_sdk_1.AdaptiveCurveIrmLib; } });
|
|
6
6
|
Object.defineProperty(exports, "CapacityLimitReason", { enumerable: true, get: function () { return blue_sdk_1.CapacityLimitReason; } });
|
|
@@ -16,8 +16,6 @@ Object.defineProperty(exports, "VaultV2Utils", { enumerable: true, get: function
|
|
|
16
16
|
var blue_sdk_viem_1 = require("@morpho-org/blue-sdk-viem");
|
|
17
17
|
Object.defineProperty(exports, "decodeBytes32String", { enumerable: true, get: function () { return blue_sdk_viem_1.decodeBytes32String; } });
|
|
18
18
|
Object.defineProperty(exports, "getAuthorizationTypedData", { enumerable: true, get: function () { return blue_sdk_viem_1.getAuthorizationTypedData; } });
|
|
19
|
-
/** @deprecated DAI is routed through Permit2 internally; scheduled for removal in the next major. */
|
|
20
|
-
Object.defineProperty(exports, "getDaiPermitTypedData", { enumerable: true, get: function () { return blue_sdk_viem_1.getDaiPermitTypedData; } });
|
|
21
19
|
Object.defineProperty(exports, "getPermit2PermitTypedData", { enumerable: true, get: function () { return blue_sdk_viem_1.getPermit2PermitTypedData; } });
|
|
22
20
|
Object.defineProperty(exports, "getPermit2TransferFromTypedData", { enumerable: true, get: function () { return blue_sdk_viem_1.getPermit2TransferFromTypedData; } });
|
|
23
21
|
Object.defineProperty(exports, "getPermitTypedData", { enumerable: true, get: function () { return blue_sdk_viem_1.getPermitTypedData; } });
|
|
@@ -12,7 +12,7 @@ import { type Metadata, type MorphoClientType } from "../types/index.js";
|
|
|
12
12
|
* @param _options.metadata - Optional analytics metadata applied to every transaction the
|
|
13
13
|
* `morpho` namespace builds.
|
|
14
14
|
* @param _options.supportSignature - Whether the integrator can collect EIP-712 signatures for
|
|
15
|
-
* ERC-2612, Permit2
|
|
15
|
+
* ERC-2612, Permit2 SignatureTransfer, and Morpho authorization.
|
|
16
16
|
* Defaults to `false` (standalone approvals and authorization calls only).
|
|
17
17
|
* @param _options.supportDeployless - Whether entity fetchers may use deployless multicall.
|
|
18
18
|
* @returns A viem extension function — `client.extend(morphoViemExtension(...))` adds
|