UNPKG

uniderp-mcp

Version:

> A plug-and-play MCP tool server to **send ETH**, **transfer ERC-20 tokens**, **deploy tokens**, and **interact with smart contracts** on the **UNICHAIN** — built for **Claude Desktop**, **AI agents**, and **developers.**

46 lines (45 loc) 1.67 kB
import { z } from "zod"; import { getAccount } from "../config.js"; import { buildTxUrl, checkTransactionHash } from "../util.js"; export function registerUniswapAddLiquidity(server) { server.tool("Uniswap_Add_Liquidity", "📇 Add owned uniswap liquidity position (requires wallet check first)", { tokenInAddress: z.string(), tokenOutAddress: z.string(), exactIn: z.boolean(), amount: z.string(), }, async ({ tokenInAddress, tokenOutAddress, exactIn, amount }) => { let txHash = undefined; try { const account = await getAccount(); // txHash = await walletClient(account).sendTransaction({ // to: recipientAddress as `0x${string}`, // value: parseEther(amount), // }); throw Error("TODO"); const txUrl = await checkTransactionHash(txHash); return { content: [ { type: "text", text: `Transaction sent successfully. ${txUrl}`, url: txUrl, }, ], }; } catch (error) { const errorMessage = error instanceof Error ? error.message : String(error); const txUrl = buildTxUrl(txHash); return { content: [ { type: "text", text: `Failed to Add liquidity on uniswap: ${errorMessage}`, url: txUrl, }, ], isError: true, }; } }); }