Skip to content

Commit 1e41273

Browse files
authored
fix: remove deprecated /api/v1/order/closePosition endpoint (#10)
The POST /order/closePosition endpoint has been deprecated by BitMEX. Removes the `close-position` subcommand from `bitmex order` and its entry from the tool catalog. Bump version to 1.0.1.
1 parent 3200380 commit 1e41273

4 files changed

Lines changed: 2 additions & 31 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "bitmex-cli"
3-
version = "1.0.0"
3+
version = "1.0.1"
44
edition = "2024"
55
description = "BitMEX CLI — trade, query, and manage your BitMEX account from the terminal"
66
license = "MIT"

agents/tool-catalog.json

Lines changed: 0 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/cli/commands/order.rs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,6 @@ pub(crate) enum OrderCommand {
9191
CancelAfter {
9292
timeout: u64,
9393
},
94-
/// Close a position with a market order.
95-
ClosePosition {
96-
symbol: String,
97-
#[arg(long)]
98-
price: Option<f64>,
99-
},
10094
/// List open (or all) orders.
10195
List {
10296
#[arg(long)]
@@ -219,16 +213,6 @@ pub(crate) async fn run(
219213
Ok(CommandOutput::from_json(val))
220214
}
221215

222-
OrderCommand::ClosePosition { symbol, price } => {
223-
if !ctx.force {
224-
confirm_destructive(&format!("Close position for {}?", symbol))?;
225-
}
226-
let mut body = json!({ "symbol": symbol });
227-
if let Some(p) = price { body["price"] = json!(p); }
228-
let val = client.post("/order/closePosition", &body, creds).await?;
229-
Ok(CommandOutput::from_json(val))
230-
}
231-
232216
OrderCommand::List {
233217
symbol, filter, count, reverse, start_time, end_time,
234218
} => {

0 commit comments

Comments
 (0)