@morpho-org/morpho-sdk 6.0.0-next.0 → 6.0.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/MIGRATION-v5-to-v6.md +206 -3
- package/README.md +81 -41
- package/lib/cjs/abis.d.ts +210 -0
- package/lib/cjs/abis.js +142 -2
- package/lib/cjs/actions/blue/borrow.d.ts +1 -1
- package/lib/cjs/actions/blue/borrow.js +1 -1
- package/lib/cjs/actions/blue/common.d.ts +6 -19
- package/lib/cjs/actions/blue/common.js +25 -138
- package/lib/cjs/actions/blue/refinance.d.ts +1 -1
- package/lib/cjs/actions/blue/refinance.js +1 -1
- package/lib/cjs/actions/blue/repay.d.ts +3 -3
- package/lib/cjs/actions/blue/repay.js +1 -1
- package/lib/cjs/actions/blue/repayWithdrawCollateral.d.ts +3 -3
- package/lib/cjs/actions/blue/repayWithdrawCollateral.js +1 -1
- package/lib/cjs/actions/blue/supply.d.ts +3 -3
- package/lib/cjs/actions/blue/supply.js +1 -1
- package/lib/cjs/actions/blue/supplyCollateral.d.ts +3 -3
- package/lib/cjs/actions/blue/supplyCollateral.js +1 -1
- package/lib/cjs/actions/blue/supplyCollateralBorrow.d.ts +3 -3
- package/lib/cjs/actions/blue/supplyCollateralBorrow.js +1 -1
- package/lib/cjs/actions/blue/withdraw.d.ts +1 -1
- package/lib/cjs/actions/blue/withdraw.js +1 -1
- package/lib/cjs/actions/blue/withdrawCollateral.d.ts +1 -1
- package/lib/cjs/actions/blue/withdrawCollateral.js +1 -1
- package/lib/cjs/actions/bundles/common.d.ts +200 -0
- package/lib/cjs/actions/bundles/common.js +469 -0
- package/lib/cjs/actions/bundles/index.d.ts +3 -0
- package/lib/cjs/actions/bundles/index.js +23 -0
- package/lib/cjs/actions/bundles/resolveBundlesTokenRequirements.d.ts +76 -0
- package/lib/cjs/actions/bundles/resolveBundlesTokenRequirements.js +125 -0
- package/lib/cjs/actions/index.d.ts +1 -0
- package/lib/cjs/actions/index.js +1 -0
- package/lib/cjs/actions/midnight/supplyCollateralTakeBorrow.d.ts +2 -2
- package/lib/cjs/actions/midnight/supplyCollateralTakeBorrow.js +2 -2
- package/lib/cjs/actions/midnight/takeBorrow.d.ts +2 -2
- package/lib/cjs/actions/midnight/takeBorrow.js +2 -2
- package/lib/cjs/actions/midnight/takeLend.d.ts +2 -2
- package/lib/cjs/actions/midnight/takeLend.js +2 -2
- package/lib/cjs/actions/requirements/blue/getUnusedPermit2Nonce.d.ts +1 -1
- package/lib/cjs/actions/requirements/blue/getUnusedPermit2Nonce.js +1 -1
- package/lib/cjs/actions/requirements/blue/index.d.ts +0 -1
- package/lib/cjs/actions/requirements/blue/index.js +0 -1
- package/lib/cjs/actions/requirements/encode/encodeBlueSignatureAuthorization.js +1 -1
- package/lib/cjs/actions/requirements/encode/encodeErc20Approval.d.ts +1 -1
- package/lib/cjs/actions/requirements/encode/encodeErc20Approval.js +2 -1
- package/lib/cjs/actions/requirements/encode/encodeErc20Permit.d.ts +3 -3
- package/lib/cjs/actions/requirements/encode/encodeErc20Permit.js +10 -4
- package/lib/{esm/actions/requirements/encode/encodeErc20Permit2TransferFrom.d.ts → cjs/actions/requirements/encode/encodeErc20Permit2SignatureTransfer.d.ts} +12 -12
- package/lib/cjs/actions/requirements/encode/{encodeErc20Permit2TransferFrom.js → encodeErc20Permit2SignatureTransfer.js} +13 -13
- package/lib/cjs/actions/requirements/encode/encodeVaultSharesPermit.d.ts +4 -4
- package/lib/cjs/actions/requirements/encode/encodeVaultSharesPermit.js +6 -5
- package/lib/cjs/actions/requirements/encode/index.d.ts +1 -1
- package/lib/cjs/actions/requirements/encode/index.js +1 -1
- package/lib/cjs/actions/requirements/getRequirementsApproval.d.ts +4 -3
- package/lib/cjs/actions/requirements/getRequirementsApproval.js +4 -3
- package/lib/cjs/actions/signatures/getTokenRequirementActions.js +2 -2
- package/lib/cjs/actions/signatures/getVaultExitBundlesV1PermitStruct.d.ts +22 -30
- package/lib/cjs/actions/signatures/getVaultExitBundlesV1PermitStruct.js +18 -66
- package/lib/cjs/actions/vaultV1/deposit.d.ts +73 -57
- package/lib/cjs/actions/vaultV1/deposit.js +110 -109
- package/lib/cjs/actions/vaultV1/migrateToV2.d.ts +43 -66
- package/lib/cjs/actions/vaultV1/migrateToV2.js +91 -104
- package/lib/cjs/actions/vaultV1/redeem.d.ts +30 -23
- package/lib/cjs/actions/vaultV1/redeem.js +56 -33
- package/lib/cjs/actions/vaultV1/withdraw.d.ts +58 -24
- package/lib/cjs/actions/vaultV1/withdraw.js +86 -34
- package/lib/cjs/actions/vaultV2/deposit.d.ts +74 -57
- package/lib/cjs/actions/vaultV2/deposit.js +111 -109
- package/lib/cjs/actions/vaultV2/redeem.d.ts +30 -24
- package/lib/cjs/actions/vaultV2/redeem.js +56 -34
- package/lib/cjs/actions/vaultV2/withdraw.d.ts +58 -25
- package/lib/cjs/actions/vaultV2/withdraw.js +86 -35
- package/lib/cjs/entities/blue/blue.d.ts +19 -19
- package/lib/cjs/entities/blue/blue.js +3 -1
- package/lib/cjs/entities/index.d.ts +1 -0
- package/lib/cjs/entities/index.js +15 -0
- package/lib/cjs/entities/midnight/midnight.d.ts +2 -2
- package/lib/cjs/{actions/requirements/blue/getBlueBundlesV1TokenRequirements.d.ts → entities/requirements/getBundlesTokenRequirements.d.ts} +21 -14
- package/lib/cjs/{actions/requirements/blue/getBlueBundlesV1TokenRequirements.js → entities/requirements/getBundlesTokenRequirements.js} +61 -65
- package/lib/cjs/entities/requirements/getVaultBundlesSharesRequirements.d.ts +28 -0
- package/lib/cjs/entities/requirements/getVaultBundlesSharesRequirements.js +74 -0
- package/lib/cjs/entities/requirements/index.d.ts +1 -0
- package/lib/cjs/entities/requirements/index.js +17 -0
- package/lib/cjs/entities/vaultV1/vaultV1.d.ts +348 -98
- package/lib/cjs/entities/vaultV1/vaultV1.js +322 -120
- package/lib/cjs/entities/vaultV2/vaultV2.d.ts +221 -68
- package/lib/cjs/entities/vaultV2/vaultV2.js +219 -77
- package/lib/cjs/helpers/index.d.ts +2 -1
- package/lib/cjs/helpers/index.js +5 -1
- package/lib/cjs/helpers/referralFee.d.ts +21 -0
- package/lib/cjs/helpers/referralFee.js +35 -0
- package/lib/cjs/helpers/slippage.d.ts +90 -1
- package/lib/cjs/helpers/slippage.js +123 -0
- package/lib/cjs/helpers/validate.d.ts +2 -0
- package/lib/cjs/helpers/validate.js +12 -1
- package/lib/cjs/helpers/validateRequirementSpender.d.ts +1 -1
- package/lib/cjs/helpers/validateRequirementSpender.js +1 -0
- package/lib/cjs/index.d.ts +1 -0
- package/lib/cjs/index.js +1 -0
- package/lib/cjs/types/action.d.ts +179 -70
- package/lib/cjs/types/action.js +12 -12
- package/lib/cjs/types/error.d.ts +62 -14
- package/lib/cjs/types/error.js +88 -22
- package/lib/esm/abis.d.ts +210 -0
- package/lib/esm/abis.js +140 -0
- package/lib/esm/actions/blue/borrow.d.ts +1 -1
- package/lib/esm/actions/blue/borrow.js +1 -1
- package/lib/esm/actions/blue/common.d.ts +6 -19
- package/lib/esm/actions/blue/common.js +27 -140
- package/lib/esm/actions/blue/refinance.d.ts +1 -1
- package/lib/esm/actions/blue/refinance.js +1 -1
- package/lib/esm/actions/blue/repay.d.ts +3 -3
- package/lib/esm/actions/blue/repay.js +1 -1
- package/lib/esm/actions/blue/repayWithdrawCollateral.d.ts +3 -3
- package/lib/esm/actions/blue/repayWithdrawCollateral.js +1 -1
- package/lib/esm/actions/blue/supply.d.ts +3 -3
- package/lib/esm/actions/blue/supply.js +1 -1
- package/lib/esm/actions/blue/supplyCollateral.d.ts +3 -3
- package/lib/esm/actions/blue/supplyCollateral.js +1 -1
- package/lib/esm/actions/blue/supplyCollateralBorrow.d.ts +3 -3
- package/lib/esm/actions/blue/supplyCollateralBorrow.js +1 -1
- package/lib/esm/actions/blue/withdraw.d.ts +1 -1
- package/lib/esm/actions/blue/withdraw.js +1 -1
- package/lib/esm/actions/blue/withdrawCollateral.d.ts +1 -1
- package/lib/esm/actions/blue/withdrawCollateral.js +1 -1
- package/lib/esm/actions/bundles/common.d.ts +200 -0
- package/lib/esm/actions/bundles/common.js +457 -0
- package/lib/esm/actions/bundles/index.d.ts +3 -0
- package/lib/esm/actions/bundles/index.js +2 -0
- package/lib/esm/actions/bundles/resolveBundlesTokenRequirements.d.ts +76 -0
- package/lib/esm/actions/bundles/resolveBundlesTokenRequirements.js +121 -0
- package/lib/esm/actions/index.d.ts +1 -0
- package/lib/esm/actions/index.js +1 -0
- package/lib/esm/actions/midnight/supplyCollateralTakeBorrow.d.ts +2 -2
- package/lib/esm/actions/midnight/supplyCollateralTakeBorrow.js +2 -2
- package/lib/esm/actions/midnight/takeBorrow.d.ts +2 -2
- package/lib/esm/actions/midnight/takeBorrow.js +2 -2
- package/lib/esm/actions/midnight/takeLend.d.ts +2 -2
- package/lib/esm/actions/midnight/takeLend.js +2 -2
- package/lib/esm/actions/requirements/blue/getUnusedPermit2Nonce.d.ts +1 -1
- package/lib/esm/actions/requirements/blue/getUnusedPermit2Nonce.js +1 -1
- package/lib/esm/actions/requirements/blue/index.d.ts +0 -1
- package/lib/esm/actions/requirements/blue/index.js +0 -1
- package/lib/esm/actions/requirements/encode/encodeBlueSignatureAuthorization.js +1 -1
- package/lib/esm/actions/requirements/encode/encodeErc20Approval.d.ts +1 -1
- package/lib/esm/actions/requirements/encode/encodeErc20Approval.js +2 -1
- package/lib/esm/actions/requirements/encode/encodeErc20Permit.d.ts +3 -3
- package/lib/esm/actions/requirements/encode/encodeErc20Permit.js +10 -4
- package/lib/{cjs/actions/requirements/encode/encodeErc20Permit2TransferFrom.d.ts → esm/actions/requirements/encode/encodeErc20Permit2SignatureTransfer.d.ts} +12 -12
- package/lib/esm/actions/requirements/encode/{encodeErc20Permit2TransferFrom.js → encodeErc20Permit2SignatureTransfer.js} +11 -11
- package/lib/esm/actions/requirements/encode/encodeVaultSharesPermit.d.ts +4 -4
- package/lib/esm/actions/requirements/encode/encodeVaultSharesPermit.js +6 -5
- package/lib/esm/actions/requirements/encode/index.d.ts +1 -1
- package/lib/esm/actions/requirements/encode/index.js +1 -1
- package/lib/esm/actions/requirements/getRequirementsApproval.d.ts +4 -3
- package/lib/esm/actions/requirements/getRequirementsApproval.js +4 -3
- package/lib/esm/actions/signatures/getTokenRequirementActions.js +3 -3
- package/lib/esm/actions/signatures/getVaultExitBundlesV1PermitStruct.d.ts +22 -30
- package/lib/esm/actions/signatures/getVaultExitBundlesV1PermitStruct.js +19 -67
- package/lib/esm/actions/vaultV1/deposit.d.ts +73 -57
- package/lib/esm/actions/vaultV1/deposit.js +112 -111
- package/lib/esm/actions/vaultV1/migrateToV2.d.ts +43 -66
- package/lib/esm/actions/vaultV1/migrateToV2.js +93 -106
- package/lib/esm/actions/vaultV1/redeem.d.ts +30 -23
- package/lib/esm/actions/vaultV1/redeem.js +56 -33
- package/lib/esm/actions/vaultV1/withdraw.d.ts +58 -24
- package/lib/esm/actions/vaultV1/withdraw.js +86 -34
- package/lib/esm/actions/vaultV2/deposit.d.ts +74 -57
- package/lib/esm/actions/vaultV2/deposit.js +113 -111
- package/lib/esm/actions/vaultV2/redeem.d.ts +30 -24
- package/lib/esm/actions/vaultV2/redeem.js +56 -34
- package/lib/esm/actions/vaultV2/withdraw.d.ts +58 -25
- package/lib/esm/actions/vaultV2/withdraw.js +86 -35
- package/lib/esm/entities/blue/blue.d.ts +19 -19
- package/lib/esm/entities/blue/blue.js +4 -2
- package/lib/esm/entities/index.d.ts +1 -0
- package/lib/esm/entities/index.js +1 -0
- package/lib/esm/entities/midnight/midnight.d.ts +2 -2
- package/lib/esm/{actions/requirements/blue/getBlueBundlesV1TokenRequirements.d.ts → entities/requirements/getBundlesTokenRequirements.d.ts} +21 -14
- package/lib/esm/{actions/requirements/blue/getBlueBundlesV1TokenRequirements.js → entities/requirements/getBundlesTokenRequirements.js} +51 -55
- package/lib/esm/entities/requirements/getVaultBundlesSharesRequirements.d.ts +28 -0
- package/lib/esm/entities/requirements/getVaultBundlesSharesRequirements.js +70 -0
- package/lib/esm/entities/requirements/index.d.ts +1 -0
- package/lib/esm/entities/requirements/index.js +1 -0
- package/lib/esm/entities/vaultV1/vaultV1.d.ts +348 -98
- package/lib/esm/entities/vaultV1/vaultV1.js +326 -124
- package/lib/esm/entities/vaultV2/vaultV2.d.ts +221 -68
- package/lib/esm/entities/vaultV2/vaultV2.js +222 -80
- package/lib/esm/helpers/index.d.ts +2 -1
- package/lib/esm/helpers/index.js +2 -1
- package/lib/esm/helpers/referralFee.d.ts +21 -0
- package/lib/esm/helpers/referralFee.js +31 -0
- package/lib/esm/helpers/slippage.d.ts +90 -1
- package/lib/esm/helpers/slippage.js +122 -2
- package/lib/esm/helpers/validate.d.ts +2 -0
- package/lib/esm/helpers/validate.js +11 -1
- package/lib/esm/helpers/validateRequirementSpender.d.ts +1 -1
- package/lib/esm/helpers/validateRequirementSpender.js +1 -0
- package/lib/esm/index.d.ts +1 -0
- package/lib/esm/index.js +1 -0
- package/lib/esm/types/action.d.ts +179 -70
- package/lib/esm/types/action.js +11 -11
- package/lib/esm/types/error.d.ts +62 -14
- package/lib/esm/types/error.js +80 -16
- package/package.json +3 -3
|
@@ -7,21 +7,8 @@ const viem_1 = require("viem");
|
|
|
7
7
|
const index_js_1 = require("../../helpers/index.js");
|
|
8
8
|
const validate_js_1 = require("../../helpers/validate.js");
|
|
9
9
|
const index_js_2 = require("../../types/index.js");
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
* the pull, `erc2612` (1) is an ERC-2612 permit, `permit2TransferFrom` (2) is a Permit2
|
|
13
|
-
* SignatureTransfer. Named so a transposed literal can't silently route a permit to the wrong branch.
|
|
14
|
-
* @internal
|
|
15
|
-
*/
|
|
16
|
-
const BLUE_BUNDLES_V1_TOKEN_PERMIT_KIND = {
|
|
17
|
-
none: 0,
|
|
18
|
-
erc2612: 1,
|
|
19
|
-
permit2TransferFrom: 2,
|
|
20
|
-
};
|
|
21
|
-
const EMPTY_TOKEN_PERMIT = {
|
|
22
|
-
kind: BLUE_BUNDLES_V1_TOKEN_PERMIT_KIND.none,
|
|
23
|
-
data: "0x",
|
|
24
|
-
};
|
|
10
|
+
const common_js_1 = require("../bundles/common.js");
|
|
11
|
+
const index_js_3 = require("../bundles/index.js");
|
|
25
12
|
const EMPTY_SIGNED_AUTHORIZATION = {
|
|
26
13
|
signature: { v: 0, r: viem_1.zeroHash, s: viem_1.zeroHash },
|
|
27
14
|
nonce: 0n,
|
|
@@ -29,35 +16,10 @@ const EMPTY_SIGNED_AUTHORIZATION = {
|
|
|
29
16
|
};
|
|
30
17
|
/** @internal */
|
|
31
18
|
const normalizeBlueBundlesV1CommonParams = (params) => {
|
|
32
|
-
|
|
33
|
-
throw new index_js_2.NonPositiveInputError("deadline", params.deadline);
|
|
34
|
-
}
|
|
35
|
-
if (params.deadline > viem_1.maxUint256) {
|
|
36
|
-
throw new index_js_2.InputExceedsMaxError({
|
|
37
|
-
field: "deadline",
|
|
38
|
-
value: params.deadline,
|
|
39
|
-
max: viem_1.maxUint256,
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
const referralFeePct = params.referralFeePct ?? 0n;
|
|
43
|
-
if (referralFeePct < 0n) {
|
|
44
|
-
throw new index_js_2.NegativeInputError("referralFeePct", referralFeePct);
|
|
45
|
-
}
|
|
46
|
-
if (referralFeePct >= blue_sdk_1.MathLib.WAD) {
|
|
47
|
-
throw new index_js_2.InputExceedsMaxError({
|
|
48
|
-
field: "referralFeePct",
|
|
49
|
-
value: referralFeePct,
|
|
50
|
-
max: blue_sdk_1.MathLib.WAD - 1n,
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
if (referralFeePct > 0n &&
|
|
54
|
-
(params.referralFeeRecipient == null ||
|
|
55
|
-
(0, viem_1.isAddressEqual)(params.referralFeeRecipient, viem_1.zeroAddress))) {
|
|
56
|
-
throw new index_js_2.MissingReferralFeeRecipientError();
|
|
57
|
-
}
|
|
19
|
+
const normalized = (0, common_js_1.normalizeBundlesCommonParams)(params);
|
|
58
20
|
return {
|
|
59
|
-
referralFeePct,
|
|
60
|
-
referralFeeRecipient:
|
|
21
|
+
referralFeePct: normalized.referralFeePct,
|
|
22
|
+
referralFeeRecipient: normalized.referralFeeRecipient,
|
|
61
23
|
};
|
|
62
24
|
};
|
|
63
25
|
exports.normalizeBlueBundlesV1CommonParams = normalizeBlueBundlesV1CommonParams;
|
|
@@ -81,88 +43,13 @@ const validateBlueBundlesV1NativeFunding = (params) => {
|
|
|
81
43
|
exports.validateBlueBundlesV1NativeFunding = validateBlueBundlesV1NativeFunding;
|
|
82
44
|
/** @internal */
|
|
83
45
|
const getBlueBundlesV1TokenPermit = (params) => {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}
|
|
91
|
-
if (!(0, viem_1.isAddressEqual)(requirementSignature.args.asset, params.token)) {
|
|
92
|
-
throw new index_js_2.DepositAssetMismatchError(params.token, requirementSignature.args.asset);
|
|
93
|
-
}
|
|
94
|
-
if (requirementSignature.args.amount !== params.amount) {
|
|
95
|
-
throw new index_js_2.DepositAmountMismatchError(params.amount, requirementSignature.args.amount);
|
|
96
|
-
}
|
|
97
|
-
if (!(0, viem_1.isAddressEqual)(requirementSignature.action.args.spender, spender)) {
|
|
98
|
-
throw new index_js_2.DepositSpenderMismatchError(spender, requirementSignature.action.args.spender);
|
|
99
|
-
}
|
|
100
|
-
if (requirementSignature.action.args.amount !== params.amount) {
|
|
101
|
-
throw new index_js_2.DepositAmountMismatchError(params.amount, requirementSignature.action.args.amount);
|
|
102
|
-
}
|
|
103
|
-
if (requirementSignature.action.args.deadline !==
|
|
104
|
-
requirementSignature.args.deadline) {
|
|
105
|
-
throw new index_js_2.BlueBundlesV1RequirementSignatureMismatchError({
|
|
106
|
-
field: "deadline",
|
|
107
|
-
expected: String(requirementSignature.args.deadline),
|
|
108
|
-
actual: String(requirementSignature.action.args.deadline),
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
if (requirementSignature.action.type === "permit2TransferFrom") {
|
|
112
|
-
return {
|
|
113
|
-
kind: BLUE_BUNDLES_V1_TOKEN_PERMIT_KIND.permit2TransferFrom,
|
|
114
|
-
data: (0, viem_1.encodeAbiParameters)([
|
|
115
|
-
{ type: "uint256", name: "nonce" },
|
|
116
|
-
{ type: "uint256", name: "deadline" },
|
|
117
|
-
{ type: "bytes", name: "signature" },
|
|
118
|
-
], [
|
|
119
|
-
requirementSignature.args.nonce,
|
|
120
|
-
requirementSignature.args.deadline,
|
|
121
|
-
requirementSignature.args.signature,
|
|
122
|
-
]),
|
|
123
|
-
};
|
|
124
|
-
}
|
|
125
|
-
if (requirementSignature.action.type !== "permit") {
|
|
126
|
-
throw new index_js_2.BlueBundlesV1RequirementSignatureMismatchError({
|
|
127
|
-
field: "type",
|
|
128
|
-
expected: "permit or permit2TransferFrom",
|
|
129
|
-
actual: requirementSignature.action.type,
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
const serializedSignature = requirementSignature.args.signature;
|
|
133
|
-
let parsed;
|
|
134
|
-
try {
|
|
135
|
-
parsed =
|
|
136
|
-
(0, viem_1.size)(serializedSignature) === 64
|
|
137
|
-
? (0, viem_1.compactSignatureToSignature)((0, viem_1.parseCompactSignature)(serializedSignature))
|
|
138
|
-
: (0, viem_1.parseSignature)(serializedSignature);
|
|
139
|
-
}
|
|
140
|
-
catch (cause) {
|
|
141
|
-
throw new index_js_2.BlueBundlesV1RequirementSignatureMismatchError({
|
|
142
|
-
field: "signature",
|
|
143
|
-
expected: "a 64-byte compact or 65-byte serialized ECDSA signature",
|
|
144
|
-
actual: serializedSignature,
|
|
145
|
-
cause,
|
|
146
|
-
});
|
|
147
|
-
}
|
|
148
|
-
const v = parsed.v ??
|
|
149
|
-
(parsed.yParity == null ? undefined : BigInt(parsed.yParity + 27));
|
|
150
|
-
if (v == null) {
|
|
151
|
-
throw new index_js_2.BlueBundlesV1RequirementSignatureMismatchError({
|
|
152
|
-
field: "signature",
|
|
153
|
-
expected: "a signature containing v or yParity",
|
|
154
|
-
actual: serializedSignature,
|
|
155
|
-
});
|
|
156
|
-
}
|
|
157
|
-
return {
|
|
158
|
-
kind: BLUE_BUNDLES_V1_TOKEN_PERMIT_KIND.erc2612,
|
|
159
|
-
data: (0, viem_1.encodeAbiParameters)([
|
|
160
|
-
{ type: "uint256", name: "deadline" },
|
|
161
|
-
{ type: "uint8", name: "v" },
|
|
162
|
-
{ type: "bytes32", name: "r" },
|
|
163
|
-
{ type: "bytes32", name: "s" },
|
|
164
|
-
], [requirementSignature.args.deadline, Number(v), parsed.r, parsed.s]),
|
|
165
|
-
};
|
|
46
|
+
return (0, index_js_3.getBundlesTokenPermit)({
|
|
47
|
+
userAddress: params.userAddress,
|
|
48
|
+
token: params.token,
|
|
49
|
+
spender: (0, morpho_ts_1.getChainAddress)(params.chainId, "bundles.blueBundlesV1"),
|
|
50
|
+
amount: params.amount,
|
|
51
|
+
requirementSignature: params.requirementSignature,
|
|
52
|
+
});
|
|
166
53
|
};
|
|
167
54
|
exports.getBlueBundlesV1TokenPermit = getBlueBundlesV1TokenPermit;
|
|
168
55
|
/** @internal */
|
|
@@ -175,28 +62,28 @@ const getBlueBundlesV1SignedAuthorization = (params) => {
|
|
|
175
62
|
throw new index_js_2.DepositOwnerMismatchError(params.userAddress, authorizationSignature.args.owner);
|
|
176
63
|
}
|
|
177
64
|
if (!(0, viem_1.isAddressEqual)(authorizationSignature.args.authorized, authorized)) {
|
|
178
|
-
throw new index_js_2.
|
|
65
|
+
throw new index_js_2.BundlesRequirementSignatureMismatchError({
|
|
179
66
|
field: "authorized",
|
|
180
67
|
expected: authorized,
|
|
181
68
|
actual: authorizationSignature.args.authorized,
|
|
182
69
|
});
|
|
183
70
|
}
|
|
184
71
|
if (!(0, viem_1.isAddressEqual)(authorizationSignature.action.args.authorized, authorized)) {
|
|
185
|
-
throw new index_js_2.
|
|
72
|
+
throw new index_js_2.BundlesRequirementSignatureMismatchError({
|
|
186
73
|
field: "authorized",
|
|
187
74
|
expected: authorized,
|
|
188
75
|
actual: authorizationSignature.action.args.authorized,
|
|
189
76
|
});
|
|
190
77
|
}
|
|
191
78
|
if (!authorizationSignature.args.isAuthorized) {
|
|
192
|
-
throw new index_js_2.
|
|
79
|
+
throw new index_js_2.BundlesRequirementSignatureMismatchError({
|
|
193
80
|
field: "isAuthorized",
|
|
194
81
|
expected: "true",
|
|
195
82
|
actual: String(authorizationSignature.args.isAuthorized),
|
|
196
83
|
});
|
|
197
84
|
}
|
|
198
85
|
if (!authorizationSignature.action.args.isAuthorized) {
|
|
199
|
-
throw new index_js_2.
|
|
86
|
+
throw new index_js_2.BundlesRequirementSignatureMismatchError({
|
|
200
87
|
field: "isAuthorized",
|
|
201
88
|
expected: "true",
|
|
202
89
|
actual: String(authorizationSignature.action.args.isAuthorized),
|
|
@@ -204,7 +91,7 @@ const getBlueBundlesV1SignedAuthorization = (params) => {
|
|
|
204
91
|
}
|
|
205
92
|
if (authorizationSignature.action.args.deadline !==
|
|
206
93
|
authorizationSignature.args.deadline) {
|
|
207
|
-
throw new index_js_2.
|
|
94
|
+
throw new index_js_2.BundlesRequirementSignatureMismatchError({
|
|
208
95
|
field: "deadline",
|
|
209
96
|
expected: String(authorizationSignature.args.deadline),
|
|
210
97
|
actual: String(authorizationSignature.action.args.deadline),
|
|
@@ -219,7 +106,7 @@ const getBlueBundlesV1SignedAuthorization = (params) => {
|
|
|
219
106
|
: (0, viem_1.parseSignature)(serializedSignature);
|
|
220
107
|
}
|
|
221
108
|
catch (cause) {
|
|
222
|
-
throw new index_js_2.
|
|
109
|
+
throw new index_js_2.BundlesRequirementSignatureMismatchError({
|
|
223
110
|
field: "signature",
|
|
224
111
|
expected: "a 64-byte compact or 65-byte serialized ECDSA signature",
|
|
225
112
|
actual: serializedSignature,
|
|
@@ -229,7 +116,7 @@ const getBlueBundlesV1SignedAuthorization = (params) => {
|
|
|
229
116
|
const v = parsed.v ??
|
|
230
117
|
(parsed.yParity == null ? undefined : BigInt(parsed.yParity + 27));
|
|
231
118
|
if (v == null) {
|
|
232
|
-
throw new index_js_2.
|
|
119
|
+
throw new index_js_2.BundlesRequirementSignatureMismatchError({
|
|
233
120
|
field: "signature",
|
|
234
121
|
expected: "a signature containing v or yParity",
|
|
235
122
|
actual: serializedSignature,
|
|
@@ -281,24 +168,24 @@ const getBlueBundlesV1ReferralFeeAssets = (assets, referralFeePct) => referralFe
|
|
|
281
168
|
exports.getBlueBundlesV1ReferralFeeAssets = getBlueBundlesV1ReferralFeeAssets;
|
|
282
169
|
/** @internal */
|
|
283
170
|
const selectBlueBundlesV1RequirementSignatures = (signatures, accepts) => {
|
|
284
|
-
const { permit,
|
|
171
|
+
const { permit, permit2SignatureTransfer, authorization } = (0, index_js_2.selectRequirementSignatures)(signatures, {
|
|
285
172
|
permit: accepts.token,
|
|
286
|
-
|
|
173
|
+
permit2SignatureTransfer: accepts.token,
|
|
287
174
|
authorization: accepts.authorization,
|
|
288
175
|
});
|
|
289
176
|
if (permit?.action.type === "permit2") {
|
|
290
|
-
throw new index_js_2.
|
|
177
|
+
throw new index_js_2.BundlesRequirementSignatureMismatchError({
|
|
291
178
|
field: "type",
|
|
292
|
-
expected: "permit or
|
|
179
|
+
expected: "permit or permit2SignatureTransfer",
|
|
293
180
|
actual: permit.action.type,
|
|
294
181
|
});
|
|
295
182
|
}
|
|
296
|
-
if (permit != null &&
|
|
183
|
+
if (permit != null && permit2SignatureTransfer != null) {
|
|
297
184
|
throw new index_js_2.AmbiguousRequirementSignaturesError("permit", 2);
|
|
298
185
|
}
|
|
299
186
|
return {
|
|
300
187
|
token: permit ??
|
|
301
|
-
|
|
188
|
+
permit2SignatureTransfer,
|
|
302
189
|
authorization,
|
|
303
190
|
};
|
|
304
191
|
};
|
|
@@ -69,7 +69,7 @@ export interface BlueRefinanceParams {
|
|
|
69
69
|
* @throws {ReallocationWithdrawalOnTargetMarketError} when a source is the destination market.
|
|
70
70
|
* @throws {ReallocationLoanTokenMismatchError} when a source market uses another loan token.
|
|
71
71
|
* @throws {DepositOwnerMismatchError} when the signed authorization owner differs from `userAddress`.
|
|
72
|
-
* @throws {
|
|
72
|
+
* @throws {BundlesRequirementSignatureMismatchError} when authorization cannot be bound safely.
|
|
73
73
|
* @throws {UnsupportedChainIdError} when the chain is absent from the registry.
|
|
74
74
|
* @throws {UnknownAddressError} when BlueBundlesV1 is not registered.
|
|
75
75
|
* @example
|
|
@@ -42,7 +42,7 @@ const common_js_1 = require("./common.js");
|
|
|
42
42
|
* @throws {ReallocationWithdrawalOnTargetMarketError} when a source is the destination market.
|
|
43
43
|
* @throws {ReallocationLoanTokenMismatchError} when a source market uses another loan token.
|
|
44
44
|
* @throws {DepositOwnerMismatchError} when the signed authorization owner differs from `userAddress`.
|
|
45
|
-
* @throws {
|
|
45
|
+
* @throws {BundlesRequirementSignatureMismatchError} when authorization cannot be bound safely.
|
|
46
46
|
* @throws {UnsupportedChainIdError} when the chain is absent from the registry.
|
|
47
47
|
* @throws {UnknownAddressError} when BlueBundlesV1 is not registered.
|
|
48
48
|
* @example
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { MarketParams } from "@morpho-org/blue-sdk";
|
|
2
2
|
import { type Address } from "viem";
|
|
3
|
-
import type {
|
|
3
|
+
import type { BlueRepayAction, BundlesTokenRequirementSignature, Metadata, Transaction } from "../../types/index.js";
|
|
4
4
|
/** Parameters for {@link blueRepay}. */
|
|
5
5
|
export interface BlueRepayParams {
|
|
6
6
|
/** Chain and scoped Morpho Blue market. */
|
|
@@ -27,7 +27,7 @@ export interface BlueRepayParams {
|
|
|
27
27
|
/** Recipient required when `referralFeePct` is positive. */
|
|
28
28
|
readonly referralFeeRecipient?: Address;
|
|
29
29
|
/** Optional loan-token ERC-2612 or Permit2 SignatureTransfer result. */
|
|
30
|
-
readonly requirementSignature?:
|
|
30
|
+
readonly requirementSignature?: BundlesTokenRequirementSignature;
|
|
31
31
|
};
|
|
32
32
|
/** Optional transaction metadata suffix. */
|
|
33
33
|
readonly metadata?: Metadata;
|
|
@@ -65,7 +65,7 @@ export interface BlueRepayParams {
|
|
|
65
65
|
* @throws {DepositAssetMismatchError} when the signed asset differs from the loan token.
|
|
66
66
|
* @throws {DepositAmountMismatchError} when the signed amount differs from `maxRepayAssets`.
|
|
67
67
|
* @throws {DepositSpenderMismatchError} when the signed spender is not BlueBundlesV1.
|
|
68
|
-
* @throws {
|
|
68
|
+
* @throws {BundlesRequirementSignatureMismatchError} when a signature cannot be encoded safely.
|
|
69
69
|
* @throws {InputExceedsMaxError} when the referral fee is at least WAD.
|
|
70
70
|
* @throws {MissingReferralFeeRecipientError} when a positive fee has no recipient.
|
|
71
71
|
* @throws {UnsupportedChainIdError} when the chain is absent from the registry.
|
|
@@ -37,7 +37,7 @@ const repayWithdrawCollateral_js_1 = require("./repayWithdrawCollateral.js");
|
|
|
37
37
|
* @throws {DepositAssetMismatchError} when the signed asset differs from the loan token.
|
|
38
38
|
* @throws {DepositAmountMismatchError} when the signed amount differs from `maxRepayAssets`.
|
|
39
39
|
* @throws {DepositSpenderMismatchError} when the signed spender is not BlueBundlesV1.
|
|
40
|
-
* @throws {
|
|
40
|
+
* @throws {BundlesRequirementSignatureMismatchError} when a signature cannot be encoded safely.
|
|
41
41
|
* @throws {InputExceedsMaxError} when the referral fee is at least WAD.
|
|
42
42
|
* @throws {MissingReferralFeeRecipientError} when a positive fee has no recipient.
|
|
43
43
|
* @throws {UnsupportedChainIdError} when the chain is absent from the registry.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { MarketParams } from "@morpho-org/blue-sdk";
|
|
2
2
|
import { type Address } from "viem";
|
|
3
|
-
import { type AuthorizationRequirementSignature, type
|
|
3
|
+
import { type AuthorizationRequirementSignature, type BlueRepayWithdrawCollateralAction, type BundlesTokenRequirementSignature, type Metadata, type Transaction } from "../../types/index.js";
|
|
4
4
|
/** Parameters for {@link blueRepayWithdrawCollateral}. */
|
|
5
5
|
export interface BlueRepayWithdrawCollateralParams {
|
|
6
6
|
/** Chain and scoped Morpho Blue market. */
|
|
@@ -31,7 +31,7 @@ export interface BlueRepayWithdrawCollateralParams {
|
|
|
31
31
|
/** Recipient required when `referralFeePct` is positive. */
|
|
32
32
|
readonly referralFeeRecipient?: Address;
|
|
33
33
|
/** Optional loan-token ERC-2612 or Permit2 SignatureTransfer result. */
|
|
34
|
-
readonly requirementSignature?:
|
|
34
|
+
readonly requirementSignature?: BundlesTokenRequirementSignature;
|
|
35
35
|
/** Optional Morpho authorization signature for BlueBundlesV1. */
|
|
36
36
|
readonly authorizationSignature?: AuthorizationRequirementSignature;
|
|
37
37
|
};
|
|
@@ -77,7 +77,7 @@ export interface BlueRepayWithdrawCollateralParams {
|
|
|
77
77
|
* @throws {DepositAssetMismatchError} when the signed asset differs from the loan token.
|
|
78
78
|
* @throws {DepositAmountMismatchError} when the signed amount differs from `maxRepayAssets`.
|
|
79
79
|
* @throws {DepositSpenderMismatchError} when the signed spender is not BlueBundlesV1.
|
|
80
|
-
* @throws {
|
|
80
|
+
* @throws {BundlesRequirementSignatureMismatchError} when a signature cannot be bound safely.
|
|
81
81
|
* @throws {UnsupportedChainIdError} when the chain is absent from the registry.
|
|
82
82
|
* @throws {UnknownAddressError} when BlueBundlesV1 is not registered.
|
|
83
83
|
* @example
|
|
@@ -45,7 +45,7 @@ const common_js_1 = require("./common.js");
|
|
|
45
45
|
* @throws {DepositAssetMismatchError} when the signed asset differs from the loan token.
|
|
46
46
|
* @throws {DepositAmountMismatchError} when the signed amount differs from `maxRepayAssets`.
|
|
47
47
|
* @throws {DepositSpenderMismatchError} when the signed spender is not BlueBundlesV1.
|
|
48
|
-
* @throws {
|
|
48
|
+
* @throws {BundlesRequirementSignatureMismatchError} when a signature cannot be bound safely.
|
|
49
49
|
* @throws {UnsupportedChainIdError} when the chain is absent from the registry.
|
|
50
50
|
* @throws {UnknownAddressError} when BlueBundlesV1 is not registered.
|
|
51
51
|
* @example
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { MarketParams } from "@morpho-org/blue-sdk";
|
|
2
2
|
import { type Address } from "viem";
|
|
3
|
-
import type {
|
|
3
|
+
import type { BlueSupplyAction, BundlesTokenRequirementSignature, Metadata, Transaction } from "../../types/index.js";
|
|
4
4
|
/** Parameters for {@link blueSupply}. */
|
|
5
5
|
export interface BlueSupplyParams {
|
|
6
6
|
/** Chain and scoped Morpho Blue market. */
|
|
@@ -23,7 +23,7 @@ export interface BlueSupplyParams {
|
|
|
23
23
|
/** Recipient required when `referralFeePct` is positive. */
|
|
24
24
|
readonly referralFeeRecipient?: Address;
|
|
25
25
|
/** Optional ERC-2612 or Permit2 SignatureTransfer requirement result. */
|
|
26
|
-
readonly requirementSignature?:
|
|
26
|
+
readonly requirementSignature?: BundlesTokenRequirementSignature;
|
|
27
27
|
};
|
|
28
28
|
/** Optional transaction metadata suffix. */
|
|
29
29
|
readonly metadata?: Metadata;
|
|
@@ -59,7 +59,7 @@ export interface BlueSupplyParams {
|
|
|
59
59
|
* @throws {DepositAssetMismatchError} when the signed asset differs from the loan token.
|
|
60
60
|
* @throws {DepositAmountMismatchError} when the signed amount differs from `assets`.
|
|
61
61
|
* @throws {DepositSpenderMismatchError} when the signed spender is not BlueBundlesV1.
|
|
62
|
-
* @throws {
|
|
62
|
+
* @throws {BundlesRequirementSignatureMismatchError} when the signature kind or encoding is invalid.
|
|
63
63
|
* @throws {UnsupportedChainIdError} when the chain is absent from the address registry.
|
|
64
64
|
* @throws {UnknownAddressError} when BlueBundlesV1 is not registered.
|
|
65
65
|
* @example
|
|
@@ -36,7 +36,7 @@ const common_js_1 = require("./common.js");
|
|
|
36
36
|
* @throws {DepositAssetMismatchError} when the signed asset differs from the loan token.
|
|
37
37
|
* @throws {DepositAmountMismatchError} when the signed amount differs from `assets`.
|
|
38
38
|
* @throws {DepositSpenderMismatchError} when the signed spender is not BlueBundlesV1.
|
|
39
|
-
* @throws {
|
|
39
|
+
* @throws {BundlesRequirementSignatureMismatchError} when the signature kind or encoding is invalid.
|
|
40
40
|
* @throws {UnsupportedChainIdError} when the chain is absent from the address registry.
|
|
41
41
|
* @throws {UnknownAddressError} when BlueBundlesV1 is not registered.
|
|
42
42
|
* @example
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { MarketParams } from "@morpho-org/blue-sdk";
|
|
2
2
|
import { type Address } from "viem";
|
|
3
|
-
import type {
|
|
3
|
+
import type { BlueSupplyCollateralAction, BundlesTokenRequirementSignature, Metadata, Transaction } from "../../types/index.js";
|
|
4
4
|
/** Parameters for {@link blueSupplyCollateral}. */
|
|
5
5
|
export interface BlueSupplyCollateralParams {
|
|
6
6
|
/** Chain and scoped Morpho Blue market. */
|
|
@@ -23,7 +23,7 @@ export interface BlueSupplyCollateralParams {
|
|
|
23
23
|
/** Recipient required when `referralFeePct` is positive. */
|
|
24
24
|
readonly referralFeeRecipient?: Address;
|
|
25
25
|
/** Optional collateral ERC-2612 or Permit2 SignatureTransfer result. */
|
|
26
|
-
readonly requirementSignature?:
|
|
26
|
+
readonly requirementSignature?: BundlesTokenRequirementSignature;
|
|
27
27
|
};
|
|
28
28
|
/** Optional transaction metadata suffix. */
|
|
29
29
|
readonly metadata?: Metadata;
|
|
@@ -57,7 +57,7 @@ export interface BlueSupplyCollateralParams {
|
|
|
57
57
|
* @throws {DepositAssetMismatchError} when the signed asset differs from the collateral token.
|
|
58
58
|
* @throws {DepositAmountMismatchError} when the signed amount differs from `collateralAssets`.
|
|
59
59
|
* @throws {DepositSpenderMismatchError} when the signed spender is not BlueBundlesV1.
|
|
60
|
-
* @throws {
|
|
60
|
+
* @throws {BundlesRequirementSignatureMismatchError} when a signature cannot be encoded safely.
|
|
61
61
|
* @throws {InputExceedsMaxError} when the referral fee is at least WAD.
|
|
62
62
|
* @throws {MissingReferralFeeRecipientError} when a positive fee has no recipient.
|
|
63
63
|
* @throws {UnsupportedChainIdError} when the chain is absent from the registry.
|
|
@@ -33,7 +33,7 @@ const supplyCollateralBorrow_js_1 = require("./supplyCollateralBorrow.js");
|
|
|
33
33
|
* @throws {DepositAssetMismatchError} when the signed asset differs from the collateral token.
|
|
34
34
|
* @throws {DepositAmountMismatchError} when the signed amount differs from `collateralAssets`.
|
|
35
35
|
* @throws {DepositSpenderMismatchError} when the signed spender is not BlueBundlesV1.
|
|
36
|
-
* @throws {
|
|
36
|
+
* @throws {BundlesRequirementSignatureMismatchError} when a signature cannot be encoded safely.
|
|
37
37
|
* @throws {InputExceedsMaxError} when the referral fee is at least WAD.
|
|
38
38
|
* @throws {MissingReferralFeeRecipientError} when a positive fee has no recipient.
|
|
39
39
|
* @throws {UnsupportedChainIdError} when the chain is absent from the registry.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { MarketParams } from "@morpho-org/blue-sdk";
|
|
2
2
|
import { type Address } from "viem";
|
|
3
|
-
import { type AuthorizationRequirementSignature, type
|
|
3
|
+
import { type AuthorizationRequirementSignature, type BlueSupplyCollateralBorrowAction, type BundlesTokenRequirementSignature, type Metadata, type Transaction, type VaultV2BlueReallocation } from "../../types/index.js";
|
|
4
4
|
/** Parameters for {@link blueSupplyCollateralBorrow}. */
|
|
5
5
|
export interface BlueSupplyCollateralBorrowParams {
|
|
6
6
|
/** Chain and scoped Morpho Blue market. */
|
|
@@ -29,7 +29,7 @@ export interface BlueSupplyCollateralBorrowParams {
|
|
|
29
29
|
/** Recipient required when `referralFeePct` is positive. */
|
|
30
30
|
readonly referralFeeRecipient?: Address;
|
|
31
31
|
/** Optional collateral ERC-2612 or Permit2 SignatureTransfer result. */
|
|
32
|
-
readonly requirementSignature?:
|
|
32
|
+
readonly requirementSignature?: BundlesTokenRequirementSignature;
|
|
33
33
|
/** Optional Morpho authorization signature for BlueBundlesV1. */
|
|
34
34
|
readonly authorizationSignature?: AuthorizationRequirementSignature;
|
|
35
35
|
};
|
|
@@ -78,7 +78,7 @@ export interface BlueSupplyCollateralBorrowParams {
|
|
|
78
78
|
* @throws {DepositAssetMismatchError} when the signed asset differs from the collateral token.
|
|
79
79
|
* @throws {DepositAmountMismatchError} when the signed amount differs from `collateralAssets`.
|
|
80
80
|
* @throws {DepositSpenderMismatchError} when the signed spender is not BlueBundlesV1.
|
|
81
|
-
* @throws {
|
|
81
|
+
* @throws {BundlesRequirementSignatureMismatchError} when a signature cannot be bound safely.
|
|
82
82
|
* @throws {UnsupportedChainIdError} when the chain is absent from the registry.
|
|
83
83
|
* @throws {UnknownAddressError} when BlueBundlesV1 is not registered.
|
|
84
84
|
* @example
|
|
@@ -48,7 +48,7 @@ const common_js_1 = require("./common.js");
|
|
|
48
48
|
* @throws {DepositAssetMismatchError} when the signed asset differs from the collateral token.
|
|
49
49
|
* @throws {DepositAmountMismatchError} when the signed amount differs from `collateralAssets`.
|
|
50
50
|
* @throws {DepositSpenderMismatchError} when the signed spender is not BlueBundlesV1.
|
|
51
|
-
* @throws {
|
|
51
|
+
* @throws {BundlesRequirementSignatureMismatchError} when a signature cannot be bound safely.
|
|
52
52
|
* @throws {UnsupportedChainIdError} when the chain is absent from the registry.
|
|
53
53
|
* @throws {UnknownAddressError} when BlueBundlesV1 is not registered.
|
|
54
54
|
* @example
|
|
@@ -64,7 +64,7 @@ export interface BlueWithdrawParams {
|
|
|
64
64
|
* @throws {ReallocationWithdrawalOnTargetMarketError} when a source is the target market.
|
|
65
65
|
* @throws {ReallocationLoanTokenMismatchError} when a source market uses another loan token.
|
|
66
66
|
* @throws {DepositOwnerMismatchError} when the signed authorization owner differs from `userAddress`.
|
|
67
|
-
* @throws {
|
|
67
|
+
* @throws {BundlesRequirementSignatureMismatchError} when authorization cannot be bound safely.
|
|
68
68
|
* @throws {UnsupportedChainIdError} when the chain is absent from the registry.
|
|
69
69
|
* @throws {UnknownAddressError} when BlueBundlesV1 is not registered.
|
|
70
70
|
* @example
|
|
@@ -40,7 +40,7 @@ const common_js_1 = require("./common.js");
|
|
|
40
40
|
* @throws {ReallocationWithdrawalOnTargetMarketError} when a source is the target market.
|
|
41
41
|
* @throws {ReallocationLoanTokenMismatchError} when a source market uses another loan token.
|
|
42
42
|
* @throws {DepositOwnerMismatchError} when the signed authorization owner differs from `userAddress`.
|
|
43
|
-
* @throws {
|
|
43
|
+
* @throws {BundlesRequirementSignatureMismatchError} when authorization cannot be bound safely.
|
|
44
44
|
* @throws {UnsupportedChainIdError} when the chain is absent from the registry.
|
|
45
45
|
* @throws {UnknownAddressError} when BlueBundlesV1 is not registered.
|
|
46
46
|
* @example
|
|
@@ -52,7 +52,7 @@ export interface BlueWithdrawCollateralParams {
|
|
|
52
52
|
* @throws {InputExceedsMaxError} when the referral fee is at least WAD.
|
|
53
53
|
* @throws {MissingReferralFeeRecipientError} when a positive fee has no recipient.
|
|
54
54
|
* @throws {DepositOwnerMismatchError} when the signed authorization owner differs from `userAddress`.
|
|
55
|
-
* @throws {
|
|
55
|
+
* @throws {BundlesRequirementSignatureMismatchError} when authorization cannot be bound safely.
|
|
56
56
|
* @throws {UnsupportedChainIdError} when the chain is absent from the registry.
|
|
57
57
|
* @throws {UnknownAddressError} when BlueBundlesV1 is not registered.
|
|
58
58
|
* @example
|
|
@@ -27,7 +27,7 @@ const repayWithdrawCollateral_js_1 = require("./repayWithdrawCollateral.js");
|
|
|
27
27
|
* @throws {InputExceedsMaxError} when the referral fee is at least WAD.
|
|
28
28
|
* @throws {MissingReferralFeeRecipientError} when a positive fee has no recipient.
|
|
29
29
|
* @throws {DepositOwnerMismatchError} when the signed authorization owner differs from `userAddress`.
|
|
30
|
-
* @throws {
|
|
30
|
+
* @throws {BundlesRequirementSignatureMismatchError} when authorization cannot be bound safely.
|
|
31
31
|
* @throws {UnsupportedChainIdError} when the chain is absent from the registry.
|
|
32
32
|
* @throws {UnknownAddressError} when BlueBundlesV1 is not registered.
|
|
33
33
|
* @example
|