@morpho-org/morpho-sdk 5.8.0 → 5.10.1
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 +4 -0
- package/lib/cjs/abis.d.ts +543 -0
- package/lib/cjs/abis.js +738 -0
- package/lib/cjs/actions/blue/borrow.d.ts +5 -2
- package/lib/cjs/actions/blue/borrow.js +1 -1
- package/lib/cjs/actions/blue/refinance.d.ts +7 -2
- package/lib/cjs/actions/blue/refinance.js +3 -1
- package/lib/cjs/actions/blue/supplyCollateralBorrow.d.ts +6 -2
- package/lib/cjs/actions/blue/supplyCollateralBorrow.js +2 -1
- package/lib/cjs/actions/blue/withdraw.d.ts +2 -1
- package/lib/cjs/actions/blue/withdraw.js +1 -1
- package/lib/cjs/actions/midnight/supplyCollateralTakeBorrow.d.ts +2 -2
- package/lib/cjs/actions/midnight/supplyCollateralTakeBorrow.js +2 -2
- package/lib/cjs/actions/midnight/takeBorrow.d.ts +2 -2
- package/lib/cjs/actions/midnight/takeBorrow.js +2 -2
- package/lib/cjs/actions/midnight/takeLend.d.ts +2 -2
- package/lib/cjs/actions/midnight/takeLend.js +2 -2
- package/lib/cjs/blue/types.d.ts +3 -1
- package/lib/cjs/blue/utils.d.ts +3 -1
- package/lib/cjs/blue/utils.js +1 -0
- package/lib/cjs/bundler/actions.d.ts +2 -0
- package/lib/cjs/bundler/actions.js +2 -0
- package/lib/cjs/bundler/types.d.ts +10 -1
- package/lib/cjs/entities/blue/blue.d.ts +30 -5
- package/lib/cjs/entities/blue/blue.js +8 -2
- package/lib/cjs/entities/midnight/midnight.d.ts +2 -2
- package/lib/cjs/entities/vaultV1/vaultV1.d.ts +69 -12
- package/lib/cjs/entities/vaultV1/vaultV1.js +11 -14
- package/lib/cjs/entities/vaultV1ReallocationData.d.ts +18 -3
- package/lib/cjs/entities/vaultV1ReallocationData.js +11 -1
- package/lib/cjs/entities/vaultV2/vaultV2.js +6 -18
- package/lib/cjs/entities/vaultV2BlueReallocationData.js +5 -1
- package/lib/cjs/helpers/computeVaultV1Reallocations.d.ts +4 -1
- package/lib/cjs/helpers/computeVaultV1Reallocations.js +4 -1
- package/lib/cjs/helpers/metadata.d.ts +3 -5
- package/lib/cjs/helpers/metadata.js +4 -6
- package/lib/cjs/helpers/validate.d.ts +2 -0
- package/lib/cjs/helpers/validate.js +2 -0
- package/lib/cjs/types/error.d.ts +34 -6
- package/lib/cjs/types/error.js +34 -6
- package/lib/cjs/types/sharedLiquidity.d.ts +26 -3
- package/lib/cjs/types.d.ts +3 -1
- package/lib/cjs/utils.d.ts +3 -1
- package/lib/cjs/utils.js +1 -0
- package/lib/esm/abis.d.ts +543 -0
- package/lib/esm/abis.js +737 -0
- package/lib/esm/actions/blue/borrow.d.ts +5 -2
- package/lib/esm/actions/blue/borrow.js +1 -1
- package/lib/esm/actions/blue/refinance.d.ts +7 -2
- package/lib/esm/actions/blue/refinance.js +3 -1
- package/lib/esm/actions/blue/supplyCollateralBorrow.d.ts +6 -2
- package/lib/esm/actions/blue/supplyCollateralBorrow.js +2 -1
- package/lib/esm/actions/blue/withdraw.d.ts +2 -1
- package/lib/esm/actions/blue/withdraw.js +1 -1
- package/lib/esm/actions/midnight/supplyCollateralTakeBorrow.d.ts +2 -2
- package/lib/esm/actions/midnight/supplyCollateralTakeBorrow.js +2 -2
- package/lib/esm/actions/midnight/takeBorrow.d.ts +2 -2
- package/lib/esm/actions/midnight/takeBorrow.js +2 -2
- package/lib/esm/actions/midnight/takeLend.d.ts +2 -2
- package/lib/esm/actions/midnight/takeLend.js +2 -2
- package/lib/esm/blue/types.d.ts +3 -1
- package/lib/esm/blue/utils.d.ts +3 -1
- package/lib/esm/blue/utils.js +3 -1
- package/lib/esm/bundler/actions.d.ts +2 -0
- package/lib/esm/bundler/actions.js +2 -0
- package/lib/esm/bundler/types.d.ts +10 -1
- package/lib/esm/entities/blue/blue.d.ts +30 -5
- package/lib/esm/entities/blue/blue.js +8 -2
- package/lib/esm/entities/midnight/midnight.d.ts +2 -2
- package/lib/esm/entities/vaultV1/vaultV1.d.ts +69 -12
- package/lib/esm/entities/vaultV1/vaultV1.js +11 -14
- package/lib/esm/entities/vaultV1ReallocationData.d.ts +18 -3
- package/lib/esm/entities/vaultV1ReallocationData.js +13 -2
- package/lib/esm/entities/vaultV2/vaultV2.js +7 -19
- package/lib/esm/entities/vaultV2BlueReallocationData.js +5 -1
- package/lib/esm/helpers/computeVaultV1Reallocations.d.ts +4 -1
- package/lib/esm/helpers/computeVaultV1Reallocations.js +4 -1
- package/lib/esm/helpers/metadata.d.ts +3 -5
- package/lib/esm/helpers/metadata.js +4 -6
- package/lib/esm/helpers/validate.d.ts +2 -0
- package/lib/esm/helpers/validate.js +2 -0
- package/lib/esm/types/error.d.ts +34 -6
- package/lib/esm/types/error.js +34 -6
- package/lib/esm/types/sharedLiquidity.d.ts +26 -3
- package/lib/esm/types.d.ts +3 -1
- package/lib/esm/utils.d.ts +3 -1
- package/lib/esm/utils.js +3 -1
- package/package.json +8 -8
|
@@ -14,7 +14,10 @@ export interface BlueBorrowParams {
|
|
|
14
14
|
receiver: Address;
|
|
15
15
|
/** Minimum borrow share price (in ray). Protects against share price manipulation. */
|
|
16
16
|
minSharePrice: bigint;
|
|
17
|
-
/**
|
|
17
|
+
/**
|
|
18
|
+
* Homogeneous Vault V1 or Vault V2 reallocations to execute before borrowing.
|
|
19
|
+
* Vault V1 inputs are deprecated for high-level Blue writes; use Vault V2 for new integrations.
|
|
20
|
+
*/
|
|
18
21
|
reallocations?: BlueReallocationPlan;
|
|
19
22
|
/**
|
|
20
23
|
* Optional signed Morpho authorization. When provided, a `setAuthorizationWithSig` call is
|
|
@@ -43,7 +46,7 @@ export interface BlueBorrowParams {
|
|
|
43
46
|
* @param params.args.receiver - Address that receives the borrowed assets.
|
|
44
47
|
* @param params.args.minSharePrice - Minimum borrow share price (in ray). Slippage protection.
|
|
45
48
|
* @param params.args.reallocations - Optional homogeneous Vault V1 or Vault V2 reallocations to
|
|
46
|
-
* execute before borrowing.
|
|
49
|
+
* execute before borrowing. Vault V1 inputs are deprecated; use Vault V2 for new integrations.
|
|
47
50
|
* @param params.args.authorizationSignature - Optional signed Morpho authorization; when present,
|
|
48
51
|
* a `setAuthorizationWithSig` call is prepended to the bundle.
|
|
49
52
|
* @param params.metadata - Optional analytics metadata attached to the bundle.
|
|
@@ -25,7 +25,7 @@ const buildReallocationActions_js_1 = require("./buildReallocationActions.js");
|
|
|
25
25
|
* @param params.args.receiver - Address that receives the borrowed assets.
|
|
26
26
|
* @param params.args.minSharePrice - Minimum borrow share price (in ray). Slippage protection.
|
|
27
27
|
* @param params.args.reallocations - Optional homogeneous Vault V1 or Vault V2 reallocations to
|
|
28
|
-
* execute before borrowing.
|
|
28
|
+
* execute before borrowing. Vault V1 inputs are deprecated; use Vault V2 for new integrations.
|
|
29
29
|
* @param params.args.authorizationSignature - Optional signed Morpho authorization; when present,
|
|
30
30
|
* a `setAuthorizationWithSig` call is prepended to the bundle.
|
|
31
31
|
* @param params.metadata - Optional analytics metadata attached to the bundle.
|
|
@@ -27,7 +27,10 @@ export interface BlueRefinanceParams {
|
|
|
27
27
|
minBorrowSharePrice: bigint;
|
|
28
28
|
/** Maximum repay share price on the source market (in ray); must be > 0 when a repay leg exists. */
|
|
29
29
|
maxRepaySharePrice: bigint;
|
|
30
|
-
/**
|
|
30
|
+
/**
|
|
31
|
+
* Homogeneous Vault V1 or Vault V2 reallocations into the target market.
|
|
32
|
+
* Vault V1 inputs are deprecated for high-level Blue writes; use Vault V2 for new integrations.
|
|
33
|
+
*/
|
|
31
34
|
targetReallocations?: BlueReallocationPlan;
|
|
32
35
|
/**
|
|
33
36
|
* Optional signed Morpho authorization. When provided, a `setAuthorizationWithSig` call is
|
|
@@ -85,7 +88,9 @@ export interface BlueRefinanceParams {
|
|
|
85
88
|
* @param params.args.minBorrowSharePrice - Minimum borrow share price (ray) on the target.
|
|
86
89
|
* @param params.args.maxRepaySharePrice - Maximum repay share price (ray) on the source.
|
|
87
90
|
* @param params.args.targetReallocations - Homogeneous Vault V1 or Vault V2 reallocations into the
|
|
88
|
-
* target, run before the supply leg. V1
|
|
91
|
+
* target, run before the supply leg. Vault V1 inputs are deprecated for high-level Blue writes;
|
|
92
|
+
* use Vault V2 for new integrations. V1 fees add to `tx.value`; V2 penalties are paid in the
|
|
93
|
+
* target loan token.
|
|
89
94
|
* @param params.args.authorizationSignature - Optional signed Morpho authorization; when present,
|
|
90
95
|
* a `setAuthorizationWithSig` call is prepended to the bundle.
|
|
91
96
|
* @param params.metadata - Optional analytics metadata appended to `tx.data`.
|
|
@@ -56,7 +56,9 @@ const buildReallocationActions_js_1 = require("./buildReallocationActions.js");
|
|
|
56
56
|
* @param params.args.minBorrowSharePrice - Minimum borrow share price (ray) on the target.
|
|
57
57
|
* @param params.args.maxRepaySharePrice - Maximum repay share price (ray) on the source.
|
|
58
58
|
* @param params.args.targetReallocations - Homogeneous Vault V1 or Vault V2 reallocations into the
|
|
59
|
-
* target, run before the supply leg. V1
|
|
59
|
+
* target, run before the supply leg. Vault V1 inputs are deprecated for high-level Blue writes;
|
|
60
|
+
* use Vault V2 for new integrations. V1 fees add to `tx.value`; V2 penalties are paid in the
|
|
61
|
+
* target loan token.
|
|
60
62
|
* @param params.args.authorizationSignature - Optional signed Morpho authorization; when present,
|
|
61
63
|
* a `setAuthorizationWithSig` call is prepended to the bundle.
|
|
62
64
|
* @param params.metadata - Optional analytics metadata appended to `tx.data`.
|
|
@@ -18,7 +18,10 @@ export interface BlueSupplyCollateralBorrowParams {
|
|
|
18
18
|
minSharePrice: bigint;
|
|
19
19
|
/** Optional pre-signed permit/permit2 approval for the collateral transfer. */
|
|
20
20
|
requirementSignature?: PermitRequirementSignature;
|
|
21
|
-
/**
|
|
21
|
+
/**
|
|
22
|
+
* Homogeneous Vault V1 or Vault V2 reallocations to execute before borrowing.
|
|
23
|
+
* Vault V1 inputs are deprecated for high-level Blue writes; use Vault V2 for new integrations.
|
|
24
|
+
*/
|
|
22
25
|
reallocations?: BlueReallocationPlan;
|
|
23
26
|
/**
|
|
24
27
|
* Optional signed Morpho authorization. When provided, a `setAuthorizationWithSig` call is
|
|
@@ -59,7 +62,8 @@ export interface BlueSupplyCollateralBorrowParams {
|
|
|
59
62
|
* @param params.args.nativeAmount - Optional amount of native token to wrap into wNative for the
|
|
60
63
|
* collateral supply. Requires the collateral token to be the chain's wNative.
|
|
61
64
|
* @param params.args.reallocations - Optional homogeneous Vault V1 or Vault V2 reallocations to
|
|
62
|
-
* execute between the supply and borrow legs.
|
|
65
|
+
* execute between the supply and borrow legs. Vault V1 inputs are deprecated; use Vault V2 for
|
|
66
|
+
* new integrations.
|
|
63
67
|
* @param params.args.authorizationSignature - Optional signed Morpho authorization; when present,
|
|
64
68
|
* a `setAuthorizationWithSig` call is prepended to the bundle.
|
|
65
69
|
* @param params.metadata - Optional analytics metadata attached to the bundle.
|
|
@@ -39,7 +39,8 @@ const buildReallocationActions_js_1 = require("./buildReallocationActions.js");
|
|
|
39
39
|
* @param params.args.nativeAmount - Optional amount of native token to wrap into wNative for the
|
|
40
40
|
* collateral supply. Requires the collateral token to be the chain's wNative.
|
|
41
41
|
* @param params.args.reallocations - Optional homogeneous Vault V1 or Vault V2 reallocations to
|
|
42
|
-
* execute between the supply and borrow legs.
|
|
42
|
+
* execute between the supply and borrow legs. Vault V1 inputs are deprecated; use Vault V2 for
|
|
43
|
+
* new integrations.
|
|
43
44
|
* @param params.args.authorizationSignature - Optional signed Morpho authorization; when present,
|
|
44
45
|
* a `setAuthorizationWithSig` call is prepended to the bundle.
|
|
45
46
|
* @param params.metadata - Optional analytics metadata attached to the bundle.
|
|
@@ -20,6 +20,7 @@ export interface BlueWithdrawParams {
|
|
|
20
20
|
* Homogeneous Vault V1 or Vault V2 reallocations to execute before withdrawing. V1 entries can be
|
|
21
21
|
* computed via `MorphoBlue.getVaultV1Reallocations({ operation: "withdraw", amount })` or directly
|
|
22
22
|
* via `computeVaultV1Reallocations({ operation: "withdraw", amount, ... })`.
|
|
23
|
+
* Vault V1 inputs are deprecated for high-level Blue writes; use Vault V2 for new integrations.
|
|
23
24
|
*/
|
|
24
25
|
reallocations?: BlueReallocationPlan;
|
|
25
26
|
/**
|
|
@@ -59,7 +60,7 @@ export interface BlueWithdrawParams {
|
|
|
59
60
|
* @param params.args.minSharePrice - Minimum acceptable withdraw share price (in ray). Slippage
|
|
60
61
|
* protection.
|
|
61
62
|
* @param params.args.reallocations - Optional homogeneous Vault V1 or Vault V2 reallocations to
|
|
62
|
-
* execute before withdrawing.
|
|
63
|
+
* execute before withdrawing. Vault V1 inputs are deprecated; use Vault V2 for new integrations.
|
|
63
64
|
* @param params.args.authorizationSignature - Optional signed Morpho authorization; when present,
|
|
64
65
|
* a `setAuthorizationWithSig` call is prepended to the bundle.
|
|
65
66
|
* @param params.metadata - Optional analytics metadata attached to the bundle.
|
|
@@ -35,7 +35,7 @@ const buildReallocationActions_js_1 = require("./buildReallocationActions.js");
|
|
|
35
35
|
* @param params.args.minSharePrice - Minimum acceptable withdraw share price (in ray). Slippage
|
|
36
36
|
* protection.
|
|
37
37
|
* @param params.args.reallocations - Optional homogeneous Vault V1 or Vault V2 reallocations to
|
|
38
|
-
* execute before withdrawing.
|
|
38
|
+
* execute before withdrawing. Vault V1 inputs are deprecated; use Vault V2 for new integrations.
|
|
39
39
|
* @param params.args.authorizationSignature - Optional signed Morpho authorization; when present,
|
|
40
40
|
* a `setAuthorizationWithSig` call is prepended to the bundle.
|
|
41
41
|
* @param params.metadata - Optional analytics metadata attached to the bundle.
|
|
@@ -40,8 +40,8 @@ export interface MidnightSupplyCollateralTakeBorrowParams extends MidnightTakeBo
|
|
|
40
40
|
* chainId: 8453,
|
|
41
41
|
* market: marketData.params,
|
|
42
42
|
* collateralAssets: 2_000_000n,
|
|
43
|
-
* loanAssets:
|
|
44
|
-
* maxUnits:
|
|
43
|
+
* loanAssets: 1_000_000n,
|
|
44
|
+
* maxUnits: 1_100_000n,
|
|
45
45
|
* taker: borrower,
|
|
46
46
|
* takeableOffers: quote.data.takeableOffers,
|
|
47
47
|
* deadline: maxUint256,
|
|
@@ -44,8 +44,8 @@ const types_js_1 = require("./types.js");
|
|
|
44
44
|
* chainId: 8453,
|
|
45
45
|
* market: marketData.params,
|
|
46
46
|
* collateralAssets: 2_000_000n,
|
|
47
|
-
* loanAssets:
|
|
48
|
-
* maxUnits:
|
|
47
|
+
* loanAssets: 1_000_000n,
|
|
48
|
+
* maxUnits: 1_100_000n,
|
|
49
49
|
* taker: borrower,
|
|
50
50
|
* takeableOffers: quote.data.takeableOffers,
|
|
51
51
|
* deadline: maxUint256,
|
|
@@ -46,8 +46,8 @@ export interface MidnightTakeBorrowParams {
|
|
|
46
46
|
* const tx = midnightTakeBorrow({
|
|
47
47
|
* chainId: 8453,
|
|
48
48
|
* market: marketData.params,
|
|
49
|
-
* loanAssets:
|
|
50
|
-
* maxUnits:
|
|
49
|
+
* loanAssets: 1_000_000n,
|
|
50
|
+
* maxUnits: 1_100_000n,
|
|
51
51
|
* taker: borrower,
|
|
52
52
|
* takeableOffers: quote.data.takeableOffers,
|
|
53
53
|
* deadline: maxUint256,
|
|
@@ -40,8 +40,8 @@ const index_js_2 = require("../../types/index.js");
|
|
|
40
40
|
* const tx = midnightTakeBorrow({
|
|
41
41
|
* chainId: 8453,
|
|
42
42
|
* market: marketData.params,
|
|
43
|
-
* loanAssets:
|
|
44
|
-
* maxUnits:
|
|
43
|
+
* loanAssets: 1_000_000n,
|
|
44
|
+
* maxUnits: 1_100_000n,
|
|
45
45
|
* taker: borrower,
|
|
46
46
|
* takeableOffers: quote.data.takeableOffers,
|
|
47
47
|
* deadline: maxUint256,
|
|
@@ -46,8 +46,8 @@ export interface MidnightTakeLendParams {
|
|
|
46
46
|
* const tx = midnightTakeLend({
|
|
47
47
|
* chainId: 8453,
|
|
48
48
|
* market: marketData.params,
|
|
49
|
-
* assets:
|
|
50
|
-
* minUnits:
|
|
49
|
+
* assets: 1_000_000n,
|
|
50
|
+
* minUnits: 900_000n,
|
|
51
51
|
* taker: lender,
|
|
52
52
|
* takeableOffers: quote.data.takeableOffers,
|
|
53
53
|
* deadline: maxUint256,
|
|
@@ -41,8 +41,8 @@ const types_js_1 = require("./types.js");
|
|
|
41
41
|
* const tx = midnightTakeLend({
|
|
42
42
|
* chainId: 8453,
|
|
43
43
|
* market: marketData.params,
|
|
44
|
-
* assets:
|
|
45
|
-
* minUnits:
|
|
44
|
+
* assets: 1_000_000n,
|
|
45
|
+
* minUnits: 900_000n,
|
|
46
46
|
* taker: lender,
|
|
47
47
|
* takeableOffers: quote.data.takeableOffers,
|
|
48
48
|
* deadline: maxUint256,
|
package/lib/cjs/blue/types.d.ts
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
export type { BigIntish, CollateralAllocation, Eip712Field, Erc20AllowanceRecipient, Failable, Fetchable, InputMarketParams, IPermit2Allowance, Loadable, MarketId, MaxBorrowOptions, MaxPositionCapacities, MaxWithdrawCollateralOptions, Pending, Permit2Allowance, } from "@morpho-org/blue-sdk";
|
|
2
|
-
export type { AuthorizationArgs,
|
|
2
|
+
export type { AuthorizationArgs,
|
|
3
|
+
/** @deprecated Args for the deprecated getDaiPermitTypedData; scheduled for removal in the next major. */
|
|
4
|
+
DaiPermitArgs, DeploylessFetchParameters, FetchParameters, InputAllocation, MetaMorphoCall, Permit2PermitArgs, Permit2TransferFromArgs, PermitArgs, } from "@morpho-org/blue-sdk-viem";
|
package/lib/cjs/blue/utils.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
export type { CapacityLimit, RoundingDirection } from "@morpho-org/blue-sdk";
|
|
2
2
|
export { AdaptiveCurveIrmLib, CapacityLimitReason, defaultPreLiquidationParamsRegistry, getDefaultPreLiquidationParams, MarketUtils, MathLib, SharesMath, VaultUtils, VaultV2BlueMarketPublicAllocatorConfigUtils, VaultV2BluePublicAllocatorConfigUtils, VaultV2Utils, } from "@morpho-org/blue-sdk";
|
|
3
|
-
export { decodeBytes32String, getAuthorizationTypedData,
|
|
3
|
+
export { decodeBytes32String, getAuthorizationTypedData,
|
|
4
|
+
/** @deprecated DAI is routed through Permit2 internally; scheduled for removal in the next major. */
|
|
5
|
+
getDaiPermitTypedData, getPermit2PermitTypedData, getPermit2TransferFromTypedData, getPermitTypedData, MetaMorphoAction, optionalBoolean, readContractRestructured, restructure, safeGetAddress, safeParseNumber, safeParseUnits, } from "@morpho-org/blue-sdk-viem";
|
package/lib/cjs/blue/utils.js
CHANGED
|
@@ -16,6 +16,7 @@ Object.defineProperty(exports, "VaultV2Utils", { enumerable: true, get: function
|
|
|
16
16
|
var blue_sdk_viem_1 = require("@morpho-org/blue-sdk-viem");
|
|
17
17
|
Object.defineProperty(exports, "decodeBytes32String", { enumerable: true, get: function () { return blue_sdk_viem_1.decodeBytes32String; } });
|
|
18
18
|
Object.defineProperty(exports, "getAuthorizationTypedData", { enumerable: true, get: function () { return blue_sdk_viem_1.getAuthorizationTypedData; } });
|
|
19
|
+
/** @deprecated DAI is routed through Permit2 internally; scheduled for removal in the next major. */
|
|
19
20
|
Object.defineProperty(exports, "getDaiPermitTypedData", { enumerable: true, get: function () { return blue_sdk_viem_1.getDaiPermitTypedData; } });
|
|
20
21
|
Object.defineProperty(exports, "getPermit2PermitTypedData", { enumerable: true, get: function () { return blue_sdk_viem_1.getPermit2PermitTypedData; } });
|
|
21
22
|
Object.defineProperty(exports, "getPermit2TransferFromTypedData", { enumerable: true, get: function () { return blue_sdk_viem_1.getPermit2TransferFromTypedData; } });
|
|
@@ -622,6 +622,8 @@ export declare namespace BundlerAction {
|
|
|
622
622
|
* @param skipRevert - Whether Bundler3 should tolerate a revert.
|
|
623
623
|
* @returns Encoded Bundler3 calls.
|
|
624
624
|
* @throws {BundlerErrors.UnexpectedAction} when the PublicAllocator is unavailable on the chain.
|
|
625
|
+
* @deprecated Vault V1 PublicAllocator composition will be removed in the next major. Use
|
|
626
|
+
* `vaultV2BluePublicAllocatorReallocate` or `vaultV2BluePublicAllocatorAllocateFromIdle`.
|
|
625
627
|
*
|
|
626
628
|
* @example
|
|
627
629
|
* ```ts
|
|
@@ -1075,6 +1075,8 @@ var BundlerAction;
|
|
|
1075
1075
|
* @param skipRevert - Whether Bundler3 should tolerate a revert.
|
|
1076
1076
|
* @returns Encoded Bundler3 calls.
|
|
1077
1077
|
* @throws {BundlerErrors.UnexpectedAction} when the PublicAllocator is unavailable on the chain.
|
|
1078
|
+
* @deprecated Vault V1 PublicAllocator composition will be removed in the next major. Use
|
|
1079
|
+
* `vaultV2BluePublicAllocatorReallocate` or `vaultV2BluePublicAllocatorAllocateFromIdle`.
|
|
1078
1080
|
*
|
|
1079
1081
|
* @example
|
|
1080
1082
|
* ```ts
|
|
@@ -18,6 +18,9 @@ export interface Authorization {
|
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
20
|
* Public allocator withdrawal input used by a `reallocateTo` Bundler3 action.
|
|
21
|
+
*
|
|
22
|
+
* @deprecated Vault V1 PublicAllocator composition will be removed in the next major. Use Vault V2
|
|
23
|
+
* BluePublicAllocator actions.
|
|
21
24
|
*/
|
|
22
25
|
export interface InputReallocation {
|
|
23
26
|
/** Market to withdraw liquidity from. */
|
|
@@ -172,7 +175,13 @@ export interface ActionArgs {
|
|
|
172
175
|
receiver: Address,
|
|
173
176
|
skipRevert?: boolean
|
|
174
177
|
];
|
|
175
|
-
/**
|
|
178
|
+
/**
|
|
179
|
+
* PublicAllocator reallocation to `supplyMarket` from `vault` withdrawals while paying `fee`;
|
|
180
|
+
* `skipRevert` controls Bundler3 revert handling.
|
|
181
|
+
*
|
|
182
|
+
* @deprecated Vault V1 PublicAllocator composition will be removed in the next major. Use Vault V2
|
|
183
|
+
* BluePublicAllocator actions.
|
|
184
|
+
*/
|
|
176
185
|
readonly reallocateTo: [
|
|
177
186
|
vault: Address,
|
|
178
187
|
fee: bigint,
|
|
@@ -106,6 +106,8 @@ export interface BlueActions {
|
|
|
106
106
|
* When `reallocations` is provided, its homogeneous V1 or V2 actions are
|
|
107
107
|
* prepended to move liquidity before withdrawing. V1 fees add
|
|
108
108
|
* to the transaction value; V2 penalties are paid in the loan token.
|
|
109
|
+
* Vault V1 inputs are deprecated for high-level Blue writes; use Vault V2
|
|
110
|
+
* reallocations for new integrations.
|
|
109
111
|
*
|
|
110
112
|
* `getRequirements` returns the loan-token approval needed for V2 penalties
|
|
111
113
|
* and `morpho.setAuthorization(generalAdapter1, true)` when GA1 is not yet
|
|
@@ -128,6 +130,7 @@ export interface BlueActions {
|
|
|
128
130
|
receiver?: Address;
|
|
129
131
|
positionData: AccrualPosition;
|
|
130
132
|
slippageTolerance?: bigint;
|
|
133
|
+
/** Vault V1 inputs are deprecated for high-level Blue writes; prefer Vault V2. */
|
|
131
134
|
reallocations?: BlueReallocationPlan;
|
|
132
135
|
} & AssetsOrSharesArgs) => {
|
|
133
136
|
buildTx: (signatures?: readonly RequirementSignature[]) => Readonly<Transaction<BlueWithdrawAction>>;
|
|
@@ -143,6 +146,8 @@ export interface BlueActions {
|
|
|
143
146
|
* When `reallocations` is provided, its homogeneous V1 or V2 actions are
|
|
144
147
|
* prepended before borrowing. V1 fees add to the transaction
|
|
145
148
|
* value; V2 penalties are paid in the loan token.
|
|
149
|
+
* Vault V1 inputs are deprecated for high-level Blue writes; use Vault V2
|
|
150
|
+
* reallocations for new integrations.
|
|
146
151
|
*
|
|
147
152
|
* `getRequirements` returns the loan-token approval needed for V2 penalties
|
|
148
153
|
* and Morpho authorization for GeneralAdapter1 when needed.
|
|
@@ -164,6 +169,7 @@ export interface BlueActions {
|
|
|
164
169
|
amount: bigint;
|
|
165
170
|
positionData: AccrualPosition;
|
|
166
171
|
slippageTolerance?: bigint;
|
|
172
|
+
/** Vault V1 inputs are deprecated for high-level Blue writes; prefer Vault V2. */
|
|
167
173
|
reallocations?: BlueReallocationPlan;
|
|
168
174
|
}) => {
|
|
169
175
|
buildTx: (signatures?: readonly RequirementSignature[]) => Readonly<Transaction<BlueBorrowAction>>;
|
|
@@ -265,6 +271,8 @@ export interface BlueActions {
|
|
|
265
271
|
* When `reallocations` is provided, its homogeneous V1 or V2 actions run
|
|
266
272
|
* between the collateral supply and `morphoBorrow`. V1 fees add
|
|
267
273
|
* to the transaction value; V2 penalties are paid in the loan token.
|
|
274
|
+
* Vault V1 inputs are deprecated for high-level Blue writes; use Vault V2
|
|
275
|
+
* reallocations for new integrations.
|
|
268
276
|
*
|
|
269
277
|
* `getRequirements` returns in parallel:
|
|
270
278
|
* - ERC20 approval or permit for collateral token (to GeneralAdapter1).
|
|
@@ -288,6 +296,7 @@ export interface BlueActions {
|
|
|
288
296
|
positionData: AccrualPosition;
|
|
289
297
|
borrowAmount: bigint;
|
|
290
298
|
slippageTolerance?: bigint;
|
|
299
|
+
/** Vault V1 inputs are deprecated for high-level Blue writes; prefer Vault V2. */
|
|
291
300
|
reallocations?: BlueReallocationPlan;
|
|
292
301
|
} & DepositAmountArgs) => {
|
|
293
302
|
buildTx: (signatures?: readonly RequirementSignature[]) => Readonly<Transaction<BlueSupplyCollateralBorrowAction>>;
|
|
@@ -311,6 +320,8 @@ export interface BlueActions {
|
|
|
311
320
|
* A homogeneous V1 or V2 target reallocation plan runs first; V1 fees add
|
|
312
321
|
* to the transaction value and V2 penalties are paid
|
|
313
322
|
* in the loan token.
|
|
323
|
+
* Vault V1 inputs are deprecated for high-level Blue writes; use Vault V2
|
|
324
|
+
* reallocations for new integrations.
|
|
314
325
|
*
|
|
315
326
|
* `getRequirements` returns the loan-token approval needed for V2 penalties
|
|
316
327
|
* and Morpho authorization for GeneralAdapter1 when needed.
|
|
@@ -323,7 +334,8 @@ export interface BlueActions {
|
|
|
323
334
|
* @param params.borrowAssets - Loan assets to repay on source; exclusive with `borrowShares`.
|
|
324
335
|
* @param params.borrowShares - Borrow shares to repay on source; exclusive with `borrowAssets`.
|
|
325
336
|
* @param params.slippageTolerance - WAD slippage tolerance. Defaults to `DEFAULT_SLIPPAGE_TOLERANCE`.
|
|
326
|
-
* @param params.targetReallocations - Homogeneous Vault V1 or Vault V2 reallocations into the
|
|
337
|
+
* @param params.targetReallocations - Homogeneous Vault V1 or Vault V2 reallocations into the
|
|
338
|
+
* target market. Vault V1 inputs are deprecated; prefer Vault V2.
|
|
327
339
|
* @returns Object with `buildTx` and `getRequirements`.
|
|
328
340
|
* @throws {BundlerErrors.UnexpectedAction} when a V2 plan is unsupported on the chain.
|
|
329
341
|
* @throws {InputExceedsMaxError} when a V2 reallocation asset amount exceeds `uint128` or its penalty exceeds WAD.
|
|
@@ -344,6 +356,7 @@ export interface BlueActions {
|
|
|
344
356
|
borrowAssets?: bigint;
|
|
345
357
|
borrowShares?: bigint;
|
|
346
358
|
slippageTolerance?: bigint;
|
|
359
|
+
/** Vault V1 inputs are deprecated for high-level Blue writes; prefer Vault V2. */
|
|
347
360
|
targetReallocations?: BlueReallocationPlan;
|
|
348
361
|
}) => {
|
|
349
362
|
buildTx: (signatures?: readonly RequirementSignature[]) => Readonly<Transaction<BlueRefinanceAction>>;
|
|
@@ -369,6 +382,8 @@ export interface BlueActions {
|
|
|
369
382
|
* @param params.block - The block to fetch data at (number and timestamp).
|
|
370
383
|
* @returns A VaultV1ReallocationData instance populated with all required data.
|
|
371
384
|
* @throws {ChainIdMismatchError} when the client chain does not match this market.
|
|
385
|
+
* @deprecated Vault V1 shared-liquidity planning will be removed in the next major. Use
|
|
386
|
+
* {@link getVaultV2BlueReallocationData}.
|
|
372
387
|
*/
|
|
373
388
|
getVaultV1ReallocationData: (params: {
|
|
374
389
|
vaultAddresses: readonly Address[];
|
|
@@ -385,7 +400,8 @@ export interface BlueActions {
|
|
|
385
400
|
* @param params.block.timestamp - Timestamp corresponding to the fetched block.
|
|
386
401
|
* @returns A `VaultV1ReallocationData` snapshot populated from one block.
|
|
387
402
|
* @throws {ChainIdMismatchError} when the client chain does not match this market.
|
|
388
|
-
* @deprecated
|
|
403
|
+
* @deprecated Vault V1 shared-liquidity planning will be removed in the next major. Use
|
|
404
|
+
* {@link getVaultV2BlueReallocationData}.
|
|
389
405
|
*/
|
|
390
406
|
getReallocationData: (params: {
|
|
391
407
|
vaultAddresses: readonly Address[];
|
|
@@ -444,6 +460,8 @@ export interface BlueActions {
|
|
|
444
460
|
* @throws {ReallocationWithdrawExceedsMarketSupplyError} when a withdrawal exceeds the target market supply.
|
|
445
461
|
* @throws {MissingPublicAllocatorConfigError} when a selected vault is missing its public allocator config.
|
|
446
462
|
* @throws {UnknownReallocationMarketError} when the target market is absent from the reallocation data.
|
|
463
|
+
* @deprecated Vault V1 shared-liquidity planning will be removed in the next major. Use
|
|
464
|
+
* {@link getVaultV2BlueReallocations}.
|
|
447
465
|
* @example
|
|
448
466
|
* ```ts
|
|
449
467
|
* const reallocations = market.getVaultV1Reallocations({
|
|
@@ -468,7 +486,8 @@ export interface BlueActions {
|
|
|
468
486
|
* @throws {ReallocationWithdrawExceedsMarketSupplyError} when a withdrawal exceeds market supply.
|
|
469
487
|
* @throws {MissingPublicAllocatorConfigError} when a selected vault lacks allocator state.
|
|
470
488
|
* @throws {UnknownReallocationMarketError} when the target market is absent.
|
|
471
|
-
* @deprecated
|
|
489
|
+
* @deprecated Vault V1 shared-liquidity planning will be removed in the next major. Use
|
|
490
|
+
* {@link getVaultV2BlueReallocations}.
|
|
472
491
|
* @example
|
|
473
492
|
* ```ts
|
|
474
493
|
* const reallocations = market.getReallocations({
|
|
@@ -622,6 +641,8 @@ export declare class MorphoBlue implements BlueActions {
|
|
|
622
641
|
* @param params.block.timestamp - Timestamp corresponding to the fetched block.
|
|
623
642
|
* @returns Reallocation data ready for {@link getVaultV1Reallocations}.
|
|
624
643
|
* @throws {ChainIdMismatchError} when the client chain does not match this market.
|
|
644
|
+
* @deprecated Vault V1 shared-liquidity planning will be removed in the next major. Use
|
|
645
|
+
* {@link getVaultV2BlueReallocationData}.
|
|
625
646
|
* @example
|
|
626
647
|
* ```ts
|
|
627
648
|
* import { markets, vaults } from "@morpho-org/morpho-test";
|
|
@@ -655,7 +676,8 @@ export declare class MorphoBlue implements BlueActions {
|
|
|
655
676
|
* @param params.block.timestamp - Timestamp corresponding to the fetched block.
|
|
656
677
|
* @returns A `VaultV1ReallocationData` snapshot populated from one block.
|
|
657
678
|
* @throws {ChainIdMismatchError} when the client chain does not match this market.
|
|
658
|
-
* @deprecated
|
|
679
|
+
* @deprecated Vault V1 shared-liquidity planning will be removed in the next major. Use
|
|
680
|
+
* {@link getVaultV2BlueReallocationData}.
|
|
659
681
|
* @example
|
|
660
682
|
* ```ts
|
|
661
683
|
* const data = await market.getReallocationData({ vaultAddresses, block });
|
|
@@ -731,6 +753,8 @@ export declare class MorphoBlue implements BlueActions {
|
|
|
731
753
|
* @throws {ReallocationWithdrawExceedsMarketSupplyError} when `operation === "withdraw"` and `amount` exceeds the target market's `totalSupplyAssets`.
|
|
732
754
|
* @throws {MissingPublicAllocatorConfigError} when a selected vault is missing its public allocator config.
|
|
733
755
|
* @throws {UnknownReallocationMarketError} when the target market is absent from the reallocation data.
|
|
756
|
+
* @deprecated Vault V1 shared-liquidity planning will be removed in the next major. Use
|
|
757
|
+
* {@link getVaultV2BlueReallocations}.
|
|
734
758
|
* @example
|
|
735
759
|
* ```ts
|
|
736
760
|
* const reallocations = market.getVaultV1Reallocations({
|
|
@@ -755,7 +779,8 @@ export declare class MorphoBlue implements BlueActions {
|
|
|
755
779
|
* @throws {ReallocationWithdrawExceedsMarketSupplyError} when a withdrawal exceeds market supply.
|
|
756
780
|
* @throws {MissingPublicAllocatorConfigError} when a selected vault lacks allocator state.
|
|
757
781
|
* @throws {UnknownReallocationMarketError} when the target market is absent.
|
|
758
|
-
* @deprecated
|
|
782
|
+
* @deprecated Vault V1 shared-liquidity planning will be removed in the next major. Use
|
|
783
|
+
* {@link getVaultV2BlueReallocations}.
|
|
759
784
|
* @example
|
|
760
785
|
* ```ts
|
|
761
786
|
* const reallocations = market.getReallocations({
|
|
@@ -917,6 +917,8 @@ class MorphoBlue {
|
|
|
917
917
|
* @param params.block.timestamp - Timestamp corresponding to the fetched block.
|
|
918
918
|
* @returns Reallocation data ready for {@link getVaultV1Reallocations}.
|
|
919
919
|
* @throws {ChainIdMismatchError} when the client chain does not match this market.
|
|
920
|
+
* @deprecated Vault V1 shared-liquidity planning will be removed in the next major. Use
|
|
921
|
+
* {@link getVaultV2BlueReallocationData}.
|
|
920
922
|
* @example
|
|
921
923
|
* ```ts
|
|
922
924
|
* import { markets, vaults } from "@morpho-org/morpho-test";
|
|
@@ -1010,7 +1012,8 @@ class MorphoBlue {
|
|
|
1010
1012
|
* @param params.block.timestamp - Timestamp corresponding to the fetched block.
|
|
1011
1013
|
* @returns A `VaultV1ReallocationData` snapshot populated from one block.
|
|
1012
1014
|
* @throws {ChainIdMismatchError} when the client chain does not match this market.
|
|
1013
|
-
* @deprecated
|
|
1015
|
+
* @deprecated Vault V1 shared-liquidity planning will be removed in the next major. Use
|
|
1016
|
+
* {@link getVaultV2BlueReallocationData}.
|
|
1014
1017
|
* @example
|
|
1015
1018
|
* ```ts
|
|
1016
1019
|
* const data = await market.getReallocationData({ vaultAddresses, block });
|
|
@@ -1116,6 +1119,8 @@ class MorphoBlue {
|
|
|
1116
1119
|
* @throws {ReallocationWithdrawExceedsMarketSupplyError} when `operation === "withdraw"` and `amount` exceeds the target market's `totalSupplyAssets`.
|
|
1117
1120
|
* @throws {MissingPublicAllocatorConfigError} when a selected vault is missing its public allocator config.
|
|
1118
1121
|
* @throws {UnknownReallocationMarketError} when the target market is absent from the reallocation data.
|
|
1122
|
+
* @deprecated Vault V1 shared-liquidity planning will be removed in the next major. Use
|
|
1123
|
+
* {@link getVaultV2BlueReallocations}.
|
|
1119
1124
|
* @example
|
|
1120
1125
|
* ```ts
|
|
1121
1126
|
* const reallocations = market.getVaultV1Reallocations({
|
|
@@ -1160,7 +1165,8 @@ class MorphoBlue {
|
|
|
1160
1165
|
* @throws {ReallocationWithdrawExceedsMarketSupplyError} when a withdrawal exceeds market supply.
|
|
1161
1166
|
* @throws {MissingPublicAllocatorConfigError} when a selected vault lacks allocator state.
|
|
1162
1167
|
* @throws {UnknownReallocationMarketError} when the target market is absent.
|
|
1163
|
-
* @deprecated
|
|
1168
|
+
* @deprecated Vault V1 shared-liquidity planning will be removed in the next major. Use
|
|
1169
|
+
* {@link getVaultV2BlueReallocations}.
|
|
1164
1170
|
* @example
|
|
1165
1171
|
* ```ts
|
|
1166
1172
|
* const reallocations = market.getReallocations({
|
|
@@ -20,8 +20,8 @@ import type { GetOffersDataParams, GetPositionDataParams, MakeLendParams, MakeOf
|
|
|
20
20
|
* const output = midnight.takeLend({
|
|
21
21
|
* accountAddress: lender,
|
|
22
22
|
* marketData,
|
|
23
|
-
* assets:
|
|
24
|
-
* minUnits:
|
|
23
|
+
* assets: 1_000_000n,
|
|
24
|
+
* minUnits: 900_000n,
|
|
25
25
|
* takeableOffers: quote.data.takeableOffers,
|
|
26
26
|
* deadline: maxUint256,
|
|
27
27
|
* });
|
|
@@ -5,10 +5,10 @@ import type { FetchParameters } from "../../types/data.js";
|
|
|
5
5
|
import { type ActionOutput, type DepositAmountArgs, type ERC20ApprovalAction, type MorphoClientType, type PermitRequirementSignature, type Requirement, type RequirementSignature, type Transaction, type VaultV1DepositAction, type VaultV1InKindRedeemAction, type VaultV1MigrateToV2Action, type VaultV1RedeemAction, type VaultV1WithdrawAction } from "../../types/index.js";
|
|
6
6
|
export interface VaultV1Actions {
|
|
7
7
|
/**
|
|
8
|
-
* Fetches
|
|
8
|
+
* Fetches direct onchain vault and allocation state without applying virtual interest.
|
|
9
9
|
*
|
|
10
10
|
* @param {FetchParameters} [parameters] - Optional fetch parameters (block number, state overrides, etc.).
|
|
11
|
-
* @returns {Promise<Awaited<ReturnType<typeof fetchAccrualVault>>>} The
|
|
11
|
+
* @returns {Promise<Awaited<ReturnType<typeof fetchAccrualVault>>>} The requested vault state.
|
|
12
12
|
*/
|
|
13
13
|
getData: (parameters?: FetchParameters) => Promise<Awaited<ReturnType<typeof fetchAccrualVault>>>;
|
|
14
14
|
/**
|
|
@@ -134,18 +134,74 @@ export interface VaultV1Actions {
|
|
|
134
134
|
readonly deadline?: bigint;
|
|
135
135
|
}) => ActionOutput<VaultV1InKindRedeemAction, readonly RequirementSignature[], undefined>;
|
|
136
136
|
/**
|
|
137
|
-
* Prepares
|
|
137
|
+
* Prepares an atomic migration of Vault V1 shares to Vault V2 through bundler3.
|
|
138
138
|
*
|
|
139
|
-
*
|
|
140
|
-
*
|
|
139
|
+
* Accrues the source snapshot before converting V1 shares to assets so pending Vault V1
|
|
140
|
+
* performance-fee shares are reflected in both migration bounds. Projects the target Vault V2
|
|
141
|
+
* two hours forward when computing the deposit-leg maximum share price.
|
|
141
142
|
*
|
|
142
|
-
* @param
|
|
143
|
-
* @param
|
|
144
|
-
*
|
|
145
|
-
* @param
|
|
146
|
-
* @param
|
|
147
|
-
*
|
|
148
|
-
* @
|
|
143
|
+
* @param params - Migration parameters.
|
|
144
|
+
* @param params.userAddress - Account whose Vault V1 shares are migrated and that receives Vault
|
|
145
|
+
* V2 shares.
|
|
146
|
+
* @param params.sourceVault - Pre-fetched Vault V1 state with market allocations for local accrual.
|
|
147
|
+
* @param params.targetVault - Pre-fetched Vault V2 accrual snapshot with the same underlying
|
|
148
|
+
* asset.
|
|
149
|
+
* @param params.shares - Positive number of Vault V1 shares to migrate.
|
|
150
|
+
* @param params.slippageTolerance - Optional WAD-scaled tolerance; defaults to
|
|
151
|
+
* `DEFAULT_SLIPPAGE_TOLERANCE` and cannot exceed 10%.
|
|
152
|
+
* @returns Lazy approval or permit resolution through `getRequirements()` and a synchronous
|
|
153
|
+
* `buildTx()` returning a deep-frozen `Transaction<VaultV1MigrateToV2Action>`.
|
|
154
|
+
* @throws {ChainIdMismatchError} when the client and entity target different chains.
|
|
155
|
+
* @throws {VaultAddressMismatchError} when `sourceVault` belongs to another vault.
|
|
156
|
+
* @throws {VaultAssetMismatchError} when the source and target assets differ.
|
|
157
|
+
* @throws {NonPositiveInputError} when `shares` is not positive or the target projection yields
|
|
158
|
+
* no shares.
|
|
159
|
+
* @throws {NegativeInputError} when `slippageTolerance` is negative.
|
|
160
|
+
* @throws {ExcessiveSlippageToleranceError} when `slippageTolerance` exceeds the SDK maximum.
|
|
161
|
+
* @throws {UnknownBlueMarketAllocationError} when `sourceVault.withdrawQueue` references a market
|
|
162
|
+
* absent from `sourceVault.allocations`.
|
|
163
|
+
* @throws {UnsupportedChainIdError} from `getRequirements()` or `buildTx()` when the chain has no
|
|
164
|
+
* address registry.
|
|
165
|
+
* @throws {viem.BaseError} from `getRequirements()` when an RPC contract read fails.
|
|
166
|
+
* @throws {UnexpectedRequirementSignatureError} from `buildTx()` when a non-permit signature is
|
|
167
|
+
* supplied.
|
|
168
|
+
* @throws {AmbiguousRequirementSignaturesError} from `buildTx()` when several permit signatures
|
|
169
|
+
* are supplied.
|
|
170
|
+
* @throws {DepositAssetMismatchError} from `buildTx()` when a supplied permit targets another
|
|
171
|
+
* token.
|
|
172
|
+
* @throws {DepositAmountMismatchError} from `buildTx()` when a supplied permit covers another
|
|
173
|
+
* amount.
|
|
174
|
+
* @throws {Permit2ExpirationMissingError} from `buildTx()` when a Permit2 signature lacks an
|
|
175
|
+
* expiration.
|
|
176
|
+
* @example
|
|
177
|
+
* ```ts
|
|
178
|
+
* import {
|
|
179
|
+
* morphoViemExtension,
|
|
180
|
+
* type Transaction,
|
|
181
|
+
* type VaultV1MigrateToV2Action,
|
|
182
|
+
* } from "@morpho-org/morpho-sdk";
|
|
183
|
+
* import { createPublicClient, http } from "viem";
|
|
184
|
+
* import { mainnet } from "viem/chains";
|
|
185
|
+
*
|
|
186
|
+
* const client = createPublicClient({ chain: mainnet, transport: http() }).extend(
|
|
187
|
+
* morphoViemExtension(),
|
|
188
|
+
* );
|
|
189
|
+
* const sourceVaultAddress = "0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB";
|
|
190
|
+
* const targetVaultAddress = "0x04422053aDDbc9bB2759b248B574e3FCA76Bc145";
|
|
191
|
+
* const userAddress = "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266";
|
|
192
|
+
* const source = client.morpho.vaultV1(sourceVaultAddress, mainnet.id);
|
|
193
|
+
* const [sourceVault, targetVault] = await Promise.all([
|
|
194
|
+
* source.getData(),
|
|
195
|
+
* client.morpho.vaultV2(targetVaultAddress, mainnet.id).getData(),
|
|
196
|
+
* ]);
|
|
197
|
+
* const { buildTx } = source.migrateToV2({
|
|
198
|
+
* userAddress,
|
|
199
|
+
* sourceVault,
|
|
200
|
+
* targetVault,
|
|
201
|
+
* shares: 1_000_000n,
|
|
202
|
+
* });
|
|
203
|
+
* const tx: Readonly<Transaction<VaultV1MigrateToV2Action>> = buildTx();
|
|
204
|
+
* ```
|
|
149
205
|
*/
|
|
150
206
|
migrateToV2: (params: {
|
|
151
207
|
userAddress: Address;
|
|
@@ -194,6 +250,7 @@ export declare class MorphoVaultV1 implements VaultV1Actions {
|
|
|
194
250
|
readonly userAddress: Address;
|
|
195
251
|
readonly deadline?: bigint;
|
|
196
252
|
}): ActionOutput<VaultV1InKindRedeemAction, readonly RequirementSignature[], undefined>;
|
|
253
|
+
/** {@inheritDoc VaultV1Actions.migrateToV2} */
|
|
197
254
|
migrateToV2({ userAddress, sourceVault, targetVault, shares, slippageTolerance, }: {
|
|
198
255
|
userAddress: Address;
|
|
199
256
|
sourceVault: AccrualVault;
|