Adds GetTickerPrice(currency string) TickerPrice func to interface. Implements on all exchanges (where possible)

Attempts to make routing generic with /exchanges/{exchangeName}/latest/{currency} path and response
This commit is contained in:
Scott
2016-06-05 19:10:32 +10:00
parent 4b2a336e1b
commit 95cfb356ba
21 changed files with 244 additions and 28 deletions

View File

@@ -134,6 +134,16 @@ func (i *ItBit) GetTicker(currency string) ItBitTicker {
return itbitTicker
}
func (i *ItBit) GetTickerPrice(currency string) TickerPrice {
var tickerPrice TickerPrice
ticker := i.GetTicker(currency)
tickerPrice.Ask = ticker.Ask
tickerPrice.Bid = ticker.Bid
return tickerPrice
}
type ItbitOrderbookEntry struct {
Quantitiy float64 `json:"quantity,string"`
Price float64 `json:"price,string"`