@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
|
@@ -15,8 +15,9 @@ import { parseBlueSupplyCollateralBorrow } from "./supplyCollateralBorrow.intern
|
|
|
15
15
|
* @param params.args.maxLtv - Maximum post-operation LTV.
|
|
16
16
|
* @param params.args.nativeAmount - Exclusive native collateral funding.
|
|
17
17
|
* @param params.args.reallocations - Vault V2 reallocations executed before borrowing.
|
|
18
|
+
* @param params.args.maxPenalty - Maximum WAD-scaled penalty rate per reallocation in [0, WAD], defaulting to zero. Each rate applies to that reallocation's assets, so it does not bound total proceeds lost.
|
|
18
19
|
* @param params.args.deadline - Final call deadline in Unix seconds.
|
|
19
|
-
* @param params.args.referralFeePct - Optional WAD-scaled fee
|
|
20
|
+
* @param params.args.referralFeePct - Optional WAD-scaled fee at most 10%.
|
|
20
21
|
* @param params.args.referralFeeRecipient - Recipient required for a positive fee.
|
|
21
22
|
* @param params.args.requirementSignature - Optional collateral token signature.
|
|
22
23
|
* @param params.args.authorizationSignature - Optional Blue authorization signature.
|
|
@@ -25,12 +26,17 @@ import { parseBlueSupplyCollateralBorrow } from "./supplyCollateralBorrow.intern
|
|
|
25
26
|
* whose `to` address is BlueBundlesV1 and whose `action` records the normalized inputs.
|
|
26
27
|
* @throws {MarketIdMismatchError} when the target market or a reallocation source market has an
|
|
27
28
|
* `id` that does not hash from its tuple fields.
|
|
29
|
+
* @throws {InvalidBigIntInputError} when a supplied maxPenalty is not a bigint.
|
|
28
30
|
* @throws {NegativeInputError} when an amount, `maxLtv`, native value, or fee is negative.
|
|
31
|
+
* Also thrown when maxPenalty is negative.
|
|
29
32
|
* @throws {NonPositiveInputError} when both operation legs are zero, the deadline is not positive,
|
|
30
33
|
* or a reallocation amount is not positive.
|
|
31
34
|
* @throws {ReallocationsRequireBorrowError} when reallocations accompany no borrow.
|
|
32
|
-
* @throws {InputExceedsMaxError} when a
|
|
35
|
+
* @throws {InputExceedsMaxError} when a reallocation amount or penalty exceeds its ABI bound.
|
|
36
|
+
* Also thrown when maxPenalty exceeds WAD or a penalty exceeds maxPenalty (zero by default).
|
|
33
37
|
* @throws {ReferralFeeRecipientMissingError} when a positive fee has no recipient.
|
|
38
|
+
* @throws {ReferralFeePctExceededError} when the referral fee is at least WAD.
|
|
39
|
+
* @throws {MidnightReferralFeePctExceededError} when the referral fee is above 10% but below WAD.
|
|
34
40
|
* @throws {InvalidReallocationAddressError} when a vault or adapter address is malformed.
|
|
35
41
|
* @throws {InvalidVaultV2BlueReallocationShapeError} when a reallocation entry is not a valid Vault V2 reallocation.
|
|
36
42
|
* @throws {InvalidReallocationSourceTypeError} when a reallocation source is malformed.
|
|
@@ -18,9 +18,11 @@ export interface BlueWithdrawParams {
|
|
|
18
18
|
readonly withdrawShares: bigint;
|
|
19
19
|
/** Optional validated Vault V2 BluePublicAllocator reallocations. */
|
|
20
20
|
readonly reallocations?: Iterable<VaultV2BlueReallocation>;
|
|
21
|
+
/** Maximum WAD-scaled penalty rate per reallocation, defaulting to zero; it does not bound total proceeds lost. */
|
|
22
|
+
readonly maxPenalty?: bigint;
|
|
21
23
|
/** Final call deadline in Unix seconds. */
|
|
22
24
|
readonly deadline: bigint;
|
|
23
|
-
/** Optional WAD-scaled referral fee,
|
|
25
|
+
/** Optional WAD-scaled referral fee, at most 10%. */
|
|
24
26
|
readonly referralFeePct?: bigint;
|
|
25
27
|
/** Recipient required when `referralFeePct` is positive. */
|
|
26
28
|
readonly referralFeeRecipient?: Address;
|
|
@@ -44,8 +46,9 @@ export interface BlueWithdrawParams {
|
|
|
44
46
|
* @param params.args.withdrawAssets - Exact assets withdrawn, exclusive with shares.
|
|
45
47
|
* @param params.args.withdrawShares - Exact shares burned, exclusive with assets.
|
|
46
48
|
* @param params.args.reallocations - Vault V2 reallocations executed before withdrawal.
|
|
49
|
+
* @param params.args.maxPenalty - Maximum WAD-scaled penalty rate per reallocation in [0, WAD], defaulting to zero. Each rate applies to that reallocation's assets, so it does not bound total proceeds lost.
|
|
47
50
|
* @param params.args.deadline - Final call deadline in Unix seconds.
|
|
48
|
-
* @param params.args.referralFeePct - Optional WAD-scaled fee
|
|
51
|
+
* @param params.args.referralFeePct - Optional WAD-scaled fee at most 10%.
|
|
49
52
|
* @param params.args.referralFeeRecipient - Recipient required for a positive fee.
|
|
50
53
|
* @param params.args.authorizationSignature - Optional Blue authorization signature.
|
|
51
54
|
* @param params.metadata - Optional transaction metadata.
|
|
@@ -53,12 +56,17 @@ export interface BlueWithdrawParams {
|
|
|
53
56
|
* BlueBundlesV1 and whose `action` records the normalized withdrawal inputs.
|
|
54
57
|
* @throws {MarketIdMismatchError} when the target market or a reallocation source market has an
|
|
55
58
|
* `id` that does not hash from its tuple fields.
|
|
59
|
+
* @throws {InvalidBigIntInputError} when a supplied maxPenalty is not a bigint.
|
|
56
60
|
* @throws {NegativeInputError} when an amount, fee, or reallocation penalty is negative.
|
|
61
|
+
* Also thrown when maxPenalty is negative.
|
|
57
62
|
* @throws {MutuallyExclusiveWithdrawAmountsError} when assets and shares are both nonzero.
|
|
58
63
|
* @throws {NonPositiveInputError} when neither mode, no valid deadline, or a non-positive
|
|
59
64
|
* reallocation amount is provided.
|
|
60
|
-
* @throws {InputExceedsMaxError} when a withdraw amount,
|
|
65
|
+
* @throws {InputExceedsMaxError} when a withdraw amount, reallocation amount, or penalty exceeds its ABI bound.
|
|
66
|
+
* Also thrown when maxPenalty exceeds WAD or a penalty exceeds maxPenalty (zero by default).
|
|
61
67
|
* @throws {ReferralFeeRecipientMissingError} when a positive fee has no recipient.
|
|
68
|
+
* @throws {ReferralFeePctExceededError} when the referral fee is at least WAD.
|
|
69
|
+
* @throws {MidnightReferralFeePctExceededError} when the referral fee is above 10% but below WAD.
|
|
62
70
|
* @throws {InvalidReallocationAddressError} when a vault or adapter address is malformed.
|
|
63
71
|
* @throws {InvalidVaultV2BlueReallocationShapeError} when a reallocation entry is not a valid Vault V2 reallocation.
|
|
64
72
|
* @throws {InvalidReallocationSourceTypeError} when a reallocation source is malformed.
|
|
@@ -50,7 +50,10 @@ export const parseBlueWithdraw = (params) => {
|
|
|
50
50
|
...common,
|
|
51
51
|
authorizationSignature: params.args.authorizationSignature,
|
|
52
52
|
});
|
|
53
|
-
const allocations = parseBlueWithdrawPenalty(parseBlueAllocations([...(params.args.reallocations ?? [])],
|
|
53
|
+
const allocations = parseBlueWithdrawPenalty(parseBlueAllocations([...(params.args.reallocations ?? [])], {
|
|
54
|
+
marketParams,
|
|
55
|
+
maxPenalty: params.args.maxPenalty,
|
|
56
|
+
}), mode);
|
|
54
57
|
const fields = {
|
|
55
58
|
...normalized,
|
|
56
59
|
chainId: common.chainId,
|
|
@@ -14,8 +14,9 @@ import { parseBlueWithdraw } from "./withdraw.internal.js";
|
|
|
14
14
|
* @param params.args.withdrawAssets - Exact assets withdrawn, exclusive with shares.
|
|
15
15
|
* @param params.args.withdrawShares - Exact shares burned, exclusive with assets.
|
|
16
16
|
* @param params.args.reallocations - Vault V2 reallocations executed before withdrawal.
|
|
17
|
+
* @param params.args.maxPenalty - Maximum WAD-scaled penalty rate per reallocation in [0, WAD], defaulting to zero. Each rate applies to that reallocation's assets, so it does not bound total proceeds lost.
|
|
17
18
|
* @param params.args.deadline - Final call deadline in Unix seconds.
|
|
18
|
-
* @param params.args.referralFeePct - Optional WAD-scaled fee
|
|
19
|
+
* @param params.args.referralFeePct - Optional WAD-scaled fee at most 10%.
|
|
19
20
|
* @param params.args.referralFeeRecipient - Recipient required for a positive fee.
|
|
20
21
|
* @param params.args.authorizationSignature - Optional Blue authorization signature.
|
|
21
22
|
* @param params.metadata - Optional transaction metadata.
|
|
@@ -23,12 +24,17 @@ import { parseBlueWithdraw } from "./withdraw.internal.js";
|
|
|
23
24
|
* BlueBundlesV1 and whose `action` records the normalized withdrawal inputs.
|
|
24
25
|
* @throws {MarketIdMismatchError} when the target market or a reallocation source market has an
|
|
25
26
|
* `id` that does not hash from its tuple fields.
|
|
27
|
+
* @throws {InvalidBigIntInputError} when a supplied maxPenalty is not a bigint.
|
|
26
28
|
* @throws {NegativeInputError} when an amount, fee, or reallocation penalty is negative.
|
|
29
|
+
* Also thrown when maxPenalty is negative.
|
|
27
30
|
* @throws {MutuallyExclusiveWithdrawAmountsError} when assets and shares are both nonzero.
|
|
28
31
|
* @throws {NonPositiveInputError} when neither mode, no valid deadline, or a non-positive
|
|
29
32
|
* reallocation amount is provided.
|
|
30
|
-
* @throws {InputExceedsMaxError} when a withdraw amount,
|
|
33
|
+
* @throws {InputExceedsMaxError} when a withdraw amount, reallocation amount, or penalty exceeds its ABI bound.
|
|
34
|
+
* Also thrown when maxPenalty exceeds WAD or a penalty exceeds maxPenalty (zero by default).
|
|
31
35
|
* @throws {ReferralFeeRecipientMissingError} when a positive fee has no recipient.
|
|
36
|
+
* @throws {ReferralFeePctExceededError} when the referral fee is at least WAD.
|
|
37
|
+
* @throws {MidnightReferralFeePctExceededError} when the referral fee is above 10% but below WAD.
|
|
32
38
|
* @throws {InvalidReallocationAddressError} when a vault or adapter address is malformed.
|
|
33
39
|
* @throws {InvalidVaultV2BlueReallocationShapeError} when a reallocation entry is not a valid Vault V2 reallocation.
|
|
34
40
|
* @throws {InvalidReallocationSourceTypeError} when a reallocation source is malformed.
|
|
@@ -18,7 +18,7 @@ export interface BlueWithdrawCollateralParams {
|
|
|
18
18
|
readonly maxLtv: bigint;
|
|
19
19
|
/** Final call deadline in Unix seconds. */
|
|
20
20
|
readonly deadline: bigint;
|
|
21
|
-
/** Optional WAD-scaled referral fee,
|
|
21
|
+
/** Optional WAD-scaled referral fee, at most 10%. */
|
|
22
22
|
readonly referralFeePct?: bigint;
|
|
23
23
|
/** Recipient required when `referralFeePct` is positive. */
|
|
24
24
|
readonly referralFeeRecipient?: Address;
|
|
@@ -41,7 +41,7 @@ export interface BlueWithdrawCollateralParams {
|
|
|
41
41
|
* @param params.args.collateralAssets - Collateral assets withdrawn.
|
|
42
42
|
* @param params.args.maxLtv - Maximum post-operation LTV.
|
|
43
43
|
* @param params.args.deadline - Final call deadline in Unix seconds.
|
|
44
|
-
* @param params.args.referralFeePct - Optional WAD-scaled referral fee
|
|
44
|
+
* @param params.args.referralFeePct - Optional WAD-scaled referral fee, at most 10%.
|
|
45
45
|
* @param params.args.referralFeeRecipient - Recipient required for a positive fee.
|
|
46
46
|
* @param params.args.authorizationSignature - Optional Blue authorization signature.
|
|
47
47
|
* @param params.metadata - Optional transaction metadata.
|
|
@@ -50,8 +50,9 @@ export interface BlueWithdrawCollateralParams {
|
|
|
50
50
|
* @throws {MarketIdMismatchError} when `marketParams.id` does not hash from its tuple fields.
|
|
51
51
|
* @throws {NegativeInputError} when collateral, LTV, or fee is negative.
|
|
52
52
|
* @throws {NonPositiveInputError} when collateral or deadline is not positive.
|
|
53
|
-
* @throws {InputExceedsMaxError} when the referral fee is at least WAD.
|
|
54
53
|
* @throws {ReferralFeeRecipientMissingError} when a positive fee has no recipient.
|
|
54
|
+
* @throws {ReferralFeePctExceededError} when the referral fee is at least WAD.
|
|
55
|
+
* @throws {MidnightReferralFeePctExceededError} when the referral fee is above 10% but below WAD.
|
|
55
56
|
* @throws {DepositOwnerMismatchError} when the signed authorization owner differs from `userAddress`.
|
|
56
57
|
* @throws {BundlesRequirementSignatureMismatchError} when authorization cannot be bound safely.
|
|
57
58
|
* @throws {UnsupportedChainIdError} when the chain is absent from the registry.
|
|
@@ -12,7 +12,7 @@ import { buildBlueWithdrawCollateral, parseBlueWithdrawCollateral, } from "./wit
|
|
|
12
12
|
* @param params.args.collateralAssets - Collateral assets withdrawn.
|
|
13
13
|
* @param params.args.maxLtv - Maximum post-operation LTV.
|
|
14
14
|
* @param params.args.deadline - Final call deadline in Unix seconds.
|
|
15
|
-
* @param params.args.referralFeePct - Optional WAD-scaled referral fee
|
|
15
|
+
* @param params.args.referralFeePct - Optional WAD-scaled referral fee, at most 10%.
|
|
16
16
|
* @param params.args.referralFeeRecipient - Recipient required for a positive fee.
|
|
17
17
|
* @param params.args.authorizationSignature - Optional Blue authorization signature.
|
|
18
18
|
* @param params.metadata - Optional transaction metadata.
|
|
@@ -21,8 +21,9 @@ import { buildBlueWithdrawCollateral, parseBlueWithdrawCollateral, } from "./wit
|
|
|
21
21
|
* @throws {MarketIdMismatchError} when `marketParams.id` does not hash from its tuple fields.
|
|
22
22
|
* @throws {NegativeInputError} when collateral, LTV, or fee is negative.
|
|
23
23
|
* @throws {NonPositiveInputError} when collateral or deadline is not positive.
|
|
24
|
-
* @throws {InputExceedsMaxError} when the referral fee is at least WAD.
|
|
25
24
|
* @throws {ReferralFeeRecipientMissingError} when a positive fee has no recipient.
|
|
25
|
+
* @throws {ReferralFeePctExceededError} when the referral fee is at least WAD.
|
|
26
|
+
* @throws {MidnightReferralFeePctExceededError} when the referral fee is above 10% but below WAD.
|
|
26
27
|
* @throws {DepositOwnerMismatchError} when the signed authorization owner differs from `userAddress`.
|
|
27
28
|
* @throws {BundlesRequirementSignatureMismatchError} when authorization cannot be bound safely.
|
|
28
29
|
* @throws {UnsupportedChainIdError} when the chain is absent from the registry.
|
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
import { type Address, type Hex } from "viem";
|
|
2
|
+
import { BundlesPermitKind } from "../../abis.js";
|
|
2
3
|
import { type BaseAction, type BundlesFundingArgs, type BundlesTokenRequirementSignature, type Erc2612RequirementSignature, type Metadata, type PermitRequirementSignature, type RequirementSignature, type TokenRequirementSignature, type Transaction } from "../../types/index.js";
|
|
3
|
-
|
|
4
|
-
export declare const BundlesPermitKind: {
|
|
5
|
-
readonly None: 0;
|
|
6
|
-
readonly ERC2612: 1;
|
|
7
|
-
readonly Permit2: 2;
|
|
8
|
-
};
|
|
9
|
-
/** A numeric permit kind consumed by `TokenLib.pullToken`. */
|
|
10
|
-
export type BundlesPermitKind = (typeof BundlesPermitKind)[keyof typeof BundlesPermitKind];
|
|
4
|
+
export { BundlesPermitKind } from "../../abis.js";
|
|
11
5
|
/** ABI-ready token permit consumed by fixed bundles deposit and funding entrypoints. */
|
|
12
6
|
export interface BundlesTokenPermit {
|
|
13
7
|
/** TokenLib permit dispatch kind. */
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
import { MathLib } from "@morpho-org/blue-sdk";
|
|
2
2
|
import { deepFreeze, getChainAddress } from "@morpho-org/morpho-ts";
|
|
3
3
|
import { compactSignatureToSignature, encodeAbiParameters, isAddressEqual, parseCompactSignature, parseSignature, size, zeroHash, } from "viem";
|
|
4
|
+
import { BundlesPermitKind, bundlesPermitParameters } from "../../abis.js";
|
|
4
5
|
import { addTransactionMetadata } from "../../helpers/index.js";
|
|
5
6
|
import { parseDeadline } from "../../helpers/parse.js";
|
|
6
7
|
import { validateDeadline, validateReferralFee, } from "../../helpers/validate.js";
|
|
7
8
|
import { AmbiguousRequirementSignaturesError, BundlesPermitMismatchError, BundlesRequirementSignatureMismatchError, DepositAmountMismatchError, DepositAssetMismatchError, DepositOwnerMismatchError, DepositSpenderMismatchError, MixedBundlesFundingError, NegativeInputError, NonPositiveInputError, selectRequirementSignatures, UnexpectedRequirementSignatureError, UnsupportedRequirementSignatureError, } from "../../types/index.js";
|
|
8
|
-
|
|
9
|
-
export const BundlesPermitKind = {
|
|
10
|
-
None: 0,
|
|
11
|
-
ERC2612: 1,
|
|
12
|
-
Permit2: 2,
|
|
13
|
-
};
|
|
9
|
+
export { BundlesPermitKind } from "../../abis.js";
|
|
14
10
|
const EMPTY_TOKEN_PERMIT = {
|
|
15
11
|
kind: BundlesPermitKind.None,
|
|
16
12
|
data: "0x",
|
|
@@ -143,11 +139,7 @@ export const getBundlesTokenPermit = (params) => {
|
|
|
143
139
|
if (requirementSignature.action.type === "permit2SignatureTransfer") {
|
|
144
140
|
return {
|
|
145
141
|
kind: BundlesPermitKind.Permit2,
|
|
146
|
-
data: encodeAbiParameters([
|
|
147
|
-
{ type: "uint256", name: "nonce" },
|
|
148
|
-
{ type: "uint256", name: "deadline" },
|
|
149
|
-
{ type: "bytes", name: "signature" },
|
|
150
|
-
], [
|
|
142
|
+
data: encodeAbiParameters(bundlesPermitParameters[BundlesPermitKind.Permit2], [
|
|
151
143
|
requirementSignature.args.nonce,
|
|
152
144
|
requirementSignature.args.deadline,
|
|
153
145
|
requirementSignature.args.signature,
|
|
@@ -171,12 +163,7 @@ export const getBundlesTokenPermit = (params) => {
|
|
|
171
163
|
}
|
|
172
164
|
return {
|
|
173
165
|
kind: BundlesPermitKind.ERC2612,
|
|
174
|
-
data: encodeAbiParameters([
|
|
175
|
-
{ type: "uint256", name: "deadline" },
|
|
176
|
-
{ type: "uint8", name: "v" },
|
|
177
|
-
{ type: "bytes32", name: "r" },
|
|
178
|
-
{ type: "bytes32", name: "s" },
|
|
179
|
-
], [
|
|
166
|
+
data: encodeAbiParameters(bundlesPermitParameters[BundlesPermitKind.ERC2612], [
|
|
180
167
|
requirementSignature.args.deadline,
|
|
181
168
|
signature.v,
|
|
182
169
|
signature.r,
|
|
@@ -4,7 +4,7 @@ import { maxUint256 } from "viem";
|
|
|
4
4
|
import { parseDeadline, parseReferralFee } from "../../helpers/parse.js";
|
|
5
5
|
import { parseMidnightNativeFunding } from "../../helpers/parseMidnight.js";
|
|
6
6
|
import { validateMidnightAddress } from "../../helpers/validateMidnightAccount.js";
|
|
7
|
-
import {
|
|
7
|
+
import { validateMidnightTakeableOfferBounds, validateMidnightUint128Field, } from "../../helpers/validateMidnightBounds.js";
|
|
8
8
|
import { validateMidnightCollateralSupplies } from "../../helpers/validateMidnightCollateralSupplies.js";
|
|
9
9
|
import { validateMidnightMarket } from "../../helpers/validateMidnightMarket.js";
|
|
10
10
|
import { validateMidnightReceiver } from "../../helpers/validateMidnightReceiver.js";
|
|
@@ -156,7 +156,6 @@ export const parseMidnightSupplyCollateralTakeBorrow = (params) => {
|
|
|
156
156
|
validateMidnightAddress("referralFeeRecipient", params.referralFeeRecipient);
|
|
157
157
|
}
|
|
158
158
|
const { referralFeePct, referralFeeRecipient } = parseReferralFee(params);
|
|
159
|
-
validateMidnightReferralFeeCap(referralFeePct);
|
|
160
159
|
validateMidnightSellTargetBounds({ target, referralFeePct });
|
|
161
160
|
if (referralFeePct > 0n) {
|
|
162
161
|
// Rejects fee recipients that would strand the fee in a contract.
|
|
@@ -2,7 +2,7 @@ import { deepFreeze } from "@morpho-org/morpho-ts";
|
|
|
2
2
|
import { maxUint256 } from "viem";
|
|
3
3
|
import { parseDeadline, parseReferralFee } from "../../helpers/parse.js";
|
|
4
4
|
import { validateMidnightAddress } from "../../helpers/validateMidnightAccount.js";
|
|
5
|
-
import {
|
|
5
|
+
import { validateMidnightTakeableOfferBounds, validateMidnightUint128Field, } from "../../helpers/validateMidnightBounds.js";
|
|
6
6
|
import { validateMidnightMarket } from "../../helpers/validateMidnightMarket.js";
|
|
7
7
|
import { validateMidnightReceiver } from "../../helpers/validateMidnightReceiver.js";
|
|
8
8
|
import { validateMidnightSellTargetBounds } from "../../helpers/validateMidnightTakeFeasibility.js";
|
|
@@ -131,7 +131,6 @@ export const parseMidnightTakeBorrow = (params) => {
|
|
|
131
131
|
validateMidnightAddress("referralFeeRecipient", params.referralFeeRecipient);
|
|
132
132
|
}
|
|
133
133
|
const { referralFeePct, referralFeeRecipient } = parseReferralFee(params);
|
|
134
|
-
validateMidnightReferralFeeCap(referralFeePct);
|
|
135
134
|
validateMidnightSellTargetBounds({ target, referralFeePct });
|
|
136
135
|
if (referralFeePct > 0n) {
|
|
137
136
|
// Rejects fee recipients that would strand the fee in a contract.
|
|
@@ -4,7 +4,7 @@ import { maxUint256 } from "viem";
|
|
|
4
4
|
import { parseDeadline, parseReferralFee, parseUint256, } from "../../helpers/parse.js";
|
|
5
5
|
import { parseMidnightNativeFunding } from "../../helpers/parseMidnight.js";
|
|
6
6
|
import { validateMidnightAddress } from "../../helpers/validateMidnightAccount.js";
|
|
7
|
-
import {
|
|
7
|
+
import { validateMidnightTakeableOfferBounds, validateMidnightUint128Field, } from "../../helpers/validateMidnightBounds.js";
|
|
8
8
|
import { validateMidnightMarket } from "../../helpers/validateMidnightMarket.js";
|
|
9
9
|
import { validateMidnightReceiver } from "../../helpers/validateMidnightReceiver.js";
|
|
10
10
|
import { validatePositiveInput } from "../../helpers/validatePositiveInput.js";
|
|
@@ -125,7 +125,6 @@ export const parseMidnightTakeLend = (params) => {
|
|
|
125
125
|
validateMidnightAddress("referralFeeRecipient", params.referralFeeRecipient);
|
|
126
126
|
}
|
|
127
127
|
const { referralFeePct, referralFeeRecipient } = parseReferralFee(params);
|
|
128
|
-
validateMidnightReferralFeeCap(referralFeePct);
|
|
129
128
|
if (referralFeePct > 0n) {
|
|
130
129
|
// Rejects fee recipients that would strand the fee in a contract.
|
|
131
130
|
validateMidnightReceiver({
|
|
@@ -4,7 +4,7 @@ import { maxUint256 } from "viem";
|
|
|
4
4
|
import { parseDeadline, parseReferralFee, parseUint256, } from "../../helpers/parse.js";
|
|
5
5
|
import { parseMidnightNativeFunding } from "../../helpers/parseMidnight.js";
|
|
6
6
|
import { validateMidnightAddress } from "../../helpers/validateMidnightAccount.js";
|
|
7
|
-
import {
|
|
7
|
+
import { validateMidnightTakeableOfferBounds, validateMidnightUint128Field, } from "../../helpers/validateMidnightBounds.js";
|
|
8
8
|
import { validateMidnightMarket } from "../../helpers/validateMidnightMarket.js";
|
|
9
9
|
import { validateMidnightReceiver } from "../../helpers/validateMidnightReceiver.js";
|
|
10
10
|
import { validatePositiveInput } from "../../helpers/validatePositiveInput.js";
|
|
@@ -160,7 +160,6 @@ export const parseMidnightTakeRepayWithdrawCollateral = (params) => {
|
|
|
160
160
|
validateMidnightAddress("referralFeeRecipient", params.referralFeeRecipient);
|
|
161
161
|
}
|
|
162
162
|
const { referralFeePct, referralFeeRecipient } = parseReferralFee(params);
|
|
163
|
-
validateMidnightReferralFeeCap(referralFeePct);
|
|
164
163
|
if (referralFeePct > 0n) {
|
|
165
164
|
// Rejects fee recipients that would strand the fee in a contract.
|
|
166
165
|
validateMidnightReceiver({
|
|
@@ -2,7 +2,7 @@ import { deepFreeze } from "@morpho-org/morpho-ts";
|
|
|
2
2
|
import { maxUint256 } from "viem";
|
|
3
3
|
import { parseDeadline, parseReferralFee } from "../../helpers/parse.js";
|
|
4
4
|
import { validateMidnightAddress } from "../../helpers/validateMidnightAccount.js";
|
|
5
|
-
import {
|
|
5
|
+
import { validateMidnightTakeableOfferBounds, validateMidnightUint128Field, } from "../../helpers/validateMidnightBounds.js";
|
|
6
6
|
import { validateMidnightMarket } from "../../helpers/validateMidnightMarket.js";
|
|
7
7
|
import { validateMidnightReceiver } from "../../helpers/validateMidnightReceiver.js";
|
|
8
8
|
import { validateMidnightSellTargetBounds } from "../../helpers/validateMidnightTakeFeasibility.js";
|
|
@@ -126,7 +126,6 @@ export const parseMidnightTakeWithdraw = (params) => {
|
|
|
126
126
|
validateMidnightAddress("referralFeeRecipient", params.referralFeeRecipient);
|
|
127
127
|
}
|
|
128
128
|
const { referralFeePct, referralFeeRecipient } = parseReferralFee(params);
|
|
129
|
-
validateMidnightReferralFeeCap(referralFeePct);
|
|
130
129
|
validateMidnightSellTargetBounds({ target, referralFeePct });
|
|
131
130
|
if (referralFeePct > 0n) {
|
|
132
131
|
// 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.
|
|
@@ -20,7 +20,7 @@ import { finalizeVaultBundlesV1Transaction, getBundlesReferralFeeAssets, getBund
|
|
|
20
20
|
* @param params.args.recipient - Unsupported; shares are always minted to the transaction sender.
|
|
21
21
|
* @param params.args.requirementSignature - Optional ERC-2612 or Permit2 SignatureTransfer signature
|
|
22
22
|
* for the gross amount, vault asset, `userAddress`, and VaultBundlesV1 spender.
|
|
23
|
-
* @param params.args.referralFeePct - Optional WAD-scaled fee
|
|
23
|
+
* @param params.args.referralFeePct - Optional WAD-scaled fee from 0% to 10%, inclusive, defaulting to zero.
|
|
24
24
|
* The fee is rounded down and deducted from gross assets before depositing.
|
|
25
25
|
* @param params.args.referralFeeRecipient - Optional fee recipient; a nonzero address is required
|
|
26
26
|
* when `referralFeePct > 0n`.
|
|
@@ -38,6 +38,7 @@ import { finalizeVaultBundlesV1Transaction, getBundlesReferralFeeAssets, getBund
|
|
|
38
38
|
* @throws {NativeAmountOnNonWNativeVaultError} when native funding targets a non-wNative vault.
|
|
39
39
|
* @throws {ReferralFeePctExceededError} when `referralFeePct` is at least WAD; it extends
|
|
40
40
|
* {@link InputExceedsMaxError}, so either class catches it.
|
|
41
|
+
* @throws {MidnightReferralFeePctExceededError} when the referral fee is above 10% but below WAD.
|
|
41
42
|
* @throws {ReferralFeeRecipientMissingError} when a positive `referralFeePct` has no recipient.
|
|
42
43
|
* @throws {UnexpectedRequirementSignatureError} when native funding carries a token permit.
|
|
43
44
|
* @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.
|
|
@@ -23,7 +23,7 @@ import { finalizeVaultBundlesV1Transaction, getBundlesReferralFeeAssets, getPars
|
|
|
23
23
|
* share-price bound.
|
|
24
24
|
* @param params.args.requirementSignature - Optional ERC-2612 vault-share permit for `userAddress`
|
|
25
25
|
* and the registered VaultBundlesV1 spender. Omit when the share allowance is already set.
|
|
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`.
|
|
@@ -40,6 +40,7 @@ import { finalizeVaultBundlesV1Transaction, getBundlesReferralFeeAssets, getPars
|
|
|
40
40
|
* @throws {InputExceedsMaxError} when the selected amount, `maxSharePriceVaultV2`, or `deadline` exceeds uint256.
|
|
41
41
|
* @throws {NegativeInputError} when `referralFeePct` is negative.
|
|
42
42
|
* @throws {ReferralFeePctExceededError} when `referralFeePct` is at least WAD.
|
|
43
|
+
* @throws {MidnightReferralFeePctExceededError} when the referral fee is above 10% but below WAD.
|
|
43
44
|
* @throws {ReferralFeeRecipientMissingError} when a positive referral fee has no non-zero recipient.
|
|
44
45
|
* @throws {UnsupportedChainIdError} when the chain is absent from the address registry.
|
|
45
46
|
* @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.
|
|
@@ -15,7 +15,7 @@ import { finalizeVaultBundlesV1Transaction, getParsedBundlesSharesPermit, normal
|
|
|
15
15
|
* @param params.args.onBehalf - Unsupported; VaultBundlesV1 always burns the transaction sender's shares.
|
|
16
16
|
* @param params.args.requirementSignature - Optional ERC-2612 vault-share permit for `userAddress`
|
|
17
17
|
* and the registered VaultBundlesV1 spender. Omit when the share allowance is already set.
|
|
18
|
-
* @param params.args.referralFeePct - Optional WAD-scaled fee
|
|
18
|
+
* @param params.args.referralFeePct - Optional WAD-scaled fee from 0% to 10%, inclusive, defaulting to zero.
|
|
19
19
|
* The fee is rounded down and deducted from the gross redeemed assets.
|
|
20
20
|
* @param params.args.referralFeeRecipient - Optional fee recipient; a nonzero address is required
|
|
21
21
|
* when `referralFeePct > 0n`.
|
|
@@ -29,6 +29,7 @@ import { finalizeVaultBundlesV1Transaction, getParsedBundlesSharesPermit, normal
|
|
|
29
29
|
* @throws {InputExceedsMaxError} when `shares` or `deadline` exceeds uint256.
|
|
30
30
|
* @throws {NegativeInputError} when `referralFeePct` is negative.
|
|
31
31
|
* @throws {ReferralFeePctExceededError} when `referralFeePct` is at least WAD.
|
|
32
|
+
* @throws {MidnightReferralFeePctExceededError} when the referral fee is above 10% but below WAD.
|
|
32
33
|
* @throws {ReferralFeeRecipientMissingError} when a positive referral fee has no non-zero recipient.
|
|
33
34
|
* @throws {UnsupportedChainIdError} when the chain is absent from the address registry.
|
|
34
35
|
* @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.
|
|
@@ -18,7 +18,7 @@ import { finalizeVaultBundlesV1Transaction, getBundlesReferralFeeAssets, getPars
|
|
|
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 meets the required amount.
|
|
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 withdrawn assets.
|
|
23
23
|
* @param params.args.referralFeeRecipient - Optional fee recipient; a nonzero address is required
|
|
24
24
|
* when `referralFeePct > 0n`.
|
|
@@ -33,6 +33,7 @@ import { finalizeVaultBundlesV1Transaction, getBundlesReferralFeeAssets, getPars
|
|
|
33
33
|
* @throws {InputExceedsMaxError} when `amount` or `deadline` exceeds uint256.
|
|
34
34
|
* @throws {NegativeInputError} when `referralFeePct` is negative.
|
|
35
35
|
* @throws {ReferralFeePctExceededError} when `referralFeePct` is at least WAD.
|
|
36
|
+
* @throws {MidnightReferralFeePctExceededError} when the referral fee is above 10% but below WAD.
|
|
36
37
|
* @throws {ReferralFeeRecipientMissingError} when a positive referral fee has no nonzero recipient.
|
|
37
38
|
* @throws {UnsupportedChainIdError} when the chain is absent from the address registry.
|
|
38
39
|
* @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.
|
|
@@ -20,7 +20,7 @@ import { finalizeVaultBundlesV1Transaction, getBundlesReferralFeeAssets, getBund
|
|
|
20
20
|
* @param params.args.recipient - Unsupported; shares are always minted to the transaction sender.
|
|
21
21
|
* @param params.args.requirementSignature - Optional ERC-2612 or Permit2 SignatureTransfer signature
|
|
22
22
|
* for the gross amount, vault asset, `userAddress`, and VaultBundlesV1 spender.
|
|
23
|
-
* @param params.args.referralFeePct - Optional WAD-scaled fee
|
|
23
|
+
* @param params.args.referralFeePct - Optional WAD-scaled fee from 0% to 10%, inclusive, defaulting to zero.
|
|
24
24
|
* The fee is rounded down and deducted from gross assets before depositing.
|
|
25
25
|
* @param params.args.referralFeeRecipient - Optional fee recipient; a nonzero address is required
|
|
26
26
|
* when `referralFeePct > 0n`.
|
|
@@ -38,6 +38,7 @@ import { finalizeVaultBundlesV1Transaction, getBundlesReferralFeeAssets, getBund
|
|
|
38
38
|
* @throws {NativeAmountOnNonWNativeVaultError} when native funding targets a non-wNative vault.
|
|
39
39
|
* @throws {ReferralFeePctExceededError} when `referralFeePct` is at least WAD; it extends
|
|
40
40
|
* {@link InputExceedsMaxError}, so either class catches it.
|
|
41
|
+
* @throws {MidnightReferralFeePctExceededError} when the referral fee is above 10% but below WAD.
|
|
41
42
|
* @throws {ReferralFeeRecipientMissingError} when a positive `referralFeePct` has no recipient.
|
|
42
43
|
* @throws {UnexpectedRequirementSignatureError} when native funding carries a token permit.
|
|
43
44
|
* @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.
|
|
@@ -33,7 +33,7 @@ import { getParsedBundlesSharesPermit } from "../bundles/common.js";
|
|
|
33
33
|
* submitting account must equal this address.
|
|
34
34
|
* @param params.args.deadline - Permit and bundle deadline.
|
|
35
35
|
* @param params.args.referralFeePct - Optional WAD-scaled share of the withdrawn assets routed to
|
|
36
|
-
* `referralFeeRecipient
|
|
36
|
+
* `referralFeeRecipient`, at most 10%. Defaults to `0n`. Deducted *after* the `minSharePriceE27` check, so it
|
|
37
37
|
* is outside that bound's protection.
|
|
38
38
|
* @param params.args.referralFeeRecipient - Optional referral fee recipient. Defaults to the zero
|
|
39
39
|
* address, which is only valid alongside a zero `referralFeePct`.
|
|
@@ -45,6 +45,7 @@ import { getParsedBundlesSharesPermit } from "../bundles/common.js";
|
|
|
45
45
|
* @throws {NegativeInputError} when `referralFeePct` or `minSharePriceE27` is negative.
|
|
46
46
|
* @throws {ReferralFeePctExceededError} when `referralFeePct` is not below WAD (the contract
|
|
47
47
|
* rejects it with `PctExceeded`); it extends {@link InputExceedsMaxError}.
|
|
48
|
+
* @throws {MidnightReferralFeePctExceededError} when the referral fee is above 10% but below WAD.
|
|
48
49
|
* @throws {InputExceedsMaxError} when `exitAssets`, `deadline`, or `minSharePriceE27` exceeds `uint256`.
|
|
49
50
|
* @throws {ReferralFeeRecipientMissingError} when a positive `referralFeePct` has no recipient.
|
|
50
51
|
* @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.
|
|
@@ -15,7 +15,7 @@ import { finalizeVaultBundlesV1Transaction, getParsedBundlesSharesPermit, normal
|
|
|
15
15
|
* @param params.args.onBehalf - Unsupported; VaultBundlesV1 always burns the transaction sender's shares.
|
|
16
16
|
* @param params.args.requirementSignature - Optional ERC-2612 vault-share permit for `userAddress`
|
|
17
17
|
* and the registered VaultBundlesV1 spender. Omit when the share allowance is already set.
|
|
18
|
-
* @param params.args.referralFeePct - Optional WAD-scaled fee
|
|
18
|
+
* @param params.args.referralFeePct - Optional WAD-scaled fee from 0% to 10%, inclusive, defaulting to zero.
|
|
19
19
|
* The fee is rounded down and deducted from the gross redeemed assets.
|
|
20
20
|
* @param params.args.referralFeeRecipient - Optional fee recipient; a nonzero address is required
|
|
21
21
|
* when `referralFeePct > 0n`.
|
|
@@ -29,6 +29,7 @@ import { finalizeVaultBundlesV1Transaction, getParsedBundlesSharesPermit, normal
|
|
|
29
29
|
* @throws {InputExceedsMaxError} when `shares` or `deadline` exceeds uint256.
|
|
30
30
|
* @throws {NegativeInputError} when `referralFeePct` is negative.
|
|
31
31
|
* @throws {ReferralFeePctExceededError} when `referralFeePct` is at least WAD.
|
|
32
|
+
* @throws {MidnightReferralFeePctExceededError} when the referral fee is above 10% but below WAD.
|
|
32
33
|
* @throws {ReferralFeeRecipientMissingError} when a positive referral fee has no non-zero recipient.
|
|
33
34
|
* @throws {UnsupportedChainIdError} when the chain is absent from the address registry.
|
|
34
35
|
* @throws {UnknownAddressError} when VaultBundlesV1 is not registered on the target chain.
|