@morpho-org/morpho-sdk 5.6.0 → 5.8.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
@@ -1,29 +1,67 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MAX_TOKEN_APPROVALS = exports.MAX_SLIPPAGE_TOLERANCE = exports.MAX_REALLOCATION_PENALTY = exports.MAX_ABSOLUTE_SHARE_PRICE = exports.DEFAULT_WITHDRAWAL_TARGET_UTILIZATION = exports.DEFAULT_SUPPLY_TARGET_UTILIZATION = exports.DEFAULT_MAX_REALLOCATION_PENALTY = exports.DEFAULT_LLTV_BUFFER = exports.APPROVE_ONLY_ONCE_TOKENS = exports.ZERO_ADDRESS = exports.REWARDS_BASE_URL = exports.OPTIMIZERS_BASE_URL = exports.OPTIMIZERS_API_BASE_URL = exports.MORPHO_DOMAIN = exports.DOCS_BASE_URL = exports.ChainUtils = exports.ChainId = exports.CDN_BASE_URL = exports.BLUE_API_GRAPHQL_URL = exports.BLUE_API_BASE_URL = exports.SETTLEMENT_FEE_BREAKPOINTS = exports.PRICE_ROUNDING_STEP = exports.OFFER_TYPEHASH = exports.MAX_TICK = exports.MAX_SETTLEMENT_FEES = exports.MAX_CONTINUOUS_FEE = exports.MAX_COLLATERALS_PER_BORROWER = exports.MAX_COLLATERALS = exports.MARKET_TYPEHASH = exports.EIP712_DOMAIN_TYPEHASH = exports.DEFAULT_TICK_SPACING = exports.COLLATERAL_PARAMS_TYPEHASH = exports.CBP = exports.TransactionType = exports.SECONDS_PER_YEAR = exports.ORACLE_PRICE_SCALE = exports.MAX_LIQUIDATION_INCENTIVE_FACTOR = exports.LIQUIDATION_CURSOR = exports.isMarketId = exports.EIP_712_FIELDS = exports.DEFAULT_SLIPPAGE_TOLERANCE = void 0;
3
+ exports.OPTIMIZERS_BASE_URL = exports.OPTIMIZERS_API_BASE_URL = exports.MORPHO_DOMAIN = exports.DOCS_BASE_URL = exports.ChainUtils = exports.ChainId = exports.CDN_BASE_URL = exports.BLUE_API_GRAPHQL_URL = exports.BLUE_API_BASE_URL = exports.MIDNIGHT_TIME_TO_MAX_LIF = exports.SETTLEMENT_FEE_BREAKPOINTS = exports.MIDNIGHT_SETTLEMENT_FEE_BREAKPOINTS = exports.PRICE_ROUNDING_STEP = exports.MIDNIGHT_PRICE_ROUNDING_STEP = exports.OFFER_TYPEHASH = exports.MIDNIGHT_OFFER_TYPEHASH = exports.MAX_TICK = exports.MIDNIGHT_MAX_TICK = exports.MAX_SETTLEMENT_FEES = exports.MIDNIGHT_MAX_SETTLEMENT_FEES = exports.MIDNIGHT_MAX_OFFER_CAP = exports.MAX_CONTINUOUS_FEE = exports.MIDNIGHT_MAX_CONTINUOUS_FEE = exports.MAX_COLLATERALS_PER_BORROWER = exports.MIDNIGHT_MAX_COLLATERALS_PER_BORROWER = exports.MAX_COLLATERALS = exports.MIDNIGHT_MAX_COLLATERALS = exports.MARKET_TYPEHASH = exports.MIDNIGHT_MARKET_TYPEHASH = exports.EIP712_DOMAIN_TYPEHASH = exports.MIDNIGHT_EIP712_DOMAIN_TYPEHASH = exports.DEFAULT_TICK_SPACING = exports.MIDNIGHT_DEFAULT_TICK_SPACING = exports.COLLATERAL_PARAMS_TYPEHASH = exports.MIDNIGHT_COLLATERAL_PARAMS_TYPEHASH = exports.CBP = exports.MIDNIGHT_CBP = exports.TransactionType = exports.BlueTransactionType = exports.SECONDS_PER_YEAR = exports.ORACLE_PRICE_SCALE = exports.MAX_LIQUIDATION_INCENTIVE_FACTOR = exports.BLUE_MAX_LIQUIDATION_INCENTIVE_FACTOR = exports.LIQUIDATION_CURSOR = exports.BLUE_LIQUIDATION_CURSOR = exports.isMarketId = exports.isBlueMarketId = exports.ERC20_ALLOWANCE_RECIPIENTS = exports.EIP_712_FIELDS = exports.DEFAULT_SLIPPAGE_TOLERANCE = void 0;
4
+ exports.MAX_TOKEN_APPROVALS = exports.MAX_SLIPPAGE_TOLERANCE = exports.MAX_REALLOCATION_PENALTY = exports.MAX_ABSOLUTE_SHARE_PRICE = exports.DEFAULT_WITHDRAWAL_TARGET_UTILIZATION = exports.DEFAULT_SUPPLY_TARGET_UTILIZATION = exports.DEFAULT_MAX_REALLOCATION_PENALTY = exports.DEFAULT_LLTV_BUFFER = exports.APPROVE_ONLY_ONCE_TOKENS = exports.ZERO_ADDRESS = exports.REWARDS_BASE_URL = void 0;
4
5
  var blue_sdk_1 = require("@morpho-org/blue-sdk");
5
6
  Object.defineProperty(exports, "DEFAULT_SLIPPAGE_TOLERANCE", { enumerable: true, get: function () { return blue_sdk_1.DEFAULT_SLIPPAGE_TOLERANCE; } });
6
7
  Object.defineProperty(exports, "EIP_712_FIELDS", { enumerable: true, get: function () { return blue_sdk_1.EIP_712_FIELDS; } });
8
+ Object.defineProperty(exports, "ERC20_ALLOWANCE_RECIPIENTS", { enumerable: true, get: function () { return blue_sdk_1.ERC20_ALLOWANCE_RECIPIENTS; } });
9
+ Object.defineProperty(exports, "isBlueMarketId", { enumerable: true, get: function () { return blue_sdk_1.isMarketId; } });
10
+ /** @deprecated Use `isBlueMarketId` or the raw `/blue/constants` subpath. */
7
11
  Object.defineProperty(exports, "isMarketId", { enumerable: true, get: function () { return blue_sdk_1.isMarketId; } });
12
+ Object.defineProperty(exports, "BLUE_LIQUIDATION_CURSOR", { enumerable: true, get: function () { return blue_sdk_1.LIQUIDATION_CURSOR; } });
13
+ /** @deprecated Use `BLUE_LIQUIDATION_CURSOR` or the raw `/blue/constants` subpath. */
8
14
  Object.defineProperty(exports, "LIQUIDATION_CURSOR", { enumerable: true, get: function () { return blue_sdk_1.LIQUIDATION_CURSOR; } });
