@morpho-org/morpho-sdk 4.1.0 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -12
- package/lib/cjs/actions/blue/borrow.d.ts +12 -2
- package/lib/cjs/actions/blue/borrow.js +7 -1
- package/lib/cjs/actions/blue/refinance.d.ts +13 -3
- package/lib/cjs/actions/blue/refinance.js +8 -2
- package/lib/cjs/actions/blue/repay.d.ts +6 -5
- package/lib/cjs/actions/blue/repay.js +10 -18
- package/lib/cjs/actions/blue/repayWithdrawCollateral.d.ts +15 -6
- package/lib/cjs/actions/blue/repayWithdrawCollateral.js +16 -18
- package/lib/cjs/actions/blue/supply.d.ts +7 -7
- package/lib/cjs/actions/blue/supply.js +10 -20
- package/lib/cjs/actions/blue/supplyCollateral.d.ts +8 -8
- package/lib/cjs/actions/blue/supplyCollateral.js +11 -21
- package/lib/cjs/actions/blue/supplyCollateralBorrow.d.ts +18 -6
- package/lib/cjs/actions/blue/supplyCollateralBorrow.js +17 -19
- package/lib/cjs/actions/blue/withdraw.d.ts +10 -2
- package/lib/cjs/actions/blue/withdraw.js +7 -1
- package/lib/cjs/actions/index.d.ts +1 -0
- package/lib/cjs/actions/index.js +1 -0
- package/lib/cjs/actions/requirements/blue/getBlueAuthorizationRequirement.d.ts +49 -0
- package/lib/cjs/actions/requirements/blue/getBlueAuthorizationRequirement.js +111 -0
- package/lib/cjs/actions/requirements/blue/index.d.ts +1 -0
- package/lib/cjs/actions/requirements/blue/index.js +17 -0
- package/lib/cjs/actions/requirements/encode/encodeBlueSignatureAuthorization.d.ts +55 -0
- package/lib/cjs/actions/requirements/encode/encodeBlueSignatureAuthorization.js +89 -0
- package/lib/cjs/actions/requirements/encode/encodeErc20Approval.d.ts +6 -5
- package/lib/cjs/actions/requirements/encode/encodeErc20Approval.js +17 -5
- package/lib/cjs/actions/requirements/encode/encodeErc20Permit.d.ts +9 -7
- package/lib/cjs/actions/requirements/encode/encodeErc20Permit.js +18 -4
- package/lib/cjs/actions/requirements/encode/{encodeErc20Permit2.d.ts → encodeErc20Permit2Approve.d.ts} +11 -13
- package/lib/cjs/actions/requirements/encode/{encodeErc20Permit2.js → encodeErc20Permit2Approve.js} +10 -14
- package/lib/cjs/actions/requirements/encode/index.d.ts +2 -1
- package/lib/cjs/actions/requirements/encode/index.js +2 -1
- package/lib/cjs/actions/requirements/{getRequirements.d.ts → generalAdapter/getGeneralAdapterRequirements.d.ts} +34 -20
- package/lib/cjs/actions/requirements/generalAdapter/getGeneralAdapterRequirements.js +151 -0
- package/lib/{esm/actions/requirements/getRequirementsPermit.d.ts → cjs/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit.d.ts} +6 -14
- package/lib/cjs/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit.js +50 -0
- package/lib/cjs/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit2.d.ts +57 -0
- package/lib/cjs/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit2.js +74 -0
- package/lib/cjs/actions/requirements/generalAdapter/index.d.ts +3 -0
- package/lib/cjs/actions/requirements/generalAdapter/index.js +19 -0
- package/lib/cjs/actions/requirements/getRequirementsApproval.d.ts +3 -2
- package/lib/cjs/actions/requirements/getRequirementsApproval.js +3 -2
- package/lib/cjs/actions/requirements/index.d.ts +2 -5
- package/lib/cjs/actions/requirements/index.js +2 -5
- package/lib/cjs/actions/signatures/getBlueAuthorizationAction.d.ts +29 -0
- package/lib/cjs/actions/signatures/getBlueAuthorizationAction.js +48 -0
- package/lib/{esm/actions/requirements/getRequirementsAction.d.ts → cjs/actions/signatures/getTokenRequirementActions.d.ts} +17 -17
- package/lib/cjs/actions/{requirements/getRequirementsAction.js → signatures/getTokenRequirementActions.js} +26 -13
- package/lib/cjs/actions/signatures/index.d.ts +2 -0
- package/lib/cjs/actions/signatures/index.js +18 -0
- package/lib/cjs/actions/vaultV1/deposit.d.ts +6 -8
- package/lib/cjs/actions/vaultV1/deposit.js +11 -21
- package/lib/cjs/actions/vaultV1/migrateToV2.d.ts +6 -6
- package/lib/cjs/actions/vaultV1/migrateToV2.js +12 -20
- package/lib/cjs/actions/vaultV2/deposit.d.ts +6 -8
- package/lib/cjs/actions/vaultV2/deposit.js +11 -21
- package/lib/cjs/addresses.d.ts +2 -2
- package/lib/cjs/addresses.js +2 -1
- package/lib/cjs/bundler/actions.d.ts +44 -4
- package/lib/cjs/bundler/actions.js +75 -2
- package/lib/cjs/bundler/types.d.ts +6 -0
- package/lib/cjs/constants.d.ts +2 -2
- package/lib/cjs/constants.js +3 -3
- package/lib/cjs/entities/blue/blue.d.ts +58 -33
- package/lib/cjs/entities/blue/blue.js +171 -125
- package/lib/cjs/entities/reallocationData.d.ts +12 -12
- package/lib/cjs/entities/reallocationData.js +19 -19
- package/lib/cjs/entities/vaultV1/vaultV1.d.ts +9 -9
- package/lib/cjs/entities/vaultV1/vaultV1.js +44 -34
- package/lib/cjs/entities/vaultV2/vaultV2.d.ts +6 -6
- package/lib/cjs/entities/vaultV2/vaultV2.js +21 -16
- package/lib/cjs/errors.d.ts +3 -2
- package/lib/cjs/errors.js +5 -2
- package/lib/cjs/helpers/validate.d.ts +2 -2
- package/lib/cjs/helpers/validate.js +1 -1
- package/lib/cjs/types/action.d.ts +113 -9
- package/lib/cjs/types/action.js +79 -5
- package/lib/cjs/types/error.d.ts +73 -0
- package/lib/cjs/types/error.js +89 -4
- package/lib/cjs/types.d.ts +2 -1
- package/lib/cjs/utils.d.ts +1 -1
- package/lib/cjs/utils.js +2 -3
- package/lib/esm/actions/blue/borrow.d.ts +12 -2
- package/lib/esm/actions/blue/borrow.js +7 -1
- package/lib/esm/actions/blue/refinance.d.ts +13 -3
- package/lib/esm/actions/blue/refinance.js +8 -2
- package/lib/esm/actions/blue/repay.d.ts +6 -5
- package/lib/esm/actions/blue/repay.js +10 -18
- package/lib/esm/actions/blue/repayWithdrawCollateral.d.ts +15 -6
- package/lib/esm/actions/blue/repayWithdrawCollateral.js +16 -18
- package/lib/esm/actions/blue/supply.d.ts +7 -7
- package/lib/esm/actions/blue/supply.js +10 -20
- package/lib/esm/actions/blue/supplyCollateral.d.ts +8 -8
- package/lib/esm/actions/blue/supplyCollateral.js +11 -21
- package/lib/esm/actions/blue/supplyCollateralBorrow.d.ts +18 -6
- package/lib/esm/actions/blue/supplyCollateralBorrow.js +17 -19
- package/lib/esm/actions/blue/withdraw.d.ts +10 -2
- package/lib/esm/actions/blue/withdraw.js +7 -1
- package/lib/esm/actions/index.d.ts +1 -0
- package/lib/esm/actions/index.js +1 -0
- package/lib/esm/actions/requirements/blue/getBlueAuthorizationRequirement.d.ts +49 -0
- package/lib/esm/actions/requirements/blue/getBlueAuthorizationRequirement.js +107 -0
- package/lib/esm/actions/requirements/blue/index.d.ts +1 -0
- package/lib/esm/actions/requirements/blue/index.js +1 -0
- package/lib/esm/actions/requirements/encode/encodeBlueSignatureAuthorization.d.ts +55 -0
- package/lib/esm/actions/requirements/encode/encodeBlueSignatureAuthorization.js +85 -0
- package/lib/esm/actions/requirements/encode/encodeErc20Approval.d.ts +6 -5
- package/lib/esm/actions/requirements/encode/encodeErc20Approval.js +19 -7
- package/lib/esm/actions/requirements/encode/encodeErc20Permit.d.ts +9 -7
- package/lib/esm/actions/requirements/encode/encodeErc20Permit.js +20 -6
- package/lib/esm/actions/requirements/encode/{encodeErc20Permit2.d.ts → encodeErc20Permit2Approve.d.ts} +11 -13
- package/lib/esm/actions/requirements/encode/{encodeErc20Permit2.js → encodeErc20Permit2Approve.js} +8 -12
- package/lib/esm/actions/requirements/encode/index.d.ts +2 -1
- package/lib/esm/actions/requirements/encode/index.js +2 -1
- package/lib/esm/actions/requirements/{getRequirements.d.ts → generalAdapter/getGeneralAdapterRequirements.d.ts} +34 -20
- package/lib/esm/actions/requirements/generalAdapter/getGeneralAdapterRequirements.js +147 -0
- package/lib/{cjs/actions/requirements/getRequirementsPermit.d.ts → esm/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit.d.ts} +6 -14
- package/lib/esm/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit.js +46 -0
- package/lib/esm/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit2.d.ts +57 -0
- package/lib/esm/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit2.js +70 -0
- package/lib/esm/actions/requirements/generalAdapter/index.d.ts +3 -0
- package/lib/esm/actions/requirements/generalAdapter/index.js +3 -0
- package/lib/esm/actions/requirements/getRequirementsApproval.d.ts +3 -2
- package/lib/esm/actions/requirements/getRequirementsApproval.js +3 -2
- package/lib/esm/actions/requirements/index.d.ts +2 -5
- package/lib/esm/actions/requirements/index.js +2 -5
- package/lib/esm/actions/signatures/getBlueAuthorizationAction.d.ts +29 -0
- package/lib/esm/actions/signatures/getBlueAuthorizationAction.js +44 -0
- package/lib/{cjs/actions/requirements/getRequirementsAction.d.ts → esm/actions/signatures/getTokenRequirementActions.d.ts} +17 -17
- package/lib/esm/actions/{requirements/getRequirementsAction.js → signatures/getTokenRequirementActions.js} +24 -11
- package/lib/esm/actions/signatures/index.d.ts +2 -0
- package/lib/esm/actions/signatures/index.js +2 -0
- package/lib/esm/actions/vaultV1/deposit.d.ts +6 -8
- package/lib/esm/actions/vaultV1/deposit.js +11 -21
- package/lib/esm/actions/vaultV1/migrateToV2.d.ts +6 -6
- package/lib/esm/actions/vaultV1/migrateToV2.js +12 -20
- package/lib/esm/actions/vaultV2/deposit.d.ts +6 -8
- package/lib/esm/actions/vaultV2/deposit.js +11 -21
- package/lib/esm/addresses.d.ts +2 -2
- package/lib/esm/addresses.js +1 -1
- package/lib/esm/bundler/actions.d.ts +44 -4
- package/lib/esm/bundler/actions.js +77 -4
- package/lib/esm/bundler/types.d.ts +6 -0
- package/lib/esm/constants.d.ts +2 -2
- package/lib/esm/constants.js +2 -2
- package/lib/esm/entities/blue/blue.d.ts +58 -33
- package/lib/esm/entities/blue/blue.js +173 -127
- package/lib/esm/entities/reallocationData.d.ts +12 -12
- package/lib/esm/entities/reallocationData.js +18 -18
- package/lib/esm/entities/vaultV1/vaultV1.d.ts +9 -9
- package/lib/esm/entities/vaultV1/vaultV1.js +46 -36
- package/lib/esm/entities/vaultV2/vaultV2.d.ts +6 -6
- package/lib/esm/entities/vaultV2/vaultV2.js +23 -18
- package/lib/esm/errors.d.ts +3 -2
- package/lib/esm/errors.js +2 -1
- package/lib/esm/helpers/validate.d.ts +2 -2
- package/lib/esm/helpers/validate.js +1 -1
- package/lib/esm/types/action.d.ts +113 -9
- package/lib/esm/types/action.js +75 -4
- package/lib/esm/types/error.d.ts +73 -0
- package/lib/esm/types/error.js +84 -2
- package/lib/esm/types.d.ts +2 -1
- package/lib/esm/utils.d.ts +1 -1
- package/lib/esm/utils.js +1 -1
- package/package.json +6 -6
- package/lib/cjs/actions/requirements/getMorphoAuthorizationRequirement.d.ts +0 -37
- package/lib/cjs/actions/requirements/getMorphoAuthorizationRequirement.js +0 -71
- package/lib/cjs/actions/requirements/getRequirements.js +0 -112
- package/lib/cjs/actions/requirements/getRequirementsPermit.js +0 -57
- package/lib/cjs/actions/requirements/getRequirementsPermit2.d.ts +0 -63
- package/lib/cjs/actions/requirements/getRequirementsPermit2.js +0 -85
- package/lib/esm/actions/requirements/getMorphoAuthorizationRequirement.d.ts +0 -37
- package/lib/esm/actions/requirements/getMorphoAuthorizationRequirement.js +0 -67
- package/lib/esm/actions/requirements/getRequirements.js +0 -108
- package/lib/esm/actions/requirements/getRequirementsPermit.js +0 -53
- package/lib/esm/actions/requirements/getRequirementsPermit2.d.ts +0 -63
- package/lib/esm/actions/requirements/getRequirementsPermit2.js +0 -81
|
@@ -2,9 +2,9 @@ import { AccrualPosition, DEFAULT_SLIPPAGE_TOLERANCE, MathLib, } from "@morpho-o
|
|
|
2
2
|
import { fetchAccrualPosition, fetchMarket, fetchPosition, fetchVault, fetchVaultMarketConfig, } from "@morpho-org/blue-sdk-viem";
|
|
3
3
|
import { Time } from "@morpho-org/morpho-ts";
|
|
4
4
|
import { isAddressEqual } from "viem";
|
|
5
|
-
import { blueBorrow, blueRefinance, blueRepay, blueRepayWithdrawCollateral, blueSupply, blueSupplyCollateral, blueSupplyCollateralBorrow, blueWithdraw, blueWithdrawCollateral,
|
|
5
|
+
import { blueBorrow, blueRefinance, blueRepay, blueRepayWithdrawCollateral, blueSupply, blueSupplyCollateral, blueSupplyCollateralBorrow, blueWithdraw, blueWithdrawCollateral, getBlueAuthorizationRequirement, getGeneralAdapterRequirements, } from "../../actions/index.js";
|
|
6
6
|
import { computeMaxRepaySharePrice, computeMaxSupplySharePrice, computeMinBorrowSharePrice, computeMinWithdrawSharePrice, computeReallocations, validateAccrualPosition, validateChainId, validateNativeAsset, validatePositionHealth, validatePositionHealthAfterWithdraw, validateRepayAmount, validateRepayShares, validateSlippageTolerance, validateWithdrawAmount, validateWithdrawShares, } from "../../helpers/index.js";
|
|
7
|
-
import { BorrowAmountAndSharesExclusiveError, MarketIdMismatchError, MissingAccrualPositionError, MutuallyExclusiveRepayAmountsError, MutuallyExclusiveWithdrawAmountsError, NegativeBorrowSharesError, NegativeNativeAmountError, NegativeSupplyAmountError, NonPositiveAssetAmountError, NonPositiveBorrowAmountError, NonPositiveRepayAmountError, NonPositiveWithdrawAmountError, NonPositiveWithdrawCollateralAmountError, RefinanceExceedsBorrowAssetsError, RefinanceExceedsBorrowSharesError, RefinanceExceedsCollateralError, RefinanceSameMarketError, RefinanceTokenMismatchError, WithdrawExceedsCollateralError, ZeroCollateralAmountError, ZeroSupplyAmountError, } from "../../types/index.js";
|
|
7
|
+
import { BorrowAmountAndSharesExclusiveError, MarketIdMismatchError, MissingAccrualPositionError, MutuallyExclusiveRepayAmountsError, MutuallyExclusiveWithdrawAmountsError, NegativeBorrowSharesError, NegativeNativeAmountError, NegativeSupplyAmountError, NonPositiveAssetAmountError, NonPositiveBorrowAmountError, NonPositiveRepayAmountError, NonPositiveWithdrawAmountError, NonPositiveWithdrawCollateralAmountError, RefinanceExceedsBorrowAssetsError, RefinanceExceedsBorrowSharesError, RefinanceExceedsCollateralError, RefinanceSameMarketError, RefinanceTokenMismatchError, selectRequirementSignatures, WithdrawExceedsCollateralError, ZeroCollateralAmountError, ZeroSupplyAmountError, } from "../../types/index.js";
|
|
8
8
|
import { ReallocationData } from "../reallocationData.js";
|
|
9
9
|
export class MorphoBlue {
|
|
10
10
|
client;
|
|
@@ -57,7 +57,7 @@ export class MorphoBlue {
|
|
|
57
57
|
slippageTolerance,
|
|
58
58
|
});
|
|
59
59
|
return {
|
|
60
|
-
getRequirements: (params) =>
|
|
60
|
+
getRequirements: (params) => getGeneralAdapterRequirements(this.client.viemClient, {
|
|
61
61
|
address: this.marketParams.loanToken,
|
|
62
62
|
chainId: this.chainId,
|
|
63
63
|
supportSignature: this.client.options.supportSignature,
|
|
@@ -65,17 +65,22 @@ export class MorphoBlue {
|
|
|
65
65
|
useSimplePermit: params?.useSimplePermit,
|
|
66
66
|
args: { amount, from: userAddress },
|
|
67
67
|
}),
|
|
68
|
-
buildTx: (
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
68
|
+
buildTx: (signatures) => {
|
|
69
|
+
const { permit } = selectRequirementSignatures(signatures, {
|
|
70
|
+
permit: true,
|
|
71
|
+
});
|
|
72
|
+
return blueSupply({
|
|
73
|
+
market: { chainId: this.chainId, marketParams: this.marketParams },
|
|
74
|
+
args: {
|
|
75
|
+
amount,
|
|
76
|
+
nativeAmount,
|
|
77
|
+
onBehalf: userAddress,
|
|
78
|
+
maxSharePrice,
|
|
79
|
+
requirementSignature: permit,
|
|
80
|
+
},
|
|
81
|
+
metadata: this.client.options.metadata,
|
|
82
|
+
});
|
|
83
|
+
},
|
|
79
84
|
};
|
|
80
85
|
}
|
|
81
86
|
withdraw(params) {
|
|
@@ -126,24 +131,31 @@ export class MorphoBlue {
|
|
|
126
131
|
});
|
|
127
132
|
return {
|
|
128
133
|
getRequirements: async () => {
|
|
129
|
-
const authTx = await
|
|
134
|
+
const authTx = await getBlueAuthorizationRequirement({
|
|
130
135
|
viemClient: this.client.viemClient,
|
|
131
136
|
chainId: this.chainId,
|
|
132
137
|
userAddress,
|
|
138
|
+
supportSignature: this.client.options.supportSignature,
|
|
133
139
|
});
|
|
134
140
|
return authTx ? [authTx] : [];
|
|
135
141
|
},
|
|
136
|
-
buildTx: () =>
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
142
|
+
buildTx: (signatures) => {
|
|
143
|
+
const { authorization } = selectRequirementSignatures(signatures, {
|
|
144
|
+
authorization: true,
|
|
145
|
+
});
|
|
146
|
+
return blueWithdraw({
|
|
147
|
+
market: { chainId: this.chainId, marketParams: this.marketParams },
|
|
148
|
+
args: {
|
|
149
|
+
assets,
|
|
150
|
+
shares,
|
|
151
|
+
receiver,
|
|
152
|
+
minSharePrice,
|
|
153
|
+
reallocations,
|
|
154
|
+
authorizationSignature: authorization,
|
|
155
|
+
},
|
|
156
|
+
metadata: this.client.options.metadata,
|
|
157
|
+
});
|
|
158
|
+
},
|
|
147
159
|
};
|
|
148
160
|
}
|
|
149
161
|
supplyCollateral({ amount = 0n, userAddress, nativeAmount, }) {
|
|
@@ -162,7 +174,7 @@ export class MorphoBlue {
|
|
|
162
174
|
validateNativeAsset(this.chainId, this.marketParams.collateralToken);
|
|
163
175
|
}
|
|
164
176
|
return {
|
|
165
|
-
getRequirements: (params) =>
|
|
177
|
+
getRequirements: (params) => getGeneralAdapterRequirements(this.client.viemClient, {
|
|
166
178
|
address: this.marketParams.collateralToken,
|
|
167
179
|
chainId: this.chainId,
|
|
168
180
|
supportSignature: this.client.options.supportSignature,
|
|
@@ -170,19 +182,24 @@ export class MorphoBlue {
|
|
|
170
182
|
useSimplePermit: params?.useSimplePermit,
|
|
171
183
|
args: { amount, from: userAddress },
|
|
172
184
|
}),
|
|
173
|
-
buildTx: (
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
185
|
+
buildTx: (signatures) => {
|
|
186
|
+
const { permit } = selectRequirementSignatures(signatures, {
|
|
187
|
+
permit: true,
|
|
188
|
+
});
|
|
189
|
+
return blueSupplyCollateral({
|
|
190
|
+
market: {
|
|
191
|
+
chainId: this.chainId,
|
|
192
|
+
marketParams: this.marketParams,
|
|
193
|
+
},
|
|
194
|
+
args: {
|
|
195
|
+
amount,
|
|
196
|
+
nativeAmount,
|
|
197
|
+
onBehalf: userAddress,
|
|
198
|
+
requirementSignature: permit,
|
|
199
|
+
},
|
|
200
|
+
metadata: this.client.options.metadata,
|
|
201
|
+
});
|
|
202
|
+
},
|
|
186
203
|
};
|
|
187
204
|
}
|
|
188
205
|
borrow({ amount, userAddress, positionData, slippageTolerance = DEFAULT_SLIPPAGE_TOLERANCE, reallocations, }) {
|
|
@@ -213,26 +230,33 @@ export class MorphoBlue {
|
|
|
213
230
|
});
|
|
214
231
|
return {
|
|
215
232
|
getRequirements: async () => {
|
|
216
|
-
const authTx = await
|
|
233
|
+
const authTx = await getBlueAuthorizationRequirement({
|
|
217
234
|
viemClient: this.client.viemClient,
|
|
218
235
|
chainId: this.chainId,
|
|
219
236
|
userAddress,
|
|
237
|
+
supportSignature: this.client.options.supportSignature,
|
|
220
238
|
});
|
|
221
239
|
return authTx ? [authTx] : [];
|
|
222
240
|
},
|
|
223
|
-
buildTx: () =>
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
241
|
+
buildTx: (signatures) => {
|
|
242
|
+
const { authorization } = selectRequirementSignatures(signatures, {
|
|
243
|
+
authorization: true,
|
|
244
|
+
});
|
|
245
|
+
return blueBorrow({
|
|
246
|
+
market: {
|
|
247
|
+
chainId: this.chainId,
|
|
248
|
+
marketParams: this.marketParams,
|
|
249
|
+
},
|
|
250
|
+
args: {
|
|
251
|
+
amount,
|
|
252
|
+
receiver: userAddress,
|
|
253
|
+
minSharePrice,
|
|
254
|
+
reallocations,
|
|
255
|
+
authorizationSignature: authorization,
|
|
256
|
+
},
|
|
257
|
+
metadata: this.client.options.metadata,
|
|
258
|
+
});
|
|
259
|
+
},
|
|
236
260
|
};
|
|
237
261
|
}
|
|
238
262
|
repay(params) {
|
|
@@ -298,7 +322,7 @@ export class MorphoBlue {
|
|
|
298
322
|
slippageTolerance,
|
|
299
323
|
});
|
|
300
324
|
return {
|
|
301
|
-
getRequirements: (reqParams) =>
|
|
325
|
+
getRequirements: (reqParams) => getGeneralAdapterRequirements(this.client.viemClient, {
|
|
302
326
|
address: this.marketParams.loanToken,
|
|
303
327
|
chainId: this.chainId,
|
|
304
328
|
supportSignature: this.client.options.supportSignature,
|
|
@@ -306,22 +330,27 @@ export class MorphoBlue {
|
|
|
306
330
|
useSimplePermit: reqParams?.useSimplePermit,
|
|
307
331
|
args: { amount: transferAmount, from: userAddress },
|
|
308
332
|
}),
|
|
309
|
-
buildTx: (
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
333
|
+
buildTx: (signatures) => {
|
|
334
|
+
const { permit } = selectRequirementSignatures(signatures, {
|
|
335
|
+
permit: true,
|
|
336
|
+
});
|
|
337
|
+
return blueRepay({
|
|
338
|
+
market: {
|
|
339
|
+
chainId: this.chainId,
|
|
340
|
+
marketParams: this.marketParams,
|
|
341
|
+
},
|
|
342
|
+
args: {
|
|
343
|
+
assets,
|
|
344
|
+
shares,
|
|
345
|
+
transferAmount,
|
|
346
|
+
onBehalf: userAddress,
|
|
347
|
+
receiver: userAddress,
|
|
348
|
+
maxSharePrice,
|
|
349
|
+
requirementSignature: permit,
|
|
350
|
+
},
|
|
351
|
+
metadata: this.client.options.metadata,
|
|
352
|
+
});
|
|
353
|
+
},
|
|
325
354
|
};
|
|
326
355
|
}
|
|
327
356
|
withdrawCollateral({ userAddress, amount, positionData, }) {
|
|
@@ -447,7 +476,7 @@ export class MorphoBlue {
|
|
|
447
476
|
return {
|
|
448
477
|
getRequirements: async (reqParams) => {
|
|
449
478
|
const [erc20Requirements, authTx] = await Promise.all([
|
|
450
|
-
|
|
479
|
+
getGeneralAdapterRequirements(this.client.viemClient, {
|
|
451
480
|
address: this.marketParams.loanToken,
|
|
452
481
|
chainId: this.chainId,
|
|
453
482
|
supportSignature: this.client.options.supportSignature,
|
|
@@ -455,31 +484,36 @@ export class MorphoBlue {
|
|
|
455
484
|
useSimplePermit: reqParams?.useSimplePermit,
|
|
456
485
|
args: { amount: transferAmount, from: userAddress },
|
|
457
486
|
}),
|
|
458
|
-
|
|
487
|
+
getBlueAuthorizationRequirement({
|
|
459
488
|
viemClient: this.client.viemClient,
|
|
460
489
|
chainId: this.chainId,
|
|
461
490
|
userAddress,
|
|
491
|
+
supportSignature: this.client.options.supportSignature,
|
|
462
492
|
}),
|
|
463
493
|
]);
|
|
464
494
|
return [...erc20Requirements, ...(authTx ? [authTx] : [])];
|
|
465
495
|
},
|
|
466
|
-
buildTx: (
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
496
|
+
buildTx: (signatures) => {
|
|
497
|
+
const { permit, authorization } = selectRequirementSignatures(signatures, { permit: true, authorization: true });
|
|
498
|
+
return blueRepayWithdrawCollateral({
|
|
499
|
+
market: {
|
|
500
|
+
chainId: this.chainId,
|
|
501
|
+
marketParams: this.marketParams,
|
|
502
|
+
},
|
|
503
|
+
args: {
|
|
504
|
+
assets,
|
|
505
|
+
shares,
|
|
506
|
+
transferAmount,
|
|
507
|
+
withdrawAmount,
|
|
508
|
+
onBehalf: userAddress,
|
|
509
|
+
receiver: userAddress,
|
|
510
|
+
maxSharePrice,
|
|
511
|
+
requirementSignature: permit,
|
|
512
|
+
authorizationSignature: authorization,
|
|
513
|
+
},
|
|
514
|
+
metadata: this.client.options.metadata,
|
|
515
|
+
});
|
|
516
|
+
},
|
|
483
517
|
};
|
|
484
518
|
}
|
|
485
519
|
supplyCollateralBorrow({ amount = 0n, userAddress, positionData, borrowAmount, nativeAmount, slippageTolerance = DEFAULT_SLIPPAGE_TOLERANCE, reallocations, }) {
|
|
@@ -524,7 +558,7 @@ export class MorphoBlue {
|
|
|
524
558
|
return {
|
|
525
559
|
getRequirements: async (params) => {
|
|
526
560
|
const [erc20Requirements, authTx] = await Promise.all([
|
|
527
|
-
|
|
561
|
+
getGeneralAdapterRequirements(this.client.viemClient, {
|
|
528
562
|
address: this.marketParams.collateralToken,
|
|
529
563
|
chainId: this.chainId,
|
|
530
564
|
supportSignature: this.client.options.supportSignature,
|
|
@@ -532,31 +566,36 @@ export class MorphoBlue {
|
|
|
532
566
|
useSimplePermit: params?.useSimplePermit,
|
|
533
567
|
args: { amount, from: userAddress },
|
|
534
568
|
}),
|
|
535
|
-
|
|
569
|
+
getBlueAuthorizationRequirement({
|
|
536
570
|
viemClient: this.client.viemClient,
|
|
537
571
|
chainId: this.chainId,
|
|
538
572
|
userAddress,
|
|
573
|
+
supportSignature: this.client.options.supportSignature,
|
|
539
574
|
}),
|
|
540
575
|
]);
|
|
541
576
|
return [...erc20Requirements, ...(authTx ? [authTx] : [])];
|
|
542
577
|
},
|
|
543
|
-
buildTx: (
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
578
|
+
buildTx: (signatures) => {
|
|
579
|
+
const { permit, authorization } = selectRequirementSignatures(signatures, { permit: true, authorization: true });
|
|
580
|
+
return blueSupplyCollateralBorrow({
|
|
581
|
+
market: {
|
|
582
|
+
chainId: this.chainId,
|
|
583
|
+
marketParams: this.marketParams,
|
|
584
|
+
},
|
|
585
|
+
args: {
|
|
586
|
+
amount,
|
|
587
|
+
nativeAmount,
|
|
588
|
+
borrowAmount,
|
|
589
|
+
onBehalf: userAddress,
|
|
590
|
+
receiver: userAddress,
|
|
591
|
+
minSharePrice,
|
|
592
|
+
requirementSignature: permit,
|
|
593
|
+
authorizationSignature: authorization,
|
|
594
|
+
reallocations,
|
|
595
|
+
},
|
|
596
|
+
metadata: this.client.options.metadata,
|
|
597
|
+
});
|
|
598
|
+
},
|
|
560
599
|
};
|
|
561
600
|
}
|
|
562
601
|
refinance({ userAddress, positionData, target, collateralAmount, borrowAssets, borrowShares, slippageTolerance = DEFAULT_SLIPPAGE_TOLERANCE, targetReallocations, }) {
|
|
@@ -690,30 +729,37 @@ export class MorphoBlue {
|
|
|
690
729
|
: 0n;
|
|
691
730
|
return {
|
|
692
731
|
getRequirements: async () => {
|
|
693
|
-
const authTx = await
|
|
732
|
+
const authTx = await getBlueAuthorizationRequirement({
|
|
694
733
|
viemClient: this.client.viemClient,
|
|
695
734
|
chainId: this.chainId,
|
|
696
735
|
userAddress,
|
|
736
|
+
supportSignature: this.client.options.supportSignature,
|
|
697
737
|
});
|
|
698
738
|
return authTx ? [authTx] : [];
|
|
699
739
|
},
|
|
700
|
-
buildTx: () =>
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
740
|
+
buildTx: (signatures) => {
|
|
741
|
+
const { authorization } = selectRequirementSignatures(signatures, {
|
|
742
|
+
authorization: true,
|
|
743
|
+
});
|
|
744
|
+
return blueRefinance({
|
|
745
|
+
source: {
|
|
746
|
+
chainId: this.chainId,
|
|
747
|
+
marketParams: this.marketParams,
|
|
748
|
+
},
|
|
749
|
+
target: { marketParams: target.marketParams },
|
|
750
|
+
args: {
|
|
751
|
+
user: userAddress,
|
|
752
|
+
collateralAmount,
|
|
753
|
+
borrowAssets: borrowAssetsAdjusted,
|
|
754
|
+
borrowShares: requestedShares,
|
|
755
|
+
minBorrowSharePrice,
|
|
756
|
+
maxRepaySharePrice,
|
|
757
|
+
targetReallocations,
|
|
758
|
+
authorizationSignature: authorization,
|
|
759
|
+
},
|
|
760
|
+
metadata: this.client.options.metadata,
|
|
761
|
+
});
|
|
762
|
+
},
|
|
717
763
|
};
|
|
718
764
|
}
|
|
719
765
|
/**
|
|
@@ -200,28 +200,28 @@ export declare class ReallocationData implements InputReallocationData {
|
|
|
200
200
|
*/
|
|
201
201
|
getPublicReallocationLiquidity(marketId: MarketId, options?: PublicAllocatorOptions): bigint;
|
|
202
202
|
/**
|
|
203
|
-
* Computes the liquidity available to bring `marketId` to `
|
|
203
|
+
* Computes the liquidity available to bring `marketId` to `utilization`,
|
|
204
204
|
* counting the public-allocator liquidity reallocatable into it.
|
|
205
205
|
*
|
|
206
206
|
* Returns the max borrow `x` keeping post-borrow utilization
|
|
207
|
-
* `(borrow + x) / (supply + L) ≤
|
|
207
|
+
* `(borrow + x) / (supply + L) ≤ utilization`, where `L` is the
|
|
208
208
|
* reallocatable liquidity added to the market's supply — equivalently
|
|
209
|
-
* `getBorrowToUtilization({ supply + L, borrow },
|
|
210
|
-
*
|
|
209
|
+
* `getBorrowToUtilization({ supply + L, borrow }, utilization)`. Below
|
|
210
|
+
* `utilization` this is the market's own borrow headroom plus `utilization · L`;
|
|
211
211
|
* reallocated supply also raises the supply denominator, so only that scaled
|
|
212
212
|
* share backs further borrow.
|
|
213
213
|
*
|
|
214
214
|
* Read-only metric — never throws on insufficiency:
|
|
215
215
|
* - returns only the market's own borrow headroom when
|
|
216
|
-
* `supplyTargetUtilization >
|
|
217
|
-
* trigger at that
|
|
218
|
-
* - returns `0n` when the market is already at or above
|
|
219
|
-
* too small to bring it back under.
|
|
216
|
+
* `supplyTargetUtilization > utilization` (reallocation would not
|
|
217
|
+
* trigger at that utilization);
|
|
218
|
+
* - returns `0n` when the market is already at or above `utilization` and `L`
|
|
219
|
+
* is too small to bring it back under.
|
|
220
220
|
*
|
|
221
221
|
* @param marketId - Target market to borrow from.
|
|
222
|
-
* @param
|
|
222
|
+
* @param utilization - Utilization to bring the market to, scaled by WAD. Defaults to {@link DEFAULT_SUPPLY_TARGET_UTILIZATION}.
|
|
223
223
|
* @param options - Optional reallocation options (supply target utilization trigger, timestamp, withdrawal caps).
|
|
224
|
-
* @returns Available liquidity to the
|
|
224
|
+
* @returns Available liquidity to the given utilization in loan-token units; `0n` when none is available.
|
|
225
225
|
* @throws {@link UnknownReallocationMarketError} when the target market is absent.
|
|
226
226
|
* @example
|
|
227
227
|
* ```ts
|
|
@@ -245,14 +245,14 @@ export declare class ReallocationData implements InputReallocationData {
|
|
|
245
245
|
*
|
|
246
246
|
* // Max borrow keeping utilization at or below 90%, counting shared liquidity.
|
|
247
247
|
* const available: bigint =
|
|
248
|
-
* reallocationData.
|
|
248
|
+
* reallocationData.getAvailableLiquidityToUtilization(
|
|
249
249
|
* marketParams.id,
|
|
250
250
|
* parseEther("0.9"),
|
|
251
251
|
* { timestamp: block.timestamp },
|
|
252
252
|
* );
|
|
253
253
|
* ```
|
|
254
254
|
*/
|
|
255
|
-
|
|
255
|
+
getAvailableLiquidityToUtilization(marketId: MarketId, utilization?: bigint, options?: ReallocationComputeOptions): bigint;
|
|
256
256
|
/**
|
|
257
257
|
* Gets the largest currently valid source-market withdrawal for a vault.
|
|
258
258
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { bigIntComparator } from "@morpho-org/morpho-ts";
|
|
1
|
+
import { AccrualPosition, Market, MarketUtils, MathLib, Position, UnknownDataError, Vault, VaultMarketConfig, VaultMarketPublicAllocatorConfig, } from "@morpho-org/blue-sdk";
|
|
2
|
+
import { _try, bigIntComparator } from "@morpho-org/morpho-ts";
|
|
3
3
|
import { DEFAULT_SUPPLY_TARGET_UTILIZATION, DEFAULT_WITHDRAWAL_TARGET_UTILIZATION, } from "../helpers/constant.js";
|
|
4
4
|
import { getSupplyTargetUtilization } from "../helpers/utilization.js";
|
|
5
5
|
import { DisabledReallocationMarketError, MissingPublicAllocatorConfigError, UnknownReallocationMarketError, UnknownReallocationPositionError, UnknownReallocationVaultError, UnknownReallocationVaultMarketConfigError, } from "../types/index.js";
|
|
@@ -345,28 +345,28 @@ export class ReallocationData {
|
|
|
345
345
|
return withdrawals.reduce((total, { assets }) => total + assets, 0n);
|
|
346
346
|
}
|
|
347
347
|
/**
|
|
348
|
-
* Computes the liquidity available to bring `marketId` to `
|
|
348
|
+
* Computes the liquidity available to bring `marketId` to `utilization`,
|
|
349
349
|
* counting the public-allocator liquidity reallocatable into it.
|
|
350
350
|
*
|
|
351
351
|
* Returns the max borrow `x` keeping post-borrow utilization
|
|
352
|
-
* `(borrow + x) / (supply + L) ≤
|
|
352
|
+
* `(borrow + x) / (supply + L) ≤ utilization`, where `L` is the
|
|
353
353
|
* reallocatable liquidity added to the market's supply — equivalently
|
|
354
|
-
* `getBorrowToUtilization({ supply + L, borrow },
|
|
355
|
-
*
|
|
354
|
+
* `getBorrowToUtilization({ supply + L, borrow }, utilization)`. Below
|
|
355
|
+
* `utilization` this is the market's own borrow headroom plus `utilization · L`;
|
|
356
356
|
* reallocated supply also raises the supply denominator, so only that scaled
|
|
357
357
|
* share backs further borrow.
|
|
358
358
|
*
|
|
359
359
|
* Read-only metric — never throws on insufficiency:
|
|
360
360
|
* - returns only the market's own borrow headroom when
|
|
361
|
-
* `supplyTargetUtilization >
|
|
362
|
-
* trigger at that
|
|
363
|
-
* - returns `0n` when the market is already at or above
|
|
364
|
-
* too small to bring it back under.
|
|
361
|
+
* `supplyTargetUtilization > utilization` (reallocation would not
|
|
362
|
+
* trigger at that utilization);
|
|
363
|
+
* - returns `0n` when the market is already at or above `utilization` and `L`
|
|
364
|
+
* is too small to bring it back under.
|
|
365
365
|
*
|
|
366
366
|
* @param marketId - Target market to borrow from.
|
|
367
|
-
* @param
|
|
367
|
+
* @param utilization - Utilization to bring the market to, scaled by WAD. Defaults to {@link DEFAULT_SUPPLY_TARGET_UTILIZATION}.
|
|
368
368
|
* @param options - Optional reallocation options (supply target utilization trigger, timestamp, withdrawal caps).
|
|
369
|
-
* @returns Available liquidity to the
|
|
369
|
+
* @returns Available liquidity to the given utilization in loan-token units; `0n` when none is available.
|
|
370
370
|
* @throws {@link UnknownReallocationMarketError} when the target market is absent.
|
|
371
371
|
* @example
|
|
372
372
|
* ```ts
|
|
@@ -390,26 +390,26 @@ export class ReallocationData {
|
|
|
390
390
|
*
|
|
391
391
|
* // Max borrow keeping utilization at or below 90%, counting shared liquidity.
|
|
392
392
|
* const available: bigint =
|
|
393
|
-
* reallocationData.
|
|
393
|
+
* reallocationData.getAvailableLiquidityToUtilization(
|
|
394
394
|
* marketParams.id,
|
|
395
395
|
* parseEther("0.9"),
|
|
396
396
|
* { timestamp: block.timestamp },
|
|
397
397
|
* );
|
|
398
398
|
* ```
|
|
399
399
|
*/
|
|
400
|
-
// biome-ignore lint/complexity/useMaxParams: (marketId,
|
|
401
|
-
|
|
400
|
+
// biome-ignore lint/complexity/useMaxParams: (marketId, utilization, options) is the metric's public API
|
|
401
|
+
getAvailableLiquidityToUtilization(marketId, utilization = DEFAULT_SUPPLY_TARGET_UTILIZATION, options) {
|
|
402
402
|
const market = this.getMarket(marketId).accrueInterest(options?.timestamp);
|
|
403
403
|
// Below the allocator's trigger, no reallocation happens: own headroom only.
|
|
404
404
|
const supplyTargetUtilization = getSupplyTargetUtilization(marketId, options);
|
|
405
|
-
if (supplyTargetUtilization >
|
|
406
|
-
return market.getBorrowToUtilization(
|
|
405
|
+
if (supplyTargetUtilization > utilization)
|
|
406
|
+
return market.getBorrowToUtilization(utilization);
|
|
407
407
|
// Borrow-to-target on the post-reallocation supply; clamps to 0n above target.
|
|
408
408
|
const availableLiquidity = this.getPublicReallocationLiquidity(marketId, options);
|
|
409
409
|
return MarketUtils.getBorrowToUtilization({
|
|
410
410
|
totalSupplyAssets: market.totalSupplyAssets + availableLiquidity,
|
|
411
411
|
totalBorrowAssets: market.totalBorrowAssets,
|
|
412
|
-
},
|
|
412
|
+
}, utilization);
|
|
413
413
|
}
|
|
414
414
|
/**
|
|
415
415
|
* Gets the largest currently valid source-market withdrawal for a vault.
|
|
@@ -2,7 +2,7 @@ import { type AccrualVault, type AccrualVaultV2 } from "@morpho-org/blue-sdk";
|
|
|
2
2
|
import { fetchAccrualVault } from "@morpho-org/blue-sdk-viem";
|
|
3
3
|
import { type Address } from "viem";
|
|
4
4
|
import type { FetchParameters } from "../../types/data.js";
|
|
5
|
-
import { type DepositAmountArgs, type ERC20ApprovalAction, type MorphoClientType, type Requirement, type RequirementSignature, type Transaction, type VaultV1DepositAction, type VaultV1MigrateToV2Action, type VaultV1RedeemAction, type VaultV1WithdrawAction } from "../../types/index.js";
|
|
5
|
+
import { type DepositAmountArgs, type ERC20ApprovalAction, type MorphoClientType, type PermitRequirementSignature, type Requirement, type RequirementSignature, type Transaction, type VaultV1DepositAction, type VaultV1MigrateToV2Action, type VaultV1RedeemAction, type VaultV1WithdrawAction } from "../../types/index.js";
|
|
6
6
|
export interface VaultV1Actions {
|
|
7
7
|
/**
|
|
8
8
|
* Fetches the latest vault data with accrued interest.
|
|
@@ -30,10 +30,10 @@ export interface VaultV1Actions {
|
|
|
30
30
|
vaultData: AccrualVault;
|
|
31
31
|
slippageTolerance?: bigint;
|
|
32
32
|
} & DepositAmountArgs) => {
|
|
33
|
-
buildTx: (
|
|
33
|
+
buildTx: (signatures?: readonly RequirementSignature[]) => Readonly<Transaction<VaultV1DepositAction>>;
|
|
34
34
|
getRequirements: (params?: {
|
|
35
35
|
useSimplePermit?: boolean;
|
|
36
|
-
}) => Promise<(Readonly<Transaction<ERC20ApprovalAction>> | Requirement)[]>;
|
|
36
|
+
}) => Promise<(Readonly<Transaction<ERC20ApprovalAction>> | Requirement<PermitRequirementSignature>)[]>;
|
|
37
37
|
};
|
|
38
38
|
/**
|
|
39
39
|
* Prepares a withdraw from a VaultV1 (MetaMorpho) contract.
|
|
@@ -84,8 +84,8 @@ export interface VaultV1Actions {
|
|
|
84
84
|
shares: bigint;
|
|
85
85
|
slippageTolerance?: bigint;
|
|
86
86
|
}) => {
|
|
87
|
-
buildTx: (
|
|
88
|
-
getRequirements: () => Promise<(Readonly<Transaction<ERC20ApprovalAction>> | Requirement)[]>;
|
|
87
|
+
buildTx: (signatures?: readonly RequirementSignature[]) => Readonly<Transaction<VaultV1MigrateToV2Action>>;
|
|
88
|
+
getRequirements: () => Promise<(Readonly<Transaction<ERC20ApprovalAction>> | Requirement<PermitRequirementSignature>)[]>;
|
|
89
89
|
};
|
|
90
90
|
}
|
|
91
91
|
export declare class MorphoVaultV1 implements VaultV1Actions {
|
|
@@ -101,8 +101,8 @@ export declare class MorphoVaultV1 implements VaultV1Actions {
|
|
|
101
101
|
} & DepositAmountArgs): {
|
|
102
102
|
getRequirements: (params?: {
|
|
103
103
|
useSimplePermit?: boolean;
|
|
104
|
-
}) => Promise<(
|
|
105
|
-
buildTx: (
|
|
104
|
+
}) => Promise<(import("../../types/action.js").Bundler3TokenSignatureRequirement | Readonly<Transaction<ERC20ApprovalAction>>)[]>;
|
|
105
|
+
buildTx: (signatures?: readonly RequirementSignature[]) => Readonly<Transaction<VaultV1DepositAction>>;
|
|
106
106
|
};
|
|
107
107
|
withdraw({ amount, userAddress }: {
|
|
108
108
|
amount: bigint;
|
|
@@ -123,7 +123,7 @@ export declare class MorphoVaultV1 implements VaultV1Actions {
|
|
|
123
123
|
shares: bigint;
|
|
124
124
|
slippageTolerance?: bigint;
|
|
125
125
|
}): {
|
|
126
|
-
getRequirements: () => Promise<(
|
|
127
|
-
buildTx: (
|
|
126
|
+
getRequirements: () => Promise<(import("../../types/action.js").Bundler3TokenSignatureRequirement | Readonly<Transaction<ERC20ApprovalAction>>)[]>;
|
|
127
|
+
buildTx: (signatures?: readonly RequirementSignature[]) => Readonly<Transaction<VaultV1MigrateToV2Action>>;
|
|
128
128
|
};
|
|
129
129
|
}
|