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 +5 -5
- package/dist/cjs/ccxt.js +9 -6
- package/dist/cjs/src/base/Exchange.js +4 -3
- package/dist/cjs/src/bitrue.js +6 -1
- package/dist/cjs/src/coinbaseadvanced.js +17 -0
- package/dist/cjs/src/{coinbasepro.js → coinbaseexchange.js} +40 -40
- package/dist/cjs/src/coinex.js +41 -76
- package/dist/cjs/src/kucoin.js +1 -0
- package/dist/cjs/src/pro/bitget.js +12 -3
- package/dist/cjs/src/pro/{coinbasepro.js → coinbaseexchange.js} +13 -13
- package/js/ccxt.d.ts +11 -8
- package/js/ccxt.js +8 -6
- package/js/src/abstract/coinbaseadvanced.d.ts +97 -0
- package/js/src/abstract/coinbaseadvanced.js +11 -0
- package/js/src/base/Exchange.js +4 -3
- package/js/src/bitrue.js +6 -1
- package/js/src/coinbaseadvanced.d.ts +4 -0
- package/js/src/coinbaseadvanced.js +18 -0
- package/js/src/{coinbasepro.d.ts → coinbaseexchange.d.ts} +3 -3
- package/js/src/{coinbasepro.js → coinbaseexchange.js} +39 -39
- package/js/src/coinex.d.ts +1 -1
- package/js/src/coinex.js +41 -76
- package/js/src/kucoin.js +1 -0
- package/js/src/pro/bitget.js +12 -3
- package/js/src/pro/{coinbasepro.d.ts → coinbaseexchange.d.ts} +2 -2
- package/js/src/pro/{coinbasepro.js → coinbaseexchange.js} +12 -12
- package/package.json +1 -1
- /package/dist/cjs/src/abstract/{coinbasepro.js → coinbaseexchange.js} +0 -0
- /package/js/src/abstract/{coinbasepro.d.ts → coinbaseexchange.d.ts} +0 -0
- /package/js/src/abstract/{coinbasepro.js → coinbaseexchange.js} +0 -0
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# CCXT – CryptoCurrency eXchange Trading Library
|
|
2
2
|
|
|
3
|
-
[](https://travis-ci.com/ccxt/ccxt) [](https://npmjs.com/package/ccxt) [](https://pypi.python.org/pypi/ccxt) [](https://www.npmjs.com/package/ccxt) [](https://discord.gg/ccxt) [](https://travis-ci.com/ccxt/ccxt) [](https://npmjs.com/package/ccxt) [](https://pypi.python.org/pypi/ccxt) [](https://www.npmjs.com/package/ccxt) [](https://discord.gg/ccxt) [](https://github.com/ccxt/ccxt/wiki/Exchange-Markets) [](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
|
| [](https://www.bybit.com/register?affiliate_id=35953) | bybit | [Bybit](https://www.bybit.com/register?affiliate_id=35953) | [](https://bybit-exchange.github.io/docs/inverse/) | [](https://github.com/ccxt/ccxt/wiki/Certification) | [](https://ccxt.pro) |
|
|
97
97
|
| [](https://cex.io/r/0/up105393824/0/) | cex | [CEX.IO](https://cex.io/r/0/up105393824/0/) | [](https://cex.io/cex-api) | | [](https://ccxt.pro) |
|
|
98
98
|
| [](https://www.coinbase.com/join/58cbe25a355148797479dbd2) | coinbase | [Coinbase Advanced](https://www.coinbase.com/join/58cbe25a355148797479dbd2) | [](https://developers.coinbase.com/api/v2) | [](https://github.com/ccxt/ccxt/wiki/Certification) | [](https://ccxt.pro) |
|
|
99
|
+
| [](https://coinbase.com/) | coinbaseexchange | [Coinbase Exchange](https://coinbase.com/) | [](https://docs.cloud.coinbase.com/exchange/docs/) | | [](https://ccxt.pro) |
|
|
99
100
|
| [](https://international.coinbase.com) | coinbaseinternational | [Coinbase International](https://international.coinbase.com) | [](https://docs.cloud.coinbase.com/intx/docs) | [](https://github.com/ccxt/ccxt/wiki/Certification) | [](https://ccxt.pro) |
|
|
100
|
-
| [](https://pro.coinbase.com/) | coinbasepro | [Coinbase Pro(Deprecated)](https://pro.coinbase.com/) | [](https://docs.pro.coinbase.com) | | [](https://ccxt.pro) |
|
|
101
101
|
| [](https://coincheck.com) | coincheck | [coincheck](https://coincheck.com) | [](https://coincheck.com/documents/exchange/api) | | |
|
|
102
102
|
| [](https://www.coinex.com/register?refer_code=yw5fz) | coinex | [CoinEx](https://www.coinex.com/register?refer_code=yw5fz) | [](https://docs.coinex.com/api/v2) | [](https://github.com/ccxt/ccxt/wiki/Certification) | [](https://ccxt.pro) |
|
|
103
103
|
| [](https://coinlist.co) | coinlist | [Coinlist](https://coinlist.co) | [](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.
|
|
219
|
-
* unpkg: https://unpkg.com/ccxt@4.3.
|
|
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.
|
|
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.
|
|
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
|
|
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
|
|
5961
|
-
const
|
|
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) {
|
package/dist/cjs/src/bitrue.js
CHANGED
|
@@ -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
|
|
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
|
|
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
|
|
12
|
+
* @class coinbaseexchange
|
|
13
13
|
* @augments Exchange
|
|
14
14
|
*/
|
|
15
|
-
class
|
|
15
|
+
class coinbaseexchange extends coinbaseexchange$1 {
|
|
16
16
|
describe() {
|
|
17
17
|
return this.deepExtend(super.describe(), {
|
|
18
|
-
'id': '
|
|
19
|
-
'name': 'Coinbase
|
|
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': '
|
|
81
|
+
'hostname': 'exchange.coinbase.com',
|
|
82
82
|
'urls': {
|
|
83
83
|
'test': {
|
|
84
|
-
'public': 'https://api-public.sandbox.
|
|
85
|
-
'private': 'https://api-public.sandbox.
|
|
84
|
+
'public': 'https://api-public.sandbox.exchange.coinbase.com',
|
|
85
|
+
'private': 'https://api-public.sandbox.exchange.coinbase.com',
|
|
86
86
|
},
|
|
87
|
-
'logo': 'https://
|
|
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://
|
|
93
|
-
'doc': 'https://docs.
|
|
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
|
|
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
|
|
312
|
-
* @description retrieves data on all markets for
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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 =
|
|
1874
|
+
module.exports = coinbaseexchange;
|
package/dist/cjs/src/coinex.js
CHANGED
|
@@ -445,7 +445,9 @@ class coinex extends coinex$1 {
|
|
|
445
445
|
'fillResponseFromRequest': true,
|
|
446
446
|
},
|
|
447
447
|
'accountsById': {
|
|
448
|
-
'spot': '
|
|
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
|
-
|
|
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://
|
|
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
|
-
'
|
|
4910
|
+
'from_account_type': fromId,
|
|
4911
|
+
'to_account_type': toId,
|
|
4901
4912
|
};
|
|
4902
|
-
|
|
4903
|
-
|
|
4904
|
-
|
|
4905
|
-
|
|
4906
|
-
|
|
4907
|
-
|
|
4908
|
-
request['
|
|
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
|
-
|
|
4912
|
-
|
|
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
|
-
// {
|
|
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
|
-
|
|
4940
|
-
|
|
4941
|
-
|
|
4942
|
-
|
|
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
|
-
'
|
|
4988
|
-
'id': this.safeString(transfer, 'id'),
|
|
4953
|
+
'id': undefined,
|
|
4989
4954
|
'timestamp': timestamp,
|
|
4990
4955
|
'datetime': this.iso8601(timestamp),
|
|
4991
|
-
'currency':
|
|
4956
|
+
'currency': this.safeCurrencyCode(currencyId, currency),
|
|
4992
4957
|
'amount': this.safeNumber(transfer, 'amount'),
|
|
4993
|
-
'fromAccount':
|
|
4994
|
-
'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
|
}
|
package/dist/cjs/src/kucoin.js
CHANGED
|
@@ -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');
|