@morpho-org/morpho-sdk 7.1.0-next.1 → 8.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/MIGRATION-v7-to-v8.md +290 -0
- package/README.md +11 -6
- package/lib/cjs/abis.d.ts +1 -1
- package/lib/cjs/abis.js +1 -5
- package/lib/cjs/actions/bundles/resolveBundlesTokenRequirements.d.ts +2 -0
- package/lib/cjs/actions/bundles/resolveBundlesTokenRequirements.js +2 -0
- package/lib/cjs/actions/midnight/cancelAndMake.d.ts +17 -71
- package/lib/cjs/actions/midnight/cancelAndMake.js +41 -29
- package/lib/cjs/actions/midnight/redeem.d.ts +8 -1
- package/lib/cjs/actions/midnight/redeem.js +18 -1
- package/lib/cjs/actions/midnight/repayWithdrawCollateral.d.ts +19 -3
- package/lib/cjs/actions/midnight/repayWithdrawCollateral.js +24 -2
- package/lib/cjs/actions/midnight/supplyCollateral.d.ts +1 -0
- package/lib/cjs/actions/midnight/supplyCollateral.js +3 -0
- package/lib/cjs/actions/midnight/supplyCollateralTakeBorrow.d.ts +21 -6
- package/lib/cjs/actions/midnight/supplyCollateralTakeBorrow.js +49 -14
- package/lib/cjs/actions/midnight/takeBorrow.d.ts +18 -5
- package/lib/cjs/actions/midnight/takeBorrow.js +44 -12
- package/lib/cjs/actions/midnight/takeLend.d.ts +10 -5
- package/lib/cjs/actions/midnight/takeLend.js +27 -9
- package/lib/cjs/actions/midnight/takeRepayWithdrawCollateral.d.ts +22 -7
- package/lib/cjs/actions/midnight/takeRepayWithdrawCollateral.js +51 -27
- package/lib/cjs/actions/midnight/takeWithdraw.d.ts +14 -5
- package/lib/cjs/actions/midnight/takeWithdraw.js +40 -9
- package/lib/cjs/actions/requirements/blue/getBlueAuthorizationRequirement.d.ts +6 -2
- package/lib/cjs/actions/requirements/blue/getBlueAuthorizationRequirement.js +11 -6
- package/lib/cjs/actions/requirements/encode/encodeBlueSignatureAuthorization.d.ts +3 -0
- package/lib/cjs/actions/requirements/encode/encodeBlueSignatureAuthorization.js +2 -1
- package/lib/cjs/actions/requirements/encode/encodeErc20Permit.d.ts +13 -2
- package/lib/cjs/actions/requirements/encode/encodeErc20Permit.js +17 -6
- package/lib/cjs/actions/requirements/encode/encodeErc20Permit2SignatureTransfer.d.ts +3 -0
- package/lib/cjs/actions/requirements/encode/encodeErc20Permit2SignatureTransfer.js +2 -1
- package/lib/cjs/actions/requirements/encode/encodeVaultSharesPermit.d.ts +5 -0
- package/lib/cjs/actions/requirements/encode/encodeVaultSharesPermit.js +4 -1
- package/lib/cjs/actions/requirements/midnight/getMidnightApprovalRequirements.d.ts +3 -1
- package/lib/cjs/actions/requirements/midnight/getMidnightApprovalRequirements.js +5 -1
- package/lib/cjs/actions/requirements/midnight/getMidnightAuthorizationRequirement.d.ts +3 -1
- package/lib/cjs/actions/requirements/midnight/getMidnightAuthorizationRequirement.js +5 -1
- package/lib/cjs/actions/requirements/validateClientChainId.d.ts +26 -0
- package/lib/cjs/actions/requirements/validateClientChainId.js +34 -0
- package/lib/cjs/blue/abis.d.ts +1 -1
- package/lib/cjs/blue/abis.js +1 -5
- package/lib/cjs/blue/entities.d.ts +4 -4
- package/lib/cjs/blue/entities.js +1 -3
- package/lib/cjs/blue/errors.d.ts +2 -2
- package/lib/cjs/blue/errors.js +3 -5
- package/lib/cjs/blue/fetch.d.ts +2 -2
- package/lib/cjs/blue/fetch.js +1 -3
- package/lib/cjs/blue/types.d.ts +1 -1
- package/lib/cjs/blue/utils.d.ts +2 -2
- package/lib/cjs/blue/utils.js +5 -2
- package/lib/cjs/entities/blue/blue.d.ts +109 -27
- package/lib/cjs/entities/blue/blue.js +103 -28
- package/lib/cjs/entities/index.d.ts +5 -5
- package/lib/cjs/entities/index.js +1 -3
- package/lib/cjs/entities/midnight/deadline.d.ts +15 -0
- package/lib/cjs/entities/midnight/deadline.js +24 -0
- package/lib/cjs/entities/midnight/midnight.d.ts +427 -72
- package/lib/cjs/entities/midnight/midnight.js +864 -186
- package/lib/cjs/entities/midnight/publication.d.ts +134 -0
- package/lib/cjs/entities/midnight/publication.js +404 -0
- package/lib/cjs/entities/midnight/types.d.ts +26 -5
- package/lib/cjs/entities/requirements/assertContractCode.d.ts +49 -0
- package/lib/cjs/entities/requirements/assertContractCode.js +79 -0
- package/lib/cjs/entities/requirements/getBundlesTokenRequirements.d.ts +19 -4
- package/lib/cjs/entities/requirements/getBundlesTokenRequirements.js +45 -18
- package/lib/cjs/entities/requirements/getUnusedPermit2Nonce.d.ts +3 -2
- package/lib/cjs/entities/requirements/getUnusedPermit2Nonce.js +5 -2
- package/lib/cjs/entities/requirements/getVaultBundlesSharesRequirements.d.ts +5 -1
- package/lib/cjs/entities/requirements/getVaultBundlesSharesRequirements.js +8 -2
- package/lib/cjs/entities/vaultV1/vaultV1.d.ts +63 -11
- package/lib/cjs/entities/vaultV1/vaultV1.js +52 -15
- package/lib/cjs/entities/vaultV2/vaultV2.d.ts +62 -44
- package/lib/cjs/entities/vaultV2/vaultV2.js +53 -48
- package/lib/cjs/entities/vaultV2BlueReallocationData.d.ts +3 -5
- package/lib/cjs/entities/vaultV2BlueReallocationData.js +3 -9
- package/lib/cjs/errors.d.ts +4 -4
- package/lib/cjs/errors.js +7 -10
- package/lib/cjs/fetch.d.ts +2 -2
- package/lib/cjs/fetch.js +1 -3
- package/lib/cjs/helpers/constant.d.ts +5 -0
- package/lib/cjs/helpers/constant.js +6 -1
- package/lib/cjs/helpers/index.d.ts +1 -1
- package/lib/cjs/helpers/index.js +2 -1
- package/lib/cjs/helpers/validate.d.ts +163 -8
- package/lib/cjs/helpers/validate.js +179 -8
- package/lib/cjs/helpers/validateMidnightBounds.d.ts +47 -0
- package/lib/cjs/helpers/validateMidnightBounds.js +79 -0
- package/lib/cjs/helpers/validateMidnightPublication.d.ts +12 -0
- package/lib/cjs/helpers/validateMidnightPublication.js +144 -0
- package/lib/cjs/helpers/validateMidnightReceiver.d.ts +29 -0
- package/lib/cjs/helpers/validateMidnightReceiver.js +84 -0
- package/lib/cjs/helpers/validateMidnightTakeFeasibility.d.ts +102 -0
- package/lib/cjs/helpers/validateMidnightTakeFeasibility.js +231 -0
- package/lib/cjs/index.d.ts +1 -0
- package/lib/cjs/index.js +3 -0
- package/lib/cjs/midnight/errors.d.ts +1 -2
- package/lib/cjs/midnight/errors.js +4 -5
- package/lib/cjs/types/error.d.ts +197 -4
- package/lib/cjs/types/error.js +265 -5
- package/lib/cjs/types/index.d.ts +1 -0
- package/lib/cjs/types/index.js +1 -0
- package/lib/cjs/types/midnightCancelAndMake.d.ts +70 -0
- package/lib/cjs/types/midnightCancelAndMake.js +2 -0
- package/lib/cjs/types/midnightPublicationError.d.ts +332 -0
- package/lib/cjs/types/midnightPublicationError.js +376 -0
- package/lib/cjs/types.d.ts +1 -1
- package/lib/cjs/utils.d.ts +4 -3
- package/lib/cjs/utils.js +8 -4
- package/lib/esm/abis.d.ts +1 -1
- package/lib/esm/abis.js +1 -1
- package/lib/esm/actions/bundles/resolveBundlesTokenRequirements.d.ts +2 -0
- package/lib/esm/actions/bundles/resolveBundlesTokenRequirements.js +2 -0
- package/lib/esm/actions/midnight/cancelAndMake.d.ts +17 -71
- package/lib/esm/actions/midnight/cancelAndMake.js +42 -30
- package/lib/esm/actions/midnight/redeem.d.ts +8 -1
- package/lib/esm/actions/midnight/redeem.js +18 -1
- package/lib/esm/actions/midnight/repayWithdrawCollateral.d.ts +19 -3
- package/lib/esm/actions/midnight/repayWithdrawCollateral.js +24 -2
- package/lib/esm/actions/midnight/supplyCollateral.d.ts +1 -0
- package/lib/esm/actions/midnight/supplyCollateral.js +3 -0
- package/lib/esm/actions/midnight/supplyCollateralTakeBorrow.d.ts +21 -6
- package/lib/esm/actions/midnight/supplyCollateralTakeBorrow.js +52 -17
- package/lib/esm/actions/midnight/takeBorrow.d.ts +18 -5
- package/lib/esm/actions/midnight/takeBorrow.js +47 -15
- package/lib/esm/actions/midnight/takeLend.d.ts +10 -5
- package/lib/esm/actions/midnight/takeLend.js +27 -9
- package/lib/esm/actions/midnight/takeRepayWithdrawCollateral.d.ts +22 -7
- package/lib/esm/actions/midnight/takeRepayWithdrawCollateral.js +52 -28
- package/lib/esm/actions/midnight/takeWithdraw.d.ts +14 -5
- package/lib/esm/actions/midnight/takeWithdraw.js +41 -10
- package/lib/esm/actions/requirements/blue/getBlueAuthorizationRequirement.d.ts +6 -2
- package/lib/esm/actions/requirements/blue/getBlueAuthorizationRequirement.js +13 -8
- package/lib/esm/actions/requirements/encode/encodeBlueSignatureAuthorization.d.ts +3 -0
- package/lib/esm/actions/requirements/encode/encodeBlueSignatureAuthorization.js +2 -1
- package/lib/esm/actions/requirements/encode/encodeErc20Permit.d.ts +13 -2
- package/lib/esm/actions/requirements/encode/encodeErc20Permit.js +17 -6
- package/lib/esm/actions/requirements/encode/encodeErc20Permit2SignatureTransfer.d.ts +3 -0
- package/lib/esm/actions/requirements/encode/encodeErc20Permit2SignatureTransfer.js +2 -1
- package/lib/esm/actions/requirements/encode/encodeVaultSharesPermit.d.ts +5 -0
- package/lib/esm/actions/requirements/encode/encodeVaultSharesPermit.js +4 -1
- package/lib/esm/actions/requirements/midnight/getMidnightApprovalRequirements.d.ts +3 -1
- package/lib/esm/actions/requirements/midnight/getMidnightApprovalRequirements.js +5 -1
- package/lib/esm/actions/requirements/midnight/getMidnightAuthorizationRequirement.d.ts +3 -1
- package/lib/esm/actions/requirements/midnight/getMidnightAuthorizationRequirement.js +5 -1
- package/lib/esm/actions/requirements/validateClientChainId.d.ts +26 -0
- package/lib/esm/actions/requirements/validateClientChainId.js +30 -0
- package/lib/esm/blue/abis.d.ts +1 -1
- package/lib/esm/blue/abis.js +1 -1
- package/lib/esm/blue/entities.d.ts +4 -4
- package/lib/esm/blue/entities.js +2 -2
- package/lib/esm/blue/errors.d.ts +2 -2
- package/lib/esm/blue/errors.js +2 -2
- package/lib/esm/blue/fetch.d.ts +2 -2
- package/lib/esm/blue/fetch.js +2 -2
- package/lib/esm/blue/types.d.ts +1 -1
- package/lib/esm/blue/utils.d.ts +2 -2
- package/lib/esm/blue/utils.js +2 -2
- package/lib/esm/entities/blue/blue.d.ts +109 -27
- package/lib/esm/entities/blue/blue.js +104 -29
- package/lib/esm/entities/index.d.ts +5 -5
- package/lib/esm/entities/index.js +2 -2
- package/lib/esm/entities/midnight/deadline.d.ts +15 -0
- package/lib/esm/entities/midnight/deadline.js +20 -0
- package/lib/esm/entities/midnight/midnight.d.ts +427 -72
- package/lib/esm/entities/midnight/midnight.js +865 -187
- package/lib/esm/entities/midnight/publication.d.ts +134 -0
- package/lib/esm/entities/midnight/publication.js +397 -0
- package/lib/esm/entities/midnight/types.d.ts +26 -5
- package/lib/esm/entities/requirements/assertContractCode.d.ts +49 -0
- package/lib/esm/entities/requirements/assertContractCode.js +74 -0
- package/lib/esm/entities/requirements/getBundlesTokenRequirements.d.ts +19 -4
- package/lib/esm/entities/requirements/getBundlesTokenRequirements.js +47 -20
- package/lib/esm/entities/requirements/getUnusedPermit2Nonce.d.ts +3 -2
- package/lib/esm/entities/requirements/getUnusedPermit2Nonce.js +5 -2
- package/lib/esm/entities/requirements/getVaultBundlesSharesRequirements.d.ts +5 -1
- package/lib/esm/entities/requirements/getVaultBundlesSharesRequirements.js +8 -2
- package/lib/esm/entities/vaultV1/vaultV1.d.ts +63 -11
- package/lib/esm/entities/vaultV1/vaultV1.js +53 -16
- package/lib/esm/entities/vaultV2/vaultV2.d.ts +62 -44
- package/lib/esm/entities/vaultV2/vaultV2.js +54 -49
- package/lib/esm/entities/vaultV2BlueReallocationData.d.ts +3 -5
- package/lib/esm/entities/vaultV2BlueReallocationData.js +3 -9
- package/lib/esm/errors.d.ts +4 -4
- package/lib/esm/errors.js +4 -4
- package/lib/esm/fetch.d.ts +2 -2
- package/lib/esm/fetch.js +2 -2
- package/lib/esm/helpers/constant.d.ts +5 -0
- package/lib/esm/helpers/constant.js +5 -0
- package/lib/esm/helpers/index.d.ts +1 -1
- package/lib/esm/helpers/index.js +1 -1
- package/lib/esm/helpers/validate.d.ts +163 -8
- package/lib/esm/helpers/validate.js +177 -7
- package/lib/esm/helpers/validateMidnightBounds.d.ts +47 -0
- package/lib/esm/helpers/validateMidnightBounds.js +72 -0
- package/lib/esm/helpers/validateMidnightPublication.d.ts +12 -0
- package/lib/esm/helpers/validateMidnightPublication.js +139 -0
- package/lib/esm/helpers/validateMidnightReceiver.d.ts +29 -0
- package/lib/esm/helpers/validateMidnightReceiver.js +80 -0
- package/lib/esm/helpers/validateMidnightTakeFeasibility.d.ts +102 -0
- package/lib/esm/helpers/validateMidnightTakeFeasibility.js +226 -0
- package/lib/esm/index.d.ts +1 -0
- package/lib/esm/index.js +1 -0
- package/lib/esm/midnight/errors.d.ts +1 -2
- package/lib/esm/midnight/errors.js +1 -2
- package/lib/esm/types/error.d.ts +197 -4
- package/lib/esm/types/error.js +253 -2
- package/lib/esm/types/index.d.ts +1 -0
- package/lib/esm/types/index.js +1 -0
- package/lib/esm/types/midnightCancelAndMake.d.ts +70 -0
- package/lib/esm/types/midnightCancelAndMake.js +1 -0
- package/lib/esm/types/midnightPublicationError.d.ts +332 -0
- package/lib/esm/types/midnightPublicationError.js +359 -0
- package/lib/esm/types.d.ts +1 -1
- package/lib/esm/utils.d.ts +4 -3
- package/lib/esm/utils.js +4 -3
- package/package.json +9 -8
package/lib/esm/blue/errors.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { BlueErrors, DivisionByZeroError, IncompleteChainRegistryError, InvalidAddressError, InvalidBitLengthError, InvalidMarketParamsError,
|
|
1
|
+
export { BlueErrors, DivisionByZeroError, IncompleteChainRegistryError, InvalidAddressError, InvalidBitLengthError, InvalidMarketParamsError, RegistryValueAlreadyRegisteredError, UnknownAddressError, UnknownDataError, UnknownFactory, UnknownMarketAllocationError, UnknownMarketParamsError, UnknownOfFactory, UnknownTokenError, UnknownTokenPriceError, UnknownVaultConfigError, UnsupportedChainIdError, UnsupportedMarketIrmError,
|
|
2
2
|
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
|
3
3
|
UnsupportedPreLiquidationParamsError, UnsupportedVaultV2AdapterError, VaultV2Errors, } from "@morpho-org/blue-sdk";
|
|
4
|
-
export { getUnsupportedVaultV2Adapter, InvalidNumberError, InvalidPermitDomainChainIdError, InvalidPermitDomainVerifyingContractError, isUnknownOfFactoryError, MarketParamsIdMismatchError, NonTupleReturnValueError, UnknownAbiFunctionError, UnnamedAbiOutputsError,
|
|
4
|
+
export { getUnsupportedVaultV2Adapter, InvalidNumberError, InvalidPermitDomainChainIdError, InvalidPermitDomainVerifyingContractError, isUnknownOfFactoryError, MalformedTokenMetadataError, MarketParamsIdMismatchError, MissingPermitDomainNameError, NonTupleReturnValueError, UnknownAbiFunctionError, UnnamedAbiOutputsError, UnsupportedPermitDomainExtensionsError, } from "@morpho-org/blue-sdk-viem";
|
package/lib/esm/blue/errors.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { BlueErrors, DivisionByZeroError, IncompleteChainRegistryError, InvalidAddressError, InvalidBitLengthError, InvalidMarketParamsError,
|
|
1
|
+
export { BlueErrors, DivisionByZeroError, IncompleteChainRegistryError, InvalidAddressError, InvalidBitLengthError, InvalidMarketParamsError, RegistryValueAlreadyRegisteredError, UnknownAddressError, UnknownDataError, UnknownFactory, UnknownMarketAllocationError, UnknownMarketParamsError, UnknownOfFactory, UnknownTokenError, UnknownTokenPriceError, UnknownVaultConfigError, UnsupportedChainIdError, UnsupportedMarketIrmError,
|
|
2
2
|
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
|
3
3
|
UnsupportedPreLiquidationParamsError, UnsupportedVaultV2AdapterError, VaultV2Errors, } from "@morpho-org/blue-sdk";
|
|
4
|
-
export { getUnsupportedVaultV2Adapter, InvalidNumberError, InvalidPermitDomainChainIdError, InvalidPermitDomainVerifyingContractError, isUnknownOfFactoryError, MarketParamsIdMismatchError, NonTupleReturnValueError, UnknownAbiFunctionError, UnnamedAbiOutputsError,
|
|
4
|
+
export { getUnsupportedVaultV2Adapter, InvalidNumberError, InvalidPermitDomainChainIdError, InvalidPermitDomainVerifyingContractError, isUnknownOfFactoryError, MalformedTokenMetadataError, MarketParamsIdMismatchError, MissingPermitDomainNameError, NonTupleReturnValueError, UnknownAbiFunctionError, UnnamedAbiOutputsError, UnsupportedPermitDomainExtensionsError, } from "@morpho-org/blue-sdk-viem";
|
package/lib/esm/blue/fetch.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { fetchAccrualPosition, fetchAccrualVault, fetchAccrualVaultV2, fetchAccrualVaultV2Adapter,
|
|
1
|
+
export { fetchAccrualPosition, fetchAccrualVault, fetchAccrualVaultV2, fetchAccrualVaultV2Adapter, fetchAccrualVaultV2MorphoMarketV1Adapter, fetchAccrualVaultV2MorphoMarketV1AdapterV2, fetchAccrualVaultV2MorphoVaultV1Adapter, fetchHolding, fetchMarket, fetchMarketParams, fetchPosition,
|
|
2
2
|
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
|
3
3
|
fetchPreLiquidationParams,
|
|
4
4
|
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
|
5
|
-
fetchPreLiquidationPosition, fetchToken, fetchUser, fetchVault, fetchVaultConfig, fetchVaultMarketAllocation, fetchVaultMarketConfig, fetchVaultUser, fetchVaultV2, fetchVaultV2Adapter, fetchVaultV2BlueMarketPublicAllocatorConfig, fetchVaultV2BluePublicAllocatorConfig, fetchVaultV2BluePublicAllocatorData,
|
|
5
|
+
fetchPreLiquidationPosition, fetchToken, fetchUser, fetchVault, fetchVaultConfig, fetchVaultMarketAllocation, fetchVaultMarketConfig, fetchVaultUser, fetchVaultV2, fetchVaultV2Adapter, fetchVaultV2BlueMarketPublicAllocatorConfig, fetchVaultV2BluePublicAllocatorConfig, fetchVaultV2BluePublicAllocatorData, fetchVaultV2MorphoMarketV1Adapter, fetchVaultV2MorphoMarketV1AdapterV2, fetchVaultV2MorphoVaultV1Adapter, } from "@morpho-org/blue-sdk-viem";
|
package/lib/esm/blue/fetch.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { fetchAccrualPosition, fetchAccrualVault, fetchAccrualVaultV2, fetchAccrualVaultV2Adapter,
|
|
1
|
+
export { fetchAccrualPosition, fetchAccrualVault, fetchAccrualVaultV2, fetchAccrualVaultV2Adapter, fetchAccrualVaultV2MorphoMarketV1Adapter, fetchAccrualVaultV2MorphoMarketV1AdapterV2, fetchAccrualVaultV2MorphoVaultV1Adapter, fetchHolding, fetchMarket, fetchMarketParams, fetchPosition,
|
|
2
2
|
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
|
3
3
|
fetchPreLiquidationParams,
|
|
4
4
|
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
|
5
|
-
fetchPreLiquidationPosition, fetchToken, fetchUser, fetchVault, fetchVaultConfig, fetchVaultMarketAllocation, fetchVaultMarketConfig, fetchVaultUser, fetchVaultV2, fetchVaultV2Adapter, fetchVaultV2BlueMarketPublicAllocatorConfig, fetchVaultV2BluePublicAllocatorConfig, fetchVaultV2BluePublicAllocatorData,
|
|
5
|
+
fetchPreLiquidationPosition, fetchToken, fetchUser, fetchVault, fetchVaultConfig, fetchVaultMarketAllocation, fetchVaultMarketConfig, fetchVaultUser, fetchVaultV2, fetchVaultV2Adapter, fetchVaultV2BlueMarketPublicAllocatorConfig, fetchVaultV2BluePublicAllocatorConfig, fetchVaultV2BluePublicAllocatorData, fetchVaultV2MorphoMarketV1Adapter, fetchVaultV2MorphoMarketV1AdapterV2, fetchVaultV2MorphoVaultV1Adapter, } from "@morpho-org/blue-sdk-viem";
|
package/lib/esm/blue/types.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export type { BigIntish, CollateralAllocation, Eip712Field, Erc20AllowanceRecipient, Failable, Fetchable, InputMarketParams, Loadable, MarketId, MaxBorrowOptions, MaxPositionCapacities, MaxWithdrawCollateralOptions, Pending, } from "@morpho-org/blue-sdk";
|
|
2
|
-
export type { AuthorizationArgs, DeploylessFetchParameters, FetchParameters, InputAllocation, MetaMorphoCall, Permit2PermitArgs, Permit2TransferFromArgs, PermitArgs, } from "@morpho-org/blue-sdk-viem";
|
|
2
|
+
export type { AuthorizationArgs, DeploylessFetchParameters, FetchParameters, InputAllocation, MetaMorphoCall, Permit2PermitArgs, Permit2TransferFromArgs, PermitArgs, TokenMetadataField, } from "@morpho-org/blue-sdk-viem";
|
package/lib/esm/blue/utils.d.ts
CHANGED
|
@@ -3,5 +3,5 @@ export { AdaptiveCurveIrmLib, CapacityLimitReason,
|
|
|
3
3
|
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
|
4
4
|
defaultPreLiquidationParamsRegistry,
|
|
5
5
|
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
|
6
|
-
getDefaultPreLiquidationParams, MarketUtils, MathLib, SharesMath, VaultUtils, VaultV2BlueMarketPublicAllocatorConfigUtils, VaultV2BluePublicAllocatorConfigUtils,
|
|
7
|
-
export { decodeBytes32String, getAuthorizationTypedData, getPermit2PermitTypedData, getPermit2TransferFromTypedData, getPermitTypedData, MetaMorphoAction, optionalBoolean, readContractRestructured, restructure, safeGetAddress, safeParseNumber, safeParseUnits, } from "@morpho-org/blue-sdk-viem";
|
|
6
|
+
getDefaultPreLiquidationParams, MarketUtils, MathLib, SharesMath, VaultUtils, VaultV2BlueMarketPublicAllocatorConfigUtils, VaultV2BluePublicAllocatorConfigUtils, VaultV2Utils, } from "@morpho-org/blue-sdk";
|
|
7
|
+
export { catchRevertOnly, decodeBytes32String, getAuthorizationTypedData, getPermit2PermitTypedData, getPermit2TransferFromTypedData, getPermitTypedData, isContractRevertError, isTransportError, isUndecodableResultError, MetaMorphoAction, optionalBoolean, readContractRestructured, restructure, safeGetAddress, safeParseNumber, safeParseUnits, } from "@morpho-org/blue-sdk-viem";
|
package/lib/esm/blue/utils.js
CHANGED
|
@@ -2,5 +2,5 @@ export { AdaptiveCurveIrmLib, CapacityLimitReason,
|
|
|
2
2
|
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
|
3
3
|
defaultPreLiquidationParamsRegistry,
|
|
4
4
|
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
|
5
|
-
getDefaultPreLiquidationParams, MarketUtils, MathLib, SharesMath, VaultUtils, VaultV2BlueMarketPublicAllocatorConfigUtils, VaultV2BluePublicAllocatorConfigUtils,
|
|
6
|
-
export { decodeBytes32String, getAuthorizationTypedData, getPermit2PermitTypedData, getPermit2TransferFromTypedData, getPermitTypedData, MetaMorphoAction, optionalBoolean, readContractRestructured, restructure, safeGetAddress, safeParseNumber, safeParseUnits, } from "@morpho-org/blue-sdk-viem";
|
|
5
|
+
getDefaultPreLiquidationParams, MarketUtils, MathLib, SharesMath, VaultUtils, VaultV2BlueMarketPublicAllocatorConfigUtils, VaultV2BluePublicAllocatorConfigUtils, VaultV2Utils, } from "@morpho-org/blue-sdk";
|
|
6
|
+
export { catchRevertOnly, decodeBytes32String, getAuthorizationTypedData, getPermit2PermitTypedData, getPermit2TransferFromTypedData, getPermitTypedData, isContractRevertError, isTransportError, isUndecodableResultError, MetaMorphoAction, optionalBoolean, readContractRestructured, restructure, safeGetAddress, safeParseNumber, safeParseUnits, } from "@morpho-org/blue-sdk-viem";
|
|
@@ -31,7 +31,8 @@ export interface BlueActions {
|
|
|
31
31
|
*
|
|
32
32
|
* @param parameters - Optional fetch parameters (block number, state overrides).
|
|
33
33
|
* @returns Market state including total supply/borrow assets and shares.
|
|
34
|
-
* @throws {ChainIdMismatchError} when the connected client
|
|
34
|
+
* @throws {ChainIdMismatchError} when the connected client declares another chain or none, or its RPC reports another chain via `eth_chainId`.
|
|
35
|
+
* @throws {viem.BaseError} when the `eth_chainId` request or a state read fails.
|
|
35
36
|
* @example
|
|
36
37
|
* ```ts
|
|
37
38
|
* import { markets } from "@morpho-org/morpho-test";
|
|
@@ -52,7 +53,8 @@ export interface BlueActions {
|
|
|
52
53
|
* @param userAddress - The user whose position to fetch.
|
|
53
54
|
* @param parameters - Optional fetch parameters (block number, state overrides).
|
|
54
55
|
* @returns Accrual position with health metrics (maxBorrowAssets, ltv, isHealthy).
|
|
55
|
-
* @throws {ChainIdMismatchError} when the connected client
|
|
56
|
+
* @throws {ChainIdMismatchError} when the connected client declares another chain or none, or its RPC reports another chain via `eth_chainId`.
|
|
57
|
+
* @throws {viem.BaseError} when the `eth_chainId` request or a state read fails.
|
|
56
58
|
* @example
|
|
57
59
|
* ```ts
|
|
58
60
|
* import { markets } from "@morpho-org/morpho-test";
|
|
@@ -81,7 +83,8 @@ export interface BlueActions {
|
|
|
81
83
|
* @param params.referralFeePct - Optional WAD-scaled referral fee below 100%.
|
|
82
84
|
* @param params.referralFeeRecipient - Recipient required for a positive fee.
|
|
83
85
|
* @returns Lazy token prerequisite resolution and a synchronous deep-frozen transaction.
|
|
84
|
-
* @throws {ChainIdMismatchError} when the client targets another chain
|
|
86
|
+
* @throws {ChainIdMismatchError} when the client targets another chain, or from
|
|
87
|
+
* `getRequirements()` when the RPC reports another chain via `eth_chainId`.
|
|
85
88
|
* @throws {ExpiredDeadlineError} when the deadline is stale.
|
|
86
89
|
* @throws {NonPositiveInputError} when `collateralAssets` is not positive.
|
|
87
90
|
* @throws {NegativeInputError} when collateral, native funding, or the referral fee is negative.
|
|
@@ -101,7 +104,14 @@ export interface BlueActions {
|
|
|
101
104
|
* @throws {BundlesRequirementSignatureMismatchError} from `buildTx()` when a signature cannot be encoded safely.
|
|
102
105
|
* @throws {UnsupportedChainIdError} when the chain is absent from the address registry.
|
|
103
106
|
* @throws {UnknownAddressError} when BlueBundlesV1 is not registered.
|
|
104
|
-
* @throws {
|
|
107
|
+
* @throws {UnknownTokenError} from `getRequirements()` when the funded token's `decimals()` is unusable.
|
|
108
|
+
* @throws {MalformedTokenMetadataError} when the token's `eip712Domain()` or
|
|
109
|
+
* `bytes32` `name`/`symbol` retry returns non-empty data that does not decode, or when the
|
|
110
|
+
* deployless query reports malformed `name()`/`symbol()`/`eip712Domain()` returndata (no fallback).
|
|
111
|
+
* @throws {MissingContractCodeError} from `getRequirements()` when a fixed bundles or protocol
|
|
112
|
+
* contract has no code at its registered address.
|
|
113
|
+
* @throws {viem.BaseError} from `getRequirements()` when an allowance, nonce, or token metadata
|
|
114
|
+
* read or `eth_chainId` request fails.
|
|
105
115
|
* @example
|
|
106
116
|
* ```ts
|
|
107
117
|
* import { markets } from "@morpho-org/morpho-test";
|
|
@@ -132,9 +142,11 @@ export interface BlueActions {
|
|
|
132
142
|
/**
|
|
133
143
|
* Prepares a direct BlueBundlesV1 loan-asset supply.
|
|
134
144
|
*
|
|
135
|
-
* `getRequirements()`
|
|
136
|
-
*
|
|
137
|
-
* ERC-
|
|
145
|
+
* `getRequirements()` first checks that BlueBundlesV1, Blue and, for ERC-20 funding with
|
|
146
|
+
* signatures enabled, Permit2 hold code at their registered addresses, then reads the loan-token
|
|
147
|
+
* allowance and selected ERC-2612 or Permit2 nonce state. Direct approvals and ERC-2612 name
|
|
148
|
+
* BlueBundlesV1 as spender; Permit2 keeps its ERC-20 approval on canonical Permit2. Native
|
|
149
|
+
* funding is exclusive and skips token requirements (the code check still runs).
|
|
138
150
|
* The referral fee is deducted from the gross `assets` supplied. This route exposes no
|
|
139
151
|
* share-price bound or `slippageTolerance`.
|
|
140
152
|
*
|
|
@@ -145,7 +157,8 @@ export interface BlueActions {
|
|
|
145
157
|
* @param params.referralFeePct - Optional WAD-scaled referral fee below 100%.
|
|
146
158
|
* @param params.referralFeeRecipient - Recipient required for a positive fee.
|
|
147
159
|
* @returns Lazy prerequisite resolution and a synchronous deep-frozen transaction builder.
|
|
148
|
-
* @throws {ChainIdMismatchError} when the client targets another chain
|
|
160
|
+
* @throws {ChainIdMismatchError} when the client targets another chain, or from
|
|
161
|
+
* `getRequirements()` when the RPC reports another chain via `eth_chainId`.
|
|
149
162
|
* @throws {ExpiredDeadlineError} when the deadline is not in the future at creation or requirement resolution.
|
|
150
163
|
* @throws {NonPositiveInputError} when `assets` is not positive.
|
|
151
164
|
* @throws {NegativeInputError} when native funding or the referral fee is negative, or from `getRequirements()` when an explicit `permit2Nonce` is negative.
|
|
@@ -166,7 +179,14 @@ export interface BlueActions {
|
|
|
166
179
|
* @throws {BundlesRequirementSignatureMismatchError} from `buildTx()` when a signature cannot be encoded safely.
|
|
167
180
|
* @throws {UnsupportedChainIdError} when the chain is absent from the address registry.
|
|
168
181
|
* @throws {UnknownAddressError} when BlueBundlesV1 is not registered.
|
|
169
|
-
* @throws {
|
|
182
|
+
* @throws {UnknownTokenError} from `getRequirements()` when the funded token's `decimals()` is unusable.
|
|
183
|
+
* @throws {MalformedTokenMetadataError} when the token's `eip712Domain()` or
|
|
184
|
+
* `bytes32` `name`/`symbol` retry returns non-empty data that does not decode, or when the
|
|
185
|
+
* deployless query reports malformed `name()`/`symbol()`/`eip712Domain()` returndata (no fallback).
|
|
186
|
+
* @throws {MissingContractCodeError} from `getRequirements()` when a fixed bundles or protocol
|
|
187
|
+
* contract has no code at its registered address.
|
|
188
|
+
* @throws {viem.BaseError} from `getRequirements()` when a required allowance, nonce, or token
|
|
189
|
+
* metadata read or `eth_chainId` request fails.
|
|
170
190
|
* @example
|
|
171
191
|
* ```ts
|
|
172
192
|
* import { markets } from "@morpho-org/morpho-test";
|
|
@@ -213,7 +233,8 @@ export interface BlueActions {
|
|
|
213
233
|
* @param params.referralFeePct - Optional WAD-scaled referral fee below 100%.
|
|
214
234
|
* @param params.referralFeeRecipient - Recipient required for a positive fee.
|
|
215
235
|
* @returns Lazy authorization resolution and a synchronous deep-frozen transaction builder.
|
|
216
|
-
* @throws {ChainIdMismatchError} when the client targets another chain
|
|
236
|
+
* @throws {ChainIdMismatchError} when the client targets another chain, or from
|
|
237
|
+
* `getRequirements()` when the RPC reports another chain via `eth_chainId`.
|
|
217
238
|
* @throws {ExpiredDeadlineError} when the deadline is stale.
|
|
218
239
|
* @throws {MissingAccrualPositionError} when no position snapshot is provided at runtime.
|
|
219
240
|
* @throws {MarketIdMismatchError} when `positionData` belongs to another market.
|
|
@@ -237,7 +258,10 @@ export interface BlueActions {
|
|
|
237
258
|
* @throws {BundlesRequirementSignatureMismatchError} from `buildTx()` when authorization cannot be encoded safely.
|
|
238
259
|
* @throws {UnsupportedChainIdError} when the chain is absent from the address registry.
|
|
239
260
|
* @throws {UnknownAddressError} when BlueBundlesV1 is not registered.
|
|
240
|
-
* @throws {
|
|
261
|
+
* @throws {MissingContractCodeError} from `getRequirements()` when a fixed bundles or protocol
|
|
262
|
+
* contract has no code at its registered address.
|
|
263
|
+
* @throws {viem.BaseError} from `getRequirements()` when an authorization read or
|
|
264
|
+
* `eth_chainId` request fails.
|
|
241
265
|
* @example
|
|
242
266
|
* ```ts
|
|
243
267
|
* import { AccrualPosition } from "@morpho-org/blue-sdk";
|
|
@@ -288,7 +312,8 @@ export interface BlueActions {
|
|
|
288
312
|
* @param params.referralFeePct - Optional WAD-scaled referral fee below 100%.
|
|
289
313
|
* @param params.referralFeeRecipient - Recipient required for a positive fee.
|
|
290
314
|
* @returns Lazy Blue authorization resolution and a synchronous deep-frozen transaction.
|
|
291
|
-
* @throws {ChainIdMismatchError} when the client targets another chain
|
|
315
|
+
* @throws {ChainIdMismatchError} when the client targets another chain, or from
|
|
316
|
+
* `getRequirements()` when the RPC reports another chain via `eth_chainId`.
|
|
292
317
|
* @throws {UnsupportedBlueMarketIrmError} when positive debt requires an unsupported IRM projection.
|
|
293
318
|
* @throws {ExpiredDeadlineError} when the deadline is stale.
|
|
294
319
|
* @throws {MissingAccrualPositionError} when no position snapshot is provided.
|
|
@@ -312,7 +337,10 @@ export interface BlueActions {
|
|
|
312
337
|
* @throws {BundlesRequirementSignatureMismatchError} from `buildTx()` when authorization cannot be encoded safely.
|
|
313
338
|
* @throws {UnsupportedChainIdError} when the chain is absent from the address registry.
|
|
314
339
|
* @throws {UnknownAddressError} when BlueBundlesV1 is not registered.
|
|
315
|
-
* @throws {
|
|
340
|
+
* @throws {MissingContractCodeError} from `getRequirements()` when a fixed bundles or protocol
|
|
341
|
+
* contract has no code at its registered address.
|
|
342
|
+
* @throws {viem.BaseError} from `getRequirements()` when an authorization read or
|
|
343
|
+
* `eth_chainId` request fails.
|
|
316
344
|
* @example
|
|
317
345
|
* ```ts
|
|
318
346
|
* import { AccrualPosition } from "@morpho-org/blue-sdk";
|
|
@@ -364,7 +392,8 @@ export interface BlueActions {
|
|
|
364
392
|
* @param params.referralFeePct - Optional WAD-scaled referral fee below 100%.
|
|
365
393
|
* @param params.referralFeeRecipient - Recipient required for a positive fee.
|
|
366
394
|
* @returns Lazy token prerequisite resolution and a synchronous deep-frozen transaction.
|
|
367
|
-
* @throws {ChainIdMismatchError} when the client targets another chain
|
|
395
|
+
* @throws {ChainIdMismatchError} when the client targets another chain, or from
|
|
396
|
+
* `getRequirements()` when the RPC reports another chain via `eth_chainId`.
|
|
368
397
|
* @throws {UnsupportedBlueMarketIrmError} when positive debt requires an unsupported IRM projection.
|
|
369
398
|
* @throws {ExpiredDeadlineError} when the deadline is stale.
|
|
370
399
|
* @throws {MissingAccrualPositionError} when no position snapshot is provided.
|
|
@@ -394,7 +423,14 @@ export interface BlueActions {
|
|
|
394
423
|
* @throws {BundlesRequirementSignatureMismatchError} from `buildTx()` when a signature cannot be encoded safely.
|
|
395
424
|
* @throws {UnsupportedChainIdError} when the chain is absent from the address registry.
|
|
396
425
|
* @throws {UnknownAddressError} when BlueBundlesV1 is not registered.
|
|
397
|
-
* @throws {
|
|
426
|
+
* @throws {UnknownTokenError} from `getRequirements()` when the funded token's `decimals()` is unusable.
|
|
427
|
+
* @throws {MalformedTokenMetadataError} when the token's `eip712Domain()` or
|
|
428
|
+
* `bytes32` `name`/`symbol` retry returns non-empty data that does not decode, or when the
|
|
429
|
+
* deployless query reports malformed `name()`/`symbol()`/`eip712Domain()` returndata (no fallback).
|
|
430
|
+
* @throws {MissingContractCodeError} from `getRequirements()` when a fixed bundles or protocol
|
|
431
|
+
* contract has no code at its registered address.
|
|
432
|
+
* @throws {viem.BaseError} from `getRequirements()` when an allowance, nonce, token metadata,
|
|
433
|
+
* or `eth_chainId` read fails.
|
|
398
434
|
* @example
|
|
399
435
|
* ```ts
|
|
400
436
|
* import { AccrualPosition } from "@morpho-org/blue-sdk";
|
|
@@ -449,7 +485,8 @@ export interface BlueActions {
|
|
|
449
485
|
* @param params.referralFeePct - Optional WAD-scaled referral fee below 100%.
|
|
450
486
|
* @param params.referralFeeRecipient - Recipient required for a positive fee.
|
|
451
487
|
* @returns Lazy Blue authorization resolution and a synchronous deep-frozen transaction.
|
|
452
|
-
* @throws {ChainIdMismatchError} when the client targets another chain
|
|
488
|
+
* @throws {ChainIdMismatchError} when the client targets another chain, or from
|
|
489
|
+
* `getRequirements()` when the RPC reports another chain via `eth_chainId`.
|
|
453
490
|
* @throws {UnsupportedBlueMarketIrmError} when positive debt requires an unsupported IRM projection.
|
|
454
491
|
* @throws {ExpiredDeadlineError} when the deadline is stale.
|
|
455
492
|
* @throws {MissingAccrualPositionError} when no position snapshot is provided.
|
|
@@ -468,7 +505,10 @@ export interface BlueActions {
|
|
|
468
505
|
* @throws {BundlesRequirementSignatureMismatchError} from `buildTx()` when authorization cannot be encoded safely.
|
|
469
506
|
* @throws {UnsupportedChainIdError} when the chain is absent from the address registry.
|
|
470
507
|
* @throws {UnknownAddressError} when BlueBundlesV1 is not registered.
|
|
471
|
-
* @throws {
|
|
508
|
+
* @throws {MissingContractCodeError} from `getRequirements()` when a fixed bundles or protocol
|
|
509
|
+
* contract has no code at its registered address.
|
|
510
|
+
* @throws {viem.BaseError} from `getRequirements()` when an authorization read or
|
|
511
|
+
* `eth_chainId` request fails.
|
|
472
512
|
* @example
|
|
473
513
|
* ```ts
|
|
474
514
|
* import { AccrualPosition } from "@morpho-org/blue-sdk";
|
|
@@ -526,7 +566,8 @@ export interface BlueActions {
|
|
|
526
566
|
* @param params.referralFeePct - Optional WAD-scaled referral fee below 100%.
|
|
527
567
|
* @param params.referralFeeRecipient - Recipient required for a positive fee.
|
|
528
568
|
* @returns Lazy funding/authorization resolution and a synchronous deep-frozen transaction builder.
|
|
529
|
-
* @throws {ChainIdMismatchError} when the client targets another chain
|
|
569
|
+
* @throws {ChainIdMismatchError} when the client targets another chain, or from
|
|
570
|
+
* `getRequirements()` when the RPC reports another chain via `eth_chainId`.
|
|
530
571
|
* @throws {UnsupportedBlueMarketIrmError} when positive debt requires an unsupported IRM projection.
|
|
531
572
|
* @throws {MissingAccrualPositionError} when no position snapshot is provided at runtime.
|
|
532
573
|
* @throws {MarketIdMismatchError} when `positionData` belongs to another market.
|
|
@@ -559,7 +600,14 @@ export interface BlueActions {
|
|
|
559
600
|
* @throws {BundlesRequirementSignatureMismatchError} from `buildTx()` when a signature cannot be encoded safely.
|
|
560
601
|
* @throws {UnsupportedChainIdError} when the chain is absent from the address registry.
|
|
561
602
|
* @throws {UnknownAddressError} when BlueBundlesV1 is not registered.
|
|
562
|
-
* @throws {
|
|
603
|
+
* @throws {UnknownTokenError} from `getRequirements()` when the funded token's `decimals()` is unusable.
|
|
604
|
+
* @throws {MalformedTokenMetadataError} when the token's `eip712Domain()` or
|
|
605
|
+
* `bytes32` `name`/`symbol` retry returns non-empty data that does not decode, or when the
|
|
606
|
+
* deployless query reports malformed `name()`/`symbol()`/`eip712Domain()` returndata (no fallback).
|
|
607
|
+
* @throws {MissingContractCodeError} from `getRequirements()` when a fixed bundles or protocol
|
|
608
|
+
* contract has no code at its registered address.
|
|
609
|
+
* @throws {viem.BaseError} from `getRequirements()` when a required allowance, nonce, token
|
|
610
|
+
* metadata, authorization, or `eth_chainId` read fails.
|
|
563
611
|
* @example
|
|
564
612
|
* ```ts
|
|
565
613
|
* import { AccrualPosition } from "@morpho-org/blue-sdk";
|
|
@@ -625,7 +673,8 @@ export interface BlueActions {
|
|
|
625
673
|
* @param params.referralFeePct - Optional WAD-scaled referral fee below 100%.
|
|
626
674
|
* @param params.referralFeeRecipient - Recipient required for a positive fee.
|
|
627
675
|
* @returns Lazy funding/authorization resolution and a synchronous deep-frozen transaction builder.
|
|
628
|
-
* @throws {ChainIdMismatchError} when the client targets another chain
|
|
676
|
+
* @throws {ChainIdMismatchError} when the client targets another chain, or from
|
|
677
|
+
* `getRequirements()` when the RPC reports another chain via `eth_chainId`.
|
|
629
678
|
* @throws {UnsupportedBlueMarketIrmError} when positive debt requires an unsupported IRM projection.
|
|
630
679
|
* @throws {MissingAccrualPositionError} when a borrow has no position snapshot.
|
|
631
680
|
* @throws {MarketIdMismatchError} when `positionData` belongs to another market.
|
|
@@ -658,7 +707,14 @@ export interface BlueActions {
|
|
|
658
707
|
* @throws {BundlesRequirementSignatureMismatchError} from `buildTx()` when a signature cannot be encoded safely.
|
|
659
708
|
* @throws {UnsupportedChainIdError} when the chain is absent from the address registry.
|
|
660
709
|
* @throws {UnknownAddressError} when BlueBundlesV1 is not registered.
|
|
661
|
-
* @throws {
|
|
710
|
+
* @throws {UnknownTokenError} from `getRequirements()` when the funded token's `decimals()` is unusable.
|
|
711
|
+
* @throws {MalformedTokenMetadataError} when the token's `eip712Domain()` or
|
|
712
|
+
* `bytes32` `name`/`symbol` retry returns non-empty data that does not decode, or when the
|
|
713
|
+
* deployless query reports malformed `name()`/`symbol()`/`eip712Domain()` returndata (no fallback).
|
|
714
|
+
* @throws {MissingContractCodeError} from `getRequirements()` when a fixed bundles or protocol
|
|
715
|
+
* contract has no code at its registered address.
|
|
716
|
+
* @throws {viem.BaseError} from `getRequirements()` when a required allowance, nonce, token
|
|
717
|
+
* metadata, authorization, or `eth_chainId` read fails.
|
|
662
718
|
* @example
|
|
663
719
|
* ```ts
|
|
664
720
|
* import { markets } from "@morpho-org/morpho-test";
|
|
@@ -714,7 +770,8 @@ export interface BlueActions {
|
|
|
714
770
|
* @param params.referralFeePct - Optional WAD-scaled referral fee below 100%.
|
|
715
771
|
* @param params.referralFeeRecipient - Recipient required for a positive fee.
|
|
716
772
|
* @returns Lazy Blue authorization resolution and a synchronous deep-frozen transaction builder.
|
|
717
|
-
* @throws {ChainIdMismatchError} when the client targets another chain
|
|
773
|
+
* @throws {ChainIdMismatchError} when the client targets another chain, or from
|
|
774
|
+
* `getRequirements()` when the RPC reports another chain via `eth_chainId`.
|
|
718
775
|
* @throws {UnsupportedBlueMarketIrmError} when positive source or destination debt requires an unsupported IRM projection.
|
|
719
776
|
* @throws {MissingAccrualPositionError} when either position snapshot is absent at runtime.
|
|
720
777
|
* @throws {MarketIdMismatchError} when a position snapshot belongs to another market.
|
|
@@ -740,7 +797,10 @@ export interface BlueActions {
|
|
|
740
797
|
* @throws {BundlesRequirementSignatureMismatchError} from `buildTx()` when authorization cannot be encoded safely.
|
|
741
798
|
* @throws {UnsupportedChainIdError} when the chain is absent from the address registry.
|
|
742
799
|
* @throws {UnknownAddressError} when BlueBundlesV1 is not registered.
|
|
743
|
-
* @throws {
|
|
800
|
+
* @throws {MissingContractCodeError} from `getRequirements()` when a fixed bundles or protocol
|
|
801
|
+
* contract has no code at its registered address.
|
|
802
|
+
* @throws {viem.BaseError} from `getRequirements()` when an authorization read or
|
|
803
|
+
* `eth_chainId` request fails.
|
|
744
804
|
* @example
|
|
745
805
|
* ```ts
|
|
746
806
|
* import { AccrualPosition } from "@morpho-org/blue-sdk";
|
|
@@ -797,13 +857,19 @@ export interface BlueActions {
|
|
|
797
857
|
* @param params.block.number - Block number used for every RPC read.
|
|
798
858
|
* @param params.block.timestamp - Timestamp corresponding to the fetched block.
|
|
799
859
|
* @returns A `VaultV2BlueReallocationData` snapshot ready for {@link getVaultV2BlueReallocations}.
|
|
800
|
-
* @throws {ChainIdMismatchError} when the client chain
|
|
860
|
+
* @throws {ChainIdMismatchError} when the client declares another chain or its RPC reports another
|
|
861
|
+
* chain via `eth_chainId`.
|
|
801
862
|
* @throws {UnsupportedChainIdError} when the chain is absent from the address registry.
|
|
802
863
|
* @throws {UnknownAddressError} when the chain has no BluePublicAllocator deployment.
|
|
803
864
|
* @throws {UnknownBlueFactory} when the chain has no Vault V2 factory.
|
|
804
865
|
* @throws {UnknownBlueOfFactory} when a requested address is not a Vault V2 from that factory.
|
|
805
866
|
* @throws {UnsupportedBlueVaultV2AdapterError} when a vault contains an unsupported adapter.
|
|
806
|
-
* @throws {
|
|
867
|
+
* @throws {UnknownTokenError} when a vault's share token has unusable decimals.
|
|
868
|
+
* @throws {MalformedTokenMetadataError} when the share token's `eip712Domain()` or
|
|
869
|
+
* `bytes32` `name`/`symbol` retry returns non-empty data that does not decode, or when the
|
|
870
|
+
* deployless query reports malformed `name()`/`symbol()`/`eip712Domain()` returndata (no fallback).
|
|
871
|
+
* @throws {viem.BaseError} when the `eth_chainId` request fails or a later RPC or contract read
|
|
872
|
+
* fails with no fallback left.
|
|
807
873
|
*/
|
|
808
874
|
getVaultV2BlueReallocationData: (params: {
|
|
809
875
|
vaultAddresses: readonly Address[];
|
|
@@ -862,6 +928,16 @@ export declare class MorphoBlue implements BlueActions {
|
|
|
862
928
|
constructor(client: MorphoClientType, marketParams: MarketParams, chainId: number);
|
|
863
929
|
private validateDeadline;
|
|
864
930
|
private validateWriteCommon;
|
|
931
|
+
/**
|
|
932
|
+
* Asserts that every registry contract this flow's transaction targets or names as
|
|
933
|
+
* spender/authorized operator holds code, with one `eth_getCode` per distinct address
|
|
934
|
+
* before any other requirement read. Blue write flows probe `eth_chainId` only after a target
|
|
935
|
+
* has no code and report a chain mismatch when the RPC serves another chain.
|
|
936
|
+
*
|
|
937
|
+
* @param params.erc20Funding - Whether the flow resolves an ERC-20 funding leg, which
|
|
938
|
+
* may name canonical Permit2 when signatures are supported.
|
|
939
|
+
*/
|
|
940
|
+
private assertWriteTargets;
|
|
865
941
|
private getMaxLtv;
|
|
866
942
|
private getBlueBundlesV1QuoteTimestamp;
|
|
867
943
|
private getTokenRequirements;
|
|
@@ -998,13 +1074,19 @@ export declare class MorphoBlue implements BlueActions {
|
|
|
998
1074
|
* @param params.block.number - Block number used for every RPC read.
|
|
999
1075
|
* @param params.block.timestamp - Timestamp corresponding to the fetched block.
|
|
1000
1076
|
* @returns A `VaultV2BlueReallocationData` snapshot ready for {@link getVaultV2BlueReallocations}.
|
|
1001
|
-
* @throws {ChainIdMismatchError} when the client chain
|
|
1077
|
+
* @throws {ChainIdMismatchError} when the client declares another chain or its RPC reports another
|
|
1078
|
+
* chain via `eth_chainId`.
|
|
1002
1079
|
* @throws {UnsupportedChainIdError} when the chain is absent from the address registry.
|
|
1003
1080
|
* @throws {UnknownAddressError} when the chain has no BluePublicAllocator deployment.
|
|
1004
1081
|
* @throws {UnknownBlueFactory} when the chain has no Vault V2 factory.
|
|
1005
1082
|
* @throws {UnknownBlueOfFactory} when a requested address is not a Vault V2 from that factory.
|
|
1006
1083
|
* @throws {UnsupportedBlueVaultV2AdapterError} when a vault contains an unsupported adapter.
|
|
1007
|
-
* @throws {
|
|
1084
|
+
* @throws {UnknownTokenError} when a vault's share token has unusable decimals.
|
|
1085
|
+
* @throws {MalformedTokenMetadataError} when the share token's `eip712Domain()` or
|
|
1086
|
+
* `bytes32` `name`/`symbol` retry returns non-empty data that does not decode, or when the
|
|
1087
|
+
* deployless query reports malformed `name()`/`symbol()`/`eip712Domain()` returndata (no fallback).
|
|
1088
|
+
* @throws {viem.BaseError} when the `eth_chainId` request fails or a later RPC or contract read
|
|
1089
|
+
* fails with no fallback left.
|
|
1008
1090
|
* @example
|
|
1009
1091
|
* ```ts
|
|
1010
1092
|
* import { markets } from "@morpho-org/morpho-test";
|