@morpho-org/morpho-sdk 9.4.0 → 9.6.0-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/MIGRATION-v5-to-v6.md +7 -0
  2. package/MIGRATION-v7-to-v8.md +7 -0
  3. package/MIGRATION-v8-to-v9.md +7 -0
  4. package/README.md +6 -4
  5. package/lib/cjs/abis.d.ts +1 -1
  6. package/lib/cjs/abis.js +5 -1
  7. package/lib/cjs/actions/bundles/resolveBundlesTokenRequirements.d.ts +1 -0
  8. package/lib/cjs/actions/requirements/encode/encodeErc20Permit.d.ts +4 -1
  9. package/lib/cjs/actions/requirements/encode/encodeErc20Permit.js +4 -1
  10. package/lib/cjs/actions/requirements/encode/encodeErc20Permit2SignatureTransfer.d.ts +5 -1
  11. package/lib/cjs/actions/requirements/encode/encodeErc20Permit2SignatureTransfer.js +1 -0
  12. package/lib/cjs/blue/abis.d.ts +1 -1
  13. package/lib/cjs/blue/abis.js +5 -1
  14. package/lib/cjs/blue/entities.d.ts +4 -4
  15. package/lib/cjs/blue/entities.js +3 -1
  16. package/lib/cjs/blue/errors.d.ts +2 -2
  17. package/lib/cjs/blue/errors.js +5 -1
  18. package/lib/cjs/blue/fetch.d.ts +2 -2
  19. package/lib/cjs/blue/fetch.js +3 -1
  20. package/lib/cjs/blue/utils.d.ts +1 -1
  21. package/lib/cjs/blue/utils.js +2 -1
  22. package/lib/cjs/client/morphoViemExtension.d.ts +1 -1
  23. package/lib/cjs/client/morphoViemExtension.js +1 -1
  24. package/lib/cjs/entities/blue/blue.d.ts +7 -21
  25. package/lib/cjs/entities/blue/blue.js +4 -22
  26. package/lib/cjs/entities/index.d.ts +4 -4
  27. package/lib/cjs/entities/index.js +3 -1
  28. package/lib/cjs/entities/requirements/getBundlesTokenRequirements.d.ts +21 -26
  29. package/lib/cjs/entities/requirements/getBundlesTokenRequirements.js +42 -80
  30. package/lib/cjs/entities/requirements/getUnusedPermit2Nonce.d.ts +6 -3
  31. package/lib/cjs/entities/requirements/getUnusedPermit2Nonce.js +2 -2
  32. package/lib/cjs/entities/vaultV1/vaultV1.d.ts +5 -11
  33. package/lib/cjs/entities/vaultV1/vaultV1.js +3 -11
  34. package/lib/cjs/entities/vaultV2/vaultV2.d.ts +37 -18
  35. package/lib/cjs/entities/vaultV2/vaultV2.js +36 -12
  36. package/lib/cjs/entities/vaultV2BlueReallocationData.d.ts +8 -3
  37. package/lib/cjs/entities/vaultV2BlueReallocationData.js +49 -7
  38. package/lib/cjs/errors.d.ts +4 -4
  39. package/lib/cjs/errors.js +7 -5
  40. package/lib/cjs/fetch.d.ts +2 -2
  41. package/lib/cjs/fetch.js +3 -1
  42. package/lib/cjs/helpers/deadShares.js +2 -0
  43. package/lib/cjs/midnight/errors.d.ts +2 -1
  44. package/lib/cjs/midnight/errors.js +5 -4
  45. package/lib/cjs/types/action.d.ts +11 -4
  46. package/lib/cjs/types/action.js +1 -0
  47. package/lib/cjs/types/error.d.ts +8 -2
  48. package/lib/cjs/types/error.js +8 -2
  49. package/lib/cjs/utils.d.ts +2 -2
  50. package/lib/cjs/utils.js +4 -2
  51. package/lib/esm/abis.d.ts +1 -1
  52. package/lib/esm/abis.js +1 -1
  53. package/lib/esm/actions/bundles/resolveBundlesTokenRequirements.d.ts +1 -0
  54. package/lib/esm/actions/requirements/encode/encodeErc20Permit.d.ts +4 -1
  55. package/lib/esm/actions/requirements/encode/encodeErc20Permit.js +4 -1
  56. package/lib/esm/actions/requirements/encode/encodeErc20Permit2SignatureTransfer.d.ts +5 -1
  57. package/lib/esm/actions/requirements/encode/encodeErc20Permit2SignatureTransfer.js +1 -0
  58. package/lib/esm/blue/abis.d.ts +1 -1
  59. package/lib/esm/blue/abis.js +1 -1
  60. package/lib/esm/blue/entities.d.ts +4 -4
  61. package/lib/esm/blue/entities.js +2 -2
  62. package/lib/esm/blue/errors.d.ts +2 -2
  63. package/lib/esm/blue/errors.js +2 -2
  64. package/lib/esm/blue/fetch.d.ts +2 -2
  65. package/lib/esm/blue/fetch.js +2 -2
  66. package/lib/esm/blue/utils.d.ts +1 -1
  67. package/lib/esm/blue/utils.js +1 -1
  68. package/lib/esm/client/morphoViemExtension.d.ts +1 -1
  69. package/lib/esm/client/morphoViemExtension.js +1 -1
  70. package/lib/esm/entities/blue/blue.d.ts +7 -21
  71. package/lib/esm/entities/blue/blue.js +4 -22
  72. package/lib/esm/entities/index.d.ts +4 -4
  73. package/lib/esm/entities/index.js +2 -2
  74. package/lib/esm/entities/requirements/getBundlesTokenRequirements.d.ts +21 -26
  75. package/lib/esm/entities/requirements/getBundlesTokenRequirements.js +44 -82
  76. package/lib/esm/entities/requirements/getUnusedPermit2Nonce.d.ts +6 -3
  77. package/lib/esm/entities/requirements/getUnusedPermit2Nonce.js +2 -2
  78. package/lib/esm/entities/vaultV1/vaultV1.d.ts +5 -11
  79. package/lib/esm/entities/vaultV1/vaultV1.js +4 -12
  80. package/lib/esm/entities/vaultV2/vaultV2.d.ts +37 -18
  81. package/lib/esm/entities/vaultV2/vaultV2.js +37 -13
  82. package/lib/esm/entities/vaultV2BlueReallocationData.d.ts +8 -3
  83. package/lib/esm/entities/vaultV2BlueReallocationData.js +49 -7
  84. package/lib/esm/errors.d.ts +4 -4
  85. package/lib/esm/errors.js +4 -4
  86. package/lib/esm/fetch.d.ts +2 -2
  87. package/lib/esm/fetch.js +2 -2
  88. package/lib/esm/helpers/deadShares.js +3 -1
  89. package/lib/esm/midnight/errors.d.ts +2 -1
  90. package/lib/esm/midnight/errors.js +2 -1
  91. package/lib/esm/types/action.d.ts +11 -4
  92. package/lib/esm/types/action.js +1 -0
  93. package/lib/esm/types/error.d.ts +8 -2
  94. package/lib/esm/types/error.js +8 -2
  95. package/lib/esm/utils.d.ts +2 -2
  96. package/lib/esm/utils.js +2 -2
  97. package/package.json +6 -6
