@morpho-org/morpho-sdk 6.0.0-next.0 → 6.0.0-next.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/MIGRATION-v5-to-v6.md +329 -15
- package/README.md +93 -47
- package/lib/cjs/abis.d.ts +227 -2
- package/lib/cjs/abis.js +156 -3
- package/lib/cjs/actions/blue/borrow.d.ts +1 -1
- package/lib/cjs/actions/blue/borrow.js +1 -1
- package/lib/cjs/actions/blue/common.d.ts +6 -19
- package/lib/cjs/actions/blue/common.js +28 -162
- package/lib/cjs/actions/blue/refinance.d.ts +1 -1
- package/lib/cjs/actions/blue/refinance.js +1 -1
- package/lib/cjs/actions/blue/repay.d.ts +3 -3
- package/lib/cjs/actions/blue/repay.js +1 -1
- package/lib/cjs/actions/blue/repayWithdrawCollateral.d.ts +3 -3
- package/lib/cjs/actions/blue/repayWithdrawCollateral.js +1 -1
- package/lib/cjs/actions/blue/supply.d.ts +3 -3
- package/lib/cjs/actions/blue/supply.js +3 -8
- package/lib/cjs/actions/blue/supplyCollateral.d.ts +3 -3
- package/lib/cjs/actions/blue/supplyCollateral.js +1 -1
- package/lib/cjs/actions/blue/supplyCollateralBorrow.d.ts +3 -3
- package/lib/cjs/actions/blue/supplyCollateralBorrow.js +1 -1
- package/lib/cjs/actions/blue/withdraw.d.ts +1 -1
- package/lib/cjs/actions/blue/withdraw.js +1 -1
- package/lib/cjs/actions/blue/withdrawCollateral.d.ts +1 -1
- package/lib/cjs/actions/blue/withdrawCollateral.js +1 -1
- package/lib/cjs/actions/bundles/common.d.ts +230 -0
- package/lib/cjs/actions/bundles/common.js +507 -0
- package/lib/cjs/actions/bundles/index.d.ts +3 -0
- package/lib/cjs/actions/bundles/index.js +23 -0
- package/lib/cjs/actions/bundles/resolveBundlesTokenRequirements.d.ts +76 -0
- package/lib/cjs/actions/bundles/resolveBundlesTokenRequirements.js +125 -0
- package/lib/cjs/actions/index.d.ts +1 -0
- package/lib/cjs/actions/index.js +1 -0
- package/lib/cjs/actions/midnight/supplyCollateralTakeBorrow.d.ts +2 -2
- package/lib/cjs/actions/midnight/supplyCollateralTakeBorrow.js +2 -2
- package/lib/cjs/actions/midnight/takeBorrow.d.ts +2 -2
- package/lib/cjs/actions/midnight/takeBorrow.js +2 -2
- package/lib/cjs/actions/midnight/takeLend.d.ts +2 -2
- package/lib/cjs/actions/midnight/takeLend.js +2 -2
- package/lib/cjs/actions/requirements/blue/getBlueAuthorizationRequirement.d.ts +3 -0
- package/lib/cjs/actions/requirements/blue/getBlueAuthorizationRequirement.js +6 -10
- package/lib/cjs/actions/requirements/blue/index.d.ts +0 -2
- package/lib/cjs/actions/requirements/blue/index.js +0 -2
- package/lib/cjs/actions/requirements/encode/encodeBlueSignatureAuthorization.d.ts +15 -8
- package/lib/cjs/actions/requirements/encode/encodeBlueSignatureAuthorization.js +21 -21
- package/lib/cjs/actions/requirements/encode/encodeErc20Approval.d.ts +1 -1
- package/lib/cjs/actions/requirements/encode/encodeErc20Approval.js +2 -1
- package/lib/cjs/actions/requirements/encode/encodeErc20Permit.d.ts +19 -10
- package/lib/cjs/actions/requirements/encode/encodeErc20Permit.js +43 -31
- package/lib/cjs/actions/requirements/encode/encodeErc20Permit2Approve.d.ts +4 -2
- package/lib/cjs/actions/requirements/encode/encodeErc20Permit2Approve.js +15 -10
- package/lib/{esm/actions/requirements/encode/encodeErc20Permit2TransferFrom.d.ts → cjs/actions/requirements/encode/encodeErc20Permit2SignatureTransfer.d.ts} +16 -14
- package/lib/cjs/actions/requirements/encode/{encodeErc20Permit2TransferFrom.js → encodeErc20Permit2SignatureTransfer.js} +27 -22
- package/lib/cjs/actions/requirements/encode/encodeVaultSharesPermit.d.ts +12 -9
- package/lib/cjs/actions/requirements/encode/encodeVaultSharesPermit.js +27 -21
- package/lib/cjs/actions/requirements/encode/index.d.ts +1 -1
- package/lib/cjs/actions/requirements/encode/index.js +1 -1
- package/lib/cjs/actions/requirements/generalAdapter/getGeneralAdapterRequirements.js +1 -0
- package/lib/cjs/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit.d.ts +4 -1
- package/lib/cjs/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit.js +5 -2
- package/lib/cjs/actions/requirements/getRequirementsApproval.d.ts +4 -3
- package/lib/cjs/actions/requirements/getRequirementsApproval.js +4 -3
- package/lib/cjs/actions/signatures/getTokenRequirementActions.js +2 -2
- package/lib/cjs/actions/signatures/getVaultExitBundlesV1PermitStruct.d.ts +28 -30
- package/lib/cjs/actions/signatures/getVaultExitBundlesV1PermitStruct.js +20 -66
- package/lib/cjs/actions/vaultV1/deposit.d.ts +73 -57
- package/lib/cjs/actions/vaultV1/deposit.js +110 -109
- package/lib/cjs/actions/vaultV1/inKindRedeem.d.ts +1 -0
- package/lib/cjs/actions/vaultV1/inKindRedeem.js +3 -2
- package/lib/cjs/actions/vaultV1/migrateToV2.d.ts +43 -66
- package/lib/cjs/actions/vaultV1/migrateToV2.js +91 -104
- package/lib/cjs/actions/vaultV1/redeem.d.ts +30 -23
- package/lib/cjs/actions/vaultV1/redeem.js +56 -33
- package/lib/cjs/actions/vaultV1/withdraw.d.ts +58 -24
- package/lib/cjs/actions/vaultV1/withdraw.js +86 -34
- package/lib/cjs/actions/vaultV2/deposit.d.ts +74 -57
- package/lib/cjs/actions/vaultV2/deposit.js +111 -109
- package/lib/cjs/actions/vaultV2/forceWithdraw.d.ts +58 -39
- package/lib/cjs/actions/vaultV2/forceWithdraw.js +87 -60
- package/lib/cjs/actions/vaultV2/inKindRedeem.d.ts +1 -0
- package/lib/cjs/actions/vaultV2/inKindRedeem.js +3 -2
- package/lib/cjs/actions/vaultV2/redeem.d.ts +30 -24
- package/lib/cjs/actions/vaultV2/redeem.js +56 -34
- package/lib/cjs/actions/vaultV2/withdraw.d.ts +58 -25
- package/lib/cjs/actions/vaultV2/withdraw.js +86 -35
- package/lib/cjs/augment/VaultMarketPublicAllocatorConfig.d.ts +4 -1
- package/lib/cjs/blue/abis.d.ts +5 -1
- package/lib/cjs/blue/abis.js +2 -0
- package/lib/cjs/blue/entities.d.ts +8 -2
- package/lib/cjs/blue/entities.js +1 -0
- package/lib/cjs/blue/errors.d.ts +1 -1
- package/lib/cjs/blue/errors.js +2 -1
- package/lib/cjs/blue/fetch.d.ts +3 -1
- package/lib/cjs/blue/fetch.js +1 -0
- package/lib/cjs/entities/blue/blue.d.ts +29 -20
- package/lib/cjs/entities/blue/blue.js +6 -1
- package/lib/cjs/entities/index.d.ts +9 -2
- package/lib/cjs/entities/index.js +16 -0
- package/lib/cjs/entities/midnight/midnight.d.ts +2 -2
- package/lib/cjs/entities/midnight/midnight.js +20 -24
- package/lib/cjs/{actions/requirements/blue/getBlueBundlesV1TokenRequirements.d.ts → entities/requirements/getBundlesTokenRequirements.d.ts} +27 -19
- package/lib/cjs/{actions/requirements/blue/getBlueBundlesV1TokenRequirements.js → entities/requirements/getBundlesTokenRequirements.js} +76 -75
- package/lib/{esm/actions/requirements/blue → cjs/entities/requirements}/getUnusedPermit2Nonce.d.ts +1 -1
- package/lib/cjs/{actions/requirements/blue → entities/requirements}/getUnusedPermit2Nonce.js +4 -4
- package/lib/cjs/entities/requirements/getVaultBundlesSharesRequirements.d.ts +28 -0
- package/lib/cjs/entities/requirements/getVaultBundlesSharesRequirements.js +74 -0
- package/lib/cjs/entities/requirements/index.d.ts +2 -0
- package/lib/cjs/entities/requirements/index.js +18 -0
- package/lib/cjs/entities/vaultV1/vaultV1.d.ts +356 -101
- package/lib/cjs/entities/vaultV1/vaultV1.js +334 -120
- package/lib/cjs/entities/vaultV1ReallocationData.d.ts +6 -0
- package/lib/cjs/entities/vaultV1ReallocationData.js +20 -5
- package/lib/cjs/entities/vaultV2/vaultV2.d.ts +359 -100
- package/lib/cjs/entities/vaultV2/vaultV2.js +448 -93
- package/lib/cjs/entities/vaultV2BlueReallocationData.d.ts +8 -1
- package/lib/cjs/entities/vaultV2BlueReallocationData.js +46 -13
- package/lib/cjs/errors.d.ts +1 -1
- package/lib/cjs/errors.js +3 -2
- package/lib/cjs/fetch.d.ts +3 -1
- package/lib/cjs/fetch.js +1 -0
- package/lib/cjs/helpers/computeVaultV1Reallocations.d.ts +2 -0
- package/lib/cjs/helpers/computeVaultV1Reallocations.js +2 -0
- package/lib/cjs/helpers/index.d.ts +4 -1
- package/lib/cjs/helpers/index.js +14 -1
- package/lib/cjs/helpers/metadata.d.ts +3 -5
- package/lib/cjs/helpers/metadata.js +4 -6
- package/lib/cjs/helpers/previewVaultV2ForceWithdraw.d.ts +107 -0
- package/lib/cjs/helpers/previewVaultV2ForceWithdraw.js +164 -0
- package/lib/cjs/helpers/previewVaultV2InKindRedeem.d.ts +1 -0
- package/lib/cjs/helpers/previewVaultV2InKindRedeem.js +2 -0
- package/lib/cjs/helpers/referralFee.d.ts +21 -0
- package/lib/cjs/helpers/referralFee.js +35 -0
- package/lib/cjs/helpers/slippage.d.ts +136 -1
- package/lib/cjs/helpers/slippage.js +188 -0
- package/lib/cjs/helpers/validate.d.ts +67 -8
- package/lib/cjs/helpers/validate.js +94 -9
- package/lib/cjs/helpers/validateRequirementSpender.d.ts +1 -1
- package/lib/cjs/helpers/validateRequirementSpender.js +1 -0
- package/lib/cjs/helpers/vaultV2ForceWithdrawPlan.d.ts +274 -0
- package/lib/cjs/helpers/vaultV2ForceWithdrawPlan.js +369 -0
- package/lib/cjs/index.d.ts +1 -0
- package/lib/cjs/index.js +1 -0
- package/lib/cjs/types/action.d.ts +273 -82
- package/lib/cjs/types/action.js +12 -12
- package/lib/cjs/types/error.d.ts +349 -23
- package/lib/cjs/types/error.js +393 -39
- package/lib/cjs/types/sharedLiquidity.d.ts +2 -2
- package/lib/cjs/utils.d.ts +3 -1
- package/lib/cjs/utils.js +10 -1
- package/lib/esm/abis.d.ts +227 -2
- package/lib/esm/abis.js +157 -2
- package/lib/esm/actions/blue/borrow.d.ts +1 -1
- package/lib/esm/actions/blue/borrow.js +1 -1
- package/lib/esm/actions/blue/common.d.ts +6 -19
- package/lib/esm/actions/blue/common.js +30 -164
- package/lib/esm/actions/blue/refinance.d.ts +1 -1
- package/lib/esm/actions/blue/refinance.js +1 -1
- package/lib/esm/actions/blue/repay.d.ts +3 -3
- package/lib/esm/actions/blue/repay.js +1 -1
- package/lib/esm/actions/blue/repayWithdrawCollateral.d.ts +3 -3
- package/lib/esm/actions/blue/repayWithdrawCollateral.js +1 -1
- package/lib/esm/actions/blue/supply.d.ts +3 -3
- package/lib/esm/actions/blue/supply.js +5 -10
- package/lib/esm/actions/blue/supplyCollateral.d.ts +3 -3
- package/lib/esm/actions/blue/supplyCollateral.js +1 -1
- package/lib/esm/actions/blue/supplyCollateralBorrow.d.ts +3 -3
- package/lib/esm/actions/blue/supplyCollateralBorrow.js +1 -1
- package/lib/esm/actions/blue/withdraw.d.ts +1 -1
- package/lib/esm/actions/blue/withdraw.js +1 -1
- package/lib/esm/actions/blue/withdrawCollateral.d.ts +1 -1
- package/lib/esm/actions/blue/withdrawCollateral.js +1 -1
- package/lib/esm/actions/bundles/common.d.ts +230 -0
- package/lib/esm/actions/bundles/common.js +494 -0
- package/lib/esm/actions/bundles/index.d.ts +3 -0
- package/lib/esm/actions/bundles/index.js +2 -0
- package/lib/esm/actions/bundles/resolveBundlesTokenRequirements.d.ts +76 -0
- package/lib/esm/actions/bundles/resolveBundlesTokenRequirements.js +121 -0
- package/lib/esm/actions/index.d.ts +1 -0
- package/lib/esm/actions/index.js +1 -0
- package/lib/esm/actions/midnight/supplyCollateralTakeBorrow.d.ts +2 -2
- package/lib/esm/actions/midnight/supplyCollateralTakeBorrow.js +2 -2
- package/lib/esm/actions/midnight/takeBorrow.d.ts +2 -2
- package/lib/esm/actions/midnight/takeBorrow.js +2 -2
- package/lib/esm/actions/midnight/takeLend.d.ts +2 -2
- package/lib/esm/actions/midnight/takeLend.js +2 -2
- package/lib/esm/actions/requirements/blue/getBlueAuthorizationRequirement.d.ts +3 -0
- package/lib/esm/actions/requirements/blue/getBlueAuthorizationRequirement.js +8 -12
- package/lib/esm/actions/requirements/blue/index.d.ts +0 -2
- package/lib/esm/actions/requirements/blue/index.js +0 -2
- package/lib/esm/actions/requirements/encode/encodeBlueSignatureAuthorization.d.ts +15 -8
- package/lib/esm/actions/requirements/encode/encodeBlueSignatureAuthorization.js +22 -22
- package/lib/esm/actions/requirements/encode/encodeErc20Approval.d.ts +1 -1
- package/lib/esm/actions/requirements/encode/encodeErc20Approval.js +2 -1
- package/lib/esm/actions/requirements/encode/encodeErc20Permit.d.ts +19 -10
- package/lib/esm/actions/requirements/encode/encodeErc20Permit.js +44 -32
- package/lib/esm/actions/requirements/encode/encodeErc20Permit2Approve.d.ts +4 -2
- package/lib/esm/actions/requirements/encode/encodeErc20Permit2Approve.js +15 -10
- package/lib/{cjs/actions/requirements/encode/encodeErc20Permit2TransferFrom.d.ts → esm/actions/requirements/encode/encodeErc20Permit2SignatureTransfer.d.ts} +16 -14
- package/lib/esm/actions/requirements/encode/{encodeErc20Permit2TransferFrom.js → encodeErc20Permit2SignatureTransfer.js} +25 -20
- package/lib/esm/actions/requirements/encode/encodeVaultSharesPermit.d.ts +12 -9
- package/lib/esm/actions/requirements/encode/encodeVaultSharesPermit.js +27 -21
- package/lib/esm/actions/requirements/encode/index.d.ts +1 -1
- package/lib/esm/actions/requirements/encode/index.js +1 -1
- package/lib/esm/actions/requirements/generalAdapter/getGeneralAdapterRequirements.js +1 -0
- package/lib/esm/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit.d.ts +4 -1
- package/lib/esm/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit.js +5 -2
- package/lib/esm/actions/requirements/getRequirementsApproval.d.ts +4 -3
- package/lib/esm/actions/requirements/getRequirementsApproval.js +4 -3
- package/lib/esm/actions/signatures/getTokenRequirementActions.js +3 -3
- package/lib/esm/actions/signatures/getVaultExitBundlesV1PermitStruct.d.ts +28 -30
- package/lib/esm/actions/signatures/getVaultExitBundlesV1PermitStruct.js +21 -67
- package/lib/esm/actions/vaultV1/deposit.d.ts +73 -57
- package/lib/esm/actions/vaultV1/deposit.js +112 -111
- package/lib/esm/actions/vaultV1/inKindRedeem.d.ts +1 -0
- package/lib/esm/actions/vaultV1/inKindRedeem.js +3 -2
- package/lib/esm/actions/vaultV1/migrateToV2.d.ts +43 -66
- package/lib/esm/actions/vaultV1/migrateToV2.js +93 -106
- package/lib/esm/actions/vaultV1/redeem.d.ts +30 -23
- package/lib/esm/actions/vaultV1/redeem.js +56 -33
- package/lib/esm/actions/vaultV1/withdraw.d.ts +58 -24
- package/lib/esm/actions/vaultV1/withdraw.js +86 -34
- package/lib/esm/actions/vaultV2/deposit.d.ts +74 -57
- package/lib/esm/actions/vaultV2/deposit.js +113 -111
- package/lib/esm/actions/vaultV2/forceWithdraw.d.ts +58 -39
- package/lib/esm/actions/vaultV2/forceWithdraw.js +89 -62
- package/lib/esm/actions/vaultV2/inKindRedeem.d.ts +1 -0
- package/lib/esm/actions/vaultV2/inKindRedeem.js +3 -2
- package/lib/esm/actions/vaultV2/redeem.d.ts +30 -24
- package/lib/esm/actions/vaultV2/redeem.js +56 -34
- package/lib/esm/actions/vaultV2/withdraw.d.ts +58 -25
- package/lib/esm/actions/vaultV2/withdraw.js +86 -35
- package/lib/esm/augment/VaultMarketPublicAllocatorConfig.d.ts +4 -1
- package/lib/esm/augment/VaultMarketPublicAllocatorConfig.js +3 -1
- package/lib/esm/blue/abis.d.ts +5 -1
- package/lib/esm/blue/abis.js +5 -1
- package/lib/esm/blue/entities.d.ts +8 -2
- package/lib/esm/blue/entities.js +3 -1
- package/lib/esm/blue/errors.d.ts +1 -1
- package/lib/esm/blue/errors.js +1 -1
- package/lib/esm/blue/fetch.d.ts +3 -1
- package/lib/esm/blue/fetch.js +3 -1
- package/lib/esm/entities/blue/blue.d.ts +29 -20
- package/lib/esm/entities/blue/blue.js +7 -2
- package/lib/esm/entities/index.d.ts +9 -2
- package/lib/esm/entities/index.js +4 -1
- package/lib/esm/entities/midnight/midnight.d.ts +2 -2
- package/lib/esm/entities/midnight/midnight.js +20 -24
- package/lib/esm/{actions/requirements/blue/getBlueBundlesV1TokenRequirements.d.ts → entities/requirements/getBundlesTokenRequirements.d.ts} +27 -19
- package/lib/esm/{actions/requirements/blue/getBlueBundlesV1TokenRequirements.js → entities/requirements/getBundlesTokenRequirements.js} +67 -66
- package/lib/{cjs/actions/requirements/blue → esm/entities/requirements}/getUnusedPermit2Nonce.d.ts +1 -1
- package/lib/esm/{actions/requirements/blue → entities/requirements}/getUnusedPermit2Nonce.js +4 -4
- package/lib/esm/entities/requirements/getVaultBundlesSharesRequirements.d.ts +28 -0
- package/lib/esm/entities/requirements/getVaultBundlesSharesRequirements.js +70 -0
- package/lib/esm/entities/requirements/index.d.ts +2 -0
- package/lib/esm/entities/requirements/index.js +2 -0
- package/lib/esm/entities/vaultV1/vaultV1.d.ts +356 -101
- package/lib/esm/entities/vaultV1/vaultV1.js +338 -124
- package/lib/esm/entities/vaultV1ReallocationData.d.ts +6 -0
- package/lib/esm/entities/vaultV1ReallocationData.js +20 -5
- package/lib/esm/entities/vaultV2/vaultV2.d.ts +359 -100
- package/lib/esm/entities/vaultV2/vaultV2.js +452 -97
- package/lib/esm/entities/vaultV2BlueReallocationData.d.ts +8 -1
- package/lib/esm/entities/vaultV2BlueReallocationData.js +46 -13
- package/lib/esm/errors.d.ts +1 -1
- package/lib/esm/errors.js +1 -1
- package/lib/esm/fetch.d.ts +3 -1
- package/lib/esm/fetch.js +3 -1
- package/lib/esm/helpers/computeVaultV1Reallocations.d.ts +2 -0
- package/lib/esm/helpers/computeVaultV1Reallocations.js +2 -0
- package/lib/esm/helpers/index.d.ts +4 -1
- package/lib/esm/helpers/index.js +4 -1
- package/lib/esm/helpers/metadata.d.ts +3 -5
- package/lib/esm/helpers/metadata.js +4 -6
- package/lib/esm/helpers/previewVaultV2ForceWithdraw.d.ts +107 -0
- package/lib/esm/helpers/previewVaultV2ForceWithdraw.js +161 -0
- package/lib/esm/helpers/previewVaultV2InKindRedeem.d.ts +1 -0
- package/lib/esm/helpers/previewVaultV2InKindRedeem.js +2 -0
- package/lib/esm/helpers/referralFee.d.ts +21 -0
- package/lib/esm/helpers/referralFee.js +31 -0
- package/lib/esm/helpers/slippage.d.ts +136 -1
- package/lib/esm/helpers/slippage.js +186 -2
- package/lib/esm/helpers/validate.d.ts +67 -8
- package/lib/esm/helpers/validate.js +92 -10
- package/lib/esm/helpers/validateRequirementSpender.d.ts +1 -1
- package/lib/esm/helpers/validateRequirementSpender.js +1 -0
- package/lib/esm/helpers/vaultV2ForceWithdrawPlan.d.ts +274 -0
- package/lib/esm/helpers/vaultV2ForceWithdrawPlan.js +362 -0
- package/lib/esm/index.d.ts +1 -0
- package/lib/esm/index.js +1 -0
- package/lib/esm/types/action.d.ts +273 -82
- package/lib/esm/types/action.js +11 -11
- package/lib/esm/types/error.d.ts +349 -23
- package/lib/esm/types/error.js +377 -31
- package/lib/esm/types/sharedLiquidity.d.ts +2 -2
- package/lib/esm/utils.d.ts +3 -1
- package/lib/esm/utils.js +3 -1
- package/package.json +7 -7
|
@@ -1,40 +1,73 @@
|
|
|
1
1
|
import { type Address } from "viem";
|
|
2
|
-
import { type Metadata, type Transaction, type VaultV2WithdrawAction } from "../../types/index.js";
|
|
2
|
+
import { type Erc2612RequirementSignature, type Metadata, type Transaction, type VaultV2WithdrawAction } from "../../types/index.js";
|
|
3
3
|
/** Parameters for {@link vaultV2Withdraw}. */
|
|
4
4
|
export interface VaultV2WithdrawParams {
|
|
5
|
-
vault: {
|
|
6
|
-
|
|
5
|
+
readonly vault: {
|
|
6
|
+
readonly chainId: number;
|
|
7
|
+
readonly address: Address;
|
|
7
8
|
};
|
|
8
|
-
args: {
|
|
9
|
-
amount: bigint;
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
readonly args: {
|
|
10
|
+
readonly amount: bigint;
|
|
11
|
+
readonly userAddress: Address;
|
|
12
|
+
readonly recipient?: never;
|
|
13
|
+
readonly onBehalf?: never;
|
|
14
|
+
readonly requirementSignature?: Erc2612RequirementSignature;
|
|
15
|
+
readonly referralFeePct?: bigint;
|
|
16
|
+
readonly referralFeeRecipient?: Address;
|
|
17
|
+
readonly deadline: bigint;
|
|
12
18
|
};
|
|
13
|
-
metadata?: Metadata;
|
|
19
|
+
readonly metadata?: Metadata;
|
|
14
20
|
}
|
|
15
21
|
/**
|
|
16
|
-
*
|
|
22
|
+
* Encodes an exact-assets Vault V2 withdrawal through VaultBundlesV1.
|
|
17
23
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
24
|
+
* This low-level builder does not bind `permit.value` to a share cap; use
|
|
25
|
+
* `MorphoVaultV2.withdraw().buildTx()` to validate it against the cap from `getRequirements()`.
|
|
20
26
|
*
|
|
21
|
-
* @param params.vault.
|
|
22
|
-
* @param params.
|
|
23
|
-
* @param params.args.
|
|
24
|
-
* @param params.args.
|
|
25
|
-
* @param params.
|
|
26
|
-
* @
|
|
27
|
-
*
|
|
28
|
-
*
|
|
27
|
+
* @param params.vault.chainId - Chain containing the vault and its registered VaultBundlesV1 contract.
|
|
28
|
+
* @param params.vault.address - Vault V2 whose shares are burned for the withdrawal.
|
|
29
|
+
* @param params.args.amount - Positive gross withdrawal in underlying asset base units, before fees.
|
|
30
|
+
* @param params.args.userAddress - Share owner and transaction sender; receives the net withdrawn assets.
|
|
31
|
+
* @param params.args.recipient - Unsupported; net assets are always paid to the transaction sender.
|
|
32
|
+
* @param params.args.onBehalf - Unsupported; VaultBundlesV1 always burns the transaction sender's shares.
|
|
33
|
+
* @param params.args.requirementSignature - Optional ERC-2612 vault-share permit for `userAddress`
|
|
34
|
+
* and the registered VaultBundlesV1 spender. Omit when the exact share allowance is already set.
|
|
35
|
+
* @param params.args.referralFeePct - Optional WAD-scaled fee in [0, 1e18), defaulting to zero.
|
|
36
|
+
* The fee is rounded down and deducted from the gross withdrawn assets.
|
|
37
|
+
* @param params.args.referralFeeRecipient - Optional fee recipient; a nonzero address is required
|
|
38
|
+
* when `referralFeePct > 0n`.
|
|
39
|
+
* @param params.args.deadline - Required positive uint256 Unix timestamp in seconds after which
|
|
40
|
+
* execution reverts. This pure builder does not check the current time.
|
|
41
|
+
* @param params.metadata - Optional analytics metadata appended to the transaction calldata.
|
|
42
|
+
* @param params.metadata.origin - Hex origin identifier of at most four bytes, with an optional `0x` prefix.
|
|
43
|
+
* @param params.metadata.timestamp - Optional flag to append the current timestamp; defaults to false.
|
|
44
|
+
* @returns A deep-frozen `Transaction<VaultV2WithdrawAction>` targeting VaultBundlesV1, with
|
|
45
|
+
* `to`, `value: 0n`, `data`, and gross/fee/net withdrawal action metadata.
|
|
46
|
+
* @throws {NonPositiveInputError} when `amount` or `deadline` is not positive.
|
|
47
|
+
* @throws {InputExceedsMaxError} when `amount` or `deadline` exceeds uint256.
|
|
48
|
+
* @throws {NegativeInputError} when `referralFeePct` is negative.
|
|
49
|
+
* @throws {ReferralFeePctExceededError} when `referralFeePct` is at least WAD.
|
|
50
|
+
* @throws {ReferralFeeRecipientMissingError} when a positive referral fee has no nonzero recipient.
|
|
51
|
+
* @throws {UnsupportedChainIdError} when the chain is absent from the address registry.
|
|
52
|
+
* @throws {UnknownAddressError} when VaultBundlesV1 is not registered on the target chain.
|
|
53
|
+
* @throws {BundlesPermitMismatchError} when the optional share permit is incompatible.
|
|
54
|
+
* @throws {viem.BaseError} when transaction encoding fails.
|
|
29
55
|
* @example
|
|
30
56
|
* ```ts
|
|
31
57
|
* import { vaultV2Withdraw } from "@morpho-org/morpho-sdk";
|
|
58
|
+
* import type { Address } from "viem";
|
|
59
|
+
* import { mainnet } from "viem/chains";
|
|
32
60
|
*
|
|
33
|
-
*
|
|
34
|
-
* vault
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
61
|
+
* export function buildUsdcWithdrawal(userAddress: Address, deadline: bigint) {
|
|
62
|
+
* const vault = "0x04422053aDDbc9bB2759b248B574e3FCA76Bc145";
|
|
63
|
+
* // Set the exact vault-share allowance before submitting; the entity API derives that cap.
|
|
64
|
+
* const tx = vaultV2Withdraw({
|
|
65
|
+
* vault: { chainId: mainnet.id, address: vault },
|
|
66
|
+
* args: { amount: 1_000_000n, userAddress, deadline },
|
|
67
|
+
* });
|
|
68
|
+
* // tx satisfies Readonly<Transaction<VaultV2WithdrawAction>>
|
|
69
|
+
* return tx;
|
|
70
|
+
* }
|
|
38
71
|
* ```
|
|
39
72
|
*/
|
|
40
|
-
export declare const vaultV2Withdraw: (
|
|
73
|
+
export declare const vaultV2Withdraw: (params: VaultV2WithdrawParams) => Readonly<Transaction<VaultV2WithdrawAction>>;
|
|
@@ -1,58 +1,109 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.vaultV2Withdraw = 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
|
|
8
|
-
const
|
|
6
|
+
const abis_js_1 = require("../../abis.js");
|
|
7
|
+
const validate_js_1 = require("../../helpers/validate.js");
|
|
8
|
+
const index_js_1 = require("../../types/index.js");
|
|
9
|
+
const common_js_1 = require("../bundles/common.js");
|
|
9
10
|
/**
|
|
10
|
-
*
|
|
11
|
+
* Encodes an exact-assets Vault V2 withdrawal through VaultBundlesV1.
|
|
11
12
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
13
|
+
* This low-level builder does not bind `permit.value` to a share cap; use
|
|
14
|
+
* `MorphoVaultV2.withdraw().buildTx()` to validate it against the cap from `getRequirements()`.
|
|
14
15
|
*
|
|
15
|
-
* @param params.vault.
|
|
16
|
-
* @param params.
|
|
17
|
-
* @param params.args.
|
|
18
|
-
* @param params.args.
|
|
19
|
-
* @param params.
|
|
20
|
-
* @
|
|
21
|
-
*
|
|
22
|
-
*
|
|
16
|
+
* @param params.vault.chainId - Chain containing the vault and its registered VaultBundlesV1 contract.
|
|
17
|
+
* @param params.vault.address - Vault V2 whose shares are burned for the withdrawal.
|
|
18
|
+
* @param params.args.amount - Positive gross withdrawal in underlying asset base units, before fees.
|
|
19
|
+
* @param params.args.userAddress - Share owner and transaction sender; receives the net withdrawn assets.
|
|
20
|
+
* @param params.args.recipient - Unsupported; net assets are always paid to the transaction sender.
|
|
21
|
+
* @param params.args.onBehalf - Unsupported; VaultBundlesV1 always burns the transaction sender's shares.
|
|
22
|
+
* @param params.args.requirementSignature - Optional ERC-2612 vault-share permit for `userAddress`
|
|
23
|
+
* and the registered VaultBundlesV1 spender. Omit when the exact share allowance is already set.
|
|
24
|
+
* @param params.args.referralFeePct - Optional WAD-scaled fee in [0, 1e18), defaulting to zero.
|
|
25
|
+
* The fee is rounded down and deducted from the gross withdrawn assets.
|
|
26
|
+
* @param params.args.referralFeeRecipient - Optional fee recipient; a nonzero address is required
|
|
27
|
+
* when `referralFeePct > 0n`.
|
|
28
|
+
* @param params.args.deadline - Required positive uint256 Unix timestamp in seconds after which
|
|
29
|
+
* execution reverts. This pure builder does not check the current time.
|
|
30
|
+
* @param params.metadata - Optional analytics metadata appended to the transaction calldata.
|
|
31
|
+
* @param params.metadata.origin - Hex origin identifier of at most four bytes, with an optional `0x` prefix.
|
|
32
|
+
* @param params.metadata.timestamp - Optional flag to append the current timestamp; defaults to false.
|
|
33
|
+
* @returns A deep-frozen `Transaction<VaultV2WithdrawAction>` targeting VaultBundlesV1, with
|
|
34
|
+
* `to`, `value: 0n`, `data`, and gross/fee/net withdrawal action metadata.
|
|
35
|
+
* @throws {NonPositiveInputError} when `amount` or `deadline` is not positive.
|
|
36
|
+
* @throws {InputExceedsMaxError} when `amount` or `deadline` exceeds uint256.
|
|
37
|
+
* @throws {NegativeInputError} when `referralFeePct` is negative.
|
|
38
|
+
* @throws {ReferralFeePctExceededError} when `referralFeePct` is at least WAD.
|
|
39
|
+
* @throws {ReferralFeeRecipientMissingError} when a positive referral fee has no nonzero recipient.
|
|
40
|
+
* @throws {UnsupportedChainIdError} when the chain is absent from the address registry.
|
|
41
|
+
* @throws {UnknownAddressError} when VaultBundlesV1 is not registered on the target chain.
|
|
42
|
+
* @throws {BundlesPermitMismatchError} when the optional share permit is incompatible.
|
|
43
|
+
* @throws {viem.BaseError} when transaction encoding fails.
|
|
23
44
|
* @example
|
|
24
45
|
* ```ts
|
|
25
46
|
* import { vaultV2Withdraw } from "@morpho-org/morpho-sdk";
|
|
47
|
+
* import type { Address } from "viem";
|
|
48
|
+
* import { mainnet } from "viem/chains";
|
|
26
49
|
*
|
|
27
|
-
*
|
|
28
|
-
* vault
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
50
|
+
* export function buildUsdcWithdrawal(userAddress: Address, deadline: bigint) {
|
|
51
|
+
* const vault = "0x04422053aDDbc9bB2759b248B574e3FCA76Bc145";
|
|
52
|
+
* // Set the exact vault-share allowance before submitting; the entity API derives that cap.
|
|
53
|
+
* const tx = vaultV2Withdraw({
|
|
54
|
+
* vault: { chainId: mainnet.id, address: vault },
|
|
55
|
+
* args: { amount: 1_000_000n, userAddress, deadline },
|
|
56
|
+
* });
|
|
57
|
+
* // tx satisfies Readonly<Transaction<VaultV2WithdrawAction>>
|
|
58
|
+
* return tx;
|
|
59
|
+
* }
|
|
32
60
|
* ```
|
|
33
61
|
*/
|
|
34
|
-
const vaultV2Withdraw = (
|
|
35
|
-
if (amount <= 0n) {
|
|
36
|
-
throw new
|
|
62
|
+
const vaultV2Withdraw = (params) => {
|
|
63
|
+
if (params.args.amount <= 0n) {
|
|
64
|
+
throw new index_js_1.NonPositiveInputError("amount", params.args.amount);
|
|
37
65
|
}
|
|
38
|
-
|
|
39
|
-
|
|
66
|
+
// Validate the ABI bound before encoding to preserve the SDK's typed errors.
|
|
67
|
+
(0, validate_js_1.validateUint256Field)("amount", params.args.amount);
|
|
68
|
+
const common = (0, common_js_1.normalizeBundlesCommonParams)(params.args);
|
|
69
|
+
const spender = (0, morpho_ts_1.getChainAddress)(params.vault.chainId, "bundles.vaultBundlesV1");
|
|
70
|
+
const sharesPermit = (0, common_js_1.getBundlesSharesPermit)({
|
|
71
|
+
vault: params.vault.address,
|
|
72
|
+
deadline: common.deadline,
|
|
73
|
+
owner: params.args.userAddress,
|
|
74
|
+
spender,
|
|
75
|
+
requirementSignature: params.args.requirementSignature,
|
|
76
|
+
});
|
|
77
|
+
const referralFeeAssets = (0, common_js_1.getBundlesReferralFeeAssets)(params.args.amount, common.referralFeePct);
|
|
78
|
+
return (0, common_js_1.finalizeVaultBundlesV1Transaction)({
|
|
79
|
+
chainId: params.vault.chainId,
|
|
80
|
+
value: 0n,
|
|
40
81
|
data: (0, viem_1.encodeFunctionData)({
|
|
41
|
-
abi:
|
|
42
|
-
functionName: "
|
|
43
|
-
args: [
|
|
82
|
+
abi: abis_js_1.vaultBundlesV1Abi,
|
|
83
|
+
functionName: "vaultBundlesV1Withdraw",
|
|
84
|
+
args: [
|
|
85
|
+
params.vault.address,
|
|
86
|
+
params.args.amount,
|
|
87
|
+
0n,
|
|
88
|
+
sharesPermit,
|
|
89
|
+
common.referralFeePct,
|
|
90
|
+
common.referralFeeRecipient,
|
|
91
|
+
common.deadline,
|
|
92
|
+
],
|
|
44
93
|
}),
|
|
45
|
-
value: 0n,
|
|
46
|
-
};
|
|
47
|
-
if (metadata) {
|
|
48
|
-
tx = (0, index_js_1.addTransactionMetadata)(tx, metadata);
|
|
49
|
-
}
|
|
50
|
-
return (0, morpho_ts_1.deepFreeze)({
|
|
51
|
-
...tx,
|
|
52
94
|
action: {
|
|
53
95
|
type: "vaultV2Withdraw",
|
|
54
|
-
args: {
|
|
96
|
+
args: {
|
|
97
|
+
vault: params.vault.address,
|
|
98
|
+
amount: params.args.amount,
|
|
99
|
+
referralFeePct: common.referralFeePct,
|
|
100
|
+
referralFeeRecipient: common.referralFeeRecipient,
|
|
101
|
+
referralFeeAssets,
|
|
102
|
+
netAssets: params.args.amount - referralFeeAssets,
|
|
103
|
+
deadline: common.deadline,
|
|
104
|
+
},
|
|
55
105
|
},
|
|
106
|
+
metadata: params.metadata,
|
|
56
107
|
});
|
|
57
108
|
};
|
|
58
109
|
exports.vaultV2Withdraw = vaultV2Withdraw;
|
|
@@ -2,7 +2,10 @@ import { VaultMarketPublicAllocatorConfig as BlueVaultMarketPublicAllocatorConfi
|
|
|
2
2
|
import { fetchVaultMarketPublicAllocatorConfig } from "@morpho-org/blue-sdk-viem";
|
|
3
3
|
declare module "@morpho-org/blue-sdk" {
|
|
4
4
|
namespace VaultMarketPublicAllocatorConfig {
|
|
5
|
+
/** @deprecated Vault V1 PublicAllocator support will be removed in the next major. Use `fetchVaultV2BlueMarketPublicAllocatorConfig` from `@morpho-org/morpho-sdk/fetch`. */
|
|
5
6
|
let fetch: typeof fetchVaultMarketPublicAllocatorConfig;
|
|
6
7
|
}
|
|
7
8
|
}
|
|
8
|
-
export {
|
|
9
|
+
export {
|
|
10
|
+
/** @deprecated Vault V1 PublicAllocator support will be removed in the next major. Use `VaultV2BlueMarketPublicAllocatorConfig` from `@morpho-org/morpho-sdk/entities`. */
|
|
11
|
+
BlueVaultMarketPublicAllocatorConfig as VaultMarketPublicAllocatorConfig, };
|
package/lib/cjs/blue/abis.d.ts
CHANGED
|
@@ -1,2 +1,6 @@
|
|
|
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,
|
|
3
|
+
/** @deprecated Vault V1 PublicAllocator support will be removed in the next major. Use `vaultV2BluePublicAllocatorAbi`. */
|
|
4
|
+
publicAllocatorAbi, vaultV1AdapterAbi, vaultV1AdapterFactoryAbi,
|
|
5
|
+
/** @deprecated Vault V1 PublicAllocator support will be removed in the next major. Use `vaultV2BluePublicAllocatorAbi`. */
|
|
6
|
+
vaultV1PublicAllocatorAbi, vaultV2Abi, vaultV2BluePublicAllocatorAbi, vaultV2FactoryAbi, whitelistControllerAggregatorV2Abi, wrappedBackedTokenAbi, wstEthAbi, } from "@morpho-org/blue-sdk-viem";
|
package/lib/cjs/blue/abis.js
CHANGED
|
@@ -21,9 +21,11 @@ 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
|
+
/** @deprecated Vault V1 PublicAllocator support will be removed in the next major. Use `vaultV2BluePublicAllocatorAbi`. */
|
|
24
25
|
Object.defineProperty(exports, "publicAllocatorAbi", { enumerable: true, get: function () { return blue_sdk_viem_1.publicAllocatorAbi; } });
|
|
25
26
|
Object.defineProperty(exports, "vaultV1AdapterAbi", { enumerable: true, get: function () { return blue_sdk_viem_1.vaultV1AdapterAbi; } });
|
|
26
27
|
Object.defineProperty(exports, "vaultV1AdapterFactoryAbi", { enumerable: true, get: function () { return blue_sdk_viem_1.vaultV1AdapterFactoryAbi; } });
|
|
28
|
+
/** @deprecated Vault V1 PublicAllocator support will be removed in the next major. Use `vaultV2BluePublicAllocatorAbi`. */
|
|
27
29
|
Object.defineProperty(exports, "vaultV1PublicAllocatorAbi", { enumerable: true, get: function () { return blue_sdk_viem_1.vaultV1PublicAllocatorAbi; } });
|
|
28
30
|
Object.defineProperty(exports, "vaultV2Abi", { enumerable: true, get: function () { return blue_sdk_viem_1.vaultV2Abi; } });
|
|
29
31
|
Object.defineProperty(exports, "vaultV2BluePublicAllocatorAbi", { enumerable: true, get: function () { return blue_sdk_viem_1.vaultV2BluePublicAllocatorAbi; } });
|
|
@@ -1,2 +1,8 @@
|
|
|
1
|
-
export type { IAccrualPosition, IAccrualVault, IAccrualVaultV2, IAccrualVaultV2Adapter, IAccrualVaultV2MorphoMarketV1Adapter, IAccrualVaultV2MorphoMarketV1AdapterV2, IAccrualVaultV2MorphoVaultV1Adapter, IAssetBalances, IEip5267Domain, IHolding, IMarket, IMarketParams, IPosition, IPreLiquidationParams, IPreLiquidationPosition, IToken, IVault, IVaultConfig, IVaultMarketAllocation, IVaultMarketConfig,
|
|
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
|
+
/** @deprecated Vault V1 PublicAllocator support will be removed in the next major. Use `IVaultV2BlueMarketPublicAllocatorConfig`. */
|
|
3
|
+
IVaultMarketPublicAllocatorConfig, IVaultToken, IVaultUser, IVaultV2, IVaultV2Adapter, IVaultV2Allocation, IVaultV2BlueMarketPublicAllocatorConfig, IVaultV2BluePublicAllocatorConfig, IVaultV2MorphoMarketV1Adapter, IVaultV2MorphoMarketV1AdapterV2, IVaultV2MorphoVaultV1Adapter, PeripheralBalance, PeripheralBalanceType,
|
|
4
|
+
/** @deprecated Vault V1 PublicAllocator support will be removed in the next major. Use `IVaultV2BluePublicAllocatorConfig`. */
|
|
5
|
+
VaultPublicAllocatorConfig, } from "@morpho-org/blue-sdk";
|
|
6
|
+
export { AccrualPosition, AccrualVault, AccrualVaultV2, AccrualVaultV2MorphoMarketV1Adapter, AccrualVaultV2MorphoMarketV1AdapterV2, AccrualVaultV2MorphoVaultV1Adapter, AssetBalances, ConstantWrappedToken, Eip5267Domain, ExchangeRateWrappedToken, Holding, Market, MarketParams, Position, PreLiquidationParams, PreLiquidationPosition, Token, User, Vault, VaultConfig, VaultMarketAllocation, VaultMarketConfig,
|
|
7
|
+
/** @deprecated Vault V1 PublicAllocator support will be removed in the next major. Use `VaultV2BlueMarketPublicAllocatorConfig`. */
|
|
8
|
+
VaultMarketPublicAllocatorConfig, VaultToken, VaultUser, VaultV2, VaultV2Adapter, VaultV2BlueMarketPublicAllocatorConfig, VaultV2BluePublicAllocatorConfig, VaultV2MorphoMarketV1Adapter, VaultV2MorphoMarketV1AdapterV2, VaultV2MorphoVaultV1Adapter, WrappedToken, } from "@morpho-org/blue-sdk";
|
package/lib/cjs/blue/entities.js
CHANGED
|
@@ -24,6 +24,7 @@ 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
|
+
/** @deprecated Vault V1 PublicAllocator support will be removed in the next major. Use `VaultV2BlueMarketPublicAllocatorConfig`. */
|
|
27
28
|
Object.defineProperty(exports, "VaultMarketPublicAllocatorConfig", { enumerable: true, get: function () { return blue_sdk_1.VaultMarketPublicAllocatorConfig; } });
|
|
28
29
|
Object.defineProperty(exports, "VaultToken", { enumerable: true, get: function () { return blue_sdk_1.VaultToken; } });
|
|
29
30
|
Object.defineProperty(exports, "VaultUser", { enumerable: true, get: function () { return blue_sdk_1.VaultUser; } });
|
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,3 @@
|
|
|
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,
|
|
2
|
+
/** @deprecated Vault V1 PublicAllocator support will be removed in the next major. Use `fetchVaultV2BlueMarketPublicAllocatorConfig`. */
|
|
3
|
+
fetchVaultMarketPublicAllocatorConfig, fetchVaultUser, fetchVaultV2, fetchVaultV2Adapter, fetchVaultV2BlueMarketPublicAllocatorConfig, fetchVaultV2BluePublicAllocatorConfig, fetchVaultV2BluePublicAllocatorData, fetchVaultV2MorphoMarketV1Adapter, fetchVaultV2MorphoMarketV1AdapterV2, fetchVaultV2MorphoVaultV1Adapter, } from "@morpho-org/blue-sdk-viem";
|
package/lib/cjs/blue/fetch.js
CHANGED
|
@@ -21,6 +21,7 @@ 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
|
+
/** @deprecated Vault V1 PublicAllocator support will be removed in the next major. Use `fetchVaultV2BlueMarketPublicAllocatorConfig`. */
|
|
24
25
|
Object.defineProperty(exports, "fetchVaultMarketPublicAllocatorConfig", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchVaultMarketPublicAllocatorConfig; } });
|
|
25
26
|
Object.defineProperty(exports, "fetchVaultUser", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchVaultUser; } });
|
|
26
27
|
Object.defineProperty(exports, "fetchVaultV2", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchVaultV2; } });
|
|
@@ -30,7 +30,7 @@ type VaultV2BlueReallocationsParams = {
|
|
|
30
30
|
export interface BlueTokenRequirementsParams {
|
|
31
31
|
/** Prefer ERC-2612 when the funded token exposes a compatible nonce. */
|
|
32
32
|
readonly useSimplePermit?: boolean;
|
|
33
|
-
/** Explicit unused Permit2 SignatureTransfer unordered nonce. */
|
|
33
|
+
/** Explicit unused Permit2 SignatureTransfer unordered nonce; defaults to the lowest unused nonce. */
|
|
34
34
|
readonly permit2Nonce?: bigint;
|
|
35
35
|
/**
|
|
36
36
|
* Classic ERC-20 allowance to set when an approval is needed, enabling a reusable approval (for
|
|
@@ -77,15 +77,15 @@ export interface BlueActions {
|
|
|
77
77
|
* @throws {NativeAmountOnNonWNativeAssetError} when native funding targets another token.
|
|
78
78
|
* @throws {InputExceedsMaxError} when the referral fee is at least WAD.
|
|
79
79
|
* @throws {MissingReferralFeeRecipientError} when a positive fee has no recipient.
|
|
80
|
-
* @throws {
|
|
81
|
-
* @throws {
|
|
80
|
+
* @throws {NoUnusedPermit2NonceError} from `getRequirements()` when every Permit2 nonce for the owner is consumed and none was passed explicitly.
|
|
81
|
+
* @throws {Permit2SignatureTransferNonceAlreadyUsedError} from `getRequirements()` when the explicit Permit2 nonce is consumed.
|
|
82
82
|
* @throws {AmbiguousRequirementSignaturesError} from `buildTx()` when multiple token signatures are supplied.
|
|
83
83
|
* @throws {UnexpectedRequirementSignatureError} from `buildTx()` when an unsupported signature is supplied.
|
|
84
84
|
* @throws {DepositOwnerMismatchError} from `buildTx()` when the signed owner differs from `userAddress`.
|
|
85
85
|
* @throws {DepositAssetMismatchError} from `buildTx()` when the signed asset differs from the collateral token.
|
|
86
86
|
* @throws {DepositAmountMismatchError} from `buildTx()` when the signed amount differs from `collateralAssets`.
|
|
87
87
|
* @throws {DepositSpenderMismatchError} from `buildTx()` when the signed spender is not BlueBundlesV1.
|
|
88
|
-
* @throws {
|
|
88
|
+
* @throws {BundlesRequirementSignatureMismatchError} from `buildTx()` when a signature cannot be encoded safely.
|
|
89
89
|
* @throws {UnsupportedChainIdError} when the chain is absent from the address registry.
|
|
90
90
|
* @throws {UnknownAddressError} when BlueBundlesV1 is not registered.
|
|
91
91
|
* @throws {viem.BaseError} from `getRequirements()` when an allowance, nonce, or token metadata read fails.
|
|
@@ -141,8 +141,8 @@ export interface BlueActions {
|
|
|
141
141
|
* @throws {NativeAmountOnNonWNativeAssetError} when native funding targets another token.
|
|
142
142
|
* @throws {InputExceedsMaxError} when `assets` or `deadline` exceeds `uint256`, when the referral fee is at least WAD, or from `getRequirements()` when an explicit `permit2Nonce` exceeds `uint256`.
|
|
143
143
|
* @throws {MissingReferralFeeRecipientError} when a positive fee has no recipient.
|
|
144
|
-
* @throws {
|
|
145
|
-
* @throws {
|
|
144
|
+
* @throws {NoUnusedPermit2NonceError} from `getRequirements()` when every Permit2 nonce for the owner is consumed and none was passed explicitly.
|
|
145
|
+
* @throws {Permit2SignatureTransferNonceAlreadyUsedError} from `getRequirements()` when the explicit Permit2 nonce is consumed.
|
|
146
146
|
* @throws {ApprovalAmountLessThanSpendAmountError} from `getRequirements()` when a classic `approvalAmount` is below the funded `assets`.
|
|
147
147
|
* @throws {AmbiguousRequirementSignaturesError} from `buildTx()` when multiple token signatures are supplied.
|
|
148
148
|
* @throws {UnexpectedRequirementSignatureError} from `buildTx()` when the route cannot consume a supplied signature.
|
|
@@ -150,7 +150,7 @@ export interface BlueActions {
|
|
|
150
150
|
* @throws {DepositAssetMismatchError} from `buildTx()` when the signed asset differs from the loan token.
|
|
151
151
|
* @throws {DepositAmountMismatchError} from `buildTx()` when the signed amount differs from `assets`.
|
|
152
152
|
* @throws {DepositSpenderMismatchError} from `buildTx()` when the signed spender is not BlueBundlesV1.
|
|
153
|
-
* @throws {
|
|
153
|
+
* @throws {BundlesRequirementSignatureMismatchError} from `buildTx()` when a signature cannot be encoded safely.
|
|
154
154
|
* @throws {UnsupportedChainIdError} when the chain is absent from the address registry.
|
|
155
155
|
* @throws {UnknownAddressError} when BlueBundlesV1 is not registered.
|
|
156
156
|
* @throws {viem.BaseError} from `getRequirements()` when a required allowance, nonce, or token metadata read fails.
|
|
@@ -221,7 +221,7 @@ export interface BlueActions {
|
|
|
221
221
|
* @throws {AmbiguousRequirementSignaturesError} from `buildTx()` when multiple authorization signatures are supplied.
|
|
222
222
|
* @throws {UnexpectedRequirementSignatureError} from `buildTx()` when a non-authorization signature is supplied.
|
|
223
223
|
* @throws {DepositOwnerMismatchError} from `buildTx()` when the signed owner differs from `userAddress`.
|
|
224
|
-
* @throws {
|
|
224
|
+
* @throws {BundlesRequirementSignatureMismatchError} from `buildTx()` when authorization cannot be encoded safely.
|
|
225
225
|
* @throws {UnsupportedChainIdError} when the chain is absent from the address registry.
|
|
226
226
|
* @throws {UnknownAddressError} when BlueBundlesV1 is not registered.
|
|
227
227
|
* @throws {viem.BaseError} from `getRequirements()` when authorization reads fail.
|
|
@@ -295,7 +295,7 @@ export interface BlueActions {
|
|
|
295
295
|
* @throws {AmbiguousRequirementSignaturesError} from `buildTx()` when multiple authorization signatures are supplied.
|
|
296
296
|
* @throws {UnexpectedRequirementSignatureError} from `buildTx()` when a token signature is supplied.
|
|
297
297
|
* @throws {DepositOwnerMismatchError} from `buildTx()` when the signed owner differs from `userAddress`.
|
|
298
|
-
* @throws {
|
|
298
|
+
* @throws {BundlesRequirementSignatureMismatchError} from `buildTx()` when authorization cannot be encoded safely.
|
|
299
299
|
* @throws {UnsupportedChainIdError} when the chain is absent from the address registry.
|
|
300
300
|
* @throws {UnknownAddressError} when BlueBundlesV1 is not registered.
|
|
301
301
|
* @throws {viem.BaseError} from `getRequirements()` when authorization reads fail.
|
|
@@ -350,6 +350,7 @@ export interface BlueActions {
|
|
|
350
350
|
* @param params.referralFeePct - Optional WAD-scaled referral fee below 100%.
|
|
351
351
|
* @param params.referralFeeRecipient - Recipient required for a positive fee.
|
|
352
352
|
* @returns Lazy token prerequisite resolution and a synchronous deep-frozen transaction.
|
|
353
|
+
* @throws {UnsupportedBlueMarketIrmError} when required interest projection encounters an unsupported IRM.
|
|
353
354
|
* @throws {ChainIdMismatchError} when the client targets another chain.
|
|
354
355
|
* @throws {ExpiredDeadlineError} when the deadline is stale.
|
|
355
356
|
* @throws {MissingAccrualPositionError} when no position snapshot is provided.
|
|
@@ -366,15 +367,15 @@ export interface BlueActions {
|
|
|
366
367
|
* @throws {NativeFundingAmountMismatchError} when native funding is partial or mixed.
|
|
367
368
|
* @throws {ChainWNativeMissingError} when native funding is requested on a chain without wNative.
|
|
368
369
|
* @throws {NativeAmountOnNonWNativeAssetError} when native funding targets another token.
|
|
369
|
-
* @throws {
|
|
370
|
-
* @throws {
|
|
370
|
+
* @throws {NoUnusedPermit2NonceError} from `getRequirements()` when every Permit2 nonce for the owner is consumed and none was passed explicitly.
|
|
371
|
+
* @throws {Permit2SignatureTransferNonceAlreadyUsedError} from `getRequirements()` when the explicit Permit2 nonce is consumed.
|
|
371
372
|
* @throws {AmbiguousRequirementSignaturesError} from `buildTx()` when multiple token signatures are supplied.
|
|
372
373
|
* @throws {UnexpectedRequirementSignatureError} from `buildTx()` when an authorization signature is supplied.
|
|
373
374
|
* @throws {DepositOwnerMismatchError} from `buildTx()` when the signed owner differs from `userAddress`.
|
|
374
375
|
* @throws {DepositAssetMismatchError} from `buildTx()` when the signed asset differs from the loan token.
|
|
375
376
|
* @throws {DepositAmountMismatchError} from `buildTx()` when the signed amount differs from the derived funding cap.
|
|
376
377
|
* @throws {DepositSpenderMismatchError} from `buildTx()` when the signed spender is not BlueBundlesV1.
|
|
377
|
-
* @throws {
|
|
378
|
+
* @throws {BundlesRequirementSignatureMismatchError} from `buildTx()` when a signature cannot be encoded safely.
|
|
378
379
|
* @throws {UnsupportedChainIdError} when the chain is absent from the address registry.
|
|
379
380
|
* @throws {UnknownAddressError} when BlueBundlesV1 is not registered.
|
|
380
381
|
* @throws {viem.BaseError} from `getRequirements()` when an allowance, nonce, or token metadata read fails.
|
|
@@ -447,7 +448,7 @@ export interface BlueActions {
|
|
|
447
448
|
* @throws {AmbiguousRequirementSignaturesError} from `buildTx()` when multiple authorization signatures are supplied.
|
|
448
449
|
* @throws {UnexpectedRequirementSignatureError} from `buildTx()` when a token signature is supplied.
|
|
449
450
|
* @throws {DepositOwnerMismatchError} from `buildTx()` when the signed owner differs from `userAddress`.
|
|
450
|
-
* @throws {
|
|
451
|
+
* @throws {BundlesRequirementSignatureMismatchError} from `buildTx()` when authorization cannot be encoded safely.
|
|
451
452
|
* @throws {UnsupportedChainIdError} when the chain is absent from the address registry.
|
|
452
453
|
* @throws {UnknownAddressError} when BlueBundlesV1 is not registered.
|
|
453
454
|
* @throws {viem.BaseError} from `getRequirements()` when authorization reads fail.
|
|
@@ -508,6 +509,7 @@ export interface BlueActions {
|
|
|
508
509
|
* @param params.referralFeePct - Optional WAD-scaled referral fee below 100%.
|
|
509
510
|
* @param params.referralFeeRecipient - Recipient required for a positive fee.
|
|
510
511
|
* @returns Lazy funding/authorization resolution and a synchronous deep-frozen transaction builder.
|
|
512
|
+
* @throws {UnsupportedBlueMarketIrmError} when required interest projection encounters an unsupported IRM.
|
|
511
513
|
* @throws {ChainIdMismatchError} when the client targets another chain.
|
|
512
514
|
* @throws {MissingAccrualPositionError} when no position snapshot is provided at runtime.
|
|
513
515
|
* @throws {MarketIdMismatchError} when `positionData` belongs to another market.
|
|
@@ -527,15 +529,15 @@ export interface BlueActions {
|
|
|
527
529
|
* @throws {NativeFundingAmountMismatchError} when native funding is partial or mixed.
|
|
528
530
|
* @throws {ChainWNativeMissingError} when native funding is requested on a chain without wNative.
|
|
529
531
|
* @throws {NativeAmountOnNonWNativeAssetError} when native funding targets another token.
|
|
530
|
-
* @throws {
|
|
531
|
-
* @throws {
|
|
532
|
+
* @throws {NoUnusedPermit2NonceError} from `getRequirements()` when every Permit2 nonce for the owner is consumed and none was passed explicitly.
|
|
533
|
+
* @throws {Permit2SignatureTransferNonceAlreadyUsedError} from `getRequirements()` when the explicit Permit2 nonce is consumed.
|
|
532
534
|
* @throws {AmbiguousRequirementSignaturesError} from `buildTx()` when multiple signatures of one kind are supplied.
|
|
533
535
|
* @throws {UnexpectedRequirementSignatureError} from `buildTx()` when an inactive leg cannot consume a supplied signature.
|
|
534
536
|
* @throws {DepositOwnerMismatchError} from `buildTx()` when a signed owner differs from `userAddress`.
|
|
535
537
|
* @throws {DepositAssetMismatchError} from `buildTx()` when the signed asset differs from the loan token.
|
|
536
538
|
* @throws {DepositAmountMismatchError} from `buildTx()` when the signed amount differs from the derived funding cap.
|
|
537
539
|
* @throws {DepositSpenderMismatchError} from `buildTx()` when the signed spender is not BlueBundlesV1.
|
|
538
|
-
* @throws {
|
|
540
|
+
* @throws {BundlesRequirementSignatureMismatchError} from `buildTx()` when a signature cannot be encoded safely.
|
|
539
541
|
* @throws {UnsupportedChainIdError} when the chain is absent from the address registry.
|
|
540
542
|
* @throws {UnknownAddressError} when BlueBundlesV1 is not registered.
|
|
541
543
|
* @throws {viem.BaseError} from `getRequirements()` when a required allowance, nonce, token metadata, or authorization read fails.
|
|
@@ -625,15 +627,15 @@ export interface BlueActions {
|
|
|
625
627
|
* @throws {InconsistentReallocationPenaltyError} when one vault uses different penalties.
|
|
626
628
|
* @throws {ReallocationWithdrawalOnTargetMarketError} when a source is the target market.
|
|
627
629
|
* @throws {ReallocationLoanTokenMismatchError} when a source uses another loan token.
|
|
628
|
-
* @throws {
|
|
629
|
-
* @throws {
|
|
630
|
+
* @throws {NoUnusedPermit2NonceError} from `getRequirements()` when every Permit2 nonce for the owner is consumed and none was passed explicitly.
|
|
631
|
+
* @throws {Permit2SignatureTransferNonceAlreadyUsedError} from `getRequirements()` when the explicit Permit2 nonce is consumed.
|
|
630
632
|
* @throws {AmbiguousRequirementSignaturesError} from `buildTx()` when multiple signatures of one kind are supplied.
|
|
631
633
|
* @throws {UnexpectedRequirementSignatureError} from `buildTx()` when an inactive leg cannot consume a supplied signature.
|
|
632
634
|
* @throws {DepositOwnerMismatchError} from `buildTx()` when a signed owner differs from `userAddress`.
|
|
633
635
|
* @throws {DepositAssetMismatchError} from `buildTx()` when the signed asset differs from the collateral token.
|
|
634
636
|
* @throws {DepositAmountMismatchError} from `buildTx()` when the signed amount differs from `collateralAssets`.
|
|
635
637
|
* @throws {DepositSpenderMismatchError} from `buildTx()` when the signed spender is not BlueBundlesV1.
|
|
636
|
-
* @throws {
|
|
638
|
+
* @throws {BundlesRequirementSignatureMismatchError} from `buildTx()` when a signature cannot be encoded safely.
|
|
637
639
|
* @throws {UnsupportedChainIdError} when the chain is absent from the address registry.
|
|
638
640
|
* @throws {UnknownAddressError} when BlueBundlesV1 is not registered.
|
|
639
641
|
* @throws {viem.BaseError} from `getRequirements()` when a required allowance, nonce, token metadata, or authorization read fails.
|
|
@@ -692,6 +694,7 @@ export interface BlueActions {
|
|
|
692
694
|
* @param params.referralFeePct - Optional WAD-scaled referral fee below 100%.
|
|
693
695
|
* @param params.referralFeeRecipient - Recipient required for a positive fee.
|
|
694
696
|
* @returns Lazy Blue authorization resolution and a synchronous deep-frozen transaction builder.
|
|
697
|
+
* @throws {UnsupportedBlueMarketIrmError} when required interest projection encounters an unsupported IRM.
|
|
695
698
|
* @throws {ChainIdMismatchError} when the client targets another chain.
|
|
696
699
|
* @throws {MissingAccrualPositionError} when either position snapshot is absent at runtime.
|
|
697
700
|
* @throws {MarketIdMismatchError} when a position snapshot belongs to another market.
|
|
@@ -714,7 +717,7 @@ export interface BlueActions {
|
|
|
714
717
|
* @throws {AmbiguousRequirementSignaturesError} from `buildTx()` when multiple authorization signatures are supplied.
|
|
715
718
|
* @throws {UnexpectedRequirementSignatureError} from `buildTx()` when a non-authorization signature is supplied.
|
|
716
719
|
* @throws {DepositOwnerMismatchError} from `buildTx()` when the signed owner differs from `userAddress`.
|
|
717
|
-
* @throws {
|
|
720
|
+
* @throws {BundlesRequirementSignatureMismatchError} from `buildTx()` when authorization cannot be encoded safely.
|
|
718
721
|
* @throws {UnsupportedChainIdError} when the chain is absent from the address registry.
|
|
719
722
|
* @throws {UnknownAddressError} when BlueBundlesV1 is not registered.
|
|
720
723
|
* @throws {viem.BaseError} from `getRequirements()` when authorization reads fail.
|
|
@@ -857,6 +860,7 @@ export interface BlueActions {
|
|
|
857
860
|
* Pass the fetched block timestamp to compute reallocations at the same block.
|
|
858
861
|
* @returns Vault V1 reallocations for explicit low-level Bundler3 composition.
|
|
859
862
|
* @throws {ChainIdMismatchError} when `reallocationData` belongs to a different chain than this market.
|
|
863
|
+
* @throws {UnsupportedBlueMarketIrmError} when a market with positive debt uses an unsupported IRM.
|
|
860
864
|
* @throws {InsufficientSharedLiquidityError} when shared liquidity cannot cover the operation's absolute shortfall on the target market — preventing fee-bearing reallocations from being attached to a call that would still revert onchain.
|
|
861
865
|
* @throws {ReallocationWithdrawExceedsMarketSupplyError} when a withdrawal exceeds the target market supply.
|
|
862
866
|
* @throws {MissingPublicAllocatorConfigError} when a selected vault is missing its public allocator config.
|
|
@@ -883,6 +887,7 @@ export interface BlueActions {
|
|
|
883
887
|
* @param params.options - Optional allocator and utilization options.
|
|
884
888
|
* @returns Vault V1 reallocations for explicit low-level Bundler3 composition.
|
|
885
889
|
* @throws {ChainIdMismatchError} when `reallocationData` belongs to another chain.
|
|
890
|
+
* @throws {UnsupportedBlueMarketIrmError} when a market with positive debt uses an unsupported IRM.
|
|
886
891
|
* @throws {InsufficientSharedLiquidityError} when shared liquidity cannot cover the operation.
|
|
887
892
|
* @throws {ReallocationWithdrawExceedsMarketSupplyError} when a withdrawal exceeds market supply.
|
|
888
893
|
* @throws {MissingPublicAllocatorConfigError} when a selected vault lacks allocator state.
|
|
@@ -906,6 +911,7 @@ export interface BlueActions {
|
|
|
906
911
|
* @param params.options - Optional allocator discovery controls and operation to support.
|
|
907
912
|
* @returns Action-ready reallocations and their post-simulation state.
|
|
908
913
|
* @throws {ChainIdMismatchError} when `reallocationData` belongs to another chain.
|
|
914
|
+
* @throws {UnsupportedBlueMarketIrmError} when a market with positive debt uses an unsupported IRM.
|
|
909
915
|
* @throws {NegativeInputError} when a utilization or penalty limit is negative.
|
|
910
916
|
* @throws {InputExceedsMaxError} when a utilization or penalty limit exceeds WAD.
|
|
911
917
|
* @throws {NonPositiveInputError} when an enabled operation amount is not positive.
|
|
@@ -1181,6 +1187,7 @@ export declare class MorphoBlue implements BlueActions {
|
|
|
1181
1187
|
* @param params.options - Optional allocator and utilization options.
|
|
1182
1188
|
* @returns Vault V1 reallocations for explicit low-level Bundler3 composition.
|
|
1183
1189
|
* @throws {ChainIdMismatchError} when `reallocationData` belongs to a different chain than this market.
|
|
1190
|
+
* @throws {UnsupportedBlueMarketIrmError} when a market with positive debt uses an unsupported IRM.
|
|
1184
1191
|
* @throws {InsufficientSharedLiquidityError} when shared liquidity cannot cover the operation's absolute shortfall on the target market.
|
|
1185
1192
|
* @throws {ReallocationWithdrawExceedsMarketSupplyError} when `operation === "withdraw"` and `amount` exceeds the target market's `totalSupplyAssets`.
|
|
1186
1193
|
* @throws {MissingPublicAllocatorConfigError} when a selected vault is missing its public allocator config.
|
|
@@ -1207,6 +1214,7 @@ export declare class MorphoBlue implements BlueActions {
|
|
|
1207
1214
|
* @param params.options - Optional allocator and utilization options.
|
|
1208
1215
|
* @returns Vault V1 reallocations for explicit low-level Bundler3 composition.
|
|
1209
1216
|
* @throws {ChainIdMismatchError} when `reallocationData` belongs to another chain.
|
|
1217
|
+
* @throws {UnsupportedBlueMarketIrmError} when a market with positive debt uses an unsupported IRM.
|
|
1210
1218
|
* @throws {InsufficientSharedLiquidityError} when shared liquidity cannot cover the operation.
|
|
1211
1219
|
* @throws {ReallocationWithdrawExceedsMarketSupplyError} when a withdrawal exceeds market supply.
|
|
1212
1220
|
* @throws {MissingPublicAllocatorConfigError} when a selected vault lacks allocator state.
|
|
@@ -1230,6 +1238,7 @@ export declare class MorphoBlue implements BlueActions {
|
|
|
1230
1238
|
* @param params.options - Optional allocator discovery controls and operation to support.
|
|
1231
1239
|
* @returns Action-ready reallocations and their post-simulation state.
|
|
1232
1240
|
* @throws {ChainIdMismatchError} when `reallocationData` belongs to another chain.
|
|
1241
|
+
* @throws {UnsupportedBlueMarketIrmError} when a market with positive debt uses an unsupported IRM.
|
|
1233
1242
|
* @throws {NegativeInputError} when a utilization or penalty limit is negative.
|
|
1234
1243
|
* @throws {InputExceedsMaxError} when a utilization or penalty limit exceeds WAD.
|
|
1235
1244
|
* @throws {NonPositiveInputError} when an enabled operation amount is not positive.
|