5 unstable releases

0.19.0 Aug 1, 2023
0.18.0 Nov 6, 2022
0.1.2 Mar 5, 2022
0.1.1 Aug 28, 2021
0.1.0 Aug 28, 2021

#12 in #kraken

41 downloads per month

Apache-2.0

31KB
748 lines

Support for Kraken WebSocket API

Kraken SDK component for the Kraken WebSocket API

A strongly-typed Rust SDK for the Kraken WebSocket API.

This crate is an unofficial, community-driven effort.

Installation

[dependencies]
kraken_sdk_ws = "0.18"

Usage

use futures::StreamExt;
use kraken_sdk_ws::{api::SubscribeTickerRequest, client::WS_URL, Client};

#[tokio::main]
async fn main() {
    let mut client = Client::connect(WS_URL, None).await.expect("cannot connect");

    let req = SubscribeTickerRequest::new(&["BTC/USD"]);

    client.send(req).await.expect("cannot send request");

    loop {
        if let Some(msg) = client.messages.next().await {
            dbg!(&msg);
        }
    }
}

or run the example:

cargo run --example ticker

Status

The software is under active development and the API is expected to change.

Contributing

Pull requests, issues and comments are welcome! Make sure to add tests for new features and bug fixes.

License

This work is licensed under the Apache-2.0 License. See LICENSE.txt or https://spdx.org/licenses/Apache-2.0.html for details.

Copyright © 2022 Georgios Moschovitis.

Dependencies

~16–29MB
~530K SLoC