Adds send and broadcast support to the demo wallet#82
Conversation
ac8c97c to
fb9b45a
Compare
| } | ||
|
|
||
| final transaction = psbt.extractTx(); | ||
| blockchainClient.broadcast(transaction); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
fb9b45a to
5c7492b
Compare
Adds a full send flow to the demo wallet. The
/sendroute 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
WalletService.buildTransactiontake 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.