@tongateway/mcp 0.4.0 → 0.6.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 +9 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -140,8 +140,9 @@ server.tool('get_auth_token', 'Check if the user has completed wallet authentica
|
|
|
140
140
|
server.tool('request_transfer', 'Request a TON transfer from the wallet owner. The request will be queued and the owner must approve it via TON Connect.', {
|
|
141
141
|
to: z.string().describe('Destination TON address'),
|
|
142
142
|
amountNano: z.string().describe('Amount in nanoTON (1 TON = 1000000000)'),
|
|
143
|
-
|
|
144
|
-
|
|
143
|
+
payload: z.string().optional().describe('Optional BOC-encoded payload for the transaction'),
|
|
144
|
+
stateInit: z.string().optional().describe('Optional stateInit BOC for deploying new contracts'),
|
|
145
|
+
}, async ({ to, amountNano, payload, stateInit }) => {
|
|
145
146
|
if (!TOKEN) {
|
|
146
147
|
return {
|
|
147
148
|
content: [{ type: 'text', text: 'No token configured. Use request_auth first to authenticate.' }],
|
|
@@ -150,8 +151,10 @@ server.tool('request_transfer', 'Request a TON transfer from the wallet owner. T
|
|
|
150
151
|
}
|
|
151
152
|
try {
|
|
152
153
|
const body = { to, amountNano };
|
|
153
|
-
if (
|
|
154
|
-
body.
|
|
154
|
+
if (payload)
|
|
155
|
+
body.payload = payload;
|
|
156
|
+
if (stateInit)
|
|
157
|
+
body.stateInit = stateInit;
|
|
155
158
|
const result = await apiCall('/v1/safe/tx/transfer', {
|
|
156
159
|
method: 'POST',
|
|
157
160
|
body: JSON.stringify(body),
|
|
@@ -202,6 +205,8 @@ server.tool('get_request_status', 'Check the status of a previously submitted tr
|
|
|
202
205
|
`To: ${result.to}`,
|
|
203
206
|
`Amount: ${result.amountNano} nanoTON`,
|
|
204
207
|
result.txHash ? `TX Hash: ${result.txHash}` : null,
|
|
208
|
+
result.broadcastResult ? `Broadcast: ${result.broadcastResult}` : null,
|
|
209
|
+
result.broadcastError ? `Error: ${result.broadcastError}` : null,
|
|
205
210
|
`Created: ${new Date(result.createdAt).toISOString()}`,
|
|
206
211
|
`Expires: ${new Date(result.expiresAt).toISOString()}`,
|
|
207
212
|
]
|