Struct bittrex_api::api::BittrexAPI
[−]
[src]
pub struct BittrexAPI<'a> { /* fields omitted */ }Methods
impl<'a> BittrexAPI<'a>[src]
fn new(api_key: &'a str, api_secret: &'a str) -> Self
fn new_override_api_url(
api_key: &'a str,
api_secret: &'a str,
api_url: &'a str
) -> Self
api_key: &'a str,
api_secret: &'a str,
api_url: &'a str
) -> Self
fn new_with_proxy(
api_key: &'a str,
api_secret: &'a str,
http_proxy: Option<&'a str>,
https_proxy: Option<&'a str>
) -> Self
api_key: &'a str,
api_secret: &'a str,
http_proxy: Option<&'a str>,
https_proxy: Option<&'a str>
) -> Self
fn get_markets(&self) -> Result<Vec<BittrexMarket>, BittrexError>
Returns all available market data
Examples
use bittrex_api::api::BittrexAPI; let bittrex_api = BittrexAPI::new("APIKEY", "APISECRET"); let markets = bittrex_api.get_markets().unwrap();
fn get_currencies(&self) -> Result<Vec<BittrexCurrency>, BittrexError>
Returns all available currencies
Examples
use bittrex_api::api::BittrexAPI; let bittrex_api = BittrexAPI::new("APIKEY", "APISECRET"); let currencies = bittrex_api.get_currencies().unwrap();
fn get_ticker(&self, market: &str) -> Result<BittrexTicker, BittrexError>
Returns ticker by market name
Examples
use bittrex_api::api::BittrexAPI; let bittrex_api = BittrexAPI::new("APIKEY", "APISECRET"); let ticker = bittrex_api.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::api::BittrexAPI; let bittrex_api = BittrexAPI::new("APIKEY", "APISECRET"); let summaries = bittrex_api.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::api::BittrexAPI; let bittrex_api = BittrexAPI::new("APIKEY", "APISECRET"); let summary = bittrex_api.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::api::BittrexAPI; use bittrex_api::values::BittrexOrderType; let bittrex_api = BittrexAPI::new("APIKEY", "APISECRET"); let order_book = bittrex_api.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::api::BittrexAPI; let bittrex_api = BittrexAPI::new("APIKEY", "APISECRET"); let market_history = bittrex_api.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::api::BittrexAPI; let bittrex_api = BittrexAPI::new("APIKEY", "APISECRET"); let open_orders = bittrex_api.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::api::BittrexAPI; let bittrex_api = BittrexAPI::new("APIKEY", "APISECRET"); let open_orders = bittrex_api.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::api::BittrexAPI; let bittrex_api = BittrexAPI::new("APIKEY", "APISECRET"); let order = bittrex_api.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::api::BittrexAPI; let bittrex_api = BittrexAPI::new("APIKEY", "APISECRET"); let order_history = bittrex_api.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::api::BittrexAPI; let bittrex_api = BittrexAPI::new("APIKEY", "APISECRET"); let order_history = bittrex_api.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::api::BittrexAPI; let bittrex_api = BittrexAPI::new("APIKEY", "APISECRET"); let withdrawal_history = bittrex_api.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::api::BittrexAPI; let bittrex_api = BittrexAPI::new("APIKEY", "APISECRET"); let withdrawal_history = bittrex_api.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::api::BittrexAPI; let bittrex_api = BittrexAPI::new("APIKEY", "APISECRET"); let deposit_history = bittrex_api.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::api::BittrexAPI; let bittrex_api = BittrexAPI::new("APIKEY", "APISECRET"); let deposit_history = bittrex_api.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::api::BittrexAPI; let bittrex_api = BittrexAPI::new("APIKEY", "APISECRET"); let balances = bittrex_api.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::api::BittrexAPI; let bittrex_api = BittrexAPI::new("APIKEY", "APISECRET"); let balance = bittrex_api.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::api::BittrexAPI; let bittrex_api = BittrexAPI::new("APIKEY", "APISECRET"); let deposit_history = bittrex_api.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::api::BittrexAPI; let bittrex_api = BittrexAPI::new("APIKEY", "APISECRET"); let withdraw_uuid = bittrex_api.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::api::BittrexAPI; let bittrex_api = BittrexAPI::new("APIKEY", "APISECRET"); let buy_uuid = bittrex_api.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::api::BittrexAPI; let bittrex_api = BittrexAPI::new("APIKEY", "APISECRET"); let sell_uuid = bittrex_api.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::api::BittrexAPI; let bittrex_api = BittrexAPI::new("APIKEY", "APISECRET"); bittrex_api.cancel_order("ORDERID").unwrap();
Trait Implementations
impl<'a> Default for BittrexAPI<'a>[src]
fn default() -> BittrexAPI<'a>
Returns the "default value" for a type. Read more