Skip to content

Adds send and broadcast support to the demo wallet#82

Open
Johnosezele wants to merge 5 commits into
bitcoindevkit:mainfrom
Johnosezele:feat/send-broadcast
Open

Adds send and broadcast support to the demo wallet#82
Johnosezele wants to merge 5 commits into
bitcoindevkit:mainfrom
Johnosezele:feat/send-broadcast

Conversation

@Johnosezele

@Johnosezele Johnosezele commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Adds a full send flow to the demo wallet. The /send route now presents a validated single recipient form, loads fee-rate suggestions from the active wallet network without blocking the UI isolate, supports sats and BTC amount entry, and requires confirmation before signing and broadcasting.

Notes to Reviewers

  • Fee suggestions run through an injectable isolate job runner so slow backend calls do not freeze Send navigation.
  • The transaction build/broadcast boundary remains sats-based even when the UI displays BTC, because WalletService.buildTransaction take integer satoshis (Amount.fromSat) and floating point BTC in the service layer would invite rounding errors, the UI converts once at submit time and the confirmation dialog shows both units so the user can verify the exact spend.

@Johnosezele Johnosezele changed the title Adds send/broadcast support to the demo wallet Adds send and broadcast support to the demo wallet Jun 15, 2026
@Johnosezele Johnosezele force-pushed the feat/send-broadcast branch from ac8c97c to fb9b45a Compare June 15, 2026 23:37
@Johnosezele Johnosezele marked this pull request as ready for review June 16, 2026 01:44
}

final transaction = psbt.extractTx();
blockchainClient.broadcast(transaction);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After a successful broadcast I think we should apply the transaction to the wallet as unconfirmed and persist those staged changes before returning. TxBuilder.finish() only stages/persists the change address reservation; it does not record this spend in the wallet graph. Without wallet.applyUnconfirmedTxs([...]) plus persistence, the UI can keep showing the spent UTXO as available and a second send before sync can reuse it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching this. I've updated the broadcast path to apply the extracted transaction as unconfirmed after a successful broadcast, then persist the staged wallet changes before returning... that should keep the local wallet graph from treating the spent UTXO as available while we wait for the next sync.

@Johnosezele Johnosezele force-pushed the feat/send-broadcast branch from fb9b45a to 5c7492b Compare June 17, 2026 04:08
@Johnosezele Johnosezele requested a review from reez June 17, 2026 04:45
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.

2 participants