@@ -87,6 +87,10 @@ const cloneAccrualVault = (vault, markets) => new AccrualVault({
87
87
  position: clonePosition(position, markets),
88
88
  })));
89
89
  const cloneAdapter = (adapter, markets) => {
90
+ // BluePublicAllocator never moves Midnight liquidity, and reallocation never mutates a Midnight
91
+ // adapter, so its read-only snapshot is shared as-is.
92
+ if (adapter.type === "VaultV2MidnightAdapter")
93
+ return adapter;
90
94
  const base = {
91
95
  address: adapter.address,
92
96
  parentVault: adapter.parentVault,
@@ -134,8 +138,9 @@ const cloneVault = (vault, { markets, adapterKeysToClone, }) => {
134
138
  /**
135
139
  * Immutable-by-convention state container for Vault V2 BluePublicAllocator simulations.
136
140
  *
137
- * Constructor inputs are cloned. Every simulated reallocation returns a new
138
- * instance. Planning keeps the transaction-scoped `firstTotalAssets`
141
+ * Constructor inputs are cloned, except Midnight adapter snapshots: those are
142
+ * shared by reference and must be treated as read-only. Every simulated
143
+ * reallocation returns a new instance. Planning keeps the transaction-scoped `firstTotalAssets`
139
144
  * denominator outside the durable snapshot while applying reallocations in
140
145
  * contract order. Penalty donations update simulated vault accounting but are
141
146
  * excluded from same-plan idle liquidity so round-up dust cannot create
@@ -279,7 +284,8 @@ export class VaultV2BlueReallocationData {
279
284
  /**
280
285
  * Clones the complete simulation snapshot.
281
286
  *
282
- * @returns A deep clone of this simulation state.
287
+ * @returns A deep clone of this simulation state. Midnight adapter snapshots are
288
+ * shared by reference and must be treated as read-only.
283
289
  * @example
284
290
  * ```ts
285
291
  * import { markets } from "@morpho-org/morpho-test";
@@ -651,6 +657,9 @@ export class VaultV2BlueReallocationData {
651
657
  * Full-liquidity discovery omits a candidate when its non-shared maximum
652
658
  * violates a shared cap instead of scanning smaller base-unit amounts. These
653
659
  * bounds can understate executable liquidity in rounding-only edge cases.
660
+ * With an explicit Blue balance, a paid operation may retry the same search
661
+ * from a physical-funding budget and keep a strictly cheaper feasible plan.
662
+ * This bounded refinement does not guarantee globally minimal penalties.
654
663
  *
655
664
  * @param marketId - Target Blue market id.
656
665
  * @param options - Optional discovery controls and operation to support.
@@ -805,7 +814,7 @@ export class VaultV2BlueReallocationData {
805
814
  ? [config.penalty]
806
815
  : [])),
807
816
  ].sort(bigIntComparator((tier) => tier));
808
- const plan = (maxAssets, headroom) => {
817
+ const plan = (maxAssets, { headroom, usePhysicalBalance = false, }) => {
809
818
  let reserves = createCapReserveState(this.mutableMarkets);
810
819
  const reallocations = [];
811
820
  let data = this.clone();
@@ -829,6 +838,19 @@ export class VaultV2BlueReallocationData {
829
838
  : isFreeFriendlyPass
830
839
  ? maxAssets
831
840
  : remainingShortfall;
841
+ if (usePhysicalBalance && penalty > 0n) {
842
+ const penaltyMultiplier = type === "refinance" ? 2n : 1n;
843
+ const physicalPenalty = penaltyMultiplier * penalty;
844
+ if (physicalPenalty < MathLib.WAD) {
845
+ const idleAssets = reallocations.reduce((total, { from, assets }) => from.type === "idle" ? total + assets : total, 0n);
846
+ // Idle must fund both the operation and its penalty flash loan.
847
+ const physicalShortfall = MathLib.zeroFloorSub(amount +
848
+ feeAssets +
849
+ penaltyMultiplier *
850
+ getBlueBundlesV1PenaltyAssets(reallocations), blueBalance + idleAssets);
851
+ passMaxAssets = MathLib.max(passMaxAssets, MathLib.mulDivUp(physicalShortfall, MathLib.WAD, MathLib.WAD - physicalPenalty));
852
+ }
853
+ }
832
854
  const retryPaidPass = penalty > 0n;
833
855
  let lo = retryPaidPass ? passMaxAssets - 1n : 0n;
834
856
  let tryFullCapacityAttempt = false;
@@ -1019,6 +1041,8 @@ export class VaultV2BlueReallocationData {
1019
1041
  ? reallocatedAssets >= absoluteShortfall + penaltyAssets
1020
1042
  : reallocatedAssets >= absoluteShortfall;
1021
1043
  return {
1044
+ maxAssets,
1045
+ headroom,
1022
1046
  reallocations,
1023
1047
  data,
1024
1048
  liquidityBound: allocatorCapBoundTargets.size > 0 || idleBoundVaults.size > 0,
@@ -1035,12 +1059,12 @@ export class VaultV2BlueReallocationData {
1035
1059
  // (nearly) all of a source vault's starting idle, revert once another
1036
1060
  // allocation lands first. A bound plan therefore moves only the operation's
1037
1061
  // shortfall, or what unbound legs moved.
1038
- const target = plan(requiredAssets, allocatorCapHeadroom);
1062
+ const target = plan(requiredAssets, { headroom: allocatorCapHeadroom });
1039
1063
  let selected = target;
1040
1064
  if (allocatorCapHeadroom > 0n && target.liquidityBound) {
1041
1065
  selected = plan(absoluteShortfall > target.unboundAssets
1042
1066
  ? absoluteShortfall
1043
- : target.unboundAssets, allocatorCapHeadroom);
1067
+ : target.unboundAssets, { headroom: allocatorCapHeadroom });
1044
1068
  // Shared-cap fitting is not monotonic in the budget.
1045
1069
  if (!selected.coversShortfall && target.coversShortfall)
1046
1070
  selected = target;
@@ -1051,7 +1075,7 @@ export class VaultV2BlueReallocationData {
1051
1075
  for (const maxAssets of fullCapBudgets) {
1052
1076
  if (selected.coversShortfall)
1053
1077
  break;
1054
- selected = plan(maxAssets, 0n);
1078
+ selected = plan(maxAssets, { headroom: 0n });
1055
1079
  if (selected.reallocatedAssets > available)
1056
1080
  available = selected.reallocatedAssets;
1057
1081
  }
@@ -1083,6 +1107,24 @@ export class VaultV2BlueReallocationData {
1083
1107
  available,
1084
1108
  });
1085
1109
  }
1110
+ const selectedPenaltyAssets = getBlueBundlesV1PenaltyAssets(selected.reallocations);
1111
+ if (hasExplicitBlueBalance &&
1112
+ selectedPenaltyAssets > 1n &&
1113
+ blueBalance <
1114
+ amount +
1115
+ feeAssets +
1116
+ (type === "refinance" ? 2n : 1n) * selectedPenaltyAssets) {
1117
+ // Amount feasibility is not monotonic: retain the original plan unless
1118
+ // the physical-balance seed finds a fully funded, strictly cheaper one.
1119
+ const alternative = plan(selected.maxAssets, {
1120
+ headroom: selected.headroom,
1121
+ usePhysicalBalance: true,
1122
+ });
1123
+ if (alternative.coversShortfall &&
1124
+ getBlueBundlesV1PenaltyAssets(alternative.reallocations) <
1125
+ getBlueBundlesV1PenaltyAssets(selected.reallocations))
1126
+ selected = alternative;
1127
+ }
1086
1128
  return { reallocations: selected.reallocations, data: selected.data };
1087
1129
  }
1088
1130
  computeVaultV2BlueReallocationsAtUtilizationInPlace({ context, reserves, marketId, maxWithdrawalUtilization, maxAssets, capAccrualBuffer, allocatorCapHeadroom = 0n, penalty, options = {}, }) {
@@ -1,7 +1,7 @@
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,
1
+ export { BlueErrors, IncompleteChainRegistryError, InvalidMarketParamsError as InvalidBlueMarketParamsError, InvalidVaultV2MidnightAdapterMarketsError as InvalidBlueVaultV2MidnightAdapterMarketsError, 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, 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";
4
+ export { getUnsupportedVaultV2Adapter as getBlueUnsupportedVaultV2Adapter, InvalidNumberError, InvalidPermitDomainChainIdError, InvalidPermitDomainVerifyingContractError, isUnknownOfFactoryError as isBlueUnknownOfFactoryError, MalformedTokenMetadataError, MarketParamsIdMismatchError as BlueMarketParamsIdMismatchError, MissingPermitDomainNameError, NonTupleReturnValueError, Permit2ExpirationOutOfRangeError, UnknownAbiFunctionError, UnnamedAbiOutputsError, UnresolvedBlockNumberError, 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, 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, NegativeValueError, RegistryValueAlreadyRegisteredError, RetriesExhaustedError, RetryStoppedError, } from "@morpho-org/morpho-ts";
7
+ export { _try, DivisionByZeroError, InvalidAddressError, InvalidBitLengthError, InvalidPositionAccrualStateError as InvalidMidnightPositionAccrualStateError, InvalidPositionAccrualTimestampError as InvalidMidnightPositionAccrualTimestampError, InvalidPositionLossFactorError as InvalidMidnightPositionLossFactorError, NegativeValueError, RegistryValueAlreadyRegisteredError, RetriesExhaustedError, RetryStoppedError, } from "@morpho-org/morpho-ts";
package/lib/esm/errors.js CHANGED
@@ -1,6 +1,6 @@
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,
1
+ export { BlueErrors, IncompleteChainRegistryError, InvalidMarketParamsError as InvalidBlueMarketParamsError, InvalidVaultV2MidnightAdapterMarketsError as InvalidBlueVaultV2MidnightAdapterMarketsError, 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, 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, RetriesExhaustedError, RetryStoppedError, } from "@morpho-org/morpho-ts";
4
+ export { getUnsupportedVaultV2Adapter as getBlueUnsupportedVaultV2Adapter, InvalidNumberError, InvalidPermitDomainChainIdError, InvalidPermitDomainVerifyingContractError, isUnknownOfFactoryError as isBlueUnknownOfFactoryError, MalformedTokenMetadataError, MarketParamsIdMismatchError as BlueMarketParamsIdMismatchError, MissingPermitDomainNameError, NonTupleReturnValueError, Permit2ExpirationOutOfRangeError, UnknownAbiFunctionError, UnnamedAbiOutputsError, UnresolvedBlockNumberError, 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, 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, InvalidPositionAccrualStateError as InvalidMidnightPositionAccrualStateError, InvalidPositionAccrualTimestampError as InvalidMidnightPositionAccrualTimestampError, InvalidPositionLossFactorError as InvalidMidnightPositionLossFactorError, NegativeValueError, RegistryValueAlreadyRegisteredError, RetriesExhaustedError, RetryStoppedError, } from "@morpho-org/morpho-ts";
@@ -1,6 +1,6 @@
1
- export { fetchAccrualPosition as fetchBlueAccrualPosition, fetchAccrualVault, fetchAccrualVaultV2, fetchAccrualVaultV2Adapter, fetchAccrualVaultV2MorphoMarketV1Adapter, fetchAccrualVaultV2MorphoMarketV1AdapterV2, fetchAccrualVaultV2MorphoVaultV1Adapter, fetchHolding, fetchMarket as fetchBlueMarket, fetchMarketParams as fetchBlueMarketParams, fetchPosition as fetchBluePosition,
1
+ export { fetchAccrualPosition as fetchBlueAccrualPosition, fetchAccrualVault, fetchAccrualVaultV2, fetchAccrualVaultV2Adapter, fetchAccrualVaultV2MidnightAdapter, 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, fetchVaultV2MorphoMarketV1Adapter, fetchVaultV2MorphoMarketV1AdapterV2, fetchVaultV2MorphoVaultV1Adapter, } from "@morpho-org/blue-sdk-viem";
5
+ fetchPreLiquidationPosition as fetchBluePreLiquidationPosition, fetchToken, fetchUser as fetchBlueUser, fetchVault, fetchVaultConfig, fetchVaultMarketAllocation, fetchVaultMarketConfig, fetchVaultUser, fetchVaultV2, fetchVaultV2Adapter, fetchVaultV2BlueMarketPublicAllocatorConfig, fetchVaultV2BluePublicAllocatorConfig, fetchVaultV2BluePublicAllocatorData, fetchVaultV2MidnightAdapter, 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, fetchAccrualVaultV2MorphoMarketV1Adapter, fetchAccrualVaultV2MorphoMarketV1AdapterV2, fetchAccrualVaultV2MorphoVaultV1Adapter, fetchHolding, fetchMarket as fetchBlueMarket, fetchMarketParams as fetchBlueMarketParams, fetchPosition as fetchBluePosition,
1
+ export { fetchAccrualPosition as fetchBlueAccrualPosition, fetchAccrualVault, fetchAccrualVaultV2, fetchAccrualVaultV2Adapter, fetchAccrualVaultV2MidnightAdapter, 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, fetchVaultV2MorphoMarketV1Adapter, fetchVaultV2MorphoMarketV1AdapterV2, fetchVaultV2MorphoVaultV1Adapter, } from "@morpho-org/blue-sdk-viem";
5
+ fetchPreLiquidationPosition as fetchBluePreLiquidationPosition, fetchToken, fetchUser as fetchBlueUser, fetchVault, fetchVaultConfig, fetchVaultMarketAllocation, fetchVaultMarketConfig, fetchVaultUser, fetchVaultV2, fetchVaultV2Adapter, fetchVaultV2BlueMarketPublicAllocatorConfig, fetchVaultV2BluePublicAllocatorConfig, fetchVaultV2BluePublicAllocatorData, fetchVaultV2MidnightAdapter, 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";
@@ -1,4 +1,4 @@
1
- import { AccrualVaultV2MorphoMarketV1Adapter, AccrualVaultV2MorphoMarketV1AdapterV2, AccrualVaultV2MorphoVaultV1Adapter, MarketParams, VaultV2MorphoMarketV1Adapter, VaultV2MorphoMarketV1AdapterV2, VaultV2MorphoVaultV1Adapter, } from "@morpho-org/blue-sdk";
1
+ import { AccrualVaultV2MidnightAdapter, AccrualVaultV2MorphoMarketV1Adapter, AccrualVaultV2MorphoMarketV1AdapterV2, AccrualVaultV2MorphoVaultV1Adapter, MarketParams, VaultV2MorphoMarketV1Adapter, VaultV2MorphoMarketV1AdapterV2, VaultV2MorphoVaultV1Adapter, } from "@morpho-org/blue-sdk";
2
2
  import { InsufficientDeadSharesError, MissingDeadSharesDataError, } from "../types/error.js";
3
3
  import { MIN_DEAD_SHARES, MIN_VAULT_V2_DEAD_ASSETS } from "./constant.js";
4
4
  /**
@@ -151,6 +151,8 @@ export function validateVaultV2DeadShares(vault, path = []) {
151
151
  return cap;
152
152
  };
153
153
  for (const adapter of vault.accrualAdapters) {
154
+ if (adapter instanceof AccrualVaultV2MidnightAdapter)
155
+ continue;
154
156
  if (adapter instanceof AccrualVaultV2MorphoVaultV1Adapter) {
155
157
  const id = VaultV2MorphoVaultV1Adapter.adapterCapId(adapter.address);
156
158
  if (capOf(id, adapter.address) > 0n)
@@ -1 +1,2 @@
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
+ 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 +1,2 @@
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
+ 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";
@@ -548,9 +548,9 @@ export type BundlesFundingArgs = {
548
548
  };
549
549
  /** Controls token requirements generated for a bundles-funded action. */
550
550
  export interface BundlesTokenRequirementsOptions {
551
- /** Prefer ERC-2612 when the funded token exposes a compatible nonce. */
551
+ /** Prefer ERC-2612 when the funded token exposes a compatible nonce; defaults to true when signatures are supported. */
552
552
  readonly useSimplePermit?: boolean;
553
- /** Explicit unused Permit2 SignatureTransfer unordered nonce; defaults to the lowest unused nonce. */
553
+ /** @deprecated Ignored. The SDK no longer requests Permit2 funding; use ERC-2612 permits or ERC-20 approvals. */
554
554
  readonly permit2Nonce?: bigint;
555
555
  }
556
556
  /** Mutually exclusive source amount accepted by a Vault V1 to Vault V2 migration. */
@@ -612,7 +612,10 @@ export interface PermitAction extends BaseAction<"permit", {
612
612
  */
613
613
  readonly typedData?: RequirementTypedData;
614
614
  }
615
- /** Signable Permit2 SignatureTransfer requirement for a fixed bundles token pull. */
615
+ /**
616
+ * Signable Permit2 SignatureTransfer requirement for a fixed bundles token pull.
617
+ * @deprecated The SDK no longer requests Permit2 funding; use ERC-2612 permits or ERC-20 approvals.
618
+ */
616
619
  export interface Permit2SignatureTransferAction extends BaseAction<"permit2SignatureTransfer", {
617
620
  readonly spender: Address;
618
621
  readonly amount: bigint;
@@ -644,7 +647,10 @@ export interface Erc2612RequirementSignature {
644
647
  }
645
648
  /** A signed ERC-2612 permit requirement accepted by vault-share bundle calls. */
646
649
  export type PermitRequirementSignature = Erc2612RequirementSignature;
647
- /** A signed Permit2 SignatureTransfer requirement used by fixed bundles contracts. */
650
+ /**
651
+ * A signed Permit2 SignatureTransfer requirement used by fixed bundles contracts.
652
+ * @deprecated The SDK no longer requests Permit2 funding; use ERC-2612 permits or ERC-20 approvals.
653
+ */
648
654
  export interface Permit2SignatureTransferRequirementSignature {
649
655
  readonly args: Readonly<PermitArgs>;
650
656
  readonly action: Permit2SignatureTransferAction;
@@ -874,6 +880,7 @@ export declare function isPermitSignature(signature: RequirementSignature): sign
874
880
  * const getPermit2Nonce = (signature: RequirementSignature): bigint | undefined =>
875
881
  * isPermit2SignatureTransferSignature(signature) ? signature.args.nonce : undefined;
876
882
  * ```
883
+ * @deprecated The SDK no longer requests Permit2 funding; use ERC-2612 permits or ERC-20 approvals.
877
884
  */
878
885
  export declare function isPermit2SignatureTransferSignature(signature: RequirementSignature): signature is Permit2SignatureTransferRequirementSignature;
879
886
  /**
@@ -156,6 +156,7 @@ export function isPermitSignature(signature) {
156
156
  * const getPermit2Nonce = (signature: RequirementSignature): bigint | undefined =>
157
157
  * isPermit2SignatureTransferSignature(signature) ? signature.args.nonce : undefined;
158
158
  * ```
159
+ * @deprecated The SDK no longer requests Permit2 funding; use ERC-2612 permits or ERC-20 approvals.
159
160
  */
160
161
  export function isPermit2SignatureTransferSignature(signature) {
161
162
  return signature.action.type === "permit2SignatureTransfer";
@@ -538,7 +538,10 @@ export declare class BundlesRequirementSignatureMismatchError extends Error {
538
538
  cause?: unknown;
539
539
  });
540
540
  }
541
- /** Thrown when an explicit Permit2 SignatureTransfer unordered nonce is already consumed. */
541
+ /**
542
+ * Thrown when an explicit Permit2 SignatureTransfer unordered nonce is already consumed.
543
+ * @deprecated The SDK no longer requests Permit2 funding; use ERC-2612 permits or ERC-20 approvals.
544
+ */
542
545
  export declare class Permit2SignatureTransferNonceAlreadyUsedError extends Error {
543
546
  readonly owner: Address;
544
547
  readonly nonce: bigint;
@@ -548,7 +551,10 @@ export declare class Permit2SignatureTransferNonceAlreadyUsedError extends Error
548
551
  */
549
552
  constructor(owner: Address, nonce: bigint);
550
553
  }
551
- /** Thrown when no unused Permit2 unordered nonce exists at or after the requested start nonce. */
554
+ /**
555
+ * Thrown when no unused Permit2 unordered nonce exists at or after the requested start nonce.
556
+ * @deprecated The SDK no longer requests Permit2 funding; use ERC-2612 permits or ERC-20 approvals.
557
+ */
552
558
  export declare class NoUnusedPermit2NonceError extends Error {
553
559
  readonly owner: Address;
554
560
  readonly startNonce: bigint;
@@ -600,7 +600,10 @@ export class BundlesRequirementSignatureMismatchError extends Error {
600
600
  this.name = "BundlesRequirementSignatureMismatchError";
601
601
  }
602
602
  }
603
- /** Thrown when an explicit Permit2 SignatureTransfer unordered nonce is already consumed. */
603
+ /**
604
+ * Thrown when an explicit Permit2 SignatureTransfer unordered nonce is already consumed.
605
+ * @deprecated The SDK no longer requests Permit2 funding; use ERC-2612 permits or ERC-20 approvals.
606
+ */
604
607
  export class Permit2SignatureTransferNonceAlreadyUsedError extends Error {
605
608
  owner;
606
609
  nonce;
@@ -615,7 +618,10 @@ export class Permit2SignatureTransferNonceAlreadyUsedError extends Error {
615
618
  this.name = "Permit2SignatureTransferNonceAlreadyUsedError";
616
619
  }
617
620
  }
618
- /** Thrown when no unused Permit2 unordered nonce exists at or after the requested start nonce. */
621
+ /**
622
+ * Thrown when no unused Permit2 unordered nonce exists at or after the requested start nonce.
623
+ * @deprecated The SDK no longer requests Permit2 funding; use ERC-2612 permits or ERC-20 approvals.
624
+ */
619
625
  export class NoUnusedPermit2NonceError extends Error {
620
626
  owner;
621
627
  startNonce;
@@ -3,7 +3,7 @@ export { AdaptiveCurveIrmLib as BlueAdaptiveCurveIrmLib, CapacityLimitReason,
3
3
  /** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
4
4
  defaultPreLiquidationParamsRegistry as blueDefaultPreLiquidationParamsRegistry,
5
5
  /** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
6
- getDefaultPreLiquidationParams as getBlueDefaultPreLiquidationParams, MarketUtils as BlueMarketUtils, MathLib, SharesMath as BlueSharesMath, VaultUtils, VaultV2BlueMarketPublicAllocatorConfigUtils, VaultV2BluePublicAllocatorConfigUtils, VaultV2Utils, } from "@morpho-org/blue-sdk";
6
+ getDefaultPreLiquidationParams as getBlueDefaultPreLiquidationParams, MarketUtils as BlueMarketUtils, MathLib, SharesMath as BlueSharesMath, VaultUtils, VaultV2BlueMarketPublicAllocatorConfigUtils, VaultV2BluePublicAllocatorConfigUtils, VaultV2MidnightAdapterUtils, VaultV2Utils, } from "@morpho-org/blue-sdk";
7
7
  export { catchRevertOnly, decodeBytes32String, getAuthorizationTypedData as getBlueAuthorizationTypedData, getPermit2PermitTypedData, getPermit2TransferFromTypedData, getPermitTypedData, isContractRevertError, isTransportError, isUndecodableResultError, MetaMorphoAction as BlueMetaMorphoAction, optionalBoolean, readContractRestructured, restructure, safeGetAddress, safeParseNumber, safeParseUnits, } from "@morpho-org/blue-sdk-viem";
8
8
  export { EcrecoverRatifier as MidnightEcrecoverRatifier,
9
9
  /** @deprecated Use MidnightEcrecoverRatifier with a tagged tree. */
@@ -17,7 +17,7 @@ RatifierUtils as MidnightRatifierUtils, SetterRatifier as MidnightSetterRatifier
17
17
  /** @deprecated Use MidnightSetterRatifier with a tagged tree. */
18
18
  SetterRatifierUtils as MidnightSetterRatifierUtils, TakeAmountsLib as MidnightTakeAmountsLib, TickLib as MidnightTickLib, TreeUtils as MidnightTreeUtils, } from "@morpho-org/midnight-sdk";
19
19
  export type { ArrayElementType, DeepPartial, DottedKeys, FieldType, PartialDottedKeys, } from "@morpho-org/morpho-ts";
20
- export { bigIntComparator, createGetValue, createHasValue, deepFreeze, entries, filterDefined, fromEntries, getLast, getLastDefined, getSubdomainBaseUrl, getValue, hasValue, isDefined, isNotNull, isNotUndefined, keys, mergeEntries, retryPromiseLinearBackoff, Time, transformValue, values, } from "@morpho-org/morpho-ts";
20
+ export { bigIntComparator, createGetValue, createHasValue, deepFreeze, entries, filterDefined, fromEntries, getLast, getLastDefined, getSubdomainBaseUrl, getValue, hasValue, isDefined, isNotNull, isNotUndefined, keys, MidnightPositionLib, mergeEntries, retryPromiseLinearBackoff, Time, transformValue, values, } from "@morpho-org/morpho-ts";
21
21
  export { validateClientChainId } from "./actions/requirements/validateClientChainId.js";
22
22
  export { addTransactionMetadata } from "./helpers/metadata.js";
23
23
  export { type PreviewVaultV2ForceWithdrawParams, previewVaultV2ForceWithdraw, type VaultV2ForceWithdrawPreview, } from "./helpers/previewVaultV2ForceWithdraw.js";
package/lib/esm/utils.js CHANGED
@@ -2,7 +2,7 @@ export { AdaptiveCurveIrmLib as BlueAdaptiveCurveIrmLib, CapacityLimitReason,
2
2
  /** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
3
3
  defaultPreLiquidationParamsRegistry as blueDefaultPreLiquidationParamsRegistry,
4
4
  /** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
5
- getDefaultPreLiquidationParams as getBlueDefaultPreLiquidationParams, MarketUtils as BlueMarketUtils, MathLib, SharesMath as BlueSharesMath, VaultUtils, VaultV2BlueMarketPublicAllocatorConfigUtils, VaultV2BluePublicAllocatorConfigUtils, VaultV2Utils, } from "@morpho-org/blue-sdk";
5
+ getDefaultPreLiquidationParams as getBlueDefaultPreLiquidationParams, MarketUtils as BlueMarketUtils, MathLib, SharesMath as BlueSharesMath, VaultUtils, VaultV2BlueMarketPublicAllocatorConfigUtils, VaultV2BluePublicAllocatorConfigUtils, VaultV2MidnightAdapterUtils, VaultV2Utils, } from "@morpho-org/blue-sdk";
6
6
  export { catchRevertOnly, decodeBytes32String, getAuthorizationTypedData as getBlueAuthorizationTypedData, getPermit2PermitTypedData, getPermit2TransferFromTypedData, getPermitTypedData, isContractRevertError, isTransportError, isUndecodableResultError, MetaMorphoAction as BlueMetaMorphoAction, optionalBoolean, readContractRestructured, restructure, safeGetAddress, safeParseNumber, safeParseUnits, } from "@morpho-org/blue-sdk-viem";
7
7
  export { EcrecoverRatifier as MidnightEcrecoverRatifier,
8
8
  /** @deprecated Use MidnightEcrecoverRatifier with a tagged tree. */
@@ -15,7 +15,7 @@ RateRatifierV1Utils as MidnightRateRatifierV1Utils, Ratifier as MidnightRatifier
15
15
  RatifierUtils as MidnightRatifierUtils, SetterRatifier as MidnightSetterRatifier,
16
16
  /** @deprecated Use MidnightSetterRatifier with a tagged tree. */
17
17
  SetterRatifierUtils as MidnightSetterRatifierUtils, TakeAmountsLib as MidnightTakeAmountsLib, TickLib as MidnightTickLib, TreeUtils as MidnightTreeUtils, } from "@morpho-org/midnight-sdk";
18
- export { bigIntComparator, createGetValue, createHasValue, deepFreeze, entries, filterDefined, fromEntries, getLast, getLastDefined, getSubdomainBaseUrl, getValue, hasValue, isDefined, isNotNull, isNotUndefined, keys, mergeEntries, retryPromiseLinearBackoff, Time, transformValue, values, } from "@morpho-org/morpho-ts";
18
+ export { bigIntComparator, createGetValue, createHasValue, deepFreeze, entries, filterDefined, fromEntries, getLast, getLastDefined, getSubdomainBaseUrl, getValue, hasValue, isDefined, isNotNull, isNotUndefined, keys, MidnightPositionLib, mergeEntries, retryPromiseLinearBackoff, Time, transformValue, values, } from "@morpho-org/morpho-ts";
19
19
  export { validateClientChainId } from "./actions/requirements/validateClientChainId.js";
20
20
  export { addTransactionMetadata } from "./helpers/metadata.js";
21
21
  export { previewVaultV2ForceWithdraw, } from "./helpers/previewVaultV2ForceWithdraw.js";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@morpho-org/morpho-sdk",
3
3
  "description": "Abstraction layer for Morpho's complexity.",
4
- "version": "9.4.0",
4
+ "version": "9.6.0-next.0",
5
5
  "author": "Morpho Association <contact@morpho.org>",
6
6
  "repository": {
7
7
  "type": "git",
@@ -154,17 +154,17 @@
154
154
  "DEAD-SHARE-PROTECTION.md"
155
155
  ],
156
156
  "dependencies": {
157
- "@morpho-org/blue-sdk": "^8.2.0",
158
- "@morpho-org/blue-sdk-viem": "^7.3.0",
159
- "@morpho-org/midnight-sdk": "^2.4.0",
160
- "@morpho-org/morpho-ts": "^4.2.0"
157
+ "@morpho-org/blue-sdk": "^8.3.0-next.0",
158
+ "@morpho-org/blue-sdk-viem": "^7.4.0-next.0",
159
+ "@morpho-org/midnight-sdk": "^2.5.0-next.0",
160
+ "@morpho-org/morpho-ts": "^4.3.0-next.0"
161
161
  },
162
162
  "peerDependencies": {
163
163
  "viem": "^2.0.0"
164
164
  },
165
165
  "devDependencies": {
166
166
  "@morpho-org/morpho-test": "^4.2.0",
167
- "@morpho-org/test": "^2.12.0",
167
+ "@morpho-org/test": "^2.13.0-next.1",
168
168
  "fast-check": "^4.9.0",
169
169
  "typescript": "7.0.2",
170
170
  "viem": "^2.55.10",