feat(v4.1.17): update dependencies and ESLint configuration, fix all linter errors
This commit is contained in:
10
src/index.ts
10
src/index.ts
@@ -1,8 +1,8 @@
|
||||
export * from './constants/enum';
|
||||
export * from './rest-client-v5';
|
||||
export * from './spot-client-v3';
|
||||
export * from './websocket-client';
|
||||
export * from './websocket-api-client';
|
||||
export * from './util/logger';
|
||||
export * from './util';
|
||||
export * from './types';
|
||||
export * from './constants/enum';
|
||||
export * from './util';
|
||||
export * from './util/logger';
|
||||
export * from './websocket-api-client';
|
||||
export * from './websocket-client';
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
/* eslint-disable max-len */
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
import {
|
||||
APIResponseV3,
|
||||
APIResponseV3WithTime,
|
||||
AccountBorrowCollateralLimitV5,
|
||||
AccountCoinBalanceV5,
|
||||
AccountInfoV5,
|
||||
@@ -18,6 +16,8 @@ import {
|
||||
AmendOrderParamsV5,
|
||||
AmendSpreadOrderParamsV5,
|
||||
ApiKeyInfoV5,
|
||||
APIResponseV3,
|
||||
APIResponseV3WithTime,
|
||||
AssetInfoV5,
|
||||
BatchAmendOrderParamsV5,
|
||||
BatchAmendOrderResultV5,
|
||||
@@ -44,8 +44,8 @@ import {
|
||||
CollateralInfoV5,
|
||||
CompletedLoanOrderV5,
|
||||
ConfirmNewRiskLimitParamsV5,
|
||||
ConvertCoinSpecV5,
|
||||
ConvertCoinsParamsV5,
|
||||
ConvertCoinSpecV5,
|
||||
ConvertHistoryRecordV5,
|
||||
ConvertQuoteV5,
|
||||
ConvertStatusV5,
|
||||
@@ -116,13 +116,13 @@ import {
|
||||
GetP2POrdersParamsV5,
|
||||
GetP2PPendingOrdersParamsV5,
|
||||
GetP2PPersonalAdsParamsV5,
|
||||
GetPremiumIndexPriceKlineParamsV5,
|
||||
GetPreUpgradeClosedPnlParamsV5,
|
||||
GetPreUpgradeOptionDeliveryRecordParamsV5,
|
||||
GetPreUpgradeOrderHistoryParamsV5,
|
||||
GetPreUpgradeTradeHistoryParamsV5,
|
||||
GetPreUpgradeTransactionLogParamsV5,
|
||||
GetPreUpgradeUSDCSessionParamsV5,
|
||||
GetPremiumIndexPriceKlineParamsV5,
|
||||
GetPublicTradingHistoryParamsV5,
|
||||
GetRepaymentHistoryParamsV5,
|
||||
GetRiskLimitParamsV5,
|
||||
@@ -148,9 +148,9 @@ import {
|
||||
IssueVoucherParamsV5,
|
||||
LoanLTVAdjustmentHistoryV5,
|
||||
LongShortRatioV5,
|
||||
MarkP2POrderAsPaidParamsV5,
|
||||
MMPModifyParamsV5,
|
||||
MMPStateV5,
|
||||
MarkP2POrderAsPaidParamsV5,
|
||||
MovePositionHistoryV5,
|
||||
MovePositionParamsV5,
|
||||
MovePositionResultV5,
|
||||
@@ -158,11 +158,11 @@ import {
|
||||
OHLCVKlineV5,
|
||||
OpenInterestResponseV5,
|
||||
OptionDeliveryPriceV5,
|
||||
OrderbookResponseV5,
|
||||
OrderParamsV5,
|
||||
OrderPriceLimitV5,
|
||||
OrderResultV5,
|
||||
OrderSideV5,
|
||||
OrderbookResponseV5,
|
||||
P2PAccountCoinsBalanceV5,
|
||||
P2PAdDetailV5,
|
||||
P2PCounterpartyUserInfoV5,
|
||||
@@ -192,15 +192,15 @@ import {
|
||||
SetLeverageParamsV5,
|
||||
SetRiskLimitParamsV5,
|
||||
SetRiskLimitResultV5,
|
||||
SettlementRecordV5,
|
||||
SetTPSLModeParamsV5,
|
||||
SetTradingStopParamsV5,
|
||||
SettlementRecordV5,
|
||||
SpotBorrowCheckResultV5,
|
||||
SpotMarginStateV5,
|
||||
SpreadInstrumentInfoV5,
|
||||
SpreadOpenOrderV5,
|
||||
SpreadOrderHistoryV5,
|
||||
SpreadOrderbookResponseV5,
|
||||
SpreadOrderHistoryV5,
|
||||
SpreadRecentTradeV5,
|
||||
SpreadTickerV5,
|
||||
SpreadTradeV5,
|
||||
@@ -209,10 +209,10 @@ import {
|
||||
SubmitStakeRedeemParamsV5,
|
||||
SwitchIsolatedMarginParamsV5,
|
||||
SwitchPositionModeParamsV5,
|
||||
TPSLModeV5,
|
||||
TickerLinearInverseV5,
|
||||
TickerOptionV5,
|
||||
TickerSpotV5,
|
||||
TPSLModeV5,
|
||||
TransactionLogV5,
|
||||
UnifiedAccountUpgradeResultV5,
|
||||
UniversalTransferParamsV5,
|
||||
@@ -221,14 +221,14 @@ import {
|
||||
UpdateApiKeyParamsV5,
|
||||
UpdateApiKeyResultV5,
|
||||
UpdateP2PAdParamsV5,
|
||||
VIPMarginDataV5,
|
||||
VaspEntityV5,
|
||||
VipBorrowableCoinsV5,
|
||||
VipCollateralCoinsV5,
|
||||
VIPMarginDataV5,
|
||||
WalletBalanceV5,
|
||||
WithdrawParamsV5,
|
||||
WithdrawableAmountV5,
|
||||
WithdrawalRecordV5,
|
||||
WithdrawParamsV5,
|
||||
} from './types';
|
||||
import { REST_CLIENT_TYPE_ENUM } from './util';
|
||||
import BaseRestClient from './util/BaseRestClient';
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import {
|
||||
CategoryV5,
|
||||
OrderFilterV5,
|
||||
OrderSMPTypeV5,
|
||||
OrderSideV5,
|
||||
OrderSMPTypeV5,
|
||||
OrderStatusV5,
|
||||
OrderTimeInForceV5,
|
||||
OrderTriggerByV5,
|
||||
|
||||
@@ -8,6 +8,7 @@ export * from './v5-account';
|
||||
export * from './v5-asset';
|
||||
export * from './v5-broker';
|
||||
export * from './v5-crypto-loan';
|
||||
export * from './v5-earn';
|
||||
export * from './v5-market';
|
||||
export * from './v5-p2p-trading';
|
||||
export * from './v5-position';
|
||||
@@ -15,4 +16,3 @@ export * from './v5-preupgrade';
|
||||
export * from './v5-spot-leverage-token';
|
||||
export * from './v5-trade';
|
||||
export * from './v5-user';
|
||||
export * from './v5-earn';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import {
|
||||
LeverageTokenStatusV5,
|
||||
LTOrderStatusV5,
|
||||
LTOrderTypeV5,
|
||||
LeverageTokenStatusV5,
|
||||
} from '../shared-v5';
|
||||
|
||||
export interface LeverageTokenInfoV5 {
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
export * from './ws-general';
|
||||
export * from './ws-events';
|
||||
export * from './ws-confirmations';
|
||||
export * from './ws-events';
|
||||
export * from './ws-general';
|
||||
|
||||
@@ -7,8 +7,8 @@ import {
|
||||
OrderCancelTypeV5,
|
||||
OrderCreateTypeV5,
|
||||
OrderRejectReasonV5,
|
||||
OrderSMPTypeV5,
|
||||
OrderSideV5,
|
||||
OrderSMPTypeV5,
|
||||
OrderStatusV5,
|
||||
OrderTimeInForceV5,
|
||||
OrderTriggerByV5,
|
||||
@@ -20,7 +20,6 @@ import {
|
||||
TPSLModeV5,
|
||||
TradeModeV5,
|
||||
} from '../shared-v5';
|
||||
|
||||
import { WsKey } from './ws-general';
|
||||
|
||||
export interface MessageEventLike {
|
||||
|
||||
@@ -4,10 +4,10 @@ import https from 'https';
|
||||
|
||||
import {
|
||||
APIID,
|
||||
RestClientOptions,
|
||||
RestClientType,
|
||||
getRestBaseUrl,
|
||||
parseRateLimitHeaders,
|
||||
RestClientOptions,
|
||||
RestClientType,
|
||||
serializeParams,
|
||||
} from './requestUtils';
|
||||
import { SignAlgorithm, SignEncodeMethod, signMessage } from './webCryptoAPI';
|
||||
|
||||
@@ -3,25 +3,25 @@
|
||||
import EventEmitter from 'events';
|
||||
import WebSocket from 'isomorphic-ws';
|
||||
|
||||
import {
|
||||
isMessageEvent,
|
||||
MessageEventLike,
|
||||
WebsocketClientOptions,
|
||||
WSClientConfigurableOptions,
|
||||
WsMarket,
|
||||
} from '../types';
|
||||
import { WsOperation } from '../types/websockets/ws-api';
|
||||
import { DefaultLogger } from './logger';
|
||||
import {
|
||||
MessageEventLike,
|
||||
WSClientConfigurableOptions,
|
||||
WebsocketClientOptions,
|
||||
WsMarket,
|
||||
isMessageEvent,
|
||||
} from '../types';
|
||||
import { WsStore } from './websockets/WsStore';
|
||||
import {
|
||||
WSConnectedResult,
|
||||
getNormalisedTopicRequests,
|
||||
safeTerminateWs,
|
||||
WS_LOGGER_CATEGORY,
|
||||
WSConnectedResult,
|
||||
WsConnectionStateEnum,
|
||||
WsTopicRequest,
|
||||
WsTopicRequestOrStringTopic,
|
||||
getNormalisedTopicRequests,
|
||||
safeTerminateWs,
|
||||
} from './websockets';
|
||||
import { WsOperation } from '../types/websockets/ws-api';
|
||||
import { WsStore } from './websockets/WsStore';
|
||||
|
||||
type UseTheExceptionEventInstead = never;
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { AxiosResponse } from 'axios';
|
||||
|
||||
import { APIRateLimit } from '../types';
|
||||
|
||||
export interface RestClientOptions {
|
||||
|
||||
@@ -6,7 +6,7 @@ import {
|
||||
WebsocketSucceededTopicSubscriptionConfirmationEvent,
|
||||
WebsocketTopicSubscriptionConfirmationEvent,
|
||||
} from '../types';
|
||||
import { WSAPIResponse, WS_API_Operations } from '../types/websockets/ws-api';
|
||||
import { WS_API_Operations, WSAPIResponse } from '../types/websockets/ws-api';
|
||||
import {
|
||||
WSAccountOrderEventV5,
|
||||
WSExecutionEventV5,
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import WebSocket from 'isomorphic-ws';
|
||||
|
||||
import {
|
||||
APIMarket,
|
||||
CategoryV5,
|
||||
@@ -6,9 +7,8 @@ import {
|
||||
WsKey,
|
||||
WsTopic,
|
||||
} from '../../types';
|
||||
|
||||
import { DefaultLogger } from '../logger';
|
||||
import { WSAPIRequest } from '../../types/websockets/ws-api';
|
||||
import { DefaultLogger } from '../logger';
|
||||
import { neverGuard } from '../typeGuards';
|
||||
|
||||
export const WS_LOGGER_CATEGORY = { category: 'bybit-ws' };
|
||||
|
||||
@@ -7,13 +7,18 @@ import {
|
||||
WsMarket,
|
||||
WsTopic,
|
||||
} from './types';
|
||||
import {
|
||||
Exact,
|
||||
WSAPIOperation,
|
||||
WsAPIOperationResponseMap,
|
||||
WSAPIRequest,
|
||||
WsAPITopicRequestParamMap,
|
||||
WsAPIWsKeyTopicMap,
|
||||
WsOperation,
|
||||
WsRequestOperationBybit,
|
||||
} from './types/websockets/ws-api';
|
||||
import {
|
||||
APIID,
|
||||
WSConnectedResult,
|
||||
WS_AUTH_ON_CONNECT_KEYS,
|
||||
WS_KEY_MAP,
|
||||
WS_LOGGER_CATEGORY,
|
||||
WsTopicRequest,
|
||||
getMaxTopicsPerSubscribeEvent,
|
||||
getNormalisedTopicRequests,
|
||||
getPromiseRefForWSAPIRequest,
|
||||
@@ -26,22 +31,17 @@ import {
|
||||
isWSAPIResponse,
|
||||
isWsPong,
|
||||
neverGuard,
|
||||
WS_AUTH_ON_CONNECT_KEYS,
|
||||
WS_KEY_MAP,
|
||||
WS_LOGGER_CATEGORY,
|
||||
WSConnectedResult,
|
||||
WsTopicRequest,
|
||||
} from './util';
|
||||
import {
|
||||
BaseWebsocketClient,
|
||||
EmittableEvent,
|
||||
MidflightWsRequestEvent,
|
||||
} from './util/BaseWSClient';
|
||||
import {
|
||||
Exact,
|
||||
WSAPIOperation,
|
||||
WSAPIRequest,
|
||||
WsAPIOperationResponseMap,
|
||||
WsAPITopicRequestParamMap,
|
||||
WsAPIWsKeyTopicMap,
|
||||
WsOperation,
|
||||
WsRequestOperationBybit,
|
||||
} from './types/websockets/ws-api';
|
||||
import { SignAlgorithm, signMessage } from './util/webCryptoAPI';
|
||||
|
||||
export class WebsocketClient extends BaseWebsocketClient<
|
||||
@@ -773,6 +773,7 @@ export class WebsocketClient extends BaseWebsocketClient<
|
||||
},
|
||||
true,
|
||||
);
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
} catch (e) {
|
||||
this.logger.error('Exception trying to reject WSAPI promise', {
|
||||
wsKey,
|
||||
@@ -800,6 +801,7 @@ export class WebsocketClient extends BaseWebsocketClient<
|
||||
},
|
||||
true,
|
||||
);
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
} catch (e) {
|
||||
this.logger.error('Exception trying to resolve WSAPI promise', {
|
||||
wsKey,
|
||||
|
||||
Reference in New Issue
Block a user