ccxt 4.4.94 → 4.4.96
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 +7 -7
- package/dist/ccxt.browser.min.js +7 -7
- package/dist/cjs/ccxt.js +4 -1
- package/dist/cjs/src/abstract/foxbit.js +9 -0
- package/dist/cjs/src/apex.js +2 -2
- package/dist/cjs/src/ascendex.js +3 -3
- package/dist/cjs/src/base/Exchange.js +8 -4
- package/dist/cjs/src/base/ws/Future.js +2 -2
- package/dist/cjs/src/bingx.js +148 -94
- package/dist/cjs/src/bitget.js +32 -144
- package/dist/cjs/src/bitmart.js +2 -2
- package/dist/cjs/src/bitrue.js +15 -8
- package/dist/cjs/src/bitstamp.js +1 -0
- package/dist/cjs/src/blofin.js +7 -1
- package/dist/cjs/src/bybit.js +17 -6
- package/dist/cjs/src/coinbase.js +36 -0
- package/dist/cjs/src/coinbaseexchange.js +4 -2
- package/dist/cjs/src/coinmate.js +34 -0
- package/dist/cjs/src/coinone.js +34 -0
- package/dist/cjs/src/coinsph.js +29 -0
- package/dist/cjs/src/coinspot.js +36 -1
- package/dist/cjs/src/cryptocom.js +2 -1
- package/dist/cjs/src/cryptomus.js +41 -1
- package/dist/cjs/src/defx.js +1 -1
- package/dist/cjs/src/derive.js +1 -1
- package/dist/cjs/src/ellipx.js +40 -0
- package/dist/cjs/src/foxbit.js +2016 -0
- package/dist/cjs/src/gate.js +1 -1
- package/dist/cjs/src/hyperliquid.js +3 -2
- package/dist/cjs/src/kucoin.js +1 -1
- package/dist/cjs/src/kucoinfutures.js +3 -2
- package/dist/cjs/src/mexc.js +28 -13
- package/dist/cjs/src/modetrade.js +3 -3
- package/dist/cjs/src/okcoin.js +1 -1
- package/dist/cjs/src/okx.js +12 -3
- package/dist/cjs/src/onetrading.js +1 -1
- package/dist/cjs/src/oxfun.js +2 -1
- package/dist/cjs/src/paradex.js +2 -2
- package/dist/cjs/src/pro/hyperliquid.js +6 -6
- package/dist/cjs/src/pro/kraken.js +18 -18
- package/dist/cjs/src/pro/mexc.js +10 -10
- package/dist/cjs/src/vertex.js +3 -2
- package/dist/cjs/src/woo.js +1281 -894
- package/dist/cjs/src/woofipro.js +2 -2
- package/js/ccxt.d.ts +5 -2
- package/js/ccxt.js +4 -2
- package/js/src/abstract/bingx.d.ts +3 -0
- package/js/src/abstract/foxbit.d.ts +29 -0
- package/js/src/abstract/foxbit.js +11 -0
- package/js/src/abstract/woo.d.ts +58 -3
- package/js/src/apex.d.ts +2 -2
- package/js/src/apex.js +2 -2
- package/js/src/ascendex.d.ts +1 -1
- package/js/src/ascendex.js +3 -3
- package/js/src/base/Exchange.d.ts +7 -6
- package/js/src/base/Exchange.js +8 -4
- package/js/src/base/ws/Future.js +2 -2
- package/js/src/bingx.d.ts +6 -6
- package/js/src/bingx.js +148 -94
- package/js/src/bitget.js +32 -144
- package/js/src/bitmart.d.ts +2 -2
- package/js/src/bitmart.js +2 -2
- package/js/src/bitrue.js +15 -8
- package/js/src/bitstamp.js +2 -1
- package/js/src/bittrade.d.ts +1 -1
- package/js/src/blofin.d.ts +2 -1
- package/js/src/blofin.js +7 -1
- package/js/src/bybit.d.ts +1 -1
- package/js/src/bybit.js +17 -6
- package/js/src/coinbase.js +36 -0
- package/js/src/coinbaseexchange.d.ts +2 -2
- package/js/src/coinbaseexchange.js +4 -2
- package/js/src/coinbaseinternational.d.ts +2 -2
- package/js/src/coinmate.js +34 -0
- package/js/src/coinone.js +34 -0
- package/js/src/coinsph.js +29 -0
- package/js/src/coinspot.d.ts +1 -1
- package/js/src/coinspot.js +36 -1
- package/js/src/cryptocom.d.ts +1 -1
- package/js/src/cryptocom.js +2 -1
- package/js/src/cryptomus.d.ts +1 -1
- package/js/src/cryptomus.js +41 -1
- package/js/src/defx.d.ts +2 -2
- package/js/src/defx.js +1 -1
- package/js/src/derive.d.ts +2 -2
- package/js/src/derive.js +1 -1
- package/js/src/digifinex.d.ts +1 -1
- package/js/src/ellipx.js +40 -0
- package/js/src/foxbit.d.ts +352 -0
- package/js/src/foxbit.js +2016 -0
- package/js/src/gate.js +1 -1
- package/js/src/htx.d.ts +2 -2
- package/js/src/hyperliquid.d.ts +2 -2
- package/js/src/hyperliquid.js +3 -2
- package/js/src/krakenfutures.d.ts +1 -1
- package/js/src/kucoin.d.ts +1 -1
- package/js/src/kucoin.js +1 -1
- package/js/src/kucoinfutures.d.ts +3 -3
- package/js/src/kucoinfutures.js +3 -2
- package/js/src/mexc.d.ts +1 -1
- package/js/src/mexc.js +28 -13
- package/js/src/modetrade.d.ts +2 -4
- package/js/src/modetrade.js +3 -3
- package/js/src/ndax.d.ts +1 -1
- package/js/src/okcoin.d.ts +1 -1
- package/js/src/okcoin.js +1 -1
- package/js/src/okx.d.ts +1 -1
- package/js/src/okx.js +12 -3
- package/js/src/onetrading.d.ts +1 -1
- package/js/src/onetrading.js +1 -1
- package/js/src/oxfun.d.ts +1 -1
- package/js/src/oxfun.js +2 -1
- package/js/src/paradex.d.ts +1 -1
- package/js/src/paradex.js +2 -2
- package/js/src/pro/hyperliquid.js +6 -6
- package/js/src/pro/kraken.js +18 -18
- package/js/src/pro/mexc.js +10 -10
- package/js/src/timex.d.ts +1 -1
- package/js/src/vertex.d.ts +2 -2
- package/js/src/vertex.js +3 -2
- package/js/src/woo.d.ts +80 -50
- package/js/src/woo.js +1281 -894
- package/js/src/woofipro.d.ts +2 -4
- package/js/src/woofipro.js +2 -2
- package/package.json +7 -7
package/dist/cjs/ccxt.js
CHANGED
|
@@ -68,6 +68,7 @@ var digifinex = require('./src/digifinex.js');
|
|
|
68
68
|
var ellipx = require('./src/ellipx.js');
|
|
69
69
|
var exmo = require('./src/exmo.js');
|
|
70
70
|
var fmfwio = require('./src/fmfwio.js');
|
|
71
|
+
var foxbit = require('./src/foxbit.js');
|
|
71
72
|
var gate = require('./src/gate.js');
|
|
72
73
|
var gateio = require('./src/gateio.js');
|
|
73
74
|
var gemini = require('./src/gemini.js');
|
|
@@ -193,7 +194,7 @@ var xt$1 = require('./src/pro/xt.js');
|
|
|
193
194
|
|
|
194
195
|
//-----------------------------------------------------------------------------
|
|
195
196
|
// this is updated by vss.js when building
|
|
196
|
-
const version = '4.4.
|
|
197
|
+
const version = '4.4.96';
|
|
197
198
|
Exchange["default"].ccxtVersion = version;
|
|
198
199
|
const exchanges = {
|
|
199
200
|
'alpaca': alpaca,
|
|
@@ -252,6 +253,7 @@ const exchanges = {
|
|
|
252
253
|
'ellipx': ellipx,
|
|
253
254
|
'exmo': exmo,
|
|
254
255
|
'fmfwio': fmfwio,
|
|
256
|
+
'foxbit': foxbit,
|
|
255
257
|
'gate': gate,
|
|
256
258
|
'gateio': gateio,
|
|
257
259
|
'gemini': gemini,
|
|
@@ -483,6 +485,7 @@ exports.digifinex = digifinex;
|
|
|
483
485
|
exports.ellipx = ellipx;
|
|
484
486
|
exports.exmo = exmo;
|
|
485
487
|
exports.fmfwio = fmfwio;
|
|
488
|
+
exports.foxbit = foxbit;
|
|
486
489
|
exports.gate = gate;
|
|
487
490
|
exports.gateio = gateio;
|
|
488
491
|
exports.gemini = gemini;
|
package/dist/cjs/src/apex.js
CHANGED
|
@@ -1537,7 +1537,7 @@ class apex extends apex$1 {
|
|
|
1537
1537
|
}
|
|
1538
1538
|
const response = await this.privatePostV3DeleteOpenOrders(this.extend(request, params));
|
|
1539
1539
|
const data = this.safeDict(response, 'data', {});
|
|
1540
|
-
return data;
|
|
1540
|
+
return [this.parseOrder(data, market)];
|
|
1541
1541
|
}
|
|
1542
1542
|
/**
|
|
1543
1543
|
* @method
|
|
@@ -1563,7 +1563,7 @@ class apex extends apex$1 {
|
|
|
1563
1563
|
response = await this.privatePostV3DeleteOrder(this.extend(request, params));
|
|
1564
1564
|
}
|
|
1565
1565
|
const data = this.safeDict(response, 'data', {});
|
|
1566
|
-
return data;
|
|
1566
|
+
return this.safeOrder(data);
|
|
1567
1567
|
}
|
|
1568
1568
|
/**
|
|
1569
1569
|
* @method
|
package/dist/cjs/src/ascendex.js
CHANGED
|
@@ -2540,9 +2540,9 @@ class ascendex extends ascendex$1 {
|
|
|
2540
2540
|
// }
|
|
2541
2541
|
// }
|
|
2542
2542
|
//
|
|
2543
|
-
return this.safeOrder({
|
|
2544
|
-
|
|
2545
|
-
|
|
2543
|
+
return [this.safeOrder({
|
|
2544
|
+
'info': response,
|
|
2545
|
+
})];
|
|
2546
2546
|
}
|
|
2547
2547
|
parseDepositAddress(depositAddress, currency = undefined) {
|
|
2548
2548
|
//
|
|
@@ -74,6 +74,7 @@ class Exchange {
|
|
|
74
74
|
'chrome100': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.75 Safari/537.36',
|
|
75
75
|
};
|
|
76
76
|
this.headers = {};
|
|
77
|
+
this.returnResponseHeaders = false;
|
|
77
78
|
this.origin = '*'; // CORS origin
|
|
78
79
|
this.MAX_VALUE = Number.MAX_VALUE;
|
|
79
80
|
//
|
|
@@ -726,6 +727,9 @@ class Exchange {
|
|
|
726
727
|
if (!skipFurtherErrorHandling) {
|
|
727
728
|
this.handleHttpStatusCode(response.status, response.statusText, url, method, responseBody);
|
|
728
729
|
}
|
|
730
|
+
if (json && !Array.isArray(json) && this.returnResponseHeaders) {
|
|
731
|
+
json['responseHeaders'] = responseHeaders;
|
|
732
|
+
}
|
|
729
733
|
return json || responseBody;
|
|
730
734
|
});
|
|
731
735
|
}
|
|
@@ -2374,7 +2378,7 @@ class Exchange {
|
|
|
2374
2378
|
// keep this in mind:
|
|
2375
2379
|
// in JS: 1 == 1.0 is true; 1 === 1.0 is true
|
|
2376
2380
|
// in Python: 1 == 1.0 is true
|
|
2377
|
-
// in PHP 1 == 1.0 is true, but 1 === 1.0 is false
|
|
2381
|
+
// in PHP 1 == 1.0 is true, but 1 === 1.0 is false.
|
|
2378
2382
|
if (stringVersion.indexOf('.') >= 0) {
|
|
2379
2383
|
return parseFloat(stringVersion);
|
|
2380
2384
|
}
|
|
@@ -3478,7 +3482,7 @@ class Exchange {
|
|
|
3478
3482
|
for (let i = 0; i < fees.length; i++) {
|
|
3479
3483
|
const fee = fees[i];
|
|
3480
3484
|
const code = this.safeString(fee, 'currency');
|
|
3481
|
-
const feeCurrencyCode = code !== undefined ? code : i.toString();
|
|
3485
|
+
const feeCurrencyCode = (code !== undefined) ? code : i.toString();
|
|
3482
3486
|
if (feeCurrencyCode !== undefined) {
|
|
3483
3487
|
const rate = this.safeString(fee, 'rate');
|
|
3484
3488
|
const cost = this.safeString(fee, 'cost');
|
|
@@ -5514,10 +5518,10 @@ class Exchange {
|
|
|
5514
5518
|
*/
|
|
5515
5519
|
throw new errors.NotSupported(this.id + ' fetchDepositsWithdrawals() is not supported yet');
|
|
5516
5520
|
}
|
|
5517
|
-
async fetchDeposits(
|
|
5521
|
+
async fetchDeposits(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
5518
5522
|
throw new errors.NotSupported(this.id + ' fetchDeposits() is not supported yet');
|
|
5519
5523
|
}
|
|
5520
|
-
async fetchWithdrawals(
|
|
5524
|
+
async fetchWithdrawals(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
5521
5525
|
throw new errors.NotSupported(this.id + ' fetchWithdrawals() is not supported yet');
|
|
5522
5526
|
}
|
|
5523
5527
|
async fetchDepositsWs(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
@@ -13,13 +13,13 @@ function Future() {
|
|
|
13
13
|
});
|
|
14
14
|
p.resolve = function _resolve() {
|
|
15
15
|
// eslint-disable-next-line prefer-rest-params
|
|
16
|
-
|
|
16
|
+
queueMicrotask(() => {
|
|
17
17
|
resolve.apply(this, arguments);
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
20
|
p.reject = function _reject() {
|
|
21
21
|
// eslint-disable-next-line prefer-rest-params
|
|
22
|
-
|
|
22
|
+
queueMicrotask(() => {
|
|
23
23
|
reject.apply(this, arguments);
|
|
24
24
|
});
|
|
25
25
|
};
|
package/dist/cjs/src/bingx.js
CHANGED
|
@@ -112,6 +112,7 @@ class bingx extends bingx$1 {
|
|
|
112
112
|
'account': 'https://open-api.{hostname}/openApi',
|
|
113
113
|
'copyTrading': 'https://open-api.{hostname}/openApi',
|
|
114
114
|
'cswap': 'https://open-api.{hostname}/openApi',
|
|
115
|
+
'api': 'https://open-api.{hostname}/openApi',
|
|
115
116
|
},
|
|
116
117
|
'test': {
|
|
117
118
|
'swap': 'https://open-api-vst.{hostname}/openApi', // only swap is really "test" but since the API keys are the same, we want to keep all the functionalities when the user enables the sandboxmode
|
|
@@ -441,6 +442,7 @@ class bingx extends bingx$1 {
|
|
|
441
442
|
'private': {
|
|
442
443
|
'get': {
|
|
443
444
|
'asset/transfer': 1,
|
|
445
|
+
'asset/transferRecord': 5,
|
|
444
446
|
'capital/deposit/hisrec': 1,
|
|
445
447
|
'capital/withdraw/history': 1,
|
|
446
448
|
},
|
|
@@ -449,6 +451,20 @@ class bingx extends bingx$1 {
|
|
|
449
451
|
},
|
|
450
452
|
},
|
|
451
453
|
},
|
|
454
|
+
'asset': {
|
|
455
|
+
'v1': {
|
|
456
|
+
'private': {
|
|
457
|
+
'post': {
|
|
458
|
+
'transfer': 5,
|
|
459
|
+
},
|
|
460
|
+
},
|
|
461
|
+
'public': {
|
|
462
|
+
'get': {
|
|
463
|
+
'transfer/supportCoins': 5,
|
|
464
|
+
},
|
|
465
|
+
},
|
|
466
|
+
},
|
|
467
|
+
},
|
|
452
468
|
},
|
|
453
469
|
},
|
|
454
470
|
'timeframes': {
|
|
@@ -513,16 +529,19 @@ class bingx extends bingx$1 {
|
|
|
513
529
|
'options': {
|
|
514
530
|
'defaultType': 'spot',
|
|
515
531
|
'accountsByType': {
|
|
516
|
-
'funding': '
|
|
517
|
-
'spot': '
|
|
518
|
-
'
|
|
519
|
-
'
|
|
532
|
+
'funding': 'fund',
|
|
533
|
+
'spot': 'spot',
|
|
534
|
+
'future': 'stdFutures',
|
|
535
|
+
'swap': 'USDTMPerp',
|
|
536
|
+
'linear': 'USDTMPerp',
|
|
537
|
+
'inverse': 'coinMPerp',
|
|
520
538
|
},
|
|
521
539
|
'accountsById': {
|
|
522
|
-
'
|
|
523
|
-
'
|
|
524
|
-
'
|
|
525
|
-
'
|
|
540
|
+
'fund': 'funding',
|
|
541
|
+
'spot': 'spot',
|
|
542
|
+
'stdFutures': 'future',
|
|
543
|
+
'USDTMPerp': 'linear',
|
|
544
|
+
'coinMPerp': 'inverse',
|
|
526
545
|
},
|
|
527
546
|
'recvWindow': 5 * 1000,
|
|
528
547
|
'broker': 'CCXT',
|
|
@@ -766,6 +785,10 @@ class bingx extends bingx$1 {
|
|
|
766
785
|
'min': this.safeNumber(rawNetwork, 'withdrawMin'),
|
|
767
786
|
'max': this.safeNumber(rawNetwork, 'withdrawMax'),
|
|
768
787
|
},
|
|
788
|
+
'deposit': {
|
|
789
|
+
'min': this.safeNumber(rawNetwork, 'depositMin'),
|
|
790
|
+
'max': undefined,
|
|
791
|
+
},
|
|
769
792
|
};
|
|
770
793
|
const precision = this.parseNumber(this.parsePrecision(this.safeString(rawNetwork, 'withdrawPrecision')));
|
|
771
794
|
networks[networkCode] = {
|
|
@@ -780,20 +803,40 @@ class bingx extends bingx$1 {
|
|
|
780
803
|
'limits': limits,
|
|
781
804
|
};
|
|
782
805
|
}
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
806
|
+
if (!(code in result)) { // the exchange could return the same currency with different networks
|
|
807
|
+
result[code] = {
|
|
808
|
+
'info': entry,
|
|
809
|
+
'code': code,
|
|
810
|
+
'id': currencyId,
|
|
811
|
+
'precision': undefined,
|
|
812
|
+
'name': name,
|
|
813
|
+
'active': undefined,
|
|
814
|
+
'deposit': undefined,
|
|
815
|
+
'withdraw': undefined,
|
|
816
|
+
'networks': networks,
|
|
817
|
+
'fee': undefined,
|
|
818
|
+
'limits': undefined,
|
|
819
|
+
'type': 'crypto', // only cryptos now
|
|
820
|
+
};
|
|
821
|
+
}
|
|
822
|
+
else {
|
|
823
|
+
const existing = result[code];
|
|
824
|
+
const existingNetworks = this.safeDict(existing, 'networks', {});
|
|
825
|
+
const newNetworkCodes = Object.keys(networks);
|
|
826
|
+
for (let j = 0; j < newNetworkCodes.length; j++) {
|
|
827
|
+
const newNetworkCode = newNetworkCodes[j];
|
|
828
|
+
if (!(newNetworkCode in existingNetworks)) {
|
|
829
|
+
existingNetworks[newNetworkCode] = networks[newNetworkCode];
|
|
830
|
+
}
|
|
831
|
+
}
|
|
832
|
+
result[code]['networks'] = existingNetworks;
|
|
833
|
+
}
|
|
834
|
+
}
|
|
835
|
+
const codes = Object.keys(result);
|
|
836
|
+
for (let i = 0; i < codes.length; i++) {
|
|
837
|
+
const code = codes[i];
|
|
838
|
+
const currency = result[code];
|
|
839
|
+
result[code] = this.safeCurrencyStructure(currency);
|
|
797
840
|
}
|
|
798
841
|
return result;
|
|
799
842
|
}
|
|
@@ -4859,11 +4902,11 @@ class bingx extends bingx$1 {
|
|
|
4859
4902
|
* @method
|
|
4860
4903
|
* @name bingx#transfer
|
|
4861
4904
|
* @description transfer currency internally between wallets on the same account
|
|
4862
|
-
* @see https://bingx-api.github.io/docs/#/en-us/common/account-api.html#Asset%20Transfer
|
|
4905
|
+
* @see https://bingx-api.github.io/docs/#/en-us/common/account-api.html#Asset%20Transfer%20New
|
|
4863
4906
|
* @param {string} code unified currency code
|
|
4864
4907
|
* @param {float} amount amount to transfer
|
|
4865
4908
|
* @param {string} fromAccount account to transfer from (spot, swap, futures, or funding)
|
|
4866
|
-
* @param {string} toAccount account to transfer to (spot, swap,
|
|
4909
|
+
* @param {string} toAccount account to transfer to (spot, swap (linear or inverse), future, or funding)
|
|
4867
4910
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4868
4911
|
* @returns {object} a [transfer structure]{@link https://docs.ccxt.com/#/?id=transfer-structure}
|
|
4869
4912
|
*/
|
|
@@ -4871,14 +4914,33 @@ class bingx extends bingx$1 {
|
|
|
4871
4914
|
await this.loadMarkets();
|
|
4872
4915
|
const currency = this.currency(code);
|
|
4873
4916
|
const accountsByType = this.safeDict(this.options, 'accountsByType', {});
|
|
4874
|
-
|
|
4875
|
-
|
|
4917
|
+
let subType = undefined;
|
|
4918
|
+
[subType, params] = this.handleSubTypeAndParams('transfer', undefined, params);
|
|
4919
|
+
let fromId = this.safeString(accountsByType, fromAccount, fromAccount);
|
|
4920
|
+
let toId = this.safeString(accountsByType, toAccount, toAccount);
|
|
4921
|
+
if (fromId === 'swap') {
|
|
4922
|
+
if (subType === 'inverse') {
|
|
4923
|
+
fromId = 'coinMPerp';
|
|
4924
|
+
}
|
|
4925
|
+
else {
|
|
4926
|
+
fromId = 'USDTMPerp';
|
|
4927
|
+
}
|
|
4928
|
+
}
|
|
4929
|
+
if (toId === 'swap') {
|
|
4930
|
+
if (subType === 'inverse') {
|
|
4931
|
+
toId = 'coinMPerp';
|
|
4932
|
+
}
|
|
4933
|
+
else {
|
|
4934
|
+
toId = 'USDTMPerp';
|
|
4935
|
+
}
|
|
4936
|
+
}
|
|
4876
4937
|
const request = {
|
|
4938
|
+
'fromAccount': fromId,
|
|
4939
|
+
'toAccount': toId,
|
|
4877
4940
|
'asset': currency['id'],
|
|
4878
4941
|
'amount': this.currencyToPrecision(code, amount),
|
|
4879
|
-
'type': fromId + '_' + toId,
|
|
4880
4942
|
};
|
|
4881
|
-
const response = await this.
|
|
4943
|
+
const response = await this.apiAssetV1PrivatePostTransfer(this.extend(request, params));
|
|
4882
4944
|
//
|
|
4883
4945
|
// {
|
|
4884
4946
|
// "tranId": 1933130865269936128,
|
|
@@ -4887,7 +4949,7 @@ class bingx extends bingx$1 {
|
|
|
4887
4949
|
//
|
|
4888
4950
|
return {
|
|
4889
4951
|
'info': response,
|
|
4890
|
-
'id': this.safeString(response, '
|
|
4952
|
+
'id': this.safeString(response, 'transferId'),
|
|
4891
4953
|
'timestamp': undefined,
|
|
4892
4954
|
'datetime': undefined,
|
|
4893
4955
|
'currency': code,
|
|
@@ -4901,18 +4963,19 @@ class bingx extends bingx$1 {
|
|
|
4901
4963
|
* @method
|
|
4902
4964
|
* @name bingx#fetchTransfers
|
|
4903
4965
|
* @description fetch a history of internal transfers made on an account
|
|
4904
|
-
* @see https://bingx-api.github.io/docs/#/
|
|
4966
|
+
* @see https://bingx-api.github.io/docs/#/en-us/common/account-api.html#Asset%20transfer%20records%20new
|
|
4905
4967
|
* @param {string} [code] unified currency code of the currency transferred
|
|
4906
4968
|
* @param {int} [since] the earliest time in ms to fetch transfers for
|
|
4907
4969
|
* @param {int} [limit] the maximum number of transfers structures to retrieve (default 10, max 100)
|
|
4908
4970
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4909
|
-
* @param {string} params.fromAccount (mandatory) transfer from (spot, swap,
|
|
4910
|
-
* @param {string} params.toAccount (mandatory) transfer to (spot, swap,
|
|
4971
|
+
* @param {string} params.fromAccount (mandatory) transfer from (spot, swap (linear or inverse), future, or funding)
|
|
4972
|
+
* @param {string} params.toAccount (mandatory) transfer to (spot, swap(linear or inverse), future, or funding)
|
|
4911
4973
|
* @param {boolean} [params.paginate] whether to paginate the results (default false)
|
|
4912
4974
|
* @returns {object[]} a list of [transfer structures]{@link https://docs.ccxt.com/#/?id=transfer-structure}
|
|
4913
4975
|
*/
|
|
4914
4976
|
async fetchTransfers(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
4915
4977
|
await this.loadMarkets();
|
|
4978
|
+
let request = {};
|
|
4916
4979
|
let currency = undefined;
|
|
4917
4980
|
if (code !== undefined) {
|
|
4918
4981
|
currency = this.currency(code);
|
|
@@ -4923,7 +4986,13 @@ class bingx extends bingx$1 {
|
|
|
4923
4986
|
const fromId = this.safeString(accountsByType, fromAccount, fromAccount);
|
|
4924
4987
|
const toId = this.safeString(accountsByType, toAccount, toAccount);
|
|
4925
4988
|
if (fromId === undefined || toId === undefined) {
|
|
4926
|
-
throw new errors.ExchangeError(this.id + ' fromAccount & toAccount
|
|
4989
|
+
throw new errors.ExchangeError(this.id + ' fromAccount & toAccount parameters are required');
|
|
4990
|
+
}
|
|
4991
|
+
if (fromAccount !== undefined) {
|
|
4992
|
+
request['fromAccount'] = fromId;
|
|
4993
|
+
}
|
|
4994
|
+
if (toAccount !== undefined) {
|
|
4995
|
+
request['toAccount'] = toId;
|
|
4927
4996
|
}
|
|
4928
4997
|
params = this.omit(params, ['fromAccount', 'toAccount']);
|
|
4929
4998
|
const maxLimit = 100;
|
|
@@ -4932,29 +5001,27 @@ class bingx extends bingx$1 {
|
|
|
4932
5001
|
if (paginate) {
|
|
4933
5002
|
return await this.fetchPaginatedCallDynamic('fetchTransfers', undefined, since, limit, params, maxLimit);
|
|
4934
5003
|
}
|
|
4935
|
-
let request = {
|
|
4936
|
-
'type': fromId + '_' + toId,
|
|
4937
|
-
};
|
|
4938
5004
|
if (since !== undefined) {
|
|
4939
5005
|
request['startTime'] = since;
|
|
4940
5006
|
}
|
|
4941
5007
|
if (limit !== undefined) {
|
|
4942
|
-
request['
|
|
5008
|
+
request['pageSize'] = limit;
|
|
4943
5009
|
}
|
|
4944
5010
|
[request, params] = this.handleUntilOption('endTime', request, params);
|
|
4945
|
-
const response = await this.
|
|
5011
|
+
const response = await this.apiV3PrivateGetAssetTransferRecord(this.extend(request, params));
|
|
4946
5012
|
//
|
|
4947
5013
|
// {
|
|
4948
|
-
// "total":
|
|
5014
|
+
// "total": 2,
|
|
4949
5015
|
// "rows": [
|
|
4950
5016
|
// {
|
|
4951
|
-
// "asset": "
|
|
4952
|
-
// "amount": "
|
|
4953
|
-
// "type": "FUND_SFUTURES",
|
|
5017
|
+
// "asset": "LTC",
|
|
5018
|
+
// "amount": "0.05000000000000000000",
|
|
4954
5019
|
// "status": "CONFIRMED",
|
|
4955
|
-
// "
|
|
4956
|
-
// "timestamp":
|
|
4957
|
-
//
|
|
5020
|
+
// "transferId": "1051461075661819338791",
|
|
5021
|
+
// "timestamp": 1752202092000,
|
|
5022
|
+
// "fromAccount": "spot",
|
|
5023
|
+
// "toAccount": "USDTMPerp"
|
|
5024
|
+
// }
|
|
4958
5025
|
// ]
|
|
4959
5026
|
// }
|
|
4960
5027
|
//
|
|
@@ -4962,15 +5029,14 @@ class bingx extends bingx$1 {
|
|
|
4962
5029
|
return this.parseTransfers(rows, currency, since, limit);
|
|
4963
5030
|
}
|
|
4964
5031
|
parseTransfer(transfer, currency = undefined) {
|
|
4965
|
-
const tranId = this.safeString(transfer, '
|
|
5032
|
+
const tranId = this.safeString(transfer, 'transferId');
|
|
4966
5033
|
const timestamp = this.safeInteger(transfer, 'timestamp');
|
|
4967
|
-
const
|
|
5034
|
+
const currencyId = this.safeString(transfer, 'asset');
|
|
5035
|
+
const currencyCode = this.safeCurrencyCode(currencyId, currency);
|
|
4968
5036
|
const status = this.safeString(transfer, 'status');
|
|
4969
5037
|
const accountsById = this.safeDict(this.options, 'accountsById', {});
|
|
4970
|
-
const
|
|
4971
|
-
const
|
|
4972
|
-
const fromId = this.safeString(typeIdSplit, 0);
|
|
4973
|
-
const toId = this.safeString(typeIdSplit, 1);
|
|
5038
|
+
const fromId = this.safeString(transfer, 'fromAccount');
|
|
5039
|
+
const toId = this.safeString(transfer, 'toAccount');
|
|
4974
5040
|
const fromAccount = this.safeString(accountsById, fromId, fromId);
|
|
4975
5041
|
const toAccount = this.safeString(accountsById, toId, toId);
|
|
4976
5042
|
return {
|
|
@@ -5716,37 +5782,13 @@ class bingx extends bingx$1 {
|
|
|
5716
5782
|
}
|
|
5717
5783
|
parseDepositWithdrawFee(fee, currency = undefined) {
|
|
5718
5784
|
//
|
|
5719
|
-
//
|
|
5720
|
-
// "coin": "BTC",
|
|
5721
|
-
// "name": "BTC",
|
|
5722
|
-
// "networkList": [
|
|
5723
|
-
// {
|
|
5724
|
-
// "name": "BTC",
|
|
5725
|
-
// "network": "BTC",
|
|
5726
|
-
// "isDefault": true,
|
|
5727
|
-
// "minConfirm": "2",
|
|
5728
|
-
// "withdrawEnable": true,
|
|
5729
|
-
// "withdrawFee": "0.00035",
|
|
5730
|
-
// "withdrawMax": "1.62842",
|
|
5731
|
-
// "withdrawMin": "0.0005"
|
|
5732
|
-
// },
|
|
5733
|
-
// {
|
|
5734
|
-
// "name": "BTC",
|
|
5735
|
-
// "network": "BEP20",
|
|
5736
|
-
// "isDefault": false,
|
|
5737
|
-
// "minConfirm": "15",
|
|
5738
|
-
// "withdrawEnable": true,
|
|
5739
|
-
// "withdrawFee": "0.00001",
|
|
5740
|
-
// "withdrawMax": "1.62734",
|
|
5741
|
-
// "withdrawMin": "0.0001"
|
|
5742
|
-
// }
|
|
5743
|
-
// ]
|
|
5744
|
-
// }
|
|
5785
|
+
// currencie structure
|
|
5745
5786
|
//
|
|
5746
|
-
const
|
|
5747
|
-
const
|
|
5787
|
+
const networks = this.safeDict(fee, 'networks', {});
|
|
5788
|
+
const networkCodes = Object.keys(networks);
|
|
5789
|
+
const networksLength = networkCodes.length;
|
|
5748
5790
|
const result = {
|
|
5749
|
-
'info':
|
|
5791
|
+
'info': networks,
|
|
5750
5792
|
'withdraw': {
|
|
5751
5793
|
'fee': undefined,
|
|
5752
5794
|
'percentage': undefined,
|
|
@@ -5757,18 +5799,15 @@ class bingx extends bingx$1 {
|
|
|
5757
5799
|
},
|
|
5758
5800
|
'networks': {},
|
|
5759
5801
|
};
|
|
5760
|
-
if (
|
|
5761
|
-
for (let i = 0; i <
|
|
5762
|
-
const
|
|
5763
|
-
const
|
|
5764
|
-
const isDefault = this.safeBool(network, 'isDefault');
|
|
5765
|
-
const currencyCode = this.safeString(currency, 'code');
|
|
5766
|
-
const networkCode = this.networkIdToCode(networkId, currencyCode);
|
|
5802
|
+
if (networksLength !== 0) {
|
|
5803
|
+
for (let i = 0; i < networksLength; i++) {
|
|
5804
|
+
const networkCode = networkCodes[i];
|
|
5805
|
+
const network = networks[networkCode];
|
|
5767
5806
|
result['networks'][networkCode] = {
|
|
5768
5807
|
'deposit': { 'fee': undefined, 'percentage': undefined },
|
|
5769
|
-
'withdraw': { 'fee': this.safeNumber(network, '
|
|
5808
|
+
'withdraw': { 'fee': this.safeNumber(network, 'fee'), 'percentage': false },
|
|
5770
5809
|
};
|
|
5771
|
-
if (
|
|
5810
|
+
if (networksLength === 1) {
|
|
5772
5811
|
result['withdraw']['fee'] = this.safeNumber(network, 'withdrawFee');
|
|
5773
5812
|
result['withdraw']['percentage'] = false;
|
|
5774
5813
|
}
|
|
@@ -5787,9 +5826,17 @@ class bingx extends bingx$1 {
|
|
|
5787
5826
|
*/
|
|
5788
5827
|
async fetchDepositWithdrawFees(codes = undefined, params = {}) {
|
|
5789
5828
|
await this.loadMarkets();
|
|
5790
|
-
const response = await this.
|
|
5791
|
-
const
|
|
5792
|
-
|
|
5829
|
+
const response = await this.fetchCurrencies(params);
|
|
5830
|
+
const depositWithdrawFees = {};
|
|
5831
|
+
const responseCodes = Object.keys(response);
|
|
5832
|
+
for (let i = 0; i < responseCodes.length; i++) {
|
|
5833
|
+
const code = responseCodes[i];
|
|
5834
|
+
if ((codes === undefined) || (this.inArray(code, codes))) {
|
|
5835
|
+
const entry = response[code];
|
|
5836
|
+
depositWithdrawFees[code] = this.parseDepositWithdrawFee(entry);
|
|
5837
|
+
}
|
|
5838
|
+
}
|
|
5839
|
+
return depositWithdrawFees;
|
|
5793
5840
|
}
|
|
5794
5841
|
/**
|
|
5795
5842
|
* @method
|
|
@@ -6530,8 +6577,15 @@ class bingx extends bingx$1 {
|
|
|
6530
6577
|
}
|
|
6531
6578
|
let url = this.implodeHostname(this.urls['api'][type]);
|
|
6532
6579
|
path = this.implodeParams(path, params);
|
|
6533
|
-
|
|
6534
|
-
|
|
6580
|
+
const versionIsTransfer = (version === 'transfer');
|
|
6581
|
+
const versionIsAsset = (version === 'asset');
|
|
6582
|
+
if (versionIsTransfer || versionIsAsset) {
|
|
6583
|
+
if (versionIsTransfer) {
|
|
6584
|
+
type = 'account/transfer';
|
|
6585
|
+
}
|
|
6586
|
+
else {
|
|
6587
|
+
type = 'api/asset';
|
|
6588
|
+
}
|
|
6535
6589
|
version = section[2];
|
|
6536
6590
|
access = section[3];
|
|
6537
6591
|
}
|