@champz-llc/legends-mcp-server 1.6.0 → 1.7.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/index.js +236 -25
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -382,15 +382,228 @@ Last updated: ${new Date(stats.cached_at * 1000).toLocaleString()}`;
382
382
  };
383
383
  }
384
384
 
385
- let output = 'šŸ„ Legends of Champz - Claimable Rewards\n\n';
386
- output += `${data.message}\n\n`;
387
- output += `šŸ’° **Total Claimable:**\n`;
388
- if (data.total_champz !== '0.00 CHAMPZ') output += ` šŸ„ ${data.total_champz}\n`;
389
- if (data.total_usdc !== '0.00 USDC') output += ` šŸ’µ ${data.total_usdc}\n`;
390
- output += `\nšŸ“ Ready to execute on Base L2 (Chain ID: ${data.chain_id})\n`;
385
+ // Build HTML artifact with real token icons
386
+ const champzIcon = 'https://img.champz.world/img/icon_small.png';
387
+ const usdcIcon = 'https://img.champz.world/img/loots/usdc.svg';
388
+
389
+ let claimsHTML = '';
390
+
391
+ // CHAMPZ claims
392
+ if (data.champz_claims.length > 0) {
393
+ data.champz_claims.forEach((claim, idx) => {
394
+ const typeIcon = claim.claim_type === 18 ? 'šŸ‘‘' : 'āš”ļø';
395
+ const typeColor = claim.claim_type === 18 ? '#9D4EDD' : '#4EA8DE';
396
+ claimsHTML += `
397
+ <div class="claim-card">
398
+ <div class="claim-header">
399
+ <span class="claim-number">#${idx + 1}</span>
400
+ <span class="claim-type" style="background: ${typeColor};">${typeIcon} ${claim.claim_type_name}</span>
401
+ </div>
402
+ <div class="claim-amount">
403
+ <img src="${champzIcon}" alt="CHAMPZ" class="token-icon">
404
+ <span class="amount">${claim.amount_human}</span>
405
+ </div>
406
+ <div class="claim-footer">
407
+ <span class="expires">Expires: ${new Date(claim.expires_at).toLocaleDateString()}</span>
408
+ </div>
409
+ </div>
410
+ `;
411
+ });
412
+ }
413
+
414
+ // USDC claims
415
+ if (data.usdc_claims.length > 0) {
416
+ const champzClaimsCount = data.champz_claims.length;
417
+ data.usdc_claims.forEach((claim, idx) => {
418
+ const typeIcon = claim.claim_type === 5 ? 'āš”ļø' : claim.claim_type === 6 ? 'šŸ‘‘' : 'šŸ¤–';
419
+ const typeColor = claim.claim_type === 5 ? '#4EA8DE' : claim.claim_type === 6 ? '#9D4EDD' : '#FFD700';
420
+ claimsHTML += `
421
+ <div class="claim-card">
422
+ <div class="claim-header">
423
+ <span class="claim-number">#${champzClaimsCount + idx + 1}</span>
424
+ <span class="claim-type" style="background: ${typeColor};">${typeIcon} ${claim.claim_type_name}</span>
425
+ </div>
426
+ <div class="claim-amount">
427
+ <img src="${usdcIcon}" alt="USDC" class="token-icon">
428
+ <span class="amount">${claim.amount_human}</span>
429
+ </div>
430
+ <div class="claim-footer">
431
+ <span class="expires">Expires: ${new Date(claim.expires_at).toLocaleDateString()}</span>
432
+ </div>
433
+ </div>
434
+ `;
435
+ });
436
+ }
437
+
438
+ const html = `<!DOCTYPE html>
439
+ <html>
440
+ <head>
441
+ <meta charset="UTF-8">
442
+ <style>
443
+ * { margin: 0; padding: 0; box-sizing: border-box; }
444
+ body {
445
+ font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
446
+ background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
447
+ padding: 20px;
448
+ min-height: 100vh;
449
+ }
450
+ .container {
451
+ max-width: 600px;
452
+ margin: 0 auto;
453
+ }
454
+ .header {
455
+ text-align: center;
456
+ margin-bottom: 24px;
457
+ padding-bottom: 16px;
458
+ border-bottom: 2px solid rgba(255,255,255,0.1);
459
+ }
460
+ .header h1 {
461
+ color: #fff;
462
+ font-size: 24px;
463
+ margin-bottom: 8px;
464
+ }
465
+ .header .subtitle {
466
+ color: #aaa;
467
+ font-size: 14px;
468
+ }
469
+ .claim-card {
470
+ background: linear-gradient(145deg, #2a2a3e 0%, #1f1f2e 100%);
471
+ border-radius: 12px;
472
+ padding: 16px;
473
+ margin-bottom: 12px;
474
+ border: 1px solid rgba(255,255,255,0.1);
475
+ transition: transform 0.2s;
476
+ }
477
+ .claim-card:hover {
478
+ transform: translateY(-2px);
479
+ border-color: rgba(157, 78, 221, 0.5);
480
+ }
481
+ .claim-header {
482
+ display: flex;
483
+ justify-content: space-between;
484
+ align-items: center;
485
+ margin-bottom: 12px;
486
+ }
487
+ .claim-number {
488
+ background: rgba(255,255,255,0.1);
489
+ color: #fff;
490
+ padding: 4px 10px;
491
+ border-radius: 12px;
492
+ font-size: 12px;
493
+ font-weight: bold;
494
+ }
495
+ .claim-type {
496
+ padding: 4px 12px;
497
+ border-radius: 12px;
498
+ font-size: 12px;
499
+ font-weight: bold;
500
+ color: #fff;
501
+ }
502
+ .claim-amount {
503
+ display: flex;
504
+ align-items: center;
505
+ gap: 12px;
506
+ margin-bottom: 12px;
507
+ }
508
+ .token-icon {
509
+ width: 32px;
510
+ height: 32px;
511
+ border-radius: 50%;
512
+ background: rgba(255,255,255,0.1);
513
+ padding: 2px;
514
+ }
515
+ .amount {
516
+ color: #fff;
517
+ font-size: 20px;
518
+ font-weight: bold;
519
+ }
520
+ .claim-footer {
521
+ display: flex;
522
+ justify-content: space-between;
523
+ padding-top: 8px;
524
+ border-top: 1px solid rgba(255,255,255,0.05);
525
+ }
526
+ .expires {
527
+ color: #888;
528
+ font-size: 11px;
529
+ }
530
+ .summary {
531
+ background: linear-gradient(135deg, rgba(157, 78, 221, 0.2), rgba(77, 144, 254, 0.2));
532
+ border: 2px solid #9D4EDD;
533
+ border-radius: 12px;
534
+ padding: 16px;
535
+ margin-top: 16px;
536
+ text-align: center;
537
+ }
538
+ .summary-title {
539
+ color: #aaa;
540
+ font-size: 12px;
541
+ margin-bottom: 8px;
542
+ text-transform: uppercase;
543
+ letter-spacing: 1px;
544
+ }
545
+ .summary-amount {
546
+ display: flex;
547
+ align-items: center;
548
+ justify-content: center;
549
+ gap: 8px;
550
+ margin: 8px 0;
551
+ }
552
+ .summary-amount img {
553
+ width: 24px;
554
+ height: 24px;
555
+ }
556
+ .summary-amount span {
557
+ color: #fff;
558
+ font-size: 18px;
559
+ font-weight: bold;
560
+ }
561
+ .footer-note {
562
+ text-align: center;
563
+ color: #888;
564
+ font-size: 12px;
565
+ margin-top: 16px;
566
+ padding: 12px;
567
+ background: rgba(255,255,255,0.05);
568
+ border-radius: 8px;
569
+ }
570
+ </style>
571
+ </head>
572
+ <body>
573
+ <div class="container">
574
+ <div class="header">
575
+ <h1>šŸ„ Claimable Rewards</h1>
576
+ <div class="subtitle">${data.message}</div>
577
+ </div>
578
+
579
+ ${claimsHTML}
580
+
581
+ <div class="summary">
582
+ <div class="summary-title">Total Claimable</div>
583
+ ${data.total_champz !== '0 CHAMPZ' ? `
584
+ <div class="summary-amount">
585
+ <img src="${champzIcon}" alt="CHAMPZ">
586
+ <span>${data.total_champz}</span>
587
+ </div>
588
+ ` : ''}
589
+ ${data.total_usdc !== '0.00 USDC' ? `
590
+ <div class="summary-amount">
591
+ <img src="${usdcIcon}" alt="USDC">
592
+ <span>${data.total_usdc}</span>
593
+ </div>
594
+ ` : ''}
595
+ </div>
596
+
597
+ <div class="footer-note">
598
+ šŸ“ Ready to execute on Base L2 (Chain ID: ${data.chain_id})<br>
599
+ šŸ’” Claims are executed one at a time through Base MCP
600
+ </div>
601
+ </div>
602
+ </body>
603
+ </html>`;
391
604
 
392
605
  return {
393
- content: [{ type: 'text', text: output }],
606
+ content: [{ type: 'text', text: html }],
394
607
  };
395
608
  } catch (error) {
396
609
  return {
@@ -421,27 +634,26 @@ Last updated: ${new Date(stats.cached_at * 1000).toLocaleString()}`;
421
634
  };
