* Gets the price of a given symbol or symbols * @param {array} data - array of symbols * @return {array} - symbols with their current prices
(data: any)
| 3262 | * @return {array} - symbols with their current prices |
| 3263 | */ |
| 3264 | priceData(data: any): { [key: string]: number } { |
| 3265 | const prices = {}; |
| 3266 | if (Array.isArray(data)) { |
| 3267 | for (const obj of data) { |
| 3268 | prices[obj.symbol] = obj.price; |
| 3269 | } |
| 3270 | } else { // Single price returned |
| 3271 | prices[data.symbol] = parseFloat(data.price); |
| 3272 | } |
| 3273 | return prices; |
| 3274 | } |
| 3275 | |
| 3276 | /** |
| 3277 | * Used by bookTickers to format the bids and asks given given symbols |
no outgoing calls
no test coverage detected