chore(): refactor ws events into organised dir
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
export * from './response';
|
||||
export * from './request';
|
||||
export * from './shared';
|
||||
export * from './v5-shared';
|
||||
export * from './shared-v5';
|
||||
export * from './websockets';
|
||||
export * from './websocket.events';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { AccountTypeV5, CategoryV5, TransactionTypeV5 } from '../v5-shared';
|
||||
import { AccountTypeV5, CategoryV5, TransactionTypeV5 } from '../shared-v5';
|
||||
|
||||
export interface GetWalletBalanceParamsV5 {
|
||||
accountType: AccountTypeV5;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { AccountTypeV5, CategoryV5 } from '../v5-shared';
|
||||
import { AccountTypeV5, CategoryV5 } from '../shared-v5';
|
||||
|
||||
export interface GetCoinExchangeRecordParamsV5 {
|
||||
fromCoin?: string;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { KlineIntervalV3 } from '../shared';
|
||||
import { CategoryV5, InstrumentStatusV5, OptionTypeV5 } from '../v5-shared';
|
||||
import { CategoryV5, InstrumentStatusV5, OptionTypeV5 } from '../shared-v5';
|
||||
|
||||
export interface GetKlineParamsV5 {
|
||||
category: 'spot' | 'linear' | 'inverse';
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
OrderTypeV5,
|
||||
PositionIdx,
|
||||
TPSLModeV5,
|
||||
} from '../v5-shared';
|
||||
} from '../shared-v5';
|
||||
|
||||
export interface PositionInfoParamsV5 {
|
||||
category: CategoryV5;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ExecTypeV5 } from '../v5-shared';
|
||||
import { ExecTypeV5 } from '../shared-v5';
|
||||
|
||||
export interface GetPreUpgradeOrderHistoryParamsV5 {
|
||||
category: 'linear' | 'inverse';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { LTOrderTypeV5 } from '../v5-shared';
|
||||
import { LTOrderTypeV5 } from '../shared-v5';
|
||||
|
||||
export interface PurchaseSpotLeveragedTokenParamsV5 {
|
||||
ltCoin: string;
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
OrderTriggerByV5,
|
||||
OrderTypeV5,
|
||||
PositionIdx,
|
||||
} from '../v5-shared';
|
||||
} from '../shared-v5';
|
||||
|
||||
export interface OrderParamsV5 {
|
||||
category: CategoryV5;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { PermissionsV5 } from '../v5-shared';
|
||||
import { PermissionsV5 } from '../shared-v5';
|
||||
|
||||
export interface CreateSubMemberParamsV5 {
|
||||
username: string;
|
||||
|
||||
@@ -4,7 +4,7 @@ import {
|
||||
CategoryV5,
|
||||
TransactionTypeV5,
|
||||
UnifiedUpdateStatusV5,
|
||||
} from '../v5-shared';
|
||||
} from '../shared-v5';
|
||||
|
||||
export interface WalletBalanceV5Coin {
|
||||
coin: string;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { AccountTypeV5, OrderSideV5, WithdrawalTypeV5 } from '../v5-shared';
|
||||
import { AccountTypeV5, OrderSideV5, WithdrawalTypeV5 } from '../shared-v5';
|
||||
|
||||
export interface CoinExchangeRecordV5 {
|
||||
fromCoin: string;
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
MarginTradingV5,
|
||||
OptionTypeV5,
|
||||
OrderSideV5,
|
||||
} from '../v5-shared';
|
||||
} from '../shared-v5';
|
||||
|
||||
/**
|
||||
* OHLCVT candle used by v5 APIs
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
StopOrderTypeV5,
|
||||
TPSLModeV5,
|
||||
TradeModeV5,
|
||||
} from '../v5-shared';
|
||||
} from '../shared-v5';
|
||||
|
||||
export interface PositionV5 {
|
||||
positionIdx: PositionIdx;
|
||||
|
||||
@@ -2,7 +2,7 @@ import {
|
||||
LTOrderStatusV5,
|
||||
LTOrderTypeV5,
|
||||
LeverageTokenStatusV5,
|
||||
} from '../v5-shared';
|
||||
} from '../shared-v5';
|
||||
|
||||
export interface LeverageTokenInfoV5 {
|
||||
ltCoin: string;
|
||||
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
OrderTypeV5,
|
||||
PositionIdx,
|
||||
StopOrderTypeV5,
|
||||
} from '../v5-shared';
|
||||
} from '../shared-v5';
|
||||
|
||||
export interface OrderResultV5 {
|
||||
orderId: string;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { PermissionsV5 } from '../v5-shared';
|
||||
import { PermissionsV5 } from '../shared-v5';
|
||||
|
||||
export interface CreateSubMemberResultV5 {
|
||||
uid: string;
|
||||
|
||||
2
src/types/websockets/index.ts
Normal file
2
src/types/websockets/index.ts
Normal file
@@ -0,0 +1,2 @@
|
||||
export * from './ws-general';
|
||||
export * from './ws-events';
|
||||
17
src/types/websockets/ws-confirmations.ts
Normal file
17
src/types/websockets/ws-confirmations.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
export interface WebsocketTopicSubscriptionConfirmationEvent {
|
||||
op: 'subscribe';
|
||||
req_id: string;
|
||||
conn_id: string;
|
||||
ret_msg: string;
|
||||
success: boolean;
|
||||
}
|
||||
|
||||
export interface WebsocketSucceededTopicSubscriptionConfirmationEvent
|
||||
extends WebsocketTopicSubscriptionConfirmationEvent {
|
||||
success: true;
|
||||
}
|
||||
|
||||
export interface WebsocketFailedTopicSubscriptionConfirmationEvent
|
||||
extends WebsocketTopicSubscriptionConfirmationEvent {
|
||||
success: false;
|
||||
}
|
||||
@@ -17,8 +17,8 @@ import {
|
||||
StopOrderTypeV5,
|
||||
TPSLModeV5,
|
||||
TradeModeV5,
|
||||
} from './v5-shared';
|
||||
import { WsKey } from './websockets';
|
||||
} from '../shared-v5';
|
||||
import { WsKey } from '.';
|
||||
|
||||
export interface WSPublicTopicEventV5<TTopic extends string, TType, TData> {
|
||||
id?: string;
|
||||
@@ -1,4 +1,4 @@
|
||||
import { RestClientOptions, WS_KEY_MAP } from '../util';
|
||||
import { RestClientOptions, WS_KEY_MAP } from '../../util';
|
||||
|
||||
/** For spot markets, spotV3 is recommended */
|
||||
export type APIMarket =
|
||||
@@ -1,6 +0,0 @@
|
||||
import { WebsocketTopicSubscriptionConfirmationEvent } from './topic-subscription-confirmation';
|
||||
|
||||
export interface WebsocketFailedTopicSubscriptionConfirmationEvent
|
||||
extends WebsocketTopicSubscriptionConfirmationEvent {
|
||||
success: false;
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
import { WebsocketTopicSubscriptionConfirmationEvent } from './topic-subscription-confirmation';
|
||||
|
||||
export interface WebsocketSucceededTopicSubscriptionConfirmationEvent
|
||||
extends WebsocketTopicSubscriptionConfirmationEvent {
|
||||
success: true;
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
export interface WebsocketTopicSubscriptionConfirmationEvent {
|
||||
op: 'subscribe';
|
||||
req_id: string;
|
||||
conn_id: string;
|
||||
ret_msg: string;
|
||||
success: boolean;
|
||||
}
|
||||
Reference in New Issue
Block a user