interface EngineServerOrderUpdateStreamParams { product_id: number; subaccount: string; } interface EngineServerTradeStreamParams { product_id: number; } interface EngineServerBestBidOfferStreamParams { product_id: number; } interface EngineServerFillStreamParams { product_id: number; subaccount: string; } interface EngineServerPositionChangeStreamParams { product_id: number; subaccount: string; } interface EngineServerBookDepthStreamParams { product_id: number; } /** * Available subscription streams */ interface EngineServerSubscriptionStreamParamsByType { order_update: EngineServerOrderUpdateStreamParams; trade: EngineServerTradeStreamParams; best_bid_offer: EngineServerBestBidOfferStreamParams; fill: EngineServerFillStreamParams; position_change: EngineServerPositionChangeStreamParams; book_depth: EngineServerBookDepthStreamParams; } type EngineServerSubscriptionStreamParamsType = keyof EngineServerSubscriptionStreamParamsByType; /** * Describes a stream that can be subscribed to. */ type EngineServerSubscriptionStream = { type: TStreamType; } & EngineServerSubscriptionStreamParamsByType[TStreamType]; /** * Params to provide to a `subscribe` / `unsubscribe` action. */ interface EngineServerSubscriptionParams { stream: EngineServerSubscriptionStream; } /** * Available actions on the subscription API. */ interface EngineServerSubscriptionRequestByType { subscribe: EngineServerSubscriptionParams; unsubscribe: EngineServerSubscriptionParams; list: Record; } type EngineServerSubscriptionRequestType = keyof EngineServerSubscriptionRequestByType; /** * Top level request to send to the server. */ type EngineServerSubscriptionRequest = { id: number; method: TRequestType; } & EngineServerSubscriptionRequestByType[TRequestType]; export type { EngineServerBestBidOfferStreamParams, EngineServerBookDepthStreamParams, EngineServerFillStreamParams, EngineServerOrderUpdateStreamParams, EngineServerPositionChangeStreamParams, EngineServerSubscriptionParams, EngineServerSubscriptionRequest, EngineServerSubscriptionRequestByType, EngineServerSubscriptionRequestType, EngineServerSubscriptionStream, EngineServerSubscriptionStreamParamsByType, EngineServerSubscriptionStreamParamsType, EngineServerTradeStreamParams };