@morpho-org/morpho-sdk 6.0.0-next.3 → 6.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 (123) hide show
  1. package/MIGRATION-v5-to-v6.md +24 -16
  2. package/README.md +6 -4
  3. package/lib/cjs/abis.d.ts +5 -1
  4. package/lib/cjs/abis.js +2 -0
  5. package/lib/cjs/actions/bundles/common.d.ts +20 -25
  6. package/lib/cjs/actions/bundles/common.js +46 -85
  7. package/lib/cjs/actions/bundles/index.d.ts +1 -1
  8. package/lib/cjs/actions/bundles/resolveBundlesTokenRequirements.d.ts +6 -2
  9. package/lib/cjs/actions/bundles/resolveBundlesTokenRequirements.js +6 -2
  10. package/lib/cjs/actions/requirements/blue/getBlueAuthorizationRequirement.d.ts +1 -0
  11. package/lib/cjs/actions/requirements/blue/getBlueAuthorizationRequirement.js +1 -0
  12. package/lib/cjs/actions/requirements/encode/encodeBlueSignatureAuthorization.d.ts +11 -3
  13. package/lib/cjs/actions/requirements/encode/encodeBlueSignatureAuthorization.js +19 -1
  14. package/lib/cjs/actions/requirements/encode/encodeVaultSharesPermit.d.ts +4 -1
  15. package/lib/cjs/actions/requirements/encode/encodeVaultSharesPermit.js +12 -0
  16. package/lib/cjs/actions/vaultV1/inKindRedeem.d.ts +2 -1
  17. package/lib/cjs/actions/vaultV1/inKindRedeem.js +2 -1
  18. package/lib/cjs/actions/vaultV1/migrateToV2.d.ts +62 -17
  19. package/lib/cjs/actions/vaultV1/migrateToV2.js +48 -17
  20. package/lib/cjs/actions/vaultV1/redeem.d.ts +28 -1
  21. package/lib/cjs/actions/vaultV1/redeem.js +17 -1
  22. package/lib/cjs/actions/vaultV1/withdraw.d.ts +1 -1
  23. package/lib/cjs/actions/vaultV1/withdraw.js +1 -1
  24. package/lib/cjs/actions/vaultV2/forceWithdraw.d.ts +3 -2
  25. package/lib/cjs/actions/vaultV2/forceWithdraw.js +3 -2
  26. package/lib/cjs/actions/vaultV2/inKindRedeem.d.ts +2 -1
  27. package/lib/cjs/actions/vaultV2/inKindRedeem.js +2 -1
  28. package/lib/cjs/actions/vaultV2/redeem.d.ts +28 -1
  29. package/lib/cjs/actions/vaultV2/redeem.js +17 -1
  30. package/lib/cjs/actions/vaultV2/withdraw.d.ts +1 -1
  31. package/lib/cjs/actions/vaultV2/withdraw.js +1 -1
  32. package/lib/cjs/augment/AccrualPosition.d.ts +1 -0
  33. package/lib/cjs/blue/abis.d.ts +5 -1
  34. package/lib/cjs/blue/abis.js +2 -0
  35. package/lib/cjs/blue/entities.d.ts +10 -2
  36. package/lib/cjs/blue/entities.js +2 -0
  37. package/lib/cjs/blue/errors.d.ts +4 -2
  38. package/lib/cjs/blue/errors.js +3 -1
  39. package/lib/cjs/blue/fetch.d.ts +5 -1
  40. package/lib/cjs/blue/fetch.js +2 -0
  41. package/lib/cjs/blue/utils.d.ts +5 -1
  42. package/lib/cjs/blue/utils.js +2 -0
  43. package/lib/cjs/entities/index.d.ts +10 -2
  44. package/lib/cjs/entities/index.js +2 -0
  45. package/lib/cjs/entities/requirements/getVaultBundlesSharesRequirements.d.ts +5 -2
  46. package/lib/cjs/entities/requirements/getVaultBundlesSharesRequirements.js +8 -3
  47. package/lib/cjs/entities/vaultV1/vaultV1.d.ts +31 -21
  48. package/lib/cjs/entities/vaultV1/vaultV1.js +50 -83
  49. package/lib/cjs/entities/vaultV2/vaultV2.d.ts +52 -35
  50. package/lib/cjs/entities/vaultV2/vaultV2.js +71 -81
  51. package/lib/cjs/errors.d.ts +5 -3
  52. package/lib/cjs/errors.js +4 -1
  53. package/lib/cjs/fetch.d.ts +5 -1
  54. package/lib/cjs/fetch.js +2 -0
  55. package/lib/cjs/helpers/previewVaultV2ForceWithdraw.js +11 -5
  56. package/lib/cjs/helpers/vaultV2ForceWithdrawPlan.d.ts +48 -15
  57. package/lib/cjs/helpers/vaultV2ForceWithdrawPlan.js +48 -15
  58. package/lib/cjs/midnight/errors.d.ts +1 -1
  59. package/lib/cjs/midnight/errors.js +2 -1
  60. package/lib/cjs/types/action.d.ts +1 -0
  61. package/lib/cjs/utils.d.ts +5 -1
  62. package/lib/cjs/utils.js +2 -0
  63. package/lib/esm/abis.d.ts +5 -1
  64. package/lib/esm/abis.js +5 -1
  65. package/lib/esm/actions/bundles/common.d.ts +20 -25
  66. package/lib/esm/actions/bundles/common.js +44 -82
  67. package/lib/esm/actions/bundles/index.d.ts +1 -1
  68. package/lib/esm/actions/bundles/resolveBundlesTokenRequirements.d.ts +6 -2
  69. package/lib/esm/actions/bundles/resolveBundlesTokenRequirements.js +6 -2
  70. package/lib/esm/actions/requirements/blue/getBlueAuthorizationRequirement.d.ts +1 -0
  71. package/lib/esm/actions/requirements/blue/getBlueAuthorizationRequirement.js +1 -0
  72. package/lib/esm/actions/requirements/encode/encodeBlueSignatureAuthorization.d.ts +11 -3
  73. package/lib/esm/actions/requirements/encode/encodeBlueSignatureAuthorization.js +21 -3
  74. package/lib/esm/actions/requirements/encode/encodeVaultSharesPermit.d.ts +4 -1
  75. package/lib/esm/actions/requirements/encode/encodeVaultSharesPermit.js +14 -2
  76. package/lib/esm/actions/vaultV1/inKindRedeem.d.ts +2 -1
  77. package/lib/esm/actions/vaultV1/inKindRedeem.js +2 -1
  78. package/lib/esm/actions/vaultV1/migrateToV2.d.ts +62 -17
  79. package/lib/esm/actions/vaultV1/migrateToV2.js +48 -17
  80. package/lib/esm/actions/vaultV1/redeem.d.ts +28 -1
  81. package/lib/esm/actions/vaultV1/redeem.js +17 -1
  82. package/lib/esm/actions/vaultV1/withdraw.d.ts +1 -1
  83. package/lib/esm/actions/vaultV1/withdraw.js +1 -1
  84. package/lib/esm/actions/vaultV2/forceWithdraw.d.ts +3 -2
  85. package/lib/esm/actions/vaultV2/forceWithdraw.js +3 -2
  86. package/lib/esm/actions/vaultV2/inKindRedeem.d.ts +2 -1
  87. package/lib/esm/actions/vaultV2/inKindRedeem.js +2 -1
  88. package/lib/esm/actions/vaultV2/redeem.d.ts +28 -1
  89. package/lib/esm/actions/vaultV2/redeem.js +17 -1
  90. package/lib/esm/actions/vaultV2/withdraw.d.ts +1 -1
  91. package/lib/esm/actions/vaultV2/withdraw.js +1 -1
  92. package/lib/esm/augment/AccrualPosition.d.ts +1 -0
  93. package/lib/esm/blue/abis.d.ts +5 -1
  94. package/lib/esm/blue/abis.js +5 -1
  95. package/lib/esm/blue/entities.d.ts +10 -2
  96. package/lib/esm/blue/entities.js +5 -1
  97. package/lib/esm/blue/errors.d.ts +4 -2
  98. package/lib/esm/blue/errors.js +4 -2
  99. package/lib/esm/blue/fetch.d.ts +5 -1
  100. package/lib/esm/blue/fetch.js +5 -1
  101. package/lib/esm/blue/utils.d.ts +5 -1
  102. package/lib/esm/blue/utils.js +5 -1
  103. package/lib/esm/entities/index.d.ts +10 -2
  104. package/lib/esm/entities/index.js +5 -1
  105. package/lib/esm/entities/requirements/getVaultBundlesSharesRequirements.d.ts +5 -2
  106. package/lib/esm/entities/requirements/getVaultBundlesSharesRequirements.js +8 -3
  107. package/lib/esm/entities/vaultV1/vaultV1.d.ts +31 -21
  108. package/lib/esm/entities/vaultV1/vaultV1.js +52 -85
  109. package/lib/esm/entities/vaultV2/vaultV2.d.ts +52 -35
  110. package/lib/esm/entities/vaultV2/vaultV2.js +73 -83
  111. package/lib/esm/errors.d.ts +5 -3
  112. package/lib/esm/errors.js +5 -3
  113. package/lib/esm/fetch.d.ts +5 -1
  114. package/lib/esm/fetch.js +5 -1
  115. package/lib/esm/helpers/previewVaultV2ForceWithdraw.js +11 -5
  116. package/lib/esm/helpers/vaultV2ForceWithdrawPlan.d.ts +48 -15
  117. package/lib/esm/helpers/vaultV2ForceWithdrawPlan.js +48 -15
  118. package/lib/esm/midnight/errors.d.ts +1 -1
  119. package/lib/esm/midnight/errors.js +1 -1
  120. package/lib/esm/types/action.d.ts +1 -0
  121. package/lib/esm/utils.d.ts +5 -1
  122. package/lib/esm/utils.js +5 -1
  123. package/package.json +6 -9
