@morpho-org/morpho-sdk 5.9.0 → 6.0.0-next.1

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 (243) hide show
  1. package/MIGRATION-v5-to-v6.md +404 -0
  2. package/README.md +127 -69
  3. package/lib/cjs/abis.d.ts +210 -0
  4. package/lib/cjs/abis.js +142 -2
  5. package/lib/cjs/actions/blue/borrow.d.ts +62 -61
  6. package/lib/cjs/actions/blue/borrow.js +48 -80
  7. package/lib/cjs/actions/blue/common.d.ts +86 -0
  8. package/lib/cjs/actions/blue/common.js +205 -0
  9. package/lib/cjs/actions/blue/refinance.d.ts +72 -112
  10. package/lib/cjs/actions/blue/refinance.js +97 -199
  11. package/lib/cjs/actions/blue/repay.d.ts +72 -68
  12. package/lib/cjs/actions/blue/repay.js +56 -118
  13. package/lib/cjs/actions/blue/repayWithdrawCollateral.d.ts +85 -90
  14. package/lib/cjs/actions/blue/repayWithdrawCollateral.js +148 -137
  15. package/lib/cjs/actions/blue/supply.d.ts +62 -45
  16. package/lib/cjs/actions/blue/supply.js +94 -70
  17. package/lib/cjs/actions/blue/supplyCollateral.d.ts +63 -40
  18. package/lib/cjs/actions/blue/supplyCollateral.js +52 -69
  19. package/lib/cjs/actions/blue/supplyCollateralBorrow.d.ts +82 -90
  20. package/lib/cjs/actions/blue/supplyCollateralBorrow.js +133 -120
  21. package/lib/cjs/actions/blue/withdraw.d.ts +68 -79
  22. package/lib/cjs/actions/blue/withdraw.js +101 -97
  23. package/lib/cjs/actions/blue/withdrawCollateral.d.ts +56 -28
  24. package/lib/cjs/actions/blue/withdrawCollateral.js +45 -50
  25. package/lib/cjs/actions/bundles/common.d.ts +200 -0
  26. package/lib/cjs/actions/bundles/common.js +469 -0
  27. package/lib/cjs/actions/bundles/index.d.ts +3 -0
  28. package/lib/cjs/actions/bundles/index.js +23 -0
  29. package/lib/cjs/actions/bundles/resolveBundlesTokenRequirements.d.ts +76 -0
  30. package/lib/cjs/actions/bundles/resolveBundlesTokenRequirements.js +125 -0
  31. package/lib/cjs/actions/index.d.ts +2 -1
  32. package/lib/cjs/actions/index.js +1 -0
  33. package/lib/cjs/actions/midnight/supplyCollateralTakeBorrow.d.ts +2 -2
  34. package/lib/cjs/actions/midnight/supplyCollateralTakeBorrow.js +2 -2
  35. package/lib/cjs/actions/midnight/takeBorrow.d.ts +2 -2
  36. package/lib/cjs/actions/midnight/takeBorrow.js +2 -2
  37. package/lib/cjs/actions/midnight/takeLend.d.ts +2 -2
  38. package/lib/cjs/actions/midnight/takeLend.js +2 -2
  39. package/lib/cjs/actions/requirements/blue/getBlueAuthorizationRequirement.d.ts +29 -17
  40. package/lib/cjs/actions/requirements/blue/getBlueAuthorizationRequirement.js +60 -19
  41. package/lib/cjs/actions/requirements/blue/getUnusedPermit2Nonce.d.ts +48 -0
  42. package/lib/cjs/actions/requirements/blue/getUnusedPermit2Nonce.js +72 -0
  43. package/lib/cjs/actions/requirements/blue/index.d.ts +1 -0
  44. package/lib/cjs/actions/requirements/blue/index.js +1 -0
  45. package/lib/cjs/actions/requirements/encode/encodeBlueSignatureAuthorization.d.ts +10 -7
  46. package/lib/cjs/actions/requirements/encode/encodeBlueSignatureAuthorization.js +30 -5
  47. package/lib/cjs/actions/requirements/encode/encodeErc20Approval.d.ts +2 -1
  48. package/lib/cjs/actions/requirements/encode/encodeErc20Approval.js +8 -2
  49. package/lib/cjs/actions/requirements/encode/encodeErc20Permit.d.ts +16 -7
  50. package/lib/cjs/actions/requirements/encode/encodeErc20Permit.js +39 -6
  51. package/lib/cjs/actions/requirements/encode/encodeErc20Permit2SignatureTransfer.d.ts +61 -0
  52. package/lib/cjs/actions/requirements/encode/encodeErc20Permit2SignatureTransfer.js +123 -0
  53. package/lib/cjs/actions/requirements/encode/encodeVaultSharesPermit.d.ts +4 -4
  54. package/lib/cjs/actions/requirements/encode/encodeVaultSharesPermit.js +6 -5
  55. package/lib/cjs/actions/requirements/encode/index.d.ts +1 -0
  56. package/lib/cjs/actions/requirements/encode/index.js +1 -0
  57. package/lib/cjs/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit.d.ts +1 -1
  58. package/lib/cjs/actions/requirements/getRequirementsApproval.d.ts +6 -4
  59. package/lib/cjs/actions/requirements/getRequirementsApproval.js +6 -4
  60. package/lib/cjs/actions/signatures/getTokenRequirementActions.d.ts +1 -0
  61. package/lib/cjs/actions/signatures/getTokenRequirementActions.js +4 -0
  62. package/lib/cjs/actions/signatures/getVaultExitBundlesV1PermitStruct.d.ts +22 -30
  63. package/lib/cjs/actions/signatures/getVaultExitBundlesV1PermitStruct.js +18 -66
  64. package/lib/cjs/actions/vaultV1/deposit.d.ts +73 -57
  65. package/lib/cjs/actions/vaultV1/deposit.js +110 -109
  66. package/lib/cjs/actions/vaultV1/migrateToV2.d.ts +43 -66
  67. package/lib/cjs/actions/vaultV1/migrateToV2.js +91 -104
  68. package/lib/cjs/actions/vaultV1/redeem.d.ts +30 -23
  69. package/lib/cjs/actions/vaultV1/redeem.js +56 -33
  70. package/lib/cjs/actions/vaultV1/withdraw.d.ts +58 -24
  71. package/lib/cjs/actions/vaultV1/withdraw.js +86 -34
  72. package/lib/cjs/actions/vaultV2/deposit.d.ts +74 -57
  73. package/lib/cjs/actions/vaultV2/deposit.js +111 -109
  74. package/lib/cjs/actions/vaultV2/redeem.d.ts +30 -24
  75. package/lib/cjs/actions/vaultV2/redeem.js +56 -34
  76. package/lib/cjs/actions/vaultV2/withdraw.d.ts +58 -25
  77. package/lib/cjs/actions/vaultV2/withdraw.js +86 -35
  78. package/lib/cjs/bundler/actions.d.ts +4 -4
  79. package/lib/cjs/bundler/actions.js +4 -4
  80. package/lib/cjs/client/morphoViemExtension.d.ts +2 -1
  81. package/lib/cjs/client/morphoViemExtension.js +2 -1
  82. package/lib/cjs/entities/blue/blue.d.ts +806 -374
  83. package/lib/cjs/entities/blue/blue.js +449 -696
  84. package/lib/cjs/entities/index.d.ts +2 -0
  85. package/lib/cjs/entities/index.js +15 -0
  86. package/lib/cjs/entities/midnight/midnight.d.ts +2 -2
  87. package/lib/cjs/entities/requirements/getBundlesTokenRequirements.d.ts +87 -0
  88. package/lib/cjs/entities/requirements/getBundlesTokenRequirements.js +203 -0
  89. package/lib/cjs/entities/requirements/getVaultBundlesSharesRequirements.d.ts +28 -0
  90. package/lib/cjs/entities/requirements/getVaultBundlesSharesRequirements.js +74 -0
  91. package/lib/cjs/entities/requirements/index.d.ts +1 -0
  92. package/lib/cjs/entities/requirements/index.js +17 -0
  93. package/lib/cjs/entities/vaultV1/vaultV1.d.ts +348 -98
  94. package/lib/cjs/entities/vaultV1/vaultV1.js +322 -120
  95. package/lib/cjs/entities/vaultV2/vaultV2.d.ts +221 -68
  96. package/lib/cjs/entities/vaultV2/vaultV2.js +219 -77
  97. package/lib/cjs/helpers/computeVaultV1Reallocations.d.ts +3 -9
  98. package/lib/cjs/helpers/computeVaultV1Reallocations.js +3 -9
  99. package/lib/cjs/helpers/index.d.ts +2 -1
  100. package/lib/cjs/helpers/index.js +5 -1
  101. package/lib/cjs/helpers/referralFee.d.ts +21 -0
  102. package/lib/cjs/helpers/referralFee.js +35 -0
  103. package/lib/cjs/helpers/slippage.d.ts +90 -1
  104. package/lib/cjs/helpers/slippage.js +123 -0
  105. package/lib/cjs/helpers/validate.d.ts +16 -23
  106. package/lib/cjs/helpers/validate.js +41 -48
  107. package/lib/cjs/helpers/validateRequirementSpender.d.ts +2 -1
  108. package/lib/cjs/helpers/validateRequirementSpender.js +3 -0
  109. package/lib/cjs/index.d.ts +1 -0
  110. package/lib/cjs/index.js +1 -0
  111. package/lib/cjs/types/action.d.ts +303 -210
  112. package/lib/cjs/types/action.js +29 -2
  113. package/lib/cjs/types/client.d.ts +9 -0
  114. package/lib/cjs/types/error.d.ts +193 -18
  115. package/lib/cjs/types/error.js +267 -24
  116. package/lib/cjs/types/sharedLiquidity.d.ts +0 -7
  117. package/lib/esm/abis.d.ts +210 -0
  118. package/lib/esm/abis.js +140 -0
  119. package/lib/esm/actions/blue/borrow.d.ts +62 -61
  120. package/lib/esm/actions/blue/borrow.js +48 -80
  121. package/lib/esm/actions/blue/common.d.ts +86 -0
  122. package/lib/esm/actions/blue/common.js +193 -0
  123. package/lib/esm/actions/blue/refinance.d.ts +72 -112
  124. package/lib/esm/actions/blue/refinance.js +98 -200
  125. package/lib/esm/actions/blue/repay.d.ts +72 -68
  126. package/lib/esm/actions/blue/repay.js +56 -118
  127. package/lib/esm/actions/blue/repayWithdrawCollateral.d.ts +85 -90
  128. package/lib/esm/actions/blue/repayWithdrawCollateral.js +149 -138
  129. package/lib/esm/actions/blue/supply.d.ts +62 -45
  130. package/lib/esm/actions/blue/supply.js +94 -70
  131. package/lib/esm/actions/blue/supplyCollateral.d.ts +63 -40
  132. package/lib/esm/actions/blue/supplyCollateral.js +52 -69
  133. package/lib/esm/actions/blue/supplyCollateralBorrow.d.ts +82 -90
  134. package/lib/esm/actions/blue/supplyCollateralBorrow.js +134 -121
  135. package/lib/esm/actions/blue/withdraw.d.ts +68 -79
  136. package/lib/esm/actions/blue/withdraw.js +100 -96
  137. package/lib/esm/actions/blue/withdrawCollateral.d.ts +56 -28
  138. package/lib/esm/actions/blue/withdrawCollateral.js +45 -50
  139. package/lib/esm/actions/bundles/common.d.ts +200 -0
  140. package/lib/esm/actions/bundles/common.js +457 -0
  141. package/lib/esm/actions/bundles/index.d.ts +3 -0
  142. package/lib/esm/actions/bundles/index.js +2 -0
  143. package/lib/esm/actions/bundles/resolveBundlesTokenRequirements.d.ts +76 -0
  144. package/lib/esm/actions/bundles/resolveBundlesTokenRequirements.js +121 -0
  145. package/lib/esm/actions/index.d.ts +2 -1
  146. package/lib/esm/actions/index.js +1 -0
  147. package/lib/esm/actions/midnight/supplyCollateralTakeBorrow.d.ts +2 -2
  148. package/lib/esm/actions/midnight/supplyCollateralTakeBorrow.js +2 -2
  149. package/lib/esm/actions/midnight/takeBorrow.d.ts +2 -2
  150. package/lib/esm/actions/midnight/takeBorrow.js +2 -2
  151. package/lib/esm/actions/midnight/takeLend.d.ts +2 -2
  152. package/lib/esm/actions/midnight/takeLend.js +2 -2
  153. package/lib/esm/actions/requirements/blue/getBlueAuthorizationRequirement.d.ts +29 -17
  154. package/lib/esm/actions/requirements/blue/getBlueAuthorizationRequirement.js +63 -22
  155. package/lib/esm/actions/requirements/blue/getUnusedPermit2Nonce.d.ts +48 -0
  156. package/lib/esm/actions/requirements/blue/getUnusedPermit2Nonce.js +68 -0
  157. package/lib/esm/actions/requirements/blue/index.d.ts +1 -0
  158. package/lib/esm/actions/requirements/blue/index.js +1 -0
  159. package/lib/esm/actions/requirements/encode/encodeBlueSignatureAuthorization.d.ts +10 -7
  160. package/lib/esm/actions/requirements/encode/encodeBlueSignatureAuthorization.js +31 -6
  161. package/lib/esm/actions/requirements/encode/encodeErc20Approval.d.ts +2 -1
  162. package/lib/esm/actions/requirements/encode/encodeErc20Approval.js +9 -3
  163. package/lib/esm/actions/requirements/encode/encodeErc20Permit.d.ts +16 -7
  164. package/lib/esm/actions/requirements/encode/encodeErc20Permit.js +40 -7
  165. package/lib/esm/actions/requirements/encode/encodeErc20Permit2SignatureTransfer.d.ts +61 -0
  166. package/lib/esm/actions/requirements/encode/encodeErc20Permit2SignatureTransfer.js +119 -0
  167. package/lib/esm/actions/requirements/encode/encodeVaultSharesPermit.d.ts +4 -4
  168. package/lib/esm/actions/requirements/encode/encodeVaultSharesPermit.js +6 -5
  169. package/lib/esm/actions/requirements/encode/index.d.ts +1 -0
  170. package/lib/esm/actions/requirements/encode/index.js +1 -0
  171. package/lib/esm/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit.d.ts +1 -1
  172. package/lib/esm/actions/requirements/getRequirementsApproval.d.ts +6 -4
  173. package/lib/esm/actions/requirements/getRequirementsApproval.js +6 -4
  174. package/lib/esm/actions/signatures/getTokenRequirementActions.d.ts +1 -0
  175. package/lib/esm/actions/signatures/getTokenRequirementActions.js +5 -1
  176. package/lib/esm/actions/signatures/getVaultExitBundlesV1PermitStruct.d.ts +22 -30
  177. package/lib/esm/actions/signatures/getVaultExitBundlesV1PermitStruct.js +19 -67
  178. package/lib/esm/actions/vaultV1/deposit.d.ts +73 -57
  179. package/lib/esm/actions/vaultV1/deposit.js +112 -111
  180. package/lib/esm/actions/vaultV1/migrateToV2.d.ts +43 -66
  181. package/lib/esm/actions/vaultV1/migrateToV2.js +93 -106
  182. package/lib/esm/actions/vaultV1/redeem.d.ts +30 -23
  183. package/lib/esm/actions/vaultV1/redeem.js +56 -33
  184. package/lib/esm/actions/vaultV1/withdraw.d.ts +58 -24
  185. package/lib/esm/actions/vaultV1/withdraw.js +86 -34
  186. package/lib/esm/actions/vaultV2/deposit.d.ts +74 -57
  187. package/lib/esm/actions/vaultV2/deposit.js +113 -111
  188. package/lib/esm/actions/vaultV2/redeem.d.ts +30 -24
  189. package/lib/esm/actions/vaultV2/redeem.js +56 -34
  190. package/lib/esm/actions/vaultV2/withdraw.d.ts +58 -25
  191. package/lib/esm/actions/vaultV2/withdraw.js +86 -35
  192. package/lib/esm/bundler/actions.d.ts +4 -4
  193. package/lib/esm/bundler/actions.js +4 -4
  194. package/lib/esm/client/morphoViemExtension.d.ts +2 -1
  195. package/lib/esm/client/morphoViemExtension.js +2 -1
  196. package/lib/esm/entities/blue/blue.d.ts +806 -374
  197. package/lib/esm/entities/blue/blue.js +455 -702
  198. package/lib/esm/entities/index.d.ts +2 -0
  199. package/lib/esm/entities/index.js +1 -0
  200. package/lib/esm/entities/midnight/midnight.d.ts +2 -2
  201. package/lib/esm/entities/requirements/getBundlesTokenRequirements.d.ts +87 -0
  202. package/lib/esm/entities/requirements/getBundlesTokenRequirements.js +199 -0
  203. package/lib/esm/entities/requirements/getVaultBundlesSharesRequirements.d.ts +28 -0
  204. package/lib/esm/entities/requirements/getVaultBundlesSharesRequirements.js +70 -0
  205. package/lib/esm/entities/requirements/index.d.ts +1 -0
  206. package/lib/esm/entities/requirements/index.js +1 -0
  207. package/lib/esm/entities/vaultV1/vaultV1.d.ts +348 -98
  208. package/lib/esm/entities/vaultV1/vaultV1.js +326 -124
  209. package/lib/esm/entities/vaultV2/vaultV2.d.ts +221 -68
  210. package/lib/esm/entities/vaultV2/vaultV2.js +222 -80
  211. package/lib/esm/helpers/computeVaultV1Reallocations.d.ts +3 -9
  212. package/lib/esm/helpers/computeVaultV1Reallocations.js +3 -9
  213. package/lib/esm/helpers/index.d.ts +2 -1
  214. package/lib/esm/helpers/index.js +2 -1
  215. package/lib/esm/helpers/referralFee.d.ts +21 -0
  216. package/lib/esm/helpers/referralFee.js +31 -0
  217. package/lib/esm/helpers/slippage.d.ts +90 -1
  218. package/lib/esm/helpers/slippage.js +122 -2
  219. package/lib/esm/helpers/validate.d.ts +16 -23
  220. package/lib/esm/helpers/validate.js +40 -48
  221. package/lib/esm/helpers/validateRequirementSpender.d.ts +2 -1
  222. package/lib/esm/helpers/validateRequirementSpender.js +3 -0
  223. package/lib/esm/index.d.ts +1 -0
  224. package/lib/esm/index.js +1 -0
  225. package/lib/esm/types/action.d.ts +303 -210
  226. package/lib/esm/types/action.js +28 -2
  227. package/lib/esm/types/client.d.ts +9 -0
  228. package/lib/esm/types/error.d.ts +193 -18
  229. package/lib/esm/types/error.js +252 -21
  230. package/lib/esm/types/sharedLiquidity.d.ts +0 -7
  231. package/package.json +6 -5
  232. package/lib/cjs/actions/blue/buildAssetFundingActions.d.ts +0 -47
  233. package/lib/cjs/actions/blue/buildAssetFundingActions.js +0 -63
  234. package/lib/cjs/actions/blue/buildReallocationActions.d.ts +0 -69
  235. package/lib/cjs/actions/blue/buildReallocationActions.js +0 -141
  236. package/lib/cjs/actions/blue/resolveRepayFunding.d.ts +0 -66
  237. package/lib/cjs/actions/blue/resolveRepayFunding.js +0 -85
  238. package/lib/esm/actions/blue/buildAssetFundingActions.d.ts +0 -47
  239. package/lib/esm/actions/blue/buildAssetFundingActions.js +0 -59
  240. package/lib/esm/actions/blue/buildReallocationActions.d.ts +0 -69
  241. package/lib/esm/actions/blue/buildReallocationActions.js +0 -135
  242. package/lib/esm/actions/blue/resolveRepayFunding.d.ts +0 -66
  243. package/lib/esm/actions/blue/resolveRepayFunding.js +0 -81
