Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
7 changes: 0 additions & 7 deletions src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(())
}

Expand Down
4 changes: 0 additions & 4 deletions src/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,10 +253,6 @@ pub struct PriceData {
pub currency: String,
#[serde(default)]
pub as_of: Option<i64>,
#[serde(default)]
pub method: Option<String>,
#[serde(default)]
pub fx_date: Option<String>,
}

#[derive(Debug, Deserialize)]
Expand Down
2 changes: 1 addition & 1 deletion src/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ fn commands() -> Value {
},
"price <network> [--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 <network> [--page N] [--page-size 25|50|100]": {
Expand Down
13 changes: 13 additions & 0 deletions tests/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"]);
}
Loading