### Kraken CLI: System Status Example Source: https://github.com/cbeck88/krakenrs/blob/master/README.md Demonstrates how to check the current system status of the Kraken exchange using the command-line interface. Requires the 'kraken' example target to be built. ```bash cargo run --example kraken -- system-status ``` -------------------------------- ### Kraken CLI: Private API - Get Open Orders Source: https://github.com/cbeck88/krakenrs/blob/master/README.md Example of how to invoke a private API call to retrieve open orders. Requires a credentials file and API key setup. ```bash cargo run --example kraken path/to/creds get-open-orders ``` -------------------------------- ### Kraken CLI: Asset Pairs and Ticker Example Source: https://github.com/cbeck88/krakenrs/blob/master/README.md Shows how to retrieve a list of available asset pairs or the current ticker information for a specific pair using the 'kraken' CLI example. This is a public API call. ```bash cargo run --example kraken -- asset-pairs ``` ```bash cargo run --example kraken -- ticker AAVEUSD ``` -------------------------------- ### Kraken CLI: Funding API - Get Deposit Addresses Source: https://github.com/cbeck88/krakenrs/blob/master/README.md Example of how to retrieve deposit addresses for a given asset and payment method. Requires a credentials file. ```bash cargo run --example kraken path/to/creds get-deposit-addresses BTC Bitcoin ``` -------------------------------- ### Kraken CLI: Funding API - Get Deposit Methods Source: https://github.com/cbeck88/krakenrs/blob/master/README.md Shows how to request available deposit methods for a specific asset using the funding APIs. Requires a credentials file. ```bash cargo run --example kraken path/to/creds get-deposit-methods BTC ``` -------------------------------- ### Kraken CLI: Funding API - Withdraw Funds Source: https://github.com/cbeck88/krakenrs/blob/master/README.md Example of initiating a withdrawal of funds for a specified asset, destination address, and amount. Requires a credentials file. ```bash cargo run --example kraken path/to/creds withdraw BTC my_btc_wallet 0.01 ``` -------------------------------- ### Connect to Websockets API Source: https://github.com/cbeck88/krakenrs/blob/master/README.md Example of connecting to the Kraken Websockets API to subscribe to price feeds. This snippet is incomplete and requires further implementation for full functionality. ```rust use krakenrs::ws::{KrakenWsConfig, KrakenWsAPI}; use std::{ time::Duration, thread, }; fn main() { let pairs = vec!["USD/CAD".to_string()]; ``` -------------------------------- ### Kraken CLI: Funding API - Get Withdrawal Addresses Source: https://github.com/cbeck88/krakenrs/blob/master/README.md Shows how to retrieve a list of pre-registered withdrawal addresses for a specific asset. Requires a credentials file. ```bash cargo run --example kraken path/to/creds get-withdrawal-addresses ``` ```bash cargo run --example kraken path/to/creds get-withdrawal-addresses --asset BTC ``` -------------------------------- ### Get Asset Pairs and Ticker Info (REST API) Source: https://github.com/cbeck88/krakenrs/blob/master/README.md Demonstrates how to fetch asset pair information and ticker data using the Kraken REST API. Requires `serde_json` for pretty printing. ```rust use krakenrs::{KrakenRestAPI, KrakenRestConfig}; use serde_json::to_string_pretty; fn main() { let kc_config = KrakenRestConfig::default(); let api = KrakenRestAPI::try_from(kc_config).expect("could not create kraken api"); println!( "{}", to_string_pretty( &api.asset_pairs(vec!["XBTUSD".to_string(), "SOLBTC".to_string()]) .expect("api call failed") ) .unwrap() ); println!( "{}", to_string_pretty( &api.ticker(vec!["XBTUSD".to_string()]) .expect("api call failed") ) .unwrap() ); } ``` -------------------------------- ### Kraken CLI: Funding API - Get Deposit Status Source: https://github.com/cbeck88/krakenrs/blob/master/README.md Demonstrates how to query the status of recent deposits, with options to filter by asset and limit the number of results. Requires a credentials file. ```bash cargo run --example kraken path/to/creds get-deposit-status ``` ```bash cargo run --example kraken path/to/creds get-deposit-status --asset ETH --limit 10 ``` -------------------------------- ### Kraken CLI: Funding API - Get Withdrawal Status Source: https://github.com/cbeck88/krakenrs/blob/master/README.md Demonstrates how to query the status of recent withdrawals, with options to filter by asset and limit the number of results. Requires a credentials file. ```bash cargo run --example kraken path/to/creds get-withdraw-status ``` ```bash cargo run --example kraken path/to/creds get-withdraw-status --asset ETH --limit 10 ``` -------------------------------- ### Kraken CLI: Private API - Market Buy Order Source: https://github.com/cbeck88/krakenrs/blob/master/README.md Demonstrates placing a market buy order for a specified volume and asset pair using private API access. Requires a credentials file. ```bash cargo run --example kraken path/to/creds --validate market-buy 0.02 AAVEUSD ``` -------------------------------- ### Subscribe to Order Book and Process Data Source: https://github.com/cbeck88/krakenrs/blob/master/README.md This snippet demonstrates how to subscribe to the order book for specified pairs using KrakenWsConfig and continuously process incoming book data. It includes error handling for checksum failures and checks for stream closure. ```rust let ws_config = KrakenWsConfig::builder() .subscribe_book(pairs) .build() .unwrap(); let api = KrakenWsAPI::new(ws_config).expect("could not connect to websockets api"); loop { thread::sleep(Duration::from_millis(500)); let books = api.get_all_books(); for (pair, book) in books { println!("{}", pair); println!("{} bids:", pair); for (price, entry) in book.bid.iter() { println!("{}\t\t{}", price, entry.volume); } println!("{} asks:", pair); for (price, entry) in book.ask.iter() { println!("{}\t\t{}", price, entry.volume); } println!(); if book.checksum_failed { println!("Checksum failed, aborting"); return; } } if api.stream_closed() { return; } } } ``` -------------------------------- ### Kraken Websockets Feed: Subscribe to Order Book Source: https://github.com/cbeck88/krakenrs/blob/master/README.md This command subscribes to the real-time order book feed for a specified asset pair (e.g., XBT/USD) using the websockets client. The output will continuously update. ```bash cargo run --example kraken-feed book XBT/USD ``` -------------------------------- ### Kraken Websockets Feed: Subscribe to Trades Source: https://github.com/cbeck88/krakenrs/blob/master/README.md This command subscribes to the real-time trade feed for a specified asset pair (e.g., XBT/USD) using the websockets client. The output will continuously display incoming trades. ```bash cargo run --example kraken-feed trades XBT/USD ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.