Repository navigation
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_alland the dead-man's switchcancel_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
TradeErrorvariantsSessionExpired,PermissionDenied,AuthenticationFailedandInFlightLimitReached(the optionalfutures_max_in_flightcap).
Security
- Connections trust only the certificate authorities in the
kraken.comCAA record, plus an optionaltls_extra_root_certs_file. The OS trust store is no longer read. - Endpoint URL settings must name a
kraken.comorkraken.zonehost. - 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 returnResult<HandlerHandle, SubscriptionError>; add?at the call site. - Several events carry a new
urlfield; 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_fileif you need it.
See the CHANGELOG for every change and fix, and features for the full method and handler tables.