@morpho-org/morpho-sdk 8.2.0-next.0 → 8.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/MIGRATION-v7-to-v8.md +7 -3
- package/README.md +11 -1
- package/lib/cjs/abis.d.ts +1 -1
- package/lib/cjs/abis.js +1 -5
- package/lib/cjs/actions/blue/repayWithdrawCollateral.js +1 -0
- package/lib/cjs/actions/blue/supply.js +7 -5
- package/lib/cjs/actions/blue/supplyCollateralBorrow.js +10 -8
- package/lib/cjs/actions/blue/withdraw.js +10 -6
- package/lib/cjs/actions/midnight/redeem.d.ts +1 -0
- package/lib/cjs/actions/midnight/redeem.js +4 -0
- package/lib/cjs/actions/midnight/supplyCollateral.d.ts +1 -0
- package/lib/cjs/actions/midnight/supplyCollateral.js +4 -0
- package/lib/cjs/blue/abis.d.ts +1 -1
- package/lib/cjs/blue/abis.js +1 -5
- package/lib/cjs/blue/entities.d.ts +4 -4
- package/lib/cjs/blue/entities.js +1 -3
- package/lib/cjs/blue/errors.d.ts +2 -2
- package/lib/cjs/blue/errors.js +1 -5
- package/lib/cjs/blue/fetch.d.ts +2 -2
- package/lib/cjs/blue/fetch.js +1 -3
- package/lib/cjs/blue/utils.d.ts +1 -1
- package/lib/cjs/blue/utils.js +1 -2
- package/lib/cjs/entities/index.d.ts +4 -4
- package/lib/cjs/entities/index.js +1 -3
- package/lib/cjs/entities/midnight/midnight.d.ts +3 -1
- package/lib/cjs/entities/midnight/midnight.js +3 -1
- package/lib/cjs/entities/midnight/types.d.ts +4 -3
- package/lib/cjs/entities/vaultV2/vaultV2.d.ts +9 -33
- package/lib/cjs/entities/vaultV2/vaultV2.js +1 -33
- package/lib/cjs/entities/vaultV2BlueReallocationData.d.ts +3 -5
- package/lib/cjs/entities/vaultV2BlueReallocationData.js +3 -9
- package/lib/cjs/errors.d.ts +4 -4
- package/lib/cjs/errors.js +5 -10
- package/lib/cjs/fetch.d.ts +2 -2
- package/lib/cjs/fetch.js +1 -3
- package/lib/cjs/midnight/errors.d.ts +1 -2
- package/lib/cjs/midnight/errors.js +4 -5
- package/lib/cjs/types/action.d.ts +22 -0
- package/lib/cjs/types/error.d.ts +8 -0
- package/lib/cjs/types/error.js +15 -2
- package/lib/cjs/utils.d.ts +2 -2
- package/lib/cjs/utils.js +2 -4
- package/lib/esm/abis.d.ts +1 -1
- package/lib/esm/abis.js +1 -1
- package/lib/esm/actions/blue/repayWithdrawCollateral.js +1 -0
- package/lib/esm/actions/blue/supply.js +2 -0
- package/lib/esm/actions/blue/supplyCollateralBorrow.js +2 -0
- package/lib/esm/actions/blue/withdraw.js +4 -0
- package/lib/esm/actions/midnight/redeem.d.ts +1 -0
- package/lib/esm/actions/midnight/redeem.js +6 -2
- package/lib/esm/actions/midnight/supplyCollateral.d.ts +1 -0
- package/lib/esm/actions/midnight/supplyCollateral.js +6 -2
- 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/midnight/midnight.d.ts +3 -1
- package/lib/esm/entities/midnight/midnight.js +3 -1
- package/lib/esm/entities/midnight/types.d.ts +4 -3
- package/lib/esm/entities/vaultV2/vaultV2.d.ts +9 -33
- package/lib/esm/entities/vaultV2/vaultV2.js +1 -33
- package/lib/esm/entities/vaultV2BlueReallocationData.d.ts +3 -5
- package/lib/esm/entities/vaultV2BlueReallocationData.js +3 -9
- 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 +1 -2
- package/lib/esm/midnight/errors.js +1 -2
- package/lib/esm/types/action.d.ts +22 -0
- package/lib/esm/types/error.d.ts +8 -0
- package/lib/esm/types/error.js +12 -0
- package/lib/esm/utils.d.ts +2 -2
- package/lib/esm/utils.js +2 -2
- package/package.json +7 -7
package/MIGRATION-v7-to-v8.md
CHANGED
|
@@ -142,9 +142,13 @@ Get `positionData` from
|
|
|
142
142
|
`midnight.getPositionData({ marketId: marketData.id, accountAddress })`. For each collateral index,
|
|
143
143
|
read `price()` from the oracle at `marketData.params.collateralParams[i].oracle` with viem's
|
|
144
144
|
`readContract`. Prices use `ORACLE_PRICE_SCALE` and must be in the same index order as the market's
|
|
145
|
-
collateral parameters.
|
|
146
|
-
debt
|
|
147
|
-
|
|
145
|
+
collateral parameters. `takeBorrow` and `supplyCollateralTakeBorrow` always need prices, because
|
|
146
|
+
debt after a borrow is always positive. `takeRepayWithdrawCollateral` and
|
|
147
|
+
`repayWithdrawCollateral` need prices only when `collateralWithdrawals` is non-empty and the SDK's
|
|
148
|
+
conservative post-operation debt is positive. For these two methods, pass `collateralPrices: []`
|
|
149
|
+
when there is no collateral withdrawal, including a partial repayment that leaves debt, or when the
|
|
150
|
+
conservative post-operation debt is zero, such as after a `full` repay, a repayment units target
|
|
151
|
+
covering `positionData.debt`, or `minUnits` / `repay.assets` covering it. For example:
|
|
148
152
|
|
|
149
153
|
```ts
|
|
150
154
|
midnight.takeBorrow({
|
package/README.md
CHANGED
|
@@ -62,7 +62,7 @@ then call `buildTx()` without a separate root signature.
|
|
|
62
62
|
|
|
63
63
|
`VaultExitBundlesV1`, `VaultBundlesV1`, and `BlueBundlesV1` are registered on Ethereum, Base,
|
|
64
64
|
Arbitrum, Optimism, Polygon, World Chain, Unichain, HyperEVM, Katana, Monad, Stable, Tempo,
|
|
65
|
-
Robinhood Chain, and
|
|
65
|
+
Robinhood Chain, Arc, and X Layer. Custom deployments can still be configured with `registerCustomAddresses`.
|
|
66
66
|
|
|
67
67
|
## How it works
|
|
68
68
|
|
|
@@ -78,6 +78,16 @@ prerequisites.
|
|
|
78
78
|
- **`getRequirements()`** — async; the on-chain prerequisites to satisfy first: ERC-20 approvals, permit / Permit2 signatures, Morpho authorization, or (for Midnight) operator authorization.
|
|
79
79
|
- **`buildTx(signatures?)`** — synchronous; the final, deep-frozen viem transaction. Pass any signatures collected from the requirements.
|
|
80
80
|
|
|
81
|
+
Every transaction carries `tx.action` — typed metadata describing the encoded call (`type` plus
|
|
82
|
+
the normalized `args`, including `referralFeeAssets`: the exact referral-fee amount the
|
|
83
|
+
BlueBundlesV1 call charges, where derivable; it is omitted in exact-shares mode
|
|
84
|
+
(`blueWithdraw`, `blueRepay` and `blueRepayWithdrawCollateral` with a shares input),
|
|
85
|
+
where the underlying amount is resolved at execution. On the repay actions it is set
|
|
86
|
+
only for an exact-assets repay (`repayAssets > 0n`), so it is also omitted when
|
|
87
|
+
`blueRepayWithdrawCollateral` has no repay leg).
|
|
88
|
+
`@morpho-org/evm-simulation`'s `toSimulationLimits` consumes this metadata to derive simulation
|
|
89
|
+
limits from an action.
|
|
90
|
+
|
|
81
91
|
```typescript
|
|
82
92
|
const vaultData = await vault.getData();
|
|
83
93
|
const { buildTx, getRequirements } = vault.deposit({ amount, userAddress, vaultData });
|
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,
|
|
2
|
+
export { adaptiveCurveIrmAbi as blueAdaptiveCurveIrmAbi, blueAbi, blueOracleAbi, erc2612Abi, erc5267Abi, metaMorphoAbi, metaMorphoFactoryAbi, 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.
|
|
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;
|
|
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,10 +11,6 @@ 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; } });
|
|
18
14
|
Object.defineProperty(exports, "morphoMarketV1AdapterAbi", { enumerable: true, get: function () { return blue_sdk_viem_1.morphoMarketV1AdapterAbi; } });
|
|
19
15
|
Object.defineProperty(exports, "morphoMarketV1AdapterFactoryAbi", { enumerable: true, get: function () { return blue_sdk_viem_1.morphoMarketV1AdapterFactoryAbi; } });
|
|
20
16
|
Object.defineProperty(exports, "morphoMarketV1AdapterV2Abi", { enumerable: true, get: function () { return blue_sdk_viem_1.morphoMarketV1AdapterV2Abi; } });
|
|
@@ -175,6 +175,7 @@ const blueRepayWithdrawCollateral = (params) => {
|
|
|
175
175
|
nativeAmount: value > 0n ? value : undefined,
|
|
176
176
|
referralFeePct,
|
|
177
177
|
referralFeeRecipient,
|
|
178
|
+
referralFeeAssets: repayAssets > 0n ? minimumRepayAssets - repayAssets : undefined,
|
|
178
179
|
deadline: params.args.deadline,
|
|
179
180
|
},
|
|
180
181
|
},
|
|
@@ -5,7 +5,8 @@ const viem_1 = require("viem");
|
|
|
5
5
|
const abis_js_1 = require("../../abis.js");
|
|
6
6
|
const validate_js_1 = require("../../helpers/validate.js");
|
|
7
7
|
const index_js_1 = require("../../types/index.js");
|
|
8
|
-
const common_js_1 = require("
|
|
8
|
+
const common_js_1 = require("../bundles/common.js");
|
|
9
|
+
const common_js_2 = require("./common.js");
|
|
9
10
|
/**
|
|
10
11
|
* Encodes a direct BlueBundlesV1 loan-asset supply transaction.
|
|
11
12
|
*
|
|
@@ -74,22 +75,22 @@ const blueSupply = (params) => {
|
|
|
74
75
|
referralFeeRecipient: params.args.referralFeeRecipient,
|
|
75
76
|
metadata: params.metadata,
|
|
76
77
|
};
|
|
77
|
-
const { referralFeePct, referralFeeRecipient } = (0,
|
|
78
|
-
const value = (0,
|
|
78
|
+
const { referralFeePct, referralFeeRecipient } = (0, common_js_2.normalizeBlueBundlesV1CommonParams)(common);
|
|
79
|
+
const value = (0, common_js_2.validateBlueBundlesV1NativeFunding)({
|
|
79
80
|
chainId,
|
|
80
81
|
token: marketParams.loanToken,
|
|
81
82
|
fundedAmount: assets,
|
|
82
83
|
nativeAmount: params.args.nativeAmount,
|
|
83
84
|
requirementSignature,
|
|
84
85
|
});
|
|
85
|
-
const tokenPermit = (0,
|
|
86
|
+
const tokenPermit = (0, common_js_2.getBlueBundlesV1TokenPermit)({
|
|
86
87
|
chainId,
|
|
87
88
|
userAddress,
|
|
88
89
|
token: marketParams.loanToken,
|
|
89
90
|
amount: assets,
|
|
90
91
|
requirementSignature,
|
|
91
92
|
});
|
|
92
|
-
return (0,
|
|
93
|
+
return (0, common_js_2.finalizeBlueBundlesV1Transaction)({
|
|
93
94
|
common,
|
|
94
95
|
value,
|
|
95
96
|
data: (0, viem_1.encodeFunctionData)({
|
|
@@ -113,6 +114,7 @@ const blueSupply = (params) => {
|
|
|
113
114
|
nativeAmount: value > 0n ? value : undefined,
|
|
114
115
|
referralFeePct,
|
|
115
116
|
referralFeeRecipient,
|
|
117
|
+
referralFeeAssets: (0, common_js_1.getBundlesReferralFeeAssets)(assets, referralFeePct),
|
|
116
118
|
deadline: params.args.deadline,
|
|
117
119
|
},
|
|
118
120
|
},
|
|
@@ -5,7 +5,8 @@ const viem_1 = require("viem");
|
|
|
5
5
|
const abis_js_1 = require("../../abis.js");
|
|
6
6
|
const validate_js_1 = require("../../helpers/validate.js");
|
|
7
7
|
const index_js_1 = require("../../types/index.js");
|
|
8
|
-
const common_js_1 = require("
|
|
8
|
+
const common_js_1 = require("../bundles/common.js");
|
|
9
|
+
const common_js_2 = require("./common.js");
|
|
9
10
|
/**
|
|
10
11
|
* Encodes a direct BlueBundlesV1 collateral supply and/or borrow transaction.
|
|
11
12
|
*
|
|
@@ -104,28 +105,28 @@ const blueSupplyCollateralBorrow = (params) => {
|
|
|
104
105
|
referralFeeRecipient: params.args.referralFeeRecipient,
|
|
105
106
|
metadata: params.metadata,
|
|
106
107
|
};
|
|
107
|
-
const { referralFeePct, referralFeeRecipient } = (0,
|
|
108
|
-
const value = (0,
|
|
108
|
+
const { referralFeePct, referralFeeRecipient } = (0, common_js_2.normalizeBlueBundlesV1CommonParams)(common);
|
|
109
|
+
const value = (0, common_js_2.validateBlueBundlesV1NativeFunding)({
|
|
109
110
|
chainId,
|
|
110
111
|
token: marketParams.collateralToken,
|
|
111
112
|
fundedAmount: collateralAssets,
|
|
112
113
|
nativeAmount: params.args.nativeAmount,
|
|
113
114
|
requirementSignature,
|
|
114
115
|
});
|
|
115
|
-
const collateralPermit = (0,
|
|
116
|
+
const collateralPermit = (0, common_js_2.getBlueBundlesV1TokenPermit)({
|
|
116
117
|
chainId,
|
|
117
118
|
userAddress,
|
|
118
119
|
token: marketParams.collateralToken,
|
|
119
120
|
amount: collateralAssets,
|
|
120
121
|
requirementSignature,
|
|
121
122
|
});
|
|
122
|
-
const signedAuthorization = (0,
|
|
123
|
+
const signedAuthorization = (0, common_js_2.getBlueBundlesV1SignedAuthorization)({
|
|
123
124
|
chainId,
|
|
124
125
|
userAddress,
|
|
125
126
|
authorizationSignature,
|
|
126
127
|
});
|
|
127
|
-
const publicAllocations = (0,
|
|
128
|
-
const reallocationPenaltyAssets = (0,
|
|
128
|
+
const publicAllocations = (0, common_js_2.getBlueBundlesV1PublicAllocations)(reallocations, marketParams);
|
|
129
|
+
const reallocationPenaltyAssets = (0, common_js_2.getBlueBundlesV1PenaltyAssets)(publicAllocations);
|
|
129
130
|
if (reallocationPenaltyAssets > borrowAssets) {
|
|
130
131
|
throw new index_js_1.InputExceedsMaxError({
|
|
131
132
|
field: "reallocationPenaltyAssets",
|
|
@@ -133,7 +134,7 @@ const blueSupplyCollateralBorrow = (params) => {
|
|
|
133
134
|
max: borrowAssets,
|
|
134
135
|
});
|
|
135
136
|
}
|
|
136
|
-
return (0,
|
|
137
|
+
return (0, common_js_2.finalizeBlueBundlesV1Transaction)({
|
|
137
138
|
common,
|
|
138
139
|
value,
|
|
139
140
|
data: (0, viem_1.encodeFunctionData)({
|
|
@@ -165,6 +166,7 @@ const blueSupplyCollateralBorrow = (params) => {
|
|
|
165
166
|
reallocationPenaltyAssets,
|
|
166
167
|
referralFeePct,
|
|
167
168
|
referralFeeRecipient,
|
|
169
|
+
referralFeeAssets: (0, common_js_1.getBundlesReferralFeeAssets)(borrowAssets - reallocationPenaltyAssets, referralFeePct),
|
|
168
170
|
deadline: params.args.deadline,
|
|
169
171
|
},
|
|
170
172
|
},
|
|
@@ -5,7 +5,8 @@ const viem_1 = require("viem");
|
|
|
5
5
|
const abis_js_1 = require("../../abis.js");
|
|
6
6
|
const validate_js_1 = require("../../helpers/validate.js");
|
|
7
7
|
const index_js_1 = require("../../types/index.js");
|
|
8
|
-
const common_js_1 = require("
|
|
8
|
+
const common_js_1 = require("../bundles/common.js");
|
|
9
|
+
const common_js_2 = require("./common.js");
|
|
9
10
|
/**
|
|
10
11
|
* Encodes a direct BlueBundlesV1 loan-asset withdrawal transaction.
|
|
11
12
|
*
|
|
@@ -82,14 +83,14 @@ const blueWithdraw = (params) => {
|
|
|
82
83
|
referralFeeRecipient: params.args.referralFeeRecipient,
|
|
83
84
|
metadata: params.metadata,
|
|
84
85
|
};
|
|
85
|
-
const { referralFeePct, referralFeeRecipient } = (0,
|
|
86
|
-
const signedAuthorization = (0,
|
|
86
|
+
const { referralFeePct, referralFeeRecipient } = (0, common_js_2.normalizeBlueBundlesV1CommonParams)(common);
|
|
87
|
+
const signedAuthorization = (0, common_js_2.getBlueBundlesV1SignedAuthorization)({
|
|
87
88
|
chainId,
|
|
88
89
|
userAddress,
|
|
89
90
|
authorizationSignature,
|
|
90
91
|
});
|
|
91
|
-
const publicAllocations = (0,
|
|
92
|
-
const reallocationPenaltyAssets = (0,
|
|
92
|
+
const publicAllocations = (0, common_js_2.getBlueBundlesV1PublicAllocations)([...(params.args.reallocations ?? [])], marketParams);
|
|
93
|
+
const reallocationPenaltyAssets = (0, common_js_2.getBlueBundlesV1PenaltyAssets)(publicAllocations);
|
|
93
94
|
if (withdrawAssets > 0n && reallocationPenaltyAssets > withdrawAssets) {
|
|
94
95
|
throw new index_js_1.InputExceedsMaxError({
|
|
95
96
|
field: "reallocationPenaltyAssets",
|
|
@@ -97,7 +98,7 @@ const blueWithdraw = (params) => {
|
|
|
97
98
|
max: withdrawAssets,
|
|
98
99
|
});
|
|
99
100
|
}
|
|
100
|
-
return (0,
|
|
101
|
+
return (0, common_js_2.finalizeBlueBundlesV1Transaction)({
|
|
101
102
|
common,
|
|
102
103
|
value: 0n,
|
|
103
104
|
data: (0, viem_1.encodeFunctionData)({
|
|
@@ -125,6 +126,9 @@ const blueWithdraw = (params) => {
|
|
|
125
126
|
reallocationPenaltyAssets,
|
|
126
127
|
referralFeePct,
|
|
127
128
|
referralFeeRecipient,
|
|
129
|
+
referralFeeAssets: withdrawAssets > 0n
|
|
130
|
+
? (0, common_js_1.getBundlesReferralFeeAssets)(withdrawAssets - reallocationPenaltyAssets, referralFeePct)
|
|
131
|
+
: undefined,
|
|
128
132
|
deadline: params.args.deadline,
|
|
129
133
|
},
|
|
130
134
|
},
|
|
@@ -30,6 +30,7 @@ export interface MidnightRedeemParams {
|
|
|
30
30
|
* @returns A deep-frozen `Transaction<MidnightRedeemAction>` targeting `Midnight`.
|
|
31
31
|
* @throws {NonPositiveInputError} when `units <= 0n`.
|
|
32
32
|
* @throws {InputExceedsMaxError} when `units` exceeds `uint128`.
|
|
33
|
+
* @throws {MidnightZeroOnBehalfError} when `onBehalf` is the zero address.
|
|
33
34
|
* @throws {ChainIdMismatchError} when the market targets another chain.
|
|
34
35
|
* @throws {MidnightMarketAddressMismatchError} when the market targets another Midnight deployment.
|
|
35
36
|
* @throws {MidnightZeroReceiverError} when `receiver` resolves to the zero address.
|
|
@@ -29,6 +29,7 @@ const index_js_2 = require("../../types/index.js");
|
|
|
29
29
|
* @returns A deep-frozen `Transaction<MidnightRedeemAction>` targeting `Midnight`.
|
|
30
30
|
* @throws {NonPositiveInputError} when `units <= 0n`.
|
|
31
31
|
* @throws {InputExceedsMaxError} when `units` exceeds `uint128`.
|
|
32
|
+
* @throws {MidnightZeroOnBehalfError} when `onBehalf` is the zero address.
|
|
32
33
|
* @throws {ChainIdMismatchError} when the market targets another chain.
|
|
33
34
|
* @throws {MidnightMarketAddressMismatchError} when the market targets another Midnight deployment.
|
|
34
35
|
* @throws {MidnightZeroReceiverError} when `receiver` resolves to the zero address.
|
|
@@ -51,6 +52,9 @@ const midnightRedeem = (params) => {
|
|
|
51
52
|
throw new index_js_2.NonPositiveInputError("units", params.units);
|
|
52
53
|
}
|
|
53
54
|
(0, validateMidnightBounds_js_1.validateMidnightUint128Field)("units", params.units);
|
|
55
|
+
if ((0, viem_1.isAddressEqual)(params.onBehalf, viem_1.zeroAddress)) {
|
|
56
|
+
throw new index_js_2.MidnightZeroOnBehalfError("onBehalf");
|
|
57
|
+
}
|
|
54
58
|
// Reject markets from another chain deployment before encoding the call.
|
|
55
59
|
(0, validateMidnightMarket_js_1.validateMidnightMarket)({ market: params.market, chainId: params.chainId });
|
|
56
60
|
const marketId = midnight_sdk_1.MarketUtils.toId(params.market);
|
|
@@ -27,6 +27,7 @@ export interface MidnightSupplyCollateralParams {
|
|
|
27
27
|
* @returns A deep-frozen `Transaction<MidnightSupplyCollateralAction>` targeting `Midnight`.
|
|
28
28
|
* @throws {NonPositiveInputError} when `assets <= 0n`.
|
|
29
29
|
* @throws {InputExceedsMaxError} when `assets` exceeds `uint128`.
|
|
30
|
+
* @throws {MidnightZeroOnBehalfError} when `onBehalf` is the zero address.
|
|
30
31
|
* @throws {ChainIdMismatchError} when the market targets another chain.
|
|
31
32
|
* @throws {MidnightMarketAddressMismatchError} when the market targets another Midnight deployment.
|
|
32
33
|
* @throws {UnknownCollateralIndexError} when `collateralIndex` is not configured on the market.
|
|
@@ -25,6 +25,7 @@ const index_js_2 = require("../../types/index.js");
|
|
|
25
25
|
* @returns A deep-frozen `Transaction<MidnightSupplyCollateralAction>` targeting `Midnight`.
|
|
26
26
|
* @throws {NonPositiveInputError} when `assets <= 0n`.
|
|
27
27
|
* @throws {InputExceedsMaxError} when `assets` exceeds `uint128`.
|
|
28
|
+
* @throws {MidnightZeroOnBehalfError} when `onBehalf` is the zero address.
|
|
28
29
|
* @throws {ChainIdMismatchError} when the market targets another chain.
|
|
29
30
|
* @throws {MidnightMarketAddressMismatchError} when the market targets another Midnight deployment.
|
|
30
31
|
* @throws {UnknownCollateralIndexError} when `collateralIndex` is not configured on the market.
|
|
@@ -46,6 +47,9 @@ const midnightSupplyCollateral = (params) => {
|
|
|
46
47
|
throw new index_js_2.NonPositiveInputError("assets", params.assets);
|
|
47
48
|
}
|
|
48
49
|
(0, validateMidnightBounds_js_1.validateMidnightUint128Field)("assets", params.assets);
|
|
50
|
+
if ((0, viem_1.isAddressEqual)(params.onBehalf, viem_1.zeroAddress)) {
|
|
51
|
+
throw new index_js_2.MidnightZeroOnBehalfError("onBehalf");
|
|
52
|
+
}
|
|
49
53
|
// Reject markets from another chain deployment before encoding the call.
|
|
50
54
|
(0, validateMidnightMarket_js_1.validateMidnightMarket)({ market: params.market, chainId: params.chainId });
|
|
51
55
|
const marketId = midnight_sdk_1.MarketUtils.toId(params.market);
|
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,
|
|
2
|
+
export { adaptiveCurveIrmAbi, blueAbi, blueOracleAbi, erc2612Abi, erc5267Abi, metaMorphoAbi, metaMorphoFactoryAbi, 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.
|
|
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;
|
|
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,10 +11,6 @@ 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; } });
|
|
18
14
|
Object.defineProperty(exports, "morphoMarketV1AdapterAbi", { enumerable: true, get: function () { return blue_sdk_viem_1.morphoMarketV1AdapterAbi; } });
|
|
19
15
|
Object.defineProperty(exports, "morphoMarketV1AdapterFactoryAbi", { enumerable: true, get: function () { return blue_sdk_viem_1.morphoMarketV1AdapterFactoryAbi; } });
|
|
20
16
|
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,
|
|
1
|
+
export type { IAccrualPosition, IAccrualVault, IAccrualVaultV2, IAccrualVaultV2Adapter, 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,
|
|
6
|
-
export { AccrualPosition, AccrualVault, AccrualVaultV2,
|
|
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
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,
|
|
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/cjs/blue/entities.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WrappedToken = exports.VaultV2MorphoVaultV1Adapter = exports.VaultV2MorphoMarketV1AdapterV2 = exports.VaultV2MorphoMarketV1Adapter = exports.
|
|
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;
|
|
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; } });
|
|
9
8
|
Object.defineProperty(exports, "AccrualVaultV2MorphoMarketV1Adapter", { enumerable: true, get: function () { return blue_sdk_1.AccrualVaultV2MorphoMarketV1Adapter; } });
|
|
10
9
|
Object.defineProperty(exports, "AccrualVaultV2MorphoMarketV1AdapterV2", { enumerable: true, get: function () { return blue_sdk_1.AccrualVaultV2MorphoMarketV1AdapterV2; } });
|
|
11
10
|
Object.defineProperty(exports, "AccrualVaultV2MorphoVaultV1Adapter", { enumerable: true, get: function () { return blue_sdk_1.AccrualVaultV2MorphoVaultV1Adapter; } });
|
|
@@ -33,7 +32,6 @@ Object.defineProperty(exports, "VaultV2", { enumerable: true, get: function () {
|
|
|
33
32
|
Object.defineProperty(exports, "VaultV2Adapter", { enumerable: true, get: function () { return blue_sdk_1.VaultV2Adapter; } });
|
|
34
33
|
Object.defineProperty(exports, "VaultV2BlueMarketPublicAllocatorConfig", { enumerable: true, get: function () { return blue_sdk_1.VaultV2BlueMarketPublicAllocatorConfig; } });
|
|
35
34
|
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; } });
|
|
37
35
|
Object.defineProperty(exports, "VaultV2MorphoMarketV1Adapter", { enumerable: true, get: function () { return blue_sdk_1.VaultV2MorphoMarketV1Adapter; } });
|
|
38
36
|
Object.defineProperty(exports, "VaultV2MorphoMarketV1AdapterV2", { enumerable: true, get: function () { return blue_sdk_1.VaultV2MorphoMarketV1AdapterV2; } });
|
|
39
37
|
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,
|
|
1
|
+
export { BlueErrors, DivisionByZeroError, IncompleteChainRegistryError, InvalidAddressError, InvalidBitLengthError, InvalidMarketParamsError, 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,
|
|
4
|
+
export { getUnsupportedVaultV2Adapter, InvalidNumberError, InvalidPermitDomainChainIdError, InvalidPermitDomainVerifyingContractError, isUnknownOfFactoryError, MalformedTokenMetadataError, MarketParamsIdMismatchError, MissingPermitDomainNameError, NonTupleReturnValueError, UnknownAbiFunctionError, UnnamedAbiOutputsError, 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.
|
|
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;
|
|
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,9 +8,6 @@ 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; } });
|
|
14
11
|
Object.defineProperty(exports, "RegistryValueAlreadyRegisteredError", { enumerable: true, get: function () { return blue_sdk_1.RegistryValueAlreadyRegisteredError; } });
|
|
15
12
|
Object.defineProperty(exports, "UnknownAddressError", { enumerable: true, get: function () { return blue_sdk_1.UnknownAddressError; } });
|
|
16
13
|
Object.defineProperty(exports, "UnknownDataError", { enumerable: true, get: function () { return blue_sdk_1.UnknownDataError; } });
|
|
@@ -39,5 +36,4 @@ Object.defineProperty(exports, "MissingPermitDomainNameError", { enumerable: tru
|
|
|
39
36
|
Object.defineProperty(exports, "NonTupleReturnValueError", { enumerable: true, get: function () { return blue_sdk_viem_1.NonTupleReturnValueError; } });
|
|
40
37
|
Object.defineProperty(exports, "UnknownAbiFunctionError", { enumerable: true, get: function () { return blue_sdk_viem_1.UnknownAbiFunctionError; } });
|
|
41
38
|
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; } });
|
|
43
39
|
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,
|
|
1
|
+
export { fetchAccrualPosition, fetchAccrualVault, fetchAccrualVaultV2, fetchAccrualVaultV2Adapter, 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,
|
|
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/cjs/blue/fetch.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fetchVaultV2MorphoVaultV1Adapter = exports.fetchVaultV2MorphoMarketV1AdapterV2 = exports.fetchVaultV2MorphoMarketV1Adapter = exports.
|
|
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;
|
|
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; } });
|
|
10
9
|
Object.defineProperty(exports, "fetchAccrualVaultV2MorphoMarketV1Adapter", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchAccrualVaultV2MorphoMarketV1Adapter; } });
|
|
11
10
|
Object.defineProperty(exports, "fetchAccrualVaultV2MorphoMarketV1AdapterV2", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchAccrualVaultV2MorphoMarketV1AdapterV2; } });
|
|
12
11
|
Object.defineProperty(exports, "fetchAccrualVaultV2MorphoVaultV1Adapter", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchAccrualVaultV2MorphoVaultV1Adapter; } });
|
|
@@ -30,7 +29,6 @@ Object.defineProperty(exports, "fetchVaultV2Adapter", { enumerable: true, get: f
|
|
|
30
29
|
Object.defineProperty(exports, "fetchVaultV2BlueMarketPublicAllocatorConfig", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchVaultV2BlueMarketPublicAllocatorConfig; } });
|
|
31
30
|
Object.defineProperty(exports, "fetchVaultV2BluePublicAllocatorConfig", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchVaultV2BluePublicAllocatorConfig; } });
|
|
32
31
|
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; } });
|
|
34
32
|
Object.defineProperty(exports, "fetchVaultV2MorphoMarketV1Adapter", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchVaultV2MorphoMarketV1Adapter; } });
|
|
35
33
|
Object.defineProperty(exports, "fetchVaultV2MorphoMarketV1AdapterV2", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchVaultV2MorphoMarketV1AdapterV2; } });
|
|
36
34
|
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,
|
|
6
|
+
getDefaultPreLiquidationParams, MarketUtils, MathLib, SharesMath, VaultUtils, VaultV2BlueMarketPublicAllocatorConfigUtils, VaultV2BluePublicAllocatorConfigUtils, 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.
|
|
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;
|
|
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,7 +14,6 @@ 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; } });
|
|
18
17
|
Object.defineProperty(exports, "VaultV2Utils", { enumerable: true, get: function () { return blue_sdk_1.VaultV2Utils; } });
|
|
19
18
|
var blue_sdk_viem_1 = require("@morpho-org/blue-sdk-viem");
|
|
20
19
|
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,
|
|
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
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,
|
|
6
|
-
export { AccrualPosition as BlueAccrualPosition, AccrualVault, AccrualVaultV2,
|
|
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
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,
|
|
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";
|
|
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,12 +14,11 @@ 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.
|
|
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;
|
|
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; } });
|
|
23
22
|
Object.defineProperty(exports, "AccrualVaultV2MorphoMarketV1Adapter", { enumerable: true, get: function () { return blue_sdk_1.AccrualVaultV2MorphoMarketV1Adapter; } });
|
|
24
23
|
Object.defineProperty(exports, "AccrualVaultV2MorphoMarketV1AdapterV2", { enumerable: true, get: function () { return blue_sdk_1.AccrualVaultV2MorphoMarketV1AdapterV2; } });
|
|
25
24
|
Object.defineProperty(exports, "AccrualVaultV2MorphoVaultV1Adapter", { enumerable: true, get: function () { return blue_sdk_1.AccrualVaultV2MorphoVaultV1Adapter; } });
|
|
@@ -47,7 +46,6 @@ Object.defineProperty(exports, "VaultV2", { enumerable: true, get: function () {
|
|
|
47
46
|
Object.defineProperty(exports, "VaultV2Adapter", { enumerable: true, get: function () { return blue_sdk_1.VaultV2Adapter; } });
|
|
48
47
|
Object.defineProperty(exports, "VaultV2BlueMarketPublicAllocatorConfig", { enumerable: true, get: function () { return blue_sdk_1.VaultV2BlueMarketPublicAllocatorConfig; } });
|
|
49
48
|
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; } });
|
|
51
49
|
Object.defineProperty(exports, "VaultV2MorphoMarketV1Adapter", { enumerable: true, get: function () { return blue_sdk_1.VaultV2MorphoMarketV1Adapter; } });
|
|
52
50
|
Object.defineProperty(exports, "VaultV2MorphoMarketV1AdapterV2", { enumerable: true, get: function () { return blue_sdk_1.VaultV2MorphoMarketV1AdapterV2; } });
|
|
53
51
|
Object.defineProperty(exports, "VaultV2MorphoVaultV1Adapter", { enumerable: true, get: function () { return blue_sdk_1.VaultV2MorphoVaultV1Adapter; } });
|
|
@@ -594,6 +594,7 @@ export declare class MorphoMidnight {
|
|
|
594
594
|
* @throws {NonPositiveInputError} when `collateralAssets` is non-positive.
|
|
595
595
|
* @throws {InputExceedsMaxError} when `collateralAssets` exceeds `uint128`.
|
|
596
596
|
* @throws {NegativeInputError} when `reservedCollateralAssets` is negative.
|
|
597
|
+
* @throws {MidnightZeroOnBehalfError} from `buildTx()` when `accountAddress` is the zero address.
|
|
597
598
|
* @throws {UnknownCollateralIndexError} when the selected collateral is not configured.
|
|
598
599
|
* @throws {ApprovalAmountLessThanSpendAmountError} from `getRequirements()` when `approvalAmount` is below the pulled collateral assets.
|
|
599
600
|
* @example
|
|
@@ -1080,14 +1081,15 @@ export declare class MorphoMidnight {
|
|
|
1080
1081
|
* @throws {MissingAccrualPositionError} when no position snapshot is supplied.
|
|
1081
1082
|
* @throws {AccrualPositionUserMismatchError} when the position snapshot belongs to another account.
|
|
1082
1083
|
* @throws {NoMidnightCreditToRedeemError} when the selected unit amount is non-positive.
|
|
1084
|
+
* @throws {InputExceedsMaxError} when the selected units exceed `uint128`.
|
|
1083
1085
|
* @throws {MidnightRedeemExceedsCreditError} when the selected amount exceeds the accrued
|
|
1084
1086
|
* position credit.
|
|
1085
1087
|
* @throws {InvalidMidnightPositionLossFactorError} when the market loss factor is below the
|
|
1086
1088
|
* position's `lastLossFactor`, which `getPositionData` snapshots never are.
|
|
1087
1089
|
* @throws {InvalidMidnightPositionAccrualStateError} when the snapshot's credit, pending fee or
|
|
1088
1090
|
* loss factor are inconsistent, which `getPositionData` snapshots never are.
|
|
1089
|
-
* @throws {InputExceedsMaxError} when the selected units exceed `uint128`.
|
|
1090
1091
|
* @throws {InsufficientMidnightWithdrawableLiquidityError} when market liquidity cannot cover the redemption.
|
|
1092
|
+
* @throws {MidnightZeroOnBehalfError} when `accountAddress` is the zero address.
|
|
1091
1093
|
* @throws {MidnightZeroReceiverError} when `receiver` resolves to the zero address.
|
|
1092
1094
|
* @throws {MidnightContractReceiverError} when `receiver` is a Midnight protocol contract or a
|
|
1093
1095
|
* market token contract.
|
|
@@ -1062,6 +1062,7 @@ class MorphoMidnight {
|
|
|
1062
1062
|
* @throws {NonPositiveInputError} when `collateralAssets` is non-positive.
|
|
1063
1063
|
* @throws {InputExceedsMaxError} when `collateralAssets` exceeds `uint128`.
|
|
1064
1064
|
* @throws {NegativeInputError} when `reservedCollateralAssets` is negative.
|
|
1065
|
+
* @throws {MidnightZeroOnBehalfError} from `buildTx()` when `accountAddress` is the zero address.
|
|
1065
1066
|
* @throws {UnknownCollateralIndexError} when the selected collateral is not configured.
|
|
1066
1067
|
* @throws {ApprovalAmountLessThanSpendAmountError} from `getRequirements()` when `approvalAmount` is below the pulled collateral assets.
|
|
1067
1068
|
* @example
|
|
@@ -1863,14 +1864,15 @@ class MorphoMidnight {
|
|
|
1863
1864
|
* @throws {MissingAccrualPositionError} when no position snapshot is supplied.
|
|
1864
1865
|
* @throws {AccrualPositionUserMismatchError} when the position snapshot belongs to another account.
|
|
1865
1866
|
* @throws {NoMidnightCreditToRedeemError} when the selected unit amount is non-positive.
|
|
1867
|
+
* @throws {InputExceedsMaxError} when the selected units exceed `uint128`.
|
|
1866
1868
|
* @throws {MidnightRedeemExceedsCreditError} when the selected amount exceeds the accrued
|
|
1867
1869
|
* position credit.
|
|
1868
1870
|
* @throws {InvalidMidnightPositionLossFactorError} when the market loss factor is below the
|
|
1869
1871
|
* position's `lastLossFactor`, which `getPositionData` snapshots never are.
|
|
1870
1872
|
* @throws {InvalidMidnightPositionAccrualStateError} when the snapshot's credit, pending fee or
|
|
1871
1873
|
* loss factor are inconsistent, which `getPositionData` snapshots never are.
|
|
1872
|
-
* @throws {InputExceedsMaxError} when the selected units exceed `uint128`.
|
|
1873
1874
|
* @throws {InsufficientMidnightWithdrawableLiquidityError} when market liquidity cannot cover the redemption.
|
|
1875
|
+
* @throws {MidnightZeroOnBehalfError} when `accountAddress` is the zero address.
|
|
1874
1876
|
* @throws {MidnightZeroReceiverError} when `receiver` resolves to the zero address.
|
|
1875
1877
|
* @throws {MidnightContractReceiverError} when `receiver` is a Midnight protocol contract or a
|
|
1876
1878
|
* market token contract.
|