kraken_futures_rest_client

Crates.iokraken_futures_rest_client
lib.rskraken_futures_rest_client
version0.26.0
sourcesrc
created_at2023-08-14 08:27:39.648992
updated_at2024-07-10 17:42:30.095228
descriptionA strongly-typed client for the Kraken Futures REST API
homepage
repositoryhttps://github.com/gmosx/kraken-sdk-rust/tree/main/kraken_sdk_futures_rest
max_upload_size
id943953
size25,846
George Moschovitis (gmosx)

documentation

README

Kraken Futures REST API

A strongly-typed Rust SDK for the Kraken Futures REST API.

This crate is an unofficial, community-driven effort.

Installation

[dependencies]
kraken_futures_client_rest = "0.2"

Usage

let client = Client::default();

let symbol = "PI_XBTUSD";
let interval = Interval::Min1;
let now = chrono::Local::now();
let from = now - chrono::Duration::minutes(6_000);
let to = from + (1_000 * 60);

let res = client
    .get_ohlc(symbol, interval, price_type)
    .from(from)
    .to(i64::min(now, to))
    .send()
    .await?;

println!("{}", res.candles);

FAQ

Why provide both execute and send methods for API endpoint handlers?

Providing the lower-level execute method allows for more flexibility. Since execute is generic you can pass any type of object to deserialize the response to, e.g. you could deserialize to a HashMap instead of the 'default' response for each API call. Or you could use a custom struct with only the fields you are interested in.

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