@morpho-org/morpho-sdk 5.9.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 +404 -0
- package/README.md +127 -69
- package/lib/cjs/abis.d.ts +210 -0
- package/lib/cjs/abis.js +142 -2
- package/lib/cjs/actions/blue/borrow.d.ts +62 -61
- package/lib/cjs/actions/blue/borrow.js +48 -80
- package/lib/cjs/actions/blue/common.d.ts +86 -0
- package/lib/cjs/actions/blue/common.js +205 -0
- package/lib/cjs/actions/blue/refinance.d.ts +72 -112
- package/lib/cjs/actions/blue/refinance.js +97 -199
- package/lib/cjs/actions/blue/repay.d.ts +72 -68
- package/lib/cjs/actions/blue/repay.js +56 -118
- package/lib/cjs/actions/blue/repayWithdrawCollateral.d.ts +85 -90
- package/lib/cjs/actions/blue/repayWithdrawCollateral.js +148 -137
- package/lib/cjs/actions/blue/supply.d.ts +62 -45
- package/lib/cjs/actions/blue/supply.js +94 -70
- package/lib/cjs/actions/blue/supplyCollateral.d.ts +63 -40
- package/lib/cjs/actions/blue/supplyCollateral.js +52 -69
- package/lib/cjs/actions/blue/supplyCollateralBorrow.d.ts +82 -90
- package/lib/cjs/actions/blue/supplyCollateralBorrow.js +133 -120
- package/lib/cjs/actions/blue/withdraw.d.ts +68 -79
- package/lib/cjs/actions/blue/withdraw.js +101 -97
- package/lib/cjs/actions/blue/withdrawCollateral.d.ts +56 -28
- package/lib/cjs/actions/blue/withdrawCollateral.js +45 -50
- 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 +2 -1
- 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/getBlueAuthorizationRequirement.d.ts +29 -17
- package/lib/cjs/actions/requirements/blue/getBlueAuthorizationRequirement.js +60 -19
- package/lib/cjs/actions/requirements/blue/getUnusedPermit2Nonce.d.ts +48 -0
- package/lib/cjs/actions/requirements/blue/getUnusedPermit2Nonce.js +72 -0
- package/lib/cjs/actions/requirements/blue/index.d.ts +1 -0
- package/lib/cjs/actions/requirements/blue/index.js +1 -0
- package/lib/cjs/actions/requirements/encode/encodeBlueSignatureAuthorization.d.ts +10 -7
- package/lib/cjs/actions/requirements/encode/encodeBlueSignatureAuthorization.js +30 -5
- package/lib/cjs/actions/requirements/encode/encodeErc20Approval.d.ts +2 -1
- package/lib/cjs/actions/requirements/encode/encodeErc20Approval.js +8 -2
- package/lib/cjs/actions/requirements/encode/encodeErc20Permit.d.ts +16 -7
- package/lib/cjs/actions/requirements/encode/encodeErc20Permit.js +39 -6
- package/lib/cjs/actions/requirements/encode/encodeErc20Permit2SignatureTransfer.d.ts +61 -0
- package/lib/cjs/actions/requirements/encode/encodeErc20Permit2SignatureTransfer.js +123 -0
- 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 -0
- package/lib/cjs/actions/requirements/encode/index.js +1 -0
- package/lib/cjs/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit.d.ts +1 -1
- package/lib/cjs/actions/requirements/getRequirementsApproval.d.ts +6 -4
- package/lib/cjs/actions/requirements/getRequirementsApproval.js +6 -4
- package/lib/cjs/actions/signatures/getTokenRequirementActions.d.ts +1 -0
- package/lib/cjs/actions/signatures/getTokenRequirementActions.js +4 -0
- 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/bundler/actions.d.ts +4 -4
- package/lib/cjs/bundler/actions.js +4 -4
- package/lib/cjs/client/morphoViemExtension.d.ts +2 -1
- package/lib/cjs/client/morphoViemExtension.js +2 -1
- package/lib/cjs/entities/blue/blue.d.ts +806 -374
- package/lib/cjs/entities/blue/blue.js +449 -696
- package/lib/cjs/entities/index.d.ts +2 -0
- package/lib/cjs/entities/index.js +15 -0
- package/lib/cjs/entities/midnight/midnight.d.ts +2 -2
- package/lib/cjs/entities/requirements/getBundlesTokenRequirements.d.ts +87 -0
- package/lib/cjs/entities/requirements/getBundlesTokenRequirements.js +203 -0
- 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/computeVaultV1Reallocations.d.ts +3 -9
- package/lib/cjs/helpers/computeVaultV1Reallocations.js +3 -9
- 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 +16 -23
- package/lib/cjs/helpers/validate.js +41 -48
- package/lib/cjs/helpers/validateRequirementSpender.d.ts +2 -1
- package/lib/cjs/helpers/validateRequirementSpender.js +3 -0
- package/lib/cjs/index.d.ts +1 -0
- package/lib/cjs/index.js +1 -0
- package/lib/cjs/types/action.d.ts +303 -210
- package/lib/cjs/types/action.js +29 -2
- package/lib/cjs/types/client.d.ts +9 -0
- package/lib/cjs/types/error.d.ts +193 -18
- package/lib/cjs/types/error.js +267 -24
- package/lib/cjs/types/sharedLiquidity.d.ts +0 -7
- package/lib/esm/abis.d.ts +210 -0
- package/lib/esm/abis.js +140 -0
- package/lib/esm/actions/blue/borrow.d.ts +62 -61
- package/lib/esm/actions/blue/borrow.js +48 -80
- package/lib/esm/actions/blue/common.d.ts +86 -0
- package/lib/esm/actions/blue/common.js +193 -0
- package/lib/esm/actions/blue/refinance.d.ts +72 -112
- package/lib/esm/actions/blue/refinance.js +98 -200
- package/lib/esm/actions/blue/repay.d.ts +72 -68
- package/lib/esm/actions/blue/repay.js +56 -118
- package/lib/esm/actions/blue/repayWithdrawCollateral.d.ts +85 -90
- package/lib/esm/actions/blue/repayWithdrawCollateral.js +149 -138
- package/lib/esm/actions/blue/supply.d.ts +62 -45
- package/lib/esm/actions/blue/supply.js +94 -70
- package/lib/esm/actions/blue/supplyCollateral.d.ts +63 -40
- package/lib/esm/actions/blue/supplyCollateral.js +52 -69
- package/lib/esm/actions/blue/supplyCollateralBorrow.d.ts +82 -90
- package/lib/esm/actions/blue/supplyCollateralBorrow.js +134 -121
- package/lib/esm/actions/blue/withdraw.d.ts +68 -79
- package/lib/esm/actions/blue/withdraw.js +100 -96
- package/lib/esm/actions/blue/withdrawCollateral.d.ts +56 -28
- package/lib/esm/actions/blue/withdrawCollateral.js +45 -50
- 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 +2 -1
- 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/getBlueAuthorizationRequirement.d.ts +29 -17
- package/lib/esm/actions/requirements/blue/getBlueAuthorizationRequirement.js +63 -22
- package/lib/esm/actions/requirements/blue/getUnusedPermit2Nonce.d.ts +48 -0
- package/lib/esm/actions/requirements/blue/getUnusedPermit2Nonce.js +68 -0
- package/lib/esm/actions/requirements/blue/index.d.ts +1 -0
- package/lib/esm/actions/requirements/blue/index.js +1 -0
- package/lib/esm/actions/requirements/encode/encodeBlueSignatureAuthorization.d.ts +10 -7
- package/lib/esm/actions/requirements/encode/encodeBlueSignatureAuthorization.js +31 -6
- package/lib/esm/actions/requirements/encode/encodeErc20Approval.d.ts +2 -1
- package/lib/esm/actions/requirements/encode/encodeErc20Approval.js +9 -3
- package/lib/esm/actions/requirements/encode/encodeErc20Permit.d.ts +16 -7
- package/lib/esm/actions/requirements/encode/encodeErc20Permit.js +40 -7
- package/lib/esm/actions/requirements/encode/encodeErc20Permit2SignatureTransfer.d.ts +61 -0
- package/lib/esm/actions/requirements/encode/encodeErc20Permit2SignatureTransfer.js +119 -0
- 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 -0
- package/lib/esm/actions/requirements/encode/index.js +1 -0
- package/lib/esm/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit.d.ts +1 -1
- package/lib/esm/actions/requirements/getRequirementsApproval.d.ts +6 -4
- package/lib/esm/actions/requirements/getRequirementsApproval.js +6 -4
- package/lib/esm/actions/signatures/getTokenRequirementActions.d.ts +1 -0
- package/lib/esm/actions/signatures/getTokenRequirementActions.js +5 -1
- 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/bundler/actions.d.ts +4 -4
- package/lib/esm/bundler/actions.js +4 -4
- package/lib/esm/client/morphoViemExtension.d.ts +2 -1
- package/lib/esm/client/morphoViemExtension.js +2 -1
- package/lib/esm/entities/blue/blue.d.ts +806 -374
- package/lib/esm/entities/blue/blue.js +455 -702
- package/lib/esm/entities/index.d.ts +2 -0
- package/lib/esm/entities/index.js +1 -0
- package/lib/esm/entities/midnight/midnight.d.ts +2 -2
- package/lib/esm/entities/requirements/getBundlesTokenRequirements.d.ts +87 -0
- package/lib/esm/entities/requirements/getBundlesTokenRequirements.js +199 -0
- 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/computeVaultV1Reallocations.d.ts +3 -9
- package/lib/esm/helpers/computeVaultV1Reallocations.js +3 -9
- 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 +16 -23
- package/lib/esm/helpers/validate.js +40 -48
- package/lib/esm/helpers/validateRequirementSpender.d.ts +2 -1
- package/lib/esm/helpers/validateRequirementSpender.js +3 -0
- package/lib/esm/index.d.ts +1 -0
- package/lib/esm/index.js +1 -0
- package/lib/esm/types/action.d.ts +303 -210
- package/lib/esm/types/action.js +28 -2
- package/lib/esm/types/client.d.ts +9 -0
- package/lib/esm/types/error.d.ts +193 -18
- package/lib/esm/types/error.js +252 -21
- package/lib/esm/types/sharedLiquidity.d.ts +0 -7
- package/package.json +6 -5
- package/lib/cjs/actions/blue/buildAssetFundingActions.d.ts +0 -47
- package/lib/cjs/actions/blue/buildAssetFundingActions.js +0 -63
- package/lib/cjs/actions/blue/buildReallocationActions.d.ts +0 -69
- package/lib/cjs/actions/blue/buildReallocationActions.js +0 -141
- package/lib/cjs/actions/blue/resolveRepayFunding.d.ts +0 -66
- package/lib/cjs/actions/blue/resolveRepayFunding.js +0 -85
- package/lib/esm/actions/blue/buildAssetFundingActions.d.ts +0 -47
- package/lib/esm/actions/blue/buildAssetFundingActions.js +0 -59
- package/lib/esm/actions/blue/buildReallocationActions.d.ts +0 -69
- package/lib/esm/actions/blue/buildReallocationActions.js +0 -135
- package/lib/esm/actions/blue/resolveRepayFunding.d.ts +0 -66
- package/lib/esm/actions/blue/resolveRepayFunding.js +0 -81
|
@@ -28,6 +28,7 @@ PreLiquidationPosition, Token, User as BlueUser,
|
|
|
28
28
|
User, Vault, VaultConfig, VaultMarketAllocation, VaultMarketConfig, VaultMarketPublicAllocatorConfig, VaultToken, VaultUser, VaultV2, VaultV2Adapter, VaultV2BlueMarketPublicAllocatorConfig, VaultV2BluePublicAllocatorConfig, VaultV2MorphoMarketV1Adapter, VaultV2MorphoMarketV1AdapterV2, VaultV2MorphoVaultV1Adapter, WrappedToken, } from "@morpho-org/blue-sdk";
|
|
29
29
|
export type { BuildOfferParams as MidnightBuildOfferParams, CollateralParams as MidnightCollateralParams, GroupInput as MidnightGroupInput, IAccrualPosition as IMidnightAccrualPosition, ICollateralParams as IMidnightCollateralParams, IGroup as IMidnightGroup, IMarket as IMidnightMarket, IMarketParams as IMidnightMarketParams, IOffer as IMidnightOffer, IPosition as IMidnightPosition, MarketInput as MidnightMarketInput, OfferStruct as MidnightOfferStruct, RatifierTreeInput as MidnightRatifierTreeInput, SettlementFeeCbps as MidnightSettlementFeeCbps, TreeCreateParams as MidnightTreeCreateParams, TreeDescriptor as MidnightTreeDescriptor, TreeInput as MidnightTreeInput, TreeLike as MidnightTreeLike, TreeMempoolValidateParams as MidnightTreeMempoolValidateParams, TreeMempoolValidateRatification as MidnightTreeMempoolValidateRatification, TreeProof as MidnightTreeProof, } from "@morpho-org/midnight-sdk";
|
|
30
30
|
export { AccrualPosition as MidnightAccrualPosition, Group as MidnightGroup, Market as MidnightMarket, MarketParams as MidnightMarketParams, Offer as MidnightOffer, Position as MidnightPosition, Tree as MidnightTree, } from "@morpho-org/midnight-sdk";
|
|
31
|
+
export type { BlueActions, BlueTokenRequirementsParams, } from "./blue/index.js";
|
|
31
32
|
export { MorphoBlue } from "./blue/index.js";
|
|
32
33
|
export type { GetOffersDataParams as MidnightGetOffersDataParams,
|
|
33
34
|
/** @deprecated Use `MidnightGetOffersDataParams`. */
|
|
@@ -61,6 +62,7 @@ TakeBorrowParams, TakeLendParams as MidnightTakeLendParams,
|
|
|
61
62
|
/** @deprecated Use `MidnightTakeLendParams`. */
|
|
62
63
|
TakeLendParams, } from "./midnight/index.js";
|
|
63
64
|
export { type MidnightActionOutput, type MidnightActionSignatures, type MidnightActions, MorphoMidnight, } from "./midnight/index.js";
|
|
65
|
+
export * from "./requirements/index.js";
|
|
64
66
|
export { MorphoVaultV1 } from "./vaultV1/index.js";
|
|
65
67
|
export { type InputReallocationData, type InputVaultV1ReallocationData, ReallocationData, VaultV1ReallocationData, } from "./vaultV1ReallocationData.js";
|
|
66
68
|
export { MorphoVaultV2 } from "./vaultV2/index.js";
|
|
@@ -16,6 +16,7 @@ User, Vault, VaultConfig, VaultMarketAllocation, VaultMarketConfig, VaultMarketP
|
|
|
16
16
|
export { AccrualPosition as MidnightAccrualPosition, Group as MidnightGroup, Market as MidnightMarket, MarketParams as MidnightMarketParams, Offer as MidnightOffer, Position as MidnightPosition, Tree as MidnightTree, } from "@morpho-org/midnight-sdk";
|
|
17
17
|
export { MorphoBlue } from "./blue/index.js";
|
|
18
18
|
export { MorphoMidnight, } from "./midnight/index.js";
|
|
19
|
+
export * from "./requirements/index.js";
|
|
19
20
|
export { MorphoVaultV1 } from "./vaultV1/index.js";
|
|
20
21
|
export { ReallocationData, VaultV1ReallocationData, } from "./vaultV1ReallocationData.js";
|
|
21
22
|
export { MorphoVaultV2 } from "./vaultV2/index.js";
|
|
@@ -20,8 +20,8 @@ import type { GetOffersDataParams, GetPositionDataParams, MakeLendParams, MakeOf
|
|
|
20
20
|
* const output = midnight.takeLend({
|
|
21
21
|
* accountAddress: lender,
|
|
22
22
|
* marketData,
|
|
23
|
-
* assets:
|
|
24
|
-
* minUnits:
|
|
23
|
+
* assets: 1_000_000n,
|
|
24
|
+
* minUnits: 900_000n,
|
|
25
25
|
* takeableOffers: quote.data.takeableOffers,
|
|
26
26
|
* deadline: maxUint256,
|
|
27
27
|
* });
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { type Address, type Client } from "viem";
|
|
2
|
+
import { type BundlesTokenSignatureRequirement, type ERC20ApprovalAction, type Transaction } from "../../types/index.js";
|
|
3
|
+
/** Parameters for {@link getBundlesTokenRequirements}. */
|
|
4
|
+
export interface GetBundlesTokenRequirementsParams {
|
|
5
|
+
/** ERC-20 token funded by the operation. */
|
|
6
|
+
readonly token: Address;
|
|
7
|
+
/** Registered fixed bundles contract that pulls the token. */
|
|
8
|
+
readonly spender: Address;
|
|
9
|
+
/** Exact amount the bundles contract will pull. */
|
|
10
|
+
readonly amount: bigint;
|
|
11
|
+
/** Classic approval amount; defaults to the exact pull amount. */
|
|
12
|
+
readonly approvalAmount?: bigint;
|
|
13
|
+
/** Account funding the operation. */
|
|
14
|
+
readonly owner: Address;
|
|
15
|
+
/** Target chain id. */
|
|
16
|
+
readonly chainId: number;
|
|
17
|
+
/** Final-call and signature deadline. */
|
|
18
|
+
readonly deadline: bigint;
|
|
19
|
+
/** Whether the caller can collect offchain token signatures. */
|
|
20
|
+
readonly supportSignature: boolean;
|
|
21
|
+
/** Whether token metadata reads may use deployless aggregation. */
|
|
22
|
+
readonly supportDeployless?: boolean;
|
|
23
|
+
/** Prefer ERC-2612 when the token exposes a compatible nonce. */
|
|
24
|
+
readonly useSimplePermit?: boolean;
|
|
25
|
+
/** Explicit unused Permit2 SignatureTransfer unordered nonce. */
|
|
26
|
+
readonly permit2Nonce?: bigint;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Resolves direct approval, ERC-2612, or Permit2 SignatureTransfer prerequisites for
|
|
30
|
+
* a registered fixed bundles contract.
|
|
31
|
+
*
|
|
32
|
+
* Reads only the allowance and nonce state required by the selected path. Permit2 keeps the
|
|
33
|
+
* ERC-20 allowance on canonical Permit2 while the one-time signed transfer names the bundles contract
|
|
34
|
+
* as spender. Permit2 SignatureTransfer requires an explicit unused unordered nonce so concurrent
|
|
35
|
+
* requirements never silently sign the same owner-global nonce.
|
|
36
|
+
*
|
|
37
|
+
* @param viemClient - Connected viem client used for allowance and nonce reads.
|
|
38
|
+
* @param params - Token requirement parameters.
|
|
39
|
+
* @param params.token - ERC-20 token funded by the operation.
|
|
40
|
+
* @param params.spender - Registered fixed bundles contract that pulls the token.
|
|
41
|
+
* @param params.amount - Exact amount the contract will pull; zero returns no requirements.
|
|
42
|
+
* @param params.approvalAmount - Classic approval amount; defaults to `amount` and is ignored by signature paths.
|
|
43
|
+
* @param params.owner - Account funding the operation.
|
|
44
|
+
* @param params.chainId - Target chain id; must match the client chain.
|
|
45
|
+
* @param params.deadline - Final-call and signature deadline.
|
|
46
|
+
* @param params.supportSignature - Whether ERC-2612 or Permit2 signatures may be requested.
|
|
47
|
+
* @param params.supportDeployless - Whether ERC-2612 metadata reads may use deployless calls.
|
|
48
|
+
* @param params.useSimplePermit - Prefer ERC-2612 when its nonce probe succeeds.
|
|
49
|
+
* @param params.permit2Nonce - Explicit unused uint256 nonce required when Permit2 is selected.
|
|
50
|
+
* @returns Ordered deep-frozen approval transactions and/or signable token requirements.
|
|
51
|
+
* @throws {ChainIdMismatchError} when the connected client targets another chain.
|
|
52
|
+
* @throws {NegativeInputError} when `amount` or `permit2Nonce` is negative.
|
|
53
|
+
* @throws {NonPositiveInputError} when `deadline` is not positive.
|
|
54
|
+
* @throws {ExpiredDeadlineError} when `deadline` is positive but not in the future.
|
|
55
|
+
* @throws {UnsupportedChainIdError} when the chain is absent from the address registry.
|
|
56
|
+
* @throws {UnsupportedErc20ApprovalSpenderError} when `spender` is not the chain's registered
|
|
57
|
+
* BlueBundlesV1 or VaultBundlesV1 deployment, including for a zero-amount request.
|
|
58
|
+
* @throws {MissingPermit2SignatureTransferNonceError} when Permit2 is selected without a nonce.
|
|
59
|
+
* @throws {Permit2SignatureTransferNonceAlreadyUsedError} when `permit2Nonce` is already consumed.
|
|
60
|
+
* @throws {InputExceedsMaxError} when `amount`, `deadline`, or `permit2Nonce` exceeds uint256.
|
|
61
|
+
* @throws {ApprovalAmountLessThanSpendAmountError} when `approvalAmount` is below `amount`.
|
|
62
|
+
* @throws {viem.BaseError} when a required allowance, Permit2 nonce-bitmap, or ERC-2612 metadata
|
|
63
|
+
* read fails. A failed ERC-2612 nonce probe alone falls back to Permit2 or classic approval.
|
|
64
|
+
* @example
|
|
65
|
+
* ```ts
|
|
66
|
+
* import { addressesRegistry } from "@morpho-org/blue-sdk";
|
|
67
|
+
* import { getChainAddress } from "@morpho-org/morpho-ts";
|
|
68
|
+
* import { createPublicClient, http, zeroAddress } from "viem";
|
|
69
|
+
* import { mainnet } from "viem/chains";
|
|
70
|
+
* import { getBundlesTokenRequirements } from "@morpho-org/morpho-sdk";
|
|
71
|
+
*
|
|
72
|
+
* const client = createPublicClient({ chain: mainnet, transport: http() });
|
|
73
|
+
* const vaultBundlesV1 = getChainAddress(mainnet.id, "bundles.vaultBundlesV1");
|
|
74
|
+
* const requirements = await getBundlesTokenRequirements(client, {
|
|
75
|
+
* token: addressesRegistry[mainnet.id].usdc,
|
|
76
|
+
* spender: vaultBundlesV1,
|
|
77
|
+
* amount: 1_000_000n,
|
|
78
|
+
* owner: zeroAddress,
|
|
79
|
+
* chainId: mainnet.id,
|
|
80
|
+
* deadline: 1_900_000_000n,
|
|
81
|
+
* supportSignature: true,
|
|
82
|
+
* permit2Nonce: 42n,
|
|
83
|
+
* });
|
|
84
|
+
* // requirements contains approvals and/or signable bundles token requirements.
|
|
85
|
+
* ```
|
|
86
|
+
*/
|
|
87
|
+
export declare const getBundlesTokenRequirements: (viemClient: Client, params: GetBundlesTokenRequirementsParams) => Promise<readonly (Readonly<Transaction<ERC20ApprovalAction>> | BundlesTokenSignatureRequirement)[]>;
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import { getChainAddresses } from "@morpho-org/blue-sdk";
|
|
2
|
+
import { erc2612Abi, permit2Abi } from "@morpho-org/blue-sdk-viem";
|
|
3
|
+
import { isDefined, Time } from "@morpho-org/morpho-ts";
|
|
4
|
+
import { erc20Abi, isAddressEqual, maxUint256, } from "viem";
|
|
5
|
+
import { readContract } from "viem/actions";
|
|
6
|
+
import { resolveBundlesTokenRequirements } from "../../actions/bundles/index.js";
|
|
7
|
+
import { encodeErc20Permit } from "../../actions/requirements/encode/encodeErc20Permit.js";
|
|
8
|
+
import { validateChainId, validateRequirementSpender, } from "../../helpers/index.js";
|
|
9
|
+
import { ApprovalAmountLessThanSpendAmountError, ExpiredDeadlineError, InputExceedsMaxError, MissingPermit2SignatureTransferNonceError, NegativeInputError, NonPositiveInputError, } from "../../types/index.js";
|
|
10
|
+
/**
|
|
11
|
+
* Resolves direct approval, ERC-2612, or Permit2 SignatureTransfer prerequisites for
|
|
12
|
+
* a registered fixed bundles contract.
|
|
13
|
+
*
|
|
14
|
+
* Reads only the allowance and nonce state required by the selected path. Permit2 keeps the
|
|
15
|
+
* ERC-20 allowance on canonical Permit2 while the one-time signed transfer names the bundles contract
|
|
16
|
+
* as spender. Permit2 SignatureTransfer requires an explicit unused unordered nonce so concurrent
|
|
17
|
+
* requirements never silently sign the same owner-global nonce.
|
|
18
|
+
*
|
|
19
|
+
* @param viemClient - Connected viem client used for allowance and nonce reads.
|
|
20
|
+
* @param params - Token requirement parameters.
|
|
21
|
+
* @param params.token - ERC-20 token funded by the operation.
|
|
22
|
+
* @param params.spender - Registered fixed bundles contract that pulls the token.
|
|
23
|
+
* @param params.amount - Exact amount the contract will pull; zero returns no requirements.
|
|
24
|
+
* @param params.approvalAmount - Classic approval amount; defaults to `amount` and is ignored by signature paths.
|
|
25
|
+
* @param params.owner - Account funding the operation.
|
|
26
|
+
* @param params.chainId - Target chain id; must match the client chain.
|
|
27
|
+
* @param params.deadline - Final-call and signature deadline.
|
|
28
|
+
* @param params.supportSignature - Whether ERC-2612 or Permit2 signatures may be requested.
|
|
29
|
+
* @param params.supportDeployless - Whether ERC-2612 metadata reads may use deployless calls.
|
|
30
|
+
* @param params.useSimplePermit - Prefer ERC-2612 when its nonce probe succeeds.
|
|
31
|
+
* @param params.permit2Nonce - Explicit unused uint256 nonce required when Permit2 is selected.
|
|
32
|
+
* @returns Ordered deep-frozen approval transactions and/or signable token requirements.
|
|
33
|
+
* @throws {ChainIdMismatchError} when the connected client targets another chain.
|
|
34
|
+
* @throws {NegativeInputError} when `amount` or `permit2Nonce` is negative.
|
|
35
|
+
* @throws {NonPositiveInputError} when `deadline` is not positive.
|
|
36
|
+
* @throws {ExpiredDeadlineError} when `deadline` is positive but not in the future.
|
|
37
|
+
* @throws {UnsupportedChainIdError} when the chain is absent from the address registry.
|
|
38
|
+
* @throws {UnsupportedErc20ApprovalSpenderError} when `spender` is not the chain's registered
|
|
39
|
+
* BlueBundlesV1 or VaultBundlesV1 deployment, including for a zero-amount request.
|
|
40
|
+
* @throws {MissingPermit2SignatureTransferNonceError} when Permit2 is selected without a nonce.
|
|
41
|
+
* @throws {Permit2SignatureTransferNonceAlreadyUsedError} when `permit2Nonce` is already consumed.
|
|
42
|
+
* @throws {InputExceedsMaxError} when `amount`, `deadline`, or `permit2Nonce` exceeds uint256.
|
|
43
|
+
* @throws {ApprovalAmountLessThanSpendAmountError} when `approvalAmount` is below `amount`.
|
|
44
|
+
* @throws {viem.BaseError} when a required allowance, Permit2 nonce-bitmap, or ERC-2612 metadata
|
|
45
|
+
* read fails. A failed ERC-2612 nonce probe alone falls back to Permit2 or classic approval.
|
|
46
|
+
* @example
|
|
47
|
+
* ```ts
|
|
48
|
+
* import { addressesRegistry } from "@morpho-org/blue-sdk";
|
|
49
|
+
* import { getChainAddress } from "@morpho-org/morpho-ts";
|
|
50
|
+
* import { createPublicClient, http, zeroAddress } from "viem";
|
|
51
|
+
* import { mainnet } from "viem/chains";
|
|
52
|
+
* import { getBundlesTokenRequirements } from "@morpho-org/morpho-sdk";
|
|
53
|
+
*
|
|
54
|
+
* const client = createPublicClient({ chain: mainnet, transport: http() });
|
|
55
|
+
* const vaultBundlesV1 = getChainAddress(mainnet.id, "bundles.vaultBundlesV1");
|
|
56
|
+
* const requirements = await getBundlesTokenRequirements(client, {
|
|
57
|
+
* token: addressesRegistry[mainnet.id].usdc,
|
|
58
|
+
* spender: vaultBundlesV1,
|
|
59
|
+
* amount: 1_000_000n,
|
|
60
|
+
* owner: zeroAddress,
|
|
61
|
+
* chainId: mainnet.id,
|
|
62
|
+
* deadline: 1_900_000_000n,
|
|
63
|
+
* supportSignature: true,
|
|
64
|
+
* permit2Nonce: 42n,
|
|
65
|
+
* });
|
|
66
|
+
* // requirements contains approvals and/or signable bundles token requirements.
|
|
67
|
+
* ```
|
|
68
|
+
*/
|
|
69
|
+
export const getBundlesTokenRequirements = async (viemClient, params) => {
|
|
70
|
+
validateChainId(viemClient.chain?.id, params.chainId);
|
|
71
|
+
validateRequirementSpender({
|
|
72
|
+
chainId: params.chainId,
|
|
73
|
+
spender: params.spender,
|
|
74
|
+
allowed: ["blueBundlesV1", "vaultBundlesV1"],
|
|
75
|
+
});
|
|
76
|
+
if (params.amount < 0n) {
|
|
77
|
+
throw new NegativeInputError("amount", params.amount);
|
|
78
|
+
}
|
|
79
|
+
// Reject oversized inputs before any RPC read so this resolver never asks the user to sign or
|
|
80
|
+
// submit an approval/permit that the eventual BlueBundlesV1 call (uint256 ABI) would reject.
|
|
81
|
+
if (params.amount > maxUint256) {
|
|
82
|
+
throw new InputExceedsMaxError({
|
|
83
|
+
field: "amount",
|
|
84
|
+
value: params.amount,
|
|
85
|
+
max: maxUint256,
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
if (params.deadline <= 0n) {
|
|
89
|
+
throw new NonPositiveInputError("deadline", params.deadline);
|
|
90
|
+
}
|
|
91
|
+
if (params.deadline > maxUint256) {
|
|
92
|
+
throw new InputExceedsMaxError({
|
|
93
|
+
field: "deadline",
|
|
94
|
+
value: params.deadline,
|
|
95
|
+
max: maxUint256,
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
// Reject an already-expired deadline before the RPC reads so a direct caller of this resolver
|
|
99
|
+
// never signs a permit for a supply the BlueBundlesV1 call would revert. The entity validates
|
|
100
|
+
// this too, but the exported resolver must guard its own callers.
|
|
101
|
+
const timestamp = Time.timestamp();
|
|
102
|
+
if (params.deadline <= timestamp) {
|
|
103
|
+
throw new ExpiredDeadlineError(params.deadline, timestamp);
|
|
104
|
+
}
|
|
105
|
+
if (params.amount === 0n)
|
|
106
|
+
return [];
|
|
107
|
+
const { permit2, dai } = getChainAddresses(params.chainId);
|
|
108
|
+
if (params.supportSignature) {
|
|
109
|
+
const isDai = isDefined(dai) && isAddressEqual(params.token, dai);
|
|
110
|
+
if (params.useSimplePermit && !isDai) {
|
|
111
|
+
const nonce = await readContract(viemClient, {
|
|
112
|
+
abi: erc2612Abi,
|
|
113
|
+
address: params.token,
|
|
114
|
+
functionName: "nonces",
|
|
115
|
+
args: [params.owner],
|
|
116
|
+
}).catch(() => undefined);
|
|
117
|
+
if (isDefined(nonce)) {
|
|
118
|
+
return [
|
|
119
|
+
await encodeErc20Permit(viemClient, {
|
|
120
|
+
token: params.token,
|
|
121
|
+
spender: params.spender,
|
|
122
|
+
amount: params.amount,
|
|
123
|
+
chainId: params.chainId,
|
|
124
|
+
nonce,
|
|
125
|
+
deadline: params.deadline,
|
|
126
|
+
supportDeployless: params.supportDeployless,
|
|
127
|
+
}),
|
|
128
|
+
];
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
if (permit2 != null) {
|
|
132
|
+
if (params.permit2Nonce == null) {
|
|
133
|
+
throw new MissingPermit2SignatureTransferNonceError();
|
|
134
|
+
}
|
|
135
|
+
if (params.permit2Nonce < 0n) {
|
|
136
|
+
throw new NegativeInputError("permit2Nonce", params.permit2Nonce);
|
|
137
|
+
}
|
|
138
|
+
if (params.permit2Nonce > maxUint256) {
|
|
139
|
+
throw new InputExceedsMaxError({
|
|
140
|
+
field: "permit2Nonce",
|
|
141
|
+
value: params.permit2Nonce,
|
|
142
|
+
max: maxUint256,
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
const wordPosition = params.permit2Nonce >> 8n;
|
|
146
|
+
const [allowance, nonceBitmap] = await Promise.all([
|
|
147
|
+
readContract(viemClient, {
|
|
148
|
+
abi: erc20Abi,
|
|
149
|
+
address: params.token,
|
|
150
|
+
functionName: "allowance",
|
|
151
|
+
args: [params.owner, permit2],
|
|
152
|
+
}),
|
|
153
|
+
readContract(viemClient, {
|
|
154
|
+
abi: permit2Abi,
|
|
155
|
+
address: permit2,
|
|
156
|
+
functionName: "nonceBitmap",
|
|
157
|
+
args: [params.owner, wordPosition],
|
|
158
|
+
}),
|
|
159
|
+
]);
|
|
160
|
+
return resolveBundlesTokenRequirements({
|
|
161
|
+
token: params.token,
|
|
162
|
+
spender: params.spender,
|
|
163
|
+
owner: params.owner,
|
|
164
|
+
chainId: params.chainId,
|
|
165
|
+
amount: params.amount,
|
|
166
|
+
deadline: params.deadline,
|
|
167
|
+
state: {
|
|
168
|
+
type: "permit2SignatureTransfer",
|
|
169
|
+
permit2Allowance: allowance,
|
|
170
|
+
permit2Nonce: params.permit2Nonce,
|
|
171
|
+
nonceBitmap,
|
|
172
|
+
},
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
const approvalAmount = params.approvalAmount ?? params.amount;
|
|
177
|
+
if (approvalAmount < params.amount) {
|
|
178
|
+
throw new ApprovalAmountLessThanSpendAmountError();
|
|
179
|
+
}
|
|
180
|
+
const allowance = await readContract(viemClient, {
|
|
181
|
+
abi: erc20Abi,
|
|
182
|
+
address: params.token,
|
|
183
|
+
functionName: "allowance",
|
|
184
|
+
args: [params.owner, params.spender],
|
|
185
|
+
});
|
|
186
|
+
return resolveBundlesTokenRequirements({
|
|
187
|
+
token: params.token,
|
|
188
|
+
spender: params.spender,
|
|
189
|
+
owner: params.owner,
|
|
190
|
+
chainId: params.chainId,
|
|
191
|
+
amount: params.amount,
|
|
192
|
+
deadline: params.deadline,
|
|
193
|
+
state: {
|
|
194
|
+
type: "approval",
|
|
195
|
+
allowance,
|
|
196
|
+
approvalAmount,
|
|
197
|
+
},
|
|
198
|
+
});
|
|
199
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Token } from "@morpho-org/blue-sdk";
|
|
2
|
+
import type { Address, Client } from "viem";
|
|
3
|
+
import { type ActionRequirement } from "../../types/index.js";
|
|
4
|
+
/**
|
|
5
|
+
* Resolves the exact vault-share approval or ERC-2612 requirement for a VaultBundlesV1 exit.
|
|
6
|
+
*
|
|
7
|
+
* The exit burns however many shares the vault prices at execution time, so the share allowance is
|
|
8
|
+
* the only cap on that burn. A leftover allowance above `requiredShareAllowance` therefore does not
|
|
9
|
+
* satisfy the requirement: it is replaced by an approval or permit for exactly the computed cap.
|
|
10
|
+
*
|
|
11
|
+
* @internal
|
|
12
|
+
*
|
|
13
|
+
* @param viemClient - Client used to read the current share allowance and permit nonce.
|
|
14
|
+
* @param params - Vault snapshot, owner, exact allowance, and deadline values.
|
|
15
|
+
* @returns No requirement when the allowance already equals `requiredShareAllowance`, otherwise one
|
|
16
|
+
* permit or approval that sets it to exactly that cap.
|
|
17
|
+
* @throws {ExpiredDeadlineError} when the bundles deadline has elapsed.
|
|
18
|
+
* @throws {viem.BaseError} when an allowance or nonce read fails.
|
|
19
|
+
*/
|
|
20
|
+
export declare const getVaultBundlesSharesRequirements: (viemClient: Client, params: {
|
|
21
|
+
readonly vaultData: Token;
|
|
22
|
+
readonly version: "vaultV1" | "vaultV2";
|
|
23
|
+
readonly owner: Address;
|
|
24
|
+
readonly chainId: number;
|
|
25
|
+
readonly requiredShareAllowance: bigint;
|
|
26
|
+
readonly deadline: bigint;
|
|
27
|
+
readonly supportSignature: boolean;
|
|
28
|
+
}) => Promise<readonly ActionRequirement[]>;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { erc2612Abi } from "@morpho-org/blue-sdk-viem";
|
|
2
|
+
import { getChainAddress, Time } from "@morpho-org/morpho-ts";
|
|
3
|
+
import { erc20Abi } from "viem";
|
|
4
|
+
import { readContract } from "viem/actions";
|
|
5
|
+
import { encodeErc20Approval, encodeVaultSharesPermit, } from "../../actions/index.js";
|
|
6
|
+
import { validateChainId } from "../../helpers/index.js";
|
|
7
|
+
import { ExpiredDeadlineError, } from "../../types/index.js";
|
|
8
|
+
/**
|
|
9
|
+
* Resolves the exact vault-share approval or ERC-2612 requirement for a VaultBundlesV1 exit.
|
|
10
|
+
*
|
|
11
|
+
* The exit burns however many shares the vault prices at execution time, so the share allowance is
|
|
12
|
+
* the only cap on that burn. A leftover allowance above `requiredShareAllowance` therefore does not
|
|
13
|
+
* satisfy the requirement: it is replaced by an approval or permit for exactly the computed cap.
|
|
14
|
+
*
|
|
15
|
+
* @internal
|
|
16
|
+
*
|
|
17
|
+
* @param viemClient - Client used to read the current share allowance and permit nonce.
|
|
18
|
+
* @param params - Vault snapshot, owner, exact allowance, and deadline values.
|
|
19
|
+
* @returns No requirement when the allowance already equals `requiredShareAllowance`, otherwise one
|
|
20
|
+
* permit or approval that sets it to exactly that cap.
|
|
21
|
+
* @throws {ExpiredDeadlineError} when the bundles deadline has elapsed.
|
|
22
|
+
* @throws {viem.BaseError} when an allowance or nonce read fails.
|
|
23
|
+
*/
|
|
24
|
+
export const getVaultBundlesSharesRequirements = async (viemClient, params) => {
|
|
25
|
+
validateChainId(viemClient.chain?.id, params.chainId);
|
|
26
|
+
const now = Time.timestamp();
|
|
27
|
+
if (params.deadline <= now) {
|
|
28
|
+
throw new ExpiredDeadlineError(params.deadline, now);
|
|
29
|
+
}
|
|
30
|
+
const spender = getChainAddress(params.chainId, "bundles.vaultBundlesV1");
|
|
31
|
+
const allowance = await readContract(viemClient, {
|
|
32
|
+
address: params.vaultData.address,
|
|
33
|
+
abi: erc20Abi,
|
|
34
|
+
functionName: "allowance",
|
|
35
|
+
args: [params.owner, spender],
|
|
36
|
+
});
|
|
37
|
+
// Asset-mode withdrawals carry no onchain share cap, so the allowance itself is the cap. A
|
|
38
|
+
// larger leftover allowance would let a share-price loss burn past `requiredShareAllowance`,
|
|
39
|
+
// so only an exact match skips the approval or permit that resets it to the computed cap.
|
|
40
|
+
if (allowance === params.requiredShareAllowance)
|
|
41
|
+
return [];
|
|
42
|
+
if (params.supportSignature) {
|
|
43
|
+
const nonce = await readContract(viemClient, {
|
|
44
|
+
address: params.vaultData.address,
|
|
45
|
+
abi: erc2612Abi,
|
|
46
|
+
functionName: "nonces",
|
|
47
|
+
args: [params.owner],
|
|
48
|
+
});
|
|
49
|
+
return [
|
|
50
|
+
encodeVaultSharesPermit({
|
|
51
|
+
vault: params.vaultData,
|
|
52
|
+
version: params.version,
|
|
53
|
+
spender,
|
|
54
|
+
owner: params.owner,
|
|
55
|
+
chainId: params.chainId,
|
|
56
|
+
nonce,
|
|
57
|
+
amount: params.requiredShareAllowance,
|
|
58
|
+
deadline: params.deadline,
|
|
59
|
+
}),
|
|
60
|
+
];
|
|
61
|
+
}
|
|
62
|
+
return [
|
|
63
|
+
encodeErc20Approval({
|
|
64
|
+
token: params.vaultData.address,
|
|
65
|
+
spender,
|
|
66
|
+
amount: params.requiredShareAllowance,
|
|
67
|
+
chainId: params.chainId,
|
|
68
|
+
}),
|
|
69
|
+
];
|
|
70
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./getBundlesTokenRequirements.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./getBundlesTokenRequirements.js";
|