Skip to content

Phase 2 — Address Balance Checker + unified CLI - #5

Merged
devdavidejesus merged 2 commits into
mainfrom
phase-2-balance
Jul 26, 2026
Merged

Phase 2 — Address Balance Checker + unified CLI#5
devdavidejesus merged 2 commits into
mainfrom
phase-2-balance

Conversation

@devdavidejesus

Copy link
Copy Markdown
Owner

Closes #1

What's new

  • btc-toolkit balance <address> —> confirmed + unconfirmed (mempool) balance for any address type (P2PKH, P2SH, Bech32, Taproot), mainnet and testnet
  • Unified CLI — single btc-toolkit command with subcommands; Phase 1 is now btc-toolkit opreturn <txid>
  • Shared HTTP client (api.py) —> all current and future phases use one client, no duplication
  • Integer-only sats→BTC conversion —> satoshi-exact, no float precision loss

Verification

  • 36 tests (18 opreturn + 18 balance), all API calls mocked — suite runs offline
  • Verified on-chain: balance of 1A1zP1eP...DivfNa (genesis address) matches mempool.space exactly —> 57.32133862 BTC

Breaking change

Command renamed: python -m op_return_reader <txid>btc-toolkit opreturn <txid>

- New unified package btc_toolkit/ with subcommands (opreturn, balance)
- Shared Mempool.space HTTP client (api.py) reused by all phases
- balance: confirmed + unconfirmed (mempool) balance, all address types
- Integer-only sats→BTC conversion (no float precision loss)
- 36 tests (18 opreturn + 18 balance), all API calls mocked
- Verified on-chain against mempool.space (genesis address, exact match)
- BREAKING: command changed from 'python -m op_return_reader' to
  'btc-toolkit <subcommand>'
@devdavidejesus
devdavidejesus merged commit bbe8a45 into main Jul 26, 2026
4 checks passed
@devdavidejesus
devdavidejesus deleted the phase-2-balance branch July 26, 2026 01:22
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.

Phase 2 — Address Balance Checker

1 participant