@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
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { S as SupportedNetwork, C as ChainBalance,
|
|
2
|
+
import { S as SupportedNetwork, C as ChainBalance, b as PaymentResult, G as GaslessPaymentResult, B as BridgeFeeQuote, a as BridgeResult } from '../ton-bridge-BN3RKhNy.js';
|
|
3
|
+
export { d as TON_BRIDGE_TOOLS, e as TonMcpBridgeConfig, f as createTonBridgeToolSet, g as executeTonBridgeTool } from '../ton-bridge-BN3RKhNy.js';
|
|
4
|
+
import { T402WDK } from '@t402/wdk';
|
|
3
5
|
import 'viem';
|
|
4
6
|
|
|
5
7
|
/**
|
|
@@ -244,12 +246,518 @@ declare function executeBridge(input: BridgeInput, options: BridgeOptions): Prom
|
|
|
244
246
|
*/
|
|
245
247
|
declare function formatBridgeResult(result: BridgeResult): string;
|
|
246
248
|
|
|
249
|
+
/**
|
|
250
|
+
* wdk/getWallet - Get wallet info from WDK
|
|
251
|
+
*/
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* Input schema for wdk/getWallet tool
|
|
255
|
+
*/
|
|
256
|
+
declare const wdkGetWalletInputSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
257
|
+
type WdkGetWalletInput = z.infer<typeof wdkGetWalletInputSchema>;
|
|
258
|
+
/**
|
|
259
|
+
* Wallet info result
|
|
260
|
+
*/
|
|
261
|
+
interface WdkWalletInfo {
|
|
262
|
+
/** EVM address */
|
|
263
|
+
evmAddress: string;
|
|
264
|
+
/** Supported chains */
|
|
265
|
+
chains: string[];
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* Execute wdk/getWallet tool
|
|
269
|
+
*
|
|
270
|
+
* @param _input - Empty input (no params needed)
|
|
271
|
+
* @param wdk - T402WDK instance
|
|
272
|
+
* @returns Wallet info
|
|
273
|
+
*/
|
|
274
|
+
declare function executeWdkGetWallet(_input: WdkGetWalletInput, wdk: T402WDK): Promise<WdkWalletInfo>;
|
|
275
|
+
/**
|
|
276
|
+
* Execute wdk/getWallet in demo mode
|
|
277
|
+
*
|
|
278
|
+
* @returns Demo wallet info
|
|
279
|
+
*/
|
|
280
|
+
declare function executeWdkGetWalletDemo(): WdkWalletInfo;
|
|
281
|
+
/**
|
|
282
|
+
* Format wallet info for display
|
|
283
|
+
*
|
|
284
|
+
* @param info - Wallet info
|
|
285
|
+
* @returns Formatted string
|
|
286
|
+
*/
|
|
287
|
+
declare function formatWdkWalletResult(info: WdkWalletInfo): string;
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* wdk/getBalances - Get multi-chain balances via WDK
|
|
291
|
+
*/
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* Input schema for wdk/getBalances tool
|
|
295
|
+
*/
|
|
296
|
+
declare const wdkGetBalancesInputSchema: z.ZodObject<{
|
|
297
|
+
chains: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
298
|
+
}, "strip", z.ZodTypeAny, {
|
|
299
|
+
chains?: string[] | undefined;
|
|
300
|
+
}, {
|
|
301
|
+
chains?: string[] | undefined;
|
|
302
|
+
}>;
|
|
303
|
+
type WdkGetBalancesInput = z.infer<typeof wdkGetBalancesInputSchema>;
|
|
304
|
+
/**
|
|
305
|
+
* WDK balance result
|
|
306
|
+
*/
|
|
307
|
+
interface WdkBalancesResult {
|
|
308
|
+
/** Per-chain balances */
|
|
309
|
+
chains: Array<{
|
|
310
|
+
chain: string;
|
|
311
|
+
usdt0: string;
|
|
312
|
+
usdc: string;
|
|
313
|
+
native: string;
|
|
314
|
+
}>;
|
|
315
|
+
/** Total USDT0 across all chains */
|
|
316
|
+
totalUsdt0: string;
|
|
317
|
+
/** Total USDC across all chains */
|
|
318
|
+
totalUsdc: string;
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* Execute wdk/getBalances tool
|
|
322
|
+
*
|
|
323
|
+
* @param input - Input with optional chains filter
|
|
324
|
+
* @param wdk - T402WDK instance
|
|
325
|
+
* @returns Multi-chain balances
|
|
326
|
+
*/
|
|
327
|
+
declare function executeWdkGetBalances(input: WdkGetBalancesInput, wdk: T402WDK): Promise<WdkBalancesResult>;
|
|
328
|
+
/**
|
|
329
|
+
* Execute wdk/getBalances in demo mode
|
|
330
|
+
*
|
|
331
|
+
* @returns Demo balances
|
|
332
|
+
*/
|
|
333
|
+
declare function executeWdkGetBalancesDemo(): WdkBalancesResult;
|
|
334
|
+
/**
|
|
335
|
+
* Format balances for display
|
|
336
|
+
*
|
|
337
|
+
* @param result - Balances result
|
|
338
|
+
* @returns Formatted string
|
|
339
|
+
*/
|
|
340
|
+
declare function formatWdkBalancesResult(result: WdkBalancesResult): string;
|
|
341
|
+
|
|
342
|
+
/**
|
|
343
|
+
* wdk/transfer - Send tokens via WDK
|
|
344
|
+
*/
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* Input schema for wdk/transfer tool
|
|
348
|
+
*/
|
|
349
|
+
declare const wdkTransferInputSchema: z.ZodObject<{
|
|
350
|
+
to: z.ZodString;
|
|
351
|
+
amount: z.ZodString;
|
|
352
|
+
token: z.ZodEnum<["USDC", "USDT", "USDT0"]>;
|
|
353
|
+
chain: z.ZodString;
|
|
354
|
+
}, "strip", z.ZodTypeAny, {
|
|
355
|
+
to: string;
|
|
356
|
+
amount: string;
|
|
357
|
+
chain: string;
|
|
358
|
+
token: "USDC" | "USDT" | "USDT0";
|
|
359
|
+
}, {
|
|
360
|
+
to: string;
|
|
361
|
+
amount: string;
|
|
362
|
+
chain: string;
|
|
363
|
+
token: "USDC" | "USDT" | "USDT0";
|
|
364
|
+
}>;
|
|
365
|
+
type WdkTransferInput = z.infer<typeof wdkTransferInputSchema>;
|
|
366
|
+
/**
|
|
367
|
+
* Transfer result
|
|
368
|
+
*/
|
|
369
|
+
interface WdkTransferResult {
|
|
370
|
+
/** Transaction hash */
|
|
371
|
+
txHash: string;
|
|
372
|
+
/** Amount transferred */
|
|
373
|
+
amount: string;
|
|
374
|
+
/** Token transferred */
|
|
375
|
+
token: string;
|
|
376
|
+
/** Chain used */
|
|
377
|
+
chain: string;
|
|
378
|
+
/** Recipient */
|
|
379
|
+
to: string;
|
|
380
|
+
/** Explorer URL */
|
|
381
|
+
explorerUrl: string;
|
|
382
|
+
}
|
|
383
|
+
/**
|
|
384
|
+
* Execute wdk/transfer tool
|
|
385
|
+
*
|
|
386
|
+
* @param input - Transfer parameters
|
|
387
|
+
* @param wdk - T402WDK instance
|
|
388
|
+
* @returns Transfer result
|
|
389
|
+
*/
|
|
390
|
+
declare function executeWdkTransfer(input: WdkTransferInput, wdk: T402WDK): Promise<WdkTransferResult>;
|
|
391
|
+
/**
|
|
392
|
+
* Execute wdk/transfer in demo mode
|
|
393
|
+
*
|
|
394
|
+
* @param input - Transfer parameters
|
|
395
|
+
* @returns Demo transfer result
|
|
396
|
+
*/
|
|
397
|
+
declare function executeWdkTransferDemo(input: WdkTransferInput): WdkTransferResult;
|
|
398
|
+
/**
|
|
399
|
+
* Format transfer result for display
|
|
400
|
+
*
|
|
401
|
+
* @param result - Transfer result
|
|
402
|
+
* @returns Formatted string
|
|
403
|
+
*/
|
|
404
|
+
declare function formatWdkTransferResult(result: WdkTransferResult): string;
|
|
405
|
+
|
|
406
|
+
/**
|
|
407
|
+
* wdk/swap - Swap tokens via WDK
|
|
408
|
+
*/
|
|
409
|
+
|
|
410
|
+
/**
|
|
411
|
+
* Input schema for wdk/swap tool
|
|
412
|
+
*/
|
|
413
|
+
declare const wdkSwapInputSchema: z.ZodObject<{
|
|
414
|
+
fromToken: z.ZodString;
|
|
415
|
+
toToken: z.ZodString;
|
|
416
|
+
amount: z.ZodString;
|
|
417
|
+
chain: z.ZodString;
|
|
418
|
+
}, "strip", z.ZodTypeAny, {
|
|
419
|
+
amount: string;
|
|
420
|
+
chain: string;
|
|
421
|
+
fromToken: string;
|
|
422
|
+
toToken: string;
|
|
423
|
+
}, {
|
|
424
|
+
amount: string;
|
|
425
|
+
chain: string;
|
|
426
|
+
fromToken: string;
|
|
427
|
+
toToken: string;
|
|
428
|
+
}>;
|
|
429
|
+
type WdkSwapInput = z.infer<typeof wdkSwapInputSchema>;
|
|
430
|
+
/**
|
|
431
|
+
* Swap result
|
|
432
|
+
*/
|
|
433
|
+
interface WdkSwapResult {
|
|
434
|
+
/** Input amount */
|
|
435
|
+
fromAmount: string;
|
|
436
|
+
/** Input token */
|
|
437
|
+
fromToken: string;
|
|
438
|
+
/** Output amount (estimated or actual) */
|
|
439
|
+
toAmount: string;
|
|
440
|
+
/** Output token */
|
|
441
|
+
toToken: string;
|
|
442
|
+
/** Chain */
|
|
443
|
+
chain: string;
|
|
444
|
+
/** Transaction hash (if executed) */
|
|
445
|
+
txHash?: string;
|
|
446
|
+
}
|
|
447
|
+
/**
|
|
448
|
+
* Execute wdk/swap tool
|
|
449
|
+
*
|
|
450
|
+
* @param input - Swap parameters
|
|
451
|
+
* @param wdk - T402WDK instance
|
|
452
|
+
* @returns Swap result
|
|
453
|
+
*/
|
|
454
|
+
declare function executeWdkSwap(input: WdkSwapInput, wdk: T402WDK): Promise<WdkSwapResult>;
|
|
455
|
+
/**
|
|
456
|
+
* Execute wdk/swap in demo mode
|
|
457
|
+
*
|
|
458
|
+
* @param input - Swap parameters
|
|
459
|
+
* @returns Demo swap result
|
|
460
|
+
*/
|
|
461
|
+
declare function executeWdkSwapDemo(input: WdkSwapInput): WdkSwapResult;
|
|
462
|
+
/**
|
|
463
|
+
* Format swap result for display
|
|
464
|
+
*
|
|
465
|
+
* @param result - Swap result
|
|
466
|
+
* @returns Formatted string
|
|
467
|
+
*/
|
|
468
|
+
declare function formatWdkSwapResult(result: WdkSwapResult): string;
|
|
469
|
+
|
|
470
|
+
/**
|
|
471
|
+
* t402/autoPay - Smart payment orchestrator
|
|
472
|
+
*
|
|
473
|
+
* Fetches a URL, detects 402 payment requirements, checks WDK balances,
|
|
474
|
+
* signs payment, and returns the paid content.
|
|
475
|
+
*/
|
|
476
|
+
|
|
477
|
+
/**
|
|
478
|
+
* Input schema for t402/autoPay tool
|
|
479
|
+
*/
|
|
480
|
+
declare const autoPayInputSchema: z.ZodObject<{
|
|
481
|
+
url: z.ZodString;
|
|
482
|
+
maxAmount: z.ZodOptional<z.ZodString>;
|
|
483
|
+
preferredChain: z.ZodOptional<z.ZodString>;
|
|
484
|
+
}, "strip", z.ZodTypeAny, {
|
|
485
|
+
url: string;
|
|
486
|
+
maxAmount?: string | undefined;
|
|
487
|
+
preferredChain?: string | undefined;
|
|
488
|
+
}, {
|
|
489
|
+
url: string;
|
|
490
|
+
maxAmount?: string | undefined;
|
|
491
|
+
preferredChain?: string | undefined;
|
|
492
|
+
}>;
|
|
493
|
+
type AutoPayInput = z.infer<typeof autoPayInputSchema>;
|
|
494
|
+
/**
|
|
495
|
+
* AutoPay result
|
|
496
|
+
*/
|
|
497
|
+
interface AutoPayResult {
|
|
498
|
+
/** Whether the resource was successfully accessed */
|
|
499
|
+
success: boolean;
|
|
500
|
+
/** HTTP status code */
|
|
501
|
+
statusCode: number;
|
|
502
|
+
/** Response body (truncated if large) */
|
|
503
|
+
body: string;
|
|
504
|
+
/** Content type of the response */
|
|
505
|
+
contentType?: string;
|
|
506
|
+
/** Payment details (if payment was made) */
|
|
507
|
+
payment?: {
|
|
508
|
+
network: string;
|
|
509
|
+
scheme: string;
|
|
510
|
+
amount: string;
|
|
511
|
+
payTo: string;
|
|
512
|
+
};
|
|
513
|
+
/** Error message (if failed) */
|
|
514
|
+
error?: string;
|
|
515
|
+
}
|
|
516
|
+
/**
|
|
517
|
+
* Execute t402/autoPay tool
|
|
518
|
+
*
|
|
519
|
+
* @param input - AutoPay parameters
|
|
520
|
+
* @param wdk - T402WDK instance
|
|
521
|
+
* @returns AutoPay result
|
|
522
|
+
*/
|
|
523
|
+
declare function executeAutoPay(input: AutoPayInput, wdk: T402WDK): Promise<AutoPayResult>;
|
|
524
|
+
/**
|
|
525
|
+
* Execute t402/autoPay in demo mode
|
|
526
|
+
*
|
|
527
|
+
* @param input - AutoPay parameters
|
|
528
|
+
* @returns Demo autopay result
|
|
529
|
+
*/
|
|
530
|
+
declare function executeAutoPayDemo(input: AutoPayInput): AutoPayResult;
|
|
531
|
+
/**
|
|
532
|
+
* Format autopay result for display
|
|
533
|
+
*
|
|
534
|
+
* @param result - AutoPay result
|
|
535
|
+
* @returns Formatted string
|
|
536
|
+
*/
|
|
537
|
+
declare function formatAutoPayResult(result: AutoPayResult): string;
|
|
538
|
+
|
|
539
|
+
/**
|
|
540
|
+
* Unified MCP Toolkit - Combines WDK wallet tools with t402 payment tools.
|
|
541
|
+
*
|
|
542
|
+
* Agent workflow: check price -> check balance -> bridge if needed -> pay
|
|
543
|
+
* All in one MCP session with a single server.
|
|
544
|
+
*/
|
|
545
|
+
|
|
546
|
+
/**
|
|
547
|
+
* Configuration for unified MCP mode
|
|
548
|
+
*/
|
|
549
|
+
interface UnifiedMcpConfig {
|
|
550
|
+
/** WDK seed phrase for wallet management */
|
|
551
|
+
wdkSeedPhrase?: string;
|
|
552
|
+
/** Chain RPC configurations */
|
|
553
|
+
chains?: Record<string, string | string[]>;
|
|
554
|
+
/** Enable auto-pay mode (automatic balance check + bridge + pay) */
|
|
555
|
+
autoPayEnabled?: boolean;
|
|
556
|
+
}
|
|
557
|
+
/**
|
|
558
|
+
* SmartPay input schema
|
|
559
|
+
*/
|
|
560
|
+
declare const smartPayInputSchema: z.ZodObject<{
|
|
561
|
+
url: z.ZodString;
|
|
562
|
+
maxBridgeFee: z.ZodOptional<z.ZodString>;
|
|
563
|
+
preferredNetwork: z.ZodOptional<z.ZodString>;
|
|
564
|
+
}, "strip", z.ZodTypeAny, {
|
|
565
|
+
url: string;
|
|
566
|
+
maxBridgeFee?: string | undefined;
|
|
567
|
+
preferredNetwork?: string | undefined;
|
|
568
|
+
}, {
|
|
569
|
+
url: string;
|
|
570
|
+
maxBridgeFee?: string | undefined;
|
|
571
|
+
preferredNetwork?: string | undefined;
|
|
572
|
+
}>;
|
|
573
|
+
type SmartPayInput = z.infer<typeof smartPayInputSchema>;
|
|
574
|
+
/**
|
|
575
|
+
* SmartPay result
|
|
576
|
+
*/
|
|
577
|
+
interface SmartPayResult {
|
|
578
|
+
/** Whether the resource was successfully accessed */
|
|
579
|
+
success: boolean;
|
|
580
|
+
/** HTTP status code */
|
|
581
|
+
statusCode: number;
|
|
582
|
+
/** Response body (truncated if large) */
|
|
583
|
+
body: string;
|
|
584
|
+
/** Content type of the response */
|
|
585
|
+
contentType?: string;
|
|
586
|
+
/** Steps taken during smart payment */
|
|
587
|
+
steps: SmartPayStep[];
|
|
588
|
+
/** Payment details (if payment was made) */
|
|
589
|
+
payment?: {
|
|
590
|
+
network: string;
|
|
591
|
+
scheme: string;
|
|
592
|
+
amount: string;
|
|
593
|
+
payTo: string;
|
|
594
|
+
};
|
|
595
|
+
/** Error message (if failed) */
|
|
596
|
+
error?: string;
|
|
597
|
+
}
|
|
598
|
+
/**
|
|
599
|
+
* A step in the smart payment flow
|
|
600
|
+
*/
|
|
601
|
+
interface SmartPayStep {
|
|
602
|
+
action: 'check_price' | 'check_balance' | 'bridge' | 'pay' | 'fetch';
|
|
603
|
+
status: 'success' | 'skipped' | 'failed';
|
|
604
|
+
detail: string;
|
|
605
|
+
}
|
|
606
|
+
/**
|
|
607
|
+
* PaymentPlan input schema
|
|
608
|
+
*/
|
|
609
|
+
declare const paymentPlanInputSchema: z.ZodObject<{
|
|
610
|
+
paymentRequired: z.ZodObject<{
|
|
611
|
+
scheme: z.ZodOptional<z.ZodString>;
|
|
612
|
+
network: z.ZodOptional<z.ZodString>;
|
|
613
|
+
maxAmountRequired: z.ZodOptional<z.ZodString>;
|
|
614
|
+
resource: z.ZodOptional<z.ZodString>;
|
|
615
|
+
description: z.ZodOptional<z.ZodString>;
|
|
616
|
+
payTo: z.ZodOptional<z.ZodString>;
|
|
617
|
+
maxDeadline: z.ZodOptional<z.ZodNumber>;
|
|
618
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
619
|
+
scheme: z.ZodOptional<z.ZodString>;
|
|
620
|
+
network: z.ZodOptional<z.ZodString>;
|
|
621
|
+
maxAmountRequired: z.ZodOptional<z.ZodString>;
|
|
622
|
+
resource: z.ZodOptional<z.ZodString>;
|
|
623
|
+
description: z.ZodOptional<z.ZodString>;
|
|
624
|
+
payTo: z.ZodOptional<z.ZodString>;
|
|
625
|
+
maxDeadline: z.ZodOptional<z.ZodNumber>;
|
|
626
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
627
|
+
scheme: z.ZodOptional<z.ZodString>;
|
|
628
|
+
network: z.ZodOptional<z.ZodString>;
|
|
629
|
+
maxAmountRequired: z.ZodOptional<z.ZodString>;
|
|
630
|
+
resource: z.ZodOptional<z.ZodString>;
|
|
631
|
+
description: z.ZodOptional<z.ZodString>;
|
|
632
|
+
payTo: z.ZodOptional<z.ZodString>;
|
|
633
|
+
maxDeadline: z.ZodOptional<z.ZodNumber>;
|
|
634
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
635
|
+
}, "strip", z.ZodTypeAny, {
|
|
636
|
+
paymentRequired: {
|
|
637
|
+
network?: string | undefined;
|
|
638
|
+
description?: string | undefined;
|
|
639
|
+
scheme?: string | undefined;
|
|
640
|
+
payTo?: string | undefined;
|
|
641
|
+
maxAmountRequired?: string | undefined;
|
|
642
|
+
resource?: string | undefined;
|
|
643
|
+
maxDeadline?: number | undefined;
|
|
644
|
+
} & {
|
|
645
|
+
[k: string]: unknown;
|
|
646
|
+
};
|
|
647
|
+
}, {
|
|
648
|
+
paymentRequired: {
|
|
649
|
+
network?: string | undefined;
|
|
650
|
+
description?: string | undefined;
|
|
651
|
+
scheme?: string | undefined;
|
|
652
|
+
payTo?: string | undefined;
|
|
653
|
+
maxAmountRequired?: string | undefined;
|
|
654
|
+
resource?: string | undefined;
|
|
655
|
+
maxDeadline?: number | undefined;
|
|
656
|
+
} & {
|
|
657
|
+
[k: string]: unknown;
|
|
658
|
+
};
|
|
659
|
+
}>;
|
|
660
|
+
type PaymentPlanInput = z.infer<typeof paymentPlanInputSchema>;
|
|
661
|
+
/**
|
|
662
|
+
* Payment plan result
|
|
663
|
+
*/
|
|
664
|
+
interface PaymentPlanResult {
|
|
665
|
+
/** Whether a viable plan was found */
|
|
666
|
+
viable: boolean;
|
|
667
|
+
/** Recommended network to pay on */
|
|
668
|
+
recommendedNetwork?: string;
|
|
669
|
+
/** Available balance on that network */
|
|
670
|
+
availableBalance?: string;
|
|
671
|
+
/** Whether bridging is needed */
|
|
672
|
+
bridgeRequired: boolean;
|
|
673
|
+
/** Bridge details if needed */
|
|
674
|
+
bridgeDetails?: {
|
|
675
|
+
fromChain: string;
|
|
676
|
+
toChain: string;
|
|
677
|
+
amount: string;
|
|
678
|
+
estimatedFee: string;
|
|
679
|
+
};
|
|
680
|
+
/** Balances across all chains */
|
|
681
|
+
balances: Array<{
|
|
682
|
+
chain: string;
|
|
683
|
+
usdt0: string;
|
|
684
|
+
usdc: string;
|
|
685
|
+
}>;
|
|
686
|
+
/** Reason if not viable */
|
|
687
|
+
reason?: string;
|
|
688
|
+
}
|
|
689
|
+
/**
|
|
690
|
+
* Unified tool definitions (additional tools beyond base + WDK)
|
|
691
|
+
*/
|
|
692
|
+
declare const UNIFIED_TOOL_DEFINITIONS: {
|
|
693
|
+
readonly 't402/smartPay': {
|
|
694
|
+
readonly name: "t402/smartPay";
|
|
695
|
+
readonly description: "Intelligent payment that automatically checks balance, bridges if needed, and pays. Handles the entire payment flow for 402-protected resources.";
|
|
696
|
+
readonly inputSchema: {
|
|
697
|
+
readonly type: "object";
|
|
698
|
+
readonly properties: {
|
|
699
|
+
readonly url: {
|
|
700
|
+
readonly type: "string";
|
|
701
|
+
readonly description: "URL of the 402-protected resource";
|
|
702
|
+
};
|
|
703
|
+
readonly maxBridgeFee: {
|
|
704
|
+
readonly type: "string";
|
|
705
|
+
readonly description: "Maximum acceptable bridge fee in native token (optional)";
|
|
706
|
+
};
|
|
707
|
+
readonly preferredNetwork: {
|
|
708
|
+
readonly type: "string";
|
|
709
|
+
readonly description: "Preferred network for payment (optional)";
|
|
710
|
+
};
|
|
711
|
+
};
|
|
712
|
+
readonly required: readonly ["url"];
|
|
713
|
+
};
|
|
714
|
+
};
|
|
715
|
+
readonly 't402/paymentPlan': {
|
|
716
|
+
readonly name: "t402/paymentPlan";
|
|
717
|
+
readonly description: "Analyze a 402 response and create an optimal payment plan considering balances across all chains. Returns recommended network, bridge requirements, and balance overview.";
|
|
718
|
+
readonly inputSchema: {
|
|
719
|
+
readonly type: "object";
|
|
720
|
+
readonly properties: {
|
|
721
|
+
readonly paymentRequired: {
|
|
722
|
+
readonly type: "object";
|
|
723
|
+
readonly description: "The 402 PaymentRequired response";
|
|
724
|
+
};
|
|
725
|
+
};
|
|
726
|
+
readonly required: readonly ["paymentRequired"];
|
|
727
|
+
};
|
|
728
|
+
};
|
|
729
|
+
};
|
|
730
|
+
/**
|
|
731
|
+
* Execute t402/smartPay tool
|
|
732
|
+
*/
|
|
733
|
+
declare function executeSmartPay(input: SmartPayInput, wdk: T402WDK): Promise<SmartPayResult>;
|
|
734
|
+
/**
|
|
735
|
+
* Execute t402/smartPay in demo mode
|
|
736
|
+
*/
|
|
737
|
+
declare function executeSmartPayDemo(input: SmartPayInput): SmartPayResult;
|
|
738
|
+
/**
|
|
739
|
+
* Execute t402/paymentPlan tool
|
|
740
|
+
*/
|
|
741
|
+
declare function executePaymentPlan(input: PaymentPlanInput, wdk: T402WDK): Promise<PaymentPlanResult>;
|
|
742
|
+
/**
|
|
743
|
+
* Execute t402/paymentPlan in demo mode
|
|
744
|
+
*/
|
|
745
|
+
declare function executePaymentPlanDemo(_input: PaymentPlanInput): PaymentPlanResult;
|
|
746
|
+
/**
|
|
747
|
+
* Format smartPay result for display
|
|
748
|
+
*/
|
|
749
|
+
declare function formatSmartPayResult(result: SmartPayResult): string;
|
|
750
|
+
/**
|
|
751
|
+
* Format paymentPlan result for display
|
|
752
|
+
*/
|
|
753
|
+
declare function formatPaymentPlanResult(result: PaymentPlanResult): string;
|
|
754
|
+
|
|
247
755
|
/**
|
|
248
756
|
* t402 MCP Tools - Export all payment tools
|
|
249
757
|
*/
|
|
250
758
|
|
|
251
759
|
/**
|
|
252
|
-
*
|
|
760
|
+
* Base tool definitions (always available)
|
|
253
761
|
*/
|
|
254
762
|
declare const TOOL_DEFINITIONS: {
|
|
255
763
|
't402/getBalance': {
|
|
@@ -420,5 +928,114 @@ declare const TOOL_DEFINITIONS: {
|
|
|
420
928
|
};
|
|
421
929
|
};
|
|
422
930
|
};
|
|
931
|
+
/**
|
|
932
|
+
* WDK tool definitions (only available when WDK seed phrase is configured)
|
|
933
|
+
*/
|
|
934
|
+
declare const WDK_TOOL_DEFINITIONS: {
|
|
935
|
+
'wdk/getWallet': {
|
|
936
|
+
name: string;
|
|
937
|
+
description: string;
|
|
938
|
+
inputSchema: {
|
|
939
|
+
type: "object";
|
|
940
|
+
properties: {};
|
|
941
|
+
required: string[];
|
|
942
|
+
};
|
|
943
|
+
};
|
|
944
|
+
'wdk/getBalances': {
|
|
945
|
+
name: string;
|
|
946
|
+
description: string;
|
|
947
|
+
inputSchema: {
|
|
948
|
+
type: "object";
|
|
949
|
+
properties: {
|
|
950
|
+
chains: {
|
|
951
|
+
type: string;
|
|
952
|
+
items: {
|
|
953
|
+
type: string;
|
|
954
|
+
};
|
|
955
|
+
description: string;
|
|
956
|
+
};
|
|
957
|
+
};
|
|
958
|
+
required: string[];
|
|
959
|
+
};
|
|
960
|
+
};
|
|
961
|
+
'wdk/transfer': {
|
|
962
|
+
name: string;
|
|
963
|
+
description: string;
|
|
964
|
+
inputSchema: {
|
|
965
|
+
type: "object";
|
|
966
|
+
properties: {
|
|
967
|
+
to: {
|
|
968
|
+
type: string;
|
|
969
|
+
description: string;
|
|
970
|
+
};
|
|
971
|
+
amount: {
|
|
972
|
+
type: string;
|
|
973
|
+
pattern: string;
|
|
974
|
+
description: string;
|
|
975
|
+
};
|
|
976
|
+
token: {
|
|
977
|
+
type: string;
|
|
978
|
+
enum: string[];
|
|
979
|
+
description: string;
|
|
980
|
+
};
|
|
981
|
+
chain: {
|
|
982
|
+
type: string;
|
|
983
|
+
description: string;
|
|
984
|
+
};
|
|
985
|
+
};
|
|
986
|
+
required: string[];
|
|
987
|
+
};
|
|
988
|
+
};
|
|
989
|
+
'wdk/swap': {
|
|
990
|
+
name: string;
|
|
991
|
+
description: string;
|
|
992
|
+
inputSchema: {
|
|
993
|
+
type: "object";
|
|
994
|
+
properties: {
|
|
995
|
+
fromToken: {
|
|
996
|
+
type: string;
|
|
997
|
+
description: string;
|
|
998
|
+
};
|
|
999
|
+
toToken: {
|
|
1000
|
+
type: string;
|
|
1001
|
+
description: string;
|
|
1002
|
+
};
|
|
1003
|
+
amount: {
|
|
1004
|
+
type: string;
|
|
1005
|
+
pattern: string;
|
|
1006
|
+
description: string;
|
|
1007
|
+
};
|
|
1008
|
+
chain: {
|
|
1009
|
+
type: string;
|
|
1010
|
+
description: string;
|
|
1011
|
+
};
|
|
1012
|
+
};
|
|
1013
|
+
required: string[];
|
|
1014
|
+
};
|
|
1015
|
+
};
|
|
1016
|
+
't402/autoPay': {
|
|
1017
|
+
name: string;
|
|
1018
|
+
description: string;
|
|
1019
|
+
inputSchema: {
|
|
1020
|
+
type: "object";
|
|
1021
|
+
properties: {
|
|
1022
|
+
url: {
|
|
1023
|
+
type: string;
|
|
1024
|
+
description: string;
|
|
1025
|
+
};
|
|
1026
|
+
maxAmount: {
|
|
1027
|
+
type: string;
|
|
1028
|
+
pattern: string;
|
|
1029
|
+
description: string;
|
|
1030
|
+
};
|
|
1031
|
+
preferredChain: {
|
|
1032
|
+
type: string;
|
|
1033
|
+
description: string;
|
|
1034
|
+
};
|
|
1035
|
+
};
|
|
1036
|
+
required: string[];
|
|
1037
|
+
};
|
|
1038
|
+
};
|
|
1039
|
+
};
|
|
423
1040
|
|
|
424
|
-
export { type AllBalancesResult, type BridgeInput, type BridgeOptions, GASLESS_SUPPORTED_NETWORKS, type GetAllBalancesInput, type GetBalanceInput, type GetBridgeFeeInput, type PayGaslessInput, type PayGaslessOptions, type PayInput, type PayOptions, TOOL_DEFINITIONS, bridgeInputSchema, executeBridge, executeGetAllBalances, executeGetBalance, executeGetBridgeFee, executePay, executePayGasless, formatAllBalancesResult, formatBalanceResult, formatBridgeFeeResult, formatBridgeResult, formatGaslessPaymentResult, formatPaymentResult, getAllBalancesInputSchema, getBalanceInputSchema, getBridgeFeeInputSchema, payGaslessInputSchema, payInputSchema };
|
|
1041
|
+
export { type AllBalancesResult, type AutoPayInput, type AutoPayResult, type BridgeInput, type BridgeOptions, GASLESS_SUPPORTED_NETWORKS, type GetAllBalancesInput, type GetBalanceInput, type GetBridgeFeeInput, type PayGaslessInput, type PayGaslessOptions, type PayInput, type PayOptions, type PaymentPlanInput, type PaymentPlanResult, type SmartPayInput, type SmartPayResult, type SmartPayStep, TOOL_DEFINITIONS, UNIFIED_TOOL_DEFINITIONS, type UnifiedMcpConfig, WDK_TOOL_DEFINITIONS, type WdkBalancesResult, type WdkGetBalancesInput, type WdkGetWalletInput, type WdkSwapInput, type WdkSwapResult, type WdkTransferInput, type WdkTransferResult, type WdkWalletInfo, autoPayInputSchema, bridgeInputSchema, executeAutoPay, executeAutoPayDemo, executeBridge, executeGetAllBalances, executeGetBalance, executeGetBridgeFee, executePay, executePayGasless, executePaymentPlan, executePaymentPlanDemo, executeSmartPay, executeSmartPayDemo, executeWdkGetBalances, executeWdkGetBalancesDemo, executeWdkGetWallet, executeWdkGetWalletDemo, executeWdkSwap, executeWdkSwapDemo, executeWdkTransfer, executeWdkTransferDemo, formatAllBalancesResult, formatAutoPayResult, formatBalanceResult, formatBridgeFeeResult, formatBridgeResult, formatGaslessPaymentResult, formatPaymentPlanResult, formatPaymentResult, formatSmartPayResult, formatWdkBalancesResult, formatWdkSwapResult, formatWdkTransferResult, formatWdkWalletResult, getAllBalancesInputSchema, getBalanceInputSchema, getBridgeFeeInputSchema, payGaslessInputSchema, payInputSchema, paymentPlanInputSchema, smartPayInputSchema, wdkGetBalancesInputSchema, wdkGetWalletInputSchema, wdkSwapInputSchema, wdkTransferInputSchema };
|