Skip to content

feat: Add QR code display for wallet addresses in x402 commands#122

Draft
MQ37 wants to merge 1 commit intomainfrom
claude/add-qr-code-wallet-wU0xh
Draft

feat: Add QR code display for wallet addresses in x402 commands#122
MQ37 wants to merge 1 commit intomainfrom
claude/add-qr-code-wallet-wU0xh

Conversation

@MQ37
Copy link
Copy Markdown
Collaborator

@MQ37 MQ37 commented Mar 28, 2026

Summary

This PR adds QR code generation and display functionality to the x402 CLI commands, allowing users to easily scan and fund their wallets directly from the terminal.

Key Changes

  • Added qrcode-terminal dependency to generate QR codes in the terminal
  • Implemented generateQrCode() helper function that wraps the qrcode-terminal library with Promise-based API
  • Implemented printAddressQrCode() function to display formatted QR codes with proper indentation and labels
  • Integrated QR code display into three x402 commands:
    • x402 init: Shows QR code after wallet creation
    • x402 import: Shows QR code after wallet import
    • x402 info: Shows QR code when displaying wallet information
  • Updated CHANGELOG.md to document the new feature

Implementation Details

  • QR codes are generated using the "small" (half-block) mode for compact terminal display
  • Each QR code is prefixed with "Scan to fund this wallet:" label
  • Output is properly indented (2 spaces) to align with surrounding CLI output
  • The implementation uses async/await pattern for consistency with the rest of the codebase

https://claude.ai/code/session_018sHtRmQ1eguqqLZxzDzxK9

Show a scannable QR code in the terminal when running x402 init,
x402 import, and x402 info, so users can easily fund the wallet
by scanning the code with their mobile wallet app.

https://claude.ai/code/session_018sHtRmQ1eguqqLZxzDzxK9
@MQ37 MQ37 changed the title Add QR code display for wallet addresses in x402 commands feat: Add QR code display for wallet addresses in x402 commands Mar 28, 2026
@MQ37 MQ37 marked this pull request as draft March 28, 2026 01:58
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