@morpho-org/morpho-sdk 10.0.1 → 10.1.0-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -10
- package/lib/cjs/abis.d.ts +1 -1
- package/lib/cjs/abis.js +5 -1
- package/lib/cjs/actions/blue/refinance.d.ts +1 -1
- package/lib/cjs/actions/blue/refinance.js +3 -8
- package/lib/cjs/actions/blue/refinanceValidation.d.ts +19 -0
- package/lib/cjs/actions/blue/refinanceValidation.js +46 -0
- package/lib/cjs/actions/requirements/encode/encodeErc20Approval.d.ts +1 -1
- package/lib/cjs/actions/requirements/encode/encodeErc20Approval.js +3 -7
- package/lib/cjs/actions/requirements/encode/encodeErc20Permit.d.ts +1 -1
- package/lib/cjs/actions/requirements/encode/encodeErc20Permit.js +4 -20
- package/lib/cjs/actions/requirements/getRequirementsApproval.js +7 -21
- package/lib/cjs/actions/requirements/validateClientChainId.d.ts +1 -26
- package/lib/cjs/actions/requirements/validateClientChainId.js +2 -31
- package/lib/cjs/actions/vaultV2/forceRedeem.d.ts +2 -1
- package/lib/cjs/actions/vaultV2/forceRedeem.js +20 -2
- package/lib/cjs/blue/abis.d.ts +1 -1
- package/lib/cjs/blue/abis.js +5 -1
- package/lib/cjs/blue/entities.d.ts +4 -4
- package/lib/cjs/blue/entities.js +3 -1
- package/lib/cjs/blue/errors.d.ts +2 -2
- package/lib/cjs/blue/errors.js +5 -1
- package/lib/cjs/blue/fetch.d.ts +2 -2
- package/lib/cjs/blue/fetch.js +3 -1
- package/lib/cjs/blue/utils.d.ts +1 -1
- package/lib/cjs/blue/utils.js +2 -1
- package/lib/cjs/entities/blue/blue.js +24 -55
- package/lib/cjs/entities/index.d.ts +4 -4
- package/lib/cjs/entities/index.js +3 -1
- package/lib/cjs/entities/requirements/getErc2612Permit.d.ts +2 -5
- package/lib/cjs/entities/requirements/getErc2612Permit.js +9 -58
- package/lib/cjs/entities/vaultV2/vaultV2.d.ts +34 -8
- package/lib/cjs/entities/vaultV2/vaultV2.js +39 -1
- package/lib/cjs/entities/vaultV2BlueReallocationData.d.ts +3 -2
- package/lib/cjs/entities/vaultV2BlueReallocationData.js +6 -2
- package/lib/cjs/errors.d.ts +4 -4
- package/lib/cjs/errors.js +7 -5
- package/lib/cjs/fetch.d.ts +2 -2
- package/lib/cjs/fetch.js +3 -1
- package/lib/cjs/helpers/deadShares.js +3 -0
- package/lib/cjs/helpers/quoteBlueRepay.d.ts +16 -0
- package/lib/cjs/helpers/quoteBlueRepay.js +46 -0
- package/lib/cjs/helpers/tokenApproval.d.ts +14 -0
- package/lib/cjs/helpers/tokenApproval.js +20 -0
- package/lib/cjs/helpers/validate.d.ts +1 -1
- package/lib/cjs/helpers/validate.js +2 -2
- package/lib/cjs/index.d.ts +2 -2
- package/lib/cjs/index.js +13 -1
- package/lib/cjs/midnight/errors.d.ts +2 -1
- package/lib/cjs/midnight/errors.js +5 -4
- package/lib/cjs/reads/readErc2612Permit.d.ts +22 -0
- package/lib/cjs/reads/readErc2612Permit.js +77 -0
- package/lib/cjs/reads/validateClientChainId.d.ts +26 -0
- package/lib/cjs/reads/validateClientChainId.js +34 -0
- package/lib/cjs/transactionPlan/blue/authorization.d.ts +23 -0
- package/lib/cjs/transactionPlan/blue/authorization.js +128 -0
- package/lib/cjs/transactionPlan/blue/borrow.d.ts +80 -0
- package/lib/cjs/transactionPlan/blue/borrow.js +248 -0
- package/lib/cjs/transactionPlan/blue/prepare.d.ts +102 -0
- package/lib/cjs/transactionPlan/blue/prepare.js +191 -0
- package/lib/cjs/transactionPlan/blue/refinance.d.ts +93 -0
- package/lib/cjs/transactionPlan/blue/refinance.js +281 -0
- package/lib/cjs/transactionPlan/blue/refinanceValidation.d.ts +11 -0
- package/lib/cjs/transactionPlan/blue/refinanceValidation.js +20 -0
- package/lib/cjs/transactionPlan/blue/repay.d.ts +80 -0
- package/lib/cjs/transactionPlan/blue/repay.js +229 -0
- package/lib/cjs/transactionPlan/blue/repayWithdrawCollateral.d.ts +98 -0
- package/lib/cjs/transactionPlan/blue/repayWithdrawCollateral.js +379 -0
- package/lib/cjs/transactionPlan/blue/supply.d.ts +181 -0
- package/lib/cjs/transactionPlan/blue/supply.js +238 -0
- package/lib/cjs/transactionPlan/blue/supplyCollateral.d.ts +97 -0
- package/lib/cjs/transactionPlan/blue/supplyCollateral.js +231 -0
- package/lib/cjs/transactionPlan/blue/supplyCollateralBorrow.d.ts +102 -0
- package/lib/cjs/transactionPlan/blue/supplyCollateralBorrow.js +395 -0
- package/lib/cjs/transactionPlan/blue/withdraw.d.ts +136 -0
- package/lib/cjs/transactionPlan/blue/withdraw.js +340 -0
- package/lib/cjs/transactionPlan/blue/withdrawCollateral.d.ts +123 -0
- package/lib/cjs/transactionPlan/blue/withdrawCollateral.js +246 -0
- package/lib/cjs/transactionPlan/deposit.js +8 -19
- package/lib/cjs/transactionPlan/error.d.ts +50 -0
- package/lib/cjs/transactionPlan/error.js +60 -1
- package/lib/cjs/transactionPlan/getTokenPermit.d.ts +17 -8
- package/lib/cjs/transactionPlan/getTokenPermit.js +35 -7
- package/lib/cjs/transactionPlan/index.d.ts +21 -1
- package/lib/cjs/transactionPlan/index.js +27 -5
- package/lib/cjs/transactionPlan/intent.d.ts +2 -2
- package/lib/cjs/transactionPlan/intent.js +8 -4
- package/lib/cjs/transactionPlan/permit.d.ts +16 -2
- package/lib/cjs/transactionPlan/permit.js +77 -45
- package/lib/cjs/transactionPlan/plan.d.ts +67 -12
- package/lib/cjs/transactionPlan/plan.js +284 -50
- package/lib/cjs/transactionPlan/requirements.d.ts +14 -5
- package/lib/cjs/transactionPlan/requirements.js +30 -12
- package/lib/cjs/transactionPlan/serde.d.ts +7 -4
- package/lib/cjs/transactionPlan/serde.js +80 -61
- package/lib/cjs/transactionPlan/types.d.ts +141 -13
- package/lib/cjs/transactionPlan/validateActions.js +11 -1
- package/lib/cjs/transactionPlan/validation.d.ts +8 -0
- package/lib/cjs/transactionPlan/validation.js +90 -0
- package/lib/cjs/transactionPlan/vaultv1/deposit.d.ts +1 -0
- package/lib/cjs/transactionPlan/vaultv1/deposit.js +1 -0
- package/lib/cjs/transactionPlan/vaultv1/inKindRedeem.d.ts +1 -0
- package/lib/cjs/transactionPlan/vaultv1/inKindRedeem.js +1 -0
- package/lib/cjs/transactionPlan/vaultv1/migrateToV2.d.ts +1 -0
- package/lib/cjs/transactionPlan/vaultv1/migrateToV2.js +1 -0
- package/lib/cjs/transactionPlan/vaultv1/redeem.d.ts +1 -0
- package/lib/cjs/transactionPlan/vaultv1/redeem.js +1 -0
- package/lib/cjs/transactionPlan/vaultv1/withdraw.d.ts +1 -0
- package/lib/cjs/transactionPlan/vaultv1/withdraw.js +1 -0
- package/lib/cjs/transactionPlan/vaultv2/deposit.d.ts +1 -0
- package/lib/cjs/transactionPlan/vaultv2/deposit.js +1 -0
- package/lib/cjs/transactionPlan/vaultv2/forceRedeem.d.ts +1 -0
- package/lib/cjs/transactionPlan/vaultv2/forceRedeem.js +1 -0
- package/lib/cjs/transactionPlan/vaultv2/forceWithdraw.d.ts +1 -0
- package/lib/cjs/transactionPlan/vaultv2/forceWithdraw.js +1 -0
- package/lib/cjs/transactionPlan/vaultv2/inKindRedeem.d.ts +1 -0
- package/lib/cjs/transactionPlan/vaultv2/inKindRedeem.js +1 -0
- package/lib/cjs/transactionPlan/vaultv2/redeem.d.ts +1 -0
- package/lib/cjs/transactionPlan/vaultv2/redeem.js +1 -0
- package/lib/cjs/transactionPlan/vaultv2/withdraw.d.ts +1 -0
- package/lib/cjs/transactionPlan/vaultv2/withdraw.js +1 -0
- package/lib/cjs/utils.d.ts +2 -2
- package/lib/cjs/utils.js +4 -2
- package/lib/cjs/version.d.ts +1 -1
- package/lib/cjs/version.js +1 -1
- package/lib/esm/abis.d.ts +1 -1
- package/lib/esm/abis.js +1 -1
- package/lib/esm/actions/blue/refinance.d.ts +1 -1
- package/lib/esm/actions/blue/refinance.js +4 -9
- package/lib/esm/actions/blue/refinanceValidation.d.ts +19 -0
- package/lib/esm/actions/blue/refinanceValidation.js +41 -0
- package/lib/esm/actions/requirements/encode/encodeErc20Approval.d.ts +1 -1
- package/lib/esm/actions/requirements/encode/encodeErc20Approval.js +4 -8
- package/lib/esm/actions/requirements/encode/encodeErc20Permit.d.ts +1 -1
- package/lib/esm/actions/requirements/encode/encodeErc20Permit.js +5 -21
- package/lib/esm/actions/requirements/getRequirementsApproval.js +7 -21
- package/lib/esm/actions/requirements/validateClientChainId.d.ts +1 -26
- package/lib/esm/actions/requirements/validateClientChainId.js +1 -30
- package/lib/esm/actions/vaultV2/forceRedeem.d.ts +2 -1
- package/lib/esm/actions/vaultV2/forceRedeem.js +20 -2
- package/lib/esm/blue/abis.d.ts +1 -1
- package/lib/esm/blue/abis.js +1 -1
- package/lib/esm/blue/entities.d.ts +4 -4
- package/lib/esm/blue/entities.js +2 -2
- package/lib/esm/blue/errors.d.ts +2 -2
- package/lib/esm/blue/errors.js +2 -2
- package/lib/esm/blue/fetch.d.ts +2 -2
- package/lib/esm/blue/fetch.js +2 -2
- package/lib/esm/blue/utils.d.ts +1 -1
- package/lib/esm/blue/utils.js +1 -1
- package/lib/esm/entities/blue/blue.js +26 -57
- package/lib/esm/entities/index.d.ts +4 -4
- package/lib/esm/entities/index.js +2 -2
- package/lib/esm/entities/requirements/getErc2612Permit.d.ts +2 -5
- package/lib/esm/entities/requirements/getErc2612Permit.js +9 -58
- package/lib/esm/entities/vaultV2/vaultV2.d.ts +34 -8
- package/lib/esm/entities/vaultV2/vaultV2.js +40 -2
- package/lib/esm/entities/vaultV2BlueReallocationData.d.ts +3 -2
- package/lib/esm/entities/vaultV2BlueReallocationData.js +6 -2
- package/lib/esm/errors.d.ts +4 -4
- package/lib/esm/errors.js +4 -4
- package/lib/esm/fetch.d.ts +2 -2
- package/lib/esm/fetch.js +2 -2
- package/lib/esm/helpers/deadShares.js +4 -1
- package/lib/esm/helpers/quoteBlueRepay.d.ts +16 -0
- package/lib/esm/helpers/quoteBlueRepay.js +42 -0
- package/lib/esm/helpers/tokenApproval.d.ts +14 -0
- package/lib/esm/helpers/tokenApproval.js +16 -0
- package/lib/esm/helpers/validate.d.ts +1 -1
- package/lib/esm/helpers/validate.js +3 -3
- package/lib/esm/index.d.ts +2 -2
- package/lib/esm/index.js +1 -1
- package/lib/esm/midnight/errors.d.ts +2 -1
- package/lib/esm/midnight/errors.js +2 -1
- package/lib/esm/reads/readErc2612Permit.d.ts +22 -0
- package/lib/esm/reads/readErc2612Permit.js +73 -0
- package/lib/esm/reads/validateClientChainId.d.ts +26 -0
- package/lib/esm/reads/validateClientChainId.js +30 -0
- package/lib/esm/transactionPlan/blue/authorization.d.ts +23 -0
- package/lib/esm/transactionPlan/blue/authorization.js +122 -0
- package/lib/esm/transactionPlan/blue/borrow.d.ts +80 -0
- package/lib/esm/transactionPlan/blue/borrow.js +243 -0
- package/lib/esm/transactionPlan/blue/prepare.d.ts +102 -0
- package/lib/esm/transactionPlan/blue/prepare.js +187 -0
- package/lib/esm/transactionPlan/blue/refinance.d.ts +93 -0
- package/lib/esm/transactionPlan/blue/refinance.js +276 -0
- package/lib/esm/transactionPlan/blue/refinanceValidation.d.ts +11 -0
- package/lib/esm/transactionPlan/blue/refinanceValidation.js +17 -0
- package/lib/esm/transactionPlan/blue/repay.d.ts +80 -0
- package/lib/esm/transactionPlan/blue/repay.js +223 -0
- package/lib/esm/transactionPlan/blue/repayWithdrawCollateral.d.ts +98 -0
- package/lib/esm/transactionPlan/blue/repayWithdrawCollateral.js +373 -0
- package/lib/esm/transactionPlan/blue/supply.d.ts +181 -0
- package/lib/esm/transactionPlan/blue/supply.js +232 -0
- package/lib/esm/transactionPlan/blue/supplyCollateral.d.ts +97 -0
- package/lib/esm/transactionPlan/blue/supplyCollateral.js +225 -0
- package/lib/esm/transactionPlan/blue/supplyCollateralBorrow.d.ts +102 -0
- package/lib/esm/transactionPlan/blue/supplyCollateralBorrow.js +389 -0
- package/lib/esm/transactionPlan/blue/withdraw.d.ts +136 -0
- package/lib/esm/transactionPlan/blue/withdraw.js +334 -0
- package/lib/esm/transactionPlan/blue/withdrawCollateral.d.ts +123 -0
- package/lib/esm/transactionPlan/blue/withdrawCollateral.js +240 -0
- package/lib/esm/transactionPlan/deposit.js +9 -20
- package/lib/esm/transactionPlan/error.d.ts +50 -0
- package/lib/esm/transactionPlan/error.js +57 -0
- package/lib/esm/transactionPlan/getTokenPermit.d.ts +17 -8
- package/lib/esm/transactionPlan/getTokenPermit.js +35 -7
- package/lib/esm/transactionPlan/index.d.ts +21 -1
- package/lib/esm/transactionPlan/index.js +11 -1
- package/lib/esm/transactionPlan/intent.d.ts +2 -2
- package/lib/esm/transactionPlan/intent.js +8 -4
- package/lib/esm/transactionPlan/permit.d.ts +16 -2
- package/lib/esm/transactionPlan/permit.js +76 -44
- package/lib/esm/transactionPlan/plan.d.ts +67 -12
- package/lib/esm/transactionPlan/plan.js +279 -46
- package/lib/esm/transactionPlan/requirements.d.ts +14 -5
- package/lib/esm/transactionPlan/requirements.js +30 -12
- package/lib/esm/transactionPlan/serde.d.ts +7 -4
- package/lib/esm/transactionPlan/serde.js +73 -54
- package/lib/esm/transactionPlan/types.d.ts +141 -13
- package/lib/esm/transactionPlan/validateActions.js +11 -1
- package/lib/esm/transactionPlan/validation.d.ts +8 -0
- package/lib/esm/transactionPlan/validation.js +88 -1
- package/lib/esm/transactionPlan/vaultv1/deposit.d.ts +1 -0
- package/lib/esm/transactionPlan/vaultv1/deposit.js +1 -0
- package/lib/esm/transactionPlan/vaultv1/inKindRedeem.d.ts +1 -0
- package/lib/esm/transactionPlan/vaultv1/inKindRedeem.js +1 -0
- package/lib/esm/transactionPlan/vaultv1/migrateToV2.d.ts +1 -0
- package/lib/esm/transactionPlan/vaultv1/migrateToV2.js +1 -0
- package/lib/esm/transactionPlan/vaultv1/redeem.d.ts +1 -0
- package/lib/esm/transactionPlan/vaultv1/redeem.js +1 -0
- package/lib/esm/transactionPlan/vaultv1/withdraw.d.ts +1 -0
- package/lib/esm/transactionPlan/vaultv1/withdraw.js +1 -0
- package/lib/esm/transactionPlan/vaultv2/deposit.d.ts +1 -0
- package/lib/esm/transactionPlan/vaultv2/deposit.js +1 -0
- package/lib/esm/transactionPlan/vaultv2/forceRedeem.d.ts +1 -0
- package/lib/esm/transactionPlan/vaultv2/forceRedeem.js +1 -0
- package/lib/esm/transactionPlan/vaultv2/forceWithdraw.d.ts +1 -0
- package/lib/esm/transactionPlan/vaultv2/forceWithdraw.js +1 -0
- package/lib/esm/transactionPlan/vaultv2/inKindRedeem.d.ts +1 -0
- package/lib/esm/transactionPlan/vaultv2/inKindRedeem.js +1 -0
- package/lib/esm/transactionPlan/vaultv2/redeem.d.ts +1 -0
- package/lib/esm/transactionPlan/vaultv2/redeem.js +1 -0
- package/lib/esm/transactionPlan/vaultv2/withdraw.d.ts +1 -0
- package/lib/esm/transactionPlan/vaultv2/withdraw.js +1 -0
- package/lib/esm/utils.d.ts +2 -2
- package/lib/esm/utils.js +2 -2
- package/lib/esm/version.d.ts +1 -1
- package/lib/esm/version.js +1 -1
- package/package.json +7 -7
|
@@ -45,6 +45,7 @@ export interface VaultV1WithdrawPlanParams extends WithdrawPlanParams<AccrualVau
|
|
|
45
45
|
* @throws {NegativeInputError} when `referralFee.bps` is negative.
|
|
46
46
|
* @throws {InputExceedsMaxError} when `referralFee.bps` exceeds 10,000 or `assets` exceeds uint256.
|
|
47
47
|
* @throws {InvalidCalldataOriginError} when `calldataOrigin` is empty, malformed or has an odd number of hex digits.
|
|
48
|
+
* @throws {InvalidTransactionPlanError} when `account` is malformed or `calldataOrigin` exceeds 1 MiB.
|
|
48
49
|
* @throws {ReferralFeePctExceededError} when `referralFee.bps` equals 10,000; the normalized fee must be below WAD.
|
|
49
50
|
* @throws {ReferralFeeRecipientMissingError} when a positive referral fee has no recipient or a zero recipient.
|
|
50
51
|
* @throws {ChainIdMismatchError} when the client targets another chain.
|
|
@@ -35,6 +35,7 @@ const withdraw_js_2 = require("../withdraw.js");
|
|
|
35
35
|
* @throws {NegativeInputError} when `referralFee.bps` is negative.
|
|
36
36
|
* @throws {InputExceedsMaxError} when `referralFee.bps` exceeds 10,000 or `assets` exceeds uint256.
|
|
37
37
|
* @throws {InvalidCalldataOriginError} when `calldataOrigin` is empty, malformed or has an odd number of hex digits.
|
|
38
|
+
* @throws {InvalidTransactionPlanError} when `account` is malformed or `calldataOrigin` exceeds 1 MiB.
|
|
38
39
|
* @throws {ReferralFeePctExceededError} when `referralFee.bps` equals 10,000; the normalized fee must be below WAD.
|
|
39
40
|
* @throws {ReferralFeeRecipientMissingError} when a positive referral fee has no recipient or a zero recipient.
|
|
40
41
|
* @throws {ChainIdMismatchError} when the client targets another chain.
|
|
@@ -37,6 +37,7 @@ export interface VaultV2DepositPlanParams extends DepositPlanParams<AccrualVault
|
|
|
37
37
|
* @throws {InputExceedsMaxError} when `referralFee.bps` exceeds 10,000 or `assets` exceeds uint256.
|
|
38
38
|
* @throws {ExcessiveSlippageToleranceError} when `slippageTolerance` exceeds `MAX_SLIPPAGE_TOLERANCE`.
|
|
39
39
|
* @throws {InvalidCalldataOriginError} when `calldataOrigin` is empty, malformed or has an odd number of hex digits.
|
|
40
|
+
* @throws {InvalidTransactionPlanError} when `account` is malformed or `calldataOrigin` exceeds 1 MiB.
|
|
40
41
|
* @throws {ReferralFeePctExceededError} when `referralFee.bps` equals 10,000; the normalized fee must be below WAD.
|
|
41
42
|
* @throws {ReferralFeeRecipientMissingError} when a positive referral fee has no recipient or a zero recipient.
|
|
42
43
|
* @throws {NativeAmountOnNonWNativeVaultError} when native funding targets a vault whose asset is not wNative.
|
|
@@ -35,6 +35,7 @@ const permit_js_1 = require("../permit.js");
|
|
|
35
35
|
* @throws {InputExceedsMaxError} when `referralFee.bps` exceeds 10,000 or `assets` exceeds uint256.
|
|
36
36
|
* @throws {ExcessiveSlippageToleranceError} when `slippageTolerance` exceeds `MAX_SLIPPAGE_TOLERANCE`.
|
|
37
37
|
* @throws {InvalidCalldataOriginError} when `calldataOrigin` is empty, malformed or has an odd number of hex digits.
|
|
38
|
+
* @throws {InvalidTransactionPlanError} when `account` is malformed or `calldataOrigin` exceeds 1 MiB.
|
|
38
39
|
* @throws {ReferralFeePctExceededError} when `referralFee.bps` equals 10,000; the normalized fee must be below WAD.
|
|
39
40
|
* @throws {ReferralFeeRecipientMissingError} when a positive referral fee has no recipient or a zero recipient.
|
|
40
41
|
* @throws {NativeAmountOnNonWNativeVaultError} when native funding targets a vault whose asset is not wNative.
|
|
@@ -46,6 +46,7 @@ export interface VaultV2ForceRedeemPlanParams extends Pick<IntentParams, "chainI
|
|
|
46
46
|
* @throws {NonIntegerInputError} If `expiresAt` is not a safe integer.
|
|
47
47
|
* @throws {ExpiredDeadlineError} If `expiresAt` is not in the future.
|
|
48
48
|
* @throws {InvalidCalldataOriginError} If `calldataOrigin` is empty, malformed or has an odd number of hex digits.
|
|
49
|
+
* @throws {InvalidTransactionPlanError} when `account` is malformed or `calldataOrigin` exceeds 1 MiB.
|
|
49
50
|
* @example
|
|
50
51
|
* ```ts
|
|
51
52
|
* import { prepareVaultV2ForceRedeem, type TransactionPlan } from "@morpho-org/morpho-sdk";
|
|
@@ -64,6 +64,7 @@ function validateForceRedeemPlanAction(action, path) {
|
|
|
64
64
|
* @throws {NonIntegerInputError} If `expiresAt` is not a safe integer.
|
|
65
65
|
* @throws {ExpiredDeadlineError} If `expiresAt` is not in the future.
|
|
66
66
|
* @throws {InvalidCalldataOriginError} If `calldataOrigin` is empty, malformed or has an odd number of hex digits.
|
|
67
|
+
* @throws {InvalidTransactionPlanError} when `account` is malformed or `calldataOrigin` exceeds 1 MiB.
|
|
67
68
|
* @example
|
|
68
69
|
* ```ts
|
|
69
70
|
* import { prepareVaultV2ForceRedeem, type TransactionPlan } from "@morpho-org/morpho-sdk";
|
|
@@ -54,6 +54,7 @@ export interface VaultV2ForceWithdrawPlanParams extends Omit<IntentParams, "depl
|
|
|
54
54
|
* @throws {ExcessiveSlippageToleranceError} when `slippageTolerance` exceeds `MAX_SLIPPAGE_TOLERANCE`.
|
|
55
55
|
* @throws {InputExceedsMaxError} when the fee exceeds 10,000 bps, an input exceeds uint256 or the expiry exceeds the fee-projection horizon.
|
|
56
56
|
* @throws {InvalidCalldataOriginError} when `calldataOrigin` is empty, malformed or has an odd number of hex digits.
|
|
57
|
+
* @throws {InvalidTransactionPlanError} when `account` is malformed or `calldataOrigin` exceeds 1 MiB.
|
|
57
58
|
* @throws {ChainIdMismatchError} when the client declares or serves another chain.
|
|
58
59
|
* @throws {ReferralFeePctExceededError} when `referralFee.bps` equals 10,000.
|
|
59
60
|
* @throws {ReferralFeeRecipientMissingError} when a positive referral fee has no recipient or a zero recipient.
|
|
@@ -44,6 +44,7 @@ const validation_js_1 = require("../validation.js");
|
|
|
44
44
|
* @throws {ExcessiveSlippageToleranceError} when `slippageTolerance` exceeds `MAX_SLIPPAGE_TOLERANCE`.
|
|
45
45
|
* @throws {InputExceedsMaxError} when the fee exceeds 10,000 bps, an input exceeds uint256 or the expiry exceeds the fee-projection horizon.
|
|
46
46
|
* @throws {InvalidCalldataOriginError} when `calldataOrigin` is empty, malformed or has an odd number of hex digits.
|
|
47
|
+
* @throws {InvalidTransactionPlanError} when `account` is malformed or `calldataOrigin` exceeds 1 MiB.
|
|
47
48
|
* @throws {ChainIdMismatchError} when the client declares or serves another chain.
|
|
48
49
|
* @throws {ReferralFeePctExceededError} when `referralFee.bps` equals 10,000.
|
|
49
50
|
* @throws {ReferralFeeRecipientMissingError} when a positive referral fee has no recipient or a zero recipient.
|
|
@@ -63,6 +63,7 @@ export interface VaultV2InKindRedeemPlanParams extends Omit<IntentParams, "refer
|
|
|
63
63
|
* @throws {NonPositiveInputError} when `expiresAt` or `assets` is not positive.
|
|
64
64
|
* @throws {ExpiredDeadlineError} when the deadline has elapsed before preparation or permit creation finishes.
|
|
65
65
|
* @throws {InvalidCalldataOriginError} when `calldataOrigin` is empty, malformed or has an odd number of hex digits.
|
|
66
|
+
* @throws {InvalidTransactionPlanError} when `account` is malformed or `calldataOrigin` exceeds 1 MiB.
|
|
66
67
|
* @throws {ChainIdMismatchError} when the client declares or its endpoint serves another chain.
|
|
67
68
|
* @throws {VaultV2SingleAdapterRequiredError} when the snapshot does not contain exactly one adapter.
|
|
68
69
|
* @throws {AdapterNotPartOfVaultError} when `adapter` differs from the snapshot's sole adapter.
|
|
@@ -35,6 +35,7 @@ const validation_js_1 = require("../validation.js");
|
|
|
35
35
|
* @throws {NonPositiveInputError} when `expiresAt` or `assets` is not positive.
|
|
36
36
|
* @throws {ExpiredDeadlineError} when the deadline has elapsed before preparation or permit creation finishes.
|
|
37
37
|
* @throws {InvalidCalldataOriginError} when `calldataOrigin` is empty, malformed or has an odd number of hex digits.
|
|
38
|
+
* @throws {InvalidTransactionPlanError} when `account` is malformed or `calldataOrigin` exceeds 1 MiB.
|
|
38
39
|
* @throws {ChainIdMismatchError} when the client declares or its endpoint serves another chain.
|
|
39
40
|
* @throws {VaultV2SingleAdapterRequiredError} when the snapshot does not contain exactly one adapter.
|
|
40
41
|
* @throws {AdapterNotPartOfVaultError} when `adapter` differs from the snapshot's sole adapter.
|
|
@@ -50,6 +50,7 @@ export interface VaultV2RedeemPlanParams extends RedeemPlanParams {
|
|
|
50
50
|
* @throws {NegativeInputError} when `referralFee.bps` is negative.
|
|
51
51
|
* @throws {InputExceedsMaxError} when `referralFee.bps` exceeds 10,000 or `shares` exceeds uint256.
|
|
52
52
|
* @throws {InvalidCalldataOriginError} when `calldataOrigin` is empty, malformed or has an odd number of hex digits.
|
|
53
|
+
* @throws {InvalidTransactionPlanError} when `account` is malformed or `calldataOrigin` exceeds 1 MiB.
|
|
53
54
|
* @throws {ReferralFeePctExceededError} when `referralFee.bps` equals 10,000; the normalized fee must be below WAD.
|
|
54
55
|
* @throws {ReferralFeeRecipientMissingError} when a positive referral fee has no non-zero recipient.
|
|
55
56
|
* @throws {ChainIdMismatchError} when the declared or RPC chain differs from `chainId`.
|
|
@@ -31,6 +31,7 @@ const redeem_js_2 = require("../redeem.js");
|
|
|
31
31
|
* @throws {NegativeInputError} when `referralFee.bps` is negative.
|
|
32
32
|
* @throws {InputExceedsMaxError} when `referralFee.bps` exceeds 10,000 or `shares` exceeds uint256.
|
|
33
33
|
* @throws {InvalidCalldataOriginError} when `calldataOrigin` is empty, malformed or has an odd number of hex digits.
|
|
34
|
+
* @throws {InvalidTransactionPlanError} when `account` is malformed or `calldataOrigin` exceeds 1 MiB.
|
|
34
35
|
* @throws {ReferralFeePctExceededError} when `referralFee.bps` equals 10,000; the normalized fee must be below WAD.
|
|
35
36
|
* @throws {ReferralFeeRecipientMissingError} when a positive referral fee has no non-zero recipient.
|
|
36
37
|
* @throws {ChainIdMismatchError} when the declared or RPC chain differs from `chainId`.
|
|
@@ -37,6 +37,7 @@ export interface VaultV2WithdrawPlanParams extends WithdrawPlanParams<AccrualVau
|
|
|
37
37
|
* @throws {NegativeInputError} when `referralFee.bps` is negative.
|
|
38
38
|
* @throws {InputExceedsMaxError} when `referralFee.bps` exceeds 10,000 or `assets` exceeds uint256.
|
|
39
39
|
* @throws {InvalidCalldataOriginError} when `calldataOrigin` is empty, malformed or has an odd number of hex digits.
|
|
40
|
+
* @throws {InvalidTransactionPlanError} when `account` is malformed or `calldataOrigin` exceeds 1 MiB.
|
|
40
41
|
* @throws {ReferralFeePctExceededError} when `referralFee.bps` equals 10,000; the normalized fee must be below WAD.
|
|
41
42
|
* @throws {ReferralFeeRecipientMissingError} when a positive referral fee has no recipient or a zero recipient.
|
|
42
43
|
* @throws {ChainIdMismatchError} when the client targets another chain.
|
|
@@ -35,6 +35,7 @@ const withdraw_js_2 = require("../withdraw.js");
|
|
|
35
35
|
* @throws {NegativeInputError} when `referralFee.bps` is negative.
|
|
36
36
|
* @throws {InputExceedsMaxError} when `referralFee.bps` exceeds 10,000 or `assets` exceeds uint256.
|
|
37
37
|
* @throws {InvalidCalldataOriginError} when `calldataOrigin` is empty, malformed or has an odd number of hex digits.
|
|
38
|
+
* @throws {InvalidTransactionPlanError} when `account` is malformed or `calldataOrigin` exceeds 1 MiB.
|
|
38
39
|
* @throws {ReferralFeePctExceededError} when `referralFee.bps` equals 10,000; the normalized fee must be below WAD.
|
|
39
40
|
* @throws {ReferralFeeRecipientMissingError} when a positive referral fee has no recipient or a zero recipient.
|
|
40
41
|
* @throws {ChainIdMismatchError} when the client targets another chain.
|
package/lib/cjs/utils.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export { AdaptiveCurveIrmLib as BlueAdaptiveCurveIrmLib, CapacityLimitReason,
|
|
|
3
3
|
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
|
4
4
|
defaultPreLiquidationParamsRegistry as blueDefaultPreLiquidationParamsRegistry,
|
|
5
5
|
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
|
6
|
-
getDefaultPreLiquidationParams as getBlueDefaultPreLiquidationParams, MarketUtils as BlueMarketUtils, MathLib, SharesMath as BlueSharesMath, VaultUtils, VaultV2BlueMarketPublicAllocatorConfigUtils, VaultV2BluePublicAllocatorConfigUtils, VaultV2Utils, } from "@morpho-org/blue-sdk";
|
|
6
|
+
getDefaultPreLiquidationParams as getBlueDefaultPreLiquidationParams, MarketUtils as BlueMarketUtils, MathLib, SharesMath as BlueSharesMath, VaultUtils, VaultV2BlueMarketPublicAllocatorConfigUtils, VaultV2BluePublicAllocatorConfigUtils, VaultV2MidnightAdapterUtils, VaultV2Utils, } from "@morpho-org/blue-sdk";
|
|
7
7
|
export { catchRevertOnly, decodeBytes32String, getAuthorizationTypedData as getBlueAuthorizationTypedData, getPermit2PermitTypedData, getPermit2TransferFromTypedData, getPermitTypedData, isContractRevertError, isTransportError, isUndecodableResultError, MetaMorphoAction as BlueMetaMorphoAction, optionalBoolean, readContractRestructured, restructure, safeGetAddress, safeParseNumber, safeParseUnits, } from "@morpho-org/blue-sdk-viem";
|
|
8
8
|
export { EcrecoverRatifier as MidnightEcrecoverRatifier,
|
|
9
9
|
/** @deprecated Use MidnightEcrecoverRatifier with a tagged tree. */
|
|
@@ -17,7 +17,7 @@ RatifierUtils as MidnightRatifierUtils, SetterRatifier as MidnightSetterRatifier
|
|
|
17
17
|
/** @deprecated Use MidnightSetterRatifier with a tagged tree. */
|
|
18
18
|
SetterRatifierUtils as MidnightSetterRatifierUtils, TakeAmountsLib as MidnightTakeAmountsLib, TickLib as MidnightTickLib, TreeUtils as MidnightTreeUtils, } from "@morpho-org/midnight-sdk";
|
|
19
19
|
export type { ArrayElementType, DeepPartial, DottedKeys, FieldType, PartialDottedKeys, } from "@morpho-org/morpho-ts";
|
|
20
|
-
export { bigIntComparator, createGetValue, createHasValue, deepFreeze, entries, filterDefined, fromEntries, getLast, getLastDefined, getSubdomainBaseUrl, getValue, hasValue, isDefined, isNotNull, isNotUndefined, keys, mergeEntries, retryPromiseLinearBackoff, Time, transformValue, values, } from "@morpho-org/morpho-ts";
|
|
20
|
+
export { bigIntComparator, createGetValue, createHasValue, deepFreeze, entries, filterDefined, fromEntries, getLast, getLastDefined, getSubdomainBaseUrl, getValue, hasValue, isDefined, isNotNull, isNotUndefined, keys, MidnightPositionLib, mergeEntries, retryPromiseLinearBackoff, Time, transformValue, values, } from "@morpho-org/morpho-ts";
|
|
21
21
|
export { validateClientChainId } from "./actions/requirements/validateClientChainId.js";
|
|
22
22
|
export { addTransactionMetadata } from "./helpers/metadata.js";
|
|
23
23
|
export { type PreviewVaultV2ForceWithdrawParams, previewVaultV2ForceWithdraw, type VaultV2ForceWithdrawPreview, } from "./helpers/previewVaultV2ForceWithdraw.js";
|
package/lib/cjs/utils.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.resolveVaultV2ForceWithdrawEligibility = exports.computeVaultV2ForceWithdrawSharesBurnt = exports.computeVaultV2ForceWithdrawPlan = exports.computeVaultV2ForceWithdrawMinSharesBurnt = exports.computeVaultV2ForceWithdrawFeeSharesMinted = exports.validateUserAddress = exports.validateSlippageTolerance = exports.validateRepayShares = exports.validateRepayAmount = exports.validatePositionHealthAfterWithdraw = exports.validatePositionHealth = exports.validateNativeAsset = exports.validateChainId = exports.validateAccrualPosition = exports.computeMinForceWithdrawSharePrice = exports.previewVaultV2InKindRedeem = exports.previewVaultV2ForceWithdraw = exports.addTransactionMetadata = exports.validateClientChainId = exports.values = exports.transformValue = exports.Time = exports.retryPromiseLinearBackoff = exports.mergeEntries = exports.keys = exports.isNotUndefined = exports.isNotNull = exports.isDefined = exports.hasValue = exports.getValue = exports.getSubdomainBaseUrl = exports.getLastDefined = exports.getLast = exports.fromEntries = exports.filterDefined = exports.entries = exports.deepFreeze = void 0;
|
|
3
|
+
exports.createGetValue = exports.bigIntComparator = exports.MidnightTreeUtils = exports.MidnightTickLib = exports.MidnightTakeAmountsLib = exports.MidnightSetterRatifierUtils = exports.MidnightSetterRatifier = exports.MidnightRatifierUtils = exports.MidnightRatifier = exports.MidnightRateRatifierV1Utils = exports.MidnightRateRatifierV1 = exports.MidnightPriceRatifierV1Utils = exports.MidnightPriceRatifierV1 = exports.MidnightPositionUtils = exports.MidnightPayload = exports.MidnightOfferUtils = exports.MidnightOfferChainUtils = exports.MidnightMarketUtils = exports.MidnightGroupUtils = exports.eip712Digest = exports.MidnightEcrecoverRatifierUtils = exports.MidnightEcrecoverRatifier = exports.safeParseUnits = exports.safeParseNumber = exports.safeGetAddress = exports.restructure = exports.readContractRestructured = exports.optionalBoolean = exports.BlueMetaMorphoAction = exports.isUndecodableResultError = exports.isTransportError = exports.isContractRevertError = exports.getPermitTypedData = exports.getPermit2TransferFromTypedData = exports.getPermit2PermitTypedData = exports.getBlueAuthorizationTypedData = exports.decodeBytes32String = exports.catchRevertOnly = exports.VaultV2Utils = exports.VaultV2MidnightAdapterUtils = exports.VaultV2BluePublicAllocatorConfigUtils = exports.VaultV2BlueMarketPublicAllocatorConfigUtils = exports.VaultUtils = exports.BlueSharesMath = exports.MathLib = exports.BlueMarketUtils = exports.getBlueDefaultPreLiquidationParams = exports.blueDefaultPreLiquidationParamsRegistry = exports.CapacityLimitReason = exports.BlueAdaptiveCurveIrmLib = void 0;
|
|
4
|
+
exports.resolveVaultV2ForceWithdrawEligibility = exports.computeVaultV2ForceWithdrawSharesBurnt = exports.computeVaultV2ForceWithdrawPlan = exports.computeVaultV2ForceWithdrawMinSharesBurnt = exports.computeVaultV2ForceWithdrawFeeSharesMinted = exports.validateUserAddress = exports.validateSlippageTolerance = exports.validateRepayShares = exports.validateRepayAmount = exports.validatePositionHealthAfterWithdraw = exports.validatePositionHealth = exports.validateNativeAsset = exports.validateChainId = exports.validateAccrualPosition = exports.computeMinForceWithdrawSharePrice = exports.previewVaultV2InKindRedeem = exports.previewVaultV2ForceWithdraw = exports.addTransactionMetadata = exports.validateClientChainId = exports.values = exports.transformValue = exports.Time = exports.retryPromiseLinearBackoff = exports.mergeEntries = exports.MidnightPositionLib = exports.keys = exports.isNotUndefined = exports.isNotNull = exports.isDefined = exports.hasValue = exports.getValue = exports.getSubdomainBaseUrl = exports.getLastDefined = exports.getLast = exports.fromEntries = exports.filterDefined = exports.entries = exports.deepFreeze = exports.createHasValue = void 0;
|
|
5
5
|
var blue_sdk_1 = require("@morpho-org/blue-sdk");
|
|
6
6
|
Object.defineProperty(exports, "BlueAdaptiveCurveIrmLib", { enumerable: true, get: function () { return blue_sdk_1.AdaptiveCurveIrmLib; } });
|
|
7
7
|
Object.defineProperty(exports, "CapacityLimitReason", { enumerable: true, get: function () { return blue_sdk_1.CapacityLimitReason; } });
|
|
@@ -15,6 +15,7 @@ Object.defineProperty(exports, "BlueSharesMath", { enumerable: true, get: functi
|
|
|
15
15
|
Object.defineProperty(exports, "VaultUtils", { enumerable: true, get: function () { return blue_sdk_1.VaultUtils; } });
|
|
16
16
|
Object.defineProperty(exports, "VaultV2BlueMarketPublicAllocatorConfigUtils", { enumerable: true, get: function () { return blue_sdk_1.VaultV2BlueMarketPublicAllocatorConfigUtils; } });
|
|
17
17
|
Object.defineProperty(exports, "VaultV2BluePublicAllocatorConfigUtils", { enumerable: true, get: function () { return blue_sdk_1.VaultV2BluePublicAllocatorConfigUtils; } });
|
|
18
|
+
Object.defineProperty(exports, "VaultV2MidnightAdapterUtils", { enumerable: true, get: function () { return blue_sdk_1.VaultV2MidnightAdapterUtils; } });
|
|
18
19
|
Object.defineProperty(exports, "VaultV2Utils", { enumerable: true, get: function () { return blue_sdk_1.VaultV2Utils; } });
|
|
19
20
|
var blue_sdk_viem_1 = require("@morpho-org/blue-sdk-viem");
|
|
20
21
|
Object.defineProperty(exports, "catchRevertOnly", { enumerable: true, get: function () { return blue_sdk_viem_1.catchRevertOnly; } });
|
|
@@ -76,6 +77,7 @@ Object.defineProperty(exports, "isDefined", { enumerable: true, get: function ()
|
|
|
76
77
|
Object.defineProperty(exports, "isNotNull", { enumerable: true, get: function () { return morpho_ts_1.isNotNull; } });
|
|
77
78
|
Object.defineProperty(exports, "isNotUndefined", { enumerable: true, get: function () { return morpho_ts_1.isNotUndefined; } });
|
|
78
79
|
Object.defineProperty(exports, "keys", { enumerable: true, get: function () { return morpho_ts_1.keys; } });
|
|
80
|
+
Object.defineProperty(exports, "MidnightPositionLib", { enumerable: true, get: function () { return morpho_ts_1.MidnightPositionLib; } });
|
|
79
81
|
Object.defineProperty(exports, "mergeEntries", { enumerable: true, get: function () { return morpho_ts_1.mergeEntries; } });
|
|
80
82
|
Object.defineProperty(exports, "retryPromiseLinearBackoff", { enumerable: true, get: function () { return morpho_ts_1.retryPromiseLinearBackoff; } });
|
|
81
83
|
Object.defineProperty(exports, "Time", { enumerable: true, get: function () { return morpho_ts_1.Time; } });
|
package/lib/cjs/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** Installed @morpho-org/morpho-sdk package version. */
|
|
2
|
-
export declare const version = "10.0.
|
|
2
|
+
export declare const version = "10.1.0-next.0";
|
package/lib/cjs/version.js
CHANGED
package/lib/esm/abis.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { marketParamsAbi as blueMarketParamsAbi } from "@morpho-org/blue-sdk";
|
|
2
|
-
export { adaptiveCurveIrmAbi as blueAdaptiveCurveIrmAbi, blueAbi, blueOracleAbi, erc2612Abi, erc3643Abi, erc3643IdentityRegistryAbi, erc5267Abi, metaMorphoAbi, metaMorphoFactoryAbi, morphoMarketV1AdapterAbi, morphoMarketV1AdapterFactoryAbi, morphoMarketV1AdapterV2Abi, morphoMarketV1AdapterV2FactoryAbi, morphoVaultV1AdapterAbi, morphoVaultV1AdapterFactoryAbi, permissionedErc20WrapperAbi, permit2Abi,
|
|
2
|
+
export { adaptiveCurveIrmAbi as blueAdaptiveCurveIrmAbi, blueAbi, blueOracleAbi, erc2612Abi, erc3643Abi, erc3643IdentityRegistryAbi, erc5267Abi, metaMorphoAbi, metaMorphoFactoryAbi, midnightAdapterAbi, midnightAdapterFactoryAbi, midnightAdapterPriceRatifierV1Abi, midnightAdapterRateRatifierV1Abi, morphoMarketV1AdapterAbi, morphoMarketV1AdapterFactoryAbi, morphoMarketV1AdapterV2Abi, morphoMarketV1AdapterV2FactoryAbi, morphoVaultV1AdapterAbi, morphoVaultV1AdapterFactoryAbi, permissionedErc20WrapperAbi, permit2Abi,
|
|
3
3
|
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
|
4
4
|
preLiquidationAbi as bluePreLiquidationAbi,
|
|
5
5
|
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
package/lib/esm/abis.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { marketParamsAbi as blueMarketParamsAbi } from "@morpho-org/blue-sdk";
|
|
2
|
-
export { adaptiveCurveIrmAbi as blueAdaptiveCurveIrmAbi, blueAbi, blueOracleAbi, erc2612Abi, erc3643Abi, erc3643IdentityRegistryAbi, erc5267Abi, metaMorphoAbi, metaMorphoFactoryAbi, morphoMarketV1AdapterAbi, morphoMarketV1AdapterFactoryAbi, morphoMarketV1AdapterV2Abi, morphoMarketV1AdapterV2FactoryAbi, morphoVaultV1AdapterAbi, morphoVaultV1AdapterFactoryAbi, permissionedErc20WrapperAbi, permit2Abi,
|
|
2
|
+
export { adaptiveCurveIrmAbi as blueAdaptiveCurveIrmAbi, blueAbi, blueOracleAbi, erc2612Abi, erc3643Abi, erc3643IdentityRegistryAbi, erc5267Abi, metaMorphoAbi, metaMorphoFactoryAbi, midnightAdapterAbi, midnightAdapterFactoryAbi, midnightAdapterPriceRatifierV1Abi, midnightAdapterRateRatifierV1Abi, morphoMarketV1AdapterAbi, morphoMarketV1AdapterFactoryAbi, morphoMarketV1AdapterV2Abi, morphoMarketV1AdapterV2FactoryAbi, morphoVaultV1AdapterAbi, morphoVaultV1AdapterFactoryAbi, permissionedErc20WrapperAbi, permit2Abi,
|
|
3
3
|
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
|
4
4
|
preLiquidationAbi as bluePreLiquidationAbi,
|
|
5
5
|
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { MarketParams } from "@morpho-org/blue-sdk";
|
|
2
2
|
import { type Address } from "viem";
|
|
3
|
-
import {
|
|
3
|
+
import type { AuthorizationRequirementSignature, BlueRefinanceAction, Metadata, Transaction, VaultV2BlueReallocation } from "../../types/index.js";
|
|
4
4
|
/** Parameters for {@link blueRefinance}. */
|
|
5
5
|
export interface BlueRefinanceParams {
|
|
6
6
|
/** Chain plus source and destination Morpho Blue markets. */
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { encodeFunctionData
|
|
1
|
+
import { encodeFunctionData } from "viem";
|
|
2
2
|
import { blueBundlesV1Abi } from "../../abis.js";
|
|
3
3
|
import { validateMarketParamsId, validateUint256Field, } from "../../helpers/validate.js";
|
|
4
|
-
import { RefinanceSameMarketError, RefinanceTokenMismatchError, } from "../../types/index.js";
|
|
5
4
|
import { finalizeBlueBundlesV1Transaction, getBlueBundlesV1PenaltyAssets, getBlueBundlesV1PublicAllocations, getBlueBundlesV1SignedAuthorization, normalizeBlueBundlesV1CommonParams, } from "./common.js";
|
|
5
|
+
import { validateBlueRefinanceMarkets } from "./refinanceValidation.js";
|
|
6
6
|
/**
|
|
7
7
|
* Encodes a direct BlueBundlesV1 full borrow-position migration transaction.
|
|
8
8
|
*
|
|
@@ -68,13 +68,8 @@ export const blueRefinance = (params) => {
|
|
|
68
68
|
validateMarketParamsId(sourceMarketParams);
|
|
69
69
|
validateMarketParamsId(destinationMarketParams);
|
|
70
70
|
const { userAddress, maxLtv, authorizationSignature } = params.args;
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}
|
|
74
|
-
if (!isAddressEqual(sourceMarketParams.loanToken, destinationMarketParams.loanToken) ||
|
|
75
|
-
!isAddressEqual(sourceMarketParams.collateralToken, destinationMarketParams.collateralToken)) {
|
|
76
|
-
throw new RefinanceTokenMismatchError(sourceMarketParams.id, destinationMarketParams.id);
|
|
77
|
-
}
|
|
71
|
+
// Reject same-market migrations and token mismatches before encoding.
|
|
72
|
+
validateBlueRefinanceMarkets(sourceMarketParams, destinationMarketParams);
|
|
78
73
|
validateUint256Field("maxLtv", maxLtv);
|
|
79
74
|
const common = {
|
|
80
75
|
chainId,
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type AccrualPosition, type MarketParams } from "@morpho-org/blue-sdk";
|
|
2
|
+
import { type VaultV2BlueReallocation } from "../../types/index.js";
|
|
3
|
+
/** @internal Rejects an empty source debt or incompatible refinance markets. */
|
|
4
|
+
export declare function validateBlueRefinanceSource({ sourceMarketParams, destinationMarketParams, borrowShares, }: {
|
|
5
|
+
readonly sourceMarketParams: MarketParams;
|
|
6
|
+
readonly destinationMarketParams: MarketParams;
|
|
7
|
+
readonly borrowShares: bigint;
|
|
8
|
+
}): void;
|
|
9
|
+
/** @internal Requires distinct markets with identical loan and collateral tokens. */
|
|
10
|
+
export declare function validateBlueRefinanceMarkets(sourceMarketParams: MarketParams, destinationMarketParams: MarketParams): void;
|
|
11
|
+
/** @internal Checks the migration quote, including destination debt from allocator penalties and fees. */
|
|
12
|
+
export declare function validateBlueRefinanceQuote({ destinationMarketParams, sourcePosition, destinationPosition, reallocations, referralFeePct, now, }: {
|
|
13
|
+
readonly destinationMarketParams: MarketParams;
|
|
14
|
+
readonly sourcePosition: Readonly<AccrualPosition>;
|
|
15
|
+
readonly destinationPosition: Readonly<AccrualPosition>;
|
|
16
|
+
readonly reallocations: readonly VaultV2BlueReallocation[];
|
|
17
|
+
readonly referralFeePct: bigint;
|
|
18
|
+
readonly now: bigint;
|
|
19
|
+
}): void;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { MathLib, } from "@morpho-org/blue-sdk";
|
|
2
|
+
import { Time } from "@morpho-org/morpho-ts";
|
|
3
|
+
import { isAddressEqual } from "viem";
|
|
4
|
+
import { validatePositionHealth } from "../../helpers/validate.js";
|
|
5
|
+
import { NonPositiveInputError, RefinanceSameMarketError, RefinanceTokenMismatchError, } from "../../types/index.js";
|
|
6
|
+
import { getBlueBundlesV1PenaltyAssets, getBlueBundlesV1PublicAllocations, getBlueBundlesV1ReferralFeeAssets, } from "./common.js";
|
|
7
|
+
/** @internal Rejects an empty source debt or incompatible refinance markets. */
|
|
8
|
+
export function validateBlueRefinanceSource({ sourceMarketParams, destinationMarketParams, borrowShares, }) {
|
|
9
|
+
if (borrowShares <= 0n) {
|
|
10
|
+
throw new NonPositiveInputError("positionData.borrowShares", borrowShares);
|
|
11
|
+
}
|
|
12
|
+
// Reject same-market migrations and token mismatches before quoting.
|
|
13
|
+
validateBlueRefinanceMarkets(sourceMarketParams, destinationMarketParams);
|
|
14
|
+
}
|
|
15
|
+
/** @internal Requires distinct markets with identical loan and collateral tokens. */
|
|
16
|
+
export function validateBlueRefinanceMarkets(sourceMarketParams, destinationMarketParams) {
|
|
17
|
+
if (sourceMarketParams.id === destinationMarketParams.id) {
|
|
18
|
+
throw new RefinanceSameMarketError(sourceMarketParams.id);
|
|
19
|
+
}
|
|
20
|
+
if (!isAddressEqual(sourceMarketParams.loanToken, destinationMarketParams.loanToken) ||
|
|
21
|
+
!isAddressEqual(sourceMarketParams.collateralToken, destinationMarketParams.collateralToken)) {
|
|
22
|
+
throw new RefinanceTokenMismatchError(sourceMarketParams.id, destinationMarketParams.id);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
/** @internal Checks the migration quote, including destination debt from allocator penalties and fees. */
|
|
26
|
+
export function validateBlueRefinanceQuote({ destinationMarketParams, sourcePosition, destinationPosition, reallocations, referralFeePct, now, }) {
|
|
27
|
+
const allocations = getBlueBundlesV1PublicAllocations(reallocations, destinationMarketParams);
|
|
28
|
+
const penaltyAssets = getBlueBundlesV1PenaltyAssets(allocations);
|
|
29
|
+
const accrualTimestamp = MathLib.max(now, sourcePosition.market.lastUpdate, destinationPosition.market.lastUpdate) + Time.s.from.h(2n);
|
|
30
|
+
const source = sourcePosition.accrueInterest(accrualTimestamp);
|
|
31
|
+
const destination = destinationPosition.accrueInterest(accrualTimestamp);
|
|
32
|
+
const feeAssets = getBlueBundlesV1ReferralFeeAssets(source.borrowAssets, referralFeePct);
|
|
33
|
+
// Health is checked before authorizing or encoding the migration; the contract rechecks maxLtv.
|
|
34
|
+
validatePositionHealth({
|
|
35
|
+
positionData: destination,
|
|
36
|
+
additionalCollateral: source.collateral,
|
|
37
|
+
borrowAmount: source.borrowAssets + penaltyAssets + feeAssets,
|
|
38
|
+
marketId: destinationMarketParams.id,
|
|
39
|
+
lltv: destinationMarketParams.lltv,
|
|
40
|
+
});
|
|
41
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Address } from "@morpho-org/blue-sdk";
|
|
2
2
|
import type { ERC20ApprovalAction, Transaction } from "../../../types/index.js";
|
|
3
3
|
/** Parameters for {@link encodeErc20Approval}. */
|
|
4
4
|
interface EncodeErc20ApprovalParams {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { MathLib } from "@morpho-org/blue-sdk";
|
|
2
1
|
import { deepFreeze } from "@morpho-org/morpho-ts";
|
|
3
|
-
import { encodeFunctionData, erc20Abi
|
|
4
|
-
import {
|
|
2
|
+
import { encodeFunctionData, erc20Abi } from "viem";
|
|
3
|
+
import { capTokenApproval } from "../../../helpers/tokenApproval.js";
|
|
5
4
|
import { validateRequirementSpender } from "../../../helpers/validateRequirementSpender.js";
|
|
6
5
|
/**
|
|
7
6
|
* Encodes a deep-frozen ERC-20 approval transaction for a supported SDK spender.
|
|
@@ -33,7 +32,7 @@ import { validateRequirementSpender } from "../../../helpers/validateRequirement
|
|
|
33
32
|
* ```
|
|
34
33
|
*/
|
|
35
34
|
export const encodeErc20Approval = (params) => {
|
|
36
|
-
const { token, spender,
|
|
35
|
+
const { token, spender, chainId } = params;
|
|
37
36
|
// Reject approval targets outside the SDK's registered protocol spenders.
|
|
38
37
|
validateRequirementSpender({
|
|
39
38
|
chainId,
|
|
@@ -47,10 +46,7 @@ export const encodeErc20Approval = (params) => {
|
|
|
47
46
|
"blueBundlesV1",
|
|
48
47
|
],
|
|
49
48
|
});
|
|
50
|
-
const amountValue =
|
|
51
|
-
// Checksum the lookup key so a differently-cased token still resolves its per-token cap
|
|
52
|
-
// instead of falling back to `maxUint256`, which UNI/ONDO/COMP/FLUID reject above `uint96`.
|
|
53
|
-
MAX_TOKEN_APPROVALS[chainId]?.[getAddress(token)] ?? maxUint256);
|
|
49
|
+
const amountValue = capTokenApproval(params);
|
|
54
50
|
return deepFreeze({
|
|
55
51
|
to: token,
|
|
56
52
|
data: encodeFunctionData({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Address } from "@morpho-org/blue-sdk";
|
|
2
2
|
import type { Client } from "viem";
|
|
3
|
-
import {
|
|
3
|
+
import type { Erc2612RequirementSignature, ReferenceTimestampParams, Requirement } from "../../../types/index.js";
|
|
4
4
|
/** Parameters for {@link encodeErc20Permit}. */
|
|
5
5
|
interface EncodeErc20PermitParams extends ReferenceTimestampParams {
|
|
6
6
|
token: Address;
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { fetchToken, getPermitTypedData } from "@morpho-org/blue-sdk-viem";
|
|
2
2
|
import { deepFreeze, Time } from "@morpho-org/morpho-ts";
|
|
3
3
|
import { signAndVerifyTypedData } from "../../../helpers/signAndVerifyTypedData.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { ChainIdMismatchError, ExpiredDeadlineError, } from "../../../types/index.js";
|
|
7
|
-
import { validateClientChainId } from "../validateClientChainId.js";
|
|
4
|
+
import { validateUserAddress } from "../../../helpers/validate.js";
|
|
5
|
+
import { validateErc2612Permit } from "../../../reads/readErc2612Permit.js";
|
|
8
6
|
/**
|
|
9
7
|
* Builds an EIP-2612 permit `Requirement` that, once signed, lets a supported SDK spender pull
|
|
10
8
|
* `amount` of `token`.
|
|
@@ -75,26 +73,12 @@ import { validateClientChainId } from "../validateClientChainId.js";
|
|
|
75
73
|
*/
|
|
76
74
|
export const encodeErc20Permit = async (viemClient, params) => {
|
|
77
75
|
const { token, owner, spender, amount, chainId, nonce, supportDeployless } = params;
|
|
78
|
-
|
|
79
|
-
throw new ChainIdMismatchError(viemClient.chain?.id, chainId);
|
|
80
|
-
}
|
|
81
|
-
validateRequirementSpender({
|
|
76
|
+
const deadline = await validateErc2612Permit(viemClient, {
|
|
82
77
|
chainId,
|
|
83
78
|
spender,
|
|
84
|
-
|
|
79
|
+
deadline: params.deadline,
|
|
80
|
+
now: params.now ?? Time.timestamp(),
|
|
85
81
|
});
|
|
86
|
-
const timestamp = params.now ?? Time.timestamp();
|
|
87
|
-
// Validate an explicit deadline before the token-metadata read: this exported encoder can be
|
|
88
|
-
// called independently of the BlueBundlesV1 resolver, and an out-of-range or already-expired
|
|
89
|
-
// deadline otherwise surfaces only as a downstream wallet typed-data error or an on-chain revert.
|
|
90
|
-
if (params.deadline != null) {
|
|
91
|
-
validateDeadline(params.deadline);
|
|
92
|
-
if (params.deadline <= timestamp) {
|
|
93
|
-
throw new ExpiredDeadlineError(params.deadline, timestamp);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
const deadline = params.deadline ?? (params.now ?? Time.timestamp()) + Time.s.from.h(2n);
|
|
97
|
-
await validateClientChainId(viemClient, chainId);
|
|
98
82
|
const tokenData = await fetchToken(token, viemClient, {
|
|
99
83
|
deployless: supportDeployless,
|
|
100
84
|
});
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { APPROVE_ONLY_ONCE_TOKENS } from "../../helpers/constant.js";
|
|
1
|
+
import { getTokenApprovalAmounts } from "../../helpers/tokenApproval.js";
|
|
3
2
|
import { encodeErc20Approval } from "./encode/encodeErc20Approval.js";
|
|
4
3
|
/**
|
|
5
4
|
* Computes classic ERC-20 approval transactions for a supported SDK spender, given the existing
|
|
@@ -40,23 +39,10 @@ import { encodeErc20Approval } from "./encode/encodeErc20Approval.js";
|
|
|
40
39
|
*/
|
|
41
40
|
export const getRequirementsApproval = (params) => {
|
|
42
41
|
const { address, chainId, args: { spendAmount, spender }, allowances, } = params;
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
spender,
|
|
50
|
-
amount: 0n,
|
|
51
|
-
chainId,
|
|
52
|
-
}));
|
|
53
|
-
}
|
|
54
|
-
approvals.push(encodeErc20Approval({
|
|
55
|
-
token: address,
|
|
56
|
-
spender,
|
|
57
|
-
amount: maxUint256,
|
|
58
|
-
chainId,
|
|
59
|
-
}));
|
|
60
|
-
}
|
|
61
|
-
return approvals;
|
|
42
|
+
return getTokenApprovalAmounts({
|
|
43
|
+
token: address,
|
|
44
|
+
chainId,
|
|
45
|
+
allowance: allowances,
|
|
46
|
+
spendAmount,
|
|
47
|
+
}).map((amount) => encodeErc20Approval({ token: address, spender, amount, chainId }));
|
|
62
48
|
};
|
|
@@ -1,26 +1 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* Validates both the chain the viem client declares and the chain its transport serves.
|
|
4
|
-
*
|
|
5
|
-
* Sends one `eth_chainId` request per call; the result is never cached, so every flow observes the
|
|
6
|
-
* endpoint it actually reads from. An honest RPC connected to another chain fails here, before any
|
|
7
|
-
* state read. A provider that lies about `eth_chainId` is not detected (see THREAT_MODEL.md, RPC).
|
|
8
|
-
*
|
|
9
|
-
* @param client - Viem client whose declared chain and transport are checked.
|
|
10
|
-
* @param expectedChainId - Chain ID expected by the entity or action.
|
|
11
|
-
* @returns Resolves only when both the declared and the observed chain IDs equal
|
|
12
|
-
* `expectedChainId`.
|
|
13
|
-
* @throws {ChainIdMismatchError} when the declared or the observed chain ID differs from
|
|
14
|
-
* `expectedChainId`.
|
|
15
|
-
* @throws {viem.BaseError} when the `eth_chainId` request fails.
|
|
16
|
-
* @example
|
|
17
|
-
* ```ts
|
|
18
|
-
* import { createPublicClient, http } from "viem";
|
|
19
|
-
* import { mainnet } from "viem/chains";
|
|
20
|
-
* import { validateClientChainId } from "@morpho-org/morpho-sdk";
|
|
21
|
-
*
|
|
22
|
-
* const client = createPublicClient({ chain: mainnet, transport: http() });
|
|
23
|
-
* await validateClientChainId(client, mainnet.id);
|
|
24
|
-
* ```
|
|
25
|
-
*/
|
|
26
|
-
export declare const validateClientChainId: (client: Client, expectedChainId: number) => Promise<void>;
|
|
1
|
+
export { validateClientChainId } from "../../reads/validateClientChainId.js";
|
|
@@ -1,30 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { validateChainId } from "../../helpers/validate.js";
|
|
3
|
-
/**
|
|
4
|
-
* Validates both the chain the viem client declares and the chain its transport serves.
|
|
5
|
-
*
|
|
6
|
-
* Sends one `eth_chainId` request per call; the result is never cached, so every flow observes the
|
|
7
|
-
* endpoint it actually reads from. An honest RPC connected to another chain fails here, before any
|
|
8
|
-
* state read. A provider that lies about `eth_chainId` is not detected (see THREAT_MODEL.md, RPC).
|
|
9
|
-
*
|
|
10
|
-
* @param client - Viem client whose declared chain and transport are checked.
|
|
11
|
-
* @param expectedChainId - Chain ID expected by the entity or action.
|
|
12
|
-
* @returns Resolves only when both the declared and the observed chain IDs equal
|
|
13
|
-
* `expectedChainId`.
|
|
14
|
-
* @throws {ChainIdMismatchError} when the declared or the observed chain ID differs from
|
|
15
|
-
* `expectedChainId`.
|
|
16
|
-
* @throws {viem.BaseError} when the `eth_chainId` request fails.
|
|
17
|
-
* @example
|
|
18
|
-
* ```ts
|
|
19
|
-
* import { createPublicClient, http } from "viem";
|
|
20
|
-
* import { mainnet } from "viem/chains";
|
|
21
|
-
* import { validateClientChainId } from "@morpho-org/morpho-sdk";
|
|
22
|
-
*
|
|
23
|
-
* const client = createPublicClient({ chain: mainnet, transport: http() });
|
|
24
|
-
* await validateClientChainId(client, mainnet.id);
|
|
25
|
-
* ```
|
|
26
|
-
*/
|
|
27
|
-
export const validateClientChainId = async (client, expectedChainId) => {
|
|
28
|
-
validateChainId(client.chain?.id, expectedChainId);
|
|
29
|
-
validateChainId(await getChainId(client), expectedChainId);
|
|
30
|
-
};
|
|
1
|
+
export { validateClientChainId } from "../../reads/validateClientChainId.js";
|
|
@@ -40,7 +40,8 @@ export interface VaultV2ForceRedeemParams {
|
|
|
40
40
|
* penalty is taken.
|
|
41
41
|
* @param params.metadata - Optional analytics metadata attached to the multicall transaction.
|
|
42
42
|
* @returns A deep-frozen `Transaction<VaultV2ForceRedeemAction>` with `to`, `value`, `data`, and
|
|
43
|
-
* the typed `action` discriminator the simulation layer consumes.
|
|
43
|
+
* the typed `action` discriminator the simulation layer consumes. Input deallocations and their
|
|
44
|
+
* market parameters are not frozen.
|
|
44
45
|
* @throws {EmptyDeallocationsError} when `deallocations` is empty.
|
|
45
46
|
* @throws {NonPositiveInputError} when `redeem.shares <= 0n` or any deallocation amount is
|
|
46
47
|
* non-positive.
|
|
@@ -29,7 +29,8 @@ import { EmptyDeallocationsError, NonPositiveInputError, } from "../../types/ind
|
|
|
29
29
|
* penalty is taken.
|
|
30
30
|
* @param params.metadata - Optional analytics metadata attached to the multicall transaction.
|
|
31
31
|
* @returns A deep-frozen `Transaction<VaultV2ForceRedeemAction>` with `to`, `value`, `data`, and
|
|
32
|
-
* the typed `action` discriminator the simulation layer consumes.
|
|
32
|
+
* the typed `action` discriminator the simulation layer consumes. Input deallocations and their
|
|
33
|
+
* market parameters are not frozen.
|
|
33
34
|
* @throws {EmptyDeallocationsError} when `deallocations` is empty.
|
|
34
35
|
* @throws {NonPositiveInputError} when `redeem.shares <= 0n` or any deallocation amount is
|
|
35
36
|
* non-positive.
|
|
@@ -82,7 +83,24 @@ export const vaultV2ForceRedeem = ({ vault: { address: vaultAddress }, args: { d
|
|
|
82
83
|
type: "vaultV2ForceRedeem",
|
|
83
84
|
args: {
|
|
84
85
|
vault: vaultAddress,
|
|
85
|
-
deallocations: deallocations.map((
|
|
86
|
+
deallocations: deallocations.map((deallocation) => {
|
|
87
|
+
const { adapter, amount, marketParams } = deallocation;
|
|
88
|
+
return {
|
|
89
|
+
adapter,
|
|
90
|
+
amount,
|
|
91
|
+
...(Object.hasOwn(deallocation, "marketParams") && {
|
|
92
|
+
marketParams: marketParams && {
|
|
93
|
+
loanToken: marketParams.loanToken,
|
|
94
|
+
collateralToken: marketParams.collateralToken,
|
|
95
|
+
oracle: marketParams.oracle,
|
|
96
|
+
irm: marketParams.irm,
|
|
97
|
+
lltv: marketParams.lltv,
|
|
98
|
+
id: marketParams.id,
|
|
99
|
+
liquidationIncentiveFactor: marketParams.liquidationIncentiveFactor,
|
|
100
|
+
},
|
|
101
|
+
}),
|
|
102
|
+
};
|
|
103
|
+
}),
|
|
86
104
|
redeem: {
|
|
87
105
|
shares: redeem.shares,
|
|
88
106
|
recipient: redeem.recipient,
|
package/lib/esm/blue/abis.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { marketParamsAbi } from "@morpho-org/blue-sdk";
|
|
2
|
-
export { adaptiveCurveIrmAbi, blueAbi, blueOracleAbi, erc2612Abi, erc3643Abi, erc3643IdentityRegistryAbi, erc5267Abi, metaMorphoAbi, metaMorphoFactoryAbi, morphoMarketV1AdapterAbi, morphoMarketV1AdapterFactoryAbi, morphoMarketV1AdapterV2Abi, morphoMarketV1AdapterV2FactoryAbi, morphoVaultV1AdapterAbi, morphoVaultV1AdapterFactoryAbi, permissionedErc20WrapperAbi, permit2Abi,
|
|
2
|
+
export { adaptiveCurveIrmAbi, blueAbi, blueOracleAbi, erc2612Abi, erc3643Abi, erc3643IdentityRegistryAbi, erc5267Abi, metaMorphoAbi, metaMorphoFactoryAbi, midnightAdapterAbi, midnightAdapterFactoryAbi, midnightAdapterPriceRatifierV1Abi, midnightAdapterRateRatifierV1Abi, morphoMarketV1AdapterAbi, morphoMarketV1AdapterFactoryAbi, morphoMarketV1AdapterV2Abi, morphoMarketV1AdapterV2FactoryAbi, morphoVaultV1AdapterAbi, morphoVaultV1AdapterFactoryAbi, permissionedErc20WrapperAbi, permit2Abi,
|
|
3
3
|
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
|
4
4
|
preLiquidationAbi,
|
|
5
5
|
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
package/lib/esm/blue/abis.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { marketParamsAbi } from "@morpho-org/blue-sdk";
|
|
2
|
-
export { adaptiveCurveIrmAbi, blueAbi, blueOracleAbi, erc2612Abi, erc3643Abi, erc3643IdentityRegistryAbi, erc5267Abi, metaMorphoAbi, metaMorphoFactoryAbi, morphoMarketV1AdapterAbi, morphoMarketV1AdapterFactoryAbi, morphoMarketV1AdapterV2Abi, morphoMarketV1AdapterV2FactoryAbi, morphoVaultV1AdapterAbi, morphoVaultV1AdapterFactoryAbi, permissionedErc20WrapperAbi, permit2Abi,
|
|
2
|
+
export { adaptiveCurveIrmAbi, blueAbi, blueOracleAbi, erc2612Abi, erc3643Abi, erc3643IdentityRegistryAbi, erc5267Abi, metaMorphoAbi, metaMorphoFactoryAbi, midnightAdapterAbi, midnightAdapterFactoryAbi, midnightAdapterPriceRatifierV1Abi, midnightAdapterRateRatifierV1Abi, morphoMarketV1AdapterAbi, morphoMarketV1AdapterFactoryAbi, morphoMarketV1AdapterV2Abi, morphoMarketV1AdapterV2FactoryAbi, morphoVaultV1AdapterAbi, morphoVaultV1AdapterFactoryAbi, permissionedErc20WrapperAbi, permit2Abi,
|
|
3
3
|
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
|
4
4
|
preLiquidationAbi,
|
|
5
5
|
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export type { IAccrualPosition, IAccrualVault, IAccrualVaultV2, IAccrualVaultV2Adapter, IAccrualVaultV2MorphoMarketV1Adapter, IAccrualVaultV2MorphoMarketV1AdapterV2, IAccrualVaultV2MorphoVaultV1Adapter, IAssetBalances, IEip5267Domain, IHolding, IMarket, IMarketParams, IPosition,
|
|
1
|
+
export type { IAccrualPosition, IAccrualVault, IAccrualVaultV2, IAccrualVaultV2Adapter, IAccrualVaultV2MidnightAdapter, IAccrualVaultV2MorphoMarketV1Adapter, IAccrualVaultV2MorphoMarketV1AdapterV2, IAccrualVaultV2MorphoVaultV1Adapter, IAssetBalances, IEip5267Domain, IHolding, IMarket, IMarketParams, IPosition,
|
|
2
2
|
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
|
3
3
|
IPreLiquidationParams,
|
|
4
4
|
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
|
5
|
-
IPreLiquidationPosition, IToken, IVault, IVaultConfig, IVaultMarketAllocation, IVaultMarketConfig, IVaultToken, IVaultUser, IVaultV2, IVaultV2Adapter, IVaultV2Allocation, IVaultV2BlueMarketPublicAllocatorConfig, IVaultV2BluePublicAllocatorConfig, IVaultV2MorphoMarketV1Adapter, IVaultV2MorphoMarketV1AdapterV2, IVaultV2MorphoVaultV1Adapter, PeripheralBalance, PeripheralBalanceType, } from "@morpho-org/blue-sdk";
|
|
6
|
-
export { AccrualPosition, AccrualVault, AccrualVaultV2, AccrualVaultV2MorphoMarketV1Adapter, AccrualVaultV2MorphoMarketV1AdapterV2, AccrualVaultV2MorphoVaultV1Adapter, AssetBalances, ConstantWrappedToken, Eip5267Domain, ExchangeRateWrappedToken, Holding, Market, MarketParams, Position,
|
|
5
|
+
IPreLiquidationPosition, IToken, IVault, IVaultConfig, IVaultMarketAllocation, IVaultMarketConfig, IVaultToken, IVaultUser, IVaultV2, IVaultV2Adapter, IVaultV2Allocation, IVaultV2BlueMarketPublicAllocatorConfig, IVaultV2BluePublicAllocatorConfig, IVaultV2MidnightAdapter, IVaultV2MidnightAdapterAccrualMarket, IVaultV2MidnightAdapterCollateralParams, IVaultV2MidnightAdapterMarket, IVaultV2MidnightAdapterMarketData, IVaultV2MidnightAdapterMarketState, IVaultV2MidnightAdapterMidnightMarket, IVaultV2MidnightAdapterPosition, IVaultV2MorphoMarketV1Adapter, IVaultV2MorphoMarketV1AdapterV2, IVaultV2MorphoVaultV1Adapter, PeripheralBalance, PeripheralBalanceType, VaultV2MidnightAdapterAccrualMarket, VaultV2MidnightAdapterMarketData, } from "@morpho-org/blue-sdk";
|
|
6
|
+
export { AccrualPosition, AccrualVault, AccrualVaultV2, AccrualVaultV2MidnightAdapter, AccrualVaultV2MorphoMarketV1Adapter, AccrualVaultV2MorphoMarketV1AdapterV2, AccrualVaultV2MorphoVaultV1Adapter, AssetBalances, ConstantWrappedToken, Eip5267Domain, ExchangeRateWrappedToken, Holding, Market, MarketParams, Position,
|
|
7
7
|
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
|
8
8
|
PreLiquidationParams,
|
|
9
9
|
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
|
10
|
-
PreLiquidationPosition, Token, User, Vault, VaultConfig, VaultMarketAllocation, VaultMarketConfig, VaultToken, VaultUser, VaultV2, VaultV2Adapter, VaultV2BlueMarketPublicAllocatorConfig, VaultV2BluePublicAllocatorConfig, VaultV2MorphoMarketV1Adapter, VaultV2MorphoMarketV1AdapterV2, VaultV2MorphoVaultV1Adapter, WrappedToken, } from "@morpho-org/blue-sdk";
|
|
10
|
+
PreLiquidationPosition, Token, User, Vault, VaultConfig, VaultMarketAllocation, VaultMarketConfig, VaultToken, VaultUser, VaultV2, VaultV2Adapter, VaultV2BlueMarketPublicAllocatorConfig, VaultV2BluePublicAllocatorConfig, VaultV2MidnightAdapter, VaultV2MorphoMarketV1Adapter, VaultV2MorphoMarketV1AdapterV2, VaultV2MorphoVaultV1Adapter, WrappedToken, } from "@morpho-org/blue-sdk";
|