indodax-cli 0.1.13

A command-line interface for the Indodax cryptocurrency exchange
Documentation
## ๐Ÿš€ Welcome to Indodax CLI v0.1.13

The unofficial, fast, and feature-rich command-line interface for **Indodax**, Indonesia's largest cryptocurrency exchange.

### ๐Ÿ†• What's New in v0.1.13

- **๐Ÿ”’ SSL/TLS Fix**: Switched to `rustls-tls-native-roots` for both HTTP and WebSocket connections. This resolves `UnknownIssuer` errors by correctly loading the system's root certificates from the OS trust store.

### ๐Ÿ†• What's New in v0.1.13

- **๐Ÿ”ฅ WebSocket Reliability Overhaul**:
  - **Connection Stability**: Added application-level Ping (method 7) every 30 seconds and automatic reconnection with exponential backoff for all WebSocket streams.
  - **Private WebSocket (PWS)**: Fully rewritten to support the correct `connect` (authenticate) and `subscribe` flow. Now streams both **Order Updates** and **Balance Updates** in real-time.
  - **Robust Parsing**: Enhanced public WebSocket handlers to support multiple Indodax API response formats (array-based and object-based), ensuring compatibility with all trading pairs.
  - **Flexible Auth**: Introduced `ws_token` configuration. Prioritizes dynamic fetching, followed by user-defined tokens in `config.toml`, with a reliable hardcoded default fallback.
- **๐Ÿ› Bug Fixes**:
  - **Market Pairs**: Fixed an issue where `indodax market pairs` returned an empty table due to an unhandled API response format (JSON array).
  - **Market Trades**: Resolved empty output by correcting the trading pair format (no underscore) required by the trades API.
  - **Market OHLC**: Refactored parser to support the modern array-of-objects response format, ensuring historical candle data is correctly displayed.
  - **WS Token Fetching**: Centralized public WebSocket token logic with robust error handling. Fixes "API method not found" errors by gracefully falling back to the documented static token when dynamic generation is unavailable.
- **๐Ÿ›ก๏ธ Security & Configuration**:
  - Added `ws_token` field to `IndodaxConfig` for custom WebSocket authentication tokens.
  - Improved credential resolution priority to ensure consistency across CLI, ENV, and Config file.
- **๐Ÿงช Enhanced Testing**:
  - Added comprehensive unit tests for WebSocket message parsing and event handling.
  - Introduced `scripts/e2e_websocket_mock.sh` for automated connectivity verification.

### โœจ Core Features

- **๐Ÿค– AI Agent Integration (MCP)**: Built-in Model Context Protocol server. Seamlessly connect your Indodax account to **Claude Desktop, ChatGPT, Cursor, or Gemini CLI**.
- **๐Ÿ”ฅ Real-Time WebSocket Streams**: Live data for tickers, trades, order books, and private order updates.
- **๐Ÿ“Š Comprehensive Market Data**: Access OHLCV, order books, tickers, and price increments without an API key.
- **๐Ÿ’ฐ Full Account Management**: Check balances, track open orders, and view trade/transaction history (V2 API support).
- **๐Ÿ› ๏ธ Powerful Trading**: Execute buy/sell orders (including Market IDR orders) and manage a deadman switch countdown.
- **๐Ÿงช Paper Trading**: Risk-free simulated environment with virtual balances to test your strategies.
- **๐Ÿ” Secure & Flexible**: HMAC-SHA512 signing, 0600 config permissions, and support for ENV vars/CLI flags.

### ๐Ÿ“ฆ Installation

**From NPM:**
```bash
npm install -g indodax-cli
```

**From Source (requires Rust):**
```bash
git clone https://github.com/ibidathoillah/indodax-cli.git
cd indodax-cli
cargo install --path .
```

### ๐Ÿค– MCP Integration
Add this to your `claude_desktop_config.json`:
```json
{
  "mcpServers": {
    "indodax": {
      "command": "indodax",
      "args": ["mcp", "-s", "all"]
    }
  }
}
```

---
*Disclaimer: This is an unofficial tool. Trading cryptocurrency involves significant risk. Use at your own risk.*