@morpho-org/morpho-sdk 9.6.0 → 9.7.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/MIGRATION-v6-to-v7.md +1 -1
- package/README.md +64 -3
- package/lib/cjs/entities/requirements/getBundlesTokenRequirements.js +12 -46
- package/lib/cjs/entities/requirements/getErc2612Permit.d.ts +7 -0
- package/lib/cjs/entities/requirements/getErc2612Permit.js +60 -0
- package/lib/cjs/entities/requirements/getVaultBundlesSharesRequirements.d.ts +2 -2
- package/lib/cjs/entities/vaultV1/vaultV1.d.ts +3 -3
- package/lib/cjs/entities/vaultV2/vaultV2.d.ts +2 -2
- package/lib/cjs/helpers/validateMidnightCollateralBatch.d.ts +1 -0
- package/lib/cjs/helpers/validateMidnightCollateralBatch.js +1 -0
- package/lib/cjs/index.d.ts +2 -0
- package/lib/cjs/index.js +18 -1
- package/lib/cjs/transactionPlan/approval.d.ts +2 -0
- package/lib/cjs/transactionPlan/approval.js +16 -0
- package/lib/cjs/transactionPlan/error.d.ts +145 -0
- package/lib/cjs/transactionPlan/error.js +186 -0
- package/lib/cjs/transactionPlan/getTokenPermit.d.ts +11 -0
- package/lib/cjs/transactionPlan/getTokenPermit.js +18 -0
- package/lib/cjs/transactionPlan/index.d.ts +9 -0
- package/lib/cjs/transactionPlan/index.js +24 -0
- package/lib/cjs/transactionPlan/intent.d.ts +51 -0
- package/lib/cjs/transactionPlan/intent.js +54 -0
- package/lib/cjs/transactionPlan/permit.d.ts +13 -0
- package/lib/cjs/transactionPlan/permit.js +145 -0
- package/lib/cjs/transactionPlan/plan.d.ts +99 -0
- package/lib/cjs/transactionPlan/plan.js +232 -0
- package/lib/cjs/transactionPlan/requirements.d.ts +44 -0
- package/lib/cjs/transactionPlan/requirements.js +79 -0
- package/lib/cjs/transactionPlan/serde.d.ts +33 -0
- package/lib/cjs/transactionPlan/serde.js +205 -0
- package/lib/cjs/transactionPlan/types.d.ts +91 -0
- package/lib/cjs/transactionPlan/types.js +2 -0
- package/lib/cjs/transactionPlan/validateActions.d.ts +8 -0
- package/lib/cjs/transactionPlan/validateActions.js +19 -0
- package/lib/cjs/transactionPlan/validation.d.ts +17 -0
- package/lib/cjs/transactionPlan/validation.js +70 -0
- package/lib/cjs/transactionPlan/vaultv2/deposit.d.ts +81 -0
- package/lib/cjs/transactionPlan/vaultv2/deposit.js +211 -0
- package/lib/cjs/transactionPlan/vaultv2/withdraw.d.ts +77 -0
- package/lib/cjs/transactionPlan/vaultv2/withdraw.js +190 -0
- package/lib/cjs/transactionPlan/version.d.ts +2 -0
- package/lib/cjs/transactionPlan/version.js +9 -0
- package/lib/esm/entities/requirements/getBundlesTokenRequirements.js +14 -48
- package/lib/esm/entities/requirements/getErc2612Permit.d.ts +7 -0
- package/lib/esm/entities/requirements/getErc2612Permit.js +57 -0
- package/lib/esm/entities/requirements/getVaultBundlesSharesRequirements.d.ts +2 -2
- package/lib/esm/entities/vaultV1/vaultV1.d.ts +3 -3
- package/lib/esm/entities/vaultV2/vaultV2.d.ts +2 -2
- package/lib/esm/helpers/validateMidnightCollateralBatch.d.ts +1 -0
- package/lib/esm/helpers/validateMidnightCollateralBatch.js +1 -0
- package/lib/esm/index.d.ts +2 -0
- package/lib/esm/index.js +1 -0
- package/lib/esm/transactionPlan/approval.d.ts +2 -0
- package/lib/esm/transactionPlan/approval.js +13 -0
- package/lib/esm/transactionPlan/error.d.ts +145 -0
- package/lib/esm/transactionPlan/error.js +175 -0
- package/lib/esm/transactionPlan/getTokenPermit.d.ts +11 -0
- package/lib/esm/transactionPlan/getTokenPermit.js +15 -0
- package/lib/esm/transactionPlan/index.d.ts +9 -0
- package/lib/esm/transactionPlan/index.js +5 -0
- package/lib/esm/transactionPlan/intent.d.ts +51 -0
- package/lib/esm/transactionPlan/intent.js +51 -0
- package/lib/esm/transactionPlan/permit.d.ts +13 -0
- package/lib/esm/transactionPlan/permit.js +140 -0
- package/lib/esm/transactionPlan/plan.d.ts +99 -0
- package/lib/esm/transactionPlan/plan.js +226 -0
- package/lib/esm/transactionPlan/requirements.d.ts +44 -0
- package/lib/esm/transactionPlan/requirements.js +74 -0
- package/lib/esm/transactionPlan/serde.d.ts +33 -0
- package/lib/esm/transactionPlan/serde.js +201 -0
- package/lib/esm/transactionPlan/types.d.ts +91 -0
- package/lib/esm/transactionPlan/types.js +1 -0
- package/lib/esm/transactionPlan/validateActions.d.ts +8 -0
- package/lib/esm/transactionPlan/validateActions.js +16 -0
- package/lib/esm/transactionPlan/validation.d.ts +17 -0
- package/lib/esm/transactionPlan/validation.js +64 -0
- package/lib/esm/transactionPlan/vaultv2/deposit.d.ts +81 -0
- package/lib/esm/transactionPlan/vaultv2/deposit.js +206 -0
- package/lib/esm/transactionPlan/vaultv2/withdraw.d.ts +77 -0
- package/lib/esm/transactionPlan/vaultv2/withdraw.js +185 -0
- package/lib/esm/transactionPlan/version.d.ts +2 -0
- package/lib/esm/transactionPlan/version.js +6 -0
- package/package.json +6 -5
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import type { Address, Hex } from "viem";
|
|
2
|
+
import type { BundlesFundingArgs, PermitAction, RequirementTypedData } from "../types/index.js";
|
|
3
|
+
interface ActionInputs {
|
|
4
|
+
readonly chainId: number;
|
|
5
|
+
readonly account: Address;
|
|
6
|
+
}
|
|
7
|
+
interface VaultInputs extends ActionInputs {
|
|
8
|
+
readonly vault: Address;
|
|
9
|
+
readonly deadline: bigint;
|
|
10
|
+
readonly referralFeePct: bigint;
|
|
11
|
+
readonly referralFeeRecipient: Address;
|
|
12
|
+
}
|
|
13
|
+
/** Signature request roles a vault action selects by plan-local ID. */
|
|
14
|
+
type VaultSignatureRequestIds = {
|
|
15
|
+
/** Token permit consumed by the action; omitted when no permit is needed. */
|
|
16
|
+
readonly tokenPermit?: string;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Recipes supported by Vault V2 plans. Each `type` equals the `action.type` of the
|
|
20
|
+
* {@link TransactionAction} it builds.
|
|
21
|
+
* Snapshot-derived values such as the asset and the quote are fixed on `inputs` at preparation;
|
|
22
|
+
* each action also carries its own chain and account on `inputs`.
|
|
23
|
+
* the role map `signatureRequestIds` is a step's only request reference.
|
|
24
|
+
* @experimental TransactionPlan is in beta; breaking changes may ship in minor releases.
|
|
25
|
+
*/
|
|
26
|
+
export type Action = {
|
|
27
|
+
readonly type: "erc20Approval";
|
|
28
|
+
readonly inputs: ActionInputs & {
|
|
29
|
+
readonly token: Address;
|
|
30
|
+
readonly spender: Address;
|
|
31
|
+
readonly amount: bigint;
|
|
32
|
+
};
|
|
33
|
+
} | {
|
|
34
|
+
readonly type: "vaultV2Deposit";
|
|
35
|
+
readonly inputs: VaultInputs & BundlesFundingArgs & {
|
|
36
|
+
/** Vault asset read from the snapshot. */
|
|
37
|
+
readonly asset: Address;
|
|
38
|
+
/** Deadline-accrued RAY-scaled bound quoted from the snapshot for the net deposit. */
|
|
39
|
+
readonly maxSharePrice: bigint;
|
|
40
|
+
};
|
|
41
|
+
readonly signatureRequestIds: VaultSignatureRequestIds;
|
|
42
|
+
} | {
|
|
43
|
+
readonly type: "vaultV2Withdraw";
|
|
44
|
+
readonly inputs: VaultInputs & {
|
|
45
|
+
readonly amount: bigint;
|
|
46
|
+
/** Minimum share allowance quoted from the snapshot for the gross withdrawal. */
|
|
47
|
+
readonly requiredShareAllowance: bigint;
|
|
48
|
+
};
|
|
49
|
+
readonly signatureRequestIds: VaultSignatureRequestIds;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* A recipe with a plan-unique `id`; its request dependencies are the roles its action names.
|
|
53
|
+
* @experimental TransactionPlan is in beta; breaking changes may ship in minor releases.
|
|
54
|
+
*/
|
|
55
|
+
export interface Step<TAction extends Action = Action> {
|
|
56
|
+
readonly id: string;
|
|
57
|
+
readonly label: string;
|
|
58
|
+
readonly action: TAction;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* ERC-2612 permit request exposed as `{ id, kind, typedData }`. `signature` is undefined until the
|
|
62
|
+
* account signs `typedData`. Protocol milestones add further `kind`s such as Blue authorization.
|
|
63
|
+
* @experimental TransactionPlan is in beta; breaking changes may ship in minor releases.
|
|
64
|
+
*/
|
|
65
|
+
export interface SignatureRequest {
|
|
66
|
+
readonly id: string;
|
|
67
|
+
readonly kind: "permit";
|
|
68
|
+
readonly typedData: RequirementTypedData;
|
|
69
|
+
readonly args: PermitAction["args"] & {
|
|
70
|
+
readonly nonce: bigint;
|
|
71
|
+
};
|
|
72
|
+
readonly signature?: Hex;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Data-only operation prepared for one chain and account from the caller's intent and a vault
|
|
76
|
+
* snapshot. Every step and signature request carries its own `id`, unique within the plan. Once
|
|
77
|
+
* prepared, a plan is static: only signatures are added before building.
|
|
78
|
+
* @experimental TransactionPlan is in beta; breaking changes may ship in minor releases.
|
|
79
|
+
*/
|
|
80
|
+
export interface TransactionPlan {
|
|
81
|
+
readonly version: 1;
|
|
82
|
+
readonly chainId: number;
|
|
83
|
+
readonly account: Address;
|
|
84
|
+
/** Unix seconds. One expiry governs every step deadline and signature deadline. */
|
|
85
|
+
readonly expiresAt: number;
|
|
86
|
+
/** Appended verbatim to every built transaction's calldata. */
|
|
87
|
+
readonly calldataOrigin?: Hex;
|
|
88
|
+
readonly steps: readonly Step[];
|
|
89
|
+
readonly signatureRequests: readonly SignatureRequest[];
|
|
90
|
+
}
|
|
91
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Step } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* @internal Rejects unknown action types before interpreting requests or updates.
|
|
4
|
+
* @param steps - Steps whose action discriminators must be supported.
|
|
5
|
+
* @returns Nothing when every action type is supported.
|
|
6
|
+
* @throws {UnsupportedTransactionPlanActionError} when any step names an unsupported action type.
|
|
7
|
+
*/
|
|
8
|
+
export declare function validateTransactionPlanActions(steps: readonly Step[]): void;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateTransactionPlanActions = validateTransactionPlanActions;
|
|
4
|
+
const error_js_1 = require("./error.js");
|
|
5
|
+
/**
|
|
6
|
+
* @internal Rejects unknown action types before interpreting requests or updates.
|
|
7
|
+
* @param steps - Steps whose action discriminators must be supported.
|
|
8
|
+
* @returns Nothing when every action type is supported.
|
|
9
|
+
* @throws {UnsupportedTransactionPlanActionError} when any step names an unsupported action type.
|
|
10
|
+
*/
|
|
11
|
+
function validateTransactionPlanActions(steps) {
|
|
12
|
+
for (const step of steps) {
|
|
13
|
+
const actionType = step.action.type;
|
|
14
|
+
if (actionType !== "erc20Approval" &&
|
|
15
|
+
actionType !== "vaultV2Deposit" &&
|
|
16
|
+
actionType !== "vaultV2Withdraw")
|
|
17
|
+
throw new error_js_1.UnsupportedTransactionPlanActionError(actionType);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** @internal Scalar and collection shapes used by stored plan fields. */
|
|
2
|
+
type PlanFieldType = "string" | "address" | "hex" | "safe integer" | "positive safe integer" | "uint256 bigint" | "array";
|
|
3
|
+
/** @internal Validates one restored field without coercing it. */
|
|
4
|
+
export declare function validatePlanField(value: unknown, options: {
|
|
5
|
+
readonly path: string;
|
|
6
|
+
readonly type: PlanFieldType;
|
|
7
|
+
}): void;
|
|
8
|
+
/** @internal Requires a non-null, non-array JSON object. */
|
|
9
|
+
export declare function getPlanObject(value: unknown, path: string): Record<string, unknown>;
|
|
10
|
+
/** @internal Validates required fields while permitting additional keys. */
|
|
11
|
+
export declare function validatePlanFields(value: Record<string, unknown>, options: {
|
|
12
|
+
readonly path: string;
|
|
13
|
+
readonly fields: Readonly<Record<string, PlanFieldType>>;
|
|
14
|
+
}): void;
|
|
15
|
+
/** @internal Validates the shared stored vault-action fields and role map. */
|
|
16
|
+
export declare function validateVaultPlanAction(action: Record<string, unknown>, path: string): Record<string, unknown>;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validatePlanField = validatePlanField;
|
|
4
|
+
exports.getPlanObject = getPlanObject;
|
|
5
|
+
exports.validatePlanFields = validatePlanFields;
|
|
6
|
+
exports.validateVaultPlanAction = validateVaultPlanAction;
|
|
7
|
+
const viem_1 = require("viem");
|
|
8
|
+
const error_js_1 = require("./error.js");
|
|
9
|
+
/** @internal Validates one restored field without coercing it. */
|
|
10
|
+
function validatePlanField(value, options) {
|
|
11
|
+
const { path, type } = options;
|
|
12
|
+
let valid;
|
|
13
|
+
switch (type) {
|
|
14
|
+
case "string":
|
|
15
|
+
valid = typeof value === "string";
|
|
16
|
+
break;
|
|
17
|
+
case "address":
|
|
18
|
+
valid = typeof value === "string" && (0, viem_1.isAddress)(value);
|
|
19
|
+
break;
|
|
20
|
+
case "hex":
|
|
21
|
+
valid =
|
|
22
|
+
typeof value === "string" && /^0x(?:[0-9a-fA-F]{2})*$/.test(value);
|
|
23
|
+
break;
|
|
24
|
+
case "safe integer":
|
|
25
|
+
valid = typeof value === "number" && Number.isSafeInteger(value);
|
|
26
|
+
break;
|
|
27
|
+
case "positive safe integer":
|
|
28
|
+
valid =
|
|
29
|
+
typeof value === "number" && Number.isSafeInteger(value) && value > 0;
|
|
30
|
+
break;
|
|
31
|
+
case "uint256 bigint":
|
|
32
|
+
valid = typeof value === "bigint" && value >= 0n && value <= viem_1.maxUint256;
|
|
33
|
+
break;
|
|
34
|
+
case "array":
|
|
35
|
+
valid = Array.isArray(value);
|
|
36
|
+
break;
|
|
37
|
+
}
|
|
38
|
+
if (!valid)
|
|
39
|
+
throw new error_js_1.InvalidTransactionPlanError({ path, reason: `expected ${type}` });
|
|
40
|
+
}
|
|
41
|
+
/** @internal Requires a non-null, non-array JSON object. */
|
|
42
|
+
function getPlanObject(value, path) {
|
|
43
|
+
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
44
|
+
throw new error_js_1.InvalidTransactionPlanError({
|
|
45
|
+
path,
|
|
46
|
+
reason: "expected an object",
|
|
47
|
+
});
|
|
48
|
+
return value;
|
|
49
|
+
}
|
|
50
|
+
/** @internal Validates required fields while permitting additional keys. */
|
|
51
|
+
function validatePlanFields(value, options) {
|
|
52
|
+
for (const [key, type] of Object.entries(options.fields))
|
|
53
|
+
validatePlanField(value[key], { path: `${options.path}.${key}`, type });
|
|
54
|
+
}
|
|
55
|
+
/** @internal Validates the shared stored vault-action fields and role map. */
|
|
56
|
+
function validateVaultPlanAction(action, path) {
|
|
57
|
+
const inputs = getPlanObject(action.inputs, `${path}.inputs`);
|
|
58
|
+
validatePlanFields(inputs, {
|
|
59
|
+
path: `${path}.inputs`,
|
|
60
|
+
fields: {
|
|
61
|
+
vault: "address",
|
|
62
|
+
deadline: "uint256 bigint",
|
|
63
|
+
referralFeePct: "uint256 bigint",
|
|
64
|
+
referralFeeRecipient: "address",
|
|
65
|
+
},
|
|
66
|
+
});
|
|
67
|
+
// Vault actions require a role map even when no permit is needed.
|
|
68
|
+
getPlanObject(action.signatureRequestIds, `${path}.signatureRequestIds`);
|
|
69
|
+
return inputs;
|
|
70
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { type AccrualVaultV2 } from "@morpho-org/blue-sdk";
|
|
2
|
+
import { type Address, type Client } from "viem";
|
|
3
|
+
import { type Transaction, type VaultV2DepositAction } from "../../types/index.js";
|
|
4
|
+
import { type Funding, type IntentParams } from "../intent.js";
|
|
5
|
+
import type { Action, SignatureRequest, TransactionPlan } from "../types.js";
|
|
6
|
+
/** @internal Validates the stored Vault V2 deposit action's input shape. */
|
|
7
|
+
export declare function validateDepositPlanAction(action: Record<string, unknown>, path: string): void;
|
|
8
|
+
/**
|
|
9
|
+
* Caller intent for a Vault V2 deposit, mirroring the Actions API deposit inputs, plus the snapshot.
|
|
10
|
+
* @experimental TransactionPlan is in beta; breaking changes may ship in minor releases.
|
|
11
|
+
*/
|
|
12
|
+
export interface VaultV2DepositPlanParams extends IntentParams {
|
|
13
|
+
/** WAD-scaled tolerance for the share-price bound; defaults to `DEFAULT_SLIPPAGE_TOLERANCE`. */
|
|
14
|
+
readonly slippageTolerance?: bigint;
|
|
15
|
+
readonly vault: Address;
|
|
16
|
+
/** Gross amount the account pays, before the referral fee. */
|
|
17
|
+
readonly amount: bigint;
|
|
18
|
+
/** Defaults to `{ type: "erc20" }`. */
|
|
19
|
+
readonly funding?: Funding;
|
|
20
|
+
/**
|
|
21
|
+
* Accrual snapshot of `vault`, fetched by the caller with `fetchAccrualVaultV2`. The asset and
|
|
22
|
+
* the deadline-accrued `maxSharePrice` are derived from it at preparation; the snapshot itself is
|
|
23
|
+
* never stored in the plan.
|
|
24
|
+
*/
|
|
25
|
+
readonly vaultData: AccrualVaultV2;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Prepares a deposit plan from caller intent and a vault snapshot, reading the token prerequisites
|
|
29
|
+
* directly. The quote is fixed on the deposit step at preparation, so the returned plan is static:
|
|
30
|
+
* only signatures are added before building.
|
|
31
|
+
* @param client - Viem client for `params.chainId`, used for allowance and permit metadata reads only.
|
|
32
|
+
* @param params.vault - Vault V2 contract receiving the net deposit.
|
|
33
|
+
* @param params.vaultData - Caller-fetched `AccrualVaultV2` snapshot of `vault`, used to derive the asset and deadline-accrued share-price bound.
|
|
34
|
+
* @param params.chainId - Chain containing the vault and registered VaultBundlesV1 contract.
|
|
35
|
+
* @param params.account - Non-zero account funding, signing and sending the deposit.
|
|
36
|
+
* @param params.amount - Positive gross deposit in asset base units, before referral fees.
|
|
37
|
+
* @param params.funding.type - Optional funding source: `"erc20"` (default) or `"native"`; native funding requires the vault asset to be wNative.
|
|
38
|
+
* @param params.referralFee.bps - Optional integer fee in basis points of the gross amount; defaults to zero and must be below 10,000.
|
|
39
|
+
* @param params.referralFee.recipient - Recipient of the optional fee; must be non-zero when the fee is positive.
|
|
40
|
+
* @param params.slippageTolerance - Optional WAD-scaled tolerance for the share-price bound; defaults to `DEFAULT_SLIPPAGE_TOLERANCE` and must not exceed `MAX_SLIPPAGE_TOLERANCE`.
|
|
41
|
+
* @param params.supportSignature - Optional ERC-2612 preference, defaulting to `false`; when enabled, falls back to direct approval if no permit is available.
|
|
42
|
+
* @param params.expiresAt - Optional future Unix timestamp in seconds as a safe integer; defaults to two hours from preparation.
|
|
43
|
+
* @param params.calldataOrigin - Optional non-empty, even-length hex bytes appended to each built transaction's calldata.
|
|
44
|
+
* @param params.deployless - Optional permission to use deployless aggregation for token permit metadata reads.
|
|
45
|
+
* @returns A plan with approvals, concrete signature requests and the deposit step.
|
|
46
|
+
* @throws {ZeroAccountError} when `account` is the zero address.
|
|
47
|
+
* @throws {NonIntegerInputError} when `expiresAt` or `referralFee.bps` is not a safe integer.
|
|
48
|
+
* @throws {NonPositiveInputError} when `expiresAt`, `amount`, net assets or previewed shares are not positive.
|
|
49
|
+
* @throws {ExpiredDeadlineError} when `expiresAt` is not in the future.
|
|
50
|
+
* @throws {NegativeInputError} when `referralFee.bps` or `slippageTolerance` is negative.
|
|
51
|
+
* @throws {InputExceedsMaxError} when `referralFee.bps` exceeds 10,000 or `amount` exceeds uint256.
|
|
52
|
+
* @throws {ExcessiveSlippageToleranceError} when `slippageTolerance` exceeds `MAX_SLIPPAGE_TOLERANCE`.
|
|
53
|
+
* @throws {InvalidCalldataOriginError} when `calldataOrigin` is empty, malformed or has an odd number of hex digits.
|
|
54
|
+
* @throws {ReferralFeePctExceededError} when `referralFee.bps` equals 10,000; the normalized fee must be below WAD.
|
|
55
|
+
* @throws {ReferralFeeRecipientMissingError} when a positive referral fee has no recipient or a zero recipient.
|
|
56
|
+
* @throws {VaultAddressMismatchError} when `vaultData` describes another vault.
|
|
57
|
+
* @throws {NativeAmountOnNonWNativeVaultError} when native funding targets a vault whose asset is not wNative.
|
|
58
|
+
* @throws {ChainIdMismatchError} when the client targets another chain.
|
|
59
|
+
* @throws {MissingContractCodeError} when the VaultBundlesV1 contract is absent.
|
|
60
|
+
* @see computeVaultMaxSharePrice for quote errors.
|
|
61
|
+
* @example
|
|
62
|
+
* ```ts
|
|
63
|
+
* import { prepareVaultV2Deposit } from "@morpho-org/morpho-sdk";
|
|
64
|
+
* import { fetchAccrualVaultV2 } from "@morpho-org/morpho-sdk/fetch";
|
|
65
|
+
* import { createPublicClient, http } from "viem";
|
|
66
|
+
* import { mainnet } from "viem/chains";
|
|
67
|
+
* const client = createPublicClient({ chain: mainnet, transport: http() });
|
|
68
|
+
* const vault = "0x04422053aDDbc9bB2759b248B574e3FCA76Bc145";
|
|
69
|
+
* const plan = await prepareVaultV2Deposit(client, {
|
|
70
|
+
* vault, chainId: 1, account: "0x0000000000000000000000000000000000000001", amount: 1_000_000n, supportSignature: true,
|
|
71
|
+
* vaultData: await fetchAccrualVaultV2(vault, client),
|
|
72
|
+
* });
|
|
73
|
+
* // Sign the pending requests, verify and attach with applySignatures, then build.
|
|
74
|
+
* ```
|
|
75
|
+
* @experimental TransactionPlan is in beta; breaking changes may ship in minor releases.
|
|
76
|
+
*/
|
|
77
|
+
export declare function prepareVaultV2Deposit(client: Client, params: VaultV2DepositPlanParams): Promise<TransactionPlan>;
|
|
78
|
+
/** @internal Encodes the deposit from its self-contained inputs and resolved signature requests. */
|
|
79
|
+
export declare function buildVaultV2Deposit(action: Extract<Action, {
|
|
80
|
+
type: "vaultV2Deposit";
|
|
81
|
+
}>, requests: readonly SignatureRequest[]): Readonly<Transaction<VaultV2DepositAction>>;
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateDepositPlanAction = validateDepositPlanAction;
|
|
4
|
+
exports.prepareVaultV2Deposit = prepareVaultV2Deposit;
|
|
5
|
+
exports.buildVaultV2Deposit = buildVaultV2Deposit;
|
|
6
|
+
const blue_sdk_1 = require("@morpho-org/blue-sdk");
|
|
7
|
+
const morpho_ts_1 = require("@morpho-org/morpho-ts");
|
|
8
|
+
const viem_1 = require("viem");
|
|
9
|
+
const common_js_1 = require("../../actions/bundles/common.js");
|
|
10
|
+
const validateClientChainId_js_1 = require("../../actions/requirements/validateClientChainId.js");
|
|
11
|
+
const deposit_js_1 = require("../../actions/vaultV2/deposit.js");
|
|
12
|
+
const assertContractCode_js_1 = require("../../entities/requirements/assertContractCode.js");
|
|
13
|
+
const index_js_1 = require("../../helpers/index.js");
|
|
14
|
+
const validate_js_1 = require("../../helpers/validate.js");
|
|
15
|
+
const index_js_2 = require("../../types/index.js");
|
|
16
|
+
const error_js_1 = require("../error.js");
|
|
17
|
+
const intent_js_1 = require("../intent.js");
|
|
18
|
+
const permit_js_1 = require("../permit.js");
|
|
19
|
+
const requirements_js_1 = require("../requirements.js");
|
|
20
|
+
const validation_js_1 = require("../validation.js");
|
|
21
|
+
/** @internal Validates the stored Vault V2 deposit action's input shape. */
|
|
22
|
+
function validateDepositPlanAction(action, path) {
|
|
23
|
+
const inputs = (0, validation_js_1.validateVaultPlanAction)(action, path);
|
|
24
|
+
(0, validation_js_1.validatePlanFields)(inputs, {
|
|
25
|
+
path: `${path}.inputs`,
|
|
26
|
+
fields: { asset: "address", maxSharePrice: "uint256 bigint" },
|
|
27
|
+
});
|
|
28
|
+
if ((inputs.amount === undefined) === (inputs.nativeAmount === undefined))
|
|
29
|
+
throw new error_js_1.InvalidTransactionPlanError({
|
|
30
|
+
path: `${path}.inputs`,
|
|
31
|
+
reason: "expected exactly one of amount or nativeAmount",
|
|
32
|
+
});
|
|
33
|
+
const field = inputs.amount === undefined ? "nativeAmount" : "amount";
|
|
34
|
+
(0, validation_js_1.validatePlanField)(inputs[field], {
|
|
35
|
+
path: `${path}.inputs.${field}`,
|
|
36
|
+
type: "uint256 bigint",
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
function resolveDepositInputs(params, now) {
|
|
40
|
+
const { vault, chainId, amount, vaultData } = params;
|
|
41
|
+
const intent = (0, intent_js_1.resolveIntent)(params, now);
|
|
42
|
+
const slippageTolerance = params.slippageTolerance ?? blue_sdk_1.DEFAULT_SLIPPAGE_TOLERANCE;
|
|
43
|
+
(0, validate_js_1.validateSlippageTolerance)(slippageTolerance);
|
|
44
|
+
const native = (params.funding ?? { type: "erc20" }).type === "native";
|
|
45
|
+
if (amount <= 0n)
|
|
46
|
+
throw new index_js_2.NonPositiveInputError("amount", amount);
|
|
47
|
+
// Reject amounts that cannot be encoded as uint256 before making RPC requests.
|
|
48
|
+
(0, validate_js_1.validateUint256Field)("amount", amount);
|
|
49
|
+
const common = (0, common_js_1.normalizeBundlesCommonParams)({
|
|
50
|
+
deadline: intent.deadline,
|
|
51
|
+
referralFeePct: intent.referralFeePct,
|
|
52
|
+
referralFeeRecipient: intent.referralFeeRecipient,
|
|
53
|
+
});
|
|
54
|
+
if (!(0, viem_1.isAddressEqual)(vaultData.address, vault))
|
|
55
|
+
throw new index_js_2.VaultAddressMismatchError(vaultData.address, vault);
|
|
56
|
+
const { asset } = vaultData;
|
|
57
|
+
// Native funding must target the chain's wrapped-native vault asset.
|
|
58
|
+
if (native)
|
|
59
|
+
(0, validate_js_1.validateNativeVaultAsset)(chainId, asset);
|
|
60
|
+
// The quote depends only on the snapshot and the intent, so it is fixed before any read.
|
|
61
|
+
const maxSharePrice = (0, index_js_1.computeVaultMaxSharePrice)({
|
|
62
|
+
vaultData,
|
|
63
|
+
deadline: intent.deadline,
|
|
64
|
+
assets: amount - (0, common_js_1.getBundlesReferralFeeAssets)(amount, common.referralFeePct),
|
|
65
|
+
slippageTolerance,
|
|
66
|
+
});
|
|
67
|
+
return { intent, native, common, asset, maxSharePrice };
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Prepares a deposit plan from caller intent and a vault snapshot, reading the token prerequisites
|
|
71
|
+
* directly. The quote is fixed on the deposit step at preparation, so the returned plan is static:
|
|
72
|
+
* only signatures are added before building.
|
|
73
|
+
* @param client - Viem client for `params.chainId`, used for allowance and permit metadata reads only.
|
|
74
|
+
* @param params.vault - Vault V2 contract receiving the net deposit.
|
|
75
|
+
* @param params.vaultData - Caller-fetched `AccrualVaultV2` snapshot of `vault`, used to derive the asset and deadline-accrued share-price bound.
|
|
76
|
+
* @param params.chainId - Chain containing the vault and registered VaultBundlesV1 contract.
|
|
77
|
+
* @param params.account - Non-zero account funding, signing and sending the deposit.
|
|
78
|
+
* @param params.amount - Positive gross deposit in asset base units, before referral fees.
|
|
79
|
+
* @param params.funding.type - Optional funding source: `"erc20"` (default) or `"native"`; native funding requires the vault asset to be wNative.
|
|
80
|
+
* @param params.referralFee.bps - Optional integer fee in basis points of the gross amount; defaults to zero and must be below 10,000.
|
|
81
|
+
* @param params.referralFee.recipient - Recipient of the optional fee; must be non-zero when the fee is positive.
|
|
82
|
+
* @param params.slippageTolerance - Optional WAD-scaled tolerance for the share-price bound; defaults to `DEFAULT_SLIPPAGE_TOLERANCE` and must not exceed `MAX_SLIPPAGE_TOLERANCE`.
|
|
83
|
+
* @param params.supportSignature - Optional ERC-2612 preference, defaulting to `false`; when enabled, falls back to direct approval if no permit is available.
|
|
84
|
+
* @param params.expiresAt - Optional future Unix timestamp in seconds as a safe integer; defaults to two hours from preparation.
|
|
85
|
+
* @param params.calldataOrigin - Optional non-empty, even-length hex bytes appended to each built transaction's calldata.
|
|
86
|
+
* @param params.deployless - Optional permission to use deployless aggregation for token permit metadata reads.
|
|
87
|
+
* @returns A plan with approvals, concrete signature requests and the deposit step.
|
|
88
|
+
* @throws {ZeroAccountError} when `account` is the zero address.
|
|
89
|
+
* @throws {NonIntegerInputError} when `expiresAt` or `referralFee.bps` is not a safe integer.
|
|
90
|
+
* @throws {NonPositiveInputError} when `expiresAt`, `amount`, net assets or previewed shares are not positive.
|
|
91
|
+
* @throws {ExpiredDeadlineError} when `expiresAt` is not in the future.
|
|
92
|
+
* @throws {NegativeInputError} when `referralFee.bps` or `slippageTolerance` is negative.
|
|
93
|
+
* @throws {InputExceedsMaxError} when `referralFee.bps` exceeds 10,000 or `amount` exceeds uint256.
|
|
94
|
+
* @throws {ExcessiveSlippageToleranceError} when `slippageTolerance` exceeds `MAX_SLIPPAGE_TOLERANCE`.
|
|
95
|
+
* @throws {InvalidCalldataOriginError} when `calldataOrigin` is empty, malformed or has an odd number of hex digits.
|
|
96
|
+
* @throws {ReferralFeePctExceededError} when `referralFee.bps` equals 10,000; the normalized fee must be below WAD.
|
|
97
|
+
* @throws {ReferralFeeRecipientMissingError} when a positive referral fee has no recipient or a zero recipient.
|
|
98
|
+
* @throws {VaultAddressMismatchError} when `vaultData` describes another vault.
|
|
99
|
+
* @throws {NativeAmountOnNonWNativeVaultError} when native funding targets a vault whose asset is not wNative.
|
|
100
|
+
* @throws {ChainIdMismatchError} when the client targets another chain.
|
|
101
|
+
* @throws {MissingContractCodeError} when the VaultBundlesV1 contract is absent.
|
|
102
|
+
* @see computeVaultMaxSharePrice for quote errors.
|
|
103
|
+
* @example
|
|
104
|
+
* ```ts
|
|
105
|
+
* import { prepareVaultV2Deposit } from "@morpho-org/morpho-sdk";
|
|
106
|
+
* import { fetchAccrualVaultV2 } from "@morpho-org/morpho-sdk/fetch";
|
|
107
|
+
* import { createPublicClient, http } from "viem";
|
|
108
|
+
* import { mainnet } from "viem/chains";
|
|
109
|
+
* const client = createPublicClient({ chain: mainnet, transport: http() });
|
|
110
|
+
* const vault = "0x04422053aDDbc9bB2759b248B574e3FCA76Bc145";
|
|
111
|
+
* const plan = await prepareVaultV2Deposit(client, {
|
|
112
|
+
* vault, chainId: 1, account: "0x0000000000000000000000000000000000000001", amount: 1_000_000n, supportSignature: true,
|
|
113
|
+
* vaultData: await fetchAccrualVaultV2(vault, client),
|
|
114
|
+
* });
|
|
115
|
+
* // Sign the pending requests, verify and attach with applySignatures, then build.
|
|
116
|
+
* ```
|
|
117
|
+
* @experimental TransactionPlan is in beta; breaking changes may ship in minor releases.
|
|
118
|
+
*/
|
|
119
|
+
async function prepareVaultV2Deposit(client, params) {
|
|
120
|
+
const { vault, chainId, account, amount } = params;
|
|
121
|
+
const now = morpho_ts_1.Time.timestamp();
|
|
122
|
+
const { intent, native, common, asset, maxSharePrice } = resolveDepositInputs(params, now);
|
|
123
|
+
const spender = (0, morpho_ts_1.getChainAddress)(chainId, "bundles.vaultBundlesV1");
|
|
124
|
+
const [requirements] = await Promise.all([
|
|
125
|
+
(0, validateClientChainId_js_1.validateClientChainId)(client, chainId).then(() => native
|
|
126
|
+
? []
|
|
127
|
+
: (0, requirements_js_1.getTokenRequirements)(client, {
|
|
128
|
+
token: asset,
|
|
129
|
+
spender,
|
|
130
|
+
amount,
|
|
131
|
+
owner: account,
|
|
132
|
+
chainId,
|
|
133
|
+
deadline: intent.deadline,
|
|
134
|
+
now,
|
|
135
|
+
supportSignature: intent.supportSignature,
|
|
136
|
+
deployless: intent.deployless,
|
|
137
|
+
})),
|
|
138
|
+
(0, assertContractCode_js_1.assertRegistryTargetsHaveCode)(client, chainId, [
|
|
139
|
+
{ role: "bundles.vaultBundlesV1", address: spender },
|
|
140
|
+
]),
|
|
141
|
+
]);
|
|
142
|
+
const approvals = [];
|
|
143
|
+
const signatureRequests = [];
|
|
144
|
+
const tokenPermitRequestId = "vaultV2Deposit:tokenPermit";
|
|
145
|
+
for (const requirement of requirements) {
|
|
146
|
+
if ("sign" in requirement) {
|
|
147
|
+
signatureRequests.push((0, requirements_js_1.buildPermitSignatureRequest)(requirement, tokenPermitRequestId));
|
|
148
|
+
}
|
|
149
|
+
else {
|
|
150
|
+
approvals.push((0, requirements_js_1.buildApprovalStep)(requirement, {
|
|
151
|
+
id: approvals.length === 0
|
|
152
|
+
? "vaultV2Deposit:approval"
|
|
153
|
+
: `vaultV2Deposit:approval:${approvals.length + 1}`,
|
|
154
|
+
chainId,
|
|
155
|
+
account,
|
|
156
|
+
}));
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
return (0, morpho_ts_1.deepFreeze)(structuredClone({
|
|
160
|
+
version: 1,
|
|
161
|
+
account,
|
|
162
|
+
chainId,
|
|
163
|
+
expiresAt: intent.expiresAt,
|
|
164
|
+
...(intent.calldataOrigin && { calldataOrigin: intent.calldataOrigin }),
|
|
165
|
+
steps: [
|
|
166
|
+
...approvals,
|
|
167
|
+
{
|
|
168
|
+
id: "vaultV2Deposit",
|
|
169
|
+
label: "Deposit into vault",
|
|
170
|
+
action: {
|
|
171
|
+
type: "vaultV2Deposit",
|
|
172
|
+
inputs: {
|
|
173
|
+
chainId,
|
|
174
|
+
account,
|
|
175
|
+
vault,
|
|
176
|
+
asset,
|
|
177
|
+
maxSharePrice,
|
|
178
|
+
...(native ? { nativeAmount: amount } : { amount }),
|
|
179
|
+
...common,
|
|
180
|
+
},
|
|
181
|
+
signatureRequestIds: signatureRequests.length > 0
|
|
182
|
+
? { tokenPermit: tokenPermitRequestId }
|
|
183
|
+
: {},
|
|
184
|
+
},
|
|
185
|
+
},
|
|
186
|
+
],
|
|
187
|
+
signatureRequests,
|
|
188
|
+
}));
|
|
189
|
+
}
|
|
190
|
+
/** @internal Encodes the deposit from its self-contained inputs and resolved signature requests. */
|
|
191
|
+
function buildVaultV2Deposit(action, requests) {
|
|
192
|
+
const { asset, chainId, account, ...args } = action.inputs;
|
|
193
|
+
const signature = (0, permit_js_1.getVaultPermit)(requests, {
|
|
194
|
+
id: action.signatureRequestIds.tokenPermit,
|
|
195
|
+
asset,
|
|
196
|
+
owner: account,
|
|
197
|
+
});
|
|
198
|
+
const requirementSignature = (0, common_js_1.selectBundlesTokenRequirementSignature)(signature ? [signature] : [], {
|
|
199
|
+
spender: (0, morpho_ts_1.getChainAddress)(chainId, "bundles.vaultBundlesV1"),
|
|
200
|
+
amount: action.inputs.amount ?? action.inputs.nativeAmount,
|
|
201
|
+
deadline: action.inputs.deadline,
|
|
202
|
+
});
|
|
203
|
+
return (0, deposit_js_1.vaultV2Deposit)({
|
|
204
|
+
vault: { chainId, address: action.inputs.vault, asset },
|
|
205
|
+
args: {
|
|
206
|
+
...args,
|
|
207
|
+
userAddress: account,
|
|
208
|
+
requirementSignature,
|
|
209
|
+
},
|
|
210
|
+
});
|
|
211
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { type AccrualVaultV2 } from "@morpho-org/blue-sdk";
|
|
2
|
+
import { type Address, type Client } from "viem";
|
|
3
|
+
import { type Transaction, type VaultV2WithdrawAction } from "../../types/index.js";
|
|
4
|
+
import { type IntentParams } from "../intent.js";
|
|
5
|
+
import type { Action, SignatureRequest, TransactionPlan } from "../types.js";
|
|
6
|
+
/** @internal Validates the stored Vault V2 withdrawal action's input shape. */
|
|
7
|
+
export declare function validateWithdrawPlanAction(action: Record<string, unknown>, path: string): void;
|
|
8
|
+
/**
|
|
9
|
+
* Caller intent for a Vault V2 asset withdrawal, mirroring the Actions API withdraw inputs, plus the snapshot.
|
|
10
|
+
* @experimental TransactionPlan is in beta; breaking changes may ship in minor releases.
|
|
11
|
+
*/
|
|
12
|
+
export interface VaultV2WithdrawPlanParams extends IntentParams {
|
|
13
|
+
readonly vault: Address;
|
|
14
|
+
/** Gross assets withdrawn, before the referral fee. */
|
|
15
|
+
readonly amount: bigint;
|
|
16
|
+
/**
|
|
17
|
+
* Accrual snapshot of `vault`, fetched by the caller with `fetchAccrualVaultV2`. The required
|
|
18
|
+
* share allowance is derived from it at preparation; the snapshot itself is never stored.
|
|
19
|
+
*/
|
|
20
|
+
readonly vaultData: AccrualVaultV2;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Prepares a withdrawal plan from caller intent and a vault snapshot. The share quote is fixed on
|
|
24
|
+
* the withdrawal step at preparation, because the required share allowance decides the approval or
|
|
25
|
+
* permit prerequisite, so the returned plan is static: only signatures are added before building.
|
|
26
|
+
* When allowance is insufficient, both direct share approvals and ERC-2612 share permits authorize
|
|
27
|
+
* `maxUint256`, not the quote. Later withdrawals reuse that allowance without another signature.
|
|
28
|
+
* The share-allowance quote uses `DEFAULT_SLIPPAGE_TOLERANCE` internally. The withdrawal has no
|
|
29
|
+
* on-chain share-price or max-shares bound and accepts no slippage tolerance input.
|
|
30
|
+
* @param client - Viem client for `params.chainId`, used for allowance and nonce reads only.
|
|
31
|
+
* @param params.vault - Vault V2 contract whose shares are burned for the withdrawal.
|
|
32
|
+
* @param params.vaultData - Caller-fetched `AccrualVaultV2` snapshot of `vault`, used to derive the required share allowance.
|
|
33
|
+
* @param params.chainId - Chain containing the vault and registered VaultBundlesV1 contract.
|
|
34
|
+
* @param params.account - Non-zero account approving or permitting shares and sending the withdrawal.
|
|
35
|
+
* @param params.amount - Positive gross withdrawal in asset base units, before referral fees.
|
|
36
|
+
* @param params.referralFee.bps - Optional integer fee in basis points of the gross amount; defaults to zero and must be below 10,000.
|
|
37
|
+
* @param params.referralFee.recipient - Recipient of the optional fee; must be non-zero when the fee is positive.
|
|
38
|
+
* @param params.supportSignature - Optional unlimited share-permit preference, defaulting to `false`; otherwise uses unlimited direct share approval when allowance is insufficient.
|
|
39
|
+
* @param params.expiresAt - Optional future Unix timestamp in seconds as a safe integer; defaults to two hours from preparation.
|
|
40
|
+
* @param params.calldataOrigin - Optional non-empty, even-length hex bytes appended to each built transaction's calldata.
|
|
41
|
+
* @param params.deployless - Optional shared intent field; unused by withdrawal share-permit reads.
|
|
42
|
+
* @returns A plan with the withdrawal step and any required share approval or signature request.
|
|
43
|
+
* @throws {ZeroAccountError} when `account` is the zero address.
|
|
44
|
+
* @throws {NonIntegerInputError} when `expiresAt` or `referralFee.bps` is not a safe integer.
|
|
45
|
+
* @throws {NonPositiveInputError} when `expiresAt`, `amount` or the computed required shares are not positive.
|
|
46
|
+
* @throws {ExpiredDeadlineError} when `expiresAt` is not in the future.
|
|
47
|
+
* @throws {NegativeInputError} when `referralFee.bps` is negative.
|
|
48
|
+
* @throws {InputExceedsMaxError} when `referralFee.bps` exceeds 10,000 or `amount` exceeds uint256.
|
|
49
|
+
* @throws {InvalidCalldataOriginError} when `calldataOrigin` is empty, malformed or has an odd number of hex digits.
|
|
50
|
+
* @throws {ReferralFeePctExceededError} when `referralFee.bps` equals 10,000; the normalized fee must be below WAD.
|
|
51
|
+
* @throws {ReferralFeeRecipientMissingError} when a positive referral fee has no recipient or a zero recipient.
|
|
52
|
+
* @throws {VaultAddressMismatchError} when `vaultData` describes another vault.
|
|
53
|
+
* @throws {ChainIdMismatchError} when the client targets another chain.
|
|
54
|
+
* @throws {MissingContractCodeError} when the VaultBundlesV1 contract is absent.
|
|
55
|
+
* @see computeVaultMaxShareAllowance for quote errors.
|
|
56
|
+
* @see getVaultBundlesSharesRequirements for allowance and nonce reads.
|
|
57
|
+
* @example
|
|
58
|
+
* ```ts
|
|
59
|
+
* import { prepareVaultV2Withdraw } from "@morpho-org/morpho-sdk";
|
|
60
|
+
* import { fetchAccrualVaultV2 } from "@morpho-org/morpho-sdk/fetch";
|
|
61
|
+
* import { createPublicClient, http } from "viem";
|
|
62
|
+
* import { mainnet } from "viem/chains";
|
|
63
|
+
* const client = createPublicClient({ chain: mainnet, transport: http() });
|
|
64
|
+
* const vault = "0x04422053aDDbc9bB2759b248B574e3FCA76Bc145";
|
|
65
|
+
* const plan = await prepareVaultV2Withdraw(client, {
|
|
66
|
+
* vault, chainId: 1, account: "0x0000000000000000000000000000000000000001", amount: 1_000_000n, supportSignature: true,
|
|
67
|
+
* vaultData: await fetchAccrualVaultV2(vault, client),
|
|
68
|
+
* });
|
|
69
|
+
* // Sign the pending requests, verify and attach with applySignatures, then build.
|
|
70
|
+
* ```
|
|
71
|
+
* @experimental TransactionPlan is in beta; breaking changes may ship in minor releases.
|
|
72
|
+
*/
|
|
73
|
+
export declare function prepareVaultV2Withdraw(client: Client, params: VaultV2WithdrawPlanParams): Promise<TransactionPlan>;
|
|
74
|
+
/** @internal Encodes the withdrawal from its self-contained inputs and resolved signature requests. */
|
|
75
|
+
export declare function buildVaultV2Withdraw(action: Extract<Action, {
|
|
76
|
+
type: "vaultV2Withdraw";
|
|
77
|
+
}>, requests: readonly SignatureRequest[]): Readonly<Transaction<VaultV2WithdrawAction>>;
|