@morpho-org/morpho-sdk 5.2.0 → 5.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/README.md +46 -2
- package/lib/cjs/abis.d.ts +1 -0
- package/lib/cjs/abis.js +6 -1
- package/lib/cjs/actions/blue/borrow.d.ts +3 -7
- package/lib/cjs/actions/blue/borrow.js +5 -9
- package/lib/cjs/actions/blue/buildReallocationActions.d.ts +3 -4
- package/lib/cjs/actions/blue/buildReallocationActions.js +3 -4
- package/lib/cjs/actions/blue/refinance.d.ts +4 -8
- package/lib/cjs/actions/blue/refinance.js +10 -14
- package/lib/cjs/actions/blue/repay.d.ts +2 -5
- package/lib/cjs/actions/blue/repay.js +2 -5
- package/lib/cjs/actions/blue/repayWithdrawCollateral.d.ts +3 -6
- package/lib/cjs/actions/blue/repayWithdrawCollateral.js +4 -7
- package/lib/cjs/actions/blue/resolveRepayFunding.d.ts +2 -5
- package/lib/cjs/actions/blue/resolveRepayFunding.js +15 -12
- package/lib/cjs/actions/blue/supply.d.ts +2 -4
- package/lib/cjs/actions/blue/supply.js +6 -8
- package/lib/cjs/actions/blue/supplyCollateral.d.ts +2 -3
- package/lib/cjs/actions/blue/supplyCollateral.js +5 -6
- package/lib/cjs/actions/blue/supplyCollateralBorrow.d.ts +4 -9
- package/lib/cjs/actions/blue/supplyCollateralBorrow.js +9 -14
- package/lib/cjs/actions/blue/withdraw.d.ts +9 -7
- package/lib/cjs/actions/blue/withdraw.js +18 -10
- package/lib/cjs/actions/blue/withdrawCollateral.d.ts +1 -1
- package/lib/cjs/actions/blue/withdrawCollateral.js +2 -2
- package/lib/cjs/actions/index.d.ts +2 -0
- package/lib/cjs/actions/index.js +1 -0
- package/lib/cjs/actions/midnight/authorization.d.ts +37 -0
- package/lib/cjs/actions/midnight/authorization.js +69 -0
- package/lib/cjs/actions/midnight/cancelOffer.d.ts +38 -0
- package/lib/cjs/actions/midnight/cancelOffer.js +73 -0
- package/lib/cjs/actions/midnight/index.d.ts +11 -0
- package/lib/cjs/actions/midnight/index.js +27 -0
- package/lib/cjs/actions/midnight/mempoolSubmitOffers.d.ts +52 -0
- package/lib/cjs/actions/midnight/mempoolSubmitOffers.js +72 -0
- package/lib/cjs/actions/midnight/redeem.d.ts +43 -0
- package/lib/cjs/actions/midnight/redeem.js +79 -0
- package/lib/cjs/actions/midnight/repayWithdrawCollateral.d.ts +53 -0
- package/lib/cjs/actions/midnight/repayWithdrawCollateral.js +121 -0
- package/lib/cjs/actions/midnight/setterRatifierRatifyRoot.d.ts +40 -0
- package/lib/cjs/actions/midnight/setterRatifierRatifyRoot.js +59 -0
- package/lib/cjs/actions/midnight/supplyCollateral.d.ts +45 -0
- package/lib/cjs/actions/midnight/supplyCollateral.js +83 -0
- package/lib/cjs/actions/midnight/supplyCollateralTakeBorrow.d.ts +51 -0
- package/lib/cjs/actions/midnight/supplyCollateralTakeBorrow.js +128 -0
- package/lib/cjs/actions/midnight/takeBorrow.d.ts +57 -0
- package/lib/cjs/actions/midnight/takeBorrow.js +110 -0
- package/lib/cjs/actions/midnight/takeLend.d.ts +57 -0
- package/lib/cjs/actions/midnight/takeLend.js +110 -0
- package/lib/cjs/actions/midnight/types.d.ts +39 -0
- package/lib/cjs/actions/midnight/types.js +15 -0
- package/lib/cjs/actions/requirements/encode/encodeBlueSignatureAuthorization.d.ts +1 -1
- package/lib/cjs/actions/requirements/encode/encodeBlueSignatureAuthorization.js +5 -16
- package/lib/cjs/actions/requirements/encode/encodeErc20Approval.d.ts +5 -4
- package/lib/cjs/actions/requirements/encode/encodeErc20Approval.js +10 -14
- package/lib/cjs/actions/requirements/encode/encodeErc20Permit.d.ts +2 -2
- package/lib/cjs/actions/requirements/encode/encodeErc20Permit.js +11 -28
- package/lib/cjs/actions/requirements/encode/encodeErc20Permit2Approve.d.ts +1 -1
- package/lib/cjs/actions/requirements/encode/encodeErc20Permit2Approve.js +5 -17
- package/lib/cjs/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit.d.ts +1 -1
- package/lib/cjs/actions/requirements/getRequirementsApproval.d.ts +10 -4
- package/lib/cjs/actions/requirements/getRequirementsApproval.js +10 -4
- package/lib/cjs/actions/requirements/index.d.ts +1 -0
- package/lib/cjs/actions/requirements/index.js +1 -0
- package/lib/cjs/actions/requirements/midnight/getMidnightApprovalRequirements.d.ts +49 -0
- package/lib/cjs/actions/requirements/midnight/getMidnightApprovalRequirements.js +76 -0
- package/lib/cjs/actions/requirements/midnight/getMidnightAuthorizationRequirement.d.ts +44 -0
- package/lib/cjs/actions/requirements/midnight/getMidnightAuthorizationRequirement.js +78 -0
- package/lib/cjs/actions/requirements/midnight/getSetterRatifierRatifyRootRequirement.d.ts +42 -0
- package/lib/cjs/actions/requirements/midnight/getSetterRatifierRatifyRootRequirement.js +70 -0
- package/lib/cjs/actions/requirements/midnight/index.d.ts +3 -0
- package/lib/cjs/actions/requirements/midnight/index.js +19 -0
- package/lib/cjs/actions/vaultV1/deposit.d.ts +3 -4
- package/lib/cjs/actions/vaultV1/deposit.js +7 -8
- package/lib/cjs/actions/vaultV1/migrateToV2.d.ts +2 -3
- package/lib/cjs/actions/vaultV1/migrateToV2.js +5 -6
- package/lib/cjs/actions/vaultV1/redeem.d.ts +1 -1
- package/lib/cjs/actions/vaultV1/redeem.js +2 -2
- package/lib/cjs/actions/vaultV1/withdraw.d.ts +1 -1
- package/lib/cjs/actions/vaultV1/withdraw.js +2 -2
- package/lib/cjs/actions/vaultV2/deposit.d.ts +3 -4
- package/lib/cjs/actions/vaultV2/deposit.js +7 -8
- package/lib/cjs/actions/vaultV2/forceRedeem.d.ts +2 -3
- package/lib/cjs/actions/vaultV2/forceRedeem.js +3 -4
- package/lib/cjs/actions/vaultV2/forceWithdraw.d.ts +1 -1
- package/lib/cjs/actions/vaultV2/forceWithdraw.js +2 -2
- package/lib/cjs/actions/vaultV2/redeem.d.ts +1 -1
- package/lib/cjs/actions/vaultV2/redeem.js +2 -2
- package/lib/cjs/actions/vaultV2/withdraw.d.ts +1 -1
- package/lib/cjs/actions/vaultV2/withdraw.js +2 -2
- package/lib/cjs/client/morphoViemExtension.d.ts +1 -1
- package/lib/cjs/client/morphoViemExtension.js +5 -2
- package/lib/cjs/constants.d.ts +1 -0
- package/lib/cjs/constants.js +15 -1
- package/lib/cjs/entities/blue/blue.d.ts +5 -5
- package/lib/cjs/entities/blue/blue.js +93 -68
- package/lib/cjs/entities/index.d.ts +1 -0
- package/lib/cjs/entities/index.js +15 -0
- package/lib/cjs/entities/midnight/index.d.ts +2 -0
- package/lib/cjs/entities/midnight/index.js +18 -0
- package/lib/cjs/entities/midnight/midnight.d.ts +402 -0
- package/lib/cjs/entities/midnight/midnight.js +1036 -0
- package/lib/cjs/entities/midnight/types.d.ts +164 -0
- package/lib/cjs/entities/midnight/types.js +2 -0
- package/lib/cjs/entities/vaultV1/vaultV1.js +10 -17
- package/lib/cjs/entities/vaultV2/vaultV2.js +19 -21
- package/lib/cjs/errors.d.ts +1 -0
- package/lib/cjs/errors.js +17 -1
- package/lib/cjs/helpers/encodeDeallocation.d.ts +1 -0
- package/lib/cjs/helpers/encodeDeallocation.js +2 -1
- package/lib/cjs/helpers/index.d.ts +4 -1
- package/lib/cjs/helpers/index.js +8 -1
- package/lib/cjs/helpers/signAndVerifyTypedData.d.ts +34 -0
- package/lib/cjs/helpers/signAndVerifyTypedData.js +58 -0
- package/lib/cjs/helpers/validate.d.ts +40 -1
- package/lib/cjs/helpers/validate.js +47 -5
- package/lib/cjs/helpers/validateMidnightAuthorizationTarget.d.ts +15 -0
- package/lib/cjs/helpers/validateMidnightAuthorizationTarget.js +32 -0
- package/lib/cjs/helpers/validateMidnightMarket.d.ts +10 -0
- package/lib/cjs/helpers/validateMidnightMarket.js +24 -0
- package/lib/cjs/helpers/validateOfferSides.d.ts +21 -0
- package/lib/cjs/helpers/validateOfferSides.js +36 -0
- package/lib/cjs/helpers/validateRequirementSpender.d.ts +29 -0
- package/lib/cjs/helpers/validateRequirementSpender.js +49 -0
- package/lib/cjs/helpers/validateTakeableOffers.d.ts +18 -0
- package/lib/cjs/helpers/validateTakeableOffers.js +35 -0
- package/lib/cjs/midnight-api.d.ts +1 -0
- package/lib/cjs/midnight-api.js +17 -0
- package/lib/cjs/types/action.d.ts +189 -23
- package/lib/cjs/types/action.js +27 -7
- package/lib/cjs/types/client.d.ts +3 -2
- package/lib/cjs/types/error.d.ts +288 -119
- package/lib/cjs/types/error.js +259 -180
- package/lib/cjs/utils.d.ts +1 -0
- package/lib/cjs/utils.js +12 -2
- package/lib/esm/abis.d.ts +1 -0
- package/lib/esm/abis.js +1 -0
- package/lib/esm/actions/blue/borrow.d.ts +3 -7
- package/lib/esm/actions/blue/borrow.js +6 -10
- package/lib/esm/actions/blue/buildReallocationActions.d.ts +3 -4
- package/lib/esm/actions/blue/buildReallocationActions.js +3 -4
- package/lib/esm/actions/blue/refinance.d.ts +4 -8
- package/lib/esm/actions/blue/refinance.js +11 -15
- package/lib/esm/actions/blue/repay.d.ts +2 -5
- package/lib/esm/actions/blue/repay.js +2 -5
- package/lib/esm/actions/blue/repayWithdrawCollateral.d.ts +3 -6
- package/lib/esm/actions/blue/repayWithdrawCollateral.js +5 -8
- package/lib/esm/actions/blue/resolveRepayFunding.d.ts +2 -5
- package/lib/esm/actions/blue/resolveRepayFunding.js +16 -13
- package/lib/esm/actions/blue/supply.d.ts +2 -4
- package/lib/esm/actions/blue/supply.js +7 -9
- package/lib/esm/actions/blue/supplyCollateral.d.ts +2 -3
- package/lib/esm/actions/blue/supplyCollateral.js +6 -7
- package/lib/esm/actions/blue/supplyCollateralBorrow.d.ts +4 -9
- package/lib/esm/actions/blue/supplyCollateralBorrow.js +10 -15
- package/lib/esm/actions/blue/withdraw.d.ts +9 -7
- package/lib/esm/actions/blue/withdraw.js +19 -11
- package/lib/esm/actions/blue/withdrawCollateral.d.ts +1 -1
- package/lib/esm/actions/blue/withdrawCollateral.js +3 -3
- package/lib/esm/actions/index.d.ts +2 -0
- package/lib/esm/actions/index.js +1 -0
- package/lib/esm/actions/midnight/authorization.d.ts +37 -0
- package/lib/esm/actions/midnight/authorization.js +65 -0
- package/lib/esm/actions/midnight/cancelOffer.d.ts +38 -0
- package/lib/esm/actions/midnight/cancelOffer.js +69 -0
- package/lib/esm/actions/midnight/index.d.ts +11 -0
- package/lib/esm/actions/midnight/index.js +11 -0
- package/lib/esm/actions/midnight/mempoolSubmitOffers.d.ts +52 -0
- package/lib/esm/actions/midnight/mempoolSubmitOffers.js +68 -0
- package/lib/esm/actions/midnight/redeem.d.ts +43 -0
- package/lib/esm/actions/midnight/redeem.js +75 -0
- package/lib/esm/actions/midnight/repayWithdrawCollateral.d.ts +53 -0
- package/lib/esm/actions/midnight/repayWithdrawCollateral.js +117 -0
- package/lib/esm/actions/midnight/setterRatifierRatifyRoot.d.ts +40 -0
- package/lib/esm/actions/midnight/setterRatifierRatifyRoot.js +55 -0
- package/lib/esm/actions/midnight/supplyCollateral.d.ts +45 -0
- package/lib/esm/actions/midnight/supplyCollateral.js +79 -0
- package/lib/esm/actions/midnight/supplyCollateralTakeBorrow.d.ts +51 -0
- package/lib/esm/actions/midnight/supplyCollateralTakeBorrow.js +124 -0
- package/lib/esm/actions/midnight/takeBorrow.d.ts +57 -0
- package/lib/esm/actions/midnight/takeBorrow.js +106 -0
- package/lib/esm/actions/midnight/takeLend.d.ts +57 -0
- package/lib/esm/actions/midnight/takeLend.js +106 -0
- package/lib/esm/actions/midnight/types.d.ts +39 -0
- package/lib/esm/actions/midnight/types.js +12 -0
- package/lib/esm/actions/requirements/encode/encodeBlueSignatureAuthorization.d.ts +1 -1
- package/lib/esm/actions/requirements/encode/encodeBlueSignatureAuthorization.js +6 -17
- package/lib/esm/actions/requirements/encode/encodeErc20Approval.d.ts +5 -4
- package/lib/esm/actions/requirements/encode/encodeErc20Approval.js +12 -16
- package/lib/esm/actions/requirements/encode/encodeErc20Permit.d.ts +2 -2
- package/lib/esm/actions/requirements/encode/encodeErc20Permit.js +12 -29
- package/lib/esm/actions/requirements/encode/encodeErc20Permit2Approve.d.ts +1 -1
- package/lib/esm/actions/requirements/encode/encodeErc20Permit2Approve.js +5 -17
- package/lib/esm/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit.d.ts +1 -1
- package/lib/esm/actions/requirements/getRequirementsApproval.d.ts +10 -4
- package/lib/esm/actions/requirements/getRequirementsApproval.js +10 -4
- package/lib/esm/actions/requirements/index.d.ts +1 -0
- package/lib/esm/actions/requirements/index.js +1 -0
- package/lib/esm/actions/requirements/midnight/getMidnightApprovalRequirements.d.ts +49 -0
- package/lib/esm/actions/requirements/midnight/getMidnightApprovalRequirements.js +72 -0
- package/lib/esm/actions/requirements/midnight/getMidnightAuthorizationRequirement.d.ts +44 -0
- package/lib/esm/actions/requirements/midnight/getMidnightAuthorizationRequirement.js +74 -0
- package/lib/esm/actions/requirements/midnight/getSetterRatifierRatifyRootRequirement.d.ts +42 -0
- package/lib/esm/actions/requirements/midnight/getSetterRatifierRatifyRootRequirement.js +66 -0
- package/lib/esm/actions/requirements/midnight/index.d.ts +3 -0
- package/lib/esm/actions/requirements/midnight/index.js +3 -0
- package/lib/esm/actions/vaultV1/deposit.d.ts +3 -4
- package/lib/esm/actions/vaultV1/deposit.js +8 -9
- package/lib/esm/actions/vaultV1/migrateToV2.d.ts +2 -3
- package/lib/esm/actions/vaultV1/migrateToV2.js +6 -7
- package/lib/esm/actions/vaultV1/redeem.d.ts +1 -1
- package/lib/esm/actions/vaultV1/redeem.js +3 -3
- package/lib/esm/actions/vaultV1/withdraw.d.ts +1 -1
- package/lib/esm/actions/vaultV1/withdraw.js +3 -3
- package/lib/esm/actions/vaultV2/deposit.d.ts +3 -4
- package/lib/esm/actions/vaultV2/deposit.js +8 -9
- package/lib/esm/actions/vaultV2/forceRedeem.d.ts +2 -3
- package/lib/esm/actions/vaultV2/forceRedeem.js +4 -5
- package/lib/esm/actions/vaultV2/forceWithdraw.d.ts +1 -1
- package/lib/esm/actions/vaultV2/forceWithdraw.js +3 -3
- package/lib/esm/actions/vaultV2/redeem.d.ts +1 -1
- package/lib/esm/actions/vaultV2/redeem.js +3 -3
- package/lib/esm/actions/vaultV2/withdraw.d.ts +1 -1
- package/lib/esm/actions/vaultV2/withdraw.js +3 -3
- package/lib/esm/client/morphoViemExtension.d.ts +1 -1
- package/lib/esm/client/morphoViemExtension.js +6 -3
- package/lib/esm/constants.d.ts +1 -0
- package/lib/esm/constants.js +1 -0
- package/lib/esm/entities/blue/blue.d.ts +5 -5
- package/lib/esm/entities/blue/blue.js +95 -70
- package/lib/esm/entities/index.d.ts +1 -0
- package/lib/esm/entities/index.js +1 -0
- package/lib/esm/entities/midnight/index.d.ts +2 -0
- package/lib/esm/entities/midnight/index.js +2 -0
- package/lib/esm/entities/midnight/midnight.d.ts +402 -0
- package/lib/esm/entities/midnight/midnight.js +1032 -0
- package/lib/esm/entities/midnight/types.d.ts +164 -0
- package/lib/esm/entities/midnight/types.js +1 -0
- package/lib/esm/entities/vaultV1/vaultV1.js +13 -20
- package/lib/esm/entities/vaultV2/vaultV2.js +9 -11
- package/lib/esm/errors.d.ts +1 -0
- package/lib/esm/errors.js +1 -0
- package/lib/esm/helpers/encodeDeallocation.d.ts +1 -0
- package/lib/esm/helpers/encodeDeallocation.js +3 -2
- package/lib/esm/helpers/index.d.ts +4 -1
- package/lib/esm/helpers/index.js +4 -1
- package/lib/esm/helpers/signAndVerifyTypedData.d.ts +34 -0
- package/lib/esm/helpers/signAndVerifyTypedData.js +54 -0
- package/lib/esm/helpers/validate.d.ts +40 -1
- package/lib/esm/helpers/validate.js +46 -5
- package/lib/esm/helpers/validateMidnightAuthorizationTarget.d.ts +15 -0
- package/lib/esm/helpers/validateMidnightAuthorizationTarget.js +28 -0
- package/lib/esm/helpers/validateMidnightMarket.d.ts +10 -0
- package/lib/esm/helpers/validateMidnightMarket.js +20 -0
- package/lib/esm/helpers/validateOfferSides.d.ts +21 -0
- package/lib/esm/helpers/validateOfferSides.js +32 -0
- package/lib/esm/helpers/validateRequirementSpender.d.ts +29 -0
- package/lib/esm/helpers/validateRequirementSpender.js +45 -0
- package/lib/esm/helpers/validateTakeableOffers.d.ts +18 -0
- package/lib/esm/helpers/validateTakeableOffers.js +31 -0
- package/lib/esm/midnight-api.d.ts +1 -0
- package/lib/esm/midnight-api.js +1 -0
- package/lib/esm/types/action.d.ts +189 -23
- package/lib/esm/types/action.js +26 -7
- package/lib/esm/types/client.d.ts +3 -2
- package/lib/esm/types/error.d.ts +288 -119
- package/lib/esm/types/error.js +232 -154
- package/lib/esm/utils.d.ts +1 -0
- package/lib/esm/utils.js +1 -0
- package/package.json +12 -3
package/lib/cjs/types/error.d.ts
CHANGED
|
@@ -1,5 +1,137 @@
|
|
|
1
1
|
import { type MarketId, UnknownDataError } from "@morpho-org/blue-sdk";
|
|
2
2
|
import type { Address } from "viem";
|
|
3
|
+
/**
|
|
4
|
+
* Thrown when a morpho-sdk input that must be non-negative is negative.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```ts
|
|
8
|
+
* import { NegativeInputError } from "@morpho-org/morpho-sdk";
|
|
9
|
+
*
|
|
10
|
+
* const error = new NegativeInputError("amount", -1n);
|
|
11
|
+
* if (error instanceof NegativeInputError) {
|
|
12
|
+
* console.error(error.field, error.value);
|
|
13
|
+
* }
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export declare class NegativeInputError extends Error {
|
|
17
|
+
readonly field: string;
|
|
18
|
+
readonly value: bigint;
|
|
19
|
+
/**
|
|
20
|
+
* @param field - Public input field whose value is invalid.
|
|
21
|
+
* @param value - Negative bigint supplied for the field.
|
|
22
|
+
*/
|
|
23
|
+
constructor(field: string, value: bigint);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Thrown when a morpho-sdk input that must be positive is zero or negative.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```ts
|
|
30
|
+
* import { NonPositiveInputError } from "@morpho-org/morpho-sdk";
|
|
31
|
+
*
|
|
32
|
+
* const error = new NonPositiveInputError("shares", 0n);
|
|
33
|
+
* if (error instanceof NonPositiveInputError) {
|
|
34
|
+
* console.error(error.field, error.value);
|
|
35
|
+
* }
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
export declare class NonPositiveInputError extends Error {
|
|
39
|
+
readonly field: string;
|
|
40
|
+
readonly value: bigint;
|
|
41
|
+
/**
|
|
42
|
+
* @param field - Public input field whose value is invalid.
|
|
43
|
+
* @param value - Zero or negative bigint supplied for the field.
|
|
44
|
+
*/
|
|
45
|
+
constructor(field: string, value: bigint);
|
|
46
|
+
}
|
|
47
|
+
/** @deprecated Use {@link NonPositiveInputError}. */
|
|
48
|
+
export declare const NonPositiveAssetAmountError: typeof NonPositiveInputError;
|
|
49
|
+
/** @deprecated Use {@link NonPositiveInputError}. */
|
|
50
|
+
export type NonPositiveAssetAmountError = NonPositiveInputError;
|
|
51
|
+
/** @deprecated Use {@link NonPositiveInputError}. */
|
|
52
|
+
export declare const NonPositiveSharesAmountError: typeof NonPositiveInputError;
|
|
53
|
+
/** @deprecated Use {@link NonPositiveInputError}. */
|
|
54
|
+
export type NonPositiveSharesAmountError = NonPositiveInputError;
|
|
55
|
+
/** @deprecated Use {@link NonPositiveInputError}. */
|
|
56
|
+
export declare const NonPositiveMaxSharePriceError: typeof NonPositiveInputError;
|
|
57
|
+
/** @deprecated Use {@link NonPositiveInputError}. */
|
|
58
|
+
export type NonPositiveMaxSharePriceError = NonPositiveInputError;
|
|
59
|
+
/** @deprecated Use {@link NonPositiveInputError}. */
|
|
60
|
+
export declare const ZeroDepositAmountError: typeof NonPositiveInputError;
|
|
61
|
+
/** @deprecated Use {@link NonPositiveInputError}. */
|
|
62
|
+
export type ZeroDepositAmountError = NonPositiveInputError;
|
|
63
|
+
/** @deprecated Use {@link NonPositiveInputError}. */
|
|
64
|
+
export declare const NonPositiveBorrowAmountError: typeof NonPositiveInputError;
|
|
65
|
+
/** @deprecated Use {@link NonPositiveInputError}. */
|
|
66
|
+
export type NonPositiveBorrowAmountError = NonPositiveInputError;
|
|
67
|
+
/** @deprecated Use {@link NonPositiveInputError}. */
|
|
68
|
+
export declare const ZeroCollateralAmountError: typeof NonPositiveInputError;
|
|
69
|
+
/** @deprecated Use {@link NonPositiveInputError}. */
|
|
70
|
+
export type ZeroCollateralAmountError = NonPositiveInputError;
|
|
71
|
+
/** @deprecated Use {@link NonPositiveInputError}. */
|
|
72
|
+
export declare const NonPositiveReallocationAmountError: typeof NonPositiveInputError;
|
|
73
|
+
/** @deprecated Use {@link NonPositiveInputError}. */
|
|
74
|
+
export type NonPositiveReallocationAmountError = NonPositiveInputError;
|
|
75
|
+
/** @deprecated Use {@link NonPositiveInputError}. */
|
|
76
|
+
export declare const NonPositiveRepayAmountError: typeof NonPositiveInputError;
|
|
77
|
+
/** @deprecated Use {@link NonPositiveInputError}. */
|
|
78
|
+
export type NonPositiveRepayAmountError = NonPositiveInputError;
|
|
79
|
+
/** @deprecated Use {@link NonPositiveInputError}. */
|
|
80
|
+
export declare const NonPositiveRepayMaxSharePriceError: typeof NonPositiveInputError;
|
|
81
|
+
/** @deprecated Use {@link NonPositiveInputError}. */
|
|
82
|
+
export type NonPositiveRepayMaxSharePriceError = NonPositiveInputError;
|
|
83
|
+
/** @deprecated Use {@link NonPositiveInputError}. */
|
|
84
|
+
export declare const NonPositiveWithdrawCollateralAmountError: typeof NonPositiveInputError;
|
|
85
|
+
/** @deprecated Use {@link NonPositiveInputError}. */
|
|
86
|
+
export type NonPositiveWithdrawCollateralAmountError = NonPositiveInputError;
|
|
87
|
+
/** @deprecated Use {@link NonPositiveInputError}. */
|
|
88
|
+
export declare const ZeroSupplyAmountError: typeof NonPositiveInputError;
|
|
89
|
+
/** @deprecated Use {@link NonPositiveInputError}. */
|
|
90
|
+
export type ZeroSupplyAmountError = NonPositiveInputError;
|
|
91
|
+
/** @deprecated Use {@link NonPositiveInputError}. */
|
|
92
|
+
export declare const NonPositiveWithdrawAmountError: typeof NonPositiveInputError;
|
|
93
|
+
/** @deprecated Use {@link NonPositiveInputError}. */
|
|
94
|
+
export type NonPositiveWithdrawAmountError = NonPositiveInputError;
|
|
95
|
+
/** @deprecated Use {@link NegativeInputError}. */
|
|
96
|
+
export declare const NegativeSlippageToleranceError: typeof NegativeInputError;
|
|
97
|
+
/** @deprecated Use {@link NegativeInputError}. */
|
|
98
|
+
export type NegativeSlippageToleranceError = NegativeInputError;
|
|
99
|
+
/** @deprecated Use {@link NegativeInputError}. */
|
|
100
|
+
export declare const NegativeNativeAmountError: typeof NegativeInputError;
|
|
101
|
+
/** @deprecated Use {@link NegativeInputError}. */
|
|
102
|
+
export type NegativeNativeAmountError = NegativeInputError;
|
|
103
|
+
/** @deprecated Use {@link NegativeInputError}. */
|
|
104
|
+
export declare const NegativeReallocationFeeError: typeof NegativeInputError;
|
|
105
|
+
/** @deprecated Use {@link NegativeInputError}. */
|
|
106
|
+
export type NegativeReallocationFeeError = NegativeInputError;
|
|
107
|
+
/** @deprecated Use {@link NegativeInputError}. */
|
|
108
|
+
export declare const NonPositiveMinBorrowSharePriceError: typeof NegativeInputError;
|
|
109
|
+
/** @deprecated Use {@link NegativeInputError}. */
|
|
110
|
+
export type NonPositiveMinBorrowSharePriceError = NegativeInputError;
|
|
111
|
+
/** @deprecated Use {@link NegativeInputError}. */
|
|
112
|
+
export declare const NegativeSupplyAmountError: typeof NegativeInputError;
|
|
113
|
+
/** @deprecated Use {@link NegativeInputError}. */
|
|
114
|
+
export type NegativeSupplyAmountError = NegativeInputError;
|
|
115
|
+
/** @deprecated Use {@link NegativeInputError}. */
|
|
116
|
+
export declare const NegativeSupplyMaxSharePriceError: typeof NegativeInputError;
|
|
117
|
+
/** @deprecated Use {@link NegativeInputError}. */
|
|
118
|
+
export type NegativeSupplyMaxSharePriceError = NegativeInputError;
|
|
119
|
+
/** @deprecated Use {@link NegativeInputError}. */
|
|
120
|
+
export declare const NegativeWithdrawMinSharePriceError: typeof NegativeInputError;
|
|
121
|
+
/** @deprecated Use {@link NegativeInputError}. */
|
|
122
|
+
export type NegativeWithdrawMinSharePriceError = NegativeInputError;
|
|
123
|
+
/** @deprecated Use {@link NegativeInputError}. */
|
|
124
|
+
export declare const NegativeMinSharePriceError: typeof NegativeInputError;
|
|
125
|
+
/** @deprecated Use {@link NegativeInputError}. */
|
|
126
|
+
export type NegativeMinSharePriceError = NegativeInputError;
|
|
127
|
+
/** @deprecated Use {@link NegativeInputError}. */
|
|
128
|
+
export declare const NegativeBorrowSharesError: typeof NegativeInputError;
|
|
129
|
+
/** @deprecated Use {@link NegativeInputError}. */
|
|
130
|
+
export type NegativeBorrowSharesError = NegativeInputError;
|
|
131
|
+
/** @deprecated Use {@link NegativeInputError}. */
|
|
132
|
+
export declare const NegativeMaxRepaySharePriceError: typeof NegativeInputError;
|
|
133
|
+
/** @deprecated Use {@link NegativeInputError}. */
|
|
134
|
+
export type NegativeMaxRepaySharePriceError = NegativeInputError;
|
|
3
135
|
/**
|
|
4
136
|
* Typed errors thrown while encoding supported Bundler3 actions.
|
|
5
137
|
*
|
|
@@ -63,32 +195,33 @@ export declare namespace BundlerErrors {
|
|
|
63
195
|
constructor(authorized: Address);
|
|
64
196
|
}
|
|
65
197
|
}
|
|
198
|
+
/** Requirement signature kind accepted by action-output transaction builders. */
|
|
199
|
+
export type RequirementSignatureKind = "permit" | "authorization" | "midnightOfferRootSignature";
|
|
66
200
|
/**
|
|
67
201
|
* Thrown when `buildTx` receives more than one requirement signature of the same kind.
|
|
68
202
|
*
|
|
69
|
-
* A bundled path consumes at most one
|
|
70
|
-
*
|
|
203
|
+
* A bundled path consumes at most one signature per accepted kind; passing several of the same
|
|
204
|
+
* kind is ambiguous and would silently drop all but the first, so it is rejected instead.
|
|
71
205
|
*
|
|
72
206
|
* @example
|
|
73
207
|
* ```ts
|
|
74
208
|
* import { AmbiguousRequirementSignaturesError } from "@morpho-org/morpho-sdk";
|
|
75
209
|
*
|
|
76
210
|
* if (error instanceof AmbiguousRequirementSignaturesError) {
|
|
77
|
-
* // Pass a single
|
|
211
|
+
* // Pass a single signature per accepted kind to buildTx.
|
|
78
212
|
* }
|
|
79
213
|
* ```
|
|
80
214
|
*/
|
|
81
215
|
export declare class AmbiguousRequirementSignaturesError extends Error {
|
|
82
216
|
/**
|
|
83
|
-
* @param kind - The over-supplied signature kind
|
|
217
|
+
* @param kind - The over-supplied signature kind.
|
|
84
218
|
* @param count - How many signatures of that kind were received.
|
|
85
219
|
*/
|
|
86
|
-
constructor(kind:
|
|
220
|
+
constructor(kind: RequirementSignatureKind, count: number);
|
|
87
221
|
}
|
|
88
222
|
/**
|
|
89
|
-
* Thrown when `buildTx` receives a requirement signature of a kind the operation does not consume
|
|
90
|
-
*
|
|
91
|
-
* authorization or permit from being silently ignored.
|
|
223
|
+
* Thrown when `buildTx` receives a requirement signature of a kind the operation does not consume.
|
|
224
|
+
* Surfacing it prevents a signed requirement from being silently ignored.
|
|
92
225
|
*
|
|
93
226
|
* @example
|
|
94
227
|
* ```ts
|
|
@@ -101,21 +234,9 @@ export declare class AmbiguousRequirementSignaturesError extends Error {
|
|
|
101
234
|
*/
|
|
102
235
|
export declare class UnexpectedRequirementSignatureError extends Error {
|
|
103
236
|
/**
|
|
104
|
-
* @param kind - The unexpected signature kind
|
|
237
|
+
* @param kind - The unexpected signature kind.
|
|
105
238
|
*/
|
|
106
|
-
constructor(kind:
|
|
107
|
-
}
|
|
108
|
-
/** Thrown when an asset amount is required to be positive but is zero or negative. */
|
|
109
|
-
export declare class NonPositiveAssetAmountError extends Error {
|
|
110
|
-
constructor(origin: Address);
|
|
111
|
-
}
|
|
112
|
-
/** Thrown when a shares amount is required to be positive but is zero or negative. */
|
|
113
|
-
export declare class NonPositiveSharesAmountError extends Error {
|
|
114
|
-
constructor(vault: Address);
|
|
115
|
-
}
|
|
116
|
-
/** Thrown when a vault deposit's `maxSharePrice` slippage bound is zero or negative. */
|
|
117
|
-
export declare class NonPositiveMaxSharePriceError extends Error {
|
|
118
|
-
constructor(vault: Address);
|
|
239
|
+
constructor(kind: RequirementSignatureKind);
|
|
119
240
|
}
|
|
120
241
|
/** Thrown when a viem client's account address does not match the address required by the call. */
|
|
121
242
|
export declare class AddressMismatchError extends Error {
|
|
@@ -125,6 +246,10 @@ export declare class AddressMismatchError extends Error {
|
|
|
125
246
|
export declare class ChainIdMismatchError extends Error {
|
|
126
247
|
constructor(clientChainId: number | undefined, argsChainId: number);
|
|
127
248
|
}
|
|
249
|
+
/** Thrown when a runtime crypto API is required but unavailable. */
|
|
250
|
+
export declare class CryptoUnavailableError extends Error {
|
|
251
|
+
constructor(feature: string);
|
|
252
|
+
}
|
|
128
253
|
/** Thrown when the viem client is missing a property the call requires (e.g. `account.address`). */
|
|
129
254
|
export declare class MissingClientPropertyError extends Error {
|
|
130
255
|
constructor(property: string);
|
|
@@ -145,13 +270,17 @@ export declare class UnsupportedErc20ApprovalSpenderError extends Error {
|
|
|
145
270
|
readonly supportedSpenders?: readonly (Address | undefined)[];
|
|
146
271
|
});
|
|
147
272
|
}
|
|
148
|
-
/** Thrown when a
|
|
149
|
-
export declare class
|
|
150
|
-
constructor(
|
|
273
|
+
/** Thrown when a Midnight authorization requirement targets an unsupported operator. */
|
|
274
|
+
export declare class UnsupportedMidnightAuthorizationTargetError extends Error {
|
|
275
|
+
constructor(params: {
|
|
276
|
+
readonly authorized: Address;
|
|
277
|
+
readonly chainId: number;
|
|
278
|
+
readonly supportedTargets: readonly Address[];
|
|
279
|
+
});
|
|
151
280
|
}
|
|
152
|
-
/** Thrown when a Morpho accrual position
|
|
281
|
+
/** Thrown when a Morpho accrual position required by a call is missing. */
|
|
153
282
|
export declare class MissingAccrualPositionError extends Error {
|
|
154
|
-
constructor(market
|
|
283
|
+
constructor(market?: string);
|
|
155
284
|
}
|
|
156
285
|
/** Thrown when a slippage tolerance exceeds `MAX_SLIPPAGE_TOLERANCE` (10%). */
|
|
157
286
|
export declare class ExcessiveSlippageToleranceError extends Error {
|
|
@@ -169,6 +298,14 @@ export declare class DepositAmountMismatchError extends Error {
|
|
|
169
298
|
export declare class DepositAssetMismatchError extends Error {
|
|
170
299
|
constructor(depositAsset: Address, signatureAsset: Address);
|
|
171
300
|
}
|
|
301
|
+
/** Thrown when a deposit's owner differs from the owner the supplied permit / permit2 signature was issued for. */
|
|
302
|
+
export declare class DepositOwnerMismatchError extends Error {
|
|
303
|
+
constructor(depositOwner: Address, signatureOwner: Address);
|
|
304
|
+
}
|
|
305
|
+
/** Thrown when a deposit's spender differs from the spender the supplied permit / permit2 signature was issued for. */
|
|
306
|
+
export declare class DepositSpenderMismatchError extends Error {
|
|
307
|
+
constructor(depositSpender: Address, signatureSpender: Address);
|
|
308
|
+
}
|
|
172
309
|
/** Thrown when a `permit2` requirement signature is missing the `expiration` field. */
|
|
173
310
|
export declare class Permit2ExpirationMissingError extends Error {
|
|
174
311
|
constructor();
|
|
@@ -181,26 +318,10 @@ export declare class NativeAmountOnNonWNativeVaultError extends Error {
|
|
|
181
318
|
export declare class ChainWNativeMissingError extends Error {
|
|
182
319
|
constructor(chainId: number);
|
|
183
320
|
}
|
|
184
|
-
/** Thrown when `nativeAmount` is negative. */
|
|
185
|
-
export declare class NegativeNativeAmountError extends Error {
|
|
186
|
-
constructor(nativeAmount: bigint);
|
|
187
|
-
}
|
|
188
|
-
/** Thrown when both `amount` and `nativeAmount` resolve to zero on a vault deposit. */
|
|
189
|
-
export declare class ZeroDepositAmountError extends Error {
|
|
190
|
-
constructor(vault: Address);
|
|
191
|
-
}
|
|
192
321
|
/** Thrown when a vault entity's address does not match the vault address embedded in the call's args. */
|
|
193
322
|
export declare class VaultAddressMismatchError extends Error {
|
|
194
323
|
constructor(vaultAddress: Address, argsVaultAddress: Address);
|
|
195
324
|
}
|
|
196
|
-
/** Thrown when a market borrow amount is zero or negative. */
|
|
197
|
-
export declare class NonPositiveBorrowAmountError extends Error {
|
|
198
|
-
constructor(market: string);
|
|
199
|
-
}
|
|
200
|
-
/** Thrown when both `amount` and `nativeAmount` resolve to zero on a market collateral supply. */
|
|
201
|
-
export declare class ZeroCollateralAmountError extends Error {
|
|
202
|
-
constructor(market: string);
|
|
203
|
-
}
|
|
204
325
|
/** Thrown when an action uses `nativeAmount` but the target asset is not the chain's wNative. */
|
|
205
326
|
export declare class NativeAmountOnNonWNativeAssetError extends Error {
|
|
206
327
|
constructor(asset: Address, wNative: Address);
|
|
@@ -224,18 +345,10 @@ export declare class MarketIdMismatchError extends Error {
|
|
|
224
345
|
export declare class AccrualPositionUserMismatchError extends Error {
|
|
225
346
|
constructor(positionUser: string, expectedUser: string);
|
|
226
347
|
}
|
|
227
|
-
/** Thrown when a reallocation's fee is negative. */
|
|
228
|
-
export declare class NegativeReallocationFeeError extends Error {
|
|
229
|
-
constructor(vault: string);
|
|
230
|
-
}
|
|
231
348
|
/** Thrown when a reallocation has no withdrawals. */
|
|
232
349
|
export declare class EmptyReallocationWithdrawalsError extends Error {
|
|
233
350
|
constructor(vault: string);
|
|
234
351
|
}
|
|
235
|
-
/** Thrown when a reallocation withdrawal amount is zero or negative. */
|
|
236
|
-
export declare class NonPositiveReallocationAmountError extends Error {
|
|
237
|
-
constructor(vault: string, market: string);
|
|
238
|
-
}
|
|
239
352
|
/** Thrown when a reallocation withdrawal references the operation's target market (which would be a no-op or self-deal). */
|
|
240
353
|
export declare class ReallocationWithdrawalOnTargetMarketError extends Error {
|
|
241
354
|
constructor(vault: string, marketId: string);
|
|
@@ -244,17 +357,6 @@ export declare class ReallocationWithdrawalOnTargetMarketError extends Error {
|
|
|
244
357
|
export declare class UnsortedReallocationWithdrawalsError extends Error {
|
|
245
358
|
constructor(vault: string, marketId: string);
|
|
246
359
|
}
|
|
247
|
-
/**
|
|
248
|
-
* Thrown when a market repay's `transferAmount` is zero or negative.
|
|
249
|
-
*
|
|
250
|
-
* @deprecated No longer thrown. The repay action layer no longer validates `transferAmount`
|
|
251
|
-
* directly (assets mode uses {@link NonPositiveRepayAmountError}; shares mode allows a zero
|
|
252
|
-
* ERC-20 transfer for fully-native repays). Retained as exported API for back-compat; slated
|
|
253
|
-
* for removal in a future major.
|
|
254
|
-
*/
|
|
255
|
-
export declare class NonPositiveTransferAmountError extends Error {
|
|
256
|
-
constructor(market: string);
|
|
257
|
-
}
|
|
258
360
|
/**
|
|
259
361
|
* Thrown when a market repay in assets mode has `transferAmount !== amount + nativeAmount` — the
|
|
260
362
|
* pre-resolved ERC-20 pull plus the wrapped native must equal the assets repaid, so the bundle
|
|
@@ -267,38 +369,10 @@ export declare class TransferAmountNotEqualToAssetsError extends Error {
|
|
|
267
369
|
market: string;
|
|
268
370
|
});
|
|
269
371
|
}
|
|
270
|
-
/**
|
|
271
|
-
* Thrown when a shares-mode repay's `nativeAmount` exceeds `transferAmount`, which
|
|
272
|
-
* would make the ERC-20 amount to pull (`transferAmount − nativeAmount`) negative.
|
|
273
|
-
*
|
|
274
|
-
* @deprecated No longer thrown. A shares-mode repay now accepts a `nativeAmount` that
|
|
275
|
-
* covers (or exceeds) the full repaid assets: it wraps the native, pulls no ERC-20, and
|
|
276
|
-
* the bundle skims the residual wNative back to the receiver. This class is retained for
|
|
277
|
-
* one minor for API stability and will be removed in the next major.
|
|
278
|
-
*/
|
|
279
|
-
export declare class NativeAmountExceedsTransferAmountError extends Error {
|
|
280
|
-
constructor(params: {
|
|
281
|
-
nativeAmount: bigint;
|
|
282
|
-
transferAmount: bigint;
|
|
283
|
-
market: string;
|
|
284
|
-
});
|
|
285
|
-
}
|
|
286
372
|
/** Thrown when a market repay specifies both `assets` and `shares` as non-zero (modes are mutually exclusive). */
|
|
287
373
|
export declare class MutuallyExclusiveRepayAmountsError extends Error {
|
|
288
374
|
constructor(market: string);
|
|
289
375
|
}
|
|
290
|
-
/** Thrown when a market repay has non-positive amounts: both `assets` and `shares` are zero, or either is negative. */
|
|
291
|
-
export declare class NonPositiveRepayAmountError extends Error {
|
|
292
|
-
constructor(market: string);
|
|
293
|
-
}
|
|
294
|
-
/** Thrown when a market repay's `maxSharePrice` slippage bound is zero or negative. */
|
|
295
|
-
export declare class NonPositiveRepayMaxSharePriceError extends Error {
|
|
296
|
-
constructor(market: string);
|
|
297
|
-
}
|
|
298
|
-
/** Thrown when a market `withdrawCollateral` amount is zero or negative. */
|
|
299
|
-
export declare class NonPositiveWithdrawCollateralAmountError extends Error {
|
|
300
|
-
constructor(market: string);
|
|
301
|
-
}
|
|
302
376
|
/** Thrown when a withdraw amount exceeds the position's available collateral. */
|
|
303
377
|
export declare class WithdrawExceedsCollateralError extends Error {
|
|
304
378
|
constructor(params: {
|
|
@@ -404,30 +478,137 @@ export declare class UnknownReallocationPositionError extends UnknownDataError {
|
|
|
404
478
|
*/
|
|
405
479
|
constructor(user: Address, marketId: MarketId);
|
|
406
480
|
}
|
|
407
|
-
/** Thrown when a
|
|
408
|
-
export declare class
|
|
409
|
-
constructor(
|
|
481
|
+
/** Thrown when a Midnight amount exceeds the maximum offer-cap value accepted onchain. */
|
|
482
|
+
export declare class MidnightAmountExceedsMaxOfferCapError extends Error {
|
|
483
|
+
constructor(params: {
|
|
484
|
+
readonly label: string;
|
|
485
|
+
readonly amount: bigint;
|
|
486
|
+
readonly maxOfferCap: bigint;
|
|
487
|
+
});
|
|
410
488
|
}
|
|
411
|
-
/** Thrown when a
|
|
412
|
-
export declare class
|
|
413
|
-
constructor(
|
|
489
|
+
/** Thrown when a Midnight flow needs at least one takeable offer. */
|
|
490
|
+
export declare class EmptyMidnightTakeableOffersError extends Error {
|
|
491
|
+
constructor();
|
|
414
492
|
}
|
|
415
|
-
/** Thrown when a
|
|
416
|
-
export declare class
|
|
417
|
-
constructor(
|
|
493
|
+
/** Thrown when a Midnight offer has the wrong maker side for the requested flow. */
|
|
494
|
+
export declare class MidnightOfferSideMismatchError extends Error {
|
|
495
|
+
constructor(params: {
|
|
496
|
+
index: number;
|
|
497
|
+
expectedBuy: boolean;
|
|
498
|
+
actualBuy: boolean;
|
|
499
|
+
});
|
|
418
500
|
}
|
|
419
|
-
/** Thrown when
|
|
420
|
-
export declare class
|
|
421
|
-
constructor(
|
|
501
|
+
/** Thrown when a Midnight maker offer belongs to a different account than the action flow. */
|
|
502
|
+
export declare class MidnightOfferMakerMismatchError extends Error {
|
|
503
|
+
constructor(params: {
|
|
504
|
+
readonly index: number;
|
|
505
|
+
readonly expectedMaker: Address;
|
|
506
|
+
readonly actualMaker: Address;
|
|
507
|
+
});
|
|
422
508
|
}
|
|
423
|
-
/** Thrown when a
|
|
424
|
-
export declare class
|
|
425
|
-
constructor(
|
|
509
|
+
/** Thrown when a Midnight maker offer targets a different chain than the action flow. */
|
|
510
|
+
export declare class MidnightOfferMarketChainMismatchError extends Error {
|
|
511
|
+
constructor(params: {
|
|
512
|
+
readonly index: number;
|
|
513
|
+
readonly expectedChainId: number;
|
|
514
|
+
readonly actualChainId: bigint;
|
|
515
|
+
});
|
|
516
|
+
}
|
|
517
|
+
/** Thrown when a Midnight maker offer targets a different Midnight contract than the action flow. */
|
|
518
|
+
export declare class MidnightOfferMarketAddressMismatchError extends Error {
|
|
519
|
+
constructor(params: {
|
|
520
|
+
readonly index: number;
|
|
521
|
+
readonly expectedMidnight: Address;
|
|
522
|
+
readonly actualMidnight: Address;
|
|
523
|
+
});
|
|
524
|
+
}
|
|
525
|
+
/** Thrown when a Midnight market targets a different deployment than the selected chain. */
|
|
526
|
+
export declare class MidnightMarketAddressMismatchError extends Error {
|
|
527
|
+
constructor(params: {
|
|
528
|
+
readonly expectedMidnight: Address;
|
|
529
|
+
readonly actualMidnight: Address;
|
|
530
|
+
});
|
|
531
|
+
}
|
|
532
|
+
/** Thrown when a Midnight make-lend offer does not use the approved loan token. */
|
|
533
|
+
export declare class MidnightOfferMarketLoanTokenMismatchError extends Error {
|
|
534
|
+
constructor(params: {
|
|
535
|
+
readonly index: number;
|
|
536
|
+
readonly expectedLoanToken: Address;
|
|
537
|
+
readonly actualLoanToken: Address;
|
|
538
|
+
});
|
|
539
|
+
}
|
|
540
|
+
/** Thrown when a quoted Midnight takeable offer belongs to a different market than the requested flow. */
|
|
541
|
+
export declare class MidnightTakeableOfferMarketMismatchError extends Error {
|
|
542
|
+
constructor(params: {
|
|
543
|
+
index: number;
|
|
544
|
+
expectedMarket: string;
|
|
545
|
+
actualMarket: string;
|
|
546
|
+
});
|
|
547
|
+
}
|
|
548
|
+
/** Thrown when a Midnight offer tree uses an unsupported ratifier address. */
|
|
549
|
+
export declare class UnknownMidnightRatifierError extends Error {
|
|
550
|
+
constructor(params: {
|
|
551
|
+
ratifier: Address;
|
|
552
|
+
ecrecoverRatifier: Address;
|
|
553
|
+
setterRatifier: Address;
|
|
554
|
+
});
|
|
426
555
|
}
|
|
427
|
-
/** Thrown when a
|
|
428
|
-
export declare class
|
|
556
|
+
/** Thrown when a Midnight Ecrecover maker flow builds the submit transaction before signing. */
|
|
557
|
+
export declare class MissingMidnightOfferRootSignatureError extends Error {
|
|
558
|
+
constructor();
|
|
559
|
+
}
|
|
560
|
+
/** Thrown when a Midnight offer-root signature does not match the prepared tree root. */
|
|
561
|
+
export declare class MidnightOfferRootMismatchError extends Error {
|
|
562
|
+
constructor(params: {
|
|
563
|
+
expectedRoot: string;
|
|
564
|
+
actualRoot: string;
|
|
565
|
+
});
|
|
566
|
+
}
|
|
567
|
+
/** Thrown when a Midnight offer-root signature was produced by another maker account. */
|
|
568
|
+
export declare class MidnightOfferRootOwnerMismatchError extends Error {
|
|
569
|
+
constructor(params: {
|
|
570
|
+
expectedOwner: Address;
|
|
571
|
+
actualOwner: Address;
|
|
572
|
+
});
|
|
573
|
+
}
|
|
574
|
+
/** Thrown when a Midnight offer-root signature targets another ratifier. */
|
|
575
|
+
export declare class MidnightOfferRootRatifierMismatchError extends Error {
|
|
576
|
+
constructor(params: {
|
|
577
|
+
expectedRatifier: Address;
|
|
578
|
+
actualRatifier: Address;
|
|
579
|
+
});
|
|
580
|
+
}
|
|
581
|
+
/** Thrown when a Midnight offer-root signature was produced for another offer count. */
|
|
582
|
+
export declare class MidnightOfferRootOfferCountMismatchError extends Error {
|
|
583
|
+
constructor(params: {
|
|
584
|
+
expectedOffers: number;
|
|
585
|
+
actualOffers: number;
|
|
586
|
+
});
|
|
587
|
+
}
|
|
588
|
+
/** Thrown when a Midnight offer-root signature was not prepared by this maker flow. */
|
|
589
|
+
export declare class UnpreparedMidnightOfferRootSignatureError extends Error {
|
|
590
|
+
constructor();
|
|
591
|
+
}
|
|
592
|
+
/** Thrown when a Midnight redeem flow finds no credit units for the user. */
|
|
593
|
+
export declare class NoMidnightCreditToRedeemError extends Error {
|
|
429
594
|
constructor(market: string);
|
|
430
595
|
}
|
|
596
|
+
/** Thrown when a Midnight redeem amount exceeds the user's accrued credit. */
|
|
597
|
+
export declare class MidnightRedeemExceedsCreditError extends Error {
|
|
598
|
+
constructor(params: {
|
|
599
|
+
market: string;
|
|
600
|
+
units: bigint;
|
|
601
|
+
credit: bigint;
|
|
602
|
+
});
|
|
603
|
+
}
|
|
604
|
+
/** Thrown when a Midnight redeem amount exceeds the market's currently withdrawable liquidity. */
|
|
605
|
+
export declare class InsufficientMidnightWithdrawableLiquidityError extends Error {
|
|
606
|
+
constructor(params: {
|
|
607
|
+
market: string;
|
|
608
|
+
units: bigint;
|
|
609
|
+
withdrawable: bigint;
|
|
610
|
+
});
|
|
611
|
+
}
|
|
431
612
|
/** Thrown when a loan-asset withdraw specifies both `assets` and `shares` as non-zero (modes are mutually exclusive). */
|
|
432
613
|
export declare class MutuallyExclusiveWithdrawAmountsError extends Error {
|
|
433
614
|
constructor(market: string);
|
|
@@ -471,22 +652,10 @@ export declare class ReallocationWithdrawExceedsMarketSupplyError extends Error
|
|
|
471
652
|
export declare class VaultAssetMismatchError extends Error {
|
|
472
653
|
constructor(sourceAsset: Address, targetAsset: Address);
|
|
473
654
|
}
|
|
474
|
-
/** Thrown when a vault redeem's `minSharePrice` slippage bound is negative. */
|
|
475
|
-
export declare class NegativeMinSharePriceError extends Error {
|
|
476
|
-
constructor(vault: Address);
|
|
477
|
-
}
|
|
478
|
-
/** Thrown when a refinance's `borrowShares` argument is negative. */
|
|
479
|
-
export declare class NegativeBorrowSharesError extends Error {
|
|
480
|
-
constructor(market: string);
|
|
481
|
-
}
|
|
482
655
|
/** Thrown when a refinance specifies both `borrowAssets` and `borrowShares` as non-zero (modes are mutually exclusive). */
|
|
483
656
|
export declare class BorrowAmountAndSharesExclusiveError extends Error {
|
|
484
657
|
constructor(market: string);
|
|
485
658
|
}
|
|
486
|
-
/** Thrown when a refinance's `maxRepaySharePrice` slippage bound is negative. */
|
|
487
|
-
export declare class NegativeMaxRepaySharePriceError extends Error {
|
|
488
|
-
constructor(market: string);
|
|
489
|
-
}
|
|
490
659
|
/** Thrown when a refinance has identical source and target market ids (a refinance to the same market is a costly no-op). */
|
|
491
660
|
export declare class RefinanceSameMarketError extends Error {
|
|
492
661
|
constructor(market: string);
|