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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/MIGRATION-v5-to-v6.md +7 -0
  2. package/MIGRATION-v7-to-v8.md +7 -0
  3. package/MIGRATION-v8-to-v9.md +7 -0
  4. package/README.md +6 -4
  5. package/lib/cjs/abis.d.ts +1 -1
  6. package/lib/cjs/abis.js +5 -1
  7. package/lib/cjs/actions/bundles/resolveBundlesTokenRequirements.d.ts +1 -0
  8. package/lib/cjs/actions/requirements/encode/encodeErc20Permit.d.ts +4 -1
  9. package/lib/cjs/actions/requirements/encode/encodeErc20Permit.js +4 -1
  10. package/lib/cjs/actions/requirements/encode/encodeErc20Permit2SignatureTransfer.d.ts +5 -1
  11. package/lib/cjs/actions/requirements/encode/encodeErc20Permit2SignatureTransfer.js +1 -0
  12. package/lib/cjs/blue/abis.d.ts +1 -1
  13. package/lib/cjs/blue/abis.js +5 -1
  14. package/lib/cjs/blue/entities.d.ts +4 -4
  15. package/lib/cjs/blue/entities.js +3 -1
  16. package/lib/cjs/blue/errors.d.ts +2 -2
  17. package/lib/cjs/blue/errors.js +5 -1
  18. package/lib/cjs/blue/fetch.d.ts +2 -2
  19. package/lib/cjs/blue/fetch.js +3 -1
  20. package/lib/cjs/blue/utils.d.ts +1 -1
  21. package/lib/cjs/blue/utils.js +2 -1
  22. package/lib/cjs/client/morphoViemExtension.d.ts +1 -1
  23. package/lib/cjs/client/morphoViemExtension.js +1 -1
  24. package/lib/cjs/entities/blue/blue.d.ts +7 -21
  25. package/lib/cjs/entities/blue/blue.js +4 -22
  26. package/lib/cjs/entities/index.d.ts +4 -4
  27. package/lib/cjs/entities/index.js +3 -1
  28. package/lib/cjs/entities/requirements/getBundlesTokenRequirements.d.ts +21 -26
  29. package/lib/cjs/entities/requirements/getBundlesTokenRequirements.js +42 -80
  30. package/lib/cjs/entities/requirements/getUnusedPermit2Nonce.d.ts +6 -3
  31. package/lib/cjs/entities/requirements/getUnusedPermit2Nonce.js +2 -2
  32. package/lib/cjs/entities/vaultV1/vaultV1.d.ts +5 -11
  33. package/lib/cjs/entities/vaultV1/vaultV1.js +3 -11
  34. package/lib/cjs/entities/vaultV2/vaultV2.d.ts +37 -18
  35. package/lib/cjs/entities/vaultV2/vaultV2.js +36 -12
  36. package/lib/cjs/entities/vaultV2BlueReallocationData.d.ts +8 -3
  37. package/lib/cjs/entities/vaultV2BlueReallocationData.js +49 -7
  38. package/lib/cjs/errors.d.ts +4 -4
  39. package/lib/cjs/errors.js +7 -5
  40. package/lib/cjs/fetch.d.ts +2 -2
  41. package/lib/cjs/fetch.js +3 -1
  42. package/lib/cjs/helpers/deadShares.js +2 -0
  43. package/lib/cjs/midnight/errors.d.ts +2 -1
  44. package/lib/cjs/midnight/errors.js +5 -4
  45. package/lib/cjs/types/action.d.ts +11 -4
  46. package/lib/cjs/types/action.js +1 -0
  47. package/lib/cjs/types/error.d.ts +8 -2
  48. package/lib/cjs/types/error.js +8 -2
  49. package/lib/cjs/utils.d.ts +2 -2
  50. package/lib/cjs/utils.js +4 -2
  51. package/lib/esm/abis.d.ts +1 -1
  52. package/lib/esm/abis.js +1 -1
  53. package/lib/esm/actions/bundles/resolveBundlesTokenRequirements.d.ts +1 -0
  54. package/lib/esm/actions/requirements/encode/encodeErc20Permit.d.ts +4 -1
  55. package/lib/esm/actions/requirements/encode/encodeErc20Permit.js +4 -1
  56. package/lib/esm/actions/requirements/encode/encodeErc20Permit2SignatureTransfer.d.ts +5 -1
  57. package/lib/esm/actions/requirements/encode/encodeErc20Permit2SignatureTransfer.js +1 -0
  58. package/lib/esm/blue/abis.d.ts +1 -1
  59. package/lib/esm/blue/abis.js +1 -1
  60. package/lib/esm/blue/entities.d.ts +4 -4
  61. package/lib/esm/blue/entities.js +2 -2
  62. package/lib/esm/blue/errors.d.ts +2 -2
  63. package/lib/esm/blue/errors.js +2 -2
  64. package/lib/esm/blue/fetch.d.ts +2 -2
  65. package/lib/esm/blue/fetch.js +2 -2
  66. package/lib/esm/blue/utils.d.ts +1 -1
  67. package/lib/esm/blue/utils.js +1 -1
  68. package/lib/esm/client/morphoViemExtension.d.ts +1 -1
  69. package/lib/esm/client/morphoViemExtension.js +1 -1
  70. package/lib/esm/entities/blue/blue.d.ts +7 -21
  71. package/lib/esm/entities/blue/blue.js +4 -22
  72. package/lib/esm/entities/index.d.ts +4 -4
  73. package/lib/esm/entities/index.js +2 -2
  74. package/lib/esm/entities/requirements/getBundlesTokenRequirements.d.ts +21 -26
  75. package/lib/esm/entities/requirements/getBundlesTokenRequirements.js +44 -82
  76. package/lib/esm/entities/requirements/getUnusedPermit2Nonce.d.ts +6 -3
  77. package/lib/esm/entities/requirements/getUnusedPermit2Nonce.js +2 -2
  78. package/lib/esm/entities/vaultV1/vaultV1.d.ts +5 -11
  79. package/lib/esm/entities/vaultV1/vaultV1.js +4 -12
  80. package/lib/esm/entities/vaultV2/vaultV2.d.ts +37 -18
  81. package/lib/esm/entities/vaultV2/vaultV2.js +37 -13
  82. package/lib/esm/entities/vaultV2BlueReallocationData.d.ts +8 -3
  83. package/lib/esm/entities/vaultV2BlueReallocationData.js +49 -7
  84. package/lib/esm/errors.d.ts +4 -4
  85. package/lib/esm/errors.js +4 -4
  86. package/lib/esm/fetch.d.ts +2 -2
  87. package/lib/esm/fetch.js +2 -2
  88. package/lib/esm/helpers/deadShares.js +3 -1
  89. package/lib/esm/midnight/errors.d.ts +2 -1
  90. package/lib/esm/midnight/errors.js +2 -1
  91. package/lib/esm/types/action.d.ts +11 -4
  92. package/lib/esm/types/action.js +1 -0
  93. package/lib/esm/types/error.d.ts +8 -2
  94. package/lib/esm/types/error.js +8 -2
  95. package/lib/esm/utils.d.ts +2 -2
  96. package/lib/esm/utils.js +2 -2
  97. package/package.json +6 -6
@@ -1,5 +1,12 @@
1
1
  # Migrating `@morpho-org/morpho-sdk` from v5 to v6
2
2
 
3
+ > Current funding behavior: the SDK no longer requests Permit2 funding. Use ERC-2612 permits
4
+ > (`supportSignature: true`, with `useSimplePermit` defaulting to true) or direct ERC-20 approvals.
5
+ > Pass `useSimplePermit: false` to force approvals. The legacy
6
+ > `permit2Nonce` option is deprecated and ignored; builders still accept previously collected
7
+ > signatures. Permit2 requirement descriptions below document historical behavior.
8
+
9
+
3
10
  Version 6 keeps the Blue entity at `client.morpho.blue(marketParams, chainId)` and preserves its
4
11
  write-method names while routing them through five direct BlueBundlesV1 entrypoints. Blue reads and
5
12
  the Vault V2 reallocation-data helper remain on the same entity. There is no parallel
@@ -1,5 +1,12 @@
1
1
  # Migrating `@morpho-org/morpho-sdk` from v7 to v8
2
2
 
3
+ > Current funding behavior: the SDK no longer requests Permit2 funding. Use ERC-2612 permits
4
+ > (`supportSignature: true`, with `useSimplePermit` defaulting to true) or direct ERC-20 approvals.
5
+ > Pass `useSimplePermit: false` to force approvals. The legacy
6
+ > `permit2Nonce` option is deprecated and ignored; builders still accept previously collected
7
+ > signatures. Permit2 requirement descriptions below document historical behavior.
8
+
9
+
3
10
  Version 8 makes token metadata and RPC-backed requirement reads fail closed.
4
11
  These calls now throw typed errors instead of returning partial or default values.
5
12
 
@@ -1,5 +1,12 @@
1
1
  # Migrating from morpho-sdk v8 to v9
2
2
 
3
+ > Current funding behavior: the SDK no longer requests Permit2 funding. Use ERC-2612 permits
4
+ > (`supportSignature: true`, with `useSimplePermit` defaulting to true) or direct ERC-20 approvals.
5
+ > Pass `useSimplePermit: false` to force approvals. The legacy
6
+ > `permit2Nonce` option is deprecated and ignored; builders still accept previously collected
7
+ > signatures. Permit2 requirement descriptions below document historical behavior.
8
+
9
+
3
10
  Version 9 removes exact-amount approval controls. Classic ERC-20 approvals and vault-share