@@ -8,6 +8,7 @@ const viem_1 = require("viem");
8
8
  const signAndVerifyTypedData_js_1 = require("../../../helpers/signAndVerifyTypedData.js");
9
9
  const validate_js_1 = require("../../../helpers/validate.js");
10
10
  const validateRequirementSpender_js_1 = require("../../../helpers/validateRequirementSpender.js");
11
+ const index_js_1 = require("../../../types/index.js");
11
12
  /**
12
13
  * Builds the bounded ERC-2612 shares-permit requirement used by an in-kind vault exit.
13
14
  *
@@ -27,6 +28,9 @@ const validateRequirementSpender_js_1 = require("../../../helpers/validateRequir
27
28
  * can be embedded in fixed vault-bundles calldata.
28
29
  * @throws {UnsupportedChainIdError} when no address registry exists for `chainId`.
29
30
  * @throws {UnsupportedErc20ApprovalSpenderError} when `spender` is not a registered fixed vault-bundles contract.
31
+ * @throws {NonPositiveInputError} when `deadline` is not positive.
32
+ * @throws {InputExceedsMaxError} when `deadline` exceeds uint256.
33
+ * @throws {ExpiredDeadlineError} when `deadline` is not in the future.
30
34
  * @throws {MissingClientPropertyError} from `sign()` when the wallet has no account.
31
35
  * @throws {AddressMismatchError} from `sign()` when `userAddress` differs from `owner`, or when the
32
36
  * wallet account differs from `userAddress`.
@@ -88,6 +92,14 @@ const encodeVaultSharesPermit = (params) => {
88
92
  spender,
89
93
  allowed: ["vaultExitBundlesV1", "vaultBundlesV1"],
90
94
  });
95
+ const now = morpho_ts_1.Time.timestamp();
96
+ // Validate the explicit deadline: this exported encoder can be called independently of the
97
+ // guarded resolvers, and an out-of-range or already-expired deadline otherwise surfaces only as
98
+ // a downstream wallet typed-data error or an on-chain revert.
99
+ (0, validate_js_1.validateDeadline)(deadline);
100
+ if (deadline <= now) {
101
+ throw new index_js_1.ExpiredDeadlineError(deadline, now);
102
+ }
91
103
  const permitTypedData = (0, blue_sdk_viem_1.getPermitTypedData)({
92
104
  owner,
93
105
  spender,
@@ -41,7 +41,8 @@ export interface VaultV1InKindRedeemParams {
41
41
  * @throws {UnsupportedChainIdError} when no address registry exists for the target chain.
42
42
  * @throws {UnknownAddressError} when VaultExitBundlesV1 is not registered on the target chain.
43
43
  * @throws {BundlesPermitMismatchError} when the requirement has the wrong permit kind, asset, owner,
44
- * spender, or signature encoding, or when its signed and action amounts or deadlines disagree.
44
+ * spender, or signature encoding, or when its signed and action amounts, deadlines, or a supplied
45
+ * action nonce disagree.
45
46
  * @example
46
47
  * ```ts
47
48
  * import { vaultV1InKindRedeem } from "@morpho-org/morpho-sdk";
@@ -33,7 +33,8 @@ const common_js_1 = require("../bundles/common.js");
33
33
  * @throws {UnsupportedChainIdError} when no address registry exists for the target chain.
34
34
  * @throws {UnknownAddressError} when VaultExitBundlesV1 is not registered on the target chain.
35
35
  * @throws {BundlesPermitMismatchError} when the requirement has the wrong permit kind, asset, owner,
36
- * spender, or signature encoding, or when its signed and action amounts or deadlines disagree.
36
+ * spender, or signature encoding, or when its signed and action amounts, deadlines, or a supplied
37
+ * action nonce disagree.
37
38
  * @example
38
39
  * ```ts
39
40
  * import { vaultV1InKindRedeem } from "@morpho-org/morpho-sdk";
@@ -3,28 +3,65 @@ import { type Erc2612RequirementSignature, type Metadata, type Transaction, type
3
3
  /** Parameters for {@link vaultV1MigrateToV2}. */