@@ -28,6 +28,7 @@ PreLiquidationPosition, Token, User as BlueUser,
28
28
  User, Vault, VaultConfig, VaultMarketAllocation, VaultMarketConfig, VaultMarketPublicAllocatorConfig, VaultToken, VaultUser, VaultV2, VaultV2Adapter, VaultV2BlueMarketPublicAllocatorConfig, VaultV2BluePublicAllocatorConfig, VaultV2MorphoMarketV1Adapter, VaultV2MorphoMarketV1AdapterV2, VaultV2MorphoVaultV1Adapter, WrappedToken, } from "@morpho-org/blue-sdk";
29
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
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";
31
+ export type { BlueActions, BlueTokenRequirementsParams, } from "./blue/index.js";
31
32
  export { MorphoBlue } from "./blue/index.js";
32
33
  export type { GetOffersDataParams as MidnightGetOffersDataParams,
33
34
  /** @deprecated Use `MidnightGetOffersDataParams`. */
@@ -61,6 +62,7 @@ TakeBorrowParams, TakeLendParams as MidnightTakeLendParams,
61
62
  /** @deprecated Use `MidnightTakeLendParams`. */
62
63
  TakeLendParams, } from "./midnight/index.js";
63
64
  export { type MidnightActionOutput, type MidnightActionSignatures, type MidnightActions, MorphoMidnight, } from "./midnight/index.js";
