Refactor commands

This commit is contained in:
Jon Staab
2026-05-19 17:20:00 -07:00
parent dde4b981b2
commit 2d5eb0ca84
5 changed files with 222 additions and 303 deletions
+2 -2
View File
@@ -24,11 +24,11 @@ pub async fn get_bitcoin_price(currency: &str) -> Result<f64> {
let resp = http.get(url).send().await?;
let body: CoinbaseSpotPriceResponse = resp.error_for_status()?.json().await?;
Ok(body
body
.data
.amount
.parse::<f64>()
.map_err(|e| anyhow!("invalid BTC spot quote for {currency}: {e}"))?)
.map_err(|e| anyhow!("invalid BTC spot quote for {currency}: {e}"))
}
/// Number of decimal places in `currency`'s minor unit, following Stripe's