From 8cfe89fdc842445b4ac2736efbb7d9a904705e49 Mon Sep 17 00:00:00 2001 From: Atif Nazir Date: Mon, 12 Oct 2026 20:06:59 -0700 Subject: [PATCH] Release 0.1.3: show the price alone --- CHANGELOG.md | 9 ++++++++- Cargo.lock | 2 +- Cargo.toml | 2 +- src/commands.rs | 7 ------- src/model.rs | 4 ---- src/schema.rs | 2 +- tests/cli.rs | 13 +++++++++++++ 7 files changed, 24 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c2ef77..a2bab56 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,12 @@ names, environment variables, exit codes, error codes, and the shape of ## [Unreleased] +## [0.1.3] - 2026-10-13 + +### Changed + +- `price` shows the price alone, in the currency asked for. + ## [0.1.2] - 2026-10-13 ### Changed @@ -46,7 +52,8 @@ names, environment variables, exit codes, error codes, and the shape of - `skill` and `mcp` to set up AI agents. - `schema` and `guide` for scripts and agents. -[Unreleased]: https://github.com/BlockIo/sochain-cli/compare/v0.1.2...HEAD +[Unreleased]: https://github.com/BlockIo/sochain-cli/compare/v0.1.3...HEAD +[0.1.3]: https://github.com/BlockIo/sochain-cli/compare/v0.1.2...v0.1.3 [0.1.2]: https://github.com/BlockIo/sochain-cli/compare/v0.1.1...v0.1.2 [0.1.1]: https://github.com/BlockIo/sochain-cli/compare/v0.1.0...v0.1.1 [0.1.0]: https://github.com/BlockIo/sochain-cli/releases/tag/v0.1.0 diff --git a/Cargo.lock b/Cargo.lock index 9debb31..2b77497 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1452,7 +1452,7 @@ checksum = "f9395f0f0eee849a9b707b2f06bb92a6a422090e2123bb2ef8e87a0e61892a8e" [[package]] name = "sochain-cli" -version = "0.1.2" +version = "0.1.3" dependencies = [ "assert_cmd", "clap", diff --git a/Cargo.toml b/Cargo.toml index bc33dc3..877b4e1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sochain-cli" -version = "0.1.2" +version = "0.1.3" edition = "2024" rust-version = "1.88" description = "Command-line interface for SoChain: Bitcoin, Litecoin, Dogecoin and Zcash blockchain data" diff --git a/src/commands.rs b/src/commands.rs index 081f7bb..5528853 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -968,13 +968,6 @@ fn show_price(out: &mut dyn Write, n: Network, historic: bool, p: PriceData) -> _ => String::new(), }; writeln!(out, "1 {n} = {price}{when}")?; - if p.method.as_deref() == Some("usd_fx") { - let date = p.fx_date.map(|d| format!(" of {d}")).unwrap_or_default(); - writeln!( - out, - "Converted from US dollars at the ECB reference rate{date}." - )?; - } Ok(()) } diff --git a/src/model.rs b/src/model.rs index 2596fd7..6d6608e 100644 --- a/src/model.rs +++ b/src/model.rs @@ -253,10 +253,6 @@ pub struct PriceData { pub currency: String, #[serde(default)] pub as_of: Option, - #[serde(default)] - pub method: Option, - #[serde(default)] - pub fx_date: Option, } #[derive(Debug, Deserialize)] diff --git a/src/schema.rs b/src/schema.rs index 40a1ee8..d2962e1 100644 --- a/src/schema.rs +++ b/src/schema.rs @@ -130,7 +130,7 @@ fn commands() -> Value { }, "price [--time T]": { "api": "GET /price/{network} or GET /price/{network}/{unix_timestamp}", - "data": "value, currency, as_of?, sources?; with --currency: method (native | usd_fx), fx_rate?, fx_date? (usd_fx only)", + "data": "value, currency, as_of? (the latest price only)", "notes": "--time takes unix seconds or a date and gives that UTC day's opening price" }, "rich-list [--page N] [--page-size 25|50|100]": { diff --git a/tests/cli.rs b/tests/cli.rs index b13974e..ec64704 100644 --- a/tests/cli.rs +++ b/tests/cli.rs @@ -1093,3 +1093,16 @@ fn account_shows_the_monthly_quota() { "Requests this month 12,345 of 500,000 ยท resets in 3 days 4 h", )); } + +#[test] +fn price_in_another_currency_is_just_the_price() { + let m = mock(vec![ok( + json!({ "value": "70000.00000000", "currency": "EUR", "as_of": 1_790_000_000 }), + )]); + sochain(&m, &config()) + .args(["price", "BTC", "--currency", "EUR"]) + .assert() + .success() + .stdout("1 BTC = 70,000.00 EUR as of 2026-09-21 14:13:20 UTC\n"); + assert_eq!(m.paths(), ["/api/v3/price/BTC?currency=EUR"]); +}