ccxt 4.2.16 → 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 (53) hide show
  1. package/README.md +4 -4
  2. package/dist/ccxt.browser.js +546 -276
  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 -0
  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/coinlist.js +10 -2
  12. package/dist/cjs/js/src/coinsph.js +2 -2
  13. package/dist/cjs/js/src/deribit.js +5 -1
  14. package/dist/cjs/js/src/kraken.js +1 -1
  15. package/dist/cjs/js/src/pro/binance.js +3 -3
  16. package/dist/cjs/js/src/pro/bitget.js +1 -1
  17. package/dist/cjs/js/src/pro/coincheck.js +208 -0
  18. package/dist/cjs/js/src/pro/hitbtc.js +5 -4
  19. package/dist/cjs/js/src/pro/kucoin.js +46 -36
  20. package/dist/cjs/js/src/pro/kucoinfutures.js +45 -37
  21. package/dist/cjs/js/src/pro/poloniex.js +2 -2
  22. package/dist/cjs/js/src/pro/poloniexfutures.js +43 -35
  23. package/dist/cjs/js/src/whitebit.js +1 -0
  24. package/js/ccxt.d.ts +4 -1
  25. package/js/ccxt.js +3 -1
  26. package/js/src/abstract/binance.d.ts +1 -0
  27. package/js/src/abstract/binancecoinm.d.ts +1 -0
  28. package/js/src/abstract/binanceus.d.ts +1 -0
  29. package/js/src/abstract/binanceusdm.d.ts +1 -0
  30. package/js/src/abstract/coinlist.d.ts +8 -0
  31. package/js/src/base/Exchange.d.ts +2 -3
  32. package/js/src/base/Exchange.js +5 -2
  33. package/js/src/binance.js +7 -0
  34. package/js/src/bingx.d.ts +1 -0
  35. package/js/src/bingx.js +26 -0
  36. package/js/src/bybit.js +21 -47
  37. package/js/src/coincheck.js +1 -0
  38. package/js/src/coinlist.js +10 -2
  39. package/js/src/coinsph.js +2 -2
  40. package/js/src/deribit.js +5 -1
  41. package/js/src/kraken.js +1 -1
  42. package/js/src/pro/binance.js +3 -3
  43. package/js/src/pro/bitget.js +1 -1
  44. package/js/src/pro/coincheck.d.ts +12 -0
  45. package/js/src/pro/coincheck.js +209 -0
  46. package/js/src/pro/hitbtc.js +5 -4
  47. package/js/src/pro/kucoin.js +46 -36
  48. package/js/src/pro/kucoinfutures.js +45 -37
  49. package/js/src/pro/poloniex.js +2 -2
  50. package/js/src/pro/poloniexfutures.js +43 -35
  51. package/js/src/whitebit.js +1 -0
  52. package/package.json +1 -1
  53. package/skip-tests.json +12 -1
