@morpho-org/morpho-sdk 5.4.1 → 5.6.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 +23 -7
- package/lib/cjs/abis.d.ts +314 -1
- package/lib/cjs/abis.js +169 -1
- package/lib/cjs/actions/blue/borrow.d.ts +21 -15
- package/lib/cjs/actions/blue/borrow.js +25 -18
- package/lib/cjs/actions/blue/buildAssetFundingActions.d.ts +1 -1
- package/lib/cjs/actions/blue/buildAssetFundingActions.js +1 -1
- package/lib/cjs/actions/blue/buildReallocationActions.d.ts +62 -19
- package/lib/cjs/actions/blue/buildReallocationActions.js +123 -27
- package/lib/cjs/actions/blue/refinance.d.ts +14 -7
- package/lib/cjs/actions/blue/refinance.js +18 -10
- package/lib/cjs/actions/blue/supplyCollateralBorrow.d.ts +28 -19
- package/lib/cjs/actions/blue/supplyCollateralBorrow.js +39 -23
- package/lib/cjs/actions/blue/withdraw.d.ts +20 -13
- package/lib/cjs/actions/blue/withdraw.js +23 -18
- package/lib/cjs/actions/requirements/encode/encodeErc20Approval.d.ts +1 -1
- package/lib/cjs/actions/requirements/encode/encodeErc20Approval.js +9 -2
- package/lib/cjs/actions/requirements/encode/encodeVaultSharesPermit.d.ts +64 -0
- package/lib/cjs/actions/requirements/encode/encodeVaultSharesPermit.js +131 -0
- package/lib/cjs/actions/requirements/encode/index.d.ts +1 -0
- package/lib/cjs/actions/requirements/encode/index.js +1 -0
- package/lib/cjs/actions/requirements/getRequirementsApproval.d.ts +3 -2
- package/lib/cjs/actions/requirements/getRequirementsApproval.js +5 -3
- package/lib/cjs/actions/signatures/getVaultExitBundlesV1PermitStruct.d.ts +52 -0
- package/lib/cjs/actions/signatures/getVaultExitBundlesV1PermitStruct.js +91 -0
- package/lib/cjs/actions/signatures/index.d.ts +1 -0
- package/lib/cjs/actions/signatures/index.js +1 -0
- package/lib/cjs/actions/vaultV1/inKindRedeem.d.ts +54 -0
- package/lib/cjs/actions/vaultV1/inKindRedeem.js +96 -0
- package/lib/cjs/actions/vaultV1/index.d.ts +1 -0
- package/lib/cjs/actions/vaultV1/index.js +1 -0
- package/lib/cjs/actions/vaultV2/inKindRedeem.d.ts +56 -0
- package/lib/cjs/actions/vaultV2/inKindRedeem.js +97 -0
- package/lib/cjs/actions/vaultV2/index.d.ts +1 -0
- package/lib/cjs/actions/vaultV2/index.js +1 -0
- package/lib/cjs/bundler/actions.d.ts +118 -2
- package/lib/cjs/bundler/actions.js +212 -6
- package/lib/cjs/bundler/types.d.ts +20 -0
- package/lib/cjs/constants.d.ts +1 -1
- package/lib/cjs/constants.js +3 -1
- package/lib/cjs/entities/blue/blue.d.ts +365 -76
- package/lib/cjs/entities/blue/blue.js +285 -52
- package/lib/cjs/entities/index.d.ts +2 -1
- package/lib/cjs/entities/index.js +6 -3
- package/lib/cjs/entities/vaultV1/vaultV1.d.ts +82 -4
- package/lib/cjs/entities/vaultV1/vaultV1.js +164 -0
- package/lib/cjs/entities/{reallocationData.d.ts → vaultV1ReallocationData.d.ts} +41 -17
- package/lib/cjs/entities/{reallocationData.js → vaultV1ReallocationData.js} +30 -18
- package/lib/cjs/entities/vaultV2/vaultV2.d.ts +89 -3
- package/lib/cjs/entities/vaultV2/vaultV2.js +181 -0
- package/lib/cjs/entities/vaultV2BlueReallocationData.d.ts +511 -0
- package/lib/cjs/entities/vaultV2BlueReallocationData.js +1311 -0
- package/lib/{esm/helpers/computeReallocations.d.ts → cjs/helpers/computeVaultV1Reallocations.d.ts} +14 -8
- package/lib/cjs/helpers/{computeReallocations.js → computeVaultV1Reallocations.js} +27 -13
- package/lib/cjs/helpers/constant.d.ts +5 -3
- package/lib/cjs/helpers/constant.js +6 -4
- package/lib/cjs/helpers/index.d.ts +3 -2
- package/lib/cjs/helpers/index.js +8 -3
- package/lib/cjs/helpers/previewVaultV2InKindRedeem.d.ts +49 -0
- package/lib/cjs/helpers/previewVaultV2InKindRedeem.js +73 -0
- package/lib/cjs/helpers/validate.d.ts +31 -15
- package/lib/cjs/helpers/validate.js +140 -27
- package/lib/cjs/helpers/validateRequirementSpender.d.ts +1 -1
- package/lib/cjs/helpers/validateRequirementSpender.js +2 -1
- package/lib/cjs/types/action.d.ts +33 -1
- package/lib/cjs/types/error.d.ts +363 -5
- package/lib/cjs/types/error.js +455 -6
- package/lib/cjs/types/sharedLiquidity.d.ts +72 -8
- package/lib/cjs/utils.d.ts +2 -2
- package/lib/cjs/utils.js +6 -4
- package/lib/esm/abis.d.ts +314 -1
- package/lib/esm/abis.js +167 -1
- package/lib/esm/actions/blue/borrow.d.ts +21 -15
- package/lib/esm/actions/blue/borrow.js +26 -19
- package/lib/esm/actions/blue/buildAssetFundingActions.d.ts +1 -1
- package/lib/esm/actions/blue/buildAssetFundingActions.js +1 -1
- package/lib/esm/actions/blue/buildReallocationActions.d.ts +62 -19
- package/lib/esm/actions/blue/buildReallocationActions.js +119 -25
- package/lib/esm/actions/blue/refinance.d.ts +14 -7
- package/lib/esm/actions/blue/refinance.js +19 -11
- package/lib/esm/actions/blue/supplyCollateralBorrow.d.ts +28 -19
- package/lib/esm/actions/blue/supplyCollateralBorrow.js +40 -24
- package/lib/esm/actions/blue/withdraw.d.ts +20 -13
- package/lib/esm/actions/blue/withdraw.js +24 -19
- package/lib/esm/actions/requirements/encode/encodeErc20Approval.d.ts +1 -1
- package/lib/esm/actions/requirements/encode/encodeErc20Approval.js +9 -2
- package/lib/esm/actions/requirements/encode/encodeVaultSharesPermit.d.ts +64 -0
- package/lib/esm/actions/requirements/encode/encodeVaultSharesPermit.js +127 -0
- package/lib/esm/actions/requirements/encode/index.d.ts +1 -0
- package/lib/esm/actions/requirements/encode/index.js +1 -0
- package/lib/esm/actions/requirements/getRequirementsApproval.d.ts +3 -2
- package/lib/esm/actions/requirements/getRequirementsApproval.js +5 -3
- package/lib/esm/actions/signatures/getVaultExitBundlesV1PermitStruct.d.ts +52 -0
- package/lib/esm/actions/signatures/getVaultExitBundlesV1PermitStruct.js +87 -0
- package/lib/esm/actions/signatures/index.d.ts +1 -0
- package/lib/esm/actions/signatures/index.js +1 -0
- package/lib/esm/actions/vaultV1/inKindRedeem.d.ts +54 -0
- package/lib/esm/actions/vaultV1/inKindRedeem.js +92 -0
- package/lib/esm/actions/vaultV1/index.d.ts +1 -0
- package/lib/esm/actions/vaultV1/index.js +1 -0
- package/lib/esm/actions/vaultV2/inKindRedeem.d.ts +56 -0
- package/lib/esm/actions/vaultV2/inKindRedeem.js +93 -0
- package/lib/esm/actions/vaultV2/index.d.ts +1 -0
- package/lib/esm/actions/vaultV2/index.js +1 -0
- package/lib/esm/bundler/actions.d.ts +118 -2
- package/lib/esm/bundler/actions.js +215 -9
- package/lib/esm/bundler/types.d.ts +20 -0
- package/lib/esm/constants.d.ts +1 -1
- package/lib/esm/constants.js +1 -1
- package/lib/esm/entities/blue/blue.d.ts +362 -73
- package/lib/esm/entities/blue/blue.js +288 -55
- package/lib/esm/entities/index.d.ts +2 -1
- package/lib/esm/entities/index.js +2 -1
- package/lib/esm/entities/vaultV1/vaultV1.d.ts +80 -2
- package/lib/esm/entities/vaultV1/vaultV1.js +170 -6
- package/lib/esm/entities/{reallocationData.d.ts → vaultV1ReallocationData.d.ts} +41 -17
- package/lib/esm/entities/{reallocationData.js → vaultV1ReallocationData.js} +33 -16
- package/lib/esm/entities/vaultV2/vaultV2.d.ts +88 -2
- package/lib/esm/entities/vaultV2/vaultV2.js +187 -6
- package/lib/esm/entities/vaultV2BlueReallocationData.d.ts +511 -0
- package/lib/esm/entities/vaultV2BlueReallocationData.js +1307 -0
- package/lib/{cjs/helpers/computeReallocations.d.ts → esm/helpers/computeVaultV1Reallocations.d.ts} +14 -8
- package/lib/esm/helpers/{computeReallocations.js → computeVaultV1Reallocations.js} +25 -11
- package/lib/esm/helpers/constant.d.ts +5 -3
- package/lib/esm/helpers/constant.js +5 -3
- package/lib/esm/helpers/index.d.ts +3 -2
- package/lib/esm/helpers/index.js +3 -2
- package/lib/esm/helpers/previewVaultV2InKindRedeem.d.ts +49 -0
- package/lib/esm/helpers/previewVaultV2InKindRedeem.js +70 -0
- package/lib/esm/helpers/validate.d.ts +31 -15
- package/lib/esm/helpers/validate.js +141 -30
- package/lib/esm/helpers/validateRequirementSpender.d.ts +1 -1
- package/lib/esm/helpers/validateRequirementSpender.js +2 -1
- package/lib/esm/types/action.d.ts +33 -1
- package/lib/esm/types/error.d.ts +363 -5
- package/lib/esm/types/error.js +428 -4
- package/lib/esm/types/sharedLiquidity.d.ts +72 -8
- package/lib/esm/utils.d.ts +2 -2
- package/lib/esm/utils.js +2 -2
- package/package.json +9 -11
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getVaultExitBundlesV1PermitStruct = void 0;
|
|
4
|
+
const viem_1 = require("viem");
|
|
5
|
+
const index_js_1 = require("../../types/index.js");
|
|
6
|
+
/**
|
|
7
|
+
* Returns the permit struct consumed by VaultExitBundlesV1 from an optional vault-share
|
|
8
|
+
* requirement signature.
|
|
9
|
+
*
|
|
10
|
+
* Without a signature, returns the contract's empty-permit sentinel. With a signature, validates
|
|
11
|
+
* the ERC-2612 kind and vault asset before splitting the serialized signature.
|
|
12
|
+
* Owner, spender, deadline, nonce, and cryptographic validity are verified onchain by the vault.
|
|
13
|
+
*
|
|
14
|
+
* @param params.vault - Vault share token authorized by the permit.
|
|
15
|
+
* @param params.deadline - Bundle deadline used by the empty-permit sentinel.
|
|
16
|
+
* @param params.requirementSignature - Optional signed bounded ERC-2612 requirement.
|
|
17
|
+
* @returns The VaultExitBundlesV1 permit tuple.
|
|
18
|
+
* @throws {VaultExitBundlesV1PermitMismatchError} when the requirement has the wrong permit kind, asset, or signature encoding.
|
|
19
|
+
* @example
|
|
20
|
+
* ```ts
|
|
21
|
+
* import { getVaultExitBundlesV1PermitStruct } from "@morpho-org/morpho-sdk";
|
|
22
|
+
*
|
|
23
|
+
* const permit = getVaultExitBundlesV1PermitStruct({
|
|
24
|
+
* vault,
|
|
25
|
+
* deadline,
|
|
26
|
+
* requirementSignature,
|
|
27
|
+
* });
|
|
28
|
+
* // permit satisfies VaultExitBundlesV1PermitStruct
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
const getVaultExitBundlesV1PermitStruct = (params) => {
|
|
32
|
+
const { requirementSignature } = params;
|
|
33
|
+
if (requirementSignature == null) {
|
|
34
|
+
return {
|
|
35
|
+
value: 0n,
|
|
36
|
+
nonce: 0n,
|
|
37
|
+
deadline: params.deadline,
|
|
38
|
+
v: 0,
|
|
39
|
+
r: viem_1.zeroHash,
|
|
40
|
+
s: viem_1.zeroHash,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
if (requirementSignature.action.type !== "permit") {
|
|
44
|
+
throw new index_js_1.VaultExitBundlesV1PermitMismatchError({
|
|
45
|
+
field: "type",
|
|
46
|
+
expected: "permit",
|
|
47
|
+
actual: requirementSignature.action.type,
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
if (!(0, viem_1.isAddressEqual)(requirementSignature.args.asset, params.vault)) {
|
|
51
|
+
throw new index_js_1.VaultExitBundlesV1PermitMismatchError({
|
|
52
|
+
field: "asset",
|
|
53
|
+
expected: params.vault,
|
|
54
|
+
actual: requirementSignature.args.asset,
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
const signature = (() => {
|
|
58
|
+
try {
|
|
59
|
+
const serializedSignature = requirementSignature.args.signature;
|
|
60
|
+
return (0, viem_1.size)(serializedSignature) === 64
|
|
61
|
+
? (0, viem_1.compactSignatureToSignature)((0, viem_1.parseCompactSignature)(serializedSignature))
|
|
62
|
+
: (0, viem_1.parseSignature)(serializedSignature);
|
|
63
|
+
}
|
|
64
|
+
catch (cause) {
|
|
65
|
+
throw new index_js_1.VaultExitBundlesV1PermitMismatchError({
|
|
66
|
+
field: "signature",
|
|
67
|
+
expected: "a 64-byte compact or 65-byte serialized ECDSA signature",
|
|
68
|
+
actual: requirementSignature.args.signature,
|
|
69
|
+
cause,
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
})();
|
|
73
|
+
const { r, s, v, yParity } = signature;
|
|
74
|
+
const normalizedV = v ?? (yParity == null ? undefined : BigInt(yParity + 27));
|
|
75
|
+
if (normalizedV == null) {
|
|
76
|
+
throw new index_js_1.VaultExitBundlesV1PermitMismatchError({
|
|
77
|
+
field: "signature",
|
|
78
|
+
expected: "a signature containing v or yParity",
|
|
79
|
+
actual: requirementSignature.args.signature,
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
return {
|
|
83
|
+
value: requirementSignature.args.amount,
|
|
84
|
+
nonce: requirementSignature.args.nonce,
|
|
85
|
+
deadline: requirementSignature.args.deadline,
|
|
86
|
+
v: Number(normalizedV),
|
|
87
|
+
r,
|
|
88
|
+
s,
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
exports.getVaultExitBundlesV1PermitStruct = getVaultExitBundlesV1PermitStruct;
|
|
@@ -16,3 +16,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./getBlueAuthorizationAction.js"), exports);
|
|
18
18
|
__exportStar(require("./getTokenRequirementActions.js"), exports);
|
|
19
|
+
__exportStar(require("./getVaultExitBundlesV1PermitStruct.js"), exports);
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { InputMarketParams } from "@morpho-org/blue-sdk";
|
|
2
|
+
import { type Address } from "viem";
|
|
3
|
+
import { type Metadata, type PermitRequirementSignature, type Transaction, type VaultV1InKindRedeemAction } from "../../types/index.js";
|
|
4
|
+
/** Parameters for {@link vaultV1InKindRedeem}. */
|
|
5
|
+
export interface VaultV1InKindRedeemParams {
|
|
6
|
+
readonly vault: {
|
|
7
|
+
readonly chainId: number;
|
|
8
|
+
readonly address: Address;
|
|
9
|
+
};
|
|
10
|
+
readonly args: {
|
|
11
|
+
readonly amount: bigint;
|
|
12
|
+
readonly marketParamsList: readonly InputMarketParams[];
|
|
13
|
+
readonly userAddress: Address;
|
|
14
|
+
readonly deadline: bigint;
|
|
15
|
+
readonly requirementSignature?: PermitRequirementSignature;
|
|
16
|
+
};
|
|
17
|
+
readonly metadata?: Metadata;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Prepares a Vault V1 in-kind redemption into Morpho Blue supply positions.
|
|
21
|
+
*
|
|
22
|
+
* The transaction calls VaultExitBundlesV1 directly. Without a signature it embeds the contract's
|
|
23
|
+
* empty-permit sentinel; the user must first approve enough shares for the exit.
|
|
24
|
+
*
|
|
25
|
+
* @param params - In-kind redemption parameters.
|
|
26
|
+
* @param params.vault.chainId - Chain containing the target Vault V1 and VaultExitBundlesV1.
|
|
27
|
+
* @param params.vault.address - Target Vault V1 address.
|
|
28
|
+
* @param params.args.amount - Asset-denominated amount to exit.
|
|
29
|
+
* @param params.args.marketParamsList - Ordered markets consumed greedily by the contract.
|
|
30
|
+
* @param params.args.userAddress - Expected transaction sender, recorded in action metadata only.
|
|
31
|
+
* VaultExitBundlesV1 burns `msg.sender`'s vault shares, so the submitting account must equal this
|
|
32
|
+
* address.
|
|
33
|
+
* @param params.args.deadline - Permit and bundle deadline.
|
|
34
|
+
* @param params.args.requirementSignature - Optional bounded Vault V1 shares permit.
|
|
35
|
+
* @param params.metadata - Optional analytics metadata.
|
|
36
|
+
* @returns A deep-frozen `Readonly<Transaction<VaultV1InKindRedeemAction>>` with `to`, `value`,
|
|
37
|
+
* `data`, and the typed action discriminator.
|
|
38
|
+
* @throws {NonPositiveInputError} when `amount` or `deadline` is not positive.
|
|
39
|
+
* @throws {EmptyMarketParamsListError} when no markets are supplied.
|
|
40
|
+
* @throws {UnsupportedChainIdError} when no address registry exists for the target chain.
|
|
41
|
+
* @throws {UnknownAddressError} when VaultExitBundlesV1 is not registered on the target chain.
|
|
42
|
+
* @throws {VaultExitBundlesV1PermitMismatchError} when the requirement has the wrong permit kind, asset, or signature encoding.
|
|
43
|
+
* @example
|
|
44
|
+
* ```ts
|
|
45
|
+
* import { vaultV1InKindRedeem } from "@morpho-org/morpho-sdk";
|
|
46
|
+
*
|
|
47
|
+
* const tx = vaultV1InKindRedeem({
|
|
48
|
+
* vault: { chainId: 1, address: vault },
|
|
49
|
+
* args: { amount: 1_000_000n, marketParamsList, userAddress, deadline },
|
|
50
|
+
* });
|
|
51
|
+
* // tx satisfies Readonly<Transaction<VaultV1InKindRedeemAction>>
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
export declare const vaultV1InKindRedeem: ({ vault, args, metadata, }: VaultV1InKindRedeemParams) => Readonly<Transaction<VaultV1InKindRedeemAction>>;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.vaultV1InKindRedeem = void 0;
|
|
4
|
+
const morpho_ts_1 = require("@morpho-org/morpho-ts");
|
|
5
|
+
const viem_1 = require("viem");
|
|
6
|
+
const abis_js_1 = require("../../abis.js");
|
|
7
|
+
const index_js_1 = require("../../helpers/index.js");
|
|
8
|
+
const index_js_2 = require("../../types/index.js");
|
|
9
|
+
const getVaultExitBundlesV1PermitStruct_js_1 = require("../signatures/getVaultExitBundlesV1PermitStruct.js");
|
|
10
|
+
/**
|
|
11
|
+
* Prepares a Vault V1 in-kind redemption into Morpho Blue supply positions.
|
|
12
|
+
*
|
|
13
|
+
* The transaction calls VaultExitBundlesV1 directly. Without a signature it embeds the contract's
|
|
14
|
+
* empty-permit sentinel; the user must first approve enough shares for the exit.
|
|
15
|
+
*
|
|
16
|
+
* @param params - In-kind redemption parameters.
|
|
17
|
+
* @param params.vault.chainId - Chain containing the target Vault V1 and VaultExitBundlesV1.
|
|
18
|
+
* @param params.vault.address - Target Vault V1 address.
|
|
19
|
+
* @param params.args.amount - Asset-denominated amount to exit.
|
|
20
|
+
* @param params.args.marketParamsList - Ordered markets consumed greedily by the contract.
|
|
21
|
+
* @param params.args.userAddress - Expected transaction sender, recorded in action metadata only.
|
|
22
|
+
* VaultExitBundlesV1 burns `msg.sender`'s vault shares, so the submitting account must equal this
|
|
23
|
+
* address.
|
|
24
|
+
* @param params.args.deadline - Permit and bundle deadline.
|
|
25
|
+
* @param params.args.requirementSignature - Optional bounded Vault V1 shares permit.
|
|
26
|
+
* @param params.metadata - Optional analytics metadata.
|
|
27
|
+
* @returns A deep-frozen `Readonly<Transaction<VaultV1InKindRedeemAction>>` with `to`, `value`,
|
|
28
|
+
* `data`, and the typed action discriminator.
|
|
29
|
+
* @throws {NonPositiveInputError} when `amount` or `deadline` is not positive.
|
|
30
|
+
* @throws {EmptyMarketParamsListError} when no markets are supplied.
|
|
31
|
+
* @throws {UnsupportedChainIdError} when no address registry exists for the target chain.
|
|
32
|
+
* @throws {UnknownAddressError} when VaultExitBundlesV1 is not registered on the target chain.
|
|
33
|
+
* @throws {VaultExitBundlesV1PermitMismatchError} when the requirement has the wrong permit kind, asset, or signature encoding.
|
|
34
|
+
* @example
|
|
35
|
+
* ```ts
|
|
36
|
+
* import { vaultV1InKindRedeem } from "@morpho-org/morpho-sdk";
|
|
37
|
+
*
|
|
38
|
+
* const tx = vaultV1InKindRedeem({
|
|
39
|
+
* vault: { chainId: 1, address: vault },
|
|
40
|
+
* args: { amount: 1_000_000n, marketParamsList, userAddress, deadline },
|
|
41
|
+
* });
|
|
42
|
+
* // tx satisfies Readonly<Transaction<VaultV1InKindRedeemAction>>
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
const vaultV1InKindRedeem = ({ vault, args, metadata, }) => {
|
|
46
|
+
if (args.amount <= 0n)
|
|
47
|
+
throw new index_js_2.NonPositiveInputError("amount", args.amount);
|
|
48
|
+
if (args.deadline <= 0n)
|
|
49
|
+
throw new index_js_2.NonPositiveInputError("deadline", args.deadline);
|
|
50
|
+
if (args.marketParamsList.length === 0)
|
|
51
|
+
throw new index_js_2.EmptyMarketParamsListError();
|
|
52
|
+
const to = (0, morpho_ts_1.getChainAddress)(vault.chainId, "bundles.vaultExitBundlesV1");
|
|
53
|
+
const marketParamsList = args.marketParamsList.map((marketParams) => ({
|
|
54
|
+
loanToken: marketParams.loanToken,
|
|
55
|
+
collateralToken: marketParams.collateralToken,
|
|
56
|
+
oracle: marketParams.oracle,
|
|
57
|
+
irm: marketParams.irm,
|
|
58
|
+
lltv: marketParams.lltv,
|
|
59
|
+
}));
|
|
60
|
+
const sharesPermit = (0, getVaultExitBundlesV1PermitStruct_js_1.getVaultExitBundlesV1PermitStruct)({
|
|
61
|
+
vault: vault.address,
|
|
62
|
+
deadline: args.deadline,
|
|
63
|
+
requirementSignature: args.requirementSignature,
|
|
64
|
+
});
|
|
65
|
+
let tx = {
|
|
66
|
+
to,
|
|
67
|
+
value: 0n,
|
|
68
|
+
data: (0, viem_1.encodeFunctionData)({
|
|
69
|
+
abi: abis_js_1.vaultExitBundlesV1Abi,
|
|
70
|
+
functionName: "vaultExitBundlesV1InKindRedemptionVaultV1",
|
|
71
|
+
args: [
|
|
72
|
+
vault.address,
|
|
73
|
+
marketParamsList,
|
|
74
|
+
args.amount,
|
|
75
|
+
sharesPermit,
|
|
76
|
+
args.deadline,
|
|
77
|
+
],
|
|
78
|
+
}),
|
|
79
|
+
};
|
|
80
|
+
if (metadata)
|
|
81
|
+
tx = (0, index_js_1.addTransactionMetadata)(tx, metadata);
|
|
82
|
+
return (0, morpho_ts_1.deepFreeze)({
|
|
83
|
+
...tx,
|
|
84
|
+
action: {
|
|
85
|
+
type: "vaultV1InKindRedeem",
|
|
86
|
+
args: {
|
|
87
|
+
vault: vault.address,
|
|
88
|
+
amount: args.amount,
|
|
89
|
+
marketParamsList,
|
|
90
|
+
onBehalf: args.userAddress,
|
|
91
|
+
deadline: args.deadline,
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
});
|
|
95
|
+
};
|
|
96
|
+
exports.vaultV1InKindRedeem = vaultV1InKindRedeem;
|
|
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./deposit.js"), exports);
|
|
18
|
+
__exportStar(require("./inKindRedeem.js"), exports);
|
|
18
19
|
__exportStar(require("./migrateToV2.js"), exports);
|
|
19
20
|
__exportStar(require("./redeem.js"), exports);
|
|
20
21
|
__exportStar(require("./withdraw.js"), exports);
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { InputMarketParams } from "@morpho-org/blue-sdk";
|
|
2
|
+
import { type Address } from "viem";
|
|
3
|
+
import { type Metadata, type PermitRequirementSignature, type Transaction, type VaultV2InKindRedeemAction } from "../../types/index.js";
|
|
4
|
+
/** Parameters for {@link vaultV2InKindRedeem}. */
|
|
5
|
+
export interface VaultV2InKindRedeemParams {
|
|
6
|
+
readonly vault: {
|
|
7
|
+
readonly chainId: number;
|
|
8
|
+
readonly address: Address;
|
|
9
|
+
};
|
|
10
|
+
readonly args: {
|
|
11
|
+
readonly adapter: Address;
|
|
12
|
+
readonly amount: bigint;
|
|
13
|
+
readonly marketParamsList: readonly InputMarketParams[];
|
|
14
|
+
readonly userAddress: Address;
|
|
15
|
+
readonly deadline: bigint;
|
|
16
|
+
readonly requirementSignature?: PermitRequirementSignature;
|
|
17
|
+
};
|
|
18
|
+
readonly metadata?: Metadata;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Prepares a Vault V2 in-kind redemption into idle assets and Morpho Blue supply positions.
|
|
22
|
+
*
|
|
23
|
+
* `amount` includes the Vault V2 force-deallocation penalty. Without a signature this embeds the
|
|
24
|
+
* empty-permit sentinel and requires a sufficient share approval to VaultExitBundlesV1.
|
|
25
|
+
*
|
|
26
|
+
* @param params - In-kind redemption parameters.
|
|
27
|
+
* @param params.vault.chainId - Chain containing the target Vault V2 and VaultExitBundlesV1.
|
|
28
|
+
* @param params.vault.address - Target Vault V2 address.
|
|
29
|
+
* @param params.args.adapter - Vault's sole MorphoMarketV1AdapterV2.
|
|
30
|
+
* @param params.args.amount - Penalty-inclusive, asset-denominated amount to exit.
|
|
31
|
+
* @param params.args.marketParamsList - Ordered markets consumed greedily after idle assets. May be
|
|
32
|
+
* empty when the vault's idle balance covers `amount`.
|
|
33
|
+
* @param params.args.userAddress - Expected transaction sender, recorded in action metadata only.
|
|
34
|
+
* VaultExitBundlesV1 burns `msg.sender`'s vault shares, so the submitting account must equal this
|
|
35
|
+
* address.
|
|
36
|
+
* @param params.args.deadline - Permit and bundle deadline.
|
|
37
|
+
* @param params.args.requirementSignature - Optional bounded Vault V2 shares permit.
|
|
38
|
+
* @param params.metadata - Optional analytics metadata.
|
|
39
|
+
* @returns A deep-frozen `Readonly<Transaction<VaultV2InKindRedeemAction>>` with `to`, `value`,
|
|
40
|
+
* `data`, and the typed action discriminator.
|
|
41
|
+
* @throws {NonPositiveInputError} when `amount` or `deadline` is not positive.
|
|
42
|
+
* @throws {UnsupportedChainIdError} when no address registry exists for the target chain.
|
|
43
|
+
* @throws {UnknownAddressError} when VaultExitBundlesV1 is not registered on the target chain.
|
|
44
|
+
* @throws {VaultExitBundlesV1PermitMismatchError} when the requirement has the wrong permit kind, asset, or signature encoding.
|
|
45
|
+
* @example
|
|
46
|
+
* ```ts
|
|
47
|
+
* import { vaultV2InKindRedeem } from "@morpho-org/morpho-sdk";
|
|
48
|
+
*
|
|
49
|
+
* const tx = vaultV2InKindRedeem({
|
|
50
|
+
* vault: { chainId: 1, address: vault },
|
|
51
|
+
* args: { adapter, amount: 1_000_000n, marketParamsList, userAddress, deadline },
|
|
52
|
+
* });
|
|
53
|
+
* // tx satisfies Readonly<Transaction<VaultV2InKindRedeemAction>>
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
export declare const vaultV2InKindRedeem: ({ vault, args, metadata, }: VaultV2InKindRedeemParams) => Readonly<Transaction<VaultV2InKindRedeemAction>>;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.vaultV2InKindRedeem = void 0;
|
|
4
|
+
const morpho_ts_1 = require("@morpho-org/morpho-ts");
|
|
5
|
+
const viem_1 = require("viem");
|
|
6
|
+
const abis_js_1 = require("../../abis.js");
|
|
7
|
+
const index_js_1 = require("../../helpers/index.js");
|
|
8
|
+
const index_js_2 = require("../../types/index.js");
|
|
9
|
+
const getVaultExitBundlesV1PermitStruct_js_1 = require("../signatures/getVaultExitBundlesV1PermitStruct.js");
|
|
10
|
+
/**
|
|
11
|
+
* Prepares a Vault V2 in-kind redemption into idle assets and Morpho Blue supply positions.
|
|
12
|
+
*
|
|
13
|
+
* `amount` includes the Vault V2 force-deallocation penalty. Without a signature this embeds the
|
|
14
|
+
* empty-permit sentinel and requires a sufficient share approval to VaultExitBundlesV1.
|
|
15
|
+
*
|
|
16
|
+
* @param params - In-kind redemption parameters.
|
|
17
|
+
* @param params.vault.chainId - Chain containing the target Vault V2 and VaultExitBundlesV1.
|
|
18
|
+
* @param params.vault.address - Target Vault V2 address.
|
|
19
|
+
* @param params.args.adapter - Vault's sole MorphoMarketV1AdapterV2.
|
|
20
|
+
* @param params.args.amount - Penalty-inclusive, asset-denominated amount to exit.
|
|
21
|
+
* @param params.args.marketParamsList - Ordered markets consumed greedily after idle assets. May be
|
|
22
|
+
* empty when the vault's idle balance covers `amount`.
|
|
23
|
+
* @param params.args.userAddress - Expected transaction sender, recorded in action metadata only.
|
|
24
|
+
* VaultExitBundlesV1 burns `msg.sender`'s vault shares, so the submitting account must equal this
|
|
25
|
+
* address.
|
|
26
|
+
* @param params.args.deadline - Permit and bundle deadline.
|
|
27
|
+
* @param params.args.requirementSignature - Optional bounded Vault V2 shares permit.
|
|
28
|
+
* @param params.metadata - Optional analytics metadata.
|
|
29
|
+
* @returns A deep-frozen `Readonly<Transaction<VaultV2InKindRedeemAction>>` with `to`, `value`,
|
|
30
|
+
* `data`, and the typed action discriminator.
|
|
31
|
+
* @throws {NonPositiveInputError} when `amount` or `deadline` is not positive.
|
|
32
|
+
* @throws {UnsupportedChainIdError} when no address registry exists for the target chain.
|
|
33
|
+
* @throws {UnknownAddressError} when VaultExitBundlesV1 is not registered on the target chain.
|
|
34
|
+
* @throws {VaultExitBundlesV1PermitMismatchError} when the requirement has the wrong permit kind, asset, or signature encoding.
|
|
35
|
+
* @example
|
|
36
|
+
* ```ts
|
|
37
|
+
* import { vaultV2InKindRedeem } from "@morpho-org/morpho-sdk";
|
|
38
|
+
*
|
|
39
|
+
* const tx = vaultV2InKindRedeem({
|
|
40
|
+
* vault: { chainId: 1, address: vault },
|
|
41
|
+
* args: { adapter, amount: 1_000_000n, marketParamsList, userAddress, deadline },
|
|
42
|
+
* });
|
|
43
|
+
* // tx satisfies Readonly<Transaction<VaultV2InKindRedeemAction>>
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
const vaultV2InKindRedeem = ({ vault, args, metadata, }) => {
|
|
47
|
+
if (args.amount <= 0n)
|
|
48
|
+
throw new index_js_2.NonPositiveInputError("amount", args.amount);
|
|
49
|
+
if (args.deadline <= 0n)
|
|
50
|
+
throw new index_js_2.NonPositiveInputError("deadline", args.deadline);
|
|
51
|
+
const to = (0, morpho_ts_1.getChainAddress)(vault.chainId, "bundles.vaultExitBundlesV1");
|
|
52
|
+
const marketParamsList = args.marketParamsList.map((marketParams) => ({
|
|
53
|
+
loanToken: marketParams.loanToken,
|
|
54
|
+
collateralToken: marketParams.collateralToken,
|
|
55
|
+
oracle: marketParams.oracle,
|
|
56
|
+
irm: marketParams.irm,
|
|
57
|
+
lltv: marketParams.lltv,
|
|
58
|
+
}));
|
|
59
|
+
const sharesPermit = (0, getVaultExitBundlesV1PermitStruct_js_1.getVaultExitBundlesV1PermitStruct)({
|
|
60
|
+
vault: vault.address,
|
|
61
|
+
deadline: args.deadline,
|
|
62
|
+
requirementSignature: args.requirementSignature,
|
|
63
|
+
});
|
|
64
|
+
let tx = {
|
|
65
|
+
to,
|
|
66
|
+
value: 0n,
|
|
67
|
+
data: (0, viem_1.encodeFunctionData)({
|
|
68
|
+
abi: abis_js_1.vaultExitBundlesV1Abi,
|
|
69
|
+
functionName: "vaultExitBundlesV1InKindRedemptionVaultV2",
|
|
70
|
+
args: [
|
|
71
|
+
vault.address,
|
|
72
|
+
args.adapter,
|
|
73
|
+
marketParamsList,
|
|
74
|
+
args.amount,
|
|
75
|
+
sharesPermit,
|
|
76
|
+
args.deadline,
|
|
77
|
+
],
|
|
78
|
+
}),
|
|
79
|
+
};
|
|
80
|
+
if (metadata)
|
|
81
|
+
tx = (0, index_js_1.addTransactionMetadata)(tx, metadata);
|
|
82
|
+
return (0, morpho_ts_1.deepFreeze)({
|
|
83
|
+
...tx,
|
|
84
|
+
action: {
|
|
85
|
+
type: "vaultV2InKindRedeem",
|
|
86
|
+
args: {
|
|
87
|
+
vault: vault.address,
|
|
88
|
+
adapter: args.adapter,
|
|
89
|
+
amount: args.amount,
|
|
90
|
+
marketParamsList,
|
|
91
|
+
onBehalf: args.userAddress,
|
|
92
|
+
deadline: args.deadline,
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
});
|
|
96
|
+
};
|
|
97
|
+
exports.vaultV2InKindRedeem = vaultV2InKindRedeem;
|
|
@@ -17,5 +17,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./deposit.js"), exports);
|
|
18
18
|
__exportStar(require("./forceRedeem.js"), exports);
|
|
19
19
|
__exportStar(require("./forceWithdraw.js"), exports);
|
|
20
|
+
__exportStar(require("./inKindRedeem.js"), exports);
|
|
20
21
|
__exportStar(require("./redeem.js"), exports);
|
|
21
22
|
__exportStar(require("./withdraw.js"), exports);
|
|
@@ -21,8 +21,7 @@ export interface BundlerCall {
|
|
|
21
21
|
*
|
|
22
22
|
* @remarks
|
|
23
23
|
* The namespace covers only the Bundler3 actions required by `morpho-sdk`.
|
|
24
|
-
* It does not expose operation population or simulation helpers
|
|
25
|
-
* `@morpho-org/bundler-sdk-viem`.
|
|
24
|
+
* It does not expose operation population or broad simulation helpers.
|
|
26
25
|
*/
|
|
27
26
|
export declare namespace BundlerAction {
|
|
28
27
|
/**
|
|
@@ -651,6 +650,123 @@ export declare namespace BundlerAction {
|
|
|
651
650
|
* ```
|
|
652
651
|
*/
|
|
653
652
|
function publicAllocatorReallocateTo(chainId: number, vault: Address, fee: bigint, withdrawals: InputReallocation[], supplyMarketParams: InputMarketParams, skipRevert?: boolean): BundlerCall[];
|
|
653
|
+
/**
|
|
654
|
+
* Encodes a Vault V2 Blue Public Allocator market-to-market reallocation.
|
|
655
|
+
*
|
|
656
|
+
* @remarks Bundler3 must already hold the computed penalty assets. The
|
|
657
|
+
* high-level Blue builders add the corresponding GeneralAdapter1 transfer.
|
|
658
|
+
*
|
|
659
|
+
* @param chainId - Chain whose canonical Blue Public Allocator is called.
|
|
660
|
+
* @param vault - Vault whose liquidity is reallocated.
|
|
661
|
+
* @param deallocateAdapter - Vault V2 adapter supplying the source market.
|
|
662
|
+
* @param deallocateMarket - Source Morpho Blue market parameters.
|
|
663
|
+
* @param allocateAdapter - Vault V2 adapter supplying the target market.
|
|
664
|
+
* @param allocateMarket - Target Morpho Blue market parameters.
|
|
665
|
+
* @param assets - Assets to reallocate, bounded by `uint128` by the high-level action.
|
|
666
|
+
* @param penalty - Vault-configured proportional penalty, scaled by WAD.
|
|
667
|
+
* @param skipRevert - Whether Bundler3 should tolerate a revert.
|
|
668
|
+
* @returns A zero reset and exact approval when needed, then the allocator call.
|
|
669
|
+
* @throws {BundlerErrors.UnexpectedAction} when the chain has no Blue Public Allocator deployment.
|
|
670
|
+
* @throws {BundlerErrors.SkippableAllocatorPenalty} when `skipRevert` is true and a token approval is required.
|
|
671
|
+
* @example
|
|
672
|
+
* ```ts
|
|
673
|
+
* import { ChainId, type InputMarketParams } from "@morpho-org/blue-sdk";
|
|
674
|
+
* import {
|
|
675
|
+
* BundlerAction,
|
|
676
|
+
* type BundlerCall,
|
|
677
|
+
* } from "@morpho-org/morpho-sdk/bundler";
|
|
678
|
+
* import type { Address } from "viem";
|
|
679
|
+
*
|
|
680
|
+
* const keyrockUsdcVault =
|
|
681
|
+
* "0x04422053aDDbc9bB2759b248B574e3FCA76Bc145" satisfies Address;
|
|
682
|
+
* const sourceAdapterFixture =
|
|
683
|
+
* "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" satisfies Address;
|
|
684
|
+
* const targetAdapterFixture =
|
|
685
|
+
* "0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC" satisfies Address;
|
|
686
|
+
* const usdc = "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48" satisfies Address;
|
|
687
|
+
* const weth = "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" satisfies Address;
|
|
688
|
+
* const wbtc = "0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599" satisfies Address;
|
|
689
|
+
* const ethUsdOracle = "0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419" satisfies Address;
|
|
690
|
+
* const adaptiveCurveIrm = "0x870aC11D48B15DB9a138Cf899d20F13F79Ba00BC" satisfies Address;
|
|
691
|
+
* const sourceMarket = {
|
|
692
|
+
* loanToken: usdc,
|
|
693
|
+
* collateralToken: weth,
|
|
694
|
+
* oracle: ethUsdOracle,
|
|
695
|
+
* irm: adaptiveCurveIrm,
|
|
696
|
+
* lltv: 860_000_000_000_000_000n,
|
|
697
|
+
* } satisfies InputMarketParams;
|
|
698
|
+
* const targetMarket = {
|
|
699
|
+
* ...sourceMarket,
|
|
700
|
+
* collateralToken: wbtc,
|
|
701
|
+
* } satisfies InputMarketParams;
|
|
702
|
+
*
|
|
703
|
+
* const calls: BundlerCall[] = BundlerAction.vaultV2BluePublicAllocatorReallocate(
|
|
704
|
+
* ChainId.EthMainnet,
|
|
705
|
+
* keyrockUsdcVault,
|
|
706
|
+
* sourceAdapterFixture,
|
|
707
|
+
* sourceMarket,
|
|
708
|
+
* targetAdapterFixture,
|
|
709
|
+
* targetMarket,
|
|
710
|
+
* 1_000_000n,
|
|
711
|
+
* 1_000_000_000_000_000n,
|
|
712
|
+
* );
|
|
713
|
+
* // Bundler3 resets and approves 1_000 USDC units, then calls `reallocate` with zero native value.
|
|
714
|
+
* ```
|
|
715
|
+
*/
|
|
716
|
+
function vaultV2BluePublicAllocatorReallocate(chainId: number, vault: Address, deallocateAdapter: Address, deallocateMarket: InputMarketParams, allocateAdapter: Address, allocateMarket: InputMarketParams, assets: bigint, penalty: bigint, skipRevert?: boolean): BundlerCall[];
|
|
717
|
+
/**
|
|
718
|
+
* Encodes a Vault V2 Blue Public Allocator allocation from vault idle liquidity.
|
|
719
|
+
*
|
|
720
|
+
* @remarks Bundler3 must already hold the computed penalty assets. The
|
|
721
|
+
* high-level Blue builders add the corresponding GeneralAdapter1 transfer.
|
|
722
|
+
*
|
|
723
|
+
* @param chainId - Chain whose canonical Blue Public Allocator is called.
|
|
724
|
+
* @param vault - Vault whose idle liquidity is allocated.
|
|
725
|
+
* @param adapter - Vault V2 adapter supplying the target market.
|
|
726
|
+
* @param market - Target Morpho Blue market parameters.
|
|
727
|
+
* @param assets - Assets to allocate, bounded by `uint128` by the high-level action.
|
|
728
|
+
* @param penalty - Vault-configured proportional penalty, scaled by WAD.
|
|
729
|
+
* @param skipRevert - Whether Bundler3 should tolerate a revert.
|
|
730
|
+
* @returns A zero reset and exact approval when needed, then the allocator call.
|
|
731
|
+
* @throws {BundlerErrors.UnexpectedAction} when the chain has no Blue Public Allocator deployment.
|
|
732
|
+
* @throws {BundlerErrors.SkippableAllocatorPenalty} when `skipRevert` is true and a token approval is required.
|
|
733
|
+
* @example
|
|
734
|
+
* ```ts
|
|
735
|
+
* import { ChainId, type InputMarketParams } from "@morpho-org/blue-sdk";
|
|
736
|
+
* import {
|
|
737
|
+
* BundlerAction,
|
|
738
|
+
* type BundlerCall,
|
|
739
|
+
* } from "@morpho-org/morpho-sdk/bundler";
|
|
740
|
+
* import type { Address } from "viem";
|
|
741
|
+
*
|
|
742
|
+
* const keyrockUsdcVault =
|
|
743
|
+
* "0x04422053aDDbc9bB2759b248B574e3FCA76Bc145" satisfies Address;
|
|
744
|
+
* const targetAdapterFixture =
|
|
745
|
+
* "0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC" satisfies Address;
|
|
746
|
+
* const usdc = "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48" satisfies Address;
|
|
747
|
+
* const weth = "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" satisfies Address;
|
|
748
|
+
* const ethUsdOracle = "0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419" satisfies Address;
|
|
749
|
+
* const adaptiveCurveIrm = "0x870aC11D48B15DB9a138Cf899d20F13F79Ba00BC" satisfies Address;
|
|
750
|
+
* const targetMarket = {
|
|
751
|
+
* loanToken: usdc,
|
|
752
|
+
* collateralToken: weth,
|
|
753
|
+
* oracle: ethUsdOracle,
|
|
754
|
+
* irm: adaptiveCurveIrm,
|
|
755
|
+
* lltv: 860_000_000_000_000_000n,
|
|
756
|
+
* } satisfies InputMarketParams;
|
|
757
|
+
*
|
|
758
|
+
* const calls: BundlerCall[] = BundlerAction.vaultV2BluePublicAllocatorAllocateFromIdle(
|
|
759
|
+
* ChainId.EthMainnet,
|
|
760
|
+
* keyrockUsdcVault,
|
|
761
|
+
* targetAdapterFixture,
|
|
762
|
+
* targetMarket,
|
|
763
|
+
* 1_000_000n,
|
|
764
|
+
* 1_000_000_000_000_000n,
|
|
765
|
+
* );
|
|
766
|
+
* // Bundler3 resets and approves 1_000 USDC units, then calls `allocateFromIdle` with zero native value.
|
|
767
|
+
* ```
|
|
768
|
+
*/
|
|
769
|
+
function vaultV2BluePublicAllocatorAllocateFromIdle(chainId: number, vault: Address, adapter: Address, market: InputMarketParams, assets: bigint, penalty: bigint, skipRevert?: boolean): BundlerCall[];
|
|
654
770
|
/**
|
|
655
771
|
* Encodes a GeneralAdapter1 native-token wrap call.
|
|
656
772
|
*
|