@morpho-org/morpho-sdk 6.0.0-next.2 → 6.0.0-next.4
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 +88 -32
- package/README.md +9 -7
- package/lib/cjs/abis.d.ts +7 -2844
- package/lib/cjs/abis.js +3 -1951
- 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 +1 -9
- 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 +2 -2
- 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 +6 -2
- package/lib/cjs/actions/bundles/common.js +31 -5
- 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 +6 -8
- package/lib/cjs/actions/requirements/blue/getBlueAuthorizationRequirement.js +11 -16
- package/lib/cjs/actions/requirements/encode/encodeBlueSignatureAuthorization.d.ts +5 -6
- package/lib/cjs/actions/requirements/encode/encodeBlueSignatureAuthorization.js +4 -5
- 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 +5 -5
- package/lib/cjs/actions/requirements/encode/encodeErc20Permit.js +6 -11
- 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 +7 -5
- package/lib/cjs/actions/vaultV1/inKindRedeem.js +11 -7
- 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 +1 -1
- package/lib/cjs/actions/vaultV2/forceWithdraw.js +3 -3
- package/lib/cjs/actions/vaultV2/inKindRedeem.d.ts +7 -5
- package/lib/cjs/actions/vaultV2/inKindRedeem.js +11 -7
- package/lib/cjs/augment/AccrualPosition.d.ts +1 -0
- package/lib/cjs/augment.d.ts +0 -1
- package/lib/cjs/augment.js +0 -1
- package/lib/cjs/blue/abis.d.ts +5 -5
- package/lib/cjs/blue/abis.js +3 -7
- package/lib/cjs/blue/entities.d.ts +10 -8
- package/lib/cjs/blue/entities.js +3 -3
- package/lib/cjs/blue/errors.d.ts +4 -2
- package/lib/cjs/blue/errors.js +3 -1
- package/lib/cjs/blue/fetch.d.ts +5 -3
- package/lib/cjs/blue/fetch.js +3 -3
- package/lib/cjs/blue/types.d.ts +2 -4
- package/lib/cjs/blue/utils.d.ts +6 -4
- package/lib/cjs/blue/utils.js +3 -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 +30 -265
- package/lib/cjs/entities/blue/blue.js +1 -205
- package/lib/cjs/entities/index.d.ts +11 -66
- package/lib/cjs/entities/index.js +3 -21
- package/lib/cjs/entities/requirements/getVaultBundlesSharesRequirements.d.ts +5 -2
- package/lib/cjs/entities/requirements/getVaultBundlesSharesRequirements.js +8 -3
- package/lib/cjs/entities/vaultV1/vaultV1.d.ts +13 -5
- package/lib/cjs/entities/vaultV1/vaultV1.js +16 -10
- package/lib/cjs/entities/vaultV2/vaultV2.d.ts +40 -19
- package/lib/cjs/entities/vaultV2/vaultV2.js +57 -26
- package/lib/cjs/entities/vaultV2BlueReallocationData.js +4 -21
- package/lib/cjs/errors.d.ts +5 -47
- package/lib/cjs/errors.js +4 -46
- package/lib/cjs/fetch.d.ts +5 -17
- package/lib/cjs/fetch.js +3 -17
- package/lib/cjs/helpers/constant.d.ts +0 -2
- package/lib/cjs/helpers/constant.js +0 -2
- package/lib/cjs/helpers/index.d.ts +2 -3
- package/lib/cjs/helpers/index.js +1 -9
- package/lib/cjs/helpers/previewVaultV2ForceWithdraw.js +11 -5
- package/lib/cjs/helpers/slippage.d.ts +1 -103
- package/lib/cjs/helpers/slippage.js +0 -150
- package/lib/cjs/helpers/utilization.d.ts +12 -10
- package/lib/cjs/helpers/utilization.js +27 -12
- package/lib/cjs/helpers/validate.d.ts +1 -24
- package/lib/cjs/helpers/validate.js +2 -49
- package/lib/cjs/helpers/validateRequirementSpender.d.ts +1 -1
- package/lib/cjs/helpers/validateRequirementSpender.js +1 -3
- package/lib/cjs/helpers/vaultV2ForceWithdrawPlan.d.ts +48 -15
- package/lib/cjs/helpers/vaultV2ForceWithdrawPlan.js +48 -15
- package/lib/cjs/midnight/errors.d.ts +1 -1
- package/lib/cjs/midnight/errors.js +2 -1
- package/lib/cjs/types/action.d.ts +17 -65
- package/lib/cjs/types/action.js +11 -4
- package/lib/cjs/types/error.d.ts +50 -381
- package/lib/cjs/types/error.js +64 -395
- package/lib/cjs/types/sharedLiquidity.d.ts +1 -117
- package/lib/cjs/types.d.ts +2 -18
- package/lib/cjs/utils.d.ts +10 -35
- package/lib/cjs/utils.js +4 -36
- package/lib/esm/abis.d.ts +7 -2844
- package/lib/esm/abis.js +7 -1950
- 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 +1 -9
- 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 +2 -2
- 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 +6 -2
- package/lib/esm/actions/bundles/common.js +32 -6
- 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 +6 -8
- package/lib/esm/actions/requirements/blue/getBlueAuthorizationRequirement.js +12 -17
- package/lib/esm/actions/requirements/encode/encodeBlueSignatureAuthorization.d.ts +5 -6
- package/lib/esm/actions/requirements/encode/encodeBlueSignatureAuthorization.js +4 -5
- 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 +5 -5
- package/lib/esm/actions/requirements/encode/encodeErc20Permit.js +6 -11
- 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 +7 -5
- package/lib/esm/actions/vaultV1/inKindRedeem.js +11 -7
- 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 +1 -1
- package/lib/esm/actions/vaultV2/forceWithdraw.js +3 -3
- package/lib/esm/actions/vaultV2/inKindRedeem.d.ts +7 -5
- package/lib/esm/actions/vaultV2/inKindRedeem.js +11 -7
- package/lib/esm/augment/AccrualPosition.d.ts +1 -0
- package/lib/esm/augment.d.ts +0 -1
- package/lib/esm/augment.js +0 -1
- package/lib/esm/blue/abis.d.ts +5 -5
- package/lib/esm/blue/abis.js +5 -5
- package/lib/esm/blue/entities.d.ts +10 -8
- package/lib/esm/blue/entities.js +5 -3
- package/lib/esm/blue/errors.d.ts +4 -2
- package/lib/esm/blue/errors.js +4 -2
- package/lib/esm/blue/fetch.d.ts +5 -3
- package/lib/esm/blue/fetch.js +5 -3
- package/lib/esm/blue/types.d.ts +2 -4
- package/lib/esm/blue/utils.d.ts +6 -4
- package/lib/esm/blue/utils.js +6 -4
- 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 +30 -265
- package/lib/esm/entities/blue/blue.js +4 -208
- package/lib/esm/entities/index.d.ts +11 -66
- package/lib/esm/entities/index.js +5 -18
- package/lib/esm/entities/requirements/getVaultBundlesSharesRequirements.d.ts +5 -2
- package/lib/esm/entities/requirements/getVaultBundlesSharesRequirements.js +8 -3
- package/lib/esm/entities/vaultV1/vaultV1.d.ts +13 -5
- package/lib/esm/entities/vaultV1/vaultV1.js +19 -13
- package/lib/esm/entities/vaultV2/vaultV2.d.ts +40 -19
- package/lib/esm/entities/vaultV2/vaultV2.js +61 -30
- package/lib/esm/entities/vaultV2BlueReallocationData.js +2 -19
- package/lib/esm/errors.d.ts +5 -47
- package/lib/esm/errors.js +5 -47
- package/lib/esm/fetch.d.ts +5 -17
- package/lib/esm/fetch.js +5 -17
- package/lib/esm/helpers/constant.d.ts +0 -2
- package/lib/esm/helpers/constant.js +0 -2
- package/lib/esm/helpers/index.d.ts +2 -3
- package/lib/esm/helpers/index.js +2 -3
- package/lib/esm/helpers/previewVaultV2ForceWithdraw.js +11 -5
- package/lib/esm/helpers/slippage.d.ts +1 -103
- package/lib/esm/helpers/slippage.js +1 -147
- package/lib/esm/helpers/utilization.d.ts +12 -10
- package/lib/esm/helpers/utilization.js +26 -11
- package/lib/esm/helpers/validate.d.ts +1 -24
- package/lib/esm/helpers/validate.js +2 -48
- package/lib/esm/helpers/validateRequirementSpender.d.ts +1 -1
- package/lib/esm/helpers/validateRequirementSpender.js +1 -3
- package/lib/esm/helpers/vaultV2ForceWithdrawPlan.d.ts +48 -15
- package/lib/esm/helpers/vaultV2ForceWithdrawPlan.js +48 -15
- package/lib/esm/midnight/errors.d.ts +1 -1
- package/lib/esm/midnight/errors.js +1 -1
- package/lib/esm/types/action.d.ts +17 -65
- package/lib/esm/types/action.js +12 -5
- package/lib/esm/types/error.d.ts +50 -381
- package/lib/esm/types/error.js +58 -377
- package/lib/esm/types/sharedLiquidity.d.ts +1 -117
- package/lib/esm/types.d.ts +2 -18
- package/lib/esm/utils.d.ts +10 -35
- package/lib/esm/utils.js +9 -34
- package/package.json +6 -17
- package/lib/cjs/actions/requirements/encode/encodeErc20Permit2Approve.d.ts +0 -44
- package/lib/cjs/actions/requirements/encode/encodeErc20Permit2Approve.js +0 -88
- package/lib/cjs/actions/requirements/generalAdapter/getGeneralAdapterRequirements.d.ts +0 -88
- package/lib/cjs/actions/requirements/generalAdapter/getGeneralAdapterRequirements.js +0 -152
- package/lib/cjs/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit.d.ts +0 -40
- package/lib/cjs/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit.js +0 -53
- 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 -50
- package/lib/cjs/actions/signatures/getVaultExitBundlesV1PermitStruct.js +0 -45
- 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 -11
- 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 -332
- package/lib/cjs/entities/vaultV1ReallocationData.js +0 -557
- package/lib/cjs/helpers/computeVaultV1Reallocations.d.ts +0 -80
- package/lib/cjs/helpers/computeVaultV1Reallocations.js +0 -245
- package/lib/esm/actions/requirements/encode/encodeErc20Permit2Approve.d.ts +0 -44
- package/lib/esm/actions/requirements/encode/encodeErc20Permit2Approve.js +0 -84
- package/lib/esm/actions/requirements/generalAdapter/getGeneralAdapterRequirements.d.ts +0 -88
- package/lib/esm/actions/requirements/generalAdapter/getGeneralAdapterRequirements.js +0 -148
- package/lib/esm/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit.d.ts +0 -40
- package/lib/esm/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit.js +0 -49
- 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 -50
- package/lib/esm/actions/signatures/getVaultExitBundlesV1PermitStruct.js +0 -41
- 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 -11
- package/lib/esm/augment/VaultMarketPublicAllocatorConfig.js +0 -7
- 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 -332
- package/lib/esm/entities/vaultV1ReallocationData.js +0 -559
- package/lib/esm/helpers/computeVaultV1Reallocations.d.ts +0 -80
- package/lib/esm/helpers/computeVaultV1Reallocations.js +0 -241
package/MIGRATION-v5-to-v6.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Version 6 keeps the Blue entity at `client.morpho.blue(marketParams, chainId)` and preserves its
|
|
4
4
|
write-method names while routing them through five direct BlueBundlesV1 entrypoints. Blue reads and
|
|
5
|
-
|
|
5
|
+
the Vault V2 reallocation-data helper remain on the same entity. There is no parallel
|
|
6
6
|
extension or automatic fallback to the v5 route. Version 6 also reshapes Vault V2 `forceWithdraw`
|
|
7
7
|
to route through the standalone `VaultExitBundlesV1` periphery. This guide covers the Blue write
|
|
8
8
|
rerouting and the Vault V2 `forceWithdraw` route replacement alongside the other v6 breaks
|
|
@@ -160,13 +160,15 @@ prerequisite v5 withdrawals did not have. Await `getRequirements()` and satisfy
|
|
|
160
160
|
`buildTx()`, or the withdrawal reverts:
|
|
161
161
|
|
|
162
162
|
- Without signature support, it returns one ERC-20 approval transaction to send first.
|
|
163
|
-
- With `supportSignature: true`, it returns one signable ERC-2612 shares permit
|
|
164
|
-
to `buildTx([sharesPermit])` and it is folded into
|
|
163
|
+
- With `supportSignature: true`, it returns one signable ERC-2612 shares permit when the current
|
|
164
|
+
allowance is below the cap; pass the signature to `buildTx([sharesPermit])` and it is folded into
|
|
165
|
+
the VaultBundlesV1 call. A larger leftover allowance is always reset with an ERC-20 approval
|
|
166
|
+
transaction instead, because VaultBundlesV1 skips a permit whose nonce was already consumed.
|
|
165
167
|
|
|
166
168
|
The allowance is the only cap on the burn, since asset-mode calldata carries no maximum-shares
|
|
167
169
|
argument. `getRequirements()` therefore derives an exact cap from the vault snapshot, the deadline,
|
|
168
170
|
and `slippageTolerance` (default 0.03%), and returns an approval or permit for exactly that amount
|
|
169
|
-
whenever the current allowance differs
|
|
171
|
+
whenever the current allowance differs.
|
|
170
172
|
|
|
171
173
|
`getRequirements()` re-validates the deadline on every call, so a prepared withdrawal reused after
|
|
172
174
|
its deadline throws `ExpiredDeadlineError` rather than returning cached prerequisites.
|
|
@@ -212,10 +214,10 @@ it alongside the added fields.
|
|
|
212
214
|
transaction sender and sends proceeds and refunds back to that sender; `userAddress` must be the
|
|
213
215
|
eventual sender used to resolve requirements and position snapshots.
|
|
214
216
|
- Replace PublicAllocator V1 or mixed-version reallocation write inputs with Vault V2
|
|
215
|
-
`VaultV2BlueReallocation` inputs.
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
217
|
+
`VaultV2BlueReallocation` inputs. Vault V1 reallocation planning, data, input, validation, and
|
|
218
|
+
explicit low-level Bundler3-composition surfaces are removed in v6. Direct Vault V1 vault
|
|
219
|
+
operations (`deposit`, `withdraw`, `redeem`, `migrateToV2`, `inKindRedeem`) remain; allocator-specific
|
|
220
|
+
raw exports are gone.
|
|
219
221
|
- Provide the BlueBundlesV1 execution deadline and any optional referral-fee configuration through
|
|
220
222
|
the new typed method inputs. Share-mode repayment deadlines are limited to two hours so the SDK's
|
|
221
223
|
derived `maxRepayAssets` remains sufficient through execution.
|
|
@@ -240,9 +242,9 @@ The destinations are different:
|
|
|
240
242
|
BlueBundlesV1 as spender. The SDK resolves the lowest unused Permit2 nonce by default — see the
|
|
241
243
|
subsection below.
|
|
242
244
|
- Morpho authorization now grants BlueBundlesV1 operator rights instead of GeneralAdapter1.
|
|
243
|
-
- Without signature support,
|
|
244
|
-
|
|
245
|
-
transaction funding.
|
|
245
|
+
- Without signature support, full-repay requirements approve exactly the derived `maxRepayAssets`
|
|
246
|
+
funding cap; pass `approvalAmount` to `getRequirements()` to keep a reusable allowance.
|
|
247
|
+
BlueBundlesV1 still refunds unused transaction funding.
|
|
246
248
|
- The built transaction's `to` is BlueBundlesV1, not Bundler3, and calldata contains one fixed
|
|
247
249
|
BlueBundlesV1 entrypoint rather than a `BundlerAction[]` multicall.
|
|
248
250
|
|
|
@@ -272,10 +274,9 @@ no nonce.
|
|
|
272
274
|
|
|
273
275
|
### Signature requirements expose `action.typedData`; low-level encoders take `owner`
|
|
274
276
|
|
|
275
|
-
Every signable requirement action (`PermitAction`, `
|
|
276
|
-
`
|
|
277
|
-
|
|
278
|
-
before signing:
|
|
277
|
+
Every signable requirement action (`PermitAction`, `Permit2SignatureTransferAction`,
|
|
278
|
+
`AuthorizationAction`, `MidnightOfferRootSignatureAction`) now carries the deep-frozen EIP-712
|
|
279
|
+
payload that `sign()` signs, so it can be inspected or displayed before signing:
|
|
279
280
|
|
|
280
281
|
```ts
|
|
281
282
|
const requirement = (await output.getRequirements()).find(isRequirementSignature);
|
|
@@ -291,15 +292,13 @@ It is the exact `TypedDataDefinition` that `sign()` signs; signing itself still
|
|
|
291
292
|
`Requirement.sign(client, userAddress)`.
|
|
292
293
|
|
|
293
294
|
Because the permit and authorization payloads embed the owner and are built eagerly, two exported
|
|
294
|
-
low-level encoders take a new required `owner` parameter
|
|
295
|
-
|
|
296
|
-
`AddressMismatchError`.
|
|
295
|
+
low-level encoders take a new required `owner` parameter. Their `sign(client, userAddress)` rejects
|
|
296
|
+
a `userAddress` different from `owner` with `AddressMismatchError`.
|
|
297
297
|
|
|
298
298
|
| v5 call | v6 call |
|
|
299
299
|
| --- | --- |
|
|
300
300
|
| `encodeErc20Permit(client, { token, spender, amount, chainId, nonce })` | `encodeErc20Permit(client, { token, owner, spender, amount, chainId, nonce })` |
|
|
301
301
|
| `encodeBlueSignatureAuthorization(client, { authorized, isAuthorized, chainId, nonce })` | `encodeBlueSignatureAuthorization(client, { owner, authorized, isAuthorized, chainId, nonce })` |
|
|
302
|
-
| `getGeneralAdapterRequirementsPermit(client, { token, chainId, args, nonce })` | `getGeneralAdapterRequirementsPermit(client, { token, owner, chainId, args, nonce })` |
|
|
303
302
|
|
|
304
303
|
High-level entity flows (`client.morpho.blue(...)`, vault deposits, Midnight) already supply the
|
|
305
304
|
owner and need no changes.
|
|
@@ -347,13 +346,12 @@ Stay on v5 if the product requires partial or collateral-only refinance behavior
|
|
|
347
346
|
|
|
348
347
|
The partial-migration error classes `BorrowAmountAndSharesExclusiveError`,
|
|
349
348
|
`RefinanceExceedsCollateralError`, `RefinanceExceedsBorrowSharesError`,
|
|
350
|
-
`RefinanceExceedsBorrowAssetsError`, and `RefinanceSharesMissingBorrowAssetsError` are
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
`RefinanceTokenMismatchError` stay.
|
|
349
|
+
`RefinanceExceedsBorrowAssetsError`, and `RefinanceSharesMissingBorrowAssetsError` are removed. They
|
|
350
|
+
were never thrown by the full-position route. This removal did not receive a published deprecation
|
|
351
|
+
window; remove pattern-matching branches for these errors or stay on v5. The full-position route
|
|
352
|
+
validates snapshot ownership and token/market compatibility, accounts for reallocation penalties in
|
|
353
|
+
destination debt, then checks the combined destination position against the buffered LLTV
|
|
354
|
+
(`BorrowExceedsSafeLtvError`); `RefinanceSameMarketError` and `RefinanceTokenMismatchError` stay.
|
|
357
355
|
|
|
358
356
|
## Removed action-output field: `reallocationFee`
|
|
359
357
|
|
|
@@ -366,8 +364,65 @@ reallocations.
|
|
|
366
364
|
## Removed type: `BlueReallocationPlan`
|
|
367
365
|
|
|
368
366
|
The `BlueReallocationPlan` union is removed. High-level Blue write inputs accept
|
|
369
|
-
`Iterable<VaultV2BlueReallocation>` directly
|
|
370
|
-
|
|
367
|
+
`Iterable<VaultV2BlueReallocation>` directly. Stay on v5 if explicit PublicAllocator V1 planning or
|
|
368
|
+
Bundler3 composition is required.
|
|
369
|
+
|
|
370
|
+
## Removed deprecated compatibility exports
|
|
371
|
+
|
|
372
|
+
Version 6 removes all deprecated compatibility exports, including names first deprecated only in a
|
|
373
|
+
v6 prerelease:
|
|
374
|
+
|
|
375
|
+
- Ambiguous unprefixed Blue and Midnight facade aliases are removed. Use the `Blue*` / `Midnight*`
|
|
376
|
+
names from shared facade subpaths or canonical names from `/blue/*` and `/midnight/*`.
|
|
377
|
+
- Operation-specific scalar and native-asset error aliases are removed. Pattern-match on the
|
|
378
|
+
current generic input errors and canonical native-asset error classes.
|
|
379
|
+
- `InvalidReallocationShapeError` is removed. Use `InvalidVaultV2BlueReallocationShapeError` for
|
|
380
|
+
malformed Vault V2 entries.
|
|
381
|
+
- Deprecated ABI, constant, typed-data helper, and utility-type aliases inherited from upstream
|
|
382
|
+
packages are removed. Import their canonical replacements from the same facade category.
|
|
383
|
+
- The deprecated `getDaiPermitTypedData` and `DaiPermitArgs` exports are removed from both the root
|
|
384
|
+
and raw `/blue` facades. Maintained action flows route DAI approvals through Permit2 or a classic
|
|
385
|
+
approval.
|
|
386
|
+
- PublicAllocator V1 addresses, ABIs, configs, fetchers, augmentation, planner, data, input,
|
|
387
|
+
validation, and Bundler3-composition symbols are removed.
|
|
388
|
+
Use `getVaultV2BlueReallocationData` and
|
|
389
|
+
`VaultV2BlueReallocationData.computeVaultV2BlueReallocations`.
|
|
390
|
+
- In-kind, fixed-bundles, referral-fee, and Permit2 compatibility errors are removed. Use
|
|
391
|
+
`VaultV2SingleAdapterRequiredError`, `VaultV2UnsupportedExitAdapterError`,
|
|
392
|
+
`BundlesPermitMismatchError`, `BundlesRequirementSignatureMismatchError`,
|
|
393
|
+
`Permit2SignatureTransferNonceAlreadyUsedError`, and `ReferralFeeRecipientMissingError`.
|
|
394
|
+
- `UnsupportedRequirementSignatureError` is thrown by `selectRequirementSignatures` and
|
|
395
|
+
`getBundlesTokenPermit` when a requirement signature carries an action type the v6 flows do not
|
|
396
|
+
support, such as a stale v5 `permit2` signature. `getBundlesTokenPermit` previously threw
|
|
397
|
+
`UnexpectedRequirementSignatureError("permit")` for that case.
|
|
398
|
+
- `getVaultExitBundlesV1PermitStruct` and its parameter/result types are removed. Use
|
|
399
|
+
`getBundlesSharesPermit` and `BundleSharesPermit`.
|
|
400
|
+
|
|
401
|
+
Direct Vault V1 actions remain. Vault V1 PublicAllocator compatibility does not.
|
|
402
|
+
|
|
403
|
+
Several compatibility names above, including the partial-refinance errors, did not complete a
|
|
404
|
+
published deprecation window. Their v6 removal is intentional; stay on v5 if migration cannot be
|
|
405
|
+
completed atomically.
|
|
406
|
+
|
|
407
|
+
## Removed without a deprecation window
|
|
408
|
+
|
|
409
|
+
The stable low-level Bundler3 and migration-adapter surfaces, including their registry and ABI
|
|
410
|
+
re-exports, compatibility errors, signature helpers and types, the WDK requirement alias, and the
|
|
411
|
+
five v5 partial-refinance error classes were removed without a published deprecation window. This
|
|
412
|
+
is an intentional one-time lifecycle deviation; migrate to the standalone bundle actions and
|
|
413
|
+
canonical exports, or stay on v5.
|
|
414
|
+
|
|
415
|
+
## Removed low-level Bundler3 and migration surfaces
|
|
416
|
+
|
|
417
|
+
Version 6 removes the low-level Bundler3 action composer, executor and adapter ABIs, Bundler3-only
|
|
418
|
+
requirements and signature helpers, and related action, signature, and error types. It also removes
|
|
419
|
+
the residual Aave and Compound migration-adapter ABIs left after `migration-sdk-viem` was retired,
|
|
420
|
+
plus the legacy MORPHO token-wrapper ABI entries. Use the fixed standalone BlueBundlesV1,
|
|
421
|
+
VaultBundlesV1, and VaultExitBundlesV1 actions for supported SDK workflows.
|
|
422
|
+
|
|
423
|
+
These low-level surfaces were not deprecated in a published v5 minor. Their removal is an
|
|
424
|
+
intentional one-time lifecycle deviation; integrations that still compose arbitrary Bundler3 calls
|
|
425
|
+
must stay on v5 or encode against the contracts independently.
|
|
371
426
|
|
|
372
427
|
## Vault V2 `forceWithdraw`
|
|
373
428
|
|
|
@@ -428,9 +483,8 @@ Migration steps:
|
|
|
428
483
|
`exitAssets`, `minSharePriceE27`, `referralFeePct`, `referralFeeRecipient`, and `deadline` are new.
|
|
429
484
|
- Stop batching exits: only one VaultExitBundlesV1 call can execute per transaction, because its
|
|
430
485
|
`initiator` guard is transient and never cleared.
|
|
431
|
-
- `InKindRedeemRequiresSingleAdapterError` and `UnsupportedInKindAdapterError`
|
|
432
|
-
|
|
433
|
-
working for both names.
|
|
486
|
+
- Replace `InKindRedeemRequiresSingleAdapterError` and `UnsupportedInKindAdapterError` with
|
|
487
|
+
`VaultV2SingleAdapterRequiredError` and `VaultV2UnsupportedExitAdapterError`.
|
|
434
488
|
|
|
435
489
|
See the [`TIB-2026-08-28-vault-exit-force-withdraw`](https://github.com/morpho-org/sdks/blob/main/docs/tibs/TIB-2026-08-28-vault-exit-force-withdraw.md)
|
|
436
490
|
decision record for the full rationale.
|
|
@@ -484,6 +538,8 @@ const transaction = withdrawal.buildTx(signatures);
|
|
|
484
538
|
Stay on v5 if you need vault deposits or withdrawals on a chain without VaultBundlesV1.
|
|
485
539
|
- Update every Blue write call using the table above; method names remain stable.
|
|
486
540
|
- Remove Blue slippage and PublicAllocator V1 write inputs.
|
|
541
|
+
- Replace deprecated facade, error, and upstream aliases with their canonical exports.
|
|
542
|
+
- Remove low-level Bundler3 composers, migration-adapter ABIs, and legacy MORPHO wrapping imports.
|
|
487
543
|
- Re-run approval and Morpho-authorization setup against the new spender/operator.
|
|
488
544
|
- Update transaction decoding, simulation fixtures, and action metadata fields; the `type`
|
|
489
545
|
discriminators remain stable, including `"vaultV2ForceWithdraw"`.
|
|
@@ -508,7 +564,7 @@ BlueBundlesV1 and VaultBundlesV1.
|
|
|
508
564
|
| `isPermit2TransferFromSignature` | `isPermit2SignatureTransferSignature` |
|
|
509
565
|
| `selectRequirementSignatures` option and result field `permit2TransferFrom` | `permit2SignatureTransfer` |
|
|
510
566
|
| `MissingPermit2TransferFromNonceError` | Removed — the nonce is resolved automatically; catch `NoUnusedPermit2NonceError` only if every nonce is consumed |
|
|
511
|
-
| `Permit2TransferFromNonceAlreadyUsedError` | `Permit2SignatureTransferNonceAlreadyUsedError`
|
|
567
|
+
| `Permit2TransferFromNonceAlreadyUsedError` | `Permit2SignatureTransferNonceAlreadyUsedError` |
|
|
512
568
|
|
|
513
569
|
Update call sites and `switch`/discriminated-union checks on `action.type` to the new
|
|
514
570
|
`"permit2SignatureTransfer"` tag; the signed payload shape (`nonce`, `deadline`, `signature`) is
|
package/README.md
CHANGED
|
@@ -9,11 +9,14 @@
|
|
|
9
9
|
|
|
10
10
|
Build transactions for Morpho's **VaultV1** (MetaMorpho), **VaultV2**, **Blue**, and **Midnight** fixed-rate markets on chains with the required protocol and periphery deployments. Custom deployments can be added with `registerCustomAddresses` from `@morpho-org/morpho-sdk/addresses`.
|
|
11
11
|
|
|
12
|
-
##
|
|
12
|
+
## Removed in v6
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
Vault V1 PublicAllocator APIs, low-level Bundler3 composition, migration adapters, and legacy
|
|
15
|
+
MORPHO wrapping were removed. Use Vault V2 BluePublicAllocator APIs:
|
|
16
|
+
`getVaultV2BlueReallocationData()` fetches the state and `getVaultV2BlueReallocations()` prepares a
|
|
17
|
+
plan for a Blue action.
|
|
15
18
|
|
|
16
|
-
|
|
19
|
+
General Vault V1 operations remain supported.
|
|
17
20
|
|
|
18
21
|
## Installation
|
|
19
22
|
|
|
@@ -218,13 +221,12 @@ borrowing. That path may also require Morpho authorization for BlueBundlesV1. Op
|
|
|
218
221
|
instant liquidation. Blue writes do not accept `slippageTolerance`, `minSharePrice`, or
|
|
219
222
|
`maxSharePrice` because BlueBundlesV1 has no share-price-bound inputs.
|
|
220
223
|
|
|
221
|
-
> High-level Blue writes
|
|
222
|
-
> low-level
|
|
223
|
-
> will be removed in the next major.
|
|
224
|
+
> High-level Blue writes and shared-liquidity planning use Vault V2 only. Vault V1 allocator and
|
|
225
|
+
> low-level composition surfaces were removed in v6; direct Vault V1 flows remain.
|
|
224
226
|
|
|
225
227
|
### Midnight: take a fixed-rate offer
|
|
226
228
|
|
|
227
|
-
Protocol-specific names are qualified in shared facades, for example `fetchBluePosition` and `fetchMidnightPosition` from `@morpho-org/morpho-sdk/fetch`.
|
|
229
|
+
Protocol-specific names are qualified in shared facades, for example `fetchBluePosition` and `fetchMidnightPosition` from `@morpho-org/morpho-sdk/fetch`. Canonical raw upstream names remain available under `/blue/{abis,addresses,constants,entities,errors,fetch,types,utils}` and `/midnight/{abis,constants,entities,errors,fetch,types,utils}`.
|
|
228
230
|
|
|
229
231
|
```typescript
|
|
230
232
|
const midnight = client.morpho.midnight(8453);
|