@morpho-org/morpho-sdk 8.1.0 → 8.2.0-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/abis.d.ts +1 -1
- package/lib/cjs/abis.js +5 -1
- package/lib/cjs/blue/abis.d.ts +1 -1
- package/lib/cjs/blue/abis.js +5 -1
- package/lib/cjs/blue/entities.d.ts +4 -4
- package/lib/cjs/blue/entities.js +3 -1
- package/lib/cjs/blue/errors.d.ts +2 -2
- package/lib/cjs/blue/errors.js +5 -1
- package/lib/cjs/blue/fetch.d.ts +2 -2
- package/lib/cjs/blue/fetch.js +3 -1
- package/lib/cjs/blue/utils.d.ts +1 -1
- package/lib/cjs/blue/utils.js +2 -1
- package/lib/cjs/entities/index.d.ts +4 -4
- package/lib/cjs/entities/index.js +3 -1
- package/lib/cjs/entities/vaultV2/vaultV2.d.ts +33 -9
- package/lib/cjs/entities/vaultV2/vaultV2.js +33 -1
- package/lib/cjs/entities/vaultV2BlueReallocationData.d.ts +17 -9
- package/lib/cjs/entities/vaultV2BlueReallocationData.js +51 -17
- package/lib/cjs/errors.d.ts +4 -4
- package/lib/cjs/errors.js +10 -5
- package/lib/cjs/fetch.d.ts +2 -2
- package/lib/cjs/fetch.js +3 -1
- package/lib/cjs/midnight/errors.d.ts +2 -1
- package/lib/cjs/midnight/errors.js +5 -4
- package/lib/cjs/types/sharedLiquidity.d.ts +12 -7
- package/lib/cjs/utils.d.ts +2 -2
- package/lib/cjs/utils.js +4 -2
- package/lib/esm/abis.d.ts +1 -1
- package/lib/esm/abis.js +1 -1
- package/lib/esm/blue/abis.d.ts +1 -1
- package/lib/esm/blue/abis.js +1 -1
- package/lib/esm/blue/entities.d.ts +4 -4
- package/lib/esm/blue/entities.js +2 -2
- package/lib/esm/blue/errors.d.ts +2 -2
- package/lib/esm/blue/errors.js +2 -2
- package/lib/esm/blue/fetch.d.ts +2 -2
- package/lib/esm/blue/fetch.js +2 -2
- package/lib/esm/blue/utils.d.ts +1 -1
- package/lib/esm/blue/utils.js +1 -1
- package/lib/esm/entities/index.d.ts +4 -4
- package/lib/esm/entities/index.js +2 -2
- package/lib/esm/entities/vaultV2/vaultV2.d.ts +33 -9
- package/lib/esm/entities/vaultV2/vaultV2.js +33 -1
- package/lib/esm/entities/vaultV2BlueReallocationData.d.ts +17 -9
- package/lib/esm/entities/vaultV2BlueReallocationData.js +51 -17
- package/lib/esm/errors.d.ts +4 -4
- package/lib/esm/errors.js +4 -4
- package/lib/esm/fetch.d.ts +2 -2
- package/lib/esm/fetch.js +2 -2
- package/lib/esm/midnight/errors.d.ts +2 -1
- package/lib/esm/midnight/errors.js +2 -1
- package/lib/esm/types/sharedLiquidity.d.ts +12 -7
- package/lib/esm/utils.d.ts +2 -2
- package/lib/esm/utils.js +2 -2
- package/package.json +6 -6
package/lib/cjs/abis.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { marketParamsAbi as blueMarketParamsAbi } from "@morpho-org/blue-sdk";
|
|
2
|
-
export { adaptiveCurveIrmAbi as blueAdaptiveCurveIrmAbi, blueAbi, blueOracleAbi, erc2612Abi, erc5267Abi, metaMorphoAbi, metaMorphoFactoryAbi, morphoMarketV1AdapterAbi, morphoMarketV1AdapterFactoryAbi, morphoMarketV1AdapterV2Abi, morphoMarketV1AdapterV2FactoryAbi, morphoVaultV1AdapterAbi, morphoVaultV1AdapterFactoryAbi, permissionedErc20WrapperAbi, permit2Abi,
|
|
2
|
+
export { adaptiveCurveIrmAbi as blueAdaptiveCurveIrmAbi, blueAbi, blueOracleAbi, erc2612Abi, erc5267Abi, metaMorphoAbi, metaMorphoFactoryAbi, midnightAdapterAbi, midnightAdapterFactoryAbi, midnightAdapterPriceRatifierV1Abi, midnightAdapterRateRatifierV1Abi, morphoMarketV1AdapterAbi, morphoMarketV1AdapterFactoryAbi, morphoMarketV1AdapterV2Abi, morphoMarketV1AdapterV2FactoryAbi, morphoVaultV1AdapterAbi, morphoVaultV1AdapterFactoryAbi, permissionedErc20WrapperAbi, permit2Abi,
|
|
3
3
|
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
|
4
4
|
preLiquidationAbi as bluePreLiquidationAbi,
|
|
5
5
|
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
package/lib/cjs/abis.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.blueBundlesV1Abi = exports.vaultBundlesV1Abi = exports.vaultExitBundlesV1Abi = exports.midnightSetterRatifierAbi = exports.midnightRateRatifierV1Abi = exports.midnightPriceRatifierV1Abi = exports.midnightBundlesV2Abi = exports.midnightAbi = exports.midnightEcrecoverRatifierAbi = exports.midnightBlueBuyCallbackFactoryAbi = exports.wstEthAbi = exports.wrappedBackedTokenAbi = exports.whitelistControllerAggregatorV2Abi = exports.vaultV2FactoryAbi = exports.vaultV2BluePublicAllocatorAbi = exports.vaultV2Abi = exports.bluePreLiquidationFactoryAbi = exports.bluePreLiquidationAbi = exports.permit2Abi = exports.permissionedErc20WrapperAbi = exports.morphoVaultV1AdapterFactoryAbi = exports.morphoVaultV1AdapterAbi = exports.morphoMarketV1AdapterV2FactoryAbi = exports.morphoMarketV1AdapterV2Abi = exports.morphoMarketV1AdapterFactoryAbi = exports.morphoMarketV1AdapterAbi = exports.metaMorphoFactoryAbi = exports.metaMorphoAbi = exports.erc5267Abi = exports.erc2612Abi = exports.blueOracleAbi = exports.blueAbi = exports.blueAdaptiveCurveIrmAbi = exports.blueMarketParamsAbi = void 0;
|
|
3
|
+
exports.blueBundlesV1Abi = exports.vaultBundlesV1Abi = exports.vaultExitBundlesV1Abi = exports.midnightSetterRatifierAbi = exports.midnightRateRatifierV1Abi = exports.midnightPriceRatifierV1Abi = exports.midnightBundlesV2Abi = exports.midnightAbi = exports.midnightEcrecoverRatifierAbi = exports.midnightBlueBuyCallbackFactoryAbi = exports.wstEthAbi = exports.wrappedBackedTokenAbi = exports.whitelistControllerAggregatorV2Abi = exports.vaultV2FactoryAbi = exports.vaultV2BluePublicAllocatorAbi = exports.vaultV2Abi = exports.bluePreLiquidationFactoryAbi = exports.bluePreLiquidationAbi = exports.permit2Abi = exports.permissionedErc20WrapperAbi = exports.morphoVaultV1AdapterFactoryAbi = exports.morphoVaultV1AdapterAbi = exports.morphoMarketV1AdapterV2FactoryAbi = exports.morphoMarketV1AdapterV2Abi = exports.morphoMarketV1AdapterFactoryAbi = exports.morphoMarketV1AdapterAbi = exports.midnightAdapterRateRatifierV1Abi = exports.midnightAdapterPriceRatifierV1Abi = exports.midnightAdapterFactoryAbi = exports.midnightAdapterAbi = exports.metaMorphoFactoryAbi = exports.metaMorphoAbi = exports.erc5267Abi = exports.erc2612Abi = exports.blueOracleAbi = exports.blueAbi = exports.blueAdaptiveCurveIrmAbi = exports.blueMarketParamsAbi = void 0;
|
|
4
4
|
var blue_sdk_1 = require("@morpho-org/blue-sdk");
|
|
5
5
|
Object.defineProperty(exports, "blueMarketParamsAbi", { enumerable: true, get: function () { return blue_sdk_1.marketParamsAbi; } });
|
|
6
6
|
var blue_sdk_viem_1 = require("@morpho-org/blue-sdk-viem");
|
|
@@ -11,6 +11,10 @@ Object.defineProperty(exports, "erc2612Abi", { enumerable: true, get: function (
|
|
|
11
11
|
Object.defineProperty(exports, "erc5267Abi", { enumerable: true, get: function () { return blue_sdk_viem_1.erc5267Abi; } });
|
|
12
12
|
Object.defineProperty(exports, "metaMorphoAbi", { enumerable: true, get: function () { return blue_sdk_viem_1.metaMorphoAbi; } });
|
|
13
13
|
Object.defineProperty(exports, "metaMorphoFactoryAbi", { enumerable: true, get: function () { return blue_sdk_viem_1.metaMorphoFactoryAbi; } });
|
|
14
|
+
Object.defineProperty(exports, "midnightAdapterAbi", { enumerable: true, get: function () { return blue_sdk_viem_1.midnightAdapterAbi; } });
|
|
15
|
+
Object.defineProperty(exports, "midnightAdapterFactoryAbi", { enumerable: true, get: function () { return blue_sdk_viem_1.midnightAdapterFactoryAbi; } });
|
|
16
|
+
Object.defineProperty(exports, "midnightAdapterPriceRatifierV1Abi", { enumerable: true, get: function () { return blue_sdk_viem_1.midnightAdapterPriceRatifierV1Abi; } });
|
|
17
|
+
Object.defineProperty(exports, "midnightAdapterRateRatifierV1Abi", { enumerable: true, get: function () { return blue_sdk_viem_1.midnightAdapterRateRatifierV1Abi; } });
|
|
14
18
|
Object.defineProperty(exports, "morphoMarketV1AdapterAbi", { enumerable: true, get: function () { return blue_sdk_viem_1.morphoMarketV1AdapterAbi; } });
|
|
15
19
|
Object.defineProperty(exports, "morphoMarketV1AdapterFactoryAbi", { enumerable: true, get: function () { return blue_sdk_viem_1.morphoMarketV1AdapterFactoryAbi; } });
|
|
16
20
|
Object.defineProperty(exports, "morphoMarketV1AdapterV2Abi", { enumerable: true, get: function () { return blue_sdk_viem_1.morphoMarketV1AdapterV2Abi; } });
|
package/lib/cjs/blue/abis.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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, midnightAdapterAbi, midnightAdapterFactoryAbi, midnightAdapterPriceRatifierV1Abi, midnightAdapterRateRatifierV1Abi, morphoMarketV1AdapterAbi, morphoMarketV1AdapterFactoryAbi, morphoMarketV1AdapterV2Abi, morphoMarketV1AdapterV2FactoryAbi, morphoVaultV1AdapterAbi, morphoVaultV1AdapterFactoryAbi, permissionedErc20WrapperAbi, permit2Abi,
|
|
3
3
|
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
|
4
4
|
preLiquidationAbi,
|
|
5
5
|
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
package/lib/cjs/blue/abis.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.wstEthAbi = exports.wrappedBackedTokenAbi = exports.whitelistControllerAggregatorV2Abi = exports.vaultV2FactoryAbi = exports.vaultV2BluePublicAllocatorAbi = exports.vaultV2Abi = exports.preLiquidationFactoryAbi = exports.preLiquidationAbi = exports.permit2Abi = exports.permissionedErc20WrapperAbi = exports.morphoVaultV1AdapterFactoryAbi = exports.morphoVaultV1AdapterAbi = exports.morphoMarketV1AdapterV2FactoryAbi = exports.morphoMarketV1AdapterV2Abi = exports.morphoMarketV1AdapterFactoryAbi = exports.morphoMarketV1AdapterAbi = exports.metaMorphoFactoryAbi = exports.metaMorphoAbi = exports.erc5267Abi = exports.erc2612Abi = exports.blueOracleAbi = exports.blueAbi = exports.adaptiveCurveIrmAbi = exports.marketParamsAbi = void 0;
|
|
3
|
+
exports.wstEthAbi = exports.wrappedBackedTokenAbi = exports.whitelistControllerAggregatorV2Abi = exports.vaultV2FactoryAbi = exports.vaultV2BluePublicAllocatorAbi = exports.vaultV2Abi = exports.preLiquidationFactoryAbi = exports.preLiquidationAbi = exports.permit2Abi = exports.permissionedErc20WrapperAbi = exports.morphoVaultV1AdapterFactoryAbi = exports.morphoVaultV1AdapterAbi = exports.morphoMarketV1AdapterV2FactoryAbi = exports.morphoMarketV1AdapterV2Abi = exports.morphoMarketV1AdapterFactoryAbi = exports.morphoMarketV1AdapterAbi = exports.midnightAdapterRateRatifierV1Abi = exports.midnightAdapterPriceRatifierV1Abi = exports.midnightAdapterFactoryAbi = exports.midnightAdapterAbi = exports.metaMorphoFactoryAbi = exports.metaMorphoAbi = exports.erc5267Abi = exports.erc2612Abi = exports.blueOracleAbi = exports.blueAbi = exports.adaptiveCurveIrmAbi = exports.marketParamsAbi = void 0;
|
|
4
4
|
var blue_sdk_1 = require("@morpho-org/blue-sdk");
|
|
5
5
|
Object.defineProperty(exports, "marketParamsAbi", { enumerable: true, get: function () { return blue_sdk_1.marketParamsAbi; } });
|
|
6
6
|
var blue_sdk_viem_1 = require("@morpho-org/blue-sdk-viem");
|
|
@@ -11,6 +11,10 @@ Object.defineProperty(exports, "erc2612Abi", { enumerable: true, get: function (
|
|
|
11
11
|
Object.defineProperty(exports, "erc5267Abi", { enumerable: true, get: function () { return blue_sdk_viem_1.erc5267Abi; } });
|
|
12
12
|
Object.defineProperty(exports, "metaMorphoAbi", { enumerable: true, get: function () { return blue_sdk_viem_1.metaMorphoAbi; } });
|
|
13
13
|
Object.defineProperty(exports, "metaMorphoFactoryAbi", { enumerable: true, get: function () { return blue_sdk_viem_1.metaMorphoFactoryAbi; } });
|
|
14
|
+
Object.defineProperty(exports, "midnightAdapterAbi", { enumerable: true, get: function () { return blue_sdk_viem_1.midnightAdapterAbi; } });
|
|
15
|
+
Object.defineProperty(exports, "midnightAdapterFactoryAbi", { enumerable: true, get: function () { return blue_sdk_viem_1.midnightAdapterFactoryAbi; } });
|
|
16
|
+
Object.defineProperty(exports, "midnightAdapterPriceRatifierV1Abi", { enumerable: true, get: function () { return blue_sdk_viem_1.midnightAdapterPriceRatifierV1Abi; } });
|
|
17
|
+
Object.defineProperty(exports, "midnightAdapterRateRatifierV1Abi", { enumerable: true, get: function () { return blue_sdk_viem_1.midnightAdapterRateRatifierV1Abi; } });
|
|
14
18
|
Object.defineProperty(exports, "morphoMarketV1AdapterAbi", { enumerable: true, get: function () { return blue_sdk_viem_1.morphoMarketV1AdapterAbi; } });
|
|
15
19
|
Object.defineProperty(exports, "morphoMarketV1AdapterFactoryAbi", { enumerable: true, get: function () { return blue_sdk_viem_1.morphoMarketV1AdapterFactoryAbi; } });
|
|
16
20
|
Object.defineProperty(exports, "morphoMarketV1AdapterV2Abi", { enumerable: true, get: function () { return blue_sdk_viem_1.morphoMarketV1AdapterV2Abi; } });
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export type { IAccrualPosition, IAccrualVault, IAccrualVaultV2, IAccrualVaultV2Adapter, IAccrualVaultV2MorphoMarketV1Adapter, IAccrualVaultV2MorphoMarketV1AdapterV2, IAccrualVaultV2MorphoVaultV1Adapter, IAssetBalances, IEip5267Domain, IHolding, IMarket, IMarketParams, IPosition,
|
|
1
|
+
export type { IAccrualPosition, IAccrualVault, IAccrualVaultV2, IAccrualVaultV2Adapter, IAccrualVaultV2MidnightAdapter, IAccrualVaultV2MorphoMarketV1Adapter, IAccrualVaultV2MorphoMarketV1AdapterV2, IAccrualVaultV2MorphoVaultV1Adapter, IAssetBalances, IEip5267Domain, IHolding, IMarket, IMarketParams, IPosition,
|
|
2
2
|
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
|
3
3
|
IPreLiquidationParams,
|
|
4
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,
|
|
5
|
+
IPreLiquidationPosition, IToken, IVault, IVaultConfig, IVaultMarketAllocation, IVaultMarketConfig, IVaultToken, IVaultUser, IVaultV2, IVaultV2Adapter, IVaultV2Allocation, IVaultV2BlueMarketPublicAllocatorConfig, IVaultV2BluePublicAllocatorConfig, IVaultV2MidnightAdapter, IVaultV2MidnightAdapterAccrualMarket, IVaultV2MidnightAdapterCollateralParams, IVaultV2MidnightAdapterMarket, IVaultV2MidnightAdapterMarketData, IVaultV2MidnightAdapterMarketState, IVaultV2MidnightAdapterPosition, IVaultV2MorphoMarketV1Adapter, IVaultV2MorphoMarketV1AdapterV2, IVaultV2MorphoVaultV1Adapter, PeripheralBalance, PeripheralBalanceType, VaultV2MidnightAdapterAccrualMarket, VaultV2MidnightAdapterMarketData, } from "@morpho-org/blue-sdk";
|
|
6
|
+
export { AccrualPosition, AccrualVault, AccrualVaultV2, AccrualVaultV2MidnightAdapter, AccrualVaultV2MorphoMarketV1Adapter, AccrualVaultV2MorphoMarketV1AdapterV2, AccrualVaultV2MorphoVaultV1Adapter, AssetBalances, ConstantWrappedToken, Eip5267Domain, ExchangeRateWrappedToken, Holding, Market, MarketParams, Position,
|
|
7
7
|
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
|
8
8
|
PreLiquidationParams,
|
|
9
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";
|
|
10
|
+
PreLiquidationPosition, Token, User, Vault, VaultConfig, VaultMarketAllocation, VaultMarketConfig, VaultToken, VaultUser, VaultV2, VaultV2Adapter, VaultV2BlueMarketPublicAllocatorConfig, VaultV2BluePublicAllocatorConfig, VaultV2MidnightAdapter, VaultV2MorphoMarketV1Adapter, VaultV2MorphoMarketV1AdapterV2, VaultV2MorphoVaultV1Adapter, WrappedToken, } from "@morpho-org/blue-sdk";
|
package/lib/cjs/blue/entities.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WrappedToken = exports.VaultV2MorphoVaultV1Adapter = exports.VaultV2MorphoMarketV1AdapterV2 = exports.VaultV2MorphoMarketV1Adapter = exports.VaultV2BluePublicAllocatorConfig = exports.VaultV2BlueMarketPublicAllocatorConfig = exports.VaultV2Adapter = exports.VaultV2 = exports.VaultUser = exports.VaultToken = exports.VaultMarketConfig = exports.VaultMarketAllocation = exports.VaultConfig = exports.Vault = exports.User = exports.Token = exports.PreLiquidationPosition = exports.PreLiquidationParams = exports.Position = exports.MarketParams = exports.Market = exports.Holding = exports.ExchangeRateWrappedToken = exports.Eip5267Domain = exports.ConstantWrappedToken = exports.AssetBalances = exports.AccrualVaultV2MorphoVaultV1Adapter = exports.AccrualVaultV2MorphoMarketV1AdapterV2 = exports.AccrualVaultV2MorphoMarketV1Adapter = exports.AccrualVaultV2 = exports.AccrualVault = exports.AccrualPosition = void 0;
|
|
3
|
+
exports.WrappedToken = exports.VaultV2MorphoVaultV1Adapter = exports.VaultV2MorphoMarketV1AdapterV2 = exports.VaultV2MorphoMarketV1Adapter = exports.VaultV2MidnightAdapter = exports.VaultV2BluePublicAllocatorConfig = exports.VaultV2BlueMarketPublicAllocatorConfig = exports.VaultV2Adapter = exports.VaultV2 = exports.VaultUser = exports.VaultToken = exports.VaultMarketConfig = exports.VaultMarketAllocation = exports.VaultConfig = exports.Vault = exports.User = exports.Token = exports.PreLiquidationPosition = exports.PreLiquidationParams = exports.Position = exports.MarketParams = exports.Market = exports.Holding = exports.ExchangeRateWrappedToken = exports.Eip5267Domain = exports.ConstantWrappedToken = exports.AssetBalances = exports.AccrualVaultV2MorphoVaultV1Adapter = exports.AccrualVaultV2MorphoMarketV1AdapterV2 = exports.AccrualVaultV2MorphoMarketV1Adapter = exports.AccrualVaultV2MidnightAdapter = exports.AccrualVaultV2 = exports.AccrualVault = exports.AccrualPosition = void 0;
|
|
4
4
|
var blue_sdk_1 = require("@morpho-org/blue-sdk");
|
|
5
5
|
Object.defineProperty(exports, "AccrualPosition", { enumerable: true, get: function () { return blue_sdk_1.AccrualPosition; } });
|
|
6
6
|
Object.defineProperty(exports, "AccrualVault", { enumerable: true, get: function () { return blue_sdk_1.AccrualVault; } });
|
|
7
7
|
Object.defineProperty(exports, "AccrualVaultV2", { enumerable: true, get: function () { return blue_sdk_1.AccrualVaultV2; } });
|
|
8
|
+
Object.defineProperty(exports, "AccrualVaultV2MidnightAdapter", { enumerable: true, get: function () { return blue_sdk_1.AccrualVaultV2MidnightAdapter; } });
|
|
8
9
|
Object.defineProperty(exports, "AccrualVaultV2MorphoMarketV1Adapter", { enumerable: true, get: function () { return blue_sdk_1.AccrualVaultV2MorphoMarketV1Adapter; } });
|
|
9
10
|
Object.defineProperty(exports, "AccrualVaultV2MorphoMarketV1AdapterV2", { enumerable: true, get: function () { return blue_sdk_1.AccrualVaultV2MorphoMarketV1AdapterV2; } });
|
|
10
11
|
Object.defineProperty(exports, "AccrualVaultV2MorphoVaultV1Adapter", { enumerable: true, get: function () { return blue_sdk_1.AccrualVaultV2MorphoVaultV1Adapter; } });
|
|
@@ -32,6 +33,7 @@ Object.defineProperty(exports, "VaultV2", { enumerable: true, get: function () {
|
|
|
32
33
|
Object.defineProperty(exports, "VaultV2Adapter", { enumerable: true, get: function () { return blue_sdk_1.VaultV2Adapter; } });
|
|
33
34
|
Object.defineProperty(exports, "VaultV2BlueMarketPublicAllocatorConfig", { enumerable: true, get: function () { return blue_sdk_1.VaultV2BlueMarketPublicAllocatorConfig; } });
|
|
34
35
|
Object.defineProperty(exports, "VaultV2BluePublicAllocatorConfig", { enumerable: true, get: function () { return blue_sdk_1.VaultV2BluePublicAllocatorConfig; } });
|
|
36
|
+
Object.defineProperty(exports, "VaultV2MidnightAdapter", { enumerable: true, get: function () { return blue_sdk_1.VaultV2MidnightAdapter; } });
|
|
35
37
|
Object.defineProperty(exports, "VaultV2MorphoMarketV1Adapter", { enumerable: true, get: function () { return blue_sdk_1.VaultV2MorphoMarketV1Adapter; } });
|
|
36
38
|
Object.defineProperty(exports, "VaultV2MorphoMarketV1AdapterV2", { enumerable: true, get: function () { return blue_sdk_1.VaultV2MorphoMarketV1AdapterV2; } });
|
|
37
39
|
Object.defineProperty(exports, "VaultV2MorphoVaultV1Adapter", { enumerable: true, get: function () { return blue_sdk_1.VaultV2MorphoVaultV1Adapter; } });
|
package/lib/cjs/blue/errors.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { BlueErrors, DivisionByZeroError, IncompleteChainRegistryError, InvalidAddressError, InvalidBitLengthError, InvalidMarketParamsError, RegistryValueAlreadyRegisteredError, UnknownAddressError, UnknownDataError, UnknownFactory, UnknownMarketAllocationError, UnknownMarketParamsError, UnknownOfFactory, UnknownTokenError, UnknownTokenPriceError, UnknownVaultConfigError, UnsupportedChainIdError, UnsupportedMarketIrmError,
|
|
1
|
+
export { BlueErrors, DivisionByZeroError, IncompleteChainRegistryError, InvalidAddressError, InvalidBitLengthError, InvalidMarketParamsError, InvalidPositionAccrualStateError, InvalidPositionLossFactorError, InvalidVaultV2MidnightAdapterMarketsError, RegistryValueAlreadyRegisteredError, UnknownAddressError, UnknownDataError, UnknownFactory, UnknownMarketAllocationError, UnknownMarketParamsError, UnknownOfFactory, UnknownTokenError, UnknownTokenPriceError, UnknownVaultConfigError, UnsupportedChainIdError, UnsupportedMarketIrmError,
|
|
2
2
|
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
|
3
3
|
UnsupportedPreLiquidationParamsError, UnsupportedVaultV2AdapterError, VaultV2Errors, } from "@morpho-org/blue-sdk";
|
|
4
|
-
export { getUnsupportedVaultV2Adapter, InvalidNumberError, InvalidPermitDomainChainIdError, InvalidPermitDomainVerifyingContractError, isUnknownOfFactoryError, MalformedTokenMetadataError, MarketParamsIdMismatchError, MissingPermitDomainNameError, NonTupleReturnValueError, UnknownAbiFunctionError, UnnamedAbiOutputsError, UnsupportedPermitDomainExtensionsError, } from "@morpho-org/blue-sdk-viem";
|
|
4
|
+
export { getUnsupportedVaultV2Adapter, InvalidNumberError, InvalidPermitDomainChainIdError, InvalidPermitDomainVerifyingContractError, isUnknownOfFactoryError, MalformedTokenMetadataError, MarketParamsIdMismatchError, MissingPermitDomainNameError, NonTupleReturnValueError, UnknownAbiFunctionError, UnnamedAbiOutputsError, UnresolvedBlockNumberError, UnsupportedPermitDomainExtensionsError, } from "@morpho-org/blue-sdk-viem";
|
package/lib/cjs/blue/errors.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UnsupportedPermitDomainExtensionsError = exports.UnnamedAbiOutputsError = exports.UnknownAbiFunctionError = exports.NonTupleReturnValueError = exports.MissingPermitDomainNameError = exports.MarketParamsIdMismatchError = exports.MalformedTokenMetadataError = exports.isUnknownOfFactoryError = exports.InvalidPermitDomainVerifyingContractError = exports.InvalidPermitDomainChainIdError = exports.InvalidNumberError = exports.getUnsupportedVaultV2Adapter = exports.VaultV2Errors = exports.UnsupportedVaultV2AdapterError = exports.UnsupportedPreLiquidationParamsError = exports.UnsupportedMarketIrmError = exports.UnsupportedChainIdError = exports.UnknownVaultConfigError = exports.UnknownTokenPriceError = exports.UnknownTokenError = exports.UnknownOfFactory = exports.UnknownMarketParamsError = exports.UnknownMarketAllocationError = exports.UnknownFactory = exports.UnknownDataError = exports.UnknownAddressError = exports.RegistryValueAlreadyRegisteredError = exports.InvalidMarketParamsError = exports.InvalidBitLengthError = exports.InvalidAddressError = exports.IncompleteChainRegistryError = exports.DivisionByZeroError = exports.BlueErrors = void 0;
|
|
3
|
+
exports.UnsupportedPermitDomainExtensionsError = exports.UnresolvedBlockNumberError = exports.UnnamedAbiOutputsError = exports.UnknownAbiFunctionError = exports.NonTupleReturnValueError = exports.MissingPermitDomainNameError = exports.MarketParamsIdMismatchError = exports.MalformedTokenMetadataError = exports.isUnknownOfFactoryError = exports.InvalidPermitDomainVerifyingContractError = exports.InvalidPermitDomainChainIdError = exports.InvalidNumberError = exports.getUnsupportedVaultV2Adapter = exports.VaultV2Errors = exports.UnsupportedVaultV2AdapterError = exports.UnsupportedPreLiquidationParamsError = exports.UnsupportedMarketIrmError = exports.UnsupportedChainIdError = exports.UnknownVaultConfigError = exports.UnknownTokenPriceError = exports.UnknownTokenError = exports.UnknownOfFactory = exports.UnknownMarketParamsError = exports.UnknownMarketAllocationError = exports.UnknownFactory = exports.UnknownDataError = exports.UnknownAddressError = exports.RegistryValueAlreadyRegisteredError = exports.InvalidVaultV2MidnightAdapterMarketsError = exports.InvalidPositionLossFactorError = exports.InvalidPositionAccrualStateError = exports.InvalidMarketParamsError = exports.InvalidBitLengthError = exports.InvalidAddressError = exports.IncompleteChainRegistryError = exports.DivisionByZeroError = exports.BlueErrors = void 0;
|
|
4
4
|
var blue_sdk_1 = require("@morpho-org/blue-sdk");
|
|
5
5
|
Object.defineProperty(exports, "BlueErrors", { enumerable: true, get: function () { return blue_sdk_1.BlueErrors; } });
|
|
6
6
|
Object.defineProperty(exports, "DivisionByZeroError", { enumerable: true, get: function () { return blue_sdk_1.DivisionByZeroError; } });
|
|
@@ -8,6 +8,9 @@ Object.defineProperty(exports, "IncompleteChainRegistryError", { enumerable: tru
|
|
|
8
8
|
Object.defineProperty(exports, "InvalidAddressError", { enumerable: true, get: function () { return blue_sdk_1.InvalidAddressError; } });
|
|
9
9
|
Object.defineProperty(exports, "InvalidBitLengthError", { enumerable: true, get: function () { return blue_sdk_1.InvalidBitLengthError; } });
|
|
10
10
|
Object.defineProperty(exports, "InvalidMarketParamsError", { enumerable: true, get: function () { return blue_sdk_1.InvalidMarketParamsError; } });
|
|
11
|
+
Object.defineProperty(exports, "InvalidPositionAccrualStateError", { enumerable: true, get: function () { return blue_sdk_1.InvalidPositionAccrualStateError; } });
|
|
12
|
+
Object.defineProperty(exports, "InvalidPositionLossFactorError", { enumerable: true, get: function () { return blue_sdk_1.InvalidPositionLossFactorError; } });
|
|
13
|
+
Object.defineProperty(exports, "InvalidVaultV2MidnightAdapterMarketsError", { enumerable: true, get: function () { return blue_sdk_1.InvalidVaultV2MidnightAdapterMarketsError; } });
|
|
11
14
|
Object.defineProperty(exports, "RegistryValueAlreadyRegisteredError", { enumerable: true, get: function () { return blue_sdk_1.RegistryValueAlreadyRegisteredError; } });
|
|
12
15
|
Object.defineProperty(exports, "UnknownAddressError", { enumerable: true, get: function () { return blue_sdk_1.UnknownAddressError; } });
|
|
13
16
|
Object.defineProperty(exports, "UnknownDataError", { enumerable: true, get: function () { return blue_sdk_1.UnknownDataError; } });
|
|
@@ -36,4 +39,5 @@ Object.defineProperty(exports, "MissingPermitDomainNameError", { enumerable: tru
|
|
|
36
39
|
Object.defineProperty(exports, "NonTupleReturnValueError", { enumerable: true, get: function () { return blue_sdk_viem_1.NonTupleReturnValueError; } });
|
|
37
40
|
Object.defineProperty(exports, "UnknownAbiFunctionError", { enumerable: true, get: function () { return blue_sdk_viem_1.UnknownAbiFunctionError; } });
|
|
38
41
|
Object.defineProperty(exports, "UnnamedAbiOutputsError", { enumerable: true, get: function () { return blue_sdk_viem_1.UnnamedAbiOutputsError; } });
|
|
42
|
+
Object.defineProperty(exports, "UnresolvedBlockNumberError", { enumerable: true, get: function () { return blue_sdk_viem_1.UnresolvedBlockNumberError; } });
|
|
39
43
|
Object.defineProperty(exports, "UnsupportedPermitDomainExtensionsError", { enumerable: true, get: function () { return blue_sdk_viem_1.UnsupportedPermitDomainExtensionsError; } });
|
package/lib/cjs/blue/fetch.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { fetchAccrualPosition, fetchAccrualVault, fetchAccrualVaultV2, fetchAccrualVaultV2Adapter, fetchAccrualVaultV2MorphoMarketV1Adapter, fetchAccrualVaultV2MorphoMarketV1AdapterV2, fetchAccrualVaultV2MorphoVaultV1Adapter, fetchHolding, fetchMarket, fetchMarketParams, fetchPosition,
|
|
1
|
+
export { fetchAccrualPosition, fetchAccrualVault, fetchAccrualVaultV2, fetchAccrualVaultV2Adapter, fetchAccrualVaultV2MidnightAdapter, fetchAccrualVaultV2MorphoMarketV1Adapter, fetchAccrualVaultV2MorphoMarketV1AdapterV2, fetchAccrualVaultV2MorphoVaultV1Adapter, fetchHolding, fetchMarket, fetchMarketParams, fetchPosition,
|
|
2
2
|
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
|
3
3
|
fetchPreLiquidationParams,
|
|
4
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";
|
|
5
|
+
fetchPreLiquidationPosition, fetchToken, fetchUser, fetchVault, fetchVaultConfig, fetchVaultMarketAllocation, fetchVaultMarketConfig, fetchVaultUser, fetchVaultV2, fetchVaultV2Adapter, fetchVaultV2BlueMarketPublicAllocatorConfig, fetchVaultV2BluePublicAllocatorConfig, fetchVaultV2BluePublicAllocatorData, fetchVaultV2MidnightAdapter, fetchVaultV2MorphoMarketV1Adapter, fetchVaultV2MorphoMarketV1AdapterV2, fetchVaultV2MorphoVaultV1Adapter, } from "@morpho-org/blue-sdk-viem";
|
package/lib/cjs/blue/fetch.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
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.fetchUser = exports.fetchToken = exports.fetchPreLiquidationPosition = exports.fetchPreLiquidationParams = exports.fetchPosition = exports.fetchMarketParams = exports.fetchMarket = exports.fetchHolding = exports.fetchAccrualVaultV2MorphoVaultV1Adapter = exports.fetchAccrualVaultV2MorphoMarketV1AdapterV2 = exports.fetchAccrualVaultV2MorphoMarketV1Adapter = exports.fetchAccrualVaultV2Adapter = exports.fetchAccrualVaultV2 = exports.fetchAccrualVault = exports.fetchAccrualPosition = void 0;
|
|
3
|
+
exports.fetchVaultV2MorphoVaultV1Adapter = exports.fetchVaultV2MorphoMarketV1AdapterV2 = exports.fetchVaultV2MorphoMarketV1Adapter = exports.fetchVaultV2MidnightAdapter = exports.fetchVaultV2BluePublicAllocatorData = exports.fetchVaultV2BluePublicAllocatorConfig = exports.fetchVaultV2BlueMarketPublicAllocatorConfig = exports.fetchVaultV2Adapter = exports.fetchVaultV2 = exports.fetchVaultUser = exports.fetchVaultMarketConfig = exports.fetchVaultMarketAllocation = exports.fetchVaultConfig = exports.fetchVault = exports.fetchUser = exports.fetchToken = exports.fetchPreLiquidationPosition = exports.fetchPreLiquidationParams = exports.fetchPosition = exports.fetchMarketParams = exports.fetchMarket = exports.fetchHolding = exports.fetchAccrualVaultV2MorphoVaultV1Adapter = exports.fetchAccrualVaultV2MorphoMarketV1AdapterV2 = exports.fetchAccrualVaultV2MorphoMarketV1Adapter = exports.fetchAccrualVaultV2MidnightAdapter = exports.fetchAccrualVaultV2Adapter = exports.fetchAccrualVaultV2 = exports.fetchAccrualVault = exports.fetchAccrualPosition = void 0;
|
|
4
4
|
var blue_sdk_viem_1 = require("@morpho-org/blue-sdk-viem");
|
|
5
5
|
Object.defineProperty(exports, "fetchAccrualPosition", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchAccrualPosition; } });
|
|
6
6
|
Object.defineProperty(exports, "fetchAccrualVault", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchAccrualVault; } });
|
|
7
7
|
Object.defineProperty(exports, "fetchAccrualVaultV2", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchAccrualVaultV2; } });
|
|
8
8
|
Object.defineProperty(exports, "fetchAccrualVaultV2Adapter", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchAccrualVaultV2Adapter; } });
|
|
9
|
+
Object.defineProperty(exports, "fetchAccrualVaultV2MidnightAdapter", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchAccrualVaultV2MidnightAdapter; } });
|
|
9
10
|
Object.defineProperty(exports, "fetchAccrualVaultV2MorphoMarketV1Adapter", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchAccrualVaultV2MorphoMarketV1Adapter; } });
|
|
10
11
|
Object.defineProperty(exports, "fetchAccrualVaultV2MorphoMarketV1AdapterV2", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchAccrualVaultV2MorphoMarketV1AdapterV2; } });
|
|
11
12
|
Object.defineProperty(exports, "fetchAccrualVaultV2MorphoVaultV1Adapter", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchAccrualVaultV2MorphoVaultV1Adapter; } });
|
|
@@ -29,6 +30,7 @@ Object.defineProperty(exports, "fetchVaultV2Adapter", { enumerable: true, get: f
|
|
|
29
30
|
Object.defineProperty(exports, "fetchVaultV2BlueMarketPublicAllocatorConfig", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchVaultV2BlueMarketPublicAllocatorConfig; } });
|
|
30
31
|
Object.defineProperty(exports, "fetchVaultV2BluePublicAllocatorConfig", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchVaultV2BluePublicAllocatorConfig; } });
|
|
31
32
|
Object.defineProperty(exports, "fetchVaultV2BluePublicAllocatorData", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchVaultV2BluePublicAllocatorData; } });
|
|
33
|
+
Object.defineProperty(exports, "fetchVaultV2MidnightAdapter", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchVaultV2MidnightAdapter; } });
|
|
32
34
|
Object.defineProperty(exports, "fetchVaultV2MorphoMarketV1Adapter", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchVaultV2MorphoMarketV1Adapter; } });
|
|
33
35
|
Object.defineProperty(exports, "fetchVaultV2MorphoMarketV1AdapterV2", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchVaultV2MorphoMarketV1AdapterV2; } });
|
|
34
36
|
Object.defineProperty(exports, "fetchVaultV2MorphoVaultV1Adapter", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchVaultV2MorphoVaultV1Adapter; } });
|
package/lib/cjs/blue/utils.d.ts
CHANGED
|
@@ -3,5 +3,5 @@ export { AdaptiveCurveIrmLib, CapacityLimitReason,
|
|
|
3
3
|
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
|
4
4
|
defaultPreLiquidationParamsRegistry,
|
|
5
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";
|
|
6
|
+
getDefaultPreLiquidationParams, MarketUtils, MathLib, SharesMath, VaultUtils, VaultV2BlueMarketPublicAllocatorConfigUtils, VaultV2BluePublicAllocatorConfigUtils, VaultV2MidnightAdapterUtils, VaultV2Utils, } from "@morpho-org/blue-sdk";
|
|
7
7
|
export { catchRevertOnly, decodeBytes32String, getAuthorizationTypedData, getPermit2PermitTypedData, getPermit2TransferFromTypedData, getPermitTypedData, isContractRevertError, isTransportError, isUndecodableResultError, MetaMorphoAction, optionalBoolean, readContractRestructured, restructure, safeGetAddress, safeParseNumber, safeParseUnits, } from "@morpho-org/blue-sdk-viem";
|
package/lib/cjs/blue/utils.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.safeParseUnits = exports.safeParseNumber = exports.safeGetAddress = exports.restructure = exports.readContractRestructured = exports.optionalBoolean = exports.MetaMorphoAction = exports.isUndecodableResultError = exports.isTransportError = exports.isContractRevertError = exports.getPermitTypedData = exports.getPermit2TransferFromTypedData = exports.getPermit2PermitTypedData = exports.getAuthorizationTypedData = exports.decodeBytes32String = exports.catchRevertOnly = exports.VaultV2Utils = exports.VaultV2BluePublicAllocatorConfigUtils = exports.VaultV2BlueMarketPublicAllocatorConfigUtils = exports.VaultUtils = exports.SharesMath = exports.MathLib = exports.MarketUtils = exports.getDefaultPreLiquidationParams = exports.defaultPreLiquidationParamsRegistry = exports.CapacityLimitReason = exports.AdaptiveCurveIrmLib = void 0;
|
|
3
|
+
exports.safeParseUnits = exports.safeParseNumber = exports.safeGetAddress = exports.restructure = exports.readContractRestructured = exports.optionalBoolean = exports.MetaMorphoAction = exports.isUndecodableResultError = exports.isTransportError = exports.isContractRevertError = exports.getPermitTypedData = exports.getPermit2TransferFromTypedData = exports.getPermit2PermitTypedData = exports.getAuthorizationTypedData = exports.decodeBytes32String = exports.catchRevertOnly = exports.VaultV2Utils = exports.VaultV2MidnightAdapterUtils = exports.VaultV2BluePublicAllocatorConfigUtils = exports.VaultV2BlueMarketPublicAllocatorConfigUtils = exports.VaultUtils = exports.SharesMath = exports.MathLib = exports.MarketUtils = exports.getDefaultPreLiquidationParams = exports.defaultPreLiquidationParamsRegistry = exports.CapacityLimitReason = exports.AdaptiveCurveIrmLib = void 0;
|
|
4
4
|
var blue_sdk_1 = require("@morpho-org/blue-sdk");
|
|
5
5
|
Object.defineProperty(exports, "AdaptiveCurveIrmLib", { enumerable: true, get: function () { return blue_sdk_1.AdaptiveCurveIrmLib; } });
|
|
6
6
|
Object.defineProperty(exports, "CapacityLimitReason", { enumerable: true, get: function () { return blue_sdk_1.CapacityLimitReason; } });
|
|
@@ -14,6 +14,7 @@ Object.defineProperty(exports, "SharesMath", { enumerable: true, get: function (
|
|
|
14
14
|
Object.defineProperty(exports, "VaultUtils", { enumerable: true, get: function () { return blue_sdk_1.VaultUtils; } });
|
|
15
15
|
Object.defineProperty(exports, "VaultV2BlueMarketPublicAllocatorConfigUtils", { enumerable: true, get: function () { return blue_sdk_1.VaultV2BlueMarketPublicAllocatorConfigUtils; } });
|
|
16
16
|
Object.defineProperty(exports, "VaultV2BluePublicAllocatorConfigUtils", { enumerable: true, get: function () { return blue_sdk_1.VaultV2BluePublicAllocatorConfigUtils; } });
|
|
17
|
+
Object.defineProperty(exports, "VaultV2MidnightAdapterUtils", { enumerable: true, get: function () { return blue_sdk_1.VaultV2MidnightAdapterUtils; } });
|
|
17
18
|
Object.defineProperty(exports, "VaultV2Utils", { enumerable: true, get: function () { return blue_sdk_1.VaultV2Utils; } });
|
|
18
19
|
var blue_sdk_viem_1 = require("@morpho-org/blue-sdk-viem");
|
|
19
20
|
Object.defineProperty(exports, "catchRevertOnly", { enumerable: true, get: function () { return blue_sdk_viem_1.catchRevertOnly; } });
|
|
@@ -1,13 +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,
|
|
1
|
+
export type { IAccrualPosition as IBlueAccrualPosition, IAccrualVault, IAccrualVaultV2, IAccrualVaultV2Adapter, IAccrualVaultV2MidnightAdapter, IAccrualVaultV2MorphoMarketV1Adapter, IAccrualVaultV2MorphoMarketV1AdapterV2, IAccrualVaultV2MorphoVaultV1Adapter, IAssetBalances, IEip5267Domain, IHolding, IMarket as IBlueMarket, IMarketParams as IBlueMarketParams, IPosition as IBluePosition,
|
|
2
2
|
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
|
3
3
|
IPreLiquidationParams as IBluePreLiquidationParams,
|
|
4
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,
|
|
5
|
+
IPreLiquidationPosition as IBluePreLiquidationPosition, IToken, IVault, IVaultConfig, IVaultMarketAllocation, IVaultMarketConfig, IVaultToken, IVaultUser, IVaultV2, IVaultV2Adapter, IVaultV2Allocation, IVaultV2BlueMarketPublicAllocatorConfig, IVaultV2BluePublicAllocatorConfig, IVaultV2MidnightAdapter, IVaultV2MidnightAdapterAccrualMarket, IVaultV2MidnightAdapterCollateralParams, IVaultV2MidnightAdapterMarket, IVaultV2MidnightAdapterMarketData, IVaultV2MidnightAdapterMarketState, IVaultV2MidnightAdapterPosition, IVaultV2MorphoMarketV1Adapter, IVaultV2MorphoMarketV1AdapterV2, IVaultV2MorphoVaultV1Adapter, PeripheralBalance, PeripheralBalanceType, VaultV2MidnightAdapterAccrualMarket, VaultV2MidnightAdapterMarketData, } from "@morpho-org/blue-sdk";
|
|
6
|
+
export { AccrualPosition as BlueAccrualPosition, AccrualVault, AccrualVaultV2, AccrualVaultV2MidnightAdapter, AccrualVaultV2MorphoMarketV1Adapter, AccrualVaultV2MorphoMarketV1AdapterV2, AccrualVaultV2MorphoVaultV1Adapter, AssetBalances, ConstantWrappedToken, Eip5267Domain, ExchangeRateWrappedToken, Holding, Market as BlueMarket, MarketParams as BlueMarketParams, Position as BluePosition,
|
|
7
7
|
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
|
8
8
|
PreLiquidationParams as BluePreLiquidationParams,
|
|
9
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";
|
|
10
|
+
PreLiquidationPosition as BluePreLiquidationPosition, Token, User as BlueUser, Vault, VaultConfig, VaultMarketAllocation, VaultMarketConfig, VaultToken, VaultUser, VaultV2, VaultV2Adapter, VaultV2BlueMarketPublicAllocatorConfig, VaultV2BluePublicAllocatorConfig, VaultV2MidnightAdapter, VaultV2MorphoMarketV1Adapter, VaultV2MorphoMarketV1AdapterV2, VaultV2MorphoVaultV1Adapter, WrappedToken, } from "@morpho-org/blue-sdk";
|
|
11
11
|
export type { AnyTree as MidnightAnyTree, AnyTreeSnapshot as MidnightAnyTreeSnapshot, BuildOfferParams as MidnightBuildOfferParams, CollateralParams as MidnightCollateralParams, EcrecoverTreeCreateRequest as MidnightEcrecoverTreeCreateRequest, 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, PriceRatifierV1TreeCreateRequest as MidnightPriceRatifierV1TreeCreateRequest, RateRatifierV1TreeCreateRequest as MidnightRateRatifierV1TreeCreateRequest, RatifierKind as MidnightRatifierKind, RatifierTreeInput as MidnightRatifierTreeInput, RatifierTypes as MidnightRatifierTypes, SetterTreeCreateRequest as MidnightSetterTreeCreateRequest, SettlementFeeCbps as MidnightSettlementFeeCbps, TreeCreateParams as MidnightTreeCreateParams, TreeCreateRequest as MidnightTreeCreateRequest, TreeData as MidnightTreeData, TreeDescriptor as MidnightTreeDescriptor, TreeEntry as MidnightTreeEntry, TreeInput as MidnightTreeInput, TreeLike as MidnightTreeLike, TreeMempoolValidateParams as MidnightTreeMempoolValidateParams, TreeMempoolValidateRatification as MidnightTreeMempoolValidateRatification, TreeProof as MidnightTreeProof, TreeSnapshot as MidnightTreeSnapshot, TypedRatifierTreeInput as MidnightTypedRatifierTreeInput, TypedTreeMempoolValidateParams as MidnightTypedTreeMempoolValidateParams, } from "@morpho-org/midnight-sdk";
|
|
12
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";
|
|
13
13
|
export type { BlueActions, BlueTokenRequirementsParams, } from "./blue/index.js";
|
|
@@ -14,11 +14,12 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.VaultV2BlueReallocationData = exports.MorphoVaultV2 = exports.MorphoVaultV1 = exports.MorphoMidnight = exports.MorphoBlue = exports.MidnightTree = exports.MidnightPosition = exports.MidnightOffer = exports.MidnightMarketParams = exports.MidnightMarket = exports.MidnightGroup = exports.MidnightAccrualPosition = exports.WrappedToken = exports.VaultV2MorphoVaultV1Adapter = exports.VaultV2MorphoMarketV1AdapterV2 = exports.VaultV2MorphoMarketV1Adapter = exports.VaultV2BluePublicAllocatorConfig = exports.VaultV2BlueMarketPublicAllocatorConfig = exports.VaultV2Adapter = exports.VaultV2 = exports.VaultUser = exports.VaultToken = exports.VaultMarketConfig = exports.VaultMarketAllocation = exports.VaultConfig = exports.Vault = exports.BlueUser = exports.Token = exports.BluePreLiquidationPosition = exports.BluePreLiquidationParams = exports.BluePosition = exports.BlueMarketParams = exports.BlueMarket = exports.Holding = exports.ExchangeRateWrappedToken = exports.Eip5267Domain = exports.ConstantWrappedToken = exports.AssetBalances = exports.AccrualVaultV2MorphoVaultV1Adapter = exports.AccrualVaultV2MorphoMarketV1AdapterV2 = exports.AccrualVaultV2MorphoMarketV1Adapter = exports.AccrualVaultV2 = exports.AccrualVault = exports.BlueAccrualPosition = void 0;
|
|
17
|
+
exports.VaultV2BlueReallocationData = exports.MorphoVaultV2 = exports.MorphoVaultV1 = exports.MorphoMidnight = exports.MorphoBlue = exports.MidnightTree = exports.MidnightPosition = exports.MidnightOffer = exports.MidnightMarketParams = exports.MidnightMarket = exports.MidnightGroup = exports.MidnightAccrualPosition = exports.WrappedToken = exports.VaultV2MorphoVaultV1Adapter = exports.VaultV2MorphoMarketV1AdapterV2 = exports.VaultV2MorphoMarketV1Adapter = exports.VaultV2MidnightAdapter = exports.VaultV2BluePublicAllocatorConfig = exports.VaultV2BlueMarketPublicAllocatorConfig = exports.VaultV2Adapter = exports.VaultV2 = exports.VaultUser = exports.VaultToken = exports.VaultMarketConfig = exports.VaultMarketAllocation = exports.VaultConfig = exports.Vault = exports.BlueUser = exports.Token = exports.BluePreLiquidationPosition = exports.BluePreLiquidationParams = exports.BluePosition = exports.BlueMarketParams = exports.BlueMarket = exports.Holding = exports.ExchangeRateWrappedToken = exports.Eip5267Domain = exports.ConstantWrappedToken = exports.AssetBalances = exports.AccrualVaultV2MorphoVaultV1Adapter = exports.AccrualVaultV2MorphoMarketV1AdapterV2 = exports.AccrualVaultV2MorphoMarketV1Adapter = exports.AccrualVaultV2MidnightAdapter = exports.AccrualVaultV2 = exports.AccrualVault = exports.BlueAccrualPosition = void 0;
|
|
18
18
|
var blue_sdk_1 = require("@morpho-org/blue-sdk");
|
|
19
19
|
Object.defineProperty(exports, "BlueAccrualPosition", { enumerable: true, get: function () { return blue_sdk_1.AccrualPosition; } });
|
|
20
20
|
Object.defineProperty(exports, "AccrualVault", { enumerable: true, get: function () { return blue_sdk_1.AccrualVault; } });
|
|
21
21
|
Object.defineProperty(exports, "AccrualVaultV2", { enumerable: true, get: function () { return blue_sdk_1.AccrualVaultV2; } });
|
|
22
|
+
Object.defineProperty(exports, "AccrualVaultV2MidnightAdapter", { enumerable: true, get: function () { return blue_sdk_1.AccrualVaultV2MidnightAdapter; } });
|
|
22
23
|
Object.defineProperty(exports, "AccrualVaultV2MorphoMarketV1Adapter", { enumerable: true, get: function () { return blue_sdk_1.AccrualVaultV2MorphoMarketV1Adapter; } });
|
|
23
24
|
Object.defineProperty(exports, "AccrualVaultV2MorphoMarketV1AdapterV2", { enumerable: true, get: function () { return blue_sdk_1.AccrualVaultV2MorphoMarketV1AdapterV2; } });
|
|
24
25
|
Object.defineProperty(exports, "AccrualVaultV2MorphoVaultV1Adapter", { enumerable: true, get: function () { return blue_sdk_1.AccrualVaultV2MorphoVaultV1Adapter; } });
|
|
@@ -46,6 +47,7 @@ Object.defineProperty(exports, "VaultV2", { enumerable: true, get: function () {
|
|
|
46
47
|
Object.defineProperty(exports, "VaultV2Adapter", { enumerable: true, get: function () { return blue_sdk_1.VaultV2Adapter; } });
|
|
47
48
|
Object.defineProperty(exports, "VaultV2BlueMarketPublicAllocatorConfig", { enumerable: true, get: function () { return blue_sdk_1.VaultV2BlueMarketPublicAllocatorConfig; } });
|
|
48
49
|
Object.defineProperty(exports, "VaultV2BluePublicAllocatorConfig", { enumerable: true, get: function () { return blue_sdk_1.VaultV2BluePublicAllocatorConfig; } });
|
|
50
|
+
Object.defineProperty(exports, "VaultV2MidnightAdapter", { enumerable: true, get: function () { return blue_sdk_1.VaultV2MidnightAdapter; } });
|
|
49
51
|
Object.defineProperty(exports, "VaultV2MorphoMarketV1Adapter", { enumerable: true, get: function () { return blue_sdk_1.VaultV2MorphoMarketV1Adapter; } });
|
|
50
52
|
Object.defineProperty(exports, "VaultV2MorphoMarketV1AdapterV2", { enumerable: true, get: function () { return blue_sdk_1.VaultV2MorphoMarketV1AdapterV2; } });
|
|
51
53
|
Object.defineProperty(exports, "VaultV2MorphoVaultV1Adapter", { enumerable: true, get: function () { return blue_sdk_1.VaultV2MorphoVaultV1Adapter; } });
|
|
@@ -69,8 +69,9 @@ export interface VaultV2Actions {
|
|
|
69
69
|
* owner is consumed and none was passed explicitly.
|
|
70
70
|
* @throws {Permit2SignatureTransferNonceAlreadyUsedError} from `getRequirements()` when the
|
|
71
71
|
* explicit Permit2 nonce is consumed.
|
|
72
|
-
* @throws {InputExceedsMaxError} when funding or the deadline exceeds uint256,
|
|
73
|
-
*
|
|
72
|
+
* @throws {InputExceedsMaxError} when funding or the deadline exceeds uint256, when the vault's
|
|
73
|
+
* liquidity adapter is a Midnight adapter (it cannot receive vault allocations, so no deposit
|
|
74
|
+
* fits and `max` is `0n`), or from `getRequirements()` when the Permit2 nonce exceeds uint256.
|
|
74
75
|
* @throws {AmbiguousRequirementSignaturesError} from `buildTx()` when multiple token signatures are supplied.
|
|
75
76
|
* @throws {UnexpectedRequirementSignatureError} from `buildTx()` when an unsupported signature is supplied.
|
|
76
77
|
* @throws {BundlesPermitMismatchError} from `buildTx()` when the signature's spender, amount or
|
|
@@ -153,7 +154,9 @@ export interface VaultV2Actions {
|
|
|
153
154
|
* @throws {NonPositiveInputError} when `amount` or the computed share cap is not positive.
|
|
154
155
|
* @throws {ExpiredDeadlineError} when `deadline` is not in the future at handle creation or
|
|
155
156
|
* at any `getRequirements()` call.
|
|
156
|
-
* @throws {InputExceedsMaxError} when `amount` or `deadline` exceeds uint256 at handle creation
|
|
157
|
+
* @throws {InputExceedsMaxError} when `amount` or `deadline` exceeds uint256 at handle creation,
|
|
158
|
+
* or when the vault's liquidity adapter is a Midnight adapter and `amount` exceeds the vault's
|
|
159
|
+
* idle assets.
|
|
157
160
|
* @throws {NegativeInputError} when `referralFeePct` or `slippageTolerance` is negative.
|
|
158
161
|
* @throws {ReferralFeePctExceededError} when `referralFeePct` is at least WAD.
|
|
159
162
|
* @throws {ReferralFeeRecipientMissingError} when a positive referral fee has no nonzero recipient.
|
|
@@ -218,7 +221,24 @@ export interface VaultV2Actions {
|
|
|
218
221
|
* @throws {NonPositiveInputError} when `shares` is not positive.
|
|
219
222
|
* @throws {ExpiredDeadlineError} when `deadline` is not in the future at handle creation or
|
|
220
223
|
* requirement resolution.
|
|
221
|
-
* @throws {InputExceedsMaxError} when `shares` or `deadline` exceeds uint256
|
|
224
|
+
* @throws {InputExceedsMaxError} when `shares` or `deadline` exceeds uint256, or from
|
|
225
|
+
* `getRequirements()` when the vault's liquidity adapter is a Midnight adapter and `shares`
|
|
226
|
+
* are worth more than the vault's idle assets.
|
|
227
|
+
* @throws {UnknownBlueFactory} from `getRequirements()` when the configured chain has no VaultV2 factory.
|
|
228
|
+
* @throws {UnknownBlueOfFactory} from `getRequirements()` when the vault is not a VaultV2 from the
|
|
229
|
+
* configured factory.
|
|
230
|
+
* @throws {UnsupportedBlueVaultV2AdapterError} from `getRequirements()` when the vault or one of its
|
|
231
|
+
* adapters uses an unsupported adapter class.
|
|
232
|
+
* @throws {UnsupportedBlueMarketIrmError} from `getRequirements()` when the vault's liquidity adapter
|
|
233
|
+
* is a Midnight adapter and accrual projects an underlying market with positive debt that uses an
|
|
234
|
+
* unsupported IRM.
|
|
235
|
+
* @throws {UnknownBlueMarketAllocationError} from `getRequirements()` when the vault's liquidity
|
|
236
|
+
* adapter is a Midnight adapter and accrual meets a nested Vault V1 withdraw queue market without
|
|
237
|
+
* allocation data.
|
|
238
|
+
* @throws {InvalidMidnightPositionLossFactorError} from `getRequirements()` when the vault's liquidity
|
|
239
|
+
* adapter is a Midnight adapter and accrual meets a market loss factor below a position's.
|
|
240
|
+
* @throws {InvalidMidnightPositionAccrualStateError} from `getRequirements()` when the vault's
|
|
241
|
+
* liquidity adapter is a Midnight adapter and accrual meets invalid Midnight position inputs.
|
|
222
242
|
* @throws {NegativeInputError} when `referralFeePct` is negative.
|
|
223
243
|
* @throws {ReferralFeePctExceededError} when `referralFeePct` is not below WAD.
|
|
224
244
|
* @throws {ReferralFeeRecipientMissingError} when a positive fee has no non-zero recipient.
|
|
@@ -226,7 +246,7 @@ export interface VaultV2Actions {
|
|
|
226
246
|
* @throws {UnknownAddressError} when VaultBundlesV1 is not registered on the target chain.
|
|
227
247
|
* @throws {MissingContractCodeError} from `getRequirements()` when a fixed bundles or protocol
|
|
228
248
|
* contract has no code at its registered address.
|
|
229
|
-
* @throws {viem.BaseError} from `getRequirements()` when
|
|
249
|
+
* @throws {viem.BaseError} from `getRequirements()` when a vault-state, allowance, nonce, `eth_chainId`, or
|
|
230
250
|
* `eth_getCode` read fails.
|
|
231
251
|
* @throws {UnknownTokenError} from `getRequirements()` when the share token fetched by
|
|
232
252
|
* `getData()` has unusable decimals.
|
|
@@ -303,9 +323,11 @@ export interface VaultV2Actions {
|
|
|
303
323
|
* @throws {InputExceedsMaxError} when `deadline` exceeds `uint256`.
|
|
304
324
|
* @throws {ExpiredDeadlineError} when `deadline` is not in the future at handle creation or
|
|
305
325
|
* requirement resolution.
|
|
306
|
-
* @throws {VaultV2SingleAdapterRequiredError} when the vault does not have one adapter
|
|
326
|
+
* @throws {VaultV2SingleAdapterRequiredError} when the vault does not have one adapter, including
|
|
327
|
+
* a vault that mixes Blue and Midnight adapters.
|
|
307
328
|
* @throws {AdapterNotPartOfVaultError} when `adapter` is not the vault's adapter.
|
|
308
|
-
* @throws {VaultV2UnsupportedExitAdapterError} when the adapter is not a MorphoMarketV1AdapterV2
|
|
329
|
+
* @throws {VaultV2UnsupportedExitAdapterError} when the adapter is not a MorphoMarketV1AdapterV2,
|
|
330
|
+
* including a Midnight adapter.
|
|
309
331
|
* @throws {InKindRedeemCoverageError} when the deduplicated list cannot cover the exit.
|
|
310
332
|
* @throws {UnsupportedChainIdError} when no address registry exists for the target chain.
|
|
311
333
|
* @throws {UnknownAddressError} when VaultExitBundlesV1 is not registered on the target chain.
|
|
@@ -429,9 +451,11 @@ export interface VaultV2Actions {
|
|
|
429
451
|
* @throws {ExpiredDeadlineError} when `deadline` is not in the future at handle creation or
|
|
430
452
|
* requirement resolution.
|
|
431
453
|
* @throws {ExcessiveSlippageToleranceError} when `slippageTolerance` exceeds the SDK maximum.
|
|
432
|
-
* @throws {VaultV2SingleAdapterRequiredError} when the vault does not have exactly one adapter
|
|
454
|
+
* @throws {VaultV2SingleAdapterRequiredError} when the vault does not have exactly one adapter,
|
|
455
|
+
* including a vault that mixes Blue and Midnight adapters.
|
|
433
456
|
* @throws {AdapterNotPartOfVaultError} when `adapter` is not the vault's adapter.
|
|
434
|
-
* @throws {VaultV2UnsupportedExitAdapterError} when the adapter is not a MorphoMarketV1AdapterV2
|
|
457
|
+
* @throws {VaultV2UnsupportedExitAdapterError} when the adapter is not a MorphoMarketV1AdapterV2,
|
|
458
|
+
* including a Midnight adapter.
|
|
435
459
|
* @throws {VaultV2UnsupportedLiquidityAdapterError} when the vault routes liquidity through
|
|
436
460
|
* another adapter.
|
|
437
461
|
* @throws {VaultV2UndecodableLiquidityDataError} when the vault's `liquidityData` does not decode
|
|
@@ -19,6 +19,11 @@ const index_js_4 = require("../requirements/index.js");
|
|
|
19
19
|
// Maximum accepted deadline horizon; the on-chain management fee is capped at 5%/yr so the
|
|
20
20
|
// accrual model stays well-defined inside it.
|
|
21
21
|
const VAULT_V2_FEE_PROJECTION_HORIZON = morpho_ts_1.Time.s.from.y(1n);
|
|
22
|
+
/**
|
|
23
|
+
* Midnight adapters revert vault-initiated `allocate` and `deallocate` (`SelfAllocationOnly`), so a
|
|
24
|
+
* vault routing liquidity through one accepts no deposit and serves exits from idle assets only.
|
|
25
|
+
*/
|
|
26
|
+
const isMidnightLiquidityAdapter = (vaultData) => vaultData.accrualLiquidityAdapter?.type === "VaultV2MidnightAdapter";
|
|
22
27
|
/** Binds a viem client to a Vault V2 vault's action builders. */
|
|
23
28
|
class MorphoVaultV2 {
|
|
24
29
|
client;
|
|
@@ -82,6 +87,13 @@ class MorphoVaultV2 {
|
|
|
82
87
|
// The native path must target the chain's registered wrapped-native asset.
|
|
83
88
|
(0, validate_js_1.validateNativeVaultAsset)(this.chainId, vaultAsset);
|
|
84
89
|
}
|
|
90
|
+
if (isMidnightLiquidityAdapter(vaultData)) {
|
|
91
|
+
throw new index_js_3.InputExceedsMaxError({
|
|
92
|
+
field: funding.value > 0n ? "nativeAmount" : "amount",
|
|
93
|
+
value: funding.assets,
|
|
94
|
+
max: 0n,
|
|
95
|
+
});
|
|
96
|
+
}
|
|
85
97
|
const referralFeeAssets = (0, common_js_1.getBundlesReferralFeeAssets)(funding.assets, common.referralFeePct);
|
|
86
98
|
const maxSharePrice = (0, index_js_2.computeVaultMaxSharePrice)({
|
|
87
99
|
vaultData,
|
|
@@ -165,6 +177,14 @@ class MorphoVaultV2 {
|
|
|
165
177
|
throw new index_js_3.NonPositiveInputError("amount", amount);
|
|
166
178
|
// Reject values outside the ABI range before resolving any requirements.
|
|
167
179
|
(0, validate_js_1.validateUint256Field)("amount", amount);
|
|
180
|
+
if (isMidnightLiquidityAdapter(vaultData) &&
|
|
181
|
+
amount > vaultData.assetBalance) {
|
|
182
|
+
throw new index_js_3.InputExceedsMaxError({
|
|
183
|
+
field: "amount",
|
|
184
|
+
value: amount,
|
|
185
|
+
max: vaultData.assetBalance,
|
|
186
|
+
});
|
|
187
|
+
}
|
|
168
188
|
const createdAt = morpho_ts_1.Time.timestamp();
|
|
169
189
|
const deadline = params.deadline ?? createdAt + morpho_ts_1.Time.s.from.h(2n);
|
|
170
190
|
if (deadline <= createdAt)
|
|
@@ -255,8 +275,20 @@ class MorphoVaultV2 {
|
|
|
255
275
|
if (deadline <= now)
|
|
256
276
|
throw new index_js_3.ExpiredDeadlineError(deadline, now);
|
|
257
277
|
await this.assertWriteTargets(["bundles.vaultBundlesV1"]);
|
|
278
|
+
const vaultData = await this.getData();
|
|
279
|
+
if (isMidnightLiquidityAdapter(vaultData)) {
|
|
280
|
+
// Onchain redeem accrues interest before converting shares to assets.
|
|
281
|
+
const { vault: accrued } = vaultData.accrueInterest(now);
|
|
282
|
+
if (accrued.toAssets(shares) > accrued.assetBalance) {
|
|
283
|
+
throw new index_js_3.InputExceedsMaxError({
|
|
284
|
+
field: "shares",
|
|
285
|
+
value: shares,
|
|
286
|
+
max: accrued.toShares(accrued.assetBalance),
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
}
|
|
258
290
|
return (0, getVaultBundlesSharesRequirements_js_1.getVaultBundlesSharesRequirements)(this.client.viemClient, {
|
|
259
|
-
vaultData
|
|
291
|
+
vaultData,
|
|
260
292
|
version: "vaultV2",
|
|
261
293
|
owner: userAddress,
|
|
262
294
|
chainId: this.chainId,
|
|
@@ -39,8 +39,9 @@ export interface InputVaultV2BlueReallocationData {
|
|
|
39
39
|
/**
|
|
40
40
|
* Immutable-by-convention state container for Vault V2 BluePublicAllocator simulations.
|
|
41
41
|
*
|
|
42
|
-
* Constructor inputs are cloned
|
|
43
|
-
*
|
|
42
|
+
* Constructor inputs are cloned, except Midnight adapter snapshots: those are
|
|
43
|
+
* shared by reference and must be treated as read-only. Every simulated
|
|
44
|
+
* reallocation returns a new instance. Planning keeps the transaction-scoped `firstTotalAssets`
|
|
44
45
|
* denominator outside the durable snapshot while applying reallocations in
|
|
45
46
|
* contract order. Penalty donations update simulated vault accounting but are
|
|
46
47
|
* excluded from same-plan idle liquidity so round-up dust cannot create
|
|
@@ -100,7 +101,8 @@ export declare class VaultV2BlueReallocationData implements InputVaultV2BlueReal
|
|
|
100
101
|
/**
|
|
101
102
|
* Clones the complete simulation snapshot.
|
|
102
103
|
*
|
|
103
|
-
* @returns A deep clone of this simulation state.
|
|
104
|
+
* @returns A deep clone of this simulation state. Midnight adapter snapshots are
|
|
105
|
+
* shared by reference and must be treated as read-only.
|
|
104
106
|
* @example
|
|
105
107
|
* ```ts
|
|
106
108
|
* import { markets } from "@morpho-org/morpho-test";
|
|
@@ -369,12 +371,18 @@ export declare class VaultV2BlueReallocationData implements InputVaultV2BlueReal
|
|
|
369
371
|
* (two hours by default; `0n` disables it). When an operation's plan would
|
|
370
372
|
* come within `allocatorCapHeadroom` (1% of the cap by default) of a target
|
|
371
373
|
* BluePublicAllocator cap, the plan is reduced to the larger of the
|
|
372
|
-
* operation's absolute shortfall and what
|
|
373
|
-
*
|
|
374
|
-
*
|
|
375
|
-
*
|
|
376
|
-
* only the shortfall
|
|
377
|
-
*
|
|
374
|
+
* operation's absolute shortfall and what unbound legs moved (legs that
|
|
375
|
+
* neither come within the headroom of an allocator cap nor take nearly all
|
|
376
|
+
* of their source vault's idle). The kept headroom absorbs other allocations
|
|
377
|
+
* up to that share of the cap landing before inclusion. The plan uses the
|
|
378
|
+
* full cap only when the shortfall needs it, and can then still revert if
|
|
379
|
+
* another allocation lands first.
|
|
380
|
+
* Idle legs that together leave at most `allocatorCapHeadroom` of a source
|
|
381
|
+
* vault's starting idle are bound the same way, so an operation without
|
|
382
|
+
* shortfall whose plan draws only on such idle plans no reallocation.
|
|
383
|
+
* A plan of only the shortfall leaves the market fully utilized, so a
|
|
384
|
+
* competing borrow or withdraw landing first can also make it revert. For
|
|
385
|
+
* market-source reallocations
|
|
378
386
|
* the source position's interest is also reserved on cap ids shared with the
|
|
379
387
|
* target, and reserves persist across every leg of a plan. Targets with no remaining supply
|
|
380
388
|
* or allocator capacity are skipped before projecting source interest. The
|