@morpho-org/morpho-sdk 5.6.0 → 5.7.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 (112) hide show
  1. package/README.md +3 -1
  2. package/lib/cjs/abis.d.ts +15 -3
  3. package/lib/cjs/abis.js +13 -1
  4. package/lib/cjs/actions/midnight/mempoolSubmitOffers.d.ts +2 -2
  5. package/lib/cjs/actions/midnight/mempoolSubmitOffers.js +2 -2
  6. package/lib/cjs/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit2.d.ts +1 -1
  7. package/lib/cjs/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit2.js +1 -1
  8. package/lib/cjs/blue/abis.d.ts +2 -0
  9. package/lib/cjs/blue/abis.js +33 -0
  10. package/lib/cjs/blue/addresses.d.ts +2 -0
  11. package/lib/cjs/blue/addresses.js +19 -0
  12. package/lib/cjs/blue/constants.d.ts +1 -0
  13. package/lib/cjs/blue/constants.js +13 -0
  14. package/lib/cjs/blue/entities.d.ts +2 -0
  15. package/lib/cjs/blue/entities.js +37 -0
  16. package/lib/cjs/blue/errors.d.ts +2 -0
  17. package/lib/cjs/blue/errors.js +29 -0
  18. package/lib/cjs/blue/fetch.d.ts +1 -0
  19. package/lib/cjs/blue/fetch.js +33 -0
  20. package/lib/cjs/blue/types.d.ts +2 -0
  21. package/lib/cjs/blue/types.js +2 -0
  22. package/lib/cjs/blue/utils.d.ts +3 -0
  23. package/lib/cjs/blue/utils.js +29 -0
  24. package/lib/cjs/bundler/actions.d.ts +10 -8
  25. package/lib/cjs/bundler/actions.js +10 -8
  26. package/lib/cjs/constants.d.ts +36 -2
  27. package/lib/cjs/constants.js +39 -1
  28. package/lib/cjs/entities/blue/blue.d.ts +8 -6
  29. package/lib/cjs/entities/blue/blue.js +4 -3
  30. package/lib/cjs/entities/index.d.ts +62 -3
  31. package/lib/cjs/entities/index.js +32 -20
  32. package/lib/cjs/entities/vaultV2BlueReallocationData.d.ts +6 -6
  33. package/lib/cjs/entities/vaultV2BlueReallocationData.js +22 -33
  34. package/lib/cjs/errors.d.ts +48 -3
  35. package/lib/cjs/errors.js +62 -1
  36. package/lib/cjs/fetch.d.ts +16 -1
  37. package/lib/cjs/fetch.js +24 -1
  38. package/lib/cjs/helpers/validate.d.ts +2 -2
  39. package/lib/cjs/helpers/validate.js +2 -2
  40. package/lib/cjs/midnight/abis.d.ts +1 -0
  41. package/lib/cjs/midnight/abis.js +8 -0
  42. package/lib/cjs/midnight/constants.d.ts +1 -0
  43. package/lib/cjs/midnight/constants.js +19 -0
  44. package/lib/cjs/midnight/entities.d.ts +2 -0
  45. package/lib/cjs/midnight/entities.js +11 -0
  46. package/lib/cjs/midnight/errors.d.ts +1 -0
  47. package/lib/cjs/midnight/errors.js +24 -0
  48. package/lib/cjs/midnight/fetch.d.ts +1 -0
  49. package/lib/cjs/midnight/fetch.js +9 -0
  50. package/lib/cjs/midnight/types.d.ts +1 -0
  51. package/lib/cjs/midnight/types.js +2 -0
  52. package/lib/cjs/midnight/utils.d.ts +1 -0
  53. package/lib/cjs/midnight/utils.js +17 -0
  54. package/lib/cjs/types.d.ts +17 -2
  55. package/lib/cjs/utils.d.ts +30 -3
  56. package/lib/cjs/utils.js +40 -2
  57. package/lib/esm/abis.d.ts +15 -3
  58. package/lib/esm/abis.js +15 -3
  59. package/lib/esm/actions/midnight/mempoolSubmitOffers.d.ts +2 -2
  60. package/lib/esm/actions/midnight/mempoolSubmitOffers.js +2 -2
  61. package/lib/esm/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit2.d.ts +1 -1
  62. package/lib/esm/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit2.js +1 -1
  63. package/lib/esm/blue/abis.d.ts +2 -0
  64. package/lib/esm/blue/abis.js +2 -0
  65. package/lib/esm/blue/addresses.d.ts +2 -0
  66. package/lib/esm/blue/addresses.js +1 -0
  67. package/lib/esm/blue/constants.d.ts +1 -0
  68. package/lib/esm/blue/constants.js +1 -0
  69. package/lib/esm/blue/entities.d.ts +2 -0
  70. package/lib/esm/blue/entities.js +1 -0
  71. package/lib/esm/blue/errors.d.ts +2 -0
  72. package/lib/esm/blue/errors.js +2 -0
  73. package/lib/esm/blue/fetch.d.ts +1 -0
  74. package/lib/esm/blue/fetch.js +1 -0
  75. package/lib/esm/blue/types.d.ts +2 -0
  76. package/lib/esm/blue/types.js +1 -0
  77. package/lib/esm/blue/utils.d.ts +3 -0
  78. package/lib/esm/blue/utils.js +2 -0
  79. package/lib/esm/bundler/actions.d.ts +10 -8
  80. package/lib/esm/bundler/actions.js +10 -8
  81. package/lib/esm/constants.d.ts +36 -2
  82. package/lib/esm/constants.js +36 -2
  83. package/lib/esm/entities/blue/blue.d.ts +8 -6
  84. package/lib/esm/entities/blue/blue.js +4 -3
  85. package/lib/esm/entities/index.d.ts +62 -3
  86. package/lib/esm/entities/index.js +17 -2
  87. package/lib/esm/entities/vaultV2BlueReallocationData.d.ts +6 -6
  88. package/lib/esm/entities/vaultV2BlueReallocationData.js +22 -33
  89. package/lib/esm/errors.d.ts +48 -3
  90. package/lib/esm/errors.js +48 -3
  91. package/lib/esm/fetch.d.ts +16 -1
  92. package/lib/esm/fetch.js +16 -1
  93. package/lib/esm/helpers/validate.d.ts +2 -2
  94. package/lib/esm/helpers/validate.js +2 -2
  95. package/lib/esm/midnight/abis.d.ts +1 -0
  96. package/lib/esm/midnight/abis.js +1 -0
  97. package/lib/esm/midnight/constants.d.ts +1 -0
  98. package/lib/esm/midnight/constants.js +1 -0
  99. package/lib/esm/midnight/entities.d.ts +2 -0
  100. package/lib/esm/midnight/entities.js +1 -0
  101. package/lib/esm/midnight/errors.d.ts +1 -0
  102. package/lib/esm/midnight/errors.js +1 -0
  103. package/lib/esm/midnight/fetch.d.ts +1 -0
  104. package/lib/esm/midnight/fetch.js +1 -0
  105. package/lib/esm/midnight/types.d.ts +1 -0
  106. package/lib/esm/midnight/types.js +1 -0
  107. package/lib/esm/midnight/utils.d.ts +1 -0
  108. package/lib/esm/midnight/utils.js +1 -0
  109. package/lib/esm/types.d.ts +17 -2
  110. package/lib/esm/utils.d.ts +30 -3
  111. package/lib/esm/utils.js +30 -3
  112. package/package.json +22 -6
@@ -3,6 +3,7 @@ import { _try, bigIntComparator } from "@morpho-org/morpho-ts";
3
3
  import { isAddressEqual } from "viem";
4
4
  import { DEFAULT_MAX_REALLOCATION_PENALTY, DEFAULT_SUPPLY_TARGET_UTILIZATION, DEFAULT_WITHDRAWAL_TARGET_UTILIZATION, MAX_REALLOCATION_PENALTY, } from "../helpers/constant.js";
