@morpho-org/morpho-sdk 3.1.1 → 4.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 (103) hide show
  1. package/README.md +63 -13
  2. package/lib/cjs/actions/{marketV1 → blue}/borrow.d.ts +8 -8
  3. package/lib/cjs/actions/{marketV1 → blue}/borrow.js +8 -8
  4. package/lib/{esm/actions/marketV1 → cjs/actions/blue}/buildReallocationActions.d.ts +1 -1
  5. package/lib/cjs/actions/{marketV1 → blue}/buildReallocationActions.js +1 -1
  6. package/lib/cjs/actions/{marketV1 → blue}/index.d.ts +1 -0
  7. package/lib/cjs/actions/{marketV1 → blue}/index.js +1 -0
  8. package/lib/cjs/actions/blue/refinance.d.ts +117 -0
  9. package/lib/cjs/actions/blue/refinance.js +218 -0
  10. package/lib/{esm/actions/marketV1 → cjs/actions/blue}/repay.d.ts +8 -8
  11. package/lib/cjs/actions/{marketV1 → blue}/repay.js +8 -8
  12. package/lib/{esm/actions/marketV1 → cjs/actions/blue}/repayWithdrawCollateral.d.ts +8 -8
  13. package/lib/cjs/actions/{marketV1 → blue}/repayWithdrawCollateral.js +8 -8
  14. package/lib/{esm/actions/marketV1 → cjs/actions/blue}/supply.d.ts +8 -8
  15. package/lib/cjs/actions/{marketV1 → blue}/supply.js +8 -8
  16. package/lib/cjs/actions/{marketV1 → blue}/supplyCollateral.d.ts +8 -8
  17. package/lib/cjs/actions/{marketV1 → blue}/supplyCollateral.js +8 -8
  18. package/lib/{esm/actions/marketV1 → cjs/actions/blue}/supplyCollateralBorrow.d.ts +8 -8
  19. package/lib/cjs/actions/{marketV1 → blue}/supplyCollateralBorrow.js +8 -8
  20. package/lib/{esm/actions/marketV1 → cjs/actions/blue}/withdraw.d.ts +11 -11
  21. package/lib/cjs/actions/{marketV1 → blue}/withdraw.js +10 -10
  22. package/lib/{esm/actions/marketV1 → cjs/actions/blue}/withdrawCollateral.d.ts +8 -8
  23. package/lib/cjs/actions/{marketV1 → blue}/withdrawCollateral.js +8 -8
  24. package/lib/cjs/actions/index.d.ts +2 -2
  25. package/lib/cjs/actions/index.js +1 -1
  26. package/lib/cjs/actions/requirements/getMorphoAuthorizationRequirement.d.ts +1 -1
  27. package/lib/cjs/actions/requirements/getMorphoAuthorizationRequirement.js +1 -1
  28. package/lib/cjs/client/index.d.ts +0 -1
  29. package/lib/cjs/client/index.js +0 -1
  30. package/lib/cjs/client/morphoViemExtension.d.ts +17 -11
  31. package/lib/cjs/client/morphoViemExtension.js +55 -10
  32. package/lib/cjs/entities/{marketV1/marketV1.d.ts → blue/blue.d.ts} +76 -21
  33. package/lib/cjs/entities/{marketV1/marketV1.js → blue/blue.js} +169 -11
  34. package/lib/cjs/entities/blue/index.d.ts +1 -0
  35. package/lib/cjs/entities/{marketV1 → blue}/index.js +1 -1
  36. package/lib/cjs/entities/index.d.ts +1 -1
  37. package/lib/cjs/entities/index.js +3 -3
  38. package/lib/cjs/entities/reallocationData.d.ts +1 -1
  39. package/lib/cjs/entities/reallocationData.js +1 -1
  40. package/lib/cjs/entities/vaultV2/vaultV2.js +1 -1
  41. package/lib/cjs/helpers/computeReallocations.d.ts +1 -1
  42. package/lib/cjs/helpers/computeReallocations.js +1 -1
  43. package/lib/cjs/helpers/validate.d.ts +2 -2
  44. package/lib/cjs/helpers/validate.js +2 -2
  45. package/lib/cjs/types/action.d.ts +21 -9
  46. package/lib/cjs/types/client.d.ts +5 -4
  47. package/lib/cjs/types/error.d.ts +57 -0
  48. package/lib/cjs/types/error.js +82 -1
  49. package/lib/esm/actions/{marketV1 → blue}/borrow.d.ts +8 -8
  50. package/lib/esm/actions/{marketV1 → blue}/borrow.js +6 -6
  51. package/lib/{cjs/actions/marketV1 → esm/actions/blue}/buildReallocationActions.d.ts +1 -1
  52. package/lib/esm/actions/{marketV1 → blue}/buildReallocationActions.js +1 -1
  53. package/lib/esm/actions/{marketV1 → blue}/index.d.ts +1 -0
  54. package/lib/esm/actions/{marketV1 → blue}/index.js +1 -0
  55. package/lib/esm/actions/blue/refinance.d.ts +117 -0
  56. package/lib/esm/actions/blue/refinance.js +214 -0
  57. package/lib/{cjs/actions/marketV1 → esm/actions/blue}/repay.d.ts +8 -8
  58. package/lib/esm/actions/{marketV1 → blue}/repay.js +6 -6
  59. package/lib/{cjs/actions/marketV1 → esm/actions/blue}/repayWithdrawCollateral.d.ts +8 -8
  60. package/lib/esm/actions/{marketV1 → blue}/repayWithdrawCollateral.js +6 -6
  61. package/lib/{cjs/actions/marketV1 → esm/actions/blue}/supply.d.ts +8 -8
  62. package/lib/esm/actions/{marketV1 → blue}/supply.js +6 -6
  63. package/lib/esm/actions/{marketV1 → blue}/supplyCollateral.d.ts +8 -8
  64. package/lib/esm/actions/{marketV1 → blue}/supplyCollateral.js +6 -6
  65. package/lib/{cjs/actions/marketV1 → esm/actions/blue}/supplyCollateralBorrow.d.ts +8 -8
  66. package/lib/esm/actions/{marketV1 → blue}/supplyCollateralBorrow.js +6 -6
  67. package/lib/{cjs/actions/marketV1 → esm/actions/blue}/withdraw.d.ts +11 -11
  68. package/lib/esm/actions/{marketV1 → blue}/withdraw.js +8 -8
  69. package/lib/{cjs/actions/marketV1 → esm/actions/blue}/withdrawCollateral.d.ts +8 -8
  70. package/lib/esm/actions/{marketV1 → blue}/withdrawCollateral.js +6 -6
  71. package/lib/esm/actions/index.d.ts +2 -2
  72. package/lib/esm/actions/index.js +1 -1
  73. package/lib/esm/actions/requirements/getMorphoAuthorizationRequirement.d.ts +1 -1
  74. package/lib/esm/actions/requirements/getMorphoAuthorizationRequirement.js +1 -1
  75. package/lib/esm/client/index.d.ts +0 -1
  76. package/lib/esm/client/index.js +0 -1
  77. package/lib/esm/client/morphoViemExtension.d.ts +17 -11
  78. package/lib/esm/client/morphoViemExtension.js +55 -10
  79. package/lib/esm/entities/{marketV1/marketV1.d.ts → blue/blue.d.ts} +76 -21
  80. package/lib/esm/entities/{marketV1/marketV1.js → blue/blue.js} +170 -12
  81. package/lib/esm/entities/blue/index.d.ts +1 -0
  82. package/lib/esm/entities/blue/index.js +1 -0
  83. package/lib/esm/entities/index.d.ts +1 -1
  84. package/lib/esm/entities/index.js +1 -1
  85. package/lib/esm/entities/reallocationData.d.ts +1 -1
  86. package/lib/esm/entities/reallocationData.js +1 -1
  87. package/lib/esm/entities/vaultV2/vaultV2.js +1 -1
  88. package/lib/esm/helpers/computeReallocations.d.ts +1 -1
  89. package/lib/esm/helpers/computeReallocations.js +1 -1
  90. package/lib/esm/helpers/validate.d.ts +2 -2
  91. package/lib/esm/helpers/validate.js +2 -2
  92. package/lib/esm/types/action.d.ts +21 -9
  93. package/lib/esm/types/client.d.ts +5 -4
  94. package/lib/esm/types/error.d.ts +57 -0
  95. package/lib/esm/types/error.js +72 -0
  96. package/package.json +6 -6
  97. package/lib/cjs/client/morphoClient.d.ts +0 -152
  98. package/lib/cjs/client/morphoClient.js +0 -162
  99. package/lib/cjs/entities/marketV1/index.d.ts +0 -1
  100. package/lib/esm/client/morphoClient.d.ts +0 -152
  101. package/lib/esm/client/morphoClient.js +0 -158
  102. package/lib/esm/entities/marketV1/index.d.ts +0 -1
  103. package/lib/esm/entities/marketV1/index.js +0 -1
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.marketV1Repay = void 0;
3
+ exports.blueRepay = void 0;
4
4
  const blue_sdk_1 = require("@morpho-org/blue-sdk");
