@morpho-org/morpho-sdk 4.1.0 → 5.0.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 (178) hide show
  1. package/README.md +12 -12
  2. package/lib/cjs/actions/blue/borrow.d.ts +12 -2
  3. package/lib/cjs/actions/blue/borrow.js +7 -1
  4. package/lib/cjs/actions/blue/refinance.d.ts +13 -3
  5. package/lib/cjs/actions/blue/refinance.js +8 -2
  6. package/lib/cjs/actions/blue/repay.d.ts +6 -5
  7. package/lib/cjs/actions/blue/repay.js +10 -18
  8. package/lib/cjs/actions/blue/repayWithdrawCollateral.d.ts +15 -6
  9. package/lib/cjs/actions/blue/repayWithdrawCollateral.js +16 -18
  10. package/lib/cjs/actions/blue/supply.d.ts +7 -7
  11. package/lib/cjs/actions/blue/supply.js +10 -20
  12. package/lib/cjs/actions/blue/supplyCollateral.d.ts +8 -8
  13. package/lib/cjs/actions/blue/supplyCollateral.js +11 -21
  14. package/lib/cjs/actions/blue/supplyCollateralBorrow.d.ts +18 -6
  15. package/lib/cjs/actions/blue/supplyCollateralBorrow.js +17 -19
  16. package/lib/cjs/actions/blue/withdraw.d.ts +10 -2
  17. package/lib/cjs/actions/blue/withdraw.js +7 -1
  18. package/lib/cjs/actions/index.d.ts +1 -0
  19. package/lib/cjs/actions/index.js +1 -0
  20. package/lib/cjs/actions/requirements/blue/getBlueAuthorizationRequirement.d.ts +49 -0
  21. package/lib/cjs/actions/requirements/blue/getBlueAuthorizationRequirement.js +111 -0
  22. package/lib/cjs/actions/requirements/blue/index.d.ts +1 -0
  23. package/lib/cjs/actions/requirements/blue/index.js +17 -0
  24. package/lib/cjs/actions/requirements/encode/encodeBlueSignatureAuthorization.d.ts +55 -0
  25. package/lib/cjs/actions/requirements/encode/encodeBlueSignatureAuthorization.js +89 -0
  26. package/lib/cjs/actions/requirements/encode/encodeErc20Approval.d.ts +6 -5
  27. package/lib/cjs/actions/requirements/encode/encodeErc20Approval.js +17 -5
  28. package/lib/cjs/actions/requirements/encode/encodeErc20Permit.d.ts +9 -7
  29. package/lib/cjs/actions/requirements/encode/encodeErc20Permit.js +18 -4
  30. package/lib/cjs/actions/requirements/encode/{encodeErc20Permit2.d.ts → encodeErc20Permit2Approve.d.ts} +11 -13
  31. package/lib/cjs/actions/requirements/encode/{encodeErc20Permit2.js → encodeErc20Permit2Approve.js} +10 -14
  32. package/lib/cjs/actions/requirements/encode/index.d.ts +2 -1
  33. package/lib/cjs/actions/requirements/encode/index.js +2 -1
  34. package/lib/cjs/actions/requirements/{getRequirements.d.ts → generalAdapter/getGeneralAdapterRequirements.d.ts} +34 -20
  35. package/lib/cjs/actions/requirements/generalAdapter/getGeneralAdapterRequirements.js +151 -0
  36. package/lib/{esm/actions/requirements/getRequirementsPermit.d.ts → cjs/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit.d.ts} +6 -14
  37. package/lib/cjs/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit.js +50 -0
  38. package/lib/cjs/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit2.d.ts +57 -0
  39. package/lib/cjs/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit2.js +74 -0
  40. package/lib/cjs/actions/requirements/generalAdapter/index.d.ts +3 -0
  41. package/lib/cjs/actions/requirements/generalAdapter/index.js +19 -0
  42. package/lib/cjs/actions/requirements/getRequirementsApproval.d.ts +3 -2
  43. package/lib/cjs/actions/requirements/getRequirementsApproval.js +3 -2
  44. package/lib/cjs/actions/requirements/index.d.ts +2 -5
  45. package/lib/cjs/actions/requirements/index.js +2 -5
  46. package/lib/cjs/actions/signatures/getBlueAuthorizationAction.d.ts +29 -0
  47. package/lib/cjs/actions/signatures/getBlueAuthorizationAction.js +48 -0
  48. package/lib/{esm/actions/requirements/getRequirementsAction.d.ts → cjs/actions/signatures/getTokenRequirementActions.d.ts} +17 -17
  49. package/lib/cjs/actions/{requirements/getRequirementsAction.js → signatures/getTokenRequirementActions.js} +26 -13
  50. package/lib/cjs/actions/signatures/index.d.ts +2 -0
  51. package/lib/cjs/actions/signatures/index.js +18 -0
  52. package/lib/cjs/actions/vaultV1/deposit.d.ts +6 -8
  53. package/lib/cjs/actions/vaultV1/deposit.js +11 -21
  54. package/lib/cjs/actions/vaultV1/migrateToV2.d.ts +6 -6
  55. package/lib/cjs/actions/vaultV1/migrateToV2.js +12 -20
  56. package/lib/cjs/actions/vaultV2/deposit.d.ts +6 -8
  57. package/lib/cjs/actions/vaultV2/deposit.js +11 -21
  58. package/lib/cjs/addresses.d.ts +2 -2
  59. package/lib/cjs/addresses.js +2 -1
  60. package/lib/cjs/bundler/actions.d.ts +44 -4
  61. package/lib/cjs/bundler/actions.js +75 -2
  62. package/lib/cjs/bundler/types.d.ts +6 -0
  63. package/lib/cjs/constants.d.ts +2 -2
  64. package/lib/cjs/constants.js +3 -3
  65. package/lib/cjs/entities/blue/blue.d.ts +58 -33
  66. package/lib/cjs/entities/blue/blue.js +171 -125
  67. package/lib/cjs/entities/reallocationData.d.ts +12 -12
  68. package/lib/cjs/entities/reallocationData.js +19 -19
  69. package/lib/cjs/entities/vaultV1/vaultV1.d.ts +9 -9
  70. package/lib/cjs/entities/vaultV1/vaultV1.js +44 -34
  71. package/lib/cjs/entities/vaultV2/vaultV2.d.ts +6 -6
  72. package/lib/cjs/entities/vaultV2/vaultV2.js +21 -16
  73. package/lib/cjs/errors.d.ts +3 -2
  74. package/lib/cjs/errors.js +5 -2
  75. package/lib/cjs/helpers/validate.d.ts +2 -2
  76. package/lib/cjs/helpers/validate.js +1 -1
  77. package/lib/cjs/types/action.d.ts +113 -9
  78. package/lib/cjs/types/action.js +79 -5
  79. package/lib/cjs/types/error.d.ts +73 -0
  80. package/lib/cjs/types/error.js +89 -4
  81. package/lib/cjs/types.d.ts +2 -1
  82. package/lib/cjs/utils.d.ts +1 -1
  83. package/lib/cjs/utils.js +2 -3
  84. package/lib/esm/actions/blue/borrow.d.ts +12 -2
  85. package/lib/esm/actions/blue/borrow.js +7 -1
  86. package/lib/esm/actions/blue/refinance.d.ts +13 -3
  87. package/lib/esm/actions/blue/refinance.js +8 -2
  88. package/lib/esm/actions/blue/repay.d.ts +6 -5
  89. package/lib/esm/actions/blue/repay.js +10 -18
  90. package/lib/esm/actions/blue/repayWithdrawCollateral.d.ts +15 -6
  91. package/lib/esm/actions/blue/repayWithdrawCollateral.js +16 -18
  92. package/lib/esm/actions/blue/supply.d.ts +7 -7
  93. package/lib/esm/actions/blue/supply.js +10 -20
  94. package/lib/esm/actions/blue/supplyCollateral.d.ts +8 -8
  95. package/lib/esm/actions/blue/supplyCollateral.js +11 -21
  96. package/lib/esm/actions/blue/supplyCollateralBorrow.d.ts +18 -6
  97. package/lib/esm/actions/blue/supplyCollateralBorrow.js +17 -19
  98. package/lib/esm/actions/blue/withdraw.d.ts +10 -2
  99. package/lib/esm/actions/blue/withdraw.js +7 -1
  100. package/lib/esm/actions/index.d.ts +1 -0
  101. package/lib/esm/actions/index.js +1 -0
  102. package/lib/esm/actions/requirements/blue/getBlueAuthorizationRequirement.d.ts +49 -0
  103. package/lib/esm/actions/requirements/blue/getBlueAuthorizationRequirement.js +107 -0
  104. package/lib/esm/actions/requirements/blue/index.d.ts +1 -0
  105. package/lib/esm/actions/requirements/blue/index.js +1 -0
  106. package/lib/esm/actions/requirements/encode/encodeBlueSignatureAuthorization.d.ts +55 -0
  107. package/lib/esm/actions/requirements/encode/encodeBlueSignatureAuthorization.js +85 -0
  108. package/lib/esm/actions/requirements/encode/encodeErc20Approval.d.ts +6 -5
  109. package/lib/esm/actions/requirements/encode/encodeErc20Approval.js +19 -7
  110. package/lib/esm/actions/requirements/encode/encodeErc20Permit.d.ts +9 -7
  111. package/lib/esm/actions/requirements/encode/encodeErc20Permit.js +20 -6
  112. package/lib/esm/actions/requirements/encode/{encodeErc20Permit2.d.ts → encodeErc20Permit2Approve.d.ts} +11 -13
  113. package/lib/esm/actions/requirements/encode/{encodeErc20Permit2.js → encodeErc20Permit2Approve.js} +8 -12
  114. package/lib/esm/actions/requirements/encode/index.d.ts +2 -1
  115. package/lib/esm/actions/requirements/encode/index.js +2 -1
  116. package/lib/esm/actions/requirements/{getRequirements.d.ts → generalAdapter/getGeneralAdapterRequirements.d.ts} +34 -20
  117. package/lib/esm/actions/requirements/generalAdapter/getGeneralAdapterRequirements.js +147 -0
  118. package/lib/{cjs/actions/requirements/getRequirementsPermit.d.ts → esm/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit.d.ts} +6 -14
  119. package/lib/esm/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit.js +46 -0
  120. package/lib/esm/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit2.d.ts +57 -0
  121. package/lib/esm/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit2.js +70 -0
  122. package/lib/esm/actions/requirements/generalAdapter/index.d.ts +3 -0
  123. package/lib/esm/actions/requirements/generalAdapter/index.js +3 -0
  124. package/lib/esm/actions/requirements/getRequirementsApproval.d.ts +3 -2
  125. package/lib/esm/actions/requirements/getRequirementsApproval.js +3 -2
  126. package/lib/esm/actions/requirements/index.d.ts +2 -5
  127. package/lib/esm/actions/requirements/index.js +2 -5
  128. package/lib/esm/actions/signatures/getBlueAuthorizationAction.d.ts +29 -0
  129. package/lib/esm/actions/signatures/getBlueAuthorizationAction.js +44 -0
  130. package/lib/{cjs/actions/requirements/getRequirementsAction.d.ts → esm/actions/signatures/getTokenRequirementActions.d.ts} +17 -17
  131. package/lib/esm/actions/{requirements/getRequirementsAction.js → signatures/getTokenRequirementActions.js} +24 -11
  132. package/lib/esm/actions/signatures/index.d.ts +2 -0
  133. package/lib/esm/actions/signatures/index.js +2 -0
  134. package/lib/esm/actions/vaultV1/deposit.d.ts +6 -8
  135. package/lib/esm/actions/vaultV1/deposit.js +11 -21
  136. package/lib/esm/actions/vaultV1/migrateToV2.d.ts +6 -6
  137. package/lib/esm/actions/vaultV1/migrateToV2.js +12 -20
  138. package/lib/esm/actions/vaultV2/deposit.d.ts +6 -8
  139. package/lib/esm/actions/vaultV2/deposit.js +11 -21
  140. package/lib/esm/addresses.d.ts +2 -2
  141. package/lib/esm/addresses.js +1 -1
  142. package/lib/esm/bundler/actions.d.ts +44 -4
  143. package/lib/esm/bundler/actions.js +77 -4
  144. package/lib/esm/bundler/types.d.ts +6 -0
  145. package/lib/esm/constants.d.ts +2 -2
  146. package/lib/esm/constants.js +2 -2
  147. package/lib/esm/entities/blue/blue.d.ts +58 -33
  148. package/lib/esm/entities/blue/blue.js +173 -127
  149. package/lib/esm/entities/reallocationData.d.ts +12 -12
  150. package/lib/esm/entities/reallocationData.js +18 -18
  151. package/lib/esm/entities/vaultV1/vaultV1.d.ts +9 -9
  152. package/lib/esm/entities/vaultV1/vaultV1.js +46 -36
  153. package/lib/esm/entities/vaultV2/vaultV2.d.ts +6 -6
  154. package/lib/esm/entities/vaultV2/vaultV2.js +23 -18
  155. package/lib/esm/errors.d.ts +3 -2
  156. package/lib/esm/errors.js +2 -1
  157. package/lib/esm/helpers/validate.d.ts +2 -2
  158. package/lib/esm/helpers/validate.js +1 -1
  159. package/lib/esm/types/action.d.ts +113 -9
  160. package/lib/esm/types/action.js +75 -4
  161. package/lib/esm/types/error.d.ts +73 -0
  162. package/lib/esm/types/error.js +84 -2
  163. package/lib/esm/types.d.ts +2 -1
  164. package/lib/esm/utils.d.ts +1 -1
  165. package/lib/esm/utils.js +1 -1
  166. package/package.json +6 -6
  167. package/lib/cjs/actions/requirements/getMorphoAuthorizationRequirement.d.ts +0 -37
  168. package/lib/cjs/actions/requirements/getMorphoAuthorizationRequirement.js +0 -71
  169. package/lib/cjs/actions/requirements/getRequirements.js +0 -112
  170. package/lib/cjs/actions/requirements/getRequirementsPermit.js +0 -57
  171. package/lib/cjs/actions/requirements/getRequirementsPermit2.d.ts +0 -63
  172. package/lib/cjs/actions/requirements/getRequirementsPermit2.js +0 -85
  173. package/lib/esm/actions/requirements/getMorphoAuthorizationRequirement.d.ts +0 -37
  174. package/lib/esm/actions/requirements/getMorphoAuthorizationRequirement.js +0 -67
  175. package/lib/esm/actions/requirements/getRequirements.js +0 -108
  176. package/lib/esm/actions/requirements/getRequirementsPermit.js +0 -53
  177. package/lib/esm/actions/requirements/getRequirementsPermit2.d.ts +0 -63
  178. package/lib/esm/actions/requirements/getRequirementsPermit2.js +0 -81
