| 2506 | * @return {undefined} |
| 2507 | */ |
| 2508 | const depthData = data => { |
| 2509 | if (!data) return { bids: [], asks: [] }; |
| 2510 | let bids = {}, asks = {}, obj; |
| 2511 | if (typeof data.bids !== 'undefined') { |
| 2512 | for (obj of data.bids) { |
| 2513 | bids[obj[0]] = parseFloat(obj[1]); |
| 2514 | } |
| 2515 | } |
| 2516 | if (typeof data.asks !== 'undefined') { |
| 2517 | for (obj of data.asks) { |
| 2518 | asks[obj[0]] = parseFloat(obj[1]); |
| 2519 | } |
| 2520 | } |
| 2521 | return { lastUpdateId: data.lastUpdateId, bids: bids, asks: asks }; |
| 2522 | } |
| 2523 | |
| 2524 | /** |
| 2525 | * Used for /depth endpoint |
no outgoing calls
no test coverage detected