@morpho-org/morpho-sdk 5.2.0 → 5.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +46 -2
- package/lib/cjs/abis.d.ts +1 -0
- package/lib/cjs/abis.js +6 -1
- package/lib/cjs/actions/blue/borrow.d.ts +3 -7
- package/lib/cjs/actions/blue/borrow.js +5 -9
- package/lib/cjs/actions/blue/buildReallocationActions.d.ts +3 -4
- package/lib/cjs/actions/blue/buildReallocationActions.js +3 -4
- package/lib/cjs/actions/blue/refinance.d.ts +4 -8
- package/lib/cjs/actions/blue/refinance.js +10 -14
- package/lib/cjs/actions/blue/repay.d.ts +2 -5
- package/lib/cjs/actions/blue/repay.js +2 -5
- package/lib/cjs/actions/blue/repayWithdrawCollateral.d.ts +3 -6
- package/lib/cjs/actions/blue/repayWithdrawCollateral.js +4 -7
- package/lib/cjs/actions/blue/resolveRepayFunding.d.ts +2 -5
- package/lib/cjs/actions/blue/resolveRepayFunding.js +15 -12
- package/lib/cjs/actions/blue/supply.d.ts +2 -4
- package/lib/cjs/actions/blue/supply.js +6 -8
- package/lib/cjs/actions/blue/supplyCollateral.d.ts +2 -3
- package/lib/cjs/actions/blue/supplyCollateral.js +5 -6
- package/lib/cjs/actions/blue/supplyCollateralBorrow.d.ts +4 -9
- package/lib/cjs/actions/blue/supplyCollateralBorrow.js +9 -14
- package/lib/cjs/actions/blue/withdraw.d.ts +9 -7
- package/lib/cjs/actions/blue/withdraw.js +18 -10
- package/lib/cjs/actions/blue/withdrawCollateral.d.ts +1 -1
- package/lib/cjs/actions/blue/withdrawCollateral.js +2 -2
- package/lib/cjs/actions/index.d.ts +2 -0
- package/lib/cjs/actions/index.js +1 -0
- package/lib/cjs/actions/midnight/authorization.d.ts +37 -0
- package/lib/cjs/actions/midnight/authorization.js +69 -0
- package/lib/cjs/actions/midnight/cancelOffer.d.ts +38 -0
- package/lib/cjs/actions/midnight/cancelOffer.js +73 -0
- package/lib/cjs/actions/midnight/index.d.ts +11 -0
- package/lib/cjs/actions/midnight/index.js +27 -0
- package/lib/cjs/actions/midnight/mempoolSubmitOffers.d.ts +52 -0
- package/lib/cjs/actions/midnight/mempoolSubmitOffers.js +72 -0
- package/lib/cjs/actions/midnight/redeem.d.ts +43 -0
- package/lib/cjs/actions/midnight/redeem.js +79 -0
- package/lib/cjs/actions/midnight/repayWithdrawCollateral.d.ts +53 -0
- package/lib/cjs/actions/midnight/repayWithdrawCollateral.js +121 -0
- package/lib/cjs/actions/midnight/setterRatifierRatifyRoot.d.ts +40 -0
- package/lib/cjs/actions/midnight/setterRatifierRatifyRoot.js +59 -0
- package/lib/cjs/actions/midnight/supplyCollateral.d.ts +45 -0
- package/lib/cjs/actions/midnight/supplyCollateral.js +83 -0
- package/lib/cjs/actions/midnight/supplyCollateralTakeBorrow.d.ts +51 -0
- package/lib/cjs/actions/midnight/supplyCollateralTakeBorrow.js +128 -0
- package/lib/cjs/actions/midnight/takeBorrow.d.ts +57 -0
- package/lib/cjs/actions/midnight/takeBorrow.js +110 -0
- package/lib/cjs/actions/midnight/takeLend.d.ts +57 -0
- package/lib/cjs/actions/midnight/takeLend.js +110 -0
- package/lib/cjs/actions/midnight/types.d.ts +39 -0
- package/lib/cjs/actions/midnight/types.js +15 -0
- package/lib/cjs/actions/requirements/encode/encodeBlueSignatureAuthorization.d.ts +1 -1
- package/lib/cjs/actions/requirements/encode/encodeBlueSignatureAuthorization.js +5 -16
- package/lib/cjs/actions/requirements/encode/encodeErc20Approval.d.ts +5 -4
- package/lib/cjs/actions/requirements/encode/encodeErc20Approval.js +10 -14
- package/lib/cjs/actions/requirements/encode/encodeErc20Permit.d.ts +2 -2
- package/lib/cjs/actions/requirements/encode/encodeErc20Permit.js +11 -28
- package/lib/cjs/actions/requirements/encode/encodeErc20Permit2Approve.d.ts +1 -1
- package/lib/cjs/actions/requirements/encode/encodeErc20Permit2Approve.js +5 -17
- package/lib/cjs/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit.d.ts +1 -1
- package/lib/cjs/actions/requirements/getRequirementsApproval.d.ts +10 -4
- package/lib/cjs/actions/requirements/getRequirementsApproval.js +10 -4
- package/lib/cjs/actions/requirements/index.d.ts +1 -0
- package/lib/cjs/actions/requirements/index.js +1 -0
- package/lib/cjs/actions/requirements/midnight/getMidnightApprovalRequirements.d.ts +49 -0
- package/lib/cjs/actions/requirements/midnight/getMidnightApprovalRequirements.js +76 -0
- package/lib/cjs/actions/requirements/midnight/getMidnightAuthorizationRequirement.d.ts +44 -0
- package/lib/cjs/actions/requirements/midnight/getMidnightAuthorizationRequirement.js +78 -0
- package/lib/cjs/actions/requirements/midnight/getSetterRatifierRatifyRootRequirement.d.ts +42 -0
- package/lib/cjs/actions/requirements/midnight/getSetterRatifierRatifyRootRequirement.js +70 -0
- package/lib/cjs/actions/requirements/midnight/index.d.ts +3 -0
- package/lib/cjs/actions/requirements/midnight/index.js +19 -0
- package/lib/cjs/actions/vaultV1/deposit.d.ts +3 -4
- package/lib/cjs/actions/vaultV1/deposit.js +7 -8
- package/lib/cjs/actions/vaultV1/migrateToV2.d.ts +2 -3
- package/lib/cjs/actions/vaultV1/migrateToV2.js +5 -6
- package/lib/cjs/actions/vaultV1/redeem.d.ts +1 -1
- package/lib/cjs/actions/vaultV1/redeem.js +2 -2
- package/lib/cjs/actions/vaultV1/withdraw.d.ts +1 -1
- package/lib/cjs/actions/vaultV1/withdraw.js +2 -2
- package/lib/cjs/actions/vaultV2/deposit.d.ts +3 -4
- package/lib/cjs/actions/vaultV2/deposit.js +7 -8
- package/lib/cjs/actions/vaultV2/forceRedeem.d.ts +2 -3
- package/lib/cjs/actions/vaultV2/forceRedeem.js +3 -4
- package/lib/cjs/actions/vaultV2/forceWithdraw.d.ts +1 -1
- package/lib/cjs/actions/vaultV2/forceWithdraw.js +2 -2
- package/lib/cjs/actions/vaultV2/redeem.d.ts +1 -1
- package/lib/cjs/actions/vaultV2/redeem.js +2 -2
- package/lib/cjs/actions/vaultV2/withdraw.d.ts +1 -1
- package/lib/cjs/actions/vaultV2/withdraw.js +2 -2
- package/lib/cjs/client/morphoViemExtension.d.ts +1 -1
- package/lib/cjs/client/morphoViemExtension.js +5 -2
- package/lib/cjs/constants.d.ts +1 -0
- package/lib/cjs/constants.js +15 -1
- package/lib/cjs/entities/blue/blue.d.ts +5 -5
- package/lib/cjs/entities/blue/blue.js +99 -80
- package/lib/cjs/entities/index.d.ts +1 -0
- package/lib/cjs/entities/index.js +15 -0
- package/lib/cjs/entities/midnight/index.d.ts +2 -0
- package/lib/cjs/entities/midnight/index.js +18 -0
- package/lib/cjs/entities/midnight/midnight.d.ts +402 -0
- package/lib/cjs/entities/midnight/midnight.js +1036 -0
- package/lib/cjs/entities/midnight/types.d.ts +164 -0
- package/lib/cjs/entities/midnight/types.js +2 -0
- package/lib/cjs/entities/vaultV1/vaultV1.js +10 -17
- package/lib/cjs/entities/vaultV2/vaultV2.js +19 -21
- package/lib/cjs/errors.d.ts +1 -0
- package/lib/cjs/errors.js +17 -1
- package/lib/cjs/helpers/encodeDeallocation.d.ts +1 -0
- package/lib/cjs/helpers/encodeDeallocation.js +2 -1
- package/lib/cjs/helpers/index.d.ts +4 -1
- package/lib/cjs/helpers/index.js +8 -1
- package/lib/cjs/helpers/signAndVerifyTypedData.d.ts +34 -0
- package/lib/cjs/helpers/signAndVerifyTypedData.js +58 -0
- package/lib/cjs/helpers/validate.d.ts +40 -1
- package/lib/cjs/helpers/validate.js +47 -5
- package/lib/cjs/helpers/validateMidnightAuthorizationTarget.d.ts +15 -0
- package/lib/cjs/helpers/validateMidnightAuthorizationTarget.js +32 -0
- package/lib/cjs/helpers/validateMidnightMarket.d.ts +10 -0
- package/lib/cjs/helpers/validateMidnightMarket.js +24 -0
- package/lib/cjs/helpers/validateOfferSides.d.ts +21 -0
- package/lib/cjs/helpers/validateOfferSides.js +36 -0
- package/lib/cjs/helpers/validateRequirementSpender.d.ts +29 -0
- package/lib/cjs/helpers/validateRequirementSpender.js +49 -0
- package/lib/cjs/helpers/validateTakeableOffers.d.ts +18 -0
- package/lib/cjs/helpers/validateTakeableOffers.js +35 -0
- package/lib/cjs/midnight-api.d.ts +1 -0
- package/lib/cjs/midnight-api.js +17 -0
- package/lib/cjs/types/action.d.ts +189 -23
- package/lib/cjs/types/action.js +27 -7
- package/lib/cjs/types/client.d.ts +3 -2
- package/lib/cjs/types/error.d.ts +288 -119
- package/lib/cjs/types/error.js +259 -180
- package/lib/cjs/utils.d.ts +1 -0
- package/lib/cjs/utils.js +12 -2
- package/lib/esm/abis.d.ts +1 -0
- package/lib/esm/abis.js +1 -0
- package/lib/esm/actions/blue/borrow.d.ts +3 -7
- package/lib/esm/actions/blue/borrow.js +6 -10
- package/lib/esm/actions/blue/buildReallocationActions.d.ts +3 -4
- package/lib/esm/actions/blue/buildReallocationActions.js +3 -4
- package/lib/esm/actions/blue/refinance.d.ts +4 -8
- package/lib/esm/actions/blue/refinance.js +11 -15
- package/lib/esm/actions/blue/repay.d.ts +2 -5
- package/lib/esm/actions/blue/repay.js +2 -5
- package/lib/esm/actions/blue/repayWithdrawCollateral.d.ts +3 -6
- package/lib/esm/actions/blue/repayWithdrawCollateral.js +5 -8
- package/lib/esm/actions/blue/resolveRepayFunding.d.ts +2 -5
- package/lib/esm/actions/blue/resolveRepayFunding.js +16 -13
- package/lib/esm/actions/blue/supply.d.ts +2 -4
- package/lib/esm/actions/blue/supply.js +7 -9
- package/lib/esm/actions/blue/supplyCollateral.d.ts +2 -3
- package/lib/esm/actions/blue/supplyCollateral.js +6 -7
- package/lib/esm/actions/blue/supplyCollateralBorrow.d.ts +4 -9
- package/lib/esm/actions/blue/supplyCollateralBorrow.js +10 -15
- package/lib/esm/actions/blue/withdraw.d.ts +9 -7
- package/lib/esm/actions/blue/withdraw.js +19 -11
- package/lib/esm/actions/blue/withdrawCollateral.d.ts +1 -1
- package/lib/esm/actions/blue/withdrawCollateral.js +3 -3
- package/lib/esm/actions/index.d.ts +2 -0
- package/lib/esm/actions/index.js +1 -0
- package/lib/esm/actions/midnight/authorization.d.ts +37 -0
- package/lib/esm/actions/midnight/authorization.js +65 -0
- package/lib/esm/actions/midnight/cancelOffer.d.ts +38 -0
- package/lib/esm/actions/midnight/cancelOffer.js +69 -0
- package/lib/esm/actions/midnight/index.d.ts +11 -0
- package/lib/esm/actions/midnight/index.js +11 -0
- package/lib/esm/actions/midnight/mempoolSubmitOffers.d.ts +52 -0
- package/lib/esm/actions/midnight/mempoolSubmitOffers.js +68 -0
- package/lib/esm/actions/midnight/redeem.d.ts +43 -0
- package/lib/esm/actions/midnight/redeem.js +75 -0
- package/lib/esm/actions/midnight/repayWithdrawCollateral.d.ts +53 -0
- package/lib/esm/actions/midnight/repayWithdrawCollateral.js +117 -0
- package/lib/esm/actions/midnight/setterRatifierRatifyRoot.d.ts +40 -0
- package/lib/esm/actions/midnight/setterRatifierRatifyRoot.js +55 -0
- package/lib/esm/actions/midnight/supplyCollateral.d.ts +45 -0
- package/lib/esm/actions/midnight/supplyCollateral.js +79 -0
- package/lib/esm/actions/midnight/supplyCollateralTakeBorrow.d.ts +51 -0
- package/lib/esm/actions/midnight/supplyCollateralTakeBorrow.js +124 -0
- package/lib/esm/actions/midnight/takeBorrow.d.ts +57 -0
- package/lib/esm/actions/midnight/takeBorrow.js +106 -0
- package/lib/esm/actions/midnight/takeLend.d.ts +57 -0
- package/lib/esm/actions/midnight/takeLend.js +106 -0
- package/lib/esm/actions/midnight/types.d.ts +39 -0
- package/lib/esm/actions/midnight/types.js +12 -0
- package/lib/esm/actions/requirements/encode/encodeBlueSignatureAuthorization.d.ts +1 -1
- package/lib/esm/actions/requirements/encode/encodeBlueSignatureAuthorization.js +6 -17
- package/lib/esm/actions/requirements/encode/encodeErc20Approval.d.ts +5 -4
- package/lib/esm/actions/requirements/encode/encodeErc20Approval.js +12 -16
- package/lib/esm/actions/requirements/encode/encodeErc20Permit.d.ts +2 -2
- package/lib/esm/actions/requirements/encode/encodeErc20Permit.js +12 -29
- package/lib/esm/actions/requirements/encode/encodeErc20Permit2Approve.d.ts +1 -1
- package/lib/esm/actions/requirements/encode/encodeErc20Permit2Approve.js +5 -17
- package/lib/esm/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit.d.ts +1 -1
- package/lib/esm/actions/requirements/getRequirementsApproval.d.ts +10 -4
- package/lib/esm/actions/requirements/getRequirementsApproval.js +10 -4
- package/lib/esm/actions/requirements/index.d.ts +1 -0
- package/lib/esm/actions/requirements/index.js +1 -0
- package/lib/esm/actions/requirements/midnight/getMidnightApprovalRequirements.d.ts +49 -0
- package/lib/esm/actions/requirements/midnight/getMidnightApprovalRequirements.js +72 -0
- package/lib/esm/actions/requirements/midnight/getMidnightAuthorizationRequirement.d.ts +44 -0
- package/lib/esm/actions/requirements/midnight/getMidnightAuthorizationRequirement.js +74 -0
- package/lib/esm/actions/requirements/midnight/getSetterRatifierRatifyRootRequirement.d.ts +42 -0
- package/lib/esm/actions/requirements/midnight/getSetterRatifierRatifyRootRequirement.js +66 -0
- package/lib/esm/actions/requirements/midnight/index.d.ts +3 -0
- package/lib/esm/actions/requirements/midnight/index.js +3 -0
- package/lib/esm/actions/vaultV1/deposit.d.ts +3 -4
- package/lib/esm/actions/vaultV1/deposit.js +8 -9
- package/lib/esm/actions/vaultV1/migrateToV2.d.ts +2 -3
- package/lib/esm/actions/vaultV1/migrateToV2.js +6 -7
- package/lib/esm/actions/vaultV1/redeem.d.ts +1 -1
- package/lib/esm/actions/vaultV1/redeem.js +3 -3
- package/lib/esm/actions/vaultV1/withdraw.d.ts +1 -1
- package/lib/esm/actions/vaultV1/withdraw.js +3 -3
- package/lib/esm/actions/vaultV2/deposit.d.ts +3 -4
- package/lib/esm/actions/vaultV2/deposit.js +8 -9
- package/lib/esm/actions/vaultV2/forceRedeem.d.ts +2 -3
- package/lib/esm/actions/vaultV2/forceRedeem.js +4 -5
- package/lib/esm/actions/vaultV2/forceWithdraw.d.ts +1 -1
- package/lib/esm/actions/vaultV2/forceWithdraw.js +3 -3
- package/lib/esm/actions/vaultV2/redeem.d.ts +1 -1
- package/lib/esm/actions/vaultV2/redeem.js +3 -3
- package/lib/esm/actions/vaultV2/withdraw.d.ts +1 -1
- package/lib/esm/actions/vaultV2/withdraw.js +3 -3
- package/lib/esm/client/morphoViemExtension.d.ts +1 -1
- package/lib/esm/client/morphoViemExtension.js +6 -3
- package/lib/esm/constants.d.ts +1 -0
- package/lib/esm/constants.js +1 -0
- package/lib/esm/entities/blue/blue.d.ts +5 -5
- package/lib/esm/entities/blue/blue.js +101 -82
- package/lib/esm/entities/index.d.ts +1 -0
- package/lib/esm/entities/index.js +1 -0
- package/lib/esm/entities/midnight/index.d.ts +2 -0
- package/lib/esm/entities/midnight/index.js +2 -0
- package/lib/esm/entities/midnight/midnight.d.ts +402 -0
- package/lib/esm/entities/midnight/midnight.js +1032 -0
- package/lib/esm/entities/midnight/types.d.ts +164 -0
- package/lib/esm/entities/midnight/types.js +1 -0
- package/lib/esm/entities/vaultV1/vaultV1.js +13 -20
- package/lib/esm/entities/vaultV2/vaultV2.js +9 -11
- package/lib/esm/errors.d.ts +1 -0
- package/lib/esm/errors.js +1 -0
- package/lib/esm/helpers/encodeDeallocation.d.ts +1 -0
- package/lib/esm/helpers/encodeDeallocation.js +3 -2
- package/lib/esm/helpers/index.d.ts +4 -1
- package/lib/esm/helpers/index.js +4 -1
- package/lib/esm/helpers/signAndVerifyTypedData.d.ts +34 -0
- package/lib/esm/helpers/signAndVerifyTypedData.js +54 -0
- package/lib/esm/helpers/validate.d.ts +40 -1
- package/lib/esm/helpers/validate.js +46 -5
- package/lib/esm/helpers/validateMidnightAuthorizationTarget.d.ts +15 -0
- package/lib/esm/helpers/validateMidnightAuthorizationTarget.js +28 -0
- package/lib/esm/helpers/validateMidnightMarket.d.ts +10 -0
- package/lib/esm/helpers/validateMidnightMarket.js +20 -0
- package/lib/esm/helpers/validateOfferSides.d.ts +21 -0
- package/lib/esm/helpers/validateOfferSides.js +32 -0
- package/lib/esm/helpers/validateRequirementSpender.d.ts +29 -0
- package/lib/esm/helpers/validateRequirementSpender.js +45 -0
- package/lib/esm/helpers/validateTakeableOffers.d.ts +18 -0
- package/lib/esm/helpers/validateTakeableOffers.js +31 -0
- package/lib/esm/midnight-api.d.ts +1 -0
- package/lib/esm/midnight-api.js +1 -0
- package/lib/esm/types/action.d.ts +189 -23
- package/lib/esm/types/action.js +26 -7
- package/lib/esm/types/client.d.ts +3 -2
- package/lib/esm/types/error.d.ts +288 -119
- package/lib/esm/types/error.js +232 -154
- package/lib/esm/utils.d.ts +1 -0
- package/lib/esm/utils.js +1 -0
- package/package.json +11 -2
|
@@ -39,9 +39,9 @@ export interface VaultV2DepositParams {
|
|
|
39
39
|
* @param params.metadata - Optional analytics metadata attached to the bundle.
|
|
40
40
|
* @returns A deep-frozen `Transaction<VaultV2DepositAction>` with `to`, `value`, `data`, and the
|
|
41
41
|
* typed `action` discriminator the simulation layer consumes.
|
|
42
|
-
* @throws {
|
|
43
|
-
* @throws {
|
|
44
|
-
*
|
|
42
|
+
* @throws {NegativeInputError} when `amount < 0n` or `nativeAmount < 0n`.
|
|
43
|
+
* @throws {NonPositiveInputError} when `maxSharePrice <= 0n`, or when both `amount` and
|
|
44
|
+
* `nativeAmount` resolve to zero.
|
|
45
45
|
* @throws {ChainWNativeMissingError} when `nativeAmount` is provided but the chain has no
|
|
46
46
|
* configured wNative.
|
|
47
47
|
* @throws {NativeAmountOnNonWNativeVaultError} when `nativeAmount` is provided but the vault
|
|
@@ -53,7 +53,6 @@ export interface VaultV2DepositParams {
|
|
|
53
53
|
* `requirementSignature` is provided and the signed amount differs from `args.amount`.
|
|
54
54
|
* @throws {Permit2ExpirationMissingError} from `getTokenRequirementActions` when `amount > 0n` and a
|
|
55
55
|
* Permit2 requirement signature is missing its expiration.
|
|
56
|
-
* @throws {ZeroDepositAmountError} when both `amount` and `nativeAmount` resolve to zero.
|
|
57
56
|
* @example
|
|
58
57
|
* ```ts
|
|
59
58
|
* import { vaultV2Deposit } from "@morpho-org/morpho-sdk";
|
|
@@ -33,9 +33,9 @@ const getTokenRequirementActions_js_1 = require("../signatures/getTokenRequireme
|
|
|
33
33
|
* @param params.metadata - Optional analytics metadata attached to the bundle.
|
|
34
34
|
* @returns A deep-frozen `Transaction<VaultV2DepositAction>` with `to`, `value`, `data`, and the
|
|
35
35
|
* typed `action` discriminator the simulation layer consumes.
|
|
36
|
-
* @throws {
|
|
37
|
-
* @throws {
|
|
38
|
-
*
|
|
36
|
+
* @throws {NegativeInputError} when `amount < 0n` or `nativeAmount < 0n`.
|
|
37
|
+
* @throws {NonPositiveInputError} when `maxSharePrice <= 0n`, or when both `amount` and
|
|
38
|
+
* `nativeAmount` resolve to zero.
|
|
39
39
|
* @throws {ChainWNativeMissingError} when `nativeAmount` is provided but the chain has no
|
|
40
40
|
* configured wNative.
|
|
41
41
|
* @throws {NativeAmountOnNonWNativeVaultError} when `nativeAmount` is provided but the vault
|
|
@@ -47,7 +47,6 @@ const getTokenRequirementActions_js_1 = require("../signatures/getTokenRequireme
|
|
|
47
47
|
* `requirementSignature` is provided and the signed amount differs from `args.amount`.
|
|
48
48
|
* @throws {Permit2ExpirationMissingError} from `getTokenRequirementActions` when `amount > 0n` and a
|
|
49
49
|
* Permit2 requirement signature is missing its expiration.
|
|
50
|
-
* @throws {ZeroDepositAmountError} when both `amount` and `nativeAmount` resolve to zero.
|
|
51
50
|
* @example
|
|
52
51
|
* ```ts
|
|
53
52
|
* import { vaultV2Deposit } from "@morpho-org/morpho-sdk";
|
|
@@ -65,16 +64,16 @@ const getTokenRequirementActions_js_1 = require("../signatures/getTokenRequireme
|
|
|
65
64
|
*/
|
|
66
65
|
const vaultV2Deposit = ({ vault: { chainId, address: vaultAddress, asset }, args: { amount = 0n, maxSharePrice, recipient, requirementSignature, nativeAmount, }, metadata, }) => {
|
|
67
66
|
if (amount < 0n) {
|
|
68
|
-
throw new index_js_3.
|
|
67
|
+
throw new index_js_3.NegativeInputError("amount", amount);
|
|
69
68
|
}
|
|
70
69
|
if (maxSharePrice <= 0n) {
|
|
71
|
-
throw new index_js_3.
|
|
70
|
+
throw new index_js_3.NonPositiveInputError("maxSharePrice", maxSharePrice);
|
|
72
71
|
}
|
|
73
72
|
const actions = [];
|
|
74
73
|
const { bundler3: { generalAdapter1, bundler3 }, wNative, } = (0, blue_sdk_1.getChainAddresses)(chainId);
|
|
75
74
|
if (nativeAmount) {
|
|
76
75
|
if (nativeAmount < 0n) {
|
|
77
|
-
throw new index_js_3.
|
|
76
|
+
throw new index_js_3.NegativeInputError("nativeAmount", nativeAmount);
|
|
78
77
|
}
|
|
79
78
|
if (!(0, morpho_ts_1.isDefined)(wNative)) {
|
|
80
79
|
throw new index_js_3.ChainWNativeMissingError(chainId);
|
|
@@ -102,7 +101,7 @@ const vaultV2Deposit = ({ vault: { chainId, address: vaultAddress, asset }, args
|
|
|
102
101
|
}
|
|
103
102
|
const totalAssets = amount + (nativeAmount ?? 0n);
|
|
104
103
|
if (totalAssets === 0n) {
|
|
105
|
-
throw new index_js_3.
|
|
104
|
+
throw new index_js_3.NonPositiveInputError("totalAssets", totalAssets);
|
|
106
105
|
}
|
|
107
106
|
actions.push({
|
|
108
107
|
type: "erc4626Deposit",
|
|
@@ -42,9 +42,8 @@ export interface VaultV2ForceRedeemParams {
|
|
|
42
42
|
* @returns A deep-frozen `Transaction<VaultV2ForceRedeemAction>` with `to`, `value`, `data`, and
|
|
43
43
|
* the typed `action` discriminator the simulation layer consumes.
|
|
44
44
|
* @throws {EmptyDeallocationsError} when `deallocations` is empty.
|
|
45
|
-
* @throws {
|
|
46
|
-
*
|
|
47
|
-
* `encodeForceDeallocateCall`).
|
|
45
|
+
* @throws {NonPositiveInputError} when `redeem.shares <= 0n` or any deallocation amount is
|
|
46
|
+
* non-positive.
|
|
48
47
|
* @example
|
|
49
48
|
* ```ts
|
|
50
49
|
* import { vaultV2ForceRedeem } from "@morpho-org/morpho-sdk";
|
|
@@ -34,9 +34,8 @@ const index_js_2 = require("../../types/index.js");
|
|
|
34
34
|
* @returns A deep-frozen `Transaction<VaultV2ForceRedeemAction>` with `to`, `value`, `data`, and
|
|
35
35
|
* the typed `action` discriminator the simulation layer consumes.
|
|
36
36
|
* @throws {EmptyDeallocationsError} when `deallocations` is empty.
|
|
37
|
-
* @throws {
|
|
38
|
-
*
|
|
39
|
-
* `encodeForceDeallocateCall`).
|
|
37
|
+
* @throws {NonPositiveInputError} when `redeem.shares <= 0n` or any deallocation amount is
|
|
38
|
+
* non-positive.
|
|
40
39
|
* @example
|
|
41
40
|
* ```ts
|
|
42
41
|
* import { vaultV2ForceRedeem } from "@morpho-org/morpho-sdk";
|
|
@@ -57,7 +56,7 @@ const vaultV2ForceRedeem = ({ vault: { address: vaultAddress }, args: { dealloca
|
|
|
57
56
|
throw new index_js_2.EmptyDeallocationsError(vaultAddress);
|
|
58
57
|
}
|
|
59
58
|
if (redeem.shares <= 0n) {
|
|
60
|
-
throw new index_js_2.
|
|
59
|
+
throw new index_js_2.NonPositiveInputError("redeem.shares", redeem.shares);
|
|
61
60
|
}
|
|
62
61
|
const calls = [];
|
|
63
62
|
for (const deallocation of deallocations) {
|
|
@@ -38,7 +38,7 @@ export interface VaultV2ForceWithdrawParams {
|
|
|
38
38
|
* @returns A deep-frozen `Transaction<VaultV2ForceWithdrawAction>` with `to`, `value`, `data`,
|
|
39
39
|
* and the typed `action` discriminator the simulation layer consumes.
|
|
40
40
|
* @throws {EmptyDeallocationsError} when `deallocations` is empty.
|
|
41
|
-
* @throws {
|
|
41
|
+
* @throws {NonPositiveInputError} when `withdraw.amount <= 0n`, or when any
|
|
42
42
|
* `deallocations[i].amount <= 0n` (raised by `encodeForceDeallocateCall`).
|
|
43
43
|
* @example
|
|
44
44
|
* ```ts
|
|
@@ -30,7 +30,7 @@ const index_js_2 = require("../../types/index.js");
|
|
|
30
30
|
* @returns A deep-frozen `Transaction<VaultV2ForceWithdrawAction>` with `to`, `value`, `data`,
|
|
31
31
|
* and the typed `action` discriminator the simulation layer consumes.
|
|
32
32
|
* @throws {EmptyDeallocationsError} when `deallocations` is empty.
|
|
33
|
-
* @throws {
|
|
33
|
+
* @throws {NonPositiveInputError} when `withdraw.amount <= 0n`, or when any
|
|
34
34
|
* `deallocations[i].amount <= 0n` (raised by `encodeForceDeallocateCall`).
|
|
35
35
|
* @example
|
|
36
36
|
* ```ts
|
|
@@ -53,7 +53,7 @@ const vaultV2ForceWithdraw = ({ vault: { address: vaultAddress }, args: { deallo
|
|
|
53
53
|
}
|
|
54
54
|
const { amount: withdrawAmount, recipient: withdrawRecipient } = withdraw;
|
|
55
55
|
if (withdrawAmount <= 0n) {
|
|
56
|
-
throw new index_js_2.
|
|
56
|
+
throw new index_js_2.NonPositiveInputError("withdraw.amount", withdrawAmount);
|
|
57
57
|
}
|
|
58
58
|
const calls = [];
|
|
59
59
|
for (const deallocation of deallocations) {
|
|
@@ -25,7 +25,7 @@ export interface VaultV2RedeemParams {
|
|
|
25
25
|
* @param params.metadata - Optional analytics metadata attached to the transaction.
|
|
26
26
|
* @returns A deep-frozen `Transaction<VaultV2RedeemAction>` with `to`, `value`, `data`, and the
|
|
27
27
|
* typed `action` discriminator the simulation layer consumes.
|
|
28
|
-
* @throws {
|
|
28
|
+
* @throws {NonPositiveInputError} when `shares <= 0n`.
|
|
29
29
|
* @example
|
|
30
30
|
* ```ts
|
|
31
31
|
* import { vaultV2Redeem } from "@morpho-org/morpho-sdk";
|
|
@@ -19,7 +19,7 @@ const index_js_2 = require("../../types/index.js");
|
|
|
19
19
|
* @param params.metadata - Optional analytics metadata attached to the transaction.
|
|
20
20
|
* @returns A deep-frozen `Transaction<VaultV2RedeemAction>` with `to`, `value`, `data`, and the
|
|
21
21
|
* typed `action` discriminator the simulation layer consumes.
|
|
22
|
-
* @throws {
|
|
22
|
+
* @throws {NonPositiveInputError} when `shares <= 0n`.
|
|
23
23
|
* @example
|
|
24
24
|
* ```ts
|
|
25
25
|
* import { vaultV2Redeem } from "@morpho-org/morpho-sdk";
|
|
@@ -33,7 +33,7 @@ const index_js_2 = require("../../types/index.js");
|
|
|
33
33
|
*/
|
|
34
34
|
const vaultV2Redeem = ({ vault: { address: vaultAddress }, args: { shares, recipient, onBehalf }, metadata, }) => {
|
|
35
35
|
if (shares <= 0n) {
|
|
36
|
-
throw new index_js_2.
|
|
36
|
+
throw new index_js_2.NonPositiveInputError("shares", shares);
|
|
37
37
|
}
|
|
38
38
|
let tx = {
|
|
39
39
|
to: vaultAddress,
|
|
@@ -25,7 +25,7 @@ export interface VaultV2WithdrawParams {
|
|
|
25
25
|
* @param params.metadata - Optional analytics metadata attached to the transaction.
|
|
26
26
|
* @returns A deep-frozen `Transaction<VaultV2WithdrawAction>` with `to`, `value`, `data`, and the
|
|
27
27
|
* typed `action` discriminator the simulation layer consumes.
|
|
28
|
-
* @throws {
|
|
28
|
+
* @throws {NonPositiveInputError} when `amount <= 0n`.
|
|
29
29
|
* @example
|
|
30
30
|
* ```ts
|
|
31
31
|
* import { vaultV2Withdraw } from "@morpho-org/morpho-sdk";
|
|
@@ -19,7 +19,7 @@ const index_js_2 = require("../../types/index.js");
|
|
|
19
19
|
* @param params.metadata - Optional analytics metadata attached to the transaction.
|
|
20
20
|
* @returns A deep-frozen `Transaction<VaultV2WithdrawAction>` with `to`, `value`, `data`, and the
|
|
21
21
|
* typed `action` discriminator the simulation layer consumes.
|
|
22
|
-
* @throws {
|
|
22
|
+
* @throws {NonPositiveInputError} when `amount <= 0n`.
|
|
23
23
|
* @example
|
|
24
24
|
* ```ts
|
|
25
25
|
* import { vaultV2Withdraw } from "@morpho-org/morpho-sdk";
|
|
@@ -33,7 +33,7 @@ const index_js_2 = require("../../types/index.js");
|
|
|
33
33
|
*/
|
|
34
34
|
const vaultV2Withdraw = ({ vault: { address: vaultAddress }, args: { amount, recipient, onBehalf }, metadata, }) => {
|
|
35
35
|
if (amount <= 0n) {
|
|
36
|
-
throw new index_js_2.
|
|
36
|
+
throw new index_js_2.NonPositiveInputError("amount", amount);
|
|
37
37
|
}
|
|
38
38
|
let tx = {
|
|
39
39
|
to: vaultAddress,
|
|
@@ -6,7 +6,7 @@ import { type Metadata, type MorphoClientType } from "../types/index.js";
|
|
|
6
6
|
* protocol entity factories under `client.morpho`, so reads and writes share one client.
|
|
7
7
|
*
|
|
8
8
|
* Holds no state beyond configuration: no cache, no `init()`, no warm-up. Each factory call
|
|
9
|
-
* (`client.morpho.vaultV1`, `vaultV2`, `blue`) returns a fresh entity bound to the client.
|
|
9
|
+
* (`client.morpho.vaultV1`, `vaultV2`, `blue`, `midnight`) returns a fresh entity bound to the client.
|
|
10
10
|
*
|
|
11
11
|
* @param _options - Optional SDK-wide options forwarded to the `morpho` namespace.
|
|
12
12
|
* @param _options.metadata - Optional analytics metadata applied to every transaction the
|
|
@@ -10,7 +10,7 @@ const index_js_2 = require("../types/index.js");
|
|
|
10
10
|
* viem `Client` plus a frozen options bag and exposes factory methods for the protocol entities.
|
|
11
11
|
*
|
|
12
12
|
* Holds no state beyond configuration: no cache, no `init()`, no warm-up. Each factory call
|
|
13
|
-
* (`vaultV1`, `vaultV2`, `blue`) returns a fresh entity bound to this client.
|
|
13
|
+
* (`vaultV1`, `vaultV2`, `blue`, `midnight`) returns a fresh entity bound to this client.
|
|
14
14
|
*
|
|
15
15
|
* @internal
|
|
16
16
|
*/
|
|
@@ -37,6 +37,9 @@ function createMorphoNamespace(viemClient, options) {
|
|
|
37
37
|
}
|
|
38
38
|
return new index_js_1.MorphoBlue(namespace, marketParams, chainId);
|
|
39
39
|
},
|
|
40
|
+
midnight(chainId) {
|
|
41
|
+
return new index_js_1.MorphoMidnight(namespace, chainId);
|
|
42
|
+
},
|
|
40
43
|
};
|
|
41
44
|
return namespace;
|
|
42
45
|
}
|
|
@@ -46,7 +49,7 @@ function createMorphoNamespace(viemClient, options) {
|
|
|
46
49
|
* protocol entity factories under `client.morpho`, so reads and writes share one client.
|
|
47
50
|
*
|
|
48
51
|
* Holds no state beyond configuration: no cache, no `init()`, no warm-up. Each factory call
|
|
49
|
-
* (`client.morpho.vaultV1`, `vaultV2`, `blue`) returns a fresh entity bound to the client.
|
|
52
|
+
* (`client.morpho.vaultV1`, `vaultV2`, `blue`, `midnight`) returns a fresh entity bound to the client.
|
|
50
53
|
*
|
|
51
54
|
* @param _options - Optional SDK-wide options forwarded to the `morpho` namespace.
|
|
52
55
|
* @param _options.metadata - Optional analytics metadata applied to every transaction the
|
package/lib/cjs/constants.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { DEFAULT_SLIPPAGE_TOLERANCE, EIP_712_FIELDS, isMarketId, LIQUIDATION_CURSOR, MAX_LIQUIDATION_INCENTIVE_FACTOR, ORACLE_PRICE_SCALE, SECONDS_PER_YEAR, TransactionType, } from "@morpho-org/blue-sdk";
|
|
2
|
+
export { CBP, COLLATERAL_PARAMS_TYPEHASH, DEFAULT_TICK_SPACING, EIP712_DOMAIN_TYPEHASH, MARKET_TYPEHASH, MAX_COLLATERALS, MAX_COLLATERALS_PER_BORROWER, MAX_CONTINUOUS_FEE, MAX_SETTLEMENT_FEES, MAX_TICK, OFFER_TYPEHASH, PRICE_ROUNDING_STEP, SETTLEMENT_FEE_BREAKPOINTS, } from "@morpho-org/midnight-sdk";
|
|
2
3
|
export { BLUE_API_BASE_URL, BLUE_API_GRAPHQL_URL, CDN_BASE_URL, ChainId, ChainUtils, DOCS_BASE_URL, MORPHO_DOMAIN, OPTIMIZERS_API_BASE_URL, OPTIMIZERS_BASE_URL, REWARDS_BASE_URL, ZERO_ADDRESS, } from "@morpho-org/morpho-ts";
|
|
3
4
|
export { APPROVE_ONLY_ONCE_TOKENS, DEFAULT_LLTV_BUFFER, DEFAULT_SUPPLY_TARGET_UTILIZATION, DEFAULT_WITHDRAWAL_TARGET_UTILIZATION, MAX_ABSOLUTE_SHARE_PRICE, MAX_SLIPPAGE_TOLERANCE, MAX_TOKEN_APPROVALS, } from "./helpers/constant.js";
|
package/lib/cjs/constants.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MAX_TOKEN_APPROVALS = exports.MAX_SLIPPAGE_TOLERANCE = exports.MAX_ABSOLUTE_SHARE_PRICE = exports.DEFAULT_WITHDRAWAL_TARGET_UTILIZATION = exports.DEFAULT_SUPPLY_TARGET_UTILIZATION = exports.DEFAULT_LLTV_BUFFER = exports.APPROVE_ONLY_ONCE_TOKENS = exports.ZERO_ADDRESS = exports.REWARDS_BASE_URL = exports.OPTIMIZERS_BASE_URL = exports.OPTIMIZERS_API_BASE_URL = exports.MORPHO_DOMAIN = exports.DOCS_BASE_URL = exports.ChainUtils = exports.ChainId = exports.CDN_BASE_URL = exports.BLUE_API_GRAPHQL_URL = exports.BLUE_API_BASE_URL = exports.TransactionType = exports.SECONDS_PER_YEAR = exports.ORACLE_PRICE_SCALE = exports.MAX_LIQUIDATION_INCENTIVE_FACTOR = exports.LIQUIDATION_CURSOR = exports.isMarketId = exports.EIP_712_FIELDS = exports.DEFAULT_SLIPPAGE_TOLERANCE = void 0;
|
|
3
|
+
exports.MAX_TOKEN_APPROVALS = exports.MAX_SLIPPAGE_TOLERANCE = exports.MAX_ABSOLUTE_SHARE_PRICE = exports.DEFAULT_WITHDRAWAL_TARGET_UTILIZATION = exports.DEFAULT_SUPPLY_TARGET_UTILIZATION = exports.DEFAULT_LLTV_BUFFER = exports.APPROVE_ONLY_ONCE_TOKENS = exports.ZERO_ADDRESS = exports.REWARDS_BASE_URL = exports.OPTIMIZERS_BASE_URL = exports.OPTIMIZERS_API_BASE_URL = exports.MORPHO_DOMAIN = exports.DOCS_BASE_URL = exports.ChainUtils = exports.ChainId = exports.CDN_BASE_URL = exports.BLUE_API_GRAPHQL_URL = exports.BLUE_API_BASE_URL = exports.SETTLEMENT_FEE_BREAKPOINTS = exports.PRICE_ROUNDING_STEP = exports.OFFER_TYPEHASH = exports.MAX_TICK = exports.MAX_SETTLEMENT_FEES = exports.MAX_CONTINUOUS_FEE = exports.MAX_COLLATERALS_PER_BORROWER = exports.MAX_COLLATERALS = exports.MARKET_TYPEHASH = exports.EIP712_DOMAIN_TYPEHASH = exports.DEFAULT_TICK_SPACING = exports.COLLATERAL_PARAMS_TYPEHASH = exports.CBP = exports.TransactionType = exports.SECONDS_PER_YEAR = exports.ORACLE_PRICE_SCALE = exports.MAX_LIQUIDATION_INCENTIVE_FACTOR = exports.LIQUIDATION_CURSOR = exports.isMarketId = exports.EIP_712_FIELDS = exports.DEFAULT_SLIPPAGE_TOLERANCE = void 0;
|
|
4
4
|
var blue_sdk_1 = require("@morpho-org/blue-sdk");
|
|
5
5
|
Object.defineProperty(exports, "DEFAULT_SLIPPAGE_TOLERANCE", { enumerable: true, get: function () { return blue_sdk_1.DEFAULT_SLIPPAGE_TOLERANCE; } });
|
|
6
6
|
Object.defineProperty(exports, "EIP_712_FIELDS", { enumerable: true, get: function () { return blue_sdk_1.EIP_712_FIELDS; } });
|
|
@@ -10,6 +10,20 @@ Object.defineProperty(exports, "MAX_LIQUIDATION_INCENTIVE_FACTOR", { enumerable:
|
|
|
10
10
|
Object.defineProperty(exports, "ORACLE_PRICE_SCALE", { enumerable: true, get: function () { return blue_sdk_1.ORACLE_PRICE_SCALE; } });
|
|
11
11
|
Object.defineProperty(exports, "SECONDS_PER_YEAR", { enumerable: true, get: function () { return blue_sdk_1.SECONDS_PER_YEAR; } });
|
|
12
12
|
Object.defineProperty(exports, "TransactionType", { enumerable: true, get: function () { return blue_sdk_1.TransactionType; } });
|
|
13
|
+
var midnight_sdk_1 = require("@morpho-org/midnight-sdk");
|
|
14
|
+
Object.defineProperty(exports, "CBP", { enumerable: true, get: function () { return midnight_sdk_1.CBP; } });
|
|
15
|
+
Object.defineProperty(exports, "COLLATERAL_PARAMS_TYPEHASH", { enumerable: true, get: function () { return midnight_sdk_1.COLLATERAL_PARAMS_TYPEHASH; } });
|
|
16
|
+
Object.defineProperty(exports, "DEFAULT_TICK_SPACING", { enumerable: true, get: function () { return midnight_sdk_1.DEFAULT_TICK_SPACING; } });
|
|
17
|
+
Object.defineProperty(exports, "EIP712_DOMAIN_TYPEHASH", { enumerable: true, get: function () { return midnight_sdk_1.EIP712_DOMAIN_TYPEHASH; } });
|
|
18
|
+
Object.defineProperty(exports, "MARKET_TYPEHASH", { enumerable: true, get: function () { return midnight_sdk_1.MARKET_TYPEHASH; } });
|
|
19
|
+
Object.defineProperty(exports, "MAX_COLLATERALS", { enumerable: true, get: function () { return midnight_sdk_1.MAX_COLLATERALS; } });
|
|
20
|
+
Object.defineProperty(exports, "MAX_COLLATERALS_PER_BORROWER", { enumerable: true, get: function () { return midnight_sdk_1.MAX_COLLATERALS_PER_BORROWER; } });
|
|
21
|
+
Object.defineProperty(exports, "MAX_CONTINUOUS_FEE", { enumerable: true, get: function () { return midnight_sdk_1.MAX_CONTINUOUS_FEE; } });
|
|
22
|
+
Object.defineProperty(exports, "MAX_SETTLEMENT_FEES", { enumerable: true, get: function () { return midnight_sdk_1.MAX_SETTLEMENT_FEES; } });
|
|
23
|
+
Object.defineProperty(exports, "MAX_TICK", { enumerable: true, get: function () { return midnight_sdk_1.MAX_TICK; } });
|
|
24
|
+
Object.defineProperty(exports, "OFFER_TYPEHASH", { enumerable: true, get: function () { return midnight_sdk_1.OFFER_TYPEHASH; } });
|
|
25
|
+
Object.defineProperty(exports, "PRICE_ROUNDING_STEP", { enumerable: true, get: function () { return midnight_sdk_1.PRICE_ROUNDING_STEP; } });
|
|
26
|
+
Object.defineProperty(exports, "SETTLEMENT_FEE_BREAKPOINTS", { enumerable: true, get: function () { return midnight_sdk_1.SETTLEMENT_FEE_BREAKPOINTS; } });
|
|
13
27
|
var morpho_ts_1 = require("@morpho-org/morpho-ts");
|
|
14
28
|
Object.defineProperty(exports, "BLUE_API_BASE_URL", { enumerable: true, get: function () { return morpho_ts_1.BLUE_API_BASE_URL; } });
|
|
15
29
|
Object.defineProperty(exports, "BLUE_API_GRAPHQL_URL", { enumerable: true, get: function () { return morpho_ts_1.BLUE_API_GRAPHQL_URL; } });
|
|
@@ -382,7 +382,7 @@ export declare class MorphoBlue implements BlueActions {
|
|
|
382
382
|
slippageTolerance?: bigint;
|
|
383
383
|
reallocations?: readonly VaultReallocation[];
|
|
384
384
|
} & AssetsOrSharesArgs): {
|
|
385
|
-
getRequirements: () => Promise<(
|
|
385
|
+
getRequirements: () => Promise<(Requirement<import("../../types/action.js").AuthorizationRequirementSignature, undefined> | Readonly<Transaction<BlueAuthorizationAction>>)[]>;
|
|
386
386
|
buildTx: (signatures?: readonly RequirementSignature[]) => Readonly<Transaction<BlueWithdrawAction>>;
|
|
387
387
|
};
|
|
388
388
|
supplyCollateral({ amount, userAddress, nativeAmount, }: {
|
|
@@ -400,7 +400,7 @@ export declare class MorphoBlue implements BlueActions {
|
|
|
400
400
|
slippageTolerance?: bigint;
|
|
401
401
|
reallocations?: readonly VaultReallocation[];
|
|
402
402
|
}): {
|
|
403
|
-
getRequirements: () => Promise<(
|
|
403
|
+
getRequirements: () => Promise<(Requirement<import("../../types/action.js").AuthorizationRequirementSignature, undefined> | Readonly<Transaction<BlueAuthorizationAction>>)[]>;
|
|
404
404
|
buildTx: (signatures?: readonly RequirementSignature[]) => Readonly<Transaction<BlueBorrowAction>>;
|
|
405
405
|
};
|
|
406
406
|
repay(params: {
|
|
@@ -428,7 +428,7 @@ export declare class MorphoBlue implements BlueActions {
|
|
|
428
428
|
} & RepayAmountArgs): {
|
|
429
429
|
getRequirements: (reqParams?: {
|
|
430
430
|
useSimplePermit?: boolean;
|
|
431
|
-
}) => Promise<(import("../../types/action.js").Bundler3TokenSignatureRequirement |
|
|
431
|
+
}) => Promise<(import("../../types/action.js").Bundler3TokenSignatureRequirement | Requirement<import("../../types/action.js").AuthorizationRequirementSignature, undefined> | Readonly<Transaction<ERC20ApprovalAction>> | Readonly<Transaction<BlueAuthorizationAction>>)[]>;
|
|
432
432
|
buildTx: (signatures?: readonly RequirementSignature[]) => Readonly<Transaction<BlueRepayWithdrawCollateralAction>>;
|
|
433
433
|
};
|
|
434
434
|
supplyCollateralBorrow({ amount, userAddress, positionData, borrowAmount, nativeAmount, slippageTolerance, reallocations, }: {
|
|
@@ -440,7 +440,7 @@ export declare class MorphoBlue implements BlueActions {
|
|
|
440
440
|
} & DepositAmountArgs): {
|
|
441
441
|
getRequirements: (params?: {
|
|
442
442
|
useSimplePermit?: boolean;
|
|
443
|
-
}) => Promise<(import("../../types/action.js").Bundler3TokenSignatureRequirement |
|
|
443
|
+
}) => Promise<(import("../../types/action.js").Bundler3TokenSignatureRequirement | Requirement<import("../../types/action.js").AuthorizationRequirementSignature, undefined> | Readonly<Transaction<ERC20ApprovalAction>> | Readonly<Transaction<BlueAuthorizationAction>>)[]>;
|
|
444
444
|
buildTx: (signatures?: readonly RequirementSignature[]) => Readonly<Transaction<BlueSupplyCollateralBorrowAction>>;
|
|
445
445
|
};
|
|
446
446
|
refinance({ userAddress, positionData, target, collateralAmount, borrowAssets, borrowShares, slippageTolerance, targetReallocations, }: {
|
|
@@ -456,7 +456,7 @@ export declare class MorphoBlue implements BlueActions {
|
|
|
456
456
|
slippageTolerance?: bigint;
|
|
457
457
|
targetReallocations?: readonly VaultReallocation[];
|
|
458
458
|
}): {
|
|
459
|
-
getRequirements: () => Promise<(
|
|
459
|
+
getRequirements: () => Promise<(Requirement<import("../../types/action.js").AuthorizationRequirementSignature, undefined> | Readonly<Transaction<BlueAuthorizationAction>>)[]>;
|
|
460
460
|
buildTx: (signatures?: readonly RequirementSignature[]) => Readonly<Transaction<BlueRefinanceAction>>;
|
|
461
461
|
};
|
|
462
462
|
/**
|