chore(): refactor ws events into organised dir

This commit is contained in:
tiagosiebler
2024-12-18 14:32:42 +00:00
parent b897826634
commit d508655136
28 changed files with 46 additions and 45 deletions

View File

@@ -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';

View File

@@ -1,4 +1,4 @@
import { AccountTypeV5, CategoryV5, TransactionTypeV5 } from '../v5-shared';
import { AccountTypeV5, CategoryV5, TransactionTypeV5 } from '../shared-v5';
export interface GetWalletBalanceParamsV5 {
accountType: AccountTypeV5;

View File

@@ -1,4 +1,4 @@
import { AccountTypeV5, CategoryV5 } from '../v5-shared';
import { AccountTypeV5, CategoryV5 } from '../shared-v5';
export interface GetCoinExchangeRecordParamsV5 {
fromCoin?: string;

View File

@@ -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';

View File

@@ -5,7 +5,7 @@ import {
OrderTypeV5,
PositionIdx,
TPSLModeV5,
} from '../v5-shared';
} from '../shared-v5';
export interface PositionInfoParamsV5 {
category: CategoryV5;

View File

@@ -1,4 +1,4 @@
import { ExecTypeV5 } from '../v5-shared';
import { ExecTypeV5 } from '../shared-v5';
export interface GetPreUpgradeOrderHistoryParamsV5 {
category: 'linear' | 'inverse';

View File

@@ -1,4 +1,4 @@
import { LTOrderTypeV5 } from '../v5-shared';
import { LTOrderTypeV5 } from '../shared-v5';
export interface PurchaseSpotLeveragedTokenParamsV5 {
ltCoin: string;

View File

@@ -8,7 +8,7 @@ import {
OrderTriggerByV5,
OrderTypeV5,
PositionIdx,
} from '../v5-shared';
} from '../shared-v5';
export interface OrderParamsV5 {
category: CategoryV5;

View File

@@ -1,4 +1,4 @@
import { PermissionsV5 } from '../v5-shared';
import { PermissionsV5 } from '../shared-v5';
export interface CreateSubMemberParamsV5 {
username: string;

View File

@@ -4,7 +4,7 @@ import {
CategoryV5,
TransactionTypeV5,
UnifiedUpdateStatusV5,
} from '../v5-shared';
} from '../shared-v5';
export interface WalletBalanceV5Coin {
coin: string;

View File

@@ -1,4 +1,4 @@
import { AccountTypeV5, OrderSideV5, WithdrawalTypeV5 } from '../v5-shared';
import { AccountTypeV5, OrderSideV5, WithdrawalTypeV5 } from '../shared-v5';
export interface CoinExchangeRecordV5 {
fromCoin: string;

View File

@@ -7,7 +7,7 @@ import {
MarginTradingV5,
OptionTypeV5,
OrderSideV5,
} from '../v5-shared';
} from '../shared-v5';
/**
* OHLCVT candle used by v5 APIs

View File

@@ -9,7 +9,7 @@ import {
StopOrderTypeV5,
TPSLModeV5,
TradeModeV5,
} from '../v5-shared';
} from '../shared-v5';
export interface PositionV5 {
positionIdx: PositionIdx;

View File

@@ -2,7 +2,7 @@ import {
LTOrderStatusV5,
LTOrderTypeV5,
LeverageTokenStatusV5,
} from '../v5-shared';
} from '../shared-v5';
export interface LeverageTokenInfoV5 {
ltCoin: string;

View File

@@ -10,7 +10,7 @@ import {
OrderTypeV5,
PositionIdx,
StopOrderTypeV5,
} from '../v5-shared';
} from '../shared-v5';
export interface OrderResultV5 {
orderId: string;

View File

@@ -1,4 +1,4 @@
import { PermissionsV5 } from '../v5-shared';
import { PermissionsV5 } from '../shared-v5';
export interface CreateSubMemberResultV5 {
uid: string;

View File

@@ -0,0 +1,2 @@
export * from './ws-general';
export * from './ws-events';

View 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;
}

View File

@@ -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;

View File

@@ -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 =

View File

@@ -1,6 +0,0 @@
import { WebsocketTopicSubscriptionConfirmationEvent } from './topic-subscription-confirmation';
export interface WebsocketFailedTopicSubscriptionConfirmationEvent
extends WebsocketTopicSubscriptionConfirmationEvent {
success: false;
}

View File

@@ -1,6 +0,0 @@
import { WebsocketTopicSubscriptionConfirmationEvent } from './topic-subscription-confirmation';
export interface WebsocketSucceededTopicSubscriptionConfirmationEvent
extends WebsocketTopicSubscriptionConfirmationEvent {
success: true;
}

View File

@@ -1,7 +0,0 @@
export interface WebsocketTopicSubscriptionConfirmationEvent {
op: 'subscribe';
req_id: string;
conn_id: string;
ret_msg: string;
success: boolean;
}