ccxt 4.3.23 → 4.3.24

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.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # CCXT – CryptoCurrency eXchange Trading Library
2
2
 
3
- [![Build Status](https://travis-ci.com/ccxt/ccxt.svg?branch=master)](https://travis-ci.com/ccxt/ccxt) [![npm](https://img.shields.io/npm/v/ccxt.svg)](https://npmjs.com/package/ccxt) [![PyPI](https://img.shields.io/pypi/v/ccxt.svg)](https://pypi.python.org/pypi/ccxt) [![NPM Downloads](https://img.shields.io/npm/dy/ccxt.svg)](https://www.npmjs.com/package/ccxt) [![Discord](https://img.shields.io/discord/690203284119617602?logo=discord&logoColor=white)](https://discord.gg/ccxt) [![Supported Exchanges](https://img.shields.io/badge/exchanges-104-blue.svg)](https://github.com/ccxt/ccxt/wiki/Exchange-Markets) [![Twitter Follow](https://img.shields.io/twitter/follow/ccxt_official.svg?style=social&label=CCXT)](https://twitter.com/ccxt_official)
3
+ [![Build Status](https://travis-ci.com/ccxt/ccxt.svg?branch=master)](https://travis-ci.com/ccxt/ccxt) [![npm](https://img.shields.io/npm/v/ccxt.svg)](https://npmjs.com/package/ccxt) [![PyPI](https://img.shields.io/pypi/v/ccxt.svg)](https://pypi.python.org/pypi/ccxt) [![NPM Downloads](https://img.shields.io/npm/dy/ccxt.svg)](https://www.npmjs.com/package/ccxt) [![Discord](https://img.shields.io/discord/690203284119617602?logo=discord&logoColor=white)](https://discord.gg/ccxt) [![Supported Exchanges](https://img.shields.io/badge/exchanges-105-blue.svg)](https://github.com/ccxt/ccxt/wiki/Exchange-Markets) [![Twitter Follow](https://img.shields.io/twitter/follow/ccxt_official.svg?style=social&label=CCXT)](https://twitter.com/ccxt_official)
4
4
 
5
5
  A JavaScript / Python / PHP / C# library for cryptocurrency trading and e-commerce with support for many bitcoin/ether/altcoin exchange markets and merchant APIs.
6
6
 
@@ -96,8 +96,8 @@ The CCXT library currently supports the following 98 cryptocurrency exchange mar
96
96
  | [![bybit](https://user-images.githubusercontent.com/51840849/76547799-daff5b80-649e-11ea-87fb-3be9bac08954.jpg)](https://www.bybit.com/register?affiliate_id=35953) | bybit | [Bybit](https://www.bybit.com/register?affiliate_id=35953) | [![API Version 5](https://img.shields.io/badge/5-lightgray)](https://bybit-exchange.github.io/docs/inverse/) | [![CCXT Certified](https://img.shields.io/badge/CCXT-Certified-green.svg)](https://github.com/ccxt/ccxt/wiki/Certification) | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://ccxt.pro) |
97
97
  | [![cex](https://user-images.githubusercontent.com/1294454/27766442-8ddc33b0-5ed8-11e7-8b98-f786aef0f3c9.jpg)](https://cex.io/r/0/up105393824/0/) | cex | [CEX.IO](https://cex.io/r/0/up105393824/0/) | [![API Version *](https://img.shields.io/badge/*-lightgray)](https://cex.io/cex-api) | | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://ccxt.pro) |
98
98
  | [![coinbase](https://user-images.githubusercontent.com/1294454/40811661-b6eceae2-653a-11e8-829e-10bfadb078cf.jpg)](https://www.coinbase.com/join/58cbe25a355148797479dbd2) | coinbase | [Coinbase Advanced](https://www.coinbase.com/join/58cbe25a355148797479dbd2) | [![API Version 2](https://img.shields.io/badge/2-lightgray)](https://developers.coinbase.com/api/v2) | [![CCXT Certified](https://img.shields.io/badge/CCXT-Certified-green.svg)](https://github.com/ccxt/ccxt/wiki/Certification) | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://ccxt.pro) |
99
+ | [![coinbaseexchange](https://github.com/ccxt/ccxt/assets/43336371/34a65553-88aa-4a38-a714-064bd228b97e)](https://coinbase.com/) | coinbaseexchange | [Coinbase Exchange](https://coinbase.com/) | [![API Version *](https://img.shields.io/badge/*-lightgray)](https://docs.cloud.coinbase.com/exchange/docs/) | | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://ccxt.pro) |
99
100
  | [![coinbaseinternational](https://github.com/ccxt/ccxt/assets/43336371/866ae638-6ab5-4ebf-ab2c-cdcce9545625)](https://international.coinbase.com) | coinbaseinternational | [Coinbase International](https://international.coinbase.com) | [![API Version 1](https://img.shields.io/badge/1-lightgray)](https://docs.cloud.coinbase.com/intx/docs) | [![CCXT Certified](https://img.shields.io/badge/CCXT-Certified-green.svg)](https://github.com/ccxt/ccxt/wiki/Certification) | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://ccxt.pro) |
100
- | [![coinbasepro](https://user-images.githubusercontent.com/1294454/41764625-63b7ffde-760a-11e8-996d-a6328fa9347a.jpg)](https://pro.coinbase.com/) | coinbasepro | [Coinbase Pro(Deprecated)](https://pro.coinbase.com/) | [![API Version *](https://img.shields.io/badge/*-lightgray)](https://docs.pro.coinbase.com) | | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://ccxt.pro) |
101
101
  | [![coincheck](https://user-images.githubusercontent.com/51840849/87182088-1d6d6380-c2ec-11ea-9c64-8ab9f9b289f5.jpg)](https://coincheck.com) | coincheck | [coincheck](https://coincheck.com) | [![API Version *](https://img.shields.io/badge/*-lightgray)](https://coincheck.com/documents/exchange/api) | | |
102
102
  | [![coinex](https://user-images.githubusercontent.com/51840849/87182089-1e05fa00-c2ec-11ea-8da9-cc73b45abbbc.jpg)](https://www.coinex.com/register?refer_code=yw5fz) | coinex | [CoinEx](https://www.coinex.com/register?refer_code=yw5fz) | [![API Version 1](https://img.shields.io/badge/1-lightgray)](https://docs.coinex.com/api/v2) | [![CCXT Certified](https://img.shields.io/badge/CCXT-Certified-green.svg)](https://github.com/ccxt/ccxt/wiki/Certification) | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://ccxt.pro) |
103
103
  | [![coinlist](https://github-production-user-asset-6210df.s3.amazonaws.com/1294454/281108917-eff2ae1d-ce8a-4b2a-950d-8678b12da965.jpg)](https://coinlist.co) | coinlist | [Coinlist](https://coinlist.co) | [![API Version 1](https://img.shields.io/badge/1-lightgray)](https://trade-docs.coinlist.co) | | |
@@ -215,13 +215,13 @@ console.log(version, Object.keys(exchanges));
215
215
 
216
216
  All-in-one browser bundle (dependencies included), served from a CDN of your choice:
217
217
 
218
- * jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.3.23/dist/ccxt.browser.js
219
- * unpkg: https://unpkg.com/ccxt@4.3.23/dist/ccxt.browser.js
218
+ * jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.3.24/dist/ccxt.browser.js
219
+ * unpkg: https://unpkg.com/ccxt@4.3.24/dist/ccxt.browser.js
220
220
 
221
221
  CDNs are not updated in real-time and may have delays. Defaulting to the most recent version without specifying the version number is not recommended. Please, keep in mind that we are not responsible for the correct operation of those CDN servers.
222
222
 
223
223
  ```HTML
224
- <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@4.3.23/dist/ccxt.browser.js"></script>
224
+ <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@4.3.24/dist/ccxt.browser.js"></script>
225
225
  ```
226
226
 
227
227
  Creates a global `ccxt` object:
package/dist/cjs/ccxt.js CHANGED
@@ -51,8 +51,9 @@ var btcturk = require('./src/btcturk.js');
51
51
  var bybit = require('./src/bybit.js');
52
52
  var cex = require('./src/cex.js');
53
53
  var coinbase = require('./src/coinbase.js');
54
+ var coinbaseadvanced = require('./src/coinbaseadvanced.js');
55
+ var coinbaseexchange = require('./src/coinbaseexchange.js');
54
56
  var coinbaseinternational = require('./src/coinbaseinternational.js');
55
- var coinbasepro = require('./src/coinbasepro.js');
56
57
  var coincheck = require('./src/coincheck.js');
57
58
  var coinex = require('./src/coinex.js');
58
59
  var coinlist = require('./src/coinlist.js');
@@ -140,8 +141,8 @@ var blockchaincom$1 = require('./src/pro/blockchaincom.js');
140
141
  var bybit$1 = require('./src/pro/bybit.js');
141
142
  var cex$1 = require('./src/pro/cex.js');
142
143
  var coinbase$1 = require('./src/pro/coinbase.js');
144
+ var coinbaseexchange$1 = require('./src/pro/coinbaseexchange.js');
143
145
  var coinbaseinternational$1 = require('./src/pro/coinbaseinternational.js');
144
- var coinbasepro$1 = require('./src/pro/coinbasepro.js');
145
146
  var coincheck$1 = require('./src/pro/coincheck.js');
146
147
  var coinex$1 = require('./src/pro/coinex.js');
147
148
  var coinone$1 = require('./src/pro/coinone.js');
@@ -184,7 +185,7 @@ var woofipro$1 = require('./src/pro/woofipro.js');
184
185
 
185
186
  //-----------------------------------------------------------------------------
186
187
  // this is updated by vss.js when building
187
- const version = '4.3.23';
188
+ const version = '4.3.24';
188
189
  Exchange["default"].ccxtVersion = version;
189
190
  const exchanges = {
190
191
  'ace': ace,
@@ -226,8 +227,9 @@ const exchanges = {
226
227
  'bybit': bybit,
227
228
  'cex': cex,
228
229
  'coinbase': coinbase,
230
+ 'coinbaseadvanced': coinbaseadvanced,
231
+ 'coinbaseexchange': coinbaseexchange,
229
232
  'coinbaseinternational': coinbaseinternational,
230
- 'coinbasepro': coinbasepro,
231
233
  'coincheck': coincheck,
232
234
  'coinex': coinex,
233
235
  'coinlist': coinlist,
@@ -317,8 +319,8 @@ const pro = {
317
319
  'bybit': bybit$1,
318
320
  'cex': cex$1,
319
321
  'coinbase': coinbase$1,
322
+ 'coinbaseexchange': coinbaseexchange$1,
320
323
  'coinbaseinternational': coinbaseinternational$1,
321
- 'coinbasepro': coinbasepro$1,
322
324
  'coincheck': coincheck$1,
323
325
  'coinex': coinex$1,
324
326
  'coinone': coinone$1,
@@ -445,8 +447,9 @@ exports.btcturk = btcturk;
445
447
  exports.bybit = bybit;
446
448
  exports.cex = cex;
447
449
  exports.coinbase = coinbase;
450
+ exports.coinbaseadvanced = coinbaseadvanced;
451
+ exports.coinbaseexchange = coinbaseexchange;
448
452
  exports.coinbaseinternational = coinbaseinternational;
449
- exports.coinbasepro = coinbasepro;
450
453
  exports.coincheck = coincheck;
451
454
  exports.coinex = coinex;
452
455
  exports.coinlist = coinlist;
@@ -251,7 +251,7 @@ class Exchange {
251
251
  // }
252
252
  // }
253
253
  //
254
- this.options = this.getDefaultOptions(); // exchange-specific options, if any
254
+ this.options = this.getDefaultOptions(); // exchange-specific options if any
255
255
  // fetch implementation options (JS only)
256
256
  // http properties
257
257
  this.headers = {};
@@ -5957,8 +5957,9 @@ class Exchange {
5957
5957
  errors = 0;
5958
5958
  const responseLength = response.length;
5959
5959
  if (this.verbose) {
5960
- const iteration = (i + 1).toString();
5961
- const cursorMessage = 'Cursor pagination call ' + iteration + ' method ' + method + ' response length ' + responseLength.toString() + ' cursor ' + cursorValue;
5960
+ const cursorString = (cursorValue === undefined) ? '' : cursorValue;
5961
+ const iteration = (i + 1);
5962
+ const cursorMessage = 'Cursor pagination call ' + iteration.toString() + ' method ' + method + ' response length ' + responseLength.toString() + ' cursor ' + cursorString;
5962
5963
  this.log(cursorMessage);
5963
5964
  }
5964
5965
  if (responseLength === 0) {
@@ -3142,6 +3142,11 @@ class bitrue extends bitrue$1 {
3142
3142
  signPath = signPath + '/' + version + '/' + path;
3143
3143
  let signMessage = timestamp + method + signPath;
3144
3144
  if (method === 'GET') {
3145
+ const keys = Object.keys(params);
3146
+ const keysLength = keys.length;
3147
+ if (keysLength > 0) {
3148
+ signMessage += '?' + this.urlencode(params);
3149
+ }
3145
3150
  const signature = this.hmac(this.encode(signMessage), this.encode(this.secret), sha256.sha256);
3146
3151
  headers = {
3147
3152
  'X-CH-APIKEY': this.apiKey,
@@ -3155,7 +3160,7 @@ class bitrue extends bitrue$1 {
3155
3160
  'recvWindow': recvWindow,
3156
3161
  }, params);
3157
3162
  body = this.json(query);
3158
- signMessage = signMessage + JSON.stringify(body);
3163
+ signMessage += body;
3159
3164
  const signature = this.hmac(this.encode(signMessage), this.encode(this.secret), sha256.sha256);
3160
3165
  headers = {
3161
3166
  'Content-Type': 'application/json',
@@ -0,0 +1,17 @@
1
+ 'use strict';
2
+
3
+ var coinbase = require('./coinbase.js');
4
+
5
+ // ---------------------------------------------------------------------------
6
+ // ---------------------------------------------------------------------------
7
+ class coinbaseadvanced extends coinbase {
8
+ describe() {
9
+ return this.deepExtend(super.describe(), {
10
+ 'id': 'coinbaseadvanced',
11
+ 'name': 'Coinbase Advanced',
12
+ 'alias': true,
13
+ });
14
+ }
15
+ }
16
+
17
+ module.exports = coinbaseadvanced;
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var coinbasepro$1 = require('./abstract/coinbasepro.js');
3
+ var coinbaseexchange$1 = require('./abstract/coinbaseexchange.js');
4
4
  var errors = require('./base/errors.js');
5
5
  var Precise = require('./base/Precise.js');
6
6
  var number = require('./base/functions/number.js');
@@ -9,14 +9,14 @@ var sha256 = require('./static_dependencies/noble-hashes/sha256.js');
9
9
  // ----------------------------------------------------------------------------
10
10
  // ----------------------------------------------------------------------------
11
11
  /**
12
- * @class coinbasepro
12
+ * @class coinbaseexchange
13
13
  * @augments Exchange
14
14
  */
15
- class coinbasepro extends coinbasepro$1 {
15
+ class coinbaseexchange extends coinbaseexchange$1 {
16
16
  describe() {
17
17
  return this.deepExtend(super.describe(), {
18
- 'id': 'coinbasepro',
19
- 'name': 'Coinbase Pro(Deprecated)',
18
+ 'id': 'coinbaseexchange',
19
+ 'name': 'Coinbase Exchange',
20
20
  'countries': ['US'],
21
21
  'rateLimit': 100,
22
22
  'userAgent': this.userAgents['chrome'],
@@ -78,19 +78,19 @@ class coinbasepro extends coinbasepro$1 {
78
78
  '6h': 21600,
79
79
  '1d': 86400,
80
80
  },
81
- 'hostname': 'pro.coinbase.com',
81
+ 'hostname': 'exchange.coinbase.com',
82
82
  'urls': {
83
83
  'test': {
84
- 'public': 'https://api-public.sandbox.pro.coinbase.com',
85
- 'private': 'https://api-public.sandbox.pro.coinbase.com',
84
+ 'public': 'https://api-public.sandbox.exchange.coinbase.com',
85
+ 'private': 'https://api-public.sandbox.exchange.coinbase.com',
86
86
  },
87
- 'logo': 'https://user-images.githubusercontent.com/1294454/41764625-63b7ffde-760a-11e8-996d-a6328fa9347a.jpg',
87
+ 'logo': 'https://github.com/ccxt/ccxt/assets/43336371/34a65553-88aa-4a38-a714-064bd228b97e',
88
88
  'api': {
89
89
  'public': 'https://api.{hostname}',
90
90
  'private': 'https://api.{hostname}',
91
91
  },
92
- 'www': 'https://pro.coinbase.com/',
93
- 'doc': 'https://docs.pro.coinbase.com',
92
+ 'www': 'https://coinbase.com/',
93
+ 'doc': 'https://docs.cloud.coinbase.com/exchange/docs/',
94
94
  'fees': [
95
95
  'https://docs.pro.coinbase.com/#fees',
96
96
  'https://support.pro.coinbase.com/customer/en/portal/articles/2945310-fees',
@@ -237,7 +237,7 @@ class coinbasepro extends coinbasepro$1 {
237
237
  async fetchCurrencies(params = {}) {
238
238
  /**
239
239
  * @method
240
- * @name coinbasepro#fetchCurrencies
240
+ * @name coinbaseexchange#fetchCurrencies
241
241
  * @description fetches all available currencies on an exchange
242
242
  * @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getcurrencies
243
243
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -308,8 +308,8 @@ class coinbasepro extends coinbasepro$1 {
308
308
  async fetchMarkets(params = {}) {
309
309
  /**
310
310
  * @method
311
- * @name coinbasepro#fetchMarkets
312
- * @description retrieves data on all markets for coinbasepro
311
+ * @name coinbaseexchange#fetchMarkets
312
+ * @description retrieves data on all markets for coinbaseexchange
313
313
  * @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getproducts
314
314
  * @param {object} [params] extra parameters specific to the exchange API endpoint
315
315
  * @returns {object[]} an array of objects representing market data
@@ -429,7 +429,7 @@ class coinbasepro extends coinbasepro$1 {
429
429
  async fetchAccounts(params = {}) {
430
430
  /**
431
431
  * @method
432
- * @name coinbasepro#fetchAccounts
432
+ * @name coinbaseexchange#fetchAccounts
433
433
  * @description fetch all the accounts associated with a profile
434
434
  * @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getaccounts
435
435
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -495,7 +495,7 @@ class coinbasepro extends coinbasepro$1 {
495
495
  async fetchBalance(params = {}) {
496
496
  /**
497
497
  * @method
498
- * @name coinbasepro#fetchBalance
498
+ * @name coinbaseexchange#fetchBalance
499
499
  * @description query for balance and get the amount of funds available for trading or funds locked in orders
500
500
  * @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getaccounts
501
501
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -508,7 +508,7 @@ class coinbasepro extends coinbasepro$1 {
508
508
  async fetchOrderBook(symbol, limit = undefined, params = {}) {
509
509
  /**
510
510
  * @method
511
- * @name coinbasepro#fetchOrderBook
511
+ * @name coinbaseexchange#fetchOrderBook
512
512
  * @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getproductbook
513
513
  * @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
514
514
  * @param {string} symbol unified symbol of the market to fetch the order book for
@@ -628,7 +628,7 @@ class coinbasepro extends coinbasepro$1 {
628
628
  async fetchTickers(symbols = undefined, params = {}) {
629
629
  /**
630
630
  * @method
631
- * @name coinbasepro#fetchTickers
631
+ * @name coinbaseexchange#fetchTickers
632
632
  * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
633
633
  * @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getproduct
634
634
  * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
@@ -675,7 +675,7 @@ class coinbasepro extends coinbasepro$1 {
675
675
  async fetchTicker(symbol, params = {}) {
676
676
  /**
677
677
  * @method
678
- * @name coinbasepro#fetchTicker
678
+ * @name coinbaseexchange#fetchTicker
679
679
  * @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getproductticker
680
680
  * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
681
681
  * @param {string} symbol unified symbol of the market to fetch the ticker for
@@ -789,7 +789,7 @@ class coinbasepro extends coinbasepro$1 {
789
789
  async fetchMyTrades(symbol = undefined, since = undefined, limit = undefined, params = {}) {
790
790
  /**
791
791
  * @method
792
- * @name coinbasepro#fetchMyTrades
792
+ * @name coinbaseexchange#fetchMyTrades
793
793
  * @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getfills
794
794
  * @description fetch all trades made by the user
795
795
  * @param {string} symbol unified market symbol
@@ -830,7 +830,7 @@ class coinbasepro extends coinbasepro$1 {
830
830
  async fetchTrades(symbol, since = undefined, limit = undefined, params = {}) {
831
831
  /**
832
832
  * @method
833
- * @name coinbasepro#fetchTrades
833
+ * @name coinbaseexchange#fetchTrades
834
834
  * @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getproducttrades
835
835
  * @description get the list of most recent trades for a particular symbol
836
836
  * @param {string} symbol unified symbol of the market to fetch trades for
@@ -864,7 +864,7 @@ class coinbasepro extends coinbasepro$1 {
864
864
  async fetchTradingFees(params = {}) {
865
865
  /**
866
866
  * @method
867
- * @name coinbasepro#fetchTradingFees
867
+ * @name coinbaseexchange#fetchTradingFees
868
868
  * @description fetch the trading fees for multiple markets
869
869
  * @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getfees
870
870
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -918,7 +918,7 @@ class coinbasepro extends coinbasepro$1 {
918
918
  async fetchOHLCV(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
919
919
  /**
920
920
  * @method
921
- * @name coinbasepro#fetchOHLCV
921
+ * @name coinbaseexchange#fetchOHLCV
922
922
  * @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getproductcandles
923
923
  * @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
924
924
  * @param {string} symbol unified symbol of the market to fetch OHLCV data for
@@ -984,7 +984,7 @@ class coinbasepro extends coinbasepro$1 {
984
984
  async fetchTime(params = {}) {
985
985
  /**
986
986
  * @method
987
- * @name coinbasepro#fetchTime
987
+ * @name coinbaseexchange#fetchTime
988
988
  * @description fetches the current integer timestamp in milliseconds from the exchange server
989
989
  * @param {object} [params] extra parameters specific to the exchange API endpoint
990
990
  * @returns {int} the current integer timestamp in milliseconds from the exchange server
@@ -1087,10 +1087,10 @@ class coinbasepro extends coinbasepro$1 {
1087
1087
  async fetchOrder(id, symbol = undefined, params = {}) {
1088
1088
  /**
1089
1089
  * @method
1090
- * @name coinbasepro#fetchOrder
1090
+ * @name coinbaseexchange#fetchOrder
1091
1091
  * @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getorder
1092
1092
  * @description fetches information on an order made by the user
1093
- * @param {string} symbol not used by coinbasepro fetchOrder
1093
+ * @param {string} symbol not used by coinbaseexchange fetchOrder
1094
1094
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1095
1095
  * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
1096
1096
  */
@@ -1113,7 +1113,7 @@ class coinbasepro extends coinbasepro$1 {
1113
1113
  async fetchOrderTrades(id, symbol = undefined, since = undefined, limit = undefined, params = {}) {
1114
1114
  /**
1115
1115
  * @method
1116
- * @name coinbasepro#fetchOrderTrades
1116
+ * @name coinbaseexchange#fetchOrderTrades
1117
1117
  * @description fetch all the trades made from a single order
1118
1118
  * @param {string} id order id
1119
1119
  * @param {string} symbol unified market symbol
@@ -1136,7 +1136,7 @@ class coinbasepro extends coinbasepro$1 {
1136
1136
  async fetchOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
1137
1137
  /**
1138
1138
  * @method
1139
- * @name coinbasepro#fetchOrders
1139
+ * @name coinbaseexchange#fetchOrders
1140
1140
  * @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getorders
1141
1141
  * @description fetches information on multiple orders made by the user
1142
1142
  * @param {string} symbol unified market symbol of the market orders were made in
@@ -1154,7 +1154,7 @@ class coinbasepro extends coinbasepro$1 {
1154
1154
  async fetchOpenOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
1155
1155
  /**
1156
1156
  * @method
1157
- * @name coinbasepro#fetchOpenOrders
1157
+ * @name coinbaseexchange#fetchOpenOrders
1158
1158
  * @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getorders
1159
1159
  * @description fetch all unfilled currently open orders
1160
1160
  * @param {string} symbol unified market symbol
@@ -1194,7 +1194,7 @@ class coinbasepro extends coinbasepro$1 {
1194
1194
  async fetchClosedOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
1195
1195
  /**
1196
1196
  * @method
1197
- * @name coinbasepro#fetchClosedOrders
1197
+ * @name coinbaseexchange#fetchClosedOrders
1198
1198
  * @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getorders
1199
1199
  * @description fetches information on multiple closed orders made by the user
1200
1200
  * @param {string} symbol unified market symbol of the market orders were made in
@@ -1212,7 +1212,7 @@ class coinbasepro extends coinbasepro$1 {
1212
1212
  async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
1213
1213
  /**
1214
1214
  * @method
1215
- * @name coinbasepro#createOrder
1215
+ * @name coinbaseexchange#createOrder
1216
1216
  * @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_postorders
1217
1217
  * @description create a trade order
1218
1218
  * @param {string} symbol unified symbol of the market to create an order in
@@ -1308,7 +1308,7 @@ class coinbasepro extends coinbasepro$1 {
1308
1308
  async cancelOrder(id, symbol = undefined, params = {}) {
1309
1309
  /**
1310
1310
  * @method
1311
- * @name coinbasepro#cancelOrder
1311
+ * @name coinbaseexchange#cancelOrder
1312
1312
  * @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_deleteorder
1313
1313
  * @description cancels an open order
1314
1314
  * @param {string} id order id
@@ -1341,7 +1341,7 @@ class coinbasepro extends coinbasepro$1 {
1341
1341
  async cancelAllOrders(symbol = undefined, params = {}) {
1342
1342
  /**
1343
1343
  * @method
1344
- * @name coinbasepro#cancelAllOrders
1344
+ * @name coinbaseexchange#cancelAllOrders
1345
1345
  * @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_deleteorders
1346
1346
  * @description cancel all open orders
1347
1347
  * @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
@@ -1363,7 +1363,7 @@ class coinbasepro extends coinbasepro$1 {
1363
1363
  async withdraw(code, amount, address, tag = undefined, params = {}) {
1364
1364
  /**
1365
1365
  * @method
1366
- * @name coinbasepro#withdraw
1366
+ * @name coinbaseexchange#withdraw
1367
1367
  * @description make a withdrawal
1368
1368
  * @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_postwithdrawpaymentmethod
1369
1369
  * @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_postwithdrawcoinbaseaccount
@@ -1489,7 +1489,7 @@ class coinbasepro extends coinbasepro$1 {
1489
1489
  async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
1490
1490
  /**
1491
1491
  * @method
1492
- * @name coinbasepro#fetchLedger
1492
+ * @name coinbaseexchange#fetchLedger
1493
1493
  * @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getaccountledger
1494
1494
  * @description fetch the history of changes, actions done by the user or operations that altered balance of the user
1495
1495
  * @param {string} code unified currency code, default is undefined
@@ -1540,7 +1540,7 @@ class coinbasepro extends coinbasepro$1 {
1540
1540
  async fetchDepositsWithdrawals(code = undefined, since = undefined, limit = undefined, params = {}) {
1541
1541
  /**
1542
1542
  * @method
1543
- * @name coinbasepro#fetchDepositsWithdrawals
1543
+ * @name coinbaseexchange#fetchDepositsWithdrawals
1544
1544
  * @description fetch history of deposits and withdrawals
1545
1545
  * @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_gettransfers
1546
1546
  * @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getaccounttransfers
@@ -1648,7 +1648,7 @@ class coinbasepro extends coinbasepro$1 {
1648
1648
  async fetchDeposits(code = undefined, since = undefined, limit = undefined, params = {}) {
1649
1649
  /**
1650
1650
  * @method
1651
- * @name coinbasepro#fetchDeposits
1651
+ * @name coinbaseexchange#fetchDeposits
1652
1652
  * @description fetch all deposits made to an account
1653
1653
  * @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_gettransfers
1654
1654
  * @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getaccounttransfers
@@ -1663,7 +1663,7 @@ class coinbasepro extends coinbasepro$1 {
1663
1663
  async fetchWithdrawals(code = undefined, since = undefined, limit = undefined, params = {}) {
1664
1664
  /**
1665
1665
  * @method
1666
- * @name coinbasepro#fetchWithdrawals
1666
+ * @name coinbaseexchange#fetchWithdrawals
1667
1667
  * @description fetch all withdrawals made from an account
1668
1668
  * @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_gettransfers
1669
1669
  * @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getaccounttransfers
@@ -1775,7 +1775,7 @@ class coinbasepro extends coinbasepro$1 {
1775
1775
  async createDepositAddress(code, params = {}) {
1776
1776
  /**
1777
1777
  * @method
1778
- * @name coinbasepro#createDepositAddress
1778
+ * @name coinbaseexchange#createDepositAddress
1779
1779
  * @description create a currency deposit address
1780
1780
  * @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_postcoinbaseaccountaddresses
1781
1781
  * @param {string} code unified currency code of the currency for the deposit address
@@ -1871,4 +1871,4 @@ class coinbasepro extends coinbasepro$1 {
1871
1871
  }
1872
1872
  }
1873
1873
 
1874
- module.exports = coinbasepro;
1874
+ module.exports = coinbaseexchange;
@@ -445,7 +445,9 @@ class coinex extends coinex$1 {
445
445
  'fillResponseFromRequest': true,
446
446
  },
447
447
  'accountsById': {
448
- 'spot': '0',
448
+ 'spot': 'SPOT',
449
+ 'margin': 'MARGIN',
450
+ 'swap': 'FUTURES',
449
451
  },
450
452
  'networks': {
451
453
  'BEP20': 'BSC',
@@ -3651,7 +3653,11 @@ class coinex extends coinex$1 {
3651
3653
  * @param {string} [params.marginMode] 'cross' or 'isolated' for fetching spot margin orders
3652
3654
  * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
3653
3655
  */
3654
- return await this.fetchOrdersByStatus('pending', symbol, since, limit, params);
3656
+ const openOrders = await this.fetchOrdersByStatus('pending', symbol, since, limit, params);
3657
+ for (let i = 0; i < openOrders.length; i++) {
3658
+ openOrders[i]['status'] = 'open';
3659
+ }
3660
+ return openOrders;
3655
3661
  }
3656
3662
  async fetchClosedOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
3657
3663
  /**
@@ -4883,43 +4889,45 @@ class coinex extends coinex$1 {
4883
4889
  * @method
4884
4890
  * @name coinex#transfer
4885
4891
  * @description transfer currency internally between wallets on the same account
4886
- * @see https://viabtc.github.io/coinex_api_en_doc/spot/#docsspot002_account014_balance_contract_transfer
4887
- * @see https://viabtc.github.io/coinex_api_en_doc/spot/#docsspot002_account013_margin_transfer
4892
+ * @see https://docs.coinex.com/api/v2/assets/transfer/http/transfer
4888
4893
  * @param {string} code unified currency code
4889
4894
  * @param {float} amount amount to transfer
4890
4895
  * @param {string} fromAccount account to transfer from
4891
4896
  * @param {string} toAccount account to transfer to
4892
4897
  * @param {object} [params] extra parameters specific to the exchange API endpoint
4898
+ * @param {string} [params.symbol] unified ccxt symbol, required when either the fromAccount or toAccount is margin
4893
4899
  * @returns {object} a [transfer structure]{@link https://docs.ccxt.com/#/?id=transfer-structure}
4894
4900
  */
4895
4901
  await this.loadMarkets();
4896
4902
  const currency = this.currency(code);
4897
4903
  const amountToPrecision = this.currencyToPrecision(code, amount);
4904
+ const accountsById = this.safeDict(this.options, 'accountsById', {});
4905
+ const fromId = this.safeString(accountsById, fromAccount, fromAccount);
4906
+ const toId = this.safeString(accountsById, toAccount, toAccount);
4898
4907
  const request = {
4908
+ 'ccy': currency['id'],
4899
4909
  'amount': amountToPrecision,
4900
- 'coin_type': currency['id'],
4910
+ 'from_account_type': fromId,
4911
+ 'to_account_type': toId,
4901
4912
  };
4902
- let response = undefined;
4903
- if ((fromAccount === 'spot') && (toAccount === 'swap')) {
4904
- request['transfer_side'] = 'in'; // 'in' spot to swap, 'out' swap to spot
4905
- response = await this.v1PrivatePostContractBalanceTransfer(this.extend(request, params));
4906
- }
4907
- else if ((fromAccount === 'swap') && (toAccount === 'spot')) {
4908
- request['transfer_side'] = 'out'; // 'in' spot to swap, 'out' swap to spot
4909
- response = await this.v1PrivatePostContractBalanceTransfer(this.extend(request, params));
4913
+ if ((fromAccount === 'margin') || (toAccount === 'margin')) {
4914
+ const symbol = this.safeString(params, 'symbol');
4915
+ if (symbol === undefined) {
4916
+ throw new errors.ArgumentsRequired(this.id + ' transfer() the symbol parameter must be defined for a margin account');
4917
+ }
4918
+ params = this.omit(params, 'symbol');
4919
+ request['market'] = this.marketId(symbol);
4910
4920
  }
4911
- else {
4912
- const accountsById = this.safeValue(this.options, 'accountsById', {});
4913
- const fromId = this.safeString(accountsById, fromAccount, fromAccount);
4914
- const toId = this.safeString(accountsById, toAccount, toAccount);
4915
- // fromAccount and toAccount must be integers for margin transfers
4916
- // spot is 0, use fetchBalance() to find the margin account id
4917
- request['from_account'] = parseInt(fromId);
4918
- request['to_account'] = parseInt(toId);
4919
- response = await this.v1PrivatePostMarginTransfer(this.extend(request, params));
4921
+ if ((fromAccount !== 'spot') && (toAccount !== 'spot')) {
4922
+ throw new errors.BadRequest(this.id + ' transfer() can only be between spot and swap, or spot and margin, either the fromAccount or toAccount must be spot');
4920
4923
  }
4924
+ const response = await this.v2PrivatePostAssetsTransfer(this.extend(request, params));
4921
4925
  //
4922
- // {"code": 0, "data": null, "message": "Success"}
4926
+ // {
4927
+ // "code": 0,
4928
+ // "data": {},
4929
+ // "message": "OK"
4930
+ // }
4923
4931
  //
4924
4932
  return this.extend(this.parseTransfer(response, currency), {
4925
4933
  'amount': this.parseNumber(amountToPrecision),
@@ -4931,67 +4939,24 @@ class coinex extends coinex$1 {
4931
4939
  const statuses = {
4932
4940
  '0': 'ok',
4933
4941
  'SUCCESS': 'ok',
4942
+ 'OK': 'ok',
4934
4943
  };
4935
4944
  return this.safeString(statuses, status, status);
4936
4945
  }
4937
4946
  parseTransfer(transfer, currency = undefined) {
4938
- //
4939
- // fetchTransfers Swap
4940
- //
4941
- // {
4942
- // "amount": "10",
4943
- // "asset": "USDT",
4944
- // "transfer_type": "transfer_out", // from swap to spot
4945
- // "created_at": 1651633422
4946
- // },
4947
- //
4948
- // fetchTransfers Margin
4949
- //
4950
- // {
4951
- // "id": 7580062,
4952
- // "updated_at": 1653684379,
4953
- // "user_id": 3620173,
4954
- // "from_account_id": 0,
4955
- // "to_account_id": 1,
4956
- // "asset": "BTC",
4957
- // "amount": "0.00160829",
4958
- // "balance": "0.00160829",
4959
- // "transfer_type": "IN",
4960
- // "status": "SUCCESS",
4961
- // "created_at": 1653684379
4962
- // },
4963
- //
4964
- const timestamp = this.safeTimestamp(transfer, 'created_at');
4965
- const transferType = this.safeString(transfer, 'transfer_type');
4966
- let fromAccount = undefined;
4967
- let toAccount = undefined;
4968
- if (transferType === 'transfer_out') {
4969
- fromAccount = 'swap';
4970
- toAccount = 'spot';
4971
- }
4972
- else if (transferType === 'transfer_in') {
4973
- fromAccount = 'spot';
4974
- toAccount = 'swap';
4975
- }
4976
- else if (transferType === 'IN') {
4977
- fromAccount = 'spot';
4978
- toAccount = 'margin';
4979
- }
4980
- else if (transferType === 'OUT') {
4981
- fromAccount = 'margin';
4982
- toAccount = 'spot';
4983
- }
4984
- const currencyId = this.safeString(transfer, 'asset');
4985
- const currencyCode = this.safeCurrencyCode(currencyId, currency);
4947
+ const timestamp = this.safeInteger(transfer, 'created_at');
4948
+ const currencyId = this.safeString(transfer, 'ccy');
4949
+ const fromId = this.safeString(transfer, 'from_account_type');
4950
+ const toId = this.safeString(transfer, 'to_account_type');
4951
+ const accountsById = this.safeValue(this.options, 'accountsById', {});
4986
4952
  return {
4987
- 'info': transfer,
4988
- 'id': this.safeString(transfer, 'id'),
4953
+ 'id': undefined,
4989
4954
  'timestamp': timestamp,
4990
4955
  'datetime': this.iso8601(timestamp),
4991
- 'currency': currencyCode,
4956
+ 'currency': this.safeCurrencyCode(currencyId, currency),
4992
4957
  'amount': this.safeNumber(transfer, 'amount'),
4993
- 'fromAccount': fromAccount,
4994
- 'toAccount': toAccount,
4958
+ 'fromAccount': this.safeString(accountsById, fromId, fromId),
4959
+ 'toAccount': this.safeString(accountsById, toId, toId),
4995
4960
  'status': this.parseTransferStatus(this.safeString2(transfer, 'code', 'status')),
4996
4961
  };
4997
4962
  }
@@ -4783,6 +4783,7 @@ class kucoin extends kucoin$1 {
4783
4783
  const partnerSignature = this.hmac(this.encode(partnerPayload), this.encode(partnerSecret), sha256.sha256, 'base64');
4784
4784
  headers['KC-API-PARTNER-SIGN'] = partnerSignature;
4785
4785
  headers['KC-API-PARTNER'] = partnerId;
4786
+ headers['KC-API-PARTNER-VERIFY'] = 'true';
4786
4787
  }
4787
4788
  if (isBroker) {
4788
4789
  const brokerName = this.safeString(partner, 'name');