Skip to main content
Glama

MCP-ODOS

by IQAIcom
assemble.ts1.12 kB
import { ODOS_API_URL } from "../constants.js"; import type { AssembleResponseTxn } from "../types.js"; import type { WalletService } from "./wallet.js"; export class AssembleService { private readonly walletService: WalletService; constructor(walletService: WalletService) { this.walletService = walletService; } async execute(pathId: string) { const walletClient = this.walletService.getWalletClient(); const userAddr = walletClient?.account?.address; if (!userAddr) { throw new Error("User address is not defined"); } try { const response = await fetch(`${ODOS_API_URL}/sor/assemble`, { method: "POST", headers: { "Content-Type": "application/json", }, body: JSON.stringify({ userAddr, pathId, }), }); if (!response.ok) { throw new Error( `HTTP error! status: ${response.status} - ${response.statusText}`, ); } const data = (await response.json()) as { transaction: AssembleResponseTxn; }; return data.transaction as AssembleResponseTxn; } catch (error) { console.error("Error assembling path:", error); } } }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/IQAIcom/mcp-odos'

If you have feedback or need assistance with the MCP directory API, please join our Discord server