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.71 kB
JavaScript
import { z } from "zod";
import { getAccount } from "../config.js";
import { uniswapTrade } from "../functions/uniswapTradeTool.js";
import { buildTxUrl, checkTransactionHash } from "../util.js";
export function registerUniderpSellMeme(server) {
server.tool("Sell_Uniderp_Meme_Token", "🪙 Sell deployed MEME token on uniderp.fun platform", {
tokenAddress: z.string().describe("MEME token address"),
tokenAmountToSell: z.string().describe("MEME token amount want to sell"),
}, async ({ tokenAddress, tokenAmountToSell }) => {
let txHash = undefined;
try {
const account = await getAccount();
txHash = await uniswapTrade({
account,
inputToken: tokenAddress,
outputToken: "ETH",
amount: tokenAmountToSell,
});
const txUrl = await checkTransactionHash(txHash);
return {
content: [
{
type: "text",
text: `Sell Uniderp MEME 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 sell MEME token on uniswap: ${errorMessage}`,
url: txUrl,
},
],
isError: true,
};
}
});
}