5
5
  import { InputExceedsMaxError, InsufficientSharedLiquidityError, NegativeInputError, NonPositiveInputError, ReallocationAdapterSupplySharesUnderflowError, ReallocationAllocationUnderflowError, ReallocationWithdrawExceedsMarketSupplyError, UnknownReallocationActiveAdaptersError, UnknownReallocationAdapterError, UnknownReallocationAllocationError, UnknownReallocationMarketError, UnknownReallocationMarketPublicAllocatorConfigError, UnknownReallocationPublicAllocatorConfigError, UnknownReallocationVaultError, } from "../types/index.js";
6
+ const MAX_SHARED_CAP_SEARCH_STEPS = 1024n;
6
7
  /** Creates isolated transaction-scoped state for one simulation. @internal */
7
8
  const createSimulationContext = () => ({
8
9
  donatedPenaltyAssets: {},
@@ -183,7 +184,7 @@ export class VaultV2BlueReallocationData {
183
184
  * Creates a cloned Vault V2 reallocation snapshot.
184
185
  *
185
186
  * @param input - State fetched at one consistent block.
186
- * @throws {UnsupportedVaultV2AdapterError} when a vault contains an unsupported adapter type.
187
+ * @throws {UnsupportedBlueVaultV2AdapterError} when a vault contains an unsupported adapter type.
187
188
  */
188
189
  constructor(input) {
189
190
  const isClone = input instanceof VaultV2BlueReallocationData;
@@ -569,10 +570,11 @@ export class VaultV2BlueReallocationData {
569
570
  * `options.maxPenalty` are ignored. By default, only zero-penalty vaults are
570
571
  * considered.
571
572
  *
572
- * Shared-cap discovery is conservative: when the non-shared maximum violates
573
- * a shared cap, the candidate is omitted instead of scanning smaller base-unit
574
- * amounts for a rounding-only fit. This keeps planning bounded but can
575
- * understate executable liquidity in an already-at-or-over-cap snapshot.
573
+ * Shared-cap discovery is conservative. Operation planning searches at most
574
+ * 1,024 base units above its targeted amount for the nearest executable fit.
575
+ * Full-liquidity discovery omits a candidate when its non-shared maximum
576
+ * violates a shared cap instead of scanning smaller base-unit amounts. These
577
+ * bounds can understate executable liquidity in rounding-only edge cases.
576
578
  *
577
579
  * @param marketId - Target Blue market id.
578
580
  * @param options - Optional discovery controls and operation to support.
@@ -586,7 +588,6 @@ export class VaultV2BlueReallocationData {
586
588
  * @throws {UnknownReallocationActiveAdaptersError} when active-adapter state is absent for a vault.
587
589
  * @throws {UnknownReallocationMarketPublicAllocatorConfigError} when an adapter-market allocator configuration is absent.
588
590
  * @throws {UnknownReallocationAllocationError} when required allocation state is absent.
589
- * @throws {ReallocationAllocationUnderflowError} when an inconsistent allocation snapshot underflows during the final transition.
590
591
  * @throws {InsufficientSharedLiquidityError} when selected liquidity cannot cover the absolute shortfall.
591
592
  * @throws {ReallocationWithdrawExceedsMarketSupplyError} when a withdraw exceeds market supply.
592
593
  * @example
@@ -871,13 +872,9 @@ export class VaultV2BlueReallocationData {
871
872
  }), ReallocationAllocationUnderflowError, ReallocationAdapterSupplySharesUnderflowError);
872
873
  if (postTransition == null)
873
874
  return;
874
- const postVault = postTransition.data.getVault(reallocation.vault);
875
875
  // Vault V2 checks relative caps against the transient firstTotalAssets,
876
876
  // which stays fixed after the vault's first allocation in a transaction.
877
- const firstTotalAssetsKey = findAddressKey(postTransition.context.firstTotalAssets, reallocation.vault);
878
- const firstTotalAssets = (firstTotalAssetsKey == null
879
- ? undefined
880
- : postTransition.context.firstTotalAssets[firstTotalAssetsKey]) ?? postVault._totalAssets;
877
+ const { firstTotalAssets } = postTransition;
881
878
  let withinUpperBounds = true;
882
879
  let withinAllCaps = true;
883
880
  for (const id of targetIds) {
@@ -895,8 +892,7 @@ export class VaultV2BlueReallocationData {
895
892
  };
896
893
  // Non-shared target IDs impose monotonic upper bounds. Shared IDs
897
894
  // can impose lower bounds and non-monotonic rounding constraints,
898
- // so validate them after selecting the non-shared maximum. If that
899
- // maximum fails, omit the candidate instead of scanning base units.
895
+ // so validate them after selecting the non-shared maximum.
900
896
  let probeUpper = true;
901
897
  while (lower < upper) {
902
898
  const assets = probeUpper ? upper : (lower + upper + 1n) / 2n;
@@ -910,24 +906,15 @@ export class VaultV2BlueReallocationData {
910
906
  let probe = selectedAssets > 0n
911
907
  ? probeReallocation(selectedAssets)
912
908
  : undefined;
913
- if (remainingAssets != null &&
914
- selectedAssets > 0n &&
915
- probe?.withinAllCaps !== true &&
916
- lower > selectedAssets &&
917
- probeReallocation(lower)?.withinAllCaps === true) {
918
- let infeasible = selectedAssets;
919
- let feasible = lower;
920
- while (infeasible + 1n < feasible) {
921
- const midpoint = (infeasible + feasible) / 2n;
922
- if (probeReallocation(midpoint)?.withinAllCaps === true) {
923
- feasible = midpoint;
924
- }
925
- else {
926
- infeasible = midpoint;
927
- }
909
+ if (remainingAssets != null && probe?.withinAllCaps !== true) {
910
+ // Bound the base-unit scan; expose a caller ceiling if wider searches become necessary.
911
+ const searchUpper = MathLib.min(lower, selectedAssets + MAX_SHARED_CAP_SEARCH_STEPS);
912
+ while (selectedAssets > 0n &&
913
+ selectedAssets < searchUpper &&
914
+ probe?.withinAllCaps !== true) {
915
+ selectedAssets += 1n;
916
+ probe = probeReallocation(selectedAssets);
928
917
  }
929
- selectedAssets = feasible;
930
- probe = probeReallocation(selectedAssets);
931
918
  }
932
919
  if (selectedAssets > 0n && probe?.withinAllCaps === true)
933
920
  capCompatibleCandidates.push({
@@ -1144,6 +1131,7 @@ export class VaultV2BlueReallocationData {
1144
1131
  const allocationsKey = findAddressKey(data.mutableAllocations, reallocation.vault) ??
1145
1132
  reallocation.vault;
1146
1133
  const firstTotalAssetsKey = findAddressKey(context.firstTotalAssets, reallocation.vault) ?? vaultKey;
1134
+ let firstTotalAssets = context.firstTotalAssets[firstTotalAssetsKey];
1147
1135
  let nextContext = context;
1148
1136
  let vault = data.getMutableVault(vaultKey);
1149
1137
  const targetMarket = data.getMarket(targetMarketId);
@@ -1203,7 +1191,7 @@ export class VaultV2BlueReallocationData {
1203
1191
  }
1204
1192
  vault.assetBalance += reallocation.assets;
1205
1193
  }
1206
- if (context.firstTotalAssets[firstTotalAssetsKey] == null) {
1194
+ if (firstTotalAssets == null) {
1207
1195
  // Vault V2's transient firstTotalAssets tracks the first allocation in a
1208
1196
  // transaction independently from elapsed time. Later allocations must not
1209
1197
  // recompute the denominator, even if their simulated balances have changed.
@@ -1218,11 +1206,12 @@ export class VaultV2BlueReallocationData {
1218
1206
  vault = vault.accrueInterest(timestamp).vault;
1219
1207
  }
1220
1208
  data.mutableVaults[vaultKey] = vault;
1209
+ firstTotalAssets = vault._totalAssets;
1221
1210
  nextContext = {
1222
1211
  ...nextContext,
1223
1212
  firstTotalAssets: {
1224
1213
  ...nextContext.firstTotalAssets,
1225
- [firstTotalAssetsKey]: vault._totalAssets,
1214
+ [firstTotalAssetsKey]: firstTotalAssets,
1226
1215
  },
1227
1216
  };
1228
1217
  }
@@ -1257,7 +1246,7 @@ export class VaultV2BlueReallocationData {
1257
1246
  };
1258
1247
  }
1259
1248
  vault.assetBalance -= reallocation.assets;
1260
- return { data, context: nextContext };
1249
+ return { data, context: nextContext, firstTotalAssets };
1261
1250
  }
1262
1251
  /** Updates canonical markets in bulk and refreshes only dependent adapter views. */
1263
1252
  setMarkets(markets, adaptersToRefresh) {
@@ -1,4 +1,49 @@
1
- export { BlueErrors, IncompleteChainRegistryError, InvalidMarketParamsError, UnknownAddressError, UnknownDataError, UnknownFactory, UnknownMarketParamsError, UnknownOfFactory, UnknownTokenError, UnknownTokenPriceError, UnknownVaultConfigError, UnsupportedChainIdError, UnsupportedPreLiquidationParamsError, UnsupportedVaultV2AdapterError, VaultV2Errors, } from "@morpho-org/blue-sdk";
2
- export { InvalidMidnightApiResponseError, InvalidOfferGroupError, InvalidOfferParameterError, InvalidPositionAccrualStateError, InvalidPositionAccrualTimestampError, InvalidPositionLossFactorError, InvalidTickSpacingError, InvalidTreeError, InvalidTreeHeightError, MidnightApiError, MidnightMempoolValidationError, PriceGreaterThanOneError, SettlementFeeExceedsPriceError, TickOutOfRangeError, UnknownCollateralIndexError, } from "@morpho-org/midnight-sdk";
1
+ export { BlueErrors, IncompleteChainRegistryError, InvalidMarketParamsError as InvalidBlueMarketParamsError,
2
+ /** @deprecated Use InvalidBlueMarketParamsError or the raw protocol subpath. */
3
+ InvalidMarketParamsError, UnknownAddressError, UnknownDataError as UnknownBlueDataError,
4
+ /** @deprecated Use UnknownBlueDataError or the raw protocol subpath. */
5
+ UnknownDataError, UnknownFactory as UnknownBlueFactory,
6
+ /** @deprecated Use UnknownBlueFactory or the raw protocol subpath. */
7
+ UnknownFactory, UnknownMarketAllocationError as UnknownBlueMarketAllocationError, UnknownMarketParamsError as UnknownBlueMarketParamsError,
8
+ /** @deprecated Use UnknownBlueMarketParamsError or the raw protocol subpath. */
9
+ UnknownMarketParamsError, UnknownOfFactory as UnknownBlueOfFactory,
10
+ /** @deprecated Use UnknownBlueOfFactory or the raw protocol subpath. */
11
+ UnknownOfFactory, UnknownTokenError as UnknownBlueTokenError,
12
+ /** @deprecated Use UnknownBlueTokenError or the raw protocol subpath. */
13
+ UnknownTokenError, UnknownTokenPriceError as UnknownBlueTokenPriceError,
14
+ /** @deprecated Use UnknownBlueTokenPriceError or the raw protocol subpath. */
15
+ UnknownTokenPriceError, UnknownVaultConfigError as UnknownBlueVaultConfigError,
16
+ /** @deprecated Use UnknownBlueVaultConfigError or the raw protocol subpath. */
17
+ UnknownVaultConfigError, UnsupportedChainIdError, UnsupportedPreLiquidationParamsError as UnsupportedBluePreLiquidationParamsError,
18
+ /** @deprecated Use UnsupportedBluePreLiquidationParamsError or the raw protocol subpath. */
19
+ UnsupportedPreLiquidationParamsError, UnsupportedVaultV2AdapterError as UnsupportedBlueVaultV2AdapterError,
20
+ /** @deprecated Use UnsupportedBlueVaultV2AdapterError or the raw protocol subpath. */
21
+ UnsupportedVaultV2AdapterError, VaultV2Errors, } from "@morpho-org/blue-sdk";
22
+ export { getUnsupportedVaultV2Adapter as getBlueUnsupportedVaultV2Adapter, InvalidPermitDomainChainIdError, InvalidPermitDomainVerifyingContractError, isUnknownOfFactoryError as isBlueUnknownOfFactoryError, UnsupportedPermitDomainExtensionsError, } from "@morpho-org/blue-sdk-viem";
23
+ export { ChainIdMismatchError as MidnightChainIdMismatchError, InvalidEcrecoverSignatureVError as InvalidMidnightEcrecoverSignatureVError, InvalidMarketParameterError as InvalidMidnightMarketParameterError, InvalidMidnightApiResponseError, InvalidOfferGroupError as InvalidMidnightOfferGroupError,
24
+ /** @deprecated Use InvalidMidnightOfferGroupError or the raw protocol subpath. */
25
+ InvalidOfferGroupError, InvalidOfferParameterError as InvalidMidnightOfferParameterError,
26
+ /** @deprecated Use InvalidMidnightOfferParameterError or the raw protocol subpath. */
27
+ InvalidOfferParameterError, InvalidPositionAccrualStateError as InvalidMidnightPositionAccrualStateError,
28
+ /** @deprecated Use InvalidMidnightPositionAccrualStateError or the raw protocol subpath. */
29
+ InvalidPositionAccrualStateError, InvalidPositionAccrualTimestampError as InvalidMidnightPositionAccrualTimestampError,
30
+ /** @deprecated Use InvalidMidnightPositionAccrualTimestampError or the raw protocol subpath. */
31
+ InvalidPositionAccrualTimestampError, InvalidPositionLossFactorError as InvalidMidnightPositionLossFactorError,
32
+ /** @deprecated Use InvalidMidnightPositionLossFactorError or the raw protocol subpath. */
33
+ InvalidPositionLossFactorError, InvalidTickSpacingError as InvalidMidnightTickSpacingError,
34
+ /** @deprecated Use InvalidMidnightTickSpacingError or the raw protocol subpath. */
35
+ InvalidTickSpacingError, InvalidTreeError as InvalidMidnightTreeError,
36
+ /** @deprecated Use InvalidMidnightTreeError or the raw protocol subpath. */
37
+ InvalidTreeError, InvalidTreeHeightError as InvalidMidnightTreeHeightError,
38
+ /** @deprecated Use InvalidMidnightTreeHeightError or the raw protocol subpath. */
39
+ InvalidTreeHeightError, InvalidTypedDataSignatureError as InvalidMidnightTypedDataSignatureError, MidnightApiError, MidnightMempoolValidationError, PayloadDecodeError as MidnightPayloadDecodeError, PriceGreaterThanOneError as MidnightPriceGreaterThanOneError,
40
+ /** @deprecated Use MidnightPriceGreaterThanOneError or the raw protocol subpath. */
41
+ PriceGreaterThanOneError, SettlementFeeExceedsPriceError as MidnightSettlementFeeExceedsPriceError,
42
+ /** @deprecated Use MidnightSettlementFeeExceedsPriceError or the raw protocol subpath. */
43
+ SettlementFeeExceedsPriceError, TickOutOfRangeError as MidnightTickOutOfRangeError,
44
+ /** @deprecated Use MidnightTickOutOfRangeError or the raw protocol subpath. */
45
+ TickOutOfRangeError, UnknownCollateralIndexError as UnknownMidnightCollateralIndexError,
46
+ /** @deprecated Use UnknownMidnightCollateralIndexError or the raw protocol subpath. */
47
+ UnknownCollateralIndexError, } from "@morpho-org/midnight-sdk";
3
48
  export type { ErrorClass } from "@morpho-org/morpho-ts";
4
- export { _try } from "@morpho-org/morpho-ts";
49
+ export { _try, DivisionByZeroError, InvalidBitLengthError, NegativeValueError, RegistryValueAlreadyRegisteredError, } from "@morpho-org/morpho-ts";
package/lib/esm/errors.js CHANGED
@@ -1,3 +1,48 @@
1
- export { BlueErrors, IncompleteChainRegistryError, InvalidMarketParamsError, UnknownAddressError, UnknownDataError, UnknownFactory, UnknownMarketParamsError, UnknownOfFactory, UnknownTokenError, UnknownTokenPriceError, UnknownVaultConfigError, UnsupportedChainIdError, UnsupportedPreLiquidationParamsError, UnsupportedVaultV2AdapterError, VaultV2Errors, } from "@morpho-org/blue-sdk";
2
- export { InvalidMidnightApiResponseError, InvalidOfferGroupError, InvalidOfferParameterError, InvalidPositionAccrualStateError, InvalidPositionAccrualTimestampError, InvalidPositionLossFactorError, InvalidTickSpacingError, InvalidTreeError, InvalidTreeHeightError, MidnightApiError, MidnightMempoolValidationError, PriceGreaterThanOneError, SettlementFeeExceedsPriceError, TickOutOfRangeError, UnknownCollateralIndexError, } from "@morpho-org/midnight-sdk";
3
- export { _try } from "@morpho-org/morpho-ts";
1
+ export { BlueErrors, IncompleteChainRegistryError, InvalidMarketParamsError as InvalidBlueMarketParamsError,
2
+ /** @deprecated Use InvalidBlueMarketParamsError or the raw protocol subpath. */
3
+ InvalidMarketParamsError, UnknownAddressError, UnknownDataError as UnknownBlueDataError,
4
+ /** @deprecated Use UnknownBlueDataError or the raw protocol subpath. */
5
+ UnknownDataError, UnknownFactory as UnknownBlueFactory,
6
+ /** @deprecated Use UnknownBlueFactory or the raw protocol subpath. */
7
+ UnknownFactory, UnknownMarketAllocationError as UnknownBlueMarketAllocationError, UnknownMarketParamsError as UnknownBlueMarketParamsError,
8
+ /** @deprecated Use UnknownBlueMarketParamsError or the raw protocol subpath. */
9
+ UnknownMarketParamsError, UnknownOfFactory as UnknownBlueOfFactory,
10
+ /** @deprecated Use UnknownBlueOfFactory or the raw protocol subpath. */
11
+ UnknownOfFactory, UnknownTokenError as UnknownBlueTokenError,
12
+ /** @deprecated Use UnknownBlueTokenError or the raw protocol subpath. */
13
+ UnknownTokenError, UnknownTokenPriceError as UnknownBlueTokenPriceError,
14
+ /** @deprecated Use UnknownBlueTokenPriceError or the raw protocol subpath. */
15
+ UnknownTokenPriceError, UnknownVaultConfigError as UnknownBlueVaultConfigError,
16
+ /** @deprecated Use UnknownBlueVaultConfigError or the raw protocol subpath. */
17
+ UnknownVaultConfigError, UnsupportedChainIdError, UnsupportedPreLiquidationParamsError as UnsupportedBluePreLiquidationParamsError,
18
+ /** @deprecated Use UnsupportedBluePreLiquidationParamsError or the raw protocol subpath. */
19
+ UnsupportedPreLiquidationParamsError, UnsupportedVaultV2AdapterError as UnsupportedBlueVaultV2AdapterError,
20
+ /** @deprecated Use UnsupportedBlueVaultV2AdapterError or the raw protocol subpath. */
21
+ UnsupportedVaultV2AdapterError, VaultV2Errors, } from "@morpho-org/blue-sdk";
22
+ export { getUnsupportedVaultV2Adapter as getBlueUnsupportedVaultV2Adapter, InvalidPermitDomainChainIdError, InvalidPermitDomainVerifyingContractError, isUnknownOfFactoryError as isBlueUnknownOfFactoryError, UnsupportedPermitDomainExtensionsError, } from "@morpho-org/blue-sdk-viem";
23
+ export { ChainIdMismatchError as MidnightChainIdMismatchError, InvalidEcrecoverSignatureVError as InvalidMidnightEcrecoverSignatureVError, InvalidMarketParameterError as InvalidMidnightMarketParameterError, InvalidMidnightApiResponseError, InvalidOfferGroupError as InvalidMidnightOfferGroupError,
24
+ /** @deprecated Use InvalidMidnightOfferGroupError or the raw protocol subpath. */
25
+ InvalidOfferGroupError, InvalidOfferParameterError as InvalidMidnightOfferParameterError,
26
+ /** @deprecated Use InvalidMidnightOfferParameterError or the raw protocol subpath. */
27
+ InvalidOfferParameterError, InvalidPositionAccrualStateError as InvalidMidnightPositionAccrualStateError,
28
+ /** @deprecated Use InvalidMidnightPositionAccrualStateError or the raw protocol subpath. */
29
+ InvalidPositionAccrualStateError, InvalidPositionAccrualTimestampError as InvalidMidnightPositionAccrualTimestampError,
30
+ /** @deprecated Use InvalidMidnightPositionAccrualTimestampError or the raw protocol subpath. */
31
+ InvalidPositionAccrualTimestampError, InvalidPositionLossFactorError as InvalidMidnightPositionLossFactorError,
32
+ /** @deprecated Use InvalidMidnightPositionLossFactorError or the raw protocol subpath. */
33
+ InvalidPositionLossFactorError, InvalidTickSpacingError as InvalidMidnightTickSpacingError,
34
+ /** @deprecated Use InvalidMidnightTickSpacingError or the raw protocol subpath. */
35
+ InvalidTickSpacingError, InvalidTreeError as InvalidMidnightTreeError,
36
+ /** @deprecated Use InvalidMidnightTreeError or the raw protocol subpath. */
37
+ InvalidTreeError, InvalidTreeHeightError as InvalidMidnightTreeHeightError,
38
+ /** @deprecated Use InvalidMidnightTreeHeightError or the raw protocol subpath. */
39
+ InvalidTreeHeightError, InvalidTypedDataSignatureError as InvalidMidnightTypedDataSignatureError, MidnightApiError, MidnightMempoolValidationError, PayloadDecodeError as MidnightPayloadDecodeError, PriceGreaterThanOneError as MidnightPriceGreaterThanOneError,
40
+ /** @deprecated Use MidnightPriceGreaterThanOneError or the raw protocol subpath. */
41
+ PriceGreaterThanOneError, SettlementFeeExceedsPriceError as MidnightSettlementFeeExceedsPriceError,
42
+ /** @deprecated Use MidnightSettlementFeeExceedsPriceError or the raw protocol subpath. */
43
+ SettlementFeeExceedsPriceError, TickOutOfRangeError as MidnightTickOutOfRangeError,
44
+ /** @deprecated Use MidnightTickOutOfRangeError or the raw protocol subpath. */
45
+ TickOutOfRangeError, UnknownCollateralIndexError as UnknownMidnightCollateralIndexError,
46
+ /** @deprecated Use UnknownMidnightCollateralIndexError or the raw protocol subpath. */
47
+ UnknownCollateralIndexError, } from "@morpho-org/midnight-sdk";
48
+ export { _try, DivisionByZeroError, InvalidBitLengthError, NegativeValueError, RegistryValueAlreadyRegisteredError, } from "@morpho-org/morpho-ts";
@@ -1 +1,16 @@
1
- export { fetchAccrualPosition, fetchAccrualVault, fetchAccrualVaultV2, fetchAccrualVaultV2Adapter, fetchAccrualVaultV2MorphoMarketV1Adapter, fetchAccrualVaultV2MorphoMarketV1AdapterV2, fetchAccrualVaultV2MorphoVaultV1Adapter, fetchHolding, fetchMarket, fetchMarketParams, fetchPosition, fetchPreLiquidationParams, fetchPreLiquidationPosition, fetchToken, fetchUser, fetchVault, fetchVaultConfig, fetchVaultMarketAllocation, fetchVaultMarketConfig, fetchVaultMarketPublicAllocatorConfig, fetchVaultUser, fetchVaultV2, fetchVaultV2Adapter, fetchVaultV2MorphoMarketV1Adapter, fetchVaultV2MorphoMarketV1AdapterV2, fetchVaultV2MorphoVaultV1Adapter, } from "@morpho-org/blue-sdk-viem";
1
+ export { fetchAccrualPosition as fetchBlueAccrualPosition,
2
+ /** @deprecated Use `fetchBlueAccrualPosition` or the raw `/blue/fetch` subpath. */
3
+ fetchAccrualPosition, fetchAccrualVault, fetchAccrualVaultV2, fetchAccrualVaultV2Adapter, fetchAccrualVaultV2MorphoMarketV1Adapter, fetchAccrualVaultV2MorphoMarketV1AdapterV2, fetchAccrualVaultV2MorphoVaultV1Adapter, fetchHolding, fetchMarket as fetchBlueMarket,
4
+ /** @deprecated Use `fetchBlueMarket` or the raw `/blue/fetch` subpath. */
5
+ fetchMarket, fetchMarketParams as fetchBlueMarketParams,
6
+ /** @deprecated Use `fetchBlueMarketParams` or the raw `/blue/fetch` subpath. */
7
+ fetchMarketParams, fetchPosition as fetchBluePosition,
8
+ /** @deprecated Use `fetchBluePosition` or the raw `/blue/fetch` subpath. */
9
+ fetchPosition, fetchPreLiquidationParams as fetchBluePreLiquidationParams,
10
+ /** @deprecated Use `fetchBluePreLiquidationParams` or the raw `/blue/fetch` subpath. */
11
+ fetchPreLiquidationParams, fetchPreLiquidationPosition as fetchBluePreLiquidationPosition,
12
+ /** @deprecated Use `fetchBluePreLiquidationPosition` or the raw `/blue/fetch` subpath. */
13
+ fetchPreLiquidationPosition, fetchToken, fetchUser as fetchBlueUser,
14
+ /** @deprecated Use `fetchBlueUser` or the raw `/blue/fetch` subpath. */
15
+ fetchUser, fetchVault, fetchVaultConfig, fetchVaultMarketAllocation, fetchVaultMarketConfig, fetchVaultMarketPublicAllocatorConfig, fetchVaultUser, fetchVaultV2, fetchVaultV2Adapter, fetchVaultV2BlueMarketPublicAllocatorConfig, fetchVaultV2BluePublicAllocatorConfig, fetchVaultV2BluePublicAllocatorData, fetchVaultV2MorphoMarketV1Adapter, fetchVaultV2MorphoMarketV1AdapterV2, fetchVaultV2MorphoVaultV1Adapter, } from "@morpho-org/blue-sdk-viem";
16
+ 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 +1,16 @@
1
- export { fetchAccrualPosition, fetchAccrualVault, fetchAccrualVaultV2, fetchAccrualVaultV2Adapter, fetchAccrualVaultV2MorphoMarketV1Adapter, fetchAccrualVaultV2MorphoMarketV1AdapterV2, fetchAccrualVaultV2MorphoVaultV1Adapter, fetchHolding, fetchMarket, fetchMarketParams, fetchPosition, fetchPreLiquidationParams, fetchPreLiquidationPosition, fetchToken, fetchUser, fetchVault, fetchVaultConfig, fetchVaultMarketAllocation, fetchVaultMarketConfig, fetchVaultMarketPublicAllocatorConfig, fetchVaultUser, fetchVaultV2, fetchVaultV2Adapter, fetchVaultV2MorphoMarketV1Adapter, fetchVaultV2MorphoMarketV1AdapterV2, fetchVaultV2MorphoVaultV1Adapter, } from "@morpho-org/blue-sdk-viem";
1
+ export { fetchAccrualPosition as fetchBlueAccrualPosition,
2
+ /** @deprecated Use `fetchBlueAccrualPosition` or the raw `/blue/fetch` subpath. */
3
+ fetchAccrualPosition, fetchAccrualVault, fetchAccrualVaultV2, fetchAccrualVaultV2Adapter, fetchAccrualVaultV2MorphoMarketV1Adapter, fetchAccrualVaultV2MorphoMarketV1AdapterV2, fetchAccrualVaultV2MorphoVaultV1Adapter, fetchHolding, fetchMarket as fetchBlueMarket,
4
+ /** @deprecated Use `fetchBlueMarket` or the raw `/blue/fetch` subpath. */
5
+ fetchMarket, fetchMarketParams as fetchBlueMarketParams,
6
+ /** @deprecated Use `fetchBlueMarketParams` or the raw `/blue/fetch` subpath. */
7
+ fetchMarketParams, fetchPosition as fetchBluePosition,
8
+ /** @deprecated Use `fetchBluePosition` or the raw `/blue/fetch` subpath. */
9
+ fetchPosition, fetchPreLiquidationParams as fetchBluePreLiquidationParams,
10
+ /** @deprecated Use `fetchBluePreLiquidationParams` or the raw `/blue/fetch` subpath. */
11
+ fetchPreLiquidationParams, fetchPreLiquidationPosition as fetchBluePreLiquidationPosition,
12
+ /** @deprecated Use `fetchBluePreLiquidationPosition` or the raw `/blue/fetch` subpath. */
13
+ fetchPreLiquidationPosition, fetchToken, fetchUser as fetchBlueUser,
14
+ /** @deprecated Use `fetchBlueUser` or the raw `/blue/fetch` subpath. */
15
+ fetchUser, fetchVault, fetchVaultConfig, fetchVaultMarketAllocation, fetchVaultMarketConfig, fetchVaultMarketPublicAllocatorConfig, fetchVaultUser, fetchVaultV2, fetchVaultV2Adapter, fetchVaultV2BlueMarketPublicAllocatorConfig, fetchVaultV2BluePublicAllocatorConfig, fetchVaultV2BluePublicAllocatorData, fetchVaultV2MorphoMarketV1Adapter, fetchVaultV2MorphoMarketV1AdapterV2, fetchVaultV2MorphoVaultV1Adapter, } from "@morpho-org/blue-sdk-viem";
16
+ export { fetchAccrualPosition as fetchMidnightAccrualPosition, fetchMarket as fetchMidnightMarket, fetchMarketParams as fetchMidnightMarketParams, fetchPosition as fetchMidnightPosition, fetchRatifierInfo as fetchMidnightRatifierInfo, } from "@morpho-org/midnight-sdk";
@@ -150,11 +150,11 @@ export declare const validateRepayShares: (params: {
150
150
  * @throws {UnsortedReallocationWithdrawalsError} when withdrawals are not strictly market-id sorted.
151
151
  * @example
152
152
  * ```ts
153
- * import type { MarketId } from "@morpho-org/blue-sdk";
153
+ * import type { BlueMarketId } from "@morpho-org/morpho-sdk/types";
154
154
  * import { validateReallocations } from "@morpho-org/morpho-sdk";
155
155
  * import { zeroHash } from "viem";
156
156
  *
157
- * const result: void = validateReallocations([], zeroHash as MarketId);
157
+ * const result: void = validateReallocations([], zeroHash as BlueMarketId);
158
158
  * ```
159
159
  */
160
160
  export declare const validateReallocations: (reallocations: Iterable<VaultV1Reallocation>, targetMarketId: MarketId) => void;
@@ -230,11 +230,11 @@ export const validateRepayShares = (params) => {
230
230
  * @throws {UnsortedReallocationWithdrawalsError} when withdrawals are not strictly market-id sorted.
231
231
  * @example
232
232
  * ```ts
233
- * import type { MarketId } from "@morpho-org/blue-sdk";
233
+ * import type { BlueMarketId } from "@morpho-org/morpho-sdk/types";
234
234
  * import { validateReallocations } from "@morpho-org/morpho-sdk";
235
235
  * import { zeroHash } from "viem";
236
236
  *
237
- * const result: void = validateReallocations([], zeroHash as MarketId);
237
+ * const result: void = validateReallocations([], zeroHash as BlueMarketId);
238
238
  * ```
239
239
  */
240
240
  export const validateReallocations = (reallocations, targetMarketId) => {
@@ -0,0 +1 @@
1
+ export { ecrecoverRatifierAbi, midnightAbi, midnightBundlesAbi, setterRatifierAbi, } from "@morpho-org/midnight-sdk";
@@ -0,0 +1 @@
1
+ export { ecrecoverRatifierAbi, midnightAbi, midnightBundlesAbi, setterRatifierAbi, } from "@morpho-org/midnight-sdk";
@@ -0,0 +1 @@
1
+ export { CBP, COLLATERAL_PARAMS_TYPEHASH, DEFAULT_TICK_SPACING, EIP712_DOMAIN_TYPEHASH, MARKET_TYPEHASH, MAX_COLLATERALS, MAX_COLLATERALS_PER_BORROWER, MAX_CONTINUOUS_FEE, MAX_OFFER_CAP, MAX_SETTLEMENT_FEES, MAX_TICK, OFFER_TYPEHASH, PRICE_ROUNDING_STEP, SETTLEMENT_FEE_BREAKPOINTS, TIME_TO_MAX_LIF, } from "@morpho-org/midnight-sdk";
@@ -0,0 +1 @@
1
+ export { CBP, COLLATERAL_PARAMS_TYPEHASH, DEFAULT_TICK_SPACING, EIP712_DOMAIN_TYPEHASH, MARKET_TYPEHASH, MAX_COLLATERALS, MAX_COLLATERALS_PER_BORROWER, MAX_CONTINUOUS_FEE, MAX_OFFER_CAP, MAX_SETTLEMENT_FEES, MAX_TICK, OFFER_TYPEHASH, PRICE_ROUNDING_STEP, SETTLEMENT_FEE_BREAKPOINTS, TIME_TO_MAX_LIF, } from "@morpho-org/midnight-sdk";
@@ -0,0 +1,2 @@
1
+ export type { BuildOfferParams, CollateralParams, GroupInput, IAccrualPosition, ICollateralParams, IGroup, IMarket, IMarketParams, IOffer, IPosition, MarketInput, OfferStruct, RatifierTreeInput, SettlementFeeCbps, TreeCreateParams, TreeDescriptor, TreeInput, TreeLike, TreeMempoolValidateParams, TreeMempoolValidateRatification, TreeProof, } from "@morpho-org/midnight-sdk";
2
+ export { AccrualPosition, Group, Market, MarketParams, Offer, Position, Tree, } from "@morpho-org/midnight-sdk";
@@ -0,0 +1 @@
1
+ export { AccrualPosition, Group, Market, MarketParams, Offer, Position, Tree, } from "@morpho-org/midnight-sdk";
@@ -0,0 +1 @@
1
+ export { ChainIdMismatchError, InvalidEcrecoverSignatureVError, InvalidMarketParameterError, InvalidMidnightApiResponseError, InvalidOfferGroupError, InvalidOfferParameterError, InvalidPositionAccrualStateError, InvalidPositionAccrualTimestampError, InvalidPositionLossFactorError, InvalidTickSpacingError, InvalidTreeError, InvalidTreeHeightError, InvalidTypedDataSignatureError, MidnightApiError, MidnightMempoolValidationError, PayloadDecodeError, PriceGreaterThanOneError, SettlementFeeExceedsPriceError, TickOutOfRangeError, UnknownCollateralIndexError, } from "@morpho-org/midnight-sdk";
@@ -0,0 +1 @@
1
+ export { ChainIdMismatchError, InvalidEcrecoverSignatureVError, InvalidMarketParameterError, InvalidMidnightApiResponseError, InvalidOfferGroupError, InvalidOfferParameterError, InvalidPositionAccrualStateError, InvalidPositionAccrualTimestampError, InvalidPositionLossFactorError, InvalidTickSpacingError, InvalidTreeError, InvalidTreeHeightError, InvalidTypedDataSignatureError, MidnightApiError, MidnightMempoolValidationError, PayloadDecodeError, PriceGreaterThanOneError, SettlementFeeExceedsPriceError, TickOutOfRangeError, UnknownCollateralIndexError, } from "@morpho-org/midnight-sdk";
@@ -0,0 +1 @@
1
+ export { fetchAccrualPosition, fetchMarket, fetchMarketParams, fetchPosition, fetchRatifierInfo, } from "@morpho-org/midnight-sdk";
@@ -0,0 +1 @@
1
+ export { fetchAccrualPosition, fetchMarket, fetchMarketParams, fetchPosition, fetchRatifierInfo, } from "@morpho-org/midnight-sdk";
@@ -0,0 +1 @@
1
+ export type { BuildFixedRateOfferChainParams, DecodedEcrecoverRatifierData, DecodedSetterRatifierData, DeploylessFetchParameters, EcrecoverRatificationTypedData, EcrecoverRatifierDataDigestParams, EcrecoverRatifierDataParams, EcrecoverRatifierDataVerificationParams, EcrecoverRatifierRatifyParams, EcrecoverRatifierRootDigestParams, EcrecoverRatifierTypedDataParams, EcrecoverSignatureInput, FixedRateOfferChainLeg, GetRatifierInfoParams, MidnightCallParameters, MidnightFetchParams, RatifierInfo, SetterRatifierDataParams, SetterRatifierDataVerificationParams, VerifiedEcrecoverRatifierData, } from "@morpho-org/midnight-sdk";
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export { EcrecoverRatifierUtils, eip712Digest, GroupUtils, MarketUtils, OfferChainUtils, OfferUtils, Payload, PositionUtils, RatifierUtils, SetterRatifierUtils, TakeAmountsLib, TickLib, TreeUtils, } from "@morpho-org/midnight-sdk";
@@ -0,0 +1 @@
1
+ export { EcrecoverRatifierUtils, eip712Digest, GroupUtils, MarketUtils, OfferChainUtils, OfferUtils, Payload, PositionUtils, RatifierUtils, SetterRatifierUtils, TakeAmountsLib, TickLib, TreeUtils, } from "@morpho-org/midnight-sdk";
@@ -1,4 +1,19 @@
1
- export type { BigIntish, CollateralAllocation, Eip712Field, Erc20AllowanceRecipient, Failable, Fetchable, InputMarketParams, IPermit2Allowance, Loadable, MarketId, MaxBorrowOptions, MaxPositionCapacities, MaxWithdrawCollateralOptions, Pending, Permit2Allowance, } from "@morpho-org/blue-sdk";
2
- export type { DeploylessFetchParameters, FetchParameters, } from "@morpho-org/blue-sdk-viem";
1
+ export type { BigIntish, CollateralAllocation, Eip712Field, Erc20AllowanceRecipient, Failable, Fetchable, InputMarketParams as BlueInputMarketParams,
2
+ /** @deprecated Use `BlueInputMarketParams` or the raw `/blue/types` subpath. */
3
+ InputMarketParams, IPermit2Allowance, Loadable, MarketId as BlueMarketId,
4
+ /** @deprecated Use `BlueMarketId` or the raw `/blue/types` subpath. */
5
+ MarketId, MaxBorrowOptions as BlueMaxBorrowOptions,
6
+ /** @deprecated Use `BlueMaxBorrowOptions` or the raw `/blue/types` subpath. */
7
+ MaxBorrowOptions, MaxPositionCapacities as BlueMaxPositionCapacities,
8
+ /** @deprecated Use `BlueMaxPositionCapacities` or the raw `/blue/types` subpath. */
9
+ MaxPositionCapacities, MaxWithdrawCollateralOptions as BlueMaxWithdrawCollateralOptions,
10
+ /** @deprecated Use `BlueMaxWithdrawCollateralOptions` or the raw `/blue/types` subpath. */
11
+ MaxWithdrawCollateralOptions, Pending, Permit2Allowance, } from "@morpho-org/blue-sdk";
12
+ export type { AuthorizationArgs as BlueAuthorizationTypedDataArgs, DaiPermitArgs, DeploylessFetchParameters as BlueDeploylessFetchParameters,
13
+ /** @deprecated Use `BlueDeploylessFetchParameters` or the raw `/blue/types` subpath. */
14
+ DeploylessFetchParameters, FetchParameters as BlueFetchParameters,
15
+ /** @deprecated Use `BlueFetchParameters` or the raw `/blue/types` subpath. */
16
+ FetchParameters, InputAllocation as BlueInputAllocation, MetaMorphoCall as BlueMetaMorphoCall, Permit2PermitArgs, Permit2TransferFromArgs, PermitArgs as PermitTypedDataArgs, } from "@morpho-org/blue-sdk-viem";
17
+ export type { BuildFixedRateOfferChainParams as MidnightBuildFixedRateOfferChainParams, DecodedEcrecoverRatifierData as MidnightDecodedEcrecoverRatifierData, DecodedSetterRatifierData as MidnightDecodedSetterRatifierData, DeploylessFetchParameters as MidnightDeploylessFetchParameters, EcrecoverRatificationTypedData as MidnightEcrecoverRatificationTypedData, EcrecoverRatifierDataDigestParams as MidnightEcrecoverRatifierDataDigestParams, EcrecoverRatifierDataParams as MidnightEcrecoverRatifierDataParams, EcrecoverRatifierDataVerificationParams as MidnightEcrecoverRatifierDataVerificationParams, EcrecoverRatifierRatifyParams as MidnightEcrecoverRatifierRatifyParams, EcrecoverRatifierRootDigestParams as MidnightEcrecoverRatifierRootDigestParams, EcrecoverRatifierTypedDataParams as MidnightEcrecoverRatifierTypedDataParams, EcrecoverSignatureInput as MidnightEcrecoverSignatureInput, FixedRateOfferChainLeg as MidnightFixedRateOfferChainLeg, GetRatifierInfoParams as MidnightGetRatifierInfoParams, MidnightCallParameters, MidnightFetchParams, RatifierInfo as MidnightRatifierInfo, SetterRatifierDataParams as MidnightSetterRatifierDataParams, SetterRatifierDataVerificationParams as MidnightSetterRatifierDataVerificationParams, VerifiedEcrecoverRatifierData as MidnightVerifiedEcrecoverRatifierData, } from "@morpho-org/midnight-sdk";
3
18
  export type { ChainMetadata } from "@morpho-org/morpho-ts";
4
19
  export * from "./types/index.js";
@@ -1,10 +1,37 @@
1
1
  export type { CapacityLimit, RoundingDirection } from "@morpho-org/blue-sdk";
2
- export { AdaptiveCurveIrmLib, CapacityLimitReason, MarketUtils, MathLib, SharesMath, VaultUtils, VaultV2Utils, } from "@morpho-org/blue-sdk";
3
- export { decodeBytes32String, getAuthorizationTypedData, getPermit2PermitTypedData, getPermit2TransferFromTypedData, getPermitTypedData, optionalBoolean, readContractRestructured, restructure, safeGetAddress, safeParseNumber, safeParseUnits, } from "@morpho-org/blue-sdk-viem";
4
- export { EcrecoverRatifierUtils, GroupUtils, OfferUtils, Payload, RatifierUtils, SetterRatifierUtils, TakeAmountsLib, TickLib, TreeUtils, } from "@morpho-org/midnight-sdk";
2
+ export { AdaptiveCurveIrmLib as BlueAdaptiveCurveIrmLib,
3
+ /** @deprecated Use BlueAdaptiveCurveIrmLib or the raw protocol subpath. */
4
+ AdaptiveCurveIrmLib, CapacityLimitReason, defaultPreLiquidationParamsRegistry as blueDefaultPreLiquidationParamsRegistry, getDefaultPreLiquidationParams as getBlueDefaultPreLiquidationParams, MarketUtils as BlueMarketUtils,
5
+ /** @deprecated Use BlueMarketUtils or the raw protocol subpath. */
6
+ MarketUtils, MathLib, SharesMath as BlueSharesMath,
7
+ /** @deprecated Use BlueSharesMath or the raw protocol subpath. */
8
+ SharesMath, VaultUtils, VaultV2BlueMarketPublicAllocatorConfigUtils, VaultV2BluePublicAllocatorConfigUtils, VaultV2Utils, } from "@morpho-org/blue-sdk";
9
+ export { decodeBytes32String, getAuthorizationTypedData as getBlueAuthorizationTypedData,
10
+ /** @deprecated Use getBlueAuthorizationTypedData or the raw protocol subpath. */
11
+ getAuthorizationTypedData, getDaiPermitTypedData, getPermit2PermitTypedData, getPermit2TransferFromTypedData, getPermitTypedData, MetaMorphoAction as BlueMetaMorphoAction, optionalBoolean, readContractRestructured, restructure, safeGetAddress, safeParseNumber, safeParseUnits, } from "@morpho-org/blue-sdk-viem";
12
+ export { EcrecoverRatifierUtils as MidnightEcrecoverRatifierUtils,
13
+ /** @deprecated Use MidnightEcrecoverRatifierUtils or the raw protocol subpath. */
14
+ EcrecoverRatifierUtils, eip712Digest, GroupUtils as MidnightGroupUtils,
15
+ /** @deprecated Use MidnightGroupUtils or the raw protocol subpath. */
16
+ GroupUtils, MarketUtils as MidnightMarketUtils, OfferChainUtils as MidnightOfferChainUtils, OfferUtils as MidnightOfferUtils,
17
+ /** @deprecated Use MidnightOfferUtils or the raw protocol subpath. */
18
+ OfferUtils, Payload as MidnightPayload,
19
+ /** @deprecated Use MidnightPayload or the raw protocol subpath. */
20
+ Payload, PositionUtils as MidnightPositionUtils, RatifierUtils as MidnightRatifierUtils,
21
+ /** @deprecated Use MidnightRatifierUtils or the raw protocol subpath. */
22
+ RatifierUtils, SetterRatifierUtils as MidnightSetterRatifierUtils,
23
+ /** @deprecated Use MidnightSetterRatifierUtils or the raw protocol subpath. */
24
+ SetterRatifierUtils, TakeAmountsLib as MidnightTakeAmountsLib,
25
+ /** @deprecated Use MidnightTakeAmountsLib or the raw protocol subpath. */
26
+ TakeAmountsLib, TickLib as MidnightTickLib,
27
+ /** @deprecated Use MidnightTickLib or the raw protocol subpath. */
28
+ TickLib, TreeUtils as MidnightTreeUtils,
29
+ /** @deprecated Use MidnightTreeUtils or the raw protocol subpath. */
30
+ TreeUtils, } from "@morpho-org/midnight-sdk";
5
31
  export type { ArrayElementType, DeepPartial, DottedKeys, FieldType, PartialDottedKeys, WithId, WithIndex, } from "@morpho-org/morpho-ts";
6
32
  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";
7
33
  export { computeReallocations, computeVaultV1Reallocations, } from "./helpers/computeVaultV1Reallocations.js";
8
34
  export { addTransactionMetadata } from "./helpers/metadata.js";
35
+ export { type PreviewVaultV2InKindRedeemParams, previewVaultV2InKindRedeem, type VaultV2InKindRedeemMarketPreview, } from "./helpers/previewVaultV2InKindRedeem.js";
9
36
  export { computeMaxRepaySharePrice, computeMinBorrowSharePrice, } from "./helpers/slippage.js";
10
37
  export { validateAccrualPosition, validateChainId, validateNativeAsset, validatePositionHealth, validatePositionHealthAfterWithdraw, validateReallocations, validateRepayAmount, validateRepayShares, validateSlippageTolerance, validateUserAddress, } from "./helpers/validate.js";
package/lib/esm/utils.js CHANGED
@@ -1,8 +1,35 @@
1
- export { AdaptiveCurveIrmLib, CapacityLimitReason, MarketUtils, MathLib, SharesMath, VaultUtils, VaultV2Utils, } from "@morpho-org/blue-sdk";
2
- export { decodeBytes32String, getAuthorizationTypedData, getPermit2PermitTypedData, getPermit2TransferFromTypedData, getPermitTypedData, optionalBoolean, readContractRestructured, restructure, safeGetAddress, safeParseNumber, safeParseUnits, } from "@morpho-org/blue-sdk-viem";
3
- export { EcrecoverRatifierUtils, GroupUtils, OfferUtils, Payload, RatifierUtils, SetterRatifierUtils, TakeAmountsLib, TickLib, TreeUtils, } from "@morpho-org/midnight-sdk";
1
+ export { AdaptiveCurveIrmLib as BlueAdaptiveCurveIrmLib,
2
+ /** @deprecated Use BlueAdaptiveCurveIrmLib or the raw protocol subpath. */
3
+ AdaptiveCurveIrmLib, CapacityLimitReason, defaultPreLiquidationParamsRegistry as blueDefaultPreLiquidationParamsRegistry, getDefaultPreLiquidationParams as getBlueDefaultPreLiquidationParams, MarketUtils as BlueMarketUtils,
4
+ /** @deprecated Use BlueMarketUtils or the raw protocol subpath. */
5
+ MarketUtils, MathLib, SharesMath as BlueSharesMath,
6
+ /** @deprecated Use BlueSharesMath or the raw protocol subpath. */
7
+ SharesMath, VaultUtils, VaultV2BlueMarketPublicAllocatorConfigUtils, VaultV2BluePublicAllocatorConfigUtils, VaultV2Utils, } from "@morpho-org/blue-sdk";
8
+ export { decodeBytes32String, getAuthorizationTypedData as getBlueAuthorizationTypedData,
9
+ /** @deprecated Use getBlueAuthorizationTypedData or the raw protocol subpath. */
10
+ getAuthorizationTypedData, getDaiPermitTypedData, getPermit2PermitTypedData, getPermit2TransferFromTypedData, getPermitTypedData, MetaMorphoAction as BlueMetaMorphoAction, optionalBoolean, readContractRestructured, restructure, safeGetAddress, safeParseNumber, safeParseUnits, } from "@morpho-org/blue-sdk-viem";
11
+ export { EcrecoverRatifierUtils as MidnightEcrecoverRatifierUtils,
12
+ /** @deprecated Use MidnightEcrecoverRatifierUtils or the raw protocol subpath. */
13
+ EcrecoverRatifierUtils, eip712Digest, GroupUtils as MidnightGroupUtils,
14
+ /** @deprecated Use MidnightGroupUtils or the raw protocol subpath. */
15
+ GroupUtils, MarketUtils as MidnightMarketUtils, OfferChainUtils as MidnightOfferChainUtils, OfferUtils as MidnightOfferUtils,
16
+ /** @deprecated Use MidnightOfferUtils or the raw protocol subpath. */
17
+ OfferUtils, Payload as MidnightPayload,
18
+ /** @deprecated Use MidnightPayload or the raw protocol subpath. */
19
+ Payload, PositionUtils as MidnightPositionUtils, RatifierUtils as MidnightRatifierUtils,
20
+ /** @deprecated Use MidnightRatifierUtils or the raw protocol subpath. */
21
+ RatifierUtils, SetterRatifierUtils as MidnightSetterRatifierUtils,
22
+ /** @deprecated Use MidnightSetterRatifierUtils or the raw protocol subpath. */
23
+ SetterRatifierUtils, TakeAmountsLib as MidnightTakeAmountsLib,
24
+ /** @deprecated Use MidnightTakeAmountsLib or the raw protocol subpath. */
25
+ TakeAmountsLib, TickLib as MidnightTickLib,
26
+ /** @deprecated Use MidnightTickLib or the raw protocol subpath. */
27
+ TickLib, TreeUtils as MidnightTreeUtils,
28
+ /** @deprecated Use MidnightTreeUtils or the raw protocol subpath. */
29
+ TreeUtils, } from "@morpho-org/midnight-sdk";
4
30
  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";
5
31
  export { computeReallocations, computeVaultV1Reallocations, } from "./helpers/computeVaultV1Reallocations.js";
6
32
  export { addTransactionMetadata } from "./helpers/metadata.js";
33
+ export { previewVaultV2InKindRedeem, } from "./helpers/previewVaultV2InKindRedeem.js";
7
34
  export { computeMaxRepaySharePrice, computeMinBorrowSharePrice, } from "./helpers/slippage.js";
8
35
  export { validateAccrualPosition, validateChainId, validateNativeAsset, validatePositionHealth, validatePositionHealthAfterWithdraw, validateReallocations, validateRepayAmount, validateRepayShares, validateSlippageTolerance, validateUserAddress, } from "./helpers/validate.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": "5.6.0",
4
+ "version": "5.7.0",
5
5
  "author": "Morpho Association <contact@morpho.org>",
6
6
  "contributors": [
7
7
  "Foulks-Plb <https://x.com/FoulkPlb>"
@@ -45,6 +45,11 @@
45
45
  "import": "./lib/esm/augment/*.js",
46
46
  "require": "./lib/cjs/augment/*.js"
47
47
  },
48
+ "./blue/*": {
49
+ "types": "./lib/esm/blue/*.d.ts",
50
+ "import": "./lib/esm/blue/*.js",
51
+ "require": "./lib/cjs/blue/*.js"
52
+ },
48
53
  "./bundler": {
49
54
  "types": "./lib/esm/bundler/index.d.ts",
50
55
  "import": "./lib/esm/bundler/index.js",
@@ -80,6 +85,11 @@
80
85
  "import": "./lib/esm/midnight-api.js",
81
86
  "require": "./lib/cjs/midnight-api.js"
82
87
  },
88
+ "./midnight/*": {
89
+ "types": "./lib/esm/midnight/*.d.ts",
90
+ "import": "./lib/esm/midnight/*.js",
91
+ "require": "./lib/cjs/midnight/*.js"
92
+ },
83
93
  "./types": {
84
94
  "types": "./lib/esm/types.d.ts",
85
95
  "import": "./lib/esm/types.js",
@@ -105,6 +115,9 @@
105
115
  "augment/*": [
106
116
  "lib/esm/augment/*.d.ts"
107
117
  ],
118
+ "blue/*": [
119
+ "lib/esm/blue/*.d.ts"
120
+ ],
108
121
  "bundler": [
109
122
  "lib/esm/bundler/index.d.ts"
110
123
  ],
@@ -126,6 +139,9 @@
126
139
  "midnight-api": [
127
140
  "lib/esm/midnight-api.d.ts"
128
141
  ],
142
+ "midnight/*": [
143
+ "lib/esm/midnight/*.d.ts"
144
+ ],
129
145
  "types": [
130
146
  "lib/esm/types.d.ts"
131
147
  ],
@@ -145,10 +161,10 @@
145
161
  ],
146
162
  "dependencies": {
147
163
  "zod": "^4.4.3",
148
- "@morpho-org/blue-sdk-viem": "^5.3.0",
164
+ "@morpho-org/blue-sdk": "^6.6.0",
165
+ "@morpho-org/blue-sdk-viem": "^5.4.0",
149
166
  "@morpho-org/midnight-sdk": "^1.3.0",
150
- "@morpho-org/morpho-ts": "^2.10.0",
151
- "@morpho-org/blue-sdk": "^6.6.0"
167
+ "@morpho-org/morpho-ts": "^2.10.0"
152
168
  },
153
169
  "peerDependencies": {
154
170
  "viem": "^2.0.0"
@@ -159,14 +175,14 @@
159
175
  "typescript": "^7.0.2",
160
176
  "viem": "^2.55.10",
161
177
  "vitest": "^4.1.10",
162
- "@morpho-org/test": "^2.8.4"
178
+ "@morpho-org/test": "^2.9.0"
163
179
  },
164
180
  "scripts": {
165
181
  "prepublish": "$npm_execpath build",
166
182
  "build": "tsc --noEmit && $npm_execpath build:cjs && $npm_execpath build:esm",
167
183
  "build:cjs": "tsc --build tsconfig.build.cjs.json && echo '{\"type\":\"commonjs\"}' > lib/cjs/package.json",
168
184
  "build:esm": "tsc --build tsconfig.build.esm.json && echo '{\"type\":\"module\"}' > lib/esm/package.json",
169
- "test": "vitest --root ../.. --project morpho-sdk"
185
+ "test": "vitest --root ../.. --project morpho-sdk --project morpho-sdk-fork"
170
186
  },
171
187
  "types": "./lib/esm/index.d.ts"
172
188
  }