@morpho-org/morpho-sdk 9.6.0-next.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 +123 -3
- package/lib/cjs/abis.d.ts +1 -1
- package/lib/cjs/abis.js +1 -5
- package/lib/cjs/actions/blue/repayWithdrawCollateral.js +2 -2
- package/lib/cjs/actions/bundles/common.js +39 -32
- package/lib/cjs/actions/midnight/cancelAndMake.js +20 -98
- package/lib/cjs/actions/midnight/index.d.ts +2 -0
- package/lib/cjs/actions/midnight/index.js +2 -0
- package/lib/cjs/actions/midnight/repayWithdrawCollateral.js +5 -6
- package/lib/cjs/actions/midnight/supplyCollateralBatch.d.ts +39 -0
- package/lib/cjs/actions/midnight/supplyCollateralBatch.js +91 -0
- package/lib/cjs/actions/midnight/supplyCollateralTakeBorrow.js +31 -32
- package/lib/cjs/actions/midnight/takeBorrow.js +24 -23
- package/lib/cjs/actions/midnight/takeLend.js +24 -23
- package/lib/cjs/actions/midnight/takeRepayWithdrawCollateral.js +20 -19
- package/lib/cjs/actions/midnight/takeWithdraw.js +24 -23
- package/lib/cjs/actions/midnight/withdrawCollateralBatch.d.ts +44 -0
- package/lib/cjs/actions/midnight/withdrawCollateralBatch.js +104 -0
- package/lib/cjs/actions/requirements/encode/encodeBlueSignatureAuthorization.d.ts +1 -0
- package/lib/cjs/actions/requirements/encode/encodeBlueSignatureAuthorization.js +1 -0
- package/lib/cjs/actions/requirements/encode/encodeErc20Permit.d.ts +1 -0
- package/lib/cjs/actions/requirements/encode/encodeErc20Permit.js +1 -0
- package/lib/cjs/actions/requirements/encode/encodeErc20Permit2SignatureTransfer.d.ts +1 -0
- package/lib/cjs/actions/requirements/encode/encodeErc20Permit2SignatureTransfer.js +1 -0
- package/lib/cjs/actions/requirements/encode/encodeVaultSharesPermit.d.ts +1 -0
- package/lib/cjs/actions/requirements/encode/encodeVaultSharesPermit.js +1 -0
- package/lib/cjs/actions/vaultV1/migrateToV2.js +7 -7
- package/lib/cjs/blue/abis.d.ts +1 -1
- package/lib/cjs/blue/abis.js +1 -5
- package/lib/cjs/blue/entities.d.ts +4 -4
- package/lib/cjs/blue/entities.js +1 -3
- package/lib/cjs/blue/errors.d.ts +2 -2
- package/lib/cjs/blue/errors.js +1 -5
- package/lib/cjs/blue/fetch.d.ts +2 -2
- package/lib/cjs/blue/fetch.js +1 -3
- package/lib/cjs/blue/utils.d.ts +1 -1
- package/lib/cjs/blue/utils.js +1 -2
- package/lib/cjs/entities/index.d.ts +5 -5
- package/lib/cjs/entities/index.js +1 -3
- package/lib/cjs/entities/midnight/midnight.d.ts +77 -3
- package/lib/cjs/entities/midnight/midnight.js +174 -0
- package/lib/cjs/entities/midnight/types.d.ts +16 -0
- 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 +10 -35
- package/lib/cjs/entities/vaultV2/vaultV2.js +1 -33
- package/lib/cjs/entities/vaultV2BlueReallocationData.d.ts +3 -5
- package/lib/cjs/entities/vaultV2BlueReallocationData.js +3 -9
- package/lib/cjs/errors.d.ts +4 -4
- package/lib/cjs/errors.js +6 -7
- package/lib/cjs/fetch.d.ts +2 -2
- package/lib/cjs/fetch.js +1 -3
- package/lib/cjs/helpers/deadShares.js +0 -2
- package/lib/cjs/helpers/signAndVerifyTypedData.d.ts +1 -0
- package/lib/cjs/helpers/signAndVerifyTypedData.js +12 -5
- package/lib/cjs/helpers/validateMidnightCancelAndMakePublication.d.ts +68 -0
- package/lib/cjs/helpers/validateMidnightCancelAndMakePublication.js +129 -0
- package/lib/cjs/helpers/validateMidnightCollateralBatch.d.ts +15 -0
- package/lib/cjs/helpers/validateMidnightCollateralBatch.js +28 -0
- package/lib/cjs/helpers/validateMidnightCollateralSupplies.d.ts +17 -0
- package/lib/cjs/helpers/validateMidnightCollateralSupplies.js +28 -0
- package/lib/cjs/helpers/validatePositiveInput.d.ts +10 -0
- package/lib/cjs/helpers/validatePositiveInput.js +18 -0
- package/lib/cjs/index.d.ts +2 -0
- package/lib/cjs/index.js +18 -1
- package/lib/cjs/midnight/errors.d.ts +1 -2
- package/lib/cjs/midnight/errors.js +5 -5
- 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/cjs/types/action.d.ts +18 -3
- package/lib/cjs/types/error.d.ts +23 -2
- package/lib/cjs/types/error.js +45 -5
- package/lib/cjs/utils.d.ts +2 -2
- package/lib/cjs/utils.js +2 -4
- package/lib/esm/abis.d.ts +1 -1
- package/lib/esm/abis.js +1 -1
- package/lib/esm/actions/blue/repayWithdrawCollateral.js +2 -2
- package/lib/esm/actions/bundles/common.js +39 -32
- package/lib/esm/actions/midnight/cancelAndMake.js +25 -103
- package/lib/esm/actions/midnight/index.d.ts +2 -0
- package/lib/esm/actions/midnight/index.js +2 -0
- package/lib/esm/actions/midnight/repayWithdrawCollateral.js +5 -6
- package/lib/esm/actions/midnight/supplyCollateralBatch.d.ts +39 -0
- package/lib/esm/actions/midnight/supplyCollateralBatch.js +87 -0
- package/lib/esm/actions/midnight/supplyCollateralTakeBorrow.js +33 -34
- package/lib/esm/actions/midnight/takeBorrow.js +25 -24
- package/lib/esm/actions/midnight/takeLend.js +25 -24
- package/lib/esm/actions/midnight/takeRepayWithdrawCollateral.js +20 -19
- package/lib/esm/actions/midnight/takeWithdraw.js +25 -24
- package/lib/esm/actions/midnight/withdrawCollateralBatch.d.ts +44 -0
- package/lib/esm/actions/midnight/withdrawCollateralBatch.js +100 -0
- package/lib/esm/actions/requirements/encode/encodeBlueSignatureAuthorization.d.ts +1 -0
- package/lib/esm/actions/requirements/encode/encodeBlueSignatureAuthorization.js +1 -0
- package/lib/esm/actions/requirements/encode/encodeErc20Permit.d.ts +1 -0
- package/lib/esm/actions/requirements/encode/encodeErc20Permit.js +1 -0
- package/lib/esm/actions/requirements/encode/encodeErc20Permit2SignatureTransfer.d.ts +1 -0
- package/lib/esm/actions/requirements/encode/encodeErc20Permit2SignatureTransfer.js +1 -0
- package/lib/esm/actions/requirements/encode/encodeVaultSharesPermit.d.ts +1 -0
- package/lib/esm/actions/requirements/encode/encodeVaultSharesPermit.js +1 -0
- package/lib/esm/actions/vaultV1/migrateToV2.js +8 -8
- package/lib/esm/blue/abis.d.ts +1 -1
- package/lib/esm/blue/abis.js +1 -1
- package/lib/esm/blue/entities.d.ts +4 -4
- package/lib/esm/blue/entities.js +2 -2
- package/lib/esm/blue/errors.d.ts +2 -2
- package/lib/esm/blue/errors.js +2 -2
- package/lib/esm/blue/fetch.d.ts +2 -2
- package/lib/esm/blue/fetch.js +2 -2
- package/lib/esm/blue/utils.d.ts +1 -1
- package/lib/esm/blue/utils.js +1 -1
- package/lib/esm/entities/index.d.ts +5 -5
- package/lib/esm/entities/index.js +2 -2
- package/lib/esm/entities/midnight/midnight.d.ts +77 -3
- package/lib/esm/entities/midnight/midnight.js +176 -2
- package/lib/esm/entities/midnight/types.d.ts +16 -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 +10 -35
- package/lib/esm/entities/vaultV2/vaultV2.js +1 -33
- package/lib/esm/entities/vaultV2BlueReallocationData.d.ts +3 -5
- package/lib/esm/entities/vaultV2BlueReallocationData.js +3 -9
- package/lib/esm/errors.d.ts +4 -4
- package/lib/esm/errors.js +4 -4
- package/lib/esm/fetch.d.ts +2 -2
- package/lib/esm/fetch.js +2 -2
- package/lib/esm/helpers/deadShares.js +1 -3
- package/lib/esm/helpers/signAndVerifyTypedData.d.ts +1 -0
- package/lib/esm/helpers/signAndVerifyTypedData.js +13 -6
- package/lib/esm/helpers/validateMidnightCancelAndMakePublication.d.ts +68 -0
- package/lib/esm/helpers/validateMidnightCancelAndMakePublication.js +124 -0
- package/lib/esm/helpers/validateMidnightCollateralBatch.d.ts +15 -0
- package/lib/esm/helpers/validateMidnightCollateralBatch.js +25 -0
- package/lib/esm/helpers/validateMidnightCollateralSupplies.d.ts +17 -0
- package/lib/esm/helpers/validateMidnightCollateralSupplies.js +24 -0
- package/lib/esm/helpers/validatePositiveInput.d.ts +10 -0
- package/lib/esm/helpers/validatePositiveInput.js +14 -0
- package/lib/esm/index.d.ts +2 -0
- package/lib/esm/index.js +1 -0
- package/lib/esm/midnight/errors.d.ts +1 -2
- package/lib/esm/midnight/errors.js +1 -2
- 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/lib/esm/types/action.d.ts +18 -3
- package/lib/esm/types/error.d.ts +23 -2
- package/lib/esm/types/error.js +40 -3
- package/lib/esm/utils.d.ts +2 -2
- package/lib/esm/utils.js +2 -2
- package/package.json +8 -7
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { getChainAddresses } from "@morpho-org/blue-sdk";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { erc20Abi, getTypesForEIP712Domain, hashDomain, isAddressEqual, maxUint256, } from "viem";
|
|
2
|
+
import { isDefined, Time } from "@morpho-org/morpho-ts";
|
|
3
|
+
import { erc20Abi, isAddressEqual, maxUint256, } from "viem";
|
|
5
4
|
import { readContract } from "viem/actions";
|
|
6
5
|
import { resolveBundlesTokenRequirements } from "../../actions/bundles/index.js";
|
|
7
|
-
import { encodeErc20Permit } from "../../actions/requirements/encode/encodeErc20Permit.js";
|
|
8
6
|
import { validateClientChainId } from "../../actions/requirements/validateClientChainId.js";
|
|
9
7
|
import { validateChainId, validateRequirementSpender, } from "../../helpers/index.js";
|
|
10
8
|
import { ExpiredDeadlineError, InputExceedsMaxError, NegativeInputError, NonPositiveInputError, } from "../../types/index.js";
|
|
9
|
+
import { getErc2612Permit } from "./getErc2612Permit.js";
|
|
11
10
|
/**
|
|
12
11
|
* Resolves direct approval or ERC-2612 prerequisites for a registered fixed bundles contract.
|
|
13
12
|
*
|
|
@@ -126,51 +125,18 @@ export const getBundlesTokenRequirements = async (viemClient, params) => {
|
|
|
126
125
|
if (params.supportSignature) {
|
|
127
126
|
const isDai = isDefined(dai) && isAddressEqual(params.token, dai);
|
|
128
127
|
if ((params.useSimplePermit ?? true) && !isDai) {
|
|
129
|
-
const
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
return undefined;
|
|
139
|
-
throw error;
|
|
128
|
+
const permit = await getErc2612Permit(viemClient, {
|
|
129
|
+
token: params.token,
|
|
130
|
+
owner: params.owner,
|
|
131
|
+
spender: params.spender,
|
|
132
|
+
amount: params.amount,
|
|
133
|
+
chainId: params.chainId,
|
|
134
|
+
deadline: params.deadline,
|
|
135
|
+
now: timestamp,
|
|
136
|
+
supportDeployless: params.supportDeployless,
|
|
140
137
|
});
|
|
141
|
-
if (isDefined(
|
|
142
|
-
|
|
143
|
-
token: params.token,
|
|
144
|
-
owner: params.owner,
|
|
145
|
-
spender: params.spender,
|
|
146
|
-
amount: params.amount,
|
|
147
|
-
chainId: params.chainId,
|
|
148
|
-
nonce,
|
|
149
|
-
deadline: params.deadline,
|
|
150
|
-
now: timestamp,
|
|
151
|
-
supportDeployless: params.supportDeployless,
|
|
152
|
-
}), MissingPermitDomainNameError, InvalidPermitDomainChainIdError, InvalidPermitDomainVerifyingContractError, UnsupportedPermitDomainExtensionsError);
|
|
153
|
-
if (isDefined(permit)) {
|
|
154
|
-
const separator = await readContract(viemClient, {
|
|
155
|
-
abi: erc2612Abi,
|
|
156
|
-
address: params.token,
|
|
157
|
-
functionName: "DOMAIN_SEPARATOR",
|
|
158
|
-
}).catch((error) => {
|
|
159
|
-
if (isTransportError(error))
|
|
160
|
-
throw error;
|
|
161
|
-
if (isContractRevertError(error) || isUndecodableResultError(error))
|
|
162
|
-
return undefined;
|
|
163
|
-
throw error;
|
|
164
|
-
});
|
|
165
|
-
const domain = permit.action.typedData.domain ?? {};
|
|
166
|
-
if (separator?.toLowerCase() ===
|
|
167
|
-
hashDomain({
|
|
168
|
-
domain,
|
|
169
|
-
types: { EIP712Domain: getTypesForEIP712Domain({ domain }) },
|
|
170
|
-
}).toLowerCase())
|
|
171
|
-
return [permit];
|
|
172
|
-
}
|
|
173
|
-
}
|
|
138
|
+
if (isDefined(permit))
|
|
139
|
+
return [permit];
|
|
174
140
|
}
|
|
175
141
|
}
|
|
176
142
|
return resolveBundlesTokenRequirements({
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type Client } from "viem";
|
|
2
|
+
import { encodeErc20Permit } from "../../actions/requirements/encode/encodeErc20Permit.js";
|
|
3
|
+
/**
|
|
4
|
+
* @internal Resolves ERC-2612 eligibility from the nonce, signing domain and onchain separator.
|
|
5
|
+
* Unsupported domains and reverted or undecodable probes return undefined; other errors propagate.
|
|
6
|
+
*/
|
|
7
|
+
export declare function getErc2612Permit(viemClient: Client, params: Omit<Parameters<typeof encodeErc20Permit>[1], "nonce">): Promise<import("../../index.js").Requirement<import("../../index.js").Erc2612RequirementSignature, undefined> | undefined>;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { erc2612Abi, InvalidPermitDomainChainIdError, InvalidPermitDomainVerifyingContractError, isContractRevertError, isTransportError, isUndecodableResultError, MissingPermitDomainNameError, UnsupportedPermitDomainExtensionsError, } from "@morpho-org/blue-sdk-viem";
|
|
2
|
+
import { _try, isDefined } from "@morpho-org/morpho-ts";
|
|
3
|
+
import { getTypesForEIP712Domain, hashDomain, } from "viem";
|
|
4
|
+
import { readContract } from "viem/actions";
|
|
5
|
+
import { encodeErc20Permit } from "../../actions/requirements/encode/encodeErc20Permit.js";
|
|
6
|
+
/**
|
|
7
|
+
* @internal Resolves ERC-2612 eligibility from the nonce, signing domain and onchain separator.
|
|
8
|
+
* Unsupported domains and reverted or undecodable probes return undefined; other errors propagate.
|
|
9
|
+
*/
|
|
10
|
+
export async function getErc2612Permit(viemClient, params) {
|
|
11
|
+
const nonce = await readContract(viemClient, {
|
|
12
|
+
abi: erc2612Abi,
|
|
13
|
+
address: params.token,
|
|
14
|
+
functionName: "nonces",
|
|
15
|
+
args: [params.owner],
|
|
16
|
+
}).catch((error) => {
|
|
17
|
+
if (isTransportError(error))
|
|
18
|
+
throw error;
|
|
19
|
+
if (isContractRevertError(error) || isUndecodableResultError(error))
|
|
20
|
+
return undefined;
|
|
21
|
+
throw error;
|
|
22
|
+
});
|
|
23
|
+
if (isDefined(nonce)) {
|
|
24
|
+
const permit = await _try(() => encodeErc20Permit(viemClient, {
|
|
25
|
+
token: params.token,
|
|
26
|
+
owner: params.owner,
|
|
27
|
+
spender: params.spender,
|
|
28
|
+
amount: params.amount,
|
|
29
|
+
chainId: params.chainId,
|
|
30
|
+
nonce,
|
|
31
|
+
deadline: params.deadline,
|
|
32
|
+
now: params.now,
|
|
33
|
+
supportDeployless: params.supportDeployless,
|
|
34
|
+
}), MissingPermitDomainNameError, InvalidPermitDomainChainIdError, InvalidPermitDomainVerifyingContractError, UnsupportedPermitDomainExtensionsError);
|
|
35
|
+
if (isDefined(permit)) {
|
|
36
|
+
const separator = await readContract(viemClient, {
|
|
37
|
+
abi: erc2612Abi,
|
|
38
|
+
address: params.token,
|
|
39
|
+
functionName: "DOMAIN_SEPARATOR",
|
|
40
|
+
}).catch((error) => {
|
|
41
|
+
if (isTransportError(error))
|
|
42
|
+
throw error;
|
|
43
|
+
if (isContractRevertError(error) || isUndecodableResultError(error))
|
|
44
|
+
return undefined;
|
|
45
|
+
throw error;
|
|
46
|
+
});
|
|
47
|
+
const domain = permit.action.typedData.domain ?? {};
|
|
48
|
+
if (separator?.toLowerCase() ===
|
|
49
|
+
hashDomain({
|
|
50
|
+
domain,
|
|
51
|
+
types: { EIP712Domain: getTypesForEIP712Domain({ domain }) },
|
|
52
|
+
}).toLowerCase())
|
|
53
|
+
return permit;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return undefined;
|
|
57
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Token } from "@morpho-org/blue-sdk";
|
|
2
2
|
import type { Address, Client } from "viem";
|
|
3
|
-
import { type
|
|
3
|
+
import { type ERC20ApprovalAction, type PermitRequirementSignature, type Requirement, type Transaction } from "../../types/index.js";
|
|
4
4
|
/**
|
|
5
5
|
* Resolves the vault-share approval or ERC-2612 requirement for a VaultBundlesV1 exit.
|
|
6
6
|
*
|
|
@@ -27,4 +27,4 @@ export declare const getVaultBundlesSharesRequirements: (viemClient: Client, par
|
|
|
27
27
|
readonly deadline: bigint;
|
|
28
28
|
readonly supportSignature: boolean;
|
|
29
29
|
readonly now?: bigint;
|
|
30
|
-
}) => Promise<readonly
|
|
30
|
+
}) => Promise<readonly (Readonly<Transaction<ERC20ApprovalAction>> | Requirement<PermitRequirementSignature>)[]>;
|
|
@@ -500,7 +500,7 @@ export declare class MorphoVaultV1 implements VaultV1Actions {
|
|
|
500
500
|
readonly referralFeeRecipient?: Address;
|
|
501
501
|
readonly deadline?: bigint;
|
|
502
502
|
}): Readonly<{
|
|
503
|
-
getRequirements: () => Promise<readonly
|
|
503
|
+
getRequirements: () => Promise<readonly (Readonly<import("../../types/action.js").Transaction<import("../../types/action.js").ERC20ApprovalAction>> | import("../../types/action.js").Requirement<import("../../types/action.js").Erc2612RequirementSignature, undefined>)[]>;
|
|
504
504
|
buildTx: (signatures?: readonly RequirementSignature[]) => Readonly<import("../../types/action.js").Transaction<VaultV1WithdrawAction>>;
|
|
505
505
|
}>;
|
|
506
506
|
/** {@inheritDoc VaultV1Actions.redeem} */
|
|
@@ -511,7 +511,7 @@ export declare class MorphoVaultV1 implements VaultV1Actions {
|
|
|
511
511
|
readonly referralFeeRecipient?: Address;
|
|
512
512
|
readonly deadline?: bigint;
|
|
513
513
|
}): Readonly<{
|
|
514
|
-
getRequirements: () => Promise<readonly
|
|
514
|
+
getRequirements: () => Promise<readonly (Readonly<import("../../types/action.js").Transaction<import("../../types/action.js").ERC20ApprovalAction>> | import("../../types/action.js").Requirement<import("../../types/action.js").Erc2612RequirementSignature, undefined>)[]>;
|
|
515
515
|
buildTx: (signatures?: readonly RequirementSignature[]) => Readonly<import("../../types/action.js").Transaction<VaultV1RedeemAction>>;
|
|
516
516
|
}>;
|
|
517
517
|
/** {@inheritDoc VaultV1Actions.inKindRedeem} */
|
|
@@ -532,7 +532,7 @@ export declare class MorphoVaultV1 implements VaultV1Actions {
|
|
|
532
532
|
readonly referralFeeRecipient?: Address;
|
|
533
533
|
readonly deadline?: bigint;
|
|
534
534
|
} & VaultV1MigrateToV2AmountArgs): Readonly<{
|
|
535
|
-
getRequirements: () => Promise<readonly
|
|
535
|
+
getRequirements: () => Promise<readonly (Readonly<import("../../types/action.js").Transaction<import("../../types/action.js").ERC20ApprovalAction>> | import("../../types/action.js").Requirement<import("../../types/action.js").Erc2612RequirementSignature, undefined>)[]>;
|
|
536
536
|
buildTx: (signatures?: readonly RequirementSignature[]) => Readonly<import("../../types/action.js").Transaction<VaultV1MigrateToV2Action>>;
|
|
537
537
|
}>;
|
|
538
538
|
}
|
|
@@ -65,9 +65,7 @@ export interface VaultV2Actions {
|
|
|
65
65
|
* @throws {ReferralFeeRecipientMissingError} when a positive referral fee has no recipient.
|
|
66
66
|
* @throws {ChainWNativeMissingError} when native funding is requested on a chain without wNative.
|
|
67
67
|
* @throws {NativeAmountOnNonWNativeVaultError} when native funding targets a non-wNative vault.
|
|
68
|
-
* @throws {InputExceedsMaxError} when funding or the deadline exceeds uint256
|
|
69
|
-
* liquidity adapter is a Midnight adapter (it cannot receive vault allocations, so no deposit
|
|
70
|
-
* fits and `max` is `0n`).
|
|
68
|
+
* @throws {InputExceedsMaxError} when funding or the deadline exceeds uint256.
|
|
71
69
|
* @throws {AmbiguousRequirementSignaturesError} from `buildTx()` when multiple token signatures are supplied.
|
|
72
70
|
* @throws {UnexpectedRequirementSignatureError} from `buildTx()` when an unsupported signature is supplied.
|
|
73
71
|
* @throws {BundlesPermitMismatchError} from `buildTx()` when the signature's spender, amount or
|
|
@@ -149,9 +147,7 @@ export interface VaultV2Actions {
|
|
|
149
147
|
* @throws {NonPositiveInputError} when `amount` or the computed required share amount is not positive.
|
|
150
148
|
* @throws {ExpiredDeadlineError} when `deadline` is not in the future at handle creation or
|
|
151
149
|
* at any `getRequirements()` call.
|
|
152
|
-
* @throws {InputExceedsMaxError} when `amount` or `deadline` exceeds uint256 at handle creation
|
|
153
|
-
* or when the vault's liquidity adapter is a Midnight adapter and `amount` exceeds the vault's
|
|
154
|
-
* idle assets.
|
|
150
|
+
* @throws {InputExceedsMaxError} when `amount` or `deadline` exceeds uint256 at handle creation.
|
|
155
151
|
* @throws {NegativeInputError} when `referralFeePct` or `slippageTolerance` is negative.
|
|
156
152
|
* @throws {ReferralFeePctExceededError} when `referralFeePct` is at least WAD.
|
|
157
153
|
* @throws {ReferralFeeRecipientMissingError} when a positive referral fee has no nonzero recipient.
|
|
@@ -217,24 +213,7 @@ export interface VaultV2Actions {
|
|
|
217
213
|
* @throws {NonPositiveInputError} when `shares` is not positive.
|
|
218
214
|
* @throws {ExpiredDeadlineError} when `deadline` is not in the future at handle creation or
|
|
219
215
|
* requirement resolution.
|
|
220
|
-
* @throws {InputExceedsMaxError} when `shares` or `deadline` exceeds uint256
|
|
221
|
-
* `getRequirements()` when the vault's liquidity adapter is a Midnight adapter and `shares`
|
|
222
|
-
* are worth more than the vault's idle assets.
|
|
223
|
-
* @throws {UnknownBlueFactory} from `getRequirements()` when the configured chain has no VaultV2 factory.
|
|
224
|
-
* @throws {UnknownBlueOfFactory} from `getRequirements()` when the vault is not a VaultV2 from the
|
|
225
|
-
* configured factory.
|
|
226
|
-
* @throws {UnsupportedBlueVaultV2AdapterError} from `getRequirements()` when the vault or one of its
|
|
227
|
-
* adapters uses an unsupported adapter class.
|
|
228
|
-
* @throws {UnsupportedBlueMarketIrmError} from `getRequirements()` when the vault's liquidity adapter
|
|
229
|
-
* is a Midnight adapter and accrual projects an underlying market with positive debt that uses an
|
|
230
|
-
* unsupported IRM.
|
|
231
|
-
* @throws {UnknownBlueMarketAllocationError} from `getRequirements()` when the vault's liquidity
|
|
232
|
-
* adapter is a Midnight adapter and accrual meets a nested Vault V1 withdraw queue market without
|
|
233
|
-
* allocation data.
|
|
234
|
-
* @throws {InvalidMidnightPositionLossFactorError} from `getRequirements()` when the vault's liquidity
|
|
235
|
-
* adapter is a Midnight adapter and accrual meets a market loss factor below a position's.
|
|
236
|
-
* @throws {InvalidMidnightPositionAccrualStateError} from `getRequirements()` when the vault's
|
|
237
|
-
* liquidity adapter is a Midnight adapter and accrual meets invalid Midnight position inputs.
|
|
216
|
+
* @throws {InputExceedsMaxError} when `shares` or `deadline` exceeds uint256.
|
|
238
217
|
* @throws {NegativeInputError} when `referralFeePct` is negative.
|
|
239
218
|
* @throws {ReferralFeePctExceededError} when `referralFeePct` is not below WAD.
|
|
240
219
|
* @throws {ReferralFeeRecipientMissingError} when a positive fee has no non-zero recipient.
|
|
@@ -242,7 +221,7 @@ export interface VaultV2Actions {
|
|
|
242
221
|
* @throws {UnknownAddressError} when VaultBundlesV1 is not registered on the target chain.
|
|
243
222
|
* @throws {MissingContractCodeError} from `getRequirements()` when a fixed bundles or protocol
|
|
244
223
|
* contract has no code at its registered address.
|
|
245
|
-
* @throws {viem.BaseError} from `getRequirements()` when
|
|
224
|
+
* @throws {viem.BaseError} from `getRequirements()` when an allowance, nonce, `eth_chainId`, or
|
|
246
225
|
* `eth_getCode` read fails.
|
|
247
226
|
* @throws {UnknownTokenError} from `getRequirements()` when the share token fetched by
|
|
248
227
|
* `getData()` has unusable decimals.
|
|
@@ -320,11 +299,9 @@ export interface VaultV2Actions {
|
|
|
320
299
|
* @throws {InputExceedsMaxError} when `deadline` exceeds `uint256`.
|
|
321
300
|
* @throws {ExpiredDeadlineError} when `deadline` is not in the future at handle creation or
|
|
322
301
|
* requirement resolution.
|
|
323
|
-
* @throws {VaultV2SingleAdapterRequiredError} when the vault does not have one adapter
|
|
324
|
-
* a vault that mixes Blue and Midnight adapters.
|
|
302
|
+
* @throws {VaultV2SingleAdapterRequiredError} when the vault does not have one adapter.
|
|
325
303
|
* @throws {AdapterNotPartOfVaultError} when `adapter` is not the vault's adapter.
|
|
326
|
-
* @throws {VaultV2UnsupportedExitAdapterError} when the adapter is not a MorphoMarketV1AdapterV2
|
|
327
|
-
* including a Midnight adapter.
|
|
304
|
+
* @throws {VaultV2UnsupportedExitAdapterError} when the adapter is not a MorphoMarketV1AdapterV2.
|
|
328
305
|
* @throws {InKindRedeemCoverageError} when the deduplicated list cannot cover the exit.
|
|
329
306
|
* @throws {UnsupportedChainIdError} when no address registry exists for the target chain.
|
|
330
307
|
* @throws {UnknownAddressError} when VaultExitBundlesV1 is not registered on the target chain.
|
|
@@ -449,11 +426,9 @@ export interface VaultV2Actions {
|
|
|
449
426
|
* @throws {ExpiredDeadlineError} when `deadline` is not in the future at handle creation or
|
|
450
427
|
* requirement resolution.
|
|
451
428
|
* @throws {ExcessiveSlippageToleranceError} when `slippageTolerance` exceeds the SDK maximum.
|
|
452
|
-
* @throws {VaultV2SingleAdapterRequiredError} when the vault does not have exactly one adapter
|
|
453
|
-
* including a vault that mixes Blue and Midnight adapters.
|
|
429
|
+
* @throws {VaultV2SingleAdapterRequiredError} when the vault does not have exactly one adapter.
|
|
454
430
|
* @throws {AdapterNotPartOfVaultError} when `adapter` is not the vault's adapter.
|
|
455
|
-
* @throws {VaultV2UnsupportedExitAdapterError} when the adapter is not a MorphoMarketV1AdapterV2
|
|
456
|
-
* including a Midnight adapter.
|
|
431
|
+
* @throws {VaultV2UnsupportedExitAdapterError} when the adapter is not a MorphoMarketV1AdapterV2.
|
|
457
432
|
* @throws {VaultV2UnsupportedLiquidityAdapterError} when the vault routes liquidity through
|
|
458
433
|
* another adapter.
|
|
459
434
|
* @throws {VaultV2UndecodableLiquidityDataError} when the vault's `liquidityData` does not decode
|
|
@@ -599,7 +574,7 @@ export declare class MorphoVaultV2 implements VaultV2Actions {
|
|
|
599
574
|
readonly referralFeeRecipient?: Address;
|
|
600
575
|
readonly deadline?: bigint;
|
|
601
576
|
}): Readonly<{
|
|
602
|
-
getRequirements: () => Promise<readonly
|
|
577
|
+
getRequirements: () => Promise<readonly (Readonly<Transaction<import("../../types/action.js").ERC20ApprovalAction>> | import("../../types/action.js").Requirement<import("../../types/action.js").Erc2612RequirementSignature, undefined>)[]>;
|
|
603
578
|
buildTx: (signatures?: readonly RequirementSignature[]) => Readonly<Transaction<VaultV2WithdrawAction>>;
|
|
604
579
|
}>;
|
|
605
580
|
/** {@inheritDoc VaultV2Actions.redeem} */
|
|
@@ -610,7 +585,7 @@ export declare class MorphoVaultV2 implements VaultV2Actions {
|
|
|
610
585
|
readonly referralFeeRecipient?: Address;
|
|
611
586
|
readonly deadline?: bigint;
|
|
612
587
|
}): Readonly<{
|
|
613
|
-
getRequirements: () => Promise<readonly
|
|
588
|
+
getRequirements: () => Promise<readonly (Readonly<Transaction<import("../../types/action.js").ERC20ApprovalAction>> | import("../../types/action.js").Requirement<import("../../types/action.js").Erc2612RequirementSignature, undefined>)[]>;
|
|
614
589
|
buildTx: (signatures?: readonly RequirementSignature[]) => Readonly<Transaction<VaultV2RedeemAction>>;
|
|
615
590
|
}>;
|
|
616
591
|
/** {@inheritDoc VaultV2Actions.inKindRedeem} */
|
|
@@ -15,11 +15,6 @@ import { getBundlesTokenRequirements } from "../requirements/index.js";
|
|
|
15
15
|
// Maximum accepted deadline horizon; the on-chain management fee is capped at 5%/yr so the
|
|
16
16
|
// accrual model stays well-defined inside it.
|
|
17
17
|
const VAULT_V2_FEE_PROJECTION_HORIZON = Time.s.from.y(1n);
|
|
18
|
-
/**
|
|
19
|
-
* Midnight adapters revert vault-initiated `allocate` and `deallocate` (`SelfAllocationOnly`), so a
|
|
20
|
-
* vault routing liquidity through one accepts no deposit and serves exits from idle assets only.
|
|
21
|
-
*/
|
|
22
|
-
const isMidnightLiquidityAdapter = (vaultData) => vaultData.accrualLiquidityAdapter?.type === "VaultV2MidnightAdapter";
|
|
23
18
|
/** Binds a viem client to a Vault V2 vault's action builders. */
|
|
24
19
|
export class MorphoVaultV2 {
|
|
25
20
|
client;
|
|
@@ -78,13 +73,6 @@ export class MorphoVaultV2 {
|
|
|
78
73
|
// The native path must target the chain's registered wrapped-native asset.
|
|
79
74
|
validateNativeVaultAsset(this.chainId, vaultAsset);
|
|
80
75
|
}
|
|
81
|
-
if (isMidnightLiquidityAdapter(vaultData)) {
|
|
82
|
-
throw new InputExceedsMaxError({
|
|
83
|
-
field: funding.value > 0n ? "nativeAmount" : "amount",
|
|
84
|
-
value: funding.assets,
|
|
85
|
-
max: 0n,
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
76
|
const referralFeeAssets = getBundlesReferralFeeAssets(funding.assets, common.referralFeePct);
|
|
89
77
|
const maxSharePrice = computeVaultMaxSharePrice({
|
|
90
78
|
vaultData,
|
|
@@ -165,14 +153,6 @@ export class MorphoVaultV2 {
|
|
|
165
153
|
throw new NonPositiveInputError("amount", amount);
|
|
166
154
|
// Reject values outside the ABI range before resolving any requirements.
|
|
167
155
|
validateUint256Field("amount", amount);
|
|
168
|
-
if (isMidnightLiquidityAdapter(vaultData) &&
|
|
169
|
-
amount > vaultData.assetBalance) {
|
|
170
|
-
throw new InputExceedsMaxError({
|
|
171
|
-
field: "amount",
|
|
172
|
-
value: amount,
|
|
173
|
-
max: vaultData.assetBalance,
|
|
174
|
-
});
|
|
175
|
-
}
|
|
176
156
|
const createdAt = Time.timestamp();
|
|
177
157
|
const deadline = params.deadline ?? createdAt + Time.s.from.h(2n);
|
|
178
158
|
if (deadline <= createdAt)
|
|
@@ -253,20 +233,8 @@ export class MorphoVaultV2 {
|
|
|
253
233
|
if (deadline <= now)
|
|
254
234
|
throw new ExpiredDeadlineError(deadline, now);
|
|
255
235
|
await this.assertWriteTargets(["bundles.vaultBundlesV1"]);
|
|
256
|
-
const vaultData = await this.getData();
|
|
257
|
-
if (isMidnightLiquidityAdapter(vaultData)) {
|
|
258
|
-
// Onchain redeem accrues interest before converting shares to assets.
|
|
259
|
-
const { vault: accrued } = vaultData.accrueInterest(now);
|
|
260
|
-
if (accrued.toAssets(shares) > accrued.assetBalance) {
|
|
261
|
-
throw new InputExceedsMaxError({
|
|
262
|
-
field: "shares",
|
|
263
|
-
value: shares,
|
|
264
|
-
max: accrued.toShares(accrued.assetBalance),
|
|
265
|
-
});
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
236
|
return getVaultBundlesSharesRequirements(this.client.viemClient, {
|
|
269
|
-
vaultData,
|
|
237
|
+
vaultData: await this.getData(),
|
|
270
238
|
version: "vaultV2",
|
|
271
239
|
owner: userAddress,
|
|
272
240
|
chainId: this.chainId,
|
|
@@ -56,9 +56,8 @@ export interface InputVaultV2BlueReallocationData {
|
|
|
56
56
|
/**
|
|
57
57
|
* Immutable-by-convention state container for Vault V2 BluePublicAllocator simulations.
|
|
58
58
|
*
|
|
59
|
-
* Constructor inputs are cloned
|
|
60
|
-
*
|
|
61
|
-
* reallocation returns a new instance. Planning keeps the transaction-scoped `firstTotalAssets`
|
|
59
|
+
* Constructor inputs are cloned. Every simulated reallocation returns a new
|
|
60
|
+
* instance. Planning keeps the transaction-scoped `firstTotalAssets`
|
|
62
61
|
* denominator outside the durable snapshot while applying reallocations in
|
|
63
62
|
* contract order. Penalty donations update simulated vault accounting but are
|
|
64
63
|
* excluded from same-plan idle liquidity so round-up dust cannot create
|
|
@@ -132,8 +131,7 @@ export declare class VaultV2BlueReallocationData implements InputVaultV2BlueReal
|
|
|
132
131
|
/**
|
|
133
132
|
* Clones the complete simulation snapshot.
|
|
134
133
|
*
|
|
135
|
-
* @returns A deep clone of this simulation state.
|
|
136
|
-
* shared by reference and must be treated as read-only.
|
|
134
|
+
* @returns A deep clone of this simulation state.
|
|
137
135
|
* @example
|
|
138
136
|
* ```ts
|
|
139
137
|
* import { markets } from "@morpho-org/morpho-test";
|
|
@@ -87,10 +87,6 @@ const cloneAccrualVault = (vault, markets) => new AccrualVault({
|
|
|
87
87
|
position: clonePosition(position, markets),
|
|
88
88
|
})));
|
|
89
89
|
const cloneAdapter = (adapter, markets) => {
|
|
90
|
-
// BluePublicAllocator never moves Midnight liquidity, and reallocation never mutates a Midnight
|
|
91
|
-
// adapter, so its read-only snapshot is shared as-is.
|
|
92
|
-
if (adapter.type === "VaultV2MidnightAdapter")
|
|
93
|
-
return adapter;
|
|
94
90
|
const base = {
|
|
95
91
|
address: adapter.address,
|
|
96
92
|
parentVault: adapter.parentVault,
|
|
@@ -138,9 +134,8 @@ const cloneVault = (vault, { markets, adapterKeysToClone, }) => {
|
|
|
138
134
|
/**
|
|
139
135
|
* Immutable-by-convention state container for Vault V2 BluePublicAllocator simulations.
|
|
140
136
|
*
|
|
141
|
-
* Constructor inputs are cloned
|
|
142
|
-
*
|
|
143
|
-
* reallocation returns a new instance. Planning keeps the transaction-scoped `firstTotalAssets`
|
|
137
|
+
* Constructor inputs are cloned. Every simulated reallocation returns a new
|
|
138
|
+
* instance. Planning keeps the transaction-scoped `firstTotalAssets`
|
|
144
139
|
* denominator outside the durable snapshot while applying reallocations in
|
|
145
140
|
* contract order. Penalty donations update simulated vault accounting but are
|
|
146
141
|
* excluded from same-plan idle liquidity so round-up dust cannot create
|
|
@@ -284,8 +279,7 @@ export class VaultV2BlueReallocationData {
|
|
|
284
279
|
/**
|
|
285
280
|
* Clones the complete simulation snapshot.
|
|
286
281
|
*
|
|
287
|
-
* @returns A deep clone of this simulation state.
|
|
288
|
-
* shared by reference and must be treated as read-only.
|
|
282
|
+
* @returns A deep clone of this simulation state.
|
|
289
283
|
* @example
|
|
290
284
|
* ```ts
|
|
291
285
|
* import { markets } from "@morpho-org/morpho-test";
|
package/lib/esm/errors.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { BlueErrors, IncompleteChainRegistryError, InvalidMarketParamsError as InvalidBlueMarketParamsError,
|
|
1
|
+
export { BlueErrors, IncompleteChainRegistryError, InvalidMarketParamsError as InvalidBlueMarketParamsError, UnknownAddressError, UnknownDataError as UnknownBlueDataError, UnknownFactory as UnknownBlueFactory, UnknownMarketAllocationError as UnknownBlueMarketAllocationError, UnknownMarketParamsError as UnknownBlueMarketParamsError, UnknownOfFactory as UnknownBlueOfFactory, UnknownTokenError as UnknownBlueTokenError, UnknownTokenPriceError as UnknownBlueTokenPriceError, UnknownVaultConfigError as UnknownBlueVaultConfigError, UnsupportedChainIdError, UnsupportedMarketIrmError as UnsupportedBlueMarketIrmError,
|
|
2
2
|
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
|
3
3
|
UnsupportedPreLiquidationParamsError as UnsupportedBluePreLiquidationParamsError, UnsupportedVaultV2AdapterError as UnsupportedBlueVaultV2AdapterError, VaultV2Errors, } from "@morpho-org/blue-sdk";
|
|
4
|
-
export { getUnsupportedVaultV2Adapter as getBlueUnsupportedVaultV2Adapter, InvalidNumberError, InvalidPermitDomainChainIdError, InvalidPermitDomainVerifyingContractError, isUnknownOfFactoryError as isBlueUnknownOfFactoryError, MalformedTokenMetadataError, MarketParamsIdMismatchError as BlueMarketParamsIdMismatchError, MissingPermitDomainNameError, NonTupleReturnValueError, Permit2ExpirationOutOfRangeError, UnknownAbiFunctionError, UnnamedAbiOutputsError,
|
|
5
|
-
export { ChainIdMismatchError as MidnightChainIdMismatchError, InvalidEcrecoverSignatureVError as InvalidMidnightEcrecoverSignatureVError, InvalidMarketParameterError as InvalidMidnightMarketParameterError, InvalidMidnightApiQuoteTargetError, InvalidMidnightApiResponseError, InvalidOfferGroupError as InvalidMidnightOfferGroupError, InvalidOfferParameterError as InvalidMidnightOfferParameterError, InvalidRateRatifierV1RateError as InvalidMidnightRateRatifierV1RateError, InvalidRateRatifierV1TickError as InvalidMidnightRateRatifierV1TickError, InvalidRateRatifierV1TimeError as InvalidMidnightRateRatifierV1TimeError, InvalidRatifierV1AddressError as InvalidMidnightRatifierV1AddressError, InvalidTickSpacingError as InvalidMidnightTickSpacingError, InvalidTreeError as InvalidMidnightTreeError, InvalidTreeHeightError as InvalidMidnightTreeHeightError, InvalidTypedDataSignatureError as InvalidMidnightTypedDataSignatureError, MidnightApiError, MidnightMempoolValidationError, PayloadDecodeError as MidnightPayloadDecodeError, PriceGreaterThanOneError as MidnightPriceGreaterThanOneError, RateRatifierV1BoundOverflowError as MidnightRateRatifierV1BoundOverflowError, RatifierV1TakerNotAllowedError as MidnightRatifierV1TakerNotAllowedError, SettlementFeeExceedsPriceError as MidnightSettlementFeeExceedsPriceError, TickOutOfRangeError as MidnightTickOutOfRangeError, UnknownCollateralIndexError as UnknownMidnightCollateralIndexError, } from "@morpho-org/midnight-sdk";
|
|
4
|
+
export { getUnsupportedVaultV2Adapter as getBlueUnsupportedVaultV2Adapter, InvalidNumberError, InvalidPermitDomainChainIdError, InvalidPermitDomainVerifyingContractError, isUnknownOfFactoryError as isBlueUnknownOfFactoryError, MalformedTokenMetadataError, MarketParamsIdMismatchError as BlueMarketParamsIdMismatchError, MissingPermitDomainNameError, NonTupleReturnValueError, Permit2ExpirationOutOfRangeError, UnknownAbiFunctionError, UnnamedAbiOutputsError, UnsupportedPermitDomainExtensionsError, } from "@morpho-org/blue-sdk-viem";
|
|
5
|
+
export { ChainIdMismatchError as MidnightChainIdMismatchError, InvalidEcrecoverSignatureError as InvalidMidnightEcrecoverSignatureError, InvalidEcrecoverSignatureVError as InvalidMidnightEcrecoverSignatureVError, InvalidMarketParameterError as InvalidMidnightMarketParameterError, InvalidMidnightApiQuoteTargetError, InvalidMidnightApiResponseError, InvalidOfferGroupError as InvalidMidnightOfferGroupError, InvalidOfferParameterError as InvalidMidnightOfferParameterError, InvalidPositionAccrualStateError as InvalidMidnightPositionAccrualStateError, InvalidPositionAccrualTimestampError as InvalidMidnightPositionAccrualTimestampError, InvalidPositionLossFactorError as InvalidMidnightPositionLossFactorError, InvalidRateRatifierV1RateError as InvalidMidnightRateRatifierV1RateError, InvalidRateRatifierV1TickError as InvalidMidnightRateRatifierV1TickError, InvalidRateRatifierV1TimeError as InvalidMidnightRateRatifierV1TimeError, InvalidRatifierV1AddressError as InvalidMidnightRatifierV1AddressError, InvalidTickSpacingError as InvalidMidnightTickSpacingError, InvalidTreeError as InvalidMidnightTreeError, InvalidTreeHeightError as InvalidMidnightTreeHeightError, InvalidTypedDataSignatureError as InvalidMidnightTypedDataSignatureError, MidnightApiError, MidnightMempoolValidationError, PayloadDecodeError as MidnightPayloadDecodeError, PriceGreaterThanOneError as MidnightPriceGreaterThanOneError, RateRatifierV1BoundOverflowError as MidnightRateRatifierV1BoundOverflowError, RatifierV1TakerNotAllowedError as MidnightRatifierV1TakerNotAllowedError, SettlementFeeExceedsPriceError as MidnightSettlementFeeExceedsPriceError, TickOutOfRangeError as MidnightTickOutOfRangeError, UnknownCollateralIndexError as UnknownMidnightCollateralIndexError, } from "@morpho-org/midnight-sdk";
|
|
6
6
|
export type { ErrorClass } from "@morpho-org/morpho-ts";
|
|
7
|
-
export { _try, DivisionByZeroError, InvalidAddressError, InvalidBitLengthError,
|
|
7
|
+
export { _try, DivisionByZeroError, InvalidAddressError, InvalidBitLengthError, NegativeValueError, RegistryValueAlreadyRegisteredError, RetriesExhaustedError, RetryStoppedError, } from "@morpho-org/morpho-ts";
|
package/lib/esm/errors.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { BlueErrors, IncompleteChainRegistryError, InvalidMarketParamsError as InvalidBlueMarketParamsError,
|
|
1
|
+
export { BlueErrors, IncompleteChainRegistryError, InvalidMarketParamsError as InvalidBlueMarketParamsError, UnknownAddressError, UnknownDataError as UnknownBlueDataError, UnknownFactory as UnknownBlueFactory, UnknownMarketAllocationError as UnknownBlueMarketAllocationError, UnknownMarketParamsError as UnknownBlueMarketParamsError, UnknownOfFactory as UnknownBlueOfFactory, UnknownTokenError as UnknownBlueTokenError, UnknownTokenPriceError as UnknownBlueTokenPriceError, UnknownVaultConfigError as UnknownBlueVaultConfigError, UnsupportedChainIdError, UnsupportedMarketIrmError as UnsupportedBlueMarketIrmError,
|
|
2
2
|
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
|
3
3
|
UnsupportedPreLiquidationParamsError as UnsupportedBluePreLiquidationParamsError, UnsupportedVaultV2AdapterError as UnsupportedBlueVaultV2AdapterError, VaultV2Errors, } from "@morpho-org/blue-sdk";
|
|
4
|
-
export { getUnsupportedVaultV2Adapter as getBlueUnsupportedVaultV2Adapter, InvalidNumberError, InvalidPermitDomainChainIdError, InvalidPermitDomainVerifyingContractError, isUnknownOfFactoryError as isBlueUnknownOfFactoryError, MalformedTokenMetadataError, MarketParamsIdMismatchError as BlueMarketParamsIdMismatchError, MissingPermitDomainNameError, NonTupleReturnValueError, Permit2ExpirationOutOfRangeError, UnknownAbiFunctionError, UnnamedAbiOutputsError,
|
|
5
|
-
export { ChainIdMismatchError as MidnightChainIdMismatchError, InvalidEcrecoverSignatureVError as InvalidMidnightEcrecoverSignatureVError, InvalidMarketParameterError as InvalidMidnightMarketParameterError, InvalidMidnightApiQuoteTargetError, InvalidMidnightApiResponseError, InvalidOfferGroupError as InvalidMidnightOfferGroupError, InvalidOfferParameterError as InvalidMidnightOfferParameterError, InvalidRateRatifierV1RateError as InvalidMidnightRateRatifierV1RateError, InvalidRateRatifierV1TickError as InvalidMidnightRateRatifierV1TickError, InvalidRateRatifierV1TimeError as InvalidMidnightRateRatifierV1TimeError, InvalidRatifierV1AddressError as InvalidMidnightRatifierV1AddressError, InvalidTickSpacingError as InvalidMidnightTickSpacingError, InvalidTreeError as InvalidMidnightTreeError, InvalidTreeHeightError as InvalidMidnightTreeHeightError, InvalidTypedDataSignatureError as InvalidMidnightTypedDataSignatureError, MidnightApiError, MidnightMempoolValidationError, PayloadDecodeError as MidnightPayloadDecodeError, PriceGreaterThanOneError as MidnightPriceGreaterThanOneError, RateRatifierV1BoundOverflowError as MidnightRateRatifierV1BoundOverflowError, RatifierV1TakerNotAllowedError as MidnightRatifierV1TakerNotAllowedError, SettlementFeeExceedsPriceError as MidnightSettlementFeeExceedsPriceError, TickOutOfRangeError as MidnightTickOutOfRangeError, UnknownCollateralIndexError as UnknownMidnightCollateralIndexError, } from "@morpho-org/midnight-sdk";
|
|
6
|
-
export { _try, DivisionByZeroError, InvalidAddressError, InvalidBitLengthError,
|
|
4
|
+
export { getUnsupportedVaultV2Adapter as getBlueUnsupportedVaultV2Adapter, InvalidNumberError, InvalidPermitDomainChainIdError, InvalidPermitDomainVerifyingContractError, isUnknownOfFactoryError as isBlueUnknownOfFactoryError, MalformedTokenMetadataError, MarketParamsIdMismatchError as BlueMarketParamsIdMismatchError, MissingPermitDomainNameError, NonTupleReturnValueError, Permit2ExpirationOutOfRangeError, UnknownAbiFunctionError, UnnamedAbiOutputsError, UnsupportedPermitDomainExtensionsError, } from "@morpho-org/blue-sdk-viem";
|
|
5
|
+
export { ChainIdMismatchError as MidnightChainIdMismatchError, InvalidEcrecoverSignatureError as InvalidMidnightEcrecoverSignatureError, InvalidEcrecoverSignatureVError as InvalidMidnightEcrecoverSignatureVError, InvalidMarketParameterError as InvalidMidnightMarketParameterError, InvalidMidnightApiQuoteTargetError, InvalidMidnightApiResponseError, InvalidOfferGroupError as InvalidMidnightOfferGroupError, InvalidOfferParameterError as InvalidMidnightOfferParameterError, InvalidPositionAccrualStateError as InvalidMidnightPositionAccrualStateError, InvalidPositionAccrualTimestampError as InvalidMidnightPositionAccrualTimestampError, InvalidPositionLossFactorError as InvalidMidnightPositionLossFactorError, InvalidRateRatifierV1RateError as InvalidMidnightRateRatifierV1RateError, InvalidRateRatifierV1TickError as InvalidMidnightRateRatifierV1TickError, InvalidRateRatifierV1TimeError as InvalidMidnightRateRatifierV1TimeError, InvalidRatifierV1AddressError as InvalidMidnightRatifierV1AddressError, InvalidTickSpacingError as InvalidMidnightTickSpacingError, InvalidTreeError as InvalidMidnightTreeError, InvalidTreeHeightError as InvalidMidnightTreeHeightError, InvalidTypedDataSignatureError as InvalidMidnightTypedDataSignatureError, MidnightApiError, MidnightMempoolValidationError, PayloadDecodeError as MidnightPayloadDecodeError, PriceGreaterThanOneError as MidnightPriceGreaterThanOneError, RateRatifierV1BoundOverflowError as MidnightRateRatifierV1BoundOverflowError, RatifierV1TakerNotAllowedError as MidnightRatifierV1TakerNotAllowedError, SettlementFeeExceedsPriceError as MidnightSettlementFeeExceedsPriceError, TickOutOfRangeError as MidnightTickOutOfRangeError, UnknownCollateralIndexError as UnknownMidnightCollateralIndexError, } from "@morpho-org/midnight-sdk";
|
|
6
|
+
export { _try, DivisionByZeroError, InvalidAddressError, InvalidBitLengthError, NegativeValueError, RegistryValueAlreadyRegisteredError, RetriesExhaustedError, RetryStoppedError, } from "@morpho-org/morpho-ts";
|
package/lib/esm/fetch.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { fetchAccrualPosition as fetchBlueAccrualPosition, fetchAccrualVault, fetchAccrualVaultV2, fetchAccrualVaultV2Adapter,
|
|
1
|
+
export { fetchAccrualPosition as fetchBlueAccrualPosition, fetchAccrualVault, fetchAccrualVaultV2, fetchAccrualVaultV2Adapter, fetchAccrualVaultV2MorphoMarketV1Adapter, fetchAccrualVaultV2MorphoMarketV1AdapterV2, fetchAccrualVaultV2MorphoVaultV1Adapter, fetchHolding, fetchMarket as fetchBlueMarket, fetchMarketParams as fetchBlueMarketParams, fetchPosition as fetchBluePosition,
|
|
2
2
|
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
|
3
3
|
fetchPreLiquidationParams as fetchBluePreLiquidationParams,
|
|
4
4
|
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
|
5
|
-
fetchPreLiquidationPosition as fetchBluePreLiquidationPosition, fetchToken, fetchUser as fetchBlueUser, fetchVault, fetchVaultConfig, fetchVaultMarketAllocation, fetchVaultMarketConfig, fetchVaultUser, fetchVaultV2, fetchVaultV2Adapter, fetchVaultV2BlueMarketPublicAllocatorConfig, fetchVaultV2BluePublicAllocatorConfig, fetchVaultV2BluePublicAllocatorData,
|
|
5
|
+
fetchPreLiquidationPosition as fetchBluePreLiquidationPosition, fetchToken, fetchUser as fetchBlueUser, fetchVault, fetchVaultConfig, fetchVaultMarketAllocation, fetchVaultMarketConfig, fetchVaultUser, fetchVaultV2, fetchVaultV2Adapter, fetchVaultV2BlueMarketPublicAllocatorConfig, fetchVaultV2BluePublicAllocatorConfig, fetchVaultV2BluePublicAllocatorData, fetchVaultV2MorphoMarketV1Adapter, fetchVaultV2MorphoMarketV1AdapterV2, fetchVaultV2MorphoVaultV1Adapter, } from "@morpho-org/blue-sdk-viem";
|
|
6
6
|
export { fetchAccrualPosition as fetchMidnightAccrualPosition, fetchMarket as fetchMidnightMarket, fetchMarketParams as fetchMidnightMarketParams, fetchPosition as fetchMidnightPosition, fetchRatifierInfo as fetchMidnightRatifierInfo, } from "@morpho-org/midnight-sdk";
|
package/lib/esm/fetch.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { fetchAccrualPosition as fetchBlueAccrualPosition, fetchAccrualVault, fetchAccrualVaultV2, fetchAccrualVaultV2Adapter,
|
|
1
|
+
export { fetchAccrualPosition as fetchBlueAccrualPosition, fetchAccrualVault, fetchAccrualVaultV2, fetchAccrualVaultV2Adapter, fetchAccrualVaultV2MorphoMarketV1Adapter, fetchAccrualVaultV2MorphoMarketV1AdapterV2, fetchAccrualVaultV2MorphoVaultV1Adapter, fetchHolding, fetchMarket as fetchBlueMarket, fetchMarketParams as fetchBlueMarketParams, fetchPosition as fetchBluePosition,
|
|
2
2
|
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
|
3
3
|
fetchPreLiquidationParams as fetchBluePreLiquidationParams,
|
|
4
4
|
/** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
|
|
5
|
-
fetchPreLiquidationPosition as fetchBluePreLiquidationPosition, fetchToken, fetchUser as fetchBlueUser, fetchVault, fetchVaultConfig, fetchVaultMarketAllocation, fetchVaultMarketConfig, fetchVaultUser, fetchVaultV2, fetchVaultV2Adapter, fetchVaultV2BlueMarketPublicAllocatorConfig, fetchVaultV2BluePublicAllocatorConfig, fetchVaultV2BluePublicAllocatorData,
|
|
5
|
+
fetchPreLiquidationPosition as fetchBluePreLiquidationPosition, fetchToken, fetchUser as fetchBlueUser, fetchVault, fetchVaultConfig, fetchVaultMarketAllocation, fetchVaultMarketConfig, fetchVaultUser, fetchVaultV2, fetchVaultV2Adapter, fetchVaultV2BlueMarketPublicAllocatorConfig, fetchVaultV2BluePublicAllocatorConfig, fetchVaultV2BluePublicAllocatorData, fetchVaultV2MorphoMarketV1Adapter, fetchVaultV2MorphoMarketV1AdapterV2, fetchVaultV2MorphoVaultV1Adapter, } from "@morpho-org/blue-sdk-viem";
|
|
6
6
|
export { fetchAccrualPosition as fetchMidnightAccrualPosition, fetchMarket as fetchMidnightMarket, fetchMarketParams as fetchMidnightMarketParams, fetchPosition as fetchMidnightPosition, fetchRatifierInfo as fetchMidnightRatifierInfo, } from "@morpho-org/midnight-sdk";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AccrualVaultV2MorphoMarketV1Adapter, AccrualVaultV2MorphoMarketV1AdapterV2, AccrualVaultV2MorphoVaultV1Adapter, MarketParams, VaultV2MorphoMarketV1Adapter, VaultV2MorphoMarketV1AdapterV2, VaultV2MorphoVaultV1Adapter, } from "@morpho-org/blue-sdk";
|
|
2
2
|
import { InsufficientDeadSharesError, MissingDeadSharesDataError, } from "../types/error.js";
|
|
3
3
|
import { MIN_DEAD_SHARES, MIN_VAULT_V2_DEAD_ASSETS } from "./constant.js";
|
|
4
4
|
/**
|
|
@@ -151,8 +151,6 @@ export function validateVaultV2DeadShares(vault, path = []) {
|
|
|
151
151
|
return cap;
|
|
152
152
|
};
|
|
153
153
|
for (const adapter of vault.accrualAdapters) {
|
|
154
|
-
if (adapter instanceof AccrualVaultV2MidnightAdapter)
|
|
155
|
-
continue;
|
|
156
154
|
if (adapter instanceof AccrualVaultV2MorphoVaultV1Adapter) {
|
|
157
155
|
const id = VaultV2MorphoVaultV1Adapter.adapterCapId(adapter.address);
|
|
158
156
|
if (capOf(id, adapter.address) > 0n)
|
|
@@ -16,6 +16,7 @@ import type { Address, Hex, TypedDataDefinition, WalletClient } from "viem";
|
|
|
16
16
|
* @throws {AddressMismatchError} when the wallet client account differs from `userAddress`.
|
|
17
17
|
* @throws {ChainIdMismatchError} when the wallet client targets a different chain than the typed-data domain.
|
|
18
18
|
* @throws {InvalidSignatureError} when the signature does not recover to `userAddress`.
|
|
19
|
+
* @throws {MalformedSignatureError} when verification throws; preserves the original error as `cause` with redacted signature diagnostics. Extends `InvalidSignatureError`.
|
|
19
20
|
* @example
|
|
20
21
|
* ```ts
|
|
21
22
|
* import { signAndVerifyTypedData } from "@morpho-org/morpho-sdk";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { verifyTypedData } from "viem";
|
|
2
2
|
import { signTypedData } from "viem/actions";
|
|
3
|
-
import { InvalidSignatureError } from "../types/index.js";
|
|
3
|
+
import { InvalidSignatureError, MalformedSignatureError, } from "../types/index.js";
|
|
4
4
|
import { validateChainId, validateUserAddress } from "./validate.js";
|
|
5
5
|
/**
|
|
6
6
|
* Signs EIP-712 typed data with a wallet client, verifies that the produced signature recovers
|
|
@@ -19,6 +19,7 @@ import { validateChainId, validateUserAddress } from "./validate.js";
|
|
|
19
19
|
* @throws {AddressMismatchError} when the wallet client account differs from `userAddress`.
|
|
20
20
|
* @throws {ChainIdMismatchError} when the wallet client targets a different chain than the typed-data domain.
|
|
21
21
|
* @throws {InvalidSignatureError} when the signature does not recover to `userAddress`.
|
|
22
|
+
* @throws {MalformedSignatureError} when verification throws; preserves the original error as `cause` with redacted signature diagnostics. Extends `InvalidSignatureError`.
|
|
22
23
|
* @example
|
|
23
24
|
* ```ts
|
|
24
25
|
* import { signAndVerifyTypedData } from "@morpho-org/morpho-sdk";
|
|
@@ -42,11 +43,17 @@ export const signAndVerifyTypedData = async (params) => {
|
|
|
42
43
|
...typedData,
|
|
43
44
|
account,
|
|
44
45
|
});
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
let isValid;
|
|
47
|
+
try {
|
|
48
|
+
isValid = await verifyTypedData({
|
|
49
|
+
...typedData,
|
|
50
|
+
address: userAddress,
|
|
51
|
+
signature,
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
catch (cause) {
|
|
55
|
+
throw new MalformedSignatureError({ signature, cause });
|
|
56
|
+
}
|
|
50
57
|
if (!isValid) {
|
|
51
58
|
throw new InvalidSignatureError();
|
|
52
59
|
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { MidnightCancelAndMakeParams } from "../types/midnightCancelAndMake.js";
|
|
2
|
+
/**
|
|
3
|
+
* Validates publication content after snapshot and hex-shape validation.
|
|
4
|
+
*
|
|
5
|
+
* @param params - Publication, chain deployment, and groups cancelled by this bundle.
|
|
6
|
+
* @returns Nothing when publication content and funding inputs are valid.
|
|
7
|
+
* @throws {InvalidTreeError} when the root is zero, payload empty, or groups empty.
|
|
8
|
+
* @throws {UnsupportedChainIdError} when the chain is absent from the registry.
|
|
9
|
+
* @throws {MidnightCalldataEncodingError} when the ratifier or collateral market address is malformed.
|
|
10
|
+
* @throws {UnsupportedMidnightAuthorizationTargetError} when the ratifier is not supported.
|
|
11
|
+
* @throws {MidnightReplacementGroupCancelledError} when a published group is cancelled.
|
|
12
|
+
* @throws {NonPositiveInputError} when Blue funding or a collateral supply is not positive.
|
|
13
|
+
* @throws {InputExceedsMaxError} when funding or collateral supply totals exceed uint128.
|
|
14
|
+
* @throws {EmptyMidnightCollateralSuppliesError} when collateral supplies are empty.
|
|
15
|
+
* @throws {ChainIdMismatchError} when the collateral market targets another chain.
|
|
16
|
+
* @throws {MidnightMarketAddressMismatchError} when its Midnight deployment differs.
|
|
17
|
+
* @throws {UnknownCollateralIndexError} when a supply index is not configured.
|
|
18
|
+
* @internal
|
|
19
|
+
*/
|
|
20
|
+
export declare const validateMidnightCancelAndMakePublication: ({ publication, chainId, cancelledGroups, }: {
|
|
21
|
+
readonly publication: NonNullable<MidnightCancelAndMakeParams["publication"]>;
|
|
22
|
+
readonly chainId: number;
|
|
23
|
+
readonly cancelledGroups: ReadonlySet<string>;
|
|
24
|
+
}) => void;
|
|
25
|
+
/**
|
|
26
|
+
* Copies validated publication fields and supplies zero ABI defaults for omitted steps.
|
|
27
|
+
*
|
|
28
|
+
* @param publication - Snapshotted publication, or undefined for cancellation only.
|
|
29
|
+
* @returns ABI defaults and copied publication fields, without mutating the input.
|
|
30
|
+
* @internal
|
|
31
|
+
*/
|
|
32
|
+
export declare const normalizeMidnightCancelAndMakePublication: (publication: MidnightCancelAndMakeParams["publication"]) => {
|
|
33
|
+
supplies: {
|
|
34
|
+
collateralIndex: bigint;
|
|
35
|
+
assets: bigint;
|
|
36
|
+
}[];
|
|
37
|
+
blueSupply: {
|
|
38
|
+
market: {
|
|
39
|
+
loanToken: `0x${string}`;
|
|
40
|
+
collateralToken: `0x${string}`;
|
|
41
|
+
oracle: `0x${string}`;
|
|
42
|
+
irm: `0x${string}`;
|
|
43
|
+
lltv: bigint;
|
|
44
|
+
};
|
|
45
|
+
assets: bigint;
|
|
46
|
+
callbackSalt: `0x${string}`;
|
|
47
|
+
} | undefined;
|
|
48
|
+
signature: import("../types/midnightCancelAndMake.js").MidnightRootActivationSignature;
|
|
49
|
+
blueMarket: {
|
|
50
|
+
readonly loanToken: "0x0000000000000000000000000000000000000000";
|
|
51
|
+
readonly collateralToken: "0x0000000000000000000000000000000000000000";
|
|
52
|
+
readonly oracle: "0x0000000000000000000000000000000000000000";
|
|
53
|
+
readonly irm: "0x0000000000000000000000000000000000000000";
|
|
54
|
+
readonly lltv: 0n;
|
|
55
|
+
} | {
|
|
56
|
+
loanToken: `0x${string}`;
|
|
57
|
+
collateralToken: `0x${string}`;
|
|
58
|
+
oracle: `0x${string}`;
|
|
59
|
+
irm: `0x${string}`;
|
|
60
|
+
lltv: bigint;
|
|
61
|
+
};
|
|
62
|
+
assetsToPark: bigint;
|
|
63
|
+
callbackSalt: `0x${string}`;
|
|
64
|
+
ratifier: `0x${string}`;
|
|
65
|
+
root: `0x${string}`;
|
|
66
|
+
groups: `0x${string}`[];
|
|
67
|
+
payload: `0x${string}`;
|
|
68
|
+
};
|