5
5
  const morpho_ts_1 = require("@morpho-org/morpho-ts");
6
6
  const viem_1 = require("viem");
@@ -35,7 +35,7 @@ const getRequirementsAction_js_1 = require("../requirements/getRequirementsActio
35
35
  * @param params.args.requirementSignature - Optional pre-signed permit/permit2 approval for the
36
36
  * loan-token transfer.
37
37
  * @param params.metadata - Optional analytics metadata attached to the bundle.
38
- * @returns A deep-frozen `Transaction<MarketV1RepayAction>` with `to`, `value`, `data`, and the
38
+ * @returns A deep-frozen `Transaction<BlueRepayAction>` with `to`, `value`, `data`, and the
39
39
  * typed `action` discriminator the simulation layer consumes.
40
40
  * @throws {NonPositiveRepayMaxSharePriceError} when `maxSharePrice <= 0n`.
41
41
  * @throws {NonPositiveRepayAmountError} when either `assets` or `shares` is negative, or when
@@ -51,9 +51,9 @@ const getRequirementsAction_js_1 = require("../requirements/getRequirementsActio
51
51
  * signature is missing its expiration.
52
52
  * @example
53
53
  * ```ts
54
- * import { marketV1Repay } from "@morpho-org/morpho-sdk";
54
+ * import { blueRepay } from "@morpho-org/morpho-sdk";
55
55
  *
56
- * const tx = marketV1Repay({
56
+ * const tx = blueRepay({
57
57
  * market: { chainId: 1, marketParams },
58
58
  * args: {
59
59
  * assets: 500_000_000n,
@@ -64,10 +64,10 @@ const getRequirementsAction_js_1 = require("../requirements/getRequirementsActio
64
64
  * maxSharePrice: 1_010_000_000_000_000_000_000_000_000n, // RAY-scaled, 1.01x
65
65
  * },
66
66
  * });
67
- * // tx satisfies Readonly<Transaction<MarketV1RepayAction>>
67
+ * // tx satisfies Readonly<Transaction<BlueRepayAction>>
68
68
  * ```
69
69
  */
70
- const marketV1Repay = ({ market: { chainId, marketParams }, args: { assets, shares, transferAmount, onBehalf, receiver, maxSharePrice, requirementSignature, }, metadata, }) => {
70
+ const blueRepay = ({ market: { chainId, marketParams }, args: { assets, shares, transferAmount, onBehalf, receiver, maxSharePrice, requirementSignature, }, metadata, }) => {
71
71
  (0, index_js_2.validateRepayParams)({
72
72
  assets,
73
73
  shares,
@@ -117,7 +117,7 @@ const marketV1Repay = ({ market: { chainId, marketParams }, args: { assets, shar
117
117
  return (0, morpho_ts_1.deepFreeze)({
118
118
  ...tx,
119
119
  action: {
120
- type: "marketV1Repay",
120
+ type: "blueRepay",
121
121
  args: {
122
122
  market: marketParams.id,
123
123
  assets,
@@ -130,4 +130,4 @@ const marketV1Repay = ({ market: { chainId, marketParams }, args: { assets, shar
130
130
  },
131
131
  });
132
132
  };
133
- exports.marketV1Repay = marketV1Repay;
133
+ exports.blueRepay = blueRepay;
@@ -1,8 +1,8 @@
1
1
  import { type MarketParams } from "@morpho-org/blue-sdk";
2
2
  import { type Address } from "viem";
3
- import { type MarketV1RepayWithdrawCollateralAction, type Metadata, type RequirementSignature, type Transaction } from "../../types/index.js";
4
- /** Parameters for {@link marketV1RepayWithdrawCollateral}. */
5
- export interface MarketV1RepayWithdrawCollateralParams {
3
+ import { type BlueRepayWithdrawCollateralAction, type Metadata, type RequirementSignature, type Transaction } from "../../types/index.js";
4
+ /** Parameters for {@link blueRepayWithdrawCollateral}. */
5
+ export interface BlueRepayWithdrawCollateralParams {
6
6
  market: {
7
7
  readonly chainId: number;
8
8
  readonly marketParams: MarketParams;
@@ -68,7 +68,7 @@ export interface MarketV1RepayWithdrawCollateralParams {
68
68
  * @param params.args.requirementSignature - Optional pre-signed permit/permit2 approval for the
69
69
  * loan-token transfer.
70
70
  * @param params.metadata - Optional analytics metadata attached to the bundle.
71
- * @returns A deep-frozen `Transaction<MarketV1RepayWithdrawCollateralAction>` with `to`,
71
+ * @returns A deep-frozen `Transaction<BlueRepayWithdrawCollateralAction>` with `to`,
72
72
  * `value`, `data`, and the typed `action` discriminator the simulation layer consumes.
73
73
  * @throws {NonPositiveRepayMaxSharePriceError} when `maxSharePrice <= 0n`.
74
74
  * @throws {NonPositiveRepayAmountError} when either `assets` or `shares` is negative, or when
@@ -85,9 +85,9 @@ export interface MarketV1RepayWithdrawCollateralParams {
85
85
  * signature is missing its expiration.
86
86
  * @example
87
87
  * ```ts
88
- * import { marketV1RepayWithdrawCollateral } from "@morpho-org/morpho-sdk";
88
+ * import { blueRepayWithdrawCollateral } from "@morpho-org/morpho-sdk";
89
89
  *
90
- * const tx = marketV1RepayWithdrawCollateral({
90
+ * const tx = blueRepayWithdrawCollateral({
91
91
  * market: { chainId: 1, marketParams },
92
92
  * args: {
93
93
  * assets: 500_000_000n,
@@ -99,7 +99,7 @@ export interface MarketV1RepayWithdrawCollateralParams {
99
99
  * maxSharePrice: 1_010_000_000_000_000_000_000_000_000n, // RAY-scaled, 1.01x
100
100
  * },
101
101
  * });
102
- * // tx satisfies Readonly<Transaction<MarketV1RepayWithdrawCollateralAction>>
102
+ * // tx satisfies Readonly<Transaction<BlueRepayWithdrawCollateralAction>>
103
103
  * ```
104
104
  */
105
- export declare const marketV1RepayWithdrawCollateral: ({ market: { chainId, marketParams }, args: { assets, shares, transferAmount, withdrawAmount, onBehalf, receiver, maxSharePrice, requirementSignature, }, metadata, }: MarketV1RepayWithdrawCollateralParams) => Readonly<Transaction<MarketV1RepayWithdrawCollateralAction>>;
105
+ export declare const blueRepayWithdrawCollateral: ({ market: { chainId, marketParams }, args: { assets, shares, transferAmount, withdrawAmount, onBehalf, receiver, maxSharePrice, requirementSignature, }, metadata, }: BlueRepayWithdrawCollateralParams) => Readonly<Transaction<BlueRepayWithdrawCollateralAction>>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.marketV1RepayWithdrawCollateral = void 0;
3
+ exports.blueRepayWithdrawCollateral = void 0;
4
4
  const blue_sdk_1 = require("@morpho-org/blue-sdk");
5
5
  const morpho_ts_1 = require("@morpho-org/morpho-ts");
6
6
  const viem_1 = require("viem");
@@ -45,7 +45,7 @@ const getRequirementsAction_js_1 = require("../requirements/getRequirementsActio
45
45
  * @param params.args.requirementSignature - Optional pre-signed permit/permit2 approval for the
46
46
  * loan-token transfer.
47
47
  * @param params.metadata - Optional analytics metadata attached to the bundle.
48
- * @returns A deep-frozen `Transaction<MarketV1RepayWithdrawCollateralAction>` with `to`,
48
+ * @returns A deep-frozen `Transaction<BlueRepayWithdrawCollateralAction>` with `to`,
49
49
  * `value`, `data`, and the typed `action` discriminator the simulation layer consumes.
50
50
  * @throws {NonPositiveRepayMaxSharePriceError} when `maxSharePrice <= 0n`.
51
51
  * @throws {NonPositiveRepayAmountError} when either `assets` or `shares` is negative, or when
@@ -62,9 +62,9 @@ const getRequirementsAction_js_1 = require("../requirements/getRequirementsActio
62
62
  * signature is missing its expiration.
63
63
  * @example
64
64
  * ```ts
65
- * import { marketV1RepayWithdrawCollateral } from "@morpho-org/morpho-sdk";
65
+ * import { blueRepayWithdrawCollateral } from "@morpho-org/morpho-sdk";
66
66
  *
67
- * const tx = marketV1RepayWithdrawCollateral({
67
+ * const tx = blueRepayWithdrawCollateral({
68
68
  * market: { chainId: 1, marketParams },
69
69
  * args: {
70
70
  * assets: 500_000_000n,
@@ -76,10 +76,10 @@ const getRequirementsAction_js_1 = require("../requirements/getRequirementsActio
76
76
  * maxSharePrice: 1_010_000_000_000_000_000_000_000_000n, // RAY-scaled, 1.01x
77
77
  * },
78
78
  * });
79
- * // tx satisfies Readonly<Transaction<MarketV1RepayWithdrawCollateralAction>>
79
+ * // tx satisfies Readonly<Transaction<BlueRepayWithdrawCollateralAction>>
80
80
  * ```
81
81
  */
82
- const marketV1RepayWithdrawCollateral = ({ market: { chainId, marketParams }, args: { assets, shares, transferAmount, withdrawAmount, onBehalf, receiver, maxSharePrice, requirementSignature, }, metadata, }) => {
82
+ const blueRepayWithdrawCollateral = ({ market: { chainId, marketParams }, args: { assets, shares, transferAmount, withdrawAmount, onBehalf, receiver, maxSharePrice, requirementSignature, }, metadata, }) => {
83
83
  (0, index_js_2.validateRepayParams)({
84
84
  assets,
85
85
  shares,
@@ -137,7 +137,7 @@ const marketV1RepayWithdrawCollateral = ({ market: { chainId, marketParams }, ar
137
137
  return (0, morpho_ts_1.deepFreeze)({
138
138
  ...tx,
139
139
  action: {
140
- type: "marketV1RepayWithdrawCollateral",
140
+ type: "blueRepayWithdrawCollateral",
141
141
  args: {
142
142
  market: marketParams.id,
143
143
  repayAssets: assets,
@@ -151,4 +151,4 @@ const marketV1RepayWithdrawCollateral = ({ market: { chainId, marketParams }, ar
151
151
  },
152
152
  });
153
153
  };
154
- exports.marketV1RepayWithdrawCollateral = marketV1RepayWithdrawCollateral;
154
+ exports.blueRepayWithdrawCollateral = blueRepayWithdrawCollateral;
@@ -1,8 +1,8 @@
1
1
  import { type MarketParams } from "@morpho-org/blue-sdk";
2
2
  import type { Address } from "viem";
3
- import { type DepositAmountArgs, type MarketV1SupplyAction, type Metadata, type RequirementSignature, type Transaction } from "../../types/index.js";
4
- /** Parameters for {@link marketV1Supply}. */
5
- export interface MarketV1SupplyParams {
3
+ import { type BlueSupplyAction, type DepositAmountArgs, type Metadata, type RequirementSignature, type Transaction } from "../../types/index.js";
4
+ /** Parameters for {@link blueSupply}. */
5
+ export interface BlueSupplyParams {
6
6
  market: {
7
7
  readonly chainId: number;
8
8
  readonly marketParams: MarketParams;
@@ -38,7 +38,7 @@ export interface MarketV1SupplyParams {
38
38
  * absent, the bundle uses a plain `erc20TransferFrom` and assumes the user has already
39
39
  * approved `GeneralAdapter1`.
40
40
  * @param params.metadata - Optional analytics metadata attached to the bundle.
41
- * @returns A deep-frozen `Transaction<MarketV1SupplyAction>` with `to`, `value`, `data`, and the
41
+ * @returns A deep-frozen `Transaction<BlueSupplyAction>` with `to`, `value`, `data`, and the
42
42
  * typed `action` discriminator the simulation layer consumes.
43
43
  * @throws {NegativeSupplyAmountError} when `amount < 0n`.
44
44
  * @throws {NegativeNativeAmountError} when `nativeAmount < 0n`.
@@ -53,9 +53,9 @@ export interface MarketV1SupplyParams {
53
53
  * is provided and the signed amount differs from `args.amount`.
54
54
  * @example
55
55
  * ```ts
56
- * import { marketV1Supply } from "@morpho-org/morpho-sdk";
56
+ * import { blueSupply } from "@morpho-org/morpho-sdk";
57
57
  *
58
- * const tx = marketV1Supply({
58
+ * const tx = blueSupply({
59
59
  * market: { chainId: 1, marketParams },
60
60
  * args: {
61
61
  * amount: 1_000_000_000n,
@@ -63,7 +63,7 @@ export interface MarketV1SupplyParams {
63
63
  * maxSharePrice: 1_010_000_000_000_000_000_000_000_000n, // RAY-scaled, 1.01x
64
64
  * },
65
65
  * });
66
- * // tx satisfies Readonly<Transaction<MarketV1SupplyAction>>
66
+ * // tx satisfies Readonly<Transaction<BlueSupplyAction>>
67
67
  * ```
68
68
  */
69
- export declare const marketV1Supply: ({ market: { chainId, marketParams }, args: { amount, onBehalf, maxSharePrice, requirementSignature, nativeAmount, }, metadata, }: MarketV1SupplyParams) => Readonly<Transaction<MarketV1SupplyAction>>;
69
+ export declare const blueSupply: ({ market: { chainId, marketParams }, args: { amount, onBehalf, maxSharePrice, requirementSignature, nativeAmount, }, metadata, }: BlueSupplyParams) => Readonly<Transaction<BlueSupplyAction>>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.marketV1Supply = void 0;
3
+ exports.blueSupply = void 0;
4
4
  const blue_sdk_1 = require("@morpho-org/blue-sdk");
5
5
  const morpho_ts_1 = require("@morpho-org/morpho-ts");
6
6
  const index_js_1 = require("../../bundler/index.js");
@@ -30,7 +30,7 @@ const getRequirementsAction_js_1 = require("../requirements/getRequirementsActio
30
30
  * absent, the bundle uses a plain `erc20TransferFrom` and assumes the user has already
31
31
  * approved `GeneralAdapter1`.
32
32
  * @param params.metadata - Optional analytics metadata attached to the bundle.
33
- * @returns A deep-frozen `Transaction<MarketV1SupplyAction>` with `to`, `value`, `data`, and the
33
+ * @returns A deep-frozen `Transaction<BlueSupplyAction>` with `to`, `value`, `data`, and the
34
34
  * typed `action` discriminator the simulation layer consumes.
35
35
  * @throws {NegativeSupplyAmountError} when `amount < 0n`.
36
36
  * @throws {NegativeNativeAmountError} when `nativeAmount < 0n`.
@@ -45,9 +45,9 @@ const getRequirementsAction_js_1 = require("../requirements/getRequirementsActio
45
45
  * is provided and the signed amount differs from `args.amount`.
46
46
  * @example
47
47
  * ```ts
48
- * import { marketV1Supply } from "@morpho-org/morpho-sdk";
48
+ * import { blueSupply } from "@morpho-org/morpho-sdk";
49
49
  *
50
- * const tx = marketV1Supply({
50
+ * const tx = blueSupply({
51
51
  * market: { chainId: 1, marketParams },
52
52
  * args: {
53
53
  * amount: 1_000_000_000n,
@@ -55,10 +55,10 @@ const getRequirementsAction_js_1 = require("../requirements/getRequirementsActio
55
55
  * maxSharePrice: 1_010_000_000_000_000_000_000_000_000n, // RAY-scaled, 1.01x
56
56
  * },
57
57
  * });
58
- * // tx satisfies Readonly<Transaction<MarketV1SupplyAction>>
58
+ * // tx satisfies Readonly<Transaction<BlueSupplyAction>>
59
59
  * ```
60
60
  */
61
- const marketV1Supply = ({ market: { chainId, marketParams }, args: { amount = 0n, onBehalf, maxSharePrice, requirementSignature, nativeAmount, }, metadata, }) => {
61
+ const blueSupply = ({ market: { chainId, marketParams }, args: { amount = 0n, onBehalf, maxSharePrice, requirementSignature, nativeAmount, }, metadata, }) => {
62
62
  if (amount < 0n) {
63
63
  throw new index_js_3.NegativeSupplyAmountError(marketParams.id);
64
64
  }
@@ -114,7 +114,7 @@ const marketV1Supply = ({ market: { chainId, marketParams }, args: { amount = 0n
114
114
  return (0, morpho_ts_1.deepFreeze)({
115
115
  ...tx,
116
116
  action: {
117
- type: "marketV1Supply",
117
+ type: "blueSupply",
118
118
  args: {
119
119
  market: marketParams.id,
120
120
  amount: totalAssets,
@@ -125,4 +125,4 @@ const marketV1Supply = ({ market: { chainId, marketParams }, args: { amount = 0n
125
125
  },
126
126
  });
127
127
  };
128
- exports.marketV1Supply = marketV1Supply;
128
+ exports.blueSupply = blueSupply;
@@ -1,8 +1,8 @@
1
1
  import { type MarketParams } from "@morpho-org/blue-sdk";
2
2
  import type { Address } from "viem";
3
- import { type DepositAmountArgs, type MarketV1SupplyCollateralAction, type Metadata, type RequirementSignature, type Transaction } from "../../types/index.js";
4
- /** Parameters for {@link marketV1SupplyCollateral}. */
5
- export interface MarketV1SupplyCollateralParams {
3
+ import { type BlueSupplyCollateralAction, type DepositAmountArgs, type Metadata, type RequirementSignature, type Transaction } from "../../types/index.js";
4
+ /** Parameters for {@link blueSupplyCollateral}. */
5
+ export interface BlueSupplyCollateralParams {
6
6
  market: {
7
7
  readonly chainId: number;
8
8
  readonly marketParams: MarketParams;
@@ -33,7 +33,7 @@ export interface MarketV1SupplyCollateralParams {
33
33
  * @param params.args.nativeAmount - Optional amount of native token to wrap into wNative for the
34
34
  * supply. Requires the collateral token to be the chain's wNative.
35
35
  * @param params.metadata - Optional analytics metadata attached to the bundle.
36
- * @returns A deep-frozen `Transaction<MarketV1SupplyCollateralAction>` with `to`, `value`, `data`,
36
+ * @returns A deep-frozen `Transaction<BlueSupplyCollateralAction>` with `to`, `value`, `data`,
37
37
  * and the typed `action` discriminator the simulation layer consumes.
38
38
  * @throws {NonPositiveAssetAmountError} when `amount < 0n`.
39
39
  * @throws {NegativeNativeAmountError} when `nativeAmount < 0n`.
@@ -49,13 +49,13 @@ export interface MarketV1SupplyCollateralParams {
49
49
  * signature is missing its expiration.
50
50
  * @example
51
51
  * ```ts
52
- * import { marketV1SupplyCollateral } from "@morpho-org/morpho-sdk";
52
+ * import { blueSupplyCollateral } from "@morpho-org/morpho-sdk";
53
53
  *
54
- * const tx = marketV1SupplyCollateral({
54
+ * const tx = blueSupplyCollateral({
55
55
  * market: { chainId: 1, marketParams },
56
56
  * args: { amount: 1_000_000_000_000_000_000n, onBehalf },
57
57
  * });
58
- * // tx satisfies Readonly<Transaction<MarketV1SupplyCollateralAction>>
58
+ * // tx satisfies Readonly<Transaction<BlueSupplyCollateralAction>>
59
59
  * ```
60
60
  */
61
- export declare const marketV1SupplyCollateral: ({ market: { chainId, marketParams }, args: { amount, onBehalf, requirementSignature, nativeAmount }, metadata, }: MarketV1SupplyCollateralParams) => Readonly<Transaction<MarketV1SupplyCollateralAction>>;
61
+ export declare const blueSupplyCollateral: ({ market: { chainId, marketParams }, args: { amount, onBehalf, requirementSignature, nativeAmount }, metadata, }: BlueSupplyCollateralParams) => Readonly<Transaction<BlueSupplyCollateralAction>>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.marketV1SupplyCollateral = void 0;
3
+ exports.blueSupplyCollateral = void 0;
4
4
  const blue_sdk_1 = require("@morpho-org/blue-sdk");
5
5
  const morpho_ts_1 = require("@morpho-org/morpho-ts");
6
6
  const index_js_1 = require("../../bundler/index.js");
@@ -27,7 +27,7 @@ const getRequirementsAction_js_1 = require("../requirements/getRequirementsActio
27
27
  * @param params.args.nativeAmount - Optional amount of native token to wrap into wNative for the
28
28
  * supply. Requires the collateral token to be the chain's wNative.
29
29
  * @param params.metadata - Optional analytics metadata attached to the bundle.
30
- * @returns A deep-frozen `Transaction<MarketV1SupplyCollateralAction>` with `to`, `value`, `data`,
30
+ * @returns A deep-frozen `Transaction<BlueSupplyCollateralAction>` with `to`, `value`, `data`,
31
31
  * and the typed `action` discriminator the simulation layer consumes.
32
32
  * @throws {NonPositiveAssetAmountError} when `amount < 0n`.
33
33
  * @throws {NegativeNativeAmountError} when `nativeAmount < 0n`.
@@ -43,16 +43,16 @@ const getRequirementsAction_js_1 = require("../requirements/getRequirementsActio
43
43
  * signature is missing its expiration.
44
44
  * @example
45
45
  * ```ts
46
- * import { marketV1SupplyCollateral } from "@morpho-org/morpho-sdk";
46
+ * import { blueSupplyCollateral } from "@morpho-org/morpho-sdk";
47
47
  *
48
- * const tx = marketV1SupplyCollateral({
48
+ * const tx = blueSupplyCollateral({
49
49
  * market: { chainId: 1, marketParams },
50
50
  * args: { amount: 1_000_000_000_000_000_000n, onBehalf },
51
51
  * });
52
- * // tx satisfies Readonly<Transaction<MarketV1SupplyCollateralAction>>
52
+ * // tx satisfies Readonly<Transaction<BlueSupplyCollateralAction>>
53
53
  * ```
54
54
  */
55
- const marketV1SupplyCollateral = ({ market: { chainId, marketParams }, args: { amount = 0n, onBehalf, requirementSignature, nativeAmount }, metadata, }) => {
55
+ const blueSupplyCollateral = ({ market: { chainId, marketParams }, args: { amount = 0n, onBehalf, requirementSignature, nativeAmount }, metadata, }) => {
56
56
  if (amount < 0n) {
57
57
  throw new index_js_3.NonPositiveAssetAmountError(marketParams.collateralToken);
58
58
  }
@@ -102,7 +102,7 @@ const marketV1SupplyCollateral = ({ market: { chainId, marketParams }, args: { a
102
102
  return (0, morpho_ts_1.deepFreeze)({
103
103
  ...tx,
104
104
  action: {
105
- type: "marketV1SupplyCollateral",
105
+ type: "blueSupplyCollateral",
106
106
  args: {
107
107
  market: marketParams.id,
108
108
  amount: totalCollateral,
@@ -112,4 +112,4 @@ const marketV1SupplyCollateral = ({ market: { chainId, marketParams }, args: { a
112
112
  },
113
113
  });
114
114
  };
115
- exports.marketV1SupplyCollateral = marketV1SupplyCollateral;
115
+ exports.blueSupplyCollateral = blueSupplyCollateral;
@@ -1,8 +1,8 @@
1
1
  import { type MarketParams } from "@morpho-org/blue-sdk";
2
2
  import type { Address } from "viem";
3
- import { type DepositAmountArgs, type MarketV1SupplyCollateralBorrowAction, type Metadata, type RequirementSignature, type Transaction, type VaultReallocation } from "../../types/index.js";
4
- /** Parameters for {@link marketV1SupplyCollateralBorrow}. */
5
- export interface MarketV1SupplyCollateralBorrowParams {
3
+ import { type BlueSupplyCollateralBorrowAction, type DepositAmountArgs, type Metadata, type RequirementSignature, type Transaction, type VaultReallocation } from "../../types/index.js";
4
+ /** Parameters for {@link blueSupplyCollateralBorrow}. */
5
+ export interface BlueSupplyCollateralBorrowParams {
6
6
  market: {
7
7
  readonly chainId: number;
8
8
  readonly marketParams: MarketParams;
@@ -47,7 +47,7 @@ export interface MarketV1SupplyCollateralBorrowParams {
47
47
  * @param params.args.reallocations - Optional vault reallocations to execute between the supply
48
48
  * and borrow legs, computed by the entity layer.
49
49
  * @param params.metadata - Optional analytics metadata attached to the bundle.
50
- * @returns A deep-frozen `Transaction<MarketV1SupplyCollateralBorrowAction>` with `to`, `value`,
50
+ * @returns A deep-frozen `Transaction<BlueSupplyCollateralBorrowAction>` with `to`, `value`,
51
51
  * `data`, and the typed `action` discriminator the simulation layer consumes.
52
52
  * @throws {NonPositiveAssetAmountError} when `amount < 0n`.
53
53
  * @throws {NegativeNativeAmountError} when `nativeAmount < 0n`.
@@ -75,9 +75,9 @@ export interface MarketV1SupplyCollateralBorrowParams {
75
75
  * reallocation withdrawals are not strictly sorted by market id.
76
76
  * @example
77
77
  * ```ts
78
- * import { marketV1SupplyCollateralBorrow } from "@morpho-org/morpho-sdk";
78
+ * import { blueSupplyCollateralBorrow } from "@morpho-org/morpho-sdk";
79
79
  *
80
- * const tx = marketV1SupplyCollateralBorrow({
80
+ * const tx = blueSupplyCollateralBorrow({
81
81
  * market: { chainId: 1, marketParams },
82
82
  * args: {
83
83
  * amount: 1_000_000_000_000_000_000n,
@@ -87,7 +87,7 @@ export interface MarketV1SupplyCollateralBorrowParams {
87
87
  * minSharePrice: 0n, // disables slippage protection — production code should compute via `computeMinBorrowSharePrice` from market state + slippage tolerance
88
88
  * },
89
89
  * });
90
- * // tx satisfies Readonly<Transaction<MarketV1SupplyCollateralBorrowAction>>
90
+ * // tx satisfies Readonly<Transaction<BlueSupplyCollateralBorrowAction>>
91
91
  * ```
92
92
  */
93
- export declare const marketV1SupplyCollateralBorrow: ({ market: { chainId, marketParams }, args: { amount, borrowAmount, onBehalf, receiver, minSharePrice, requirementSignature, nativeAmount, reallocations, }, metadata, }: MarketV1SupplyCollateralBorrowParams) => Readonly<Transaction<MarketV1SupplyCollateralBorrowAction>>;
93
+ export declare const blueSupplyCollateralBorrow: ({ market: { chainId, marketParams }, args: { amount, borrowAmount, onBehalf, receiver, minSharePrice, requirementSignature, nativeAmount, reallocations, }, metadata, }: BlueSupplyCollateralBorrowParams) => Readonly<Transaction<BlueSupplyCollateralBorrowAction>>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.marketV1SupplyCollateralBorrow = void 0;
3
+ exports.blueSupplyCollateralBorrow = void 0;
4
4
  const blue_sdk_1 = require("@morpho-org/blue-sdk");
5
5
  const morpho_ts_1 = require("@morpho-org/morpho-ts");
6
6
  const index_js_1 = require("../../bundler/index.js");
@@ -36,7 +36,7 @@ const buildReallocationActions_js_1 = require("./buildReallocationActions.js");
36
36
  * @param params.args.reallocations - Optional vault reallocations to execute between the supply
37
37
  * and borrow legs, computed by the entity layer.
38
38
  * @param params.metadata - Optional analytics metadata attached to the bundle.
39
- * @returns A deep-frozen `Transaction<MarketV1SupplyCollateralBorrowAction>` with `to`, `value`,
39
+ * @returns A deep-frozen `Transaction<BlueSupplyCollateralBorrowAction>` with `to`, `value`,
40
40
  * `data`, and the typed `action` discriminator the simulation layer consumes.
41
41
  * @throws {NonPositiveAssetAmountError} when `amount < 0n`.
42
42
  * @throws {NegativeNativeAmountError} when `nativeAmount < 0n`.
@@ -64,9 +64,9 @@ const buildReallocationActions_js_1 = require("./buildReallocationActions.js");
64
64
  * reallocation withdrawals are not strictly sorted by market id.
65
65
  * @example
66
66
  * ```ts
67
- * import { marketV1SupplyCollateralBorrow } from "@morpho-org/morpho-sdk";
67
+ * import { blueSupplyCollateralBorrow } from "@morpho-org/morpho-sdk";
68
68
  *
69
- * const tx = marketV1SupplyCollateralBorrow({
69
+ * const tx = blueSupplyCollateralBorrow({
70
70
  * market: { chainId: 1, marketParams },
71
71
  * args: {
72
72
  * amount: 1_000_000_000_000_000_000n,
@@ -76,10 +76,10 @@ const buildReallocationActions_js_1 = require("./buildReallocationActions.js");
76
76
  * minSharePrice: 0n, // disables slippage protection — production code should compute via `computeMinBorrowSharePrice` from market state + slippage tolerance
77
77
  * },
78
78
  * });
79
- * // tx satisfies Readonly<Transaction<MarketV1SupplyCollateralBorrowAction>>
79
+ * // tx satisfies Readonly<Transaction<BlueSupplyCollateralBorrowAction>>
80
80
  * ```
81
81
  */
82
- const marketV1SupplyCollateralBorrow = ({ market: { chainId, marketParams }, args: { amount = 0n, borrowAmount, onBehalf, receiver, minSharePrice, requirementSignature, nativeAmount, reallocations, }, metadata, }) => {
82
+ const blueSupplyCollateralBorrow = ({ market: { chainId, marketParams }, args: { amount = 0n, borrowAmount, onBehalf, receiver, minSharePrice, requirementSignature, nativeAmount, reallocations, }, metadata, }) => {
83
83
  if (amount < 0n) {
84
84
  throw new index_js_3.NonPositiveAssetAmountError(marketParams.collateralToken);
85
85
  }
@@ -145,7 +145,7 @@ const marketV1SupplyCollateralBorrow = ({ market: { chainId, marketParams }, arg
145
145
  return (0, morpho_ts_1.deepFreeze)({
146
146
  ...tx,
147
147
  action: {
148
- type: "marketV1SupplyCollateralBorrow",
148
+ type: "blueSupplyCollateralBorrow",
149
149
  args: {
150
150
  market: marketParams.id,
151
151
  collateralAmount: totalCollateral,
@@ -159,4 +159,4 @@ const marketV1SupplyCollateralBorrow = ({ market: { chainId, marketParams }, arg
159
159
  },
160
160
  });
161
161
  };
162
- exports.marketV1SupplyCollateralBorrow = marketV1SupplyCollateralBorrow;
162
+ exports.blueSupplyCollateralBorrow = blueSupplyCollateralBorrow;
@@ -1,8 +1,8 @@
1
1
  import type { MarketParams } from "@morpho-org/blue-sdk";
2
2
  import type { Address } from "viem";
3
- import { type MarketV1WithdrawAction, type Metadata, type Transaction, type VaultReallocation } from "../../types/index.js";
4
- /** Parameters for {@link marketV1Withdraw}. */
5
- export interface MarketV1WithdrawParams {
3
+ import { type BlueWithdrawAction, type Metadata, type Transaction, type VaultReallocation } from "../../types/index.js";
4
+ /** Parameters for {@link blueWithdraw}. */
5
+ export interface BlueWithdrawParams {
6
6
  market: {
7
7
  readonly chainId: number;
8
8
  readonly marketParams: MarketParams;
@@ -18,7 +18,7 @@ export interface MarketV1WithdrawParams {
18
18
  minSharePrice: bigint;
19
19
  /**
20
20
  * Vault reallocations to execute before withdrawing. Compute via
21
- * `MorphoMarketV1.getReallocations({ operation: "withdraw", amount })` or directly via
21
+ * `MorphoBlue.getReallocations({ operation: "withdraw", amount })` or directly via
22
22
  * `computeReallocations({ operation: "withdraw", amount, ... })`.
23
23
  */
24
24
  reallocations?: readonly VaultReallocation[];
@@ -40,7 +40,7 @@ export interface MarketV1WithdrawParams {
40
40
  * computed on-chain directly to `receiver`; no skim is required.
41
41
  *
42
42
  * The withdraw is performed on behalf of the transaction initiator (signer) — there is no
43
- * separate `onBehalf` field; mirror `marketV1Borrow`. The entity layer keeps `receiver` aligned
43
+ * separate `onBehalf` field; mirror `blueBorrow`. The entity layer keeps `receiver` aligned
44
44
  * with the user when none is provided. Requires the user to have authorized `GeneralAdapter1`
45
45
  * on Morpho.
46
46
  *
@@ -54,21 +54,21 @@ export interface MarketV1WithdrawParams {
54
54
  * @param params.args.reallocations - Optional vault reallocations to execute before withdrawing,
55
55
  * computed by the entity layer.
56
56
  * @param params.metadata - Optional analytics metadata attached to the bundle.
57
- * @returns A deep-frozen `Transaction<MarketV1WithdrawAction>` with `to`, `value`, `data`, and
57
+ * @returns A deep-frozen `Transaction<BlueWithdrawAction>` with `to`, `value`, `data`, and
58
58
  * the typed `action` discriminator the simulation layer consumes.
59
59
  * @throws {NonPositiveWithdrawAmountError} when both `assets` and `shares` are zero, or either is negative.
60
60
  * @throws {MutuallyExclusiveWithdrawAmountsError} when both `assets` and `shares` are non-zero.
61
61
  * @throws {NegativeWithdrawMinSharePriceError} when `minSharePrice < 0n` (zero is allowed despite
62
- * the class name — pattern preserved for symmetry with `marketV1Borrow`).
62
+ * the class name — pattern preserved for symmetry with `blueBorrow`).
63
63
  * @throws Reallocation errors from `buildReallocationActions` when `reallocations` is malformed
64
64
  * (see its JSDoc: `NegativeReallocationFeeError`, `EmptyReallocationWithdrawalsError`,
65
65
  * `NonPositiveReallocationAmountError`, `ReallocationWithdrawalOnTargetMarketError`,
66
66
  * `UnsortedReallocationWithdrawalsError`).
67
67
  * @example
68
68
  * ```ts
69
- * import { marketV1Withdraw } from "@morpho-org/morpho-sdk";
69
+ * import { blueWithdraw } from "@morpho-org/morpho-sdk";
70
70
  *
71
- * const tx = marketV1Withdraw({
71
+ * const tx = blueWithdraw({
72
72
  * market: { chainId: 1, marketParams },
73
73
  * args: {
74
74
  * assets: 1_000_000_000n,
@@ -77,7 +77,7 @@ export interface MarketV1WithdrawParams {
77
77
  * minSharePrice: 0n, // disables slippage protection — production code should compute via `computeMinWithdrawSharePrice` from market state + slippage tolerance
78
78
  * },
79
79
  * });
80
- * // tx satisfies Readonly<Transaction<MarketV1WithdrawAction>>
80
+ * // tx satisfies Readonly<Transaction<BlueWithdrawAction>>
81
81
  * ```
82
82
  */
83
- export declare const marketV1Withdraw: ({ market: { chainId, marketParams }, args: { assets, shares, receiver, minSharePrice, reallocations }, metadata, }: MarketV1WithdrawParams) => Readonly<Transaction<MarketV1WithdrawAction>>;
83
+ export declare const blueWithdraw: ({ market: { chainId, marketParams }, args: { assets, shares, receiver, minSharePrice, reallocations }, metadata, }: BlueWithdrawParams) => Readonly<Transaction<BlueWithdrawAction>>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.marketV1Withdraw = void 0;
3
+ exports.blueWithdraw = void 0;
4
4
  const morpho_ts_1 = require("@morpho-org/morpho-ts");
5
5
  const index_js_1 = require("../../bundler/index.js");
6
6
  const index_js_2 = require("../../helpers/index.js");
@@ -21,7 +21,7 @@ const buildReallocationActions_js_1 = require("./buildReallocationActions.js");
21
21
  * computed on-chain directly to `receiver`; no skim is required.
22
22
  *
23
23
  * The withdraw is performed on behalf of the transaction initiator (signer) — there is no
24
- * separate `onBehalf` field; mirror `marketV1Borrow`. The entity layer keeps `receiver` aligned
24
+ * separate `onBehalf` field; mirror `blueBorrow`. The entity layer keeps `receiver` aligned
25
25
  * with the user when none is provided. Requires the user to have authorized `GeneralAdapter1`
26
26
  * on Morpho.
27
27
  *
@@ -35,21 +35,21 @@ const buildReallocationActions_js_1 = require("./buildReallocationActions.js");
35
35
  * @param params.args.reallocations - Optional vault reallocations to execute before withdrawing,
36
36
  * computed by the entity layer.
37
37
  * @param params.metadata - Optional analytics metadata attached to the bundle.
38
- * @returns A deep-frozen `Transaction<MarketV1WithdrawAction>` with `to`, `value`, `data`, and
38
+ * @returns A deep-frozen `Transaction<BlueWithdrawAction>` with `to`, `value`, `data`, and
39
39
  * the typed `action` discriminator the simulation layer consumes.
40
40
  * @throws {NonPositiveWithdrawAmountError} when both `assets` and `shares` are zero, or either is negative.
41
41
  * @throws {MutuallyExclusiveWithdrawAmountsError} when both `assets` and `shares` are non-zero.
42
42
  * @throws {NegativeWithdrawMinSharePriceError} when `minSharePrice < 0n` (zero is allowed despite
43
- * the class name — pattern preserved for symmetry with `marketV1Borrow`).
43
+ * the class name — pattern preserved for symmetry with `blueBorrow`).
44
44
  * @throws Reallocation errors from `buildReallocationActions` when `reallocations` is malformed
45
45
  * (see its JSDoc: `NegativeReallocationFeeError`, `EmptyReallocationWithdrawalsError`,
46
46
  * `NonPositiveReallocationAmountError`, `ReallocationWithdrawalOnTargetMarketError`,
47
47
  * `UnsortedReallocationWithdrawalsError`).
48
48
  * @example
49
49
  * ```ts
50
- * import { marketV1Withdraw } from "@morpho-org/morpho-sdk";
50
+ * import { blueWithdraw } from "@morpho-org/morpho-sdk";
51
51
  *
52
- * const tx = marketV1Withdraw({
52
+ * const tx = blueWithdraw({
53
53
  * market: { chainId: 1, marketParams },
54
54
  * args: {
55
55
  * assets: 1_000_000_000n,
@@ -58,10 +58,10 @@ const buildReallocationActions_js_1 = require("./buildReallocationActions.js");
58
58
  * minSharePrice: 0n, // disables slippage protection — production code should compute via `computeMinWithdrawSharePrice` from market state + slippage tolerance
59
59
  * },
60
60
  * });
61
- * // tx satisfies Readonly<Transaction<MarketV1WithdrawAction>>
61
+ * // tx satisfies Readonly<Transaction<BlueWithdrawAction>>
62
62
  * ```
63
63
  */
64
- const marketV1Withdraw = ({ market: { chainId, marketParams }, args: { assets, shares, receiver, minSharePrice, reallocations }, metadata, }) => {
64
+ const blueWithdraw = ({ market: { chainId, marketParams }, args: { assets, shares, receiver, minSharePrice, reallocations }, metadata, }) => {
65
65
  // Mutual exclusion is detected on "both values present" (either non-zero),
66
66
  // before sign checks — otherwise `{ assets: -1n, shares: 5n }` would be
67
67
  // misreported as a positivity error rather than the actual mode conflict.
@@ -95,7 +95,7 @@ const marketV1Withdraw = ({ market: { chainId, marketParams }, args: { assets, s
95
95
  return (0, morpho_ts_1.deepFreeze)({
96
96
  ...tx,
97
97
  action: {
98
- type: "marketV1Withdraw",
98
+ type: "blueWithdraw",
99
99
  args: {
100
100
  market: marketParams.id,
101
101
  assets,
@@ -107,4 +107,4 @@ const marketV1Withdraw = ({ market: { chainId, marketParams }, args: { assets, s
107
107
  },
108
108
  });
109
109
  };
110
- exports.marketV1Withdraw = marketV1Withdraw;
110
+ exports.blueWithdraw = blueWithdraw;
@@ -1,8 +1,8 @@
1
1
  import { type MarketParams } from "@morpho-org/blue-sdk";
2
2
  import { type Address } from "viem";
3
- import { type MarketV1WithdrawCollateralAction, type Metadata, type Transaction } from "../../types/index.js";
4
- /** Parameters for {@link marketV1WithdrawCollateral}. */
5
- export interface MarketV1WithdrawCollateralParams {
3
+ import { type BlueWithdrawCollateralAction, type Metadata, type Transaction } from "../../types/index.js";
4
+ /** Parameters for {@link blueWithdrawCollateral}. */
5
+ export interface BlueWithdrawCollateralParams {
6
6
  market: {
7
7
  readonly chainId: number;
8
8
  readonly marketParams: MarketParams;
@@ -28,14 +28,14 @@ export interface MarketV1WithdrawCollateralParams {
28
28
  * @param params.args.onBehalf - Address whose Morpho position the collateral is withdrawn from.
29
29
  * @param params.args.receiver - Address that receives the withdrawn collateral.
30
30
  * @param params.metadata - Optional analytics metadata attached to the transaction.
31
- * @returns A deep-frozen `Transaction<MarketV1WithdrawCollateralAction>` with `to`, `value`,
31
+ * @returns A deep-frozen `Transaction<BlueWithdrawCollateralAction>` with `to`, `value`,
32
32
  * `data`, and the typed `action` discriminator the simulation layer consumes.
33
33
  * @throws {NonPositiveWithdrawCollateralAmountError} when `amount <= 0n`.
34
34
  * @example
35
35
  * ```ts
36
- * import { marketV1WithdrawCollateral } from "@morpho-org/morpho-sdk";
36
+ * import { blueWithdrawCollateral } from "@morpho-org/morpho-sdk";
37
37
  *
38
- * const tx = marketV1WithdrawCollateral({
38
+ * const tx = blueWithdrawCollateral({
39
39
  * market: { chainId: 1, marketParams },
40
40
  * args: {
41
41
  * amount: 1_000_000_000_000_000_000n,
@@ -43,7 +43,7 @@ export interface MarketV1WithdrawCollateralParams {
43
43
  * receiver: borrower,
44
44
  * },
45
45
  * });
46
- * // tx satisfies Readonly<Transaction<MarketV1WithdrawCollateralAction>>
46
+ * // tx satisfies Readonly<Transaction<BlueWithdrawCollateralAction>>
47
47
  * ```
48
48
  */
49
- export declare const marketV1WithdrawCollateral: ({ market: { chainId, marketParams }, args: { amount, onBehalf, receiver }, metadata, }: MarketV1WithdrawCollateralParams) => Readonly<Transaction<MarketV1WithdrawCollateralAction>>;
49
+ export declare const blueWithdrawCollateral: ({ market: { chainId, marketParams }, args: { amount, onBehalf, receiver }, metadata, }: BlueWithdrawCollateralParams) => Readonly<Transaction<BlueWithdrawCollateralAction>>;