@morpho-org/morpho-sdk 5.4.1 → 5.6.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/README.md +23 -7
- package/lib/cjs/abis.d.ts +314 -1
- package/lib/cjs/abis.js +169 -1
- package/lib/cjs/actions/blue/borrow.d.ts +21 -15
- package/lib/cjs/actions/blue/borrow.js +25 -18
- package/lib/cjs/actions/blue/buildAssetFundingActions.d.ts +1 -1
- package/lib/cjs/actions/blue/buildAssetFundingActions.js +1 -1
- package/lib/cjs/actions/blue/buildReallocationActions.d.ts +62 -19
- package/lib/cjs/actions/blue/buildReallocationActions.js +123 -27
- package/lib/cjs/actions/blue/refinance.d.ts +14 -7
- package/lib/cjs/actions/blue/refinance.js +18 -10
- package/lib/cjs/actions/blue/supplyCollateralBorrow.d.ts +28 -19
- package/lib/cjs/actions/blue/supplyCollateralBorrow.js +39 -23
- package/lib/cjs/actions/blue/withdraw.d.ts +20 -13
- package/lib/cjs/actions/blue/withdraw.js +23 -18
- package/lib/cjs/actions/requirements/encode/encodeErc20Approval.d.ts +1 -1
- package/lib/cjs/actions/requirements/encode/encodeErc20Approval.js +9 -2
- package/lib/cjs/actions/requirements/encode/encodeVaultSharesPermit.d.ts +64 -0
- package/lib/cjs/actions/requirements/encode/encodeVaultSharesPermit.js +131 -0
- package/lib/cjs/actions/requirements/encode/index.d.ts +1 -0
- package/lib/cjs/actions/requirements/encode/index.js +1 -0
- package/lib/cjs/actions/requirements/getRequirementsApproval.d.ts +3 -2
- package/lib/cjs/actions/requirements/getRequirementsApproval.js +5 -3
- package/lib/cjs/actions/signatures/getVaultExitBundlesV1PermitStruct.d.ts +52 -0
- package/lib/cjs/actions/signatures/getVaultExitBundlesV1PermitStruct.js +91 -0
- package/lib/cjs/actions/signatures/index.d.ts +1 -0
- package/lib/cjs/actions/signatures/index.js +1 -0
- package/lib/cjs/actions/vaultV1/inKindRedeem.d.ts +54 -0
- package/lib/cjs/actions/vaultV1/inKindRedeem.js +96 -0
- package/lib/cjs/actions/vaultV1/index.d.ts +1 -0
- package/lib/cjs/actions/vaultV1/index.js +1 -0
- package/lib/cjs/actions/vaultV2/inKindRedeem.d.ts +56 -0
- package/lib/cjs/actions/vaultV2/inKindRedeem.js +97 -0
- package/lib/cjs/actions/vaultV2/index.d.ts +1 -0
- package/lib/cjs/actions/vaultV2/index.js +1 -0
- package/lib/cjs/bundler/actions.d.ts +118 -2
- package/lib/cjs/bundler/actions.js +212 -6
- package/lib/cjs/bundler/types.d.ts +20 -0
- package/lib/cjs/constants.d.ts +1 -1
- package/lib/cjs/constants.js +3 -1
- package/lib/cjs/entities/blue/blue.d.ts +365 -76
- package/lib/cjs/entities/blue/blue.js +285 -52
- package/lib/cjs/entities/index.d.ts +2 -1
- package/lib/cjs/entities/index.js +6 -3
- package/lib/cjs/entities/vaultV1/vaultV1.d.ts +82 -4
- package/lib/cjs/entities/vaultV1/vaultV1.js +164 -0
- package/lib/cjs/entities/{reallocationData.d.ts → vaultV1ReallocationData.d.ts} +41 -17
- package/lib/cjs/entities/{reallocationData.js → vaultV1ReallocationData.js} +30 -18
- package/lib/cjs/entities/vaultV2/vaultV2.d.ts +89 -3
- package/lib/cjs/entities/vaultV2/vaultV2.js +181 -0
- package/lib/cjs/entities/vaultV2BlueReallocationData.d.ts +511 -0
- package/lib/cjs/entities/vaultV2BlueReallocationData.js +1311 -0
- package/lib/{esm/helpers/computeReallocations.d.ts → cjs/helpers/computeVaultV1Reallocations.d.ts} +14 -8
- package/lib/cjs/helpers/{computeReallocations.js → computeVaultV1Reallocations.js} +27 -13
- package/lib/cjs/helpers/constant.d.ts +5 -3
- package/lib/cjs/helpers/constant.js +6 -4
- package/lib/cjs/helpers/index.d.ts +3 -2
- package/lib/cjs/helpers/index.js +8 -3
- package/lib/cjs/helpers/previewVaultV2InKindRedeem.d.ts +49 -0
- package/lib/cjs/helpers/previewVaultV2InKindRedeem.js +73 -0
- package/lib/cjs/helpers/validate.d.ts +31 -15
- package/lib/cjs/helpers/validate.js +140 -27
- package/lib/cjs/helpers/validateRequirementSpender.d.ts +1 -1
- package/lib/cjs/helpers/validateRequirementSpender.js +2 -1
- package/lib/cjs/types/action.d.ts +33 -1
- package/lib/cjs/types/error.d.ts +363 -5
- package/lib/cjs/types/error.js +455 -6
- package/lib/cjs/types/sharedLiquidity.d.ts +72 -8
- package/lib/cjs/utils.d.ts +2 -2
- package/lib/cjs/utils.js +6 -4
- package/lib/esm/abis.d.ts +314 -1
- package/lib/esm/abis.js +167 -1
- package/lib/esm/actions/blue/borrow.d.ts +21 -15
- package/lib/esm/actions/blue/borrow.js +26 -19
- package/lib/esm/actions/blue/buildAssetFundingActions.d.ts +1 -1
- package/lib/esm/actions/blue/buildAssetFundingActions.js +1 -1
- package/lib/esm/actions/blue/buildReallocationActions.d.ts +62 -19
- package/lib/esm/actions/blue/buildReallocationActions.js +119 -25
- package/lib/esm/actions/blue/refinance.d.ts +14 -7
- package/lib/esm/actions/blue/refinance.js +19 -11
- package/lib/esm/actions/blue/supplyCollateralBorrow.d.ts +28 -19
- package/lib/esm/actions/blue/supplyCollateralBorrow.js +40 -24
- package/lib/esm/actions/blue/withdraw.d.ts +20 -13
- package/lib/esm/actions/blue/withdraw.js +24 -19
- package/lib/esm/actions/requirements/encode/encodeErc20Approval.d.ts +1 -1
- package/lib/esm/actions/requirements/encode/encodeErc20Approval.js +9 -2
- package/lib/esm/actions/requirements/encode/encodeVaultSharesPermit.d.ts +64 -0
- package/lib/esm/actions/requirements/encode/encodeVaultSharesPermit.js +127 -0
- package/lib/esm/actions/requirements/encode/index.d.ts +1 -0
- package/lib/esm/actions/requirements/encode/index.js +1 -0
- package/lib/esm/actions/requirements/getRequirementsApproval.d.ts +3 -2
- package/lib/esm/actions/requirements/getRequirementsApproval.js +5 -3
- package/lib/esm/actions/signatures/getVaultExitBundlesV1PermitStruct.d.ts +52 -0
- package/lib/esm/actions/signatures/getVaultExitBundlesV1PermitStruct.js +87 -0
- package/lib/esm/actions/signatures/index.d.ts +1 -0
- package/lib/esm/actions/signatures/index.js +1 -0
- package/lib/esm/actions/vaultV1/inKindRedeem.d.ts +54 -0
- package/lib/esm/actions/vaultV1/inKindRedeem.js +92 -0
- package/lib/esm/actions/vaultV1/index.d.ts +1 -0
- package/lib/esm/actions/vaultV1/index.js +1 -0
- package/lib/esm/actions/vaultV2/inKindRedeem.d.ts +56 -0
- package/lib/esm/actions/vaultV2/inKindRedeem.js +93 -0
- package/lib/esm/actions/vaultV2/index.d.ts +1 -0
- package/lib/esm/actions/vaultV2/index.js +1 -0
- package/lib/esm/bundler/actions.d.ts +118 -2
- package/lib/esm/bundler/actions.js +215 -9
- package/lib/esm/bundler/types.d.ts +20 -0
- package/lib/esm/constants.d.ts +1 -1
- package/lib/esm/constants.js +1 -1
- package/lib/esm/entities/blue/blue.d.ts +362 -73
- package/lib/esm/entities/blue/blue.js +288 -55
- package/lib/esm/entities/index.d.ts +2 -1
- package/lib/esm/entities/index.js +2 -1
- package/lib/esm/entities/vaultV1/vaultV1.d.ts +80 -2
- package/lib/esm/entities/vaultV1/vaultV1.js +170 -6
- package/lib/esm/entities/{reallocationData.d.ts → vaultV1ReallocationData.d.ts} +41 -17
- package/lib/esm/entities/{reallocationData.js → vaultV1ReallocationData.js} +33 -16
- package/lib/esm/entities/vaultV2/vaultV2.d.ts +88 -2
- package/lib/esm/entities/vaultV2/vaultV2.js +187 -6
- package/lib/esm/entities/vaultV2BlueReallocationData.d.ts +511 -0
- package/lib/esm/entities/vaultV2BlueReallocationData.js +1307 -0
- package/lib/{cjs/helpers/computeReallocations.d.ts → esm/helpers/computeVaultV1Reallocations.d.ts} +14 -8
- package/lib/esm/helpers/{computeReallocations.js → computeVaultV1Reallocations.js} +25 -11
- package/lib/esm/helpers/constant.d.ts +5 -3
- package/lib/esm/helpers/constant.js +5 -3
- package/lib/esm/helpers/index.d.ts +3 -2
- package/lib/esm/helpers/index.js +3 -2
- package/lib/esm/helpers/previewVaultV2InKindRedeem.d.ts +49 -0
- package/lib/esm/helpers/previewVaultV2InKindRedeem.js +70 -0
- package/lib/esm/helpers/validate.d.ts +31 -15
- package/lib/esm/helpers/validate.js +141 -30
- package/lib/esm/helpers/validateRequirementSpender.d.ts +1 -1
- package/lib/esm/helpers/validateRequirementSpender.js +2 -1
- package/lib/esm/types/action.d.ts +33 -1
- package/lib/esm/types/error.d.ts +363 -5
- package/lib/esm/types/error.js +428 -4
- package/lib/esm/types/sharedLiquidity.d.ts +72 -8
- package/lib/esm/utils.d.ts +2 -2
- package/lib/esm/utils.js +2 -2
- package/package.json +9 -11
package/lib/cjs/utils.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.validateUserAddress = exports.validateSlippageTolerance = exports.validateRepayShares = exports.validateRepayAmount = exports.validateReallocations = exports.validatePositionHealthAfterWithdraw = exports.validatePositionHealth = exports.validateNativeAsset = exports.validateChainId = exports.validateAccrualPosition = exports.computeMinBorrowSharePrice = void 0;
|
|
3
|
+
exports.computeVaultV1Reallocations = exports.computeReallocations = exports.values = exports.transformValue = exports.Time = exports.retryPromiseLinearBackoff = exports.mergeEntries = exports.keys = exports.isNotUndefined = exports.isNotNull = exports.isDefined = exports.hasValue = exports.getValue = exports.getSubdomainBaseUrl = exports.getLastDefined = exports.getLast = exports.fromEntries = exports.filterDefined = exports.entries = exports.deepFreeze = exports.createHasValue = exports.createGetValue = exports.bigIntComparator = exports.TreeUtils = exports.TickLib = exports.TakeAmountsLib = exports.SetterRatifierUtils = exports.RatifierUtils = exports.Payload = exports.OfferUtils = exports.GroupUtils = exports.EcrecoverRatifierUtils = exports.safeParseUnits = exports.safeParseNumber = exports.safeGetAddress = exports.restructure = exports.readContractRestructured = exports.optionalBoolean = exports.getPermitTypedData = exports.getPermit2TransferFromTypedData = exports.getPermit2PermitTypedData = exports.getAuthorizationTypedData = exports.decodeBytes32String = exports.VaultV2Utils = exports.VaultUtils = exports.SharesMath = exports.MathLib = exports.MarketUtils = exports.CapacityLimitReason = exports.AdaptiveCurveIrmLib = void 0;
|
|
4
|
+
exports.validateUserAddress = exports.validateSlippageTolerance = exports.validateRepayShares = exports.validateRepayAmount = exports.validateReallocations = exports.validatePositionHealthAfterWithdraw = exports.validatePositionHealth = exports.validateNativeAsset = exports.validateChainId = exports.validateAccrualPosition = exports.computeMinBorrowSharePrice = exports.computeMaxRepaySharePrice = exports.addTransactionMetadata = void 0;
|
|
5
5
|
var blue_sdk_1 = require("@morpho-org/blue-sdk");
|
|
6
6
|
Object.defineProperty(exports, "AdaptiveCurveIrmLib", { enumerable: true, get: function () { return blue_sdk_1.AdaptiveCurveIrmLib; } });
|
|
7
7
|
Object.defineProperty(exports, "CapacityLimitReason", { enumerable: true, get: function () { return blue_sdk_1.CapacityLimitReason; } });
|
|
@@ -9,6 +9,7 @@ Object.defineProperty(exports, "MarketUtils", { enumerable: true, get: function
|
|
|
9
9
|
Object.defineProperty(exports, "MathLib", { enumerable: true, get: function () { return blue_sdk_1.MathLib; } });
|
|
10
10
|
Object.defineProperty(exports, "SharesMath", { enumerable: true, get: function () { return blue_sdk_1.SharesMath; } });
|
|
11
11
|
Object.defineProperty(exports, "VaultUtils", { enumerable: true, get: function () { return blue_sdk_1.VaultUtils; } });
|
|
12
|
+
Object.defineProperty(exports, "VaultV2Utils", { enumerable: true, get: function () { return blue_sdk_1.VaultV2Utils; } });
|
|
12
13
|
var blue_sdk_viem_1 = require("@morpho-org/blue-sdk-viem");
|
|
13
14
|
Object.defineProperty(exports, "decodeBytes32String", { enumerable: true, get: function () { return blue_sdk_viem_1.decodeBytes32String; } });
|
|
14
15
|
Object.defineProperty(exports, "getAuthorizationTypedData", { enumerable: true, get: function () { return blue_sdk_viem_1.getAuthorizationTypedData; } });
|
|
@@ -53,8 +54,9 @@ Object.defineProperty(exports, "retryPromiseLinearBackoff", { enumerable: true,
|
|
|
53
54
|
Object.defineProperty(exports, "Time", { enumerable: true, get: function () { return morpho_ts_1.Time; } });
|
|
54
55
|
Object.defineProperty(exports, "transformValue", { enumerable: true, get: function () { return morpho_ts_1.transformValue; } });
|
|
55
56
|
Object.defineProperty(exports, "values", { enumerable: true, get: function () { return morpho_ts_1.values; } });
|
|
56
|
-
var
|
|
57
|
-
Object.defineProperty(exports, "computeReallocations", { enumerable: true, get: function () { return
|
|
57
|
+
var computeVaultV1Reallocations_js_1 = require("./helpers/computeVaultV1Reallocations.js");
|
|
58
|
+
Object.defineProperty(exports, "computeReallocations", { enumerable: true, get: function () { return computeVaultV1Reallocations_js_1.computeReallocations; } });
|
|
59
|
+
Object.defineProperty(exports, "computeVaultV1Reallocations", { enumerable: true, get: function () { return computeVaultV1Reallocations_js_1.computeVaultV1Reallocations; } });
|
|
58
60
|
var metadata_js_1 = require("./helpers/metadata.js");
|
|
59
61
|
Object.defineProperty(exports, "addTransactionMetadata", { enumerable: true, get: function () { return metadata_js_1.addTransactionMetadata; } });
|
|
60
62
|
var slippage_js_1 = require("./helpers/slippage.js");
|
package/lib/esm/abis.d.ts
CHANGED
|
@@ -1,6 +1,319 @@
|
|
|
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, preLiquidationAbi, preLiquidationFactoryAbi, publicAllocatorAbi, vaultV1AdapterAbi, vaultV1AdapterFactoryAbi, vaultV2Abi, vaultV2FactoryAbi, whitelistControllerAggregatorV2Abi, wrappedBackedTokenAbi, wstEthAbi, } from "@morpho-org/blue-sdk-viem";
|
|
2
|
+
export { adaptiveCurveIrmAbi, blueAbi, blueOracleAbi, erc2612Abi, erc5267Abi, metaMorphoAbi, metaMorphoFactoryAbi, morphoMarketV1AdapterAbi, morphoMarketV1AdapterFactoryAbi, morphoMarketV1AdapterV2Abi, morphoMarketV1AdapterV2FactoryAbi, morphoVaultV1AdapterAbi, morphoVaultV1AdapterFactoryAbi, permissionedErc20WrapperAbi, permit2Abi, preLiquidationAbi, preLiquidationFactoryAbi, publicAllocatorAbi, vaultV1AdapterAbi, vaultV1AdapterFactoryAbi, vaultV1PublicAllocatorAbi, vaultV2Abi, vaultV2BluePublicAllocatorAbi, vaultV2FactoryAbi, whitelistControllerAggregatorV2Abi, wrappedBackedTokenAbi, wstEthAbi, } from "@morpho-org/blue-sdk-viem";
|
|
3
3
|
export { ecrecoverRatifierAbi, midnightAbi, midnightBundlesAbi, setterRatifierAbi, } from "@morpho-org/midnight-sdk";
|
|
4
|
+
/** ABI for the VaultExitBundlesV1 periphery contract. */
|
|
5
|
+
export declare const vaultExitBundlesV1Abi: readonly [{
|
|
6
|
+
readonly type: "constructor";
|
|
7
|
+
readonly inputs: readonly [{
|
|
8
|
+
readonly name: "_blue";
|
|
9
|
+
readonly type: "address";
|
|
10
|
+
readonly internalType: "address";
|
|
11
|
+
}];
|
|
12
|
+
readonly stateMutability: "nonpayable";
|
|
13
|
+
}, {
|
|
14
|
+
readonly type: "error";
|
|
15
|
+
readonly name: "AdapterNotPartOfVault";
|
|
16
|
+
readonly inputs: readonly [];
|
|
17
|
+
}, {
|
|
18
|
+
readonly type: "error";
|
|
19
|
+
readonly name: "AlreadyInitiated";
|
|
20
|
+
readonly inputs: readonly [];
|
|
21
|
+
}, {
|
|
22
|
+
readonly type: "error";
|
|
23
|
+
readonly name: "ApproveReturnedFalse";
|
|
24
|
+
readonly inputs: readonly [];
|
|
25
|
+
}, {
|
|
26
|
+
readonly type: "error";
|
|
27
|
+
readonly name: "DeadlinePassed";
|
|
28
|
+
readonly inputs: readonly [];
|
|
29
|
+
}, {
|
|
30
|
+
readonly type: "error";
|
|
31
|
+
readonly name: "InvalidAdaptersLength";
|
|
32
|
+
readonly inputs: readonly [];
|
|
33
|
+
}, {
|
|
34
|
+
readonly type: "error";
|
|
35
|
+
readonly name: "MorphoMismatch";
|
|
36
|
+
readonly inputs: readonly [];
|
|
37
|
+
}, {
|
|
38
|
+
readonly type: "error";
|
|
39
|
+
readonly name: "NoCode";
|
|
40
|
+
readonly inputs: readonly [];
|
|
41
|
+
}, {
|
|
42
|
+
readonly type: "error";
|
|
43
|
+
readonly name: "PctExceeded";
|
|
44
|
+
readonly inputs: readonly [];
|
|
45
|
+
}, {
|
|
46
|
+
readonly type: "error";
|
|
47
|
+
readonly name: "SlippageExceeded";
|
|
48
|
+
readonly inputs: readonly [];
|
|
49
|
+
}, {
|
|
50
|
+
readonly type: "error";
|
|
51
|
+
readonly name: "TransferReturnedFalse";
|
|
52
|
+
readonly inputs: readonly [];
|
|
53
|
+
}, {
|
|
54
|
+
readonly type: "error";
|
|
55
|
+
readonly name: "UnauthorizedCallback";
|
|
56
|
+
readonly inputs: readonly [];
|
|
57
|
+
}, {
|
|
58
|
+
readonly type: "function";
|
|
59
|
+
readonly name: "BLUE";
|
|
60
|
+
readonly inputs: readonly [];
|
|
61
|
+
readonly outputs: readonly [{
|
|
62
|
+
readonly name: "";
|
|
63
|
+
readonly type: "address";
|
|
64
|
+
readonly internalType: "address";
|
|
65
|
+
}];
|
|
66
|
+
readonly stateMutability: "view";
|
|
67
|
+
}, {
|
|
68
|
+
readonly type: "function";
|
|
69
|
+
readonly name: "initiator";
|
|
70
|
+
readonly inputs: readonly [];
|
|
71
|
+
readonly outputs: readonly [{
|
|
72
|
+
readonly name: "";
|
|
73
|
+
readonly type: "address";
|
|
74
|
+
readonly internalType: "address";
|
|
75
|
+
}];
|
|
76
|
+
readonly stateMutability: "view";
|
|
77
|
+
}, {
|
|
78
|
+
readonly type: "function";
|
|
79
|
+
readonly name: "onMorphoFlashLoan";
|
|
80
|
+
readonly inputs: readonly [{
|
|
81
|
+
readonly name: "exitAssets";
|
|
82
|
+
readonly type: "uint256";
|
|
83
|
+
readonly internalType: "uint256";
|
|
84
|
+
}, {
|
|
85
|
+
readonly name: "data";
|
|
86
|
+
readonly type: "bytes";
|
|
87
|
+
readonly internalType: "bytes";
|
|
88
|
+
}];
|
|
89
|
+
readonly outputs: readonly [];
|
|
90
|
+
readonly stateMutability: "nonpayable";
|
|
91
|
+
}, {
|
|
92
|
+
readonly type: "function";
|
|
93
|
+
readonly name: "onMorphoSupply";
|
|
94
|
+
readonly inputs: readonly [{
|
|
95
|
+
readonly name: "assets";
|
|
96
|
+
readonly type: "uint256";
|
|
97
|
+
readonly internalType: "uint256";
|
|
98
|
+
}, {
|
|
99
|
+
readonly name: "data";
|
|
100
|
+
readonly type: "bytes";
|
|
101
|
+
readonly internalType: "bytes";
|
|
102
|
+
}];
|
|
103
|
+
readonly outputs: readonly [];
|
|
104
|
+
readonly stateMutability: "nonpayable";
|
|
105
|
+
}, {
|
|
106
|
+
readonly type: "function";
|
|
107
|
+
readonly name: "vaultExitBundlesV1ForceWithdrawVaultV2";
|
|
108
|
+
readonly inputs: readonly [{
|
|
109
|
+
readonly name: "vault";
|
|
110
|
+
readonly type: "address";
|
|
111
|
+
readonly internalType: "address";
|
|
112
|
+
}, {
|
|
113
|
+
readonly name: "adapter";
|
|
114
|
+
readonly type: "address";
|
|
115
|
+
readonly internalType: "address";
|
|
116
|
+
}, {
|
|
117
|
+
readonly name: "exitAssets";
|
|
118
|
+
readonly type: "uint256";
|
|
119
|
+
readonly internalType: "uint256";
|
|
120
|
+
}, {
|
|
121
|
+
readonly name: "minSharePriceE27";
|
|
122
|
+
readonly type: "uint256";
|
|
123
|
+
readonly internalType: "uint256";
|
|
124
|
+
}, {
|
|
125
|
+
readonly name: "sharesPermit";
|
|
126
|
+
readonly type: "tuple";
|
|
127
|
+
readonly internalType: "struct Permit";
|
|
128
|
+
readonly components: readonly [{
|
|
129
|
+
readonly name: "value";
|
|
130
|
+
readonly type: "uint256";
|
|
131
|
+
readonly internalType: "uint256";
|
|
132
|
+
}, {
|
|
133
|
+
readonly name: "nonce";
|
|
134
|
+
readonly type: "uint256";
|
|
135
|
+
readonly internalType: "uint256";
|
|
136
|
+
}, {
|
|
137
|
+
readonly name: "deadline";
|
|
138
|
+
readonly type: "uint256";
|
|
139
|
+
readonly internalType: "uint256";
|
|
140
|
+
}, {
|
|
141
|
+
readonly name: "v";
|
|
142
|
+
readonly type: "uint8";
|
|
143
|
+
readonly internalType: "uint8";
|
|
144
|
+
}, {
|
|
145
|
+
readonly name: "r";
|
|
146
|
+
readonly type: "bytes32";
|
|
147
|
+
readonly internalType: "bytes32";
|
|
148
|
+
}, {
|
|
149
|
+
readonly name: "s";
|
|
150
|
+
readonly type: "bytes32";
|
|
151
|
+
readonly internalType: "bytes32";
|
|
152
|
+
}];
|
|
153
|
+
}, {
|
|
154
|
+
readonly name: "referralFeePct";
|
|
155
|
+
readonly type: "uint256";
|
|
156
|
+
readonly internalType: "uint256";
|
|
157
|
+
}, {
|
|
158
|
+
readonly name: "referralFeeRecipient";
|
|
159
|
+
readonly type: "address";
|
|
160
|
+
readonly internalType: "address";
|
|
161
|
+
}, {
|
|
162
|
+
readonly name: "deadline";
|
|
163
|
+
readonly type: "uint256";
|
|
164
|
+
readonly internalType: "uint256";
|
|
165
|
+
}];
|
|
166
|
+
readonly outputs: readonly [];
|
|
167
|
+
readonly stateMutability: "nonpayable";
|
|
168
|
+
}, {
|
|
169
|
+
readonly type: "function";
|
|
170
|
+
readonly name: "vaultExitBundlesV1InKindRedemptionVaultV1";
|
|
171
|
+
readonly inputs: readonly [{
|
|
172
|
+
readonly name: "vault";
|
|
173
|
+
readonly type: "address";
|
|
174
|
+
readonly internalType: "address";
|
|
175
|
+
}, {
|
|
176
|
+
readonly name: "marketParamsList";
|
|
177
|
+
readonly type: "tuple[]";
|
|
178
|
+
readonly internalType: "struct MarketParams[]";
|
|
179
|
+
readonly components: readonly [{
|
|
180
|
+
readonly name: "loanToken";
|
|
181
|
+
readonly type: "address";
|
|
182
|
+
readonly internalType: "address";
|
|
183
|
+
}, {
|
|
184
|
+
readonly name: "collateralToken";
|
|
185
|
+
readonly type: "address";
|
|
186
|
+
readonly internalType: "address";
|
|
187
|
+
}, {
|
|
188
|
+
readonly name: "oracle";
|
|
189
|
+
readonly type: "address";
|
|
190
|
+
readonly internalType: "address";
|
|
191
|
+
}, {
|
|
192
|
+
readonly name: "irm";
|
|
193
|
+
readonly type: "address";
|
|
194
|
+
readonly internalType: "address";
|
|
195
|
+
}, {
|
|
196
|
+
readonly name: "lltv";
|
|
197
|
+
readonly type: "uint256";
|
|
198
|
+
readonly internalType: "uint256";
|
|
199
|
+
}];
|
|
200
|
+
}, {
|
|
201
|
+
readonly name: "exitAssets";
|
|
202
|
+
readonly type: "uint256";
|
|
203
|
+
readonly internalType: "uint256";
|
|
204
|
+
}, {
|
|
205
|
+
readonly name: "sharesPermit";
|
|
206
|
+
readonly type: "tuple";
|
|
207
|
+
readonly internalType: "struct Permit";
|
|
208
|
+
readonly components: readonly [{
|
|
209
|
+
readonly name: "value";
|
|
210
|
+
readonly type: "uint256";
|
|
211
|
+
readonly internalType: "uint256";
|
|
212
|
+
}, {
|
|
213
|
+
readonly name: "nonce";
|
|
214
|
+
readonly type: "uint256";
|
|
215
|
+
readonly internalType: "uint256";
|
|
216
|
+
}, {
|
|
217
|
+
readonly name: "deadline";
|
|
218
|
+
readonly type: "uint256";
|
|
219
|
+
readonly internalType: "uint256";
|
|
220
|
+
}, {
|
|
221
|
+
readonly name: "v";
|
|
222
|
+
readonly type: "uint8";
|
|
223
|
+
readonly internalType: "uint8";
|
|
224
|
+
}, {
|
|
225
|
+
readonly name: "r";
|
|
226
|
+
readonly type: "bytes32";
|
|
227
|
+
readonly internalType: "bytes32";
|
|
228
|
+
}, {
|
|
229
|
+
readonly name: "s";
|
|
230
|
+
readonly type: "bytes32";
|
|
231
|
+
readonly internalType: "bytes32";
|
|
232
|
+
}];
|
|
233
|
+
}, {
|
|
234
|
+
readonly name: "deadline";
|
|
235
|
+
readonly type: "uint256";
|
|
236
|
+
readonly internalType: "uint256";
|
|
237
|
+
}];
|
|
238
|
+
readonly outputs: readonly [];
|
|
239
|
+
readonly stateMutability: "nonpayable";
|
|
240
|
+
}, {
|
|
241
|
+
readonly type: "function";
|
|
242
|
+
readonly name: "vaultExitBundlesV1InKindRedemptionVaultV2";
|
|
243
|
+
readonly inputs: readonly [{
|
|
244
|
+
readonly name: "vault";
|
|
245
|
+
readonly type: "address";
|
|
246
|
+
readonly internalType: "address";
|
|
247
|
+
}, {
|
|
248
|
+
readonly name: "adapter";
|
|
249
|
+
readonly type: "address";
|
|
250
|
+
readonly internalType: "address";
|
|
251
|
+
}, {
|
|
252
|
+
readonly name: "marketParamsList";
|
|
253
|
+
readonly type: "tuple[]";
|
|
254
|
+
readonly internalType: "struct MarketParams[]";
|
|
255
|
+
readonly components: readonly [{
|
|
256
|
+
readonly name: "loanToken";
|
|
257
|
+
readonly type: "address";
|
|
258
|
+
readonly internalType: "address";
|
|
259
|
+
}, {
|
|
260
|
+
readonly name: "collateralToken";
|
|
261
|
+
readonly type: "address";
|
|
262
|
+
readonly internalType: "address";
|
|
263
|
+
}, {
|
|
264
|
+
readonly name: "oracle";
|
|
265
|
+
readonly type: "address";
|
|
266
|
+
readonly internalType: "address";
|
|
267
|
+
}, {
|
|
268
|
+
readonly name: "irm";
|
|
269
|
+
readonly type: "address";
|
|
270
|
+
readonly internalType: "address";
|
|
271
|
+
}, {
|
|
272
|
+
readonly name: "lltv";
|
|
273
|
+
readonly type: "uint256";
|
|
274
|
+
readonly internalType: "uint256";
|
|
275
|
+
}];
|
|
276
|
+
}, {
|
|
277
|
+
readonly name: "exitAssets";
|
|
278
|
+
readonly type: "uint256";
|
|
279
|
+
readonly internalType: "uint256";
|
|
280
|
+
}, {
|
|
281
|
+
readonly name: "sharesPermit";
|
|
282
|
+
readonly type: "tuple";
|
|
283
|
+
readonly internalType: "struct Permit";
|
|
284
|
+
readonly components: readonly [{
|
|
285
|
+
readonly name: "value";
|
|
286
|
+
readonly type: "uint256";
|
|
287
|
+
readonly internalType: "uint256";
|
|
288
|
+
}, {
|
|
289
|
+
readonly name: "nonce";
|
|
290
|
+
readonly type: "uint256";
|
|
291
|
+
readonly internalType: "uint256";
|
|
292
|
+
}, {
|
|
293
|
+
readonly name: "deadline";
|
|
294
|
+
readonly type: "uint256";
|
|
295
|
+
readonly internalType: "uint256";
|
|
296
|
+
}, {
|
|
297
|
+
readonly name: "v";
|
|
298
|
+
readonly type: "uint8";
|
|
299
|
+
readonly internalType: "uint8";
|
|
300
|
+
}, {
|
|
301
|
+
readonly name: "r";
|
|
302
|
+
readonly type: "bytes32";
|
|
303
|
+
readonly internalType: "bytes32";
|
|
304
|
+
}, {
|
|
305
|
+
readonly name: "s";
|
|
306
|
+
readonly type: "bytes32";
|
|
307
|
+
readonly internalType: "bytes32";
|
|
308
|
+
}];
|
|
309
|
+
}, {
|
|
310
|
+
readonly name: "deadline";
|
|
311
|
+
readonly type: "uint256";
|
|
312
|
+
readonly internalType: "uint256";
|
|
313
|
+
}];
|
|
314
|
+
readonly outputs: readonly [];
|
|
315
|
+
readonly stateMutability: "nonpayable";
|
|
316
|
+
}];
|
|
4
317
|
/** ABI for the Bundler3 multicall contract. */
|
|
5
318
|
export declare const bundler3Abi: readonly [{
|
|
6
319
|
readonly type: "function";
|
package/lib/esm/abis.js
CHANGED
|
@@ -1,6 +1,172 @@
|
|
|
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, preLiquidationAbi, preLiquidationFactoryAbi, publicAllocatorAbi, vaultV1AdapterAbi, vaultV1AdapterFactoryAbi, vaultV2Abi, vaultV2FactoryAbi, whitelistControllerAggregatorV2Abi, wrappedBackedTokenAbi, wstEthAbi, } from "@morpho-org/blue-sdk-viem";
|
|
2
|
+
export { adaptiveCurveIrmAbi, blueAbi, blueOracleAbi, erc2612Abi, erc5267Abi, metaMorphoAbi, metaMorphoFactoryAbi, morphoMarketV1AdapterAbi, morphoMarketV1AdapterFactoryAbi, morphoMarketV1AdapterV2Abi, morphoMarketV1AdapterV2FactoryAbi, morphoVaultV1AdapterAbi, morphoVaultV1AdapterFactoryAbi, permissionedErc20WrapperAbi, permit2Abi, preLiquidationAbi, preLiquidationFactoryAbi, publicAllocatorAbi, vaultV1AdapterAbi, vaultV1AdapterFactoryAbi, vaultV1PublicAllocatorAbi, vaultV2Abi, vaultV2BluePublicAllocatorAbi, vaultV2FactoryAbi, whitelistControllerAggregatorV2Abi, wrappedBackedTokenAbi, wstEthAbi, } from "@morpho-org/blue-sdk-viem";
|
|
3
3
|
export { ecrecoverRatifierAbi, midnightAbi, midnightBundlesAbi, setterRatifierAbi, } from "@morpho-org/midnight-sdk";
|
|
4
|
+
/** ABI for the VaultExitBundlesV1 periphery contract. */
|
|
5
|
+
export const vaultExitBundlesV1Abi = [
|
|
6
|
+
{
|
|
7
|
+
type: "constructor",
|
|
8
|
+
inputs: [{ name: "_blue", type: "address", internalType: "address" }],
|
|
9
|
+
stateMutability: "nonpayable",
|
|
10
|
+
},
|
|
11
|
+
{ type: "error", name: "AdapterNotPartOfVault", inputs: [] },
|
|
12
|
+
{ type: "error", name: "AlreadyInitiated", inputs: [] },
|
|
13
|
+
{ type: "error", name: "ApproveReturnedFalse", inputs: [] },
|
|
14
|
+
{ type: "error", name: "DeadlinePassed", inputs: [] },
|
|
15
|
+
{ type: "error", name: "InvalidAdaptersLength", inputs: [] },
|
|
16
|
+
{ type: "error", name: "MorphoMismatch", inputs: [] },
|
|
17
|
+
{ type: "error", name: "NoCode", inputs: [] },
|
|
18
|
+
{ type: "error", name: "PctExceeded", inputs: [] },
|
|
19
|
+
{ type: "error", name: "SlippageExceeded", inputs: [] },
|
|
20
|
+
{ type: "error", name: "TransferReturnedFalse", inputs: [] },
|
|
21
|
+
{ type: "error", name: "UnauthorizedCallback", inputs: [] },
|
|
22
|
+
{
|
|
23
|
+
type: "function",
|
|
24
|
+
name: "BLUE",
|
|
25
|
+
inputs: [],
|
|
26
|
+
outputs: [{ name: "", type: "address", internalType: "address" }],
|
|
27
|
+
stateMutability: "view",
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
type: "function",
|
|
31
|
+
name: "initiator",
|
|
32
|
+
inputs: [],
|
|
33
|
+
outputs: [{ name: "", type: "address", internalType: "address" }],
|
|
34
|
+
stateMutability: "view",
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
type: "function",
|
|
38
|
+
name: "onMorphoFlashLoan",
|
|
39
|
+
inputs: [
|
|
40
|
+
{ name: "exitAssets", type: "uint256", internalType: "uint256" },
|
|
41
|
+
{ name: "data", type: "bytes", internalType: "bytes" },
|
|
42
|
+
],
|
|
43
|
+
outputs: [],
|
|
44
|
+
stateMutability: "nonpayable",
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
type: "function",
|
|
48
|
+
name: "onMorphoSupply",
|
|
49
|
+
inputs: [
|
|
50
|
+
{ name: "assets", type: "uint256", internalType: "uint256" },
|
|
51
|
+
{ name: "data", type: "bytes", internalType: "bytes" },
|
|
52
|
+
],
|
|
53
|
+
outputs: [],
|
|
54
|
+
stateMutability: "nonpayable",
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
type: "function",
|
|
58
|
+
name: "vaultExitBundlesV1ForceWithdrawVaultV2",
|
|
59
|
+
inputs: [
|
|
60
|
+
{ name: "vault", type: "address", internalType: "address" },
|
|
61
|
+
{ name: "adapter", type: "address", internalType: "address" },
|
|
62
|
+
{ name: "exitAssets", type: "uint256", internalType: "uint256" },
|
|
63
|
+
{ name: "minSharePriceE27", type: "uint256", internalType: "uint256" },
|
|
64
|
+
{
|
|
65
|
+
name: "sharesPermit",
|
|
66
|
+
type: "tuple",
|
|
67
|
+
internalType: "struct Permit",
|
|
68
|
+
components: [
|
|
69
|
+
{ name: "value", type: "uint256", internalType: "uint256" },
|
|
70
|
+
{ name: "nonce", type: "uint256", internalType: "uint256" },
|
|
71
|
+
{ name: "deadline", type: "uint256", internalType: "uint256" },
|
|
72
|
+
{ name: "v", type: "uint8", internalType: "uint8" },
|
|
73
|
+
{ name: "r", type: "bytes32", internalType: "bytes32" },
|
|
74
|
+
{ name: "s", type: "bytes32", internalType: "bytes32" },
|
|
75
|
+
],
|
|
76
|
+
},
|
|
77
|
+
{ name: "referralFeePct", type: "uint256", internalType: "uint256" },
|
|
78
|
+
{
|
|
79
|
+
name: "referralFeeRecipient",
|
|
80
|
+
type: "address",
|
|
81
|
+
internalType: "address",
|
|
82
|
+
},
|
|
83
|
+
{ name: "deadline", type: "uint256", internalType: "uint256" },
|
|
84
|
+
],
|
|
85
|
+
outputs: [],
|
|
86
|
+
stateMutability: "nonpayable",
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
type: "function",
|
|
90
|
+
name: "vaultExitBundlesV1InKindRedemptionVaultV1",
|
|
91
|
+
inputs: [
|
|
92
|
+
{ name: "vault", type: "address", internalType: "address" },
|
|
93
|
+
{
|
|
94
|
+
name: "marketParamsList",
|
|
95
|
+
type: "tuple[]",
|
|
96
|
+
internalType: "struct MarketParams[]",
|
|
97
|
+
components: [
|
|
98
|
+
{ name: "loanToken", type: "address", internalType: "address" },
|
|
99
|
+
{
|
|
100
|
+
name: "collateralToken",
|
|
101
|
+
type: "address",
|
|
102
|
+
internalType: "address",
|
|
103
|
+
},
|
|
104
|
+
{ name: "oracle", type: "address", internalType: "address" },
|
|
105
|
+
{ name: "irm", type: "address", internalType: "address" },
|
|
106
|
+
{ name: "lltv", type: "uint256", internalType: "uint256" },
|
|
107
|
+
],
|
|
108
|
+
},
|
|
109
|
+
{ name: "exitAssets", type: "uint256", internalType: "uint256" },
|
|
110
|
+
{
|
|
111
|
+
name: "sharesPermit",
|
|
112
|
+
type: "tuple",
|
|
113
|
+
internalType: "struct Permit",
|
|
114
|
+
components: [
|
|
115
|
+
{ name: "value", type: "uint256", internalType: "uint256" },
|
|
116
|
+
{ name: "nonce", type: "uint256", internalType: "uint256" },
|
|
117
|
+
{ name: "deadline", type: "uint256", internalType: "uint256" },
|
|
118
|
+
{ name: "v", type: "uint8", internalType: "uint8" },
|
|
119
|
+
{ name: "r", type: "bytes32", internalType: "bytes32" },
|
|
120
|
+
{ name: "s", type: "bytes32", internalType: "bytes32" },
|
|
121
|
+
],
|
|
122
|
+
},
|
|
123
|
+
{ name: "deadline", type: "uint256", internalType: "uint256" },
|
|
124
|
+
],
|
|
125
|
+
outputs: [],
|
|
126
|
+
stateMutability: "nonpayable",
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
type: "function",
|
|
130
|
+
name: "vaultExitBundlesV1InKindRedemptionVaultV2",
|
|
131
|
+
inputs: [
|
|
132
|
+
{ name: "vault", type: "address", internalType: "address" },
|
|
133
|
+
{ name: "adapter", type: "address", internalType: "address" },
|
|
134
|
+
{
|
|
135
|
+
name: "marketParamsList",
|
|
136
|
+
type: "tuple[]",
|
|
137
|
+
internalType: "struct MarketParams[]",
|
|
138
|
+
components: [
|
|
139
|
+
{ name: "loanToken", type: "address", internalType: "address" },
|
|
140
|
+
{
|
|
141
|
+
name: "collateralToken",
|
|
142
|
+
type: "address",
|
|
143
|
+
internalType: "address",
|
|
144
|
+
},
|
|
145
|
+
{ name: "oracle", type: "address", internalType: "address" },
|
|
146
|
+
{ name: "irm", type: "address", internalType: "address" },
|
|
147
|
+
{ name: "lltv", type: "uint256", internalType: "uint256" },
|
|
148
|
+
],
|
|
149
|
+
},
|
|
150
|
+
{ name: "exitAssets", type: "uint256", internalType: "uint256" },
|
|
151
|
+
{
|
|
152
|
+
name: "sharesPermit",
|
|
153
|
+
type: "tuple",
|
|
154
|
+
internalType: "struct Permit",
|
|
155
|
+
components: [
|
|
156
|
+
{ name: "value", type: "uint256", internalType: "uint256" },
|
|
157
|
+
{ name: "nonce", type: "uint256", internalType: "uint256" },
|
|
158
|
+
{ name: "deadline", type: "uint256", internalType: "uint256" },
|
|
159
|
+
{ name: "v", type: "uint8", internalType: "uint8" },
|
|
160
|
+
{ name: "r", type: "bytes32", internalType: "bytes32" },
|
|
161
|
+
{ name: "s", type: "bytes32", internalType: "bytes32" },
|
|
162
|
+
],
|
|
163
|
+
},
|
|
164
|
+
{ name: "deadline", type: "uint256", internalType: "uint256" },
|
|
165
|
+
],
|
|
166
|
+
outputs: [],
|
|
167
|
+
stateMutability: "nonpayable",
|
|
168
|
+
},
|
|
169
|
+
];
|
|
4
170
|
/** ABI for the Bundler3 multicall contract. */
|
|
5
171
|
export const bundler3Abi = [
|
|
6
172
|
{
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { MarketParams } from "@morpho-org/blue-sdk";
|
|
2
2
|
import type { Address } from "viem";
|
|
3
|
-
import { type AuthorizationRequirementSignature, type BlueBorrowAction, type
|
|
3
|
+
import { type AuthorizationRequirementSignature, type BlueBorrowAction, type BlueReallocationPlan, type Metadata, type Transaction } from "../../types/index.js";
|
|
4
4
|
/** Parameters for {@link blueBorrow}. */
|
|
5
5
|
export interface BlueBorrowParams {
|
|
6
6
|
market: {
|
|
@@ -14,8 +14,8 @@ export interface BlueBorrowParams {
|
|
|
14
14
|
receiver: Address;
|
|
15
15
|
/** Minimum borrow share price (in ray). Protects against share price manipulation. */
|
|
16
16
|
minSharePrice: bigint;
|
|
17
|
-
/** Vault reallocations to execute before borrowing
|
|
18
|
-
reallocations?:
|
|
17
|
+
/** Homogeneous Vault V1 or Vault V2 reallocations to execute before borrowing. */
|
|
18
|
+
reallocations?: BlueReallocationPlan;
|
|
19
19
|
/**
|
|
20
20
|
* Optional signed Morpho authorization. When provided, a `setAuthorizationWithSig` call is
|
|
21
21
|
* prepended to the bundle so GeneralAdapter1 is authorized in-bundle instead of via a
|
|
@@ -32,17 +32,18 @@ export interface BlueBorrowParams {
|
|
|
32
32
|
* `onBehalf`. Uses `minSharePrice` to protect against share price manipulation between
|
|
33
33
|
* transaction construction and execution.
|
|
34
34
|
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
* accumulate in `tx.value
|
|
35
|
+
* A `reallocations` plan contains either PublicAllocator V1 entries or Vault V2
|
|
36
|
+
* BluePublicAllocator entries, never both. The calls run before the borrow.
|
|
37
|
+
* V1 fees accumulate in `tx.value`; V2 penalties are paid in the target loan
|
|
38
|
+
* token and donated directly to each vault.
|
|
38
39
|
*
|
|
39
40
|
* @param params.market.chainId - The chain the market lives on.
|
|
40
41
|
* @param params.market.marketParams - Market params (loanToken, collateralToken, oracle, irm, lltv).
|
|
41
42
|
* @param params.args.amount - Loan asset amount to borrow, in the loan token's smallest unit.
|
|
42
43
|
* @param params.args.receiver - Address that receives the borrowed assets.
|
|
43
44
|
* @param params.args.minSharePrice - Minimum borrow share price (in ray). Slippage protection.
|
|
44
|
-
* @param params.args.reallocations - Optional
|
|
45
|
-
*
|
|
45
|
+
* @param params.args.reallocations - Optional homogeneous Vault V1 or Vault V2 reallocations to
|
|
46
|
+
* execute before borrowing.
|
|
46
47
|
* @param params.args.authorizationSignature - Optional signed Morpho authorization; when present,
|
|
47
48
|
* a `setAuthorizationWithSig` call is prepended to the bundle.
|
|
48
49
|
* @param params.metadata - Optional analytics metadata attached to the bundle.
|
|
@@ -50,13 +51,18 @@ export interface BlueBorrowParams {
|
|
|
50
51
|
* typed `action` discriminator the simulation layer consumes.
|
|
51
52
|
* @throws {NonPositiveInputError} when `amount <= 0n` or any reallocation withdrawal amount
|
|
52
53
|
* is non-positive.
|
|
53
|
-
* @throws {
|
|
54
|
-
* @throws {
|
|
55
|
-
*
|
|
56
|
-
* @throws {
|
|
57
|
-
*
|
|
58
|
-
* @throws {
|
|
59
|
-
*
|
|
54
|
+
* @throws {InputExceedsMaxError} when a V2 reallocation asset amount exceeds `uint128` or its penalty exceeds WAD.
|
|
55
|
+
* @throws {InconsistentReallocationPenaltyError} when V2 entries for one vault use different penalties.
|
|
56
|
+
* @throws {InvalidReallocationAddressError} when a V2 vault or adapter address is malformed.
|
|
57
|
+
* @throws {InvalidReallocationSourceTypeError} when a V2 source is absent, incomplete, or has an unknown discriminator.
|
|
58
|
+
* @throws {InvalidReallocationShapeError} when an entry matches both or neither V1/V2 shape.
|
|
59
|
+
* @throws {MixedReallocationVersionsError} when one plan contains both V1 and V2 entries.
|
|
60
|
+
* @throws {NegativeInputError} when `minSharePrice < 0n`, a V1 fee, or a V2 penalty is negative.
|
|
61
|
+
* @throws {EmptyReallocationWithdrawalsError} when any `reallocation.withdrawals` is empty.
|
|
62
|
+
* @throws {ReallocationWithdrawalOnTargetMarketError} when any reallocation withdrawal references
|
|
63
|
+
* the target market.
|
|
64
|
+
* @throws {UnsortedReallocationWithdrawalsError} when reallocation withdrawals are not strictly
|
|
65
|
+
* sorted by market id.
|
|
60
66
|
* @example
|
|
61
67
|
* ```ts
|
|
62
68
|
* import { blueBorrow } from "@morpho-org/morpho-sdk";
|