ccxt 4.2.17 → 4.2.18

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.
Files changed (40) hide show
  1. package/README.md +4 -4
  2. package/dist/ccxt.browser.js +522 -264
  3. package/dist/ccxt.browser.min.js +3 -3
  4. package/dist/cjs/ccxt.js +1 -1
  5. package/dist/cjs/js/ccxt.js +3 -1
  6. package/dist/cjs/js/src/base/Exchange.js +5 -2
  7. package/dist/cjs/js/src/binance.js +7 -1
  8. package/dist/cjs/js/src/bingx.js +26 -0
  9. package/dist/cjs/js/src/bybit.js +21 -47
  10. package/dist/cjs/js/src/coincheck.js +1 -0
  11. package/dist/cjs/js/src/deribit.js +5 -1
  12. package/dist/cjs/js/src/kraken.js +1 -1
  13. package/dist/cjs/js/src/pro/binance.js +1 -1
  14. package/dist/cjs/js/src/pro/bitget.js +1 -1
  15. package/dist/cjs/js/src/pro/coincheck.js +208 -0
  16. package/dist/cjs/js/src/pro/kucoin.js +43 -35
  17. package/dist/cjs/js/src/pro/kucoinfutures.js +45 -37
  18. package/dist/cjs/js/src/pro/poloniexfutures.js +43 -35
  19. package/dist/cjs/js/src/whitebit.js +1 -0
  20. package/js/ccxt.d.ts +4 -1
  21. package/js/ccxt.js +3 -1
  22. package/js/src/base/Exchange.d.ts +2 -3
  23. package/js/src/base/Exchange.js +5 -2
  24. package/js/src/binance.js +7 -1
  25. package/js/src/bingx.d.ts +1 -0
  26. package/js/src/bingx.js +26 -0
  27. package/js/src/bybit.js +21 -47
  28. package/js/src/coincheck.js +1 -0
  29. package/js/src/deribit.js +5 -1
  30. package/js/src/kraken.js +1 -1
  31. package/js/src/pro/binance.js +1 -1
  32. package/js/src/pro/bitget.js +1 -1
  33. package/js/src/pro/coincheck.d.ts +12 -0
  34. package/js/src/pro/coincheck.js +209 -0
  35. package/js/src/pro/kucoin.js +43 -35
  36. package/js/src/pro/kucoinfutures.js +45 -37
  37. package/js/src/pro/poloniexfutures.js +43 -35
  38. package/js/src/whitebit.js +1 -0
  39. package/package.json +1 -1
  40. package/skip-tests.json +12 -1