4
4
  export interface VaultV1MigrateToV2Params {
5
5
  readonly vault: {
6
+ /** Chain containing the vaults and their registered VaultBundlesV1 contract. */
6
7
  readonly chainId: number;
8
+ /** Source Vault V1 address whose shares are burned. */
7
9
  readonly address: Address;
10
+ /** Source vault's underlying ERC-20 asset; must equal `args.targetAsset`. */
8
11
  readonly asset: Address;
9
12
  };
10
13
  readonly args: VaultV1MigrateToV2AmountArgs & {
14
+ /** Destination Vault V2 contract receiving the net migrated assets. */
11
15
  readonly targetVault: Address;
16
+ /** Destination vault's underlying ERC-20 asset; must equal `vault.asset`. */
12
17
  readonly targetAsset: Address;
18
+ /** Maximum accepted destination share price, scaled by RAY (1e27). */
13
19
  readonly maxSharePriceVaultV2: bigint;
20
+ /** Share owner and transaction sender; VaultBundlesV1 mints shares to this account. */
14
21
  readonly userAddress: Address;
22
+ /** Unsupported; shares are always minted to the transaction sender. */
15
23
  readonly recipient?: never;
24
+ /** Unsupported; the source Vault V1 withdrawal carries no share-price bound. */
16
25
  readonly minSharePriceVaultV1?: never;
26
+ /** Optional ERC-2612 vault-share permit for the migrated source shares. */
17
27
  readonly requirementSignature?: Erc2612RequirementSignature;
28
+ /** Optional WAD-scaled fee in [0, 1e18), defaulting to zero. */
18
29
  readonly referralFeePct?: bigint;
30
+ /** Optional fee recipient; a nonzero address is required when `referralFeePct > 0n`. */
19
31
  readonly referralFeeRecipient?: Address;
32
+ /** Positive uint256 Unix timestamp in seconds after which execution reverts. */
20
33
  readonly deadline: bigint;
21
34
  };
35
+ /** Optional analytics metadata appended to the transaction calldata. */
22
36
  readonly metadata?: Metadata;
23
37
  }
24
38
  /**
25
39
  * Encodes an assets-or-shares Vault V1 to Vault V2 migration through VaultBundlesV1.
26
40
  *
27
- * @param params - Source/destination vaults, exclusive migration amount, fee, permit, and deadline.
41
+ * @param params.vault.chainId - Chain containing the vaults and their registered VaultBundlesV1 contract.
42
+ * @param params.vault.address - Source Vault V1 address whose shares are burned.
43
+ * @param params.vault.asset - Source vault's underlying ERC-20 asset; must equal `args.targetAsset`.
44
+ * @param params.args.assets - Gross migrated amount in asset base units, exclusive with `shares`.
45
+ * @param params.args.shares - Source vault shares to burn for the migration, exclusive with `assets`.
46
+ * @param params.args.targetVault - Destination Vault V2 contract receiving the net migrated assets.
47
+ * @param params.args.targetAsset - Destination vault's underlying ERC-20 asset; must equal `vault.asset`.
48
+ * @param params.args.maxSharePriceVaultV2 - Positive maximum asset base units per share base unit
49
+ * on the destination Vault V2 deposit, scaled by RAY (1e27).
50
+ * @param params.args.userAddress - Share owner and transaction sender; VaultBundlesV1 mints shares to this account.
51
+ * @param params.args.recipient - Unsupported; shares are always minted to the transaction sender.
52
+ * @param params.args.minSharePriceVaultV1 - Unsupported; the source Vault V1 withdrawal carries no
53
+ * share-price bound.
54
+ * @param params.args.requirementSignature - Optional ERC-2612 vault-share permit for `userAddress`
55
+ * and the registered VaultBundlesV1 spender. Omit when the share allowance is already set.
56
+ * @param params.args.referralFeePct - Optional WAD-scaled fee in [0, 1e18), defaulting to zero.
57
+ * The fee is rounded down and deducted from gross assets before depositing.
58
+ * @param params.args.referralFeeRecipient - Optional fee recipient; a nonzero address is required
59
+ * when `referralFeePct > 0n`.
60
+ * @param params.args.deadline - Required positive uint256 Unix timestamp in seconds after which
61
+ * execution reverts. This pure builder does not check the current time.
62
+ * @param params.metadata - Optional analytics metadata appended to the transaction calldata.
63
+ * @param params.metadata.origin - Hex origin identifier of at most four bytes, with an optional `0x` prefix.
64
+ * @param params.metadata.timestamp - Optional flag to append the current timestamp; defaults to false.
28
65
  * @returns A deep-frozen VaultBundlesV1 migration transaction.
29
66
  * @throws {VaultAssetMismatchError} when source and destination assets differ.
30
67
  * @throws {SameVaultMigrationError} when source and destination vaults are identical.
@@ -39,24 +76,32 @@ export interface VaultV1MigrateToV2Params {
39
76
  * @throws {BundlesPermitMismatchError} when the optional share permit is incompatible.
40
77
  * @example
41
78
  * ```ts
79
+ * import { vaults } from "@morpho-org/morpho-test";
42
80
  * import { vaultV1MigrateToV2 } from "@morpho-org/morpho-sdk";
81
+ * import type { Address } from "viem";
82
+ * import { mainnet } from "viem/chains";
43
83
  *
44
- * const tx = vaultV1MigrateToV2({
45
- * vault: {
46
- * chainId: 1,
47
- * address: "0x0000000000000000000000000000000000000001",
48
- * asset: "0x0000000000000000000000000000000000000003",
49
- * },
50
- * args: {
51
- * shares: 1_000_000n,
52
- * targetVault: "0x0000000000000000000000000000000000000002",
53
- * targetAsset: "0x0000000000000000000000000000000000000003",
54
- * maxSharePriceVaultV2: 1_000_000_000_000_000_000_000_000_000n,
55
- * userAddress: "0x0000000000000000000000000000000000000004",
56
- * deadline: 1_900_000_000n,
57
- * },
58
- * });
59
- * // tx.action.type === "vaultV1MigrateToV2"
84
+ * export function buildSteakUsdcMigration(
85
+ * targetVault: Address,
86
+ * userAddress: Address,
87
+ * maxSharePriceVaultV2: bigint,
88
+ * deadline: bigint,
89
+ * ) {
90
+ * const vault = vaults[mainnet.id].steakUsdc;
91
+ * const tx = vaultV1MigrateToV2({
92
+ * vault: { chainId: mainnet.id, address: vault.address, asset: vault.asset },
93
+ * args: {
94
+ * shares: 1_000_000n,
95
+ * targetVault,
96
+ * targetAsset: vault.asset,
97
+ * maxSharePriceVaultV2,
98
+ * userAddress,
99
+ * deadline,
100
+ * },
101
+ * });
102
+ * // tx satisfies Readonly<Transaction<VaultV1MigrateToV2Action>>
103
+ * return tx;
104
+ * }
60
105
  * ```
61
106
  */
62
107
  export declare const vaultV1MigrateToV2: (params: VaultV1MigrateToV2Params) => Readonly<Transaction<VaultV1MigrateToV2Action>>;
