UNPKG

@nexex/orderbook

Version:
20 lines (19 loc) 773 B
import { OnGatewayInit, WsResponse } from '@nestjs/websockets'; import { OrderbookEvent, WsRpcRequest } from '@nexex/types/orderbook'; import { Subject } from 'rxjs'; import { Server, Socket } from 'socket.io'; import { MarketCommandPayload } from './ws.model'; export declare class WsGateway implements OnGatewayInit { private events$; server: Server; constructor(events$: Subject<OrderbookEvent>); /** * subscribe new order of this market * on client can only subscribe one market, exit others when subscribe a new one * @param client * @param market */ onSubscribe(client: Socket, market: MarketCommandPayload): WsResponse<string>; onNotify(client: Socket, req: WsRpcRequest): void; afterInit(server: Server): any; }