@@ -7,7 +7,7 @@ const viem_1 = require("viem");
7
7
  const index_js_1 = require("../../bundler/index.js");
8
8
  const index_js_2 = require("../../helpers/index.js");
9
9
  const index_js_3 = require("../../types/index.js");
10
- const getRequirementsAction_js_1 = require("../requirements/getRequirementsAction.js");
10
+ const getTokenRequirementActions_js_1 = require("../signatures/getTokenRequirementActions.js");
11
11
  /**
12
12
  * Prepares a deposit transaction for a VaultV1 (MetaMorpho) contract.
13
13
  *
@@ -27,9 +27,7 @@ const getRequirementsAction_js_1 = require("../requirements/getRequirementsActio
27
27
  * @param params.args.maxSharePrice - Maximum acceptable share price (in RAY, slippage
28
28
  * protection enforced on-chain by `GeneralAdapter1`).
29
29
  * @param params.args.recipient - Address that receives the minted vault shares.
30
- * @param params.args.requirementSignature - Optional pre-signed permit/permit2 approval. When
31
- * absent, the bundle uses a plain `erc20TransferFrom` and assumes the user has already
32
- * approved `GeneralAdapter1`.
30
+ * @param params.args.requirementSignature - Optional pre-signed permit/permit2 approval.
33
31
  * @param params.args.nativeAmount - Optional amount of native token to wrap into wNative for the
34
32
  * deposit. Requires the vault asset to be the chain's wNative.
35
33
  * @param params.metadata - Optional analytics metadata attached to the bundle.
@@ -42,12 +40,12 @@ const getRequirementsAction_js_1 = require("../requirements/getRequirementsActio
42
40
  * configured wNative.
43
41
  * @throws {NativeAmountOnNonWNativeVaultError} when `nativeAmount` is provided but the vault
44
42
  * asset is not the chain's wNative.
45
- * @throws {DepositAssetMismatchError} from `getRequirementsAction` when `amount > 0n` and
43
+ * @throws {DepositAssetMismatchError} from `getTokenRequirementActions` when `amount > 0n` and
46
44
  * `requirementSignature` is provided and the signed asset differs from `vault.asset`. The
47
45
  * signature is ignored on the native-only path (`amount === 0n` with `nativeAmount > 0n`).
48
- * @throws {DepositAmountMismatchError} from `getRequirementsAction` when `amount > 0n` and
46
+ * @throws {DepositAmountMismatchError} from `getTokenRequirementActions` when `amount > 0n` and
49
47
  * `requirementSignature` is provided and the signed amount differs from `args.amount`.
50
- * @throws {Permit2ExpirationMissingError} from `getRequirementsAction` when `amount > 0n` and a
48
+ * @throws {Permit2ExpirationMissingError} from `getTokenRequirementActions` when `amount > 0n` and a
51
49
  * Permit2 requirement signature is missing its expiration.
52
50
  * @throws {ZeroDepositAmountError} when both `amount` and `nativeAmount` resolve to zero.
53
51
  * @example
@@ -95,20 +93,12 @@ const vaultV1Deposit = ({ vault: { chainId, address: vaultAddress, asset }, args
95
93
  });
96
94
  }
97
95
  if (amount > 0n) {
98
- if (requirementSignature) {
99
- actions.push(...(0, getRequirementsAction_js_1.getRequirementsAction)({
100
- asset,
101
- amount,
102
- recipient: generalAdapter1,
103
- requirementSignature,
104
- }));
105
- }
106
- else {
107
- actions.push({
108
- type: "erc20TransferFrom",
109
- args: [asset, amount, generalAdapter1, false /* skipRevert */],
110
- });
111
- }
96
+ actions.push(...(0, getTokenRequirementActions_js_1.getTokenRequirementActions)({
97
+ asset,
98
+ amount,
99
+ recipient: generalAdapter1,
100
+ requirementSignature,
101
+ }));
112
102
  }