@@ -74,43 +74,51 @@ class kucoinfutures extends kucoinfutures$1 {
74
74
  async negotiateHelper(privateChannel, params = {}) {
75
75
  let response = undefined;
76
76
  const connectId = privateChannel ? 'private' : 'public';
77
- if (privateChannel) {
78
- response = await this.futuresPrivatePostBulletPrivate(params);
79
- //
80
- // {
81
- // "code": "200000",
82
- // "data": {
83
- // "instanceServers": [
84
- // {
85
- // "pingInterval": 50000,
86
- // "endpoint": "wss://push-private.kucoin.com/endpoint",
87
- // "protocol": "websocket",
88
- // "encrypt": true,
89
- // "pingTimeout": 10000
90
- // }
91
- // ],
92
- // "token": "2neAiuYvAU61ZDXANAGAsiL4-iAExhsBXZxftpOeh_55i3Ysy2q2LEsEWU64mdzUOPusi34M_wGoSf7iNyEWJ1UQy47YbpY4zVdzilNP-Bj3iXzrjjGlWtiYB9J6i9GjsxUuhPw3BlrzazF6ghq4Lzf7scStOz3KkxjwpsOBCH4=.WNQmhZQeUKIkh97KYgU0Lg=="
93
- // }
94
- // }
95
- //
96
- }
97
- else {
98
- response = await this.futuresPublicPostBulletPublic(params);
99
- }
100
- const data = this.safeValue(response, 'data', {});
101
- const instanceServers = this.safeValue(data, 'instanceServers', []);
102
- const firstInstanceServer = this.safeValue(instanceServers, 0);
103
- const pingInterval = this.safeInteger(firstInstanceServer, 'pingInterval');
104
- const endpoint = this.safeString(firstInstanceServer, 'endpoint');
105
- const token = this.safeString(data, 'token');
106
- const result = endpoint + '?' + this.urlencode({
107
- 'token': token,
108
- 'privateChannel': privateChannel,
109
- 'connectId': connectId,
110
- });
111
- const client = this.client(result);
112
- client.keepAlive = pingInterval;
113
- return result;
77
+ try {
78
+ if (privateChannel) {
79
+ response = await this.futuresPrivatePostBulletPrivate(params);
80
+ //
81
+ // {
82
+ // "code": "200000",
83
+ // "data": {
84
+ // "instanceServers": [
85
+ // {
86
+ // "pingInterval": 50000,
87
+ // "endpoint": "wss://push-private.kucoin.com/endpoint",
88
+ // "protocol": "websocket",
89
+ // "encrypt": true,
90
+ // "pingTimeout": 10000
91
+ // }
92
+ // ],
93
+ // "token": "2neAiuYvAU61ZDXANAGAsiL4-iAExhsBXZxftpOeh_55i3Ysy2q2LEsEWU64mdzUOPusi34M_wGoSf7iNyEWJ1UQy47YbpY4zVdzilNP-Bj3iXzrjjGlWtiYB9J6i9GjsxUuhPw3BlrzazF6ghq4Lzf7scStOz3KkxjwpsOBCH4=.WNQmhZQeUKIkh97KYgU0Lg=="
94
+ // }
95
+ // }
96
+ //
97
+ }
98
+ else {
99
+ response = await this.futuresPublicPostBulletPublic(params);
100
+ }
101
+ const data = this.safeValue(response, 'data', {});
102
+ const instanceServers = this.safeValue(data, 'instanceServers', []);
103
+ const firstInstanceServer = this.safeValue(instanceServers, 0);
104
+ const pingInterval = this.safeInteger(firstInstanceServer, 'pingInterval');
105
+ const endpoint = this.safeString(firstInstanceServer, 'endpoint');
106
+ const token = this.safeString(data, 'token');
107
+ const result = endpoint + '?' + this.urlencode({
108
+ 'token': token,
109
+ 'privateChannel': privateChannel,
110
+ 'connectId': connectId,
111
+ });
112
+ const client = this.client(result);
113
+ client.keepAlive = pingInterval;
114
+ return result;
115
+ }
116
+ catch (e) {
117
+ const future = this.safeValue(this.options['urls'], connectId);
118
+ future.reject(e);
119
+ delete this.options['urls'][connectId];
120
+ }
121
+ return undefined;
114
122
  }
115
123
  requestId() {
116
124
  const requestId = this.sum(this.safeInteger(this.options, 'requestId', 0), 1);
@@ -75,43 +75,51 @@ class poloniexfutures extends poloniexfutures$1 {
75
75
  async negotiateHelper(privateChannel, params = {}) {
76
76
  let response = undefined;
77
77
  const connectId = privateChannel ? 'private' : 'public';
78
- if (privateChannel) {
79
- response = await this.privatePostBulletPrivate(params);
80
- //
81
- // {
82
- // "code": "200000",
83
- // "data": {
84
- // "instanceServers": [
85
- // {
86
- // "pingInterval": 50000,
87
- // "endpoint": "wss://push-private.kucoin.com/endpoint",
88
- // "protocol": "websocket",
89
- // "encrypt": true,
90
- // "pingTimeout": 10000
91
- // }
92
- // ],
93
- // "token": "2neAiuYvAU61ZDXANAGAsiL4-iAExhsBXZxftpOeh_55i3Ysy2q2LEsEWU64mdzUOPusi34M_wGoSf7iNyEWJ1UQy47YbpY4zVdzilNP-Bj3iXzrjjGlWtiYB9J6i9GjsxUuhPw3BlrzazF6ghq4Lzf7scStOz3KkxjwpsOBCH4=.WNQmhZQeUKIkh97KYgU0Lg=="
94
- // }
95
- // }
96
- //
78
+ try {
79
+ if (privateChannel) {
80
+ response = await this.privatePostBulletPrivate(params);
81
+ //
82
+ // {
83
+ // "code": "200000",
84
+ // "data": {
85
+ // "instanceServers": [
86
+ // {
87
+ // "pingInterval": 50000,
88
+ // "endpoint": "wss://push-private.kucoin.com/endpoint",
89
+ // "protocol": "websocket",
90
+ // "encrypt": true,
91
+ // "pingTimeout": 10000
92
+ // }
93
+ // ],
94
+ // "token": "2neAiuYvAU61ZDXANAGAsiL4-iAExhsBXZxftpOeh_55i3Ysy2q2LEsEWU64mdzUOPusi34M_wGoSf7iNyEWJ1UQy47YbpY4zVdzilNP-Bj3iXzrjjGlWtiYB9J6i9GjsxUuhPw3BlrzazF6ghq4Lzf7scStOz3KkxjwpsOBCH4=.WNQmhZQeUKIkh97KYgU0Lg=="
95
+ // }
96
+ // }
97
+ //
98
+ }
99
+ else {
100
+ response = await this.publicPostBulletPublic(params);
101
+ }
102
+ const data = this.safeValue(response, 'data', {});
103
+ const instanceServers = this.safeValue(data, 'instanceServers', []);
104
+ const firstInstanceServer = this.safeValue(instanceServers, 0);
105
+ const pingInterval = this.safeInteger(firstInstanceServer, 'pingInterval');
106
+ const endpoint = this.safeString(firstInstanceServer, 'endpoint');
107
+ const token = this.safeString(data, 'token');
108
+ const result = endpoint + '?' + this.urlencode({
109
+ 'token': token,
110
+ 'privateChannel': privateChannel,
111
+ 'connectId': connectId,
112
+ });
113
+ const client = this.client(result);
114
+ client.keepAlive = pingInterval;
115
+ return result;
97
116
  }
98
- else {
99
- response = await this.publicPostBulletPublic(params);
117
+ catch (e) {
118
+ const future = this.safeValue(this.options['urls'], connectId);
119
+ future.reject(e);
120
+ delete this.options['urls'][connectId];
100
121
  }
101
- const data = this.safeValue(response, 'data', {});
102
- const instanceServers = this.safeValue(data, 'instanceServers', []);
103
- const firstInstanceServer = this.safeValue(instanceServers, 0);
104
- const pingInterval = this.safeInteger(firstInstanceServer, 'pingInterval');
105
- const endpoint = this.safeString(firstInstanceServer, 'endpoint');
106
- const token = this.safeString(data, 'token');
107
- const result = endpoint + '?' + this.urlencode({
108
- 'token': token,
109
- 'privateChannel': privateChannel,
110
- 'connectId': connectId,
111
- });
112
- const client = this.client(result);
113
- client.keepAlive = pingInterval;
114
- return result;
122
+ return undefined;
115
123
  }
116
124
  requestId() {
117
125
  const requestId = this.sum(this.safeInteger(this.options, 'requestId', 0), 1);
@@ -66,6 +66,7 @@ class whitebit extends whitebit$1 {
66
66
  'fetchOrderTrades': true,
67
67
  'fetchPositionMode': false,
68
68
  'fetchPremiumIndexOHLCV': false,
69
+ 'fetchStatus': true,
69
70
  'fetchTicker': true,
70
71
  'fetchTickers': true,
71
72
  'fetchTime': true,
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 } 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.16";
7
+ declare const version = "4.2.17";
8
8
  import ace from './src/ace.js';
9
9
  import alpaca from './src/alpaca.js';
10
10
  import ascendex from './src/ascendex.js';
@@ -127,6 +127,7 @@ import bybitPro from './src/pro/bybit.js';
127
127
  import cexPro from './src/pro/cex.js';
128
128
  import coinbasePro from './src/pro/coinbase.js';
129
129
  import coinbaseproPro from './src/pro/coinbasepro.js';
130
+ import coincheckPro from './src/pro/coincheck.js';
130
131
  import coinexPro from './src/pro/coinex.js';
131
132
  import coinonePro from './src/pro/coinone.js';
132
133
  import cryptocomPro from './src/pro/cryptocom.js';
@@ -285,6 +286,7 @@ declare const pro: {
285
286
  cex: typeof cexPro;
286
287
  coinbase: typeof coinbasePro;
287
288
  coinbasepro: typeof coinbaseproPro;
289
+ coincheck: typeof coincheckPro;
288
290
  coinex: typeof coinexPro;
289
291
  coinone: typeof coinonePro;
290
292
  cryptocom: typeof cryptocomPro;
@@ -349,6 +351,7 @@ declare const ccxt: {
349
351
  cex: typeof cexPro;
350
352
  coinbase: typeof coinbasePro;
351
353
  coinbasepro: typeof coinbaseproPro;
354
+ coincheck: typeof coincheckPro;
352
355
  coinex: typeof coinexPro;
353
356
  coinone: typeof coinonePro;
354
357
  cryptocom: typeof cryptocomPro;
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.17';
41
+ const version = '4.2.18';
42
42
  Exchange.ccxtVersion = version;
43
43
  //-----------------------------------------------------------------------------
44
44
  import ace from './src/ace.js';
@@ -164,6 +164,7 @@ import bybitPro from './src/pro/bybit.js';
164
164
  import cexPro from './src/pro/cex.js';
165
165
  import coinbasePro from './src/pro/coinbase.js';
166
166
  import coinbaseproPro from './src/pro/coinbasepro.js';
167
+ import coincheckPro from './src/pro/coincheck.js';
167
168
  import coinexPro from './src/pro/coinex.js';
168
169
  import coinonePro from './src/pro/coinone.js';
169
170
  import cryptocomPro from './src/pro/cryptocom.js';
@@ -322,6 +323,7 @@ const pro = {
322
323
  'cex': cexPro,
323
324
  'coinbase': coinbasePro,
324
325
  'coinbasepro': coinbaseproPro,
326
+ 'coincheck': coincheckPro,
325
327
  'coinex': coinexPro,
326
328
  'coinone': coinonePro,
327
329
  'cryptocom': cryptocomPro,
@@ -2,7 +2,6 @@ import * as functions from './functions.js';
2
2
  import { // eslint-disable-line object-curly-newline
3
3
  ExchangeError, AuthenticationError, DDoSProtection, RequestTimeout, ExchangeNotAvailable, RateLimitExceeded } from "./errors.js";
4
4
  import WsClient from './ws/WsClient.js';
5
- import { Future } from './ws/Future.js';
6
5
  import { OrderBook as WsOrderBook, IndexedOrderBook, CountedOrderBook } from './ws/OrderBook.js';
7
6
  import type { Market, Trade, Ticker, OHLCV, OHLCVC, Order, OrderBook, Balance, Balances, Dictionary, DepositAddressResponse, Currency, MinMax, IndexType, Int, OrderType, OrderSide, Position, FundingRateHistory, OpenInterest, Liquidation, OrderRequest, FundingHistory, MarginMode, Tickers, Greeks, Str, Num, MarketInterface, CurrencyInterface, Account } from './types.js';
8
7
  export type { Market, Trade, Fee, Ticker, OHLCV, OHLCVC, Order, OrderBook, Balance, Balances, Dictionary, Transaction, DepositAddressResponse, Currency, MinMax, IndexType, Int, OrderType, OrderSide, Position, FundingRateHistory, Liquidation, FundingHistory, Greeks } from './types.js';
@@ -377,7 +376,7 @@ export default class Exchange {
377
376
  fetchPositionsForSymbol: any;
378
377
  fetchPositionsRisk: any;
379
378
  fetchPremiumIndexOHLCV: any;
380
- fetchStatus: string;
379
+ fetchStatus: any;
381
380
  fetchTicker: boolean;
382
381
  fetchTickers: any;
383
382
  fetchTime: any;
@@ -540,7 +539,7 @@ export default class Exchange {
540
539
  checkOrderArguments(market: any, type: any, side: any, amount: any, price: any, params: any): void;
541
540
  handleHttpStatusCode(code: any, reason: any, url: any, method: any, body: any): void;
542
541
  remove0xPrefix(hexData: any): any;
543
- spawn(method: any, ...args: any[]): ReturnType<typeof Future>;
542
+ spawn(method: any, ...args: any[]): import("./ws/Future.js").FutureInterface;
544
543
  delay(timeout: any, method: any, ...args: any[]): void;
545
544
  orderBook(snapshot?: {}, depth?: number): WsOrderBook;
546
545
  indexedOrderBook(snapshot?: {}, depth?: number): IndexedOrderBook;
@@ -433,7 +433,7 @@ export default class Exchange {
433
433
  'fetchPositionsForSymbol': undefined,
434
434
  'fetchPositionsRisk': undefined,
435
435
  'fetchPremiumIndexOHLCV': undefined,
436
- 'fetchStatus': 'emulated',
436
+ 'fetchStatus': undefined,
437
437
  'fetchTicker': true,
438
438
  'fetchTickers': undefined,
439
439
  'fetchTime': undefined,
@@ -1015,7 +1015,10 @@ export default class Exchange {
1015
1015
  }
1016
1016
  spawn(method, ...args) {
1017
1017
  const future = Future();
1018
- method.apply(this, args).then(future.resolve).catch(future.reject);
1018
+ // using setTimeout 0 to force the execution to run after the future is returned
1019
+ setTimeout(() => {
1020
+ method.apply(this, args).then(future.resolve).catch(future.reject);
1021
+ }, 0);
1019
1022
  return future;
1020
1023
  }
1021
1024
  delay(timeout, method, ...args) {
package/js/src/binance.js CHANGED
@@ -225,7 +225,7 @@ export default class binance extends Exchange {
225
225
  'margin/allPairs': 0.1,
226
226
  'margin/priceIndex': 1,
227
227
  // these endpoints require this.apiKey + this.secret
228
- 'spot/delist-schedule': 0.1,
228
+ 'spot/delist-schedule': 10,
229
229
  'asset/assetDividend': 1,
230
230
  'asset/dribblet': 0.1,
231
231
  'asset/transfer': 0.1,
@@ -5583,6 +5583,7 @@ export default class binance extends Exchange {
5583
5583
  * @param {int} [since] the earliest time in ms to fetch my dust trades for
5584
5584
  * @param {int} [limit] the maximum number of dust trades to retrieve
5585
5585
  * @param {object} [params] extra parameters specific to the exchange API endpoint
5586
+ * @param {string} [params.type] 'spot' or 'margin', default spot
5586
5587
  * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
5587
5588
  */
5588
5589
  //
@@ -5597,6 +5598,11 @@ export default class binance extends Exchange {
5597
5598
  request['startTime'] = since;
5598
5599
  request['endTime'] = this.sum(since, 7776000000);
5599
5600
  }
5601
+ const accountType = this.safeStringUpper(params, 'type');
5602
+ params = this.omit(params, 'type');
5603
+ if (accountType !== undefined) {
5604
+ request['accountType'] = accountType;
5605
+ }
5600
5606
  const response = await this.sapiGetAssetDribblet(this.extend(request, params));
5601
5607
  // {
5602
5608
  // "total": "4",
package/js/src/bingx.d.ts CHANGED
@@ -32,6 +32,7 @@ export default class bingx extends Exchange {
32
32
  previousFundingTimestamp: any;
33
33
  previousFundingDatetime: any;
34
34
  }>;
35
+ fetchFundingRates(symbols?: Strings, params?: {}): Promise<any[]>;
35
36
  parseFundingRate(contract: any, market?: Market): {
36
37
  info: any;
37
38
  symbol: string;
package/js/src/bingx.js CHANGED
@@ -53,6 +53,7 @@ export default class bingx extends Exchange {
53
53
  'fetchDepositWithdrawFee': 'emulated',
54
54
  'fetchDepositWithdrawFees': true,
55
55
  'fetchFundingRate': true,
56
+ 'fetchFundingRates': true,
56
57
  'fetchFundingRateHistory': true,
57
58
  'fetchLeverage': true,
58
59
  'fetchLiquidations': false,
@@ -1113,6 +1114,31 @@ export default class bingx extends Exchange {
1113
1114
  const data = this.safeValue(response, 'data', {});
1114
1115
  return this.parseFundingRate(data, market);
1115
1116
  }
1117
+ async fetchFundingRates(symbols = undefined, params = {}) {
1118
+ /**
1119
+ * @method
1120
+ * @name bingx#fetchFundingRate
1121
+ * @description fetch the current funding rate
1122
+ * @see https://bingx-api.github.io/docs/#/swapV2/market-api.html#Current%20Funding%20Rate
1123
+ * @param {string[]} [symbols] list of unified market symbols
1124
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1125
+ * @returns {object} a [funding rate structure]{@link https://docs.ccxt.com/#/?id=funding-rate-structure}
1126
+ */
1127
+ await this.loadMarkets();
1128
+ symbols = this.marketSymbols(symbols, 'swap', true);
1129
+ const response = await this.swapV2PublicGetQuotePremiumIndex(this.extend(params));
1130
+ const data = this.safeValue(response, 'data', []);
1131
+ const filteredResponse = [];
1132
+ for (let i = 0; i < data.length; i++) {
1133
+ const item = data[i];
1134
+ const marketId = this.safeString(item, 'symbol');
1135
+ const market = this.safeMarket(marketId, undefined, undefined, 'swap');
1136
+ if ((symbols === undefined) || this.inArray(market['symbol'], symbols)) {
1137
+ filteredResponse.push(this.parseFundingRate(item, market));
1138
+ }
1139
+ }
1140
+ return filteredResponse;
1141
+ }
1116
1142
  parseFundingRate(contract, market = undefined) {
1117
1143
  //
1118
1144
  // {
package/js/src/bybit.js CHANGED
@@ -3966,7 +3966,7 @@ export default class bybit extends Exchange {
3966
3966
  response = await this.privatePostOptionUsdcOpenapiPrivateV1ReplaceOrder(this.extend(request, params));
3967
3967
  }
3968
3968
  else {
3969
- const isStop = this.safeValue(params, 'stop', false);
3969
+ const isStop = this.safeValue2(params, 'stop', 'trigger', false);
3970
3970
  const triggerPrice = this.safeValue2(params, 'stopPrice', 'triggerPrice');
3971
3971
  const stopLossPrice = this.safeValue(params, 'stopLossPrice');
3972
3972
  const isStopLossOrder = stopLossPrice !== undefined;
@@ -4145,8 +4145,8 @@ export default class bybit extends Exchange {
4145
4145
  // 'orderLinkId': 'string', // one of order_id, stop_order_id or order_link_id is required
4146
4146
  // 'orderId': id,
4147
4147
  };
4148
- const isStop = this.safeValue(params, 'stop', false);
4149
- params = this.omit(params, ['stop']);
4148
+ const isStop = this.safeValue2(params, 'stop', 'trigger', false);
4149
+ params = this.omit(params, ['stop', 'trigger']);
4150
4150
  if (id !== undefined) { // The user can also use argument params["order_link_id"]
4151
4151
  request['orderId'] = id;
4152
4152
  }
@@ -4207,9 +4207,9 @@ export default class bybit extends Exchange {
4207
4207
  };
4208
4208
  if (market['spot']) {
4209
4209
  // only works for spot market
4210
- const isStop = this.safeValue(params, 'stop', false);
4211
- params = this.omit(params, ['stop']);
4212
- request['orderFilter'] = isStop ? 'tpslOrder' : 'Order';
4210
+ const isStop = this.safeValue2(params, 'stop', 'trigger', false);
4211
+ params = this.omit(params, ['stop', 'trigger']);
4212
+ request['orderFilter'] = isStop ? 'StopOrder' : 'Order';
4213
4213
  }
4214
4214
  if (id !== undefined) { // The user can also use argument params["orderLinkId"]
4215
4215
  request['orderId'] = id;
@@ -4256,14 +4256,14 @@ export default class bybit extends Exchange {
4256
4256
  response = await this.privatePostOptionUsdcOpenapiPrivateV1CancelAll(this.extend(request, params));
4257
4257
  }
4258
4258
  else {
4259
- const isStop = this.safeValue(params, 'stop', false);
4259
+ const isStop = this.safeValue2(params, 'stop', 'trigger', false);
4260
4260
  if (isStop) {
4261
4261
  request['orderFilter'] = 'StopOrder';
4262
4262
  }
4263
4263
  else {
4264
4264
  request['orderFilter'] = 'Order';
4265
4265
  }
4266
- params = this.omit(params, ['stop']);
4266
+ params = this.omit(params, ['stop', 'trigger']);
4267
4267
  response = await this.privatePostPerpetualUsdcOpenapiPrivateV1CancelAll(this.extend(request, params));
4268
4268
  }
4269
4269
  //
@@ -4330,10 +4330,10 @@ export default class bybit extends Exchange {
4330
4330
  request['settleCoin'] = this.safeString(params, 'settleCoin', defaultSettle);
4331
4331
  }
4332
4332
  }
4333
- const isStop = this.safeValue(params, 'stop', false);
4334
- params = this.omit(params, ['stop']);
4333
+ const isStop = this.safeValue2(params, 'stop', 'trigger', false);
4334
+ params = this.omit(params, ['stop', 'trigger']);
4335
4335
  if (isStop) {
4336
- request['orderFilter'] = 'tpslOrder';
4336
+ request['orderFilter'] = 'StopOrder';
4337
4337
  }
4338
4338
  const response = await this.privatePostV5OrderCancelAll(this.extend(request, params));
4339
4339
  //
@@ -4398,8 +4398,8 @@ export default class bybit extends Exchange {
4398
4398
  else {
4399
4399
  request['category'] = 'OPTION';
4400
4400
  }
4401
- const isStop = this.safeValue(params, 'stop', false);
4402
- params = this.omit(params, ['stop']);
4401
+ const isStop = this.safeValue2(params, 'stop', 'trigger', false);
4402
+ params = this.omit(params, ['stop', 'trigger']);
4403
4403
  if (isStop) {
4404
4404
  request['orderFilter'] = 'StopOrder';
4405
4405
  }
@@ -4501,12 +4501,7 @@ export default class bybit extends Exchange {
4501
4501
  const isStop = this.safeValueN(params, ['trigger', 'stop'], false);
4502
4502
  params = this.omit(params, ['trigger', 'stop']);
4503
4503
  if (isStop) {
4504
- if (type === 'spot') {
4505
- request['orderFilter'] = 'tpslOrder';
4506
- }
4507
- else {
4508
- request['orderFilter'] = 'StopOrder';
4509
- }
4504
+ request['orderFilter'] = 'StopOrder';
4510
4505
  }
4511
4506
  if (limit !== undefined) {
4512
4507
  request['limit'] = limit;
@@ -4665,7 +4660,7 @@ export default class bybit extends Exchange {
4665
4660
  * @param {int} [since] the earliest time in ms to fetch open orders for
4666
4661
  * @param {int} [limit] the maximum number of open orders structures to retrieve
4667
4662
  * @param {object} [params] extra parameters specific to the exchange API endpoint
4668
- * @param {boolean} [params.stop] true if stop order
4663
+ * @param {boolean} [params.stop] set to true for fetching open stop orders
4669
4664
  * @param {string} [params.type] market type, ['swap', 'option', 'spot']
4670
4665
  * @param {string} [params.subType] market subType, ['linear', 'inverse']
4671
4666
  * @param {string} [params.baseCoin] Base coin. Supports linear, inverse & option
@@ -4699,15 +4694,10 @@ export default class bybit extends Exchange {
4699
4694
  return await this.fetchUsdcOpenOrders(symbol, since, limit, params);
4700
4695
  }
4701
4696
  request['category'] = type;
4702
- const isStop = this.safeValue(params, 'stop', false);
4703
- params = this.omit(params, ['stop']);
4697
+ const isStop = this.safeValue2(params, 'stop', 'trigger', false);
4698
+ params = this.omit(params, ['stop', 'trigger']);
4704
4699
  if (isStop) {
4705
- if (type === 'spot') {
4706
- request['orderFilter'] = 'tpslOrder';
4707
- }
4708
- else {
4709
- request['orderFilter'] = 'StopOrder';
4710
- }
4700
+ request['orderFilter'] = 'StopOrder';
4711
4701
  }
4712
4702
  if (limit !== undefined) {
4713
4703
  request['limit'] = limit;
@@ -4839,12 +4829,11 @@ export default class bybit extends Exchange {
4839
4829
  * @method
4840
4830
  * @name bybit#fetchMyTrades
4841
4831
  * @description fetch all trades made by the user
4842
- * @see https://bybit-exchange.github.io/docs/v5/position/execution
4832
+ * @see https://bybit-exchange.github.io/docs/api-explorer/v5/position/execution
4843
4833
  * @param {string} symbol unified market symbol
4844
4834
  * @param {int} [since] the earliest time in ms to fetch trades for
4845
4835
  * @param {int} [limit] the maximum number of trades structures to retrieve
4846
4836
  * @param {object} [params] extra parameters specific to the exchange API endpoint
4847
- * @param {boolean} [params.stop] true if stop order
4848
4837
  * @param {string} [params.type] market type, ['swap', 'option', 'spot']
4849
4838
  * @param {string} [params.subType] market subType, ['linear', 'inverse']
4850
4839
  * @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
@@ -4858,7 +4847,7 @@ export default class bybit extends Exchange {
4858
4847
  }
4859
4848
  const [enableUnifiedMargin, enableUnifiedAccount] = await this.isUnifiedEnabled();
4860
4849
  const isUnifiedAccount = (enableUnifiedMargin || enableUnifiedAccount);
4861
- const request = {};
4850
+ let request = {};
4862
4851
  let market = undefined;
4863
4852
  let isUsdcSettled = false;
4864
4853
  if (symbol !== undefined) {
@@ -4872,28 +4861,13 @@ export default class bybit extends Exchange {
4872
4861
  return await this.fetchMyUsdcTrades(symbol, since, limit, params);
4873
4862
  }
4874
4863
  request['category'] = type;
4875
- const isStop = this.safeValue(params, 'stop', false);
4876
- params = this.omit(params, ['stop', 'type']);
4877
- if (isStop) {
4878
- if (type === 'spot') {
4879
- request['orderFilter'] = 'tpslOrder';
4880
- }
4881
- else {
4882
- request['orderFilter'] = 'StopOrder';
4883
- }
4884
- }
4885
4864
  if (limit !== undefined) {
4886
4865
  request['limit'] = limit;
4887
4866
  }
4888
4867
  if (since !== undefined) {
4889
4868
  request['startTime'] = since;
4890
4869
  }
4891
- const until = this.safeInteger2(params, 'until', 'till'); // unified in milliseconds
4892
- const endTime = this.safeInteger(params, 'endTime', until); // exchange-specific in milliseconds
4893
- params = this.omit(params, ['endTime', 'till', 'until']);
4894
- if (endTime !== undefined) {
4895
- request['endTime'] = endTime;
4896
- }
4870
+ [request, params] = this.handleUntilOption('endTime', request, params);
4897
4871
  const response = await this.privateGetV5ExecutionList(this.extend(request, params));
4898
4872
  //
4899
4873
  // {
@@ -68,6 +68,7 @@ export default class coincheck extends Exchange {
68
68
  'setLeverage': false,
69
69
  'setMarginMode': false,
70
70
  'setPositionMode': false,
71
+ 'ws': true,
71
72
  },
72
73
  'urls': {
73
74
  'logo': 'https://user-images.githubusercontent.com/51840849/87182088-1d6d6380-c2ec-11ea-9c64-8ab9f9b289f5.jpg',
package/js/src/deribit.js CHANGED
@@ -1686,6 +1686,10 @@ export default class deribit extends Exchange {
1686
1686
  const request = {
1687
1687
  'order_id': id,
1688
1688
  };
1689
+ let market = undefined;
1690
+ if (symbol !== undefined) {
1691
+ market = this.market(symbol);
1692
+ }
1689
1693
  const response = await this.privateGetGetOrderState(this.extend(request, params));
1690
1694
  //
1691
1695
  // {
@@ -1716,7 +1720,7 @@ export default class deribit extends Exchange {
1716
1720
  // }
1717
1721
  //
1718
1722
  const result = this.safeValue(response, 'result');
1719
- return this.parseOrder(result);
1723
+ return this.parseOrder(result, market);
1720
1724
  }
1721
1725
  async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
1722
1726
  /**
package/js/src/kraken.js CHANGED
@@ -106,7 +106,7 @@ export default class kraken extends Exchange {
106
106
  'zendesk': 'https://kraken.zendesk.com/api/v2/help_center/en-us/articles', // use the public zendesk api to receive article bodies and bypass new anti-spam protections
107
107
  },
108
108
  'www': 'https://www.kraken.com',
109
- 'doc': 'https://www.kraken.com/features/api',
109
+ 'doc': 'https://docs.kraken.com/rest/',
110
110
  'fees': 'https://www.kraken.com/en-us/features/fee-schedule',
111
111
  },
112
112
  'fees': {
@@ -145,7 +145,7 @@ export default class binance extends binanceRest {
145
145
  }
146
146
  const subscriptionsByStream = this.safeInteger(this.options['numSubscriptionsByStream'], stream, 0);
147
147
  const newNumSubscriptions = subscriptionsByStream + numSubscriptions;
148
- const subscriptionLimitByStream = this.safeInteger(this.options, 'subscriptionLimitByStream', 200);
148
+ const subscriptionLimitByStream = this.safeInteger(this.options['subscriptionLimitByStream'], type, 200);
149
149
  if (newNumSubscriptions > subscriptionLimitByStream) {
150
150
  throw new BadRequest(this.id + ' reached the limit of subscriptions by stream. Increase the number of streams, or increase the stream limit or subscription limit by stream if the exchange allows.');
151
151
  }
@@ -449,7 +449,7 @@ export default class bitget extends bitgetRest {
449
449
  symbols = this.marketSymbols(symbols);
450
450
  let channel = 'books';
451
451
  let incrementalFeed = true;
452
- if ((limit === 5) || (limit === 15)) {
452
+ if ((limit === 1) || (limit === 5) || (limit === 15)) {
453
453
  channel += limit.toString();
454
454
  incrementalFeed = false;
455
455
  }
@@ -0,0 +1,12 @@
1
+ import coincheckRest from '../coincheck.js';
2
+ import type { Int, Market, OrderBook, Trade } from '../base/types.js';
3
+ import Client from '../base/ws/Client.js';
4
+ export default class coincheck extends coincheckRest {
5
+ describe(): any;
6
+ watchOrderBook(symbol: string, limit?: Int, params?: {}): Promise<OrderBook>;
7
+ handleOrderBook(client: any, message: any): void;
8
+ watchTrades(symbol: string, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
9
+ handleTrades(client: Client, message: any): void;
10
+ parseWsTrade(trade: any, market?: Market): Trade;
11
+ handleMessage(client: Client, message: any): void;
12
+ }