@t402/mcp 2.4.0 → 2.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/bin/t402-mcp.js +19 -3
- package/dist/cjs/index.d.ts +4 -3
- package/dist/cjs/index.js +1054 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/server/index.d.ts +51 -1
- package/dist/cjs/server/index.js +1036 -1
- package/dist/cjs/server/index.js.map +1 -1
- package/dist/cjs/{types-CWK2p9_n.d.ts → ton-bridge-BN3RKhNy.d.ts} +93 -1
- package/dist/cjs/tools/index.d.ts +620 -3
- package/dist/cjs/tools/index.js +945 -2
- package/dist/cjs/tools/index.js.map +1 -1
- package/dist/esm/{chunk-U2V6MOSU.mjs → chunk-3FGPOVUZ.mjs} +202 -4
- package/dist/esm/chunk-3FGPOVUZ.mjs.map +1 -0
- package/dist/esm/{chunk-5IVOABVF.mjs → chunk-RDQ7AMR4.mjs} +912 -2
- package/dist/esm/chunk-RDQ7AMR4.mjs.map +1 -0
- package/dist/esm/index.d.mts +4 -3
- package/dist/esm/index.mjs +20 -2
- package/dist/esm/server/index.d.mts +51 -1
- package/dist/esm/server/index.mjs +2 -2
- package/dist/esm/{types-CWK2p9_n.d.mts → ton-bridge-BN3RKhNy.d.mts} +93 -1
- package/dist/esm/tools/index.d.mts +620 -3
- package/dist/esm/tools/index.mjs +69 -3
- package/package.json +26 -16
- package/dist/esm/chunk-5IVOABVF.mjs.map +0 -1
- package/dist/esm/chunk-U2V6MOSU.mjs.map +0 -1
|
@@ -131,6 +131,16 @@ interface McpServerConfig {
|
|
|
131
131
|
paymasterUrl?: string;
|
|
132
132
|
/** Bundler URL for ERC-4337 */
|
|
133
133
|
bundlerUrl?: string;
|
|
134
|
+
/** WDK seed phrase (enables WDK wallet tools when set) */
|
|
135
|
+
seedPhrase?: string;
|
|
136
|
+
/** WDK chains to support (e.g., ['ethereum', 'arbitrum']) */
|
|
137
|
+
wdkChains?: string[];
|
|
138
|
+
/** Enable unified mode (base + WDK + unified tools) */
|
|
139
|
+
unifiedMode?: boolean;
|
|
140
|
+
/** @ton/mcp server URL for TON bridge tools */
|
|
141
|
+
tonMcpEndpoint?: string;
|
|
142
|
+
/** TON API key for direct TON bridge tool execution */
|
|
143
|
+
tonApiKey?: string;
|
|
134
144
|
}
|
|
135
145
|
/**
|
|
136
146
|
* Tool execution context
|
|
@@ -144,4 +154,86 @@ interface ToolContext {
|
|
|
144
154
|
getPublicClient: (network: SupportedNetwork) => Promise<unknown>;
|
|
145
155
|
}
|
|
146
156
|
|
|
147
|
-
|
|
157
|
+
/**
|
|
158
|
+
* TON MCP Bridge - Connects @ton/mcp tools with @t402/mcp
|
|
159
|
+
*
|
|
160
|
+
* Enables AI agents to perform end-to-end TON payment flows by
|
|
161
|
+
* proxying @ton/mcp's 15 blockchain tools through the t402 MCP server.
|
|
162
|
+
*/
|
|
163
|
+
/**
|
|
164
|
+
* Configuration for the TON MCP bridge
|
|
165
|
+
*/
|
|
166
|
+
interface TonMcpBridgeConfig {
|
|
167
|
+
/** @ton/mcp server URL or SSE endpoint */
|
|
168
|
+
tonMcpEndpoint?: string;
|
|
169
|
+
/** TON API key for direct calls (e.g., toncenter.com API key) */
|
|
170
|
+
tonApiKey?: string;
|
|
171
|
+
/** Enable demo mode (simulates calls without executing) */
|
|
172
|
+
demoMode?: boolean;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Tool input/output schema type
|
|
176
|
+
*/
|
|
177
|
+
interface ToolSchema {
|
|
178
|
+
type: 'object';
|
|
179
|
+
properties: Record<string, {
|
|
180
|
+
type: string;
|
|
181
|
+
description: string;
|
|
182
|
+
enum?: string[];
|
|
183
|
+
}>;
|
|
184
|
+
required: string[];
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* TON bridge tool definition
|
|
188
|
+
*/
|
|
189
|
+
interface TonBridgeTool {
|
|
190
|
+
name: string;
|
|
191
|
+
description: string;
|
|
192
|
+
inputSchema: ToolSchema;
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Proxy tool definitions from @ton/mcp
|
|
196
|
+
*
|
|
197
|
+
* These map to the tools available in the @ton/mcp server.
|
|
198
|
+
* When registered, they proxy requests to the @ton/mcp endpoint.
|
|
199
|
+
*/
|
|
200
|
+
declare const TON_BRIDGE_TOOLS: Record<string, TonBridgeTool>;
|
|
201
|
+
/**
|
|
202
|
+
* Execute a TON bridge tool call
|
|
203
|
+
*
|
|
204
|
+
* Proxies the tool call to the @ton/mcp endpoint or executes it
|
|
205
|
+
* directly using the TON API key.
|
|
206
|
+
*
|
|
207
|
+
* @param toolName - Name of the tool to execute
|
|
208
|
+
* @param args - Tool arguments
|
|
209
|
+
* @param config - Bridge configuration
|
|
210
|
+
* @returns Tool execution result
|
|
211
|
+
*/
|
|
212
|
+
declare function executeTonBridgeTool(toolName: string, args: Record<string, unknown>, config: TonMcpBridgeConfig): Promise<{
|
|
213
|
+
content: Array<{
|
|
214
|
+
type: 'text';
|
|
215
|
+
text: string;
|
|
216
|
+
}>;
|
|
217
|
+
isError?: boolean;
|
|
218
|
+
}>;
|
|
219
|
+
/**
|
|
220
|
+
* Register TON bridge tools on a t402 MCP server
|
|
221
|
+
*
|
|
222
|
+
* This function adds the TON bridge tools to the server's tool registry,
|
|
223
|
+
* enabling AI agents to use TON blockchain operations alongside t402 payment tools.
|
|
224
|
+
*
|
|
225
|
+
* @param config - Bridge configuration
|
|
226
|
+
* @returns Tool definitions and handler
|
|
227
|
+
*/
|
|
228
|
+
declare function createTonBridgeToolSet(config: TonMcpBridgeConfig): {
|
|
229
|
+
definitions: Record<string, TonBridgeTool>;
|
|
230
|
+
handleToolCall(name: string, args: Record<string, unknown>): Promise<{
|
|
231
|
+
content: Array<{
|
|
232
|
+
type: "text";
|
|
233
|
+
text: string;
|
|
234
|
+
}>;
|
|
235
|
+
isError?: boolean;
|
|
236
|
+
}>;
|
|
237
|
+
};
|
|
238
|
+
|
|
239
|
+
export { type BridgeFeeQuote as B, type ChainBalance as C, type GaslessPaymentResult as G, type McpServerConfig as M, type PaymentParams as P, type SupportedNetwork as S, type TokenBalance as T, type BridgeResult as a, type PaymentResult as b, type ToolContext as c, TON_BRIDGE_TOOLS as d, type TonMcpBridgeConfig as e, createTonBridgeToolSet as f, executeTonBridgeTool as g };
|