@tongateway/mcp 0.9.0 → 0.10.0
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/index.js +5 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -403,7 +403,7 @@ server.tool('get_ton_price', 'Get the current TON price in USD, EUR, or other cu
|
|
|
403
403
|
return { content: [{ type: 'text', text: `Error: ${e.message}` }], isError: true };
|
|
404
404
|
}
|
|
405
405
|
});
|
|
406
|
-
server.tool('
|
|
406
|
+
server.tool('create_dex_order', 'Place a limit order on the open4dev DEX order book. Provide the token pair (e.g. NOT→TON), amount, and price. The order is created as a safe transfer — the user approves it in their wallet. Use get_ton_price or get_jetton_balances to determine current rates before swapping.', {
|
|
407
407
|
fromToken: z.string().describe('Token to sell, e.g. "NOT", "TON", "USDT"'),
|
|
408
408
|
toToken: z.string().describe('Token to buy, e.g. "TON", "NOT"'),
|
|
409
409
|
amount: z.string().describe('Amount to sell in smallest unit (nanoTON for TON, or raw jetton amount based on decimals)'),
|
|
@@ -413,7 +413,7 @@ server.tool('create_swap_order', 'Swap tokens on the open4dev DEX. Provide the t
|
|
|
413
413
|
return { content: [{ type: 'text', text: 'No token configured. Use request_auth first.' }], isError: true };
|
|
414
414
|
}
|
|
415
415
|
try {
|
|
416
|
-
const result = await apiCall('/v1/dex/
|
|
416
|
+
const result = await apiCall('/v1/dex/order', {
|
|
417
417
|
method: 'POST',
|
|
418
418
|
body: JSON.stringify({ fromToken, toToken, amount, priceRateNano }),
|
|
419
419
|
});
|
|
@@ -421,7 +421,7 @@ server.tool('create_swap_order', 'Swap tokens on the open4dev DEX. Provide the t
|
|
|
421
421
|
content: [{
|
|
422
422
|
type: 'text',
|
|
423
423
|
text: [
|
|
424
|
-
`
|
|
424
|
+
`Order placed on open4dev DEX!`,
|
|
425
425
|
``,
|
|
426
426
|
`${fromToken} → ${toToken}`,
|
|
427
427
|
`Amount: ${amount}`,
|
|
@@ -429,7 +429,7 @@ server.tool('create_swap_order', 'Swap tokens on the open4dev DEX. Provide the t
|
|
|
429
429
|
`Pool: ${result.swap?.pool || 'unknown'}`,
|
|
430
430
|
`Request ID: ${result.id}`,
|
|
431
431
|
``,
|
|
432
|
-
`Approve the
|
|
432
|
+
`Approve the order in your wallet app.`,
|
|
433
433
|
].join('\n'),
|
|
434
434
|
}],
|
|
435
435
|
};
|
|
@@ -438,7 +438,7 @@ server.tool('create_swap_order', 'Swap tokens on the open4dev DEX. Provide the t
|
|
|
438
438
|
return { content: [{ type: 'text', text: `Error: ${e.message}` }], isError: true };
|
|
439
439
|
}
|
|
440
440
|
});
|
|
441
|
-
server.tool('
|
|
441
|
+
server.tool('list_dex_pairs', 'List available trading pairs on the DEX. Shows which token swaps are configured and available.', {}, async () => {
|
|
442
442
|
try {
|
|
443
443
|
const result = await fetch(`${API_URL}/v1/dex/pools`);
|
|
444
444
|
const data = await result.json();
|