Skip to content

Improve x402 wallet UX: bare command shows info, deprecate info subcommand#295

Merged
jancurn merged 6 commits into
mainfrom
claude/x402-command-interface-3b5b8o
Jul 8, 2026
Merged

Improve x402 wallet UX: bare command shows info, deprecate info subcommand#295
jancurn merged 6 commits into
mainfrom
claude/x402-command-interface-3b5b8o

Conversation

@jancurn

@jancurn jancurn commented Jun 27, 2026

Copy link
Copy Markdown
Member

mcpc x402 with no subcommand now shows the wallet info (address, balances, funding QR code) instead of the command help, matching how other commands behave. The mcpc x402 info subcommand is deprecated — hidden from help, prints a warning — and will be removed in a future release.

  • Balance labels are lowercase and always show at least 6 decimal places; a fetch failure prints a single "Failed to fetch balances" line
  • The funding QR code renders in bright white for easier scanning
  • Every x402 subcommand's help now documents its --json output shape, and x402 sign explains that it prints the PAYMENT-SIGNATURE header to stdout
  • Shared jsonHelp() helper moved from index.ts to output.ts for reuse

🤖 Generated with Claude Code

https://claude.ai/code/session_014hPgskXe8VWjXW4aFJixaM

claude added 4 commits June 27, 2026 21:05
Running "mcpc x402" with no subcommand previously printed the command
help, which is inconsistent with other commands. It now shows wallet
info (or how to create a wallet) plus a hint pointing to "mcpc help
x402" for the full reference. The "info" subcommand is deprecated: it is
hidden from help and prints a deprecation warning, and will be removed
in a future release.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014hPgskXe8VWjXW4aFJixaM
Change "ETH Balance"/"USDC Balance" to lowercase "balance" and always
show at least 6 decimal places (e.g. "1.000000"), keeping any extra
precision.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014hPgskXe8VWjXW4aFJixaM
Clarify that "x402 sign" signs the PAYMENT-REQUIRED header offline and
prints the PAYMENT-SIGNATURE header to stdout, and add the standard
"JSON output (--json):" section to every x402 subcommand's help, matching
the other commands. Move the shared jsonHelp helper into output.ts so
both index.ts and the x402 command can use it.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014hPgskXe8VWjXW4aFJixaM
Render the wallet funding QR code with chalk.whiteBright so the modules
stand out against the terminal background and are easier to scan.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014hPgskXe8VWjXW4aFJixaM
Comment thread src/cli/commands/x402.ts Outdated
console.log(` ${chalk.bold('USDC balance')} ${padDecimals(usdcBalance, 6)}`);
} else {
console.log(` ${chalk.bold('Balances')} ${theme.red('Failed to fetch')}`);
console.log(` ${chalk.bold('balances')} ${theme.red('Failed to fetch')}`);

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Show this as one text "Failed to fetch balances"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done — now shows a single red Failed to fetch balances line instead of a balances label with a Failed to fetch value (413a873).


Generated by Claude Code

claude added 2 commits June 27, 2026 22:05
Address review feedback: render the balance-fetch failure as one
"Failed to fetch balances" message instead of a "balances" label paired
with a "Failed to fetch" value.

Refs #295

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014hPgskXe8VWjXW4aFJixaM
Resolve CHANGELOG.md conflict by keeping both Unreleased entries
(Changed before Fixed).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014hPgskXe8VWjXW4aFJixaM
@jancurn
jancurn marked this pull request as ready for review July 8, 2026 13:32
@jancurn
jancurn requested a review from MQ37 July 8, 2026 13:32
@jancurn
jancurn merged commit dd4603e into main Jul 8, 2026
6 checks passed
@jancurn
jancurn deleted the claude/x402-command-interface-3b5b8o branch July 8, 2026 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants