ccxt 4.2.26 → 4.2.28
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 +6 -5
- package/dist/ccxt.browser.js +2382 -337
- package/dist/ccxt.browser.min.js +7 -7
- package/dist/cjs/ccxt.js +4 -1
- package/dist/cjs/src/abstract/coinmetro.js +9 -0
- package/dist/cjs/src/base/Exchange.js +3 -0
- package/dist/cjs/src/bingx.js +4 -0
- package/dist/cjs/src/bit2c.js +1 -0
- package/dist/cjs/src/bitbank.js +1 -0
- package/dist/cjs/src/bitbns.js +1 -0
- package/dist/cjs/src/bitfinex2.js +49 -1
- package/dist/cjs/src/bitflyer.js +1 -0
- package/dist/cjs/src/bitforex.js +29 -0
- package/dist/cjs/src/coinbase.js +6 -1
- package/dist/cjs/src/coinmetro.js +1909 -0
- package/dist/cjs/src/kucoinfutures.js +4 -0
- package/dist/cjs/src/upbit.js +21 -11
- package/js/ccxt.d.ts +5 -2
- package/js/ccxt.js +4 -2
- package/js/src/abstract/coinmetro.d.ts +36 -0
- package/js/src/abstract/coinmetro.js +11 -0
- package/js/src/base/Exchange.js +3 -0
- package/js/src/bingx.d.ts +4 -0
- package/js/src/bingx.js +4 -0
- package/js/src/bit2c.js +1 -0
- package/js/src/bitbank.js +1 -0
- package/js/src/bitbns.js +1 -0
- package/js/src/bitfinex2.d.ts +16 -0
- package/js/src/bitfinex2.js +49 -1
- package/js/src/bitflyer.js +1 -0
- package/js/src/bitforex.d.ts +1 -0
- package/js/src/bitforex.js +29 -0
- package/js/src/coinbase.js +6 -1
- package/js/src/coinmetro.d.ts +79 -0
- package/js/src/coinmetro.js +1910 -0
- package/js/src/kucoinfutures.d.ts +4 -0
- package/js/src/kucoinfutures.js +4 -0
- package/js/src/upbit.d.ts +3 -3
- package/js/src/upbit.js +21 -11
- package/package.json +1 -1
- package/skip-tests.json +7 -0
package/dist/cjs/ccxt.js
CHANGED
|
@@ -56,6 +56,7 @@ var coincheck = require('./src/coincheck.js');
|
|
|
56
56
|
var coinex = require('./src/coinex.js');
|
|
57
57
|
var coinlist = require('./src/coinlist.js');
|
|
58
58
|
var coinmate = require('./src/coinmate.js');
|
|
59
|
+
var coinmetro = require('./src/coinmetro.js');
|
|
59
60
|
var coinone = require('./src/coinone.js');
|
|
60
61
|
var coinsph = require('./src/coinsph.js');
|
|
61
62
|
var coinspot = require('./src/coinspot.js');
|
|
@@ -174,7 +175,7 @@ var woo$1 = require('./src/pro/woo.js');
|
|
|
174
175
|
|
|
175
176
|
//-----------------------------------------------------------------------------
|
|
176
177
|
// this is updated by vss.js when building
|
|
177
|
-
const version = '4.2.
|
|
178
|
+
const version = '4.2.28';
|
|
178
179
|
Exchange["default"].ccxtVersion = version;
|
|
179
180
|
const exchanges = {
|
|
180
181
|
'ace': ace,
|
|
@@ -221,6 +222,7 @@ const exchanges = {
|
|
|
221
222
|
'coinex': coinex,
|
|
222
223
|
'coinlist': coinlist,
|
|
223
224
|
'coinmate': coinmate,
|
|
225
|
+
'coinmetro': coinmetro,
|
|
224
226
|
'coinone': coinone,
|
|
225
227
|
'coinsph': coinsph,
|
|
226
228
|
'coinspot': coinspot,
|
|
@@ -424,6 +426,7 @@ exports.coincheck = coincheck;
|
|
|
424
426
|
exports.coinex = coinex;
|
|
425
427
|
exports.coinlist = coinlist;
|
|
426
428
|
exports.coinmate = coinmate;
|
|
429
|
+
exports.coinmetro = coinmetro;
|
|
427
430
|
exports.coinone = coinone;
|
|
428
431
|
exports.coinsph = coinsph;
|
|
429
432
|
exports.coinspot = coinspot;
|
|
@@ -4078,6 +4078,9 @@ class Exchange {
|
|
|
4078
4078
|
return this.cancelOrder(this.safeValue(order, 'id'), this.safeValue(order, 'symbol'), params);
|
|
4079
4079
|
}
|
|
4080
4080
|
async fetchOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
4081
|
+
if (this.has['fetchOpenOrders'] && this.has['fetchClosedOrders']) {
|
|
4082
|
+
throw new errors.NotSupported(this.id + ' fetchOrders() is not supported yet, consider using fetchOpenOrders() and fetchClosedOrders() instead');
|
|
4083
|
+
}
|
|
4081
4084
|
throw new errors.NotSupported(this.id + ' fetchOrders() is not supported yet');
|
|
4082
4085
|
}
|
|
4083
4086
|
async fetchOrdersWs(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
package/dist/cjs/src/bingx.js
CHANGED
|
@@ -8,6 +8,10 @@ var number = require('./base/functions/number.js');
|
|
|
8
8
|
|
|
9
9
|
// ---------------------------------------------------------------------------
|
|
10
10
|
// ---------------------------------------------------------------------------
|
|
11
|
+
/**
|
|
12
|
+
* @class bingx
|
|
13
|
+
* @augments Exchange
|
|
14
|
+
*/
|
|
11
15
|
class bingx extends bingx$1 {
|
|
12
16
|
describe() {
|
|
13
17
|
return this.deepExtend(super.describe(), {
|
package/dist/cjs/src/bit2c.js
CHANGED
package/dist/cjs/src/bitbank.js
CHANGED
package/dist/cjs/src/bitbns.js
CHANGED
|
@@ -69,6 +69,7 @@ class bitfinex2 extends bitfinex2$1 {
|
|
|
69
69
|
'fetchTradingFees': true,
|
|
70
70
|
'fetchTransactionFees': undefined,
|
|
71
71
|
'fetchTransactions': 'emulated',
|
|
72
|
+
'setMargin': true,
|
|
72
73
|
'withdraw': true,
|
|
73
74
|
},
|
|
74
75
|
'timeframes': {
|
|
@@ -819,6 +820,11 @@ class bitfinex2 extends bitfinex2$1 {
|
|
|
819
820
|
const result = { 'info': response };
|
|
820
821
|
for (let i = 0; i < response.length; i++) {
|
|
821
822
|
const balance = response[i];
|
|
823
|
+
const account = this.account();
|
|
824
|
+
const interest = this.safeString(balance, 3);
|
|
825
|
+
if (interest !== '0') {
|
|
826
|
+
account['debt'] = interest;
|
|
827
|
+
}
|
|
822
828
|
const type = this.safeString(balance, 0);
|
|
823
829
|
const currencyId = this.safeStringLower(balance, 1, '');
|
|
824
830
|
const start = currencyId.length - 2;
|
|
@@ -827,7 +833,6 @@ class bitfinex2 extends bitfinex2$1 {
|
|
|
827
833
|
const derivativeCondition = (!isDerivative || isDerivativeCode);
|
|
828
834
|
if ((accountType === type) && derivativeCondition) {
|
|
829
835
|
const code = this.safeCurrencyCode(currencyId);
|
|
830
|
-
const account = this.account();
|
|
831
836
|
account['total'] = this.safeString(balance, 2);
|
|
832
837
|
account['free'] = this.safeString(balance, 4);
|
|
833
838
|
result[code] = account;
|
|
@@ -3262,6 +3267,49 @@ class bitfinex2 extends bitfinex2$1 {
|
|
|
3262
3267
|
'datetime': this.iso8601(timestamp),
|
|
3263
3268
|
});
|
|
3264
3269
|
}
|
|
3270
|
+
async setMargin(symbol, amount, params = {}) {
|
|
3271
|
+
/**
|
|
3272
|
+
* @method
|
|
3273
|
+
* @name bitfinex2#setMargin
|
|
3274
|
+
* @description either adds or reduces margin in a swap position in order to set the margin to a specific value
|
|
3275
|
+
* @see https://docs.bitfinex.com/reference/rest-auth-deriv-pos-collateral-set
|
|
3276
|
+
* @param {string} symbol unified market symbol of the market to set margin in
|
|
3277
|
+
* @param {float} amount the amount to set the margin to
|
|
3278
|
+
* @param {object} [params] parameters specific to the exchange API endpoint
|
|
3279
|
+
* @returns {object} A [margin structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#add-margin-structure}
|
|
3280
|
+
*/
|
|
3281
|
+
await this.loadMarkets();
|
|
3282
|
+
const market = this.market(symbol);
|
|
3283
|
+
if (!market['swap']) {
|
|
3284
|
+
throw new errors.NotSupported(this.id + ' setMargin() only support swap markets');
|
|
3285
|
+
}
|
|
3286
|
+
const request = {
|
|
3287
|
+
'symbol': market['id'],
|
|
3288
|
+
'collateral': this.parseToNumeric(amount),
|
|
3289
|
+
};
|
|
3290
|
+
const response = await this.privatePostAuthWDerivCollateralSet(this.extend(request, params));
|
|
3291
|
+
//
|
|
3292
|
+
// [
|
|
3293
|
+
// [
|
|
3294
|
+
// 1
|
|
3295
|
+
// ]
|
|
3296
|
+
// ]
|
|
3297
|
+
//
|
|
3298
|
+
const data = this.safeValue(response, 0);
|
|
3299
|
+
return this.parseMarginModification(data, market);
|
|
3300
|
+
}
|
|
3301
|
+
parseMarginModification(data, market = undefined) {
|
|
3302
|
+
const marginStatusRaw = data[0];
|
|
3303
|
+
const marginStatus = (marginStatusRaw === 1) ? 'ok' : 'failed';
|
|
3304
|
+
return {
|
|
3305
|
+
'info': data,
|
|
3306
|
+
'type': undefined,
|
|
3307
|
+
'amount': undefined,
|
|
3308
|
+
'code': undefined,
|
|
3309
|
+
'symbol': market['symbol'],
|
|
3310
|
+
'status': marginStatus,
|
|
3311
|
+
};
|
|
3312
|
+
}
|
|
3265
3313
|
}
|
|
3266
3314
|
|
|
3267
3315
|
module.exports = bitfinex2;
|
package/dist/cjs/src/bitflyer.js
CHANGED
package/dist/cjs/src/bitforex.js
CHANGED
|
@@ -27,6 +27,7 @@ class bitforex extends bitforex$1 {
|
|
|
27
27
|
'future': false,
|
|
28
28
|
'option': false,
|
|
29
29
|
'addMargin': false,
|
|
30
|
+
'cancelAllOrders': true,
|
|
30
31
|
'cancelOrder': true,
|
|
31
32
|
'createOrder': true,
|
|
32
33
|
'createReduceOnlyOrder': false,
|
|
@@ -680,6 +681,34 @@ class bitforex extends bitforex$1 {
|
|
|
680
681
|
'trades': undefined,
|
|
681
682
|
}, market);
|
|
682
683
|
}
|
|
684
|
+
async cancelAllOrders(symbol = undefined, params = {}) {
|
|
685
|
+
/**
|
|
686
|
+
* @method
|
|
687
|
+
* @name bitforex#cancelAllOrders
|
|
688
|
+
* @see https://github.com/githubdev2020/API_Doc_en/wiki/Cancle-all-orders
|
|
689
|
+
* @description cancel all open orders in a market
|
|
690
|
+
* @param {string} symbol unified market symbol of the market to cancel orders in
|
|
691
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
692
|
+
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
693
|
+
*/
|
|
694
|
+
if (symbol === undefined) {
|
|
695
|
+
throw new errors.ArgumentsRequired(this.id + ' cancelAllOrders () requires a symbol argument');
|
|
696
|
+
}
|
|
697
|
+
await this.loadMarkets();
|
|
698
|
+
const market = this.market(symbol);
|
|
699
|
+
const request = {
|
|
700
|
+
'symbol': market['id'],
|
|
701
|
+
};
|
|
702
|
+
const response = await this.privatePostApiV1TradeCancelAllOrder(this.extend(request, params));
|
|
703
|
+
//
|
|
704
|
+
// {
|
|
705
|
+
// 'data': True,
|
|
706
|
+
// 'success': True,
|
|
707
|
+
// 'time': '1706542995252'
|
|
708
|
+
// }
|
|
709
|
+
//
|
|
710
|
+
return response;
|
|
711
|
+
}
|
|
683
712
|
async fetchOrder(id, symbol = undefined, params = {}) {
|
|
684
713
|
/**
|
|
685
714
|
* @method
|
package/dist/cjs/src/coinbase.js
CHANGED
|
@@ -3337,11 +3337,16 @@ class coinbase extends coinbase$1 {
|
|
|
3337
3337
|
'Content-Type': 'application/json',
|
|
3338
3338
|
};
|
|
3339
3339
|
}
|
|
3340
|
-
else if (this.token) {
|
|
3340
|
+
else if (this.token && !this.checkRequiredCredentials(false)) {
|
|
3341
3341
|
headers = {
|
|
3342
3342
|
'Authorization': 'Bearer ' + this.token,
|
|
3343
3343
|
'Content-Type': 'application/json',
|
|
3344
3344
|
};
|
|
3345
|
+
if (method !== 'GET') {
|
|
3346
|
+
if (Object.keys(query).length) {
|
|
3347
|
+
body = this.json(query);
|
|
3348
|
+
}
|
|
3349
|
+
}
|
|
3345
3350
|
}
|
|
3346
3351
|
else {
|
|
3347
3352
|
this.checkRequiredCredentials();
|