ccxt 4.2.75 → 4.2.76
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/build.sh +1 -1
- package/dist/ccxt.browser.js +39 -20
- package/dist/ccxt.browser.min.js +2 -2
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/binance.js +2 -0
- package/dist/cjs/src/bingx.js +12 -14
- package/dist/cjs/src/bybit.js +2 -1
- package/dist/cjs/src/coinbase.js +18 -2
- package/dist/cjs/src/coinbaseinternational.js +1 -1
- package/dist/cjs/src/gate.js +1 -0
- package/dist/cjs/src/htx.js +1 -0
- package/dist/cjs/src/pro/coinbaseinternational.js +1 -1
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/binance.d.ts +1 -0
- package/js/src/abstract/binancecoinm.d.ts +1 -0
- package/js/src/abstract/binanceus.d.ts +1 -0
- package/js/src/abstract/binanceusdm.d.ts +1 -0
- package/js/src/abstract/bingx.d.ts +2 -0
- package/js/src/binance.js +2 -0
- package/js/src/bingx.js +12 -14
- package/js/src/bybit.js +2 -1
- package/js/src/coinbase.js +18 -2
- package/js/src/coinbaseinternational.js +1 -1
- package/js/src/gate.js +1 -0
- package/js/src/htx.js +1 -0
- package/js/src/pro/coinbaseinternational.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -42,7 +42,7 @@ Current feature list:
|
|
|
42
42
|
| [](http://www.bitmart.com/?r=rQCFLh) | bitmart | [BitMart](http://www.bitmart.com/?r=rQCFLh) | [](https://developer-pro.bitmart.com/) | [](https://github.com/ccxt/ccxt/wiki/Certification) | [](https://ccxt.pro) | [](http://www.bitmart.com/?r=rQCFLh) |
|
|
43
43
|
| [](https://www.bitmex.com/app/register/NZTR1q) | bitmex | [BitMEX](https://www.bitmex.com/app/register/NZTR1q) | [](https://www.bitmex.com/app/apiOverview) | [](https://github.com/ccxt/ccxt/wiki/Certification) | [](https://ccxt.pro) | [](https://www.bitmex.com/app/register/NZTR1q) |
|
|
44
44
|
| [](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) | |
|
|
45
|
-
| [](https://international.coinbase.com) | coinbaseinternational | [
|
|
45
|
+
| [](https://international.coinbase.com) | coinbaseinternational | [Coinbase International](https://international.coinbase.com) | [](https://docs.cloud.coinbaseinternational.com/intx/docs) | [](https://github.com/ccxt/ccxt/wiki/Certification) | [](https://ccxt.pro) | |
|
|
46
46
|
| [](https://www.coinex.com/register?refer_code=yw5fz) | coinex | [CoinEx](https://www.coinex.com/register?refer_code=yw5fz) | [](https://viabtc.github.io/coinex_api_en_doc) | [](https://github.com/ccxt/ccxt/wiki/Certification) | [](https://ccxt.pro) | |
|
|
47
47
|
| [](https://crypto.com/exch/kdacthrnxt) | cryptocom | [Crypto.com](https://crypto.com/exch/kdacthrnxt) | [](https://exchange-docs.crypto.com/exchange/v1/rest-ws/index.html) | [](https://github.com/ccxt/ccxt/wiki/Certification) | [](https://ccxt.pro) | [](https://crypto.com/exch/kdacthrnxt) |
|
|
48
48
|
| [](https://www.gate.io/signup/2436035) | gate | [Gate.io](https://www.gate.io/signup/2436035) | [](https://www.gate.io/docs/developers/apiv4/en/) | [](https://github.com/ccxt/ccxt/wiki/Certification) | [](https://ccxt.pro) | [](https://www.gate.io/signup/2436035) |
|
|
@@ -95,7 +95,7 @@ The CCXT library currently supports the following 97 cryptocurrency exchange mar
|
|
|
95
95
|
| [](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) |
|
|
96
96
|
| [](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) |
|
|
97
97
|
| [](https://www.coinbase.com/join/58cbe25a355148797479dbd2) | coinbase | [Coinbase](https://www.coinbase.com/join/58cbe25a355148797479dbd2) | [](https://developers.coinbase.com/api/v2) | | [](https://ccxt.pro) |
|
|
98
|
-
| [](https://international.coinbase.com) | coinbaseinternational | [
|
|
98
|
+
| [](https://international.coinbase.com) | coinbaseinternational | [Coinbase International](https://international.coinbase.com) | [](https://docs.cloud.coinbaseinternational.com/intx/docs) | [](https://github.com/ccxt/ccxt/wiki/Certification) | [](https://ccxt.pro) |
|
|
99
99
|
| [](https://pro.coinbase.com/) | coinbasepro | [Coinbase Pro](https://pro.coinbase.com/) | [](https://docs.pro.coinbase.com) | | [](https://ccxt.pro) |
|
|
100
100
|
| [](https://coincheck.com) | coincheck | [coincheck](https://coincheck.com) | [](https://coincheck.com/documents/exchange/api) | | |
|
|
101
101
|
| [](https://www.coinex.com/register?refer_code=yw5fz) | coinex | [CoinEx](https://www.coinex.com/register?refer_code=yw5fz) | [](https://viabtc.github.io/coinex_api_en_doc) | [](https://github.com/ccxt/ccxt/wiki/Certification) | [](https://ccxt.pro) |
|
|
@@ -213,13 +213,13 @@ console.log(version, Object.keys(exchanges));
|
|
|
213
213
|
|
|
214
214
|
All-in-one browser bundle (dependencies included), served from a CDN of your choice:
|
|
215
215
|
|
|
216
|
-
* jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.2.
|
|
217
|
-
* unpkg: https://unpkg.com/ccxt@4.2.
|
|
216
|
+
* jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.2.76/dist/ccxt.browser.js
|
|
217
|
+
* unpkg: https://unpkg.com/ccxt@4.2.76/dist/ccxt.browser.js
|
|
218
218
|
|
|
219
219
|
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.
|
|
220
220
|
|
|
221
221
|
```HTML
|
|
222
|
-
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@4.2.
|
|
222
|
+
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@4.2.76/dist/ccxt.browser.js"></script>
|
|
223
223
|
```
|
|
224
224
|
|
|
225
225
|
Creates a global `ccxt` object:
|
package/build.sh
CHANGED
|
@@ -116,7 +116,7 @@ diff=$(echo "$diff" | sed -e "s/^ts\/src\/test\/static.*json//") #remove static
|
|
|
116
116
|
# diff=$(echo "$diff" | sed -e "s/^\.travis\.yml//")
|
|
117
117
|
# diff=$(echo "$diff" | sed -e "s/^package\-lock\.json//")
|
|
118
118
|
# diff=$(echo "$diff" | sed -e "s/python\/qa\.py//")
|
|
119
|
-
#echo $diff
|
|
119
|
+
#echo $diff
|
|
120
120
|
|
|
121
121
|
critical_pattern='Client(Trait)?\.php|Exchange\.php|\/base|^build|static_dependencies|^run-tests|package(-lock)?\.json|composer\.json|ccxt\.ts|__init__.py|test' # add \/test|
|
|
122
122
|
if [[ "$diff" =~ $critical_pattern ]]; then
|
package/dist/ccxt.browser.js
CHANGED
|
@@ -19218,6 +19218,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
19218
19218
|
'userTrades': 5,
|
|
19219
19219
|
'income': 30,
|
|
19220
19220
|
'commissionRate': 20,
|
|
19221
|
+
'rateLimit/order': 1,
|
|
19221
19222
|
'apiTradingStatus': 1,
|
|
19222
19223
|
'multiAssetsMargin': 30,
|
|
19223
19224
|
// broker endpoints
|
|
@@ -30074,6 +30075,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
30074
30075
|
* @param {int} [limit] default 30, max 500
|
|
30075
30076
|
* @param {object} [params] exchange specific parameters
|
|
30076
30077
|
* @param {int} [params.until] the time(ms) of the latest record to retrieve as a unix timestamp
|
|
30078
|
+
* @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)
|
|
30077
30079
|
* @returns {object} an array of [open interest structure]{@link https://docs.ccxt.com/#/?id=open-interest-structure}
|
|
30078
30080
|
*/
|
|
30079
30081
|
if (timeframe === '1m') {
|
|
@@ -31229,6 +31231,7 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
31229
31231
|
'v1': {
|
|
31230
31232
|
'public': {
|
|
31231
31233
|
'get': {
|
|
31234
|
+
'server/time': 3,
|
|
31232
31235
|
'common/symbols': 3,
|
|
31233
31236
|
'market/trades': 3,
|
|
31234
31237
|
'market/depth': 3,
|
|
@@ -31252,6 +31255,7 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
31252
31255
|
'trade/order/cancelReplace': 3,
|
|
31253
31256
|
'trade/cancelOrders': 3,
|
|
31254
31257
|
'trade/cancelOpenOrders': 3,
|
|
31258
|
+
'trade/cancelAllAfter': 1,
|
|
31255
31259
|
},
|
|
31256
31260
|
},
|
|
31257
31261
|
},
|
|
@@ -32914,15 +32918,18 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
32914
32918
|
request[exchangeClientOrderId] = clientOrderId;
|
|
32915
32919
|
}
|
|
32916
32920
|
const timeInForce = this.safeStringUpper(params, 'timeInForce');
|
|
32917
|
-
|
|
32921
|
+
[postOnly, params] = this.handlePostOnly(isMarketOrder, timeInForce === 'PostOnly', params);
|
|
32922
|
+
if (postOnly || (timeInForce === 'PostOnly')) {
|
|
32923
|
+
request['timeInForce'] = 'PostOnly';
|
|
32924
|
+
}
|
|
32925
|
+
else if (timeInForce === 'IOC') {
|
|
32918
32926
|
request['timeInForce'] = 'IOC';
|
|
32919
32927
|
}
|
|
32928
|
+
else if (timeInForce === 'GTC') {
|
|
32929
|
+
request['timeInForce'] = 'GTC';
|
|
32930
|
+
}
|
|
32920
32931
|
const triggerPrice = this.safeString2(params, 'stopPrice', 'triggerPrice');
|
|
32921
32932
|
if (isSpot) {
|
|
32922
|
-
[postOnly, params] = this.handlePostOnly(isMarketOrder, timeInForce === 'POC', params);
|
|
32923
|
-
if (postOnly || (timeInForce === 'POC')) {
|
|
32924
|
-
request['timeInForce'] = 'POC';
|
|
32925
|
-
}
|
|
32926
32933
|
const cost = this.safeNumber2(params, 'cost', 'quoteOrderQty');
|
|
32927
32934
|
params = this.omit(params, 'cost');
|
|
32928
32935
|
if (cost !== undefined) {
|
|
@@ -32955,14 +32962,7 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
32955
32962
|
}
|
|
32956
32963
|
}
|
|
32957
32964
|
else {
|
|
32958
|
-
|
|
32959
|
-
if (postOnly || (timeInForce === 'PostOnly')) {
|
|
32960
|
-
request['timeInForce'] = 'PostOnly';
|
|
32961
|
-
}
|
|
32962
|
-
else if (timeInForce === 'GTC') {
|
|
32963
|
-
request['timeInForce'] = 'GTC';
|
|
32964
|
-
}
|
|
32965
|
-
else if (timeInForce === 'FOK') {
|
|
32965
|
+
if (timeInForce === 'FOK') {
|
|
32966
32966
|
request['timeInForce'] = 'FOK';
|
|
32967
32967
|
}
|
|
32968
32968
|
const stopLossPrice = this.safeString(params, 'stopLossPrice');
|
|
@@ -33090,7 +33090,7 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
33090
33090
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
33091
33091
|
* @param {string} [params.clientOrderId] a unique id for the order
|
|
33092
33092
|
* @param {bool} [params.postOnly] true to place a post only order
|
|
33093
|
-
* @param {string} [params.timeInForce] spot supports 'PO' and 'IOC', swap supports 'PO', 'GTC', 'IOC' and 'FOK'
|
|
33093
|
+
* @param {string} [params.timeInForce] spot supports 'PO', 'GTC' and 'IOC', swap supports 'PO', 'GTC', 'IOC' and 'FOK'
|
|
33094
33094
|
* @param {bool} [params.reduceOnly] *swap only* true or false whether the order is reduce only
|
|
33095
33095
|
* @param {float} [params.triggerPrice] *swap only* triggerPrice at which the attached take profit / stop loss order will be triggered
|
|
33096
33096
|
* @param {float} [params.stopLossPrice] *swap only* stop loss trigger price
|
|
@@ -86049,7 +86049,7 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
86049
86049
|
//
|
|
86050
86050
|
const id = this.safeStringN(trade, ['execId', 'id', 'tradeId']);
|
|
86051
86051
|
const marketId = this.safeString(trade, 'symbol');
|
|
86052
|
-
let marketType = 'contract';
|
|
86052
|
+
let marketType = ('createType' in trade) ? 'contract' : 'spot';
|
|
86053
86053
|
if (market !== undefined) {
|
|
86054
86054
|
marketType = market['type'];
|
|
86055
86055
|
}
|
|
@@ -90188,6 +90188,7 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
90188
90188
|
* @param {int} [since] Not used by Bybit
|
|
90189
90189
|
* @param {int} [limit] The number of open interest structures to return. Max 200, default 50
|
|
90190
90190
|
* @param {object} [params] Exchange specific parameters
|
|
90191
|
+
* @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)
|
|
90191
90192
|
* @returns An array of open interest structures
|
|
90192
90193
|
*/
|
|
90193
90194
|
if (timeframe === '1m') {
|
|
@@ -94658,7 +94659,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
94658
94659
|
* @returns {object} an associative dictionary of currencies
|
|
94659
94660
|
*/
|
|
94660
94661
|
const response = await this.fetchCurrenciesFromCache(params);
|
|
94661
|
-
const currencies = this.
|
|
94662
|
+
const currencies = this.safeList(response, 'currencies', []);
|
|
94662
94663
|
//
|
|
94663
94664
|
// fiat
|
|
94664
94665
|
//
|
|
@@ -95210,9 +95211,15 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
95210
95211
|
* @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
|
|
95211
95212
|
* @param {int} [limit] max number of ledger entrys to return, default is undefined
|
|
95212
95213
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
95214
|
+
* @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)
|
|
95213
95215
|
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
|
|
95214
95216
|
*/
|
|
95215
95217
|
await this.loadMarkets();
|
|
95218
|
+
let paginate = false;
|
|
95219
|
+
[paginate, params] = this.handleOptionAndParams(params, 'fetchLedger', 'paginate');
|
|
95220
|
+
if (paginate) {
|
|
95221
|
+
return await this.fetchPaginatedCallCursor('fetchLedger', code, since, limit, params, 'next_starting_after', 'starting_after', undefined, 100);
|
|
95222
|
+
}
|
|
95216
95223
|
let currency = undefined;
|
|
95217
95224
|
if (code !== undefined) {
|
|
95218
95225
|
currency = this.currency(code);
|
|
@@ -95223,7 +95230,17 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
95223
95230
|
// the value for the next page can be obtained from the result of the previous call in the 'pagination' field
|
|
95224
95231
|
// eg: instance.last_json_response.pagination.next_starting_after
|
|
95225
95232
|
const response = await this.v2PrivateGetAccountsAccountIdTransactions(this.extend(request, params));
|
|
95226
|
-
|
|
95233
|
+
const ledger = this.parseLedger(response['data'], currency, since, limit);
|
|
95234
|
+
const length = ledger.length;
|
|
95235
|
+
const lastIndex = length - 1;
|
|
95236
|
+
const last = this.safeDict(ledger, lastIndex);
|
|
95237
|
+
const pagination = this.safeDict(response, 'pagination', {});
|
|
95238
|
+
const cursor = this.safeString(pagination, 'next_starting_after');
|
|
95239
|
+
if ((cursor !== undefined) && (cursor !== '')) {
|
|
95240
|
+
last['next_starting_after'] = cursor;
|
|
95241
|
+
ledger[lastIndex] = last;
|
|
95242
|
+
}
|
|
95243
|
+
return ledger;
|
|
95227
95244
|
}
|
|
95228
95245
|
parseLedgerEntryStatus(status) {
|
|
95229
95246
|
const types = {
|
|
@@ -97222,7 +97239,7 @@ class coinbaseinternational extends _abstract_coinbaseinternational_js__WEBPACK_
|
|
|
97222
97239
|
describe() {
|
|
97223
97240
|
return this.deepExtend(super.describe(), {
|
|
97224
97241
|
'id': 'coinbaseinternational',
|
|
97225
|
-
'name': '
|
|
97242
|
+
'name': 'Coinbase International',
|
|
97226
97243
|
'countries': ['US'],
|
|
97227
97244
|
'certified': true,
|
|
97228
97245
|
'pro': true,
|
|
@@ -141816,6 +141833,7 @@ class gate extends _abstract_gate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
141816
141833
|
* @param {int} [since] the time(ms) of the earliest record to retrieve as a unix timestamp
|
|
141817
141834
|
* @param {int} [limit] default 30
|
|
141818
141835
|
* @param {object} [params] exchange specific parameters
|
|
141836
|
+
* @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)
|
|
141819
141837
|
* @returns {object} an open interest structure{@link https://docs.ccxt.com/#/?id=open-interest-structure}
|
|
141820
141838
|
*/
|
|
141821
141839
|
await this.loadMarkets();
|
|
@@ -157246,6 +157264,7 @@ class htx extends _abstract_htx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
157246
157264
|
* @param {int} [since] not used by huobi, but filtered internally by ccxt
|
|
157247
157265
|
* @param {int} [limit] not used by huobi, but filtered internally by ccxt
|
|
157248
157266
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
157267
|
+
* @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)
|
|
157249
157268
|
* @returns {object[]} a list of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure}
|
|
157250
157269
|
*/
|
|
157251
157270
|
if (symbol === undefined) {
|
|
@@ -245020,7 +245039,7 @@ class coinbaseinternational extends _coinbaseinternational_js__WEBPACK_IMPORTED_
|
|
|
245020
245039
|
'ordersLimit': 1000,
|
|
245021
245040
|
'myTradesLimit': 1000,
|
|
245022
245041
|
},
|
|
245023
|
-
'
|
|
245042
|
+
'exceptions': {
|
|
245024
245043
|
'exact': {
|
|
245025
245044
|
'Unable to authenticate': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.AuthenticationError,
|
|
245026
245045
|
},
|
|
@@ -321533,7 +321552,7 @@ SOFTWARE.
|
|
|
321533
321552
|
|
|
321534
321553
|
//-----------------------------------------------------------------------------
|
|
321535
321554
|
// this is updated by vss.js when building
|
|
321536
|
-
const version = '4.2.
|
|
321555
|
+
const version = '4.2.76';
|
|
321537
321556
|
_src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange */ .e.ccxtVersion = version;
|
|
321538
321557
|
//-----------------------------------------------------------------------------
|
|
321539
321558
|
|