### Install and Run Morpho Vaults App Source: https://github.com/morpho-org/earn-basic-app Commands for cloning the repository, installing dependencies, starting the development server, and building the production application. ```shell git clone [repository-url] yarn install yarn dev yarn build ``` -------------------------------- ### Start Development Server Source: https://github.com/morpho-org/earn-basic-app Starts the local development server for the project using Yarn. Assumes dependencies are installed. The application will be accessible at http://localhost:5173. ```shell # Start development server yarn dev ``` -------------------------------- ### Clone Repository and Install Dependencies Source: https://github.com/morpho-org/earn-basic-app Clones the project repository and installs all necessary dependencies using Yarn. Requires Git and Yarn to be installed. ```shell # Clone the repository git clone [repository-url] # Install dependencies yarn install ``` -------------------------------- ### Project Setup and Execution Commands Source: https://github.com/morpho-org/bundler-basic-app Standard commands for cloning the repository, installing dependencies, running the development server, and building the application for production. ```shell git clone [repository-url] yarn install yarn dev yarn build ``` -------------------------------- ### Setup Environment Variables Source: https://github.com/morpho-org/universal-rewards-distributor/tree/main Copies the example environment file to a new file for local configuration. This is a common step before running project commands or tests. ```shell yarn cp .env.example .env ``` -------------------------------- ### Setup Viem Client and SDKs (TypeScript) Source: https://docs.morpho.org/build/earn/tutorials/assets-flow Demonstrates the initial setup for offchain integration using TypeScript, Viem, and Morpho SDKs. It covers installing packages, importing necessary modules, and configuring a Viem wallet client. ```Bash npm install viem @morpho-org/blue-sdk @morpho-org/morpho-ts ``` ```TypeScript import { createWalletClient, http, publicActions, parseUnits } from "viem"; import { privateKeyToAccount } from "viem/accounts"; import { mainnet } from "viem/chains"; import { IMetaMorpho_ABI } from "@morpho-org/morpho-ts"; const vaultAddress = "0x..."; // The vault address const assetAddress = "0x..."; // The vault's underlying asset address const account = privateKeyToAccount("0x..."); // The user's account const client = createWalletClient({ account, chain: mainnet, transport: http(process.env.RPC_URL_MAINNET), }).extend(publicActions); ``` -------------------------------- ### Install OnchainKit Dependencies Source: https://docs.morpho.org/build/earn/guides/base-onchainkit Installs necessary packages for integrating OnchainKit into an existing React project. These include the OnchainKit SDK, Viem for blockchain interaction, Wagmi for React hooks, and React Query for state management. ```bash npm install @coinbase/onchainkit viem wagmi @tanstack/react-query ``` -------------------------------- ### Market Metrics and Position Fetching Example Source: https://docs.morpho.org/tools/offchain/sdks/blue-sdk-viem/ A comprehensive example demonstrating fetching market configuration, market data (utilization, liquidity, APY), and user position details. It includes setting up the viem client and importing necessary SDK components. ```javascript import { AccrualPosition, Market, MarketConfig, MarketId, } from "@morpho-org/blue-sdk"; import "@morpho-org/blue-sdk-viem/lib/augment/MarketConfig"; import { createClient, http } from "viem"; import { mainnet } from "viem/chains"; import "dotenv/config"; import { Time } from "@morpho-org/morpho-ts"; import "@morpho-org/blue-sdk-viem/lib/augment/Market"; import "@morpho-org/blue-sdk-viem/lib/augment/Position"; const client = createClient({ chain: mainnet, transport: http(process.env.RPC_URL_MAINNET), }); const marketId: MarketId = "0xb323495f7e4148be5643a4ea4a8221eef163e4bccfdedc2a6f4696baacbc86cc" as MarketId; async function fetchMarketConfig() { console.log("Fetching market config..."); const config = await MarketConfig.fetch(marketId, client); console.log("Collateral Token:", config.collateralToken); } async function fetchMarketData() { console.log("Fetching market data..."); const market = await Market.fetch(marketId, client); console.log("Market Utilization:", market.utilization); console.log("Market Liquidity:", market.liquidity); console.log("Market APY at Target:", market.apyAtTarget); const accruedMarket = market.accrueInterest(Time.timestamp()); const assets = accruedMarket.toSupplyAssets(BigInt(1e18)); console.log("Supply Assets for 1 Share:", assets); } async function fetchUserPosition() { console.log("Fetching user position..."); const userAddress = "0x7f65e7326F22963e2039734dDfF61958D5d284Ca"; const position = await AccrualPosition.fetch(userAddress, marketId, client); console.log("Borrow Assets:", position.borrowAssets); console.log("Is Position Healthy:", position.isHealthy); console.log("Max Borrowable Assets:", position.maxBorrowableAssets); const accruedPosition = position.accrueInterest(Time.timestamp()); console.log("Accrued Borrow Assets:", accruedPosition.borrowAssets); } async function main() { await fetchMarketConfig(); await fetchMarketData(); await fetchUserPosition(); } main().catch((error) => { console.error("An error occurred:", error); }); ``` -------------------------------- ### Earn Basic App Example Source: https://docs.morpho.org/build/earn/resources/all A minimal yet complete React application example demonstrating interaction with Morpho Vaults. This serves as a practical starting point for building your own applications. ```APIDOC Example Application: earn-basic-app Repository: https://github.com/morpho-org/earn-basic-app Description: A functional React application showcasing basic interactions with Morpho Vaults. Purpose: Provides a concrete example for developers to learn from and adapt. ``` -------------------------------- ### Paperclip OS Example Application Source: https://docs.morpho.org/getting-started/developers/quick-start A complete application implementation showcasing both earn and borrow functionalities within the Morpho ecosystem. This project serves as a practical example for developers building similar applications. ```APIDOC Paperclip OS: Description: Complete application implementation with earn and borrow functionality. Repository: https://github.com/papercliplabs/compound-blue Functionality: - Earn: Integrate yield-generating capabilities. - Borrow: Enable borrowing functionality. Frontend URL: https://www.compound.blue/ Code Access: - Earn & Borrow Code: https://github.com/papercliplabs/compound-blue ``` -------------------------------- ### Clone Repository and Install Dependencies Source: https://docs.morpho.org/curation/tutorials-v2/vault-creation Initial steps to set up the deployment environment by cloning the repository and installing necessary dependencies using Forge. ```shell git clone https://github.com/morpho-org/vault-v2-deployment cd vault-v2-deployment forge install ``` -------------------------------- ### Install Dependencies with npm Source: https://docs.morpho.org/build/borrow/guides/gelato This step involves installing essential packages for integrating Morpho's lending protocol with Gelato's Smart Wallet SDK. It includes libraries for Gelato, Dynamic Labs, Wagmi, and React Query, crucial for building a React application with TypeScript. ```bash npm install @gelatonetwork/smartwallet @dynamic-labs/sdk-react-core @dynamic-labs/wagmi-connector @tanstack/react-query viem wagmi ``` -------------------------------- ### Install Morpho Bundler SDK Source: https://docs.morpho.org/bundlers/tutorials/combine-actions Installs the Morpho Bundler SDK package for viem. This is a prerequisite for using the SDK's encoding functionalities in your project. ```bash yarn add @morpho-org/bundler-sdk-viem ``` -------------------------------- ### Install Blue SDK Viem Dependencies Source: https://docs.morpho.org/tools/offchain/sdks/blue-sdk-viem/ Installs the necessary packages for using the Blue SDK with Viem, including core SDK, Viem integration, Morpho TS types, Viem, and dotenv. ```bash yarn install @morpho-org/blue-sdk @morpho-org/blue-sdk-viem @morpho-org/morpho-ts viem dotenv ``` -------------------------------- ### Install Morpho LLMs Project Dependencies Source: https://github.com/morpho-org/bundler-basic-app Clones the project repository from a given URL and installs all required dependencies using Yarn. Ensure you have Node.js (v16+) and Yarn or npm installed before proceeding. ```shell # Clone the repository git clone [repository-url] # Install dependencies yarn install ``` -------------------------------- ### Lite App Example Application Source: https://docs.morpho.org/getting-started/developers/quick-start A lightweight implementation optimized for minimal resource usage. This example is suitable for environments with limited bandwidth or processing power, showcasing efficient application design. ```APIDOC Lite App: Description: Lightweight implementation for minimal resource usage. Repository: https://github.com/morpho-org/morpho-lite-apps/tree/main/apps/lite Functionality: - Optimized for performance and low resource consumption. Frontend URL: https://lite.morpho.org/ Code Access: - Code: https://github.com/morpho-org/morpho-lite-apps/tree/main/apps/lite ``` -------------------------------- ### Install Bundler SDK and Dependencies Source: https://docs.morpho.org/bundlers/tutorials/integrate Installs the necessary Morpho SDK packages for bundler integration, including the Viem SDK, blue-sdk, and morpho-ts, along with the peer dependency Viem. ```bash yarn add @morpho-org/bundler-sdk-viem @morpho-org/blue-sdk @morpho-org/morpho-ts viem ``` -------------------------------- ### Build Project Source: https://github.com/morpho-org/earn-basic-app Executes the build script for the project using Yarn. ```shell yarn build ``` -------------------------------- ### Example: Supply, Supply Collateral, and Borrow Morpho Actions Source: https://docs.morpho.org/bundlers/tutorials/integrate Demonstrates a practical implementation of bundling multiple Morpho actions into a single transaction. This example specifically covers supplying assets to a market, supplying collateral, and borrowing assets using the `setupBundle` function. ```typescript const { morpho } = addresses[ChainId.EthMainnet]; /** * Executes a series of Morpho operations: supply, supply collateral, and borrow * @param marketId - The ID of the market to interact with * @param client - The wallet client instance * @param simulationState - The current simulation state * @param amountSupply - Amount to supply as lending position * @param amountSupplyCollateral - Amount to supply as collateral * @param amountBorrow - Amount to borrow * @returns Array of transaction responses */ export const supplySupplyCollateralBorrow = async ( marketId: MarketId, client: WalletClient, simulationState: SimulationState, amountSupply: bigint, amountSupplyCollateral: bigint, amountBorrow: bigint ) => { const user = client.account?.address; if (!user) throw new Error("User address is required"); // Placeholder for actual operation creation logic // This would involve creating InputBundlerOperation objects for each action // For example: // const supplyOperation = { // operation: "Blue_Supply", // args: { marketId, amount: amountSupply, onBehalfOf: user }, // address: morpho // }; // const supplyCollateralOperation = { // operation: "Blue_SupplyCollateral", // args: { marketId, amount: amountSupplyCollateral, onBehalfOf: user }, // address: morpho // }; // const borrowOperation = { // operation: "Blue_Borrow", // args: { marketId, amount: amountBorrow, onBehalfOf: user }, // address: morpho // }; // const inputOperations: InputBundlerOperation[] = [ // supplyOperation, // supplyCollateralOperation, // borrowOperation // ]; // return setupBundle(client, simulationState, inputOperations); return []; // Placeholder return }; ``` -------------------------------- ### Install Morpho SDK and Viem Dependencies Source: https://docs.morpho.org/build/borrow/tutorials/assets-flow Installs the necessary packages for interacting with the Morpho Protocol using Viem and the Morpho SDK. This includes the core Viem library, the Morpho Blue SDK, and the Morpho TypeScript types. ```bash npm install viem @morpho-org/blue-sdk @morpho-org/morpho-ts ``` -------------------------------- ### Install Blue SDK and Morpho TS Dependencies Source: https://docs.morpho.org/tools/offchain/sdks/blue-sdk/ Installs the necessary dependencies for the Morpho Blue SDK and the Morpho TS library using yarn. ```bash yarn install @morpho-org/blue-sdk @morpho-org/morpho-ts ``` -------------------------------- ### Install Bundler SDK Source: https://docs.morpho.org/tools/onchain/bundlers/combine-actions Installs the Morpho Bundler SDK package for use with viem or ethers. This is the first step to integrating the SDK into your project for encoding on-chain actions. ```Terminal yarn add @morpho-org/bundler-sdk-viem ``` -------------------------------- ### Full Repay Operation Example Source: https://docs.morpho.org/tools/onchain/bundlers/app-integration Provides an example of a `Blue_Repay` operation for full repayment of a position. It demonstrates the structure of the operation object, including arguments like market ID, shares, sender, and slippage. ```APIDOC Blue_Repay Operation: - Used for full repayment of a borrowed amount. - Example structure: { type: "Blue_Repay", sender: userAddress, address: morpho, args: { id: marketId, shares: position.borrowShares, // Full repayment onBehalf: userAddress, slippage: DEFAULT_SLIPPAGE_TOLERANCE, // Always include slippage }, } ``` -------------------------------- ### Get Historical Market APYs Source: https://docs.morpho.org/build/borrow/tutorials/get-data Retrieve historical time-series data for market supply and borrow APYs. Users can specify start timestamp, end timestamp, and data interval for granular analysis. ```APIDOC query GetHistoricalMarketApys($options: TimeseriesOptions) { weeklyHourlyMarketApys: marketByUniqueKey( uniqueKey: "0x608929d6de2a10bacf1046ff157ae38df5b9f466fb89413211efb8f63c63833a" ) { uniqueKey historicalState { supplyApy(options: $options) { x y } borrowApy(options: $options) { x y } } } } ``` ```APIDOC { "options": { "startTimestamp": 1707749700, "endTimestamp": 1708354500, "interval": "HOUR" } } ``` -------------------------------- ### Example Variables for Historical APY Queries Source: https://docs.morpho.org/tools/offchain/api/morpho-vaults Provides an example JSON object for variables used in historical APY queries. It specifies the start timestamp, end timestamp, and the interval (e.g., DAY) for fetching time-series data. ```APIDOC { "options": { "startTimestamp": 1716249600, "endTimestamp": 1716422400, "interval": "DAY" } } ``` -------------------------------- ### Setup Viem Client and Imports Source: https://docs.morpho.org/tools/offchain/sdks/blue-sdk-viem/ Imports required modules from Blue SDK, Blue SDK Viem, Morpho TS, Viem, and dotenv. Sets up a Viem client connected to the Ethereum mainnet using an RPC URL from environment variables. ```typescript import { AccrualPosition, MarketConfig, MarketId } from "@morpho-org/blue-sdk"; import "@morpho-org/blue-sdk-viem/lib/augment/MarketConfig"; import { createClient, http } from "viem"; import { mainnet } from "viem/chains"; import "dotenv/config"; // Set up the client const client = createClient({ chain: mainnet, transport: http(process.env.RPC_URL_MAINNET), }); ``` -------------------------------- ### Morpho Core SDKs Overview Source: https://docs.morpho.org/tools/offchain/sdks/introduction Describes the foundational, framework-agnostic SDK packages for interacting with Morpho protocols. These packages define core entities and simulation methods. ```typescript /** * @package @morpho-org/blue-sdk * @description Framework-agnostic package defining Morpho-related entity classes (e.g., Market, Token, Vault). */ /** * @package @morpho-org/simulation-sdk * @description Framework-agnostic package defining methods to simulate interactions on Morpho (e.g., Supply, Borrow) and Morpho Vaults (e.g., Deposit, Withdraw). */ /** * @package @morpho-org/blue-api-sdk * @description GraphQL SDK exporting types from the Morpho API's GraphQL schema and an Apollo cache controller. */ ``` -------------------------------- ### Setup and Dependencies (TypeScript) Source: https://docs.morpho.org/build/earn/tutorials/rewards Sets up the necessary environment and dependencies for interacting with Ethereum using `viem`. This includes creating a wallet client connected to a chain and extending it with public actions. ```TypeScript import { createWalletClient, http, publicActions } from "viem"; import { privateKeyToAccount } from "viem/accounts"; import { mainnet } from "viem/chains"; // Replace with the actual user's or relayer's private key const privateKey = "0x..."; const userAddress = "0x0ec553110e53122d1226646670a8475D4C8E6F04"; // Ensure RPC_URL_MAINNET is set in your environment variables const rpcUrl = process.env.RPC_URL_MAINNET; if (!rpcUrl) { throw new Error("RPC_URL_MAINNET environment variable not set."); } const account = privateKeyToAccount(privateKey); const client = createWalletClient({ account, chain: mainnet, transport: http(rpcUrl), }).extend(publicActions); // The 'client' variable is now ready to be used for sending transactions. ``` -------------------------------- ### Delisting an Adapter - Deallocate and Proposal Source: https://docs.morpho.org/curation/tutorials-v2/listing-adapters Guides through the process of delisting an adapter, starting with deallocating all funds and then submitting a proposal to disable the adapter. A critical pre-check ensures no assets are allocated before delisting. ```solidity // 1. Deallocate All Funds vault.deallocate(adapterAddress, data, totalAllocated); // 2. Submit Delisting Proposal (as Curator) bytes memory data = abi.encodeCall(IVaultV2.setIsAdapter, (adapterAddress, false)); vault.submit(data); ``` -------------------------------- ### Run Morpho LLMs Development Server Source: https://github.com/morpho-org/bundler-basic-app Starts the development server for the Morpho LLMs project. After running this command, the application will typically be accessible at http://localhost:5173. ```shell # Start development server yarn dev ``` -------------------------------- ### Reference Implementation Script Source: https://docs.morpho.org/tools/onchain/public-allocator A TypeScript script providing a complete, working example of the Public Allocator integration flow. It demonstrates using the Morpho API and SDKs to manage reallocations, serving as a starting point for developers. ```TypeScript // This is a reference to a script available on GitHub. // The script demonstrates the Public Allocator Integration Flow using Morpho API and SDKs. // It covers querying data, simulating transactions, and executing reallocations. // For the complete code, please refer to the GitHub repository. // Link: https://github.com/morpho-org/public-allocator-scripts/blob/main/scripts/api/apiPublicAllocatorSimulated.ts ``` -------------------------------- ### Complete Morpho Vault Interaction Contract (Solidity) Source: https://docs.morpho.org/build/earn/tutorials/assets-flow A full example contract demonstrating deposit and withdrawal interactions with a Morpho Vault. It includes setup for the vault and asset interfaces and provides functions for depositing and withdrawing all assets. ```Solidity // SPDX-License-Identifier: MIT pragma solidity ^0.8.20; import { IMetaMorpho } from "@morpho-org/metamorpho/src/interfaces/IMetaMorpho.sol"; import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; contract MetaMorphoInteraction { IMetaMorpho public immutable vault; IERC20 public immutable asset; constructor(address _vault) { vault = IMetaMorpho(_vault); asset = IERC20(vault.asset()); } /// @notice Deposits a specified amount of assets into the vault. /// @param amount The amount of underlying assets to deposit. function deposit(uint256 amount) external { asset.approve(address(vault), amount); vault.deposit(amount, msg.sender); } /// @notice Withdraws all assets from the vault for the caller. function withdrawAll() external { uint256 shares = vault.balanceOf(msg.sender); if (shares > 0) { vault.redeem(shares, msg.sender, msg.sender); } } } ``` -------------------------------- ### Bundler Basic App Example Source: https://docs.morpho.org/build/borrow/resources/all A minimal yet complete React application demonstrating how to execute complex borrow-side actions using the Morpho protocol and its associated tools. ```react // This is a conceptual reference to a GitHub repository. // The actual code would be found at: https://github.com/morpho-org/bundler-basic-app ``` -------------------------------- ### Morpho Viem Integrations Source: https://docs.morpho.org/tools/offchain/sdks/introduction Details SDK packages that extend core functionalities with Viem, a modular TypeScript, JavaScript, and Python library for Ethereum. These enable Viem-based fetch methods and transaction bundling. ```typescript /** * @package @morpho-org/blue-sdk-viem * @description Viem-based augmentation of @morpho-org/blue-sdk, exporting Viem-based fetch methods. */ /** * @package @morpho-org/bundler-sdk-viem * @description Viem-based extension of @morpho-org/simulation-sdk for transforming interactions into bundles for the bundler. * @example Blue_Borrow, MetaMorpho_Deposit */ /** * @package @morpho-org/liquidity-sdk-viem * @description Viem-based package for calculating liquidity via the PublicAllocator. */ /** * @package @morpho-org/liquidation-sdk-viem * @description Viem-based package providing utilities for building liquidation bots and examples using Flashbots and Morpho's GraphQL API. */ ``` -------------------------------- ### Install Bundler SDK Source: https://docs.morpho.org/tools/onchain/bundlers/app-integration Installs the bundler package along with its required peer dependencies using Yarn. This includes the bundler SDK, blue SDK, morpho-ts, and Viem. ```bash yarn add @morpho-org/bundler-sdk-viem @morpho-org/blue-sdk @morpho-org/morpho-ts viem ``` -------------------------------- ### Pre-Liquidation Close Factor Recalculation Example Source: https://docs.morpho.org/learn/concepts/liquidation Example calculation of the preLCF when the position's LTV is 84%, using the defined formula and assumed preLCF₁ and preLCF₂ values. ```formula preLCF = \frac{LLTV - LTV}{LLTV - preLLTV} \times preLCF\_1 + \frac{LTV - preLLTV}{LLTV - preLLTV} \times preLCF\_2 \approx 0.12 ``` -------------------------------- ### Example Usage: Fetching and Logging APY Data (TypeScript) Source: https://docs.morpho.org/tools/offchain/sdks/blue-sdk-viem/ Demonstrates how to use the `fetchHistoricalVaultData` and `fetchHistoricalMarketData` functions within an asynchronous main function. It iterates through test cases, fetches APY data for vaults and markets, and logs the results to the console. Error handling is included for robustness. ```typescript async function main() { const testCases = [ { chain: "Base", chainId: 8453, vaultAddress: "0xc1256Ae5FF1cf2719D4937adb3bbCCab2E00A2Ca" as Address, marketId: "0x1c21c59df9db44bf6f645d854ee710a8ca17b479451447e9f56758aee10a2fad" as MarketId, }, ]; for (const test of testCases) { try { console.log(`\nFetching APY data for ${test.chain}...`); // Fetch and log vault APY data const apyData = await fetchHistoricalVaultData( test.vaultAddress, test.chainId ); console.log("Vault APY Data:", { "1D APY": `${apyData.oneDayAPY}%`, "7D APY": `${apyData.sevenDayAPY}%`, "30D APY": `${apyData.thirtyDayAPY}%`, }); // Fetch and log market APY data const marketApyData = await fetchHistoricalMarketData( test.marketId, test.chainId ); console.log("Market APY Data:", { "1D APY": `${marketApyData.oneDayAPY}%`, "7D APY": `${marketApyData.sevenDayAPY}%`, "30D APY": `${marketApyData.thirtyDayAPY}%`, }); } catch (error) { console.error(`Error fetching data for ${test.chain}:`, error); } } } main().catch(console.error); ``` -------------------------------- ### Get Market Liquidity and Debt State Source: https://docs.morpho.org/build/borrow/tutorials/get-data Retrieve the real-time state of liquidity and debt across markets. Supports fetching data for all markets or a specific market by its unique key. ```APIDOC query GetMarketsLiquidityAndDebt { markets( first: 100 orderBy: SupplyAssetsUsd orderDirection: Desc where: { chainId_in: [1, 8453] } ) { items { uniqueKey state { collateralAssets collateralAssetsUsd borrowAssets borrowAssetsUsd supplyAssets supplyAssetsUsd liquidityAssets liquidityAssetsUsd } } } } ``` ```APIDOC query GetMarketLiquidityAndDebtByUniqueKey($uniqueKey: String!, $chainId: Int!) { marketByUniqueKey( uniqueKey: $uniqueKey chainId: $chainId ) { state { collateralAssets borrowAssets supplyAssets liquidityAssets } } } ``` -------------------------------- ### Morpho Development Tools Source: https://docs.morpho.org/tools/offchain/sdks/introduction Highlights development utility packages, such as the TypeScript package for time and format handling, aiding in development workflows within the Morpho ecosystem. ```typescript /** * @package @morpho-org/morpho-ts * @description TypeScript package for handling time and format-related operations within Morpho projects. */ ``` -------------------------------- ### Setup and Send Morpho Bundled Transaction Source: https://docs.morpho.org/bundlers/tutorials/integrate The `setupBundle` function orchestrates the bundling, signing, and sending of multiple Morpho operations to the blockchain. It takes a Viem wallet client, simulation state, and input operations, processing them through population, finalization, and encoding steps before sending the resulting transactions. ```typescript import { type Account, WalletClient, zeroAddress } from "viem"; import { parseAccount } from "viem/accounts"; import { type Address, addresses, ChainId, DEFAULT_SLIPPAGE_TOLERANCE, MarketId, MarketParams, UnknownMarketParamsError, getUnwrappedToken, } from "@morpho/blue-sdk"; import { type BundlingOptions, type InputBundlerOperation, encodeBundle, finalizeBundle, populateBundle, } from "@morpho/bundler-sdk-viem"; import "@morpho/blue-sdk-viem/lib/augment"; import { withSimplePermit } from "@morpho/morpho-test"; import { type SimulationState, isBlueOperation, isErc20Operation, isMetaMorphoOperation, } from "@morpho/simulation-sdk"; export const setupBundle = async ( client: WalletClient, startData: SimulationState, inputOperations: InputBundlerOperation[], { account: account_ = client.account, supportsSignature, unwrapTokens, unwrapSlippage, onBundleTx, ...options }: BundlingOptions & { account?: Address | Account; supportsSignature?: boolean; unwrapTokens?: Set
; unwrapSlippage?: bigint; onBundleTx?: (data: SimulationState) => Promise