feat(wallet): ecash gets the real payment success screen, with copyable proof
Demo images / Build & push demo images (push) Failing after 2m37s
Demo images / Build & push demo images (push) Failing after 2m37s
Redeeming ecash reported success as one line of small green text, while an on-chain or Lightning payment got the full moment — amount, verb, and the identifiers you can copy. That asymmetry matters most for ecash: it leaves no public ledger entry, so if the payment is ever questioned there is nothing to look up afterwards. Whatever isn't copyable at that instant is simply gone. The success pane is extracted from SendBitcoinModal into a shared PaymentSuccessPane so Cashu and Fedimint show the *same* screen rather than a lookalike, and the copyable-row treatment is defined once. Each caller passes the identifiers its protocol actually has; ecash receive now shows the issuing mint (newly returned by wallet.ecash-receive) and the redeemed token itself, clamped so a long token doesn't flood the pane. Also: the test-ecash switch is a proper toggle (role="switch", keyboard focusable) rather than a checkbox — it selects which purse the wallet is looking at, so it should read as a mode you are in. SendBitcoinModal still carries its own copy of the markup; consolidating it onto the shared component is a follow-up, deliberately not done in the same change as the money-path wiring. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
ffec7d3114
commit
f4a1c47429
@@ -206,10 +206,17 @@ impl RpcHandler {
|
||||
// (redeemed at the mint) or Fedimint notes (reissued via the fmcd
|
||||
// sidecar). Detect by prefix and route accordingly.
|
||||
if is_cashu_token(token) {
|
||||
// Which mint issued it, for the success screen. Ecash leaves no
|
||||
// public trace once redeemed, so the mint URL is the only thing a
|
||||
// person can quote later if the payment is ever disputed.
|
||||
let mint_url = crate::wallet::cashu::CashuToken::deserialize(token)
|
||||
.ok()
|
||||
.and_then(|t| t.mint_urls().first().map(|m| m.to_string()));
|
||||
let amount = ecash::receive_token(&self.config.data_dir, token).await?;
|
||||
return Ok(serde_json::json!({
|
||||
"received_sats": amount,
|
||||
"kind": "cashu",
|
||||
"mint_url": mint_url,
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user