422
635
  }
423
636
 
424
- // Return all CHAMPZ claims with contract data
425
- const claimsOutput = data.champz_claims.map(claim => ({
426
- claim_id: claim.claim_id,
427
- claim_type: claim.claim_type_name,
428
- amount: claim.amount_human,
637
+ // Return FIRST claim only (Base MCP works better with single claim)
638
+ // User can claim one at a time
639
+ const claim = data.champz_claims[0];
640
+ const claimOutput = {
641
+ claim_type: 'CHAMPZ Tokens',
429
642
  contract_address: claim.contract,
430
643
  chain: 'Base (8453)',
431
- expires_at: claim.expires_at,
644
+ amount: claim.amount_human,
432
645
  contract_call: {
433
646
  function: claim.function_name,
434
647
  parameters: claim.parameters,
435
- abi_function: claim.abi_function,
436
648
  abi: CHAMPZ_REWARDS_ABI
437
649
  }
438
- }));
650
+ };
439
651
 
440
652
  return {
441
653
  content: [
442
654
  {
443
655
  type: 'text',
444
- text: JSON.stringify(claimsOutput, null, 2),
656
+ text: JSON.stringify(claimOutput, null, 2),
445
657
  },
446
658
  ],
447
659
  };
@@ -474,27 +686,26 @@ Last updated: ${new Date(stats.cached_at * 1000).toLocaleString()}`;
474
686
  };
475
687
  }
476
688
 
477
- // Return all USDC claims with contract data
478
- const claimsOutput = data.usdc_claims.map(claim => ({
479
- claim_id: claim.claim_id,
480
- claim_type: claim.claim_type_name,
481
- amount: claim.amount_human,
689
+ // Return FIRST claim only (Base MCP works better with single claim)
690
+ // User can claim one at a time
691
+ const claim = data.usdc_claims[0];
692
+ const claimOutput = {
693
+ claim_type: 'USDC Rewards',
482
694
  contract_address: claim.contract,
483
695
  chain: 'Base (8453)',
484
- expires_at: claim.expires_at,
696
+ amount: claim.amount_human,
485
697
  contract_call: {
486
698
  function: claim.function_name,
487
699
  parameters: claim.parameters,
488
- abi_function: claim.abi_function,
489
700
  abi: USDC_REWARDS_ABI
490
701
  }
491
- }));
702
+ };
492
703
 
493
704
  return {
494
705
  content: [
495
706
  {
496
707
  type: 'text',
497
- text: JSON.stringify(claimsOutput, null, 2),
708
+ text: JSON.stringify(claimOutput, null, 2),
498
709
  },
499
710
  ],
500
711
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@champz-llc/legends-mcp-server",
3
- "version": "1.6.0",
3
+ "version": "1.7.0",
4
4
  "description": "MCP server for Legends of Champz - Query game stats, access personal data with signature auth, and claim rewards through Claude Desktop",
5
5
  "type": "module",
6
6
  "main": "index.js",