ccxt 4.2.85 → 4.2.86

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -162,13 +162,15 @@ class idex extends idex$1 {
162
162
  'network': 'MATIC',
163
163
  },
164
164
  'exceptions': {
165
- 'INVALID_ORDER_QUANTITY': errors.InvalidOrder,
166
- 'INSUFFICIENT_FUNDS': errors.InsufficientFunds,
167
- 'SERVICE_UNAVAILABLE': errors.ExchangeNotAvailable,
168
- 'EXCEEDED_RATE_LIMIT': errors.DDoSProtection,
169
- 'INVALID_PARAMETER': errors.BadRequest,
170
- 'WALLET_NOT_ASSOCIATED': errors.InvalidAddress,
171
- 'INVALID_WALLET_SIGNATURE': errors.AuthenticationError,
165
+ 'exact': {
166
+ 'INVALID_ORDER_QUANTITY': errors.InvalidOrder,
167
+ 'INSUFFICIENT_FUNDS': errors.InsufficientFunds,
168
+ 'SERVICE_UNAVAILABLE': errors.ExchangeNotAvailable,
169
+ 'EXCEEDED_RATE_LIMIT': errors.DDoSProtection,
170
+ 'INVALID_PARAMETER': errors.BadRequest,
171
+ 'WALLET_NOT_ASSOCIATED': errors.InvalidAddress,
172
+ 'INVALID_WALLET_SIGNATURE': errors.AuthenticationError,
173
+ },
172
174
  },
173
175
  'requiredCredentials': {
174
176
  'walletAddress': true,
@@ -1494,11 +1496,8 @@ class idex extends idex$1 {
1494
1496
  handleErrors(code, reason, url, method, headers, body, response, requestHeaders, requestBody) {
1495
1497
  const errorCode = this.safeString(response, 'code');
1496
1498
  const message = this.safeString(response, 'message');
1497
- if (errorCode in this.exceptions) {
1498
- const Exception = this.exceptions[errorCode];
1499
- throw new Exception(this.id + ' ' + message);
1500
- }
1501
1499
  if (errorCode !== undefined) {
1500
+ this.throwExactlyMatchedException(this.exceptions['exact'], errorCode, message);
1502
1501
  throw new errors.ExchangeError(this.id + ' ' + message);
1503
1502
  }
1504
1503
  return undefined;
@@ -1133,8 +1133,10 @@ class okcoin extends okcoin$1 {
1133
1133
  const request = {
1134
1134
  'instId': market['id'],
1135
1135
  'bar': bar,
1136
- 'limit': limit,
1137
1136
  };
1137
+ if (limit !== undefined) {
1138
+ request['limit'] = limit; // default 100, max 100
1139
+ }
1138
1140
  let method = undefined;
1139
1141
  [method, params] = this.handleOptionAndParams(params, 'fetchOHLCV', 'method', 'publicGetMarketCandles');
1140
1142
  let response = undefined;
@@ -83,6 +83,7 @@ class bitget extends bitget$1 {
83
83
  '30015': errors.AuthenticationError,
84
84
  '30016': errors.BadRequest, // { event: 'error', code: 30016, msg: 'Param error' }
85
85
  },
86
+ 'broad': {},
86
87
  },
87
88
  },
88
89
  });
package/js/ccxt.d.ts CHANGED
@@ -4,7 +4,7 @@ import * as functions from './src/base/functions.js';
4
4
  import * as errors from './src/base/errors.js';
5
5
  import type { Market, Trade, Fee, Ticker, OrderBook, Order, Transaction, Tickers, Currency, Balance, DepositAddress, WithdrawalResponse, DepositAddressResponse, OHLCV, Balances, PartialBalances, Dictionary, MinMax, Position, FundingRateHistory, Liquidation, FundingHistory, MarginMode, Greeks, Leverage, Leverages, Option, OptionChain } from './src/base/types.js';
6
6
  import { BaseError, ExchangeError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, MarginModeAlreadySet, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, NotSupported, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, AuthenticationError, AddressPending, NoChange } from './src/base/errors.js';
7
- declare const version = "4.2.84";
7
+ declare const version = "4.2.85";
8
8
  import ace from './src/ace.js';
9
9
  import alpaca from './src/alpaca.js';
10
10
  import ascendex from './src/ascendex.js';
package/js/ccxt.js CHANGED
@@ -38,7 +38,7 @@ import * as errors from './src/base/errors.js';
38
38
  import { BaseError, ExchangeError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, MarginModeAlreadySet, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, NotSupported, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, AuthenticationError, AddressPending, NoChange } from './src/base/errors.js';
39
39
  //-----------------------------------------------------------------------------
40
40
  // this is updated by vss.js when building
41
- const version = '4.2.85';
41
+ const version = '4.2.86';
42
42
  Exchange.ccxtVersion = version;
43
43
  //-----------------------------------------------------------------------------
44
44
  import ace from './src/ace.js';
@@ -1,129 +1,238 @@
1
1
  import { implicitReturnType } from '../base/types.js';
2
2
  import { Exchange as _Exchange } from '../base/Exchange.js';
