Fiat currency display support - #4
Conversation
- Fetch BCH-USD price via watchtower.cash asset-prices API - Display USD value below the BCH balance line - Remove Spendable balance line (causes more confusion than clarity)
…_price Each history entry from Watchtower already includes the BCH-USD rate at that moment (usd_price), so we display the USD conversion inline: IN +0.00362899 BCH | ≈ /bin/zsh.93
paytaca send <addr> 5 --unit usd → converts $5 to BCH at current rate paytaca send <addr> 1000 --unit sats → converts 1000 sats to 0.00001 BCH paytaca send <addr> 0.01 → default BCH (unchanged) Displays the exchange rate when using USD.
Co-authored-by: joemarct <joemarct@users.noreply.github.com>
|
Build passes and all 88 tests pass. Reviewed the 8 changed files for security, correctness, and style. Security Review
Issues Found1. Style / indentation —
|
Co-authored-by: joemarct <joemarct@users.noreply.github.com>
|
Build passes and all 88 tests pass. I made two minor fixes: 1. Missing trailing newline ( 2. Invalid price guard ( Review summary:
Approve with the two fixes applied. |


Overview
Prepares the CLI for multicurrency fiat support by standardizing how fiat amounts are displayed and enriching wallet output with fiat conversions. The default display currency is USD (rendered as
N USD); a user-configurable currency will come in a later version.Changes
send: Show the USD conversion inline with the amount, e.g.Sending 0.00046359 BCH (≈ 1.20 USD) on mainnet, replacing the separate conversion line. Also replaces the--unitoption with a positional[currency]argument (bch,sats/satoshis, orusd), e.g.paytaca send <address> 0.12 usd.balance: Add fiat conversion for both BCH and CashToken balances (e.g.Balance: 23.57 LIFT/≈ 3.17 USD). Drop the Spendable and satoshi lines from the default BCH view; remove the token Spendable concept.swap: Rename the--directionoption to--action(valuessell/buy).N USDinstead of$Nacross all commands (send, balance, wallet info, history, token).v0.5.1.Notes
All fiat output flows through
formatUsd, so switching to another currency later is a single-point change.