feat(bitcoin): Maestro data provider and first-class coin selection#10
Open
jinglescode wants to merge 1 commit into
Open
feat(bitcoin): Maestro data provider and first-class coin selection#10jinglescode wants to merge 1 commit into
jinglescode wants to merge 1 commit into
Conversation
Milestone: standard headless wallet on Bitcoin. - MaestroProvider implements IBitcoinProvider against Maestro's Esplora-compatible Bitcoin API using platform fetch (no new deps): address info/UTXOs/txs, per-tx unspent outputs via outspends, tx status, sat/vB fee estimates with closest-target selection, and raw-tx broadcast. - Extract largest-first coin selection from BitcoinHeadlessWallet into src/bitcoin/utils/coin-selection.ts and export it; behavior unchanged (BIP-141 vbyte model, 546-sat dust handling). - Unit tests for provider (mocked HTTP) and coin selection. - README Bitcoin section and bitcoin-milestone.md evidence doc. Co-Authored-By: Claude Fable 5 <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.
Milestone: standard headless wallet on Bitcoin
Closes the remaining gap for the Bitcoin headless wallet milestone: the wallet, coin selection, and
signTransferalready existed insrc/, but no concrete data provider did. This PR adds the Maestro provider and promotes coin selection to a first-class, tested module.A1 — UTXO querying via Maestro
MaestroProvider(src/bitcoin/providers/maestro.ts) implements the existingIBitcoinProviderinterface against Maestro's Esplora-compatible Bitcoin API: address info/UTXOs, per-tx unspent outputs (via/outspends), paginated tx history, tx status, sat/vB fee estimates (closest-target selection, testnet fallback), and raw-tx broadcast.fetch— zero new runtime dependencies. Shared plumbing insrc/bitcoin/providers/common.tswith a typedProviderHttpError.A2 — Coin selection on queried UTXOs
src/bitcoin/utils/coin-selection.tsand exported it (selectUtxosLargestFirst,DUST_THRESHOLD_P2WPKH). Behavior unchanged: BIP-141 vbyte fee model, 546-sat dust absorption.BitcoinHeadlessWallet.signTransfernow delegates to it.A3 — Send transfer
signTransferflow (query → select → PSBT → sign → broadcast) runs end-to-end on the Maestro provider; covered by the existing wallet regression tests.Tests & docs
bitcoin-milestone.mdmapping acceptance criteria to code.🤖 Generated with Claude Code