Add CLI with wallet store, subscriptions, and docs#163
Open
yashasvi-ranawat wants to merge 11 commits intopybitcash:masterfrom
Open
Add CLI with wallet store, subscriptions, and docs#163yashasvi-ranawat wants to merge 11 commits intopybitcash:masterfrom
yashasvi-ranawat wants to merge 11 commits intopybitcash:masterfrom
Conversation
- 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>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- 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>
- 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Rewrites and expands
bitcash/cli.pyfrom a singlegencommand into a full-featured CLI for interacting with Bitcoin Cash. Adds stateless blockchain query commands, asendcommand, real-timesubscribecommand, and a password-protected named wallet store backed by TinyDB.Changes
bitcash/cli.py:new,gen,balance,transactions,unspents,send,subscribestateless commandswalletsubgroup:new,list,balance,send,export,delete,subscribeprivy-encrypted WIFs; passwords accept--passwordflag,BITCASH_WALLET_PASSWORDenv var, or interactive prompt (for agent/scripting use)WalletRecorddataclass replaces freeform dict;Networkenum used throughout instead of raw stringsNETWORK_OPTIONandPASSWORD_OPTIONdecorators with type-safe callbacksdocs/guide/cli.rstwith full command reference and register it indocs/index.rsttoctreetests/test_cli.pywith 35 tests usingCliRunnerand isolated in-memory TinyDB