v2.4.0-beta.1. remove circleci, cleaning in ws client
This commit is contained in:
40
src/util/websocket-util.ts
Normal file
40
src/util/websocket-util.ts
Normal file
@@ -0,0 +1,40 @@
|
||||
import { WsKey } from '../types';
|
||||
|
||||
export const wsKeyInverse = 'inverse';
|
||||
export const wsKeyLinearPrivate = 'linearPrivate';
|
||||
export const wsKeyLinearPublic = 'linearPublic';
|
||||
export const wsKeySpotPrivate = 'spotPrivate';
|
||||
export const wsKeySpotPublic = 'spotPublic';
|
||||
|
||||
export function getLinearWsKeyForTopic(topic: string): WsKey {
|
||||
const privateLinearTopics = [
|
||||
'position',
|
||||
'execution',
|
||||
'order',
|
||||
'stop_order',
|
||||
'wallet',
|
||||
];
|
||||
if (privateLinearTopics.includes(topic)) {
|
||||
return wsKeyLinearPrivate;
|
||||
}
|
||||
|
||||
return wsKeyLinearPublic;
|
||||
}
|
||||
|
||||
export function getSpotWsKeyForTopic(topic: string): WsKey {
|
||||
const privateLinearTopics = [
|
||||
'position',
|
||||
'execution',
|
||||
'order',
|
||||
'stop_order',
|
||||
'outboundAccountInfo',
|
||||
'executionReport',
|
||||
'ticketInfo',
|
||||
];
|
||||
|
||||
if (privateLinearTopics.includes(topic)) {
|
||||
return wsKeySpotPrivate;
|
||||
}
|
||||
|
||||
return wsKeySpotPublic;
|
||||
}
|
||||
Reference in New Issue
Block a user