Skip to content

Releases

v0.2.0

Choose a tag to compare

@rui-kraken rui-kraken released this 13 Nov 10:20
49e6650

kraken-api-sdk 0.2.0 adds Kraken Futures on the Unified WebSocket API (market data, private account streams and order entry) alongside the existing Spot client. Futures symbols are venue strings such as PF_XBTUSD; Spot keeps BTC/USD.

[dependencies]
kraken-sdk = { git = "https://github.com/krakenfx/kraken-api-sdk", tag = "v0.2.0" }

Features

  • Futures market data. client.market().futures() streams system status, instruments, ticker, trades, OHLC candles (trade or mark price) and order books, maintained or raw.
  • Futures account streams. client.account().futures() delivers executions, positions, margin (multi- and single-collateral), balances and the account's trading permission.
  • Futures order entry. client.trade().futures() places, amends and cancels orders over the private WebSocket: order, order_batch, order_amend, cancel, cancel_batch, cancel_all and the dead-man's switch cancel_all_orders_after. Orders the venue would reject fail locally before anything is sent.
  • Futures subscriptions and events. client.subscription().futures() lists and tears down Futures streams; Futures* lifecycle events report each stream's outcome.
  • More precise errors. New TradeError variants SessionExpired, PermissionDenied, AuthenticationFailed and InFlightLimitReached (the optional futures_max_in_flight cap).

Security

  • Connections trust only the certificate authorities in the kraken.com CAA record, plus an optional tls_extra_root_certs_file. The OS trust store is no longer read.
  • Endpoint URL settings must name a kraken.com or kraken.zone host.
  • REST no longer follows HTTP redirects, so signed requests never reach another host.
  • TLS dependencies are updated past open RustSec advisories.

Upgrading from 0.1.0

  • Minimum supported Rust version is 1.88 (was 1.85).
  • Spot on_* handler registrations return Result<HandlerHandle, SubscriptionError>; add ? at the call site.
  • Several events carry a new url field; exhaustive patterns on them need the field or ...
  • A machine-installed CA (for example a TLS-inspecting proxy) is no longer trusted; supply it through tls_extra_root_certs_file if you need it.

See the CHANGELOG for every change and fix, and features for the full method and handler tables.

v0.1.0

Choose a tag to compare

@rui-kraken rui-kraken released this 07 Sep 17:16
a5d253c

Welcome to the first public release of kraken-api-sdk. 🎉 An async client written in Rust and covering Kraken Spot trading and portfolio data across Spot REST and Spot WebSocket v2.

Features

  • Two-factor authentication.
  • One client, five namespaces. market (public data), account (balances, orders, ledgers), trade (order placement), subscription (WebSocket stream lifecycle), and events (lifecycle bus), all reached through a Client built by ClientBuilder.
  • Market data. ticker, orderbook, trades, ohlc, spreads, assets, pairs, server_time, status over REST. ticker, book, trade, ohlc and status over WebSocket.
  • Account data. balance, extended balance, trade balance, open and closed orders, ledgers, trades history, positions, and 30-day volume over REST; executions and balances over WebSocket.
  • Trading. Shorthands for market, limit and stop, plus full control across 10 order types (Market, Limit, Iceberg, StopLoss, StopLossLimit, TakeProfit, TakeProfitLimit, TrailingStop, TrailingStopLimit, SettlePosition). Orders default to authenticated WebSocket v2, and REST calls can be forced with .via(Transport::Rest).
  • Maintained order book. Order books built from snapshot and deltas, CRC32-checked on each update.
  • Exact money. Every monetary value is a rust_decimal::Decimal. The SDK never uses f64 for a price, volume, or amount.
  • Modern symbols. Pairs are built with Symbol::new("BTC/USD"). Legacy wire codes (XBT, XXBT, ZUSD, XXBTZUSD) are rejected on input and normalized away on decode.
  • Typed error taxonomy: Errors with code, category, retryable, request_id, and message- Rate-limit awareness without blocking. The SDK tracks counter usage and emits RateLimitWarning at a configurable threshold.
  • Observability: one event bus for connection state, rate-limit warnings, order book gaps, queue depth, slow callbacks and order lifecycle.

Next Steps

  • Derivatives support
  • Level 3 order book
  • Expanding to additional languages, including C++, Python, Go, and TypeScript
  • Expand to additional domains, including Funding, Subaccounts, and Earn