Skip to content

Add CLI with wallet store, subscriptions, and docs#163

Open
yashasvi-ranawat wants to merge 11 commits intopybitcash:masterfrom
yashasvi-ranawat:cli
Open

Add CLI with wallet store, subscriptions, and docs#163
yashasvi-ranawat wants to merge 11 commits intopybitcash:masterfrom
yashasvi-ranawat:cli

Conversation

@yashasvi-ranawat
Copy link
Copy Markdown
Contributor

@yashasvi-ranawat yashasvi-ranawat commented Apr 5, 2026

Description

Rewrites and expands bitcash/cli.py from a single gen command into a full-featured CLI for interacting with Bitcoin Cash. Adds stateless blockchain query commands, a send command, real-time subscribe command, and a password-protected named wallet store backed by TinyDB.

Changes

  • Rewrite bitcash/cli.py: new, gen, balance, transactions, unspents, send, subscribe stateless commands
  • Add wallet subgroup: new, list, balance, send, export, delete, subscribe
  • Wallet store backed by TinyDB with privy-encrypted WIFs; passwords accept --password flag, BITCASH_WALLET_PASSWORD env var, or interactive prompt (for agent/scripting use)
  • WalletRecord dataclass replaces freeform dict; Network enum used throughout instead of raw strings
  • Shared NETWORK_OPTION and PASSWORD_OPTION decorators with type-safe callbacks
  • Add docs/guide/cli.rst with full command reference and register it in docs/index.rst toctree
  • Add tests/test_cli.py with 35 tests using CliRunner and isolated in-memory TinyDB

@yashasvi-ranawat yashasvi-ranawat changed the title Add expanded CLI with wallet store, subscriptions, and docs Add CLI with wallet store, subscriptions, and docs Apr 5, 2026
- Rewrites bitcash/cli.py: new, gen, balance, transactions, unspents,
  send, subscribe commands plus wallet subgroup (new, list, balance,
  send, export, delete, subscribe)
- Wallet store backed by TinyDB with privy-encrypted WIFs; passwords
  accept --password flag, BITCASH_WALLET_PASSWORD env var, or prompt
- WalletRecord dataclass replaces freeform dict; Network enum used
  throughout instead of raw strings
- Adds docs/guide/cli.rst and registers it in docs/index.rst toctree
- Adds tests/test_cli.py with 35 tests (CliRunner + isolated in-memory DB)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
yashasvi-ranawat and others added 2 commits April 5, 2026 18:30
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@yashasvi-ranawat yashasvi-ranawat marked this pull request as ready for review April 5, 2026 15:35
yashasvi-ranawat and others added 3 commits April 6, 2026 10:04
- Add `cashtoken-address` command to convert address to CATKN form
- Add `--cashtoken` flag (CASHTOKEN_FLAG) to `balance` and `wallet balance`
  to show token holdings alongside BCH balance
- Extend `send` and `wallet send` with `--category-id`, `--nft-capability`,
  `--nft-commitment` (hex→bytes), `--token-amount`
- Add shared decorators: CASHTOKEN_FLAG, CATEGORY_ID_OPTION,
  NFT_CAPABILITY_OPTION, NFT_COMMITMENT_OPTION, TOKEN_AMOUNT_OPTION
- Add _print_cashtoken_balance and _build_output helpers
- Add 16 new tests (45 total, all passing)
- Update docs/guide/cli.rst with new commands and options

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There is no 'subscriptions' extra — subscription support is part of
the base install. Remove the misleading install hint.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add "BitCash: Python Bitcoin Cash Library" to root group
- Each command now explicitly describes: what network calls it makes,
  what it outputs, key constraints (password required, address must be
  CATKN for token sends, wallet must exist), and when not to use it

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
yashasvi-ranawat and others added 5 commits April 29, 2026 21:10
- Add bitcash/click_agent.py: @agent decorator (MCP ToolAnnotations
  vocabulary + blocking, secret, local_required, skill), _serialize_command
  walker, add_schema_command injector
- Annotate all commands with agent metadata (read_only, destructive,
  idempotent, open_world, blocking, secret, local_required)
- Replace ad-hoc schema implementation with add_schema_command(bitcash)
- Add 5 focused tests: structure, unknown-field rejection, absent-field
  omission, choices/is_flag serialization, sentinel default → null

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Lists addresses holding tokens of a given category ID. Supports
--nft-capability, --nft-commitment (hex), --has-amount, and --network
filters. Now that get_cashtoken_addresses landed in master (PR pybitcash#161),
the command is fully wired up.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

1 participant