@tongateway/mcp 0.19.2 → 0.20.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.
Files changed (2) hide show
  1. package/dist/index.js +8 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -209,10 +209,15 @@ server.tool('transfer.request', 'Send a TON transfer. The user approves in their
209
209
  }
210
210
  try {
211
211
  const body = { to, amount };
212
- if (comment)
213
- body.comment = comment;
214
- if (payload)
212
+ // Encode comment as BOC payload using @ton/core
213
+ if (comment && !payload) {
214
+ const { beginCell } = await import('@ton/core');
215
+ const commentCell = beginCell().storeUint(0, 32).storeStringTail(comment).endCell();
216
+ body.payload = commentCell.toBoc().toString('base64');
217
+ }
218
+ else if (payload) {
215
219
  body.payload = payload;
220
+ }
216
221
  if (stateInit)
217
222
  body.stateInit = stateInit;
218
223
  const result = await apiCall('/v1/safe/tx/transfer', {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tongateway/mcp",
3
- "version": "0.19.2",
3
+ "version": "0.20.0",
4
4
  "description": "TON blockchain gateway for AI agents — 16 MCP tools: wallet info, transfers, jettons, NFTs, DNS, prices, DEX orders, agent wallets",
5
5
  "homepage": "https://tongateway.ai",
6
6
  "license": "MIT",