15
+ Object.defineProperty(exports, "BLUE_MAX_LIQUIDATION_INCENTIVE_FACTOR", { enumerable: true, get: function () { return blue_sdk_1.MAX_LIQUIDATION_INCENTIVE_FACTOR; } });
16
+ /** @deprecated Use `BLUE_MAX_LIQUIDATION_INCENTIVE_FACTOR` or the raw `/blue/constants` subpath. */
9
17
  Object.defineProperty(exports, "MAX_LIQUIDATION_INCENTIVE_FACTOR", { enumerable: true, get: function () { return blue_sdk_1.MAX_LIQUIDATION_INCENTIVE_FACTOR; } });
10
18
  Object.defineProperty(exports, "ORACLE_PRICE_SCALE", { enumerable: true, get: function () { return blue_sdk_1.ORACLE_PRICE_SCALE; } });
11
19
  Object.defineProperty(exports, "SECONDS_PER_YEAR", { enumerable: true, get: function () { return blue_sdk_1.SECONDS_PER_YEAR; } });
20
+ Object.defineProperty(exports, "BlueTransactionType", { enumerable: true, get: function () { return blue_sdk_1.TransactionType; } });
21
+ /** @deprecated Use `BlueTransactionType` or the raw `/blue/constants` subpath. */
12
22
  Object.defineProperty(exports, "TransactionType", { enumerable: true, get: function () { return blue_sdk_1.TransactionType; } });
13
23
  var midnight_sdk_1 = require("@morpho-org/midnight-sdk");
24
+ Object.defineProperty(exports, "MIDNIGHT_CBP", { enumerable: true, get: function () { return midnight_sdk_1.CBP; } });
25
+ /** @deprecated Use `MIDNIGHT_CBP` or the raw `/midnight/constants` subpath. */
14
26
  Object.defineProperty(exports, "CBP", { enumerable: true, get: function () { return midnight_sdk_1.CBP; } });
27
+ Object.defineProperty(exports, "MIDNIGHT_COLLATERAL_PARAMS_TYPEHASH", { enumerable: true, get: function () { return midnight_sdk_1.COLLATERAL_PARAMS_TYPEHASH; } });
28
+ /** @deprecated Use `MIDNIGHT_COLLATERAL_PARAMS_TYPEHASH` or the raw `/midnight/constants` subpath. */
15
29
  Object.defineProperty(exports, "COLLATERAL_PARAMS_TYPEHASH", { enumerable: true, get: function () { return midnight_sdk_1.COLLATERAL_PARAMS_TYPEHASH; } });
30
+ Object.defineProperty(exports, "MIDNIGHT_DEFAULT_TICK_SPACING", { enumerable: true, get: function () { return midnight_sdk_1.DEFAULT_TICK_SPACING; } });
31
+ /** @deprecated Use `MIDNIGHT_DEFAULT_TICK_SPACING` or the raw `/midnight/constants` subpath. */
16
32
  Object.defineProperty(exports, "DEFAULT_TICK_SPACING", { enumerable: true, get: function () { return midnight_sdk_1.DEFAULT_TICK_SPACING; } });
33
+ Object.defineProperty(exports, "MIDNIGHT_EIP712_DOMAIN_TYPEHASH", { enumerable: true, get: function () { return midnight_sdk_1.EIP712_DOMAIN_TYPEHASH; } });
34
+ /** @deprecated Use `MIDNIGHT_EIP712_DOMAIN_TYPEHASH` or the raw `/midnight/constants` subpath. */
17
35
  Object.defineProperty(exports, "EIP712_DOMAIN_TYPEHASH", { enumerable: true, get: function () { return midnight_sdk_1.EIP712_DOMAIN_TYPEHASH; } });
36
+ Object.defineProperty(exports, "MIDNIGHT_MARKET_TYPEHASH", { enumerable: true, get: function () { return midnight_sdk_1.MARKET_TYPEHASH; } });
37
+ /** @deprecated Use `MIDNIGHT_MARKET_TYPEHASH` or the raw `/midnight/constants` subpath. */
18
38
  Object.defineProperty(exports, "MARKET_TYPEHASH", { enumerable: true, get: function () { return midnight_sdk_1.MARKET_TYPEHASH; } });
39
+ Object.defineProperty(exports, "MIDNIGHT_MAX_COLLATERALS", { enumerable: true, get: function () { return midnight_sdk_1.MAX_COLLATERALS; } });
40
+ /** @deprecated Use `MIDNIGHT_MAX_COLLATERALS` or the raw `/midnight/constants` subpath. */
19
41
  Object.defineProperty(exports, "MAX_COLLATERALS", { enumerable: true, get: function () { return midnight_sdk_1.MAX_COLLATERALS; } });
42
+ Object.defineProperty(exports, "MIDNIGHT_MAX_COLLATERALS_PER_BORROWER", { enumerable: true, get: function () { return midnight_sdk_1.MAX_COLLATERALS_PER_BORROWER; } });
43
+ /** @deprecated Use `MIDNIGHT_MAX_COLLATERALS_PER_BORROWER` or the raw `/midnight/constants` subpath. */
20
44
  Object.defineProperty(exports, "MAX_COLLATERALS_PER_BORROWER", { enumerable: true, get: function () { return midnight_sdk_1.MAX_COLLATERALS_PER_BORROWER; } });
45
+ Object.defineProperty(exports, "MIDNIGHT_MAX_CONTINUOUS_FEE", { enumerable: true, get: function () { return midnight_sdk_1.MAX_CONTINUOUS_FEE; } });
46
+ /** @deprecated Use `MIDNIGHT_MAX_CONTINUOUS_FEE` or the raw `/midnight/constants` subpath. */
21
47
  Object.defineProperty(exports, "MAX_CONTINUOUS_FEE", { enumerable: true, get: function () { return midnight_sdk_1.MAX_CONTINUOUS_FEE; } });
48
+ Object.defineProperty(exports, "MIDNIGHT_MAX_OFFER_CAP", { enumerable: true, get: function () { return midnight_sdk_1.MAX_OFFER_CAP; } });
49
+ Object.defineProperty(exports, "MIDNIGHT_MAX_SETTLEMENT_FEES", { enumerable: true, get: function () { return midnight_sdk_1.MAX_SETTLEMENT_FEES; } });
50
+ /** @deprecated Use `MIDNIGHT_MAX_SETTLEMENT_FEES` or the raw `/midnight/constants` subpath. */
22
51
  Object.defineProperty(exports, "MAX_SETTLEMENT_FEES", { enumerable: true, get: function () { return midnight_sdk_1.MAX_SETTLEMENT_FEES; } });
52
+ Object.defineProperty(exports, "MIDNIGHT_MAX_TICK", { enumerable: true, get: function () { return midnight_sdk_1.MAX_TICK; } });
53
+ /** @deprecated Use `MIDNIGHT_MAX_TICK` or the raw `/midnight/constants` subpath. */
23
54
  Object.defineProperty(exports, "MAX_TICK", { enumerable: true, get: function () { return midnight_sdk_1.MAX_TICK; } });