4
11
  approvals or permits now use `maxUint256` when the existing allowance is below the required amount.
5
12
  An allowance at or above the required amount satisfies the requirement; larger leftovers are
package/README.md CHANGED
@@ -86,7 +86,7 @@ live Blue liquidity — before invoking `buildTx()`. Calling `buildTx()` directl
86
86
  RPC-backed pre-flight checks. `forceRedeem` remains a direct Vault V2 multicall without
87
87
  prerequisites.
88
88
 
89
- - **`getRequirements()`** — async; the on-chain prerequisites to satisfy first: ERC-20 approvals, permit / Permit2 signatures, Morpho authorization, or (for Midnight) operator authorization.
89
+ - **`getRequirements()`** — async; the on-chain prerequisites to satisfy first: ERC-20 approvals, ERC-2612 permit signatures, Morpho authorization, or (for Midnight) operator authorization.
90
90
  - **`buildTx(signatures?)`** — synchronous; the final, deep-frozen viem transaction. Pass any signatures collected from the requirements.
91
91
 
92
92
  Every transaction carries `tx.action` — typed metadata describing the encoded call (`type` plus
@@ -111,7 +111,10 @@ const requirements = await getRequirements();
111
111
  const tx = buildTx([permitSignature]);
112
112
  ```
113
113
 
114
- Enable off-chain approvals (permit / Permit2) with `morphoViemExtension({ supportSignature: true })`.
114
+ Enable off-chain approvals (ERC-2612 permits) with `morphoViemExtension({ supportSignature: true })`. Pass `getRequirements({ useSimplePermit: false })` to force direct ERC-20 approvals; unsupported tokens also fall back to direct approvals.
115
+
116
+ Token funding checks the bundles allowance first on every route. If it already covers the amount,
117
+ no token requirement is returned and ERC-2612 support is not probed.
115
118
 
116
119
  ### `userAddress` is the eventual submitter
117
120
 
@@ -152,8 +155,7 @@ Create an entity — every factory takes a chain ID as its last argument:
152
155
  ### Vault deposit / withdraw
153
156
 
154
157
  Deposit calls VaultBundlesV1 and may require an approval or permit. ERC-20 approvals and ERC-2612
155
- permits authorize VaultBundlesV1. Permit2 SignatureTransfer also names VaultBundlesV1 as spender,
156
- while the ERC-20 approval prerequisite targets canonical Permit2.
158
+ permits authorize VaultBundlesV1. The SDK no longer requests Permit2 funding.
157
159
 
158
160
  ```typescript
159
161
  const vault = client.morpho.vaultV2("0xVault...", 1);
package/lib/cjs/abis.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { marketParamsAbi as blueMarketParamsAbi } from "@morpho-org/blue-sdk";
2
- export { adaptiveCurveIrmAbi as blueAdaptiveCurveIrmAbi, blueAbi, blueOracleAbi, erc2612Abi, erc3643Abi, erc3643IdentityRegistryAbi, erc5267Abi, metaMorphoAbi, metaMorphoFactoryAbi, morphoMarketV1AdapterAbi, morphoMarketV1AdapterFactoryAbi, morphoMarketV1AdapterV2Abi, morphoMarketV1AdapterV2FactoryAbi, morphoVaultV1AdapterAbi, morphoVaultV1AdapterFactoryAbi, permissionedErc20WrapperAbi, permit2Abi,
2
+ export { adaptiveCurveIrmAbi as blueAdaptiveCurveIrmAbi, blueAbi, blueOracleAbi, erc2612Abi, erc3643Abi, erc3643IdentityRegistryAbi, erc5267Abi, metaMorphoAbi, metaMorphoFactoryAbi, midnightAdapterAbi, midnightAdapterFactoryAbi, midnightAdapterPriceRatifierV1Abi, midnightAdapterRateRatifierV1Abi, morphoMarketV1AdapterAbi, morphoMarketV1AdapterFactoryAbi, morphoMarketV1AdapterV2Abi, morphoMarketV1AdapterV2FactoryAbi, morphoVaultV1AdapterAbi, morphoVaultV1AdapterFactoryAbi, permissionedErc20WrapperAbi, permit2Abi,
3
3
  /** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
4
4
  preLiquidationAbi as bluePreLiquidationAbi,
5
5
  /** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
package/lib/cjs/abis.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.blueBundlesV1Abi = exports.vaultBundlesV1Abi = exports.vaultExitBundlesV1Abi = exports.midnightSetterRatifierAbi = exports.midnightRateRatifierV1Abi = exports.midnightPriceRatifierV1Abi = exports.midnightEventsAbi = exports.midnightBundlesV2Abi = exports.midnightAbi = exports.midnightEcrecoverRatifierAbi = exports.midnightEcrecoverAuthorizerAbi = exports.midnightBlueBuyCallbackFactoryAbi = exports.midnightBlueBuyCallbackAbi = exports.wstEthAbi = exports.wrappedBackedTokenAbi = exports.whitelistControllerAggregatorV2Abi = exports.vaultV2FactoryAbi = exports.vaultV2BluePublicAllocatorAbi = exports.vaultV2Abi = exports.bluePreLiquidationFactoryAbi = exports.bluePreLiquidationAbi = exports.permit2Abi = exports.permissionedErc20WrapperAbi = exports.morphoVaultV1AdapterFactoryAbi = exports.morphoVaultV1AdapterAbi = exports.morphoMarketV1AdapterV2FactoryAbi = exports.morphoMarketV1AdapterV2Abi = exports.morphoMarketV1AdapterFactoryAbi = exports.morphoMarketV1AdapterAbi = exports.metaMorphoFactoryAbi = exports.metaMorphoAbi = exports.erc5267Abi = exports.erc3643IdentityRegistryAbi = exports.erc3643Abi = exports.erc2612Abi = exports.blueOracleAbi = exports.blueAbi = exports.blueAdaptiveCurveIrmAbi = exports.blueMarketParamsAbi = void 0;
3
+ exports.blueBundlesV1Abi = exports.vaultBundlesV1Abi = exports.vaultExitBundlesV1Abi = exports.midnightSetterRatifierAbi = exports.midnightRateRatifierV1Abi = exports.midnightPriceRatifierV1Abi = exports.midnightEventsAbi = exports.midnightBundlesV2Abi = exports.midnightAbi = exports.midnightEcrecoverRatifierAbi = exports.midnightEcrecoverAuthorizerAbi = exports.midnightBlueBuyCallbackFactoryAbi = exports.midnightBlueBuyCallbackAbi = exports.wstEthAbi = exports.wrappedBackedTokenAbi = exports.whitelistControllerAggregatorV2Abi = exports.vaultV2FactoryAbi = exports.vaultV2BluePublicAllocatorAbi = exports.vaultV2Abi = exports.bluePreLiquidationFactoryAbi = exports.bluePreLiquidationAbi = exports.permit2Abi = exports.permissionedErc20WrapperAbi = exports.morphoVaultV1AdapterFactoryAbi = exports.morphoVaultV1AdapterAbi = exports.morphoMarketV1AdapterV2FactoryAbi = exports.morphoMarketV1AdapterV2Abi = exports.morphoMarketV1AdapterFactoryAbi = exports.morphoMarketV1AdapterAbi = exports.midnightAdapterRateRatifierV1Abi = exports.midnightAdapterPriceRatifierV1Abi = exports.midnightAdapterFactoryAbi = exports.midnightAdapterAbi = exports.metaMorphoFactoryAbi = exports.metaMorphoAbi = exports.erc5267Abi = exports.erc3643IdentityRegistryAbi = exports.erc3643Abi = exports.erc2612Abi = exports.blueOracleAbi = exports.blueAbi = exports.blueAdaptiveCurveIrmAbi = exports.blueMarketParamsAbi = void 0;
4
4
  var blue_sdk_1 = require("@morpho-org/blue-sdk");
5
5
  Object.defineProperty(exports, "blueMarketParamsAbi", { enumerable: true, get: function () { return blue_sdk_1.marketParamsAbi; } });
6
6
  var blue_sdk_viem_1 = require("@morpho-org/blue-sdk-viem");
@@ -13,6 +13,10 @@ Object.defineProperty(exports, "erc3643IdentityRegistryAbi", { enumerable: true,
13
13
  Object.defineProperty(exports, "erc5267Abi", { enumerable: true, get: function () { return blue_sdk_viem_1.erc5267Abi; } });
14
14
  Object.defineProperty(exports, "metaMorphoAbi", { enumerable: true, get: function () { return blue_sdk_viem_1.metaMorphoAbi; } });
15
15
  Object.defineProperty(exports, "metaMorphoFactoryAbi", { enumerable: true, get: function () { return blue_sdk_viem_1.metaMorphoFactoryAbi; } });
16
+ Object.defineProperty(exports, "midnightAdapterAbi", { enumerable: true, get: function () { return blue_sdk_viem_1.midnightAdapterAbi; } });
17
+ Object.defineProperty(exports, "midnightAdapterFactoryAbi", { enumerable: true, get: function () { return blue_sdk_viem_1.midnightAdapterFactoryAbi; } });
18
+ Object.defineProperty(exports, "midnightAdapterPriceRatifierV1Abi", { enumerable: true, get: function () { return blue_sdk_viem_1.midnightAdapterPriceRatifierV1Abi; } });
19
+ Object.defineProperty(exports, "midnightAdapterRateRatifierV1Abi", { enumerable: true, get: function () { return blue_sdk_viem_1.midnightAdapterRateRatifierV1Abi; } });
16
20
  Object.defineProperty(exports, "morphoMarketV1AdapterAbi", { enumerable: true, get: function () { return blue_sdk_viem_1.morphoMarketV1AdapterAbi; } });
17
21
  Object.defineProperty(exports, "morphoMarketV1AdapterFactoryAbi", { enumerable: true, get: function () { return blue_sdk_viem_1.morphoMarketV1AdapterFactoryAbi; } });
18
22
  Object.defineProperty(exports, "morphoMarketV1AdapterV2Abi", { enumerable: true, get: function () { return blue_sdk_viem_1.morphoMarketV1AdapterV2Abi; } });
@@ -6,6 +6,7 @@ export type BundlesTokenRequirementsState = {
6
6
  /** Current allowance of the funding token for `spender`. */
7
7
  readonly allowance: bigint;
8
8
  } | {
9
+ /** @deprecated The SDK no longer requests Permit2 funding; use ERC-2612 permits or ERC-20 approvals. */
9
10
  readonly type: "permit2SignatureTransfer";
10
11
  readonly permit2Allowance: bigint;
11
12
  readonly permit2Nonce: bigint;
@@ -51,6 +51,9 @@ interface EncodeErc20PermitParams {
51
51
  * @throws {MalformedTokenMetadataError} when the token's `eip712Domain()` or
52
52
  * `bytes32` `name`/`symbol` retry returns non-empty data that does not decode, or when the
53
53
  * deployless query reports malformed `name()`/`symbol()`/`eip712Domain()` returndata (no fallback).
54
+ * @throws {InvalidPermitDomainChainIdError} when the EIP-5267 domain names another chain.
55
+ * @throws {InvalidPermitDomainVerifyingContractError} when the EIP-5267 domain names another token.
56
+ * @throws {UnsupportedPermitDomainExtensionsError} when the EIP-5267 domain has extensions.
54
57
  * @throws {MissingPermitDomainNameError} when the token exposes neither `name()` nor
55
58
  * `eip712Domain()`, so its permit domain is unknown.
56
59
  * @throws {viem.BaseError} when the `eth_chainId` request or a token metadata read fails at the
@@ -67,7 +70,7 @@ interface EncodeErc20PermitParams {
67
70
  *
68
71
  * const client = createWalletClient({ chain: mainnet, transport: http() });
69
72
  * const requirement = await encodeErc20Permit(client, {
70
- * token: USDC, // Must implement standard ERC-2612. DAI is routed through Permit2 by requirement helpers.
73
+ * token: USDC, // Must implement standard ERC-2612. DAI falls back to a direct ERC-20 approval in requirement helpers.
71
74
  * owner,
72
75
  * spender: blueBundlesV1,
73
76
  * amount: 1_000_000n,
@@ -44,6 +44,9 @@ const validateClientChainId_js_1 = require("../validateClientChainId.js");
44
44
  * @throws {MalformedTokenMetadataError} when the token's `eip712Domain()` or
45
45
  * `bytes32` `name`/`symbol` retry returns non-empty data that does not decode, or when the
46
46
  * deployless query reports malformed `name()`/`symbol()`/`eip712Domain()` returndata (no fallback).
47
+ * @throws {InvalidPermitDomainChainIdError} when the EIP-5267 domain names another chain.
48
+ * @throws {InvalidPermitDomainVerifyingContractError} when the EIP-5267 domain names another token.
49
+ * @throws {UnsupportedPermitDomainExtensionsError} when the EIP-5267 domain has extensions.
47
50
  * @throws {MissingPermitDomainNameError} when the token exposes neither `name()` nor
48
51
  * `eip712Domain()`, so its permit domain is unknown.
49
52
  * @throws {viem.BaseError} when the `eth_chainId` request or a token metadata read fails at the
@@ -60,7 +63,7 @@ const validateClientChainId_js_1 = require("../validateClientChainId.js");
60
63
  *
61
64
  * const client = createWalletClient({ chain: mainnet, transport: http() });
62
65
  * const requirement = await encodeErc20Permit(client, {
63
- * token: USDC, // Must implement standard ERC-2612. DAI is routed through Permit2 by requirement helpers.
66
+ * token: USDC, // Must implement standard ERC-2612. DAI falls back to a direct ERC-20 approval in requirement helpers.
64
67
  * owner,
65
68
  * spender: blueBundlesV1,
66
69
  * amount: 1_000_000n,
@@ -1,6 +1,9 @@
1
1
  import type { Address } from "@morpho-org/blue-sdk";
2
2
  import { type Permit2SignatureTransferRequirementSignature, type Requirement } from "../../../types/index.js";
3
- /** Parameters for {@link encodeErc20Permit2SignatureTransfer}. */
3
+ /**
4
+ * Parameters for {@link encodeErc20Permit2SignatureTransfer}.
5
+ * @deprecated The SDK no longer requests Permit2 funding; use ERC-2612 permits or ERC-20 approvals.
6
+ */
4
7
  export interface EncodeErc20Permit2SignatureTransferParams {
5
8
  /** ERC-20 token pulled through Permit2. */
6
9
  readonly token: Address;
@@ -62,5 +65,6 @@ export interface EncodeErc20Permit2SignatureTransferParams {
62
65
  * });
63
66
  * // requirement satisfies Requirement<Permit2SignatureTransferRequirementSignature>
64
67
  * ```
68
+ * @deprecated The SDK no longer requests Permit2 funding; use ERC-2612 permits or ERC-20 approvals.
65
69
  */
66
70
  export declare const encodeErc20Permit2SignatureTransfer: (params: EncodeErc20Permit2SignatureTransferParams) => Requirement<Permit2SignatureTransferRequirementSignature>;
@@ -53,6 +53,7 @@ const index_js_1 = require("../../../types/index.js");
53
53
  * });
54
54
  * // requirement satisfies Requirement<Permit2SignatureTransferRequirementSignature>
55
55
  * ```
56
+ * @deprecated The SDK no longer requests Permit2 funding; use ERC-2612 permits or ERC-20 approvals.
56
57
  */
57
58
  const encodeErc20Permit2SignatureTransfer = (params) => {
58
59
  const { token, spender, amount, chainId, nonce, deadline } = params;
@@ -1,5 +1,5 @@
1
1
  export { marketParamsAbi } from "@morpho-org/blue-sdk";
2
- export { adaptiveCurveIrmAbi, blueAbi, blueOracleAbi, erc2612Abi, erc3643Abi, erc3643IdentityRegistryAbi, erc5267Abi, metaMorphoAbi, metaMorphoFactoryAbi, morphoMarketV1AdapterAbi, morphoMarketV1AdapterFactoryAbi, morphoMarketV1AdapterV2Abi, morphoMarketV1AdapterV2FactoryAbi, morphoVaultV1AdapterAbi, morphoVaultV1AdapterFactoryAbi, permissionedErc20WrapperAbi, permit2Abi,
2
+ export { adaptiveCurveIrmAbi, blueAbi, blueOracleAbi, erc2612Abi, erc3643Abi, erc3643IdentityRegistryAbi, erc5267Abi, metaMorphoAbi, metaMorphoFactoryAbi, midnightAdapterAbi, midnightAdapterFactoryAbi, midnightAdapterPriceRatifierV1Abi, midnightAdapterRateRatifierV1Abi, morphoMarketV1AdapterAbi, morphoMarketV1AdapterFactoryAbi, morphoMarketV1AdapterV2Abi, morphoMarketV1AdapterV2FactoryAbi, morphoVaultV1AdapterAbi, morphoVaultV1AdapterFactoryAbi, permissionedErc20WrapperAbi, permit2Abi,
3
3
  /** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
4
4
  preLiquidationAbi,
5
5
  /** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.wstEthAbi = exports.wrappedBackedTokenAbi = exports.whitelistControllerAggregatorV2Abi = exports.vaultV2FactoryAbi = exports.vaultV2BluePublicAllocatorAbi = exports.vaultV2Abi = exports.preLiquidationFactoryAbi = exports.preLiquidationAbi = exports.permit2Abi = exports.permissionedErc20WrapperAbi = exports.morphoVaultV1AdapterFactoryAbi = exports.morphoVaultV1AdapterAbi = exports.morphoMarketV1AdapterV2FactoryAbi = exports.morphoMarketV1AdapterV2Abi = exports.morphoMarketV1AdapterFactoryAbi = exports.morphoMarketV1AdapterAbi = exports.metaMorphoFactoryAbi = exports.metaMorphoAbi = exports.erc5267Abi = exports.erc3643IdentityRegistryAbi = exports.erc3643Abi = exports.erc2612Abi = exports.blueOracleAbi = exports.blueAbi = exports.adaptiveCurveIrmAbi = exports.marketParamsAbi = void 0;
3
+ exports.wstEthAbi = exports.wrappedBackedTokenAbi = exports.whitelistControllerAggregatorV2Abi = exports.vaultV2FactoryAbi = exports.vaultV2BluePublicAllocatorAbi = exports.vaultV2Abi = exports.preLiquidationFactoryAbi = exports.preLiquidationAbi = exports.permit2Abi = exports.permissionedErc20WrapperAbi = exports.morphoVaultV1AdapterFactoryAbi = exports.morphoVaultV1AdapterAbi = exports.morphoMarketV1AdapterV2FactoryAbi = exports.morphoMarketV1AdapterV2Abi = exports.morphoMarketV1AdapterFactoryAbi = exports.morphoMarketV1AdapterAbi = exports.midnightAdapterRateRatifierV1Abi = exports.midnightAdapterPriceRatifierV1Abi = exports.midnightAdapterFactoryAbi = exports.midnightAdapterAbi = exports.metaMorphoFactoryAbi = exports.metaMorphoAbi = exports.erc5267Abi = exports.erc3643IdentityRegistryAbi = exports.erc3643Abi = exports.erc2612Abi = exports.blueOracleAbi = exports.blueAbi = exports.adaptiveCurveIrmAbi = exports.marketParamsAbi = void 0;
4
4
  var blue_sdk_1 = require("@morpho-org/blue-sdk");
5
5
  Object.defineProperty(exports, "marketParamsAbi", { enumerable: true, get: function () { return blue_sdk_1.marketParamsAbi; } });
6
6
  var blue_sdk_viem_1 = require("@morpho-org/blue-sdk-viem");
@@ -13,6 +13,10 @@ Object.defineProperty(exports, "erc3643IdentityRegistryAbi", { enumerable: true,
13
13
  Object.defineProperty(exports, "erc5267Abi", { enumerable: true, get: function () { return blue_sdk_viem_1.erc5267Abi; } });
14
14
  Object.defineProperty(exports, "metaMorphoAbi", { enumerable: true, get: function () { return blue_sdk_viem_1.metaMorphoAbi; } });
15
15
  Object.defineProperty(exports, "metaMorphoFactoryAbi", { enumerable: true, get: function () { return blue_sdk_viem_1.metaMorphoFactoryAbi; } });
16
+ Object.defineProperty(exports, "midnightAdapterAbi", { enumerable: true, get: function () { return blue_sdk_viem_1.midnightAdapterAbi; } });
17
+ Object.defineProperty(exports, "midnightAdapterFactoryAbi", { enumerable: true, get: function () { return blue_sdk_viem_1.midnightAdapterFactoryAbi; } });
18
+ Object.defineProperty(exports, "midnightAdapterPriceRatifierV1Abi", { enumerable: true, get: function () { return blue_sdk_viem_1.midnightAdapterPriceRatifierV1Abi; } });
19
+ Object.defineProperty(exports, "midnightAdapterRateRatifierV1Abi", { enumerable: true, get: function () { return blue_sdk_viem_1.midnightAdapterRateRatifierV1Abi; } });
16
20
  Object.defineProperty(exports, "morphoMarketV1AdapterAbi", { enumerable: true, get: function () { return blue_sdk_viem_1.morphoMarketV1AdapterAbi; } });
17
21
  Object.defineProperty(exports, "morphoMarketV1AdapterFactoryAbi", { enumerable: true, get: function () { return blue_sdk_viem_1.morphoMarketV1AdapterFactoryAbi; } });
18
22
  Object.defineProperty(exports, "morphoMarketV1AdapterV2Abi", { enumerable: true, get: function () { return blue_sdk_viem_1.morphoMarketV1AdapterV2Abi; } });
@@ -1,10 +1,10 @@
1
- export type { IAccrualPosition, IAccrualVault, IAccrualVaultV2, IAccrualVaultV2Adapter, IAccrualVaultV2MorphoMarketV1Adapter, IAccrualVaultV2MorphoMarketV1AdapterV2, IAccrualVaultV2MorphoVaultV1Adapter, IAssetBalances, IEip5267Domain, IHolding, IMarket, IMarketParams, IPosition,
1
+ export type { IAccrualPosition, IAccrualVault, IAccrualVaultV2, IAccrualVaultV2Adapter, IAccrualVaultV2MidnightAdapter, IAccrualVaultV2MorphoMarketV1Adapter, IAccrualVaultV2MorphoMarketV1AdapterV2, IAccrualVaultV2MorphoVaultV1Adapter, IAssetBalances, IEip5267Domain, IHolding, IMarket, IMarketParams, IPosition,
2
2
  /** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
3
3
  IPreLiquidationParams,
4
4
  /** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
5
- IPreLiquidationPosition, IToken, IVault, IVaultConfig, IVaultMarketAllocation, IVaultMarketConfig, IVaultToken, IVaultUser, IVaultV2, IVaultV2Adapter, IVaultV2Allocation, IVaultV2BlueMarketPublicAllocatorConfig, IVaultV2BluePublicAllocatorConfig, IVaultV2MorphoMarketV1Adapter, IVaultV2MorphoMarketV1AdapterV2, IVaultV2MorphoVaultV1Adapter, PeripheralBalance, PeripheralBalanceType, } from "@morpho-org/blue-sdk";
6
- export { AccrualPosition, AccrualVault, AccrualVaultV2, AccrualVaultV2MorphoMarketV1Adapter, AccrualVaultV2MorphoMarketV1AdapterV2, AccrualVaultV2MorphoVaultV1Adapter, AssetBalances, ConstantWrappedToken, Eip5267Domain, ExchangeRateWrappedToken, Holding, Market, MarketParams, Position,
5
+ IPreLiquidationPosition, IToken, IVault, IVaultConfig, IVaultMarketAllocation, IVaultMarketConfig, IVaultToken, IVaultUser, IVaultV2, IVaultV2Adapter, IVaultV2Allocation, IVaultV2BlueMarketPublicAllocatorConfig, IVaultV2BluePublicAllocatorConfig, IVaultV2MidnightAdapter, IVaultV2MidnightAdapterAccrualMarket, IVaultV2MidnightAdapterCollateralParams, IVaultV2MidnightAdapterMarket, IVaultV2MidnightAdapterMarketData, IVaultV2MidnightAdapterMarketState, IVaultV2MidnightAdapterPosition, IVaultV2MorphoMarketV1Adapter, IVaultV2MorphoMarketV1AdapterV2, IVaultV2MorphoVaultV1Adapter, PeripheralBalance, PeripheralBalanceType, VaultV2MidnightAdapterAccrualMarket, VaultV2MidnightAdapterMarketData, } from "@morpho-org/blue-sdk";
6
+ export { AccrualPosition, AccrualVault, AccrualVaultV2, AccrualVaultV2MidnightAdapter, AccrualVaultV2MorphoMarketV1Adapter, AccrualVaultV2MorphoMarketV1AdapterV2, AccrualVaultV2MorphoVaultV1Adapter, AssetBalances, ConstantWrappedToken, Eip5267Domain, ExchangeRateWrappedToken, Holding, Market, MarketParams, Position,
7
7
  /** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
8
8
  PreLiquidationParams,
9
9
  /** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
10
- PreLiquidationPosition, Token, User, Vault, VaultConfig, VaultMarketAllocation, VaultMarketConfig, VaultToken, VaultUser, VaultV2, VaultV2Adapter, VaultV2BlueMarketPublicAllocatorConfig, VaultV2BluePublicAllocatorConfig, VaultV2MorphoMarketV1Adapter, VaultV2MorphoMarketV1AdapterV2, VaultV2MorphoVaultV1Adapter, WrappedToken, } from "@morpho-org/blue-sdk";
10
+ PreLiquidationPosition, Token, User, Vault, VaultConfig, VaultMarketAllocation, VaultMarketConfig, VaultToken, VaultUser, VaultV2, VaultV2Adapter, VaultV2BlueMarketPublicAllocatorConfig, VaultV2BluePublicAllocatorConfig, VaultV2MidnightAdapter, VaultV2MorphoMarketV1Adapter, VaultV2MorphoMarketV1AdapterV2, VaultV2MorphoVaultV1Adapter, WrappedToken, } from "@morpho-org/blue-sdk";
@@ -1,10 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WrappedToken = exports.VaultV2MorphoVaultV1Adapter = exports.VaultV2MorphoMarketV1AdapterV2 = exports.VaultV2MorphoMarketV1Adapter = exports.VaultV2BluePublicAllocatorConfig = exports.VaultV2BlueMarketPublicAllocatorConfig = exports.VaultV2Adapter = exports.VaultV2 = exports.VaultUser = exports.VaultToken = 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.WrappedToken = exports.VaultV2MorphoVaultV1Adapter = exports.VaultV2MorphoMarketV1AdapterV2 = exports.VaultV2MorphoMarketV1Adapter = exports.VaultV2MidnightAdapter = exports.VaultV2BluePublicAllocatorConfig = exports.VaultV2BlueMarketPublicAllocatorConfig = exports.VaultV2Adapter = exports.VaultV2 = exports.VaultUser = exports.VaultToken = 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.AccrualVaultV2MidnightAdapter = exports.AccrualVaultV2 = exports.AccrualVault = exports.AccrualPosition = void 0;
4
4
  var blue_sdk_1 = require("@morpho-org/blue-sdk");
5
5
  Object.defineProperty(exports, "AccrualPosition", { enumerable: true, get: function () { return blue_sdk_1.AccrualPosition; } });
6
6
  Object.defineProperty(exports, "AccrualVault", { enumerable: true, get: function () { return blue_sdk_1.AccrualVault; } });
7
7
  Object.defineProperty(exports, "AccrualVaultV2", { enumerable: true, get: function () { return blue_sdk_1.AccrualVaultV2; } });
8
+ Object.defineProperty(exports, "AccrualVaultV2MidnightAdapter", { enumerable: true, get: function () { return blue_sdk_1.AccrualVaultV2MidnightAdapter; } });
8
9
  Object.defineProperty(exports, "AccrualVaultV2MorphoMarketV1Adapter", { enumerable: true, get: function () { return blue_sdk_1.AccrualVaultV2MorphoMarketV1Adapter; } });
9
10
  Object.defineProperty(exports, "AccrualVaultV2MorphoMarketV1AdapterV2", { enumerable: true, get: function () { return blue_sdk_1.AccrualVaultV2MorphoMarketV1AdapterV2; } });
10
11
  Object.defineProperty(exports, "AccrualVaultV2MorphoVaultV1Adapter", { enumerable: true, get: function () { return blue_sdk_1.AccrualVaultV2MorphoVaultV1Adapter; } });
@@ -32,6 +33,7 @@ Object.defineProperty(exports, "VaultV2", { enumerable: true, get: function () {
32
33
  Object.defineProperty(exports, "VaultV2Adapter", { enumerable: true, get: function () { return blue_sdk_1.VaultV2Adapter; } });
33
34
  Object.defineProperty(exports, "VaultV2BlueMarketPublicAllocatorConfig", { enumerable: true, get: function () { return blue_sdk_1.VaultV2BlueMarketPublicAllocatorConfig; } });
34
35
  Object.defineProperty(exports, "VaultV2BluePublicAllocatorConfig", { enumerable: true, get: function () { return blue_sdk_1.VaultV2BluePublicAllocatorConfig; } });
36
+ Object.defineProperty(exports, "VaultV2MidnightAdapter", { enumerable: true, get: function () { return blue_sdk_1.VaultV2MidnightAdapter; } });
35
37
  Object.defineProperty(exports, "VaultV2MorphoMarketV1Adapter", { enumerable: true, get: function () { return blue_sdk_1.VaultV2MorphoMarketV1Adapter; } });
36
38
  Object.defineProperty(exports, "VaultV2MorphoMarketV1AdapterV2", { enumerable: true, get: function () { return blue_sdk_1.VaultV2MorphoMarketV1AdapterV2; } });
37
39
  Object.defineProperty(exports, "VaultV2MorphoVaultV1Adapter", { enumerable: true, get: function () { return blue_sdk_1.VaultV2MorphoVaultV1Adapter; } });
@@ -1,4 +1,4 @@
1
- export { BlueErrors, DivisionByZeroError, IncompleteChainRegistryError, InvalidAddressError, InvalidBitLengthError, InvalidMarketParamsError, RegistryValueAlreadyRegisteredError, UnknownAddressError, UnknownDataError, UnknownFactory, UnknownMarketAllocationError, UnknownMarketParamsError, UnknownOfFactory, UnknownTokenError, UnknownTokenPriceError, UnknownVaultConfigError, UnsupportedChainIdError, UnsupportedMarketIrmError,
1
+ export { BlueErrors, DivisionByZeroError, IncompleteChainRegistryError, InvalidAddressError, InvalidBitLengthError, InvalidMarketParamsError, InvalidPositionAccrualStateError, InvalidPositionLossFactorError, InvalidVaultV2MidnightAdapterMarketsError, RegistryValueAlreadyRegisteredError, UnknownAddressError, UnknownDataError, UnknownFactory, UnknownMarketAllocationError, UnknownMarketParamsError, UnknownOfFactory, UnknownTokenError, UnknownTokenPriceError, UnknownVaultConfigError, UnsupportedChainIdError, UnsupportedMarketIrmError,
2
2
  /** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
3
3
  UnsupportedPreLiquidationParamsError, UnsupportedVaultV2AdapterError, VaultV2Errors, } from "@morpho-org/blue-sdk";
4
- export { getUnsupportedVaultV2Adapter, InvalidNumberError, InvalidPermitDomainChainIdError, InvalidPermitDomainVerifyingContractError, isUnknownOfFactoryError, MalformedTokenMetadataError, MarketParamsIdMismatchError, MissingPermitDomainNameError, NonTupleReturnValueError, Permit2ExpirationOutOfRangeError, UnknownAbiFunctionError, UnnamedAbiOutputsError, UnsupportedPermitDomainExtensionsError, } from "@morpho-org/blue-sdk-viem";
4
+ export { getUnsupportedVaultV2Adapter, InvalidNumberError, InvalidPermitDomainChainIdError, InvalidPermitDomainVerifyingContractError, isUnknownOfFactoryError, MalformedTokenMetadataError, MarketParamsIdMismatchError, MissingPermitDomainNameError, NonTupleReturnValueError, Permit2ExpirationOutOfRangeError, UnknownAbiFunctionError, UnnamedAbiOutputsError, UnresolvedBlockNumberError, UnsupportedPermitDomainExtensionsError, } from "@morpho-org/blue-sdk-viem";
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UnsupportedPermitDomainExtensionsError = exports.UnnamedAbiOutputsError = exports.UnknownAbiFunctionError = exports.Permit2ExpirationOutOfRangeError = exports.NonTupleReturnValueError = exports.MissingPermitDomainNameError = exports.MarketParamsIdMismatchError = exports.MalformedTokenMetadataError = exports.isUnknownOfFactoryError = exports.InvalidPermitDomainVerifyingContractError = exports.InvalidPermitDomainChainIdError = exports.InvalidNumberError = exports.getUnsupportedVaultV2Adapter = exports.VaultV2Errors = exports.UnsupportedVaultV2AdapterError = exports.UnsupportedPreLiquidationParamsError = exports.UnsupportedMarketIrmError = exports.UnsupportedChainIdError = exports.UnknownVaultConfigError = exports.UnknownTokenPriceError = exports.UnknownTokenError = exports.UnknownOfFactory = exports.UnknownMarketParamsError = exports.UnknownMarketAllocationError = exports.UnknownFactory = exports.UnknownDataError = exports.UnknownAddressError = exports.RegistryValueAlreadyRegisteredError = exports.InvalidMarketParamsError = exports.InvalidBitLengthError = exports.InvalidAddressError = exports.IncompleteChainRegistryError = exports.DivisionByZeroError = exports.BlueErrors = void 0;
3
+ exports.UnsupportedPermitDomainExtensionsError = exports.UnresolvedBlockNumberError = exports.UnnamedAbiOutputsError = exports.UnknownAbiFunctionError = exports.Permit2ExpirationOutOfRangeError = exports.NonTupleReturnValueError = exports.MissingPermitDomainNameError = exports.MarketParamsIdMismatchError = exports.MalformedTokenMetadataError = exports.isUnknownOfFactoryError = exports.InvalidPermitDomainVerifyingContractError = exports.InvalidPermitDomainChainIdError = exports.InvalidNumberError = exports.getUnsupportedVaultV2Adapter = exports.VaultV2Errors = exports.UnsupportedVaultV2AdapterError = exports.UnsupportedPreLiquidationParamsError = exports.UnsupportedMarketIrmError = exports.UnsupportedChainIdError = exports.UnknownVaultConfigError = exports.UnknownTokenPriceError = exports.UnknownTokenError = exports.UnknownOfFactory = exports.UnknownMarketParamsError = exports.UnknownMarketAllocationError = exports.UnknownFactory = exports.UnknownDataError = exports.UnknownAddressError = exports.RegistryValueAlreadyRegisteredError = exports.InvalidVaultV2MidnightAdapterMarketsError = exports.InvalidPositionLossFactorError = exports.InvalidPositionAccrualStateError = exports.InvalidMarketParamsError = exports.InvalidBitLengthError = exports.InvalidAddressError = exports.IncompleteChainRegistryError = exports.DivisionByZeroError = exports.BlueErrors = void 0;
4
4
  var blue_sdk_1 = require("@morpho-org/blue-sdk");
5
5
  Object.defineProperty(exports, "BlueErrors", { enumerable: true, get: function () { return blue_sdk_1.BlueErrors; } });
6
6
  Object.defineProperty(exports, "DivisionByZeroError", { enumerable: true, get: function () { return blue_sdk_1.DivisionByZeroError; } });
@@ -8,6 +8,9 @@ Object.defineProperty(exports, "IncompleteChainRegistryError", { enumerable: tru
8
8
  Object.defineProperty(exports, "InvalidAddressError", { enumerable: true, get: function () { return blue_sdk_1.InvalidAddressError; } });
9
9
  Object.defineProperty(exports, "InvalidBitLengthError", { enumerable: true, get: function () { return blue_sdk_1.InvalidBitLengthError; } });
10
10
  Object.defineProperty(exports, "InvalidMarketParamsError", { enumerable: true, get: function () { return blue_sdk_1.InvalidMarketParamsError; } });
11
+ Object.defineProperty(exports, "InvalidPositionAccrualStateError", { enumerable: true, get: function () { return blue_sdk_1.InvalidPositionAccrualStateError; } });
12
+ Object.defineProperty(exports, "InvalidPositionLossFactorError", { enumerable: true, get: function () { return blue_sdk_1.InvalidPositionLossFactorError; } });
13
+ Object.defineProperty(exports, "InvalidVaultV2MidnightAdapterMarketsError", { enumerable: true, get: function () { return blue_sdk_1.InvalidVaultV2MidnightAdapterMarketsError; } });
11
14
  Object.defineProperty(exports, "RegistryValueAlreadyRegisteredError", { enumerable: true, get: function () { return blue_sdk_1.RegistryValueAlreadyRegisteredError; } });
12
15
  Object.defineProperty(exports, "UnknownAddressError", { enumerable: true, get: function () { return blue_sdk_1.UnknownAddressError; } });
13
16
  Object.defineProperty(exports, "UnknownDataError", { enumerable: true, get: function () { return blue_sdk_1.UnknownDataError; } });
@@ -37,4 +40,5 @@ Object.defineProperty(exports, "NonTupleReturnValueError", { enumerable: true, g
37
40
  Object.defineProperty(exports, "Permit2ExpirationOutOfRangeError", { enumerable: true, get: function () { return blue_sdk_viem_1.Permit2ExpirationOutOfRangeError; } });
38
41
  Object.defineProperty(exports, "UnknownAbiFunctionError", { enumerable: true, get: function () { return blue_sdk_viem_1.UnknownAbiFunctionError; } });
39
42
  Object.defineProperty(exports, "UnnamedAbiOutputsError", { enumerable: true, get: function () { return blue_sdk_viem_1.UnnamedAbiOutputsError; } });
43
+ Object.defineProperty(exports, "UnresolvedBlockNumberError", { enumerable: true, get: function () { return blue_sdk_viem_1.UnresolvedBlockNumberError; } });
40
44
  Object.defineProperty(exports, "UnsupportedPermitDomainExtensionsError", { enumerable: true, get: function () { return blue_sdk_viem_1.UnsupportedPermitDomainExtensionsError; } });
@@ -1,5 +1,5 @@
1
- export { fetchAccrualPosition, fetchAccrualVault, fetchAccrualVaultV2, fetchAccrualVaultV2Adapter, fetchAccrualVaultV2MorphoMarketV1Adapter, fetchAccrualVaultV2MorphoMarketV1AdapterV2, fetchAccrualVaultV2MorphoVaultV1Adapter, fetchHolding, fetchMarket, fetchMarketParams, fetchPosition,
1
+ export { fetchAccrualPosition, fetchAccrualVault, fetchAccrualVaultV2, fetchAccrualVaultV2Adapter, fetchAccrualVaultV2MidnightAdapter, fetchAccrualVaultV2MorphoMarketV1Adapter, fetchAccrualVaultV2MorphoMarketV1AdapterV2, fetchAccrualVaultV2MorphoVaultV1Adapter, fetchHolding, fetchMarket, fetchMarketParams, fetchPosition,
2
2
  /** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
3
3
  fetchPreLiquidationParams,
4
4
  /** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
5
- fetchPreLiquidationPosition, fetchToken, fetchUser, fetchVault, fetchVaultConfig, fetchVaultMarketAllocation, fetchVaultMarketConfig, fetchVaultUser, fetchVaultV2, fetchVaultV2Adapter, fetchVaultV2BlueMarketPublicAllocatorConfig, fetchVaultV2BluePublicAllocatorConfig, fetchVaultV2BluePublicAllocatorData, fetchVaultV2MorphoMarketV1Adapter, fetchVaultV2MorphoMarketV1AdapterV2, fetchVaultV2MorphoVaultV1Adapter, } from "@morpho-org/blue-sdk-viem";
5
+ fetchPreLiquidationPosition, fetchToken, fetchUser, fetchVault, fetchVaultConfig, fetchVaultMarketAllocation, fetchVaultMarketConfig, fetchVaultUser, fetchVaultV2, fetchVaultV2Adapter, fetchVaultV2BlueMarketPublicAllocatorConfig, fetchVaultV2BluePublicAllocatorConfig, fetchVaultV2BluePublicAllocatorData, fetchVaultV2MidnightAdapter, fetchVaultV2MorphoMarketV1Adapter, fetchVaultV2MorphoMarketV1AdapterV2, fetchVaultV2MorphoVaultV1Adapter, } from "@morpho-org/blue-sdk-viem";
@@ -1,11 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.fetchVaultV2MorphoVaultV1Adapter = exports.fetchVaultV2MorphoMarketV1AdapterV2 = exports.fetchVaultV2MorphoMarketV1Adapter = exports.fetchVaultV2BluePublicAllocatorData = exports.fetchVaultV2BluePublicAllocatorConfig = exports.fetchVaultV2BlueMarketPublicAllocatorConfig = exports.fetchVaultV2Adapter = exports.fetchVaultV2 = exports.fetchVaultUser = exports.fetchVaultMarketConfig = exports.fetchVaultMarketAllocation = exports.fetchVaultConfig = exports.fetchVault = exports.fetchUser = exports.fetchToken = exports.fetchPreLiquidationPosition = exports.fetchPreLiquidationParams = exports.fetchPosition = exports.fetchMarketParams = exports.fetchMarket = exports.fetchHolding = exports.fetchAccrualVaultV2MorphoVaultV1Adapter = exports.fetchAccrualVaultV2MorphoMarketV1AdapterV2 = exports.fetchAccrualVaultV2MorphoMarketV1Adapter = exports.fetchAccrualVaultV2Adapter = exports.fetchAccrualVaultV2 = exports.fetchAccrualVault = exports.fetchAccrualPosition = void 0;
3
+ exports.fetchVaultV2MorphoVaultV1Adapter = exports.fetchVaultV2MorphoMarketV1AdapterV2 = exports.fetchVaultV2MorphoMarketV1Adapter = exports.fetchVaultV2MidnightAdapter = exports.fetchVaultV2BluePublicAllocatorData = exports.fetchVaultV2BluePublicAllocatorConfig = exports.fetchVaultV2BlueMarketPublicAllocatorConfig = exports.fetchVaultV2Adapter = exports.fetchVaultV2 = exports.fetchVaultUser = exports.fetchVaultMarketConfig = exports.fetchVaultMarketAllocation = exports.fetchVaultConfig = exports.fetchVault = exports.fetchUser = exports.fetchToken = exports.fetchPreLiquidationPosition = exports.fetchPreLiquidationParams = exports.fetchPosition = exports.fetchMarketParams = exports.fetchMarket = exports.fetchHolding = exports.fetchAccrualVaultV2MorphoVaultV1Adapter = exports.fetchAccrualVaultV2MorphoMarketV1AdapterV2 = exports.fetchAccrualVaultV2MorphoMarketV1Adapter = exports.fetchAccrualVaultV2MidnightAdapter = exports.fetchAccrualVaultV2Adapter = exports.fetchAccrualVaultV2 = exports.fetchAccrualVault = exports.fetchAccrualPosition = void 0;
4
4
  var blue_sdk_viem_1 = require("@morpho-org/blue-sdk-viem");
5
5
  Object.defineProperty(exports, "fetchAccrualPosition", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchAccrualPosition; } });
6
6
  Object.defineProperty(exports, "fetchAccrualVault", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchAccrualVault; } });
7
7
  Object.defineProperty(exports, "fetchAccrualVaultV2", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchAccrualVaultV2; } });
8
8
  Object.defineProperty(exports, "fetchAccrualVaultV2Adapter", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchAccrualVaultV2Adapter; } });
9
+ Object.defineProperty(exports, "fetchAccrualVaultV2MidnightAdapter", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchAccrualVaultV2MidnightAdapter; } });
9
10
  Object.defineProperty(exports, "fetchAccrualVaultV2MorphoMarketV1Adapter", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchAccrualVaultV2MorphoMarketV1Adapter; } });
10
11
  Object.defineProperty(exports, "fetchAccrualVaultV2MorphoMarketV1AdapterV2", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchAccrualVaultV2MorphoMarketV1AdapterV2; } });
11
12
  Object.defineProperty(exports, "fetchAccrualVaultV2MorphoVaultV1Adapter", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchAccrualVaultV2MorphoVaultV1Adapter; } });
@@ -29,6 +30,7 @@ Object.defineProperty(exports, "fetchVaultV2Adapter", { enumerable: true, get: f
29
30
  Object.defineProperty(exports, "fetchVaultV2BlueMarketPublicAllocatorConfig", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchVaultV2BlueMarketPublicAllocatorConfig; } });
30
31
  Object.defineProperty(exports, "fetchVaultV2BluePublicAllocatorConfig", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchVaultV2BluePublicAllocatorConfig; } });
31
32
  Object.defineProperty(exports, "fetchVaultV2BluePublicAllocatorData", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchVaultV2BluePublicAllocatorData; } });
33
+ Object.defineProperty(exports, "fetchVaultV2MidnightAdapter", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchVaultV2MidnightAdapter; } });
32
34
  Object.defineProperty(exports, "fetchVaultV2MorphoMarketV1Adapter", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchVaultV2MorphoMarketV1Adapter; } });
33
35
  Object.defineProperty(exports, "fetchVaultV2MorphoMarketV1AdapterV2", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchVaultV2MorphoMarketV1AdapterV2; } });
34
36
  Object.defineProperty(exports, "fetchVaultV2MorphoVaultV1Adapter", { enumerable: true, get: function () { return blue_sdk_viem_1.fetchVaultV2MorphoVaultV1Adapter; } });
@@ -3,5 +3,5 @@ export { AdaptiveCurveIrmLib, CapacityLimitReason,
3
3
  /** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
4
4
  defaultPreLiquidationParamsRegistry,
5
5
  /** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
6
- getDefaultPreLiquidationParams, MarketUtils, MathLib, SharesMath, VaultUtils, VaultV2BlueMarketPublicAllocatorConfigUtils, VaultV2BluePublicAllocatorConfigUtils, VaultV2Utils, } from "@morpho-org/blue-sdk";
6
+ getDefaultPreLiquidationParams, MarketUtils, MathLib, SharesMath, VaultUtils, VaultV2BlueMarketPublicAllocatorConfigUtils, VaultV2BluePublicAllocatorConfigUtils, VaultV2MidnightAdapterUtils, VaultV2Utils, } from "@morpho-org/blue-sdk";
7
7
  export { catchRevertOnly, decodeBytes32String, getAuthorizationTypedData, getPermit2PermitTypedData, getPermit2TransferFromTypedData, getPermitTypedData, isContractRevertError, isTransportError, isUndecodableResultError, MetaMorphoAction, optionalBoolean, readContractRestructured, restructure, safeGetAddress, safeParseNumber, safeParseUnits, } from "@morpho-org/blue-sdk-viem";
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.safeParseUnits = exports.safeParseNumber = exports.safeGetAddress = exports.restructure = exports.readContractRestructured = exports.optionalBoolean = exports.MetaMorphoAction = exports.isUndecodableResultError = exports.isTransportError = exports.isContractRevertError = exports.getPermitTypedData = exports.getPermit2TransferFromTypedData = exports.getPermit2PermitTypedData = exports.getAuthorizationTypedData = exports.decodeBytes32String = exports.catchRevertOnly = exports.VaultV2Utils = exports.VaultV2BluePublicAllocatorConfigUtils = exports.VaultV2BlueMarketPublicAllocatorConfigUtils = exports.VaultUtils = exports.SharesMath = exports.MathLib = exports.MarketUtils = exports.getDefaultPreLiquidationParams = exports.defaultPreLiquidationParamsRegistry = exports.CapacityLimitReason = exports.AdaptiveCurveIrmLib = void 0;
3
+ exports.safeParseUnits = exports.safeParseNumber = exports.safeGetAddress = exports.restructure = exports.readContractRestructured = exports.optionalBoolean = exports.MetaMorphoAction = exports.isUndecodableResultError = exports.isTransportError = exports.isContractRevertError = exports.getPermitTypedData = exports.getPermit2TransferFromTypedData = exports.getPermit2PermitTypedData = exports.getAuthorizationTypedData = exports.decodeBytes32String = exports.catchRevertOnly = exports.VaultV2Utils = exports.VaultV2MidnightAdapterUtils = exports.VaultV2BluePublicAllocatorConfigUtils = exports.VaultV2BlueMarketPublicAllocatorConfigUtils = exports.VaultUtils = exports.SharesMath = exports.MathLib = exports.MarketUtils = exports.getDefaultPreLiquidationParams = exports.defaultPreLiquidationParamsRegistry = exports.CapacityLimitReason = exports.AdaptiveCurveIrmLib = void 0;
4
4
  var blue_sdk_1 = require("@morpho-org/blue-sdk");
5
5
  Object.defineProperty(exports, "AdaptiveCurveIrmLib", { enumerable: true, get: function () { return blue_sdk_1.AdaptiveCurveIrmLib; } });
6
6
  Object.defineProperty(exports, "CapacityLimitReason", { enumerable: true, get: function () { return blue_sdk_1.CapacityLimitReason; } });
@@ -14,6 +14,7 @@ Object.defineProperty(exports, "SharesMath", { enumerable: true, get: function (
14
14
  Object.defineProperty(exports, "VaultUtils", { enumerable: true, get: function () { return blue_sdk_1.VaultUtils; } });
15
15
  Object.defineProperty(exports, "VaultV2BlueMarketPublicAllocatorConfigUtils", { enumerable: true, get: function () { return blue_sdk_1.VaultV2BlueMarketPublicAllocatorConfigUtils; } });
16
16
  Object.defineProperty(exports, "VaultV2BluePublicAllocatorConfigUtils", { enumerable: true, get: function () { return blue_sdk_1.VaultV2BluePublicAllocatorConfigUtils; } });
17
+ Object.defineProperty(exports, "VaultV2MidnightAdapterUtils", { enumerable: true, get: function () { return blue_sdk_1.VaultV2MidnightAdapterUtils; } });
17
18
  Object.defineProperty(exports, "VaultV2Utils", { enumerable: true, get: function () { return blue_sdk_1.VaultV2Utils; } });
18
19
  var blue_sdk_viem_1 = require("@morpho-org/blue-sdk-viem");
19
20
  Object.defineProperty(exports, "catchRevertOnly", { enumerable: true, get: function () { return blue_sdk_viem_1.catchRevertOnly; } });
@@ -12,7 +12,7 @@ import type { Metadata, MorphoClientType } from "../types/index.js";
12
12
  * @param _options.metadata - Optional analytics metadata applied to every transaction the
13
13
  * `morpho` namespace builds.
14
14
  * @param _options.supportSignature - Whether the integrator can collect EIP-712 signatures for
15
- * ERC-2612, Permit2 SignatureTransfer, and Morpho authorization.
15
+ * ERC-2612 and Morpho authorization.
16
16
  * Defaults to `false` (standalone approvals and authorization calls only).
17
17
  * @param _options.supportDeployless - Whether entity fetchers may use deployless multicall.
18
18
  * @returns A viem extension function — `client.extend(morphoViemExtension(...))` adds
@@ -49,7 +49,7 @@ function createMorphoNamespace(viemClient, options) {
49
49
  * @param _options.metadata - Optional analytics metadata applied to every transaction the
50
50
  * `morpho` namespace builds.
51
51
  * @param _options.supportSignature - Whether the integrator can collect EIP-712 signatures for
52
- * ERC-2612, Permit2 SignatureTransfer, and Morpho authorization.
52
+ * ERC-2612 and Morpho authorization.
53
53
  * Defaults to `false` (standalone approvals and authorization calls only).
54
54
  * @param _options.supportDeployless - Whether entity fetchers may use deployless multicall.
55
55
  * @returns A viem extension function — `client.extend(morphoViemExtension(...))` adds
@@ -18,9 +18,9 @@ type VaultV2BlueReallocationsParams = {
18
18
  };
19
19
  /** Options for resolving token-backed BlueBundlesV1 approval or signature prerequisites. */
20
20
  export interface BlueTokenRequirementsParams {
21
- /** Prefer ERC-2612 when the funded token exposes a compatible nonce. */
21
+ /** Prefer ERC-2612 when the funded token exposes a compatible nonce; defaults to true when signatures are supported. */
22
22
  readonly useSimplePermit?: boolean;
23
- /** Explicit unused Permit2 SignatureTransfer unordered nonce; defaults to the lowest unused nonce. */
23
+ /** @deprecated Ignored. The SDK no longer requests Permit2 funding; use ERC-2612 permits or ERC-20 approvals. */
24
24
  readonly permit2Nonce?: bigint;
25
25
  }
26
26
  /**
@@ -95,8 +95,6 @@ export interface BlueActions {
95
95
  * @throws {NativeAmountOnNonWNativeAssetError} when native funding targets another token.
96
96
  * @throws {InputExceedsMaxError} when the referral fee is at least WAD.
97
97
  * @throws {ReferralFeeRecipientMissingError} when a positive fee has no recipient.
98
- * @throws {NoUnusedPermit2NonceError} from `getRequirements()` when every Permit2 nonce for the owner is consumed and none was passed explicitly.
99
- * @throws {Permit2SignatureTransferNonceAlreadyUsedError} from `getRequirements()` when the explicit Permit2 nonce is consumed.
100
98
  * @throws {AmbiguousRequirementSignaturesError} from `buildTx()` when multiple token signatures are supplied.
101
99
  * @throws {UnexpectedRequirementSignatureError} from `buildTx()` when an unsupported signature is supplied.
102
100
  * @throws {DepositOwnerMismatchError} from `buildTx()` when the signed owner differs from `userAddress`.
@@ -144,10 +142,9 @@ export interface BlueActions {
144
142
  /**
145
143
  * Prepares a direct BlueBundlesV1 loan-asset supply.
146
144
  *
147
- * `getRequirements()` first checks that BlueBundlesV1, Blue and, for ERC-20 funding with
148
- * signatures enabled, Permit2 hold code at their registered addresses, then reads the loan-token
149
- * allowance and selected ERC-2612 or Permit2 nonce state. Direct approvals and ERC-2612 name
150
- * BlueBundlesV1 as spender; Permit2 keeps its ERC-20 approval on canonical Permit2. Native
145
+ * `getRequirements()` first checks that BlueBundlesV1 and Blue hold code, then
146
+ * reads the loan-token allowance and selected ERC-2612 nonce state. Direct approvals and
147
+ * ERC-2612 name BlueBundlesV1 as spender. Native
151
148
  * funding is exclusive and skips token requirements (the code check still runs).
152
149
  * The referral fee is deducted from the gross `assets` supplied. This route exposes no
153
150
  * share-price bound or `slippageTolerance`.
@@ -166,14 +163,12 @@ export interface BlueActions {
166
163
  * `getRequirements()` when the RPC reports another chain via `eth_chainId`.
167
164
  * @throws {ExpiredDeadlineError} when the deadline is not in the future at creation or requirement resolution.
168
165
  * @throws {NonPositiveInputError} when `assets` is not positive.
169
- * @throws {NegativeInputError} when native funding or the referral fee is negative, or from `getRequirements()` when an explicit `permit2Nonce` is negative.
166
+ * @throws {NegativeInputError} when native funding or the referral fee is negative.
170
167
  * @throws {NativeFundingAmountMismatchError} when native funding is partial or mixed.
171
168
  * @throws {ChainWNativeMissingError} when native funding is requested on a chain without wNative.
172
169
  * @throws {NativeAmountOnNonWNativeAssetError} when native funding targets another token.
173
- * @throws {InputExceedsMaxError} when `assets` or `deadline` exceeds `uint256`, when the referral fee is at least WAD, or from `getRequirements()` when an explicit `permit2Nonce` exceeds `uint256`.
170
+ * @throws {InputExceedsMaxError} when `assets` or `deadline` exceeds `uint256`, when the referral fee is at least WAD.
174
171
  * @throws {ReferralFeeRecipientMissingError} when a positive fee has no recipient.
175
- * @throws {NoUnusedPermit2NonceError} from `getRequirements()` when every Permit2 nonce for the owner is consumed and none was passed explicitly.
176
- * @throws {Permit2SignatureTransferNonceAlreadyUsedError} from `getRequirements()` when the explicit Permit2 nonce is consumed.
177
172
  * @throws {AmbiguousRequirementSignaturesError} from `buildTx()` when multiple token signatures are supplied.
178
173
  * @throws {UnexpectedRequirementSignatureError} from `buildTx()` when the route cannot consume a supplied signature.
179
174
  * @throws {DepositOwnerMismatchError} from `buildTx()` when the signed owner differs from `userAddress`.
@@ -500,8 +495,6 @@ export interface BlueActions {
500
495
  * @throws {NativeFundingAmountMismatchError} when native funding is partial or mixed.
501
496
  * @throws {ChainWNativeMissingError} when native funding is requested on a chain without wNative.
502
497
  * @throws {NativeAmountOnNonWNativeAssetError} when native funding targets another token.
503
- * @throws {NoUnusedPermit2NonceError} from `getRequirements()` when every Permit2 nonce for the owner is consumed and none was passed explicitly.
504
- * @throws {Permit2SignatureTransferNonceAlreadyUsedError} from `getRequirements()` when the explicit Permit2 nonce is consumed.
505
498
  * @throws {AmbiguousRequirementSignaturesError} from `buildTx()` when multiple token signatures are supplied.
506
499
  * @throws {UnexpectedRequirementSignatureError} from `buildTx()` when an authorization signature is supplied.
507
500
  * @throws {DepositOwnerMismatchError} from `buildTx()` when the signed owner differs from `userAddress`.
@@ -675,8 +668,6 @@ export interface BlueActions {
675
668
  * @throws {NativeFundingAmountMismatchError} when native funding is partial or mixed.
676
669
  * @throws {ChainWNativeMissingError} when native funding is requested on a chain without wNative.
677
670
  * @throws {NativeAmountOnNonWNativeAssetError} when native funding targets another token.
678
- * @throws {NoUnusedPermit2NonceError} from `getRequirements()` when every Permit2 nonce for the owner is consumed and none was passed explicitly.
679
- * @throws {Permit2SignatureTransferNonceAlreadyUsedError} from `getRequirements()` when the explicit Permit2 nonce is consumed.
680
671
  * @throws {AmbiguousRequirementSignaturesError} from `buildTx()` when multiple signatures of one kind are supplied.
681
672
  * @throws {UnexpectedRequirementSignatureError} from `buildTx()` when an inactive leg cannot consume a supplied signature.
682
673
  * @throws {DepositOwnerMismatchError} from `buildTx()` when a signed owner differs from `userAddress`.
@@ -782,8 +773,6 @@ export interface BlueActions {
782
773
  * @throws {InconsistentReallocationPenaltyError} when one vault uses different penalties.
783
774
  * @throws {ReallocationWithdrawalOnTargetMarketError} when a source is the target market.
784
775
  * @throws {ReallocationLoanTokenMismatchError} when a source uses another loan token.
785
- * @throws {NoUnusedPermit2NonceError} from `getRequirements()` when every Permit2 nonce for the owner is consumed and none was passed explicitly.
786
- * @throws {Permit2SignatureTransferNonceAlreadyUsedError} from `getRequirements()` when the explicit Permit2 nonce is consumed.
787
776
  * @throws {AmbiguousRequirementSignaturesError} from `buildTx()` when multiple signatures of one kind are supplied.
788
777
  * @throws {UnexpectedRequirementSignatureError} from `buildTx()` when an inactive leg cannot consume a supplied signature.
789
778
  * @throws {DepositOwnerMismatchError} from `buildTx()` when a signed owner differs from `userAddress`.
@@ -1051,9 +1040,6 @@ export declare class MorphoBlue implements BlueActions {
1051
1040
  * spender/authorized operator holds code, with one `eth_getCode` per distinct address
1052
1041
  * before any other requirement read. Blue write flows probe `eth_chainId` only after a target
1053
1042
  * has no code and report a chain mismatch when the RPC serves another chain.
1054
- *
1055
- * @param params.erc20Funding - Whether the flow resolves an ERC-20 funding leg, which
1056
- * may name canonical Permit2 when signatures are supported.
1057
1043
  */
1058
1044
  private assertWriteTargets;
1059
1045
  private getMaxLtv;
@@ -61,11 +61,8 @@ class MorphoBlue {
61
61
  * spender/authorized operator holds code, with one `eth_getCode` per distinct address
62
62
  * before any other requirement read. Blue write flows probe `eth_chainId` only after a target
63
63
  * has no code and report a chain mismatch when the RPC serves another chain.
64
- *
65
- * @param params.erc20Funding - Whether the flow resolves an ERC-20 funding leg, which
66
- * may name canonical Permit2 when signatures are supported.
67
64
  */
68
- async assertWriteTargets(params) {
65
+ async assertWriteTargets() {
69
66
  const targets = [
70
67
  {
71
68
  role: "bundles.blueBundlesV1",
@@ -73,11 +70,6 @@ class MorphoBlue {
73
70
  },
74
71
  { role: "blue", address: (0, morpho_ts_1.getChainAddress)(this.chainId, "blue") },
75
72
  ];
76
- if (params?.erc20Funding && this.client.options.supportSignature) {
77
- const permit2 = (0, morpho_ts_1.getChainAddresses)(this.chainId).permit2;
78
- if (permit2 != null)
79
- targets.push({ role: "permit2", address: permit2 });
80
- }
81
73
  await (0, assertContractCode_js_1.assertRegistryTargetsHaveCode)(this.client.viemClient, this.chainId, targets);
82
74
  }
83
75
  getMaxLtv(marketParams = this.marketParams) {
@@ -98,7 +90,6 @@ class MorphoBlue {
98
90
  supportSignature: this.client.options.supportSignature,
99
91
  supportDeployless: this.client.options.supportDeployless,
100
92
  useSimplePermit: params.useSimplePermit,
101
- permit2Nonce: params.permit2Nonce,
102
93
  now: params.now,
103
94
  });
104
95
  }
@@ -149,9 +140,7 @@ class MorphoBlue {
149
140
  getRequirements: (requirementsParams) => {
150
141
  const now = morpho_ts_1.Time.timestamp();
151
142
  this.validateDeadline(deadline, now);
152
- return this.assertWriteTargets({
153
- erc20Funding: nativeValue === 0n,
154
- }).then(() => {
143
+ return this.assertWriteTargets().then(() => {
155
144
  if (nativeValue > 0n)
156
145
  return [];
157
146
  return this.getTokenRequirements({
@@ -161,7 +150,6 @@ class MorphoBlue {
161
150
  deadline,
162
151
  now,
163
152
  useSimplePermit: requirementsParams?.useSimplePermit,
164
- permit2Nonce: requirementsParams?.permit2Nonce,
165
153
  });
166
154
  });
167
155
  },
@@ -575,9 +563,7 @@ class MorphoBlue {
575
563
  getRequirements: async (requirementsParams) => {
576
564
  const now = morpho_ts_1.Time.timestamp();
577
565
  this.validateDeadline(deadline, now);
578
- await this.assertWriteTargets({
579
- erc20Funding: hasRepay && nativeValue === 0n,
580
- });
566
+ await this.assertWriteTargets();
581
567
  const [tokenRequirements, authorizationRequirements] = await Promise.all([
582
568
  hasRepay && nativeValue === 0n
583
569
  ? this.getTokenRequirements({
@@ -587,7 +573,6 @@ class MorphoBlue {
587
573
  deadline,
588
574
  now,
589
575
  useSimplePermit: requirementsParams?.useSimplePermit,
590
- permit2Nonce: requirementsParams?.permit2Nonce,
591
576
  })
592
577
  : Promise.resolve([]),
593
578
  collateralAssets > 0n
@@ -686,9 +671,7 @@ class MorphoBlue {
686
671
  getRequirements: async (requirementsParams) => {
687
672
  const now = morpho_ts_1.Time.timestamp();
688
673
  this.validateDeadline(deadline, now);
689
- await this.assertWriteTargets({
690
- erc20Funding: collateralAssets > 0n && nativeValue === 0n,
691
- });
674
+ await this.assertWriteTargets();
692
675
  const [tokenRequirements, authorizationRequirements] = await Promise.all([
693
676
  collateralAssets > 0n && nativeValue === 0n
694
677
  ? this.getTokenRequirements({
@@ -698,7 +681,6 @@ class MorphoBlue {
698
681
  deadline,
699
682
  now,
700
683
  useSimplePermit: requirementsParams?.useSimplePermit,
701
- permit2Nonce: requirementsParams?.permit2Nonce,
702
684
  })
703
685
  : Promise.resolve([]),
704
686
  borrowAssets > 0n