@michaleffffff/mcp-trading-server 2.3.0 → 2.3.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/dist/server.js
CHANGED
|
@@ -67,7 +67,7 @@ function zodSchemaToJsonSchema(zodSchema) {
|
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
69
|
// ─── MCP Server ───
|
|
70
|
-
const server = new Server({ name: "myx-mcp-trading-server", version: "2.3.
|
|
70
|
+
const server = new Server({ name: "myx-mcp-trading-server", version: "2.3.1" }, { capabilities: { tools: {}, resources: {}, prompts: {} } });
|
|
71
71
|
// List tools
|
|
72
72
|
server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
73
73
|
return {
|
|
@@ -167,7 +167,7 @@ server.setRequestHandler(GetPromptRequestSchema, async (request) => {
|
|
|
167
167
|
async function main() {
|
|
168
168
|
const transport = new StdioServerTransport();
|
|
169
169
|
await server.connect(transport);
|
|
170
|
-
logger.info("🚀 MYX Trading MCP Server v2.3.
|
|
170
|
+
logger.info("🚀 MYX Trading MCP Server v2.3.1 running (stdio, pure on-chain, prod ready)");
|
|
171
171
|
}
|
|
172
172
|
main().catch((err) => {
|
|
173
173
|
logger.error("Fatal Server Startup Error", err);
|
|
@@ -59,7 +59,11 @@ export async function searchMarket(client, keyword, limit = 100) {
|
|
|
59
59
|
}
|
|
60
60
|
export async function getMarketDetail(client, poolId) {
|
|
61
61
|
const chainId = getChainId();
|
|
62
|
-
|
|
62
|
+
const res = await client.markets.getMarketDetail({ chainId, poolId });
|
|
63
|
+
// Ensure it's returned as { data: ... } for consistency with other services if needed,
|
|
64
|
+
// but looking at existing tools, they often stringify the whole result.
|
|
65
|
+
// Let's just normalize it to always have the data if it's missing.
|
|
66
|
+
return res?.marketId ? { data: res } : res;
|
|
63
67
|
}
|
|
64
68
|
/**
|
|
65
69
|
* 获取所有池子列表
|
|
@@ -89,7 +89,7 @@ export async function openPosition(client, address, args) {
|
|
|
89
89
|
const tradingFeeStr = (args.tradingFee || "0").toString();
|
|
90
90
|
// 获取 marketId,SDK 0.1.267 要求 as 3rd parameter
|
|
91
91
|
const marketDetailRes = await client.markets.getMarketDetail({ chainId, poolId: args.poolId });
|
|
92
|
-
const marketId = marketDetailRes?.data?.marketId;
|
|
92
|
+
const marketId = marketDetailRes?.marketId || marketDetailRes?.data?.marketId;
|
|
93
93
|
if (!marketId) {
|
|
94
94
|
throw new Error(`Could not find marketId for poolId: ${args.poolId}`);
|
|
95
95
|
}
|