@@ -77,43 +77,51 @@ export default class kucoinfutures extends kucoinfuturesRest {
77
77
  async negotiateHelper(privateChannel, params = {}) {
78
78
  let response = undefined;
79
79
  const connectId = privateChannel ? 'private' : 'public';
80
- if (privateChannel) {
81
- response = await this.futuresPrivatePostBulletPrivate(params);
82
- //
83
- // {
84
- // "code": "200000",
85
- // "data": {
86
- // "instanceServers": [
87
- // {
88
- // "pingInterval": 50000,
89
- // "endpoint": "wss://push-private.kucoin.com/endpoint",
90
- // "protocol": "websocket",
91
- // "encrypt": true,
92
- // "pingTimeout": 10000
93
- // }
94
- // ],
95
- // "token": "2neAiuYvAU61ZDXANAGAsiL4-iAExhsBXZxftpOeh_55i3Ysy2q2LEsEWU64mdzUOPusi34M_wGoSf7iNyEWJ1UQy47YbpY4zVdzilNP-Bj3iXzrjjGlWtiYB9J6i9GjsxUuhPw3BlrzazF6ghq4Lzf7scStOz3KkxjwpsOBCH4=.WNQmhZQeUKIkh97KYgU0Lg=="
96
- // }
97
- // }
98
- //
99
- }
100
- else {
101
- response = await this.futuresPublicPostBulletPublic(params);
102
- }
103
- const data = this.safeValue(response, 'data', {});
104
- const instanceServers = this.safeValue(data, 'instanceServers', []);
105
- const firstInstanceServer = this.safeValue(instanceServers, 0);
106
- const pingInterval = this.safeInteger(firstInstanceServer, 'pingInterval');
107
- const endpoint = this.safeString(firstInstanceServer, 'endpoint');
108
- const token = this.safeString(data, 'token');
109
- const result = endpoint + '?' + this.urlencode({
110
- 'token': token,
111
- 'privateChannel': privateChannel,
112
- 'connectId': connectId,
113
- });
114
- const client = this.client(result);
115
- client.keepAlive = pingInterval;
116
- return result;
80
+ try {
81
+ if (privateChannel) {
82
+ response = await this.futuresPrivatePostBulletPrivate(params);
83
+ //
84
+ // {
85
+ // "code": "200000",
86
+ // "data": {
87
+ // "instanceServers": [
88
+ // {
89
+ // "pingInterval": 50000,
90
+ // "endpoint": "wss://push-private.kucoin.com/endpoint",
91
+ // "protocol": "websocket",
92
+ // "encrypt": true,
93
+ // "pingTimeout": 10000
94
+ // }
95
+ // ],
96
+ // "token": "2neAiuYvAU61ZDXANAGAsiL4-iAExhsBXZxftpOeh_55i3Ysy2q2LEsEWU64mdzUOPusi34M_wGoSf7iNyEWJ1UQy47YbpY4zVdzilNP-Bj3iXzrjjGlWtiYB9J6i9GjsxUuhPw3BlrzazF6ghq4Lzf7scStOz3KkxjwpsOBCH4=.WNQmhZQeUKIkh97KYgU0Lg=="
97
+ // }
98
+ // }
99
+ //
100
+ }
101
+ else {
102
+ response = await this.futuresPublicPostBulletPublic(params);
103
+ }
104
+ const data = this.safeValue(response, 'data', {});
105
+ const instanceServers = this.safeValue(data, 'instanceServers', []);
106
+ const firstInstanceServer = this.safeValue(instanceServers, 0);
107
+ const pingInterval = this.safeInteger(firstInstanceServer, 'pingInterval');
108
+ const endpoint = this.safeString(firstInstanceServer, 'endpoint');
109
+ const token = this.safeString(data, 'token');
110
+ const result = endpoint + '?' + this.urlencode({
111
+ 'token': token,
112
+ 'privateChannel': privateChannel,
113
+ 'connectId': connectId,
114
+ });
115
+ const client = this.client(result);
116
+ client.keepAlive = pingInterval;
117
+ return result;
118
+ }
119
+ catch (e) {
120
+ const future = this.safeValue(this.options['urls'], connectId);
121
+ future.reject(e);
122
+ delete this.options['urls'][connectId];
123
+ }
124
+ return undefined;
117
125
  }
118
126
  requestId() {
119
127
  const requestId = this.sum(this.safeInteger(this.options, 'requestId', 0), 1);
@@ -943,7 +943,7 @@ export default class poloniex extends poloniexRest {
943
943
  // }
944
944
  //
945
945
  const data = this.safeValue(message, 'data', []);
946
- const newTickers = [];
946
+ const newTickers = {};
947
947
  for (let i = 0; i < data.length; i++) {
948
948
  const item = data[i];
949
949
  const marketId = this.safeString(item, 'symbol');
@@ -951,7 +951,7 @@ export default class poloniex extends poloniexRest {
951
951
  const ticker = this.parseTicker(item);
952
952
  const symbol = ticker['symbol'];
953
953
  this.tickers[symbol] = ticker;
954
- newTickers.push(ticker);
954
+ newTickers[symbol] = ticker;
955
955
  }
956
956
  }
957
957
  const messageHashes = this.findMessageHashes(client, 'ticker::');
@@ -80,43 +80,51 @@ export default class poloniexfutures extends poloniexfuturesRest {
80
80
  async negotiateHelper(privateChannel, params = {}) {
81
81
  let response = undefined;
82
82
  const connectId = privateChannel ? 'private' : 'public';
83
- if (privateChannel) {
84
- response = await this.privatePostBulletPrivate(params);
85
- //
86
- // {
87
- // "code": "200000",
88
- // "data": {
89
- // "instanceServers": [
90
- // {
91
- // "pingInterval": 50000,
92
- // "endpoint": "wss://push-private.kucoin.com/endpoint",
93
- // "protocol": "websocket",
94
- // "encrypt": true,
95
- // "pingTimeout": 10000
96
- // }
97
- // ],
98
- // "token": "2neAiuYvAU61ZDXANAGAsiL4-iAExhsBXZxftpOeh_55i3Ysy2q2LEsEWU64mdzUOPusi34M_wGoSf7iNyEWJ1UQy47YbpY4zVdzilNP-Bj3iXzrjjGlWtiYB9J6i9GjsxUuhPw3BlrzazF6ghq4Lzf7scStOz3KkxjwpsOBCH4=.WNQmhZQeUKIkh97KYgU0Lg=="
99
- // }
100
- // }
101
- //
83
+ try {
84
+ if (privateChannel) {
85
+ response = await this.privatePostBulletPrivate(params);
86
+ //
87
+ // {
88
+ // "code": "200000",
89
+ // "data": {
90
+ // "instanceServers": [
91
+ // {
92
+ // "pingInterval": 50000,
93
+ // "endpoint": "wss://push-private.kucoin.com/endpoint",
94
+ // "protocol": "websocket",
95
+ // "encrypt": true,
96
+ // "pingTimeout": 10000
97
+ // }
98
+ // ],
99
+ // "token": "2neAiuYvAU61ZDXANAGAsiL4-iAExhsBXZxftpOeh_55i3Ysy2q2LEsEWU64mdzUOPusi34M_wGoSf7iNyEWJ1UQy47YbpY4zVdzilNP-Bj3iXzrjjGlWtiYB9J6i9GjsxUuhPw3BlrzazF6ghq4Lzf7scStOz3KkxjwpsOBCH4=.WNQmhZQeUKIkh97KYgU0Lg=="
100
+ // }
101
+ // }
102
+ //
103
+ }
104
+ else {
105
+ response = await this.publicPostBulletPublic(params);
106
+ }
107
+ const data = this.safeValue(response, 'data', {});
108
+ const instanceServers = this.safeValue(data, 'instanceServers', []);
109
+ const firstInstanceServer = this.safeValue(instanceServers, 0);
110
+ const pingInterval = this.safeInteger(firstInstanceServer, 'pingInterval');
111
+ const endpoint = this.safeString(firstInstanceServer, 'endpoint');
112
+ const token = this.safeString(data, 'token');
113
+ const result = endpoint + '?' + this.urlencode({
114
+ 'token': token,
115
+ 'privateChannel': privateChannel,
116
+ 'connectId': connectId,
117
+ });
118
+ const client = this.client(result);
119
+ client.keepAlive = pingInterval;
120
+ return result;
102
121
  }
103
- else {
104
- response = await this.publicPostBulletPublic(params);
122
+ catch (e) {
123
+ const future = this.safeValue(this.options['urls'], connectId);
124
+ future.reject(e);
125
+ delete this.options['urls'][connectId];
105
126
  }
106
- const data = this.safeValue(response, 'data', {});
107
- const instanceServers = this.safeValue(data, 'instanceServers', []);
108
- const firstInstanceServer = this.safeValue(instanceServers, 0);
109
- const pingInterval = this.safeInteger(firstInstanceServer, 'pingInterval');
110
- const endpoint = this.safeString(firstInstanceServer, 'endpoint');
111
- const token = this.safeString(data, 'token');
112
- const result = endpoint + '?' + this.urlencode({
113
- 'token': token,
114
- 'privateChannel': privateChannel,
115
- 'connectId': connectId,
116
- });
117
- const client = this.client(result);
118
- client.keepAlive = pingInterval;
119
- return result;
127
+ return undefined;
120
128
  }
121
129
  requestId() {
122
130
  const requestId = this.sum(this.safeInteger(this.options, 'requestId', 0), 1);
@@ -69,6 +69,7 @@ export default class whitebit extends Exchange {
69
69
  'fetchOrderTrades': true,
70
70
  'fetchPositionMode': false,
71
71
  'fetchPremiumIndexOHLCV': false,
72
+ 'fetchStatus': true,
72
73
  'fetchTicker': true,
73
74
  'fetchTickers': true,
74
75
  'fetchTime': true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccxt",
3
- "version": "4.2.16",
3
+ "version": "4.2.18",
4
4
  "description": "A JavaScript / TypeScript / Python / C# / PHP cryptocurrency trading library with support for 100+ exchanges",
5
5
  "unpkg": "dist/ccxt.browser.js",
6
6
  "type": "module",
package/skip-tests.json CHANGED
@@ -107,6 +107,9 @@
107
107
  "watchTicker": {
108
108
  "quoteVolume": "https://app.travis-ci.com/github/ccxt/ccxt/builds/267900037#L2466"
109
109
  },
110
+ "watchTickers": {
111
+ "quoteVolume": "https://app.travis-ci.com/github/ccxt/ccxt/builds/268171081#L2414"
112
+ },
110
113
  "watchOrderBook": "out of order update"
111
114
  }
112
115
  },
@@ -634,6 +637,7 @@
634
637
  }
635
638
  },
636
639
  "coincheck": {
640
+ "skipWs": true,
637
641
  "skipMethods": {
638
642
  "loadMarkets":{
639
643
  "info":"not provided",
@@ -902,11 +906,15 @@
902
906
  "currencyIdAndCode": "messed codes"
903
907
  },
904
908
  "fetchCurrencies": {
905
- "fee": "not provided"
909
+ "fee": "not provided",
910
+ "currencyIdAndCode": "https://app.travis-ci.com/github/ccxt/ccxt/builds/268371892#L2455"
906
911
  },
907
912
  "fetchTickers": {
908
913
  "bid":"messed bid-ask",
909
914
  "ask":"messed bid-ask"
915
+ },
916
+ "watchOrderBook": {
917
+ "bid": "https://app.travis-ci.com/github/ccxt/ccxt/builds/268349324#L2400"
910
918
  }
911
919
  }
912
920
  },
@@ -970,6 +978,9 @@
970
978
  "contractSize": "broken for some markets",
971
979
  "strike": "incorrect number type"
972
980
  },
981
+ "fetchCurrencies": {
982
+ "currencyIdAndCode": "https://app.travis-ci.com/github/ccxt/ccxt/builds/268371892#L2559"
983
+ },
973
984
  "fetchTrades": {
974
985
  "timestamp": "timestamp is in decimals"
975
986
  },