@morpho-org/morpho-sdk 6.0.0-next.3 → 6.0.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-v5-to-v6.md +24 -16
- package/README.md +6 -4
- package/lib/cjs/abis.d.ts +5 -1
- package/lib/cjs/abis.js +2 -0
- package/lib/cjs/actions/bundles/common.d.ts +20 -25
- package/lib/cjs/actions/bundles/common.js +46 -85
- package/lib/cjs/actions/bundles/index.d.ts +1 -1
- package/lib/cjs/actions/bundles/resolveBundlesTokenRequirements.d.ts +6 -2
- package/lib/cjs/actions/bundles/resolveBundlesTokenRequirements.js +6 -2
- package/lib/cjs/actions/requirements/blue/getBlueAuthorizationRequirement.d.ts +1 -0
- package/lib/cjs/actions/requirements/blue/getBlueAuthorizationRequirement.js +1 -0
- package/lib/cjs/actions/requirements/encode/encodeBlueSignatureAuthorization.d.ts +11 -3
- package/lib/cjs/actions/requirements/encode/encodeBlueSignatureAuthorization.js +19 -1
- package/lib/cjs/actions/requirements/encode/encodeVaultSharesPermit.d.ts +4 -1
- package/lib/cjs/actions/requirements/encode/encodeVaultSharesPermit.js +12 -0
- package/lib/cjs/actions/vaultV1/inKindRedeem.d.ts +2 -1
- package/lib/cjs/actions/vaultV1/inKindRedeem.js +2 -1
- package/lib/cjs/actions/vaultV1/migrateToV2.d.ts +62 -17
- package/lib/cjs/actions/vaultV1/migrateToV2.js +48 -17
- package/lib/cjs/actions/vaultV1/redeem.d.ts +28 -1
- package/lib/cjs/actions/vaultV1/redeem.js +17 -1
- package/lib/cjs/actions/vaultV1/withdraw.d.ts +1 -1
- package/lib/cjs/actions/vaultV1/withdraw.js +1 -1
- package/lib/cjs/actions/vaultV2/forceWithdraw.d.ts +3 -2
- package/lib/cjs/actions/vaultV2/forceWithdraw.js +3 -2
- package/lib/cjs/actions/vaultV2/inKindRedeem.d.ts +2 -1
- package/lib/cjs/actions/vaultV2/inKindRedeem.js +2 -1
- package/lib/cjs/actions/vaultV2/redeem.d.ts +28 -1
- package/lib/cjs/actions/vaultV2/redeem.js +17 -1
- package/lib/cjs/actions/vaultV2/withdraw.d.ts +1 -1
- package/lib/cjs/actions/vaultV2/withdraw.js +1 -1
- package/lib/cjs/augment/AccrualPosition.d.ts +1 -0
- package/lib/cjs/blue/abis.d.ts +5 -1
- package/lib/cjs/blue/abis.js +2 -0
- package/lib/cjs/blue/entities.d.ts +10 -2
- package/lib/cjs/blue/entities.js +2 -0
- 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 -1
- package/lib/cjs/blue/fetch.js +2 -0
- package/lib/cjs/blue/utils.d.ts +5 -1
- package/lib/cjs/blue/utils.js +2 -0
- package/lib/cjs/entities/index.d.ts +10 -2
- package/lib/cjs/entities/index.js +2 -0
- 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 +31 -21
- package/lib/cjs/entities/vaultV1/vaultV1.js +50 -83
- package/lib/cjs/entities/vaultV2/vaultV2.d.ts +52 -35
- package/lib/cjs/entities/vaultV2/vaultV2.js +71 -81
- package/lib/cjs/errors.d.ts +5 -3
- package/lib/cjs/errors.js +4 -1
- package/lib/cjs/fetch.d.ts +5 -1
- package/lib/cjs/fetch.js +2 -0
- package/lib/cjs/helpers/previewVaultV2ForceWithdraw.js +11 -5
- 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 +1 -0
- package/lib/cjs/utils.d.ts +5 -1
- package/lib/cjs/utils.js +2 -0
- package/lib/esm/abis.d.ts +5 -1
- package/lib/esm/abis.js +5 -1
- package/lib/esm/actions/bundles/common.d.ts +20 -25
- package/lib/esm/actions/bundles/common.js +44 -82
- package/lib/esm/actions/bundles/index.d.ts +1 -1
- package/lib/esm/actions/bundles/resolveBundlesTokenRequirements.d.ts +6 -2
- package/lib/esm/actions/bundles/resolveBundlesTokenRequirements.js +6 -2
- package/lib/esm/actions/requirements/blue/getBlueAuthorizationRequirement.d.ts +1 -0
- package/lib/esm/actions/requirements/blue/getBlueAuthorizationRequirement.js +1 -0
- package/lib/esm/actions/requirements/encode/encodeBlueSignatureAuthorization.d.ts +11 -3
- package/lib/esm/actions/requirements/encode/encodeBlueSignatureAuthorization.js +21 -3
- package/lib/esm/actions/requirements/encode/encodeVaultSharesPermit.d.ts +4 -1
- package/lib/esm/actions/requirements/encode/encodeVaultSharesPermit.js +14 -2
- package/lib/esm/actions/vaultV1/inKindRedeem.d.ts +2 -1
- package/lib/esm/actions/vaultV1/inKindRedeem.js +2 -1
- package/lib/esm/actions/vaultV1/migrateToV2.d.ts +62 -17
- package/lib/esm/actions/vaultV1/migrateToV2.js +48 -17
- package/lib/esm/actions/vaultV1/redeem.d.ts +28 -1
- package/lib/esm/actions/vaultV1/redeem.js +17 -1
- package/lib/esm/actions/vaultV1/withdraw.d.ts +1 -1
- package/lib/esm/actions/vaultV1/withdraw.js +1 -1
- package/lib/esm/actions/vaultV2/forceWithdraw.d.ts +3 -2
- package/lib/esm/actions/vaultV2/forceWithdraw.js +3 -2
- package/lib/esm/actions/vaultV2/inKindRedeem.d.ts +2 -1
- package/lib/esm/actions/vaultV2/inKindRedeem.js +2 -1
- package/lib/esm/actions/vaultV2/redeem.d.ts +28 -1
- package/lib/esm/actions/vaultV2/redeem.js +17 -1
- package/lib/esm/actions/vaultV2/withdraw.d.ts +1 -1
- package/lib/esm/actions/vaultV2/withdraw.js +1 -1
- package/lib/esm/augment/AccrualPosition.d.ts +1 -0
- package/lib/esm/blue/abis.d.ts +5 -1
- package/lib/esm/blue/abis.js +5 -1
- package/lib/esm/blue/entities.d.ts +10 -2
- package/lib/esm/blue/entities.js +5 -1
- 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 -1
- package/lib/esm/blue/fetch.js +5 -1
- package/lib/esm/blue/utils.d.ts +5 -1
- package/lib/esm/blue/utils.js +5 -1
- package/lib/esm/entities/index.d.ts +10 -2
- package/lib/esm/entities/index.js +5 -1
- 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 +31 -21
- package/lib/esm/entities/vaultV1/vaultV1.js +52 -85
- package/lib/esm/entities/vaultV2/vaultV2.d.ts +52 -35
- package/lib/esm/entities/vaultV2/vaultV2.js +73 -83
- package/lib/esm/errors.d.ts +5 -3
- package/lib/esm/errors.js +5 -3
- package/lib/esm/fetch.d.ts +5 -1
- package/lib/esm/fetch.js +5 -1
- package/lib/esm/helpers/previewVaultV2ForceWithdraw.js +11 -5
- 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 +1 -0
- package/lib/esm/utils.d.ts +5 -1
- package/lib/esm/utils.js +5 -1
- package/package.json +6 -9
|
@@ -8,7 +8,7 @@ import { finalizeVaultBundlesV1Transaction, getBundlesReferralFeeAssets, getBund
|
|
|
8
8
|
* Encodes an exact-assets Vault V2 withdrawal through VaultBundlesV1.
|
|
9
9
|
*
|
|
10
10
|
* This low-level builder does not bind `permit.value` to a share cap; use
|
|
11
|
-
* `MorphoVaultV2.withdraw().buildTx()` to validate it against the cap from `
|
|
11
|
+
* `MorphoVaultV2.withdraw().buildTx()` to validate it against the share cap derived from the handle's `vaultData`.
|
|
12
12
|
*
|
|
13
13
|
* @param params.vault.chainId - Chain containing the vault and its registered VaultBundlesV1 contract.
|
|
14
14
|
* @param params.vault.address - Vault V2 whose shares are burned for the withdrawal.
|
|
@@ -3,6 +3,7 @@ import { fetchAccrualPosition, fetchPreLiquidationPosition } from "@morpho-org/b
|
|
|
3
3
|
declare module "@morpho-org/blue-sdk" {
|
|
4
4
|
namespace AccrualPosition {
|
|
5
5
|
let fetch: typeof fetchAccrualPosition;
|
|
6
|
+
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
|
6
7
|
let fetchPreLiquidation: typeof fetchPreLiquidationPosition;
|
|
7
8
|
}
|
|
8
9
|
}
|
package/lib/esm/blue/abis.d.ts
CHANGED
|
@@ -1,2 +1,6 @@
|
|
|
1
1
|
export { marketParamsAbi } from "@morpho-org/blue-sdk";
|
|
2
|
-
export { adaptiveCurveIrmAbi, blueAbi, blueOracleAbi, erc2612Abi, erc5267Abi, metaMorphoAbi, metaMorphoFactoryAbi, morphoMarketV1AdapterAbi, morphoMarketV1AdapterFactoryAbi, morphoMarketV1AdapterV2Abi, morphoMarketV1AdapterV2FactoryAbi, morphoVaultV1AdapterAbi, morphoVaultV1AdapterFactoryAbi, permissionedErc20WrapperAbi, permit2Abi,
|
|
2
|
+
export { adaptiveCurveIrmAbi, blueAbi, blueOracleAbi, erc2612Abi, erc5267Abi, metaMorphoAbi, metaMorphoFactoryAbi, morphoMarketV1AdapterAbi, morphoMarketV1AdapterFactoryAbi, morphoMarketV1AdapterV2Abi, morphoMarketV1AdapterV2FactoryAbi, morphoVaultV1AdapterAbi, morphoVaultV1AdapterFactoryAbi, permissionedErc20WrapperAbi, permit2Abi,
|
|
3
|
+
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
|
4
|
+
preLiquidationAbi,
|
|
5
|
+
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
|
6
|
+
preLiquidationFactoryAbi, vaultV2Abi, vaultV2BluePublicAllocatorAbi, vaultV2FactoryAbi, whitelistControllerAggregatorV2Abi, wrappedBackedTokenAbi, wstEthAbi, } from "@morpho-org/blue-sdk-viem";
|
package/lib/esm/blue/abis.js
CHANGED
|
@@ -1,2 +1,6 @@
|
|
|
1
1
|
export { marketParamsAbi } from "@morpho-org/blue-sdk";
|
|
2
|
-
export { adaptiveCurveIrmAbi, blueAbi, blueOracleAbi, erc2612Abi, erc5267Abi, metaMorphoAbi, metaMorphoFactoryAbi, morphoMarketV1AdapterAbi, morphoMarketV1AdapterFactoryAbi, morphoMarketV1AdapterV2Abi, morphoMarketV1AdapterV2FactoryAbi, morphoVaultV1AdapterAbi, morphoVaultV1AdapterFactoryAbi, permissionedErc20WrapperAbi, permit2Abi,
|
|
2
|
+
export { adaptiveCurveIrmAbi, blueAbi, blueOracleAbi, erc2612Abi, erc5267Abi, metaMorphoAbi, metaMorphoFactoryAbi, morphoMarketV1AdapterAbi, morphoMarketV1AdapterFactoryAbi, morphoMarketV1AdapterV2Abi, morphoMarketV1AdapterV2FactoryAbi, morphoVaultV1AdapterAbi, morphoVaultV1AdapterFactoryAbi, permissionedErc20WrapperAbi, permit2Abi,
|
|
3
|
+
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
|
4
|
+
preLiquidationAbi,
|
|
5
|
+
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
|
6
|
+
preLiquidationFactoryAbi, vaultV2Abi, vaultV2BluePublicAllocatorAbi, vaultV2FactoryAbi, whitelistControllerAggregatorV2Abi, wrappedBackedTokenAbi, wstEthAbi, } from "@morpho-org/blue-sdk-viem";
|
|
@@ -1,2 +1,10 @@
|
|
|
1
|
-
export type { IAccrualPosition, IAccrualVault, IAccrualVaultV2, IAccrualVaultV2Adapter, IAccrualVaultV2MorphoMarketV1Adapter, IAccrualVaultV2MorphoMarketV1AdapterV2, IAccrualVaultV2MorphoVaultV1Adapter, IAssetBalances, IEip5267Domain, IHolding, IMarket, IMarketParams, IPosition,
|
|
2
|
-
|
|
1
|
+
export type { IAccrualPosition, IAccrualVault, IAccrualVaultV2, IAccrualVaultV2Adapter, IAccrualVaultV2MorphoMarketV1Adapter, IAccrualVaultV2MorphoMarketV1AdapterV2, IAccrualVaultV2MorphoVaultV1Adapter, IAssetBalances, IEip5267Domain, IHolding, IMarket, IMarketParams, IPosition,
|
|
2
|
+
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
|
3
|
+
IPreLiquidationParams,
|
|
4
|
+
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
|
5
|
+
IPreLiquidationPosition, IToken, IVault, IVaultConfig, IVaultMarketAllocation, IVaultMarketConfig, IVaultToken, IVaultUser, IVaultV2, IVaultV2Adapter, IVaultV2Allocation, IVaultV2BlueMarketPublicAllocatorConfig, IVaultV2BluePublicAllocatorConfig, IVaultV2MorphoMarketV1Adapter, IVaultV2MorphoMarketV1AdapterV2, IVaultV2MorphoVaultV1Adapter, PeripheralBalance, PeripheralBalanceType, } from "@morpho-org/blue-sdk";
|
|
6
|
+
export { AccrualPosition, AccrualVault, AccrualVaultV2, AccrualVaultV2MorphoMarketV1Adapter, AccrualVaultV2MorphoMarketV1AdapterV2, AccrualVaultV2MorphoVaultV1Adapter, AssetBalances, ConstantWrappedToken, Eip5267Domain, ExchangeRateWrappedToken, Holding, Market, MarketParams, Position,
|
|
7
|
+
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
|
8
|
+
PreLiquidationParams,
|
|
9
|
+
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
|
10
|
+
PreLiquidationPosition, Token, User, Vault, VaultConfig, VaultMarketAllocation, VaultMarketConfig, VaultToken, VaultUser, VaultV2, VaultV2Adapter, VaultV2BlueMarketPublicAllocatorConfig, VaultV2BluePublicAllocatorConfig, VaultV2MorphoMarketV1Adapter, VaultV2MorphoMarketV1AdapterV2, VaultV2MorphoVaultV1Adapter, WrappedToken, } from "@morpho-org/blue-sdk";
|
package/lib/esm/blue/entities.js
CHANGED
|
@@ -1 +1,5 @@
|
|
|
1
|
-
export { AccrualPosition, AccrualVault, AccrualVaultV2, AccrualVaultV2MorphoMarketV1Adapter, AccrualVaultV2MorphoMarketV1AdapterV2, AccrualVaultV2MorphoVaultV1Adapter, AssetBalances, ConstantWrappedToken, Eip5267Domain, ExchangeRateWrappedToken, Holding, Market, MarketParams, Position,
|
|
1
|
+
export { AccrualPosition, AccrualVault, AccrualVaultV2, AccrualVaultV2MorphoMarketV1Adapter, AccrualVaultV2MorphoMarketV1AdapterV2, AccrualVaultV2MorphoVaultV1Adapter, AssetBalances, ConstantWrappedToken, Eip5267Domain, ExchangeRateWrappedToken, Holding, Market, MarketParams, Position,
|
|
2
|
+
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
|
3
|
+
PreLiquidationParams,
|
|
4
|
+
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
|
5
|
+
PreLiquidationPosition, Token, User, Vault, VaultConfig, VaultMarketAllocation, VaultMarketConfig, VaultToken, VaultUser, VaultV2, VaultV2Adapter, VaultV2BlueMarketPublicAllocatorConfig, VaultV2BluePublicAllocatorConfig, VaultV2MorphoMarketV1Adapter, VaultV2MorphoMarketV1AdapterV2, VaultV2MorphoVaultV1Adapter, WrappedToken, } from "@morpho-org/blue-sdk";
|
package/lib/esm/blue/errors.d.ts
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
export { BlueErrors, DivisionByZeroError, IncompleteChainRegistryError, InvalidBitLengthError, InvalidMarketParamsError, RegistryValueAlreadyRegisteredError, UnknownAddressError, UnknownDataError, UnknownFactory, UnknownMarketAllocationError, UnknownMarketParamsError, UnknownOfFactory, UnknownTokenError, UnknownTokenPriceError, UnknownVaultConfigError, UnsupportedChainIdError, UnsupportedMarketIrmError,
|
|
2
|
-
|
|
1
|
+
export { BlueErrors, DivisionByZeroError, IncompleteChainRegistryError, InvalidBitLengthError, InvalidMarketParamsError, RegistryValueAlreadyRegisteredError, UnknownAddressError, UnknownDataError, UnknownFactory, UnknownMarketAllocationError, UnknownMarketParamsError, UnknownOfFactory, UnknownTokenError, UnknownTokenPriceError, UnknownVaultConfigError, UnsupportedChainIdError, UnsupportedMarketIrmError,
|
|
2
|
+
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
|
3
|
+
UnsupportedPreLiquidationParamsError, UnsupportedVaultV2AdapterError, VaultV2Errors, } from "@morpho-org/blue-sdk";
|
|
4
|
+
export { getUnsupportedVaultV2Adapter, InvalidNumberError, InvalidPermitDomainChainIdError, InvalidPermitDomainVerifyingContractError, isUnknownOfFactoryError, UnsupportedPermitDomainExtensionsError, } from "@morpho-org/blue-sdk-viem";
|
package/lib/esm/blue/errors.js
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
export { BlueErrors, DivisionByZeroError, IncompleteChainRegistryError, InvalidBitLengthError, InvalidMarketParamsError, RegistryValueAlreadyRegisteredError, UnknownAddressError, UnknownDataError, UnknownFactory, UnknownMarketAllocationError, UnknownMarketParamsError, UnknownOfFactory, UnknownTokenError, UnknownTokenPriceError, UnknownVaultConfigError, UnsupportedChainIdError, UnsupportedMarketIrmError,
|
|
2
|
-
|
|
1
|
+
export { BlueErrors, DivisionByZeroError, IncompleteChainRegistryError, InvalidBitLengthError, InvalidMarketParamsError, RegistryValueAlreadyRegisteredError, UnknownAddressError, UnknownDataError, UnknownFactory, UnknownMarketAllocationError, UnknownMarketParamsError, UnknownOfFactory, UnknownTokenError, UnknownTokenPriceError, UnknownVaultConfigError, UnsupportedChainIdError, UnsupportedMarketIrmError,
|
|
2
|
+
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
|
3
|
+
UnsupportedPreLiquidationParamsError, UnsupportedVaultV2AdapterError, VaultV2Errors, } from "@morpho-org/blue-sdk";
|
|
4
|
+
export { getUnsupportedVaultV2Adapter, InvalidNumberError, InvalidPermitDomainChainIdError, InvalidPermitDomainVerifyingContractError, isUnknownOfFactoryError, UnsupportedPermitDomainExtensionsError, } from "@morpho-org/blue-sdk-viem";
|
package/lib/esm/blue/fetch.d.ts
CHANGED
|
@@ -1 +1,5 @@
|
|
|
1
|
-
export { fetchAccrualPosition, fetchAccrualVault, fetchAccrualVaultV2, fetchAccrualVaultV2Adapter, fetchAccrualVaultV2MorphoMarketV1Adapter, fetchAccrualVaultV2MorphoMarketV1AdapterV2, fetchAccrualVaultV2MorphoVaultV1Adapter, fetchHolding, fetchMarket, fetchMarketParams, fetchPosition,
|
|
1
|
+
export { fetchAccrualPosition, fetchAccrualVault, fetchAccrualVaultV2, fetchAccrualVaultV2Adapter, fetchAccrualVaultV2MorphoMarketV1Adapter, fetchAccrualVaultV2MorphoMarketV1AdapterV2, fetchAccrualVaultV2MorphoVaultV1Adapter, fetchHolding, fetchMarket, fetchMarketParams, fetchPosition,
|
|
2
|
+
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
|
3
|
+
fetchPreLiquidationParams,
|
|
4
|
+
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
|
5
|
+
fetchPreLiquidationPosition, fetchToken, fetchUser, fetchVault, fetchVaultConfig, fetchVaultMarketAllocation, fetchVaultMarketConfig, fetchVaultUser, fetchVaultV2, fetchVaultV2Adapter, fetchVaultV2BlueMarketPublicAllocatorConfig, fetchVaultV2BluePublicAllocatorConfig, fetchVaultV2BluePublicAllocatorData, fetchVaultV2MorphoMarketV1Adapter, fetchVaultV2MorphoMarketV1AdapterV2, fetchVaultV2MorphoVaultV1Adapter, } from "@morpho-org/blue-sdk-viem";
|
package/lib/esm/blue/fetch.js
CHANGED
|
@@ -1 +1,5 @@
|
|
|
1
|
-
export { fetchAccrualPosition, fetchAccrualVault, fetchAccrualVaultV2, fetchAccrualVaultV2Adapter, fetchAccrualVaultV2MorphoMarketV1Adapter, fetchAccrualVaultV2MorphoMarketV1AdapterV2, fetchAccrualVaultV2MorphoVaultV1Adapter, fetchHolding, fetchMarket, fetchMarketParams, fetchPosition,
|
|
1
|
+
export { fetchAccrualPosition, fetchAccrualVault, fetchAccrualVaultV2, fetchAccrualVaultV2Adapter, fetchAccrualVaultV2MorphoMarketV1Adapter, fetchAccrualVaultV2MorphoMarketV1AdapterV2, fetchAccrualVaultV2MorphoVaultV1Adapter, fetchHolding, fetchMarket, fetchMarketParams, fetchPosition,
|
|
2
|
+
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
|
3
|
+
fetchPreLiquidationParams,
|
|
4
|
+
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
|
5
|
+
fetchPreLiquidationPosition, fetchToken, fetchUser, fetchVault, fetchVaultConfig, fetchVaultMarketAllocation, fetchVaultMarketConfig, fetchVaultUser, fetchVaultV2, fetchVaultV2Adapter, fetchVaultV2BlueMarketPublicAllocatorConfig, fetchVaultV2BluePublicAllocatorConfig, fetchVaultV2BluePublicAllocatorData, fetchVaultV2MorphoMarketV1Adapter, fetchVaultV2MorphoMarketV1AdapterV2, fetchVaultV2MorphoVaultV1Adapter, } from "@morpho-org/blue-sdk-viem";
|
package/lib/esm/blue/utils.d.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
export type { CapacityLimit, RoundingDirection } from "@morpho-org/blue-sdk";
|
|
2
|
-
export { AdaptiveCurveIrmLib, CapacityLimitReason,
|
|
2
|
+
export { AdaptiveCurveIrmLib, CapacityLimitReason,
|
|
3
|
+
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
|
4
|
+
defaultPreLiquidationParamsRegistry,
|
|
5
|
+
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
|
6
|
+
getDefaultPreLiquidationParams, MarketUtils, MathLib, SharesMath, VaultUtils, VaultV2BlueMarketPublicAllocatorConfigUtils, VaultV2BluePublicAllocatorConfigUtils, VaultV2Utils, } from "@morpho-org/blue-sdk";
|
|
3
7
|
export { decodeBytes32String, getAuthorizationTypedData, getPermit2PermitTypedData, getPermit2TransferFromTypedData, getPermitTypedData, MetaMorphoAction, optionalBoolean, readContractRestructured, restructure, safeGetAddress, safeParseNumber, safeParseUnits, } from "@morpho-org/blue-sdk-viem";
|
package/lib/esm/blue/utils.js
CHANGED
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
export { AdaptiveCurveIrmLib, CapacityLimitReason,
|
|
1
|
+
export { AdaptiveCurveIrmLib, CapacityLimitReason,
|
|
2
|
+
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
|
3
|
+
defaultPreLiquidationParamsRegistry,
|
|
4
|
+
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
|
5
|
+
getDefaultPreLiquidationParams, MarketUtils, MathLib, SharesMath, VaultUtils, VaultV2BlueMarketPublicAllocatorConfigUtils, VaultV2BluePublicAllocatorConfigUtils, VaultV2Utils, } from "@morpho-org/blue-sdk";
|
|
2
6
|
export { decodeBytes32String, getAuthorizationTypedData, getPermit2PermitTypedData, getPermit2TransferFromTypedData, getPermitTypedData, MetaMorphoAction, optionalBoolean, readContractRestructured, restructure, safeGetAddress, safeParseNumber, safeParseUnits, } from "@morpho-org/blue-sdk-viem";
|
|
@@ -1,5 +1,13 @@
|
|
|
1
|
-
export type { IAccrualPosition as IBlueAccrualPosition, IAccrualVault, IAccrualVaultV2, IAccrualVaultV2Adapter, IAccrualVaultV2MorphoMarketV1Adapter, IAccrualVaultV2MorphoMarketV1AdapterV2, IAccrualVaultV2MorphoVaultV1Adapter, IAssetBalances, IEip5267Domain, IHolding, IMarket as IBlueMarket, IMarketParams as IBlueMarketParams, IPosition as IBluePosition,
|
|
2
|
-
|
|
1
|
+
export type { IAccrualPosition as IBlueAccrualPosition, IAccrualVault, IAccrualVaultV2, IAccrualVaultV2Adapter, IAccrualVaultV2MorphoMarketV1Adapter, IAccrualVaultV2MorphoMarketV1AdapterV2, IAccrualVaultV2MorphoVaultV1Adapter, IAssetBalances, IEip5267Domain, IHolding, IMarket as IBlueMarket, IMarketParams as IBlueMarketParams, IPosition as IBluePosition,
|
|
2
|
+
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
|
3
|
+
IPreLiquidationParams as IBluePreLiquidationParams,
|
|
4
|
+
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
|
5
|
+
IPreLiquidationPosition as IBluePreLiquidationPosition, IToken, IVault, IVaultConfig, IVaultMarketAllocation, IVaultMarketConfig, IVaultToken, IVaultUser, IVaultV2, IVaultV2Adapter, IVaultV2Allocation, IVaultV2BlueMarketPublicAllocatorConfig, IVaultV2BluePublicAllocatorConfig, IVaultV2MorphoMarketV1Adapter, IVaultV2MorphoMarketV1AdapterV2, IVaultV2MorphoVaultV1Adapter, PeripheralBalance, PeripheralBalanceType, } from "@morpho-org/blue-sdk";
|
|
6
|
+
export { AccrualPosition as BlueAccrualPosition, AccrualVault, AccrualVaultV2, AccrualVaultV2MorphoMarketV1Adapter, AccrualVaultV2MorphoMarketV1AdapterV2, AccrualVaultV2MorphoVaultV1Adapter, AssetBalances, ConstantWrappedToken, Eip5267Domain, ExchangeRateWrappedToken, Holding, Market as BlueMarket, MarketParams as BlueMarketParams, Position as BluePosition,
|
|
7
|
+
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
|
8
|
+
PreLiquidationParams as BluePreLiquidationParams,
|
|
9
|
+
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
|
10
|
+
PreLiquidationPosition as BluePreLiquidationPosition, Token, User as BlueUser, Vault, VaultConfig, VaultMarketAllocation, VaultMarketConfig, VaultToken, VaultUser, VaultV2, VaultV2Adapter, VaultV2BlueMarketPublicAllocatorConfig, VaultV2BluePublicAllocatorConfig, VaultV2MorphoMarketV1Adapter, VaultV2MorphoMarketV1AdapterV2, VaultV2MorphoVaultV1Adapter, WrappedToken, } from "@morpho-org/blue-sdk";
|
|
3
11
|
export type { BuildOfferParams as MidnightBuildOfferParams, CollateralParams as MidnightCollateralParams, GroupInput as MidnightGroupInput, IAccrualPosition as IMidnightAccrualPosition, ICollateralParams as IMidnightCollateralParams, IGroup as IMidnightGroup, IMarket as IMidnightMarket, IMarketParams as IMidnightMarketParams, IOffer as IMidnightOffer, IPosition as IMidnightPosition, MarketInput as MidnightMarketInput, OfferStruct as MidnightOfferStruct, RatifierTreeInput as MidnightRatifierTreeInput, SettlementFeeCbps as MidnightSettlementFeeCbps, TreeCreateParams as MidnightTreeCreateParams, TreeDescriptor as MidnightTreeDescriptor, TreeInput as MidnightTreeInput, TreeLike as MidnightTreeLike, TreeMempoolValidateParams as MidnightTreeMempoolValidateParams, TreeMempoolValidateRatification as MidnightTreeMempoolValidateRatification, TreeProof as MidnightTreeProof, } from "@morpho-org/midnight-sdk";
|
|
4
12
|
export { AccrualPosition as MidnightAccrualPosition, Group as MidnightGroup, Market as MidnightMarket, MarketParams as MidnightMarketParams, Offer as MidnightOffer, Position as MidnightPosition, Tree as MidnightTree, } from "@morpho-org/midnight-sdk";
|
|
5
13
|
export type { BlueActions, BlueTokenRequirementsParams, } from "./blue/index.js";
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
export { AccrualPosition as BlueAccrualPosition, AccrualVault, AccrualVaultV2, AccrualVaultV2MorphoMarketV1Adapter, AccrualVaultV2MorphoMarketV1AdapterV2, AccrualVaultV2MorphoVaultV1Adapter, AssetBalances, ConstantWrappedToken, Eip5267Domain, ExchangeRateWrappedToken, Holding, Market as BlueMarket, MarketParams as BlueMarketParams, Position as BluePosition,
|
|
1
|
+
export { AccrualPosition as BlueAccrualPosition, AccrualVault, AccrualVaultV2, AccrualVaultV2MorphoMarketV1Adapter, AccrualVaultV2MorphoMarketV1AdapterV2, AccrualVaultV2MorphoVaultV1Adapter, AssetBalances, ConstantWrappedToken, Eip5267Domain, ExchangeRateWrappedToken, Holding, Market as BlueMarket, MarketParams as BlueMarketParams, Position as BluePosition,
|
|
2
|
+
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
|
3
|
+
PreLiquidationParams as BluePreLiquidationParams,
|
|
4
|
+
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
|
5
|
+
PreLiquidationPosition as BluePreLiquidationPosition, Token, User as BlueUser, Vault, VaultConfig, VaultMarketAllocation, VaultMarketConfig, VaultToken, VaultUser, VaultV2, VaultV2Adapter, VaultV2BlueMarketPublicAllocatorConfig, VaultV2BluePublicAllocatorConfig, VaultV2MorphoMarketV1Adapter, VaultV2MorphoMarketV1AdapterV2, VaultV2MorphoVaultV1Adapter, WrappedToken, } from "@morpho-org/blue-sdk";
|
|
2
6
|
export { AccrualPosition as MidnightAccrualPosition, Group as MidnightGroup, Market as MidnightMarket, MarketParams as MidnightMarketParams, Offer as MidnightOffer, Position as MidnightPosition, Tree as MidnightTree, } from "@morpho-org/midnight-sdk";
|
|
3
7
|
export { MorphoBlue } from "./blue/index.js";
|
|
4
8
|
export { MorphoMidnight, } from "./midnight/index.js";
|
|
@@ -6,14 +6,17 @@ import { type ActionRequirement } from "../../types/index.js";
|
|
|
6
6
|
*
|
|
7
7
|
* The exit burns however many shares the vault prices at execution time, so the share allowance is
|
|
8
8
|
* the only cap on that burn. A leftover allowance above `requiredShareAllowance` therefore does not
|
|
9
|
-
* satisfy the requirement: it is replaced by an approval
|
|
9
|
+
* satisfy the requirement: it is replaced by an onchain approval for exactly the computed cap. Only
|
|
10
|
+
* an insufficient allowance may be raised through an ERC-2612 permit, because VaultBundlesV1 skips a
|
|
11
|
+
* permit whose nonce was already consumed and the leftover allowance would then stay in force.
|
|
10
12
|
*
|
|
11
13
|
* @internal
|
|
12
14
|
*
|
|
13
15
|
* @param viemClient - Client used to read the current share allowance and permit nonce.
|
|
14
16
|
* @param params - Vault snapshot, owner, exact allowance, and deadline values.
|
|
15
17
|
* @returns No requirement when the allowance already equals `requiredShareAllowance`, otherwise one
|
|
16
|
-
*
|
|
18
|
+
* approval that sets it to exactly that cap, or one permit when the allowance is below the cap
|
|
19
|
+
* and signatures are supported.
|
|
17
20
|
* @throws {ExpiredDeadlineError} when the bundles deadline has elapsed.
|
|
18
21
|
* @throws {viem.BaseError} when an allowance or nonce read fails.
|
|
19
22
|
*/
|
|
@@ -10,14 +10,17 @@ import { ExpiredDeadlineError, } from "../../types/index.js";
|
|
|
10
10
|
*
|
|
11
11
|
* The exit burns however many shares the vault prices at execution time, so the share allowance is
|
|
12
12
|
* the only cap on that burn. A leftover allowance above `requiredShareAllowance` therefore does not
|
|
13
|
-
* satisfy the requirement: it is replaced by an approval
|
|
13
|
+
* satisfy the requirement: it is replaced by an onchain approval for exactly the computed cap. Only
|
|
14
|
+
* an insufficient allowance may be raised through an ERC-2612 permit, because VaultBundlesV1 skips a
|
|
15
|
+
* permit whose nonce was already consumed and the leftover allowance would then stay in force.
|
|
14
16
|
*
|
|
15
17
|
* @internal
|
|
16
18
|
*
|
|
17
19
|
* @param viemClient - Client used to read the current share allowance and permit nonce.
|
|
18
20
|
* @param params - Vault snapshot, owner, exact allowance, and deadline values.
|
|
19
21
|
* @returns No requirement when the allowance already equals `requiredShareAllowance`, otherwise one
|
|
20
|
-
*
|
|
22
|
+
* approval that sets it to exactly that cap, or one permit when the allowance is below the cap
|
|
23
|
+
* and signatures are supported.
|
|
21
24
|
* @throws {ExpiredDeadlineError} when the bundles deadline has elapsed.
|
|
22
25
|
* @throws {viem.BaseError} when an allowance or nonce read fails.
|
|
23
26
|
*/
|
|
@@ -39,7 +42,9 @@ export const getVaultBundlesSharesRequirements = async (viemClient, params) => {
|
|
|
39
42
|
// so only an exact match skips the approval or permit that resets it to the computed cap.
|
|
40
43
|
if (allowance === params.requiredShareAllowance)
|
|
41
44
|
return [];
|
|
42
|
-
|
|
45
|
+
// An oversized allowance is only ever lowered onchain: `TokenLib.submitPermit` skips a permit
|
|
46
|
+
// whose nonce was already consumed, which would silently leave the stale cap in force.
|
|
47
|
+
if (allowance < params.requiredShareAllowance && params.supportSignature) {
|
|
43
48
|
const nonce = await readContract(viemClient, {
|
|
44
49
|
address: params.vaultData.address,
|
|
45
50
|
abi: erc2612Abi,
|
|
@@ -9,6 +9,7 @@ export interface VaultV1Actions {
|
|
|
9
9
|
*
|
|
10
10
|
* @param {FetchParameters} [parameters] - Optional fetch parameters (block number, state overrides, etc.).
|
|
11
11
|
* @returns {Promise<Awaited<ReturnType<typeof fetchAccrualVault>>>} The requested vault state.
|
|
12
|
+
* @throws {ChainIdMismatchError} when the connected client targets another chain or has no chain.
|
|
12
13
|
*/
|
|
13
14
|
getData: (parameters?: FetchParameters) => Promise<Awaited<ReturnType<typeof fetchAccrualVault>>>;
|
|
14
15
|
/**
|
|
@@ -19,7 +20,7 @@ export interface VaultV1Actions {
|
|
|
19
20
|
* Permit2 nonce state. Native funding is exclusive and skips token requirements. Shares are
|
|
20
21
|
* always minted to the transaction sender, which must be `userAddress`.
|
|
21
22
|
* Concurrent requirement reads share the first caller's options; later calls refresh on-chain
|
|
22
|
-
* state using their own options.
|
|
23
|
+
* state using their own options.
|
|
23
24
|
*
|
|
24
25
|
* @param params.userAddress - Account that funds, signs, submits, and receives the vault shares.
|
|
25
26
|
* @param params.vaultData - Pre-fetched Vault V1 snapshot used for asset and share conversion.
|
|
@@ -55,8 +56,9 @@ export interface VaultV1Actions {
|
|
|
55
56
|
* `getRequirements()` when the Permit2 nonce exceeds uint256.
|
|
56
57
|
* @throws {AmbiguousRequirementSignaturesError} from `buildTx()` when multiple token signatures are supplied.
|
|
57
58
|
* @throws {UnexpectedRequirementSignatureError} from `buildTx()` when an unsupported signature is supplied.
|
|
58
|
-
* @throws {BundlesPermitMismatchError} from `buildTx()` when the signature
|
|
59
|
-
* this
|
|
59
|
+
* @throws {BundlesPermitMismatchError} from `buildTx()` when the signature's spender, amount or
|
|
60
|
+
* deadline differ from this operation's, or when the signature's carried action nonce is
|
|
61
|
+
* inconsistent with its signed nonce.
|
|
60
62
|
* @throws {DepositOwnerMismatchError} from `buildTx()` when the signed owner differs from `userAddress`.
|
|
61
63
|
* @throws {DepositAssetMismatchError} from `buildTx()` when the signed asset differs from the vault asset.
|
|
62
64
|
* @throws {BundlesRequirementSignatureMismatchError} from `buildTx()` when signature metadata is malformed.
|
|
@@ -95,13 +97,14 @@ export interface VaultV1Actions {
|
|
|
95
97
|
/**
|
|
96
98
|
* Prepares an exact-assets Vault V1 withdrawal through VaultBundlesV1.
|
|
97
99
|
*
|
|
98
|
-
*
|
|
99
|
-
* vault-share allowance and, when a signature is needed, the permit nonce on
|
|
100
|
-
* Captures the requested amount and owner at creation, so later
|
|
101
|
-
* change this handle's requirements or transaction.
|
|
100
|
+
* Derives the share-burn cap from the supplied `vaultData` snapshot at handle creation, then
|
|
101
|
+
* reads the live vault-share allowance and, when a signature is needed, the permit nonce on
|
|
102
|
+
* each `getRequirements()` call. Captures the requested amount and owner at creation, so later
|
|
103
|
+
* changes to `params` do not change this handle's requirements or transaction.
|
|
102
104
|
*
|
|
103
105
|
* @param params.amount - Positive gross withdrawal in underlying asset base units, before fees.
|
|
104
106
|
* @param params.userAddress - Share owner that must sign and submit; receives the net assets.
|
|
107
|
+
* @param params.vaultData - Pre-fetched Vault V1 snapshot used to derive the share cap.
|
|
105
108
|
* @param params.slippageTolerance - Optional WAD-scaled share-price loss tolerance applied to
|
|
106
109
|
* the share cap for MetaMorpho 1.0; MetaMorpho 1.1 retains its lost-assets clamp.
|
|
107
110
|
* Defaults to 0.03% and cannot exceed 10%.
|
|
@@ -112,9 +115,13 @@ export interface VaultV1Actions {
|
|
|
112
115
|
* defaults to two hours from handle creation.
|
|
113
116
|
* @returns A frozen handle with lazy `getRequirements()` and synchronous `buildTx(signatures?)`,
|
|
114
117
|
* which returns a deep-frozen `Transaction<VaultV1WithdrawAction>`. Requirements are empty
|
|
115
|
-
* when the allowance equals the cap;
|
|
116
|
-
*
|
|
117
|
-
*
|
|
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 is fixed at handle creation while each call re-reads
|
|
121
|
+
* the allowance. Confirm the approval or pass its signed permit to `buildTx`.
|
|
122
|
+
* @remarks VaultBundlesV1 skips a share permit whose nonce was already consumed and proceeds
|
|
123
|
+
* under the live allowance, so execute every requirement returned by the latest
|
|
124
|
+
* `getRequirements()` — including the oversized-allowance reset — before submitting.
|
|
118
125
|
* @throws {ChainIdMismatchError} when the connected client targets another chain.
|
|
119
126
|
* @throws {NonPositiveInputError} when `amount` or the computed share cap is not positive.
|
|
120
127
|
* @throws {ExpiredDeadlineError} when `deadline` is not in the future at handle creation or
|
|
@@ -124,14 +131,14 @@ export interface VaultV1Actions {
|
|
|
124
131
|
* @throws {ReferralFeePctExceededError} when `referralFeePct` is at least WAD.
|
|
125
132
|
* @throws {ReferralFeeRecipientMissingError} when a positive referral fee has no nonzero recipient.
|
|
126
133
|
* @throws {ExcessiveSlippageToleranceError} when `slippageTolerance` exceeds 10%.
|
|
134
|
+
* @throws {VaultAddressMismatchError} when `vaultData` belongs to another vault.
|
|
127
135
|
* @throws {UnsupportedChainIdError} when the chain is absent from the address registry.
|
|
128
136
|
* @throws {UnknownAddressError} when VaultBundlesV1 is not registered on the target chain.
|
|
129
137
|
* @throws {UnexpectedRequirementSignatureError} from `buildTx()` when an unsupported signature is supplied.
|
|
130
138
|
* @throws {AmbiguousRequirementSignaturesError} from `buildTx()` when multiple permits are supplied.
|
|
131
|
-
* @throws {BundlesPermitMismatchError} from `buildTx()` when the share permit is malformed
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
* @throws {viem.BaseError} when a vault, allowance, or nonce read or transaction encoding fails.
|
|
139
|
+
* @throws {BundlesPermitMismatchError} from `buildTx()` when the share permit is malformed or
|
|
140
|
+
* its spender, amount or deadline differ from this operation's.
|
|
141
|
+
* @throws {viem.BaseError} when an allowance or nonce read or transaction encoding fails.
|
|
135
142
|
* @example
|
|
136
143
|
* ```ts
|
|
137
144
|
* import { morphoViemExtension } from "@morpho-org/morpho-sdk";
|
|
@@ -143,7 +150,8 @@ export interface VaultV1Actions {
|
|
|
143
150
|
* const client = createPublicClient({ chain: mainnet, transport: http() })
|
|
144
151
|
* .extend(morphoViemExtension({ supportSignature: false }));
|
|
145
152
|
* const vault = client.morpho.vaultV1(vaultAddress, mainnet.id);
|
|
146
|
-
* const
|
|
153
|
+
* const vaultData = await vault.getData();
|
|
154
|
+
* const action = vault.withdraw({ amount: 1_000_000n, userAddress, vaultData });
|
|
147
155
|
* const requirements = await action.getRequirements();
|
|
148
156
|
* // Send and confirm each approval before calling action.buildTx().
|
|
149
157
|
* // action.buildTx() returns Readonly<Transaction<VaultV1WithdrawAction>>.
|
|
@@ -154,6 +162,7 @@ export interface VaultV1Actions {
|
|
|
154
162
|
withdraw: (params: {
|
|
155
163
|
readonly amount: bigint;
|
|
156
164
|
readonly userAddress: Address;
|
|
165
|
+
readonly vaultData: AccrualVault;
|
|
157
166
|
readonly slippageTolerance?: bigint;
|
|
158
167
|
readonly referralFeePct?: bigint;
|
|
159
168
|
readonly referralFeeRecipient?: Address;
|
|
@@ -165,7 +174,6 @@ export interface VaultV1Actions {
|
|
|
165
174
|
* Captures `shares` and `userAddress` at handle creation for both requirements and `buildTx()`.
|
|
166
175
|
* The caller must satisfy the exact vault-share allowance returned by `getRequirements()` before
|
|
167
176
|
* `buildTx()`; every requirement resolution re-reads the live allowance and checks the deadline.
|
|
168
|
-
* `buildTx()` accepts permits from the latest completed requirement resolution.
|
|
169
177
|
*
|
|
170
178
|
* @param params.shares - Exact vault shares to burn.
|
|
171
179
|
* @param params.userAddress - Account that signs and submits the transaction; VaultBundlesV1
|
|
@@ -179,6 +187,7 @@ export interface VaultV1Actions {
|
|
|
179
187
|
* @throws {ChainIdMismatchError} when the connected client targets another chain.
|
|
180
188
|
* @throws {NonPositiveInputError} when `shares` is not positive.
|
|
181
189
|
* @throws {ExpiredDeadlineError} when the deadline is stale at creation or requirement resolution.
|
|
190
|
+
* @throws {InputExceedsMaxError} when `shares` or `deadline` exceeds uint256.
|
|
182
191
|
* @throws {NegativeInputError} when `referralFeePct` is negative.
|
|
183
192
|
* @throws {ReferralFeePctExceededError} when `referralFeePct` is at least WAD.
|
|
184
193
|
* @throws {ReferralFeeRecipientMissingError} when a positive fee has no non-zero recipient.
|
|
@@ -187,8 +196,8 @@ export interface VaultV1Actions {
|
|
|
187
196
|
* @throws {viem.BaseError} from `getRequirements()` when an allowance or permit-nonce read fails.
|
|
188
197
|
* @throws {AmbiguousRequirementSignaturesError} from `buildTx()` when multiple permit signatures are supplied.
|
|
189
198
|
* @throws {UnexpectedRequirementSignatureError} from `buildTx()` when a non-permit signature is supplied.
|
|
190
|
-
* @throws {BundlesPermitMismatchError} from `buildTx()` when the
|
|
191
|
-
*
|
|
199
|
+
* @throws {BundlesPermitMismatchError} from `buildTx()` when the signature's spender, amount or
|
|
200
|
+
* deadline differ from this operation's.
|
|
192
201
|
* @example
|
|
193
202
|
* ```ts
|
|
194
203
|
* import { vaults } from "@morpho-org/morpho-test";
|
|
@@ -313,7 +322,6 @@ export interface VaultV1Actions {
|
|
|
313
322
|
* VaultBundlesV1. Only the destination deposit has an onchain share-price bound. The caller must
|
|
314
323
|
* satisfy the exact source-vault share requirement before building the transaction.
|
|
315
324
|
* Captures vault identities, permit-domain metadata, and the owner at handle creation.
|
|
316
|
-
* `buildTx()` accepts permits from the latest completed requirement resolution.
|
|
317
325
|
*
|
|
318
326
|
* @param params.userAddress - Account that signs and submits the transaction; VaultBundlesV1
|
|
319
327
|
* burns and mints shares for `msg.sender`.
|
|
@@ -346,6 +354,7 @@ export interface VaultV1Actions {
|
|
|
346
354
|
* @throws {NegativeInputError} when slippage tolerance or `referralFeePct` is negative.
|
|
347
355
|
* @throws {ExcessiveSlippageToleranceError} when slippage tolerance exceeds the SDK maximum.
|
|
348
356
|
* @throws {ExpiredDeadlineError} when the deadline is stale at creation or requirement resolution.
|
|
357
|
+
* @throws {InputExceedsMaxError} when the selected amount, `maxSharePriceVaultV2`, or `deadline` exceeds uint256.
|
|
349
358
|
* @throws {ReferralFeePctExceededError} when `referralFeePct` is at least WAD.
|
|
350
359
|
* @throws {ReferralFeeRecipientMissingError} when a positive fee has no non-zero recipient.
|
|
351
360
|
* @throws {UnsupportedChainIdError} when the chain is absent from the address registry.
|
|
@@ -353,8 +362,8 @@ export interface VaultV1Actions {
|
|
|
353
362
|
* @throws {viem.BaseError} from `getRequirements()` when an allowance or permit-nonce read fails.
|
|
354
363
|
* @throws {AmbiguousRequirementSignaturesError} from `buildTx()` when multiple permit signatures are supplied.
|
|
355
364
|
* @throws {UnexpectedRequirementSignatureError} from `buildTx()` when a non-permit signature is supplied.
|
|
356
|
-
* @throws {BundlesPermitMismatchError} from `buildTx()` when the
|
|
357
|
-
*
|
|
365
|
+
* @throws {BundlesPermitMismatchError} from `buildTx()` when the signature's spender, amount or
|
|
366
|
+
* deadline differ from this operation's.
|
|
358
367
|
* @example
|
|
359
368
|
* ```ts
|
|
360
369
|
* import { vaults } from "@morpho-org/morpho-test";
|
|
@@ -426,6 +435,7 @@ export declare class MorphoVaultV1 implements VaultV1Actions {
|
|
|
426
435
|
withdraw(params: {
|
|
427
436
|
readonly amount: bigint;
|
|
428
437
|
readonly userAddress: Address;
|
|
438
|
+
readonly vaultData: AccrualVault;
|
|
429
439
|
readonly slippageTolerance?: bigint;
|
|
430
440
|
readonly referralFeePct?: bigint;
|
|
431
441
|
readonly referralFeeRecipient?: Address;
|