Struct coinnect::bitstamp::api::BitstampApi
[−]
[src]
pub struct BitstampApi { /* fields omitted */ }
Methods
impl BitstampApi
[src]
fn new<C: Credentials>(creds: C) -> Result<BitstampApi>
Create a new BitstampApi by providing an API key & API secret
fn set_burst(&mut self, burst: bool)
The number of calls in a given period is limited. In order to avoid a ban we limit by default the number of api requests. This function sets or removes the limitation. Burst false implies no block. Burst true implies there is a control over the number of calls allowed to the exchange
fn return_ticker(&mut self, pair: Pair) -> Result<Map<String, Value>>
Sample output :
{
"BTC_LTC":{
"last":"0.0251","lowestAsk":"0.02589999","highestBid":"0.0251",
"percentChange":"0.02390438","baseVolume":"6.16485315","quoteVolume":"245.82513926"},
"BTC_NXT":{
"last":"0.00005730","lowestAsk":"0.00005710","highestBid":"0.00004903",
"percentChange":"0.16701570","baseVolume":"0.45347489","quoteVolume":"9094"},
... }
fn return_order_book(&mut self, pair: Pair) -> Result<Map<String, Value>>
Sample output :
{"asks":[[0.00007600,1164],[0.00007620,1300], ... ], "bids":[[0.00006901,200],
[0.00006900,408], ... ], "timestamp": "1234567890"}
fn return_trade_history(&mut self, pair: Pair) -> Result<Map<String, Value>>
Sample output :
[{"date":"2014-02-10 04:23:23","type":"buy","rate":"0.00007600","amount":"140",
"total":"0.01064"},
{"date":"2014-02-10 01:19:37","type":"buy","rate":"0.00007600","amount":"655",
"total":"0.04978"}, ... ]
fn return_balances(&mut self) -> Result<Map<String, Value>>
Returns all of your available balances.
Sample output:
{"BTC":"0.59098578","LTC":"3.31117268", ... }
fn buy_limit(
&mut self,
pair: Pair,
amount: Volume,
price: Price,
price_limit: Option<Price>,
daily_order: Option<bool>
) -> Result<Map<String, Value>>
&mut self,
pair: Pair,
amount: Volume,
price: Price,
price_limit: Option<Price>,
daily_order: Option<bool>
) -> Result<Map<String, Value>>
Add a buy limit order to the exchange limit_price : If the order gets executed, a new sell order will be placed, with "limit_price" as its price. daily_order (Optional) : Opens buy limit order which will be canceled at 0:00 UTC unless it already has been executed. Possible value: True
fn sell_limit(
&mut self,
pair: Pair,
amount: Volume,
price: Price,
price_limit: Option<Price>,
daily_order: Option<bool>
) -> Result<Map<String, Value>>
&mut self,
pair: Pair,
amount: Volume,
price: Price,
price_limit: Option<Price>,
daily_order: Option<bool>
) -> Result<Map<String, Value>>
Add a sell limit order to the exchange limit_price : If the order gets executed, a new sell order will be placed, with "limit_price" as its price. daily_order (Optional) : Opens sell limit order which will be canceled at 0:00 UTC unless it already has been executed. Possible value: True
fn buy_market(
&mut self,
pair: Pair,
amount: Volume
) -> Result<Map<String, Value>>
&mut self,
pair: Pair,
amount: Volume
) -> Result<Map<String, Value>>
Add a market buy order to the exchange By placing a market order you acknowledge that the execution of your order depends on the market conditions and that these conditions may be subject to sudden changes that cannot be foreseen.
fn sell_market(
&mut self,
pair: Pair,
amount: Volume
) -> Result<Map<String, Value>>
&mut self,
pair: Pair,
amount: Volume
) -> Result<Map<String, Value>>
Add a market sell order to the exchange By placing a market order you acknowledge that the execution of your order depends on the market conditions and that these conditions may be subject to sudden changes that cannot be foreseen.
Trait Implementations
impl Debug for BitstampApi
[src]
impl ExchangeApi for BitstampApi
[src]
fn ticker(&mut self, pair: Pair) -> Result<Ticker>
Return a Ticker for the Pair specified.
fn orderbook(&mut self, pair: Pair) -> Result<Orderbook>
Return an Orderbook for the specified Pair.
fn add_order(
&mut self,
order_type: OrderType,
pair: Pair,
quantity: Volume,
price: Option<Price>
) -> Result<OrderInfo>
&mut self,
order_type: OrderType,
pair: Pair,
quantity: Volume,
price: Option<Price>
) -> Result<OrderInfo>
Place an order directly to the exchange. Quantity is in quote currency. So if you want to buy 1 Bitcoin for X€ (pair BTC_EUR), base currency (right member in the pair) is BTC and quote/counter currency is BTC (left member in the pair). So quantity = 1. Read more
fn balances(&mut self) -> Result<Balances>
Return the balances for each currency on the account