@morpho-org/morpho-sdk 3.2.0 → 4.1.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 +19 -16
  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/{esm/actions/marketV1 → cjs/actions/blue}/refinance.d.ts +8 -8
  7. package/lib/cjs/actions/{marketV1 → blue}/refinance.js +8 -8
  8. package/lib/{esm/actions/marketV1 → cjs/actions/blue}/repay.d.ts +8 -8
  9. package/lib/cjs/actions/{marketV1 → blue}/repay.js +8 -8
  10. package/lib/{esm/actions/marketV1 → cjs/actions/blue}/repayWithdrawCollateral.d.ts +8 -8
  11. package/lib/cjs/actions/{marketV1 → blue}/repayWithdrawCollateral.js +8 -8
  12. package/lib/cjs/actions/{marketV1 → blue}/supply.d.ts +8 -8
  13. package/lib/cjs/actions/{marketV1 → blue}/supply.js +8 -8
  14. package/lib/cjs/actions/{marketV1 → blue}/supplyCollateral.d.ts +8 -8
  15. package/lib/cjs/actions/{marketV1 → blue}/supplyCollateral.js +8 -8
  16. package/lib/{esm/actions/marketV1 → cjs/actions/blue}/supplyCollateralBorrow.d.ts +8 -8
  17. package/lib/cjs/actions/{marketV1 → blue}/supplyCollateralBorrow.js +8 -8
  18. package/lib/{esm/actions/marketV1 → cjs/actions/blue}/withdraw.d.ts +11 -11
  19. package/lib/cjs/actions/{marketV1 → blue}/withdraw.js +10 -10
  20. package/lib/{esm/actions/marketV1 → cjs/actions/blue}/withdrawCollateral.d.ts +8 -8
  21. package/lib/cjs/actions/{marketV1 → blue}/withdrawCollateral.js +8 -8
  22. package/lib/cjs/actions/index.d.ts +2 -2
  23. package/lib/cjs/actions/index.js +1 -1
  24. package/lib/cjs/actions/requirements/getMorphoAuthorizationRequirement.d.ts +1 -1
  25. package/lib/cjs/actions/requirements/getMorphoAuthorizationRequirement.js +1 -1
  26. package/lib/cjs/client/index.d.ts +0 -1
  27. package/lib/cjs/client/index.js +0 -1
  28. package/lib/cjs/client/morphoViemExtension.d.ts +17 -11
  29. package/lib/cjs/client/morphoViemExtension.js +55 -10
  30. package/lib/cjs/entities/{marketV1/marketV1.d.ts → blue/blue.d.ts} +22 -22
  31. package/lib/cjs/entities/{marketV1/marketV1.js → blue/blue.js} +12 -12
  32. package/lib/cjs/entities/blue/index.d.ts +1 -0
  33. package/lib/cjs/entities/{marketV1 → blue}/index.js +1 -1
  34. package/lib/cjs/entities/index.d.ts +1 -1
  35. package/lib/cjs/entities/index.js +3 -3
  36. package/lib/cjs/entities/reallocationData.d.ts +96 -2
  37. package/lib/cjs/entities/reallocationData.js +112 -1
  38. package/lib/cjs/entities/vaultV2/vaultV2.js +1 -1
  39. package/lib/cjs/helpers/computeReallocations.d.ts +1 -1
  40. package/lib/cjs/helpers/computeReallocations.js +3 -5
  41. package/lib/cjs/helpers/utilization.d.ts +12 -0
  42. package/lib/cjs/helpers/utilization.js +17 -0
  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 +10 -10
  46. package/lib/cjs/types/client.d.ts +5 -4
  47. package/lib/esm/actions/{marketV1 → blue}/borrow.d.ts +8 -8
  48. package/lib/esm/actions/{marketV1 → blue}/borrow.js +6 -6
  49. package/lib/{cjs/actions/marketV1 → esm/actions/blue}/buildReallocationActions.d.ts +1 -1
  50. package/lib/esm/actions/{marketV1 → blue}/buildReallocationActions.js +1 -1
  51. package/lib/{cjs/actions/marketV1 → esm/actions/blue}/refinance.d.ts +8 -8
  52. package/lib/esm/actions/{marketV1 → blue}/refinance.js +6 -6
  53. package/lib/{cjs/actions/marketV1 → esm/actions/blue}/repay.d.ts +8 -8
  54. package/lib/esm/actions/{marketV1 → blue}/repay.js +6 -6
  55. package/lib/{cjs/actions/marketV1 → esm/actions/blue}/repayWithdrawCollateral.d.ts +8 -8
  56. package/lib/esm/actions/{marketV1 → blue}/repayWithdrawCollateral.js +6 -6
  57. package/lib/esm/actions/{marketV1 → blue}/supply.d.ts +8 -8
  58. package/lib/esm/actions/{marketV1 → blue}/supply.js +6 -6
  59. package/lib/esm/actions/{marketV1 → blue}/supplyCollateral.d.ts +8 -8
  60. package/lib/esm/actions/{marketV1 → blue}/supplyCollateral.js +6 -6
  61. package/lib/{cjs/actions/marketV1 → esm/actions/blue}/supplyCollateralBorrow.d.ts +8 -8
  62. package/lib/esm/actions/{marketV1 → blue}/supplyCollateralBorrow.js +6 -6
  63. package/lib/{cjs/actions/marketV1 → esm/actions/blue}/withdraw.d.ts +11 -11
  64. package/lib/esm/actions/{marketV1 → blue}/withdraw.js +8 -8
  65. package/lib/{cjs/actions/marketV1 → esm/actions/blue}/withdrawCollateral.d.ts +8 -8
  66. package/lib/esm/actions/{marketV1 → blue}/withdrawCollateral.js +6 -6
  67. package/lib/esm/actions/index.d.ts +2 -2
  68. package/lib/esm/actions/index.js +1 -1
  69. package/lib/esm/actions/requirements/getMorphoAuthorizationRequirement.d.ts +1 -1
  70. package/lib/esm/actions/requirements/getMorphoAuthorizationRequirement.js +1 -1
  71. package/lib/esm/client/index.d.ts +0 -1
  72. package/lib/esm/client/index.js +0 -1
  73. package/lib/esm/client/morphoViemExtension.d.ts +17 -11
  74. package/lib/esm/client/morphoViemExtension.js +55 -10
  75. package/lib/esm/entities/{marketV1/marketV1.d.ts → blue/blue.d.ts} +22 -22
  76. package/lib/esm/entities/{marketV1/marketV1.js → blue/blue.js} +11 -11
  77. package/lib/esm/entities/blue/index.d.ts +1 -0
  78. package/lib/esm/entities/blue/index.js +1 -0
  79. package/lib/esm/entities/index.d.ts +1 -1
  80. package/lib/esm/entities/index.js +1 -1
  81. package/lib/esm/entities/reallocationData.d.ts +96 -2
  82. package/lib/esm/entities/reallocationData.js +114 -3
  83. package/lib/esm/entities/vaultV2/vaultV2.js +1 -1
  84. package/lib/esm/helpers/computeReallocations.d.ts +1 -1
  85. package/lib/esm/helpers/computeReallocations.js +3 -5
  86. package/lib/esm/helpers/utilization.d.ts +12 -0
  87. package/lib/esm/helpers/utilization.js +13 -0
  88. package/lib/esm/helpers/validate.d.ts +2 -2
  89. package/lib/esm/helpers/validate.js +2 -2
  90. package/lib/esm/types/action.d.ts +10 -10
  91. package/lib/esm/types/client.d.ts +5 -4
  92. package/package.json +5 -5
  93. package/lib/cjs/client/morphoClient.d.ts +0 -152
  94. package/lib/cjs/client/morphoClient.js +0 -162
  95. package/lib/cjs/entities/marketV1/index.d.ts +0 -1
  96. package/lib/esm/client/morphoClient.d.ts +0 -152
  97. package/lib/esm/client/morphoClient.js +0 -158
  98. package/lib/esm/entities/marketV1/index.d.ts +0 -1
  99. package/lib/esm/entities/marketV1/index.js +0 -1
  100. /package/lib/cjs/actions/{marketV1 → blue}/index.d.ts +0 -0
  101. /package/lib/cjs/actions/{marketV1 → blue}/index.js +0 -0
  102. /package/lib/esm/actions/{marketV1 → blue}/index.d.ts +0 -0
  103. /package/lib/esm/actions/{marketV1 → blue}/index.js +0 -0
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getSupplyTargetUtilization = void 0;
4
+ const constant_js_1 = require("./constant.js");
5
+ /**
6
+ * Resolves the effective supply target utilization for a market: the per-market
7
+ * override, then the global default override, then
8
+ * {@link DEFAULT_SUPPLY_TARGET_UTILIZATION}.
9
+ *
10
+ * @param marketId - The market whose supply target utilization to resolve.
11
+ * @param options - Reallocation options carrying the per-market and default overrides.
12
+ * @returns The supply target utilization, scaled by WAD.
13
+ */
14
+ const getSupplyTargetUtilization = (marketId, options) => options?.supplyTargetUtilization?.[marketId] ??
15
+ options?.defaultSupplyTargetUtilization ??
16
+ constant_js_1.DEFAULT_SUPPLY_TARGET_UTILIZATION;
17
+ exports.getSupplyTargetUtilization = getSupplyTargetUtilization;
@@ -122,8 +122,8 @@ export declare const validateRepayShares: (params: {
122
122
  marketId: MarketId;
123
123
  }) => void;