3
3
  interface Exchange {
4
- publicGetAmmMarket(params?: {}): Promise<implicitReturnType>;
5
- publicGetCommonCurrencyRate(params?: {}): Promise<implicitReturnType>;
6
- publicGetCommonAssetConfig(params?: {}): Promise<implicitReturnType>;
7
- publicGetCommonMaintainInfo(params?: {}): Promise<implicitReturnType>;
8
- publicGetCommonTempMaintainInfo(params?: {}): Promise<implicitReturnType>;
9
- publicGetMarginMarket(params?: {}): Promise<implicitReturnType>;
10
- publicGetMarketInfo(params?: {}): Promise<implicitReturnType>;
11
- publicGetMarketList(params?: {}): Promise<implicitReturnType>;
12
- publicGetMarketTicker(params?: {}): Promise<implicitReturnType>;
13
- publicGetMarketTickerAll(params?: {}): Promise<implicitReturnType>;
14
- publicGetMarketDepth(params?: {}): Promise<implicitReturnType>;
15
- publicGetMarketDeals(params?: {}): Promise<implicitReturnType>;
16
- publicGetMarketKline(params?: {}): Promise<implicitReturnType>;
17
- publicGetMarketDetail(params?: {}): Promise<implicitReturnType>;
18
- privateGetAccountAmmBalance(params?: {}): Promise<implicitReturnType>;
19
- privateGetAccountInvestmentBalance(params?: {}): Promise<implicitReturnType>;
20
- privateGetAccountBalanceHistory(params?: {}): Promise<implicitReturnType>;
21
- privateGetAccountMarketFee(params?: {}): Promise<implicitReturnType>;
22
- privateGetBalanceCoinDeposit(params?: {}): Promise<implicitReturnType>;
23
- privateGetBalanceCoinWithdraw(params?: {}): Promise<implicitReturnType>;
24
- privateGetBalanceInfo(params?: {}): Promise<implicitReturnType>;
25
- privateGetBalanceDepositAddressCoinType(params?: {}): Promise<implicitReturnType>;
26
- privateGetContractTransferHistory(params?: {}): Promise<implicitReturnType>;
27
- privateGetCreditInfo(params?: {}): Promise<implicitReturnType>;
28
- privateGetCreditBalance(params?: {}): Promise<implicitReturnType>;
29
- privateGetInvestmentTransferHistory(params?: {}): Promise<implicitReturnType>;
30
- privateGetMarginAccount(params?: {}): Promise<implicitReturnType>;
31
- privateGetMarginConfig(params?: {}): Promise<implicitReturnType>;
32
- privateGetMarginLoanHistory(params?: {}): Promise<implicitReturnType>;
33
- privateGetMarginTransferHistory(params?: {}): Promise<implicitReturnType>;
34
- privateGetOrderDeals(params?: {}): Promise<implicitReturnType>;
35
- privateGetOrderFinished(params?: {}): Promise<implicitReturnType>;
36
- privateGetOrderPending(params?: {}): Promise<implicitReturnType>;
37
- privateGetOrderStatus(params?: {}): Promise<implicitReturnType>;
38
- privateGetOrderStatusBatch(params?: {}): Promise<implicitReturnType>;
39
- privateGetOrderUserDeals(params?: {}): Promise<implicitReturnType>;
40
- privateGetOrderStopFinished(params?: {}): Promise<implicitReturnType>;
41
- privateGetOrderStopPending(params?: {}): Promise<implicitReturnType>;
42
- privateGetOrderUserTradeFee(params?: {}): Promise<implicitReturnType>;
43
- privateGetOrderMarketTradeInfo(params?: {}): Promise<implicitReturnType>;
44
- privateGetSubAccountBalance(params?: {}): Promise<implicitReturnType>;
45
- privateGetSubAccountTransferHistory(params?: {}): Promise<implicitReturnType>;
46
- privateGetSubAccountAuthApi(params?: {}): Promise<implicitReturnType>;
47
- privateGetSubAccountAuthApiUserAuthId(params?: {}): Promise<implicitReturnType>;
48
- privatePostBalanceCoinWithdraw(params?: {}): Promise<implicitReturnType>;
49
- privatePostContractBalanceTransfer(params?: {}): Promise<implicitReturnType>;
50
- privatePostMarginFlat(params?: {}): Promise<implicitReturnType>;
51
- privatePostMarginLoan(params?: {}): Promise<implicitReturnType>;
52
- privatePostMarginTransfer(params?: {}): Promise<implicitReturnType>;
53
- privatePostOrderLimitBatch(params?: {}): Promise<implicitReturnType>;
54
- privatePostOrderIoc(params?: {}): Promise<implicitReturnType>;
55
- privatePostOrderLimit(params?: {}): Promise<implicitReturnType>;
56
- privatePostOrderMarket(params?: {}): Promise<implicitReturnType>;
57
- privatePostOrderModify(params?: {}): Promise<implicitReturnType>;
58
- privatePostOrderStopLimit(params?: {}): Promise<implicitReturnType>;
59
- privatePostOrderStopMarket(params?: {}): Promise<implicitReturnType>;
60
- privatePostOrderStopModify(params?: {}): Promise<implicitReturnType>;
61
- privatePostSubAccountTransfer(params?: {}): Promise<implicitReturnType>;
62
- privatePostSubAccountRegister(params?: {}): Promise<implicitReturnType>;
63
- privatePostSubAccountUnfrozen(params?: {}): Promise<implicitReturnType>;
64
- privatePostSubAccountFrozen(params?: {}): Promise<implicitReturnType>;
65
- privatePostSubAccountAuthApi(params?: {}): Promise<implicitReturnType>;
66
- privatePutBalanceDepositAddressCoinType(params?: {}): Promise<implicitReturnType>;
67
- privatePutSubAccountUnfrozen(params?: {}): Promise<implicitReturnType>;
68
- privatePutSubAccountFrozen(params?: {}): Promise<implicitReturnType>;
69
- privatePutSubAccountAuthApiUserAuthId(params?: {}): Promise<implicitReturnType>;
70
- privatePutV1AccountSettings(params?: {}): Promise<implicitReturnType>;
71
- privateDeleteBalanceCoinWithdraw(params?: {}): Promise<implicitReturnType>;
72
- privateDeleteOrderPendingBatch(params?: {}): Promise<implicitReturnType>;
73
- privateDeleteOrderPending(params?: {}): Promise<implicitReturnType>;
74
- privateDeleteOrderStopPending(params?: {}): Promise<implicitReturnType>;
75
- privateDeleteOrderStopPendingId(params?: {}): Promise<implicitReturnType>;
76
- privateDeleteOrderPendingByClientId(params?: {}): Promise<implicitReturnType>;
77
- privateDeleteOrderStopPendingByClientId(params?: {}): Promise<implicitReturnType>;
78
- privateDeleteSubAccountAuthApiUserAuthId(params?: {}): Promise<implicitReturnType>;
79
- privateDeleteSubAccountAuthorizeId(params?: {}): Promise<implicitReturnType>;
80
- perpetualPublicGetPing(params?: {}): Promise<implicitReturnType>;
81
- perpetualPublicGetTime(params?: {}): Promise<implicitReturnType>;
82
- perpetualPublicGetMarketList(params?: {}): Promise<implicitReturnType>;
83
- perpetualPublicGetMarketLimitConfig(params?: {}): Promise<implicitReturnType>;
84
- perpetualPublicGetMarketTicker(params?: {}): Promise<implicitReturnType>;
85
- perpetualPublicGetMarketTickerAll(params?: {}): Promise<implicitReturnType>;
86
- perpetualPublicGetMarketDepth(params?: {}): Promise<implicitReturnType>;
87
- perpetualPublicGetMarketDeals(params?: {}): Promise<implicitReturnType>;
88
- perpetualPublicGetMarketFundingHistory(params?: {}): Promise<implicitReturnType>;
89
- perpetualPublicGetMarketKline(params?: {}): Promise<implicitReturnType>;
90
- perpetualPrivateGetMarketUserDeals(params?: {}): Promise<implicitReturnType>;
91
- perpetualPrivateGetAssetQuery(params?: {}): Promise<implicitReturnType>;
92
- perpetualPrivateGetOrderPending(params?: {}): Promise<implicitReturnType>;
93
- perpetualPrivateGetOrderFinished(params?: {}): Promise<implicitReturnType>;
94
- perpetualPrivateGetOrderStopFinished(params?: {}): Promise<implicitReturnType>;
95
- perpetualPrivateGetOrderStopPending(params?: {}): Promise<implicitReturnType>;
96
- perpetualPrivateGetOrderStatus(params?: {}): Promise<implicitReturnType>;
97
- perpetualPrivateGetOrderStopStatus(params?: {}): Promise<implicitReturnType>;
98
- perpetualPrivateGetPositionFinished(params?: {}): Promise<implicitReturnType>;
99
- perpetualPrivateGetPositionPending(params?: {}): Promise<implicitReturnType>;
100
- perpetualPrivateGetPositionFunding(params?: {}): Promise<implicitReturnType>;
101
- perpetualPrivateGetPositionAdlHistory(params?: {}): Promise<implicitReturnType>;
102
- perpetualPrivateGetMarketPreference(params?: {}): Promise<implicitReturnType>;
103
- perpetualPrivateGetPositionMarginHistory(params?: {}): Promise<implicitReturnType>;
104
- perpetualPrivateGetPositionSettleHistory(params?: {}): Promise<implicitReturnType>;
105
- perpetualPrivatePostMarketAdjustLeverage(params?: {}): Promise<implicitReturnType>;
106
- perpetualPrivatePostMarketPositionExpect(params?: {}): Promise<implicitReturnType>;
107
- perpetualPrivatePostOrderPutLimit(params?: {}): Promise<implicitReturnType>;
108
- perpetualPrivatePostOrderPutMarket(params?: {}): Promise<implicitReturnType>;
109
- perpetualPrivatePostOrderPutStopLimit(params?: {}): Promise<implicitReturnType>;
110
- perpetualPrivatePostOrderPutStopMarket(params?: {}): Promise<implicitReturnType>;
111
- perpetualPrivatePostOrderModify(params?: {}): Promise<implicitReturnType>;
112
- perpetualPrivatePostOrderModifyStop(params?: {}): Promise<implicitReturnType>;
113
- perpetualPrivatePostOrderCancel(params?: {}): Promise<implicitReturnType>;
114
- perpetualPrivatePostOrderCancelAll(params?: {}): Promise<implicitReturnType>;
115
- perpetualPrivatePostOrderCancelBatch(params?: {}): Promise<implicitReturnType>;
116
- perpetualPrivatePostOrderCancelStop(params?: {}): Promise<implicitReturnType>;
117
- perpetualPrivatePostOrderCancelStopAll(params?: {}): Promise<implicitReturnType>;
118
- perpetualPrivatePostOrderCloseLimit(params?: {}): Promise<implicitReturnType>;
119
- perpetualPrivatePostOrderCloseMarket(params?: {}): Promise<implicitReturnType>;
120
- perpetualPrivatePostPositionAdjustMargin(params?: {}): Promise<implicitReturnType>;
121
- perpetualPrivatePostPositionStopLoss(params?: {}): Promise<implicitReturnType>;
122
- perpetualPrivatePostPositionTakeProfit(params?: {}): Promise<implicitReturnType>;
123
- perpetualPrivatePostPositionMarketClose(params?: {}): Promise<implicitReturnType>;
124
- perpetualPrivatePostOrderCancelByClientId(params?: {}): Promise<implicitReturnType>;
125
- perpetualPrivatePostOrderCancelStopByClientId(params?: {}): Promise<implicitReturnType>;
126
- perpetualPrivatePostMarketPreference(params?: {}): Promise<implicitReturnType>;
4
+ v1PublicGetAmmMarket(params?: {}): Promise<implicitReturnType>;
5
+ v1PublicGetCommonCurrencyRate(params?: {}): Promise<implicitReturnType>;
6
+ v1PublicGetCommonAssetConfig(params?: {}): Promise<implicitReturnType>;
7
+ v1PublicGetCommonMaintainInfo(params?: {}): Promise<implicitReturnType>;
8
+ v1PublicGetCommonTempMaintainInfo(params?: {}): Promise<implicitReturnType>;
9
+ v1PublicGetMarginMarket(params?: {}): Promise<implicitReturnType>;
10
+ v1PublicGetMarketInfo(params?: {}): Promise<implicitReturnType>;
11
+ v1PublicGetMarketList(params?: {}): Promise<implicitReturnType>;
12
+ v1PublicGetMarketTicker(params?: {}): Promise<implicitReturnType>;
13
+ v1PublicGetMarketTickerAll(params?: {}): Promise<implicitReturnType>;
14
+ v1PublicGetMarketDepth(params?: {}): Promise<implicitReturnType>;
15
+ v1PublicGetMarketDeals(params?: {}): Promise<implicitReturnType>;
16
+ v1PublicGetMarketKline(params?: {}): Promise<implicitReturnType>;
17
+ v1PublicGetMarketDetail(params?: {}): Promise<implicitReturnType>;
18
+ v1PrivateGetAccountAmmBalance(params?: {}): Promise<implicitReturnType>;
19
+ v1PrivateGetAccountInvestmentBalance(params?: {}): Promise<implicitReturnType>;
20
+ v1PrivateGetAccountBalanceHistory(params?: {}): Promise<implicitReturnType>;
21
+ v1PrivateGetAccountMarketFee(params?: {}): Promise<implicitReturnType>;
22
+ v1PrivateGetBalanceCoinDeposit(params?: {}): Promise<implicitReturnType>;
23
+ v1PrivateGetBalanceCoinWithdraw(params?: {}): Promise<implicitReturnType>;
24
+ v1PrivateGetBalanceInfo(params?: {}): Promise<implicitReturnType>;
25
+ v1PrivateGetBalanceDepositAddressCoinType(params?: {}): Promise<implicitReturnType>;
26
+ v1PrivateGetContractTransferHistory(params?: {}): Promise<implicitReturnType>;
27
+ v1PrivateGetCreditInfo(params?: {}): Promise<implicitReturnType>;
28
+ v1PrivateGetCreditBalance(params?: {}): Promise<implicitReturnType>;
29
+ v1PrivateGetInvestmentTransferHistory(params?: {}): Promise<implicitReturnType>;
30
+ v1PrivateGetMarginAccount(params?: {}): Promise<implicitReturnType>;
31
+ v1PrivateGetMarginConfig(params?: {}): Promise<implicitReturnType>;
32
+ v1PrivateGetMarginLoanHistory(params?: {}): Promise<implicitReturnType>;
33
+ v1PrivateGetMarginTransferHistory(params?: {}): Promise<implicitReturnType>;
34
+ v1PrivateGetOrderDeals(params?: {}): Promise<implicitReturnType>;
35
+ v1PrivateGetOrderFinished(params?: {}): Promise<implicitReturnType>;
36
+ v1PrivateGetOrderPending(params?: {}): Promise<implicitReturnType>;
37
+ v1PrivateGetOrderStatus(params?: {}): Promise<implicitReturnType>;
38
+ v1PrivateGetOrderStatusBatch(params?: {}): Promise<implicitReturnType>;
39
+ v1PrivateGetOrderUserDeals(params?: {}): Promise<implicitReturnType>;
40
+ v1PrivateGetOrderStopFinished(params?: {}): Promise<implicitReturnType>;
41
+ v1PrivateGetOrderStopPending(params?: {}): Promise<implicitReturnType>;
42
+ v1PrivateGetOrderUserTradeFee(params?: {}): Promise<implicitReturnType>;
43
+ v1PrivateGetOrderMarketTradeInfo(params?: {}): Promise<implicitReturnType>;
44
+ v1PrivateGetSubAccountBalance(params?: {}): Promise<implicitReturnType>;
45
+ v1PrivateGetSubAccountTransferHistory(params?: {}): Promise<implicitReturnType>;
46
+ v1PrivateGetSubAccountAuthApi(params?: {}): Promise<implicitReturnType>;
47
+ v1PrivateGetSubAccountAuthApiUserAuthId(params?: {}): Promise<implicitReturnType>;
48
+ v1PrivatePostBalanceCoinWithdraw(params?: {}): Promise<implicitReturnType>;
49
+ v1PrivatePostContractBalanceTransfer(params?: {}): Promise<implicitReturnType>;
50
+ v1PrivatePostMarginFlat(params?: {}): Promise<implicitReturnType>;
51
+ v1PrivatePostMarginLoan(params?: {}): Promise<implicitReturnType>;
52
+ v1PrivatePostMarginTransfer(params?: {}): Promise<implicitReturnType>;
53
+ v1PrivatePostOrderLimitBatch(params?: {}): Promise<implicitReturnType>;
54
+ v1PrivatePostOrderIoc(params?: {}): Promise<implicitReturnType>;
55
+ v1PrivatePostOrderLimit(params?: {}): Promise<implicitReturnType>;
56
+ v1PrivatePostOrderMarket(params?: {}): Promise<implicitReturnType>;
57
+ v1PrivatePostOrderModify(params?: {}): Promise<implicitReturnType>;
58
+ v1PrivatePostOrderStopLimit(params?: {}): Promise<implicitReturnType>;
59
+ v1PrivatePostOrderStopMarket(params?: {}): Promise<implicitReturnType>;
60
+ v1PrivatePostOrderStopModify(params?: {}): Promise<implicitReturnType>;
61
+ v1PrivatePostSubAccountTransfer(params?: {}): Promise<implicitReturnType>;
62
+ v1PrivatePostSubAccountRegister(params?: {}): Promise<implicitReturnType>;
63
+ v1PrivatePostSubAccountUnfrozen(params?: {}): Promise<implicitReturnType>;
64
+ v1PrivatePostSubAccountFrozen(params?: {}): Promise<implicitReturnType>;
65
+ v1PrivatePostSubAccountAuthApi(params?: {}): Promise<implicitReturnType>;
66
+ v1PrivatePutBalanceDepositAddressCoinType(params?: {}): Promise<implicitReturnType>;
67
+ v1PrivatePutSubAccountUnfrozen(params?: {}): Promise<implicitReturnType>;
68
+ v1PrivatePutSubAccountFrozen(params?: {}): Promise<implicitReturnType>;
69
+ v1PrivatePutSubAccountAuthApiUserAuthId(params?: {}): Promise<implicitReturnType>;
70
+ v1PrivatePutV1AccountSettings(params?: {}): Promise<implicitReturnType>;
71
+ v1PrivateDeleteBalanceCoinWithdraw(params?: {}): Promise<implicitReturnType>;
72
+ v1PrivateDeleteOrderPendingBatch(params?: {}): Promise<implicitReturnType>;
73
+ v1PrivateDeleteOrderPending(params?: {}): Promise<implicitReturnType>;
74
+ v1PrivateDeleteOrderStopPending(params?: {}): Promise<implicitReturnType>;
75
+ v1PrivateDeleteOrderStopPendingId(params?: {}): Promise<implicitReturnType>;
76
+ v1PrivateDeleteOrderPendingByClientId(params?: {}): Promise<implicitReturnType>;
77
+ v1PrivateDeleteOrderStopPendingByClientId(params?: {}): Promise<implicitReturnType>;
78
+ v1PrivateDeleteSubAccountAuthApiUserAuthId(params?: {}): Promise<implicitReturnType>;
79
+ v1PrivateDeleteSubAccountAuthorizeId(params?: {}): Promise<implicitReturnType>;
80
+ v1PerpetualPublicGetPing(params?: {}): Promise<implicitReturnType>;
81
+ v1PerpetualPublicGetTime(params?: {}): Promise<implicitReturnType>;
82
+ v1PerpetualPublicGetMarketList(params?: {}): Promise<implicitReturnType>;
83
+ v1PerpetualPublicGetMarketLimitConfig(params?: {}): Promise<implicitReturnType>;
84
+ v1PerpetualPublicGetMarketTicker(params?: {}): Promise<implicitReturnType>;
85
+ v1PerpetualPublicGetMarketTickerAll(params?: {}): Promise<implicitReturnType>;
86
+ v1PerpetualPublicGetMarketDepth(params?: {}): Promise<implicitReturnType>;
87
+ v1PerpetualPublicGetMarketDeals(params?: {}): Promise<implicitReturnType>;
88
+ v1PerpetualPublicGetMarketFundingHistory(params?: {}): Promise<implicitReturnType>;
89
+ v1PerpetualPublicGetMarketKline(params?: {}): Promise<implicitReturnType>;
90
+ v1PerpetualPrivateGetMarketUserDeals(params?: {}): Promise<implicitReturnType>;
91
+ v1PerpetualPrivateGetAssetQuery(params?: {}): Promise<implicitReturnType>;
92
+ v1PerpetualPrivateGetOrderPending(params?: {}): Promise<implicitReturnType>;
93
+ v1PerpetualPrivateGetOrderFinished(params?: {}): Promise<implicitReturnType>;
94
+ v1PerpetualPrivateGetOrderStopFinished(params?: {}): Promise<implicitReturnType>;
95
+ v1PerpetualPrivateGetOrderStopPending(params?: {}): Promise<implicitReturnType>;
96
+ v1PerpetualPrivateGetOrderStatus(params?: {}): Promise<implicitReturnType>;
97
+ v1PerpetualPrivateGetOrderStopStatus(params?: {}): Promise<implicitReturnType>;
98
+ v1PerpetualPrivateGetPositionFinished(params?: {}): Promise<implicitReturnType>;
99
+ v1PerpetualPrivateGetPositionPending(params?: {}): Promise<implicitReturnType>;
100
+ v1PerpetualPrivateGetPositionFunding(params?: {}): Promise<implicitReturnType>;
101
+ v1PerpetualPrivateGetPositionAdlHistory(params?: {}): Promise<implicitReturnType>;
102
+ v1PerpetualPrivateGetMarketPreference(params?: {}): Promise<implicitReturnType>;
103
+ v1PerpetualPrivateGetPositionMarginHistory(params?: {}): Promise<implicitReturnType>;
104
+ v1PerpetualPrivateGetPositionSettleHistory(params?: {}): Promise<implicitReturnType>;
105
+ v1PerpetualPrivatePostMarketAdjustLeverage(params?: {}): Promise<implicitReturnType>;
106
+ v1PerpetualPrivatePostMarketPositionExpect(params?: {}): Promise<implicitReturnType>;
107
+ v1PerpetualPrivatePostOrderPutLimit(params?: {}): Promise<implicitReturnType>;
108
+ v1PerpetualPrivatePostOrderPutMarket(params?: {}): Promise<implicitReturnType>;
109
+ v1PerpetualPrivatePostOrderPutStopLimit(params?: {}): Promise<implicitReturnType>;
110
+ v1PerpetualPrivatePostOrderPutStopMarket(params?: {}): Promise<implicitReturnType>;
111
+ v1PerpetualPrivatePostOrderModify(params?: {}): Promise<implicitReturnType>;
112
+ v1PerpetualPrivatePostOrderModifyStop(params?: {}): Promise<implicitReturnType>;
113
+ v1PerpetualPrivatePostOrderCancel(params?: {}): Promise<implicitReturnType>;
114
+ v1PerpetualPrivatePostOrderCancelAll(params?: {}): Promise<implicitReturnType>;
115
+ v1PerpetualPrivatePostOrderCancelBatch(params?: {}): Promise<implicitReturnType>;
116
+ v1PerpetualPrivatePostOrderCancelStop(params?: {}): Promise<implicitReturnType>;
117
+ v1PerpetualPrivatePostOrderCancelStopAll(params?: {}): Promise<implicitReturnType>;
118
+ v1PerpetualPrivatePostOrderCloseLimit(params?: {}): Promise<implicitReturnType>;
119
+ v1PerpetualPrivatePostOrderCloseMarket(params?: {}): Promise<implicitReturnType>;
120
+ v1PerpetualPrivatePostPositionAdjustMargin(params?: {}): Promise<implicitReturnType>;
121
+ v1PerpetualPrivatePostPositionStopLoss(params?: {}): Promise<implicitReturnType>;
122
+ v1PerpetualPrivatePostPositionTakeProfit(params?: {}): Promise<implicitReturnType>;
123
+ v1PerpetualPrivatePostPositionMarketClose(params?: {}): Promise<implicitReturnType>;
124
+ v1PerpetualPrivatePostOrderCancelByClientId(params?: {}): Promise<implicitReturnType>;
125
+ v1PerpetualPrivatePostOrderCancelStopByClientId(params?: {}): Promise<implicitReturnType>;
126
+ v1PerpetualPrivatePostMarketPreference(params?: {}): Promise<implicitReturnType>;
127
+ v2PublicGetMaintainInfo(params?: {}): Promise<implicitReturnType>;
128
+ v2PublicGetPing(params?: {}): Promise<implicitReturnType>;
129
+ v2PublicGetTime(params?: {}): Promise<implicitReturnType>;
130
+ v2PublicGetSpotMarket(params?: {}): Promise<implicitReturnType>;
131
+ v2PublicGetSpotTicker(params?: {}): Promise<implicitReturnType>;
132
+ v2PublicGetSpotDepth(params?: {}): Promise<implicitReturnType>;
133
+ v2PublicGetSpotDeals(params?: {}): Promise<implicitReturnType>;
134
+ v2PublicGetSpotKline(params?: {}): Promise<implicitReturnType>;
135
+ v2PublicGetSpotIndex(params?: {}): Promise<implicitReturnType>;
136
+ v2PublicGetFuturesMarket(params?: {}): Promise<implicitReturnType>;
137
+ v2PublicGetFuturesTicker(params?: {}): Promise<implicitReturnType>;
138
+ v2PublicGetFuturesDepth(params?: {}): Promise<implicitReturnType>;
139
+ v2PublicGetFuturesDeals(params?: {}): Promise<implicitReturnType>;
140
+ v2PublicGetFuturesKline(params?: {}): Promise<implicitReturnType>;
141
+ v2PublicGetFuturesIndex(params?: {}): Promise<implicitReturnType>;
142
+ v2PublicGetFuturesFundingRate(params?: {}): Promise<implicitReturnType>;
143
+ v2PublicGetFuturesFundingRateHistory(params?: {}): Promise<implicitReturnType>;
144
+ v2PublicGetFuturesPositionLevel(params?: {}): Promise<implicitReturnType>;
145
+ v2PublicGetFuturesLiquidationHistory(params?: {}): Promise<implicitReturnType>;
146
+ v2PublicGetFuturesBasisHistory(params?: {}): Promise<implicitReturnType>;
147
+ v2PrivateGetAccountSubs(params?: {}): Promise<implicitReturnType>;
148
+ v2PrivateGetAccountSubsApiDetail(params?: {}): Promise<implicitReturnType>;
149
+ v2PrivateGetAccountSubsInfo(params?: {}): Promise<implicitReturnType>;
150
+ v2PrivateGetAccountSubsApi(params?: {}): Promise<implicitReturnType>;
151
+ v2PrivateGetAccountSubsTransferHistory(params?: {}): Promise<implicitReturnType>;
152
+ v2PrivateGetAccountSubsSpotBalance(params?: {}): Promise<implicitReturnType>;
153
+ v2PrivateGetAccountTradeFeeRate(params?: {}): Promise<implicitReturnType>;
154
+ v2PrivateGetAssetsSpotBalance(params?: {}): Promise<implicitReturnType>;
155
+ v2PrivateGetAssetsFuturesBalance(params?: {}): Promise<implicitReturnType>;
156
+ v2PrivateGetAssetsMarginBalance(params?: {}): Promise<implicitReturnType>;
157
+ v2PrivateGetAssetsFinancialBalance(params?: {}): Promise<implicitReturnType>;
158
+ v2PrivateGetAssetsAmmLiquidity(params?: {}): Promise<implicitReturnType>;
159
+ v2PrivateGetAssetsCreditInfo(params?: {}): Promise<implicitReturnType>;
160
+ v2PrivateGetAssetsMarginBorrowHistory(params?: {}): Promise<implicitReturnType>;
161
+ v2PrivateGetAssetsMarginInterestLimit(params?: {}): Promise<implicitReturnType>;
162
+ v2PrivateGetAssetsDepositAddress(params?: {}): Promise<implicitReturnType>;
163
+ v2PrivateGetAssetsDepositHistory(params?: {}): Promise<implicitReturnType>;
164
+ v2PrivateGetAssetsWithdraw(params?: {}): Promise<implicitReturnType>;
165
+ v2PrivateGetAssetsDepositWithdrawConfig(params?: {}): Promise<implicitReturnType>;
166
+ v2PrivateGetAssetsTransferHistory(params?: {}): Promise<implicitReturnType>;
167
+ v2PrivateGetSpotOrderStatus(params?: {}): Promise<implicitReturnType>;
168
+ v2PrivateGetSpotBatchOrderStatus(params?: {}): Promise<implicitReturnType>;
169
+ v2PrivateGetSpotPendingOrder(params?: {}): Promise<implicitReturnType>;
170
+ v2PrivateGetSpotFinishedOrder(params?: {}): Promise<implicitReturnType>;
171
+ v2PrivateGetSpotPendingStopOrder(params?: {}): Promise<implicitReturnType>;
172
+ v2PrivateGetSpotFinishedStopOrder(params?: {}): Promise<implicitReturnType>;
173
+ v2PrivateGetSpotUserDeals(params?: {}): Promise<implicitReturnType>;
174
+ v2PrivateGetSpotOrderDeals(params?: {}): Promise<implicitReturnType>;
175
+ v2PrivateGetFuturesOrderStatus(params?: {}): Promise<implicitReturnType>;
176
+ v2PrivateGetFuturesBatchOrderStatus(params?: {}): Promise<implicitReturnType>;
177
+ v2PrivateGetFuturesPendingOrder(params?: {}): Promise<implicitReturnType>;
178
+ v2PrivateGetFuturesFinishedOrder(params?: {}): Promise<implicitReturnType>;
179
+ v2PrivateGetFuturesPendingStopOrder(params?: {}): Promise<implicitReturnType>;
180
+ v2PrivateGetFuturesFinishedStopOrder(params?: {}): Promise<implicitReturnType>;
181
+ v2PrivateGetFuturesUserDeals(params?: {}): Promise<implicitReturnType>;
182
+ v2PrivateGetFuturesOrderDeals(params?: {}): Promise<implicitReturnType>;
183
+ v2PrivateGetFuturesPendingPosition(params?: {}): Promise<implicitReturnType>;
184
+ v2PrivateGetFuturesFinishedPosition(params?: {}): Promise<implicitReturnType>;
185
+ v2PrivateGetFuturesPositionMarginHistory(params?: {}): Promise<implicitReturnType>;
186
+ v2PrivateGetFuturesPositionFundingHistory(params?: {}): Promise<implicitReturnType>;
187
+ v2PrivateGetFuturesPositionAdlHistory(params?: {}): Promise<implicitReturnType>;
188
+ v2PrivateGetFuturesPositionSettleHistory(params?: {}): Promise<implicitReturnType>;
189
+ v2PrivatePostAccountSubs(params?: {}): Promise<implicitReturnType>;
190
+ v2PrivatePostAccountSubsFrozen(params?: {}): Promise<implicitReturnType>;
191
+ v2PrivatePostAccountSubsUnfrozen(params?: {}): Promise<implicitReturnType>;
192
+ v2PrivatePostAccountSubsApi(params?: {}): Promise<implicitReturnType>;
193
+ v2PrivatePostAccountSubsEditApi(params?: {}): Promise<implicitReturnType>;
194
+ v2PrivatePostAccountSubsDeleteApi(params?: {}): Promise<implicitReturnType>;
195
+ v2PrivatePostAccountSubsTransfer(params?: {}): Promise<implicitReturnType>;
196
+ v2PrivatePostAccountSettings(params?: {}): Promise<implicitReturnType>;
197
+ v2PrivatePostAssetsMarginBorrow(params?: {}): Promise<implicitReturnType>;
198
+ v2PrivatePostAssetsMarginRepay(params?: {}): Promise<implicitReturnType>;
199
+ v2PrivatePostAssetsRenewalDepositAddress(params?: {}): Promise<implicitReturnType>;
200
+ v2PrivatePostAssetsWithdraw(params?: {}): Promise<implicitReturnType>;
201
+ v2PrivatePostAssetsCancelWithdraw(params?: {}): Promise<implicitReturnType>;
202
+ v2PrivatePostAssetsTransfer(params?: {}): Promise<implicitReturnType>;
203
+ v2PrivatePostAssetsAmmAddLiquidity(params?: {}): Promise<implicitReturnType>;
204
+ v2PrivatePostAssetsAmmRemoveLiquidity(params?: {}): Promise<implicitReturnType>;
205
+ v2PrivatePostSpotOrder(params?: {}): Promise<implicitReturnType>;
206
+ v2PrivatePostSpotStopOrder(params?: {}): Promise<implicitReturnType>;
207
+ v2PrivatePostSpotBatchOrder(params?: {}): Promise<implicitReturnType>;
208
+ v2PrivatePostSpotBatchStopOrder(params?: {}): Promise<implicitReturnType>;
209
+ v2PrivatePostSpotModifyOrder(params?: {}): Promise<implicitReturnType>;
210
+ v2PrivatePostSpotModifyStopOrder(params?: {}): Promise<implicitReturnType>;
211
+ v2PrivatePostSpotCancelAllOrder(params?: {}): Promise<implicitReturnType>;
212
+ v2PrivatePostSpotCancelOrder(params?: {}): Promise<implicitReturnType>;
213
+ v2PrivatePostSpotCancelStopOrder(params?: {}): Promise<implicitReturnType>;
214
+ v2PrivatePostSpotCancelBatchOrder(params?: {}): Promise<implicitReturnType>;
215
+ v2PrivatePostSpotCancelBatchStopOrder(params?: {}): Promise<implicitReturnType>;
216
+ v2PrivatePostSpotCancelOrderByClientId(params?: {}): Promise<implicitReturnType>;
217
+ v2PrivatePostSpotCancelStopOrderByClientId(params?: {}): Promise<implicitReturnType>;
218
+ v2PrivatePostFuturesOrder(params?: {}): Promise<implicitReturnType>;
219
+ v2PrivatePostFuturesStopOrder(params?: {}): Promise<implicitReturnType>;
220
+ v2PrivatePostFuturesBatchOrder(params?: {}): Promise<implicitReturnType>;
221
+ v2PrivatePostFuturesBatchStopOrder(params?: {}): Promise<implicitReturnType>;
222
+ v2PrivatePostFuturesModifyOrder(params?: {}): Promise<implicitReturnType>;
223
+ v2PrivatePostFuturesModifyStopOrder(params?: {}): Promise<implicitReturnType>;
224
+ v2PrivatePostFuturesCancelAllOrder(params?: {}): Promise<implicitReturnType>;
225
+ v2PrivatePostFuturesCancelOrder(params?: {}): Promise<implicitReturnType>;
226
+ v2PrivatePostFuturesCancelStopOrder(params?: {}): Promise<implicitReturnType>;
227
+ v2PrivatePostFuturesCancelBatchOrder(params?: {}): Promise<implicitReturnType>;
228
+ v2PrivatePostFuturesCancelBatchStopOrder(params?: {}): Promise<implicitReturnType>;
229
+ v2PrivatePostFuturesCancelOrderByClientId(params?: {}): Promise<implicitReturnType>;
230
+ v2PrivatePostFuturesCancelStopOrderByClientId(params?: {}): Promise<implicitReturnType>;
231
+ v2PrivatePostFuturesClosePosition(params?: {}): Promise<implicitReturnType>;
232
+ v2PrivatePostFuturesAdjustPositionMargin(params?: {}): Promise<implicitReturnType>;
233
+ v2PrivatePostFuturesAdjustPositionLeverage(params?: {}): Promise<implicitReturnType>;
234
+ v2PrivatePostFuturesSetPositionStopLoss(params?: {}): Promise<implicitReturnType>;
235
+ v2PrivatePostFuturesSetPositionTakeProfit(params?: {}): Promise<implicitReturnType>;
127
236
  }
