Skip to content

Commit

Permalink
several fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosmiei committed Jan 25, 2023
1 parent 34e5162 commit 6c3a066
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions js/btcalpha.js
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ module.exports = class btcalpha extends Exchange {
// sell: '22521.11'
// }
//
return this.parseTickers (response, market);
return this.parseTicker (response, market);
}

parseTicker (ticker, market = undefined) {
Expand All @@ -307,16 +307,13 @@ module.exports = class btcalpha extends Exchange {
// sell: '22521.11'
// }
//
let timestamp = this.safeFloat (ticker, 'timestamp');
if (timestamp !== undefined) {
timestamp = timestamp * 1000000;
}
const timestamp = this.safeIntegerProduct (ticker, 'timestamp', 1000000);
const marketId = this.safeString (ticker, 'pair');
market = this.safeMarket (marketId, market, '-');
market = this.safeMarket (marketId, market, '_');
const last = this.safeString (ticker, 'last');
return this.safeTicker ({
'info': ticker,
'symbol': this.safeSymbol (marketId, market, '-'),
'symbol': market['symbol'],
'timestamp': timestamp,
'datetime': this.iso8601 (timestamp),
'high': this.safeString (ticker, 'high'),
Expand All @@ -330,7 +327,7 @@ module.exports = class btcalpha extends Exchange {
'close': last,
'last': last,
'previousClose': undefined,
'change': undefined,
'change': this.safeString (ticker, 'diff'),
'percentage': undefined,
'average': undefined,
'baseVolume': undefined,
Expand Down

0 comments on commit 6c3a066

Please sign in to comment.