(data)
| 2345 | * @return {array} - symbols with their current prices |
| 2346 | */ |
| 2347 | const priceData = (data) => { |
| 2348 | const prices = {}; |
| 2349 | if (Array.isArray(data)) { |
| 2350 | for (let obj of data) { |
| 2351 | prices[obj.symbol] = obj.price; |
| 2352 | } |
| 2353 | } else { // Single price returned |
| 2354 | prices[data.symbol] = data.price; |
| 2355 | } |
| 2356 | return prices; |
| 2357 | }; |
| 2358 | |
| 2359 | /** |
| 2360 | * Used by bookTickers to format the bids and asks given given symbols |