@@ -10,7 +10,30 @@ const common_js_1 = require("../bundles/common.js");
10
10
  /**
11
11
  * Encodes an assets-or-shares Vault V1 to Vault V2 migration through VaultBundlesV1.
12
12
  *
13
- * @param params - Source/destination vaults, exclusive migration amount, fee, permit, and deadline.
13
+ * @param params.vault.chainId - Chain containing the vaults and their registered VaultBundlesV1 contract.
14
+ * @param params.vault.address - Source Vault V1 address whose shares are burned.
15
+ * @param params.vault.asset - Source vault's underlying ERC-20 asset; must equal `args.targetAsset`.
16
+ * @param params.args.assets - Gross migrated amount in asset base units, exclusive with `shares`.
17
+ * @param params.args.shares - Source vault shares to burn for the migration, exclusive with `assets`.
18
+ * @param params.args.targetVault - Destination Vault V2 contract receiving the net migrated assets.
19
+ * @param params.args.targetAsset - Destination vault's underlying ERC-20 asset; must equal `vault.asset`.
20
+ * @param params.args.maxSharePriceVaultV2 - Positive maximum asset base units per share base unit
21
+ * on the destination Vault V2 deposit, scaled by RAY (1e27).
22
+ * @param params.args.userAddress - Share owner and transaction sender; VaultBundlesV1 mints shares to this account.
23
+ * @param params.args.recipient - Unsupported; shares are always minted to the transaction sender.
24
+ * @param params.args.minSharePriceVaultV1 - Unsupported; the source Vault V1 withdrawal carries no
25
+ * share-price bound.
26
+ * @param params.args.requirementSignature - Optional ERC-2612 vault-share permit for `userAddress`
27
+ * and the registered VaultBundlesV1 spender. Omit when the share allowance is already set.
28
+ * @param params.args.referralFeePct - Optional WAD-scaled fee in [0, 1e18), defaulting to zero.
29
+ * The fee is rounded down and deducted from gross assets before depositing.
30
+ * @param params.args.referralFeeRecipient - Optional fee recipient; a nonzero address is required
31
+ * when `referralFeePct > 0n`.
32
+ * @param params.args.deadline - Required positive uint256 Unix timestamp in seconds after which
33
+ * execution reverts. This pure builder does not check the current time.
34
+ * @param params.metadata - Optional analytics metadata appended to the transaction calldata.
35
+ * @param params.metadata.origin - Hex origin identifier of at most four bytes, with an optional `0x` prefix.
36
+ * @param params.metadata.timestamp - Optional flag to append the current timestamp; defaults to false.
14
37
  * @returns A deep-frozen VaultBundlesV1 migration transaction.
15
38
  * @throws {VaultAssetMismatchError} when source and destination assets differ.
16
39
  * @throws {SameVaultMigrationError} when source and destination vaults are identical.
@@ -25,24 +48,32 @@ const common_js_1 = require("../bundles/common.js");
25
48
  * @throws {BundlesPermitMismatchError} when the optional share permit is incompatible.
26
49
  * @example
27
50
  * ```ts
51
+ * import { vaults } from "@morpho-org/morpho-test";
28
52
  * import { vaultV1MigrateToV2 } from "@morpho-org/morpho-sdk";
53
+ * import type { Address } from "viem";
54
+ * import { mainnet } from "viem/chains";
29
55
  *
30
- * const tx = vaultV1MigrateToV2({
31
- * vault: {
32
- * chainId: 1,
33
- * address: "0x0000000000000000000000000000000000000001",
34
- * asset: "0x0000000000000000000000000000000000000003",
35
- * },
36
- * args: {
37
- * shares: 1_000_000n,
38
- * targetVault: "0x0000000000000000000000000000000000000002",
39
- * targetAsset: "0x0000000000000000000000000000000000000003",
40
- * maxSharePriceVaultV2: 1_000_000_000_000_000_000_000_000_000n,
41
- * userAddress: "0x0000000000000000000000000000000000000004",
42
- * deadline: 1_900_000_000n,
43
- * },
44
- * });
45
- * // tx.action.type === "vaultV1MigrateToV2"
56
+ * export function buildSteakUsdcMigration(
57
+ * targetVault: Address,
58
+ * userAddress: Address,
59
+ * maxSharePriceVaultV2: bigint,
60
+ * deadline: bigint,
61
+ * ) {
62
+ * const vault = vaults[mainnet.id].steakUsdc;
63
+ * const tx = vaultV1MigrateToV2({
64
+ * vault: { chainId: mainnet.id, address: vault.address, asset: vault.asset },
65
+ * args: {
66
+ * shares: 1_000_000n,
67
+ * targetVault,
68
+ * targetAsset: vault.asset,
69
+ * maxSharePriceVaultV2,
70
+ * userAddress,
71
+ * deadline,
72
+ * },
73
+ * });
74
+ * // tx satisfies Readonly<Transaction<VaultV1MigrateToV2Action>>
75
+ * return tx;
76
+ * }
46
77
  * ```
47
78
  */
