Skip to content

Commit

Permalink
chore: restore origin raw result which length equal 13
Browse files Browse the repository at this point in the history
  • Loading branch information
fshiori authored and JacobPlaster committed Jan 13, 2020
1 parent 483e12a commit 8eeb36d
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions v2/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -1494,10 +1494,25 @@ func NewTickerFromRaw(symbol string, raw []interface{}) (t *Ticker, err error) {
}
// funding currency ticker
// ignore bid/ask period for now
// on funding currencies (ex. fUSD)
// SYMBOL, FRR, BID, BID_PERIOD, BID_SIZE, ASK, ASK_PERIOD, ASK_SIZE, DAILY_CHANGE, DAILY_CHANGE_RELATIVE,
// LAST_PRICE, VOLUME, HIGH, LOW, _PLACEHOLDER, _PLACEHOLDER, FRR_AMOUNT_AVAILABLE
if len(raw) == 16 {
if len(raw) == 13 {
t = &Ticker{
Symbol: symbol,
Bid: f64ValOrZero(raw[1]),
BidSize: f64ValOrZero(raw[2]),
Ask: f64ValOrZero(raw[4]),
AskSize: f64ValOrZero(raw[5]),
DailyChange: f64ValOrZero(raw[7]),
DailyChangePerc: f64ValOrZero(raw[8]),
LastPrice: f64ValOrZero(raw[9]),
Volume: f64ValOrZero(raw[10]),
High: f64ValOrZero(raw[11]),
Low: f64ValOrZero(raw[12]),
}
return t, nil
} else if len(raw) == 16 {
// on funding currencies (ex. fUSD)
// SYMBOL, FRR, BID, BID_PERIOD, BID_SIZE, ASK, ASK_PERIOD, ASK_SIZE, DAILY_CHANGE, DAILY_CHANGE_RELATIVE,
// LAST_PRICE, VOLUME, HIGH, LOW, _PLACEHOLDER, _PLACEHOLDER, FRR_AMOUNT_AVAILABLE
t = &Ticker{
Symbol: symbol,
Frr: f64ValOrZero(raw[0]),
Expand Down

0 comments on commit 8eeb36d

Please sign in to comment.