kraken_sdk_ws

Crates.iokraken_sdk_ws
lib.rskraken_sdk_ws
version0.19.0
sourcesrc
created_at2021-08-28 07:02:35.908782
updated_at2023-08-01 17:18:15.154841
descriptionA strongly-typed client for the Kraken WebSocket API
homepage
repositoryhttps://github.com/gmosx/kraken_sdk_rust/tree/main/kraken_sdk_ws
max_upload_size
id443353
size73,388
George Moschovitis (gmosx)

documentation

README

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

Copyright © 2022 Georgios Moschovitis.

Commit count: 0

cargo fmt