import { OrderbookL2Response , OrderbookResponse } from '../../../../types' ; param source export function transform ( source ) { const orderbook = { bids : [ ] , asks : [ ] , } ; for ( const item of source ) { const orderbookItem = [ `${ item . price }` , `${ item . size }` ] ; if ( item . side === 'Sell' ) { orderbook . asks . push ( orderbookItem ) ; } else { orderbook . bids . push ( orderbookItem ) ; } } orderbook . asks . reverse ( ) ; return orderbook ; }