65
+ export * from "./requirements/index.js";
64
66
  export { MorphoVaultV1 } from "./vaultV1/index.js";
65
67
  export { type InputReallocationData, type InputVaultV1ReallocationData, ReallocationData, VaultV1ReallocationData, } from "./vaultV1ReallocationData.js";
66
68
  export { MorphoVaultV2 } from "./vaultV2/index.js";
@@ -1,4 +1,18 @@
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
+ };
2
16
  Object.defineProperty(exports, "__esModule", { value: true });
3
17
  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
18
  exports.VaultV2BlueReallocationData = exports.MorphoVaultV2 = exports.VaultV1ReallocationData = exports.ReallocationData = void 0;
@@ -62,6 +76,7 @@ var index_js_1 = require("./blue/index.js");
62
76
  Object.defineProperty(exports, "MorphoBlue", { enumerable: true, get: function () { return index_js_1.MorphoBlue; } });
63
77
  var index_js_2 = require("./midnight/index.js");
64
78
  Object.defineProperty(exports, "MorphoMidnight", { enumerable: true, get: function () { return index_js_2.MorphoMidnight; } });
79
+ __exportStar(require("./requirements/index.js"), exports);
65
80
  var index_js_3 = require("./vaultV1/index.js");
66
81
  Object.defineProperty(exports, "MorphoVaultV1", { enumerable: true, get: function () { return index_js_3.MorphoVaultV1; } });
