@morpho-org/morpho-sdk 10.1.0 → 10.3.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 +126 -140
- package/lib/cjs/abis.d.ts +34 -0
- package/lib/cjs/abis.js +21 -1
- package/lib/cjs/actions/blue/borrow.d.ts +11 -3
- package/lib/cjs/actions/blue/borrow.internal.js +1 -0
- package/lib/cjs/actions/blue/borrow.js +8 -2
- package/lib/cjs/actions/blue/common.d.ts +4 -1
- package/lib/cjs/actions/blue/common.js +17 -3
- package/lib/cjs/actions/blue/refinance.d.ts +11 -3
- package/lib/cjs/actions/blue/refinance.internal.js +4 -1
- package/lib/cjs/actions/blue/refinance.js +8 -2
- package/lib/cjs/actions/blue/refinanceValidation.d.ts +3 -2
- package/lib/cjs/actions/blue/refinanceValidation.js +10 -6
- package/lib/cjs/actions/blue/repay.d.ts +4 -3
- package/lib/cjs/actions/blue/repay.js +3 -2
- package/lib/cjs/actions/blue/repayWithdrawCollateral.d.ts +4 -3
- package/lib/cjs/actions/blue/repayWithdrawCollateral.js +3 -2
- package/lib/cjs/actions/blue/supply.d.ts +5 -3
- package/lib/cjs/actions/blue/supply.js +4 -2
- package/lib/cjs/actions/blue/supplyCollateral.d.ts +4 -3
- package/lib/cjs/actions/blue/supplyCollateral.js +3 -2
- package/lib/cjs/actions/blue/supplyCollateralBorrow.d.ts +11 -3
- package/lib/cjs/actions/blue/supplyCollateralBorrow.internal.d.ts +2 -0
- package/lib/cjs/actions/blue/supplyCollateralBorrow.internal.js +5 -1
- package/lib/cjs/actions/blue/supplyCollateralBorrow.js +8 -2
- package/lib/cjs/actions/blue/withdraw.d.ts +11 -3
- package/lib/cjs/actions/blue/withdraw.internal.js +4 -1
- package/lib/cjs/actions/blue/withdraw.js +8 -2
- package/lib/cjs/actions/blue/withdrawCollateral.d.ts +4 -3
- package/lib/cjs/actions/blue/withdrawCollateral.js +3 -2
- package/lib/cjs/actions/bundles/common.d.ts +2 -8
- package/lib/cjs/actions/bundles/common.js +8 -20
- package/lib/cjs/actions/midnight/supplyCollateralTakeBorrow.js +0 -1
- package/lib/cjs/actions/midnight/takeBorrow.js +0 -1
- package/lib/cjs/actions/midnight/takeLend.js +0 -1
- package/lib/cjs/actions/midnight/takeRepayWithdrawCollateral.js +0 -1
- package/lib/cjs/actions/midnight/takeWithdraw.js +0 -1
- package/lib/cjs/actions/vaultV1/deposit.d.ts +2 -1
- package/lib/cjs/actions/vaultV1/deposit.js +2 -1
- package/lib/cjs/actions/vaultV1/migrateToV2.d.ts +3 -2
- package/lib/cjs/actions/vaultV1/migrateToV2.js +2 -1
- package/lib/cjs/actions/vaultV1/redeem.d.ts +3 -2
- package/lib/cjs/actions/vaultV1/redeem.js +2 -1
- package/lib/cjs/actions/vaultV1/withdraw.d.ts +2 -1
- package/lib/cjs/actions/vaultV1/withdraw.js +2 -1
- package/lib/cjs/actions/vaultV2/deposit.d.ts +2 -1
- package/lib/cjs/actions/vaultV2/deposit.js +2 -1
- package/lib/cjs/actions/vaultV2/forceWithdraw.d.ts +2 -1
- package/lib/cjs/actions/vaultV2/forceWithdraw.js +2 -1
- package/lib/cjs/actions/vaultV2/redeem.d.ts +3 -2
- package/lib/cjs/actions/vaultV2/redeem.js +2 -1
- package/lib/cjs/actions/vaultV2/withdraw.d.ts +2 -1
- package/lib/cjs/actions/vaultV2/withdraw.js +2 -1
- package/lib/cjs/constants.d.ts +1 -1
- package/lib/cjs/constants.js +2 -0
- package/lib/cjs/entities/blue/blue.d.ts +83 -20
- package/lib/cjs/entities/blue/blue.js +38 -12
- package/lib/cjs/entities/vaultV1/migrateToV2Quote.d.ts +2 -0
- package/lib/cjs/entities/vaultV1/migrateToV2Quote.js +5 -0
- package/lib/cjs/entities/vaultV1/vaultV1.d.ts +12 -6
- package/lib/cjs/entities/vaultV1/vaultV1.js +6 -0
- package/lib/cjs/entities/vaultV2/vaultV2.d.ts +12 -7
- package/lib/cjs/entities/vaultV2/vaultV2.js +4 -0
- package/lib/cjs/entities/vaultV2BlueReallocationData.d.ts +11 -2
- package/lib/cjs/entities/vaultV2BlueReallocationData.js +19 -21
- package/lib/cjs/helpers/constant.d.ts +2 -0
- package/lib/cjs/helpers/constant.js +3 -1
- package/lib/cjs/helpers/getBlueBundlesV1QuoteTimestamp.d.ts +10 -0
- package/lib/cjs/helpers/getBlueBundlesV1QuoteTimestamp.js +18 -0
- package/lib/cjs/helpers/index.d.ts +1 -1
- package/lib/cjs/helpers/index.js +2 -1
- package/lib/cjs/helpers/previewVaultV2ForceWithdraw.d.ts +3 -3
- package/lib/cjs/helpers/previewVaultV2ForceWithdraw.js +4 -5
- package/lib/cjs/helpers/quoteBlueRepay.d.ts +7 -3
- package/lib/cjs/helpers/quoteBlueRepay.js +20 -7
- package/lib/cjs/helpers/reallocationPenalty.d.ts +10 -0
- package/lib/cjs/helpers/reallocationPenalty.js +32 -0
- package/lib/cjs/helpers/referralFee.d.ts +2 -1
- package/lib/cjs/helpers/referralFee.js +5 -1
- package/lib/cjs/helpers/validate.d.ts +31 -4
- package/lib/cjs/helpers/validate.js +48 -9
- package/lib/cjs/helpers/validateMidnightBounds.d.ts +1 -2
- package/lib/cjs/helpers/validateMidnightBounds.js +1 -2
- package/lib/cjs/helpers/validateMidnightTakeFeasibility.d.ts +2 -2
- package/lib/cjs/helpers/validateMidnightTakeFeasibility.js +1 -1
- package/lib/cjs/transactionPlan/blue/borrow.d.ts +11 -5
- package/lib/cjs/transactionPlan/blue/borrow.js +26 -8
- package/lib/cjs/transactionPlan/blue/refinance.d.ts +9 -2
- package/lib/cjs/transactionPlan/blue/refinance.js +20 -3
- package/lib/cjs/transactionPlan/blue/repay.d.ts +1 -2
- package/lib/cjs/transactionPlan/blue/repay.js +1 -2
- package/lib/cjs/transactionPlan/blue/repayWithdrawCollateral.d.ts +4 -3
- package/lib/cjs/transactionPlan/blue/repayWithdrawCollateral.js +13 -4
- package/lib/cjs/transactionPlan/blue/supply.d.ts +1 -2
- package/lib/cjs/transactionPlan/blue/supply.js +1 -2
- package/lib/cjs/transactionPlan/blue/supplyCollateral.d.ts +2 -3
- package/lib/cjs/transactionPlan/blue/supplyCollateral.js +2 -3
- package/lib/cjs/transactionPlan/blue/supplyCollateralBorrow.d.ts +10 -4
- package/lib/cjs/transactionPlan/blue/supplyCollateralBorrow.js +23 -6
- package/lib/cjs/transactionPlan/blue/withdraw.d.ts +15 -5
- package/lib/cjs/transactionPlan/blue/withdraw.js +25 -6
- package/lib/cjs/transactionPlan/blue/withdrawCollateral.d.ts +5 -5
- package/lib/cjs/transactionPlan/blue/withdrawCollateral.js +11 -7
- package/lib/cjs/transactionPlan/deposit.js +4 -0
- package/lib/cjs/transactionPlan/intent.d.ts +1 -1
- package/lib/cjs/transactionPlan/intent.js +4 -2
- package/lib/cjs/transactionPlan/plan.d.ts +8 -4
- package/lib/cjs/transactionPlan/plan.js +8 -4
- package/lib/cjs/transactionPlan/types.d.ts +6 -0
- package/lib/cjs/transactionPlan/vaultv1/deposit.d.ts +3 -3
- package/lib/cjs/transactionPlan/vaultv1/deposit.js +3 -3
- package/lib/cjs/transactionPlan/vaultv1/migrateToV2.d.ts +3 -3
- package/lib/cjs/transactionPlan/vaultv1/migrateToV2.js +7 -3
- package/lib/cjs/transactionPlan/vaultv1/redeem.d.ts +1 -2
- package/lib/cjs/transactionPlan/vaultv1/redeem.js +1 -2
- package/lib/cjs/transactionPlan/vaultv1/withdraw.d.ts +2 -3
- package/lib/cjs/transactionPlan/vaultv1/withdraw.js +2 -3
- package/lib/cjs/transactionPlan/vaultv2/deposit.d.ts +3 -3
- package/lib/cjs/transactionPlan/vaultv2/deposit.js +3 -3
- package/lib/cjs/transactionPlan/vaultv2/forceWithdraw.d.ts +3 -3
- package/lib/cjs/transactionPlan/vaultv2/forceWithdraw.js +3 -3
- package/lib/cjs/transactionPlan/vaultv2/redeem.d.ts +2 -3
- package/lib/cjs/transactionPlan/vaultv2/redeem.js +2 -3
- package/lib/cjs/transactionPlan/vaultv2/withdraw.d.ts +2 -3
- package/lib/cjs/transactionPlan/vaultv2/withdraw.js +2 -3
- package/lib/cjs/types/error.d.ts +7 -6
- package/lib/cjs/types/error.js +10 -9
- package/lib/cjs/types/sharedLiquidity.d.ts +7 -2
- package/lib/cjs/version.d.ts +1 -1
- package/lib/cjs/version.js +1 -1
- package/lib/esm/abis.d.ts +34 -0
- package/lib/esm/abis.js +20 -0
- package/lib/esm/actions/blue/borrow.d.ts +11 -3
- package/lib/esm/actions/blue/borrow.internal.js +1 -0
- package/lib/esm/actions/blue/borrow.js +8 -2
- package/lib/esm/actions/blue/common.d.ts +4 -1
- package/lib/esm/actions/blue/common.js +17 -3
- package/lib/esm/actions/blue/refinance.d.ts +11 -3
- package/lib/esm/actions/blue/refinance.internal.js +4 -1
- package/lib/esm/actions/blue/refinance.js +8 -2
- package/lib/esm/actions/blue/refinanceValidation.d.ts +3 -2
- package/lib/esm/actions/blue/refinanceValidation.js +10 -6
- package/lib/esm/actions/blue/repay.d.ts +4 -3
- package/lib/esm/actions/blue/repay.js +3 -2
- package/lib/esm/actions/blue/repayWithdrawCollateral.d.ts +4 -3
- package/lib/esm/actions/blue/repayWithdrawCollateral.js +3 -2
- package/lib/esm/actions/blue/supply.d.ts +5 -3
- package/lib/esm/actions/blue/supply.js +4 -2
- package/lib/esm/actions/blue/supplyCollateral.d.ts +4 -3
- package/lib/esm/actions/blue/supplyCollateral.js +3 -2
- package/lib/esm/actions/blue/supplyCollateralBorrow.d.ts +11 -3
- package/lib/esm/actions/blue/supplyCollateralBorrow.internal.d.ts +2 -0
- package/lib/esm/actions/blue/supplyCollateralBorrow.internal.js +5 -1
- package/lib/esm/actions/blue/supplyCollateralBorrow.js +8 -2
- package/lib/esm/actions/blue/withdraw.d.ts +11 -3
- package/lib/esm/actions/blue/withdraw.internal.js +4 -1
- package/lib/esm/actions/blue/withdraw.js +8 -2
- package/lib/esm/actions/blue/withdrawCollateral.d.ts +4 -3
- package/lib/esm/actions/blue/withdrawCollateral.js +3 -2
- package/lib/esm/actions/bundles/common.d.ts +2 -8
- package/lib/esm/actions/bundles/common.js +4 -17
- package/lib/esm/actions/midnight/supplyCollateralTakeBorrow.js +1 -2
- package/lib/esm/actions/midnight/takeBorrow.js +1 -2
- package/lib/esm/actions/midnight/takeLend.js +1 -2
- package/lib/esm/actions/midnight/takeRepayWithdrawCollateral.js +1 -2
- package/lib/esm/actions/midnight/takeWithdraw.js +1 -2
- package/lib/esm/actions/vaultV1/deposit.d.ts +2 -1
- package/lib/esm/actions/vaultV1/deposit.js +2 -1
- package/lib/esm/actions/vaultV1/migrateToV2.d.ts +3 -2
- package/lib/esm/actions/vaultV1/migrateToV2.js +2 -1
- package/lib/esm/actions/vaultV1/redeem.d.ts +3 -2
- package/lib/esm/actions/vaultV1/redeem.js +2 -1
- package/lib/esm/actions/vaultV1/withdraw.d.ts +2 -1
- package/lib/esm/actions/vaultV1/withdraw.js +2 -1
- package/lib/esm/actions/vaultV2/deposit.d.ts +2 -1
- package/lib/esm/actions/vaultV2/deposit.js +2 -1
- package/lib/esm/actions/vaultV2/forceWithdraw.d.ts +2 -1
- package/lib/esm/actions/vaultV2/forceWithdraw.js +2 -1
- package/lib/esm/actions/vaultV2/redeem.d.ts +3 -2
- package/lib/esm/actions/vaultV2/redeem.js +2 -1
- package/lib/esm/actions/vaultV2/withdraw.d.ts +2 -1
- package/lib/esm/actions/vaultV2/withdraw.js +2 -1
- package/lib/esm/constants.d.ts +1 -1
- package/lib/esm/constants.js +1 -1
- package/lib/esm/entities/blue/blue.d.ts +83 -20
- package/lib/esm/entities/blue/blue.js +38 -12
- package/lib/esm/entities/vaultV1/migrateToV2Quote.d.ts +2 -0
- package/lib/esm/entities/vaultV1/migrateToV2Quote.js +5 -0
- package/lib/esm/entities/vaultV1/vaultV1.d.ts +12 -6
- package/lib/esm/entities/vaultV1/vaultV1.js +7 -1
- package/lib/esm/entities/vaultV2/vaultV2.d.ts +12 -7
- package/lib/esm/entities/vaultV2/vaultV2.js +5 -1
- package/lib/esm/entities/vaultV2BlueReallocationData.d.ts +11 -2
- package/lib/esm/entities/vaultV2BlueReallocationData.js +17 -19
- package/lib/esm/helpers/constant.d.ts +2 -0
- package/lib/esm/helpers/constant.js +2 -0
- package/lib/esm/helpers/getBlueBundlesV1QuoteTimestamp.d.ts +10 -0
- package/lib/esm/helpers/getBlueBundlesV1QuoteTimestamp.js +15 -0
- package/lib/esm/helpers/index.d.ts +1 -1
- package/lib/esm/helpers/index.js +1 -1
- package/lib/esm/helpers/previewVaultV2ForceWithdraw.d.ts +3 -3
- package/lib/esm/helpers/previewVaultV2ForceWithdraw.js +4 -5
- package/lib/esm/helpers/quoteBlueRepay.d.ts +7 -3
- package/lib/esm/helpers/quoteBlueRepay.js +21 -8
- package/lib/esm/helpers/reallocationPenalty.d.ts +10 -0
- package/lib/esm/helpers/reallocationPenalty.js +28 -0
- package/lib/esm/helpers/referralFee.d.ts +2 -1
- package/lib/esm/helpers/referralFee.js +5 -1
- package/lib/esm/helpers/validate.d.ts +31 -4
- package/lib/esm/helpers/validate.js +48 -11
- package/lib/esm/helpers/validateMidnightBounds.d.ts +1 -2
- package/lib/esm/helpers/validateMidnightBounds.js +1 -2
- package/lib/esm/helpers/validateMidnightTakeFeasibility.d.ts +2 -2
- package/lib/esm/helpers/validateMidnightTakeFeasibility.js +1 -1
- package/lib/esm/transactionPlan/blue/borrow.d.ts +11 -5
- package/lib/esm/transactionPlan/blue/borrow.js +27 -9
- package/lib/esm/transactionPlan/blue/refinance.d.ts +9 -2
- package/lib/esm/transactionPlan/blue/refinance.js +20 -3
- package/lib/esm/transactionPlan/blue/repay.d.ts +1 -2
- package/lib/esm/transactionPlan/blue/repay.js +1 -2
- package/lib/esm/transactionPlan/blue/repayWithdrawCollateral.d.ts +4 -3
- package/lib/esm/transactionPlan/blue/repayWithdrawCollateral.js +13 -4
- package/lib/esm/transactionPlan/blue/supply.d.ts +1 -2
- package/lib/esm/transactionPlan/blue/supply.js +1 -2
- package/lib/esm/transactionPlan/blue/supplyCollateral.d.ts +2 -3
- package/lib/esm/transactionPlan/blue/supplyCollateral.js +2 -3
- package/lib/esm/transactionPlan/blue/supplyCollateralBorrow.d.ts +10 -4
- package/lib/esm/transactionPlan/blue/supplyCollateralBorrow.js +23 -6
- package/lib/esm/transactionPlan/blue/withdraw.d.ts +15 -5
- package/lib/esm/transactionPlan/blue/withdraw.js +25 -6
- package/lib/esm/transactionPlan/blue/withdrawCollateral.d.ts +5 -5
- package/lib/esm/transactionPlan/blue/withdrawCollateral.js +11 -7
- package/lib/esm/transactionPlan/deposit.js +5 -1
- package/lib/esm/transactionPlan/intent.d.ts +1 -1
- package/lib/esm/transactionPlan/intent.js +4 -2
- package/lib/esm/transactionPlan/plan.d.ts +8 -4
- package/lib/esm/transactionPlan/plan.js +8 -4
- package/lib/esm/transactionPlan/types.d.ts +6 -0
- package/lib/esm/transactionPlan/vaultv1/deposit.d.ts +3 -3
- package/lib/esm/transactionPlan/vaultv1/deposit.js +3 -3
- package/lib/esm/transactionPlan/vaultv1/migrateToV2.d.ts +3 -3
- package/lib/esm/transactionPlan/vaultv1/migrateToV2.js +8 -4
- package/lib/esm/transactionPlan/vaultv1/redeem.d.ts +1 -2
- package/lib/esm/transactionPlan/vaultv1/redeem.js +1 -2
- package/lib/esm/transactionPlan/vaultv1/withdraw.d.ts +2 -3
- package/lib/esm/transactionPlan/vaultv1/withdraw.js +2 -3
- package/lib/esm/transactionPlan/vaultv2/deposit.d.ts +3 -3
- package/lib/esm/transactionPlan/vaultv2/deposit.js +3 -3
- package/lib/esm/transactionPlan/vaultv2/forceWithdraw.d.ts +3 -3
- package/lib/esm/transactionPlan/vaultv2/forceWithdraw.js +3 -3
- package/lib/esm/transactionPlan/vaultv2/redeem.d.ts +2 -3
- package/lib/esm/transactionPlan/vaultv2/redeem.js +2 -3
- package/lib/esm/transactionPlan/vaultv2/withdraw.d.ts +2 -3
- package/lib/esm/transactionPlan/vaultv2/withdraw.js +2 -3
- package/lib/esm/types/error.d.ts +7 -6
- package/lib/esm/types/error.js +11 -10
- package/lib/esm/types/sharedLiquidity.d.ts +7 -2
- package/lib/esm/version.d.ts +1 -1
- package/lib/esm/version.js +1 -1
- package/package.json +3 -3
|
@@ -135,7 +135,6 @@ const parseMidnightTakeBorrow = (params) => {
|
|
|
135
135
|
(0, validateMidnightAccount_js_1.validateMidnightAddress)("referralFeeRecipient", params.referralFeeRecipient);
|
|
136
136
|
}
|
|
137
137
|
const { referralFeePct, referralFeeRecipient } = (0, parse_js_1.parseReferralFee)(params);
|
|
138
|
-
(0, validateMidnightBounds_js_1.validateMidnightReferralFeeCap)(referralFeePct);
|
|
139
138
|
(0, validateMidnightTakeFeasibility_js_1.validateMidnightSellTargetBounds)({ target, referralFeePct });
|
|
140
139
|
if (referralFeePct > 0n) {
|
|
141
140
|
// Rejects fee recipients that would strand the fee in a contract.
|
|
@@ -129,7 +129,6 @@ const parseMidnightTakeLend = (params) => {
|
|
|
129
129
|
(0, validateMidnightAccount_js_1.validateMidnightAddress)("referralFeeRecipient", params.referralFeeRecipient);
|
|
130
130
|
}
|
|
131
131
|
const { referralFeePct, referralFeeRecipient } = (0, parse_js_1.parseReferralFee)(params);
|
|
132
|
-
(0, validateMidnightBounds_js_1.validateMidnightReferralFeeCap)(referralFeePct);
|
|
133
132
|
if (referralFeePct > 0n) {
|
|
134
133
|
// Rejects fee recipients that would strand the fee in a contract.
|
|
135
134
|
(0, validateMidnightReceiver_js_1.validateMidnightReceiver)({
|
|
@@ -164,7 +164,6 @@ const parseMidnightTakeRepayWithdrawCollateral = (params) => {
|
|
|
164
164
|
(0, validateMidnightAccount_js_1.validateMidnightAddress)("referralFeeRecipient", params.referralFeeRecipient);
|
|
165
165
|
}
|
|
166
166
|
const { referralFeePct, referralFeeRecipient } = (0, parse_js_1.parseReferralFee)(params);
|
|
167
|
-
(0, validateMidnightBounds_js_1.validateMidnightReferralFeeCap)(referralFeePct);
|
|
168
167
|
if (referralFeePct > 0n) {
|
|
169
168
|
// Rejects fee recipients that would strand the fee in a contract.
|
|
170
169
|
(0, validateMidnightReceiver_js_1.validateMidnightReceiver)({
|
|
@@ -130,7 +130,6 @@ const parseMidnightTakeWithdraw = (params) => {
|
|
|
130
130
|
(0, validateMidnightAccount_js_1.validateMidnightAddress)("referralFeeRecipient", params.referralFeeRecipient);
|
|
131
131
|
}
|
|
132
132
|
const { referralFeePct, referralFeeRecipient } = (0, parse_js_1.parseReferralFee)(params);
|
|
133
|
-
(0, validateMidnightBounds_js_1.validateMidnightReferralFeeCap)(referralFeePct);
|
|
134
133
|
(0, validateMidnightTakeFeasibility_js_1.validateMidnightSellTargetBounds)({ target, referralFeePct });
|
|
135
134
|
if (referralFeePct > 0n) {
|
|
136
135
|
// Rejects fee recipients that would strand the fee in a contract.
|
|
@@ -49,7 +49,7 @@ export interface VaultV1DepositInput {
|
|
|
49
49
|
* @param params.args.recipient - Unsupported; shares are always minted to the transaction sender.
|
|
50
50
|
* @param params.args.requirementSignature - Optional ERC-2612 or Permit2 SignatureTransfer signature
|
|
51
51
|
* for the gross amount, vault asset, `userAddress`, and VaultBundlesV1 spender.
|
|
52
|
-
* @param params.args.referralFeePct - Optional WAD-scaled fee
|
|
52
|
+
* @param params.args.referralFeePct - Optional WAD-scaled fee from 0% to 10%, inclusive, defaulting to zero.
|
|
53
53
|
* The fee is rounded down and deducted from gross assets before depositing.
|
|
54
54
|
* @param params.args.referralFeeRecipient - Optional fee recipient; a nonzero address is required
|
|
55
55
|
* when `referralFeePct > 0n`.
|
|
@@ -67,6 +67,7 @@ export interface VaultV1DepositInput {
|
|
|
67
67
|
* @throws {NativeAmountOnNonWNativeVaultError} when native funding targets a non-wNative vault.
|
|
68
68
|
* @throws {ReferralFeePctExceededError} when `referralFeePct` is at least WAD; it extends
|
|
69
69
|
* {@link InputExceedsMaxError}, so either class catches it.
|
|
70
|
+
* @throws {MidnightReferralFeePctExceededError} when the referral fee is above 10% but below WAD.
|
|
70
71
|
* @throws {ReferralFeeRecipientMissingError} when a positive `referralFeePct` has no recipient.
|
|
71
72
|
* @throws {UnexpectedRequirementSignatureError} when native funding carries a token permit.
|
|
72
73
|
* @throws {InputExceedsMaxError} when funding, `maxSharePrice`, or `deadline` exceeds uint256.
|
|
@@ -23,7 +23,7 @@ const common_js_1 = require("../bundles/common.js");
|
|
|
23
23
|
* @param params.args.recipient - Unsupported; shares are always minted to the transaction sender.
|
|
24
24
|
* @param params.args.requirementSignature - Optional ERC-2612 or Permit2 SignatureTransfer signature
|
|
25
25
|
* for the gross amount, vault asset, `userAddress`, and VaultBundlesV1 spender.
|
|
26
|
-
* @param params.args.referralFeePct - Optional WAD-scaled fee
|
|
26
|
+
* @param params.args.referralFeePct - Optional WAD-scaled fee from 0% to 10%, inclusive, defaulting to zero.
|
|
27
27
|
* The fee is rounded down and deducted from gross assets before depositing.
|
|
28
28
|
* @param params.args.referralFeeRecipient - Optional fee recipient; a nonzero address is required
|
|
29
29
|
* when `referralFeePct > 0n`.
|
|
@@ -41,6 +41,7 @@ const common_js_1 = require("../bundles/common.js");
|
|
|
41
41
|
* @throws {NativeAmountOnNonWNativeVaultError} when native funding targets a non-wNative vault.
|
|
42
42
|
* @throws {ReferralFeePctExceededError} when `referralFeePct` is at least WAD; it extends
|
|
43
43
|
* {@link InputExceedsMaxError}, so either class catches it.
|
|
44
|
+
* @throws {MidnightReferralFeePctExceededError} when the referral fee is above 10% but below WAD.
|
|
44
45
|
* @throws {ReferralFeeRecipientMissingError} when a positive `referralFeePct` has no recipient.
|
|
45
46
|
* @throws {UnexpectedRequirementSignatureError} when native funding carries a token permit.
|
|
46
47
|
* @throws {InputExceedsMaxError} when funding, `maxSharePrice`, or `deadline` exceeds uint256.
|
|
@@ -26,7 +26,7 @@ export interface VaultV1MigrateToV2Params {
|
|
|
26
26
|
readonly minSharePriceVaultV1?: never;
|
|
27
27
|
/** Optional ERC-2612 vault-share permit for the migrated source shares. */
|
|
28
28
|
readonly requirementSignature?: Erc2612RequirementSignature;
|
|
29
|
-
/** Optional WAD-scaled fee
|
|
29
|
+
/** Optional WAD-scaled fee from 0% to 10%, inclusive, defaulting to zero. */
|
|
30
30
|
readonly referralFeePct?: bigint;
|
|
31
31
|
/** Optional fee recipient; a nonzero address is required when `referralFeePct > 0n`. */
|
|
32
32
|
readonly referralFeeRecipient?: Address;
|
|
@@ -54,7 +54,7 @@ export interface VaultV1MigrateToV2Params {
|
|
|
54
54
|
* share-price bound.
|
|
55
55
|
* @param params.args.requirementSignature - Optional ERC-2612 vault-share permit for `userAddress`
|
|
56
56
|
* and the registered VaultBundlesV1 spender. Omit when the share allowance is already set.
|
|
57
|
-
* @param params.args.referralFeePct - Optional WAD-scaled fee
|
|
57
|
+
* @param params.args.referralFeePct - Optional WAD-scaled fee from 0% to 10%, inclusive, defaulting to zero.
|
|
58
58
|
* The fee is rounded down and deducted from gross assets before depositing.
|
|
59
59
|
* @param params.args.referralFeeRecipient - Optional fee recipient; a nonzero address is required
|
|
60
60
|
* when `referralFeePct > 0n`.
|
|
@@ -71,6 +71,7 @@ export interface VaultV1MigrateToV2Params {
|
|
|
71
71
|
* @throws {InputExceedsMaxError} when the selected amount, `maxSharePriceVaultV2`, or `deadline` exceeds uint256.
|
|
72
72
|
* @throws {NegativeInputError} when `referralFeePct` is negative.
|
|
73
73
|
* @throws {ReferralFeePctExceededError} when `referralFeePct` is at least WAD.
|
|
74
|
+
* @throws {MidnightReferralFeePctExceededError} when the referral fee is above 10% but below WAD.
|
|
74
75
|
* @throws {ReferralFeeRecipientMissingError} when a positive referral fee has no non-zero recipient.
|
|
75
76
|
* @throws {UnsupportedChainIdError} when the chain is absent from the address registry.
|
|
76
77
|
* @throws {UnknownAddressError} when VaultBundlesV1 is not registered on the target chain.
|
|
@@ -26,7 +26,7 @@ const common_js_1 = require("../bundles/common.js");
|
|
|
26
26
|
* share-price bound.
|
|
27
27
|
* @param params.args.requirementSignature - Optional ERC-2612 vault-share permit for `userAddress`
|
|
28
28
|
* and the registered VaultBundlesV1 spender. Omit when the share allowance is already set.
|
|
29
|
-
* @param params.args.referralFeePct - Optional WAD-scaled fee
|
|
29
|
+
* @param params.args.referralFeePct - Optional WAD-scaled fee from 0% to 10%, inclusive, defaulting to zero.
|
|
30
30
|
* The fee is rounded down and deducted from gross assets before depositing.
|
|
31
31
|
* @param params.args.referralFeeRecipient - Optional fee recipient; a nonzero address is required
|
|
32
32
|
* when `referralFeePct > 0n`.
|
|
@@ -43,6 +43,7 @@ const common_js_1 = require("../bundles/common.js");
|
|
|
43
43
|
* @throws {InputExceedsMaxError} when the selected amount, `maxSharePriceVaultV2`, or `deadline` exceeds uint256.
|
|
44
44
|
* @throws {NegativeInputError} when `referralFeePct` is negative.
|
|
45
45
|
* @throws {ReferralFeePctExceededError} when `referralFeePct` is at least WAD.
|
|
46
|
+
* @throws {MidnightReferralFeePctExceededError} when the referral fee is above 10% but below WAD.
|
|
46
47
|
* @throws {ReferralFeeRecipientMissingError} when a positive referral fee has no non-zero recipient.
|
|
47
48
|
* @throws {UnsupportedChainIdError} when the chain is absent from the address registry.
|
|
48
49
|
* @throws {UnknownAddressError} when VaultBundlesV1 is not registered on the target chain.
|
|
@@ -20,7 +20,7 @@ export interface VaultV1RedeemParams {
|
|
|
20
20
|
readonly onBehalf?: never;
|
|
21
21
|
/** Optional ERC-2612 vault-share permit for the redeemed shares. */
|
|
22
22
|
readonly requirementSignature?: Erc2612RequirementSignature;
|
|
23
|
-
/** Optional WAD-scaled fee
|
|
23
|
+
/** Optional WAD-scaled fee from 0% to 10%, inclusive, defaulting to zero. */
|
|
24
24
|
readonly referralFeePct?: bigint;
|
|
25
25
|
/** Optional fee recipient; a nonzero address is required when `referralFeePct > 0n`. */
|
|
26
26
|
readonly referralFeeRecipient?: Address;
|
|
@@ -54,7 +54,7 @@ export type VaultV1RedeemInput = {
|
|
|
54
54
|
* @param params.args.onBehalf - Unsupported; VaultBundlesV1 always burns the transaction sender's shares.
|
|
55
55
|
* @param params.args.requirementSignature - Optional ERC-2612 vault-share permit for `userAddress`
|
|
56
56
|
* and the registered VaultBundlesV1 spender. Omit when the share allowance is already set.
|
|
57
|
-
* @param params.args.referralFeePct - Optional WAD-scaled fee
|
|
57
|
+
* @param params.args.referralFeePct - Optional WAD-scaled fee from 0% to 10%, inclusive, defaulting to zero.
|
|
58
58
|
* The fee is rounded down and deducted from the gross redeemed assets.
|
|
59
59
|
* @param params.args.referralFeeRecipient - Optional fee recipient; a nonzero address is required
|
|
60
60
|
* when `referralFeePct > 0n`.
|
|
@@ -68,6 +68,7 @@ export type VaultV1RedeemInput = {
|
|
|
68
68
|
* @throws {InputExceedsMaxError} when `shares` or `deadline` exceeds uint256.
|
|
69
69
|
* @throws {NegativeInputError} when `referralFeePct` is negative.
|
|
70
70
|
* @throws {ReferralFeePctExceededError} when `referralFeePct` is at least WAD.
|
|
71
|
+
* @throws {MidnightReferralFeePctExceededError} when the referral fee is above 10% but below WAD.
|
|
71
72
|
* @throws {ReferralFeeRecipientMissingError} when a positive referral fee has no non-zero recipient.
|
|
72
73
|
* @throws {UnsupportedChainIdError} when the chain is absent from the address registry.
|
|
73
74
|
* @throws {UnknownAddressError} when VaultBundlesV1 is not registered on the target chain.
|
|
@@ -18,7 +18,7 @@ const common_js_1 = require("../bundles/common.js");
|
|
|
18
18
|
* @param params.args.onBehalf - Unsupported; VaultBundlesV1 always burns the transaction sender's shares.
|
|
19
19
|
* @param params.args.requirementSignature - Optional ERC-2612 vault-share permit for `userAddress`
|
|
20
20
|
* and the registered VaultBundlesV1 spender. Omit when the share allowance is already set.
|
|
21
|
-
* @param params.args.referralFeePct - Optional WAD-scaled fee
|
|
21
|
+
* @param params.args.referralFeePct - Optional WAD-scaled fee from 0% to 10%, inclusive, defaulting to zero.
|
|
22
22
|
* The fee is rounded down and deducted from the gross redeemed assets.
|
|
23
23
|
* @param params.args.referralFeeRecipient - Optional fee recipient; a nonzero address is required
|
|
24
24
|
* when `referralFeePct > 0n`.
|
|
@@ -32,6 +32,7 @@ const common_js_1 = require("../bundles/common.js");
|
|
|
32
32
|
* @throws {InputExceedsMaxError} when `shares` or `deadline` exceeds uint256.
|
|
33
33
|
* @throws {NegativeInputError} when `referralFeePct` is negative.
|
|
34
34
|
* @throws {ReferralFeePctExceededError} when `referralFeePct` is at least WAD.
|
|
35
|
+
* @throws {MidnightReferralFeePctExceededError} when the referral fee is above 10% but below WAD.
|
|
35
36
|
* @throws {ReferralFeeRecipientMissingError} when a positive referral fee has no non-zero recipient.
|
|
36
37
|
* @throws {UnsupportedChainIdError} when the chain is absent from the address registry.
|
|
37
38
|
* @throws {UnknownAddressError} when VaultBundlesV1 is not registered on the target chain.
|
|
@@ -46,7 +46,7 @@ export type VaultV1WithdrawInput = {
|
|
|
46
46
|
* @param params.args.onBehalf - Unsupported; VaultBundlesV1 always burns the transaction sender's shares.
|
|
47
47
|
* @param params.args.requirementSignature - Optional ERC-2612 vault-share permit for `userAddress`
|
|
48
48
|
* and the registered VaultBundlesV1 spender. Omit when the share allowance meets the required amount.
|
|
49
|
-
* @param params.args.referralFeePct - Optional WAD-scaled fee
|
|
49
|
+
* @param params.args.referralFeePct - Optional WAD-scaled fee from 0% to 10%, inclusive, defaulting to zero.
|
|
50
50
|
* The fee is rounded down and deducted from the gross withdrawn assets.
|
|
51
51
|
* @param params.args.referralFeeRecipient - Optional fee recipient; a nonzero address is required
|
|
52
52
|
* when `referralFeePct > 0n`.
|
|
@@ -61,6 +61,7 @@ export type VaultV1WithdrawInput = {
|
|
|
61
61
|
* @throws {InputExceedsMaxError} when `amount` or `deadline` exceeds uint256.
|
|
62
62
|
* @throws {NegativeInputError} when `referralFeePct` is negative.
|
|
63
63
|
* @throws {ReferralFeePctExceededError} when `referralFeePct` is at least WAD.
|
|
64
|
+
* @throws {MidnightReferralFeePctExceededError} when the referral fee is above 10% but below WAD.
|
|
64
65
|
* @throws {ReferralFeeRecipientMissingError} when a positive referral fee has no nonzero recipient.
|
|
65
66
|
* @throws {UnsupportedChainIdError} when the chain is absent from the address registry.
|
|
66
67
|
* @throws {UnknownAddressError} when VaultBundlesV1 is not registered on the target chain.
|
|
@@ -21,7 +21,7 @@ const common_js_1 = require("../bundles/common.js");
|
|
|
21
21
|
* @param params.args.onBehalf - Unsupported; VaultBundlesV1 always burns the transaction sender's shares.
|
|
22
22
|
* @param params.args.requirementSignature - Optional ERC-2612 vault-share permit for `userAddress`
|
|
23
23
|
* and the registered VaultBundlesV1 spender. Omit when the share allowance meets the required amount.
|
|
24
|
-
* @param params.args.referralFeePct - Optional WAD-scaled fee
|
|
24
|
+
* @param params.args.referralFeePct - Optional WAD-scaled fee from 0% to 10%, inclusive, defaulting to zero.
|
|
25
25
|
* The fee is rounded down and deducted from the gross withdrawn assets.
|
|
26
26
|
* @param params.args.referralFeeRecipient - Optional fee recipient; a nonzero address is required
|
|
27
27
|
* when `referralFeePct > 0n`.
|
|
@@ -36,6 +36,7 @@ const common_js_1 = require("../bundles/common.js");
|
|
|
36
36
|
* @throws {InputExceedsMaxError} when `amount` or `deadline` exceeds uint256.
|
|
37
37
|
* @throws {NegativeInputError} when `referralFeePct` is negative.
|
|
38
38
|
* @throws {ReferralFeePctExceededError} when `referralFeePct` is at least WAD.
|
|
39
|
+
* @throws {MidnightReferralFeePctExceededError} when the referral fee is above 10% but below WAD.
|
|
39
40
|
* @throws {ReferralFeeRecipientMissingError} when a positive referral fee has no nonzero recipient.
|
|
40
41
|
* @throws {UnsupportedChainIdError} when the chain is absent from the address registry.
|
|
41
42
|
* @throws {UnknownAddressError} when VaultBundlesV1 is not registered on the target chain.
|
|
@@ -49,7 +49,7 @@ export interface VaultV2DepositInput {
|
|
|
49
49
|
* @param params.args.recipient - Unsupported; shares are always minted to the transaction sender.
|
|
50
50
|
* @param params.args.requirementSignature - Optional ERC-2612 or Permit2 SignatureTransfer signature
|
|
51
51
|
* for the gross amount, vault asset, `userAddress`, and VaultBundlesV1 spender.
|
|
52
|
-
* @param params.args.referralFeePct - Optional WAD-scaled fee
|
|
52
|
+
* @param params.args.referralFeePct - Optional WAD-scaled fee from 0% to 10%, inclusive, defaulting to zero.
|
|
53
53
|
* The fee is rounded down and deducted from gross assets before depositing.
|
|
54
54
|
* @param params.args.referralFeeRecipient - Optional fee recipient; a nonzero address is required
|
|
55
55
|
* when `referralFeePct > 0n`.
|
|
@@ -67,6 +67,7 @@ export interface VaultV2DepositInput {
|
|
|
67
67
|
* @throws {NativeAmountOnNonWNativeVaultError} when native funding targets a non-wNative vault.
|
|
68
68
|
* @throws {ReferralFeePctExceededError} when `referralFeePct` is at least WAD; it extends
|
|
69
69
|
* {@link InputExceedsMaxError}, so either class catches it.
|
|
70
|
+
* @throws {MidnightReferralFeePctExceededError} when the referral fee is above 10% but below WAD.
|
|
70
71
|
* @throws {ReferralFeeRecipientMissingError} when a positive `referralFeePct` has no recipient.
|
|
71
72
|
* @throws {UnexpectedRequirementSignatureError} when native funding carries a token permit.
|
|
72
73
|
* @throws {InputExceedsMaxError} when funding, `maxSharePrice`, or `deadline` exceeds uint256.
|
|
@@ -23,7 +23,7 @@ const common_js_1 = require("../bundles/common.js");
|
|
|
23
23
|
* @param params.args.recipient - Unsupported; shares are always minted to the transaction sender.
|
|
24
24
|
* @param params.args.requirementSignature - Optional ERC-2612 or Permit2 SignatureTransfer signature
|
|
25
25
|
* for the gross amount, vault asset, `userAddress`, and VaultBundlesV1 spender.
|
|
26
|
-
* @param params.args.referralFeePct - Optional WAD-scaled fee
|
|
26
|
+
* @param params.args.referralFeePct - Optional WAD-scaled fee from 0% to 10%, inclusive, defaulting to zero.
|
|
27
27
|
* The fee is rounded down and deducted from gross assets before depositing.
|
|
28
28
|
* @param params.args.referralFeeRecipient - Optional fee recipient; a nonzero address is required
|
|
29
29
|
* when `referralFeePct > 0n`.
|
|
@@ -41,6 +41,7 @@ const common_js_1 = require("../bundles/common.js");
|
|
|
41
41
|
* @throws {NativeAmountOnNonWNativeVaultError} when native funding targets a non-wNative vault.
|
|
42
42
|
* @throws {ReferralFeePctExceededError} when `referralFeePct` is at least WAD; it extends
|
|
43
43
|
* {@link InputExceedsMaxError}, so either class catches it.
|
|
44
|
+
* @throws {MidnightReferralFeePctExceededError} when the referral fee is above 10% but below WAD.
|
|
44
45
|
* @throws {ReferralFeeRecipientMissingError} when a positive `referralFeePct` has no recipient.
|
|
45
46
|
* @throws {UnexpectedRequirementSignatureError} when native funding carries a token permit.
|
|
46
47
|
* @throws {InputExceedsMaxError} when funding, `maxSharePrice`, or `deadline` exceeds uint256.
|
|
@@ -63,7 +63,7 @@ export type VaultV2ForceWithdrawInput = {
|
|
|
63
63
|
* submitting account must equal this address.
|
|
64
64
|
* @param params.args.deadline - Permit and bundle deadline.
|
|
65
65
|
* @param params.args.referralFeePct - Optional WAD-scaled share of the withdrawn assets routed to
|
|
66
|
-
* `referralFeeRecipient
|
|
66
|
+
* `referralFeeRecipient`, at most 10%. Defaults to `0n`. Deducted *after* the `minSharePriceE27` check, so it
|
|
67
67
|
* is outside that bound's protection.
|
|
68
68
|
* @param params.args.referralFeeRecipient - Optional referral fee recipient. Defaults to the zero
|
|
69
69
|
* address, which is only valid alongside a zero `referralFeePct`.
|
|
@@ -75,6 +75,7 @@ export type VaultV2ForceWithdrawInput = {
|
|
|
75
75
|
* @throws {NegativeInputError} when `referralFeePct` or `minSharePriceE27` is negative.
|
|
76
76
|
* @throws {ReferralFeePctExceededError} when `referralFeePct` is not below WAD (the contract
|
|
77
77
|
* rejects it with `PctExceeded`); it extends {@link InputExceedsMaxError}.
|
|
78
|
+
* @throws {MidnightReferralFeePctExceededError} when the referral fee is above 10% but below WAD.
|
|
78
79
|
* @throws {InputExceedsMaxError} when `exitAssets`, `deadline`, or `minSharePriceE27` exceeds `uint256`.
|
|
79
80
|
* @throws {ReferralFeeRecipientMissingError} when a positive `referralFeePct` has no recipient.
|
|
80
81
|
* @throws {UnsupportedChainIdError} when no address registry exists for the target chain.
|
|
@@ -36,7 +36,7 @@ const common_js_1 = require("../bundles/common.js");
|
|
|
36
36
|
* submitting account must equal this address.
|
|
37
37
|
* @param params.args.deadline - Permit and bundle deadline.
|
|
38
38
|
* @param params.args.referralFeePct - Optional WAD-scaled share of the withdrawn assets routed to
|
|
39
|
-
* `referralFeeRecipient
|
|
39
|
+
* `referralFeeRecipient`, at most 10%. Defaults to `0n`. Deducted *after* the `minSharePriceE27` check, so it
|
|
40
40
|
* is outside that bound's protection.
|
|
41
41
|
* @param params.args.referralFeeRecipient - Optional referral fee recipient. Defaults to the zero
|
|
42
42
|
* address, which is only valid alongside a zero `referralFeePct`.
|
|
@@ -48,6 +48,7 @@ const common_js_1 = require("../bundles/common.js");
|
|
|
48
48
|
* @throws {NegativeInputError} when `referralFeePct` or `minSharePriceE27` is negative.
|
|
49
49
|
* @throws {ReferralFeePctExceededError} when `referralFeePct` is not below WAD (the contract
|
|
50
50
|
* rejects it with `PctExceeded`); it extends {@link InputExceedsMaxError}.
|
|
51
|
+
* @throws {MidnightReferralFeePctExceededError} when the referral fee is above 10% but below WAD.
|
|
51
52
|
* @throws {InputExceedsMaxError} when `exitAssets`, `deadline`, or `minSharePriceE27` exceeds `uint256`.
|
|
52
53
|
* @throws {ReferralFeeRecipientMissingError} when a positive `referralFeePct` has no recipient.
|
|
53
54
|
* @throws {UnsupportedChainIdError} when no address registry exists for the target chain.
|
|
@@ -20,7 +20,7 @@ export interface VaultV2RedeemParams {
|
|
|
20
20
|
readonly onBehalf?: never;
|
|
21
21
|
/** Optional ERC-2612 vault-share permit for the redeemed shares. */
|
|
22
22
|
readonly requirementSignature?: Erc2612RequirementSignature;
|
|
23
|
-
/** Optional WAD-scaled fee
|
|
23
|
+
/** Optional WAD-scaled fee from 0% to 10%, inclusive, defaulting to zero. */
|
|
24
24
|
readonly referralFeePct?: bigint;
|
|
25
25
|
/** Optional fee recipient; a nonzero address is required when `referralFeePct > 0n`. */
|
|
26
26
|
readonly referralFeeRecipient?: Address;
|
|
@@ -54,7 +54,7 @@ export type VaultV2RedeemInput = {
|
|
|
54
54
|
* @param params.args.onBehalf - Unsupported; VaultBundlesV1 always burns the transaction sender's shares.
|
|
55
55
|
* @param params.args.requirementSignature - Optional ERC-2612 vault-share permit for `userAddress`
|
|
56
56
|
* and the registered VaultBundlesV1 spender. Omit when the share allowance is already set.
|
|
57
|
-
* @param params.args.referralFeePct - Optional WAD-scaled fee
|
|
57
|
+
* @param params.args.referralFeePct - Optional WAD-scaled fee from 0% to 10%, inclusive, defaulting to zero.
|
|
58
58
|
* The fee is rounded down and deducted from the gross redeemed assets.
|
|
59
59
|
* @param params.args.referralFeeRecipient - Optional fee recipient; a nonzero address is required
|
|
60
60
|
* when `referralFeePct > 0n`.
|
|
@@ -68,6 +68,7 @@ export type VaultV2RedeemInput = {
|
|
|
68
68
|
* @throws {InputExceedsMaxError} when `shares` or `deadline` exceeds uint256.
|
|
69
69
|
* @throws {NegativeInputError} when `referralFeePct` is negative.
|
|
70
70
|
* @throws {ReferralFeePctExceededError} when `referralFeePct` is at least WAD.
|
|
71
|
+
* @throws {MidnightReferralFeePctExceededError} when the referral fee is above 10% but below WAD.
|
|
71
72
|
* @throws {ReferralFeeRecipientMissingError} when a positive referral fee has no non-zero recipient.
|
|
72
73
|
* @throws {UnsupportedChainIdError} when the chain is absent from the address registry.
|
|
73
74
|
* @throws {UnknownAddressError} when VaultBundlesV1 is not registered on the target chain.
|
|
@@ -18,7 +18,7 @@ const common_js_1 = require("../bundles/common.js");
|
|
|
18
18
|
* @param params.args.onBehalf - Unsupported; VaultBundlesV1 always burns the transaction sender's shares.
|
|
19
19
|
* @param params.args.requirementSignature - Optional ERC-2612 vault-share permit for `userAddress`
|
|
20
20
|
* and the registered VaultBundlesV1 spender. Omit when the share allowance is already set.
|
|
21
|
-
* @param params.args.referralFeePct - Optional WAD-scaled fee
|
|
21
|
+
* @param params.args.referralFeePct - Optional WAD-scaled fee from 0% to 10%, inclusive, defaulting to zero.
|
|
22
22
|
* The fee is rounded down and deducted from the gross redeemed assets.
|
|
23
23
|
* @param params.args.referralFeeRecipient - Optional fee recipient; a nonzero address is required
|
|
24
24
|
* when `referralFeePct > 0n`.
|
|
@@ -32,6 +32,7 @@ const common_js_1 = require("../bundles/common.js");
|
|
|
32
32
|
* @throws {InputExceedsMaxError} when `shares` or `deadline` exceeds uint256.
|
|
33
33
|
* @throws {NegativeInputError} when `referralFeePct` is negative.
|
|
34
34
|
* @throws {ReferralFeePctExceededError} when `referralFeePct` is at least WAD.
|
|
35
|
+
* @throws {MidnightReferralFeePctExceededError} when the referral fee is above 10% but below WAD.
|
|
35
36
|
* @throws {ReferralFeeRecipientMissingError} when a positive referral fee has no non-zero recipient.
|
|
36
37
|
* @throws {UnsupportedChainIdError} when the chain is absent from the address registry.
|
|
37
38
|
* @throws {UnknownAddressError} when VaultBundlesV1 is not registered on the target chain.
|
|
@@ -46,7 +46,7 @@ export type VaultV2WithdrawInput = {
|
|
|
46
46
|
* @param params.args.onBehalf - Unsupported; VaultBundlesV1 always burns the transaction sender's shares.
|
|
47
47
|
* @param params.args.requirementSignature - Optional ERC-2612 vault-share permit for `userAddress`
|
|
48
48
|
* and the registered VaultBundlesV1 spender. Omit when the share allowance meets the required amount.
|
|
49
|
-
* @param params.args.referralFeePct - Optional WAD-scaled fee
|
|
49
|
+
* @param params.args.referralFeePct - Optional WAD-scaled fee from 0% to 10%, inclusive, defaulting to zero.
|
|
50
50
|
* The fee is rounded down and deducted from the gross withdrawn assets.
|
|
51
51
|
* @param params.args.referralFeeRecipient - Optional fee recipient; a nonzero address is required
|
|
52
52
|
* when `referralFeePct > 0n`.
|
|
@@ -61,6 +61,7 @@ export type VaultV2WithdrawInput = {
|
|
|
61
61
|
* @throws {InputExceedsMaxError} when `amount` or `deadline` exceeds uint256.
|
|
62
62
|
* @throws {NegativeInputError} when `referralFeePct` is negative.
|
|
63
63
|
* @throws {ReferralFeePctExceededError} when `referralFeePct` is at least WAD.
|
|
64
|
+
* @throws {MidnightReferralFeePctExceededError} when the referral fee is above 10% but below WAD.
|
|
64
65
|
* @throws {ReferralFeeRecipientMissingError} when a positive referral fee has no nonzero recipient.
|
|
65
66
|
* @throws {UnsupportedChainIdError} when the chain is absent from the address registry.
|
|
66
67
|
* @throws {UnknownAddressError} when VaultBundlesV1 is not registered on the target chain.
|
|
@@ -21,7 +21,7 @@ const common_js_1 = require("../bundles/common.js");
|
|
|
21
21
|
* @param params.args.onBehalf - Unsupported; VaultBundlesV1 always burns the transaction sender's shares.
|
|
22
22
|
* @param params.args.requirementSignature - Optional ERC-2612 vault-share permit for `userAddress`
|
|
23
23
|
* and the registered VaultBundlesV1 spender. Omit when the share allowance meets the required amount.
|
|
24
|
-
* @param params.args.referralFeePct - Optional WAD-scaled fee
|
|
24
|
+
* @param params.args.referralFeePct - Optional WAD-scaled fee from 0% to 10%, inclusive, defaulting to zero.
|
|
25
25
|
* The fee is rounded down and deducted from the gross withdrawn assets.
|
|
26
26
|
* @param params.args.referralFeeRecipient - Optional fee recipient; a nonzero address is required
|
|
27
27
|
* when `referralFeePct > 0n`.
|
|
@@ -36,6 +36,7 @@ const common_js_1 = require("../bundles/common.js");
|
|
|
36
36
|
* @throws {InputExceedsMaxError} when `amount` or `deadline` exceeds uint256.
|
|
37
37
|
* @throws {NegativeInputError} when `referralFeePct` is negative.
|
|
38
38
|
* @throws {ReferralFeePctExceededError} when `referralFeePct` is at least WAD.
|
|
39
|
+
* @throws {MidnightReferralFeePctExceededError} when the referral fee is above 10% but below WAD.
|
|
39
40
|
* @throws {ReferralFeeRecipientMissingError} when a positive referral fee has no nonzero recipient.
|
|
40
41
|
* @throws {UnsupportedChainIdError} when the chain is absent from the address registry.
|
|
41
42
|
* @throws {UnknownAddressError} when VaultBundlesV1 is not registered on the target chain.
|
package/lib/cjs/constants.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { DEAD_ADDRESS, DEFAULT_SLIPPAGE_TOLERANCE, EIP_712_FIELDS, ERC20_ALLOWANCE_RECIPIENTS, isMarketId as isBlueMarketId, LIQUIDATION_CURSOR as BLUE_LIQUIDATION_CURSOR, MAX_LIQUIDATION_INCENTIVE_FACTOR as BLUE_MAX_LIQUIDATION_INCENTIVE_FACTOR, ORACLE_PRICE_SCALE, SECONDS_PER_YEAR, TransactionType as BlueTransactionType, } from "@morpho-org/blue-sdk";
|
|
2
2
|
export { CBP as MIDNIGHT_CBP, COLLATERAL_PARAMS_TYPEHASH as MIDNIGHT_COLLATERAL_PARAMS_TYPEHASH, DEFAULT_TICK_SPACING as MIDNIGHT_DEFAULT_TICK_SPACING, EIP712_DOMAIN_TYPEHASH as MIDNIGHT_EIP712_DOMAIN_TYPEHASH, MARKET_TYPEHASH as MIDNIGHT_MARKET_TYPEHASH, MAX_COLLATERALS as MIDNIGHT_MAX_COLLATERALS, MAX_COLLATERALS_PER_BORROWER as MIDNIGHT_MAX_COLLATERALS_PER_BORROWER, MAX_CONTINUOUS_FEE as MIDNIGHT_MAX_CONTINUOUS_FEE, MAX_OFFER_CAP as MIDNIGHT_MAX_OFFER_CAP, MAX_SETTLEMENT_FEES as MIDNIGHT_MAX_SETTLEMENT_FEES, MAX_TICK as MIDNIGHT_MAX_TICK, MAX_TREE_HEIGHT as MIDNIGHT_MAX_TREE_HEIGHT, OFFER_TYPEHASH as MIDNIGHT_OFFER_TYPEHASH, PRICE_RATIFIER_V1_OFFER_TYPEHASH as MIDNIGHT_PRICE_RATIFIER_V1_OFFER_TYPEHASH, PRICE_ROUNDING_STEP as MIDNIGHT_PRICE_ROUNDING_STEP, RATE_RATIFIER_V1_OFFER_TYPEHASH as MIDNIGHT_RATE_RATIFIER_V1_OFFER_TYPEHASH, SETTLEMENT_FEE_BREAKPOINTS as MIDNIGHT_SETTLEMENT_FEE_BREAKPOINTS, TIME_TO_MAX_LIF as MIDNIGHT_TIME_TO_MAX_LIF, } from "@morpho-org/midnight-sdk";
|
|
3
3
|
export { BLUE_API_BASE_URL, BLUE_API_GRAPHQL_URL, ChainId, ChainUtils, DOCS_BASE_URL, MORPHO_DOMAIN, REWARDS_BASE_URL, ZERO_ADDRESS, } from "@morpho-org/morpho-ts";
|
|
4
|
-
export { APPROVE_ONLY_ONCE_TOKENS, DEFAULT_ALLOCATOR_CAP_HEADROOM, DEFAULT_CAP_ACCRUAL_BUFFER, DEFAULT_LLTV_BUFFER, DEFAULT_MAX_REALLOCATION_PENALTY, DEFAULT_SUPPLY_TARGET_UTILIZATION, DEFAULT_WITHDRAWAL_TARGET_UTILIZATION, MAX_ABSOLUTE_SHARE_PRICE, MAX_REALLOCATION_PENALTY, MAX_SLIPPAGE_TOLERANCE, MAX_TOKEN_APPROVALS, MIDNIGHT_TAKE_MAX_DEADLINE_SECONDS, MIN_DEAD_SHARES, MIN_VAULT_V2_DEAD_ASSETS, } from "./helpers/constant.js";
|
|
4
|
+
export { APPROVE_ONLY_ONCE_TOKENS, DEFAULT_ALLOCATOR_CAP_HEADROOM, DEFAULT_CAP_ACCRUAL_BUFFER, DEFAULT_LLTV_BUFFER, DEFAULT_MAX_REALLOCATION_PENALTY, DEFAULT_SUPPLY_TARGET_UTILIZATION, DEFAULT_WITHDRAWAL_TARGET_UTILIZATION, MAX_ABSOLUTE_SHARE_PRICE, MAX_REALLOCATION_PENALTY, MAX_SLIPPAGE_TOLERANCE, MAX_TOKEN_APPROVALS, MIDNIGHT_TAKE_MAX_DEADLINE_SECONDS, MIN_DEAD_SHARES, MIN_VAULT_V2_DEAD_ASSETS, VAULT_DEPOSIT_MAX_DEADLINE_SECONDS, } from "./helpers/constant.js";
|
package/lib/cjs/constants.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MIN_VAULT_V2_DEAD_ASSETS = exports.MIN_DEAD_SHARES = exports.MIDNIGHT_TAKE_MAX_DEADLINE_SECONDS = exports.MAX_TOKEN_APPROVALS = exports.MAX_SLIPPAGE_TOLERANCE = exports.MAX_REALLOCATION_PENALTY = exports.MAX_ABSOLUTE_SHARE_PRICE = exports.DEFAULT_WITHDRAWAL_TARGET_UTILIZATION = exports.DEFAULT_SUPPLY_TARGET_UTILIZATION = exports.DEFAULT_MAX_REALLOCATION_PENALTY = exports.DEFAULT_LLTV_BUFFER = exports.DEFAULT_CAP_ACCRUAL_BUFFER = exports.DEFAULT_ALLOCATOR_CAP_HEADROOM = exports.APPROVE_ONLY_ONCE_TOKENS = exports.ZERO_ADDRESS = exports.REWARDS_BASE_URL = exports.MORPHO_DOMAIN = exports.DOCS_BASE_URL = exports.ChainUtils = exports.ChainId = exports.BLUE_API_GRAPHQL_URL = exports.BLUE_API_BASE_URL = exports.MIDNIGHT_TIME_TO_MAX_LIF = exports.MIDNIGHT_SETTLEMENT_FEE_BREAKPOINTS = exports.MIDNIGHT_RATE_RATIFIER_V1_OFFER_TYPEHASH = exports.MIDNIGHT_PRICE_ROUNDING_STEP = exports.MIDNIGHT_PRICE_RATIFIER_V1_OFFER_TYPEHASH = exports.MIDNIGHT_OFFER_TYPEHASH = exports.MIDNIGHT_MAX_TREE_HEIGHT = exports.MIDNIGHT_MAX_TICK = exports.MIDNIGHT_MAX_SETTLEMENT_FEES = exports.MIDNIGHT_MAX_OFFER_CAP = exports.MIDNIGHT_MAX_CONTINUOUS_FEE = exports.MIDNIGHT_MAX_COLLATERALS_PER_BORROWER = exports.MIDNIGHT_MAX_COLLATERALS = exports.MIDNIGHT_MARKET_TYPEHASH = exports.MIDNIGHT_EIP712_DOMAIN_TYPEHASH = exports.MIDNIGHT_DEFAULT_TICK_SPACING = exports.MIDNIGHT_COLLATERAL_PARAMS_TYPEHASH = exports.MIDNIGHT_CBP = exports.BlueTransactionType = exports.SECONDS_PER_YEAR = exports.ORACLE_PRICE_SCALE = exports.BLUE_MAX_LIQUIDATION_INCENTIVE_FACTOR = exports.BLUE_LIQUIDATION_CURSOR = exports.isBlueMarketId = exports.ERC20_ALLOWANCE_RECIPIENTS = exports.EIP_712_FIELDS = exports.DEFAULT_SLIPPAGE_TOLERANCE = exports.DEAD_ADDRESS = void 0;
|
|
4
|
+
exports.VAULT_DEPOSIT_MAX_DEADLINE_SECONDS = void 0;
|
|
4
5
|
var blue_sdk_1 = require("@morpho-org/blue-sdk");
|
|
5
6
|
Object.defineProperty(exports, "DEAD_ADDRESS", { enumerable: true, get: function () { return blue_sdk_1.DEAD_ADDRESS; } });
|
|
6
7
|
Object.defineProperty(exports, "DEFAULT_SLIPPAGE_TOLERANCE", { enumerable: true, get: function () { return blue_sdk_1.DEFAULT_SLIPPAGE_TOLERANCE; } });
|
|
@@ -55,3 +56,4 @@ Object.defineProperty(exports, "MAX_TOKEN_APPROVALS", { enumerable: true, get: f
|
|
|
55
56
|
Object.defineProperty(exports, "MIDNIGHT_TAKE_MAX_DEADLINE_SECONDS", { enumerable: true, get: function () { return constant_js_1.MIDNIGHT_TAKE_MAX_DEADLINE_SECONDS; } });
|
|
56
57
|
Object.defineProperty(exports, "MIN_DEAD_SHARES", { enumerable: true, get: function () { return constant_js_1.MIN_DEAD_SHARES; } });
|
|
57
58
|
Object.defineProperty(exports, "MIN_VAULT_V2_DEAD_ASSETS", { enumerable: true, get: function () { return constant_js_1.MIN_VAULT_V2_DEAD_ASSETS; } });
|
|
59
|
+
Object.defineProperty(exports, "VAULT_DEPOSIT_MAX_DEADLINE_SECONDS", { enumerable: true, get: function () { return constant_js_1.VAULT_DEPOSIT_MAX_DEADLINE_SECONDS; } });
|