@morpho-org/morpho-sdk 8.3.0 → 9.1.0-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/MIGRATION-v8-to-v9.md +54 -0
- package/README.md +13 -7
- package/lib/cjs/abis.d.ts +1 -1
- package/lib/cjs/abis.js +5 -1
- package/lib/cjs/actions/bundles/common.d.ts +4 -7
- package/lib/cjs/actions/bundles/common.js +8 -14
- package/lib/cjs/actions/bundles/resolveBundlesTokenRequirements.d.ts +1 -5
- package/lib/cjs/actions/bundles/resolveBundlesTokenRequirements.js +1 -8
- package/lib/cjs/actions/midnight/authorization.d.ts +3 -1
- package/lib/cjs/actions/midnight/authorization.js +11 -1
- package/lib/cjs/actions/midnight/cancelAndMake.d.ts +2 -0
- package/lib/cjs/actions/midnight/cancelAndMake.js +10 -2
- package/lib/cjs/actions/midnight/redeem.d.ts +3 -1
- package/lib/cjs/actions/midnight/redeem.js +9 -3
- package/lib/cjs/actions/midnight/repayWithdrawCollateral.d.ts +1 -0
- package/lib/cjs/actions/midnight/repayWithdrawCollateral.js +7 -3
- package/lib/cjs/actions/midnight/supplyCollateral.d.ts +4 -1
- package/lib/cjs/actions/midnight/supplyCollateral.js +10 -3
- package/lib/cjs/actions/midnight/supplyCollateralTakeBorrow.d.ts +3 -1
- package/lib/cjs/actions/midnight/supplyCollateralTakeBorrow.js +9 -3
- package/lib/cjs/actions/midnight/takeBorrow.d.ts +3 -1
- package/lib/cjs/actions/midnight/takeBorrow.js +9 -3
- package/lib/cjs/actions/midnight/takeLend.d.ts +1 -0
- package/lib/cjs/actions/midnight/takeLend.js +7 -2
- package/lib/cjs/actions/midnight/takeRepayWithdrawCollateral.d.ts +1 -0
- package/lib/cjs/actions/midnight/takeRepayWithdrawCollateral.js +8 -2
- package/lib/cjs/actions/midnight/takeWithdraw.d.ts +3 -1
- package/lib/cjs/actions/midnight/takeWithdraw.js +10 -3
- package/lib/cjs/actions/requirements/encode/encodeVaultSharesPermit.d.ts +1 -5
- package/lib/cjs/actions/requirements/encode/encodeVaultSharesPermit.js +5 -7
- package/lib/cjs/actions/requirements/getRequirementsApproval.d.ts +7 -11
- package/lib/cjs/actions/requirements/getRequirementsApproval.js +8 -15
- package/lib/cjs/actions/requirements/midnight/getMidnightApprovalRequirements.d.ts +5 -10
- package/lib/cjs/actions/requirements/midnight/getMidnightApprovalRequirements.js +11 -8
- package/lib/cjs/actions/requirements/midnight/getMidnightAuthorizationRequirement.d.ts +2 -0
- package/lib/cjs/actions/requirements/midnight/getMidnightAuthorizationRequirement.js +5 -0
- package/lib/cjs/actions/vaultV1/inKindRedeem.d.ts +1 -1
- package/lib/cjs/actions/vaultV1/inKindRedeem.js +1 -1
- package/lib/cjs/actions/vaultV1/withdraw.d.ts +4 -4
- package/lib/cjs/actions/vaultV1/withdraw.js +4 -4
- package/lib/cjs/actions/vaultV2/forceWithdraw.d.ts +1 -1
- package/lib/cjs/actions/vaultV2/forceWithdraw.js +1 -1
- package/lib/cjs/actions/vaultV2/inKindRedeem.d.ts +1 -1
- package/lib/cjs/actions/vaultV2/inKindRedeem.js +1 -1
- package/lib/cjs/actions/vaultV2/withdraw.d.ts +4 -4
- package/lib/cjs/actions/vaultV2/withdraw.js +4 -4
- package/lib/cjs/blue/abis.d.ts +1 -1
- package/lib/cjs/blue/abis.js +5 -1
- package/lib/cjs/blue/entities.d.ts +4 -4
- package/lib/cjs/blue/entities.js +3 -1
- package/lib/cjs/blue/errors.d.ts +2 -2
- package/lib/cjs/blue/errors.js +5 -1
- package/lib/cjs/blue/fetch.d.ts +2 -2
- package/lib/cjs/blue/fetch.js +3 -1
- package/lib/cjs/blue/utils.d.ts +1 -1
- package/lib/cjs/blue/utils.js +2 -1
- package/lib/cjs/entities/blue/blue.d.ts +2 -12
- package/lib/cjs/entities/blue/blue.js +0 -4
- package/lib/cjs/entities/index.d.ts +4 -4
- package/lib/cjs/entities/index.js +3 -1
- package/lib/cjs/entities/midnight/midnight.d.ts +63 -18
- package/lib/cjs/entities/midnight/midnight.js +138 -53
- package/lib/cjs/entities/midnight/types.d.ts +3 -10
- package/lib/cjs/entities/requirements/getBundlesTokenRequirements.d.ts +0 -4
- package/lib/cjs/entities/requirements/getBundlesTokenRequirements.js +0 -7
- package/lib/cjs/entities/requirements/getVaultBundlesSharesRequirements.d.ts +5 -14
- package/lib/cjs/entities/requirements/getVaultBundlesSharesRequirements.js +8 -20
- package/lib/cjs/entities/vaultV1/vaultV1.d.ts +40 -37
- package/lib/cjs/entities/vaultV1/vaultV1.js +5 -34
- package/lib/cjs/entities/vaultV2/vaultV2.d.ts +69 -43
- package/lib/cjs/entities/vaultV2/vaultV2.js +41 -35
- package/lib/cjs/entities/vaultV2BlueReallocationData.d.ts +5 -3
- package/lib/cjs/entities/vaultV2BlueReallocationData.js +9 -3
- package/lib/cjs/errors.d.ts +4 -4
- package/lib/cjs/errors.js +10 -5
- package/lib/cjs/fetch.d.ts +2 -2
- package/lib/cjs/fetch.js +3 -1
- package/lib/cjs/helpers/encodeMidnightCalldata.d.ts +48 -0
- package/lib/cjs/helpers/encodeMidnightCalldata.js +74 -0
- package/lib/cjs/helpers/slippage.d.ts +9 -25
- package/lib/cjs/helpers/slippage.js +10 -27
- package/lib/cjs/helpers/validate.d.ts +1 -0
- package/lib/cjs/helpers/validate.js +5 -0
- package/lib/cjs/helpers/validateMidnightAccount.d.ts +34 -0
- package/lib/cjs/helpers/validateMidnightAccount.js +47 -0
- package/lib/cjs/helpers/validateMidnightAuthorizationTarget.d.ts +1 -0
- package/lib/cjs/helpers/validateMidnightAuthorizationTarget.js +4 -0
- package/lib/cjs/helpers/validateMidnightMarket.d.ts +2 -0
- package/lib/cjs/helpers/validateMidnightMarket.js +5 -0
- package/lib/cjs/helpers/validateMidnightPublication.d.ts +11 -0
- package/lib/cjs/helpers/validateMidnightPublication.js +12 -1
- package/lib/cjs/helpers/validateMidnightReceiver.d.ts +1 -0
- package/lib/cjs/helpers/validateMidnightReceiver.js +8 -0
- package/lib/cjs/helpers/validateTakeableOffers.d.ts +2 -1
- package/lib/cjs/helpers/validateTakeableOffers.js +4 -3
- package/lib/cjs/midnight/errors.d.ts +2 -1
- package/lib/cjs/midnight/errors.js +5 -4
- package/lib/cjs/types/action.d.ts +3 -1
- package/lib/cjs/types/error.d.ts +60 -6
- package/lib/cjs/types/error.js +143 -11
- package/lib/cjs/utils.d.ts +2 -2
- package/lib/cjs/utils.js +4 -2
- package/lib/esm/abis.d.ts +1 -1
- package/lib/esm/abis.js +1 -1
- package/lib/esm/actions/bundles/common.d.ts +4 -7
- package/lib/esm/actions/bundles/common.js +8 -14
- package/lib/esm/actions/bundles/resolveBundlesTokenRequirements.d.ts +1 -5
- package/lib/esm/actions/bundles/resolveBundlesTokenRequirements.js +2 -9
- package/lib/esm/actions/midnight/authorization.d.ts +3 -1
- package/lib/esm/actions/midnight/authorization.js +12 -2
- package/lib/esm/actions/midnight/cancelAndMake.d.ts +2 -0
- package/lib/esm/actions/midnight/cancelAndMake.js +11 -3
- package/lib/esm/actions/midnight/redeem.d.ts +3 -1
- package/lib/esm/actions/midnight/redeem.js +10 -4
- package/lib/esm/actions/midnight/repayWithdrawCollateral.d.ts +1 -0
- package/lib/esm/actions/midnight/repayWithdrawCollateral.js +8 -4
- package/lib/esm/actions/midnight/supplyCollateral.d.ts +4 -1
- package/lib/esm/actions/midnight/supplyCollateral.js +11 -4
- package/lib/esm/actions/midnight/supplyCollateralTakeBorrow.d.ts +3 -1
- package/lib/esm/actions/midnight/supplyCollateralTakeBorrow.js +10 -4
- package/lib/esm/actions/midnight/takeBorrow.d.ts +3 -1
- package/lib/esm/actions/midnight/takeBorrow.js +10 -4
- package/lib/esm/actions/midnight/takeLend.d.ts +1 -0
- package/lib/esm/actions/midnight/takeLend.js +8 -3
- package/lib/esm/actions/midnight/takeRepayWithdrawCollateral.d.ts +1 -0
- package/lib/esm/actions/midnight/takeRepayWithdrawCollateral.js +9 -3
- package/lib/esm/actions/midnight/takeWithdraw.d.ts +3 -1
- package/lib/esm/actions/midnight/takeWithdraw.js +11 -4
- package/lib/esm/actions/requirements/encode/encodeVaultSharesPermit.d.ts +1 -5
- package/lib/esm/actions/requirements/encode/encodeVaultSharesPermit.js +6 -8
- package/lib/esm/actions/requirements/getRequirementsApproval.d.ts +7 -11
- package/lib/esm/actions/requirements/getRequirementsApproval.js +9 -16
- package/lib/esm/actions/requirements/midnight/getMidnightApprovalRequirements.d.ts +5 -10
- package/lib/esm/actions/requirements/midnight/getMidnightApprovalRequirements.js +12 -9
- package/lib/esm/actions/requirements/midnight/getMidnightAuthorizationRequirement.d.ts +2 -0
- package/lib/esm/actions/requirements/midnight/getMidnightAuthorizationRequirement.js +5 -0
- package/lib/esm/actions/vaultV1/inKindRedeem.d.ts +1 -1
- package/lib/esm/actions/vaultV1/inKindRedeem.js +1 -1
- package/lib/esm/actions/vaultV1/withdraw.d.ts +4 -4
- package/lib/esm/actions/vaultV1/withdraw.js +4 -4
- package/lib/esm/actions/vaultV2/forceWithdraw.d.ts +1 -1
- package/lib/esm/actions/vaultV2/forceWithdraw.js +1 -1
- package/lib/esm/actions/vaultV2/inKindRedeem.d.ts +1 -1
- package/lib/esm/actions/vaultV2/inKindRedeem.js +1 -1
- package/lib/esm/actions/vaultV2/withdraw.d.ts +4 -4
- package/lib/esm/actions/vaultV2/withdraw.js +4 -4
- package/lib/esm/blue/abis.d.ts +1 -1
- package/lib/esm/blue/abis.js +1 -1
- package/lib/esm/blue/entities.d.ts +4 -4
- package/lib/esm/blue/entities.js +2 -2
- package/lib/esm/blue/errors.d.ts +2 -2
- package/lib/esm/blue/errors.js +2 -2
- package/lib/esm/blue/fetch.d.ts +2 -2
- package/lib/esm/blue/fetch.js +2 -2
- package/lib/esm/blue/utils.d.ts +1 -1
- package/lib/esm/blue/utils.js +1 -1
- package/lib/esm/entities/blue/blue.d.ts +2 -12
- package/lib/esm/entities/blue/blue.js +0 -4
- package/lib/esm/entities/index.d.ts +4 -4
- package/lib/esm/entities/index.js +2 -2
- package/lib/esm/entities/midnight/midnight.d.ts +63 -18
- package/lib/esm/entities/midnight/midnight.js +139 -54
- package/lib/esm/entities/midnight/types.d.ts +3 -10
- package/lib/esm/entities/requirements/getBundlesTokenRequirements.d.ts +0 -4
- package/lib/esm/entities/requirements/getBundlesTokenRequirements.js +1 -8
- package/lib/esm/entities/requirements/getVaultBundlesSharesRequirements.d.ts +5 -14
- package/lib/esm/entities/requirements/getVaultBundlesSharesRequirements.js +9 -21
- package/lib/esm/entities/vaultV1/vaultV1.d.ts +40 -37
- package/lib/esm/entities/vaultV1/vaultV1.js +6 -35
- package/lib/esm/entities/vaultV2/vaultV2.d.ts +69 -43
- package/lib/esm/entities/vaultV2/vaultV2.js +41 -35
- package/lib/esm/entities/vaultV2BlueReallocationData.d.ts +5 -3
- package/lib/esm/entities/vaultV2BlueReallocationData.js +9 -3
- package/lib/esm/errors.d.ts +4 -4
- package/lib/esm/errors.js +4 -4
- package/lib/esm/fetch.d.ts +2 -2
- package/lib/esm/fetch.js +2 -2
- package/lib/esm/helpers/encodeMidnightCalldata.d.ts +48 -0
- package/lib/esm/helpers/encodeMidnightCalldata.js +69 -0
- package/lib/esm/helpers/slippage.d.ts +9 -25
- package/lib/esm/helpers/slippage.js +9 -25
- package/lib/esm/helpers/validate.d.ts +1 -0
- package/lib/esm/helpers/validate.js +5 -0
- package/lib/esm/helpers/validateMidnightAccount.d.ts +34 -0
- package/lib/esm/helpers/validateMidnightAccount.js +43 -0
- package/lib/esm/helpers/validateMidnightAuthorizationTarget.d.ts +1 -0
- package/lib/esm/helpers/validateMidnightAuthorizationTarget.js +4 -0
- package/lib/esm/helpers/validateMidnightMarket.d.ts +2 -0
- package/lib/esm/helpers/validateMidnightMarket.js +5 -0
- package/lib/esm/helpers/validateMidnightPublication.d.ts +11 -0
- package/lib/esm/helpers/validateMidnightPublication.js +10 -0
- package/lib/esm/helpers/validateMidnightReceiver.d.ts +1 -0
- package/lib/esm/helpers/validateMidnightReceiver.js +8 -0
- package/lib/esm/helpers/validateTakeableOffers.d.ts +2 -1
- package/lib/esm/helpers/validateTakeableOffers.js +4 -3
- package/lib/esm/midnight/errors.d.ts +2 -1
- package/lib/esm/midnight/errors.js +2 -1
- package/lib/esm/types/action.d.ts +3 -1
- package/lib/esm/types/error.d.ts +60 -6
- package/lib/esm/types/error.js +138 -7
- package/lib/esm/utils.d.ts +2 -2
- package/lib/esm/utils.js +2 -2
- package/package.json +8 -7
|
@@ -69,8 +69,9 @@ export interface VaultV2Actions {
|
|
|
69
69
|
* owner is consumed and none was passed explicitly.
|
|
70
70
|
* @throws {Permit2SignatureTransferNonceAlreadyUsedError} from `getRequirements()` when the
|
|
71
71
|
* explicit Permit2 nonce is consumed.
|
|
72
|
-
* @throws {InputExceedsMaxError} when funding or the deadline exceeds uint256,
|
|
73
|
-
*
|
|
72
|
+
* @throws {InputExceedsMaxError} when funding or the deadline exceeds uint256, when the vault's
|
|
73
|
+
* liquidity adapter is a Midnight adapter (it cannot receive vault allocations, so no deposit
|
|
74
|
+
* fits and `max` is `0n`), or from `getRequirements()` when the Permit2 nonce exceeds uint256.
|
|
74
75
|
* @throws {AmbiguousRequirementSignaturesError} from `buildTx()` when multiple token signatures are supplied.
|
|
75
76
|
* @throws {UnexpectedRequirementSignatureError} from `buildTx()` when an unsupported signature is supplied.
|
|
76
77
|
* @throws {BundlesPermitMismatchError} from `buildTx()` when the signature's spender, amount or
|
|
@@ -122,16 +123,16 @@ export interface VaultV2Actions {
|
|
|
122
123
|
/**
|
|
123
124
|
* Prepares an exact-assets Vault V2 withdrawal through VaultBundlesV1.
|
|
124
125
|
*
|
|
125
|
-
* Derives the share
|
|
126
|
-
* reads the live vault-share allowance and, when a signature is needed, the permit
|
|
127
|
-
* each `getRequirements()` call. Captures the requested amount and owner at creation, so
|
|
128
|
-
* changes to `params` do not change this handle's requirements or transaction.
|
|
126
|
+
* Derives the minimum required share allowance from the supplied `vaultData` snapshot at handle
|
|
127
|
+
* creation, then reads the live vault-share allowance and, when a signature is needed, the permit
|
|
128
|
+
* nonce on each `getRequirements()` call. Captures the requested amount and owner at creation, so
|
|
129
|
+
* later changes to `params` do not change this handle's requirements or transaction.
|
|
129
130
|
*
|
|
130
131
|
* @param params.amount - Positive gross withdrawal in underlying asset base units, before fees.
|
|
131
132
|
* @param params.userAddress - Share owner that must sign and submit; receives the net assets.
|
|
132
|
-
* @param params.vaultData - Pre-fetched Vault V2 snapshot used to derive the share
|
|
133
|
-
* @param params.slippageTolerance - Optional WAD-scaled
|
|
134
|
-
*
|
|
133
|
+
* @param params.vaultData - Pre-fetched Vault V2 snapshot used to derive the minimum share allowance.
|
|
134
|
+
* @param params.slippageTolerance - Optional WAD-scaled tolerance used only to size the minimum
|
|
135
|
+
* share allowance. It does not impose an on-chain share-burn bound.
|
|
135
136
|
* Defaults to 0.03% and cannot exceed 10%.
|
|
136
137
|
* @param params.referralFeePct - Optional WAD-scaled fee in [0, 1e18), defaulting to zero;
|
|
137
138
|
* rounded down and deducted from the gross withdrawn assets.
|
|
@@ -140,20 +141,21 @@ export interface VaultV2Actions {
|
|
|
140
141
|
* defaults to two hours from handle creation.
|
|
141
142
|
* @returns A frozen handle with lazy `getRequirements()` and synchronous `buildTx(signatures?)`,
|
|
142
143
|
* which returns a deep-frozen `Transaction<VaultV2WithdrawAction>`. Requirements are empty
|
|
143
|
-
* when the allowance
|
|
144
|
-
*
|
|
145
|
-
*
|
|
146
|
-
*
|
|
147
|
-
* the allowance. Confirm the approval or pass its signed permit to `buildTx`.
|
|
144
|
+
* when the allowance meets or exceeds the required share amount. An insufficient allowance is
|
|
145
|
+
* raised by an unlimited approval or, with signature support, an ERC-2612 request. The minimum
|
|
146
|
+
* is fixed at handle creation while each call re-reads the allowance. Confirm the approval or
|
|
147
|
+
* pass its signed permit to `buildTx`.
|
|
148
148
|
* @remarks VaultBundlesV1 skips a share permit whose nonce was already consumed and proceeds
|
|
149
149
|
* under the live allowance, so execute every requirement returned by the latest
|
|
150
|
-
* `getRequirements()`
|
|
150
|
+
* `getRequirements()` before submitting.
|
|
151
151
|
* @throws {ChainIdMismatchError} when the connected client targets another chain, or from
|
|
152
152
|
* `getRequirements()` when the RPC reports another chain via `eth_chainId`.
|
|
153
|
-
* @throws {NonPositiveInputError} when `amount` or the computed share
|
|
153
|
+
* @throws {NonPositiveInputError} when `amount` or the computed required share amount is not positive.
|
|
154
154
|
* @throws {ExpiredDeadlineError} when `deadline` is not in the future at handle creation or
|
|
155
155
|
* at any `getRequirements()` call.
|
|
156
|
-
* @throws {InputExceedsMaxError} when `amount` or `deadline` exceeds uint256 at handle creation
|
|
156
|
+
* @throws {InputExceedsMaxError} when `amount` or `deadline` exceeds uint256 at handle creation,
|
|
157
|
+
* or when the vault's liquidity adapter is a Midnight adapter and `amount` exceeds the vault's
|
|
158
|
+
* idle assets.
|
|
157
159
|
* @throws {NegativeInputError} when `referralFeePct` or `slippageTolerance` is negative.
|
|
158
160
|
* @throws {ReferralFeePctExceededError} when `referralFeePct` is at least WAD.
|
|
159
161
|
* @throws {ReferralFeeRecipientMissingError} when a positive referral fee has no nonzero recipient.
|
|
@@ -164,8 +166,8 @@ export interface VaultV2Actions {
|
|
|
164
166
|
* @throws {UnexpectedRequirementSignatureError} from `buildTx()` when an unsupported signature is supplied.
|
|
165
167
|
* @throws {AmbiguousRequirementSignaturesError} from `buildTx()` when multiple permits are supplied.
|
|
166
168
|
* @throws {BundlesPermitMismatchError} from `buildTx()` when the share permit is malformed or
|
|
167
|
-
* its spender or deadline differ from this operation's, or its amount is
|
|
168
|
-
*
|
|
169
|
+
* its spender or deadline differ from this operation's, or its amount is below the required
|
|
170
|
+
* share allowance.
|
|
169
171
|
* @throws {MissingContractCodeError} from `getRequirements()` when a fixed bundles or protocol
|
|
170
172
|
* contract has no code at its registered address.
|
|
171
173
|
* @throws {viem.BaseError} from `getRequirements()` when an allowance, nonce, or `eth_chainId`
|
|
@@ -203,8 +205,9 @@ export interface VaultV2Actions {
|
|
|
203
205
|
* Prepares an exact-shares Vault V2 redemption through VaultBundlesV1.
|
|
204
206
|
*
|
|
205
207
|
* Captures `shares` and `userAddress` at handle creation for both requirements and `buildTx()`.
|
|
206
|
-
* The caller must satisfy the
|
|
207
|
-
* `buildTx()`;
|
|
208
|
+
* The caller must satisfy the minimum share allowance returned by `getRequirements()` before
|
|
209
|
+
* `buildTx()`; larger allowances also suffice, and each requirement resolution re-reads the live
|
|
210
|
+
* allowance and checks the deadline.
|
|
208
211
|
*
|
|
209
212
|
* @param params - The redeem parameters.
|
|
210
213
|
* @param params.shares - Exact vault shares to burn.
|
|
@@ -212,13 +215,30 @@ export interface VaultV2Actions {
|
|
|
212
215
|
* @param [params.referralFeePct=0n] - WAD-scaled referral fee deducted from the redeemed assets; must be below WAD.
|
|
213
216
|
* @param [params.referralFeeRecipient] - Non-zero recipient required when `referralFeePct` is positive.
|
|
214
217
|
* @param [params.deadline] - VaultBundlesV1 execution deadline; defaults to two hours from now.
|
|
215
|
-
* @returns Lazy
|
|
218
|
+
* @returns Lazy share-allowance requirements and a synchronous transaction builder.
|
|
216
219
|
* @throws {ChainIdMismatchError} when the client and entity target different chains, or from
|
|
217
220
|
* `getRequirements()` when the RPC reports another chain via `eth_chainId`.
|
|
218
221
|
* @throws {NonPositiveInputError} when `shares` is not positive.
|
|
219
222
|
* @throws {ExpiredDeadlineError} when `deadline` is not in the future at handle creation or
|
|
220
223
|
* requirement resolution.
|
|
221
|
-
* @throws {InputExceedsMaxError} when `shares` or `deadline` exceeds uint256
|
|
224
|
+
* @throws {InputExceedsMaxError} when `shares` or `deadline` exceeds uint256, or from
|
|
225
|
+
* `getRequirements()` when the vault's liquidity adapter is a Midnight adapter and `shares`
|
|
226
|
+
* are worth more than the vault's idle assets.
|
|
227
|
+
* @throws {UnknownBlueFactory} from `getRequirements()` when the configured chain has no VaultV2 factory.
|
|
228
|
+
* @throws {UnknownBlueOfFactory} from `getRequirements()` when the vault is not a VaultV2 from the
|
|
229
|
+
* configured factory.
|
|
230
|
+
* @throws {UnsupportedBlueVaultV2AdapterError} from `getRequirements()` when the vault or one of its
|
|
231
|
+
* adapters uses an unsupported adapter class.
|
|
232
|
+
* @throws {UnsupportedBlueMarketIrmError} from `getRequirements()` when the vault's liquidity adapter
|
|
233
|
+
* is a Midnight adapter and accrual projects an underlying market with positive debt that uses an
|
|
234
|
+
* unsupported IRM.
|
|
235
|
+
* @throws {UnknownBlueMarketAllocationError} from `getRequirements()` when the vault's liquidity
|
|
236
|
+
* adapter is a Midnight adapter and accrual meets a nested Vault V1 withdraw queue market without
|
|
237
|
+
* allocation data.
|
|
238
|
+
* @throws {InvalidMidnightPositionLossFactorError} from `getRequirements()` when the vault's liquidity
|
|
239
|
+
* adapter is a Midnight adapter and accrual meets a market loss factor below a position's.
|
|
240
|
+
* @throws {InvalidMidnightPositionAccrualStateError} from `getRequirements()` when the vault's
|
|
241
|
+
* liquidity adapter is a Midnight adapter and accrual meets invalid Midnight position inputs.
|
|
222
242
|
* @throws {NegativeInputError} when `referralFeePct` is negative.
|
|
223
243
|
* @throws {ReferralFeePctExceededError} when `referralFeePct` is not below WAD.
|
|
224
244
|
* @throws {ReferralFeeRecipientMissingError} when a positive fee has no non-zero recipient.
|
|
@@ -226,7 +246,7 @@ export interface VaultV2Actions {
|
|
|
226
246
|
* @throws {UnknownAddressError} when VaultBundlesV1 is not registered on the target chain.
|
|
227
247
|
* @throws {MissingContractCodeError} from `getRequirements()` when a fixed bundles or protocol
|
|
228
248
|
* contract has no code at its registered address.
|
|
229
|
-
* @throws {viem.BaseError} from `getRequirements()` when
|
|
249
|
+
* @throws {viem.BaseError} from `getRequirements()` when a vault-state, allowance, nonce, `eth_chainId`, or
|
|
230
250
|
* `eth_getCode` read fails.
|
|
231
251
|
* @throws {UnknownTokenError} from `getRequirements()` when the share token fetched by
|
|
232
252
|
* `getData()` has unusable decimals.
|
|
@@ -235,8 +255,8 @@ export interface VaultV2Actions {
|
|
|
235
255
|
* deployless query reports malformed `name()`/`symbol()`/`eip712Domain()` returndata (no fallback).
|
|
236
256
|
* @throws {AmbiguousRequirementSignaturesError} from `buildTx()` when more than one permit signature is supplied.
|
|
237
257
|
* @throws {UnexpectedRequirementSignatureError} from `buildTx()` when a non-permit signature is supplied.
|
|
238
|
-
* @throws {BundlesPermitMismatchError} from `buildTx()` when the signature's spender
|
|
239
|
-
* deadline
|
|
258
|
+
* @throws {BundlesPermitMismatchError} from `buildTx()` when the signature's spender or
|
|
259
|
+
* deadline differs from this operation's, or its amount is below the required share allowance.
|
|
240
260
|
* @example
|
|
241
261
|
* ```ts
|
|
242
262
|
* import { isRequirementSignature } from "@morpho-org/morpho-sdk";
|
|
@@ -279,9 +299,10 @@ export interface VaultV2Actions {
|
|
|
279
299
|
* Idle balance, penalty, and adapter positions can drift after the snapshot, so an on-chain
|
|
280
300
|
* under-coverage panic remains possible if vault state changes between preparation and inclusion.
|
|
281
301
|
*
|
|
282
|
-
* In-kind exits
|
|
283
|
-
*
|
|
284
|
-
*
|
|
302
|
+
* In-kind exits have no on-chain share-price or max-shares bound. A share-price drop before
|
|
303
|
+
* inclusion can burn more shares than quoted when the allowance is unlimited. The SDK requires
|
|
304
|
+
* the computed minimum allowance, and an insufficient allowance is raised by an unlimited
|
|
305
|
+
* approval or ERC-2612 permit.
|
|
285
306
|
*
|
|
286
307
|
* @param params - In-kind redemption parameters.
|
|
287
308
|
* @param params.amount - Penalty-inclusive, asset-denominated amount to exit.
|
|
@@ -303,9 +324,11 @@ export interface VaultV2Actions {
|
|
|
303
324
|
* @throws {InputExceedsMaxError} when `deadline` exceeds `uint256`.
|
|
304
325
|
* @throws {ExpiredDeadlineError} when `deadline` is not in the future at handle creation or
|
|
305
326
|
* requirement resolution.
|
|
306
|
-
* @throws {VaultV2SingleAdapterRequiredError} when the vault does not have one adapter
|
|
327
|
+
* @throws {VaultV2SingleAdapterRequiredError} when the vault does not have one adapter, including
|
|
328
|
+
* a vault that mixes Blue and Midnight adapters.
|
|
307
329
|
* @throws {AdapterNotPartOfVaultError} when `adapter` is not the vault's adapter.
|
|
308
|
-
* @throws {VaultV2UnsupportedExitAdapterError} when the adapter is not a MorphoMarketV1AdapterV2
|
|
330
|
+
* @throws {VaultV2UnsupportedExitAdapterError} when the adapter is not a MorphoMarketV1AdapterV2,
|
|
331
|
+
* including a Midnight adapter.
|
|
309
332
|
* @throws {InKindRedeemCoverageError} when the deduplicated list cannot cover the exit.
|
|
310
333
|
* @throws {UnsupportedChainIdError} when no address registry exists for the target chain.
|
|
311
334
|
* @throws {UnknownAddressError} when VaultExitBundlesV1 is not registered on the target chain.
|
|
@@ -316,8 +339,8 @@ export interface VaultV2Actions {
|
|
|
316
339
|
* @throws {AmbiguousRequirementSignaturesError} from `buildTx()` when more than one permit signature is supplied.
|
|
317
340
|
* @throws {UnexpectedRequirementSignatureError} from `buildTx()` when a non-permit signature is supplied.
|
|
318
341
|
* @throws {BundlesPermitMismatchError} from `buildTx()` when the supplied permit is not ERC-2612, has
|
|
319
|
-
* the wrong asset, owner, or signature encoding,
|
|
320
|
-
*
|
|
342
|
+
* the wrong asset, owner, or signature encoding, names another spender or deadline, or
|
|
343
|
+
* signs an amount below the required share allowance.
|
|
321
344
|
* @example
|
|
322
345
|
* ```ts
|
|
323
346
|
* import { isRequirementSignature } from "@morpho-org/morpho-sdk";
|
|
@@ -384,12 +407,13 @@ export interface VaultV2Actions {
|
|
|
384
407
|
* validate the user's share balance. Per-market penalties and each vault withdrawal round the
|
|
385
408
|
* share burn up independently, so the exit can burn marginally more shares than `exitAssets` alone
|
|
386
409
|
* implies; size `exitAssets` a small buffer below `vault.previewRedeem(sharesHeld)` so a
|
|
387
|
-
* full-balance exit does not revert for insufficient shares.
|
|
388
|
-
*
|
|
389
|
-
*
|
|
390
|
-
*
|
|
391
|
-
*
|
|
392
|
-
* ERC-20 allowance underflow
|
|
410
|
+
* full-balance exit does not revert for insufficient shares. Any approval or permit this handle
|
|
411
|
+
* returns is unlimited. The computed share amount is only the smallest existing allowance the
|
|
412
|
+
* SDK accepts without a new requirement: it covers a burn at least one `slippageTolerance` step
|
|
413
|
+
* below the price floor whenever the floor exceeds one RAY unit and, in any case, at least one
|
|
414
|
+
* share above the burn at the floor. A reused allowance just above that minimum can still
|
|
415
|
+
* surface a deeper price drop as an ERC-20 allowance underflow rather than the contract's
|
|
416
|
+
* `minSharePriceE27` check.
|
|
393
417
|
*
|
|
394
418
|
* Idle balance, penalty, adapter positions, and market liquidity can drift after the snapshot, so
|
|
395
419
|
* an on-chain revert remains possible if vault state changes between preparation and inclusion.
|
|
@@ -429,9 +453,11 @@ export interface VaultV2Actions {
|
|
|
429
453
|
* @throws {ExpiredDeadlineError} when `deadline` is not in the future at handle creation or
|
|
430
454
|
* requirement resolution.
|
|
431
455
|
* @throws {ExcessiveSlippageToleranceError} when `slippageTolerance` exceeds the SDK maximum.
|
|
432
|
-
* @throws {VaultV2SingleAdapterRequiredError} when the vault does not have exactly one adapter
|
|
456
|
+
* @throws {VaultV2SingleAdapterRequiredError} when the vault does not have exactly one adapter,
|
|
457
|
+
* including a vault that mixes Blue and Midnight adapters.
|
|
433
458
|
* @throws {AdapterNotPartOfVaultError} when `adapter` is not the vault's adapter.
|
|
434
|
-
* @throws {VaultV2UnsupportedExitAdapterError} when the adapter is not a MorphoMarketV1AdapterV2
|
|
459
|
+
* @throws {VaultV2UnsupportedExitAdapterError} when the adapter is not a MorphoMarketV1AdapterV2,
|
|
460
|
+
* including a Midnight adapter.
|
|
435
461
|
* @throws {VaultV2UnsupportedLiquidityAdapterError} when the vault routes liquidity through
|
|
436
462
|
* another adapter.
|
|
437
463
|
* @throws {VaultV2UndecodableLiquidityDataError} when the vault's `liquidityData` does not decode
|
|
@@ -453,8 +479,8 @@ export interface VaultV2Actions {
|
|
|
453
479
|
* @throws {MissingContractCodeError} from `getRequirements()` when a fixed bundles or protocol contract has no code at its registered address.
|
|
454
480
|
* @throws {AmbiguousRequirementSignaturesError} from `buildTx()` when more than one permit signature is supplied.
|
|
455
481
|
* @throws {UnexpectedRequirementSignatureError} from `buildTx()` when a non-permit signature is supplied.
|
|
456
|
-
* @throws {BundlesPermitMismatchError} from `buildTx()` when the permit's spender
|
|
457
|
-
*
|
|
482
|
+
* @throws {BundlesPermitMismatchError} from `buildTx()` when the permit's spender or deadline
|
|
483
|
+
* differs from this operation, or its amount is below the required share allowance. Any handle built from the same inputs accepts the
|
|
458
484
|
* permit; a permit whose nonce was consumed is skipped onchain and the live allowance applies.
|
|
459
485
|
* @throws {BundlesPermitMismatchError} from `buildTx()` when the requirement has the wrong permit kind, asset, or signature encoding.
|
|
460
486
|
* @example
|
|
@@ -10,7 +10,6 @@ const common_js_1 = require("../../actions/bundles/common.js");
|
|
|
10
10
|
const index_js_1 = require("../../actions/index.js");
|
|
11
11
|
const validateClientChainId_js_1 = require("../../actions/requirements/validateClientChainId.js");
|
|
12
12
|
const index_js_2 = require("../../helpers/index.js");
|
|
13
|
-
const slippage_js_1 = require("../../helpers/slippage.js");
|
|
14
13
|
const validate_js_1 = require("../../helpers/validate.js");
|
|
15
14
|
const index_js_3 = require("../../types/index.js");
|
|
16
15
|
const assertContractCode_js_1 = require("../requirements/assertContractCode.js");
|
|
@@ -19,6 +18,11 @@ const index_js_4 = require("../requirements/index.js");
|
|
|
19
18
|
// Maximum accepted deadline horizon; the on-chain management fee is capped at 5%/yr so the
|
|
20
19
|
// accrual model stays well-defined inside it.
|
|
21
20
|
const VAULT_V2_FEE_PROJECTION_HORIZON = morpho_ts_1.Time.s.from.y(1n);
|
|
21
|
+
/**
|
|
22
|
+
* Midnight adapters revert vault-initiated `allocate` and `deallocate` (`SelfAllocationOnly`), so a
|
|
23
|
+
* vault routing liquidity through one accepts no deposit and serves exits from idle assets only.
|
|
24
|
+
*/
|
|
25
|
+
const isMidnightLiquidityAdapter = (vaultData) => vaultData.accrualLiquidityAdapter?.type === "VaultV2MidnightAdapter";
|
|
22
26
|
/** Binds a viem client to a Vault V2 vault's action builders. */
|
|
23
27
|
class MorphoVaultV2 {
|
|
24
28
|
client;
|
|
@@ -82,6 +86,13 @@ class MorphoVaultV2 {
|
|
|
82
86
|
// The native path must target the chain's registered wrapped-native asset.
|
|
83
87
|
(0, validate_js_1.validateNativeVaultAsset)(this.chainId, vaultAsset);
|
|
84
88
|
}
|
|
89
|
+
if (isMidnightLiquidityAdapter(vaultData)) {
|
|
90
|
+
throw new index_js_3.InputExceedsMaxError({
|
|
91
|
+
field: funding.value > 0n ? "nativeAmount" : "amount",
|
|
92
|
+
value: funding.assets,
|
|
93
|
+
max: 0n,
|
|
94
|
+
});
|
|
95
|
+
}
|
|
85
96
|
const referralFeeAssets = (0, common_js_1.getBundlesReferralFeeAssets)(funding.assets, common.referralFeePct);
|
|
86
97
|
const maxSharePrice = (0, index_js_2.computeVaultMaxSharePrice)({
|
|
87
98
|
vaultData,
|
|
@@ -165,6 +176,14 @@ class MorphoVaultV2 {
|
|
|
165
176
|
throw new index_js_3.NonPositiveInputError("amount", amount);
|
|
166
177
|
// Reject values outside the ABI range before resolving any requirements.
|
|
167
178
|
(0, validate_js_1.validateUint256Field)("amount", amount);
|
|
179
|
+
if (isMidnightLiquidityAdapter(vaultData) &&
|
|
180
|
+
amount > vaultData.assetBalance) {
|
|
181
|
+
throw new index_js_3.InputExceedsMaxError({
|
|
182
|
+
field: "amount",
|
|
183
|
+
value: amount,
|
|
184
|
+
max: vaultData.assetBalance,
|
|
185
|
+
});
|
|
186
|
+
}
|
|
168
187
|
const createdAt = morpho_ts_1.Time.timestamp();
|
|
169
188
|
const deadline = params.deadline ?? createdAt + morpho_ts_1.Time.s.from.h(2n);
|
|
170
189
|
if (deadline <= createdAt)
|
|
@@ -184,28 +203,19 @@ class MorphoVaultV2 {
|
|
|
184
203
|
assets: amount,
|
|
185
204
|
slippageTolerance,
|
|
186
205
|
});
|
|
187
|
-
const maxShareAllowance = (0, slippage_js_1.computeVaultShareAllowanceCeiling)({
|
|
188
|
-
requiredShareAllowance,
|
|
189
|
-
slippageTolerance,
|
|
190
|
-
});
|
|
191
206
|
return Object.freeze({
|
|
192
207
|
getRequirements: async () => {
|
|
193
208
|
const now = morpho_ts_1.Time.timestamp();
|
|
194
209
|
if (deadline <= now)
|
|
195
210
|
throw new index_js_3.ExpiredDeadlineError(deadline, now);
|
|
196
211
|
await this.assertWriteTargets(["bundles.vaultBundlesV1"]);
|
|
197
|
-
// Re-read the live share allowance on every call instead of caching the resolved
|
|
198
|
-
// requirements: the allowance is the sole cap on the burn, so a caller that executed the
|
|
199
|
-
// returned approval must see it satisfied on the next call, and an allowance revoked or
|
|
200
|
-
// raised afterwards must resurface as an outstanding requirement. The cap derived from
|
|
201
|
-
// `vaultData` is pinned at handle creation, so re-reading cannot move it.
|
|
212
|
+
// Re-read the live share allowance on every call instead of caching the resolved requirements.
|
|
202
213
|
return (0, getVaultBundlesSharesRequirements_js_1.getVaultBundlesSharesRequirements)(this.client.viemClient, {
|
|
203
214
|
vaultData,
|
|
204
215
|
version: "vaultV2",
|
|
205
216
|
owner: userAddress,
|
|
206
217
|
chainId: this.chainId,
|
|
207
218
|
requiredShareAllowance,
|
|
208
|
-
maxShareAllowance,
|
|
209
219
|
deadline,
|
|
210
220
|
supportSignature: this.client.options.supportSignature,
|
|
211
221
|
now,
|
|
@@ -215,7 +225,6 @@ class MorphoVaultV2 {
|
|
|
215
225
|
const permit = (0, common_js_1.selectBundlesSharesPermitSignature)(signatures, {
|
|
216
226
|
spender,
|
|
217
227
|
amount: requiredShareAllowance,
|
|
218
|
-
maxAmount: maxShareAllowance,
|
|
219
228
|
deadline,
|
|
220
229
|
});
|
|
221
230
|
return (0, index_js_1.vaultV2Withdraw)({
|
|
@@ -255,8 +264,20 @@ class MorphoVaultV2 {
|
|
|
255
264
|
if (deadline <= now)
|
|
256
265
|
throw new index_js_3.ExpiredDeadlineError(deadline, now);
|
|
257
266
|
await this.assertWriteTargets(["bundles.vaultBundlesV1"]);
|
|
267
|
+
const vaultData = await this.getData();
|
|
268
|
+
if (isMidnightLiquidityAdapter(vaultData)) {
|
|
269
|
+
// Onchain redeem accrues interest before converting shares to assets.
|
|
270
|
+
const { vault: accrued } = vaultData.accrueInterest(now);
|
|
271
|
+
if (accrued.toAssets(shares) > accrued.assetBalance) {
|
|
272
|
+
throw new index_js_3.InputExceedsMaxError({
|
|
273
|
+
field: "shares",
|
|
274
|
+
value: shares,
|
|
275
|
+
max: accrued.toShares(accrued.assetBalance),
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
}
|
|
258
279
|
return (0, getVaultBundlesSharesRequirements_js_1.getVaultBundlesSharesRequirements)(this.client.viemClient, {
|
|
259
|
-
vaultData
|
|
280
|
+
vaultData,
|
|
260
281
|
version: "vaultV2",
|
|
261
282
|
owner: userAddress,
|
|
262
283
|
chainId: this.chainId,
|
|
@@ -424,14 +445,9 @@ class MorphoVaultV2 {
|
|
|
424
445
|
required: peak,
|
|
425
446
|
});
|
|
426
447
|
}
|
|
427
|
-
|
|
428
|
-
// larger leftover allowance would let a share-price loss burn past `requiredShareAllowance`.
|
|
429
|
-
if (allowance === requiredShareAllowance)
|
|
448
|
+
if (allowance >= requiredShareAllowance)
|
|
430
449
|
return [];
|
|
431
|
-
|
|
432
|
-
// must be reset with an onchain approval.
|
|
433
|
-
if (allowance < requiredShareAllowance &&
|
|
434
|
-
this.client.options.supportSignature) {
|
|
450
|
+
if (this.client.options.supportSignature) {
|
|
435
451
|
return [
|
|
436
452
|
(0, index_js_1.encodeVaultSharesPermit)({
|
|
437
453
|
vault: vaultData,
|
|
@@ -440,7 +456,6 @@ class MorphoVaultV2 {
|
|
|
440
456
|
owner: userAddress,
|
|
441
457
|
chainId: this.chainId,
|
|
442
458
|
nonce,
|
|
443
|
-
amount: requiredShareAllowance,
|
|
444
459
|
deadline,
|
|
445
460
|
}),
|
|
446
461
|
];
|
|
@@ -449,7 +464,7 @@ class MorphoVaultV2 {
|
|
|
449
464
|
(0, index_js_1.encodeErc20Approval)({
|
|
450
465
|
token: this.vault,
|
|
451
466
|
spender: vaultExitBundlesV1,
|
|
452
|
-
amount:
|
|
467
|
+
amount: viem_1.maxUint256,
|
|
453
468
|
chainId: this.chainId,
|
|
454
469
|
}),
|
|
455
470
|
];
|
|
@@ -633,17 +648,9 @@ class MorphoVaultV2 {
|
|
|
633
648
|
// with no real protection. Its two sibling `computeMin*SharePrice` helpers cap nothing either —
|
|
634
649
|
// only the `computeMax*` ones do, where capping relaxes an upper bound and is safe.
|
|
635
650
|
(0, validate_js_1.validateUint256Field)("minSharePriceE27", minSharePriceE27);
|
|
636
|
-
//
|
|
637
|
-
//
|
|
638
|
-
//
|
|
639
|
-
// it for a price at least one tolerance step below the floor so the miss surfaces as the
|
|
640
|
-
// bundle's own revert instead, and, in any case, for at least one share above the at-floor
|
|
641
|
-
// burn — a burn of `atFloor + 1` shares prices strictly below the floor since
|
|
642
|
-
// `atFloor >= exitAssets * RAY / floor`. The `minSharePriceE27 - 1` branch keeps the
|
|
643
|
-
// denominator strictly below the floor whenever the floor exceeds 1, so even
|
|
644
|
-
// `slippageTolerance: 0n` leaves price-space headroom; a deeper drop still exhausts the
|
|
645
|
-
// allowance first. Add the fee shares the first withdrawal mints since the burn measured
|
|
646
|
-
// on-chain includes them. Saturated at `maxUint256` as an ABI-slot guard.
|
|
651
|
+
// This is the minimum allowance needed for successful execution, not an exit cap: the bundle
|
|
652
|
+
// independently rejects a realized share price below `minSharePriceE27`. Include the fee
|
|
653
|
+
// shares minted by the first withdrawal and enough headroom for the configured tolerance.
|
|
647
654
|
const allowanceSharePriceE27 = blue_sdk_1.MathLib.max(blue_sdk_1.MathLib.min(blue_sdk_1.MathLib.mulDivDown(minSharePriceE27, blue_sdk_1.MathLib.WAD - slippageTolerance, blue_sdk_1.MathLib.WAD), minSharePriceE27 - 1n), 1n);
|
|
648
655
|
const requiredShareAllowance = blue_sdk_1.MathLib.min(blue_sdk_1.MathLib.max(blue_sdk_1.MathLib.mulDivUp(exitAssets, blue_sdk_1.MathLib.RAY, allowanceSharePriceE27), blue_sdk_1.MathLib.mulDivUp(exitAssets, blue_sdk_1.MathLib.RAY, minSharePriceE27) + 1n) + feeSharesProjected, viem_1.maxUint256);
|
|
649
656
|
const vaultExitBundlesV1 = (0, morpho_ts_1.getChainAddress)(this.chainId, "bundles.vaultExitBundlesV1");
|
|
@@ -684,7 +691,6 @@ class MorphoVaultV2 {
|
|
|
684
691
|
owner: userAddress,
|
|
685
692
|
chainId: this.chainId,
|
|
686
693
|
nonce,
|
|
687
|
-
amount: requiredShareAllowance,
|
|
688
694
|
deadline,
|
|
689
695
|
});
|
|
690
696
|
return [requirement];
|
|
@@ -693,7 +699,7 @@ class MorphoVaultV2 {
|
|
|
693
699
|
(0, index_js_1.encodeErc20Approval)({
|
|
694
700
|
token: this.vault,
|
|
695
701
|
spender: vaultExitBundlesV1,
|
|
696
|
-
amount:
|
|
702
|
+
amount: viem_1.maxUint256,
|
|
697
703
|
chainId: this.chainId,
|
|
698
704
|
}),
|
|
699
705
|
];
|
|
@@ -39,8 +39,9 @@ export interface InputVaultV2BlueReallocationData {
|
|
|
39
39
|
/**
|
|
40
40
|
* Immutable-by-convention state container for Vault V2 BluePublicAllocator simulations.
|
|
41
41
|
*
|
|
42
|
-
* Constructor inputs are cloned
|
|
43
|
-
*
|
|
42
|
+
* Constructor inputs are cloned, except Midnight adapter snapshots: those are
|
|
43
|
+
* shared by reference and must be treated as read-only. Every simulated
|
|
44
|
+
* reallocation returns a new instance. Planning keeps the transaction-scoped `firstTotalAssets`
|
|
44
45
|
* denominator outside the durable snapshot while applying reallocations in
|
|
45
46
|
* contract order. Penalty donations update simulated vault accounting but are
|
|
46
47
|
* excluded from same-plan idle liquidity so round-up dust cannot create
|
|
@@ -100,7 +101,8 @@ export declare class VaultV2BlueReallocationData implements InputVaultV2BlueReal
|
|
|
100
101
|
/**
|
|
101
102
|
* Clones the complete simulation snapshot.
|
|
102
103
|
*
|
|
103
|
-
* @returns A deep clone of this simulation state.
|
|
104
|
+
* @returns A deep clone of this simulation state. Midnight adapter snapshots are
|
|
105
|
+
* shared by reference and must be treated as read-only.
|
|
104
106
|
* @example
|
|
105
107
|
* ```ts
|
|
106
108
|
* import { markets } from "@morpho-org/morpho-test";
|
|
@@ -78,6 +78,10 @@ const cloneAccrualVault = (vault, markets) => new blue_sdk_1.AccrualVault({
|
|
|
78
78
|
position: clonePosition(position, markets),
|
|
79
79
|
})));
|
|
80
80
|
const cloneAdapter = (adapter, markets) => {
|
|
81
|
+
// BluePublicAllocator never moves Midnight liquidity, and reallocation never mutates a Midnight
|
|
82
|
+
// adapter, so its read-only snapshot is shared as-is.
|
|
83
|
+
if (adapter.type === "VaultV2MidnightAdapter")
|
|
84
|
+
return adapter;
|
|
81
85
|
const base = {
|
|
82
86
|
address: adapter.address,
|
|
83
87
|
parentVault: adapter.parentVault,
|
|
@@ -125,8 +129,9 @@ const cloneVault = (vault, { markets, adapterKeysToClone, }) => {
|
|
|
125
129
|
/**
|
|
126
130
|
* Immutable-by-convention state container for Vault V2 BluePublicAllocator simulations.
|
|
127
131
|
*
|
|
128
|
-
* Constructor inputs are cloned
|
|
129
|
-
*
|
|
132
|
+
* Constructor inputs are cloned, except Midnight adapter snapshots: those are
|
|
133
|
+
* shared by reference and must be treated as read-only. Every simulated
|
|
134
|
+
* reallocation returns a new instance. Planning keeps the transaction-scoped `firstTotalAssets`
|
|
130
135
|
* denominator outside the durable snapshot while applying reallocations in
|
|
131
136
|
* contract order. Penalty donations update simulated vault accounting but are
|
|
132
137
|
* excluded from same-plan idle liquidity so round-up dust cannot create
|
|
@@ -248,7 +253,8 @@ class VaultV2BlueReallocationData {
|
|
|
248
253
|
/**
|
|
249
254
|
* Clones the complete simulation snapshot.
|
|
250
255
|
*
|
|
251
|
-
* @returns A deep clone of this simulation state.
|
|
256
|
+
* @returns A deep clone of this simulation state. Midnight adapter snapshots are
|
|
257
|
+
* shared by reference and must be treated as read-only.
|
|
252
258
|
* @example
|
|
253
259
|
* ```ts
|
|
254
260
|
* import { markets } from "@morpho-org/morpho-test";
|
package/lib/cjs/errors.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { BlueErrors, IncompleteChainRegistryError, InvalidMarketParamsError as InvalidBlueMarketParamsError, UnknownAddressError, UnknownDataError as UnknownBlueDataError, UnknownFactory as UnknownBlueFactory, UnknownMarketAllocationError as UnknownBlueMarketAllocationError, UnknownMarketParamsError as UnknownBlueMarketParamsError, UnknownOfFactory as UnknownBlueOfFactory, UnknownTokenError as UnknownBlueTokenError, UnknownTokenPriceError as UnknownBlueTokenPriceError, UnknownVaultConfigError as UnknownBlueVaultConfigError, UnsupportedChainIdError, UnsupportedMarketIrmError as UnsupportedBlueMarketIrmError,
|
|
1
|
+
export { BlueErrors, IncompleteChainRegistryError, InvalidMarketParamsError as InvalidBlueMarketParamsError, InvalidVaultV2MidnightAdapterMarketsError as InvalidBlueVaultV2MidnightAdapterMarketsError, UnknownAddressError, UnknownDataError as UnknownBlueDataError, UnknownFactory as UnknownBlueFactory, UnknownMarketAllocationError as UnknownBlueMarketAllocationError, UnknownMarketParamsError as UnknownBlueMarketParamsError, UnknownOfFactory as UnknownBlueOfFactory, UnknownTokenError as UnknownBlueTokenError, UnknownTokenPriceError as UnknownBlueTokenPriceError, UnknownVaultConfigError as UnknownBlueVaultConfigError, UnsupportedChainIdError, UnsupportedMarketIrmError as UnsupportedBlueMarketIrmError,
|
|
2
2
|
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
|
3
3
|
UnsupportedPreLiquidationParamsError as UnsupportedBluePreLiquidationParamsError, UnsupportedVaultV2AdapterError as UnsupportedBlueVaultV2AdapterError, VaultV2Errors, } from "@morpho-org/blue-sdk";
|
|
4
|
-
export { getUnsupportedVaultV2Adapter as getBlueUnsupportedVaultV2Adapter, InvalidNumberError, InvalidPermitDomainChainIdError, InvalidPermitDomainVerifyingContractError, isUnknownOfFactoryError as isBlueUnknownOfFactoryError, MalformedTokenMetadataError, MarketParamsIdMismatchError as BlueMarketParamsIdMismatchError, MissingPermitDomainNameError, NonTupleReturnValueError, UnknownAbiFunctionError, UnnamedAbiOutputsError, UnsupportedPermitDomainExtensionsError, } from "@morpho-org/blue-sdk-viem";
|
|
5
|
-
export { ChainIdMismatchError as MidnightChainIdMismatchError, InvalidEcrecoverSignatureVError as InvalidMidnightEcrecoverSignatureVError, InvalidMarketParameterError as InvalidMidnightMarketParameterError, InvalidMidnightApiQuoteTargetError, InvalidMidnightApiResponseError, InvalidOfferGroupError as InvalidMidnightOfferGroupError, InvalidOfferParameterError as InvalidMidnightOfferParameterError,
|
|
4
|
+
export { getUnsupportedVaultV2Adapter as getBlueUnsupportedVaultV2Adapter, InvalidNumberError, InvalidPermitDomainChainIdError, InvalidPermitDomainVerifyingContractError, isUnknownOfFactoryError as isBlueUnknownOfFactoryError, MalformedTokenMetadataError, MarketParamsIdMismatchError as BlueMarketParamsIdMismatchError, MissingPermitDomainNameError, NonTupleReturnValueError, UnknownAbiFunctionError, UnnamedAbiOutputsError, UnresolvedBlockNumberError as BlueUnresolvedBlockNumberError, UnsupportedPermitDomainExtensionsError, } from "@morpho-org/blue-sdk-viem";
|
|
5
|
+
export { ChainIdMismatchError as MidnightChainIdMismatchError, InvalidEcrecoverSignatureVError as InvalidMidnightEcrecoverSignatureVError, InvalidMarketParameterError as InvalidMidnightMarketParameterError, InvalidMidnightApiQuoteTargetError, InvalidMidnightApiResponseError, InvalidOfferGroupError as InvalidMidnightOfferGroupError, InvalidOfferParameterError as InvalidMidnightOfferParameterError, InvalidRateRatifierV1RateError as InvalidMidnightRateRatifierV1RateError, InvalidRateRatifierV1TickError as InvalidMidnightRateRatifierV1TickError, InvalidRateRatifierV1TimeError as InvalidMidnightRateRatifierV1TimeError, InvalidRatifierV1AddressError as InvalidMidnightRatifierV1AddressError, InvalidTickSpacingError as InvalidMidnightTickSpacingError, InvalidTreeError as InvalidMidnightTreeError, InvalidTreeHeightError as InvalidMidnightTreeHeightError, InvalidTypedDataSignatureError as InvalidMidnightTypedDataSignatureError, MidnightApiError, MidnightMempoolValidationError, PayloadDecodeError as MidnightPayloadDecodeError, PriceGreaterThanOneError as MidnightPriceGreaterThanOneError, RateRatifierV1BoundOverflowError as MidnightRateRatifierV1BoundOverflowError, RatifierV1TakerNotAllowedError as MidnightRatifierV1TakerNotAllowedError, SettlementFeeExceedsPriceError as MidnightSettlementFeeExceedsPriceError, TickOutOfRangeError as MidnightTickOutOfRangeError, UnknownCollateralIndexError as UnknownMidnightCollateralIndexError, } from "@morpho-org/midnight-sdk";
|
|
6
6
|
export type { ErrorClass } from "@morpho-org/morpho-ts";
|
|
7
|
-
export { _try, DivisionByZeroError, InvalidAddressError, InvalidBitLengthError, NegativeValueError, RegistryValueAlreadyRegisteredError, } from "@morpho-org/morpho-ts";
|
|
7
|
+
export { _try, DivisionByZeroError, InvalidAddressError, InvalidBitLengthError, InvalidPositionAccrualStateError, InvalidPositionAccrualStateError as InvalidMidnightPositionAccrualStateError, InvalidPositionAccrualTimestampError, InvalidPositionAccrualTimestampError as InvalidMidnightPositionAccrualTimestampError, InvalidPositionLossFactorError, InvalidPositionLossFactorError as InvalidMidnightPositionLossFactorError, NegativeValueError, RegistryValueAlreadyRegisteredError, } from "@morpho-org/morpho-ts";
|
package/lib/cjs/errors.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MidnightPayloadDecodeError = exports.MidnightMempoolValidationError = exports.MidnightApiError = exports.InvalidMidnightTypedDataSignatureError = exports.InvalidMidnightTreeHeightError = exports.InvalidMidnightTreeError = exports.InvalidMidnightTickSpacingError = exports.InvalidMidnightRatifierV1AddressError = exports.InvalidMidnightRateRatifierV1TimeError = exports.InvalidMidnightRateRatifierV1TickError = exports.InvalidMidnightRateRatifierV1RateError = exports.
|
|
4
|
-
exports.RegistryValueAlreadyRegisteredError = exports.NegativeValueError = exports.InvalidBitLengthError = exports.InvalidAddressError = exports.DivisionByZeroError = exports._try = exports.UnknownMidnightCollateralIndexError = exports.MidnightTickOutOfRangeError = exports.MidnightSettlementFeeExceedsPriceError = exports.MidnightRatifierV1TakerNotAllowedError = exports.MidnightRateRatifierV1BoundOverflowError =
|
|
3
|
+
exports.MidnightPriceGreaterThanOneError = exports.MidnightPayloadDecodeError = exports.MidnightMempoolValidationError = exports.MidnightApiError = exports.InvalidMidnightTypedDataSignatureError = exports.InvalidMidnightTreeHeightError = exports.InvalidMidnightTreeError = exports.InvalidMidnightTickSpacingError = exports.InvalidMidnightRatifierV1AddressError = exports.InvalidMidnightRateRatifierV1TimeError = exports.InvalidMidnightRateRatifierV1TickError = exports.InvalidMidnightRateRatifierV1RateError = exports.InvalidMidnightOfferParameterError = exports.InvalidMidnightOfferGroupError = exports.InvalidMidnightApiResponseError = exports.InvalidMidnightApiQuoteTargetError = exports.InvalidMidnightMarketParameterError = exports.InvalidMidnightEcrecoverSignatureVError = exports.MidnightChainIdMismatchError = exports.UnsupportedPermitDomainExtensionsError = exports.BlueUnresolvedBlockNumberError = exports.UnnamedAbiOutputsError = exports.UnknownAbiFunctionError = exports.NonTupleReturnValueError = exports.MissingPermitDomainNameError = exports.BlueMarketParamsIdMismatchError = exports.MalformedTokenMetadataError = exports.isBlueUnknownOfFactoryError = exports.InvalidPermitDomainVerifyingContractError = exports.InvalidPermitDomainChainIdError = exports.InvalidNumberError = exports.getBlueUnsupportedVaultV2Adapter = exports.VaultV2Errors = exports.UnsupportedBlueVaultV2AdapterError = exports.UnsupportedBluePreLiquidationParamsError = exports.UnsupportedBlueMarketIrmError = exports.UnsupportedChainIdError = exports.UnknownBlueVaultConfigError = exports.UnknownBlueTokenPriceError = exports.UnknownBlueTokenError = exports.UnknownBlueOfFactory = exports.UnknownBlueMarketParamsError = exports.UnknownBlueMarketAllocationError = exports.UnknownBlueFactory = exports.UnknownBlueDataError = exports.UnknownAddressError = exports.InvalidBlueVaultV2MidnightAdapterMarketsError = exports.InvalidBlueMarketParamsError = exports.IncompleteChainRegistryError = exports.BlueErrors = void 0;
|
|
4
|
+
exports.RegistryValueAlreadyRegisteredError = exports.NegativeValueError = exports.InvalidMidnightPositionLossFactorError = exports.InvalidPositionLossFactorError = exports.InvalidMidnightPositionAccrualTimestampError = exports.InvalidPositionAccrualTimestampError = exports.InvalidMidnightPositionAccrualStateError = exports.InvalidPositionAccrualStateError = exports.InvalidBitLengthError = exports.InvalidAddressError = exports.DivisionByZeroError = exports._try = exports.UnknownMidnightCollateralIndexError = exports.MidnightTickOutOfRangeError = exports.MidnightSettlementFeeExceedsPriceError = exports.MidnightRatifierV1TakerNotAllowedError = exports.MidnightRateRatifierV1BoundOverflowError = void 0;
|
|
5
5
|
var blue_sdk_1 = require("@morpho-org/blue-sdk");
|
|
6
6
|
Object.defineProperty(exports, "BlueErrors", { enumerable: true, get: function () { return blue_sdk_1.BlueErrors; } });
|
|
7
7
|
Object.defineProperty(exports, "IncompleteChainRegistryError", { enumerable: true, get: function () { return blue_sdk_1.IncompleteChainRegistryError; } });
|
|
8
8
|
Object.defineProperty(exports, "InvalidBlueMarketParamsError", { enumerable: true, get: function () { return blue_sdk_1.InvalidMarketParamsError; } });
|
|
9
|
+
Object.defineProperty(exports, "InvalidBlueVaultV2MidnightAdapterMarketsError", { enumerable: true, get: function () { return blue_sdk_1.InvalidVaultV2MidnightAdapterMarketsError; } });
|
|
9
10
|
Object.defineProperty(exports, "UnknownAddressError", { enumerable: true, get: function () { return blue_sdk_1.UnknownAddressError; } });
|
|
10
11
|
Object.defineProperty(exports, "UnknownBlueDataError", { enumerable: true, get: function () { return blue_sdk_1.UnknownDataError; } });
|
|
11
12
|
Object.defineProperty(exports, "UnknownBlueFactory", { enumerable: true, get: function () { return blue_sdk_1.UnknownFactory; } });
|
|
@@ -33,6 +34,7 @@ Object.defineProperty(exports, "MissingPermitDomainNameError", { enumerable: tru
|
|
|
33
34
|
Object.defineProperty(exports, "NonTupleReturnValueError", { enumerable: true, get: function () { return blue_sdk_viem_1.NonTupleReturnValueError; } });
|
|
34
35
|
Object.defineProperty(exports, "UnknownAbiFunctionError", { enumerable: true, get: function () { return blue_sdk_viem_1.UnknownAbiFunctionError; } });
|
|
35
36
|
Object.defineProperty(exports, "UnnamedAbiOutputsError", { enumerable: true, get: function () { return blue_sdk_viem_1.UnnamedAbiOutputsError; } });
|
|
37
|
+
Object.defineProperty(exports, "BlueUnresolvedBlockNumberError", { enumerable: true, get: function () { return blue_sdk_viem_1.UnresolvedBlockNumberError; } });
|
|
36
38
|
Object.defineProperty(exports, "UnsupportedPermitDomainExtensionsError", { enumerable: true, get: function () { return blue_sdk_viem_1.UnsupportedPermitDomainExtensionsError; } });
|
|
37
39
|
var midnight_sdk_1 = require("@morpho-org/midnight-sdk");
|
|
38
40
|
Object.defineProperty(exports, "MidnightChainIdMismatchError", { enumerable: true, get: function () { return midnight_sdk_1.ChainIdMismatchError; } });
|
|
@@ -42,9 +44,6 @@ Object.defineProperty(exports, "InvalidMidnightApiQuoteTargetError", { enumerabl
|
|
|
42
44
|
Object.defineProperty(exports, "InvalidMidnightApiResponseError", { enumerable: true, get: function () { return midnight_sdk_1.InvalidMidnightApiResponseError; } });
|
|
43
45
|
Object.defineProperty(exports, "InvalidMidnightOfferGroupError", { enumerable: true, get: function () { return midnight_sdk_1.InvalidOfferGroupError; } });
|
|
44
46
|
Object.defineProperty(exports, "InvalidMidnightOfferParameterError", { enumerable: true, get: function () { return midnight_sdk_1.InvalidOfferParameterError; } });
|
|
45
|
-
Object.defineProperty(exports, "InvalidMidnightPositionAccrualStateError", { enumerable: true, get: function () { return midnight_sdk_1.InvalidPositionAccrualStateError; } });
|
|
46
|
-
Object.defineProperty(exports, "InvalidMidnightPositionAccrualTimestampError", { enumerable: true, get: function () { return midnight_sdk_1.InvalidPositionAccrualTimestampError; } });
|
|
47
|
-
Object.defineProperty(exports, "InvalidMidnightPositionLossFactorError", { enumerable: true, get: function () { return midnight_sdk_1.InvalidPositionLossFactorError; } });
|
|
48
47
|
Object.defineProperty(exports, "InvalidMidnightRateRatifierV1RateError", { enumerable: true, get: function () { return midnight_sdk_1.InvalidRateRatifierV1RateError; } });
|
|
49
48
|
Object.defineProperty(exports, "InvalidMidnightRateRatifierV1TickError", { enumerable: true, get: function () { return midnight_sdk_1.InvalidRateRatifierV1TickError; } });
|
|
50
49
|
Object.defineProperty(exports, "InvalidMidnightRateRatifierV1TimeError", { enumerable: true, get: function () { return midnight_sdk_1.InvalidRateRatifierV1TimeError; } });
|
|
@@ -67,5 +66,11 @@ Object.defineProperty(exports, "_try", { enumerable: true, get: function () { re
|
|
|
67
66
|
Object.defineProperty(exports, "DivisionByZeroError", { enumerable: true, get: function () { return morpho_ts_1.DivisionByZeroError; } });
|
|
68
67
|
Object.defineProperty(exports, "InvalidAddressError", { enumerable: true, get: function () { return morpho_ts_1.InvalidAddressError; } });
|
|
69
68
|
Object.defineProperty(exports, "InvalidBitLengthError", { enumerable: true, get: function () { return morpho_ts_1.InvalidBitLengthError; } });
|
|
69
|
+
Object.defineProperty(exports, "InvalidPositionAccrualStateError", { enumerable: true, get: function () { return morpho_ts_1.InvalidPositionAccrualStateError; } });
|
|
70
|
+
Object.defineProperty(exports, "InvalidMidnightPositionAccrualStateError", { enumerable: true, get: function () { return morpho_ts_1.InvalidPositionAccrualStateError; } });
|
|
71
|
+
Object.defineProperty(exports, "InvalidPositionAccrualTimestampError", { enumerable: true, get: function () { return morpho_ts_1.InvalidPositionAccrualTimestampError; } });
|
|
72
|
+
Object.defineProperty(exports, "InvalidMidnightPositionAccrualTimestampError", { enumerable: true, get: function () { return morpho_ts_1.InvalidPositionAccrualTimestampError; } });
|
|
73
|
+
Object.defineProperty(exports, "InvalidPositionLossFactorError", { enumerable: true, get: function () { return morpho_ts_1.InvalidPositionLossFactorError; } });
|
|
74
|
+
Object.defineProperty(exports, "InvalidMidnightPositionLossFactorError", { enumerable: true, get: function () { return morpho_ts_1.InvalidPositionLossFactorError; } });
|
|
70
75
|
Object.defineProperty(exports, "NegativeValueError", { enumerable: true, get: function () { return morpho_ts_1.NegativeValueError; } });
|
|
71
76
|
Object.defineProperty(exports, "RegistryValueAlreadyRegisteredError", { enumerable: true, get: function () { return morpho_ts_1.RegistryValueAlreadyRegisteredError; } });
|
package/lib/cjs/fetch.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { fetchAccrualPosition as fetchBlueAccrualPosition, fetchAccrualVault, fetchAccrualVaultV2, fetchAccrualVaultV2Adapter, fetchAccrualVaultV2MorphoMarketV1Adapter, fetchAccrualVaultV2MorphoMarketV1AdapterV2, fetchAccrualVaultV2MorphoVaultV1Adapter, fetchHolding, fetchMarket as fetchBlueMarket, fetchMarketParams as fetchBlueMarketParams, fetchPosition as fetchBluePosition,
|
|
1
|
+
export { fetchAccrualPosition as fetchBlueAccrualPosition, fetchAccrualVault, fetchAccrualVaultV2, fetchAccrualVaultV2Adapter, fetchAccrualVaultV2MidnightAdapter, fetchAccrualVaultV2MorphoMarketV1Adapter, fetchAccrualVaultV2MorphoMarketV1AdapterV2, fetchAccrualVaultV2MorphoVaultV1Adapter, fetchHolding, fetchMarket as fetchBlueMarket, fetchMarketParams as fetchBlueMarketParams, fetchPosition as fetchBluePosition,
|
|
2
2
|
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
|
3
3
|
fetchPreLiquidationParams as fetchBluePreLiquidationParams,
|
|
4
4
|
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
|
5
|
-
fetchPreLiquidationPosition as fetchBluePreLiquidationPosition, fetchToken, fetchUser as fetchBlueUser, fetchVault, fetchVaultConfig, fetchVaultMarketAllocation, fetchVaultMarketConfig, fetchVaultUser, fetchVaultV2, fetchVaultV2Adapter, fetchVaultV2BlueMarketPublicAllocatorConfig, fetchVaultV2BluePublicAllocatorConfig, fetchVaultV2BluePublicAllocatorData, fetchVaultV2MorphoMarketV1Adapter, fetchVaultV2MorphoMarketV1AdapterV2, fetchVaultV2MorphoVaultV1Adapter, } from "@morpho-org/blue-sdk-viem";
|
|
5
|
+
fetchPreLiquidationPosition as fetchBluePreLiquidationPosition, fetchToken, fetchUser as fetchBlueUser, fetchVault, fetchVaultConfig, fetchVaultMarketAllocation, fetchVaultMarketConfig, fetchVaultUser, fetchVaultV2, fetchVaultV2Adapter, fetchVaultV2BlueMarketPublicAllocatorConfig, fetchVaultV2BluePublicAllocatorConfig, fetchVaultV2BluePublicAllocatorData, fetchVaultV2MidnightAdapter, fetchVaultV2MorphoMarketV1Adapter, fetchVaultV2MorphoMarketV1AdapterV2, fetchVaultV2MorphoVaultV1Adapter, } from "@morpho-org/blue-sdk-viem";
|
|
6
6
|
export { fetchAccrualPosition as fetchMidnightAccrualPosition, fetchMarket as fetchMidnightMarket, fetchMarketParams as fetchMidnightMarketParams, fetchPosition as fetchMidnightPosition, fetchRatifierInfo as fetchMidnightRatifierInfo, } from "@morpho-org/midnight-sdk";
|
package/lib/cjs/fetch.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fetchMidnightRatifierInfo = exports.fetchMidnightPosition = exports.fetchMidnightMarketParams = exports.fetchMidnightMarket = exports.fetchMidnightAccrualPosition = exports.fetchVaultV2MorphoVaultV1Adapter = exports.fetchVaultV2MorphoMarketV1AdapterV2 = exports.fetchVaultV2MorphoMarketV1Adapter = exports.fetchVaultV2BluePublicAllocatorData = exports.fetchVaultV2BluePublicAllocatorConfig = exports.fetchVaultV2BlueMarketPublicAllocatorConfig = exports.fetchVaultV2Adapter = exports.fetchVaultV2 = exports.fetchVaultUser = exports.fetchVaultMarketConfig = exports.fetchVaultMarketAllocation = exports.fetchVaultConfig = exports.fetchVault = exports.fetchBlueUser = exports.fetchToken = exports.fetchBluePreLiquidationPosition = exports.fetchBluePreLiquidationParams = exports.fetchBluePosition = exports.fetchBlueMarketParams = exports.fetchBlueMarket = exports.fetchHolding = exports.fetchAccrualVaultV2MorphoVaultV1Adapter = exports.fetchAccrualVaultV2MorphoMarketV1AdapterV2 = exports.fetchAccrualVaultV2MorphoMarketV1Adapter = exports.fetchAccrualVaultV2Adapter = exports.fetchAccrualVaultV2 = exports.fetchAccrualVault = exports.fetchBlueAccrualPosition = void 0;
|
|
3
|
+
exports.fetchMidnightRatifierInfo = exports.fetchMidnightPosition = exports.fetchMidnightMarketParams = exports.fetchMidnightMarket = exports.fetchMidnightAccrualPosition = exports.fetchVaultV2MorphoVaultV1Adapter = exports.fetchVaultV2MorphoMarketV1AdapterV2 = exports.fetchVaultV2MorphoMarketV1Adapter = exports.fetchVaultV2MidnightAdapter = exports.fetchVaultV2BluePublicAllocatorData = exports.fetchVaultV2BluePublicAllocatorConfig = exports.fetchVaultV2BlueMarketPublicAllocatorConfig = exports.fetchVaultV2Adapter = exports.fetchVaultV2 = exports.fetchVaultUser = exports.fetchVaultMarketConfig = exports.fetchVaultMarketAllocation = exports.fetchVaultConfig = exports.fetchVault = exports.fetchBlueUser = exports.fetchToken = exports.fetchBluePreLiquidationPosition = exports.fetchBluePreLiquidationParams = exports.fetchBluePosition = exports.fetchBlueMarketParams = exports.fetchBlueMarket = exports.fetchHolding = exports.fetchAccrualVaultV2MorphoVaultV1Adapter = exports.fetchAccrualVaultV2MorphoMarketV1AdapterV2 = exports.fetchAccrualVaultV2MorphoMarketV1Adapter = exports.fetchAccrualVaultV2MidnightAdapter = exports.fetchAccrualVaultV2Adapter = exports.fetchAccrualVaultV2 = exports.fetchAccrualVault = exports.fetchBlueAccrualPosition = void 0;
|
|
4
4
|
var blue_sdk_viem_1 = require("@morpho-org/blue-sdk-viem");
|
|
5
5
|
Object.defineProperty(exports, "fetchBlueAccrualPosition", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchAccrualPosition; } });
|
|
6
6
|
Object.defineProperty(exports, "fetchAccrualVault", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchAccrualVault; } });
|
|
7
7
|
Object.defineProperty(exports, "fetchAccrualVaultV2", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchAccrualVaultV2; } });
|
|
8
8
|
Object.defineProperty(exports, "fetchAccrualVaultV2Adapter", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchAccrualVaultV2Adapter; } });
|
|
9
|
+
Object.defineProperty(exports, "fetchAccrualVaultV2MidnightAdapter", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchAccrualVaultV2MidnightAdapter; } });
|
|
9
10
|
Object.defineProperty(exports, "fetchAccrualVaultV2MorphoMarketV1Adapter", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchAccrualVaultV2MorphoMarketV1Adapter; } });
|
|
10
11
|
Object.defineProperty(exports, "fetchAccrualVaultV2MorphoMarketV1AdapterV2", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchAccrualVaultV2MorphoMarketV1AdapterV2; } });
|
|
11
12
|
Object.defineProperty(exports, "fetchAccrualVaultV2MorphoVaultV1Adapter", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchAccrualVaultV2MorphoVaultV1Adapter; } });
|
|
@@ -29,6 +30,7 @@ Object.defineProperty(exports, "fetchVaultV2Adapter", { enumerable: true, get: f
|
|
|
29
30
|
Object.defineProperty(exports, "fetchVaultV2BlueMarketPublicAllocatorConfig", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchVaultV2BlueMarketPublicAllocatorConfig; } });
|
|
30
31
|
Object.defineProperty(exports, "fetchVaultV2BluePublicAllocatorConfig", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchVaultV2BluePublicAllocatorConfig; } });
|
|
31
32
|
Object.defineProperty(exports, "fetchVaultV2BluePublicAllocatorData", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchVaultV2BluePublicAllocatorData; } });
|
|
33
|
+
Object.defineProperty(exports, "fetchVaultV2MidnightAdapter", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchVaultV2MidnightAdapter; } });
|
|
32
34
|
Object.defineProperty(exports, "fetchVaultV2MorphoMarketV1Adapter", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchVaultV2MorphoMarketV1Adapter; } });
|
|
33
35
|
Object.defineProperty(exports, "fetchVaultV2MorphoMarketV1AdapterV2", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchVaultV2MorphoMarketV1AdapterV2; } });
|
|
34
36
|
Object.defineProperty(exports, "fetchVaultV2MorphoVaultV1Adapter", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchVaultV2MorphoVaultV1Adapter; } });
|