124
124
  /**
125
- * Validates the common repay input parameters shared by `marketV1Repay`
126
- * and `marketV1RepayWithdrawCollateral`.
125
+ * Validates the common repay input parameters shared by `blueRepay`
126
+ * and `blueRepayWithdrawCollateral`.
127
127
  *
128
128
  * @param params - Validation parameters.
129
129
  * @param params.assets - Repay assets amount (0n when repaying by shares).
@@ -212,8 +212,8 @@ const validateRepayShares = (params) => {
212
212
  };
213
213
  exports.validateRepayShares = validateRepayShares;
214
214
  /**
215
- * Validates the common repay input parameters shared by `marketV1Repay`
216
- * and `marketV1RepayWithdrawCollateral`.
215
+ * Validates the common repay input parameters shared by `blueRepay`
216
+ * and `blueRepayWithdrawCollateral`.
217
217
  *
218
218
  * @param params - Validation parameters.
219
219
  * @param params.assets - Repay assets amount (0n when repaying by shares).
@@ -81,7 +81,7 @@ export interface VaultV1MigrateToV2Action extends BaseAction<"vaultV1MigrateToV2
81
81
  recipient: Address;
82
82
  }> {
83
83
  }
84
- export interface MarketV1SupplyAction extends BaseAction<"marketV1Supply", {
84
+ export interface BlueSupplyAction extends BaseAction<"blueSupply", {
85
85
  market: Hex;
86
86
  amount: bigint;
87
87
  onBehalf: Address;
@@ -89,7 +89,7 @@ export interface MarketV1SupplyAction extends BaseAction<"marketV1Supply", {
89
89
  nativeAmount?: bigint;
90
90
  }> {
91
91
  }
92
- export interface MarketV1WithdrawAction extends BaseAction<"marketV1Withdraw", {
92
+ export interface BlueWithdrawAction extends BaseAction<"blueWithdraw", {
93
93
  market: Hex;
94
94
  assets: bigint;
95
95
  shares: bigint;
@@ -98,14 +98,14 @@ export interface MarketV1WithdrawAction extends BaseAction<"marketV1Withdraw", {
98
98
  reallocationFee: bigint;
99
99
  }> {
100
100
  }
101
- export interface MarketV1SupplyCollateralAction extends BaseAction<"marketV1SupplyCollateral", {
101
+ export interface BlueSupplyCollateralAction extends BaseAction<"blueSupplyCollateral", {
102
102
  market: Hex;
103
103
  amount: bigint;
104
104
  onBehalf: Address;
105
105
  nativeAmount?: bigint;
106
106
  }> {
107
107
  }
108
- export interface MarketV1BorrowAction extends BaseAction<"marketV1Borrow", {
108
+ export interface BlueBorrowAction extends BaseAction<"blueBorrow", {
109
109
  market: Hex;
110
110
  amount: bigint;
111
111
  receiver: Address;
@@ -113,7 +113,7 @@ export interface MarketV1BorrowAction extends BaseAction<"marketV1Borrow", {
113
113
  reallocationFee: bigint;
114
114
  }> {
115
115
  }
116
- export interface MarketV1SupplyCollateralBorrowAction extends BaseAction<"marketV1SupplyCollateralBorrow", {
116
+ export interface BlueSupplyCollateralBorrowAction extends BaseAction<"blueSupplyCollateralBorrow", {
117
117
  market: Hex;
118
118
  collateralAmount: bigint;
119
119
  borrowAmount: bigint;
@@ -124,7 +124,7 @@ export interface MarketV1SupplyCollateralBorrowAction extends BaseAction<"market
124
124
  reallocationFee: bigint;
125
125
  }> {
126
126
  }
127
- export interface MarketV1RepayAction extends BaseAction<"marketV1Repay", {
127
+ export interface BlueRepayAction extends BaseAction<"blueRepay", {
128
128
  market: Hex;
129
129
  assets: bigint;
130
130
  shares: bigint;
@@ -134,14 +134,14 @@ export interface MarketV1RepayAction extends BaseAction<"marketV1Repay", {
134
134
  maxSharePrice: bigint;
135
135
  }> {
136
136
  }
137
- export interface MarketV1WithdrawCollateralAction extends BaseAction<"marketV1WithdrawCollateral", {
137
+ export interface BlueWithdrawCollateralAction extends BaseAction<"blueWithdrawCollateral", {
138
138
  market: Hex;
139
139
  amount: bigint;
140
140
  onBehalf: Address;
141
141
  receiver: Address;
142
142
  }> {
143
143
  }
144
- export interface MarketV1RepayWithdrawCollateralAction extends BaseAction<"marketV1RepayWithdrawCollateral", {
144
+ export interface BlueRepayWithdrawCollateralAction extends BaseAction<"blueRepayWithdrawCollateral", {
145
145
  market: Hex;
146
146
  repayAssets: bigint;
147
147
  repayShares: bigint;
@@ -152,7 +152,7 @@ export interface MarketV1RepayWithdrawCollateralAction extends BaseAction<"marke
152
152
  receiver: Address;
153
153
  }> {
154
154
  }
155
- export interface MarketV1RefinanceAction extends BaseAction<"marketV1Refinance", {
155
+ export interface BlueRefinanceAction extends BaseAction<"blueRefinance", {
156
156
  readonly sourceMarket: Hex;
157
157
  readonly targetMarket: Hex;
158
158
  readonly collateralAmount: bigint;
@@ -185,7 +185,7 @@ export interface MorphoAuthorizationAction extends BaseAction<"morphoAuthorizati
185
185
  isAuthorized: boolean;
186
186
  }> {
187
187
  }
188
- export type TransactionAction = ERC20ApprovalAction | VaultV2DepositAction | VaultV2WithdrawAction | VaultV2RedeemAction | VaultV2ForceWithdrawAction | VaultV2ForceRedeemAction | VaultV1DepositAction | VaultV1WithdrawAction | VaultV1RedeemAction | VaultV1MigrateToV2Action | MarketV1SupplyAction | MarketV1WithdrawAction | MarketV1SupplyCollateralAction | MarketV1BorrowAction | MarketV1SupplyCollateralBorrowAction | MarketV1RepayAction | MarketV1WithdrawCollateralAction | MarketV1RepayWithdrawCollateralAction | MarketV1RefinanceAction | MorphoAuthorizationAction;
188
+ export type TransactionAction = ERC20ApprovalAction | VaultV2DepositAction | VaultV2WithdrawAction | VaultV2RedeemAction | VaultV2ForceWithdrawAction | VaultV2ForceRedeemAction | VaultV1DepositAction | VaultV1WithdrawAction | VaultV1RedeemAction | VaultV1MigrateToV2Action | BlueSupplyAction | BlueWithdrawAction | BlueSupplyCollateralAction | BlueBorrowAction | BlueSupplyCollateralBorrowAction | BlueRepayAction | BlueWithdrawCollateralAction | BlueRepayWithdrawCollateralAction | BlueRefinanceAction | MorphoAuthorizationAction;
189
189
  export interface Transaction<TAction extends BaseAction = TransactionAction> {
190
190
  readonly to: Address;
191
191
  readonly value: bigint;
@@ -1,10 +1,11 @@
1
1
  import type { MarketParams } from "@morpho-org/blue-sdk";
2
2
  import type { Address, Client } from "viem";
3
- import type { MarketV1Actions, VaultV1Actions, VaultV2Actions } from "../actions/index.js";
3
+ import type { BlueActions, VaultV1Actions, VaultV2Actions } from "../actions/index.js";
4
4
  import type { Metadata } from "./index.js";
5
5
  /**
6
- * Structural contract every concrete `MorphoClient` implementation satisfies. Carries the viem
7
- * client, the resolved options bag, and the three entity-factory methods the SDK exposes.
6
+ * Structural contract the `morpho` namespace satisfies — the object exposed under `client.morpho`
7
+ * once a viem client is extended with {@link morphoViemExtension}. Carries the viem client, the
8
+ * resolved options bag, and the three entity-factory methods the SDK exposes.
8
9
  */
