@morpho-org/morpho-sdk 6.0.0-next.2 → 6.0.0-next.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/MIGRATION-v5-to-v6.md +88 -32
- package/README.md +9 -7
- package/lib/cjs/abis.d.ts +7 -2844
- package/lib/cjs/abis.js +3 -1951
- package/lib/cjs/actions/blue/borrow.d.ts +3 -2
- package/lib/cjs/actions/blue/borrow.js +3 -2
- package/lib/cjs/actions/blue/common.js +1 -9
- package/lib/cjs/actions/blue/refinance.d.ts +2 -2
- package/lib/cjs/actions/blue/refinance.js +2 -2
- package/lib/cjs/actions/blue/repay.d.ts +1 -1
- package/lib/cjs/actions/blue/repay.js +1 -1
- package/lib/cjs/actions/blue/repayWithdrawCollateral.d.ts +2 -2
- package/lib/cjs/actions/blue/repayWithdrawCollateral.js +2 -2
- package/lib/cjs/actions/blue/supply.d.ts +2 -2
- package/lib/cjs/actions/blue/supply.js +2 -2
- package/lib/cjs/actions/blue/supplyCollateral.d.ts +2 -2
- package/lib/cjs/actions/blue/supplyCollateral.js +2 -2
- package/lib/cjs/actions/blue/supplyCollateralBorrow.d.ts +3 -2
- package/lib/cjs/actions/blue/supplyCollateralBorrow.js +3 -2
- package/lib/cjs/actions/blue/withdraw.d.ts +3 -3
- package/lib/cjs/actions/blue/withdraw.js +3 -3
- package/lib/cjs/actions/blue/withdrawCollateral.d.ts +2 -2
- package/lib/cjs/actions/blue/withdrawCollateral.js +2 -2
- package/lib/cjs/actions/bundles/common.d.ts +6 -2
- package/lib/cjs/actions/bundles/common.js +31 -5
- package/lib/cjs/actions/index.d.ts +0 -1
- package/lib/cjs/actions/index.js +0 -1
- package/lib/cjs/actions/requirements/blue/getBlueAuthorizationRequirement.d.ts +6 -8
- package/lib/cjs/actions/requirements/blue/getBlueAuthorizationRequirement.js +11 -16
- package/lib/cjs/actions/requirements/encode/encodeBlueSignatureAuthorization.d.ts +5 -6
- package/lib/cjs/actions/requirements/encode/encodeBlueSignatureAuthorization.js +4 -5
- package/lib/cjs/actions/requirements/encode/encodeErc20Approval.d.ts +4 -4
- package/lib/cjs/actions/requirements/encode/encodeErc20Approval.js +4 -5
- package/lib/cjs/actions/requirements/encode/encodeErc20Permit.d.ts +5 -5
- package/lib/cjs/actions/requirements/encode/encodeErc20Permit.js +6 -11
- package/lib/cjs/actions/requirements/encode/index.d.ts +0 -1
- package/lib/cjs/actions/requirements/encode/index.js +0 -1
- package/lib/cjs/actions/requirements/getRequirementsApproval.d.ts +5 -6
- package/lib/cjs/actions/requirements/getRequirementsApproval.js +5 -6
- package/lib/cjs/actions/requirements/index.d.ts +0 -1
- package/lib/cjs/actions/requirements/index.js +0 -1
- package/lib/cjs/actions/vaultV1/deposit.d.ts +1 -2
- package/lib/cjs/actions/vaultV1/deposit.js +1 -2
- package/lib/cjs/actions/vaultV1/inKindRedeem.d.ts +7 -5
- package/lib/cjs/actions/vaultV1/inKindRedeem.js +11 -7
- package/lib/cjs/actions/vaultV2/deposit.d.ts +1 -2
- package/lib/cjs/actions/vaultV2/deposit.js +1 -2
- package/lib/cjs/actions/vaultV2/forceWithdraw.d.ts +1 -1
- package/lib/cjs/actions/vaultV2/forceWithdraw.js +3 -3
- package/lib/cjs/actions/vaultV2/inKindRedeem.d.ts +7 -5
- package/lib/cjs/actions/vaultV2/inKindRedeem.js +11 -7
- package/lib/cjs/augment/AccrualPosition.d.ts +1 -0
- package/lib/cjs/augment.d.ts +0 -1
- package/lib/cjs/augment.js +0 -1
- package/lib/cjs/blue/abis.d.ts +5 -5
- package/lib/cjs/blue/abis.js +3 -7
- package/lib/cjs/blue/entities.d.ts +10 -8
- package/lib/cjs/blue/entities.js +3 -3
- package/lib/cjs/blue/errors.d.ts +4 -2
- package/lib/cjs/blue/errors.js +3 -1
- package/lib/cjs/blue/fetch.d.ts +5 -3
- package/lib/cjs/blue/fetch.js +3 -3
- package/lib/cjs/blue/types.d.ts +2 -4
- package/lib/cjs/blue/utils.d.ts +6 -4
- package/lib/cjs/blue/utils.js +3 -3
- package/lib/cjs/client/morphoViemExtension.d.ts +1 -1
- package/lib/cjs/client/morphoViemExtension.js +1 -1
- package/lib/cjs/constants.d.ts +3 -37
- package/lib/cjs/constants.js +1 -39
- package/lib/cjs/entities/blue/blue.d.ts +30 -265
- package/lib/cjs/entities/blue/blue.js +1 -205
- package/lib/cjs/entities/index.d.ts +11 -66
- package/lib/cjs/entities/index.js +3 -21
- package/lib/cjs/entities/requirements/getVaultBundlesSharesRequirements.d.ts +5 -2
- package/lib/cjs/entities/requirements/getVaultBundlesSharesRequirements.js +8 -3
- package/lib/cjs/entities/vaultV1/vaultV1.d.ts +13 -5
- package/lib/cjs/entities/vaultV1/vaultV1.js +16 -10
- package/lib/cjs/entities/vaultV2/vaultV2.d.ts +40 -19
- package/lib/cjs/entities/vaultV2/vaultV2.js +57 -26
- package/lib/cjs/entities/vaultV2BlueReallocationData.js +4 -21
- package/lib/cjs/errors.d.ts +5 -47
- package/lib/cjs/errors.js +4 -46
- package/lib/cjs/fetch.d.ts +5 -17
- package/lib/cjs/fetch.js +3 -17
- package/lib/cjs/helpers/constant.d.ts +0 -2
- package/lib/cjs/helpers/constant.js +0 -2
- package/lib/cjs/helpers/index.d.ts +2 -3
- package/lib/cjs/helpers/index.js +1 -9
- package/lib/cjs/helpers/previewVaultV2ForceWithdraw.js +11 -5
- package/lib/cjs/helpers/slippage.d.ts +1 -103
- package/lib/cjs/helpers/slippage.js +0 -150
- package/lib/cjs/helpers/utilization.d.ts +12 -10
- package/lib/cjs/helpers/utilization.js +27 -12
- package/lib/cjs/helpers/validate.d.ts +1 -24
- package/lib/cjs/helpers/validate.js +2 -49
- package/lib/cjs/helpers/validateRequirementSpender.d.ts +1 -1
- package/lib/cjs/helpers/validateRequirementSpender.js +1 -3
- package/lib/cjs/helpers/vaultV2ForceWithdrawPlan.d.ts +48 -15
- package/lib/cjs/helpers/vaultV2ForceWithdrawPlan.js +48 -15
- package/lib/cjs/midnight/errors.d.ts +1 -1
- package/lib/cjs/midnight/errors.js +2 -1
- package/lib/cjs/types/action.d.ts +17 -65
- package/lib/cjs/types/action.js +11 -4
- package/lib/cjs/types/error.d.ts +50 -381
- package/lib/cjs/types/error.js +64 -395
- package/lib/cjs/types/sharedLiquidity.d.ts +1 -117
- package/lib/cjs/types.d.ts +2 -18
- package/lib/cjs/utils.d.ts +10 -35
- package/lib/cjs/utils.js +4 -36
- package/lib/esm/abis.d.ts +7 -2844
- package/lib/esm/abis.js +7 -1950
- package/lib/esm/actions/blue/borrow.d.ts +3 -2
- package/lib/esm/actions/blue/borrow.js +3 -2
- package/lib/esm/actions/blue/common.js +1 -9
- package/lib/esm/actions/blue/refinance.d.ts +2 -2
- package/lib/esm/actions/blue/refinance.js +2 -2
- package/lib/esm/actions/blue/repay.d.ts +1 -1
- package/lib/esm/actions/blue/repay.js +1 -1
- package/lib/esm/actions/blue/repayWithdrawCollateral.d.ts +2 -2
- package/lib/esm/actions/blue/repayWithdrawCollateral.js +2 -2
- package/lib/esm/actions/blue/supply.d.ts +2 -2
- package/lib/esm/actions/blue/supply.js +2 -2
- package/lib/esm/actions/blue/supplyCollateral.d.ts +2 -2
- package/lib/esm/actions/blue/supplyCollateral.js +2 -2
- package/lib/esm/actions/blue/supplyCollateralBorrow.d.ts +3 -2
- package/lib/esm/actions/blue/supplyCollateralBorrow.js +3 -2
- package/lib/esm/actions/blue/withdraw.d.ts +3 -3
- package/lib/esm/actions/blue/withdraw.js +3 -3
- package/lib/esm/actions/blue/withdrawCollateral.d.ts +2 -2
- package/lib/esm/actions/blue/withdrawCollateral.js +2 -2
- package/lib/esm/actions/bundles/common.d.ts +6 -2
- package/lib/esm/actions/bundles/common.js +32 -6
- package/lib/esm/actions/index.d.ts +0 -1
- package/lib/esm/actions/index.js +0 -1
- package/lib/esm/actions/requirements/blue/getBlueAuthorizationRequirement.d.ts +6 -8
- package/lib/esm/actions/requirements/blue/getBlueAuthorizationRequirement.js +12 -17
- package/lib/esm/actions/requirements/encode/encodeBlueSignatureAuthorization.d.ts +5 -6
- package/lib/esm/actions/requirements/encode/encodeBlueSignatureAuthorization.js +4 -5
- package/lib/esm/actions/requirements/encode/encodeErc20Approval.d.ts +4 -4
- package/lib/esm/actions/requirements/encode/encodeErc20Approval.js +4 -5
- package/lib/esm/actions/requirements/encode/encodeErc20Permit.d.ts +5 -5
- package/lib/esm/actions/requirements/encode/encodeErc20Permit.js +6 -11
- package/lib/esm/actions/requirements/encode/index.d.ts +0 -1
- package/lib/esm/actions/requirements/encode/index.js +0 -1
- package/lib/esm/actions/requirements/getRequirementsApproval.d.ts +5 -6
- package/lib/esm/actions/requirements/getRequirementsApproval.js +5 -6
- package/lib/esm/actions/requirements/index.d.ts +0 -1
- package/lib/esm/actions/requirements/index.js +0 -1
- package/lib/esm/actions/vaultV1/deposit.d.ts +1 -2
- package/lib/esm/actions/vaultV1/deposit.js +1 -2
- package/lib/esm/actions/vaultV1/inKindRedeem.d.ts +7 -5
- package/lib/esm/actions/vaultV1/inKindRedeem.js +11 -7
- package/lib/esm/actions/vaultV2/deposit.d.ts +1 -2
- package/lib/esm/actions/vaultV2/deposit.js +1 -2
- package/lib/esm/actions/vaultV2/forceWithdraw.d.ts +1 -1
- package/lib/esm/actions/vaultV2/forceWithdraw.js +3 -3
- package/lib/esm/actions/vaultV2/inKindRedeem.d.ts +7 -5
- package/lib/esm/actions/vaultV2/inKindRedeem.js +11 -7
- package/lib/esm/augment/AccrualPosition.d.ts +1 -0
- package/lib/esm/augment.d.ts +0 -1
- package/lib/esm/augment.js +0 -1
- package/lib/esm/blue/abis.d.ts +5 -5
- package/lib/esm/blue/abis.js +5 -5
- package/lib/esm/blue/entities.d.ts +10 -8
- package/lib/esm/blue/entities.js +5 -3
- package/lib/esm/blue/errors.d.ts +4 -2
- package/lib/esm/blue/errors.js +4 -2
- package/lib/esm/blue/fetch.d.ts +5 -3
- package/lib/esm/blue/fetch.js +5 -3
- package/lib/esm/blue/types.d.ts +2 -4
- package/lib/esm/blue/utils.d.ts +6 -4
- package/lib/esm/blue/utils.js +6 -4
- package/lib/esm/client/morphoViemExtension.d.ts +1 -1
- package/lib/esm/client/morphoViemExtension.js +1 -1
- package/lib/esm/constants.d.ts +3 -37
- package/lib/esm/constants.js +3 -37
- package/lib/esm/entities/blue/blue.d.ts +30 -265
- package/lib/esm/entities/blue/blue.js +4 -208
- package/lib/esm/entities/index.d.ts +11 -66
- package/lib/esm/entities/index.js +5 -18
- package/lib/esm/entities/requirements/getVaultBundlesSharesRequirements.d.ts +5 -2
- package/lib/esm/entities/requirements/getVaultBundlesSharesRequirements.js +8 -3
- package/lib/esm/entities/vaultV1/vaultV1.d.ts +13 -5
- package/lib/esm/entities/vaultV1/vaultV1.js +19 -13
- package/lib/esm/entities/vaultV2/vaultV2.d.ts +40 -19
- package/lib/esm/entities/vaultV2/vaultV2.js +61 -30
- package/lib/esm/entities/vaultV2BlueReallocationData.js +2 -19
- package/lib/esm/errors.d.ts +5 -47
- package/lib/esm/errors.js +5 -47
- package/lib/esm/fetch.d.ts +5 -17
- package/lib/esm/fetch.js +5 -17
- package/lib/esm/helpers/constant.d.ts +0 -2
- package/lib/esm/helpers/constant.js +0 -2
- package/lib/esm/helpers/index.d.ts +2 -3
- package/lib/esm/helpers/index.js +2 -3
- package/lib/esm/helpers/previewVaultV2ForceWithdraw.js +11 -5
- package/lib/esm/helpers/slippage.d.ts +1 -103
- package/lib/esm/helpers/slippage.js +1 -147
- package/lib/esm/helpers/utilization.d.ts +12 -10
- package/lib/esm/helpers/utilization.js +26 -11
- package/lib/esm/helpers/validate.d.ts +1 -24
- package/lib/esm/helpers/validate.js +2 -48
- package/lib/esm/helpers/validateRequirementSpender.d.ts +1 -1
- package/lib/esm/helpers/validateRequirementSpender.js +1 -3
- package/lib/esm/helpers/vaultV2ForceWithdrawPlan.d.ts +48 -15
- package/lib/esm/helpers/vaultV2ForceWithdrawPlan.js +48 -15
- package/lib/esm/midnight/errors.d.ts +1 -1
- package/lib/esm/midnight/errors.js +1 -1
- package/lib/esm/types/action.d.ts +17 -65
- package/lib/esm/types/action.js +12 -5
- package/lib/esm/types/error.d.ts +50 -381
- package/lib/esm/types/error.js +58 -377
- package/lib/esm/types/sharedLiquidity.d.ts +1 -117
- package/lib/esm/types.d.ts +2 -18
- package/lib/esm/utils.d.ts +10 -35
- package/lib/esm/utils.js +9 -34
- package/package.json +6 -17
- package/lib/cjs/actions/requirements/encode/encodeErc20Permit2Approve.d.ts +0 -44
- package/lib/cjs/actions/requirements/encode/encodeErc20Permit2Approve.js +0 -88
- package/lib/cjs/actions/requirements/generalAdapter/getGeneralAdapterRequirements.d.ts +0 -88
- package/lib/cjs/actions/requirements/generalAdapter/getGeneralAdapterRequirements.js +0 -152
- package/lib/cjs/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit.d.ts +0 -40
- package/lib/cjs/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit.js +0 -53
- package/lib/cjs/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit2.d.ts +0 -57
- package/lib/cjs/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit2.js +0 -74
- package/lib/cjs/actions/requirements/generalAdapter/index.d.ts +0 -3
- package/lib/cjs/actions/requirements/generalAdapter/index.js +0 -19
- package/lib/cjs/actions/signatures/getBlueAuthorizationAction.d.ts +0 -29
- package/lib/cjs/actions/signatures/getBlueAuthorizationAction.js +0 -48
- package/lib/cjs/actions/signatures/getTokenRequirementActions.d.ts +0 -58
- package/lib/cjs/actions/signatures/getTokenRequirementActions.js +0 -119
- package/lib/cjs/actions/signatures/getVaultExitBundlesV1PermitStruct.d.ts +0 -50
- package/lib/cjs/actions/signatures/getVaultExitBundlesV1PermitStruct.js +0 -45
- package/lib/cjs/actions/signatures/index.d.ts +0 -3
- package/lib/cjs/actions/signatures/index.js +0 -19
- package/lib/cjs/augment/VaultMarketPublicAllocatorConfig.d.ts +0 -11
- package/lib/cjs/augment/VaultMarketPublicAllocatorConfig.js +0 -8
- package/lib/cjs/bundler/actions.d.ts +0 -797
- package/lib/cjs/bundler/actions.js +0 -1371
- package/lib/cjs/bundler/index.d.ts +0 -2
- package/lib/cjs/bundler/index.js +0 -18
- package/lib/cjs/bundler/types.d.ts +0 -235
- package/lib/cjs/bundler/types.js +0 -2
- package/lib/cjs/entities/vaultV1ReallocationData.d.ts +0 -332
- package/lib/cjs/entities/vaultV1ReallocationData.js +0 -557
- package/lib/cjs/helpers/computeVaultV1Reallocations.d.ts +0 -80
- package/lib/cjs/helpers/computeVaultV1Reallocations.js +0 -245
- package/lib/esm/actions/requirements/encode/encodeErc20Permit2Approve.d.ts +0 -44
- package/lib/esm/actions/requirements/encode/encodeErc20Permit2Approve.js +0 -84
- package/lib/esm/actions/requirements/generalAdapter/getGeneralAdapterRequirements.d.ts +0 -88
- package/lib/esm/actions/requirements/generalAdapter/getGeneralAdapterRequirements.js +0 -148
- package/lib/esm/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit.d.ts +0 -40
- package/lib/esm/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit.js +0 -49
- package/lib/esm/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit2.d.ts +0 -57
- package/lib/esm/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit2.js +0 -70
- package/lib/esm/actions/requirements/generalAdapter/index.d.ts +0 -3
- package/lib/esm/actions/requirements/generalAdapter/index.js +0 -3
- package/lib/esm/actions/signatures/getBlueAuthorizationAction.d.ts +0 -29
- package/lib/esm/actions/signatures/getBlueAuthorizationAction.js +0 -44
- package/lib/esm/actions/signatures/getTokenRequirementActions.d.ts +0 -58
- package/lib/esm/actions/signatures/getTokenRequirementActions.js +0 -115
- package/lib/esm/actions/signatures/getVaultExitBundlesV1PermitStruct.d.ts +0 -50
- package/lib/esm/actions/signatures/getVaultExitBundlesV1PermitStruct.js +0 -41
- package/lib/esm/actions/signatures/index.d.ts +0 -3
- package/lib/esm/actions/signatures/index.js +0 -3
- package/lib/esm/augment/VaultMarketPublicAllocatorConfig.d.ts +0 -11
- package/lib/esm/augment/VaultMarketPublicAllocatorConfig.js +0 -7
- package/lib/esm/bundler/actions.d.ts +0 -797
- package/lib/esm/bundler/actions.js +0 -1368
- package/lib/esm/bundler/index.d.ts +0 -2
- package/lib/esm/bundler/index.js +0 -2
- package/lib/esm/bundler/types.d.ts +0 -235
- package/lib/esm/bundler/types.js +0 -1
- package/lib/esm/entities/vaultV1ReallocationData.d.ts +0 -332
- package/lib/esm/entities/vaultV1ReallocationData.js +0 -559
- package/lib/esm/helpers/computeVaultV1Reallocations.d.ts +0 -80
- package/lib/esm/helpers/computeVaultV1Reallocations.js +0 -241
|
@@ -37,8 +37,8 @@ export interface VaultV2Actions {
|
|
|
37
37
|
* two hours from handle creation.
|
|
38
38
|
* @returns Lazy token prerequisite resolution and a synchronous deep-frozen VaultBundlesV1
|
|
39
39
|
* transaction builder.
|
|
40
|
-
* @throws {UnsupportedBlueMarketIrmError} when required interest projection encounters an unsupported IRM.
|
|
41
40
|
* @throws {ChainIdMismatchError} when the connected client targets another chain.
|
|
41
|
+
* @throws {UnsupportedBlueMarketIrmError} when an underlying market with positive debt uses an unsupported IRM.
|
|
42
42
|
* @throws {VaultAddressMismatchError} when `vaultData` belongs to another vault.
|
|
43
43
|
* @throws {ExpiredDeadlineError} when the deadline is stale at creation or requirement resolution.
|
|
44
44
|
* @throws {MixedBundlesFundingError} when ERC-20 and native funding are both supplied.
|
|
@@ -115,9 +115,10 @@ export interface VaultV2Actions {
|
|
|
115
115
|
* defaults to two hours from handle creation.
|
|
116
116
|
* @returns A frozen handle with lazy `getRequirements()` and synchronous `buildTx(signatures?)`,
|
|
117
117
|
* which returns a deep-frozen `Transaction<VaultV2WithdrawAction>`. Requirements are empty
|
|
118
|
-
* when the allowance equals the cap;
|
|
119
|
-
*
|
|
120
|
-
*
|
|
118
|
+
* when the allowance equals the cap; an oversized allowance is always reset with an exact
|
|
119
|
+
* onchain approval, and an insufficient one is raised by an approval or, with signature
|
|
120
|
+
* support, an ERC-2612 request. The cap stays pinned to the first resolution while each call
|
|
121
|
+
* re-reads the allowance. Confirm the approval or pass its signed permit to `buildTx`.
|
|
121
122
|
* @throws {ChainIdMismatchError} when the connected client targets another chain.
|
|
122
123
|
* @throws {NonPositiveInputError} when `amount` or the computed share cap is not positive.
|
|
123
124
|
* @throws {ExpiredDeadlineError} when `deadline` is not in the future at handle creation or
|
|
@@ -233,6 +234,10 @@ export interface VaultV2Actions {
|
|
|
233
234
|
* Idle balance, penalty, and adapter positions can drift after the snapshot, so an on-chain
|
|
234
235
|
* under-coverage panic remains possible if vault state changes between preparation and inclusion.
|
|
235
236
|
*
|
|
237
|
+
* In-kind exits require an exact vault-share allowance for the computed cap. An ERC-2612 permit
|
|
238
|
+
* is emitted only to raise an insufficient allowance; an oversized allowance is always reset
|
|
239
|
+
* with an onchain approval before the exit.
|
|
240
|
+
*
|
|
236
241
|
* @param params - In-kind redemption parameters.
|
|
237
242
|
* @param params.amount - Penalty-inclusive, asset-denominated amount to exit.
|
|
238
243
|
* @param params.marketParamsList - Ordered adapter markets consumed greedily after idle assets;
|
|
@@ -262,7 +267,9 @@ export interface VaultV2Actions {
|
|
|
262
267
|
* @throws {InsufficientBlueBalanceForInKindRedeemError} from `getRequirements()` when Blue cannot fund the largest callback.
|
|
263
268
|
* @throws {AmbiguousRequirementSignaturesError} from `buildTx()` when more than one permit signature is supplied.
|
|
264
269
|
* @throws {UnexpectedRequirementSignatureError} from `buildTx()` when a non-permit signature is supplied.
|
|
265
|
-
* @throws {
|
|
270
|
+
* @throws {BundlesPermitMismatchError} from `buildTx()` when the supplied permit is not ERC-2612, has
|
|
271
|
+
* the wrong asset, owner, or signature encoding, or names another spender, amount, or deadline
|
|
272
|
+
* than the prepared cap.
|
|
266
273
|
* @example
|
|
267
274
|
* ```ts
|
|
268
275
|
* import { isRequirementSignature } from "@morpho-org/morpho-sdk";
|
|
@@ -313,26 +320,36 @@ export interface VaultV2Actions {
|
|
|
313
320
|
* adapter or none at all. Call `getRequirements()` before `buildTx()` so the vault-share allowance
|
|
314
321
|
* and permit nonce are read on-chain.
|
|
315
322
|
*
|
|
316
|
-
*
|
|
317
|
-
*
|
|
318
|
-
*
|
|
319
|
-
*
|
|
323
|
+
* The SDK derives a conservative lower bound on the realized exit share price from the snapshot
|
|
324
|
+
* and `slippageTolerance`: the floor is priced off whichever of the raw snapshot or its accrual
|
|
325
|
+
* to `now` burns more shares, so neither pending fee mints nor interest the chain has not yet
|
|
326
|
+
* accrued can lift it above the realized price. A supplied `minSharePriceE27` replaces the
|
|
327
|
+
* tolerance-derived bound (it may be tighter or looser) but must be at least the floor derived
|
|
328
|
+
* at `MAX_SLIPPAGE_TOLERANCE`, so an override can never disable meaningful protection.
|
|
329
|
+
* The bound rejects a share price drop, a penalty increase, and liquidity shifting from the
|
|
330
|
+
* penalty-free leg to the penalised leg. It does **not** cover the referral fee, which the
|
|
331
|
+
* contract deducts afterwards.
|
|
320
332
|
*
|
|
321
333
|
* Vault gates are enforced by the final transaction and are not preflighted: the receive-assets
|
|
322
334
|
* gate must allow VaultExitBundlesV1 and may depend on its transient initiator, while a
|
|
323
335
|
* send-shares gate is arbitrary code re-evaluated after each penalty burn. The SDK also does not
|
|
324
336
|
* validate the user's share balance. Per-market penalties and each vault withdrawal round the
|
|
325
337
|
* share burn up independently, so the exit can burn marginally more shares than `exitAssets` alone
|
|
326
|
-
* implies; size `exitAssets` a small buffer below `vault.previewRedeem(sharesHeld)`
|
|
327
|
-
*
|
|
328
|
-
*
|
|
338
|
+
* implies; size `exitAssets` a small buffer below `vault.previewRedeem(sharesHeld)` so a
|
|
339
|
+
* full-balance exit does not revert for insufficient shares. The approved share allowance this
|
|
340
|
+
* handle returns covers a burn at least one `slippageTolerance` step below the price floor
|
|
341
|
+
* whenever the floor exceeds one RAY unit and, in any case, at least one share above the burn
|
|
342
|
+
* at the floor, so a price within that headroom below the floor reverts on the contract's
|
|
343
|
+
* `minSharePriceE27` check rather than on the allowance; a deeper drop can still surface as an
|
|
344
|
+
* ERC-20 allowance underflow.
|
|
329
345
|
*
|
|
330
346
|
* Idle balance, penalty, adapter positions, and market liquidity can drift after the snapshot, so
|
|
331
347
|
* an on-chain revert remains possible if vault state changes between preparation and inclusion.
|
|
332
|
-
* A fee-recipient `userAddress` gets a floor from the
|
|
333
|
-
* and a guard against fee mints reaching the lower burn
|
|
334
|
-
* includes the projected fee shares through that same
|
|
335
|
-
* handle creation are rejected, so the guard and
|
|
348
|
+
* A fee-recipient `userAddress` gets a floor from the larger of the raw snapshot burn and the
|
|
349
|
+
* `now` burn net of its own fee mints, and a guard against fee mints reaching the lower burn
|
|
350
|
+
* bound by the deadline. Its allowance includes the projected fee shares through that same
|
|
351
|
+
* deadline. Deadlines beyond one year after handle creation are rejected, so the guard and
|
|
352
|
+
* allowance cover the whole accepted window.
|
|
336
353
|
*
|
|
337
354
|
* @param params - Force withdrawal parameters.
|
|
338
355
|
* @param params.exitAssets - Penalty-inclusive, asset-denominated amount to exit.
|
|
@@ -343,8 +360,10 @@ export interface VaultV2Actions {
|
|
|
343
360
|
* Deadlines more than one year after handle creation are rejected.
|
|
344
361
|
* @param params.slippageTolerance - Optional WAD-scaled tolerance applied to the derived share
|
|
345
362
|
* price bound. Defaults to `DEFAULT_SLIPPAGE_TOLERANCE`, capped at `MAX_SLIPPAGE_TOLERANCE`.
|
|
346
|
-
* @param params.minSharePriceE27 - Optional RAY-scaled override of the derived bound.
|
|
347
|
-
*
|
|
363
|
+
* @param params.minSharePriceE27 - Optional RAY-scaled override of the derived bound. It replaces
|
|
364
|
+
* the tolerance-derived bound and may be tighter or looser, but must be at least the floor
|
|
365
|
+
* derived at `MAX_SLIPPAGE_TOLERANCE`. When that floor rounds down to zero (dust exits) it is
|
|
366
|
+
* clamped to `1`, so any positive override is accepted.
|
|
348
367
|
* @param params.referralFeePct - Optional WAD-scaled share of the withdrawn assets routed to
|
|
349
368
|
* `referralFeeRecipient`. Defaults to `0n`.
|
|
350
369
|
* @param params.referralFeeRecipient - Optional referral fee recipient, required when
|
|
@@ -373,6 +392,8 @@ export interface VaultV2Actions {
|
|
|
373
392
|
* which would overrun the contract's unbounded loop.
|
|
374
393
|
* @throws {VaultV2ForceWithdrawZeroSharePriceError} when the derived share-price floor rounds down
|
|
375
394
|
* to zero, which the contract would read as no bound at all.
|
|
395
|
+
* @throws {VaultV2ForceWithdrawSharePriceBelowFloorError} when a supplied `minSharePriceE27`
|
|
396
|
+
* is below the floor derived at `MAX_SLIPPAGE_TOLERANCE`.
|
|
376
397
|
* @throws {VaultV2ForceWithdrawFeeSharesExceedBurnError} when fee shares are minted to a
|
|
377
398
|
* fee-recipient `userAddress` and reach the lower-bound share burn at the deadline.
|
|
378
399
|
* @throws {ReferralFeeRecipientMissingError} when a positive `referralFeePct` has no recipient.
|
|
@@ -384,7 +405,7 @@ export interface VaultV2Actions {
|
|
|
384
405
|
* @throws {BundlesPermitMismatchError} from `buildTx()` when the permit's spender, amount, or
|
|
385
406
|
* deadline differs from this operation. Any handle built from the same inputs accepts the
|
|
386
407
|
* permit; the nonce is verified onchain by the vault's `permit`.
|
|
387
|
-
* @throws {
|
|
408
|
+
* @throws {BundlesPermitMismatchError} from `buildTx()` when the requirement has the wrong permit kind, asset, or signature encoding.
|
|
388
409
|
* @example
|
|
389
410
|
* ```ts
|
|
390
411
|
* import { isRequirementSignature } from "@morpho-org/morpho-sdk";
|
|
@@ -33,7 +33,6 @@ class MorphoVaultV2 {
|
|
|
33
33
|
}
|
|
34
34
|
return (0, blue_sdk_viem_1.fetchAccrualVaultV2)(this.vault, this.client.viemClient, {
|
|
35
35
|
...parameters,
|
|
36
|
-
chainId: this.chainId,
|
|
37
36
|
deployless: this.client.options.supportDeployless,
|
|
38
37
|
});
|
|
39
38
|
}
|
|
@@ -191,9 +190,10 @@ class MorphoVaultV2 {
|
|
|
191
190
|
supportSignature: this.client.options.supportSignature,
|
|
192
191
|
});
|
|
193
192
|
const signatureRequirement = requirements.find(index_js_3.isRequirementSignature);
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
193
|
+
expectedRequirement =
|
|
194
|
+
signatureRequirement?.action.type === "permit"
|
|
195
|
+
? signatureRequirement.action
|
|
196
|
+
: undefined;
|
|
197
197
|
return requirements;
|
|
198
198
|
},
|
|
199
199
|
buildTx: (signatures) => {
|
|
@@ -369,8 +369,7 @@ class MorphoVaultV2 {
|
|
|
369
369
|
remaining -= chunk;
|
|
370
370
|
}
|
|
371
371
|
const vaultExitBundlesV1 = (0, morpho_ts_1.getChainAddress)(this.chainId, "bundles.vaultExitBundlesV1");
|
|
372
|
-
const
|
|
373
|
-
const blue = addresses.blue ?? addresses.morpho;
|
|
372
|
+
const blue = (0, morpho_ts_1.getChainAddress)(this.chainId, "blue");
|
|
374
373
|
return {
|
|
375
374
|
getRequirements: async () => {
|
|
376
375
|
const requirementsTimestamp = morpho_ts_1.Time.timestamp();
|
|
@@ -413,9 +412,14 @@ class MorphoVaultV2 {
|
|
|
413
412
|
required: peak,
|
|
414
413
|
});
|
|
415
414
|
}
|
|
416
|
-
|
|
415
|
+
// In-kind withdrawals carry no onchain share cap, so the allowance itself is the cap. A
|
|
416
|
+
// larger leftover allowance would let a share-price loss burn past `requiredShareAllowance`.
|
|
417
|
+
if (allowance === requiredShareAllowance)
|
|
417
418
|
return [];
|
|
418
|
-
|
|
419
|
+
// A lowering permit can be skipped after its nonce is consumed, so oversized allowances
|
|
420
|
+
// must be reset with an onchain approval.
|
|
421
|
+
if (allowance < requiredShareAllowance &&
|
|
422
|
+
this.client.options.supportSignature) {
|
|
419
423
|
return [
|
|
420
424
|
(0, index_js_1.encodeVaultSharesPermit)({
|
|
421
425
|
vault: vaultData,
|
|
@@ -439,8 +443,10 @@ class MorphoVaultV2 {
|
|
|
439
443
|
];
|
|
440
444
|
},
|
|
441
445
|
buildTx: (signatures) => {
|
|
442
|
-
const
|
|
443
|
-
|
|
446
|
+
const permit = (0, common_js_1.selectBundlesSharesPermitSignature)(signatures, {
|
|
447
|
+
spender: vaultExitBundlesV1,
|
|
448
|
+
amount: requiredShareAllowance,
|
|
449
|
+
deadline,
|
|
444
450
|
});
|
|
445
451
|
return (0, index_js_1.vaultV2InKindRedeem)({
|
|
446
452
|
vault: { chainId: this.chainId, address: this.vault },
|
|
@@ -545,10 +551,19 @@ class MorphoVaultV2 {
|
|
|
545
551
|
}
|
|
546
552
|
const projectionTimestamp = deadline;
|
|
547
553
|
// VaultExitBundlesV1 measures shares as `sharesBefore - balanceAfter`; its first withdrawal
|
|
548
|
-
// accrues the vault before burning.
|
|
549
|
-
//
|
|
554
|
+
// accrues the vault before burning. The realized price sits between the raw snapshot price
|
|
555
|
+
// (pending fee mints not yet diluting it) and the `now` projection (interest the chain may not
|
|
556
|
+
// have accrued yet, e.g. when the wall clock runs ahead of the chain). Price the floor off the
|
|
557
|
+
// larger *net* burn of the two endpoints — the raw snapshot mints no fee shares, the `now`
|
|
558
|
+
// accrual mints `feeSharesNow` — so it never exceeds either, and use the projected deadline
|
|
559
|
+
// accrual for the fee-mint guard.
|
|
550
560
|
const { vault: nowVaultData } = vaultData.accrueInterest(blue_sdk_1.MathLib.max(now, vaultData.lastUpdate));
|
|
551
561
|
const { vault: projectedVaultData } = vaultData.accrueInterest(blue_sdk_1.MathLib.max(projectionTimestamp, vaultData.lastUpdate));
|
|
562
|
+
const sharesBurntRaw = (0, index_js_2.computeVaultV2ForceWithdrawSharesBurnt)({
|
|
563
|
+
vaultData,
|
|
564
|
+
deadlineVaultData: vaultData,
|
|
565
|
+
plan,
|
|
566
|
+
});
|
|
552
567
|
const sharesBurntNow = (0, index_js_2.computeVaultV2ForceWithdrawSharesBurnt)({
|
|
553
568
|
vaultData: nowVaultData,
|
|
554
569
|
deadlineVaultData: nowVaultData,
|
|
@@ -579,30 +594,46 @@ class MorphoVaultV2 {
|
|
|
579
594
|
});
|
|
580
595
|
}
|
|
581
596
|
// sharesBurntNow ≥ minSharesBurntNow ≥ minSharesBurntProjected > feeSharesProjected ≥ feeSharesNow
|
|
582
|
-
const
|
|
597
|
+
const sharesBurntForFloor = blue_sdk_1.MathLib.max(sharesBurntRaw, sharesBurntNow - feeSharesNow);
|
|
598
|
+
if (minSharePriceE27Override != null) {
|
|
599
|
+
// The maximum-slippage threshold only bounds the override; unlike the transaction floor it
|
|
600
|
+
// may round to zero, in which case every positive override is acceptable.
|
|
601
|
+
const minAllowedSharePriceE27 = (0, morpho_ts_1._try)(() => (0, index_js_2.computeMinForceWithdrawSharePrice)({
|
|
602
|
+
withdrawnAssets: plan.withdrawnAssets,
|
|
603
|
+
sharesBurnt: sharesBurntForFloor,
|
|
604
|
+
slippageTolerance: index_js_2.MAX_SLIPPAGE_TOLERANCE,
|
|
605
|
+
}), index_js_3.VaultV2ForceWithdrawZeroSharePriceError) ?? 1n;
|
|
606
|
+
if (minSharePriceE27Override < minAllowedSharePriceE27) {
|
|
607
|
+
throw new index_js_3.VaultV2ForceWithdrawSharePriceBelowFloorError({
|
|
608
|
+
minSharePriceE27: minSharePriceE27Override,
|
|
609
|
+
floorE27: minAllowedSharePriceE27,
|
|
610
|
+
});
|
|
611
|
+
}
|
|
612
|
+
}
|
|
583
613
|
const minSharePriceE27 = minSharePriceE27Override ??
|
|
584
614
|
(0, index_js_2.computeMinForceWithdrawSharePrice)({
|
|
585
615
|
withdrawnAssets: plan.withdrawnAssets,
|
|
586
|
-
sharesBurnt:
|
|
616
|
+
sharesBurnt: sharesBurntForFloor,
|
|
587
617
|
slippageTolerance,
|
|
588
618
|
});
|
|
589
619
|
// The floor is deliberately *not* capped at `MAX_ABSOLUTE_SHARE_PRICE` (100 assets/share):
|
|
590
620
|
// lowering a lower bound weakens it, so any vault whose share price grew past that would be left
|
|
591
621
|
// with no real protection. Its two sibling `computeMin*SharePrice` helpers cap nothing either —
|
|
592
622
|
// only the `computeMax*` ones do, where capping relaxes an upper bound and is safe.
|
|
593
|
-
//
|
|
594
|
-
// It still has to fit the ABI slot though. Defense-in-depth rather than a reachable input error:
|
|
595
|
-
// with `exitAssets` bounded above, the derived floor only exceeds `uint256` on a vault whose
|
|
596
|
-
// share price passed ~1e50 assets/share, which no fixture here can construct.
|
|
597
623
|
(0, validate_js_1.validateUint256Field)("minSharePriceE27", minSharePriceE27);
|
|
598
|
-
//
|
|
599
|
-
//
|
|
600
|
-
//
|
|
601
|
-
//
|
|
602
|
-
//
|
|
603
|
-
//
|
|
604
|
-
|
|
605
|
-
|
|
624
|
+
// The allowance is only a spend cap, never the price protection: the bundle checks
|
|
625
|
+
// `minSharePriceE27` after its last withdrawal, so an allowance sized exactly to the floor
|
|
626
|
+
// underflows `_spendAllowance` (panic 0x11) on a below-floor price before that check runs. Size
|
|
627
|
+
// it for a price at least one tolerance step below the floor so the miss surfaces as the
|
|
628
|
+
// bundle's own revert instead, and, in any case, for at least one share above the at-floor
|
|
629
|
+
// burn — a burn of `atFloor + 1` shares prices strictly below the floor since
|
|
630
|
+
// `atFloor >= exitAssets * RAY / floor`. The `minSharePriceE27 - 1` branch keeps the
|
|
631
|
+
// denominator strictly below the floor whenever the floor exceeds 1, so even
|
|
632
|
+
// `slippageTolerance: 0n` leaves price-space headroom; a deeper drop still exhausts the
|
|
633
|
+
// allowance first. Add the fee shares the first withdrawal mints since the burn measured
|
|
634
|
+
// on-chain includes them. Saturated at `maxUint256` as an ABI-slot guard.
|
|
635
|
+
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);
|
|
636
|
+
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);
|
|
606
637
|
const vaultExitBundlesV1 = (0, morpho_ts_1.getChainAddress)(this.chainId, "bundles.vaultExitBundlesV1");
|
|
607
638
|
return {
|
|
608
639
|
getRequirements: async () => {
|
|
@@ -5,6 +5,7 @@ const blue_sdk_1 = require("@morpho-org/blue-sdk");
|
|
|
5
5
|
const morpho_ts_1 = require("@morpho-org/morpho-ts");
|
|
6
6
|
const viem_1 = require("viem");
|
|
7
7
|
const constant_js_1 = require("../helpers/constant.js");
|
|
8
|
+
const utilization_js_1 = require("../helpers/utilization.js");
|
|
8
9
|
const index_js_1 = require("../types/index.js");
|
|
9
10
|
const MAX_SHARED_CAP_SEARCH_STEPS = 1024n;
|
|
10
11
|
/** Creates isolated transaction-scoped state for one simulation. @internal */
|
|
@@ -44,18 +45,6 @@ const getAdapterIds = (cache, adapter, market) => {
|
|
|
44
45
|
cache.set(key, ids);
|
|
45
46
|
return ids;
|
|
46
47
|
};
|
|
47
|
-
const resolveMaxWithdrawalUtilization = (value) => {
|
|
48
|
-
const utilization = value ?? constant_js_1.DEFAULT_WITHDRAWAL_TARGET_UTILIZATION;
|
|
49
|
-
if (utilization < 0n)
|
|
50
|
-
throw new index_js_1.NegativeInputError("maxWithdrawalUtilization", utilization);
|
|
51
|
-
if (utilization > blue_sdk_1.MathLib.WAD)
|
|
52
|
-
throw new index_js_1.InputExceedsMaxError({
|
|
53
|
-
field: "maxWithdrawalUtilization",
|
|
54
|
-
value: utilization,
|
|
55
|
-
max: blue_sdk_1.MathLib.WAD,
|
|
56
|
-
});
|
|
57
|
-
return utilization;
|
|
58
|
-
};
|
|
59
48
|
const resolveMaxPenalty = (value) => {
|
|
60
49
|
const penalty = value ?? constant_js_1.DEFAULT_MAX_REALLOCATION_PENALTY;
|
|
61
50
|
if (penalty < 0n)
|
|
@@ -75,16 +64,10 @@ const cloneAccrualVault = (vault, markets) => new blue_sdk_1.AccrualVault({
|
|
|
75
64
|
pendingTimelock: { ...vault.pendingTimelock },
|
|
76
65
|
pendingGuardian: { ...vault.pendingGuardian },
|
|
77
66
|
supplyQueue: [...vault.supplyQueue],
|
|
78
|
-
publicAllocatorConfig: vault.publicAllocatorConfig == null
|
|
79
|
-
? undefined
|
|
80
|
-
: { ...vault.publicAllocatorConfig },
|
|
81
67
|
}, [...vault.allocations.values()].map(({ config, position }) => ({
|
|
82
68
|
config: {
|
|
83
69
|
...config,
|
|
84
70
|
pendingCap: { ...config.pendingCap },
|
|
85
|
-
publicAllocatorConfig: config.publicAllocatorConfig == null
|
|
86
|
-
? undefined
|
|
87
|
-
: { ...config.publicAllocatorConfig },
|
|
88
71
|
},
|
|
89
72
|
position: clonePosition(position, markets),
|
|
90
73
|
})));
|
|
@@ -634,7 +617,7 @@ class VaultV2BlueReallocationData {
|
|
|
634
617
|
computeVaultV2BlueReallocations(marketId, options = {}) {
|
|
635
618
|
if (options.enabled === false)
|
|
636
619
|
return { reallocations: [], data: this };
|
|
637
|
-
const maxWithdrawalUtilization = resolveMaxWithdrawalUtilization(options.maxWithdrawalUtilization);
|
|
620
|
+
const maxWithdrawalUtilization = (0, utilization_js_1.resolveMaxWithdrawalUtilization)(options.maxWithdrawalUtilization);
|
|
638
621
|
const maxPenalty = resolveMaxPenalty(options.maxPenalty);
|
|
639
622
|
const resolvedOptions = { ...options, maxPenalty };
|
|
640
623
|
const operation = options.operation;
|
|
@@ -1025,7 +1008,7 @@ class VaultV2BlueReallocationData {
|
|
|
1025
1008
|
.computeVaultV2BlueReallocationsAtUtilizationInPlace({
|
|
1026
1009
|
context: createSimulationContext(),
|
|
1027
1010
|
marketId,
|
|
1028
|
-
maxWithdrawalUtilization: resolveMaxWithdrawalUtilization(options?.maxWithdrawalUtilization),
|
|
1011
|
+
maxWithdrawalUtilization: (0, utilization_js_1.resolveMaxWithdrawalUtilization)(options?.maxWithdrawalUtilization),
|
|
1029
1012
|
options: { ...options, maxPenalty },
|
|
1030
1013
|
})
|
|
1031
1014
|
.reallocations.reduce((total, { assets }) => total + assets, 0n);
|
|
@@ -1084,7 +1067,7 @@ class VaultV2BlueReallocationData {
|
|
|
1084
1067
|
.computeVaultV2BlueReallocationsAtUtilizationInPlace({
|
|
1085
1068
|
context: createSimulationContext(),
|
|
1086
1069
|
marketId,
|
|
1087
|
-
maxWithdrawalUtilization: resolveMaxWithdrawalUtilization(options?.maxWithdrawalUtilization),
|
|
1070
|
+
maxWithdrawalUtilization: (0, utilization_js_1.resolveMaxWithdrawalUtilization)(options?.maxWithdrawalUtilization),
|
|
1088
1071
|
options: {
|
|
1089
1072
|
...options,
|
|
1090
1073
|
timestamp,
|
package/lib/cjs/errors.d.ts
CHANGED
|
@@ -1,49 +1,7 @@
|
|
|
1
|
-
export { BlueErrors, IncompleteChainRegistryError, InvalidMarketParamsError as InvalidBlueMarketParamsError,
|
|
2
|
-
/** @deprecated
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
/** @deprecated Use UnknownBlueFactory or the raw protocol subpath. */
|
|
7
|
-
UnknownFactory, UnknownMarketAllocationError as UnknownBlueMarketAllocationError, UnknownMarketParamsError as UnknownBlueMarketParamsError,
|
|
8
|
-
/** @deprecated Use UnknownBlueMarketParamsError or the raw protocol subpath. */
|
|
9
|
-
UnknownMarketParamsError, UnknownOfFactory as UnknownBlueOfFactory,
|
|
10
|
-
/** @deprecated Use UnknownBlueOfFactory or the raw protocol subpath. */
|
|
11
|
-
UnknownOfFactory, UnknownTokenError as UnknownBlueTokenError,
|
|
12
|
-
/** @deprecated Use UnknownBlueTokenError or the raw protocol subpath. */
|
|
13
|
-
UnknownTokenError, UnknownTokenPriceError as UnknownBlueTokenPriceError,
|
|
14
|
-
/** @deprecated Use UnknownBlueTokenPriceError or the raw protocol subpath. */
|
|
15
|
-
UnknownTokenPriceError, UnknownVaultConfigError as UnknownBlueVaultConfigError,
|
|
16
|
-
/** @deprecated Use UnknownBlueVaultConfigError or the raw protocol subpath. */
|
|
17
|
-
UnknownVaultConfigError, UnsupportedChainIdError, UnsupportedMarketIrmError as UnsupportedBlueMarketIrmError, UnsupportedPreLiquidationParamsError as UnsupportedBluePreLiquidationParamsError,
|
|
18
|
-
/** @deprecated Use UnsupportedBluePreLiquidationParamsError or the raw protocol subpath. */
|
|
19
|
-
UnsupportedPreLiquidationParamsError, UnsupportedVaultV2AdapterError as UnsupportedBlueVaultV2AdapterError,
|
|
20
|
-
/** @deprecated Use UnsupportedBlueVaultV2AdapterError or the raw protocol subpath. */
|
|
21
|
-
UnsupportedVaultV2AdapterError, VaultV2Errors, } from "@morpho-org/blue-sdk";
|
|
22
|
-
export { getUnsupportedVaultV2Adapter as getBlueUnsupportedVaultV2Adapter, InvalidPermitDomainChainIdError, InvalidPermitDomainVerifyingContractError, isUnknownOfFactoryError as isBlueUnknownOfFactoryError, UnsupportedPermitDomainExtensionsError, } from "@morpho-org/blue-sdk-viem";
|
|
23
|
-
export { ChainIdMismatchError as MidnightChainIdMismatchError, InvalidEcrecoverSignatureVError as InvalidMidnightEcrecoverSignatureVError, InvalidMarketParameterError as InvalidMidnightMarketParameterError, InvalidMidnightApiResponseError, InvalidOfferGroupError as InvalidMidnightOfferGroupError,
|
|
24
|
-
/** @deprecated Use InvalidMidnightOfferGroupError or the raw protocol subpath. */
|
|
25
|
-
InvalidOfferGroupError, InvalidOfferParameterError as InvalidMidnightOfferParameterError,
|
|
26
|
-
/** @deprecated Use InvalidMidnightOfferParameterError or the raw protocol subpath. */
|
|
27
|
-
InvalidOfferParameterError, InvalidPositionAccrualStateError as InvalidMidnightPositionAccrualStateError,
|
|
28
|
-
/** @deprecated Use InvalidMidnightPositionAccrualStateError or the raw protocol subpath. */
|
|
29
|
-
InvalidPositionAccrualStateError, InvalidPositionAccrualTimestampError as InvalidMidnightPositionAccrualTimestampError,
|
|
30
|
-
/** @deprecated Use InvalidMidnightPositionAccrualTimestampError or the raw protocol subpath. */
|
|
31
|
-
InvalidPositionAccrualTimestampError, InvalidPositionLossFactorError as InvalidMidnightPositionLossFactorError,
|
|
32
|
-
/** @deprecated Use InvalidMidnightPositionLossFactorError or the raw protocol subpath. */
|
|
33
|
-
InvalidPositionLossFactorError, InvalidTickSpacingError as InvalidMidnightTickSpacingError,
|
|
34
|
-
/** @deprecated Use InvalidMidnightTickSpacingError or the raw protocol subpath. */
|
|
35
|
-
InvalidTickSpacingError, InvalidTreeError as InvalidMidnightTreeError,
|
|
36
|
-
/** @deprecated Use InvalidMidnightTreeError or the raw protocol subpath. */
|
|
37
|
-
InvalidTreeError, InvalidTreeHeightError as InvalidMidnightTreeHeightError,
|
|
38
|
-
/** @deprecated Use InvalidMidnightTreeHeightError or the raw protocol subpath. */
|
|
39
|
-
InvalidTreeHeightError, InvalidTypedDataSignatureError as InvalidMidnightTypedDataSignatureError, MidnightApiError, MidnightMempoolValidationError, PayloadDecodeError as MidnightPayloadDecodeError, PriceGreaterThanOneError as MidnightPriceGreaterThanOneError,
|
|
40
|
-
/** @deprecated Use MidnightPriceGreaterThanOneError or the raw protocol subpath. */
|
|
41
|
-
PriceGreaterThanOneError, SettlementFeeExceedsPriceError as MidnightSettlementFeeExceedsPriceError,
|
|
42
|
-
/** @deprecated Use MidnightSettlementFeeExceedsPriceError or the raw protocol subpath. */
|
|
43
|
-
SettlementFeeExceedsPriceError, TickOutOfRangeError as MidnightTickOutOfRangeError,
|
|
44
|
-
/** @deprecated Use MidnightTickOutOfRangeError or the raw protocol subpath. */
|
|
45
|
-
TickOutOfRangeError, UnknownCollateralIndexError as UnknownMidnightCollateralIndexError,
|
|
46
|
-
/** @deprecated Use UnknownMidnightCollateralIndexError or the raw protocol subpath. */
|
|
47
|
-
UnknownCollateralIndexError, } from "@morpho-org/midnight-sdk";
|
|
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,
|
|
2
|
+
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
|
3
|
+
UnsupportedPreLiquidationParamsError as UnsupportedBluePreLiquidationParamsError, UnsupportedVaultV2AdapterError as UnsupportedBlueVaultV2AdapterError, VaultV2Errors, } from "@morpho-org/blue-sdk";
|
|
4
|
+
export { getUnsupportedVaultV2Adapter as getBlueUnsupportedVaultV2Adapter, InvalidNumberError, InvalidPermitDomainChainIdError, InvalidPermitDomainVerifyingContractError, isUnknownOfFactoryError as isBlueUnknownOfFactoryError, 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, InvalidPositionAccrualStateError as InvalidMidnightPositionAccrualStateError, InvalidPositionAccrualTimestampError as InvalidMidnightPositionAccrualTimestampError, InvalidPositionLossFactorError as InvalidMidnightPositionLossFactorError, InvalidTickSpacingError as InvalidMidnightTickSpacingError, InvalidTreeError as InvalidMidnightTreeError, InvalidTreeHeightError as InvalidMidnightTreeHeightError, InvalidTypedDataSignatureError as InvalidMidnightTypedDataSignatureError, MidnightApiError, MidnightMempoolValidationError, PayloadDecodeError as MidnightPayloadDecodeError, PriceGreaterThanOneError as MidnightPriceGreaterThanOneError, SettlementFeeExceedsPriceError as MidnightSettlementFeeExceedsPriceError, TickOutOfRangeError as MidnightTickOutOfRangeError, UnknownCollateralIndexError as UnknownMidnightCollateralIndexError, } from "@morpho-org/midnight-sdk";
|
|
48
6
|
export type { ErrorClass } from "@morpho-org/morpho-ts";
|
|
49
7
|
export { _try, DivisionByZeroError, InvalidBitLengthError, NegativeValueError, RegistryValueAlreadyRegisteredError, } from "@morpho-org/morpho-ts";
|
package/lib/cjs/errors.js
CHANGED
|
@@ -1,47 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.RegistryValueAlreadyRegisteredError = exports.NegativeValueError = exports.InvalidBitLengthError = exports.DivisionByZeroError = exports._try = exports.UnknownCollateralIndexError = exports.UnknownMidnightCollateralIndexError = exports.TickOutOfRangeError = exports.MidnightTickOutOfRangeError = exports.SettlementFeeExceedsPriceError = exports.MidnightSettlementFeeExceedsPriceError = exports.PriceGreaterThanOneError = exports.MidnightPriceGreaterThanOneError = exports.MidnightPayloadDecodeError = exports.MidnightMempoolValidationError = exports.MidnightApiError = exports.InvalidMidnightTypedDataSignatureError = exports.InvalidTreeHeightError = exports.InvalidMidnightTreeHeightError = void 0;
|
|
3
|
+
exports.RegistryValueAlreadyRegisteredError = exports.NegativeValueError = exports.InvalidBitLengthError = exports.DivisionByZeroError = exports._try = exports.UnknownMidnightCollateralIndexError = exports.MidnightTickOutOfRangeError = exports.MidnightSettlementFeeExceedsPriceError = exports.MidnightPriceGreaterThanOneError = exports.MidnightPayloadDecodeError = exports.MidnightMempoolValidationError = exports.MidnightApiError = exports.InvalidMidnightTypedDataSignatureError = exports.InvalidMidnightTreeHeightError = exports.InvalidMidnightTreeError = exports.InvalidMidnightTickSpacingError = exports.InvalidMidnightPositionLossFactorError = exports.InvalidMidnightPositionAccrualTimestampError = exports.InvalidMidnightPositionAccrualStateError = exports.InvalidMidnightOfferParameterError = exports.InvalidMidnightOfferGroupError = exports.InvalidMidnightApiResponseError = exports.InvalidMidnightApiQuoteTargetError = exports.InvalidMidnightMarketParameterError = exports.InvalidMidnightEcrecoverSignatureVError = exports.MidnightChainIdMismatchError = exports.UnsupportedPermitDomainExtensionsError = 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.InvalidBlueMarketParamsError = exports.IncompleteChainRegistryError = exports.BlueErrors = void 0;
|
|
5
4
|
var blue_sdk_1 = require("@morpho-org/blue-sdk");
|
|
6
5
|
Object.defineProperty(exports, "BlueErrors", { enumerable: true, get: function () { return blue_sdk_1.BlueErrors; } });
|
|
7
6
|
Object.defineProperty(exports, "IncompleteChainRegistryError", { enumerable: true, get: function () { return blue_sdk_1.IncompleteChainRegistryError; } });
|
|
8
7
|
Object.defineProperty(exports, "InvalidBlueMarketParamsError", { enumerable: true, get: function () { return blue_sdk_1.InvalidMarketParamsError; } });
|
|
9
|
-
/** @deprecated Use InvalidBlueMarketParamsError or the raw protocol subpath. */
|
|
10
|
-
Object.defineProperty(exports, "InvalidMarketParamsError", { enumerable: true, get: function () { return blue_sdk_1.InvalidMarketParamsError; } });
|
|
11
8
|
Object.defineProperty(exports, "UnknownAddressError", { enumerable: true, get: function () { return blue_sdk_1.UnknownAddressError; } });
|
|
12
9
|
Object.defineProperty(exports, "UnknownBlueDataError", { enumerable: true, get: function () { return blue_sdk_1.UnknownDataError; } });
|
|
13
|
-
/** @deprecated Use UnknownBlueDataError or the raw protocol subpath. */
|
|
14
|
-
Object.defineProperty(exports, "UnknownDataError", { enumerable: true, get: function () { return blue_sdk_1.UnknownDataError; } });
|
|
15
10
|
Object.defineProperty(exports, "UnknownBlueFactory", { enumerable: true, get: function () { return blue_sdk_1.UnknownFactory; } });
|
|
16
|
-
/** @deprecated Use UnknownBlueFactory or the raw protocol subpath. */
|
|
17
|
-
Object.defineProperty(exports, "UnknownFactory", { enumerable: true, get: function () { return blue_sdk_1.UnknownFactory; } });
|
|
18
11
|
Object.defineProperty(exports, "UnknownBlueMarketAllocationError", { enumerable: true, get: function () { return blue_sdk_1.UnknownMarketAllocationError; } });
|
|
19
12
|
Object.defineProperty(exports, "UnknownBlueMarketParamsError", { enumerable: true, get: function () { return blue_sdk_1.UnknownMarketParamsError; } });
|
|
20
|
-
/** @deprecated Use UnknownBlueMarketParamsError or the raw protocol subpath. */
|
|
21
|
-
Object.defineProperty(exports, "UnknownMarketParamsError", { enumerable: true, get: function () { return blue_sdk_1.UnknownMarketParamsError; } });
|
|
22
13
|
Object.defineProperty(exports, "UnknownBlueOfFactory", { enumerable: true, get: function () { return blue_sdk_1.UnknownOfFactory; } });
|
|
23
|
-
/** @deprecated Use UnknownBlueOfFactory or the raw protocol subpath. */
|
|
24
|
-
Object.defineProperty(exports, "UnknownOfFactory", { enumerable: true, get: function () { return blue_sdk_1.UnknownOfFactory; } });
|
|
25
14
|
Object.defineProperty(exports, "UnknownBlueTokenError", { enumerable: true, get: function () { return blue_sdk_1.UnknownTokenError; } });
|
|
26
|
-
/** @deprecated Use UnknownBlueTokenError or the raw protocol subpath. */
|
|
27
|
-
Object.defineProperty(exports, "UnknownTokenError", { enumerable: true, get: function () { return blue_sdk_1.UnknownTokenError; } });
|
|
28
15
|
Object.defineProperty(exports, "UnknownBlueTokenPriceError", { enumerable: true, get: function () { return blue_sdk_1.UnknownTokenPriceError; } });
|
|
29
|
-
/** @deprecated Use UnknownBlueTokenPriceError or the raw protocol subpath. */
|
|
30
|
-
Object.defineProperty(exports, "UnknownTokenPriceError", { enumerable: true, get: function () { return blue_sdk_1.UnknownTokenPriceError; } });
|
|
31
16
|
Object.defineProperty(exports, "UnknownBlueVaultConfigError", { enumerable: true, get: function () { return blue_sdk_1.UnknownVaultConfigError; } });
|
|
32
|
-
/** @deprecated Use UnknownBlueVaultConfigError or the raw protocol subpath. */
|
|
33
|
-
Object.defineProperty(exports, "UnknownVaultConfigError", { enumerable: true, get: function () { return blue_sdk_1.UnknownVaultConfigError; } });
|
|
34
17
|
Object.defineProperty(exports, "UnsupportedChainIdError", { enumerable: true, get: function () { return blue_sdk_1.UnsupportedChainIdError; } });
|
|
35
18
|
Object.defineProperty(exports, "UnsupportedBlueMarketIrmError", { enumerable: true, get: function () { return blue_sdk_1.UnsupportedMarketIrmError; } });
|
|
19
|
+
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
|
36
20
|
Object.defineProperty(exports, "UnsupportedBluePreLiquidationParamsError", { enumerable: true, get: function () { return blue_sdk_1.UnsupportedPreLiquidationParamsError; } });
|
|
37
|
-
/** @deprecated Use UnsupportedBluePreLiquidationParamsError or the raw protocol subpath. */
|
|
38
|
-
Object.defineProperty(exports, "UnsupportedPreLiquidationParamsError", { enumerable: true, get: function () { return blue_sdk_1.UnsupportedPreLiquidationParamsError; } });
|
|
39
21
|
Object.defineProperty(exports, "UnsupportedBlueVaultV2AdapterError", { enumerable: true, get: function () { return blue_sdk_1.UnsupportedVaultV2AdapterError; } });
|
|
40
|
-
/** @deprecated Use UnsupportedBlueVaultV2AdapterError or the raw protocol subpath. */
|
|
41
|
-
Object.defineProperty(exports, "UnsupportedVaultV2AdapterError", { enumerable: true, get: function () { return blue_sdk_1.UnsupportedVaultV2AdapterError; } });
|
|
42
22
|
Object.defineProperty(exports, "VaultV2Errors", { enumerable: true, get: function () { return blue_sdk_1.VaultV2Errors; } });
|
|
43
23
|
var blue_sdk_viem_1 = require("@morpho-org/blue-sdk-viem");
|
|
44
24
|
Object.defineProperty(exports, "getBlueUnsupportedVaultV2Adapter", { enumerable: true, get: function () { return blue_sdk_viem_1.getUnsupportedVaultV2Adapter; } });
|
|
25
|
+
Object.defineProperty(exports, "InvalidNumberError", { enumerable: true, get: function () { return blue_sdk_viem_1.InvalidNumberError; } });
|
|
45
26
|
Object.defineProperty(exports, "InvalidPermitDomainChainIdError", { enumerable: true, get: function () { return blue_sdk_viem_1.InvalidPermitDomainChainIdError; } });
|
|
46
27
|
Object.defineProperty(exports, "InvalidPermitDomainVerifyingContractError", { enumerable: true, get: function () { return blue_sdk_viem_1.InvalidPermitDomainVerifyingContractError; } });
|
|
47
28
|
Object.defineProperty(exports, "isBlueUnknownOfFactoryError", { enumerable: true, get: function () { return blue_sdk_viem_1.isUnknownOfFactoryError; } });
|
|
@@ -50,47 +31,24 @@ var midnight_sdk_1 = require("@morpho-org/midnight-sdk");
|
|
|
50
31
|
Object.defineProperty(exports, "MidnightChainIdMismatchError", { enumerable: true, get: function () { return midnight_sdk_1.ChainIdMismatchError; } });
|
|
51
32
|
Object.defineProperty(exports, "InvalidMidnightEcrecoverSignatureVError", { enumerable: true, get: function () { return midnight_sdk_1.InvalidEcrecoverSignatureVError; } });
|
|
52
33
|
Object.defineProperty(exports, "InvalidMidnightMarketParameterError", { enumerable: true, get: function () { return midnight_sdk_1.InvalidMarketParameterError; } });
|
|
34
|
+
Object.defineProperty(exports, "InvalidMidnightApiQuoteTargetError", { enumerable: true, get: function () { return midnight_sdk_1.InvalidMidnightApiQuoteTargetError; } });
|
|
53
35
|
Object.defineProperty(exports, "InvalidMidnightApiResponseError", { enumerable: true, get: function () { return midnight_sdk_1.InvalidMidnightApiResponseError; } });
|
|
54
36
|
Object.defineProperty(exports, "InvalidMidnightOfferGroupError", { enumerable: true, get: function () { return midnight_sdk_1.InvalidOfferGroupError; } });
|
|
55
|
-
/** @deprecated Use InvalidMidnightOfferGroupError or the raw protocol subpath. */
|
|
56
|
-
Object.defineProperty(exports, "InvalidOfferGroupError", { enumerable: true, get: function () { return midnight_sdk_1.InvalidOfferGroupError; } });
|
|
57
37
|
Object.defineProperty(exports, "InvalidMidnightOfferParameterError", { enumerable: true, get: function () { return midnight_sdk_1.InvalidOfferParameterError; } });
|
|
58
|
-
/** @deprecated Use InvalidMidnightOfferParameterError or the raw protocol subpath. */
|
|
59
|
-
Object.defineProperty(exports, "InvalidOfferParameterError", { enumerable: true, get: function () { return midnight_sdk_1.InvalidOfferParameterError; } });
|
|
60
38
|
Object.defineProperty(exports, "InvalidMidnightPositionAccrualStateError", { enumerable: true, get: function () { return midnight_sdk_1.InvalidPositionAccrualStateError; } });
|
|
61
|
-
/** @deprecated Use InvalidMidnightPositionAccrualStateError or the raw protocol subpath. */
|
|
62
|
-
Object.defineProperty(exports, "InvalidPositionAccrualStateError", { enumerable: true, get: function () { return midnight_sdk_1.InvalidPositionAccrualStateError; } });
|
|
63
39
|
Object.defineProperty(exports, "InvalidMidnightPositionAccrualTimestampError", { enumerable: true, get: function () { return midnight_sdk_1.InvalidPositionAccrualTimestampError; } });
|
|
64
|
-
/** @deprecated Use InvalidMidnightPositionAccrualTimestampError or the raw protocol subpath. */
|
|
65
|
-
Object.defineProperty(exports, "InvalidPositionAccrualTimestampError", { enumerable: true, get: function () { return midnight_sdk_1.InvalidPositionAccrualTimestampError; } });
|
|
66
40
|
Object.defineProperty(exports, "InvalidMidnightPositionLossFactorError", { enumerable: true, get: function () { return midnight_sdk_1.InvalidPositionLossFactorError; } });
|
|
67
|
-
/** @deprecated Use InvalidMidnightPositionLossFactorError or the raw protocol subpath. */
|
|
68
|
-
Object.defineProperty(exports, "InvalidPositionLossFactorError", { enumerable: true, get: function () { return midnight_sdk_1.InvalidPositionLossFactorError; } });
|
|
69
41
|
Object.defineProperty(exports, "InvalidMidnightTickSpacingError", { enumerable: true, get: function () { return midnight_sdk_1.InvalidTickSpacingError; } });
|
|
70
|
-
/** @deprecated Use InvalidMidnightTickSpacingError or the raw protocol subpath. */
|
|
71
|
-
Object.defineProperty(exports, "InvalidTickSpacingError", { enumerable: true, get: function () { return midnight_sdk_1.InvalidTickSpacingError; } });
|
|
72
42
|
Object.defineProperty(exports, "InvalidMidnightTreeError", { enumerable: true, get: function () { return midnight_sdk_1.InvalidTreeError; } });
|
|
73
|
-
/** @deprecated Use InvalidMidnightTreeError or the raw protocol subpath. */
|
|
74
|
-
Object.defineProperty(exports, "InvalidTreeError", { enumerable: true, get: function () { return midnight_sdk_1.InvalidTreeError; } });
|
|
75
43
|
Object.defineProperty(exports, "InvalidMidnightTreeHeightError", { enumerable: true, get: function () { return midnight_sdk_1.InvalidTreeHeightError; } });
|
|
76
|
-
/** @deprecated Use InvalidMidnightTreeHeightError or the raw protocol subpath. */
|
|
77
|
-
Object.defineProperty(exports, "InvalidTreeHeightError", { enumerable: true, get: function () { return midnight_sdk_1.InvalidTreeHeightError; } });
|
|
78
44
|
Object.defineProperty(exports, "InvalidMidnightTypedDataSignatureError", { enumerable: true, get: function () { return midnight_sdk_1.InvalidTypedDataSignatureError; } });
|
|
79
45
|
Object.defineProperty(exports, "MidnightApiError", { enumerable: true, get: function () { return midnight_sdk_1.MidnightApiError; } });
|
|
80
46
|
Object.defineProperty(exports, "MidnightMempoolValidationError", { enumerable: true, get: function () { return midnight_sdk_1.MidnightMempoolValidationError; } });
|
|
81
47
|
Object.defineProperty(exports, "MidnightPayloadDecodeError", { enumerable: true, get: function () { return midnight_sdk_1.PayloadDecodeError; } });
|
|
82
48
|
Object.defineProperty(exports, "MidnightPriceGreaterThanOneError", { enumerable: true, get: function () { return midnight_sdk_1.PriceGreaterThanOneError; } });
|
|
83
|
-
/** @deprecated Use MidnightPriceGreaterThanOneError or the raw protocol subpath. */
|
|
84
|
-
Object.defineProperty(exports, "PriceGreaterThanOneError", { enumerable: true, get: function () { return midnight_sdk_1.PriceGreaterThanOneError; } });
|
|
85
49
|
Object.defineProperty(exports, "MidnightSettlementFeeExceedsPriceError", { enumerable: true, get: function () { return midnight_sdk_1.SettlementFeeExceedsPriceError; } });
|
|
86
|
-
/** @deprecated Use MidnightSettlementFeeExceedsPriceError or the raw protocol subpath. */
|
|
87
|
-
Object.defineProperty(exports, "SettlementFeeExceedsPriceError", { enumerable: true, get: function () { return midnight_sdk_1.SettlementFeeExceedsPriceError; } });
|
|
88
50
|
Object.defineProperty(exports, "MidnightTickOutOfRangeError", { enumerable: true, get: function () { return midnight_sdk_1.TickOutOfRangeError; } });
|
|
89
|
-
/** @deprecated Use MidnightTickOutOfRangeError or the raw protocol subpath. */
|
|
90
|
-
Object.defineProperty(exports, "TickOutOfRangeError", { enumerable: true, get: function () { return midnight_sdk_1.TickOutOfRangeError; } });
|
|
91
51
|
Object.defineProperty(exports, "UnknownMidnightCollateralIndexError", { enumerable: true, get: function () { return midnight_sdk_1.UnknownCollateralIndexError; } });
|
|
92
|
-
/** @deprecated Use UnknownMidnightCollateralIndexError or the raw protocol subpath. */
|
|
93
|
-
Object.defineProperty(exports, "UnknownCollateralIndexError", { enumerable: true, get: function () { return midnight_sdk_1.UnknownCollateralIndexError; } });
|
|
94
52
|
var morpho_ts_1 = require("@morpho-org/morpho-ts");
|
|
95
53
|
Object.defineProperty(exports, "_try", { enumerable: true, get: function () { return morpho_ts_1._try; } });
|
|
96
54
|
Object.defineProperty(exports, "DivisionByZeroError", { enumerable: true, get: function () { return morpho_ts_1.DivisionByZeroError; } });
|
package/lib/cjs/fetch.d.ts
CHANGED
|
@@ -1,18 +1,6 @@
|
|
|
1
|
-
export { fetchAccrualPosition as fetchBlueAccrualPosition,
|
|
2
|
-
/** @deprecated
|
|
3
|
-
|
|
4
|
-
/** @deprecated
|
|
5
|
-
|
|
6
|
-
/** @deprecated Use `fetchBlueMarketParams` or the raw `/blue/fetch` subpath. */
|
|
7
|
-
fetchMarketParams, fetchPosition as fetchBluePosition,
|
|
8
|
-
/** @deprecated Use `fetchBluePosition` or the raw `/blue/fetch` subpath. */
|
|
9
|
-
fetchPosition, fetchPreLiquidationParams as fetchBluePreLiquidationParams,
|
|
10
|
-
/** @deprecated Use `fetchBluePreLiquidationParams` or the raw `/blue/fetch` subpath. */
|
|
11
|
-
fetchPreLiquidationParams, fetchPreLiquidationPosition as fetchBluePreLiquidationPosition,
|
|
12
|
-
/** @deprecated Use `fetchBluePreLiquidationPosition` or the raw `/blue/fetch` subpath. */
|
|
13
|
-
fetchPreLiquidationPosition, fetchToken, fetchUser as fetchBlueUser,
|
|
14
|
-
/** @deprecated Use `fetchBlueUser` or the raw `/blue/fetch` subpath. */
|
|
15
|
-
fetchUser, fetchVault, fetchVaultConfig, fetchVaultMarketAllocation, fetchVaultMarketConfig,
|
|
16
|
-
/** @deprecated Vault V1 PublicAllocator support will be removed in the next major. Use `fetchVaultV2BlueMarketPublicAllocatorConfig`. */
|
|
17
|
-
fetchVaultMarketPublicAllocatorConfig, fetchVaultUser, fetchVaultV2, fetchVaultV2Adapter, fetchVaultV2BlueMarketPublicAllocatorConfig, fetchVaultV2BluePublicAllocatorConfig, fetchVaultV2BluePublicAllocatorData, fetchVaultV2MorphoMarketV1Adapter, fetchVaultV2MorphoMarketV1AdapterV2, fetchVaultV2MorphoVaultV1Adapter, } from "@morpho-org/blue-sdk-viem";
|
|
1
|
+
export { fetchAccrualPosition as fetchBlueAccrualPosition, fetchAccrualVault, fetchAccrualVaultV2, fetchAccrualVaultV2Adapter, fetchAccrualVaultV2MorphoMarketV1Adapter, fetchAccrualVaultV2MorphoMarketV1AdapterV2, fetchAccrualVaultV2MorphoVaultV1Adapter, fetchHolding, fetchMarket as fetchBlueMarket, fetchMarketParams as fetchBlueMarketParams, fetchPosition as fetchBluePosition,
|
|
2
|
+
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
|
3
|
+
fetchPreLiquidationParams as fetchBluePreLiquidationParams,
|
|
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";
|
|
18
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,10 +1,8 @@
|
|
|
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.
|
|
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;
|
|
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
|
-
/** @deprecated Use `fetchBlueAccrualPosition` or the raw `/blue/fetch` subpath. */
|
|
7
|
-
Object.defineProperty(exports, "fetchAccrualPosition", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchAccrualPosition; } });
|
|
8
6
|
Object.defineProperty(exports, "fetchAccrualVault", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchAccrualVault; } });
|
|
9
7
|
Object.defineProperty(exports, "fetchAccrualVaultV2", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchAccrualVaultV2; } });
|
|
10
8
|
Object.defineProperty(exports, "fetchAccrualVaultV2Adapter", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchAccrualVaultV2Adapter; } });
|
|
@@ -13,30 +11,18 @@ Object.defineProperty(exports, "fetchAccrualVaultV2MorphoMarketV1AdapterV2", { e
|
|
|
13
11
|
Object.defineProperty(exports, "fetchAccrualVaultV2MorphoVaultV1Adapter", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchAccrualVaultV2MorphoVaultV1Adapter; } });
|
|
14
12
|
Object.defineProperty(exports, "fetchHolding", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchHolding; } });
|
|
15
13
|
Object.defineProperty(exports, "fetchBlueMarket", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchMarket; } });
|
|
16
|
-
/** @deprecated Use `fetchBlueMarket` or the raw `/blue/fetch` subpath. */
|
|
17
|
-
Object.defineProperty(exports, "fetchMarket", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchMarket; } });
|
|
18
14
|
Object.defineProperty(exports, "fetchBlueMarketParams", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchMarketParams; } });
|
|
19
|
-
/** @deprecated Use `fetchBlueMarketParams` or the raw `/blue/fetch` subpath. */
|
|
20
|
-
Object.defineProperty(exports, "fetchMarketParams", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchMarketParams; } });
|
|
21
15
|
Object.defineProperty(exports, "fetchBluePosition", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchPosition; } });
|
|
22
|
-
/** @deprecated
|
|
23
|
-
Object.defineProperty(exports, "fetchPosition", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchPosition; } });
|
|
16
|
+
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
|
24
17
|
Object.defineProperty(exports, "fetchBluePreLiquidationParams", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchPreLiquidationParams; } });
|
|
25
|
-
/** @deprecated
|
|
26
|
-
Object.defineProperty(exports, "fetchPreLiquidationParams", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchPreLiquidationParams; } });
|
|
18
|
+
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
|
27
19
|
Object.defineProperty(exports, "fetchBluePreLiquidationPosition", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchPreLiquidationPosition; } });
|
|
28
|
-
/** @deprecated Use `fetchBluePreLiquidationPosition` or the raw `/blue/fetch` subpath. */
|
|
29
|
-
Object.defineProperty(exports, "fetchPreLiquidationPosition", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchPreLiquidationPosition; } });
|
|
30
20
|
Object.defineProperty(exports, "fetchToken", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchToken; } });
|
|
31
21
|
Object.defineProperty(exports, "fetchBlueUser", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchUser; } });
|
|
32
|
-
/** @deprecated Use `fetchBlueUser` or the raw `/blue/fetch` subpath. */
|
|
33
|
-
Object.defineProperty(exports, "fetchUser", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchUser; } });
|
|
34
22
|
Object.defineProperty(exports, "fetchVault", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchVault; } });
|
|
35
23
|
Object.defineProperty(exports, "fetchVaultConfig", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchVaultConfig; } });
|
|
36
24
|
Object.defineProperty(exports, "fetchVaultMarketAllocation", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchVaultMarketAllocation; } });
|
|
37
25
|
Object.defineProperty(exports, "fetchVaultMarketConfig", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchVaultMarketConfig; } });
|
|
38
|
-
/** @deprecated Vault V1 PublicAllocator support will be removed in the next major. Use `fetchVaultV2BlueMarketPublicAllocatorConfig`. */
|
|
39
|
-
Object.defineProperty(exports, "fetchVaultMarketPublicAllocatorConfig", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchVaultMarketPublicAllocatorConfig; } });
|
|
40
26
|
Object.defineProperty(exports, "fetchVaultUser", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchVaultUser; } });
|
|
41
27
|
Object.defineProperty(exports, "fetchVaultV2", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchVaultV2; } });
|
|
42
28
|
Object.defineProperty(exports, "fetchVaultV2Adapter", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchVaultV2Adapter; } });
|