(data, symbol: string)
| 3437 | } |
| 3438 | |
| 3439 | parseOrderBook(data, symbol: string): OrderBook { |
| 3440 | const { lastUpdateId, bids, asks } = data; |
| 3441 | if (!bids || !asks) { |
| 3442 | return data; |
| 3443 | } |
| 3444 | const orderBook: OrderBook = { |
| 3445 | symbol, |
| 3446 | lastUpdateId, |
| 3447 | bids: bids.map(b => zip(['price', 'quantity'], b)), |
| 3448 | asks: asks.map(a => zip(['price', 'quantity'], a)) |
| 3449 | }; |
| 3450 | return orderBook; |
| 3451 | } |
| 3452 | |
| 3453 | /** |
| 3454 | * Used for /depth endpoint |
no outgoing calls
no test coverage detected