9
10
  export interface MorphoClientType {
10
11
  readonly viemClient: Client;
@@ -15,5 +16,5 @@ export interface MorphoClientType {
15
16
  };
16
17
  vaultV1: (vault: Address, chainId: number) => VaultV1Actions;
17
18
  vaultV2: (vault: Address, chainId: number) => VaultV2Actions;
18
- marketV1: (marketParams: MarketParams, chainId: number) => MarketV1Actions;
19
+ blue: (marketParams: MarketParams, chainId: number) => BlueActions;
19
20
  }
@@ -1,8 +1,8 @@
1
1
  import type { MarketParams } from "@morpho-org/blue-sdk";
2
2
  import type { Address } from "viem";
3
- import { type MarketV1BorrowAction, type Metadata, type Transaction, type VaultReallocation } from "../../types/index.js";
4
- /** Parameters for {@link marketV1Borrow}. */
5
- export interface MarketV1BorrowParams {
3
+ import { type BlueBorrowAction, type Metadata, type Transaction, type VaultReallocation } from "../../types/index.js";
4
+ /** Parameters for {@link blueBorrow}. */
5
+ export interface BlueBorrowParams {
6
6
  market: {
7
7
  readonly chainId: number;
8
8
  readonly marketParams: MarketParams;
@@ -36,7 +36,7 @@ export interface MarketV1BorrowParams {
36
36
  * @param params.args.reallocations - Optional vault reallocations to execute before borrowing,
37
37
  * computed by the entity layer.
38
38
  * @param params.metadata - Optional analytics metadata attached to the bundle.
39
- * @returns A deep-frozen `Transaction<MarketV1BorrowAction>` with `to`, `value`, `data`, and the
39
+ * @returns A deep-frozen `Transaction<BlueBorrowAction>` with `to`, `value`, `data`, and the
40
40
  * typed `action` discriminator the simulation layer consumes.
41
41
  * @throws {NonPositiveBorrowAmountError} when `amount <= 0n`.
42
42
  * @throws {NonPositiveMinBorrowSharePriceError} when `minSharePrice < 0n` (negative; zero is
@@ -53,9 +53,9 @@ export interface MarketV1BorrowParams {
53
53
  * reallocation withdrawals are not strictly sorted by market id.
54
54
  * @example
55
55
  * ```ts
56
- * import { marketV1Borrow } from "@morpho-org/morpho-sdk";
56
+ * import { blueBorrow } from "@morpho-org/morpho-sdk";
57
57
  *
58
- * const tx = marketV1Borrow({
58
+ * const tx = blueBorrow({
59
59
  * market: { chainId: 1, marketParams },
60
60
  * args: {
61
61
  * amount: 1_000_000n,
@@ -63,7 +63,7 @@ export interface MarketV1BorrowParams {
63
63
  * minSharePrice: 0n, // disables slippage protection — production code should compute via `computeMinBorrowSharePrice` from market state + slippage tolerance
64
64
  * },
65
65
  * });
66
- * // tx satisfies Readonly<Transaction<MarketV1BorrowAction>>
66
+ * // tx satisfies Readonly<Transaction<BlueBorrowAction>>
67
67
  * ```
68
68
  */
69
- export declare const marketV1Borrow: ({ market: { chainId, marketParams }, args: { amount, receiver, minSharePrice, reallocations }, metadata, }: MarketV1BorrowParams) => Readonly<Transaction<MarketV1BorrowAction>>;
69
+ export declare const blueBorrow: ({ market: { chainId, marketParams }, args: { amount, receiver, minSharePrice, reallocations }, metadata, }: BlueBorrowParams) => Readonly<Transaction<BlueBorrowAction>>;
@@ -22,7 +22,7 @@ import { buildReallocationActions } from "./buildReallocationActions.js";
22
22
  * @param params.args.reallocations - Optional vault reallocations to execute before borrowing,
23
23
  * computed by the entity layer.
24
24
  * @param params.metadata - Optional analytics metadata attached to the bundle.
25
- * @returns A deep-frozen `Transaction<MarketV1BorrowAction>` with `to`, `value`, `data`, and the
25
+ * @returns A deep-frozen `Transaction<BlueBorrowAction>` with `to`, `value`, `data`, and the
26
26
  * typed `action` discriminator the simulation layer consumes.
27
27
  * @throws {NonPositiveBorrowAmountError} when `amount <= 0n`.
28
28
  * @throws {NonPositiveMinBorrowSharePriceError} when `minSharePrice < 0n` (negative; zero is
@@ -39,9 +39,9 @@ import { buildReallocationActions } from "./buildReallocationActions.js";
39
39
  * reallocation withdrawals are not strictly sorted by market id.
40
40
  * @example
41
41
  * ```ts
42
- * import { marketV1Borrow } from "@morpho-org/morpho-sdk";
42
+ * import { blueBorrow } from "@morpho-org/morpho-sdk";
43
43
  *
44
- * const tx = marketV1Borrow({
44
+ * const tx = blueBorrow({
45
45
  * market: { chainId: 1, marketParams },
46
46
  * args: {
47
47
  * amount: 1_000_000n,
@@ -49,10 +49,10 @@ import { buildReallocationActions } from "./buildReallocationActions.js";
49
49
  * minSharePrice: 0n, // disables slippage protection — production code should compute via `computeMinBorrowSharePrice` from market state + slippage tolerance
50
50
  * },
51
51
  * });
52
- * // tx satisfies Readonly<Transaction<MarketV1BorrowAction>>
52
+ * // tx satisfies Readonly<Transaction<BlueBorrowAction>>
53
53
  * ```
54
54
  */
55
- export const marketV1Borrow = ({ market: { chainId, marketParams }, args: { amount, receiver, minSharePrice, reallocations }, metadata, }) => {
55
+ export const blueBorrow = ({ market: { chainId, marketParams }, args: { amount, receiver, minSharePrice, reallocations }, metadata, }) => {
56
56
  if (amount <= 0n) {
57
57
  throw new NonPositiveBorrowAmountError(marketParams.id);
58
58
  }
@@ -77,7 +77,7 @@ export const marketV1Borrow = ({ market: { chainId, marketParams }, args: { amou
77
77
  return deepFreeze({
78
78
  ...tx,
79
79
  action: {
80
- type: "marketV1Borrow",
80
+ type: "blueBorrow",
81
81
  args: {
82
82
  market: marketParams.id,
83
83
  amount,
@@ -7,7 +7,7 @@ import type { VaultReallocation } from "../../types/index.js";
7
7
  * Validates the reallocations, then encodes each as a `reallocateTo` action against the target
8
8
  * market. Returns `{ actions: [], fee: 0n }` for an empty input — callers gate on
9
9
  * `reallocations.length > 0` and skip the call entirely in that case. Internal helper —
10
- * consumed only by `marketV1Borrow` and `marketV1SupplyCollateralBorrow`; not re-exported on the
10
+ * consumed only by `blueBorrow` and `blueSupplyCollateralBorrow`; not re-exported on the
11
11
  * public surface.
12
12
  *
13
13
  * @param reallocations - The vault reallocations to encode.
@@ -5,7 +5,7 @@ import { validateReallocations } from "../../helpers/index.js";
5
5
  * Validates the reallocations, then encodes each as a `reallocateTo` action against the target
6
6
  * market. Returns `{ actions: [], fee: 0n }` for an empty input — callers gate on
7
7
  * `reallocations.length > 0` and skip the call entirely in that case. Internal helper —
8
- * consumed only by `marketV1Borrow` and `marketV1SupplyCollateralBorrow`; not re-exported on the
8
+ * consumed only by `blueBorrow` and `blueSupplyCollateralBorrow`; not re-exported on the
9
9
  * public surface.
10
10
  *
11
11
  * @param reallocations - The vault reallocations to encode.
@@ -1,8 +1,8 @@
1
1
  import { type MarketParams } from "@morpho-org/blue-sdk";
2
2
  import { type Address } from "viem";
3
- import { type MarketV1RefinanceAction, type Metadata, type Transaction, type VaultReallocation } from "../../types/index.js";
4
- /** Parameters for {@link marketV1Refinance}. */
5
- export interface MarketV1RefinanceParams {
3
+ import { type BlueRefinanceAction, type Metadata, type Transaction, type VaultReallocation } from "../../types/index.js";
4
+ /** Parameters for {@link blueRefinance}. */
5
+ export interface BlueRefinanceParams {
6
6
  source: {
7
7
  readonly chainId: number;
8
8
  readonly marketParams: MarketParams;
@@ -78,7 +78,7 @@ export interface MarketV1RefinanceParams {
78
78
  * @param params.args.maxRepaySharePrice - Maximum repay share price (ray) on the source.
79
79
  * @param params.args.targetReallocations - PublicAllocator reallocations into the target, run before the supply leg.
80
80
  * @param params.metadata - Optional analytics metadata appended to `tx.data`.
81
- * @returns A deep-frozen `Transaction<MarketV1RefinanceAction>`.
81
+ * @returns A deep-frozen `Transaction<BlueRefinanceAction>`.
82
82
  * @remarks `borrowAssets` and `borrowShares` describe different markets (target borrow vs. source
83
83
  * repay); in shares mode the entity passes both. Caller-facing mutual exclusivity is enforced at the entity layer.
84
84
  * @throws {ZeroCollateralAmountError} when `collateralAmount <= 0n`.
@@ -97,9 +97,9 @@ export interface MarketV1RefinanceParams {
97
97
  * @throws {UnsortedReallocationWithdrawalsError} when reallocation withdrawals are not strictly sorted by market id.
98
98
  * @example
99
99
  * ```ts
100
- * import { marketV1Refinance } from "@morpho-org/morpho-sdk";
100
+ * import { blueRefinance } from "@morpho-org/morpho-sdk";
101
101
  *
102
- * const tx = marketV1Refinance({
102
+ * const tx = blueRefinance({
103
103
  * source: { chainId: 1, marketParams: sourceParams },
104
104
  * target: { marketParams: targetParams },
105
105
  * args: {
@@ -111,7 +111,7 @@ export interface MarketV1RefinanceParams {
111
111
  * maxRepaySharePrice: 1_500_000_000_000_000_000_000_000_000n,
112
112
  * },
113
113
  * });
114
- * // tx satisfies Readonly<Transaction<MarketV1RefinanceAction>>
114
+ * // tx satisfies Readonly<Transaction<BlueRefinanceAction>>
115
115
  * ```
116
116
  */
117
- export declare const marketV1Refinance: ({ source: { chainId, marketParams: sourceParams }, target: { marketParams: targetParams }, args: { user, collateralAmount, borrowAssets, borrowShares, minBorrowSharePrice, maxRepaySharePrice, targetReallocations, }, metadata, }: MarketV1RefinanceParams) => Readonly<Transaction<MarketV1RefinanceAction>>;
117
+ export declare const blueRefinance: ({ source: { chainId, marketParams: sourceParams }, target: { marketParams: targetParams }, args: { user, collateralAmount, borrowAssets, borrowShares, minBorrowSharePrice, maxRepaySharePrice, targetReallocations, }, metadata, }: BlueRefinanceParams) => Readonly<Transaction<BlueRefinanceAction>>;
@@ -53,7 +53,7 @@ import { buildReallocationActions } from "./buildReallocationActions.js";
53
53
  * @param params.args.maxRepaySharePrice - Maximum repay share price (ray) on the source.
54
54
  * @param params.args.targetReallocations - PublicAllocator reallocations into the target, run before the supply leg.
55
55
  * @param params.metadata - Optional analytics metadata appended to `tx.data`.
56
- * @returns A deep-frozen `Transaction<MarketV1RefinanceAction>`.
56
+ * @returns A deep-frozen `Transaction<BlueRefinanceAction>`.
57
57
  * @remarks `borrowAssets` and `borrowShares` describe different markets (target borrow vs. source
58
58
  * repay); in shares mode the entity passes both. Caller-facing mutual exclusivity is enforced at the entity layer.
59
59
  * @throws {ZeroCollateralAmountError} when `collateralAmount <= 0n`.
@@ -72,9 +72,9 @@ import { buildReallocationActions } from "./buildReallocationActions.js";
72
72
  * @throws {UnsortedReallocationWithdrawalsError} when reallocation withdrawals are not strictly sorted by market id.
73
73
  * @example
74
74
  * ```ts
75
- * import { marketV1Refinance } from "@morpho-org/morpho-sdk";
75
+ * import { blueRefinance } from "@morpho-org/morpho-sdk";
76
76
  *
77
- * const tx = marketV1Refinance({
77
+ * const tx = blueRefinance({
78
78
  * source: { chainId: 1, marketParams: sourceParams },
79
79
  * target: { marketParams: targetParams },
80
80
  * args: {
@@ -86,10 +86,10 @@ import { buildReallocationActions } from "./buildReallocationActions.js";
86
86
  * maxRepaySharePrice: 1_500_000_000_000_000_000_000_000_000n,
87
87
  * },
88
88
  * });
89
- * // tx satisfies Readonly<Transaction<MarketV1RefinanceAction>>
89
+ * // tx satisfies Readonly<Transaction<BlueRefinanceAction>>
90
90
  * ```
91
91
  */
92
- export const marketV1Refinance = ({ source: { chainId, marketParams: sourceParams }, target: { marketParams: targetParams }, args: { user, collateralAmount, borrowAssets = 0n, borrowShares = 0n, minBorrowSharePrice, maxRepaySharePrice, targetReallocations, }, metadata, }) => {
92
+ export const blueRefinance = ({ source: { chainId, marketParams: sourceParams }, target: { marketParams: targetParams }, args: { user, collateralAmount, borrowAssets = 0n, borrowShares = 0n, minBorrowSharePrice, maxRepaySharePrice, targetReallocations, }, metadata, }) => {
93
93
  if (collateralAmount <= 0n) {
94
94
  throw new ZeroCollateralAmountError(sourceParams.id);
95
95
  }
@@ -197,7 +197,7 @@ export const marketV1Refinance = ({ source: { chainId, marketParams: sourceParam
197
197
  return deepFreeze({
198
198
  ...tx,
199
199
  action: {
200
- type: "marketV1Refinance",
200
+ type: "blueRefinance",
201
201
  args: {
202
202
  sourceMarket: sourceParams.id,
203
203
  targetMarket: targetParams.id,
@@ -1,8 +1,8 @@
1
1
  import { type MarketParams } from "@morpho-org/blue-sdk";
2
2
  import { type Address } from "viem";
3
- import type { MarketV1RepayAction, Metadata, RequirementSignature, Transaction } from "../../types/index.js";
4
- /** Parameters for {@link marketV1Repay}. */
5
- export interface MarketV1RepayParams {
3
+ import type { BlueRepayAction, Metadata, RequirementSignature, Transaction } from "../../types/index.js";
4
+ /** Parameters for {@link blueRepay}. */
5
+ export interface BlueRepayParams {
6
6
  market: {
7
7
  readonly chainId: number;
8
8
  readonly marketParams: MarketParams;
@@ -56,7 +56,7 @@ export interface MarketV1RepayParams {
56
56
  * @param params.args.requirementSignature - Optional pre-signed permit/permit2 approval for the
57
57
  * loan-token transfer.
58
58
  * @param params.metadata - Optional analytics metadata attached to the bundle.
59
- * @returns A deep-frozen `Transaction<MarketV1RepayAction>` with `to`, `value`, `data`, and the
59
+ * @returns A deep-frozen `Transaction<BlueRepayAction>` with `to`, `value`, `data`, and the
60
60
  * typed `action` discriminator the simulation layer consumes.
61
61
  * @throws {NonPositiveRepayMaxSharePriceError} when `maxSharePrice <= 0n`.
62
62
  * @throws {NonPositiveRepayAmountError} when either `assets` or `shares` is negative, or when
@@ -72,9 +72,9 @@ export interface MarketV1RepayParams {
72
72
  * signature is missing its expiration.
73
73
  * @example
74
74
  * ```ts
75
- * import { marketV1Repay } from "@morpho-org/morpho-sdk";
75
+ * import { blueRepay } from "@morpho-org/morpho-sdk";
76
76
  *
77
- * const tx = marketV1Repay({
77
+ * const tx = blueRepay({
78
78
  * market: { chainId: 1, marketParams },
79
79
  * args: {
80
80
  * assets: 500_000_000n,
@@ -85,7 +85,7 @@ export interface MarketV1RepayParams {
85
85
  * maxSharePrice: 1_010_000_000_000_000_000_000_000_000n, // RAY-scaled, 1.01x
86
86
  * },
87
87
  * });
88
- * // tx satisfies Readonly<Transaction<MarketV1RepayAction>>
88
+ * // tx satisfies Readonly<Transaction<BlueRepayAction>>
89
89
  * ```
90
90
  */
91
- export declare const marketV1Repay: ({ market: { chainId, marketParams }, args: { assets, shares, transferAmount, onBehalf, receiver, maxSharePrice, requirementSignature, }, metadata, }: MarketV1RepayParams) => Readonly<Transaction<MarketV1RepayAction>>;
91
+ export declare const blueRepay: ({ market: { chainId, marketParams }, args: { assets, shares, transferAmount, onBehalf, receiver, maxSharePrice, requirementSignature, }, metadata, }: BlueRepayParams) => Readonly<Transaction<BlueRepayAction>>;
@@ -32,7 +32,7 @@ import { getRequirementsAction } from "../requirements/getRequirementsAction.js"
32
32
  * @param params.args.requirementSignature - Optional pre-signed permit/permit2 approval for the
33
33
  * loan-token transfer.
34
34
  * @param params.metadata - Optional analytics metadata attached to the bundle.
35
- * @returns A deep-frozen `Transaction<MarketV1RepayAction>` with `to`, `value`, `data`, and the
35
+ * @returns A deep-frozen `Transaction<BlueRepayAction>` with `to`, `value`, `data`, and the
36
36
  * typed `action` discriminator the simulation layer consumes.
37
37
  * @throws {NonPositiveRepayMaxSharePriceError} when `maxSharePrice <= 0n`.
38
38
  * @throws {NonPositiveRepayAmountError} when either `assets` or `shares` is negative, or when
@@ -48,9 +48,9 @@ import { getRequirementsAction } from "../requirements/getRequirementsAction.js"
48
48
  * signature is missing its expiration.
49
49
  * @example
50
50
  * ```ts
51
- * import { marketV1Repay } from "@morpho-org/morpho-sdk";
51
+ * import { blueRepay } from "@morpho-org/morpho-sdk";
52
52
  *
53
- * const tx = marketV1Repay({
53
+ * const tx = blueRepay({
54
54
  * market: { chainId: 1, marketParams },
55
55
  * args: {
56
56
  * assets: 500_000_000n,
@@ -61,10 +61,10 @@ import { getRequirementsAction } from "../requirements/getRequirementsAction.js"
61
61
  * maxSharePrice: 1_010_000_000_000_000_000_000_000_000n, // RAY-scaled, 1.01x
62
62
  * },
63
63
  * });
64
- * // tx satisfies Readonly<Transaction<MarketV1RepayAction>>
64
+ * // tx satisfies Readonly<Transaction<BlueRepayAction>>
65
65
  * ```
66
66
  */
67
- export const marketV1Repay = ({ market: { chainId, marketParams }, args: { assets, shares, transferAmount, onBehalf, receiver, maxSharePrice, requirementSignature, }, metadata, }) => {
67
+ export const blueRepay = ({ market: { chainId, marketParams }, args: { assets, shares, transferAmount, onBehalf, receiver, maxSharePrice, requirementSignature, }, metadata, }) => {
68
68
  validateRepayParams({
69
69
  assets,
70
70
  shares,
@@ -114,7 +114,7 @@ export const marketV1Repay = ({ market: { chainId, marketParams }, args: { asset
114
114
  return deepFreeze({
115
115
  ...tx,
116
116
  action: {
117
- type: "marketV1Repay",
117
+ type: "blueRepay",
118
118
  args: {
119
119
  market: marketParams.id,
120
120
  assets,
@@ -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>>;
@@ -42,7 +42,7 @@ import { getRequirementsAction } from "../requirements/getRequirementsAction.js"
42
42
  * @param params.args.requirementSignature - Optional pre-signed permit/permit2 approval for the
43
43
  * loan-token transfer.
44
44
  * @param params.metadata - Optional analytics metadata attached to the bundle.
45
- * @returns A deep-frozen `Transaction<MarketV1RepayWithdrawCollateralAction>` with `to`,
45
+ * @returns A deep-frozen `Transaction<BlueRepayWithdrawCollateralAction>` with `to`,
46
46
  * `value`, `data`, and the typed `action` discriminator the simulation layer consumes.
47
47
  * @throws {NonPositiveRepayMaxSharePriceError} when `maxSharePrice <= 0n`.
48
48
  * @throws {NonPositiveRepayAmountError} when either `assets` or `shares` is negative, or when
@@ -59,9 +59,9 @@ import { getRequirementsAction } from "../requirements/getRequirementsAction.js"
59
59
  * signature is missing its expiration.
60
60
  * @example
61
61
  * ```ts
62
- * import { marketV1RepayWithdrawCollateral } from "@morpho-org/morpho-sdk";
62
+ * import { blueRepayWithdrawCollateral } from "@morpho-org/morpho-sdk";
63
63
  *
64
- * const tx = marketV1RepayWithdrawCollateral({
64
+ * const tx = blueRepayWithdrawCollateral({
65
65
  * market: { chainId: 1, marketParams },
66
66
  * args: {
67
67
  * assets: 500_000_000n,
@@ -73,10 +73,10 @@ import { getRequirementsAction } from "../requirements/getRequirementsAction.js"
73
73
  * maxSharePrice: 1_010_000_000_000_000_000_000_000_000n, // RAY-scaled, 1.01x
74
74
  * },
75
75
  * });
76
- * // tx satisfies Readonly<Transaction<MarketV1RepayWithdrawCollateralAction>>
76
+ * // tx satisfies Readonly<Transaction<BlueRepayWithdrawCollateralAction>>
77
77
  * ```
78
78
  */
79
- export const marketV1RepayWithdrawCollateral = ({ market: { chainId, marketParams }, args: { assets, shares, transferAmount, withdrawAmount, onBehalf, receiver, maxSharePrice, requirementSignature, }, metadata, }) => {
79
+ export const blueRepayWithdrawCollateral = ({ market: { chainId, marketParams }, args: { assets, shares, transferAmount, withdrawAmount, onBehalf, receiver, maxSharePrice, requirementSignature, }, metadata, }) => {
80
80
  validateRepayParams({
81
81
  assets,
82
82
  shares,
@@ -134,7 +134,7 @@ export const marketV1RepayWithdrawCollateral = ({ market: { chainId, marketParam
134
134
  return deepFreeze({
135
135
  ...tx,
136
136
  action: {
137
- type: "marketV1RepayWithdrawCollateral",
137
+ type: "blueRepayWithdrawCollateral",
138
138
  args: {
139
139
  market: marketParams.id,
140
140
  repayAssets: assets,
@@ -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>>;
@@ -27,7 +27,7 @@ import { getRequirementsAction } from "../requirements/getRequirementsAction.js"
27
27
  * absent, the bundle uses a plain `erc20TransferFrom` and assumes the user has already
28
28
  * approved `GeneralAdapter1`.
29
29
  * @param params.metadata - Optional analytics metadata attached to the bundle.
30
- * @returns A deep-frozen `Transaction<MarketV1SupplyAction>` with `to`, `value`, `data`, and the
30
+ * @returns A deep-frozen `Transaction<BlueSupplyAction>` with `to`, `value`, `data`, and the
31
31
  * typed `action` discriminator the simulation layer consumes.
32
32
  * @throws {NegativeSupplyAmountError} when `amount < 0n`.
33
33
  * @throws {NegativeNativeAmountError} when `nativeAmount < 0n`.
@@ -42,9 +42,9 @@ import { getRequirementsAction } from "../requirements/getRequirementsAction.js"
42
42
  * is provided and the signed amount differs from `args.amount`.
43
43
  * @example
44
44
  * ```ts
45
- * import { marketV1Supply } from "@morpho-org/morpho-sdk";
45
+ * import { blueSupply } from "@morpho-org/morpho-sdk";
46
46
  *
47
- * const tx = marketV1Supply({
47
+ * const tx = blueSupply({
48
48
  * market: { chainId: 1, marketParams },
49
49
  * args: {
50
50
  * amount: 1_000_000_000n,
@@ -52,10 +52,10 @@ import { getRequirementsAction } from "../requirements/getRequirementsAction.js"
52
52
  * maxSharePrice: 1_010_000_000_000_000_000_000_000_000n, // RAY-scaled, 1.01x
53
53
  * },
54
54
  * });
55
- * // tx satisfies Readonly<Transaction<MarketV1SupplyAction>>
55
+ * // tx satisfies Readonly<Transaction<BlueSupplyAction>>
56
56
  * ```
57
57
  */
58
- export const marketV1Supply = ({ market: { chainId, marketParams }, args: { amount = 0n, onBehalf, maxSharePrice, requirementSignature, nativeAmount, }, metadata, }) => {
58
+ export const blueSupply = ({ market: { chainId, marketParams }, args: { amount = 0n, onBehalf, maxSharePrice, requirementSignature, nativeAmount, }, metadata, }) => {
59
59
  if (amount < 0n) {
60
60
  throw new NegativeSupplyAmountError(marketParams.id);
61
61
  }
@@ -111,7 +111,7 @@ export const marketV1Supply = ({ market: { chainId, marketParams }, args: { amou
111
111
  return deepFreeze({
112
112
  ...tx,
113
113
  action: {
114
- type: "marketV1Supply",
114
+ type: "blueSupply",
115
115
  args: {
116
116
  market: marketParams.id,
117
117
  amount: totalAssets,