Skip to content

Commit

Permalink
chore(): run linter fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tiagosiebler committed Dec 10, 2024
1 parent 13255d4 commit e92c083
Show file tree
Hide file tree
Showing 35 changed files with 812 additions and 820 deletions.
4 changes: 2 additions & 2 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ module.exports = {
plugins: [
'@typescript-eslint/eslint-plugin',
'simple-import-sort',
'require-extensions',
// 'require-extensions', // only once moved to ESM
],
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
'plugin:require-extensions/recommended',
// 'plugin:require-extensions/recommended', // only once moved to ESM
],
root: true,
env: {
Expand Down
2 changes: 1 addition & 1 deletion src/broker-client.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import {
APIResponse,
BrokerProductType,
BrokerSubWithdrawalRequest,
BrokerSubAPIKeyModifyRequest,
BrokerSubListRequest,
BrokerSubWithdrawalRequest,
} from './types';
import { REST_CLIENT_TYPE_ENUM } from './util';
import BaseRestClient from './util/BaseRestClient';
Expand Down
60 changes: 30 additions & 30 deletions src/futures-client.ts
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
import {
APIResponse,
FuturesProductType,
CancelFuturesPlanTPSL,
FuturesAccount,
FuturesAccountBillRequest,
FuturesBusinessBillRequest,
NewFuturesOrder,
NewBatchFuturesOrder,
FuturesCandleData,
FuturesHistoricPositions,
FuturesKlineInterval,
FuturesMarginMode,
FuturesMarketTrade,
FuturesPagination,
NewFuturesPlanOrder,
FuturesPlanType,
FuturesPosition,
FuturesProductType,
FuturesSymbolRule,
GetHistoricTradesParams,
HistoricPlanOrderTPSLRequest,
ModifyFuturesOrder,
ModifyFuturesPlanOrder,
ModifyFuturesPlanOrderTPSL,
NewFuturesPlanPositionTPSL,
ModifyFuturesPlanStopOrder,
CancelFuturesPlanTPSL,
HistoricPlanOrderTPSLRequest,
NewBatchFuturesOrder,
NewFuturesOrder,
NewFuturesPlanOrder,
NewFuturesPlanPositionTPSL,
NewFuturesPlanStopOrder,
FuturesAccount,
FuturesSymbolRule,
FuturesMarginMode,
FuturesPosition,
NewFuturesPlanTrailingStopOrder,
VIPFeeRate,
GetHistoricTradesParams,
FuturesMarketTrade,
FuturesPlanType,
FuturesKlineInterval,
FuturesHistoricPositions,
ModifyFuturesOrder,
FuturesCandleData,
} from './types';
import { REST_CLIENT_TYPE_ENUM } from './util';
import BaseRestClient from './util/BaseRestClient';
Expand Down Expand Up @@ -105,9 +105,9 @@ export class FuturesClient extends BaseRestClient {
symbol: string,
granularity: FuturesKlineInterval,
startTime: string,
endTime: string,
endTime: string,
limit?: string,
kLineType?: 'market' | 'mark' | 'index'
kLineType?: 'market' | 'mark' | 'index',
): Promise<APIResponse<FuturesCandleData[]>> {
return this.get('/api/mix/v1/market/candles', {
symbol,
Expand Down Expand Up @@ -569,16 +569,16 @@ export class FuturesClient extends BaseRestClient {
return this.postPrivate('/api/mix/v1/plan/cancelPlan', params);
}

/** Cancel Symbol Plan Order (TPSL) */
cancelSymbolPlanOrders(
symbol: string,
planType: FuturesPlanType,
): Promise<APIResponse<any>> {
return this.postPrivate('/api/mix/v1/plan/cancelSymbolPlan', {
symbol,
planType,
});
}
/** Cancel Symbol Plan Order (TPSL) */
cancelSymbolPlanOrders(
symbol: string,
planType: FuturesPlanType,
): Promise<APIResponse<any>> {
return this.postPrivate('/api/mix/v1/plan/cancelSymbolPlan', {
symbol,
planType,
});
}

/** Cancel All Trigger Order (TPSL) */
cancelAllPlanOrders(
Expand Down
10 changes: 5 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
export * from './rest-client-v2';
export * from './broker-client';
export * from './constants/enum';
export * from './futures-client';
export * from './rest-client-v2';
export * from './spot-client';
export * from './types';
export * from './util';
export * from './util/logger';
export * from './websocket-client';
export * from './websocket-client-v2';
export * from './util/logger';
export * from './util';
export * from './types';
export * from './constants/enum';
184 changes: 92 additions & 92 deletions src/rest-client-v2.ts
Original file line number Diff line number Diff line change
@@ -1,111 +1,111 @@
import {
APIResponse,
MarginType,
BorrowLoanRequestV2,
CloseFuturesFollowerPositionsRequestV2,
CopyTradingProductTypeV2,
FuturesAccountBillRequestV2,
FuturesBatchCancelOrderRequestV2,
FuturesBatchOrderRequestV2,
FuturesCancelAllOrdersRequestV2,
FuturesCancelOrderRequestV2,
FuturesCancelPlanOrderRequestV2,
FuturesCandlesRequestV2,
SpotCandlesRequestV2,
SpotAccountBill,
SpotHistoricCandlesRequestV2,
SpotHistoricTradesRequestV2,
SpotOrderRequestV2,
SpotCancelandSubmitOrderRequestV2,
SpotCancelOrderRequestV2,
SpotBatchOrderRequestV2,
SpotBatchCancelOrderRequestV2,
GetSpotOrderInfoRequestV2,
GetSpotOpenOrdersRequestV2,
GetSpotHistoryOrdersRequestV2,
GetSpotFillsRequestV2,
SpotPlanOrderRequestV2,
SpotModifyPlanOrderRequestV2,
GetSpotCurrentPlanOrdersRequestV2,
GetSpotHistoryPlanOrdersRequestV2,
GetSpotAccountBillsRequestV2,
SpotTransferRequestV2,
SpotAccountTypeV2,
SpotSubAccountTransferRequestV2,
SpotWithdrawalRequestV2,
SpotMainSubTransferRecordRequestV2,
GetSpotTransferRecordRequestV2,
GetSpotSubAccountDepositRecordRequestV2,
GetSpotWithdrawalRecordRequestV2,
GetSpotDepositRecordRequestV2,
FuturesMergeDepthRequestV2,
FuturesProductTypeV2,
FuturesRecentTradesRequestV2,
FuturesFlashClosePositionsRequestV2,
FuturesGetHistoricalFillsRequestV2,
FuturesGetHistoryOrdersRequestV2,
FuturesGetHistoryPlanOrdersRequestV2,
FuturesGetOpenOrdersRequestV2,
FuturesGetOrderFillsRequestV2,
FuturesGetOrderRequestV2,
FuturesGetPlanOrdersRequestV2,
FuturesHistoricalPositionsRequestV2,
FuturesHistoricTradesRequestV2,
FuturesSingleAccountRequestV2,
FuturesInterestHistoryRequestV2,
FuturesMergeDepthRequestV2,
FuturesModifyOrderRequestV2,
FuturesModifyPlanOrderRequestV2,
FuturesModifyTPSLOrderRequestV2,
FuturesOpenCountRequestV2,
FuturesPlaceOrderRequestV2,
FuturesPlanOrderRequestV2,
FuturesProductTypeV2,
FuturesRecentTradesRequestV2,
FuturesReversalOrderRequestV2,
FuturesSetAutoMarginRequestV2,
FuturesSetLeverageRequestV2,
FuturesSetPositionMarginRequestV2,
FuturesSetMarginModeRequestV2,
FuturesHistoricalPositionsRequestV2,
FuturesPlaceOrderRequestV2,
FuturesReversalOrderRequestV2,
FuturesBatchOrderRequestV2,
FuturesModifyOrderRequestV2,
FuturesCancelOrderRequestV2,
FuturesBatchCancelOrderRequestV2,
FuturesFlashClosePositionsRequestV2,
FuturesGetOrderRequestV2,
FuturesGetOrderFillsRequestV2,
FuturesGetHistoricalFillsRequestV2,
FuturesGetOpenOrdersRequestV2,
FuturesGetHistoryOrdersRequestV2,
FuturesCancelAllOrdersRequestV2,
FuturesSetPositionMarginRequestV2,
FuturesSingleAccountRequestV2,
FuturesTPSLOrderRequestV2,
FuturesPlanOrderRequestV2,
FuturesModifyTPSLOrderRequestV2,
FuturesModifyPlanOrderRequestV2,
FuturesGetPlanOrdersRequestV2,
FuturesCancelPlanOrderRequestV2,
FuturesGetHistoryPlanOrdersRequestV2,
FuturesTraderSymbolSettingRequestV2,
GetBorrowHistoryRequestV2,
GetRepayHistoryRequestV2,
GetInterestHistoryRequestV2,
GetLiquidationHistoryRequestV2,
GetEarnSavingsAssetsRequestV2,
GetEarnSavingsRecordsRequestV2,
GetFinancialHistoryRequestV2,
MarginPlaceOrderRequestV2,
MarginBatchOrdersRequestV2,
GetMarginCurrentOrdersRequestV2,
GetHistoryOrdersRequestV2,
GetMarginOrderFillsRequestV2,
GetMarginLiquidationOrdersRequestV2,
GetFuturesTraderCurrentOrdersRequestV2,
GetFuturesTraderHistoryOrdersRequestV2,
ModifyFuturesTraderOrderTPSLRequestV2,
GetFuturesTraderProfitShareDetailRequestV2,
CopyTradingProductTypeV2,
FuturesTraderSymbolSettingRequestV2,
GetFuturesTraderFollowersRequestV2,
GetFollowerFuturesCurrentTrackingOrdersRequestV2,
GetFollowerFuturesHistoryTrackingOrdersRequestV2,
UpdateFuturesFollowerTPSLRequestV2,
UpdateFuturesFollowerSettingsRequestV2,
GetFuturesFollowerTradersRequestV2,
CloseFuturesFollowerPositionsRequestV2,
GetSpotTraderHistoryProfitRequestV2,
GetSpotTraderHistoryOrdersRequestV2,
GetSpotTraderCurrentOrdersRequestV2,
GetSpotTraderFollowersRequestV2,
SpotFollowerCopyTradeSettingV2,
GetFuturesTraderCurrentOrdersRequestV2,
GetFuturesTraderFollowersRequestV2,
GetFuturesTraderHistoryOrdersRequestV2,
GetFuturesTraderProfitShareDetailRequestV2,
GetHistoryOrdersRequestV2,
GetInterestHistoryRequestV2,
GetLiquidationHistoryRequestV2,
GetLiquidationRecordsRequestV2,
GetLoanEstInterestAndBorrowableRequestV2,
GetLoanHistoryRequestV2,
GetLoanPledgeRateHistoryRequestV2,
GetLoanRepayHistoryRequestV2,
GetMarginCurrentOrdersRequestV2,
GetMarginLiquidationOrdersRequestV2,
GetMarginOrderFillsRequestV2,
GetRepayHistoryRequestV2,
GetSharkfinAssetsRequestV2,
GetSharkfinRecordsRequestV2,
GetSpotAccountBillsRequestV2,
GetSpotCurrentPlanOrdersRequestV2,
GetSpotDepositRecordRequestV2,
GetSpotFillsRequestV2,
GetSpotFollowerHistoryOrdersRequestV2,
GetSpotFollowerOpenOrdersRequestV2,
GetEarnSavingsAssetsRequestV2,
GetEarnSavingsRecordsRequestV2,
GetSpotHistoryOrdersRequestV2,
GetSpotHistoryPlanOrdersRequestV2,
GetSpotOpenOrdersRequestV2,
GetSpotOrderInfoRequestV2,
GetSpotSubAccountDepositRecordRequestV2,
GetSpotTraderCurrentOrdersRequestV2,
GetSpotTraderFollowersRequestV2,
GetSpotTraderHistoryOrdersRequestV2,
GetSpotTraderHistoryProfitRequestV2,
GetSpotTransferRecordRequestV2,
GetSpotWithdrawalRecordRequestV2,
MarginBatchOrdersRequestV2,
MarginPlaceOrderRequestV2,
MarginType,
ModifyFuturesTraderOrderTPSLRequestV2,
ModifyLoanPledgeRateRequestV2,
RedeemSavingsRequestV2,
GetSharkfinAssetsRequestV2,
GetSharkfinRecordsRequestV2,
GetLoanEstInterestAndBorrowableRequestV2,
BorrowLoanRequestV2,
RepayLoanRequestV2,
GetLoanRepayHistoryRequestV2,
ModifyLoanPledgeRateRequestV2,
GetLoanPledgeRateHistoryRequestV2,
GetLoanHistoryRequestV2,
GetLiquidationRecordsRequestV2,
SpotAccountBill,
SpotAccountTypeV2,
SpotBatchCancelOrderRequestV2,
SpotBatchOrderRequestV2,
SpotCancelandSubmitOrderRequestV2,
SpotCancelOrderRequestV2,
SpotCandlesRequestV2,
SpotFollowerCopyTradeSettingV2,
SpotHistoricCandlesRequestV2,
SpotHistoricTradesRequestV2,
SpotMainSubTransferRecordRequestV2,
SpotModifyPlanOrderRequestV2,
SpotOrderRequestV2,
SpotPlanOrderRequestV2,
SpotSubAccountTransferRequestV2,
SpotTransferRequestV2,
SpotWithdrawalRequestV2,
UpdateFuturesFollowerSettingsRequestV2,
UpdateFuturesFollowerTPSLRequestV2,
} from './types';
import {
CreateSubAccountApiKeyRequestV2,
Expand All @@ -122,6 +122,7 @@ import {
CreateVirtualSubApiKeyRequestV2,
CreateVirtualSubRequestV2,
GetAnnouncementsRequestV2,
GetConvertBGBHistoryRequestV2,
GetConvertHistoryRequestV2,
GetFuturesTransactionsRequestV2,
GetMarginTransactionsRequestV2,
Expand All @@ -131,11 +132,10 @@ import {
GetP2PTransactionsRequestV2,
GetSpotTransactionsRequestV2,
GetTradeRateRequestV2,
ModifyVirtualSubRequestV2,
ModifyVirtualSubApiKeyRequestV2,
GetConvertBGBHistoryRequestV2,
ModifyVirtualSubRequestV2,
} from './types/request/v2/common';
import { REST_CLIENT_TYPE_ENUM, assertMarginType } from './util';
import { assertMarginType, REST_CLIENT_TYPE_ENUM } from './util';
import BaseRestClient from './util/BaseRestClient';

/**
Expand Down Expand Up @@ -188,7 +188,7 @@ export class RestClientV2 extends BaseRestClient {
console.log(result);

console.log(
`Your approximate latency to exchange server:
`Your approximate latency to exchange server:
One way: ${estimatedOneWayLatency}ms.
Round trip: ${roundTripTime}ms.
`,
Expand Down
Loading

0 comments on commit e92c083

Please sign in to comment.