55
+ Object.defineProperty(exports, "MIDNIGHT_OFFER_TYPEHASH", { enumerable: true, get: function () { return midnight_sdk_1.OFFER_TYPEHASH; } });
56
+ /** @deprecated Use `MIDNIGHT_OFFER_TYPEHASH` or the raw `/midnight/constants` subpath. */
24
57
  Object.defineProperty(exports, "OFFER_TYPEHASH", { enumerable: true, get: function () { return midnight_sdk_1.OFFER_TYPEHASH; } });
58
+ Object.defineProperty(exports, "MIDNIGHT_PRICE_ROUNDING_STEP", { enumerable: true, get: function () { return midnight_sdk_1.PRICE_ROUNDING_STEP; } });
59
+ /** @deprecated Use `MIDNIGHT_PRICE_ROUNDING_STEP` or the raw `/midnight/constants` subpath. */
25
60
  Object.defineProperty(exports, "PRICE_ROUNDING_STEP", { enumerable: true, get: function () { return midnight_sdk_1.PRICE_ROUNDING_STEP; } });
61
+ Object.defineProperty(exports, "MIDNIGHT_SETTLEMENT_FEE_BREAKPOINTS", { enumerable: true, get: function () { return midnight_sdk_1.SETTLEMENT_FEE_BREAKPOINTS; } });
62
+ /** @deprecated Use `MIDNIGHT_SETTLEMENT_FEE_BREAKPOINTS` or the raw `/midnight/constants` subpath. */
26
63
  Object.defineProperty(exports, "SETTLEMENT_FEE_BREAKPOINTS", { enumerable: true, get: function () { return midnight_sdk_1.SETTLEMENT_FEE_BREAKPOINTS; } });
64
+ Object.defineProperty(exports, "MIDNIGHT_TIME_TO_MAX_LIF", { enumerable: true, get: function () { return midnight_sdk_1.TIME_TO_MAX_LIF; } });
27
65
  var morpho_ts_1 = require("@morpho-org/morpho-ts");
28
66
  Object.defineProperty(exports, "BLUE_API_BASE_URL", { enumerable: true, get: function () { return morpho_ts_1.BLUE_API_BASE_URL; } });
29
67
  Object.defineProperty(exports, "BLUE_API_GRAPHQL_URL", { enumerable: true, get: function () { return morpho_ts_1.BLUE_API_GRAPHQL_URL; } });