48
79
  const vaultV1MigrateToV2 = (params) => {
@@ -3,25 +3,52 @@ import { type Erc2612RequirementSignature, type Metadata, type Transaction, type
3
3
  /** Parameters for {@link vaultV1Redeem}. */
4
4
  export interface VaultV1RedeemParams {
5
5
  readonly vault: {
6
+ /** Chain containing the vault and its registered VaultBundlesV1 contract. */
6
7
  readonly chainId: number;
8
+ /** Vault V1 whose shares are burned for the redemption. */
7
9
  readonly address: Address;
8
10
  };
9
11
  readonly args: {
12
+ /** Vault shares to redeem, in share base units. */
10
13
  readonly shares: bigint;
14
+ /** Share owner and transaction sender; receives the net redeemed assets. */
11
15
  readonly userAddress: Address;
16
+ /** Unsupported; net assets are always paid to the transaction sender. */
12
17
  readonly recipient?: never;
18
+ /** Unsupported; VaultBundlesV1 always burns the transaction sender's shares. */
13
19
  readonly onBehalf?: never;
20
+ /** Optional ERC-2612 vault-share permit for the redeemed shares. */
14
21
  readonly requirementSignature?: Erc2612RequirementSignature;
22
+ /** Optional WAD-scaled fee in [0, 1e18), defaulting to zero. */
15
23
  readonly referralFeePct?: bigint;
24
+ /** Optional fee recipient; a nonzero address is required when `referralFeePct > 0n`. */
16
25
  readonly referralFeeRecipient?: Address;
26
+ /** Positive uint256 Unix timestamp in seconds after which execution reverts. */
17
27
  readonly deadline: bigint;
18
28
  };
29
+ /** Optional analytics metadata appended to the transaction calldata. */
19
30
  readonly metadata?: Metadata;
20
31
  }
21
32
  /**
22
33
  * Encodes an exact-shares Vault V1 redemption through VaultBundlesV1.
23
34
  *
24
- * @param params - Vault, shares, share permit, fee, and deadline values.
35
+ * @param params.vault.chainId - Chain containing the vault and its registered VaultBundlesV1 contract.
36
+ * @param params.vault.address - Vault V1 whose shares are burned for the redemption.
37
+ * @param params.args.shares - Positive vault shares to redeem, in share base units.
38
+ * @param params.args.userAddress - Share owner and transaction sender; receives the net redeemed assets.
39
+ * @param params.args.recipient - Unsupported; net assets are always paid to the transaction sender.
40
+ * @param params.args.onBehalf - Unsupported; VaultBundlesV1 always burns the transaction sender's shares.
41
+ * @param params.args.requirementSignature - Optional ERC-2612 vault-share permit for `userAddress`
42
+ * and the registered VaultBundlesV1 spender. Omit when the share allowance is already set.
43
+ * @param params.args.referralFeePct - Optional WAD-scaled fee in [0, 1e18), defaulting to zero.
44
+ * The fee is rounded down and deducted from the gross redeemed assets.
45
+ * @param params.args.referralFeeRecipient - Optional fee recipient; a nonzero address is required
46
+ * when `referralFeePct > 0n`.
47
+ * @param params.args.deadline - Required positive uint256 Unix timestamp in seconds after which
48
+ * execution reverts. This pure builder does not check the current time.
49
+ * @param params.metadata - Optional analytics metadata appended to the transaction calldata.
50
+ * @param params.metadata.origin - Hex origin identifier of at most four bytes, with an optional `0x` prefix.
51
+ * @param params.metadata.timestamp - Optional flag to append the current timestamp; defaults to false.
25
52
  * @returns A deep-frozen VaultBundlesV1 redemption transaction.
26
53
  * @throws {NonPositiveInputError} when `shares` or `deadline` is not positive.
27
54
  * @throws {InputExceedsMaxError} when `shares` or `deadline` exceeds uint256.
@@ -10,7 +10,23 @@ const common_js_1 = require("../bundles/common.js");
10
10
  /**
11
11
  * Encodes an exact-shares Vault V1 redemption through VaultBundlesV1.
12
12
  *
13
- * @param params - Vault, shares, share permit, fee, and deadline values.
13
+ * @param params.vault.chainId - Chain containing the vault and its registered VaultBundlesV1 contract.
14
+ * @param params.vault.address - Vault V1 whose shares are burned for the redemption.
15
+ * @param params.args.shares - Positive vault shares to redeem, in share base units.
16
+ * @param params.args.userAddress - Share owner and transaction sender; receives the net redeemed assets.
17
+ * @param params.args.recipient - Unsupported; net assets are always paid to the transaction sender.
18
+ * @param params.args.onBehalf - Unsupported; VaultBundlesV1 always burns the transaction sender's shares.
19
+ * @param params.args.requirementSignature - Optional ERC-2612 vault-share permit for `userAddress`
20
+ * and the registered VaultBundlesV1 spender. Omit when the share allowance is already set.
21
+ * @param params.args.referralFeePct - Optional WAD-scaled fee in [0, 1e18), defaulting to zero.
22
+ * The fee is rounded down and deducted from the gross redeemed assets.
23
+ * @param params.args.referralFeeRecipient - Optional fee recipient; a nonzero address is required
24
+ * when `referralFeePct > 0n`.
25
+ * @param params.args.deadline - Required positive uint256 Unix timestamp in seconds after which
26
+ * execution reverts. This pure builder does not check the current time.
27
+ * @param params.metadata - Optional analytics metadata appended to the transaction calldata.
28
+ * @param params.metadata.origin - Hex origin identifier of at most four bytes, with an optional `0x` prefix.
29
+ * @param params.metadata.timestamp - Optional flag to append the current timestamp; defaults to false.
14
30
  * @returns A deep-frozen VaultBundlesV1 redemption transaction.
15
31
  * @throws {NonPositiveInputError} when `shares` or `deadline` is not positive.
16
32
  * @throws {InputExceedsMaxError} when `shares` or `deadline` exceeds uint256.
@@ -22,7 +22,7 @@ export interface VaultV1WithdrawParams {
22
22
  * Encodes an exact-assets Vault V1 withdrawal through VaultBundlesV1.
23
23
  *
24
24
  * This low-level builder does not bind `permit.value` to a share cap; use
25
- * `MorphoVaultV1.withdraw().buildTx()` to validate it against the cap from `getRequirements()`.
25
+ * `MorphoVaultV1.withdraw().buildTx()` to validate it against the share cap derived from the handle's `vaultData`.
26
26
  *
27
27
  * @param params.vault.chainId - Chain containing the vault and its registered VaultBundlesV1 contract.
28
28
  * @param params.vault.address - Vault V1 whose shares are burned for the withdrawal.
@@ -11,7 +11,7 @@ const common_js_1 = require("../bundles/common.js");
11
11
  * Encodes an exact-assets Vault V1 withdrawal through VaultBundlesV1.
12
12
  *
13
13
  * This low-level builder does not bind `permit.value` to a share cap; use
14
- * `MorphoVaultV1.withdraw().buildTx()` to validate it against the cap from `getRequirements()`.
14
+ * `MorphoVaultV1.withdraw().buildTx()` to validate it against the share cap derived from the handle's `vaultData`.
15
15
  *
16
16
  * @param params.vault.chainId - Chain containing the vault and its registered VaultBundlesV1 contract.
17
17
  * @param params.vault.address - Vault V1 whose shares are burned for the withdrawal.
@@ -56,8 +56,9 @@ export interface VaultV2ForceWithdrawParams {
56
56
  * `data`, and the typed action discriminator.
57
57
  * @throws {NonPositiveInputError} when `exitAssets` or `deadline` is not positive.
58
58
  * @throws {NegativeInputError} when `referralFeePct` or `minSharePriceE27` is negative.
59
- * @throws {InputExceedsMaxError} when `referralFeePct` is not below WAD (the contract rejects it
60
- * with `PctExceeded`), or when `exitAssets`, `deadline`, or `minSharePriceE27` exceeds `uint256`.
59
+ * @throws {ReferralFeePctExceededError} when `referralFeePct` is not below WAD (the contract
60
+ * rejects it with `PctExceeded`); it extends {@link InputExceedsMaxError}.
61
+ * @throws {InputExceedsMaxError} when `exitAssets`, `deadline`, or `minSharePriceE27` exceeds `uint256`.
61
62
  * @throws {ReferralFeeRecipientMissingError} when a positive `referralFeePct` has no recipient.
62
63
  * @throws {UnsupportedChainIdError} when no address registry exists for the target chain.
63
64
  * @throws {UnknownAddressError} when VaultExitBundlesV1 is not registered on the target chain.
@@ -46,8 +46,9 @@ const common_js_1 = require("../bundles/common.js");
46
46
  * `data`, and the typed action discriminator.
47
47
  * @throws {NonPositiveInputError} when `exitAssets` or `deadline` is not positive.
48
48
  * @throws {NegativeInputError} when `referralFeePct` or `minSharePriceE27` is negative.
49
- * @throws {InputExceedsMaxError} when `referralFeePct` is not below WAD (the contract rejects it
50
- * with `PctExceeded`), or when `exitAssets`, `deadline`, or `minSharePriceE27` exceeds `uint256`.
49
+ * @throws {ReferralFeePctExceededError} when `referralFeePct` is not below WAD (the contract
50
+ * rejects it with `PctExceeded`); it extends {@link InputExceedsMaxError}.
51
+ * @throws {InputExceedsMaxError} when `exitAssets`, `deadline`, or `minSharePriceE27` exceeds `uint256`.
51
52
  * @throws {ReferralFeeRecipientMissingError} when a positive `referralFeePct` has no recipient.
52
53
  * @throws {UnsupportedChainIdError} when no address registry exists for the target chain.
53
54
  * @throws {UnknownAddressError} when VaultExitBundlesV1 is not registered on the target chain.
@@ -43,7 +43,8 @@ export interface VaultV2InKindRedeemParams {
43
43
  * @throws {UnsupportedChainIdError} when no address registry exists for the target chain.
44
44
  * @throws {UnknownAddressError} when VaultExitBundlesV1 is not registered on the target chain.
45
45
  * @throws {BundlesPermitMismatchError} when the requirement has the wrong permit kind, asset, owner,
46
- * spender, or signature encoding, or when its signed and action amounts or deadlines disagree.
46
+ * spender, or signature encoding, or when its signed and action amounts, deadlines, or a supplied
47
+ * action nonce disagree.
47
48
  * @example
48
49
  * ```ts
49
50
  * import { vaultV2InKindRedeem } from "@morpho-org/morpho-sdk";
@@ -34,7 +34,8 @@ const common_js_1 = require("../bundles/common.js");
34
34
  * @throws {UnsupportedChainIdError} when no address registry exists for the target chain.
35
35
  * @throws {UnknownAddressError} when VaultExitBundlesV1 is not registered on the target chain.
36
36
  * @throws {BundlesPermitMismatchError} when the requirement has the wrong permit kind, asset, owner,
37
- * spender, or signature encoding, or when its signed and action amounts or deadlines disagree.
37
+ * spender, or signature encoding, or when its signed and action amounts, deadlines, or a supplied
38
+ * action nonce disagree.
38
39
  * @example
39
40
  * ```ts
40
41
  * import { vaultV2InKindRedeem } from "@morpho-org/morpho-sdk";
@@ -3,25 +3,52 @@ import { type Erc2612RequirementSignature, type Metadata, type Transaction, type
3
3
  /** Parameters for {@link vaultV2Redeem}. */
4
4
  export interface VaultV2RedeemParams {
5
5
  readonly vault: {
6
+ /** Chain containing the vault and its registered VaultBundlesV1 contract. */
6
7
  readonly chainId: number;
8
+ /** Vault V2 whose shares are burned for the redemption. */
7
9
  readonly address: Address;
8
10
  };
9
11
  readonly args: {
12
+ /** Vault shares to redeem, in share base units. */
10
13
  readonly shares: bigint;
14
+ /** Share owner and transaction sender; receives the net redeemed assets. */
11
15
  readonly userAddress: Address;
16
+ /** Unsupported; net assets are always paid to the transaction sender. */
12
17
  readonly recipient?: never;
18
+ /** Unsupported; VaultBundlesV1 always burns the transaction sender's shares. */
13
19
  readonly onBehalf?: never;
20
+ /** Optional ERC-2612 vault-share permit for the redeemed shares. */
14
21
  readonly requirementSignature?: Erc2612RequirementSignature;
22
+ /** Optional WAD-scaled fee in [0, 1e18), defaulting to zero. */
15
23
  readonly referralFeePct?: bigint;
24
+ /** Optional fee recipient; a nonzero address is required when `referralFeePct > 0n`. */
16
25
  readonly referralFeeRecipient?: Address;
26
+ /** Positive uint256 Unix timestamp in seconds after which execution reverts. */
17
27
  readonly deadline: bigint;
18
28
  };
29
+ /** Optional analytics metadata appended to the transaction calldata. */
19
30
  readonly metadata?: Metadata;
20
31
  }
21
32
  /**
22
33
  * Encodes an exact-shares Vault V2 redemption through VaultBundlesV1.
23
34
  *
24
- * @param params - Vault, shares, share permit, fee, and deadline values.
35
+ * @param params.vault.chainId - Chain containing the vault and its registered VaultBundlesV1 contract.
36
+ * @param params.vault.address - Vault V2 whose shares are burned for the redemption.
37
+ * @param params.args.shares - Positive vault shares to redeem, in share base units.
38
+ * @param params.args.userAddress - Share owner and transaction sender; receives the net redeemed assets.
39
+ * @param params.args.recipient - Unsupported; net assets are always paid to the transaction sender.
40
+ * @param params.args.onBehalf - Unsupported; VaultBundlesV1 always burns the transaction sender's shares.
41
+ * @param params.args.requirementSignature - Optional ERC-2612 vault-share permit for `userAddress`
42
+ * and the registered VaultBundlesV1 spender. Omit when the share allowance is already set.
43
+ * @param params.args.referralFeePct - Optional WAD-scaled fee in [0, 1e18), defaulting to zero.
44
+ * The fee is rounded down and deducted from the gross redeemed assets.
45
+ * @param params.args.referralFeeRecipient - Optional fee recipient; a nonzero address is required
46
+ * when `referralFeePct > 0n`.
47
+ * @param params.args.deadline - Required positive uint256 Unix timestamp in seconds after which
48
+ * execution reverts. This pure builder does not check the current time.
49
+ * @param params.metadata - Optional analytics metadata appended to the transaction calldata.
50
+ * @param params.metadata.origin - Hex origin identifier of at most four bytes, with an optional `0x` prefix.
51
+ * @param params.metadata.timestamp - Optional flag to append the current timestamp; defaults to false.
25
52
  * @returns A deep-frozen VaultBundlesV1 redemption transaction.
26
53
  * @throws {NonPositiveInputError} when `shares` or `deadline` is not positive.
27
54
  * @throws {InputExceedsMaxError} when `shares` or `deadline` exceeds uint256.
@@ -10,7 +10,23 @@ const common_js_1 = require("../bundles/common.js");
10
10
  /**
11
11
  * Encodes an exact-shares Vault V2 redemption through VaultBundlesV1.
12
12
  *
13
- * @param params - Vault, shares, share permit, fee, and deadline values.
13
+ * @param params.vault.chainId - Chain containing the vault and its registered VaultBundlesV1 contract.
14
+ * @param params.vault.address - Vault V2 whose shares are burned for the redemption.
15
+ * @param params.args.shares - Positive vault shares to redeem, in share base units.
16
+ * @param params.args.userAddress - Share owner and transaction sender; receives the net redeemed assets.
17
+ * @param params.args.recipient - Unsupported; net assets are always paid to the transaction sender.
18
+ * @param params.args.onBehalf - Unsupported; VaultBundlesV1 always burns the transaction sender's shares.
19
+ * @param params.args.requirementSignature - Optional ERC-2612 vault-share permit for `userAddress`
20
+ * and the registered VaultBundlesV1 spender. Omit when the share allowance is already set.
21
+ * @param params.args.referralFeePct - Optional WAD-scaled fee in [0, 1e18), defaulting to zero.
22
+ * The fee is rounded down and deducted from the gross redeemed assets.
23
+ * @param params.args.referralFeeRecipient - Optional fee recipient; a nonzero address is required
24
+ * when `referralFeePct > 0n`.
25
+ * @param params.args.deadline - Required positive uint256 Unix timestamp in seconds after which
26
+ * execution reverts. This pure builder does not check the current time.
27
+ * @param params.metadata - Optional analytics metadata appended to the transaction calldata.
28
+ * @param params.metadata.origin - Hex origin identifier of at most four bytes, with an optional `0x` prefix.
29
+ * @param params.metadata.timestamp - Optional flag to append the current timestamp; defaults to false.
14
30
  * @returns A deep-frozen VaultBundlesV1 redemption transaction.
15
31
  * @throws {NonPositiveInputError} when `shares` or `deadline` is not positive.
16
32
  * @throws {InputExceedsMaxError} when `shares` or `deadline` exceeds uint256.
@@ -22,7 +22,7 @@ export interface VaultV2WithdrawParams {
22
22
  * Encodes an exact-assets Vault V2 withdrawal through VaultBundlesV1.
23
23
  *
24
24
  * This low-level builder does not bind `permit.value` to a share cap; use
25
- * `MorphoVaultV2.withdraw().buildTx()` to validate it against the cap from `getRequirements()`.
25
+ * `MorphoVaultV2.withdraw().buildTx()` to validate it against the share cap derived from the handle's `vaultData`.
26
26
  *
27
27
  * @param params.vault.chainId - Chain containing the vault and its registered VaultBundlesV1 contract.
28
28
  * @param params.vault.address - Vault V2 whose shares are burned for the withdrawal.
@@ -11,7 +11,7 @@ const common_js_1 = require("../bundles/common.js");
11
11
  * Encodes an exact-assets Vault V2 withdrawal through VaultBundlesV1.
12
12
  *
13
13
  * This low-level builder does not bind `permit.value` to a share cap; use
14
- * `MorphoVaultV2.withdraw().buildTx()` to validate it against the cap from `getRequirements()`.
14
+ * `MorphoVaultV2.withdraw().buildTx()` to validate it against the share cap derived from the handle's `vaultData`.
15
15
  *
16
16
  * @param params.vault.chainId - Chain containing the vault and its registered VaultBundlesV1 contract.
17
17
  * @param params.vault.address - Vault V2 whose shares are burned for the withdrawal.
@@ -3,6 +3,7 @@ import { fetchAccrualPosition, fetchPreLiquidationPosition } from "@morpho-org/b
3
3
  declare module "@morpho-org/blue-sdk" {
4
4
  namespace AccrualPosition {
5
5
  let fetch: typeof fetchAccrualPosition;
6
+ /** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
6
7
  let fetchPreLiquidation: typeof fetchPreLiquidationPosition;
7
8
  }
8
9
  }
@@ -1,2 +1,6 @@
1
1
  export { marketParamsAbi } from "@morpho-org/blue-sdk";
2
- export { adaptiveCurveIrmAbi, blueAbi, blueOracleAbi, erc2612Abi, erc5267Abi, metaMorphoAbi, metaMorphoFactoryAbi, morphoMarketV1AdapterAbi, morphoMarketV1AdapterFactoryAbi, morphoMarketV1AdapterV2Abi, morphoMarketV1AdapterV2FactoryAbi, morphoVaultV1AdapterAbi, morphoVaultV1AdapterFactoryAbi, permissionedErc20WrapperAbi, permit2Abi, preLiquidationAbi, preLiquidationFactoryAbi, vaultV2Abi, vaultV2BluePublicAllocatorAbi, vaultV2FactoryAbi, whitelistControllerAggregatorV2Abi, wrappedBackedTokenAbi, wstEthAbi, } from "@morpho-org/blue-sdk-viem";
2
+ export { adaptiveCurveIrmAbi, blueAbi, blueOracleAbi, erc2612Abi, erc5267Abi, metaMorphoAbi, metaMorphoFactoryAbi, morphoMarketV1AdapterAbi, morphoMarketV1AdapterFactoryAbi, morphoMarketV1AdapterV2Abi, morphoMarketV1AdapterV2FactoryAbi, morphoVaultV1AdapterAbi, morphoVaultV1AdapterFactoryAbi, permissionedErc20WrapperAbi, permit2Abi,
3
+ /** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
4
+ preLiquidationAbi,
5
+ /** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
6
+ preLiquidationFactoryAbi, vaultV2Abi, vaultV2BluePublicAllocatorAbi, vaultV2FactoryAbi, whitelistControllerAggregatorV2Abi, wrappedBackedTokenAbi, wstEthAbi, } from "@morpho-org/blue-sdk-viem";
@@ -19,7 +19,9 @@ Object.defineProperty(exports, "morphoVaultV1AdapterAbi", { enumerable: true, ge
19
19
  Object.defineProperty(exports, "morphoVaultV1AdapterFactoryAbi", { enumerable: true, get: function () { return blue_sdk_viem_1.morphoVaultV1AdapterFactoryAbi; } });
20
20
  Object.defineProperty(exports, "permissionedErc20WrapperAbi", { enumerable: true, get: function () { return blue_sdk_viem_1.permissionedErc20WrapperAbi; } });
21
21
  Object.defineProperty(exports, "permit2Abi", { enumerable: true, get: function () { return blue_sdk_viem_1.permit2Abi; } });
22
+ /** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
22
23
  Object.defineProperty(exports, "preLiquidationAbi", { enumerable: true, get: function () { return blue_sdk_viem_1.preLiquidationAbi; } });
24
+ /** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
23
25
  Object.defineProperty(exports, "preLiquidationFactoryAbi", { enumerable: true, get: function () { return blue_sdk_viem_1.preLiquidationFactoryAbi; } });
24
26
  Object.defineProperty(exports, "vaultV2Abi", { enumerable: true, get: function () { return blue_sdk_viem_1.vaultV2Abi; } });
25
27
  Object.defineProperty(exports, "vaultV2BluePublicAllocatorAbi", { enumerable: true, get: function () { return blue_sdk_viem_1.vaultV2BluePublicAllocatorAbi; } });
@@ -1,2 +1,10 @@
1
- export type { IAccrualPosition, IAccrualVault, IAccrualVaultV2, IAccrualVaultV2Adapter, IAccrualVaultV2MorphoMarketV1Adapter, IAccrualVaultV2MorphoMarketV1AdapterV2, IAccrualVaultV2MorphoVaultV1Adapter, IAssetBalances, IEip5267Domain, IHolding, IMarket, IMarketParams, IPosition, IPreLiquidationParams, IPreLiquidationPosition, IToken, IVault, IVaultConfig, IVaultMarketAllocation, IVaultMarketConfig, IVaultToken, IVaultUser, IVaultV2, IVaultV2Adapter, IVaultV2Allocation, IVaultV2BlueMarketPublicAllocatorConfig, IVaultV2BluePublicAllocatorConfig, IVaultV2MorphoMarketV1Adapter, IVaultV2MorphoMarketV1AdapterV2, IVaultV2MorphoVaultV1Adapter, PeripheralBalance, PeripheralBalanceType, } from "@morpho-org/blue-sdk";
2
- export { AccrualPosition, AccrualVault, AccrualVaultV2, AccrualVaultV2MorphoMarketV1Adapter, AccrualVaultV2MorphoMarketV1AdapterV2, AccrualVaultV2MorphoVaultV1Adapter, AssetBalances, ConstantWrappedToken, Eip5267Domain, ExchangeRateWrappedToken, Holding, Market, MarketParams, Position, PreLiquidationParams, PreLiquidationPosition, Token, User, Vault, VaultConfig, VaultMarketAllocation, VaultMarketConfig, VaultToken, VaultUser, VaultV2, VaultV2Adapter, VaultV2BlueMarketPublicAllocatorConfig, VaultV2BluePublicAllocatorConfig, VaultV2MorphoMarketV1Adapter, VaultV2MorphoMarketV1AdapterV2, VaultV2MorphoVaultV1Adapter, WrappedToken, } from "@morpho-org/blue-sdk";
1
+ export type { IAccrualPosition, IAccrualVault, IAccrualVaultV2, IAccrualVaultV2Adapter, IAccrualVaultV2MorphoMarketV1Adapter, IAccrualVaultV2MorphoMarketV1AdapterV2, IAccrualVaultV2MorphoVaultV1Adapter, IAssetBalances, IEip5267Domain, IHolding, IMarket, IMarketParams, IPosition,
2
+ /** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
3
+ IPreLiquidationParams,
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,
7
+ /** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
8
+ PreLiquidationParams,
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";
@@ -16,7 +16,9 @@ Object.defineProperty(exports, "Holding", { enumerable: true, get: function () {
16
16
  Object.defineProperty(exports, "Market", { enumerable: true, get: function () { return blue_sdk_1.Market; } });
17
17
  Object.defineProperty(exports, "MarketParams", { enumerable: true, get: function () { return blue_sdk_1.MarketParams; } });
18
18
  Object.defineProperty(exports, "Position", { enumerable: true, get: function () { return blue_sdk_1.Position; } });
19
+ /** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
19
20
  Object.defineProperty(exports, "PreLiquidationParams", { enumerable: true, get: function () { return blue_sdk_1.PreLiquidationParams; } });
21
+ /** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
20
22
  Object.defineProperty(exports, "PreLiquidationPosition", { enumerable: true, get: function () { return blue_sdk_1.PreLiquidationPosition; } });
21
23
  Object.defineProperty(exports, "Token", { enumerable: true, get: function () { return blue_sdk_1.Token; } });
22
24
  Object.defineProperty(exports, "User", { enumerable: true, get: function () { return blue_sdk_1.User; } });
@@ -1,2 +1,4 @@
1
- export { BlueErrors, DivisionByZeroError, IncompleteChainRegistryError, InvalidBitLengthError, InvalidMarketParamsError, RegistryValueAlreadyRegisteredError, UnknownAddressError, UnknownDataError, UnknownFactory, UnknownMarketAllocationError, UnknownMarketParamsError, UnknownOfFactory, UnknownTokenError, UnknownTokenPriceError, UnknownVaultConfigError, UnsupportedChainIdError, UnsupportedMarketIrmError, UnsupportedPreLiquidationParamsError, UnsupportedVaultV2AdapterError, VaultV2Errors, } from "@morpho-org/blue-sdk";
2
- export { getUnsupportedVaultV2Adapter, InvalidPermitDomainChainIdError, InvalidPermitDomainVerifyingContractError, isUnknownOfFactoryError, UnsupportedPermitDomainExtensionsError, } from "@morpho-org/blue-sdk-viem";
1
+ export { BlueErrors, DivisionByZeroError, IncompleteChainRegistryError, InvalidBitLengthError, InvalidMarketParamsError, RegistryValueAlreadyRegisteredError, UnknownAddressError, UnknownDataError, UnknownFactory, UnknownMarketAllocationError, UnknownMarketParamsError, UnknownOfFactory, UnknownTokenError, UnknownTokenPriceError, UnknownVaultConfigError, UnsupportedChainIdError, UnsupportedMarketIrmError,
2
+ /** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
3
+ UnsupportedPreLiquidationParamsError, UnsupportedVaultV2AdapterError, VaultV2Errors, } from "@morpho-org/blue-sdk";
4
+ export { getUnsupportedVaultV2Adapter, InvalidNumberError, InvalidPermitDomainChainIdError, InvalidPermitDomainVerifyingContractError, isUnknownOfFactoryError, 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.isUnknownOfFactoryError = exports.InvalidPermitDomainVerifyingContractError = exports.InvalidPermitDomainChainIdError = 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.IncompleteChainRegistryError = exports.DivisionByZeroError = exports.BlueErrors = void 0;
3
+ exports.UnsupportedPermitDomainExtensionsError = 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.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; } });
@@ -19,11 +19,13 @@ Object.defineProperty(exports, "UnknownTokenPriceError", { enumerable: true, get
19
19
  Object.defineProperty(exports, "UnknownVaultConfigError", { enumerable: true, get: function () { return blue_sdk_1.UnknownVaultConfigError; } });
20
20
  Object.defineProperty(exports, "UnsupportedChainIdError", { enumerable: true, get: function () { return blue_sdk_1.UnsupportedChainIdError; } });
21
21
  Object.defineProperty(exports, "UnsupportedMarketIrmError", { enumerable: true, get: function () { return blue_sdk_1.UnsupportedMarketIrmError; } });
22
+ /** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
22
23
  Object.defineProperty(exports, "UnsupportedPreLiquidationParamsError", { enumerable: true, get: function () { return blue_sdk_1.UnsupportedPreLiquidationParamsError; } });
23
24
  Object.defineProperty(exports, "UnsupportedVaultV2AdapterError", { enumerable: true, get: function () { return blue_sdk_1.UnsupportedVaultV2AdapterError; } });
24
25
  Object.defineProperty(exports, "VaultV2Errors", { enumerable: true, get: function () { return blue_sdk_1.VaultV2Errors; } });
25
26
  var blue_sdk_viem_1 = require("@morpho-org/blue-sdk-viem");
26
27
  Object.defineProperty(exports, "getUnsupportedVaultV2Adapter", { enumerable: true, get: function () { return blue_sdk_viem_1.getUnsupportedVaultV2Adapter; } });
28
+ Object.defineProperty(exports, "InvalidNumberError", { enumerable: true, get: function () { return blue_sdk_viem_1.InvalidNumberError; } });
27
29
  Object.defineProperty(exports, "InvalidPermitDomainChainIdError", { enumerable: true, get: function () { return blue_sdk_viem_1.InvalidPermitDomainChainIdError; } });
28
30
  Object.defineProperty(exports, "InvalidPermitDomainVerifyingContractError", { enumerable: true, get: function () { return blue_sdk_viem_1.InvalidPermitDomainVerifyingContractError; } });
29
31
  Object.defineProperty(exports, "isUnknownOfFactoryError", { enumerable: true, get: function () { return blue_sdk_viem_1.isUnknownOfFactoryError; } });