113
103
  const totalAssets = amount + (nativeAmount ?? 0n);
114
104
  if (totalAssets === 0n) {
@@ -1,5 +1,5 @@
1
1
  import { type Address } from "viem";
2
- import { type Metadata, type RequirementSignature, type Transaction, type VaultV1MigrateToV2Action } from "../../types/index.js";
2
+ import { type Metadata, type PermitRequirementSignature, type Transaction, type VaultV1MigrateToV2Action } from "../../types/index.js";
3
3
  /** Parameters for {@link vaultV1MigrateToV2}. */
4
4
  export interface VaultV1MigrateToV2Params {
5
5
  vault: {
@@ -21,7 +21,7 @@ export interface VaultV1MigrateToV2Params {
21
21
  /** Receives the V2 vault shares. */
22
22
  recipient: Address;
23
23
  /** Pre-signed permit/permit2 approval for V1 share transfer. */
24
- requirementSignature?: RequirementSignature;
24
+ requirementSignature?: PermitRequirementSignature;
25
25
  };
26
26
  metadata?: Metadata;
27
27
  }
@@ -51,7 +51,7 @@ export interface VaultV1MigrateToV2Params {
51
51
  * for the deposit leg).
52
52
  * @param params.args.recipient - Address that receives the V2 vault shares.
53
53
  * @param params.args.requirementSignature - Optional pre-signed permit/permit2 for the V1 share
54
- * transfer. When absent, the bundle falls back to a plain `erc20TransferFrom`.
54
+ * transfer.
55
55
  * @param params.metadata - Optional analytics metadata attached to the bundle.
56
56
  * @returns A deep-frozen `Transaction<VaultV1MigrateToV2Action>` with `to`, `value`, `data`, and
57
57
  * the typed `action` discriminator the simulation layer consumes.
@@ -59,11 +59,11 @@ export interface VaultV1MigrateToV2Params {
59
59
  * @throws {NonPositiveSharesAmountError} when `shares <= 0n`.
60
60
  * @throws {NegativeMinSharePriceError} when `minSharePriceVaultV1 < 0n`.
61
61
  * @throws {NonPositiveMaxSharePriceError} when `maxSharePriceVaultV2 <= 0n`.
62
- * @throws {DepositAssetMismatchError} from `getRequirementsAction` when `requirementSignature`
62
+ * @throws {DepositAssetMismatchError} from `getTokenRequirementActions` when `requirementSignature`
63
63
  * is provided and the signed asset differs from `vault.address` (the V1 share token).
64
- * @throws {DepositAmountMismatchError} from `getRequirementsAction` when `requirementSignature`
64
+ * @throws {DepositAmountMismatchError} from `getTokenRequirementActions` when `requirementSignature`
65
65
  * is provided and the signed amount differs from `args.shares`.
66
- * @throws {Permit2ExpirationMissingError} from `getRequirementsAction` when a Permit2 requirement
66
+ * @throws {Permit2ExpirationMissingError} from `getTokenRequirementActions` when a Permit2 requirement
67
67
  * signature is missing its expiration.
68
68
  * @example
69
69
  * ```ts
@@ -7,7 +7,7 @@ const viem_1 = require("viem");
7
7
  const index_js_1 = require("../../bundler/index.js");
8
8
  const index_js_2 = require("../../helpers/index.js");
9
9
  const index_js_3 = require("../../types/index.js");
10
- const getRequirementsAction_js_1 = require("../requirements/getRequirementsAction.js");
10
+ const getTokenRequirementActions_js_1 = require("../signatures/getTokenRequirementActions.js");
11
11
  /**
12
12
  * Prepares an atomic full-migration transaction from VaultV1 to VaultV2.
13
13
  *
@@ -34,7 +34,7 @@ const getRequirementsAction_js_1 = require("../requirements/getRequirementsActio
34
34
  * for the deposit leg).
35
35
  * @param params.args.recipient - Address that receives the V2 vault shares.
36
36
  * @param params.args.requirementSignature - Optional pre-signed permit/permit2 for the V1 share
37
- * transfer. When absent, the bundle falls back to a plain `erc20TransferFrom`.
37
+ * transfer.
38
38
  * @param params.metadata - Optional analytics metadata attached to the bundle.
39
39
  * @returns A deep-frozen `Transaction<VaultV1MigrateToV2Action>` with `to`, `value`, `data`, and
40
40
  * the typed `action` discriminator the simulation layer consumes.
@@ -42,11 +42,11 @@ const getRequirementsAction_js_1 = require("../requirements/getRequirementsActio
42
42
  * @throws {NonPositiveSharesAmountError} when `shares <= 0n`.
43
43
  * @throws {NegativeMinSharePriceError} when `minSharePriceVaultV1 < 0n`.
44
44
  * @throws {NonPositiveMaxSharePriceError} when `maxSharePriceVaultV2 <= 0n`.
45
- * @throws {DepositAssetMismatchError} from `getRequirementsAction` when `requirementSignature`
45
+ * @throws {DepositAssetMismatchError} from `getTokenRequirementActions` when `requirementSignature`
46
46
  * is provided and the signed asset differs from `vault.address` (the V1 share token).
47
- * @throws {DepositAmountMismatchError} from `getRequirementsAction` when `requirementSignature`
47
+ * @throws {DepositAmountMismatchError} from `getTokenRequirementActions` when `requirementSignature`
48
48
  * is provided and the signed amount differs from `args.shares`.
49
- * @throws {Permit2ExpirationMissingError} from `getRequirementsAction` when a Permit2 requirement
49
+ * @throws {Permit2ExpirationMissingError} from `getTokenRequirementActions` when a Permit2 requirement
50
50
  * signature is missing its expiration.
51
51
  * @example
52
52
  * ```ts
@@ -85,21 +85,13 @@ const vaultV1MigrateToV2 = ({ vault: { chainId, address: sourceVault, asset: sou
85
85
  const actions = [];
86
86
  // Transfer V1 shares from user to GA1.
87
87
  // With a signature: permit/permit2 + transferFrom for the signed amount.
88
- // Without: plain erc20TransferFrom for the specified shares amount.
89
- if (requirementSignature) {
90
- actions.push(...(0, getRequirementsAction_js_1.getRequirementsAction)({
91
- asset: sourceVault,
92
- amount: shares,
93
- recipient: generalAdapter1,
94
- requirementSignature,
95
- }));
96
- }
97
- else {
98
- actions.push({
99
- type: "erc20TransferFrom",
100
- args: [sourceVault, shares, generalAdapter1, false /* skipRevert */],
101
- });
102
- }
88
+ // Without a signature: use ERC-20 transferFrom for the specified shares amount.
89
+ actions.push(...(0, getTokenRequirementActions_js_1.getTokenRequirementActions)({
90
+ asset: sourceVault,
91
+ amount: shares,
92
+ recipient: generalAdapter1,
93
+ requirementSignature,
94
+ }));
103
95
  // GA1 redeems its own shares (owner = GA1, no allowance check).
104
96
  actions.push({
105
97
  type: "erc4626Redeem",
@@ -1,5 +1,5 @@
1
1
  import { type Address } from "viem";
2
- import { type DepositAmountArgs, type Metadata, type RequirementSignature, type Transaction, type VaultV2DepositAction } from "../../types/index.js";
2
+ import { type DepositAmountArgs, type Metadata, type PermitRequirementSignature, type Transaction, type VaultV2DepositAction } from "../../types/index.js";
3
3
  /** Parameters for {@link vaultV2Deposit}. */
4
4
  export interface VaultV2DepositParams {
5
5
  vault: {
@@ -10,7 +10,7 @@ export interface VaultV2DepositParams {
10
10
  args: DepositAmountArgs & {
11
11
  maxSharePrice: bigint;
12
12
  recipient: Address;
13
- requirementSignature?: RequirementSignature;
13
+ requirementSignature?: PermitRequirementSignature;
14
14
  };
15
15
  metadata?: Metadata;
16
16
  }
@@ -33,9 +33,7 @@ export interface VaultV2DepositParams {
33
33
  * @param params.args.maxSharePrice - Maximum acceptable share price (in RAY, slippage
34
34
  * protection enforced on-chain by `GeneralAdapter1`).
35
35
  * @param params.args.recipient - Address that receives the minted vault shares.
36
- * @param params.args.requirementSignature - Optional pre-signed permit/permit2 approval. When
37
- * absent, the bundle uses a plain `erc20TransferFrom` and assumes the user has already
38
- * approved `GeneralAdapter1`.
36
+ * @param params.args.requirementSignature - Optional pre-signed permit/permit2 approval.
39
37
  * @param params.args.nativeAmount - Optional amount of native token to wrap into wNative for the
40
38
  * deposit. Requires the vault asset to be the chain's wNative.
41
39
  * @param params.metadata - Optional analytics metadata attached to the bundle.
@@ -48,12 +46,12 @@ export interface VaultV2DepositParams {
48
46
  * configured wNative.
49
47
  * @throws {NativeAmountOnNonWNativeVaultError} when `nativeAmount` is provided but the vault
50
48
  * asset is not the chain's wNative.
51
- * @throws {DepositAssetMismatchError} from `getRequirementsAction` when `amount > 0n` and
49
+ * @throws {DepositAssetMismatchError} from `getTokenRequirementActions` when `amount > 0n` and
52
50
  * `requirementSignature` is provided and the signed asset differs from `vault.asset`. The
53
51
  * signature is ignored on the native-only path (`amount === 0n` with `nativeAmount > 0n`).
54
- * @throws {DepositAmountMismatchError} from `getRequirementsAction` when `amount > 0n` and
52
+ * @throws {DepositAmountMismatchError} from `getTokenRequirementActions` when `amount > 0n` and
55
53
  * `requirementSignature` is provided and the signed amount differs from `args.amount`.
56
- * @throws {Permit2ExpirationMissingError} from `getRequirementsAction` when `amount > 0n` and a
54
+ * @throws {Permit2ExpirationMissingError} from `getTokenRequirementActions` when `amount > 0n` and a
57
55
  * Permit2 requirement signature is missing its expiration.
58
56
  * @throws {ZeroDepositAmountError} when both `amount` and `nativeAmount` resolve to zero.
59
57
  * @example
@@ -7,7 +7,7 @@ const viem_1 = require("viem");
7
7
  const index_js_1 = require("../../bundler/index.js");
8
8
  const index_js_2 = require("../../helpers/index.js");
9
9
  const index_js_3 = require("../../types/index.js");
10
- const getRequirementsAction_js_1 = require("../requirements/getRequirementsAction.js");
10
+ const getTokenRequirementActions_js_1 = require("../signatures/getTokenRequirementActions.js");
11
11
  /**
12
12
  * Prepares a deposit transaction for a VaultV2 contract.
13
13
  *
@@ -27,9 +27,7 @@ const getRequirementsAction_js_1 = require("../requirements/getRequirementsActio
27
27
  * @param params.args.maxSharePrice - Maximum acceptable share price (in RAY, slippage
28
28
  * protection enforced on-chain by `GeneralAdapter1`).
29
29
  * @param params.args.recipient - Address that receives the minted vault shares.
30
- * @param params.args.requirementSignature - Optional pre-signed permit/permit2 approval. When
31
- * absent, the bundle uses a plain `erc20TransferFrom` and assumes the user has already
32
- * approved `GeneralAdapter1`.
30
+ * @param params.args.requirementSignature - Optional pre-signed permit/permit2 approval.
33
31
  * @param params.args.nativeAmount - Optional amount of native token to wrap into wNative for the
34
32
  * deposit. Requires the vault asset to be the chain's wNative.
35
33
  * @param params.metadata - Optional analytics metadata attached to the bundle.
@@ -42,12 +40,12 @@ const getRequirementsAction_js_1 = require("../requirements/getRequirementsActio
42
40
  * configured wNative.
43
41
  * @throws {NativeAmountOnNonWNativeVaultError} when `nativeAmount` is provided but the vault
44
42
  * asset is not the chain's wNative.
45
- * @throws {DepositAssetMismatchError} from `getRequirementsAction` when `amount > 0n` and
43
+ * @throws {DepositAssetMismatchError} from `getTokenRequirementActions` when `amount > 0n` and
46
44
  * `requirementSignature` is provided and the signed asset differs from `vault.asset`. The
47
45
  * signature is ignored on the native-only path (`amount === 0n` with `nativeAmount > 0n`).
48
- * @throws {DepositAmountMismatchError} from `getRequirementsAction` when `amount > 0n` and
46
+ * @throws {DepositAmountMismatchError} from `getTokenRequirementActions` when `amount > 0n` and
49
47
  * `requirementSignature` is provided and the signed amount differs from `args.amount`.
50
- * @throws {Permit2ExpirationMissingError} from `getRequirementsAction` when `amount > 0n` and a
48
+ * @throws {Permit2ExpirationMissingError} from `getTokenRequirementActions` when `amount > 0n` and a
51
49
  * Permit2 requirement signature is missing its expiration.
52
50
  * @throws {ZeroDepositAmountError} when both `amount` and `nativeAmount` resolve to zero.
53
51
  * @example
@@ -95,20 +93,12 @@ const vaultV2Deposit = ({ vault: { chainId, address: vaultAddress, asset }, args
95
93
  });
96
94
  }
97
95
  if (amount > 0n) {
98
- if (requirementSignature) {
99
- actions.push(...(0, getRequirementsAction_js_1.getRequirementsAction)({
100
- asset,
101
- amount,
102
- recipient: generalAdapter1,
103
- requirementSignature,
104
- }));
105
- }
106
- else {
107
- actions.push({
108
- type: "erc20TransferFrom",
109
- args: [asset, amount, generalAdapter1, false /* skipRevert */],
110
- });
111
- }
96
+ actions.push(...(0, getTokenRequirementActions_js_1.getTokenRequirementActions)({
97
+ asset,
98
+ amount,
99
+ recipient: generalAdapter1,
100
+ requirementSignature,
101
+ }));
112
102
  }
113
103
  const totalAssets = amount + (nativeAmount ?? 0n);
114
104
  if (totalAssets === 0n) {
@@ -1,2 +1,2 @@
1
- export type { AddressLabel, ChainAddresses, ChainDeployments, } from "@morpho-org/blue-sdk";
2
- export { addresses, addressesRegistry, convexWrapperTokens, deployments, erc20WrapperTokens, getChainAddresses, getPermissionedCoinbaseTokens, getUnwrappedToken, NATIVE_ADDRESS, permissionedBackedTokens, permissionedCoinbaseTokens, permissionedWrapperTokens, registerCustomAddresses, unwrappedTokensMapping, } from "@morpho-org/blue-sdk";
1
+ export type { AddressLabel, AddressRegistry, ChainAddresses, ChainDeployments, DeploymentRegistry, } from "@morpho-org/blue-sdk";
2
+ export { addresses, addressesRegistry, convexWrapperTokens, deployments, erc20WrapperTokens, getChainAddress, getChainAddresses, getPermissionedCoinbaseTokens, getUnwrappedToken, NATIVE_ADDRESS, permissionedBackedTokens, permissionedCoinbaseTokens, permissionedWrapperTokens, registerCustomAddresses, unwrappedTokensMapping, } from "@morpho-org/blue-sdk";
@@ -1,12 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.unwrappedTokensMapping = exports.registerCustomAddresses = exports.permissionedWrapperTokens = exports.permissionedCoinbaseTokens = exports.permissionedBackedTokens = exports.NATIVE_ADDRESS = exports.getUnwrappedToken = exports.getPermissionedCoinbaseTokens = exports.getChainAddresses = exports.erc20WrapperTokens = exports.deployments = exports.convexWrapperTokens = exports.addressesRegistry = exports.addresses = void 0;
3
+ exports.unwrappedTokensMapping = exports.registerCustomAddresses = exports.permissionedWrapperTokens = exports.permissionedCoinbaseTokens = exports.permissionedBackedTokens = exports.NATIVE_ADDRESS = exports.getUnwrappedToken = exports.getPermissionedCoinbaseTokens = exports.getChainAddresses = exports.getChainAddress = exports.erc20WrapperTokens = exports.deployments = exports.convexWrapperTokens = exports.addressesRegistry = exports.addresses = void 0;
4
4
  var blue_sdk_1 = require("@morpho-org/blue-sdk");
5
5
  Object.defineProperty(exports, "addresses", { enumerable: true, get: function () { return blue_sdk_1.addresses; } });
6
6
  Object.defineProperty(exports, "addressesRegistry", { enumerable: true, get: function () { return blue_sdk_1.addressesRegistry; } });
7
7
  Object.defineProperty(exports, "convexWrapperTokens", { enumerable: true, get: function () { return blue_sdk_1.convexWrapperTokens; } });
8
8
  Object.defineProperty(exports, "deployments", { enumerable: true, get: function () { return blue_sdk_1.deployments; } });
9
9
  Object.defineProperty(exports, "erc20WrapperTokens", { enumerable: true, get: function () { return blue_sdk_1.erc20WrapperTokens; } });
10
+ Object.defineProperty(exports, "getChainAddress", { enumerable: true, get: function () { return blue_sdk_1.getChainAddress; } });
10
11
  Object.defineProperty(exports, "getChainAddresses", { enumerable: true, get: function () { return blue_sdk_1.getChainAddresses; } });
11
12
  Object.defineProperty(exports, "getPermissionedCoinbaseTokens", { enumerable: true, get: function () { return blue_sdk_1.getPermissionedCoinbaseTokens; } });
12
13
  Object.defineProperty(exports, "getUnwrappedToken", { enumerable: true, get: function () { return blue_sdk_1.getUnwrappedToken; } });
@@ -1,6 +1,6 @@
1
1
  import { type InputMarketParams } from "@morpho-org/blue-sdk";
2
- import { type Address, type Hex } from "viem";
3
- import type { Action, InputReallocation, Permit2PermitSingle } from "./types.js";
2
+ import { type Address, type Hex, type Signature } from "viem";
3
+ import type { Action, Authorization, InputReallocation, Permit2PermitSingle } from "./types.js";
4
4
  /**
5
5
  * Encoded low-level call consumed by Bundler3's `multicall`.
6
6
  */
@@ -211,7 +211,7 @@ export declare namespace BundlerAction {
211
211
  * );
212
212
  * ```
213
213
  */
214
- function permit(chainId: number, owner: Address, asset: Address, amount: bigint, deadline: bigint, signature: Hex, skipRevert?: boolean): BundlerCall[];
214
+ function permit(chainId: number, owner: Address, asset: Address, amount: bigint, deadline: bigint, signature: Hex | Signature, skipRevert?: boolean): BundlerCall[];
215
215
  /**
216
216
  * Encodes a Permit2 approval for GeneralAdapter1 spending.
217
217
  *
@@ -248,7 +248,7 @@ export declare namespace BundlerAction {
248
248
  * );
249
249
  * ```
250
250
  */
251
- function approve2(chainId: number, owner: Address, permitSingle: Permit2PermitSingle, signature: Hex, skipRevert?: boolean): BundlerCall[];
251
+ function approve2(chainId: number, owner: Address, permitSingle: Permit2PermitSingle, signature: Hex | Signature, skipRevert?: boolean): BundlerCall[];
252
252
  /**
253
253
  * Encodes a GeneralAdapter1 Permit2 transfer.
254
254
  *
@@ -334,6 +334,46 @@ export declare namespace BundlerAction {
334
334
  * ```
335
335
  */
336
336
  function erc4626Redeem(chainId: number, erc4626: Address, shares: bigint, minSharePrice: bigint, receiver: Address, owner: Address, skipRevert?: boolean): BundlerCall[];
337
+ /**
338
+ * Encodes a Morpho Blue `setAuthorizationWithSig` call that submits a signed authorization.
339
+ *
340
+ * Lets a bundle grant `authorization.authorized` (GeneralAdapter1) operator rights on Morpho
341
+ * on behalf of `authorization.authorizer` without a separate `setAuthorization` transaction.
342
+ *
343
+ * @param chainId - Chain where the action will execute.
344
+ * @param authorization - The Morpho authorization payload covered by the signature.
345
+ * @param signature - The owner's EIP-712 signature over the authorization typed data, as a hex
346
+ * string or a viem `Signature` object.
347
+ * @param skipRevert - Whether Bundler3 should tolerate a revert. Defaults to `true`, matching
348
+ * the convention for already-authorized accounts (the call reverts harmlessly).
349
+ * @returns Encoded Bundler3 calls.
350
+ * @throws {BundlerErrors.UnexpectedSignature} when `authorization.authorized` is not the chain's
351
+ * `GeneralAdapter1` — the only operator this bundled path may grant rights to.
352
+ *
353
+ * @example
354
+ * ```ts
355
+ * import { getChainAddresses } from "@morpho-org/blue-sdk";
356
+ * import { BundlerAction } from "@morpho-org/morpho-sdk/bundler";
357
+ *
358
+ * const { generalAdapter1 } = getChainAddresses(1).bundler3;
359
+ * const owner = "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045";
360
+ * const signature =
361
+ * "0x111111111111111111111111111111111111111111111111111111111111111122222222222222222222222222222222222222222222222222222222222222221b";
362
+ *
363
+ * const calls = BundlerAction.morphoSetAuthorizationWithSig(
364
+ * 1,
365
+ * {
366
+ * authorizer: owner,
367
+ * authorized: generalAdapter1,
368
+ * isAuthorized: true,
369
+ * nonce: 0n,
370
+ * deadline: 1_900_000_000n,
371
+ * },
372
+ * signature,
373
+ * );
374
+ * ```
375
+ */
376
+ function morphoSetAuthorizationWithSig(chainId: number, authorization: Authorization, signature: Hex | Signature, skipRevert?: boolean): BundlerCall[];
337
377
  /**
338
378
  * Encodes a GeneralAdapter1 Morpho Blue supply-collateral call.
339
379
  *
@@ -21,6 +21,12 @@ const addBundlerPrefund = (state, amount) => ({
21
21
  value: state.value + amount,
22
22
  availableBundlerValue: state.availableBundlerValue + amount,
23
23
  });
24
+ /**
25
+ * Normalizes a raw ECDSA signature to its hex form. Integrators get a `Hex` from
26
+ * `signTypedData`/`signMessage` and a viem `Signature` object from the low-level
27
+ * `sign`; both are accepted so no manual conversion is required at the call site.
28
+ */
29
+ const toSignatureHex = (signature) => typeof signature === "string" ? signature : (0, viem_1.serializeSignature)(signature);
24
30
  const consumeCallValue = (state, call) => {
25
31
  if (call.value > state.availableBundlerValue) {
26
32
  return {
@@ -161,6 +167,12 @@ var BundlerAction;
161
167
  case "erc4626Redeem": {
162
168
  return BundlerAction.erc4626Redeem(chainId, ...args);
163
169
  }
170
+ case "morphoSetAuthorizationWithSig": {
171
+ const [authorization, signature, skipRevert] = args;
172
+ if (signature == null)
173
+ throw new error_js_1.BundlerErrors.MissingSignature();
174
+ return BundlerAction.morphoSetAuthorizationWithSig(chainId, authorization, signature, skipRevert);
175
+ }
164
176
  case "morphoSupplyCollateral": {
165
177
  const [market, amount, onBehalf, onMorphoSupplyCollateral, skipRevert] = args;
166
178
  return BundlerAction.morphoSupplyCollateral(chainId, market, amount, onBehalf, onMorphoSupplyCollateral.flatMap(BundlerAction.encode.bind(null, chainId)), skipRevert);
@@ -427,7 +439,7 @@ var BundlerAction;
427
439
  // biome-ignore lint/complexity/useMaxParams: TODO refactor to ≤2 params
428
440
  function permit(chainId, owner, asset, amount, deadline, signature, skipRevert = true) {
429
441
  const { bundler3: { generalAdapter1 }, } = (0, blue_sdk_1.getChainAddresses)(chainId);
430
- const { r, s, yParity } = (0, viem_1.parseSignature)(signature);
442
+ const { r, s, yParity } = (0, viem_1.parseSignature)(toSignatureHex(signature));
431
443
  return [
432
444
  {
433
445
  to: asset,
@@ -497,7 +509,7 @@ var BundlerAction;
497
509
  ...permitSingle,
498
510
  spender: generalAdapter1,
499
511
  },
500
- signature,
512
+ toSignatureHex(signature),
501
513
  ],
502
514
  }),
503
515
  value: 0n,
@@ -643,6 +655,67 @@ var BundlerAction;
643
655
  ];
644
656
  }
645
657
  BundlerAction.erc4626Redeem = erc4626Redeem;
658
+ /**
659
+ * Encodes a Morpho Blue `setAuthorizationWithSig` call that submits a signed authorization.
660
+ *
661
+ * Lets a bundle grant `authorization.authorized` (GeneralAdapter1) operator rights on Morpho
662
+ * on behalf of `authorization.authorizer` without a separate `setAuthorization` transaction.
663
+ *
664
+ * @param chainId - Chain where the action will execute.
665
+ * @param authorization - The Morpho authorization payload covered by the signature.
666
+ * @param signature - The owner's EIP-712 signature over the authorization typed data, as a hex
667
+ * string or a viem `Signature` object.
668
+ * @param skipRevert - Whether Bundler3 should tolerate a revert. Defaults to `true`, matching
669
+ * the convention for already-authorized accounts (the call reverts harmlessly).
670
+ * @returns Encoded Bundler3 calls.
671
+ * @throws {BundlerErrors.UnexpectedSignature} when `authorization.authorized` is not the chain's
672
+ * `GeneralAdapter1` — the only operator this bundled path may grant rights to.
673
+ *
674
+ * @example
675
+ * ```ts
676
+ * import { getChainAddresses } from "@morpho-org/blue-sdk";
677
+ * import { BundlerAction } from "@morpho-org/morpho-sdk/bundler";
678
+ *
679
+ * const { generalAdapter1 } = getChainAddresses(1).bundler3;
680
+ * const owner = "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045";
681
+ * const signature =
682
+ * "0x111111111111111111111111111111111111111111111111111111111111111122222222222222222222222222222222222222222222222222222222222222221b";
683
+ *
684
+ * const calls = BundlerAction.morphoSetAuthorizationWithSig(
685
+ * 1,
686
+ * {
687
+ * authorizer: owner,
688
+ * authorized: generalAdapter1,
689
+ * isAuthorized: true,
690
+ * nonce: 0n,
691
+ * deadline: 1_900_000_000n,
692
+ * },
693
+ * signature,
694
+ * );
695
+ * ```
696
+ */
697
+ // biome-ignore lint/complexity/useMaxParams: TODO refactor to ≤2 params
698
+ function morphoSetAuthorizationWithSig(chainId, authorization, signature, skipRevert = true) {
699
+ const { morpho, bundler3: { generalAdapter1 }, } = (0, blue_sdk_1.getChainAddresses)(chainId);
700
+ const { r, s, yParity } = (0, viem_1.parseSignature)(toSignatureHex(signature));
701
+ if (!(0, viem_1.isAddressEqual)(authorization.authorized, generalAdapter1)) {
702
+ throw new error_js_1.BundlerErrors.UnexpectedSignature(authorization.authorized);
703
+ }
704
+ return [
705
+ {
706
+ to: morpho,
707
+ data: (0, viem_1.encodeFunctionData)({
708
+ abi: blue_sdk_viem_1.blueAbi,
709
+ functionName: "setAuthorizationWithSig",
710
+ args: [authorization, { v: yParity + 27, r, s }],
711
+ }),
712
+ value: 0n,
713
+ skipRevert,
714
+ callbackHash: viem_1.zeroHash,
715
+ },
716
+ ];
717
+ }
718
+ BundlerAction.morphoSetAuthorizationWithSig = morphoSetAuthorizationWithSig;
646
719
  /**
647
720
  * Encodes a GeneralAdapter1 Morpho Blue supply-collateral call.
648
721
  *
@@ -113,6 +113,12 @@ export interface ActionArgs {
113
113
  owner: Address,
114
114
  skipRevert?: boolean
115
115
  ];
116
+ /** Morpho Blue `setAuthorizationWithSig` call submitting a signed `authorization` and its `signature`; `skipRevert` controls Bundler3 revert handling. */
117
+ readonly morphoSetAuthorizationWithSig: [
118
+ authorization: Authorization,
119
+ signature: Hex | null,
120
+ skipRevert?: boolean
121
+ ];
116
122
  /** Morpho Blue supply-collateral call for `market`, `assets`, `onBehalf`, and callback actions; `skipRevert` controls Bundler3 revert handling. */
117
123
  readonly morphoSupplyCollateral: [
118
124
  market: InputMarketParams,
@@ -1,3 +1,3 @@
1
- export { ChainId, ChainUtils, DEFAULT_SLIPPAGE_TOLERANCE, EIP_712_FIELDS, isMarketId, LIQUIDATION_CURSOR, MAX_LIQUIDATION_INCENTIVE_FACTOR, ORACLE_PRICE_SCALE, SECONDS_PER_YEAR, TransactionType, } from "@morpho-org/blue-sdk";
2
- export { BLUE_API_BASE_URL, BLUE_API_GRAPHQL_URL, CDN_BASE_URL, DOCS_BASE_URL, MORPHO_DOMAIN, OPTIMIZERS_API_BASE_URL, OPTIMIZERS_BASE_URL, REWARDS_BASE_URL, ZERO_ADDRESS, } from "@morpho-org/morpho-ts";
1
+ export { DEFAULT_SLIPPAGE_TOLERANCE, EIP_712_FIELDS, isMarketId, LIQUIDATION_CURSOR, MAX_LIQUIDATION_INCENTIVE_FACTOR, ORACLE_PRICE_SCALE, SECONDS_PER_YEAR, TransactionType, } from "@morpho-org/blue-sdk";
2
+ export { BLUE_API_BASE_URL, BLUE_API_GRAPHQL_URL, CDN_BASE_URL, ChainId, ChainUtils, DOCS_BASE_URL, MORPHO_DOMAIN, OPTIMIZERS_API_BASE_URL, OPTIMIZERS_BASE_URL, REWARDS_BASE_URL, ZERO_ADDRESS, } from "@morpho-org/morpho-ts";
3
3
  export { APPROVE_ONLY_ONCE_TOKENS, DEFAULT_LLTV_BUFFER, DEFAULT_SUPPLY_TARGET_UTILIZATION, DEFAULT_WITHDRAWAL_TARGET_UTILIZATION, MAX_ABSOLUTE_SHARE_PRICE, MAX_SLIPPAGE_TOLERANCE, MAX_TOKEN_APPROVALS, } from "./helpers/constant.js";
@@ -1,9 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MAX_TOKEN_APPROVALS = exports.MAX_SLIPPAGE_TOLERANCE = exports.MAX_ABSOLUTE_SHARE_PRICE = exports.DEFAULT_WITHDRAWAL_TARGET_UTILIZATION = exports.DEFAULT_SUPPLY_TARGET_UTILIZATION = 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.CDN_BASE_URL = exports.BLUE_API_GRAPHQL_URL = exports.BLUE_API_BASE_URL = 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 = exports.ChainUtils = exports.ChainId = void 0;
3
+ exports.MAX_TOKEN_APPROVALS = exports.MAX_SLIPPAGE_TOLERANCE = exports.MAX_ABSOLUTE_SHARE_PRICE = exports.DEFAULT_WITHDRAWAL_TARGET_UTILIZATION = exports.DEFAULT_SUPPLY_TARGET_UTILIZATION = 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.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;
4
4
  var blue_sdk_1 = require("@morpho-org/blue-sdk");
5
- Object.defineProperty(exports, "ChainId", { enumerable: true, get: function () { return blue_sdk_1.ChainId; } });
6
- Object.defineProperty(exports, "ChainUtils", { enumerable: true, get: function () { return blue_sdk_1.ChainUtils; } });
7
5
  Object.defineProperty(exports, "DEFAULT_SLIPPAGE_TOLERANCE", { enumerable: true, get: function () { return blue_sdk_1.DEFAULT_SLIPPAGE_TOLERANCE; } });
8
6
  Object.defineProperty(exports, "EIP_712_FIELDS", { enumerable: true, get: function () { return blue_sdk_1.EIP_712_FIELDS; } });
9
7
  Object.defineProperty(exports, "isMarketId", { enumerable: true, get: function () { return blue_sdk_1.isMarketId; } });
@@ -16,6 +14,8 @@ var morpho_ts_1 = require("@morpho-org/morpho-ts");
16
14
  Object.defineProperty(exports, "BLUE_API_BASE_URL", { enumerable: true, get: function () { return morpho_ts_1.BLUE_API_BASE_URL; } });
17
15
  Object.defineProperty(exports, "BLUE_API_GRAPHQL_URL", { enumerable: true, get: function () { return morpho_ts_1.BLUE_API_GRAPHQL_URL; } });
18
16
  Object.defineProperty(exports, "CDN_BASE_URL", { enumerable: true, get: function () { return morpho_ts_1.CDN_BASE_URL; } });
17
+ Object.defineProperty(exports, "ChainId", { enumerable: true, get: function () { return morpho_ts_1.ChainId; } });
18
+ Object.defineProperty(exports, "ChainUtils", { enumerable: true, get: function () { return morpho_ts_1.ChainUtils; } });
19
19
  Object.defineProperty(exports, "DOCS_BASE_URL", { enumerable: true, get: function () { return morpho_ts_1.DOCS_BASE_URL; } });
20
20
  Object.defineProperty(exports, "MORPHO_DOMAIN", { enumerable: true, get: function () { return morpho_ts_1.MORPHO_DOMAIN; } });
21
21
  Object.defineProperty(exports, "OPTIMIZERS_API_BASE_URL", { enumerable: true, get: function () { return morpho_ts_1.OPTIMIZERS_API_BASE_URL; } });