@@ -407,9 +407,9 @@ export interface BlueActions {
407
407
  * @throws {ChainIdMismatchError} when the client chain does not match this market.
408
408
  * @throws {UnsupportedChainIdError} when the chain is absent from the address registry.
409
409
  * @throws {UnknownAddressError} when the chain has no BluePublicAllocator deployment.
410
- * @throws {UnknownFactory} when the chain has no Vault V2 factory.
411
- * @throws {UnknownOfFactory} when a requested address is not a Vault V2 from that factory.
412
- * @throws {UnsupportedVaultV2AdapterError} when a vault contains an unsupported adapter.
410
+ * @throws {UnknownBlueFactory} when the chain has no Vault V2 factory.
411
+ * @throws {UnknownBlueOfFactory} when a requested address is not a Vault V2 from that factory.
412
+ * @throws {UnsupportedBlueVaultV2AdapterError} when a vault contains an unsupported adapter.
413
413
  * @throws {viem.BaseError} when an RPC or contract read fails with no fallback left.
414
414
  */
415
415
  getVaultV2BlueReallocationData: (params: {
@@ -495,6 +495,7 @@ export interface BlueActions {
495
495
  * @throws {UnknownReallocationActiveAdaptersError} when active-adapter state is absent.
496
496
  * @throws {UnknownReallocationMarketPublicAllocatorConfigError} when an adapter-market allocator configuration is absent.
497
497
  * @throws {UnknownReallocationAllocationError} when required allocation state is absent.
498
+ * @throws {ReallocationAdapterSupplySharesUnderflowError} when an inconsistent adapter snapshot underflows during the final transition.
498
499
  * @throws {ReallocationAllocationUnderflowError} when an inconsistent allocation snapshot underflows during the final transition.
499
500
  * @throws {InsufficientSharedLiquidityError} when selected liquidity cannot cover the shortfall.
500
501
  * @throws {ReallocationWithdrawExceedsMarketSupplyError} when a withdrawal exceeds market supply.
@@ -681,9 +682,9 @@ export declare class MorphoBlue implements BlueActions {
681
682
  * @throws {ChainIdMismatchError} when the client chain does not match this market.
682
683
  * @throws {UnsupportedChainIdError} when the chain is absent from the address registry.
683
684
  * @throws {UnknownAddressError} when the chain has no BluePublicAllocator deployment.
684
- * @throws {UnknownFactory} when the chain has no Vault V2 factory.
685
- * @throws {UnknownOfFactory} when a requested address is not a Vault V2 from that factory.
686
- * @throws {UnsupportedVaultV2AdapterError} when a vault contains an unsupported adapter.
685
+ * @throws {UnknownBlueFactory} when the chain has no Vault V2 factory.
686
+ * @throws {UnknownBlueOfFactory} when a requested address is not a Vault V2 from that factory.
687
+ * @throws {UnsupportedBlueVaultV2AdapterError} when a vault contains an unsupported adapter.
687
688
  * @throws {viem.BaseError} when an RPC or contract read fails with no fallback left.
688
689
  * @example
689
690
  * ```ts
@@ -781,6 +782,7 @@ export declare class MorphoBlue implements BlueActions {
781
782
  * @throws {UnknownReallocationActiveAdaptersError} when active-adapter state is absent.
782
783
  * @throws {UnknownReallocationMarketPublicAllocatorConfigError} when an adapter-market allocator configuration is absent.
783
784
  * @throws {UnknownReallocationAllocationError} when required allocation state is absent.
785
+ * @throws {ReallocationAdapterSupplySharesUnderflowError} when an inconsistent adapter snapshot underflows during the final transition.
784
786
  * @throws {ReallocationAllocationUnderflowError} when an inconsistent allocation snapshot underflows during the final transition.
785
787
  * @throws {InsufficientSharedLiquidityError} when selected liquidity cannot cover the shortfall.
786
788
  * @throws {ReallocationWithdrawExceedsMarketSupplyError} when a withdrawal exceeds market supply.
@@ -1033,9 +1033,9 @@ class MorphoBlue {
1033
1033
  * @throws {ChainIdMismatchError} when the client chain does not match this market.
1034
1034
  * @throws {UnsupportedChainIdError} when the chain is absent from the address registry.
1035
1035
  * @throws {UnknownAddressError} when the chain has no BluePublicAllocator deployment.
1036
- * @throws {UnknownFactory} when the chain has no Vault V2 factory.
1037
- * @throws {UnknownOfFactory} when a requested address is not a Vault V2 from that factory.
1038
- * @throws {UnsupportedVaultV2AdapterError} when a vault contains an unsupported adapter.
1036
+ * @throws {UnknownBlueFactory} when the chain has no Vault V2 factory.
1037
+ * @throws {UnknownBlueOfFactory} when a requested address is not a Vault V2 from that factory.
1038
+ * @throws {UnsupportedBlueVaultV2AdapterError} when a vault contains an unsupported adapter.
1039
1039
  * @throws {viem.BaseError} when an RPC or contract read fails with no fallback left.
1040
1040
  * @example
1041
1041
  * ```ts
@@ -1189,6 +1189,7 @@ class MorphoBlue {
1189
1189
  * @throws {UnknownReallocationActiveAdaptersError} when active-adapter state is absent.
1190
1190
  * @throws {UnknownReallocationMarketPublicAllocatorConfigError} when an adapter-market allocator configuration is absent.
1191
1191
  * @throws {UnknownReallocationAllocationError} when required allocation state is absent.
1192
+ * @throws {ReallocationAdapterSupplySharesUnderflowError} when an inconsistent adapter snapshot underflows during the final transition.
1192
1193
  * @throws {ReallocationAllocationUnderflowError} when an inconsistent allocation snapshot underflows during the final transition.
1193
1194
  * @throws {InsufficientSharedLiquidityError} when selected liquidity cannot cover the shortfall.
1194
1195
  * @throws {ReallocationWithdrawExceedsMarketSupplyError} when a withdrawal exceeds market supply.
@@ -1,7 +1,66 @@
1
- export type { IAccrualPosition, IAccrualVault, IAccrualVaultV2, IAccrualVaultV2Adapter, IAccrualVaultV2MorphoMarketV1Adapter, IAccrualVaultV2MorphoMarketV1AdapterV2, IAccrualVaultV2MorphoVaultV1Adapter, IAssetBalances, IEip5267Domain, IHolding, IMarket, IMarketParams, IPosition, IPreLiquidationParams, IPreLiquidationPosition, IToken, IVault, IVaultConfig, IVaultMarketAllocation, IVaultMarketConfig, IVaultMarketPublicAllocatorConfig, IVaultToken, IVaultUser, IVaultV2, IVaultV2Adapter, IVaultV2Allocation, IVaultV2MorphoMarketV1Adapter, IVaultV2MorphoMarketV1AdapterV2, IVaultV2MorphoVaultV1Adapter, PeripheralBalance, PeripheralBalanceType, VaultPublicAllocatorConfig, } from "@morpho-org/blue-sdk";
2
- export { AccrualPosition, AccrualVault, AccrualVaultV2, AccrualVaultV2MorphoMarketV1Adapter, AccrualVaultV2MorphoMarketV1AdapterV2, AccrualVaultV2MorphoVaultV1Adapter, AssetBalances, ConstantWrappedToken, Eip5267Domain, ExchangeRateWrappedToken, Holding, Market, MarketParams, Position, PreLiquidationParams, PreLiquidationPosition, Token, User, Vault, VaultConfig, VaultMarketAllocation, VaultMarketConfig, VaultMarketPublicAllocatorConfig, VaultToken, VaultUser, VaultV2, VaultV2Adapter, VaultV2MorphoMarketV1Adapter, VaultV2MorphoMarketV1AdapterV2, VaultV2MorphoVaultV1Adapter, WrappedToken, } from "@morpho-org/blue-sdk";
1
+ export type { IAccrualPosition as IBlueAccrualPosition,
2
+ /** @deprecated Use `IBlueAccrualPosition` or the raw Blue subpath. */
3
+ IAccrualPosition, IAccrualVault, IAccrualVaultV2, IAccrualVaultV2Adapter, IAccrualVaultV2MorphoMarketV1Adapter, IAccrualVaultV2MorphoMarketV1AdapterV2, IAccrualVaultV2MorphoVaultV1Adapter, IAssetBalances, IEip5267Domain, IHolding, IMarket as IBlueMarket,
4
+ /** @deprecated Use `IBlueMarket` or the raw Blue subpath. */
5
+ IMarket, IMarketParams as IBlueMarketParams,
6
+ /** @deprecated Use `IBlueMarketParams` or the raw Blue subpath. */
7
+ IMarketParams, IPosition as IBluePosition,
8
+ /** @deprecated Use `IBluePosition` or the raw Blue subpath. */
9
+ IPosition, IPreLiquidationParams as IBluePreLiquidationParams,
10
+ /** @deprecated Use `IBluePreLiquidationParams` or the raw Blue subpath. */
11
+ IPreLiquidationParams, IPreLiquidationPosition as IBluePreLiquidationPosition,
12
+ /** @deprecated Use `IBluePreLiquidationPosition` or the raw Blue subpath. */
13
+ IPreLiquidationPosition, IToken, IVault, IVaultConfig, IVaultMarketAllocation, IVaultMarketConfig, IVaultMarketPublicAllocatorConfig, IVaultToken, IVaultUser, IVaultV2, IVaultV2Adapter, IVaultV2Allocation, IVaultV2BlueMarketPublicAllocatorConfig, IVaultV2BluePublicAllocatorConfig, IVaultV2MorphoMarketV1Adapter, IVaultV2MorphoMarketV1AdapterV2, IVaultV2MorphoVaultV1Adapter, PeripheralBalance, PeripheralBalanceType, VaultPublicAllocatorConfig, } from "@morpho-org/blue-sdk";
14
+ export { AccrualPosition as BlueAccrualPosition,
15
+ /** @deprecated Use `BlueAccrualPosition` or the raw Blue subpath. */
16
+ AccrualPosition, AccrualVault, AccrualVaultV2, AccrualVaultV2MorphoMarketV1Adapter, AccrualVaultV2MorphoMarketV1AdapterV2, AccrualVaultV2MorphoVaultV1Adapter, AssetBalances, ConstantWrappedToken, Eip5267Domain, ExchangeRateWrappedToken, Holding, Market as BlueMarket,
17
+ /** @deprecated Use `BlueMarket` or the raw Blue subpath. */
18
+ Market, MarketParams as BlueMarketParams,
19
+ /** @deprecated Use `BlueMarketParams` or the raw Blue subpath. */
20
+ MarketParams, Position as BluePosition,
21
+ /** @deprecated Use `BluePosition` or the raw Blue subpath. */
22
+ Position, PreLiquidationParams as BluePreLiquidationParams,
23
+ /** @deprecated Use `BluePreLiquidationParams` or the raw Blue subpath. */
24
+ PreLiquidationParams, PreLiquidationPosition as BluePreLiquidationPosition,
25
+ /** @deprecated Use `BluePreLiquidationPosition` or the raw Blue subpath. */
26
+ PreLiquidationPosition, Token, User as BlueUser,
27
+ /** @deprecated Use `BlueUser` or the raw Blue subpath. */
28
+ User, Vault, VaultConfig, VaultMarketAllocation, VaultMarketConfig, VaultMarketPublicAllocatorConfig, VaultToken, VaultUser, VaultV2, VaultV2Adapter, VaultV2BlueMarketPublicAllocatorConfig, VaultV2BluePublicAllocatorConfig, VaultV2MorphoMarketV1Adapter, VaultV2MorphoMarketV1AdapterV2, VaultV2MorphoVaultV1Adapter, WrappedToken, } from "@morpho-org/blue-sdk";
29
+ export type { BuildOfferParams as MidnightBuildOfferParams, CollateralParams as MidnightCollateralParams, GroupInput as MidnightGroupInput, IAccrualPosition as IMidnightAccrualPosition, ICollateralParams as IMidnightCollateralParams, IGroup as IMidnightGroup, IMarket as IMidnightMarket, IMarketParams as IMidnightMarketParams, IOffer as IMidnightOffer, IPosition as IMidnightPosition, MarketInput as MidnightMarketInput, OfferStruct as MidnightOfferStruct, RatifierTreeInput as MidnightRatifierTreeInput, SettlementFeeCbps as MidnightSettlementFeeCbps, TreeCreateParams as MidnightTreeCreateParams, TreeDescriptor as MidnightTreeDescriptor, TreeInput as MidnightTreeInput, TreeLike as MidnightTreeLike, TreeMempoolValidateParams as MidnightTreeMempoolValidateParams, TreeMempoolValidateRatification as MidnightTreeMempoolValidateRatification, TreeProof as MidnightTreeProof, } from "@morpho-org/midnight-sdk";
30
+ export { AccrualPosition as MidnightAccrualPosition, Group as MidnightGroup, Market as MidnightMarket, MarketParams as MidnightMarketParams, Offer as MidnightOffer, Position as MidnightPosition, Tree as MidnightTree, } from "@morpho-org/midnight-sdk";
3
31
  export { MorphoBlue } from "./blue/index.js";
4
- export * from "./midnight/index.js";
32
+ export type { GetOffersDataParams as MidnightGetOffersDataParams,
33
+ /** @deprecated Use `MidnightGetOffersDataParams`. */
34
+ GetOffersDataParams, GetPositionDataParams as MidnightGetPositionDataParams,
35
+ /** @deprecated Use `MidnightGetPositionDataParams`. */
36
+ GetPositionDataParams, MakeLendParams as MidnightMakeLendParams,
37
+ /** @deprecated Use `MidnightMakeLendParams`. */
38
+ MakeLendParams, MakeOffersOutput as MidnightMakeOffersOutput,
39
+ /** @deprecated Use `MidnightMakeOffersOutput`. */
40
+ MakeOffersOutput, MakeOffersParams as MidnightMakeOffersParams,
41
+ /** @deprecated Use `MidnightMakeOffersParams`. */
42
+ MakeOffersParams, MarketActionParams as MidnightMarketActionParams,
43
+ /** @deprecated Use `MidnightMarketActionParams`. */
44
+ MarketActionParams, OffersData as MidnightOffersData,
45
+ /** @deprecated Use `MidnightOffersData`. */
46
+ OffersData, OfferValidationParams as MidnightOfferValidationParams,
47
+ /** @deprecated Use `MidnightOfferValidationParams`. */
48
+ OfferValidationParams, RedeemParams as MidnightRedeemParams,
49
+ /** @deprecated Use `MidnightRedeemParams`. */
50
+ RedeemParams, RepayWithdrawCollateralParams as MidnightRepayWithdrawCollateralParams,
51
+ /** @deprecated Use `MidnightRepayWithdrawCollateralParams`. */
52
+ RepayWithdrawCollateralParams, SupplyCollateralMakeBorrowParams as MidnightSupplyCollateralMakeBorrowParams,
53
+ /** @deprecated Use `MidnightSupplyCollateralMakeBorrowParams`. */
54
+ SupplyCollateralMakeBorrowParams, SupplyCollateralParams as MidnightSupplyCollateralParams,
55
+ /** @deprecated Use `MidnightSupplyCollateralParams`. */
56
+ SupplyCollateralParams, SupplyCollateralTakeBorrowParams as MidnightSupplyCollateralTakeBorrowParams,
57
+ /** @deprecated Use `MidnightSupplyCollateralTakeBorrowParams`. */
58
+ SupplyCollateralTakeBorrowParams, TakeBorrowParams as MidnightTakeBorrowParams,
59
+ /** @deprecated Use `MidnightTakeBorrowParams`. */
60
+ TakeBorrowParams, TakeLendParams as MidnightTakeLendParams,
61
+ /** @deprecated Use `MidnightTakeLendParams`. */
62
+ TakeLendParams, } from "./midnight/index.js";
63
+ export { type MidnightActionOutput, type MidnightActionSignatures, type MidnightActions, MorphoMidnight, } from "./midnight/index.js";
5
64
  export { MorphoVaultV1 } from "./vaultV1/index.js";
6
65
  export { type InputReallocationData, type InputVaultV1ReallocationData, ReallocationData, VaultV1ReallocationData, } from "./vaultV1ReallocationData.js";
7
66
  export { MorphoVaultV2 } from "./vaultV2/index.js";
@@ -1,21 +1,10 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
2
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.VaultV2BlueReallocationData = exports.MorphoVaultV2 = exports.VaultV1ReallocationData = exports.ReallocationData = exports.MorphoVaultV1 = exports.MorphoBlue = exports.WrappedToken = exports.VaultV2MorphoVaultV1Adapter = exports.VaultV2MorphoMarketV1AdapterV2 = exports.VaultV2MorphoMarketV1Adapter = exports.VaultV2Adapter = exports.VaultV2 = exports.VaultUser = exports.VaultToken = exports.VaultMarketPublicAllocatorConfig = exports.VaultMarketConfig = exports.VaultMarketAllocation = exports.VaultConfig = exports.Vault = exports.User = exports.Token = exports.PreLiquidationPosition = exports.PreLiquidationParams = exports.Position = exports.MarketParams = exports.Market = exports.Holding = exports.ExchangeRateWrappedToken = exports.Eip5267Domain = exports.ConstantWrappedToken = exports.AssetBalances = exports.AccrualVaultV2MorphoVaultV1Adapter = exports.AccrualVaultV2MorphoMarketV1AdapterV2 = exports.AccrualVaultV2MorphoMarketV1Adapter = exports.AccrualVaultV2 = exports.AccrualVault = exports.AccrualPosition = void 0;
3
+ exports.MorphoVaultV1 = exports.MorphoMidnight = exports.MorphoBlue = exports.MidnightTree = exports.MidnightPosition = exports.MidnightOffer = exports.MidnightMarketParams = exports.MidnightMarket = exports.MidnightGroup = exports.MidnightAccrualPosition = exports.WrappedToken = exports.VaultV2MorphoVaultV1Adapter = exports.VaultV2MorphoMarketV1AdapterV2 = exports.VaultV2MorphoMarketV1Adapter = exports.VaultV2BluePublicAllocatorConfig = exports.VaultV2BlueMarketPublicAllocatorConfig = exports.VaultV2Adapter = exports.VaultV2 = exports.VaultUser = exports.VaultToken = exports.VaultMarketPublicAllocatorConfig = exports.VaultMarketConfig = exports.VaultMarketAllocation = exports.VaultConfig = exports.Vault = exports.User = exports.BlueUser = exports.Token = exports.PreLiquidationPosition = exports.BluePreLiquidationPosition = exports.PreLiquidationParams = exports.BluePreLiquidationParams = exports.Position = exports.BluePosition = exports.MarketParams = exports.BlueMarketParams = exports.Market = exports.BlueMarket = exports.Holding = exports.ExchangeRateWrappedToken = exports.Eip5267Domain = exports.ConstantWrappedToken = exports.AssetBalances = exports.AccrualVaultV2MorphoVaultV1Adapter = exports.AccrualVaultV2MorphoMarketV1AdapterV2 = exports.AccrualVaultV2MorphoMarketV1Adapter = exports.AccrualVaultV2 = exports.AccrualVault = exports.AccrualPosition = exports.BlueAccrualPosition = void 0;
4
+ exports.VaultV2BlueReallocationData = exports.MorphoVaultV2 = exports.VaultV1ReallocationData = exports.ReallocationData = void 0;
18
5
  var blue_sdk_1 = require("@morpho-org/blue-sdk");
6
+ Object.defineProperty(exports, "BlueAccrualPosition", { enumerable: true, get: function () { return blue_sdk_1.AccrualPosition; } });
7
+ /** @deprecated Use `BlueAccrualPosition` or the raw Blue subpath. */
19
8
  Object.defineProperty(exports, "AccrualPosition", { enumerable: true, get: function () { return blue_sdk_1.AccrualPosition; } });
20
9
  Object.defineProperty(exports, "AccrualVault", { enumerable: true, get: function () { return blue_sdk_1.AccrualVault; } });
21
10
  Object.defineProperty(exports, "AccrualVaultV2", { enumerable: true, get: function () { return blue_sdk_1.AccrualVaultV2; } });
@@ -27,12 +16,24 @@ Object.defineProperty(exports, "ConstantWrappedToken", { enumerable: true, get:
27
16
  Object.defineProperty(exports, "Eip5267Domain", { enumerable: true, get: function () { return blue_sdk_1.Eip5267Domain; } });
28
17
  Object.defineProperty(exports, "ExchangeRateWrappedToken", { enumerable: true, get: function () { return blue_sdk_1.ExchangeRateWrappedToken; } });
29
18
  Object.defineProperty(exports, "Holding", { enumerable: true, get: function () { return blue_sdk_1.Holding; } });
19
+ Object.defineProperty(exports, "BlueMarket", { enumerable: true, get: function () { return blue_sdk_1.Market; } });
20
+ /** @deprecated Use `BlueMarket` or the raw Blue subpath. */
30
21
  Object.defineProperty(exports, "Market", { enumerable: true, get: function () { return blue_sdk_1.Market; } });
22
+ Object.defineProperty(exports, "BlueMarketParams", { enumerable: true, get: function () { return blue_sdk_1.MarketParams; } });
23
+ /** @deprecated Use `BlueMarketParams` or the raw Blue subpath. */
31
24
  Object.defineProperty(exports, "MarketParams", { enumerable: true, get: function () { return blue_sdk_1.MarketParams; } });
25
+ Object.defineProperty(exports, "BluePosition", { enumerable: true, get: function () { return blue_sdk_1.Position; } });
26
+ /** @deprecated Use `BluePosition` or the raw Blue subpath. */
32
27
  Object.defineProperty(exports, "Position", { enumerable: true, get: function () { return blue_sdk_1.Position; } });
28
+ Object.defineProperty(exports, "BluePreLiquidationParams", { enumerable: true, get: function () { return blue_sdk_1.PreLiquidationParams; } });
29
+ /** @deprecated Use `BluePreLiquidationParams` or the raw Blue subpath. */
33
30
  Object.defineProperty(exports, "PreLiquidationParams", { enumerable: true, get: function () { return blue_sdk_1.PreLiquidationParams; } });
31
+ Object.defineProperty(exports, "BluePreLiquidationPosition", { enumerable: true, get: function () { return blue_sdk_1.PreLiquidationPosition; } });
32
+ /** @deprecated Use `BluePreLiquidationPosition` or the raw Blue subpath. */
34
33
  Object.defineProperty(exports, "PreLiquidationPosition", { enumerable: true, get: function () { return blue_sdk_1.PreLiquidationPosition; } });
35
34
  Object.defineProperty(exports, "Token", { enumerable: true, get: function () { return blue_sdk_1.Token; } });
35
+ Object.defineProperty(exports, "BlueUser", { enumerable: true, get: function () { return blue_sdk_1.User; } });
36
+ /** @deprecated Use `BlueUser` or the raw Blue subpath. */
36
37
  Object.defineProperty(exports, "User", { enumerable: true, get: function () { return blue_sdk_1.User; } });
37
38
  Object.defineProperty(exports, "Vault", { enumerable: true, get: function () { return blue_sdk_1.Vault; } });
38
39
  Object.defineProperty(exports, "VaultConfig", { enumerable: true, get: function () { return blue_sdk_1.VaultConfig; } });
@@ -43,19 +44,30 @@ Object.defineProperty(exports, "VaultToken", { enumerable: true, get: function (
43
44
  Object.defineProperty(exports, "VaultUser", { enumerable: true, get: function () { return blue_sdk_1.VaultUser; } });
44
45
  Object.defineProperty(exports, "VaultV2", { enumerable: true, get: function () { return blue_sdk_1.VaultV2; } });
45
46
  Object.defineProperty(exports, "VaultV2Adapter", { enumerable: true, get: function () { return blue_sdk_1.VaultV2Adapter; } });
47
+ Object.defineProperty(exports, "VaultV2BlueMarketPublicAllocatorConfig", { enumerable: true, get: function () { return blue_sdk_1.VaultV2BlueMarketPublicAllocatorConfig; } });
48
+ Object.defineProperty(exports, "VaultV2BluePublicAllocatorConfig", { enumerable: true, get: function () { return blue_sdk_1.VaultV2BluePublicAllocatorConfig; } });
46
49
  Object.defineProperty(exports, "VaultV2MorphoMarketV1Adapter", { enumerable: true, get: function () { return blue_sdk_1.VaultV2MorphoMarketV1Adapter; } });
47
50
  Object.defineProperty(exports, "VaultV2MorphoMarketV1AdapterV2", { enumerable: true, get: function () { return blue_sdk_1.VaultV2MorphoMarketV1AdapterV2; } });
48
51
  Object.defineProperty(exports, "VaultV2MorphoVaultV1Adapter", { enumerable: true, get: function () { return blue_sdk_1.VaultV2MorphoVaultV1Adapter; } });
49
52
  Object.defineProperty(exports, "WrappedToken", { enumerable: true, get: function () { return blue_sdk_1.WrappedToken; } });
53
+ var midnight_sdk_1 = require("@morpho-org/midnight-sdk");
54
+ Object.defineProperty(exports, "MidnightAccrualPosition", { enumerable: true, get: function () { return midnight_sdk_1.AccrualPosition; } });
55
+ Object.defineProperty(exports, "MidnightGroup", { enumerable: true, get: function () { return midnight_sdk_1.Group; } });
56
+ Object.defineProperty(exports, "MidnightMarket", { enumerable: true, get: function () { return midnight_sdk_1.Market; } });
57
+ Object.defineProperty(exports, "MidnightMarketParams", { enumerable: true, get: function () { return midnight_sdk_1.MarketParams; } });
58
+ Object.defineProperty(exports, "MidnightOffer", { enumerable: true, get: function () { return midnight_sdk_1.Offer; } });
59
+ Object.defineProperty(exports, "MidnightPosition", { enumerable: true, get: function () { return midnight_sdk_1.Position; } });
60
+ Object.defineProperty(exports, "MidnightTree", { enumerable: true, get: function () { return midnight_sdk_1.Tree; } });
50
61
  var index_js_1 = require("./blue/index.js");
51
62
  Object.defineProperty(exports, "MorphoBlue", { enumerable: true, get: function () { return index_js_1.MorphoBlue; } });
52
- __exportStar(require("./midnight/index.js"), exports);
53
- var index_js_2 = require("./vaultV1/index.js");
54
- Object.defineProperty(exports, "MorphoVaultV1", { enumerable: true, get: function () { return index_js_2.MorphoVaultV1; } });
63
+ var index_js_2 = require("./midnight/index.js");
64
+ Object.defineProperty(exports, "MorphoMidnight", { enumerable: true, get: function () { return index_js_2.MorphoMidnight; } });
65
+ var index_js_3 = require("./vaultV1/index.js");
66
+ Object.defineProperty(exports, "MorphoVaultV1", { enumerable: true, get: function () { return index_js_3.MorphoVaultV1; } });
55
67
  var vaultV1ReallocationData_js_1 = require("./vaultV1ReallocationData.js");
56
68
  Object.defineProperty(exports, "ReallocationData", { enumerable: true, get: function () { return vaultV1ReallocationData_js_1.ReallocationData; } });
57
69
  Object.defineProperty(exports, "VaultV1ReallocationData", { enumerable: true, get: function () { return vaultV1ReallocationData_js_1.VaultV1ReallocationData; } });
58
- var index_js_3 = require("./vaultV2/index.js");
59
- Object.defineProperty(exports, "MorphoVaultV2", { enumerable: true, get: function () { return index_js_3.MorphoVaultV2; } });
70
+ var index_js_4 = require("./vaultV2/index.js");
71
+ Object.defineProperty(exports, "MorphoVaultV2", { enumerable: true, get: function () { return index_js_4.MorphoVaultV2; } });
60
72
  var vaultV2BlueReallocationData_js_1 = require("./vaultV2BlueReallocationData.js");
61
73
  Object.defineProperty(exports, "VaultV2BlueReallocationData", { enumerable: true, get: function () { return vaultV2BlueReallocationData_js_1.VaultV2BlueReallocationData; } });
@@ -94,7 +94,7 @@ export declare class VaultV2BlueReallocationData implements InputVaultV2BlueReal
94
94
  * Creates a cloned Vault V2 reallocation snapshot.
95
95
  *
96
96
  * @param input - State fetched at one consistent block.
97
- * @throws {UnsupportedVaultV2AdapterError} when a vault contains an unsupported adapter type.
97
+ * @throws {UnsupportedBlueVaultV2AdapterError} when a vault contains an unsupported adapter type.
98
98
  */
99
99
  constructor(input: InputVaultV2BlueReallocationData);
100
100
  /**
@@ -365,10 +365,11 @@ export declare class VaultV2BlueReallocationData implements InputVaultV2BlueReal
365
365
  * `options.maxPenalty` are ignored. By default, only zero-penalty vaults are
366
366
  * considered.
367
367
  *
368
- * Shared-cap discovery is conservative: when the non-shared maximum violates
369
- * a shared cap, the candidate is omitted instead of scanning smaller base-unit
370
- * amounts for a rounding-only fit. This keeps planning bounded but can
371
- * understate executable liquidity in an already-at-or-over-cap snapshot.
368
+ * Shared-cap discovery is conservative. Operation planning searches at most
369
+ * 1,024 base units above its targeted amount for the nearest executable fit.
370
+ * Full-liquidity discovery omits a candidate when its non-shared maximum
371
+ * violates a shared cap instead of scanning smaller base-unit amounts. These
372
+ * bounds can understate executable liquidity in rounding-only edge cases.
372
373
  *
373
374
  * @param marketId - Target Blue market id.
374
375
  * @param options - Optional discovery controls and operation to support.
@@ -382,7 +383,6 @@ export declare class VaultV2BlueReallocationData implements InputVaultV2BlueReal
382
383
  * @throws {UnknownReallocationActiveAdaptersError} when active-adapter state is absent for a vault.
383
384
  * @throws {UnknownReallocationMarketPublicAllocatorConfigError} when an adapter-market allocator configuration is absent.
384
385
  * @throws {UnknownReallocationAllocationError} when required allocation state is absent.
385
- * @throws {ReallocationAllocationUnderflowError} when an inconsistent allocation snapshot underflows during the final transition.
386
386
  * @throws {InsufficientSharedLiquidityError} when selected liquidity cannot cover the absolute shortfall.
387
387
  * @throws {ReallocationWithdrawExceedsMarketSupplyError} when a withdraw exceeds market supply.
388
388
  * @example
@@ -6,6 +6,7 @@ const morpho_ts_1 = require("@morpho-org/morpho-ts");
6
6
  const viem_1 = require("viem");
7
7
  const constant_js_1 = require("../helpers/constant.js");
8
8
  const index_js_1 = require("../types/index.js");
9
+ const MAX_SHARED_CAP_SEARCH_STEPS = 1024n;
9
10
  /** Creates isolated transaction-scoped state for one simulation. @internal */
10
11
  const createSimulationContext = () => ({
11
12
  donatedPenaltyAssets: {},
@@ -186,7 +187,7 @@ class VaultV2BlueReallocationData {
186
187
  * Creates a cloned Vault V2 reallocation snapshot.
187
188
  *
188
189
  * @param input - State fetched at one consistent block.
189
- * @throws {UnsupportedVaultV2AdapterError} when a vault contains an unsupported adapter type.
190
+ * @throws {UnsupportedBlueVaultV2AdapterError} when a vault contains an unsupported adapter type.
190
191
  */
191
192
  constructor(input) {
192
193
  const isClone = input instanceof VaultV2BlueReallocationData;
@@ -572,10 +573,11 @@ class VaultV2BlueReallocationData {
572
573
  * `options.maxPenalty` are ignored. By default, only zero-penalty vaults are
573
574
  * considered.
574
575
  *
575
- * Shared-cap discovery is conservative: when the non-shared maximum violates
576
- * a shared cap, the candidate is omitted instead of scanning smaller base-unit
577
- * amounts for a rounding-only fit. This keeps planning bounded but can
578
- * understate executable liquidity in an already-at-or-over-cap snapshot.
576
+ * Shared-cap discovery is conservative. Operation planning searches at most
577
+ * 1,024 base units above its targeted amount for the nearest executable fit.
578
+ * Full-liquidity discovery omits a candidate when its non-shared maximum
579
+ * violates a shared cap instead of scanning smaller base-unit amounts. These
580
+ * bounds can understate executable liquidity in rounding-only edge cases.
579
581
  *
580
582
  * @param marketId - Target Blue market id.
581
583
  * @param options - Optional discovery controls and operation to support.
@@ -589,7 +591,6 @@ class VaultV2BlueReallocationData {
589
591
  * @throws {UnknownReallocationActiveAdaptersError} when active-adapter state is absent for a vault.
590
592
  * @throws {UnknownReallocationMarketPublicAllocatorConfigError} when an adapter-market allocator configuration is absent.
591
593
  * @throws {UnknownReallocationAllocationError} when required allocation state is absent.
592
- * @throws {ReallocationAllocationUnderflowError} when an inconsistent allocation snapshot underflows during the final transition.
593
594
  * @throws {InsufficientSharedLiquidityError} when selected liquidity cannot cover the absolute shortfall.
594
595
  * @throws {ReallocationWithdrawExceedsMarketSupplyError} when a withdraw exceeds market supply.
595
596
  * @example
@@ -874,13 +875,9 @@ class VaultV2BlueReallocationData {
874
875
  }), index_js_1.ReallocationAllocationUnderflowError, index_js_1.ReallocationAdapterSupplySharesUnderflowError);
875
876
  if (postTransition == null)
876
877
  return;
877
- const postVault = postTransition.data.getVault(reallocation.vault);
878
878
  // Vault V2 checks relative caps against the transient firstTotalAssets,
879
879
  // which stays fixed after the vault's first allocation in a transaction.
880
- const firstTotalAssetsKey = findAddressKey(postTransition.context.firstTotalAssets, reallocation.vault);
881
- const firstTotalAssets = (firstTotalAssetsKey == null
882
- ? undefined
883
- : postTransition.context.firstTotalAssets[firstTotalAssetsKey]) ?? postVault._totalAssets;
880
+ const { firstTotalAssets } = postTransition;
884
881
  let withinUpperBounds = true;
885
882
  let withinAllCaps = true;
886
883
  for (const id of targetIds) {
@@ -898,8 +895,7 @@ class VaultV2BlueReallocationData {
898
895
  };
899
896
  // Non-shared target IDs impose monotonic upper bounds. Shared IDs
900
897
  // can impose lower bounds and non-monotonic rounding constraints,
901
- // so validate them after selecting the non-shared maximum. If that
902
- // maximum fails, omit the candidate instead of scanning base units.
898
+ // so validate them after selecting the non-shared maximum.
903
899
  let probeUpper = true;
904
900
  while (lower < upper) {
905
901
  const assets = probeUpper ? upper : (lower + upper + 1n) / 2n;
@@ -913,24 +909,15 @@ class VaultV2BlueReallocationData {
913
909
  let probe = selectedAssets > 0n
914
910
  ? probeReallocation(selectedAssets)
915
911
  : undefined;
916
- if (remainingAssets != null &&
917
- selectedAssets > 0n &&
918
- probe?.withinAllCaps !== true &&
919
- lower > selectedAssets &&
920
- probeReallocation(lower)?.withinAllCaps === true) {
921
- let infeasible = selectedAssets;
922
- let feasible = lower;
923
- while (infeasible + 1n < feasible) {
924
- const midpoint = (infeasible + feasible) / 2n;
925
- if (probeReallocation(midpoint)?.withinAllCaps === true) {
926
- feasible = midpoint;
927
- }
928
- else {
929
- infeasible = midpoint;
930
- }
912
+ if (remainingAssets != null && probe?.withinAllCaps !== true) {
913
+ // Bound the base-unit scan; expose a caller ceiling if wider searches become necessary.
914
+ const searchUpper = blue_sdk_1.MathLib.min(lower, selectedAssets + MAX_SHARED_CAP_SEARCH_STEPS);
915
+ while (selectedAssets > 0n &&
916
+ selectedAssets < searchUpper &&
917
+ probe?.withinAllCaps !== true) {
918
+ selectedAssets += 1n;
919
+ probe = probeReallocation(selectedAssets);
931
920
  }
932
- selectedAssets = feasible;
933
- probe = probeReallocation(selectedAssets);
934
921
  }
935
922
  if (selectedAssets > 0n && probe?.withinAllCaps === true)
936
923
  capCompatibleCandidates.push({
@@ -1147,6 +1134,7 @@ class VaultV2BlueReallocationData {
1147
1134
  const allocationsKey = findAddressKey(data.mutableAllocations, reallocation.vault) ??
1148
1135
  reallocation.vault;
1149
1136
  const firstTotalAssetsKey = findAddressKey(context.firstTotalAssets, reallocation.vault) ?? vaultKey;
1137
+ let firstTotalAssets = context.firstTotalAssets[firstTotalAssetsKey];
1150
1138
  let nextContext = context;
1151
1139
  let vault = data.getMutableVault(vaultKey);
1152
1140
  const targetMarket = data.getMarket(targetMarketId);
@@ -1206,7 +1194,7 @@ class VaultV2BlueReallocationData {
1206
1194
  }
1207
1195
  vault.assetBalance += reallocation.assets;
1208
1196
  }
1209
- if (context.firstTotalAssets[firstTotalAssetsKey] == null) {
1197
+ if (firstTotalAssets == null) {
1210
1198
  // Vault V2's transient firstTotalAssets tracks the first allocation in a
1211
1199
  // transaction independently from elapsed time. Later allocations must not
1212
1200
  // recompute the denominator, even if their simulated balances have changed.
@@ -1221,11 +1209,12 @@ class VaultV2BlueReallocationData {
1221
1209
  vault = vault.accrueInterest(timestamp).vault;
1222
1210
  }
1223
1211
  data.mutableVaults[vaultKey] = vault;
1212
+ firstTotalAssets = vault._totalAssets;
1224
1213
  nextContext = {
1225
1214
  ...nextContext,
1226
1215
  firstTotalAssets: {
1227
1216
  ...nextContext.firstTotalAssets,
1228
- [firstTotalAssetsKey]: vault._totalAssets,
1217
+ [firstTotalAssetsKey]: firstTotalAssets,
1229
1218
  },
1230
1219
  };
1231
1220
  }
@@ -1260,7 +1249,7 @@ class VaultV2BlueReallocationData {
1260
1249
  };
1261
1250
  }
1262
1251
  vault.assetBalance -= reallocation.assets;
1263
- return { data, context: nextContext };
1252
+ return { data, context: nextContext, firstTotalAssets };
1264
1253
  }
1265
1254
  /** Updates canonical markets in bulk and refreshes only dependent adapter views. */
1266
1255
  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";