@morpho-org/morpho-sdk 5.9.0 → 6.0.0-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/MIGRATION-v5-to-v6.md +201 -0
- package/README.md +58 -40
- package/lib/cjs/actions/blue/borrow.d.ts +62 -61
- package/lib/cjs/actions/blue/borrow.js +48 -80
- package/lib/cjs/actions/blue/common.d.ts +99 -0
- package/lib/cjs/actions/blue/common.js +318 -0
- package/lib/cjs/actions/blue/refinance.d.ts +72 -112
- package/lib/cjs/actions/blue/refinance.js +97 -199
- package/lib/cjs/actions/blue/repay.d.ts +72 -68
- package/lib/cjs/actions/blue/repay.js +56 -118
- package/lib/cjs/actions/blue/repayWithdrawCollateral.d.ts +85 -90
- package/lib/cjs/actions/blue/repayWithdrawCollateral.js +148 -137
- package/lib/cjs/actions/blue/supply.d.ts +62 -45
- package/lib/cjs/actions/blue/supply.js +94 -70
- package/lib/cjs/actions/blue/supplyCollateral.d.ts +63 -40
- package/lib/cjs/actions/blue/supplyCollateral.js +52 -69
- package/lib/cjs/actions/blue/supplyCollateralBorrow.d.ts +82 -90
- package/lib/cjs/actions/blue/supplyCollateralBorrow.js +133 -120
- package/lib/cjs/actions/blue/withdraw.d.ts +68 -79
- package/lib/cjs/actions/blue/withdraw.js +101 -97
- package/lib/cjs/actions/blue/withdrawCollateral.d.ts +56 -28
- package/lib/cjs/actions/blue/withdrawCollateral.js +45 -50
- package/lib/cjs/actions/index.d.ts +1 -1
- package/lib/cjs/actions/requirements/blue/getBlueAuthorizationRequirement.d.ts +29 -17
- package/lib/cjs/actions/requirements/blue/getBlueAuthorizationRequirement.js +60 -19
- package/lib/cjs/actions/requirements/blue/getBlueBundlesV1TokenRequirements.d.ts +80 -0
- package/lib/cjs/actions/requirements/blue/getBlueBundlesV1TokenRequirements.js +207 -0
- package/lib/cjs/actions/requirements/blue/getUnusedPermit2Nonce.d.ts +48 -0
- package/lib/cjs/actions/requirements/blue/getUnusedPermit2Nonce.js +72 -0
- package/lib/cjs/actions/requirements/blue/index.d.ts +2 -0
- package/lib/cjs/actions/requirements/blue/index.js +2 -0
- package/lib/cjs/actions/requirements/encode/encodeBlueSignatureAuthorization.d.ts +10 -7
- package/lib/cjs/actions/requirements/encode/encodeBlueSignatureAuthorization.js +30 -5
- package/lib/cjs/actions/requirements/encode/encodeErc20Approval.d.ts +2 -1
- package/lib/cjs/actions/requirements/encode/encodeErc20Approval.js +7 -2
- package/lib/cjs/actions/requirements/encode/encodeErc20Permit.d.ts +16 -7
- package/lib/cjs/actions/requirements/encode/encodeErc20Permit.js +33 -6
- package/lib/cjs/actions/requirements/encode/encodeErc20Permit2TransferFrom.d.ts +61 -0
- package/lib/cjs/actions/requirements/encode/encodeErc20Permit2TransferFrom.js +123 -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/generalAdapter/getGeneralAdapterRequirementsPermit.d.ts +1 -1
- package/lib/cjs/actions/requirements/getRequirementsApproval.d.ts +5 -4
- package/lib/cjs/actions/requirements/getRequirementsApproval.js +5 -4
- package/lib/cjs/actions/signatures/getTokenRequirementActions.d.ts +1 -0
- package/lib/cjs/actions/signatures/getTokenRequirementActions.js +4 -0
- package/lib/cjs/bundler/actions.d.ts +4 -4
- package/lib/cjs/bundler/actions.js +4 -4
- package/lib/cjs/client/morphoViemExtension.d.ts +2 -1
- package/lib/cjs/client/morphoViemExtension.js +2 -1
- package/lib/cjs/entities/blue/blue.d.ts +806 -374
- package/lib/cjs/entities/blue/blue.js +447 -696
- package/lib/cjs/entities/index.d.ts +1 -0
- package/lib/cjs/helpers/computeVaultV1Reallocations.d.ts +3 -9
- package/lib/cjs/helpers/computeVaultV1Reallocations.js +3 -9
- package/lib/cjs/helpers/validate.d.ts +14 -23
- package/lib/cjs/helpers/validate.js +30 -48
- package/lib/cjs/helpers/validateRequirementSpender.d.ts +2 -1
- package/lib/cjs/helpers/validateRequirementSpender.js +2 -0
- package/lib/cjs/types/action.d.ts +146 -162
- package/lib/cjs/types/action.js +29 -2
- package/lib/cjs/types/client.d.ts +9 -0
- package/lib/cjs/types/error.d.ts +141 -14
- package/lib/cjs/types/error.js +198 -21
- package/lib/cjs/types/sharedLiquidity.d.ts +0 -7
- package/lib/esm/actions/blue/borrow.d.ts +62 -61
- package/lib/esm/actions/blue/borrow.js +48 -80
- package/lib/esm/actions/blue/common.d.ts +99 -0
- package/lib/esm/actions/blue/common.js +306 -0
- package/lib/esm/actions/blue/refinance.d.ts +72 -112
- package/lib/esm/actions/blue/refinance.js +98 -200
- package/lib/esm/actions/blue/repay.d.ts +72 -68
- package/lib/esm/actions/blue/repay.js +56 -118
- package/lib/esm/actions/blue/repayWithdrawCollateral.d.ts +85 -90
- package/lib/esm/actions/blue/repayWithdrawCollateral.js +149 -138
- package/lib/esm/actions/blue/supply.d.ts +62 -45
- package/lib/esm/actions/blue/supply.js +94 -70
- package/lib/esm/actions/blue/supplyCollateral.d.ts +63 -40
- package/lib/esm/actions/blue/supplyCollateral.js +52 -69
- package/lib/esm/actions/blue/supplyCollateralBorrow.d.ts +82 -90
- package/lib/esm/actions/blue/supplyCollateralBorrow.js +134 -121
- package/lib/esm/actions/blue/withdraw.d.ts +68 -79
- package/lib/esm/actions/blue/withdraw.js +100 -96
- package/lib/esm/actions/blue/withdrawCollateral.d.ts +56 -28
- package/lib/esm/actions/blue/withdrawCollateral.js +45 -50
- package/lib/esm/actions/index.d.ts +1 -1
- package/lib/esm/actions/requirements/blue/getBlueAuthorizationRequirement.d.ts +29 -17
- package/lib/esm/actions/requirements/blue/getBlueAuthorizationRequirement.js +63 -22
- package/lib/esm/actions/requirements/blue/getBlueBundlesV1TokenRequirements.d.ts +80 -0
- package/lib/esm/actions/requirements/blue/getBlueBundlesV1TokenRequirements.js +203 -0
- package/lib/esm/actions/requirements/blue/getUnusedPermit2Nonce.d.ts +48 -0
- package/lib/esm/actions/requirements/blue/getUnusedPermit2Nonce.js +68 -0
- package/lib/esm/actions/requirements/blue/index.d.ts +2 -0
- package/lib/esm/actions/requirements/blue/index.js +2 -0
- package/lib/esm/actions/requirements/encode/encodeBlueSignatureAuthorization.d.ts +10 -7
- package/lib/esm/actions/requirements/encode/encodeBlueSignatureAuthorization.js +31 -6
- package/lib/esm/actions/requirements/encode/encodeErc20Approval.d.ts +2 -1
- package/lib/esm/actions/requirements/encode/encodeErc20Approval.js +8 -3
- package/lib/esm/actions/requirements/encode/encodeErc20Permit.d.ts +16 -7
- package/lib/esm/actions/requirements/encode/encodeErc20Permit.js +34 -7
- package/lib/esm/actions/requirements/encode/encodeErc20Permit2TransferFrom.d.ts +61 -0
- package/lib/esm/actions/requirements/encode/encodeErc20Permit2TransferFrom.js +119 -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/generalAdapter/getGeneralAdapterRequirementsPermit.d.ts +1 -1
- package/lib/esm/actions/requirements/getRequirementsApproval.d.ts +5 -4
- package/lib/esm/actions/requirements/getRequirementsApproval.js +5 -4
- package/lib/esm/actions/signatures/getTokenRequirementActions.d.ts +1 -0
- package/lib/esm/actions/signatures/getTokenRequirementActions.js +5 -1
- package/lib/esm/bundler/actions.d.ts +4 -4
- package/lib/esm/bundler/actions.js +4 -4
- package/lib/esm/client/morphoViemExtension.d.ts +2 -1
- package/lib/esm/client/morphoViemExtension.js +2 -1
- package/lib/esm/entities/blue/blue.d.ts +806 -374
- package/lib/esm/entities/blue/blue.js +453 -702
- package/lib/esm/entities/index.d.ts +1 -0
- package/lib/esm/helpers/computeVaultV1Reallocations.d.ts +3 -9
- package/lib/esm/helpers/computeVaultV1Reallocations.js +3 -9
- package/lib/esm/helpers/validate.d.ts +14 -23
- package/lib/esm/helpers/validate.js +30 -48
- package/lib/esm/helpers/validateRequirementSpender.d.ts +2 -1
- package/lib/esm/helpers/validateRequirementSpender.js +2 -0
- package/lib/esm/types/action.d.ts +146 -162
- package/lib/esm/types/action.js +28 -2
- package/lib/esm/types/client.d.ts +9 -0
- package/lib/esm/types/error.d.ts +141 -14
- package/lib/esm/types/error.js +184 -17
- package/lib/esm/types/sharedLiquidity.d.ts +0 -7
- package/package.json +4 -3
- package/lib/cjs/actions/blue/buildAssetFundingActions.d.ts +0 -47
- package/lib/cjs/actions/blue/buildAssetFundingActions.js +0 -63
- package/lib/cjs/actions/blue/buildReallocationActions.d.ts +0 -69
- package/lib/cjs/actions/blue/buildReallocationActions.js +0 -141
- package/lib/cjs/actions/blue/resolveRepayFunding.d.ts +0 -66
- package/lib/cjs/actions/blue/resolveRepayFunding.js +0 -85
- package/lib/esm/actions/blue/buildAssetFundingActions.d.ts +0 -47
- package/lib/esm/actions/blue/buildAssetFundingActions.js +0 -59
- package/lib/esm/actions/blue/buildReallocationActions.d.ts +0 -69
- package/lib/esm/actions/blue/buildReallocationActions.js +0 -135
- package/lib/esm/actions/blue/resolveRepayFunding.d.ts +0 -66
- package/lib/esm/actions/blue/resolveRepayFunding.js +0 -81
package/lib/cjs/types/error.d.ts
CHANGED
|
@@ -68,7 +68,7 @@ export declare class InputExceedsMaxError extends Error {
|
|
|
68
68
|
export declare class EmptyMarketParamsListError extends Error {
|
|
69
69
|
constructor();
|
|
70
70
|
}
|
|
71
|
-
/** Thrown when an
|
|
71
|
+
/** Thrown when an SDK operation deadline has already passed. */
|
|
72
72
|
export declare class ExpiredDeadlineError extends Error {
|
|
73
73
|
readonly deadline: bigint;
|
|
74
74
|
readonly timestamp: bigint;
|
|
@@ -203,6 +203,104 @@ export declare class VaultExitBundlesV1PermitMismatchError extends Error {
|
|
|
203
203
|
readonly cause?: unknown;
|
|
204
204
|
});
|
|
205
205
|
}
|
|
206
|
+
/** Thrown when a signed requirement cannot be safely encoded for BlueBundlesV1. */
|
|
207
|
+
export declare class BlueBundlesV1RequirementSignatureMismatchError extends Error {
|
|
208
|
+
/** Field whose signed value or encoding is invalid for the direct BlueBundlesV1 call. */
|
|
209
|
+
readonly field: "type" | "authorized" | "isAuthorized" | "deadline" | "signature";
|
|
210
|
+
/** Value required by BlueBundlesV1. */
|
|
211
|
+
readonly expected: string;
|
|
212
|
+
/** Value supplied by the signed requirement. */
|
|
213
|
+
readonly actual: string;
|
|
214
|
+
/**
|
|
215
|
+
* @param params - Signature mismatch details.
|
|
216
|
+
* @param params.field - Field rejected by the converter.
|
|
217
|
+
* @param params.expected - Value required by the direct route.
|
|
218
|
+
* @param params.actual - Value supplied by the requirement.
|
|
219
|
+
* @param params.cause - Original signature parser failure, when applicable.
|
|
220
|
+
*/
|
|
221
|
+
constructor(params: {
|
|
222
|
+
field: "type" | "authorized" | "isAuthorized" | "deadline" | "signature";
|
|
223
|
+
expected: string;
|
|
224
|
+
actual: string;
|
|
225
|
+
cause?: unknown;
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
/** Thrown when Permit2 SignatureTransfer is selected without an explicit unordered nonce. */
|
|
229
|
+
export declare class MissingPermit2TransferFromNonceError extends Error {
|
|
230
|
+
constructor();
|
|
231
|
+
}
|
|
232
|
+
/** Thrown when an explicit Permit2 SignatureTransfer unordered nonce is already consumed. */
|
|
233
|
+
export declare class Permit2TransferFromNonceAlreadyUsedError extends Error {
|
|
234
|
+
readonly owner: Address;
|
|
235
|
+
readonly nonce: bigint;
|
|
236
|
+
/**
|
|
237
|
+
* @param owner - Permit2 token owner whose nonce is unavailable.
|
|
238
|
+
* @param nonce - Explicit unordered nonce that has already been consumed.
|
|
239
|
+
*/
|
|
240
|
+
constructor(owner: Address, nonce: bigint);
|
|
241
|
+
}
|
|
242
|
+
/** Thrown when no unused Permit2 unordered nonce exists at or after the requested start nonce. */
|
|
243
|
+
export declare class NoUnusedPermit2NonceError extends Error {
|
|
244
|
+
readonly owner: Address;
|
|
245
|
+
readonly startNonce: bigint;
|
|
246
|
+
/**
|
|
247
|
+
* @param owner - Permit2 token owner scanned for a free nonce.
|
|
248
|
+
* @param startNonce - Lowest nonce that was considered.
|
|
249
|
+
*/
|
|
250
|
+
constructor(owner: Address, startNonce: bigint);
|
|
251
|
+
}
|
|
252
|
+
/** Thrown when native funding does not exactly match the contract's gross token pull. */
|
|
253
|
+
export declare class NativeFundingAmountMismatchError extends Error {
|
|
254
|
+
readonly nativeAmount: bigint;
|
|
255
|
+
readonly requiredAmount: bigint;
|
|
256
|
+
/**
|
|
257
|
+
* @param nativeAmount - Native value supplied with the transaction.
|
|
258
|
+
* @param requiredAmount - Gross amount the BlueBundlesV1 entrypoint funds.
|
|
259
|
+
*/
|
|
260
|
+
constructor(nativeAmount: bigint, requiredAmount: bigint);
|
|
261
|
+
}
|
|
262
|
+
/** Thrown when a positive referral fee has no recipient. */
|
|
263
|
+
export declare class MissingReferralFeeRecipientError extends Error {
|
|
264
|
+
constructor();
|
|
265
|
+
}
|
|
266
|
+
/** Thrown when a BlueBundlesV1 reallocation source uses another loan token. */
|
|
267
|
+
export declare class ReallocationLoanTokenMismatchError extends Error {
|
|
268
|
+
readonly expected: Address;
|
|
269
|
+
readonly actual: Address;
|
|
270
|
+
/**
|
|
271
|
+
* @param expected - Loan token of the operation's target market.
|
|
272
|
+
* @param actual - Loan token found in the reallocation source market.
|
|
273
|
+
*/
|
|
274
|
+
constructor(expected: Address, actual: Address);
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* Thrown when a Blue authorization operator is not one of the chain's registered Morpho operators
|
|
278
|
+
* (GeneralAdapter1 or BlueBundlesV1). Guards the exported authorization builder so a misconfigured
|
|
279
|
+
* `authorized` cannot grant an arbitrary address control over the user's Morpho positions.
|
|
280
|
+
*/
|
|
281
|
+
export declare class UnsupportedAuthorizationOperatorError extends Error {
|
|
282
|
+
readonly authorized: Address;
|
|
283
|
+
readonly chainId: number;
|
|
284
|
+
/**
|
|
285
|
+
* @param authorized - The operator address rejected as unsupported.
|
|
286
|
+
* @param chainId - Chain whose registry was consulted for the supported operators.
|
|
287
|
+
*/
|
|
288
|
+
constructor(authorized: Address, chainId: number);
|
|
289
|
+
}
|
|
290
|
+
/** Thrown when reallocations are attached to a combined call with no borrow leg. */
|
|
291
|
+
export declare class ReallocationsRequireBorrowError extends Error {
|
|
292
|
+
constructor();
|
|
293
|
+
}
|
|
294
|
+
/** Thrown when repay funding cannot cover the requested assets and referral fee. */
|
|
295
|
+
export declare class MaxRepayAssetsBelowRepayAssetsError extends Error {
|
|
296
|
+
readonly maxRepayAssets: bigint;
|
|
297
|
+
readonly repayAssets: bigint;
|
|
298
|
+
/**
|
|
299
|
+
* @param maxRepayAssets - Maximum loan-token funding supplied to the bundle.
|
|
300
|
+
* @param repayAssets - Minimum funding required for the repayment and referral fee.
|
|
301
|
+
*/
|
|
302
|
+
constructor(maxRepayAssets: bigint, repayAssets: bigint);
|
|
303
|
+
}
|
|
206
304
|
/** @deprecated Use {@link NonPositiveInputError}. */
|
|
207
305
|
export declare const NonPositiveAssetAmountError: typeof NonPositiveInputError;
|
|
208
306
|
/** @deprecated Use {@link NonPositiveInputError}. */
|
|
@@ -375,7 +473,7 @@ export declare namespace BundlerErrors {
|
|
|
375
473
|
}
|
|
376
474
|
}
|
|
377
475
|
/** Requirement signature kind accepted by action-output transaction builders. */
|
|
378
|
-
export type RequirementSignatureKind = "permit" | "authorization" | "midnightOfferRootSignature";
|
|
476
|
+
export type RequirementSignatureKind = "permit" | "permit2TransferFrom" | "authorization" | "midnightOfferRootSignature";
|
|
379
477
|
/**
|
|
380
478
|
* Thrown when `buildTx` receives more than one requirement signature of the same kind.
|
|
381
479
|
*
|
|
@@ -537,11 +635,10 @@ export declare class ReallocationWithdrawalOnTargetMarketError extends Error {
|
|
|
537
635
|
constructor(vault: string, marketId: string);
|
|
538
636
|
}
|
|
539
637
|
/**
|
|
540
|
-
* Thrown when a
|
|
541
|
-
*
|
|
638
|
+
* Thrown when a reallocation entry passed to a high-level Blue write is not a valid
|
|
639
|
+
* {@link VaultV2BlueReallocation}: a non-object entry, or an entry carrying Vault V1
|
|
640
|
+
* `withdrawals`/`fee` fields that high-level Blue writes no longer accept.
|
|
542
641
|
*
|
|
543
|
-
* @deprecated Vault V1/V2 reallocation-shape dispatch will be removed in the next major. Use Vault
|
|
544
|
-
* V2 reallocations.
|
|
545
642
|
* @example
|
|
546
643
|
* ```ts
|
|
547
644
|
* import { InvalidReallocationShapeError } from "@morpho-org/morpho-sdk";
|
|
@@ -1038,10 +1135,6 @@ export declare class ReallocationWithdrawExceedsMarketSupplyError extends Error
|
|
|
1038
1135
|
export declare class VaultAssetMismatchError extends Error {
|
|
1039
1136
|
constructor(sourceAsset: Address, targetAsset: Address);
|
|
1040
1137
|
}
|
|
1041
|
-
/** Thrown when a refinance specifies both `borrowAssets` and `borrowShares` as non-zero (modes are mutually exclusive). */
|
|
1042
|
-
export declare class BorrowAmountAndSharesExclusiveError extends Error {
|
|
1043
|
-
constructor(market: string);
|
|
1044
|
-
}
|
|
1045
1138
|
/** Thrown when a refinance has identical source and target market ids (a refinance to the same market is a costly no-op). */
|
|
1046
1139
|
export declare class RefinanceSameMarketError extends Error {
|
|
1047
1140
|
constructor(market: string);
|
|
@@ -1050,7 +1143,23 @@ export declare class RefinanceSameMarketError extends Error {
|
|
|
1050
1143
|
export declare class RefinanceTokenMismatchError extends Error {
|
|
1051
1144
|
constructor(sourceMarket: string, targetMarket: string);
|
|
1052
1145
|
}
|
|
1053
|
-
/**
|
|
1146
|
+
/**
|
|
1147
|
+
* Thrown when a refinance specifies both `borrowAssets` and `borrowShares` as non-zero (modes are mutually exclusive).
|
|
1148
|
+
*
|
|
1149
|
+
* @deprecated The BlueBundlesV1 refinance route migrates the full live position and no longer accepts
|
|
1150
|
+
* partial borrow inputs, so this error is never thrown by `morpho-sdk` v6. It remains exported as a
|
|
1151
|
+
* compatibility shim for consumers pattern-matching on the v5 surface and will be removed in the next major.
|
|
1152
|
+
*/
|
|
1153
|
+
export declare class BorrowAmountAndSharesExclusiveError extends Error {
|
|
1154
|
+
constructor(market: string);
|
|
1155
|
+
}
|
|
1156
|
+
/**
|
|
1157
|
+
* Thrown when a refinance's `collateralAmount` exceeds the source position's available collateral.
|
|
1158
|
+
*
|
|
1159
|
+
* @deprecated The BlueBundlesV1 refinance route migrates the full live position and no longer accepts
|
|
1160
|
+
* partial collateral inputs, so this error is never thrown by `morpho-sdk` v6. It remains exported as a
|
|
1161
|
+
* compatibility shim for consumers pattern-matching on the v5 surface and will be removed in the next major.
|
|
1162
|
+
*/
|
|
1054
1163
|
export declare class RefinanceExceedsCollateralError extends Error {
|
|
1055
1164
|
readonly market: string;
|
|
1056
1165
|
readonly requested: bigint;
|
|
@@ -1061,7 +1170,13 @@ export declare class RefinanceExceedsCollateralError extends Error {
|
|
|
1061
1170
|
available: bigint;
|
|
1062
1171
|
});
|
|
1063
1172
|
}
|
|
1064
|
-
/**
|
|
1173
|
+
/**
|
|
1174
|
+
* Thrown when a refinance's `borrowShares` exceeds the source position's outstanding borrow shares.
|
|
1175
|
+
*
|
|
1176
|
+
* @deprecated The BlueBundlesV1 refinance route migrates the full live position and no longer accepts
|
|
1177
|
+
* partial borrow inputs, so this error is never thrown by `morpho-sdk` v6. It remains exported as a
|
|
1178
|
+
* compatibility shim for consumers pattern-matching on the v5 surface and will be removed in the next major.
|
|
1179
|
+
*/
|
|
1065
1180
|
export declare class RefinanceExceedsBorrowSharesError extends Error {
|
|
1066
1181
|
readonly market: string;
|
|
1067
1182
|
readonly requested: bigint;
|
|
@@ -1072,7 +1187,13 @@ export declare class RefinanceExceedsBorrowSharesError extends Error {
|
|
|
1072
1187
|
available: bigint;
|
|
1073
1188
|
});
|
|
1074
1189
|
}
|
|
1075
|
-
/**
|
|
1190
|
+
/**
|
|
1191
|
+
* Thrown when a refinance's `borrowAssets` exceeds the source position's outstanding debt assets.
|
|
1192
|
+
*
|
|
1193
|
+
* @deprecated The BlueBundlesV1 refinance route migrates the full live position and no longer accepts
|
|
1194
|
+
* partial borrow inputs, so this error is never thrown by `morpho-sdk` v6. It remains exported as a
|
|
1195
|
+
* compatibility shim for consumers pattern-matching on the v5 surface and will be removed in the next major.
|
|
1196
|
+
*/
|
|
1076
1197
|
export declare class RefinanceExceedsBorrowAssetsError extends Error {
|
|
1077
1198
|
readonly market: string;
|
|
1078
1199
|
readonly requested: bigint;
|
|
@@ -1083,7 +1204,13 @@ export declare class RefinanceExceedsBorrowAssetsError extends Error {
|
|
|
1083
1204
|
available: bigint;
|
|
1084
1205
|
});
|
|
1085
1206
|
}
|
|
1086
|
-
/**
|
|
1207
|
+
/**
|
|
1208
|
+
* Thrown when a refinance in shares mode (`borrowShares > 0n`) omits the `borrowAssets` overshoot for the target borrow leg.
|
|
1209
|
+
*
|
|
1210
|
+
* @deprecated The BlueBundlesV1 refinance route migrates the full live position and no longer accepts
|
|
1211
|
+
* partial borrow inputs, so this error is never thrown by `morpho-sdk` v6. It remains exported as a
|
|
1212
|
+
* compatibility shim for consumers pattern-matching on the v5 surface and will be removed in the next major.
|
|
1213
|
+
*/
|
|
1087
1214
|
export declare class RefinanceSharesMissingBorrowAssetsError extends Error {
|
|
1088
1215
|
constructor(market: string);
|
|
1089
1216
|
}
|
package/lib/cjs/types/error.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.
|
|
5
|
-
exports.RefinanceSharesMissingBorrowAssetsError = exports.RefinanceExceedsBorrowAssetsError = exports.RefinanceExceedsBorrowSharesError = exports.RefinanceExceedsCollateralError = exports.
|
|
3
|
+
exports.AddressMismatchError = exports.UnexpectedRequirementSignatureError = exports.AmbiguousRequirementSignaturesError = exports.BundlerErrors = exports.NegativeMaxRepaySharePriceError = exports.NegativeBorrowSharesError = exports.NegativeMinSharePriceError = exports.NegativeWithdrawMinSharePriceError = exports.NegativeSupplyMaxSharePriceError = exports.NegativeSupplyAmountError = exports.NonPositiveMinBorrowSharePriceError = exports.NegativeReallocationFeeError = exports.NegativeNativeAmountError = exports.NegativeSlippageToleranceError = exports.NonPositiveWithdrawAmountError = exports.ZeroSupplyAmountError = exports.NonPositiveWithdrawCollateralAmountError = exports.NonPositiveRepayMaxSharePriceError = exports.NonPositiveRepayAmountError = exports.NonPositiveReallocationAmountError = exports.ZeroCollateralAmountError = exports.NonPositiveBorrowAmountError = exports.ZeroDepositAmountError = exports.NonPositiveMaxSharePriceError = exports.NonPositiveSharesAmountError = exports.NonPositiveAssetAmountError = exports.MaxRepayAssetsBelowRepayAssetsError = exports.ReallocationsRequireBorrowError = exports.UnsupportedAuthorizationOperatorError = exports.ReallocationLoanTokenMismatchError = exports.MissingReferralFeeRecipientError = exports.NativeFundingAmountMismatchError = exports.NoUnusedPermit2NonceError = exports.Permit2TransferFromNonceAlreadyUsedError = exports.MissingPermit2TransferFromNonceError = exports.BlueBundlesV1RequirementSignatureMismatchError = exports.VaultExitBundlesV1PermitMismatchError = exports.VaultIsBlueFeeRecipientError = exports.VaultMorphoMismatchError = exports.InsufficientBlueBalanceForInKindRedeemError = exports.InKindRedeemCoverageError = exports.InKindRedeemZeroDeallocationError = exports.UnsupportedInKindAdapterError = exports.AdapterNotPartOfVaultError = exports.InKindRedeemRequiresSingleAdapterError = exports.ExpiredDeadlineError = exports.EmptyMarketParamsListError = exports.InputExceedsMaxError = exports.NonPositiveInputError = exports.NegativeInputError = void 0;
|
|
4
|
+
exports.UnknownReallocationMarketPublicAllocatorConfigError = exports.UnknownReallocationActiveAdaptersError = exports.UnknownReallocationPublicAllocatorConfigError = exports.UnknownReallocationAllocationError = exports.UnknownReallocationPositionError = exports.UnknownReallocationVaultMarketConfigError = exports.UnknownReallocationVaultError = exports.UnknownReallocationMarketError = exports.InsufficientSharedLiquidityError = exports.DisabledReallocationMarketError = exports.MissingPublicAllocatorConfigError = exports.RepaySharesExceedDebtError = exports.InvalidSignatureError = exports.RepayExceedsDebtError = exports.ShareDivideByZeroError = exports.WithdrawMakesPositionUnhealthyError = exports.WithdrawExceedsCollateralError = exports.MutuallyExclusiveRepayAmountsError = exports.TransferAmountNotEqualToAssetsError = exports.UnsortedReallocationWithdrawalsError = exports.InconsistentReallocationPenaltyError = exports.InvalidReallocationSourceTypeError = exports.InvalidReallocationAddressError = exports.MixedReallocationVersionsError = exports.InvalidReallocationShapeError = exports.ReallocationWithdrawalOnTargetMarketError = exports.EmptyReallocationWithdrawalsError = exports.AccrualPositionUserMismatchError = exports.MarketIdMismatchError = exports.MissingMarketPriceError = exports.BorrowExceedsSafeLtvError = exports.NativeAmountOnNonWNativeCollateralError = exports.NativeAmountOnNonWNativeAssetError = exports.VaultAddressMismatchError = exports.ChainWNativeMissingError = exports.NativeAmountOnNonWNativeVaultError = exports.Permit2ExpirationMissingError = exports.DepositSpenderMismatchError = exports.DepositOwnerMismatchError = exports.DepositAssetMismatchError = exports.DepositAmountMismatchError = exports.EmptyDeallocationsError = exports.ExcessiveSlippageToleranceError = exports.MissingAccrualPositionError = exports.UnsupportedMidnightAuthorizationTargetError = exports.UnsupportedErc20ApprovalSpenderError = exports.ApprovalAmountLessThanSpendAmountError = exports.MissingClientPropertyError = exports.CryptoUnavailableError = exports.ChainIdMismatchError = void 0;
|
|
5
|
+
exports.RefinanceSharesMissingBorrowAssetsError = exports.RefinanceExceedsBorrowAssetsError = exports.RefinanceExceedsBorrowSharesError = exports.RefinanceExceedsCollateralError = exports.BorrowAmountAndSharesExclusiveError = exports.RefinanceTokenMismatchError = exports.RefinanceSameMarketError = exports.VaultAssetMismatchError = exports.ReallocationWithdrawExceedsMarketSupplyError = exports.WithdrawSharesExceedSupplyError = exports.WithdrawExceedsSupplyError = exports.MutuallyExclusiveWithdrawAmountsError = exports.InsufficientMidnightWithdrawableLiquidityError = exports.MidnightRedeemExceedsCreditError = exports.NoMidnightCreditToRedeemError = exports.UnpreparedMidnightOfferRootSignatureError = exports.MidnightOfferRootOfferCountMismatchError = exports.MidnightOfferRootRatifierMismatchError = exports.MidnightOfferRootOwnerMismatchError = exports.MidnightOfferRootMismatchError = exports.MissingMidnightOfferRootSignatureError = exports.UnknownMidnightRatifierError = exports.MidnightTakeableOfferMarketMismatchError = exports.MidnightOfferMarketLoanTokenMismatchError = exports.MidnightMarketAddressMismatchError = exports.MidnightOfferMarketAddressMismatchError = exports.MidnightOfferMarketChainMismatchError = exports.MidnightOfferMakerMismatchError = exports.MidnightOfferSideMismatchError = exports.EmptyMidnightTakeableOffersError = exports.MidnightAmountExceedsMaxOfferCapError = exports.ReallocationAdapterSupplySharesUnderflowError = exports.ReallocationAllocationUnderflowError = exports.UnknownReallocationAdapterError = void 0;
|
|
6
6
|
const blue_sdk_1 = require("@morpho-org/blue-sdk");
|
|
7
7
|
/**
|
|
8
8
|
* Thrown when a morpho-sdk input that must be non-negative is negative.
|
|
@@ -91,7 +91,7 @@ class EmptyMarketParamsListError extends Error {
|
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
exports.EmptyMarketParamsListError = EmptyMarketParamsListError;
|
|
94
|
-
/** Thrown when an
|
|
94
|
+
/** Thrown when an SDK operation deadline has already passed. */
|
|
95
95
|
class ExpiredDeadlineError extends Error {
|
|
96
96
|
deadline;
|
|
97
97
|
timestamp;
|
|
@@ -100,7 +100,7 @@ class ExpiredDeadlineError extends Error {
|
|
|
100
100
|
* @param timestamp - Current timestamp used for validation.
|
|
101
101
|
*/
|
|
102
102
|
constructor(deadline, timestamp) {
|
|
103
|
-
super(`Deadline "${deadline}" has expired at timestamp "${timestamp}". Choose a future deadline and rebuild the
|
|
103
|
+
super(`Deadline "${deadline}" has expired at timestamp "${timestamp}". Choose a future deadline and rebuild the operation.`);
|
|
104
104
|
this.deadline = deadline;
|
|
105
105
|
this.timestamp = timestamp;
|
|
106
106
|
this.name = "ExpiredDeadlineError";
|
|
@@ -269,6 +269,154 @@ class VaultExitBundlesV1PermitMismatchError extends Error {
|
|
|
269
269
|
}
|
|
270
270
|
}
|
|
271
271
|
exports.VaultExitBundlesV1PermitMismatchError = VaultExitBundlesV1PermitMismatchError;
|
|
272
|
+
/** Thrown when a signed requirement cannot be safely encoded for BlueBundlesV1. */
|
|
273
|
+
class BlueBundlesV1RequirementSignatureMismatchError extends Error {
|
|
274
|
+
/** Field whose signed value or encoding is invalid for the direct BlueBundlesV1 call. */
|
|
275
|
+
field;
|
|
276
|
+
/** Value required by BlueBundlesV1. */
|
|
277
|
+
expected;
|
|
278
|
+
/** Value supplied by the signed requirement. */
|
|
279
|
+
actual;
|
|
280
|
+
/**
|
|
281
|
+
* @param params - Signature mismatch details.
|
|
282
|
+
* @param params.field - Field rejected by the converter.
|
|
283
|
+
* @param params.expected - Value required by the direct route.
|
|
284
|
+
* @param params.actual - Value supplied by the requirement.
|
|
285
|
+
* @param params.cause - Original signature parser failure, when applicable.
|
|
286
|
+
*/
|
|
287
|
+
constructor(params) {
|
|
288
|
+
super(`BlueBundlesV1 requirement ${params.field} mismatch: expected "${params.expected}", got "${params.actual}". Resolve and sign the requirements returned by this Blue action.`, { cause: params.cause });
|
|
289
|
+
this.field = params.field;
|
|
290
|
+
this.expected = params.expected;
|
|
291
|
+
this.actual = params.actual;
|
|
292
|
+
this.name = "BlueBundlesV1RequirementSignatureMismatchError";
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
exports.BlueBundlesV1RequirementSignatureMismatchError = BlueBundlesV1RequirementSignatureMismatchError;
|
|
296
|
+
/** Thrown when Permit2 SignatureTransfer is selected without an explicit unordered nonce. */
|
|
297
|
+
class MissingPermit2TransferFromNonceError extends Error {
|
|
298
|
+
constructor() {
|
|
299
|
+
super("Permit2 SignatureTransfer requires an explicit unused permit2Nonce. Generate a unique uint256 nonce, pass it to getRequirements(), and resolve the requirements again.");
|
|
300
|
+
this.name = "MissingPermit2TransferFromNonceError";
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
exports.MissingPermit2TransferFromNonceError = MissingPermit2TransferFromNonceError;
|
|
304
|
+
/** Thrown when an explicit Permit2 SignatureTransfer unordered nonce is already consumed. */
|
|
305
|
+
class Permit2TransferFromNonceAlreadyUsedError extends Error {
|
|
306
|
+
owner;
|
|
307
|
+
nonce;
|
|
308
|
+
/**
|
|
309
|
+
* @param owner - Permit2 token owner whose nonce is unavailable.
|
|
310
|
+
* @param nonce - Explicit unordered nonce that has already been consumed.
|
|
311
|
+
*/
|
|
312
|
+
constructor(owner, nonce) {
|
|
313
|
+
super(`Permit2 nonce "${nonce}" is already used for owner "${owner}". Generate a different uint256 permit2Nonce and resolve the requirements again.`);
|
|
314
|
+
this.owner = owner;
|
|
315
|
+
this.nonce = nonce;
|
|
316
|
+
this.name = "Permit2TransferFromNonceAlreadyUsedError";
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
exports.Permit2TransferFromNonceAlreadyUsedError = Permit2TransferFromNonceAlreadyUsedError;
|
|
320
|
+
/** Thrown when no unused Permit2 unordered nonce exists at or after the requested start nonce. */
|
|
321
|
+
class NoUnusedPermit2NonceError extends Error {
|
|
322
|
+
owner;
|
|
323
|
+
startNonce;
|
|
324
|
+
/**
|
|
325
|
+
* @param owner - Permit2 token owner scanned for a free nonce.
|
|
326
|
+
* @param startNonce - Lowest nonce that was considered.
|
|
327
|
+
*/
|
|
328
|
+
constructor(owner, startNonce) {
|
|
329
|
+
super(`No unused Permit2 nonce found for owner "${owner}" at or after "${startNonce}". Pass a lower startNonce.`);
|
|
330
|
+
this.owner = owner;
|
|
331
|
+
this.startNonce = startNonce;
|
|
332
|
+
this.name = "NoUnusedPermit2NonceError";
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
exports.NoUnusedPermit2NonceError = NoUnusedPermit2NonceError;
|
|
336
|
+
/** Thrown when native funding does not exactly match the contract's gross token pull. */
|
|
337
|
+
class NativeFundingAmountMismatchError extends Error {
|
|
338
|
+
nativeAmount;
|
|
339
|
+
requiredAmount;
|
|
340
|
+
/**
|
|
341
|
+
* @param nativeAmount - Native value supplied with the transaction.
|
|
342
|
+
* @param requiredAmount - Gross amount the BlueBundlesV1 entrypoint funds.
|
|
343
|
+
*/
|
|
344
|
+
constructor(nativeAmount, requiredAmount) {
|
|
345
|
+
super(`Native funding must equal the full funded amount: expected "${requiredAmount}", got "${nativeAmount}". Use either native funding or ERC-20 funding, not both.`);
|
|
346
|
+
this.nativeAmount = nativeAmount;
|
|
347
|
+
this.requiredAmount = requiredAmount;
|
|
348
|
+
this.name = "NativeFundingAmountMismatchError";
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
exports.NativeFundingAmountMismatchError = NativeFundingAmountMismatchError;
|
|
352
|
+
/** Thrown when a positive referral fee has no recipient. */
|
|
353
|
+
class MissingReferralFeeRecipientError extends Error {
|
|
354
|
+
constructor() {
|
|
355
|
+
super("A positive referralFeePct requires referralFeeRecipient. Provide the recipient or set referralFeePct to zero.");
|
|
356
|
+
this.name = "MissingReferralFeeRecipientError";
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
exports.MissingReferralFeeRecipientError = MissingReferralFeeRecipientError;
|
|
360
|
+
/** Thrown when a BlueBundlesV1 reallocation source uses another loan token. */
|
|
361
|
+
class ReallocationLoanTokenMismatchError extends Error {
|
|
362
|
+
expected;
|
|
363
|
+
actual;
|
|
364
|
+
/**
|
|
365
|
+
* @param expected - Loan token of the operation's target market.
|
|
366
|
+
* @param actual - Loan token found in the reallocation source market.
|
|
367
|
+
*/
|
|
368
|
+
constructor(expected, actual) {
|
|
369
|
+
super(`Reallocation source loan token "${actual}" does not match target loan token "${expected}". Recompute reallocations for the target market.`);
|
|
370
|
+
this.expected = expected;
|
|
371
|
+
this.actual = actual;
|
|
372
|
+
this.name = "ReallocationLoanTokenMismatchError";
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
exports.ReallocationLoanTokenMismatchError = ReallocationLoanTokenMismatchError;
|
|
376
|
+
/**
|
|
377
|
+
* Thrown when a Blue authorization operator is not one of the chain's registered Morpho operators
|
|
378
|
+
* (GeneralAdapter1 or BlueBundlesV1). Guards the exported authorization builder so a misconfigured
|
|
379
|
+
* `authorized` cannot grant an arbitrary address control over the user's Morpho positions.
|
|
380
|
+
*/
|
|
381
|
+
class UnsupportedAuthorizationOperatorError extends Error {
|
|
382
|
+
authorized;
|
|
383
|
+
chainId;
|
|
384
|
+
/**
|
|
385
|
+
* @param authorized - The operator address rejected as unsupported.
|
|
386
|
+
* @param chainId - Chain whose registry was consulted for the supported operators.
|
|
387
|
+
*/
|
|
388
|
+
constructor(authorized, chainId) {
|
|
389
|
+
super(`Authorization operator "${authorized}" is not a supported Morpho operator on chain ${chainId}. Pass the chain's registered GeneralAdapter1 or BlueBundlesV1 address, or omit \`authorized\` to default to GeneralAdapter1.`);
|
|
390
|
+
this.authorized = authorized;
|
|
391
|
+
this.chainId = chainId;
|
|
392
|
+
this.name = "UnsupportedAuthorizationOperatorError";
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
exports.UnsupportedAuthorizationOperatorError = UnsupportedAuthorizationOperatorError;
|
|
396
|
+
/** Thrown when reallocations are attached to a combined call with no borrow leg. */
|
|
397
|
+
class ReallocationsRequireBorrowError extends Error {
|
|
398
|
+
constructor() {
|
|
399
|
+
super("BlueBundlesV1 reallocations require a positive borrowAssets value. Remove the reallocations or add a borrow leg.");
|
|
400
|
+
this.name = "ReallocationsRequireBorrowError";
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
exports.ReallocationsRequireBorrowError = ReallocationsRequireBorrowError;
|
|
404
|
+
/** Thrown when repay funding cannot cover the requested assets and referral fee. */
|
|
405
|
+
class MaxRepayAssetsBelowRepayAssetsError extends Error {
|
|
406
|
+
maxRepayAssets;
|
|
407
|
+
repayAssets;
|
|
408
|
+
/**
|
|
409
|
+
* @param maxRepayAssets - Maximum loan-token funding supplied to the bundle.
|
|
410
|
+
* @param repayAssets - Minimum funding required for the repayment and referral fee.
|
|
411
|
+
*/
|
|
412
|
+
constructor(maxRepayAssets, repayAssets) {
|
|
413
|
+
super(`maxRepayAssets "${maxRepayAssets}" cannot cover required repay funding "${repayAssets}". Increase maxRepayAssets to include the repayment and referral fee.`);
|
|
414
|
+
this.maxRepayAssets = maxRepayAssets;
|
|
415
|
+
this.repayAssets = repayAssets;
|
|
416
|
+
this.name = "MaxRepayAssetsBelowRepayAssetsError";
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
exports.MaxRepayAssetsBelowRepayAssetsError = MaxRepayAssetsBelowRepayAssetsError;
|
|
272
420
|
/** @deprecated Use {@link NonPositiveInputError}. */
|
|
273
421
|
exports.NonPositiveAssetAmountError = NonPositiveInputError;
|
|
274
422
|
/** @deprecated Use {@link NonPositiveInputError}. */
|
|
@@ -650,11 +798,10 @@ class ReallocationWithdrawalOnTargetMarketError extends Error {
|
|
|
650
798
|
}
|
|
651
799
|
exports.ReallocationWithdrawalOnTargetMarketError = ReallocationWithdrawalOnTargetMarketError;
|
|
652
800
|
/**
|
|
653
|
-
* Thrown when a
|
|
654
|
-
*
|
|
801
|
+
* Thrown when a reallocation entry passed to a high-level Blue write is not a valid
|
|
802
|
+
* {@link VaultV2BlueReallocation}: a non-object entry, or an entry carrying Vault V1
|
|
803
|
+
* `withdrawals`/`fee` fields that high-level Blue writes no longer accept.
|
|
655
804
|
*
|
|
656
|
-
* @deprecated Vault V1/V2 reallocation-shape dispatch will be removed in the next major. Use Vault
|
|
657
|
-
* V2 reallocations.
|
|
658
805
|
* @example
|
|
659
806
|
* ```ts
|
|
660
807
|
* import { InvalidReallocationShapeError } from "@morpho-org/morpho-sdk";
|
|
@@ -664,7 +811,7 @@ exports.ReallocationWithdrawalOnTargetMarketError = ReallocationWithdrawalOnTarg
|
|
|
664
811
|
*/
|
|
665
812
|
class InvalidReallocationShapeError extends Error {
|
|
666
813
|
constructor() {
|
|
667
|
-
super(
|
|
814
|
+
super("Reallocation entry is not a valid Vault V2 reallocation. High-level Blue writes accept only VaultV2BlueReallocation entries (e.g. from getVaultV2BlueReallocations()); compose Vault V1 reallocations via low-level Bundler3 actions.");
|
|
668
815
|
this.name = "InvalidReallocationShapeError";
|
|
669
816
|
}
|
|
670
817
|
}
|
|
@@ -1217,13 +1364,6 @@ class VaultAssetMismatchError extends Error {
|
|
|
1217
1364
|
}
|
|
1218
1365
|
}
|
|
1219
1366
|
exports.VaultAssetMismatchError = VaultAssetMismatchError;
|
|
1220
|
-
/** Thrown when a refinance specifies both `borrowAssets` and `borrowShares` as non-zero (modes are mutually exclusive). */
|
|
1221
|
-
class BorrowAmountAndSharesExclusiveError extends Error {
|
|
1222
|
-
constructor(market) {
|
|
1223
|
-
super(`Exactly one of borrowAssets or borrowShares must be non-zero for market: ${market}. Both were provided.`);
|
|
1224
|
-
}
|
|
1225
|
-
}
|
|
1226
|
-
exports.BorrowAmountAndSharesExclusiveError = BorrowAmountAndSharesExclusiveError;
|
|
1227
1367
|
/** Thrown when a refinance has identical source and target market ids (a refinance to the same market is a costly no-op). */
|
|
1228
1368
|
class RefinanceSameMarketError extends Error {
|
|
1229
1369
|
constructor(market) {
|
|
@@ -1238,7 +1378,26 @@ class RefinanceTokenMismatchError extends Error {
|
|
|
1238
1378
|
}
|
|
1239
1379
|
}
|
|
1240
1380
|
exports.RefinanceTokenMismatchError = RefinanceTokenMismatchError;
|
|
1241
|
-
/**
|
|
1381
|
+
/**
|
|
1382
|
+
* Thrown when a refinance specifies both `borrowAssets` and `borrowShares` as non-zero (modes are mutually exclusive).
|
|
1383
|
+
*
|
|
1384
|
+
* @deprecated The BlueBundlesV1 refinance route migrates the full live position and no longer accepts
|
|
1385
|
+
* partial borrow inputs, so this error is never thrown by `morpho-sdk` v6. It remains exported as a
|
|
1386
|
+
* compatibility shim for consumers pattern-matching on the v5 surface and will be removed in the next major.
|
|
1387
|
+
*/
|
|
1388
|
+
class BorrowAmountAndSharesExclusiveError extends Error {
|
|
1389
|
+
constructor(market) {
|
|
1390
|
+
super(`Exactly one of borrowAssets or borrowShares must be non-zero for market: ${market}. Both were provided.`);
|
|
1391
|
+
}
|
|
1392
|
+
}
|
|
1393
|
+
exports.BorrowAmountAndSharesExclusiveError = BorrowAmountAndSharesExclusiveError;
|
|
1394
|
+
/**
|
|
1395
|
+
* Thrown when a refinance's `collateralAmount` exceeds the source position's available collateral.
|
|
1396
|
+
*
|
|
1397
|
+
* @deprecated The BlueBundlesV1 refinance route migrates the full live position and no longer accepts
|
|
1398
|
+
* partial collateral inputs, so this error is never thrown by `morpho-sdk` v6. It remains exported as a
|
|
1399
|
+
* compatibility shim for consumers pattern-matching on the v5 surface and will be removed in the next major.
|
|
1400
|
+
*/
|
|
1242
1401
|
class RefinanceExceedsCollateralError extends Error {
|
|
1243
1402
|
market;
|
|
1244
1403
|
requested;
|
|
@@ -1251,7 +1410,13 @@ class RefinanceExceedsCollateralError extends Error {
|
|
|
1251
1410
|
}
|
|
1252
1411
|
}
|
|
1253
1412
|
exports.RefinanceExceedsCollateralError = RefinanceExceedsCollateralError;
|
|
1254
|
-
/**
|
|
1413
|
+
/**
|
|
1414
|
+
* Thrown when a refinance's `borrowShares` exceeds the source position's outstanding borrow shares.
|
|
1415
|
+
*
|
|
1416
|
+
* @deprecated The BlueBundlesV1 refinance route migrates the full live position and no longer accepts
|
|
1417
|
+
* partial borrow inputs, so this error is never thrown by `morpho-sdk` v6. It remains exported as a
|
|
1418
|
+
* compatibility shim for consumers pattern-matching on the v5 surface and will be removed in the next major.
|
|
1419
|
+
*/
|
|
1255
1420
|
class RefinanceExceedsBorrowSharesError extends Error {
|
|
1256
1421
|
market;
|
|
1257
1422
|
requested;
|
|
@@ -1264,7 +1429,13 @@ class RefinanceExceedsBorrowSharesError extends Error {
|
|
|
1264
1429
|
}
|
|
1265
1430
|
}
|
|
1266
1431
|
exports.RefinanceExceedsBorrowSharesError = RefinanceExceedsBorrowSharesError;
|
|
1267
|
-
/**
|
|
1432
|
+
/**
|
|
1433
|
+
* Thrown when a refinance's `borrowAssets` exceeds the source position's outstanding debt assets.
|
|
1434
|
+
*
|
|
1435
|
+
* @deprecated The BlueBundlesV1 refinance route migrates the full live position and no longer accepts
|
|
1436
|
+
* partial borrow inputs, so this error is never thrown by `morpho-sdk` v6. It remains exported as a
|
|
1437
|
+
* compatibility shim for consumers pattern-matching on the v5 surface and will be removed in the next major.
|
|
1438
|
+
*/
|
|
1268
1439
|
class RefinanceExceedsBorrowAssetsError extends Error {
|
|
1269
1440
|
market;
|
|
1270
1441
|
requested;
|
|
@@ -1277,7 +1448,13 @@ class RefinanceExceedsBorrowAssetsError extends Error {
|
|
|
1277
1448
|
}
|
|
1278
1449
|
}
|
|
1279
1450
|
exports.RefinanceExceedsBorrowAssetsError = RefinanceExceedsBorrowAssetsError;
|
|
1280
|
-
/**
|
|
1451
|
+
/**
|
|
1452
|
+
* Thrown when a refinance in shares mode (`borrowShares > 0n`) omits the `borrowAssets` overshoot for the target borrow leg.
|
|
1453
|
+
*
|
|
1454
|
+
* @deprecated The BlueBundlesV1 refinance route migrates the full live position and no longer accepts
|
|
1455
|
+
* partial borrow inputs, so this error is never thrown by `morpho-sdk` v6. It remains exported as a
|
|
1456
|
+
* compatibility shim for consumers pattern-matching on the v5 surface and will be removed in the next major.
|
|
1457
|
+
*/
|
|
1281
1458
|
class RefinanceSharesMissingBorrowAssetsError extends Error {
|
|
1282
1459
|
constructor(market) {
|
|
1283
1460
|
super(`Refinance shares mode requires a positive borrowAssets overshoot for the target borrow leg (market: ${market}).`);
|
|
@@ -137,13 +137,6 @@ export interface VaultV2BlueReallocation {
|
|
|
137
137
|
/** Vault-configured WAD-scaled penalty rate passed to the allocator. */
|
|
138
138
|
readonly penalty: bigint;
|
|
139
139
|
}
|
|
140
|
-
/**
|
|
141
|
-
* A homogeneous Blue action plan containing only Vault V1 or only Vault V2 reallocations.
|
|
142
|
-
*
|
|
143
|
-
* Vault V1 members are deprecated for high-level Blue writes and will stop being accepted in the
|
|
144
|
-
* next major. Use Vault V2 members for new high-level integrations.
|
|
145
|
-
*/
|
|
146
|
-
export type BlueReallocationPlan = Iterable<VaultV1Reallocation> | Iterable<VaultV2BlueReallocation>;
|
|
147
140
|
/**
|
|
148
141
|
* Deprecated name for a Vault V1 reallocation.
|
|
149
142
|
*
|