@morpho-org/morpho-sdk 9.1.0-next.0 → 9.2.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 +7 -1
- package/lib/cjs/abis.d.ts +2 -2
- package/lib/cjs/abis.js +3 -5
- package/lib/cjs/actions/blue/borrow.d.ts +1 -0
- package/lib/cjs/actions/blue/borrow.js +1 -0
- package/lib/cjs/actions/blue/refinance.d.ts +1 -0
- package/lib/cjs/actions/blue/refinance.js +3 -0
- package/lib/cjs/actions/blue/repay.d.ts +1 -0
- package/lib/cjs/actions/blue/repay.js +1 -0
- package/lib/cjs/actions/blue/repayWithdrawCollateral.d.ts +1 -0
- package/lib/cjs/actions/blue/repayWithdrawCollateral.js +2 -0
- package/lib/cjs/actions/blue/supply.d.ts +1 -0
- package/lib/cjs/actions/blue/supply.js +2 -0
- package/lib/cjs/actions/blue/supplyCollateral.d.ts +1 -0
- package/lib/cjs/actions/blue/supplyCollateral.js +1 -0
- package/lib/cjs/actions/blue/supplyCollateralBorrow.d.ts +1 -0
- package/lib/cjs/actions/blue/supplyCollateralBorrow.js +2 -0
- package/lib/cjs/actions/blue/withdraw.d.ts +1 -0
- package/lib/cjs/actions/blue/withdraw.js +2 -0
- package/lib/cjs/actions/blue/withdrawCollateral.d.ts +1 -0
- package/lib/cjs/actions/blue/withdrawCollateral.js +1 -0
- package/lib/cjs/actions/midnight/takeLend.d.ts +1 -0
- package/lib/cjs/actions/midnight/takeLend.js +1 -0
- package/lib/cjs/actions/midnight/takeRepayWithdrawCollateral.d.ts +1 -0
- package/lib/cjs/actions/midnight/takeRepayWithdrawCollateral.js +1 -0
- package/lib/cjs/blue/abis.d.ts +1 -1
- package/lib/cjs/blue/abis.js +1 -5
- package/lib/cjs/blue/constants.d.ts +1 -1
- package/lib/cjs/blue/constants.js +2 -1
- package/lib/cjs/blue/entities.d.ts +4 -4
- package/lib/cjs/blue/entities.js +1 -3
- package/lib/cjs/blue/errors.d.ts +2 -2
- package/lib/cjs/blue/errors.js +2 -5
- package/lib/cjs/blue/fetch.d.ts +2 -2
- package/lib/cjs/blue/fetch.js +1 -3
- package/lib/cjs/blue/utils.d.ts +1 -1
- package/lib/cjs/blue/utils.js +1 -2
- package/lib/cjs/client/morphoViemExtension.d.ts +1 -1
- package/lib/cjs/client/morphoViemExtension.js +1 -7
- package/lib/cjs/constants.d.ts +2 -2
- package/lib/cjs/constants.js +4 -1
- package/lib/cjs/entities/blue/blue.d.ts +112 -21
- package/lib/cjs/entities/blue/blue.js +58 -6
- package/lib/cjs/entities/index.d.ts +4 -4
- package/lib/cjs/entities/index.js +1 -3
- package/lib/cjs/entities/midnight/midnight.d.ts +9 -6
- package/lib/cjs/entities/midnight/midnight.js +12 -9
- package/lib/cjs/entities/midnight/types.d.ts +8 -1
- package/lib/cjs/entities/vaultV1/vaultV1.d.ts +8 -0
- package/lib/cjs/entities/vaultV1/vaultV1.js +5 -0
- package/lib/cjs/entities/vaultV2/vaultV2.d.ts +16 -34
- package/lib/cjs/entities/vaultV2/vaultV2.js +12 -38
- package/lib/cjs/entities/vaultV2BlueReallocationData.d.ts +77 -19
- package/lib/cjs/entities/vaultV2BlueReallocationData.js +376 -80
- package/lib/cjs/errors.d.ts +4 -4
- package/lib/cjs/errors.js +6 -10
- package/lib/cjs/fetch.d.ts +2 -2
- package/lib/cjs/fetch.js +1 -3
- package/lib/cjs/helpers/constant.d.ts +7 -0
- package/lib/cjs/helpers/constant.js +8 -1
- package/lib/cjs/helpers/deadShares.d.ts +82 -0
- package/lib/cjs/helpers/deadShares.js +200 -0
- package/lib/cjs/helpers/index.d.ts +2 -1
- package/lib/cjs/helpers/index.js +7 -1
- package/lib/cjs/helpers/validate.d.ts +11 -1
- package/lib/cjs/helpers/validate.js +17 -1
- package/lib/cjs/helpers/validateTakeableOffers.d.ts +4 -2
- package/lib/cjs/helpers/validateTakeableOffers.js +12 -1
- package/lib/cjs/midnight/abis.d.ts +1 -1
- package/lib/cjs/midnight/abis.js +3 -1
- package/lib/cjs/midnight/errors.d.ts +1 -2
- package/lib/cjs/midnight/errors.js +4 -5
- package/lib/cjs/types/error.d.ts +60 -5
- package/lib/cjs/types/error.js +68 -6
- package/lib/cjs/types/sharedLiquidity.d.ts +31 -11
- package/lib/cjs/utils.d.ts +2 -2
- package/lib/cjs/utils.js +2 -4
- package/lib/esm/abis.d.ts +2 -2
- package/lib/esm/abis.js +2 -2
- package/lib/esm/actions/blue/borrow.d.ts +1 -0
- package/lib/esm/actions/blue/borrow.js +1 -0
- package/lib/esm/actions/blue/refinance.d.ts +1 -0
- package/lib/esm/actions/blue/refinance.js +4 -1
- package/lib/esm/actions/blue/repay.d.ts +1 -0
- package/lib/esm/actions/blue/repay.js +1 -0
- package/lib/esm/actions/blue/repayWithdrawCollateral.d.ts +1 -0
- package/lib/esm/actions/blue/repayWithdrawCollateral.js +3 -1
- package/lib/esm/actions/blue/supply.d.ts +1 -0
- package/lib/esm/actions/blue/supply.js +3 -1
- package/lib/esm/actions/blue/supplyCollateral.d.ts +1 -0
- package/lib/esm/actions/blue/supplyCollateral.js +1 -0
- package/lib/esm/actions/blue/supplyCollateralBorrow.d.ts +1 -0
- package/lib/esm/actions/blue/supplyCollateralBorrow.js +3 -1
- package/lib/esm/actions/blue/withdraw.d.ts +1 -0
- package/lib/esm/actions/blue/withdraw.js +3 -1
- package/lib/esm/actions/blue/withdrawCollateral.d.ts +1 -0
- package/lib/esm/actions/blue/withdrawCollateral.js +1 -0
- package/lib/esm/actions/midnight/takeLend.d.ts +1 -0
- package/lib/esm/actions/midnight/takeLend.js +1 -0
- package/lib/esm/actions/midnight/takeRepayWithdrawCollateral.d.ts +1 -0
- package/lib/esm/actions/midnight/takeRepayWithdrawCollateral.js +1 -0
- package/lib/esm/blue/abis.d.ts +1 -1
- package/lib/esm/blue/abis.js +1 -1
- package/lib/esm/blue/constants.d.ts +1 -1
- package/lib/esm/blue/constants.js +1 -1
- package/lib/esm/blue/entities.d.ts +4 -4
- package/lib/esm/blue/entities.js +2 -2
- package/lib/esm/blue/errors.d.ts +2 -2
- package/lib/esm/blue/errors.js +2 -2
- package/lib/esm/blue/fetch.d.ts +2 -2
- package/lib/esm/blue/fetch.js +2 -2
- package/lib/esm/blue/utils.d.ts +1 -1
- package/lib/esm/blue/utils.js +1 -1
- package/lib/esm/client/morphoViemExtension.d.ts +1 -1
- package/lib/esm/client/morphoViemExtension.js +1 -7
- package/lib/esm/constants.d.ts +2 -2
- package/lib/esm/constants.js +2 -2
- package/lib/esm/entities/blue/blue.d.ts +112 -21
- package/lib/esm/entities/blue/blue.js +60 -8
- package/lib/esm/entities/index.d.ts +4 -4
- package/lib/esm/entities/index.js +2 -2
- package/lib/esm/entities/midnight/midnight.d.ts +9 -6
- package/lib/esm/entities/midnight/midnight.js +13 -10
- package/lib/esm/entities/midnight/types.d.ts +8 -1
- package/lib/esm/entities/vaultV1/vaultV1.d.ts +8 -0
- package/lib/esm/entities/vaultV1/vaultV1.js +5 -0
- package/lib/esm/entities/vaultV2/vaultV2.d.ts +16 -34
- package/lib/esm/entities/vaultV2/vaultV2.js +13 -39
- package/lib/esm/entities/vaultV2BlueReallocationData.d.ts +77 -19
- package/lib/esm/entities/vaultV2BlueReallocationData.js +377 -81
- package/lib/esm/errors.d.ts +4 -4
- package/lib/esm/errors.js +4 -4
- package/lib/esm/fetch.d.ts +2 -2
- package/lib/esm/fetch.js +2 -2
- package/lib/esm/helpers/constant.d.ts +7 -0
- package/lib/esm/helpers/constant.js +7 -0
- package/lib/esm/helpers/deadShares.d.ts +82 -0
- package/lib/esm/helpers/deadShares.js +195 -0
- package/lib/esm/helpers/index.d.ts +2 -1
- package/lib/esm/helpers/index.js +2 -1
- package/lib/esm/helpers/validate.d.ts +11 -1
- package/lib/esm/helpers/validate.js +15 -0
- package/lib/esm/helpers/validateTakeableOffers.d.ts +4 -2
- package/lib/esm/helpers/validateTakeableOffers.js +13 -2
- package/lib/esm/midnight/abis.d.ts +1 -1
- package/lib/esm/midnight/abis.js +1 -1
- package/lib/esm/midnight/errors.d.ts +1 -2
- package/lib/esm/midnight/errors.js +1 -2
- package/lib/esm/types/error.d.ts +60 -5
- package/lib/esm/types/error.js +64 -5
- package/lib/esm/types/sharedLiquidity.d.ts +31 -11
- package/lib/esm/utils.d.ts +2 -2
- package/lib/esm/utils.js +2 -2
- package/package.json +9 -8
package/lib/esm/errors.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { BlueErrors, IncompleteChainRegistryError, InvalidMarketParamsError as InvalidBlueMarketParamsError,
|
|
1
|
+
export { BlueErrors, IncompleteChainRegistryError, InvalidMarketParamsError as InvalidBlueMarketParamsError, UnknownAddressError, UnknownDataError as UnknownBlueDataError, UnknownFactory as UnknownBlueFactory, UnknownMarketAllocationError as UnknownBlueMarketAllocationError, UnknownMarketParamsError as UnknownBlueMarketParamsError, UnknownOfFactory as UnknownBlueOfFactory, UnknownTokenError as UnknownBlueTokenError, UnknownTokenPriceError as UnknownBlueTokenPriceError, UnknownVaultConfigError as UnknownBlueVaultConfigError, UnsupportedChainIdError, UnsupportedMarketIrmError as UnsupportedBlueMarketIrmError,
|
|
2
2
|
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
|
3
3
|
UnsupportedPreLiquidationParamsError as UnsupportedBluePreLiquidationParamsError, UnsupportedVaultV2AdapterError as UnsupportedBlueVaultV2AdapterError, VaultV2Errors, } from "@morpho-org/blue-sdk";
|
|
4
|
-
export { getUnsupportedVaultV2Adapter as getBlueUnsupportedVaultV2Adapter, InvalidNumberError, InvalidPermitDomainChainIdError, InvalidPermitDomainVerifyingContractError, isUnknownOfFactoryError as isBlueUnknownOfFactoryError, MalformedTokenMetadataError, MarketParamsIdMismatchError as BlueMarketParamsIdMismatchError, MissingPermitDomainNameError, NonTupleReturnValueError, UnknownAbiFunctionError, UnnamedAbiOutputsError,
|
|
5
|
-
export { ChainIdMismatchError as MidnightChainIdMismatchError, InvalidEcrecoverSignatureVError as InvalidMidnightEcrecoverSignatureVError, InvalidMarketParameterError as InvalidMidnightMarketParameterError, InvalidMidnightApiQuoteTargetError, InvalidMidnightApiResponseError, InvalidOfferGroupError as InvalidMidnightOfferGroupError, InvalidOfferParameterError as InvalidMidnightOfferParameterError, InvalidRateRatifierV1RateError as InvalidMidnightRateRatifierV1RateError, InvalidRateRatifierV1TickError as InvalidMidnightRateRatifierV1TickError, InvalidRateRatifierV1TimeError as InvalidMidnightRateRatifierV1TimeError, InvalidRatifierV1AddressError as InvalidMidnightRatifierV1AddressError, InvalidTickSpacingError as InvalidMidnightTickSpacingError, InvalidTreeError as InvalidMidnightTreeError, InvalidTreeHeightError as InvalidMidnightTreeHeightError, InvalidTypedDataSignatureError as InvalidMidnightTypedDataSignatureError, MidnightApiError, MidnightMempoolValidationError, PayloadDecodeError as MidnightPayloadDecodeError, PriceGreaterThanOneError as MidnightPriceGreaterThanOneError, RateRatifierV1BoundOverflowError as MidnightRateRatifierV1BoundOverflowError, RatifierV1TakerNotAllowedError as MidnightRatifierV1TakerNotAllowedError, SettlementFeeExceedsPriceError as MidnightSettlementFeeExceedsPriceError, TickOutOfRangeError as MidnightTickOutOfRangeError, UnknownCollateralIndexError as UnknownMidnightCollateralIndexError, } from "@morpho-org/midnight-sdk";
|
|
4
|
+
export { getUnsupportedVaultV2Adapter as getBlueUnsupportedVaultV2Adapter, InvalidNumberError, InvalidPermitDomainChainIdError, InvalidPermitDomainVerifyingContractError, isUnknownOfFactoryError as isBlueUnknownOfFactoryError, MalformedTokenMetadataError, MarketParamsIdMismatchError as BlueMarketParamsIdMismatchError, MissingPermitDomainNameError, NonTupleReturnValueError, Permit2ExpirationOutOfRangeError, UnknownAbiFunctionError, UnnamedAbiOutputsError, UnsupportedPermitDomainExtensionsError, } from "@morpho-org/blue-sdk-viem";
|
|
5
|
+
export { ChainIdMismatchError as MidnightChainIdMismatchError, InvalidEcrecoverSignatureVError as InvalidMidnightEcrecoverSignatureVError, InvalidMarketParameterError as InvalidMidnightMarketParameterError, InvalidMidnightApiQuoteTargetError, InvalidMidnightApiResponseError, InvalidOfferGroupError as InvalidMidnightOfferGroupError, InvalidOfferParameterError as InvalidMidnightOfferParameterError, InvalidPositionAccrualStateError as InvalidMidnightPositionAccrualStateError, InvalidPositionAccrualTimestampError as InvalidMidnightPositionAccrualTimestampError, InvalidPositionLossFactorError as InvalidMidnightPositionLossFactorError, InvalidRateRatifierV1RateError as InvalidMidnightRateRatifierV1RateError, InvalidRateRatifierV1TickError as InvalidMidnightRateRatifierV1TickError, InvalidRateRatifierV1TimeError as InvalidMidnightRateRatifierV1TimeError, InvalidRatifierV1AddressError as InvalidMidnightRatifierV1AddressError, InvalidTickSpacingError as InvalidMidnightTickSpacingError, InvalidTreeError as InvalidMidnightTreeError, InvalidTreeHeightError as InvalidMidnightTreeHeightError, InvalidTypedDataSignatureError as InvalidMidnightTypedDataSignatureError, MidnightApiError, MidnightMempoolValidationError, PayloadDecodeError as MidnightPayloadDecodeError, PriceGreaterThanOneError as MidnightPriceGreaterThanOneError, RateRatifierV1BoundOverflowError as MidnightRateRatifierV1BoundOverflowError, RatifierV1TakerNotAllowedError as MidnightRatifierV1TakerNotAllowedError, SettlementFeeExceedsPriceError as MidnightSettlementFeeExceedsPriceError, TickOutOfRangeError as MidnightTickOutOfRangeError, UnknownCollateralIndexError as UnknownMidnightCollateralIndexError, } from "@morpho-org/midnight-sdk";
|
|
6
6
|
export type { ErrorClass } from "@morpho-org/morpho-ts";
|
|
7
|
-
export { _try, DivisionByZeroError, InvalidAddressError, InvalidBitLengthError,
|
|
7
|
+
export { _try, DivisionByZeroError, InvalidAddressError, InvalidBitLengthError, NegativeValueError, RegistryValueAlreadyRegisteredError, } from "@morpho-org/morpho-ts";
|
package/lib/esm/errors.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { BlueErrors, IncompleteChainRegistryError, InvalidMarketParamsError as InvalidBlueMarketParamsError,
|
|
1
|
+
export { BlueErrors, IncompleteChainRegistryError, InvalidMarketParamsError as InvalidBlueMarketParamsError, UnknownAddressError, UnknownDataError as UnknownBlueDataError, UnknownFactory as UnknownBlueFactory, UnknownMarketAllocationError as UnknownBlueMarketAllocationError, UnknownMarketParamsError as UnknownBlueMarketParamsError, UnknownOfFactory as UnknownBlueOfFactory, UnknownTokenError as UnknownBlueTokenError, UnknownTokenPriceError as UnknownBlueTokenPriceError, UnknownVaultConfigError as UnknownBlueVaultConfigError, UnsupportedChainIdError, UnsupportedMarketIrmError as UnsupportedBlueMarketIrmError,
|
|
2
2
|
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
|
3
3
|
UnsupportedPreLiquidationParamsError as UnsupportedBluePreLiquidationParamsError, UnsupportedVaultV2AdapterError as UnsupportedBlueVaultV2AdapterError, VaultV2Errors, } from "@morpho-org/blue-sdk";
|
|
4
|
-
export { getUnsupportedVaultV2Adapter as getBlueUnsupportedVaultV2Adapter, InvalidNumberError, InvalidPermitDomainChainIdError, InvalidPermitDomainVerifyingContractError, isUnknownOfFactoryError as isBlueUnknownOfFactoryError, MalformedTokenMetadataError, MarketParamsIdMismatchError as BlueMarketParamsIdMismatchError, MissingPermitDomainNameError, NonTupleReturnValueError, UnknownAbiFunctionError, UnnamedAbiOutputsError,
|
|
5
|
-
export { ChainIdMismatchError as MidnightChainIdMismatchError, InvalidEcrecoverSignatureVError as InvalidMidnightEcrecoverSignatureVError, InvalidMarketParameterError as InvalidMidnightMarketParameterError, InvalidMidnightApiQuoteTargetError, InvalidMidnightApiResponseError, InvalidOfferGroupError as InvalidMidnightOfferGroupError, InvalidOfferParameterError as InvalidMidnightOfferParameterError, InvalidRateRatifierV1RateError as InvalidMidnightRateRatifierV1RateError, InvalidRateRatifierV1TickError as InvalidMidnightRateRatifierV1TickError, InvalidRateRatifierV1TimeError as InvalidMidnightRateRatifierV1TimeError, InvalidRatifierV1AddressError as InvalidMidnightRatifierV1AddressError, InvalidTickSpacingError as InvalidMidnightTickSpacingError, InvalidTreeError as InvalidMidnightTreeError, InvalidTreeHeightError as InvalidMidnightTreeHeightError, InvalidTypedDataSignatureError as InvalidMidnightTypedDataSignatureError, MidnightApiError, MidnightMempoolValidationError, PayloadDecodeError as MidnightPayloadDecodeError, PriceGreaterThanOneError as MidnightPriceGreaterThanOneError, RateRatifierV1BoundOverflowError as MidnightRateRatifierV1BoundOverflowError, RatifierV1TakerNotAllowedError as MidnightRatifierV1TakerNotAllowedError, SettlementFeeExceedsPriceError as MidnightSettlementFeeExceedsPriceError, TickOutOfRangeError as MidnightTickOutOfRangeError, UnknownCollateralIndexError as UnknownMidnightCollateralIndexError, } from "@morpho-org/midnight-sdk";
|
|
6
|
-
export { _try, DivisionByZeroError, InvalidAddressError, InvalidBitLengthError,
|
|
4
|
+
export { getUnsupportedVaultV2Adapter as getBlueUnsupportedVaultV2Adapter, InvalidNumberError, InvalidPermitDomainChainIdError, InvalidPermitDomainVerifyingContractError, isUnknownOfFactoryError as isBlueUnknownOfFactoryError, MalformedTokenMetadataError, MarketParamsIdMismatchError as BlueMarketParamsIdMismatchError, MissingPermitDomainNameError, NonTupleReturnValueError, Permit2ExpirationOutOfRangeError, UnknownAbiFunctionError, UnnamedAbiOutputsError, UnsupportedPermitDomainExtensionsError, } from "@morpho-org/blue-sdk-viem";
|
|
5
|
+
export { ChainIdMismatchError as MidnightChainIdMismatchError, InvalidEcrecoverSignatureVError as InvalidMidnightEcrecoverSignatureVError, InvalidMarketParameterError as InvalidMidnightMarketParameterError, InvalidMidnightApiQuoteTargetError, InvalidMidnightApiResponseError, InvalidOfferGroupError as InvalidMidnightOfferGroupError, InvalidOfferParameterError as InvalidMidnightOfferParameterError, InvalidPositionAccrualStateError as InvalidMidnightPositionAccrualStateError, InvalidPositionAccrualTimestampError as InvalidMidnightPositionAccrualTimestampError, InvalidPositionLossFactorError as InvalidMidnightPositionLossFactorError, InvalidRateRatifierV1RateError as InvalidMidnightRateRatifierV1RateError, InvalidRateRatifierV1TickError as InvalidMidnightRateRatifierV1TickError, InvalidRateRatifierV1TimeError as InvalidMidnightRateRatifierV1TimeError, InvalidRatifierV1AddressError as InvalidMidnightRatifierV1AddressError, InvalidTickSpacingError as InvalidMidnightTickSpacingError, InvalidTreeError as InvalidMidnightTreeError, InvalidTreeHeightError as InvalidMidnightTreeHeightError, InvalidTypedDataSignatureError as InvalidMidnightTypedDataSignatureError, MidnightApiError, MidnightMempoolValidationError, PayloadDecodeError as MidnightPayloadDecodeError, PriceGreaterThanOneError as MidnightPriceGreaterThanOneError, RateRatifierV1BoundOverflowError as MidnightRateRatifierV1BoundOverflowError, RatifierV1TakerNotAllowedError as MidnightRatifierV1TakerNotAllowedError, SettlementFeeExceedsPriceError as MidnightSettlementFeeExceedsPriceError, TickOutOfRangeError as MidnightTickOutOfRangeError, UnknownCollateralIndexError as UnknownMidnightCollateralIndexError, } from "@morpho-org/midnight-sdk";
|
|
6
|
+
export { _try, DivisionByZeroError, InvalidAddressError, InvalidBitLengthError, NegativeValueError, RegistryValueAlreadyRegisteredError, } from "@morpho-org/morpho-ts";
|
package/lib/esm/fetch.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { fetchAccrualPosition as fetchBlueAccrualPosition, fetchAccrualVault, fetchAccrualVaultV2, fetchAccrualVaultV2Adapter,
|
|
1
|
+
export { fetchAccrualPosition as fetchBlueAccrualPosition, fetchAccrualVault, fetchAccrualVaultV2, fetchAccrualVaultV2Adapter, fetchAccrualVaultV2MorphoMarketV1Adapter, fetchAccrualVaultV2MorphoMarketV1AdapterV2, fetchAccrualVaultV2MorphoVaultV1Adapter, fetchHolding, fetchMarket as fetchBlueMarket, fetchMarketParams as fetchBlueMarketParams, fetchPosition as fetchBluePosition,
|
|
2
2
|
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
|
3
3
|
fetchPreLiquidationParams as fetchBluePreLiquidationParams,
|
|
4
4
|
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
|
5
|
-
fetchPreLiquidationPosition as fetchBluePreLiquidationPosition, fetchToken, fetchUser as fetchBlueUser, fetchVault, fetchVaultConfig, fetchVaultMarketAllocation, fetchVaultMarketConfig, fetchVaultUser, fetchVaultV2, fetchVaultV2Adapter, fetchVaultV2BlueMarketPublicAllocatorConfig, fetchVaultV2BluePublicAllocatorConfig, fetchVaultV2BluePublicAllocatorData,
|
|
5
|
+
fetchPreLiquidationPosition as fetchBluePreLiquidationPosition, fetchToken, fetchUser as fetchBlueUser, fetchVault, fetchVaultConfig, fetchVaultMarketAllocation, fetchVaultMarketConfig, fetchVaultUser, fetchVaultV2, fetchVaultV2Adapter, fetchVaultV2BlueMarketPublicAllocatorConfig, fetchVaultV2BluePublicAllocatorConfig, fetchVaultV2BluePublicAllocatorData, fetchVaultV2MorphoMarketV1Adapter, fetchVaultV2MorphoMarketV1AdapterV2, fetchVaultV2MorphoVaultV1Adapter, } from "@morpho-org/blue-sdk-viem";
|
|
6
6
|
export { fetchAccrualPosition as fetchMidnightAccrualPosition, fetchMarket as fetchMidnightMarket, fetchMarketParams as fetchMidnightMarketParams, fetchPosition as fetchMidnightPosition, fetchRatifierInfo as fetchMidnightRatifierInfo, } from "@morpho-org/midnight-sdk";
|
package/lib/esm/fetch.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { fetchAccrualPosition as fetchBlueAccrualPosition, fetchAccrualVault, fetchAccrualVaultV2, fetchAccrualVaultV2Adapter,
|
|
1
|
+
export { fetchAccrualPosition as fetchBlueAccrualPosition, fetchAccrualVault, fetchAccrualVaultV2, fetchAccrualVaultV2Adapter, fetchAccrualVaultV2MorphoMarketV1Adapter, fetchAccrualVaultV2MorphoMarketV1AdapterV2, fetchAccrualVaultV2MorphoVaultV1Adapter, fetchHolding, fetchMarket as fetchBlueMarket, fetchMarketParams as fetchBlueMarketParams, fetchPosition as fetchBluePosition,
|
|
2
2
|
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
|
3
3
|
fetchPreLiquidationParams as fetchBluePreLiquidationParams,
|
|
4
4
|
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
|
5
|
-
fetchPreLiquidationPosition as fetchBluePreLiquidationPosition, fetchToken, fetchUser as fetchBlueUser, fetchVault, fetchVaultConfig, fetchVaultMarketAllocation, fetchVaultMarketConfig, fetchVaultUser, fetchVaultV2, fetchVaultV2Adapter, fetchVaultV2BlueMarketPublicAllocatorConfig, fetchVaultV2BluePublicAllocatorConfig, fetchVaultV2BluePublicAllocatorData,
|
|
5
|
+
fetchPreLiquidationPosition as fetchBluePreLiquidationPosition, fetchToken, fetchUser as fetchBlueUser, fetchVault, fetchVaultConfig, fetchVaultMarketAllocation, fetchVaultMarketConfig, fetchVaultUser, fetchVaultV2, fetchVaultV2Adapter, fetchVaultV2BlueMarketPublicAllocatorConfig, fetchVaultV2BluePublicAllocatorConfig, fetchVaultV2BluePublicAllocatorData, fetchVaultV2MorphoMarketV1Adapter, fetchVaultV2MorphoMarketV1AdapterV2, fetchVaultV2MorphoVaultV1Adapter, } from "@morpho-org/blue-sdk-viem";
|
|
6
6
|
export { fetchAccrualPosition as fetchMidnightAccrualPosition, fetchMarket as fetchMidnightMarket, fetchMarketParams as fetchMidnightMarketParams, fetchPosition as fetchMidnightPosition, fetchRatifierInfo as fetchMidnightRatifierInfo, } from "@morpho-org/midnight-sdk";
|
|
@@ -30,6 +30,13 @@ export declare const DEFAULT_CAP_ACCRUAL_BUFFER: bigint;
|
|
|
30
30
|
* `VaultV2BluePublicAllocatorOptions.allocatorCapHeadroom`.
|
|
31
31
|
*/
|
|
32
32
|
export declare const DEFAULT_ALLOCATOR_CAP_HEADROOM: bigint;
|
|
33
|
+
/**
|
|
34
|
+
* Minimum shares a Morpho Blue market, Vault V1 or Vault V2 must hold at `DEAD_ADDRESS` to count as
|
|
35
|
+
* protected against share-price inflation (1e9, Protocol team rule).
|
|
36
|
+
*/
|
|
37
|
+
export declare const MIN_DEAD_SHARES = 1000000000n;
|
|
38
|
+
/** Minimum assets, in the vault asset's smallest unit, a Vault V2's dead shares must be worth (1e6). */
|
|
39
|
+
export declare const MIN_VAULT_V2_DEAD_ASSETS = 1000000n;
|
|
33
40
|
/** Maximum absolute share price cap (100 RAY). Prevents absurd maxSharePrice values in repay. */
|
|
34
41
|
export declare const MAX_ABSOLUTE_SHARE_PRICE: bigint;
|
|
35
42
|
/**
|
|
@@ -32,6 +32,13 @@ export const DEFAULT_CAP_ACCRUAL_BUFFER = Time.s.from.h(2n);
|
|
|
32
32
|
* `VaultV2BluePublicAllocatorOptions.allocatorCapHeadroom`.
|
|
33
33
|
*/
|
|
34
34
|
export const DEFAULT_ALLOCATOR_CAP_HEADROOM = MathLib.WAD / 100n;
|
|
35
|
+
/**
|
|
36
|
+
* Minimum shares a Morpho Blue market, Vault V1 or Vault V2 must hold at `DEAD_ADDRESS` to count as
|
|
37
|
+
* protected against share-price inflation (1e9, Protocol team rule).
|
|
38
|
+
*/
|
|
39
|
+
export const MIN_DEAD_SHARES = 1000000000n;
|
|
40
|
+
/** Minimum assets, in the vault asset's smallest unit, a Vault V2's dead shares must be worth (1e6). */
|
|
41
|
+
export const MIN_VAULT_V2_DEAD_ASSETS = 1000000n;
|
|
35
42
|
/** Maximum absolute share price cap (100 RAY). Prevents absurd maxSharePrice values in repay. */
|
|
36
43
|
export const MAX_ABSOLUTE_SHARE_PRICE = 100n * MathLib.RAY;
|
|
37
44
|
/**
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { type AccrualVault, type AccrualVaultV2, type IMarket } from "@morpho-org/blue-sdk";
|
|
2
|
+
import type { Address, Hash } from "viem";
|
|
3
|
+
type DeadSharesPath = readonly (Address | Hash)[];
|
|
4
|
+
/**
|
|
5
|
+
* Checks that a Morpho Blue market holds at least `MIN_DEAD_SHARES` supply shares at `DEAD_ADDRESS`.
|
|
6
|
+
*
|
|
7
|
+
* @param market - Fetched market snapshot.
|
|
8
|
+
* @param path - Vaults leading to this market, outermost first; empty for a direct market.
|
|
9
|
+
* @returns Nothing; returns normally when the market passes.
|
|
10
|
+
* @throws {MissingDeadSharesDataError} when `market.deadSupplyShares` was not fetched.
|
|
11
|
+
* @throws {InsufficientDeadSharesError} when the market holds fewer than `MIN_DEAD_SHARES` dead supply shares.
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* import { validateBlueMarketDeadShares } from "@morpho-org/morpho-sdk";
|
|
15
|
+
* import { fetchBlueMarket } from "@morpho-org/morpho-sdk/fetch";
|
|
16
|
+
* import { markets } from "@morpho-org/morpho-test";
|
|
17
|
+
* import { createPublicClient, http } from "viem";
|
|
18
|
+
* import { mainnet } from "viem/chains";
|
|
19
|
+
*
|
|
20
|
+
* const client = createPublicClient({ chain: mainnet, transport: http() });
|
|
21
|
+
* const market = await fetchBlueMarket(markets[mainnet.id].usdc_wbtc.id, client);
|
|
22
|
+
* validateBlueMarketDeadShares(market);
|
|
23
|
+
* // Returns void on success; throws if the snapshot fails the rule.
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export declare function validateBlueMarketDeadShares(market: Pick<IMarket, "params" | "deadSupplyShares"> & {
|
|
27
|
+
readonly id: Hash;
|
|
28
|
+
}, path?: DeadSharesPath): void;
|
|
29
|
+
/**
|
|
30
|
+
* Checks that a Vault V1 holds at least `MIN_DEAD_SHARES` shares at `DEAD_ADDRESS` and that every
|
|
31
|
+
* market in its withdraw queue passes `validateBlueMarketDeadShares`.
|
|
32
|
+
*
|
|
33
|
+
* @param vault - Fetched vault snapshot with its withdraw-queue allocations.
|
|
34
|
+
* @param path - Vaults leading to this vault, outermost first; empty for a direct deposit.
|
|
35
|
+
* @returns Nothing; returns normally when the vault and everything it can allocate to pass.
|
|
36
|
+
* @throws {MissingDeadSharesDataError} when `vault.deadShares`, a withdraw-queue allocation or a
|
|
37
|
+
* market's `deadSupplyShares` was not fetched.
|
|
38
|
+
* @throws {InsufficientDeadSharesError} when the vault or one of its withdraw-queue markets holds
|
|
39
|
+
* too few dead shares.
|
|
40
|
+
* @example
|
|
41
|
+
* ```ts
|
|
42
|
+
* import { validateVaultV1DeadShares } from "@morpho-org/morpho-sdk";
|
|
43
|
+
* import { fetchAccrualVault } from "@morpho-org/morpho-sdk/fetch";
|
|
44
|
+
* import { vaults } from "@morpho-org/morpho-test";
|
|
45
|
+
* import { createPublicClient, http } from "viem";
|
|
46
|
+
* import { mainnet } from "viem/chains";
|
|
47
|
+
*
|
|
48
|
+
* const client = createPublicClient({ chain: mainnet, transport: http() });
|
|
49
|
+
* const vault = await fetchAccrualVault(vaults[mainnet.id].steakUsdc.address, client);
|
|
50
|
+
* validateVaultV1DeadShares(vault);
|
|
51
|
+
* // Returns void on success; throws if the snapshot fails the rule.
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
export declare function validateVaultV1DeadShares(vault: AccrualVault, path?: DeadSharesPath): void;
|
|
55
|
+
/**
|
|
56
|
+
* Checks a Vault V2 against the dead-deposit rule: at least `MIN_DEAD_SHARES` shares at
|
|
57
|
+
* `DEAD_ADDRESS` worth at least `MIN_VAULT_V2_DEAD_ASSETS` assets, a share price above
|
|
58
|
+
* `1 / (10 * virtualShares)`, and every Blue market or Vault V1 it can allocate to (non-zero
|
|
59
|
+
* absolute cap) passing its own rule. Zero-cap entries are skipped.
|
|
60
|
+
*
|
|
61
|
+
* @param vault - Fetched vault snapshot with its adapters and `absoluteCaps`.
|
|
62
|
+
* @param path - Vaults leading to this vault, outermost first; empty for a direct deposit.
|
|
63
|
+
* @returns Nothing; returns normally when the vault and everything it can allocate to pass.
|
|
64
|
+
* @throws {MissingDeadSharesDataError} when a dead-share field, an adapter cap, or the data of an
|
|
65
|
+
* adapter the SDK cannot hydrate is missing.
|
|
66
|
+
* @throws {InsufficientDeadSharesError} when the vault or an allocatable market or Vault V1 fails the rule.
|
|
67
|
+
* @example
|
|
68
|
+
* ```ts
|
|
69
|
+
* import { validateVaultV2DeadShares } from "@morpho-org/morpho-sdk";
|
|
70
|
+
* import { fetchAccrualVaultV2 } from "@morpho-org/morpho-sdk/fetch";
|
|
71
|
+
* import { createPublicClient, http } from "viem";
|
|
72
|
+
* import { mainnet } from "viem/chains";
|
|
73
|
+
*
|
|
74
|
+
* const client = createPublicClient({ chain: mainnet, transport: http() });
|
|
75
|
+
* const keyrockUsdcVaultV2 = "0x04422053aDDbc9bB2759b248B574e3FCA76Bc145";
|
|
76
|
+
* const vault = await fetchAccrualVaultV2(keyrockUsdcVaultV2, client);
|
|
77
|
+
* validateVaultV2DeadShares(vault);
|
|
78
|
+
* // Returns void on success; throws if the snapshot fails the rule.
|
|
79
|
+
* ```
|
|
80
|
+
*/
|
|
81
|
+
export declare function validateVaultV2DeadShares(vault: AccrualVaultV2, path?: DeadSharesPath): void;
|
|
82
|
+
export {};
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import { AccrualVaultV2MorphoMarketV1Adapter, AccrualVaultV2MorphoMarketV1AdapterV2, AccrualVaultV2MorphoVaultV1Adapter, MarketParams, VaultV2MorphoMarketV1Adapter, VaultV2MorphoMarketV1AdapterV2, VaultV2MorphoVaultV1Adapter, } from "@morpho-org/blue-sdk";
|
|
2
|
+
import { InsufficientDeadSharesError, MissingDeadSharesDataError, } from "../types/error.js";
|
|
3
|
+
import { MIN_DEAD_SHARES, MIN_VAULT_V2_DEAD_ASSETS } from "./constant.js";
|
|
4
|
+
/**
|
|
5
|
+
* Checks that a Morpho Blue market holds at least `MIN_DEAD_SHARES` supply shares at `DEAD_ADDRESS`.
|
|
6
|
+
*
|
|
7
|
+
* @param market - Fetched market snapshot.
|
|
8
|
+
* @param path - Vaults leading to this market, outermost first; empty for a direct market.
|
|
9
|
+
* @returns Nothing; returns normally when the market passes.
|
|
10
|
+
* @throws {MissingDeadSharesDataError} when `market.deadSupplyShares` was not fetched.
|
|
11
|
+
* @throws {InsufficientDeadSharesError} when the market holds fewer than `MIN_DEAD_SHARES` dead supply shares.
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* import { validateBlueMarketDeadShares } from "@morpho-org/morpho-sdk";
|
|
15
|
+
* import { fetchBlueMarket } from "@morpho-org/morpho-sdk/fetch";
|
|
16
|
+
* import { markets } from "@morpho-org/morpho-test";
|
|
17
|
+
* import { createPublicClient, http } from "viem";
|
|
18
|
+
* import { mainnet } from "viem/chains";
|
|
19
|
+
*
|
|
20
|
+
* const client = createPublicClient({ chain: mainnet, transport: http() });
|
|
21
|
+
* const market = await fetchBlueMarket(markets[mainnet.id].usdc_wbtc.id, client);
|
|
22
|
+
* validateBlueMarketDeadShares(market);
|
|
23
|
+
* // Returns void on success; throws if the snapshot fails the rule.
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export function validateBlueMarketDeadShares(market, path = []) {
|
|
27
|
+
const entity = [...path, market.id];
|
|
28
|
+
if (market.deadSupplyShares == null)
|
|
29
|
+
throw new MissingDeadSharesDataError({ entity, field: "deadSupplyShares" });
|
|
30
|
+
if (market.deadSupplyShares < MIN_DEAD_SHARES)
|
|
31
|
+
throw new InsufficientDeadSharesError({
|
|
32
|
+
entity,
|
|
33
|
+
reason: "deadShares",
|
|
34
|
+
observed: market.deadSupplyShares,
|
|
35
|
+
required: MIN_DEAD_SHARES,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Checks that a Vault V1 holds at least `MIN_DEAD_SHARES` shares at `DEAD_ADDRESS` and that every
|
|
40
|
+
* market in its withdraw queue passes `validateBlueMarketDeadShares`.
|
|
41
|
+
*
|
|
42
|
+
* @param vault - Fetched vault snapshot with its withdraw-queue allocations.
|
|
43
|
+
* @param path - Vaults leading to this vault, outermost first; empty for a direct deposit.
|
|
44
|
+
* @returns Nothing; returns normally when the vault and everything it can allocate to pass.
|
|
45
|
+
* @throws {MissingDeadSharesDataError} when `vault.deadShares`, a withdraw-queue allocation or a
|
|
46
|
+
* market's `deadSupplyShares` was not fetched.
|
|
47
|
+
* @throws {InsufficientDeadSharesError} when the vault or one of its withdraw-queue markets holds
|
|
48
|
+
* too few dead shares.
|
|
49
|
+
* @example
|
|
50
|
+
* ```ts
|
|
51
|
+
* import { validateVaultV1DeadShares } from "@morpho-org/morpho-sdk";
|
|
52
|
+
* import { fetchAccrualVault } from "@morpho-org/morpho-sdk/fetch";
|
|
53
|
+
* import { vaults } from "@morpho-org/morpho-test";
|
|
54
|
+
* import { createPublicClient, http } from "viem";
|
|
55
|
+
* import { mainnet } from "viem/chains";
|
|
56
|
+
*
|
|
57
|
+
* const client = createPublicClient({ chain: mainnet, transport: http() });
|
|
58
|
+
* const vault = await fetchAccrualVault(vaults[mainnet.id].steakUsdc.address, client);
|
|
59
|
+
* validateVaultV1DeadShares(vault);
|
|
60
|
+
* // Returns void on success; throws if the snapshot fails the rule.
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
export function validateVaultV1DeadShares(vault, path = []) {
|
|
64
|
+
const entity = [...path, vault.address];
|
|
65
|
+
if (vault.deadShares == null)
|
|
66
|
+
throw new MissingDeadSharesDataError({ entity, field: "deadShares" });
|
|
67
|
+
if (vault.deadShares < MIN_DEAD_SHARES)
|
|
68
|
+
throw new InsufficientDeadSharesError({
|
|
69
|
+
entity,
|
|
70
|
+
reason: "deadShares",
|
|
71
|
+
observed: vault.deadShares,
|
|
72
|
+
required: MIN_DEAD_SHARES,
|
|
73
|
+
});
|
|
74
|
+
for (const marketId of vault.withdrawQueue) {
|
|
75
|
+
const allocation = vault.allocations.get(marketId);
|
|
76
|
+
if (allocation == null)
|
|
77
|
+
throw new MissingDeadSharesDataError({
|
|
78
|
+
entity: [...entity, marketId],
|
|
79
|
+
field: "allocation",
|
|
80
|
+
});
|
|
81
|
+
validateBlueMarketDeadShares(allocation.position.market, entity);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Checks a Vault V2 against the dead-deposit rule: at least `MIN_DEAD_SHARES` shares at
|
|
86
|
+
* `DEAD_ADDRESS` worth at least `MIN_VAULT_V2_DEAD_ASSETS` assets, a share price above
|
|
87
|
+
* `1 / (10 * virtualShares)`, and every Blue market or Vault V1 it can allocate to (non-zero
|
|
88
|
+
* absolute cap) passing its own rule. Zero-cap entries are skipped.
|
|
89
|
+
*
|
|
90
|
+
* @param vault - Fetched vault snapshot with its adapters and `absoluteCaps`.
|
|
91
|
+
* @param path - Vaults leading to this vault, outermost first; empty for a direct deposit.
|
|
92
|
+
* @returns Nothing; returns normally when the vault and everything it can allocate to pass.
|
|
93
|
+
* @throws {MissingDeadSharesDataError} when a dead-share field, an adapter cap, or the data of an
|
|
94
|
+
* adapter the SDK cannot hydrate is missing.
|
|
95
|
+
* @throws {InsufficientDeadSharesError} when the vault or an allocatable market or Vault V1 fails the rule.
|
|
96
|
+
* @example
|
|
97
|
+
* ```ts
|
|
98
|
+
* import { validateVaultV2DeadShares } from "@morpho-org/morpho-sdk";
|
|
99
|
+
* import { fetchAccrualVaultV2 } from "@morpho-org/morpho-sdk/fetch";
|
|
100
|
+
* import { createPublicClient, http } from "viem";
|
|
101
|
+
* import { mainnet } from "viem/chains";
|
|
102
|
+
*
|
|
103
|
+
* const client = createPublicClient({ chain: mainnet, transport: http() });
|
|
104
|
+
* const keyrockUsdcVaultV2 = "0x04422053aDDbc9bB2759b248B574e3FCA76Bc145";
|
|
105
|
+
* const vault = await fetchAccrualVaultV2(keyrockUsdcVaultV2, client);
|
|
106
|
+
* validateVaultV2DeadShares(vault);
|
|
107
|
+
* // Returns void on success; throws if the snapshot fails the rule.
|
|
108
|
+
* ```
|
|
109
|
+
*/
|
|
110
|
+
export function validateVaultV2DeadShares(vault, path = []) {
|
|
111
|
+
const entity = [...path, vault.address];
|
|
112
|
+
const { deadShares, deadAssets, absoluteCaps } = vault;
|
|
113
|
+
if (deadShares == null)
|
|
114
|
+
throw new MissingDeadSharesDataError({ entity, field: "deadShares" });
|
|
115
|
+
if (deadAssets == null)
|
|
116
|
+
throw new MissingDeadSharesDataError({ entity, field: "deadAssets" });
|
|
117
|
+
if (absoluteCaps == null)
|
|
118
|
+
throw new MissingDeadSharesDataError({ entity, field: "absoluteCaps" });
|
|
119
|
+
if (deadShares < MIN_DEAD_SHARES)
|
|
120
|
+
throw new InsufficientDeadSharesError({
|
|
121
|
+
entity,
|
|
122
|
+
reason: "deadShares",
|
|
123
|
+
observed: deadShares,
|
|
124
|
+
required: MIN_DEAD_SHARES,
|
|
125
|
+
});
|
|
126
|
+
if (deadAssets < MIN_VAULT_V2_DEAD_ASSETS)
|
|
127
|
+
throw new InsufficientDeadSharesError({
|
|
128
|
+
entity,
|
|
129
|
+
reason: "deadAssets",
|
|
130
|
+
observed: deadAssets,
|
|
131
|
+
required: MIN_VAULT_V2_DEAD_ASSETS,
|
|
132
|
+
});
|
|
133
|
+
// Share price (totalAssets + 1) / (totalSupply + virtualShares) must exceed 1 / (10 * virtualShares).
|
|
134
|
+
const priceNumerator = (vault._totalAssets + 1n) * 10n * vault.virtualShares;
|
|
135
|
+
const priceDenominator = vault.totalSupply + vault.virtualShares;
|
|
136
|
+
if (priceNumerator <= priceDenominator)
|
|
137
|
+
throw new InsufficientDeadSharesError({
|
|
138
|
+
entity,
|
|
139
|
+
reason: "sharePrice",
|
|
140
|
+
observed: priceNumerator,
|
|
141
|
+
required: priceDenominator + 1n,
|
|
142
|
+
});
|
|
143
|
+
const capOf = (id, adapter) => {
|
|
144
|
+
const cap = absoluteCaps[id];
|
|
145
|
+
if (cap == null)
|
|
146
|
+
throw new MissingDeadSharesDataError({
|
|
147
|
+
entity: [...entity, adapter],
|
|
148
|
+
field: "absoluteCaps",
|
|
149
|
+
});
|
|
150
|
+
return cap;
|
|
151
|
+
};
|
|
152
|
+
for (const adapter of vault.accrualAdapters) {
|
|
153
|
+
if (adapter instanceof AccrualVaultV2MorphoVaultV1Adapter) {
|
|
154
|
+
const id = VaultV2MorphoVaultV1Adapter.adapterCapId(adapter.address);
|
|
155
|
+
if (capOf(id, adapter.address) > 0n)
|
|
156
|
+
validateVaultV1DeadShares(adapter.accrualVaultV1, entity);
|
|
157
|
+
}
|
|
158
|
+
else if (adapter instanceof AccrualVaultV2MorphoMarketV1Adapter) {
|
|
159
|
+
for (const { market } of adapter.positions) {
|
|
160
|
+
const id = VaultV2MorphoMarketV1Adapter.adapterMarketCapId(adapter.address, market.params);
|
|
161
|
+
if (capOf(id, adapter.address) > 0n)
|
|
162
|
+
validateBlueMarketDeadShares(market, entity);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
else if (adapter instanceof AccrualVaultV2MorphoMarketV1AdapterV2) {
|
|
166
|
+
for (const market of adapter.markets) {
|
|
167
|
+
const id = VaultV2MorphoMarketV1AdapterV2.adapterMarketCapId(adapter.address, market.params);
|
|
168
|
+
if (capOf(id, adapter.address) > 0n)
|
|
169
|
+
validateBlueMarketDeadShares(market, entity);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
throw new MissingDeadSharesDataError({
|
|
174
|
+
entity: [...entity, adapter.address],
|
|
175
|
+
field: "adapter",
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
// Deposits are allocated to the liquidity market, so the snapshot must hold it even when it
|
|
180
|
+
// has no allocation yet (the adapters only list markets they currently supply to).
|
|
181
|
+
const liquidityAdapter = vault.accrualLiquidityAdapter;
|
|
182
|
+
if (vault.liquidityData === "0x" ||
|
|
183
|
+
!(liquidityAdapter instanceof AccrualVaultV2MorphoMarketV1Adapter ||
|
|
184
|
+
liquidityAdapter instanceof AccrualVaultV2MorphoMarketV1AdapterV2))
|
|
185
|
+
return;
|
|
186
|
+
const liquidityMarketId = MarketParams.fromHex(vault.liquidityData).id;
|
|
187
|
+
const markets = liquidityAdapter instanceof AccrualVaultV2MorphoMarketV1Adapter
|
|
188
|
+
? liquidityAdapter.positions.map(({ market }) => market)
|
|
189
|
+
: liquidityAdapter.markets;
|
|
190
|
+
if (!markets.some(({ id }) => id === liquidityMarketId))
|
|
191
|
+
throw new MissingDeadSharesDataError({
|
|
192
|
+
entity: [...entity, liquidityAdapter.address, liquidityMarketId],
|
|
193
|
+
field: "liquidityMarket",
|
|
194
|
+
});
|
|
195
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { getMidnightBlueBuyCallbackAddress, getMidnightBlueBuyCallbackData, } from "./callback.js";
|
|
2
|
-
export { APPROVE_ONLY_ONCE_TOKENS, DEFAULT_ALLOCATOR_CAP_HEADROOM, DEFAULT_CAP_ACCRUAL_BUFFER, DEFAULT_LLTV_BUFFER, DEFAULT_MAX_REALLOCATION_PENALTY, DEFAULT_SUPPLY_TARGET_UTILIZATION, DEFAULT_WITHDRAWAL_TARGET_UTILIZATION, MAX_ABSOLUTE_SHARE_PRICE, MAX_REALLOCATION_PENALTY, MAX_SLIPPAGE_TOLERANCE, MAX_TOKEN_APPROVALS, MIDNIGHT_TAKE_MAX_DEADLINE_SECONDS, } from "./constant.js";
|
|
2
|
+
export { APPROVE_ONLY_ONCE_TOKENS, DEFAULT_ALLOCATOR_CAP_HEADROOM, DEFAULT_CAP_ACCRUAL_BUFFER, DEFAULT_LLTV_BUFFER, DEFAULT_MAX_REALLOCATION_PENALTY, DEFAULT_SUPPLY_TARGET_UTILIZATION, DEFAULT_WITHDRAWAL_TARGET_UTILIZATION, MAX_ABSOLUTE_SHARE_PRICE, MAX_REALLOCATION_PENALTY, MAX_SLIPPAGE_TOLERANCE, MAX_TOKEN_APPROVALS, MIDNIGHT_TAKE_MAX_DEADLINE_SECONDS, MIN_DEAD_SHARES, MIN_VAULT_V2_DEAD_ASSETS, } from "./constant.js";
|
|
3
|
+
export { validateBlueMarketDeadShares, validateVaultV1DeadShares, validateVaultV2DeadShares, } from "./deadShares.js";
|
|
3
4
|
export { addTransactionMetadata } from "./metadata.js";
|
|
4
5
|
export { type PreviewVaultV2ForceWithdrawParams, previewVaultV2ForceWithdraw, type VaultV2ForceWithdrawPreview, } from "./previewVaultV2ForceWithdraw.js";
|
|
5
6
|
export { type PreviewVaultV2InKindRedeemParams, previewVaultV2InKindRedeem, type VaultV2InKindRedeemMarketPreview, } from "./previewVaultV2InKindRedeem.js";
|
package/lib/esm/helpers/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { getMidnightBlueBuyCallbackAddress, getMidnightBlueBuyCallbackData, } from "./callback.js";
|
|
2
|
-
export { APPROVE_ONLY_ONCE_TOKENS, DEFAULT_ALLOCATOR_CAP_HEADROOM, DEFAULT_CAP_ACCRUAL_BUFFER, DEFAULT_LLTV_BUFFER, DEFAULT_MAX_REALLOCATION_PENALTY, DEFAULT_SUPPLY_TARGET_UTILIZATION, DEFAULT_WITHDRAWAL_TARGET_UTILIZATION, MAX_ABSOLUTE_SHARE_PRICE, MAX_REALLOCATION_PENALTY, MAX_SLIPPAGE_TOLERANCE, MAX_TOKEN_APPROVALS, MIDNIGHT_TAKE_MAX_DEADLINE_SECONDS, } from "./constant.js";
|
|
2
|
+
export { APPROVE_ONLY_ONCE_TOKENS, DEFAULT_ALLOCATOR_CAP_HEADROOM, DEFAULT_CAP_ACCRUAL_BUFFER, DEFAULT_LLTV_BUFFER, DEFAULT_MAX_REALLOCATION_PENALTY, DEFAULT_SUPPLY_TARGET_UTILIZATION, DEFAULT_WITHDRAWAL_TARGET_UTILIZATION, MAX_ABSOLUTE_SHARE_PRICE, MAX_REALLOCATION_PENALTY, MAX_SLIPPAGE_TOLERANCE, MAX_TOKEN_APPROVALS, MIDNIGHT_TAKE_MAX_DEADLINE_SECONDS, MIN_DEAD_SHARES, MIN_VAULT_V2_DEAD_ASSETS, } from "./constant.js";
|
|
3
|
+
export { validateBlueMarketDeadShares, validateVaultV1DeadShares, validateVaultV2DeadShares, } from "./deadShares.js";
|
|
3
4
|
export { addTransactionMetadata } from "./metadata.js";
|
|
4
5
|
export { previewVaultV2ForceWithdraw, } from "./previewVaultV2ForceWithdraw.js";
|
|
5
6
|
export { previewVaultV2InKindRedeem, } from "./previewVaultV2InKindRedeem.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type AccrualPosition, type MarketId } from "@morpho-org/blue-sdk";
|
|
1
|
+
import { type AccrualPosition, type MarketId, type MarketParams } from "@morpho-org/blue-sdk";
|
|
2
2
|
import { type Market as MidnightMarket, type MarketInput as MidnightMarketInput } from "@morpho-org/midnight-sdk";
|
|
3
3
|
import { type Address } from "viem";
|
|
4
4
|
import { type VaultV2BlueReallocation } from "../types/index.js";
|
|
@@ -15,6 +15,16 @@ import { type VaultV2BlueReallocation } from "../types/index.js";
|
|
|
15
15
|
* @internal
|
|
16
16
|
*/
|
|
17
17
|
export declare const validateUint256Field: (field: string, value: bigint) => void;
|
|
18
|
+
/**
|
|
19
|
+
* Rejects market params whose cached `id` does not hash from their five tuple fields, so a
|
|
20
|
+
* hand-built or mutated object cannot make the SDK describe one market while calldata targets another.
|
|
21
|
+
*
|
|
22
|
+
* @param marketParams - Market params whose `id` must equal the id derived from the tuple.
|
|
23
|
+
* @returns Nothing when `marketParams.id` matches the derived id.
|
|
24
|
+
* @throws {MarketIdMismatchError} when `marketParams.id` differs from the derived id.
|
|
25
|
+
* @internal
|
|
26
|
+
*/
|
|
27
|
+
export declare const validateMarketParamsId: (marketParams: MarketParams) => void;
|
|
18
28
|
/**
|
|
19
29
|
* Rejects a deadline that no periphery can honour: the contracts read `0` as "unset" and the ABI
|
|
20
30
|
* slot is a `uint256`. Callers that also need the deadline to be in the future layer their own
|
|
@@ -34,6 +34,21 @@ export const validateUint256Field = (field, value) => {
|
|
|
34
34
|
throw new InputExceedsMaxError({ field, value, max: maxUint256 });
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
|
+
/**
|
|
38
|
+
* Rejects market params whose cached `id` does not hash from their five tuple fields, so a
|
|
39
|
+
* hand-built or mutated object cannot make the SDK describe one market while calldata targets another.
|
|
40
|
+
*
|
|
41
|
+
* @param marketParams - Market params whose `id` must equal the id derived from the tuple.
|
|
42
|
+
* @returns Nothing when `marketParams.id` matches the derived id.
|
|
43
|
+
* @throws {MarketIdMismatchError} when `marketParams.id` differs from the derived id.
|
|
44
|
+
* @internal
|
|
45
|
+
*/
|
|
46
|
+
export const validateMarketParamsId = (marketParams) => {
|
|
47
|
+
const derivedId = MarketUtils.getMarketId(marketParams);
|
|
48
|
+
if (marketParams.id !== derivedId) {
|
|
49
|
+
throw new MarketIdMismatchError(marketParams.id, derivedId);
|
|
50
|
+
}
|
|
51
|
+
};
|
|
37
52
|
/**
|
|
38
53
|
* Rejects a deadline that no periphery can honour: the contracts read `0` as "unset" and the ABI
|
|
39
54
|
* slot is a `uint256`. Callers that also need the deadline to be in the future layer their own
|
|
@@ -7,13 +7,15 @@ import type { MarketInput, OfferStruct } from "@morpho-org/midnight-sdk";
|
|
|
7
7
|
* @throws {EmptyMidnightTakeableOffersError} when no offers are provided.
|
|
8
8
|
* @throws {MidnightOfferSideMismatchError} when an offer has the wrong maker side.
|
|
9
9
|
* @throws {MidnightTakeableOfferMarketMismatchError} when an offer belongs to another market.
|
|
10
|
-
* @throws {
|
|
10
|
+
* @throws {MidnightTakeableOfferZeroSellerReceiverError} when a sell offer routes seller proceeds to the zero address.
|
|
11
|
+
* @throws {MidnightCalldataEncodingError} when a market cannot be ABI-encoded or a sell offer's
|
|
12
|
+
* `receiverIfMakerIsSeller` is not an address.
|
|
11
13
|
* @internal
|
|
12
14
|
*/
|
|
13
15
|
export declare const validateTakeableOffers: (params: {
|
|
14
16
|
readonly market: MarketInput;
|
|
15
17
|
readonly takeableOffers: readonly {
|
|
16
|
-
readonly offer: Pick<OfferStruct, "buy" | "market">;
|
|
18
|
+
readonly offer: Pick<OfferStruct, "buy" | "market" | "receiverIfMakerIsSeller">;
|
|
17
19
|
}[];
|
|
18
20
|
readonly expectedBuy: boolean;
|
|
19
21
|
}) => `0x${string}`;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { isAddressEqual, zeroAddress } from "viem";
|
|
2
|
+
import { EmptyMidnightTakeableOffersError, MidnightTakeableOfferMarketMismatchError, MidnightTakeableOfferZeroSellerReceiverError, } from "../types/index.js";
|
|
2
3
|
import { encodeMidnightMarketId } from "./encodeMidnightCalldata.js";
|
|
4
|
+
import { validateMidnightAddress } from "./validateMidnightAccount.js";
|
|
3
5
|
import { validateOfferSides } from "./validateOfferSides.js";
|
|
4
6
|
/**
|
|
5
7
|
* Validates the pure invariants shared by Midnight take entity and action layers.
|
|
@@ -9,7 +11,9 @@ import { validateOfferSides } from "./validateOfferSides.js";
|
|
|
9
11
|
* @throws {EmptyMidnightTakeableOffersError} when no offers are provided.
|
|
10
12
|
* @throws {MidnightOfferSideMismatchError} when an offer has the wrong maker side.
|
|
11
13
|
* @throws {MidnightTakeableOfferMarketMismatchError} when an offer belongs to another market.
|
|
12
|
-
* @throws {
|
|
14
|
+
* @throws {MidnightTakeableOfferZeroSellerReceiverError} when a sell offer routes seller proceeds to the zero address.
|
|
15
|
+
* @throws {MidnightCalldataEncodingError} when a market cannot be ABI-encoded or a sell offer's
|
|
16
|
+
* `receiverIfMakerIsSeller` is not an address.
|
|
13
17
|
* @internal
|
|
14
18
|
*/
|
|
15
19
|
export const validateTakeableOffers = (params) => {
|
|
@@ -27,6 +31,13 @@ export const validateTakeableOffers = (params) => {
|
|
|
27
31
|
actualMarket: actualMarketId,
|
|
28
32
|
});
|
|
29
33
|
}
|
|
34
|
+
if (take.offer.buy)
|
|
35
|
+
continue;
|
|
36
|
+
// Reject a malformed address before viem compares it.
|
|
37
|
+
validateMidnightAddress(`takeableOffers[${index}].offer.receiverIfMakerIsSeller`, take.offer.receiverIfMakerIsSeller);
|
|
38
|
+
if (isAddressEqual(take.offer.receiverIfMakerIsSeller, zeroAddress)) {
|
|
39
|
+
throw new MidnightTakeableOfferZeroSellerReceiverError({ index });
|
|
40
|
+
}
|
|
30
41
|
}
|
|
31
42
|
return marketId;
|
|
32
43
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { blueBuyCallbackFactoryAbi, ecrecoverRatifierAbi, midnightAbi, midnightBundlesV2Abi, priceRatifierV1Abi, rateRatifierV1Abi, setterRatifierAbi, } from "@morpho-org/midnight-sdk";
|
|
1
|
+
export { blueBuyCallbackFactoryAbi, ecrecoverAuthorizerAbi, ecrecoverRatifierAbi, midnightAbi, midnightBundlesV2Abi, midnightEventsAbi, priceRatifierV1Abi, rateRatifierV1Abi, setterRatifierAbi, } from "@morpho-org/midnight-sdk";
|
package/lib/esm/midnight/abis.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { blueBuyCallbackFactoryAbi, ecrecoverRatifierAbi, midnightAbi, midnightBundlesV2Abi, priceRatifierV1Abi, rateRatifierV1Abi, setterRatifierAbi, } from "@morpho-org/midnight-sdk";
|
|
1
|
+
export { blueBuyCallbackFactoryAbi, ecrecoverAuthorizerAbi, ecrecoverRatifierAbi, midnightAbi, midnightBundlesV2Abi, midnightEventsAbi, priceRatifierV1Abi, rateRatifierV1Abi, setterRatifierAbi, } from "@morpho-org/midnight-sdk";
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export { ChainIdMismatchError, InvalidEcrecoverSignatureVError, InvalidMarketParameterError, InvalidMidnightApiQuoteTargetError, InvalidMidnightApiResponseError, InvalidOfferGroupError, InvalidOfferParameterError, InvalidRateRatifierV1RateError, InvalidRateRatifierV1TickError, InvalidRateRatifierV1TimeError, InvalidRatifierV1AddressError, InvalidTickSpacingError, InvalidTreeError, InvalidTreeHeightError, InvalidTypedDataSignatureError, MidnightApiError, MidnightMempoolValidationError, PayloadDecodeError, PriceGreaterThanOneError, RateRatifierV1BoundOverflowError, RatifierV1TakerNotAllowedError, SettlementFeeExceedsPriceError, TickOutOfRangeError, UnknownCollateralIndexError, } from "@morpho-org/midnight-sdk";
|
|
2
|
-
export { InvalidPositionAccrualStateError, InvalidPositionAccrualTimestampError, InvalidPositionLossFactorError, } from "@morpho-org/morpho-ts";
|
|
1
|
+
export { ChainIdMismatchError, InvalidEcrecoverSignatureVError, InvalidMarketParameterError, InvalidMidnightApiQuoteTargetError, InvalidMidnightApiResponseError, InvalidOfferGroupError, InvalidOfferParameterError, InvalidPositionAccrualStateError, InvalidPositionAccrualTimestampError, InvalidPositionLossFactorError, InvalidRateRatifierV1RateError, InvalidRateRatifierV1TickError, InvalidRateRatifierV1TimeError, InvalidRatifierV1AddressError, InvalidTickSpacingError, InvalidTreeError, InvalidTreeHeightError, InvalidTypedDataSignatureError, MidnightApiError, MidnightMempoolValidationError, PayloadDecodeError, PriceGreaterThanOneError, RateRatifierV1BoundOverflowError, RatifierV1TakerNotAllowedError, SettlementFeeExceedsPriceError, TickOutOfRangeError, UnknownCollateralIndexError, } from "@morpho-org/midnight-sdk";
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export { ChainIdMismatchError, InvalidEcrecoverSignatureVError, InvalidMarketParameterError, InvalidMidnightApiQuoteTargetError, InvalidMidnightApiResponseError, InvalidOfferGroupError, InvalidOfferParameterError, InvalidRateRatifierV1RateError, InvalidRateRatifierV1TickError, InvalidRateRatifierV1TimeError, InvalidRatifierV1AddressError, InvalidTickSpacingError, InvalidTreeError, InvalidTreeHeightError, InvalidTypedDataSignatureError, MidnightApiError, MidnightMempoolValidationError, PayloadDecodeError, PriceGreaterThanOneError, RateRatifierV1BoundOverflowError, RatifierV1TakerNotAllowedError, SettlementFeeExceedsPriceError, TickOutOfRangeError, UnknownCollateralIndexError, } from "@morpho-org/midnight-sdk";
|
|
2
|
-
export { InvalidPositionAccrualStateError, InvalidPositionAccrualTimestampError, InvalidPositionLossFactorError, } from "@morpho-org/morpho-ts";
|
|
1
|
+
export { ChainIdMismatchError, InvalidEcrecoverSignatureVError, InvalidMarketParameterError, InvalidMidnightApiQuoteTargetError, InvalidMidnightApiResponseError, InvalidOfferGroupError, InvalidOfferParameterError, InvalidPositionAccrualStateError, InvalidPositionAccrualTimestampError, InvalidPositionLossFactorError, InvalidRateRatifierV1RateError, InvalidRateRatifierV1TickError, InvalidRateRatifierV1TimeError, InvalidRatifierV1AddressError, InvalidTickSpacingError, InvalidTreeError, InvalidTreeHeightError, InvalidTypedDataSignatureError, MidnightApiError, MidnightMempoolValidationError, PayloadDecodeError, PriceGreaterThanOneError, RateRatifierV1BoundOverflowError, RatifierV1TakerNotAllowedError, SettlementFeeExceedsPriceError, TickOutOfRangeError, UnknownCollateralIndexError, } from "@morpho-org/midnight-sdk";
|
package/lib/esm/types/error.d.ts
CHANGED
|
@@ -929,11 +929,16 @@ export declare class RepaySharesExceedDebtError extends Error {
|
|
|
929
929
|
});
|
|
930
930
|
}
|
|
931
931
|
/**
|
|
932
|
-
* Thrown when shared liquidity
|
|
933
|
-
*
|
|
934
|
-
*
|
|
932
|
+
* Thrown when shared liquidity cannot cover the operation's required
|
|
933
|
+
* reallocated assets. When Blue's balance is explicit, it is also thrown if
|
|
934
|
+
* that balance cannot fund the penalty flash loan, an earlier market-sourced
|
|
935
|
+
* withdrawal, or the final operation transfer. A borrow or withdraw plan that
|
|
936
|
+
* otherwise covers its shortfall but whose planned penalty exceeds its amount
|
|
937
|
+
* instead throws `InputExceedsMaxError`.
|
|
935
938
|
*
|
|
936
|
-
*
|
|
939
|
+
* `shortfall` is the reallocated assets required by the operation and is
|
|
940
|
+
* comparable to `available`. Pattern-match on the class and inspect `params`
|
|
941
|
+
* to surface the gap to users.
|
|
937
942
|
*/
|
|
938
943
|
export declare class InsufficientSharedLiquidityError extends Error {
|
|
939
944
|
readonly params: {
|
|
@@ -1316,7 +1321,12 @@ export declare class MidnightOfferCallbackDataMismatchError extends Error {
|
|
|
1316
1321
|
readonly actualCallbackData: Hex;
|
|
1317
1322
|
});
|
|
1318
1323
|
}
|
|
1319
|
-
/**
|
|
1324
|
+
/**
|
|
1325
|
+
* Thrown when loan assets would be parked in a Morpho Blue market with no existing supply.
|
|
1326
|
+
*
|
|
1327
|
+
* @deprecated `supplyBlueMakeLend` now throws `InsufficientDeadSharesError` or
|
|
1328
|
+
* `MissingDeadSharesDataError` instead; kept exported so existing `instanceof` checks compile.
|
|
1329
|
+
*/
|
|
1320
1330
|
export declare class EmptyBlueParkingMarketError extends Error {
|
|
1321
1331
|
constructor(params: {
|
|
1322
1332
|
readonly marketId: MarketId;
|
|
@@ -1332,6 +1342,45 @@ export declare class ZeroBlueParkingSharesError extends Error {
|
|
|
1332
1342
|
readonly assets: bigint;
|
|
1333
1343
|
});
|
|
1334
1344
|
}
|
|
1345
|
+
/** Which dead-deposit condition an entity failed. */
|
|
1346
|
+
export type DeadSharesFailureReason = "deadShares" | "deadAssets" | "sharePrice";
|
|
1347
|
+
/**
|
|
1348
|
+
* Thrown when a Morpho Blue market or vault, or a market or Vault V1 it can allocate to, fails the
|
|
1349
|
+
* dead-deposit rule that protects deposits against share-price inflation.
|
|
1350
|
+
*/
|
|
1351
|
+
export declare class InsufficientDeadSharesError extends Error {
|
|
1352
|
+
/** Failing entity, outermost vault first; the last element is the market id or vault address. */
|
|
1353
|
+
readonly entity: readonly (Address | Hash)[];
|
|
1354
|
+
/** Failed condition. */
|
|
1355
|
+
readonly reason: DeadSharesFailureReason;
|
|
1356
|
+
/** Observed dead shares or assets; for `sharePrice`, `(totalAssets + 1) * 10 * virtualShares`. */
|
|
1357
|
+
readonly observed: bigint;
|
|
1358
|
+
/** Required minimum; for `sharePrice`, `totalSupply + virtualShares + 1`. */
|
|
1359
|
+
readonly required: bigint;
|
|
1360
|
+
constructor(params: {
|
|
1361
|
+
readonly entity: readonly (Address | Hash)[];
|
|
1362
|
+
readonly reason: DeadSharesFailureReason;
|
|
1363
|
+
readonly observed: bigint;
|
|
1364
|
+
readonly required: bigint;
|
|
1365
|
+
});
|
|
1366
|
+
}
|
|
1367
|
+
/** Snapshot field the dead-deposit check needs but the snapshot does not carry. */
|
|
1368
|
+
export type DeadSharesDataField = "deadSupplyShares" | "deadShares" | "deadAssets" | "absoluteCaps" | "allocation" | "adapter" | "liquidityMarket";
|
|
1369
|
+
/**
|
|
1370
|
+
* Thrown when a market or vault snapshot lacks the data the dead-deposit check needs, such as a
|
|
1371
|
+
* snapshot built by hand, from the Morpho API or by an older fetcher, or a Vault V2 adapter the
|
|
1372
|
+
* SDK cannot hydrate. The check fails closed rather than pass unverified data.
|
|
1373
|
+
*/
|
|
1374
|
+
export declare class MissingDeadSharesDataError extends Error {
|
|
1375
|
+
/** Entity missing the data, outermost vault first. */
|
|
1376
|
+
readonly entity: readonly (Address | Hash)[];
|
|
1377
|
+
/** Missing field. */
|
|
1378
|
+
readonly field: DeadSharesDataField;
|
|
1379
|
+
constructor(params: {
|
|
1380
|
+
readonly entity: readonly (Address | Hash)[];
|
|
1381
|
+
readonly field: DeadSharesDataField;
|
|
1382
|
+
});
|
|
1383
|
+
}
|
|
1335
1384
|
/** Thrown when a quoted Midnight takeable offer belongs to a different market than the requested flow. */
|
|
1336
1385
|
export declare class MidnightTakeableOfferMarketMismatchError extends Error {
|
|
1337
1386
|
constructor(params: {
|
|
@@ -1340,6 +1389,12 @@ export declare class MidnightTakeableOfferMarketMismatchError extends Error {
|
|
|
1340
1389
|
actualMarket: string;
|
|
1341
1390
|
});
|
|
1342
1391
|
}
|
|
1392
|
+
/** Thrown when a quoted Midnight sell offer routes its seller proceeds to the zero address. */
|
|
1393
|
+
export declare class MidnightTakeableOfferZeroSellerReceiverError extends Error {
|
|
1394
|
+
constructor(params: {
|
|
1395
|
+
index: number;
|
|
1396
|
+
});
|
|
1397
|
+
}
|
|
1343
1398
|
/** Thrown when a Midnight offer's ratifier does not match its tree's ratifier route. */
|
|
1344
1399
|
export declare class MidnightOfferRatifierMismatchError extends Error {
|
|
1345
1400
|
constructor(params: {
|