kucoin-universal-sdk
Version:
Official KuCoin Universal SDK.
103 lines (102 loc) • 5.04 kB
TypeScript
import { OrderbookLevel5EventCallback } from './model_orderbook_level5_event';
import { KlinesEventCallback } from './model_klines_event';
import { TickerV2EventCallback } from './model_ticker_v2_event';
import { SymbolSnapshotEventCallback } from './model_symbol_snapshot_event';
import { OrderbookIncrementEventCallback } from './model_orderbook_increment_event';
import { TickerV1EventCallback } from './model_ticker_v1_event';
import { OrderbookLevel50EventCallback } from './model_orderbook_level50_event';
import { ExecutionEventCallback } from './model_execution_event';
import { InstrumentEventCallback } from './model_instrument_event';
import { AnnouncementEventCallback } from './model_announcement_event';
import { WebSocketService } from '../../../internal/interfaces/websocket';
export interface FuturesPublicWS {
/**
* announcement announcement
* Subscribe this topic to get Funding Fee Settlement.
* push frequency: Settlement is made every 8 hours, real-time push
*/
announcement(symbol: string, callback: AnnouncementEventCallback): Promise<string>;
/**
* execution Match execution data.
* For each order executed, the system will send you the match messages in the format as following.
* push frequency: real-time
*/
execution(symbol: string, callback: ExecutionEventCallback): Promise<string>;
/**
* instrument instrument
* Subscribe this topic to get the mark Price, index Price or funding fee Rate
* push frequency: mark.index.price 1s, funding.rate 1min
*/
instrument(symbol: string, callback: InstrumentEventCallback): Promise<string>;
/**
* klines Klines
* Subscribe to this topic to get K-Line data.
* push frequency: 1s
*/
klines(symbol: string, type: string, callback: KlinesEventCallback): Promise<string>;
/**
* orderbookIncrement Orderbook - Increment
* The system will return the increment change orderbook data (all depth). If there is no change in the market, data will not be pushed.
* push frequency: real-time
*/
orderbookIncrement(symbol: string, callback: OrderbookIncrementEventCallback): Promise<string>;
/**
* orderbookLevel50 Orderbook - Level50
* The depth50 market data.
* push frequency: 100ms
*/
orderbookLevel50(symbol: string, callback: OrderbookLevel50EventCallback): Promise<string>;
/**
* orderbookLevel5 Orderbook - Level5
* The system will return the 5 best ask/bid orders data. If there is no change in the market, data will not be pushed
* push frequency: 100ms
*/
orderbookLevel5(symbol: string, callback: OrderbookLevel5EventCallback): Promise<string>;
/**
* symbolSnapshot Symbol Snapshot
* Get symbol snapshot.
* push frequency: 5000ms
*/
symbolSnapshot(symbol: string, callback: SymbolSnapshotEventCallback): Promise<string>;
/**
* tickerV1 Get Ticker(not recommended)
* Subscribe to this topic to get real-time pushes on BBO changes. It is not recommended to use this topic any more. For real-time ticker information, please subscribe /contractMarket/tickerV2:{symbol}.
* push frequency: real-time
*/
tickerV1(symbol: string, callback: TickerV1EventCallback): Promise<string>;
/**
* tickerV2 Get Ticker V2
* Subscribe to this topic to get real-time pushes of BBO changes. After subscription, when there are changes in the order book (not necessarily ask1/bid1 changes), the system will push the real-time ticker symbol information to you.
* push frequency: real-time
*/
tickerV2(symbol: string, callback: TickerV2EventCallback): Promise<string>;
/**
* Unsubscribe from topics
*/
unSubscribe(id: string): Promise<void>;
/**
* Start websocket
*/
start(): Promise<void>;
/**
* Stop websocket
*/
stop(): Promise<void>;
}
export declare class FuturesPublicWSImpl implements FuturesPublicWS {
private wsService;
constructor(wsService: WebSocketService);
announcement(symbol: string, callback: AnnouncementEventCallback): Promise<string>;
execution(symbol: string, callback: ExecutionEventCallback): Promise<string>;
instrument(symbol: string, callback: InstrumentEventCallback): Promise<string>;
klines(symbol: string, type: string, callback: KlinesEventCallback): Promise<string>;
orderbookIncrement(symbol: string, callback: OrderbookIncrementEventCallback): Promise<string>;
orderbookLevel50(symbol: string, callback: OrderbookLevel50EventCallback): Promise<string>;
orderbookLevel5(symbol: string, callback: OrderbookLevel5EventCallback): Promise<string>;
symbolSnapshot(symbol: string, callback: SymbolSnapshotEventCallback): Promise<string>;
tickerV1(symbol: string, callback: TickerV1EventCallback): Promise<string>;
tickerV2(symbol: string, callback: TickerV2EventCallback): Promise<string>;
unSubscribe(id: string): Promise<void>;
start(): Promise<void>;
stop(): Promise<void>;
}