@tongateway/mcp 0.4.0 → 0.5.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 +6 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -141,7 +141,8 @@ server.tool('request_transfer', 'Request a TON transfer from the wallet owner. T
|
|
|
141
141
|
to: z.string().describe('Destination TON address'),
|
|
142
142
|
amountNano: z.string().describe('Amount in nanoTON (1 TON = 1000000000)'),
|
|
143
143
|
payloadBoc: z.string().optional().describe('Optional BOC-encoded payload for the transaction'),
|
|
144
|
-
|
|
144
|
+
stateInit: z.string().optional().describe('Optional stateInit BOC for deploying new contracts'),
|
|
145
|
+
}, async ({ to, amountNano, payloadBoc, stateInit }) => {
|
|
145
146
|
if (!TOKEN) {
|
|
146
147
|
return {
|
|
147
148
|
content: [{ type: 'text', text: 'No token configured. Use request_auth first to authenticate.' }],
|
|
@@ -152,6 +153,8 @@ server.tool('request_transfer', 'Request a TON transfer from the wallet owner. T
|
|
|
152
153
|
const body = { to, amountNano };
|
|
153
154
|
if (payloadBoc)
|
|
154
155
|
body.payloadBoc = payloadBoc;
|
|
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
|
]
|