Struct bittrex_api::BittrexClient
[−]
[src]
pub struct BittrexClient { /* fields omitted */ }
Methods
impl BittrexClient
[src]
fn new(api_key: String, api_secret: String) -> Self
fn new_override_api_url(
api_key: String,
api_secret: String,
api_url: String
) -> Self
api_key: String,
api_secret: String,
api_url: String
) -> Self
fn new_with_proxy(
api_key: String,
api_secret: String,
http_proxy: Option<String>,
https_proxy: Option<String>
) -> Self
api_key: String,
api_secret: String,
http_proxy: Option<String>,
https_proxy: Option<String>
) -> Self
fn get_markets(&self) -> Result<Vec<BittrexMarket>, BittrexError>
Returns all available market data
Examples
use bittrex_api::BittrexClient; let bittrex_client = BittrexClient::new("APIKEY".to_string(), "APISECRET".to_string()); let markets = bittrex_client.get_markets().unwrap();
fn get_currencies(&self) -> Result<Vec<BittrexCurrency>, BittrexError>
Returns all available currencies
Examples
use bittrex_api::BittrexClient; let bittrex_client = BittrexClient::new("APIKEY".to_string(), "APISECRET".to_string()); let currencies = bittrex_client.get_currencies().unwrap();
fn get_ticker(&self, market: &str) -> Result<BittrexTicker, BittrexError>
Returns ticker by market name
Examples
use bittrex_api::BittrexClient; let bittrex_client = BittrexClient::new("APIKEY".to_string(), "APISECRET".to_string()); let ticker = bittrex_client.get_ticker("BTC-LTC").unwrap();
fn get_market_summaries(
&self
) -> Result<Vec<BittrexMarketSummary>, BittrexError>
&self
) -> Result<Vec<BittrexMarketSummary>, BittrexError>
Returns all market summaries
Examples
use bittrex_api::BittrexClient; let bittrex_client = BittrexClient::new("APIKEY".to_string(), "APISECRET".to_string()); let summaries = bittrex_client.get_market_summaries().unwrap();
fn get_market_summary(
&self,
market: &str
) -> Result<BittrexMarketSummary, BittrexError>
&self,
market: &str
) -> Result<BittrexMarketSummary, BittrexError>
Returns market summary by market name
Examples
use bittrex_api::BittrexClient; let bittrex_client = BittrexClient::new("APIKEY".to_string(), "APISECRET".to_string()); let summary = bittrex_client.get_market_summary("BTC-LTC").unwrap();
fn get_order_book(
&self,
market: &str,
book_type: BittrexOrderType
) -> Result<BittrexPublicOrderBook, BittrexError>
&self,
market: &str,
book_type: BittrexOrderType
) -> Result<BittrexPublicOrderBook, BittrexError>
Returns the order book of the given market.
Examples
use bittrex_api::BittrexClient; use bittrex_api::values::BittrexOrderType; let bittrex_client = BittrexClient::new("APIKEY".to_string(), "APISECRET".to_string()); let order_book = bittrex_client.get_order_book("BTC-LTC", BittrexOrderType::Both).unwrap();
fn get_market_history(
&self,
market: &str
) -> Result<Vec<BittrexTrade>, BittrexError>
&self,
market: &str
) -> Result<Vec<BittrexTrade>, BittrexError>
Returns the market history of the given market.
Examples
use bittrex_api::BittrexClient; let bittrex_client = BittrexClient::new("APIKEY".to_string(), "APISECRET".to_string()); let market_history = bittrex_client.get_market_history("BTC-LTC").unwrap();
fn get_open_orders(&self) -> Result<Vec<BittrexOpenOrder>, BittrexError>
Returns the open orders of the user given by the api_key and api_secret.
Examples
use bittrex_api::BittrexClient; let bittrex_client = BittrexClient::new("APIKEY".to_string(), "APISECRET".to_string()); let open_orders = bittrex_client.get_open_orders().unwrap();
fn get_open_orders_by_market(
&self,
market: &str
) -> Result<Vec<BittrexOpenOrder>, BittrexError>
&self,
market: &str
) -> Result<Vec<BittrexOpenOrder>, BittrexError>
Returns the open orders of the given market and of the user given by the api_key and api_secret.
Examples
use bittrex_api::BittrexClient; let bittrex_client = BittrexClient::new("APIKEY".to_string(), "APISECRET".to_string()); let open_orders = bittrex_client.get_open_orders_by_market("BTC-LTC").unwrap();
fn get_order(&self, order_id: &str) -> Result<BittrexOrder, BittrexError>
Returns the order given by the order_id.
Examples
use bittrex_api::BittrexClient; let bittrex_client = BittrexClient::new("APIKEY".to_string(), "APISECRET".to_string()); let order = bittrex_client.get_order("ORDERID").unwrap();
fn get_order_history(&self) -> Result<Vec<BittrexHistoryOrder>, BittrexError>
Returns the order history of the user given by the api_key and api_secret.
Examples
use bittrex_api::BittrexClient; let bittrex_client = BittrexClient::new("APIKEY".to_string(), "APISECRET".to_string()); let order_history = bittrex_client.get_order_history().unwrap();
fn get_order_history_by_market(
&self,
market: &str
) -> Result<Vec<BittrexHistoryOrder>, BittrexError>
&self,
market: &str
) -> Result<Vec<BittrexHistoryOrder>, BittrexError>
Returns the order history of the given market and of the user given by the api_key and api_secret.
Examples
use bittrex_api::BittrexClient; let bittrex_client = BittrexClient::new("APIKEY".to_string(), "APISECRET".to_string()); let order_history = bittrex_client.get_order_history_by_market("BTC-LTC").unwrap();
fn get_withdrawal_history(
&self
) -> Result<Vec<BittrexTransaction>, BittrexError>
&self
) -> Result<Vec<BittrexTransaction>, BittrexError>
Returns the withdrawal history of the user given by the api_key and api_secret.
Examples
use bittrex_api::BittrexClient; let bittrex_client = BittrexClient::new("APIKEY".to_string(), "APISECRET".to_string()); let withdrawal_history = bittrex_client.get_withdrawal_history().unwrap();
fn get_withdrawal_history_by_currency(
&self,
currency: &str
) -> Result<Vec<BittrexTransaction>, BittrexError>
&self,
currency: &str
) -> Result<Vec<BittrexTransaction>, BittrexError>
Returns the withdrawal history of the given market and of the user given by the api_key and api_secret.
Examples
use bittrex_api::BittrexClient; let bittrex_client = BittrexClient::new("APIKEY".to_string(), "APISECRET".to_string()); let withdrawal_history = bittrex_client.get_withdrawal_history_by_currency("BTC-LTC").unwrap();
fn get_deposit_history(&self) -> Result<Vec<BittrexTransaction>, BittrexError>
Returns the deposit history of the user given by the api_key and api_secret.
Examples
use bittrex_api::BittrexClient; let bittrex_client = BittrexClient::new("APIKEY".to_string(), "APISECRET".to_string()); let deposit_history = bittrex_client.get_deposit_history().unwrap();
fn get_deposit_history_by_currency(
&self,
currency: &str
) -> Result<Vec<BittrexTransaction>, BittrexError>
&self,
currency: &str
) -> Result<Vec<BittrexTransaction>, BittrexError>
Returns the deposit history of the given currency and of the user given by the api_key and api_secret.
Examples
use bittrex_api::BittrexClient; let bittrex_client = BittrexClient::new("APIKEY".to_string(), "APISECRET".to_string()); let deposit_history = bittrex_client.get_deposit_history_by_currency("BTC").unwrap();
fn get_balances(&self) -> Result<Vec<BittrexBalance>, BittrexError>
Returns the balances of the user given by the api_key and api_secret.
Examples
use bittrex_api::BittrexClient; let bittrex_client = BittrexClient::new("APIKEY".to_string(), "APISECRET".to_string()); let balances = bittrex_client.get_balances().unwrap();
fn get_balance(&self, currency: &str) -> Result<BittrexBalance, BittrexError>
Returns the balance of the given currency and of the user given by the api_key and api_secret.
Examples
use bittrex_api::BittrexClient; let bittrex_client = BittrexClient::new("APIKEY".to_string(), "APISECRET".to_string()); let balance = bittrex_client.get_balance("BTC").unwrap();
fn get_deposit_address(
&self,
currency: &str
) -> Result<BittrexAddress, BittrexError>
&self,
currency: &str
) -> Result<BittrexAddress, BittrexError>
Returns the deposit address of the given currency and of the user given by the api_key and api_secret.
Examples
use bittrex_api::BittrexClient; let bittrex_client = BittrexClient::new("APIKEY".to_string(), "APISECRET".to_string()); let deposit_history = bittrex_client.get_deposit_address("BTC").unwrap();
fn withdraw(
&self,
currency: &str,
quantity: f64,
address: &str,
payment_id: &str
) -> Result<BittrexUuid, BittrexError>
&self,
currency: &str,
quantity: f64,
address: &str,
payment_id: &str
) -> Result<BittrexUuid, BittrexError>
Withdraws tokens of the user given by the api_key and api_secret.
Examples
use bittrex_api::BittrexClient; let bittrex_client = BittrexClient::new("APIKEY".to_string(), "APISECRET".to_string()); let withdraw_uuid = bittrex_client.withdraw("BTC", 1.5, "BITCOINADDRESS", "").unwrap();
fn buy_limit(
&self,
market: &str,
quantity: f64,
rate: f64
) -> Result<BittrexUuid, BittrexError>
&self,
market: &str,
quantity: f64,
rate: f64
) -> Result<BittrexUuid, BittrexError>
Places a buy order on the given market for the user given by the api_key and api_secret.
Examples
use bittrex_api::BittrexClient; let bittrex_client = BittrexClient::new("APIKEY".to_string(), "APISECRET".to_string()); let buy_uuid = bittrex_client.buy_limit("BTC-LTC", 1.5, 0.00023).unwrap();
fn sell_limit(
&self,
market: &str,
quantity: f64,
rate: f64
) -> Result<BittrexUuid, BittrexError>
&self,
market: &str,
quantity: f64,
rate: f64
) -> Result<BittrexUuid, BittrexError>
Places a sell order on the given market for the user given by the api_key and api_secret.
Examples
use bittrex_api::BittrexClient; let bittrex_client = BittrexClient::new("APIKEY".to_string(), "APISECRET".to_string()); let sell_uuid = bittrex_client.sell_limit("BTC-LTC", 1.5, 0.00023).unwrap();
fn cancel_order(&self, order_id: &str) -> Result<(), BittrexError>
Cancels an order for the user given by the api_key and api_secret.
Examples
use bittrex_api::BittrexClient; let bittrex_client = BittrexClient::new("APIKEY".to_string(), "APISECRET".to_string()); bittrex_client.cancel_order("ORDERID").unwrap();