128
237
  declare abstract class Exchange extends _Exchange {
129
238
  }
@@ -52,7 +52,7 @@ export default class Exchange {
52
52
  nodeHttpModuleLoaded: boolean;
53
53
  httpAgent: any;
54
54
  httpsAgent: any;
55
- minFundingAddressLength: number;
55
+ minFundingAddressLength: Int;
56
56
  substituteCommonCurrencyCodes: boolean;
57
57
  quoteJsonNumbers: boolean;
58
58
  number: (numberString: string) => number;
@@ -63,7 +63,7 @@ export default class Exchange {
63
63
  FetchError: any;
64
64
  validateServerSsl: boolean;
65
65
  validateClientSsl: boolean;
66
- timeout: number;
66
+ timeout: Int;
67
67
  verbose: boolean;
68
68
  twofa: any;
69
69
  apiKey: string;
@@ -146,23 +146,23 @@ export default class Exchange {
146
146
  quoteCurrencies: any;
147
147
  currencies_by_id: any;
148
148
  codes: any;
149
- reloadingMarkets: any;
150
- marketsLoading: any;
149
+ reloadingMarkets: boolean;
150
+ marketsLoading: Promise<Dictionary<any>>;
151
151
  accounts: any;
152
152
  accountsById: any;
153
- commonCurrencies: any;
153
+ commonCurrencies: Dictionary<string>;
154
154
  hostname: Str;
155
155
  precisionMode: Num;
156
- paddingMode: any;
157
- exceptions: {};
156
+ paddingMode: Num;
157
+ exceptions: Dictionary<string>;
158
158
  timeframes: Dictionary<number | string>;
159
159
  version: Str;
160
- marketsByAltname: any;
160
+ marketsByAltname: Dictionary<any>;
161
161
  name: Str;
162
162
  lastRestRequestTimestamp: number;
163
163
  targetAccount: any;
164
164
  stablePairs: {};
165
- clients: {};
165
+ clients: Dictionary<WsClient>;
166
166
  newUpdates: boolean;
167
167
  streaming: {};
168
168
  alias: boolean;
package/js/src/bingx.js CHANGED
@@ -632,7 +632,7 @@ export default class bingx extends Exchange {
632
632
  symbol += ':' + settle;
633
633
  }
634
634
  const fees = this.safeDict(this.fees, type, {});
635
- const contractSize = this.safeNumber(market, 'size');
635
+ const contractSize = (swap) ? this.parseNumber('1') : undefined;
636
636
  const isActive = this.safeString(market, 'status') === '1';
637
637
  const isInverse = (spot) ? undefined : false;
638
638
  const isLinear = (spot) ? undefined : swap;
@@ -673,7 +673,7 @@ export default class bingx extends Exchange {
673
673
  'max': this.safeInteger(market, 'maxLongLeverage'),
674
674
  },
675
675
  'amount': {
676
- 'min': this.safeNumber(market, 'minQty'),
676
+ 'min': this.safeNumber2(market, 'minQty', 'tradeMinQuantity'),
677
677
  'max': this.safeNumber(market, 'maxQty'),
678
678
  },
679
679
  'price': {
@@ -681,7 +681,7 @@ export default class bingx extends Exchange {
681
681
  'max': undefined,
682
682
  },
683
683
  'cost': {
684
- 'min': this.safeNumber(market, 'minNotional'),
684
+ 'min': this.safeNumber2(market, 'minNotional', 'tradeMinUSDT'),
685
685
  'max': this.safeNumber(market, 'maxNotional'),
686
686
  },
687
687
  },
@@ -1038,6 +1038,13 @@ export default class bingx extends Exchange {
1038
1038
  if (isMaker !== undefined) {
1039
1039
  takeOrMaker = isMaker ? 'maker' : 'taker';
1040
1040
  }
1041
+ let amount = this.safeStringN(trade, ['qty', 'amount', 'q']);
1042
+ if ((market !== undefined) && market['swap'] && ('volume' in trade)) {
1043
+ // private trade returns num of contracts instead of base currency (as the order-related methods do)
1044
+ const contractSize = this.safeString(market['info'], 'tradeMinQuantity');
1045
+ const volume = this.safeString(trade, 'volume');
1046
+ amount = Precise.stringMul(volume, contractSize);
1047
+ }
1041
1048
  return this.safeTrade({
1042
1049
  'id': this.safeStringN(trade, ['id', 't']),
1043
1050
  'info': trade,
@@ -1049,7 +1056,7 @@ export default class bingx extends Exchange {
1049
1056
  'side': this.parseOrderSide(side),
1050
1057
  'takerOrMaker': takeOrMaker,
1051
1058
  'price': this.safeString2(trade, 'price', 'p'),
1052
- 'amount': this.safeStringN(trade, ['qty', 'volume', 'amount', 'q']),
1059
+ 'amount': amount,
1053
1060
  'cost': cost,
1054
1061
  'fee': {
1055
1062
  'cost': this.parseNumber(Precise.stringAbs(this.safeString2(trade, 'commission', 'n'))),
@@ -1681,19 +1688,27 @@ export default class bingx extends Exchange {
1681
1688
  }
1682
1689
  parsePosition(position, market = undefined) {
1683
1690
  //
1684
- // {
1685
- // "symbol": "BTC-USDT",
1686
- // "positionId": "12345678",
1687
- // "positionSide": "LONG",
1688
- // "isolated": true,
1689
- // "positionAmt": "123.33",
1690
- // "availableAmt": "128.99",
1691
- // "unrealizedProfit": "1.22",
1692
- // "realisedProfit": "8.1",
1693
- // "initialMargin": "123.33",
1694
- // "avgPrice": "2.2",
1695
- // "leverage": 10,
1696
- // }
1691
+ // {
1692
+ // "positionId":"1773122376147623936",
1693
+ // "symbol":"XRP-USDT",
1694
+ // "currency":"USDT",
1695
+ // "positionAmt":"3",
1696
+ // "availableAmt":"3",
1697
+ // "positionSide":"LONG",
1698
+ // "isolated":false,
1699
+ // "avgPrice":"0.6139",
1700
+ // "initialMargin":"0.0897",
1701
+ // "leverage":20,
1702
+ // "unrealizedProfit":"-0.0023",
1703
+ // "realisedProfit":"-0.0009",
1704
+ // "liquidationPrice":0,
1705
+ // "pnlRatio":"-0.0260",
1706
+ // "maxMarginReduction":"",
1707
+ // "riskRate":"",
1708
+ // "markPrice":"",
1709
+ // "positionValue":"",
1710
+ // "onlyOnePosition":false
1711
+ // }
1697
1712
  //
1698
1713
  // standard position
1699
1714
  //
@@ -1720,7 +1735,7 @@ export default class bingx extends Exchange {
1720
1735
  'info': position,
1721
1736
  'id': this.safeString(position, 'positionId'),
1722
1737
  'symbol': this.safeSymbol(marketId, market, '-', 'swap'),
1723
- 'notional': this.safeNumber(position, 'positionAmt'),
1738
+ 'notional': this.safeNumber(position, 'positionValue'),
1724
1739
  'marginMode': marginMode,
1725
1740
  'liquidationPrice': undefined,
1726
1741
  'entryPrice': this.safeNumber2(position, 'avgPrice', 'entryPrice'),
@@ -1738,7 +1753,7 @@ export default class bingx extends Exchange {
1738
1753
  'lastUpdateTimestamp': undefined,
1739
1754
  'maintenanceMargin': undefined,
1740
1755
  'maintenanceMarginPercentage': undefined,
1741
- 'collateral': this.safeNumber(position, 'positionAmt'),
1756
+ 'collateral': undefined,
1742
1757
  'initialMargin': this.safeNumber(position, 'initialMargin'),
1743
1758
  'initialMarginPercentage': undefined,
1744
1759
  'leverage': this.safeNumber(position, 'leverage'),