import { HttpMethod } from '@dripjs/types' ; import { Config , OrderbookResponse } from '../../../../types' ; import { PublicEndPoints , RestOrderbookL2Response , RestOrderbookRequest } from '../../../types' ; import { RestInsider } from '../../rest-insider' ; import { transform } from './helpers' ; export class Orderbook extends RestInsider { constructor ( config ) { super ( config , PublicEndPoints . OrderBookL2 ) ; } async fetch ( request ) { const res = await this . request ( HttpMethod . GET , request ) ; return { ratelimit : res . ratelimit , orderbook : transform ( < OrderbookResponse [ ] > res . body ) , error : res . error , } ; } }