67
82
  var vaultV1ReallocationData_js_1 = require("./vaultV1ReallocationData.js");
@@ -20,8 +20,8 @@ import type { GetOffersDataParams, GetPositionDataParams, MakeLendParams, MakeOf
20
20
  * const output = midnight.takeLend({
21
21
  * accountAddress: lender,
22
22
  * marketData,
23
- * assets: BigInt(quote.data.availableAssets),
24
- * minUnits: BigInt(quote.data.availableUnits),
23
+ * assets: 1_000_000n,
24
+ * minUnits: 900_000n,
25
25
  * takeableOffers: quote.data.takeableOffers,
26
26
  * deadline: maxUint256,
27
27
  * });
@@ -0,0 +1,87 @@
1
+ import { type Address, type Client } from "viem";
2
+ import { type BundlesTokenSignatureRequirement, type ERC20ApprovalAction, type Transaction } from "../../types/index.js";
3
+ /** Parameters for {@link getBundlesTokenRequirements}. */
4
+ export interface GetBundlesTokenRequirementsParams {
5
+ /** ERC-20 token funded by the operation. */
6
+ readonly token: Address;
7
+ /** Registered fixed bundles contract that pulls the token. */
8
+ readonly spender: Address;
9
+ /** Exact amount the bundles contract will pull. */
10
+ readonly amount: bigint;
11
+ /** Classic approval amount; defaults to the exact pull amount. */
12
+ readonly approvalAmount?: bigint;
13
+ /** Account funding the operation. */
14
+ readonly owner: Address;
15
+ /** Target chain id. */
16
+ readonly chainId: number;
17
+ /** Final-call and signature deadline. */
18
+ readonly deadline: bigint;
19
+ /** Whether the caller can collect offchain token signatures. */
20
+ readonly supportSignature: boolean;
21
+ /** Whether token metadata reads may use deployless aggregation. */
22
+ readonly supportDeployless?: boolean;
23
+ /** Prefer ERC-2612 when the token exposes a compatible nonce. */
24
+ readonly useSimplePermit?: boolean;
25
+ /** Explicit unused Permit2 SignatureTransfer unordered nonce. */
26
+ readonly permit2Nonce?: bigint;
27
+ }
28
+ /**
29
+ * Resolves direct approval, ERC-2612, or Permit2 SignatureTransfer prerequisites for
30
+ * a registered fixed bundles contract.
31
+ *
32
+ * Reads only the allowance and nonce state required by the selected path. Permit2 keeps the
33
+ * ERC-20 allowance on canonical Permit2 while the one-time signed transfer names the bundles contract
34
+ * as spender. Permit2 SignatureTransfer requires an explicit unused unordered nonce so concurrent
35
+ * requirements never silently sign the same owner-global nonce.
36
+ *
37
+ * @param viemClient - Connected viem client used for allowance and nonce reads.
38
+ * @param params - Token requirement parameters.
39
+ * @param params.token - ERC-20 token funded by the operation.
40
+ * @param params.spender - Registered fixed bundles contract that pulls the token.
41
+ * @param params.amount - Exact amount the contract will pull; zero returns no requirements.
42
+ * @param params.approvalAmount - Classic approval amount; defaults to `amount` and is ignored by signature paths.
43
+ * @param params.owner - Account funding the operation.
44
+ * @param params.chainId - Target chain id; must match the client chain.
45
+ * @param params.deadline - Final-call and signature deadline.
46
+ * @param params.supportSignature - Whether ERC-2612 or Permit2 signatures may be requested.
47
+ * @param params.supportDeployless - Whether ERC-2612 metadata reads may use deployless calls.
48
+ * @param params.useSimplePermit - Prefer ERC-2612 when its nonce probe succeeds.
49
+ * @param params.permit2Nonce - Explicit unused uint256 nonce required when Permit2 is selected.
50
+ * @returns Ordered deep-frozen approval transactions and/or signable token requirements.
51
+ * @throws {ChainIdMismatchError} when the connected client targets another chain.
52
+ * @throws {NegativeInputError} when `amount` or `permit2Nonce` is negative.
53
+ * @throws {NonPositiveInputError} when `deadline` is not positive.
54
+ * @throws {ExpiredDeadlineError} when `deadline` is positive but not in the future.
55
+ * @throws {UnsupportedChainIdError} when the chain is absent from the address registry.
56
+ * @throws {UnsupportedErc20ApprovalSpenderError} when `spender` is not the chain's registered
57
+ * BlueBundlesV1 or VaultBundlesV1 deployment, including for a zero-amount request.
58
+ * @throws {MissingPermit2SignatureTransferNonceError} when Permit2 is selected without a nonce.
59
+ * @throws {Permit2SignatureTransferNonceAlreadyUsedError} when `permit2Nonce` is already consumed.
60
+ * @throws {InputExceedsMaxError} when `amount`, `deadline`, or `permit2Nonce` exceeds uint256.
61
+ * @throws {ApprovalAmountLessThanSpendAmountError} when `approvalAmount` is below `amount`.
62
+ * @throws {viem.BaseError} when a required allowance, Permit2 nonce-bitmap, or ERC-2612 metadata
63
+ * read fails. A failed ERC-2612 nonce probe alone falls back to Permit2 or classic approval.
64
+ * @example
65
+ * ```ts
66
+ * import { addressesRegistry } from "@morpho-org/blue-sdk";
67
+ * import { getChainAddress } from "@morpho-org/morpho-ts";
68
+ * import { createPublicClient, http, zeroAddress } from "viem";
69
+ * import { mainnet } from "viem/chains";
70
+ * import { getBundlesTokenRequirements } from "@morpho-org/morpho-sdk";
71
+ *
72
+ * const client = createPublicClient({ chain: mainnet, transport: http() });
73
+ * const vaultBundlesV1 = getChainAddress(mainnet.id, "bundles.vaultBundlesV1");
74
+ * const requirements = await getBundlesTokenRequirements(client, {
75
+ * token: addressesRegistry[mainnet.id].usdc,
76
+ * spender: vaultBundlesV1,
77
+ * amount: 1_000_000n,
78
+ * owner: zeroAddress,
79
+ * chainId: mainnet.id,
80
+ * deadline: 1_900_000_000n,
81
+ * supportSignature: true,
82
+ * permit2Nonce: 42n,
83
+ * });
84
+ * // requirements contains approvals and/or signable bundles token requirements.
85
+ * ```
86
+ */
87
+ export declare const getBundlesTokenRequirements: (viemClient: Client, params: GetBundlesTokenRequirementsParams) => Promise<readonly (Readonly<Transaction<ERC20ApprovalAction>> | BundlesTokenSignatureRequirement)[]>;
@@ -0,0 +1,203 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getBundlesTokenRequirements = void 0;
4
+ const blue_sdk_1 = require("@morpho-org/blue-sdk");
5
+ const blue_sdk_viem_1 = require("@morpho-org/blue-sdk-viem");
6
+ const morpho_ts_1 = require("@morpho-org/morpho-ts");
7
+ const viem_1 = require("viem");
8
+ const actions_1 = require("viem/actions");
9
+ const index_js_1 = require("../../actions/bundles/index.js");
10
+ const encodeErc20Permit_js_1 = require("../../actions/requirements/encode/encodeErc20Permit.js");
11
+ const index_js_2 = require("../../helpers/index.js");
12
+ const index_js_3 = require("../../types/index.js");
13
+ /**
14
+ * Resolves direct approval, ERC-2612, or Permit2 SignatureTransfer prerequisites for
15
+ * a registered fixed bundles contract.
16
+ *
17
+ * Reads only the allowance and nonce state required by the selected path. Permit2 keeps the
18
+ * ERC-20 allowance on canonical Permit2 while the one-time signed transfer names the bundles contract
19
+ * as spender. Permit2 SignatureTransfer requires an explicit unused unordered nonce so concurrent
20
+ * requirements never silently sign the same owner-global nonce.
21
+ *
22
+ * @param viemClient - Connected viem client used for allowance and nonce reads.
23
+ * @param params - Token requirement parameters.
24
+ * @param params.token - ERC-20 token funded by the operation.
25
+ * @param params.spender - Registered fixed bundles contract that pulls the token.
26
+ * @param params.amount - Exact amount the contract will pull; zero returns no requirements.
27
+ * @param params.approvalAmount - Classic approval amount; defaults to `amount` and is ignored by signature paths.
28
+ * @param params.owner - Account funding the operation.
29
+ * @param params.chainId - Target chain id; must match the client chain.
30
+ * @param params.deadline - Final-call and signature deadline.
31
+ * @param params.supportSignature - Whether ERC-2612 or Permit2 signatures may be requested.
32
+ * @param params.supportDeployless - Whether ERC-2612 metadata reads may use deployless calls.
33
+ * @param params.useSimplePermit - Prefer ERC-2612 when its nonce probe succeeds.
34
+ * @param params.permit2Nonce - Explicit unused uint256 nonce required when Permit2 is selected.
35
+ * @returns Ordered deep-frozen approval transactions and/or signable token requirements.
36
+ * @throws {ChainIdMismatchError} when the connected client targets another chain.
37
+ * @throws {NegativeInputError} when `amount` or `permit2Nonce` is negative.
38
+ * @throws {NonPositiveInputError} when `deadline` is not positive.
39
+ * @throws {ExpiredDeadlineError} when `deadline` is positive but not in the future.
40
+ * @throws {UnsupportedChainIdError} when the chain is absent from the address registry.
41
+ * @throws {UnsupportedErc20ApprovalSpenderError} when `spender` is not the chain's registered
42
+ * BlueBundlesV1 or VaultBundlesV1 deployment, including for a zero-amount request.
43
+ * @throws {MissingPermit2SignatureTransferNonceError} when Permit2 is selected without a nonce.
44
+ * @throws {Permit2SignatureTransferNonceAlreadyUsedError} when `permit2Nonce` is already consumed.
45
+ * @throws {InputExceedsMaxError} when `amount`, `deadline`, or `permit2Nonce` exceeds uint256.
46
+ * @throws {ApprovalAmountLessThanSpendAmountError} when `approvalAmount` is below `amount`.
47
+ * @throws {viem.BaseError} when a required allowance, Permit2 nonce-bitmap, or ERC-2612 metadata
48
+ * read fails. A failed ERC-2612 nonce probe alone falls back to Permit2 or classic approval.
49
+ * @example
50
+ * ```ts
51
+ * import { addressesRegistry } from "@morpho-org/blue-sdk";
52
+ * import { getChainAddress } from "@morpho-org/morpho-ts";
53
+ * import { createPublicClient, http, zeroAddress } from "viem";
54
+ * import { mainnet } from "viem/chains";
55
+ * import { getBundlesTokenRequirements } from "@morpho-org/morpho-sdk";
56
+ *
57
+ * const client = createPublicClient({ chain: mainnet, transport: http() });
58
+ * const vaultBundlesV1 = getChainAddress(mainnet.id, "bundles.vaultBundlesV1");
59
+ * const requirements = await getBundlesTokenRequirements(client, {
60
+ * token: addressesRegistry[mainnet.id].usdc,
61
+ * spender: vaultBundlesV1,
62
+ * amount: 1_000_000n,
63
+ * owner: zeroAddress,
64
+ * chainId: mainnet.id,
65
+ * deadline: 1_900_000_000n,
66
+ * supportSignature: true,
67
+ * permit2Nonce: 42n,
68
+ * });
69
+ * // requirements contains approvals and/or signable bundles token requirements.
70
+ * ```
71
+ */
72
+ const getBundlesTokenRequirements = async (viemClient, params) => {
73
+ (0, index_js_2.validateChainId)(viemClient.chain?.id, params.chainId);
74
+ (0, index_js_2.validateRequirementSpender)({
75
+ chainId: params.chainId,
76
+ spender: params.spender,
77
+ allowed: ["blueBundlesV1", "vaultBundlesV1"],
78
+ });
79
+ if (params.amount < 0n) {
80
+ throw new index_js_3.NegativeInputError("amount", params.amount);
81
+ }
82
+ // Reject oversized inputs before any RPC read so this resolver never asks the user to sign or
83
+ // submit an approval/permit that the eventual BlueBundlesV1 call (uint256 ABI) would reject.
84
+ if (params.amount > viem_1.maxUint256) {
85
+ throw new index_js_3.InputExceedsMaxError({
86
+ field: "amount",
87
+ value: params.amount,
88
+ max: viem_1.maxUint256,
89
+ });
90
+ }
91
+ if (params.deadline <= 0n) {
92
+ throw new index_js_3.NonPositiveInputError("deadline", params.deadline);
93
+ }
94
+ if (params.deadline > viem_1.maxUint256) {
95
+ throw new index_js_3.InputExceedsMaxError({
96
+ field: "deadline",
97
+ value: params.deadline,
98
+ max: viem_1.maxUint256,
99
+ });
100
+ }
101
+ // Reject an already-expired deadline before the RPC reads so a direct caller of this resolver
102
+ // never signs a permit for a supply the BlueBundlesV1 call would revert. The entity validates
103
+ // this too, but the exported resolver must guard its own callers.
104
+ const timestamp = morpho_ts_1.Time.timestamp();
105
+ if (params.deadline <= timestamp) {
106
+ throw new index_js_3.ExpiredDeadlineError(params.deadline, timestamp);
107
+ }
108
+ if (params.amount === 0n)
109
+ return [];
110
+ const { permit2, dai } = (0, blue_sdk_1.getChainAddresses)(params.chainId);
111
+ if (params.supportSignature) {
112
+ const isDai = (0, morpho_ts_1.isDefined)(dai) && (0, viem_1.isAddressEqual)(params.token, dai);
113
+ if (params.useSimplePermit && !isDai) {
114
+ const nonce = await (0, actions_1.readContract)(viemClient, {
115
+ abi: blue_sdk_viem_1.erc2612Abi,
116
+ address: params.token,
117
+ functionName: "nonces",
118
+ args: [params.owner],
119
+ }).catch(() => undefined);
120
+ if ((0, morpho_ts_1.isDefined)(nonce)) {
121
+ return [
122
+ await (0, encodeErc20Permit_js_1.encodeErc20Permit)(viemClient, {
123
+ token: params.token,
124
+ spender: params.spender,
125
+ amount: params.amount,
126
+ chainId: params.chainId,
127
+ nonce,
128
+ deadline: params.deadline,
129
+ supportDeployless: params.supportDeployless,
130
+ }),
131
+ ];
132
+ }
133
+ }
134
+ if (permit2 != null) {
135
+ if (params.permit2Nonce == null) {
136
+ throw new index_js_3.MissingPermit2SignatureTransferNonceError();
137
+ }
138
+ if (params.permit2Nonce < 0n) {
139
+ throw new index_js_3.NegativeInputError("permit2Nonce", params.permit2Nonce);
140
+ }
141
+ if (params.permit2Nonce > viem_1.maxUint256) {
142
+ throw new index_js_3.InputExceedsMaxError({
143
+ field: "permit2Nonce",
144
+ value: params.permit2Nonce,
145
+ max: viem_1.maxUint256,
146
+ });
147
+ }
148
+ const wordPosition = params.permit2Nonce >> 8n;
149
+ const [allowance, nonceBitmap] = await Promise.all([
150
+ (0, actions_1.readContract)(viemClient, {
151
+ abi: viem_1.erc20Abi,
152
+ address: params.token,
153
+ functionName: "allowance",
154
+ args: [params.owner, permit2],
155
+ }),
156
+ (0, actions_1.readContract)(viemClient, {
157
+ abi: blue_sdk_viem_1.permit2Abi,
158
+ address: permit2,
159
+ functionName: "nonceBitmap",
160
+ args: [params.owner, wordPosition],
161
+ }),
162
+ ]);
163
+ return (0, index_js_1.resolveBundlesTokenRequirements)({
164
+ token: params.token,
165
+ spender: params.spender,
166
+ owner: params.owner,
167
+ chainId: params.chainId,
168
+ amount: params.amount,
169
+ deadline: params.deadline,
170
+ state: {
171
+ type: "permit2SignatureTransfer",
172
+ permit2Allowance: allowance,
173
+ permit2Nonce: params.permit2Nonce,
174
+ nonceBitmap,
175
+ },
176
+ });
177
+ }
178
+ }
179
+ const approvalAmount = params.approvalAmount ?? params.amount;
180
+ if (approvalAmount < params.amount) {
181
+ throw new index_js_3.ApprovalAmountLessThanSpendAmountError();
182
+ }
183
+ const allowance = await (0, actions_1.readContract)(viemClient, {
184
+ abi: viem_1.erc20Abi,
185
+ address: params.token,
186
+ functionName: "allowance",
187
+ args: [params.owner, params.spender],
188
+ });
189
+ return (0, index_js_1.resolveBundlesTokenRequirements)({
190
+ token: params.token,
191
+ spender: params.spender,
192
+ owner: params.owner,
193
+ chainId: params.chainId,
194
+ amount: params.amount,
195
+ deadline: params.deadline,
196
+ state: {
197
+ type: "approval",
198
+ allowance,
199
+ approvalAmount,
200
+ },
201
+ });
202
+ };
203
+ exports.getBundlesTokenRequirements = getBundlesTokenRequirements;
@@ -0,0 +1,28 @@
1
+ import type { Token } from "@morpho-org/blue-sdk";
2
+ import type { Address, Client } from "viem";
3
+ import { type ActionRequirement } from "../../types/index.js";
4
+ /**
5
+ * Resolves the exact vault-share approval or ERC-2612 requirement for a VaultBundlesV1 exit.
6
+ *
7
+ * The exit burns however many shares the vault prices at execution time, so the share allowance is
8
+ * the only cap on that burn. A leftover allowance above `requiredShareAllowance` therefore does not
9
+ * satisfy the requirement: it is replaced by an approval or permit for exactly the computed cap.
10
+ *
11
+ * @internal
12
+ *
13
+ * @param viemClient - Client used to read the current share allowance and permit nonce.
14
+ * @param params - Vault snapshot, owner, exact allowance, and deadline values.
15
+ * @returns No requirement when the allowance already equals `requiredShareAllowance`, otherwise one
16
+ * permit or approval that sets it to exactly that cap.
17
+ * @throws {ExpiredDeadlineError} when the bundles deadline has elapsed.
18
+ * @throws {viem.BaseError} when an allowance or nonce read fails.
19
+ */
20
+ export declare const getVaultBundlesSharesRequirements: (viemClient: Client, params: {
21
+ readonly vaultData: Token;
22
+ readonly version: "vaultV1" | "vaultV2";
23
+ readonly owner: Address;
24
+ readonly chainId: number;
25
+ readonly requiredShareAllowance: bigint;
26
+ readonly deadline: bigint;
27
+ readonly supportSignature: boolean;
28
+ }) => Promise<readonly ActionRequirement[]>;
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getVaultBundlesSharesRequirements = void 0;
4
+ const blue_sdk_viem_1 = require("@morpho-org/blue-sdk-viem");
5
+ const morpho_ts_1 = require("@morpho-org/morpho-ts");
6
+ const viem_1 = require("viem");
7
+ const actions_1 = require("viem/actions");
8
+ const index_js_1 = require("../../actions/index.js");
9
+ const index_js_2 = require("../../helpers/index.js");
10
+ const index_js_3 = require("../../types/index.js");
11
+ /**
12
+ * Resolves the exact vault-share approval or ERC-2612 requirement for a VaultBundlesV1 exit.
13
+ *
14
+ * The exit burns however many shares the vault prices at execution time, so the share allowance is
15
+ * the only cap on that burn. A leftover allowance above `requiredShareAllowance` therefore does not
16
+ * satisfy the requirement: it is replaced by an approval or permit for exactly the computed cap.
17
+ *
18
+ * @internal
19
+ *
20
+ * @param viemClient - Client used to read the current share allowance and permit nonce.
21
+ * @param params - Vault snapshot, owner, exact allowance, and deadline values.
22
+ * @returns No requirement when the allowance already equals `requiredShareAllowance`, otherwise one
23
+ * permit or approval that sets it to exactly that cap.
24
+ * @throws {ExpiredDeadlineError} when the bundles deadline has elapsed.
25
+ * @throws {viem.BaseError} when an allowance or nonce read fails.
26
+ */
27
+ const getVaultBundlesSharesRequirements = async (viemClient, params) => {
28
+ (0, index_js_2.validateChainId)(viemClient.chain?.id, params.chainId);
29
+ const now = morpho_ts_1.Time.timestamp();
30
+ if (params.deadline <= now) {
31
+ throw new index_js_3.ExpiredDeadlineError(params.deadline, now);
32
+ }
33
+ const spender = (0, morpho_ts_1.getChainAddress)(params.chainId, "bundles.vaultBundlesV1");
34
+ const allowance = await (0, actions_1.readContract)(viemClient, {
35
+ address: params.vaultData.address,
36
+ abi: viem_1.erc20Abi,
37
+ functionName: "allowance",
38
+ args: [params.owner, spender],
39
+ });
40
+ // Asset-mode withdrawals carry no onchain share cap, so the allowance itself is the cap. A
41
+ // larger leftover allowance would let a share-price loss burn past `requiredShareAllowance`,
42
+ // so only an exact match skips the approval or permit that resets it to the computed cap.
43
+ if (allowance === params.requiredShareAllowance)
44
+ return [];
45
+ if (params.supportSignature) {
46
+ const nonce = await (0, actions_1.readContract)(viemClient, {
47
+ address: params.vaultData.address,
48
+ abi: blue_sdk_viem_1.erc2612Abi,
49
+ functionName: "nonces",
50
+ args: [params.owner],
51
+ });
52
+ return [
53
+ (0, index_js_1.encodeVaultSharesPermit)({
54
+ vault: params.vaultData,
55
+ version: params.version,
56
+ spender,
57
+ owner: params.owner,
58
+ chainId: params.chainId,
59
+ nonce,
60
+ amount: params.requiredShareAllowance,
61
+ deadline: params.deadline,
62
+ }),
63
+ ];
64
+ }
65
+ return [
66
+ (0, index_js_1.encodeErc20Approval)({
67
+ token: params.vaultData.address,
68
+ spender,
69
+ amount: params.requiredShareAllowance,
70
+ chainId: params.chainId,
71
+ }),
72
+ ];
73
+ };
74
+ exports.getVaultBundlesSharesRequirements = getVaultBundlesSharesRequirements;
@@ -0,0 +1 @@
1
+ export * from "./getBundlesTokenRequirements.js";
@@ -0,0 +1,17 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./getBundlesTokenRequirements.js"), exports);