ccxt 4.5.6 → 4.5.7
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 +3 -3
- package/dist/ccxt.browser.min.js +3 -3
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/apex.js +2 -2
- package/dist/cjs/src/binance.js +3 -0
- package/dist/cjs/src/bitbank.js +1 -0
- package/dist/cjs/src/bitbns.js +1 -0
- package/dist/cjs/src/bitflyer.js +1 -0
- package/dist/cjs/src/bithumb.js +1 -0
- package/dist/cjs/src/bitso.js +1 -0
- package/dist/cjs/src/bitvavo.js +26 -40
- package/dist/cjs/src/blockchaincom.js +1 -0
- package/dist/cjs/src/btcalpha.js +1 -0
- package/dist/cjs/src/btcbox.js +1 -0
- package/dist/cjs/src/btcmarkets.js +1 -0
- package/dist/cjs/src/btcturk.js +1 -0
- package/dist/cjs/src/deribit.js +3 -2
- package/dist/cjs/src/digifinex.js +1 -1
- package/dist/cjs/src/gate.js +8 -12
- package/dist/cjs/src/gemini.js +3 -3
- package/dist/cjs/src/htx.js +11 -1
- package/dist/cjs/src/independentreserve.js +1 -0
- package/dist/cjs/src/indodax.js +17 -6
- package/dist/cjs/src/kraken.js +25 -6
- package/dist/cjs/src/krakenfutures.js +1 -0
- package/dist/cjs/src/mercado.js +1 -0
- package/dist/cjs/src/mexc.js +80 -36
- package/dist/cjs/src/novadax.js +1 -0
- package/dist/cjs/src/oceanex.js +1 -0
- package/dist/cjs/src/okx.js +18 -5
- package/dist/cjs/src/pro/apex.js +7 -4
- package/dist/cjs/src/pro/backpack.js +6 -4
- package/dist/cjs/src/pro/bingx.js +206 -220
- package/dist/cjs/src/pro/htx.js +1 -1
- package/dist/cjs/src/upbit.js +1 -0
- package/dist/cjs/src/wavesexchange.js +1 -0
- package/dist/cjs/src/yobit.js +1 -0
- package/dist/cjs/src/zaif.js +1 -0
- package/dist/cjs/src/zonda.js +1 -0
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/mexc.d.ts +1 -0
- package/js/src/apex.js +2 -2
- package/js/src/binance.js +3 -0
- package/js/src/bitbank.js +1 -0
- package/js/src/bitbns.js +1 -0
- package/js/src/bitflyer.js +1 -0
- package/js/src/bithumb.js +1 -0
- package/js/src/bitso.js +1 -0
- package/js/src/bitvavo.d.ts +0 -2
- package/js/src/bitvavo.js +27 -41
- package/js/src/blockchaincom.js +1 -0
- package/js/src/btcalpha.js +1 -0
- package/js/src/btcbox.js +1 -0
- package/js/src/btcmarkets.js +1 -0
- package/js/src/btcturk.js +1 -0
- package/js/src/deribit.js +3 -2
- package/js/src/digifinex.js +1 -1
- package/js/src/gate.d.ts +2 -2
- package/js/src/gate.js +8 -12
- package/js/src/gemini.js +3 -3
- package/js/src/htx.js +11 -1
- package/js/src/independentreserve.js +1 -0
- package/js/src/indodax.js +17 -6
- package/js/src/kraken.d.ts +1 -1
- package/js/src/kraken.js +25 -6
- package/js/src/krakenfutures.js +1 -0
- package/js/src/mercado.js +1 -0
- package/js/src/mexc.d.ts +4 -1
- package/js/src/mexc.js +80 -36
- package/js/src/novadax.js +1 -0
- package/js/src/oceanex.js +1 -0
- package/js/src/okx.js +18 -5
- package/js/src/pro/apex.js +7 -4
- package/js/src/pro/backpack.js +6 -4
- package/js/src/pro/bingx.d.ts +53 -33
- package/js/src/pro/bingx.js +207 -221
- package/js/src/pro/htx.js +1 -1
- package/js/src/upbit.js +1 -0
- package/js/src/wavesexchange.js +1 -0
- package/js/src/yobit.js +1 -0
- package/js/src/zaif.js +1 -0
- package/js/src/zonda.js +1 -0
- package/package.json +1 -1
package/js/src/binance.js
CHANGED
|
@@ -12062,6 +12062,9 @@ export default class binance extends Exchange {
|
|
|
12062
12062
|
}
|
|
12063
12063
|
else if ((api === 'private') || (api === 'eapiPrivate') || (api === 'sapi' && path !== 'system/status') || (api === 'sapiV2') || (api === 'sapiV3') || (api === 'sapiV4') || (api === 'dapiPrivate') || (api === 'dapiPrivateV2') || (api === 'fapiPrivate') || (api === 'fapiPrivateV2') || (api === 'fapiPrivateV3') || (api === 'papi' && path !== 'ping')) {
|
|
12064
12064
|
this.checkRequiredCredentials();
|
|
12065
|
+
if ((url.indexOf('testnet.binancefuture.com') > -1) && this.isSandboxModeEnabled && (!this.safeBool(this.options, 'disableFuturesSandboxWarning'))) {
|
|
12066
|
+
throw new NotSupported(this.id + ' testnet/sandbox mode is not supported for futures anymore, please check the deprecation announcement https://t.me/ccxt_announcements/92 and consider using the demo trading instead.');
|
|
12067
|
+
}
|
|
12065
12068
|
if (method === 'POST' && ((path === 'order') || (path === 'sor/order'))) {
|
|
12066
12069
|
// inject in implicit API calls
|
|
12067
12070
|
const newClientOrderId = this.safeString(params, 'newClientOrderId');
|
package/js/src/bitbank.js
CHANGED
|
@@ -43,6 +43,7 @@ export default class bitbank extends Exchange {
|
|
|
43
43
|
'fetchBorrowRatesPerSymbol': false,
|
|
44
44
|
'fetchCrossBorrowRate': false,
|
|
45
45
|
'fetchCrossBorrowRates': false,
|
|
46
|
+
'fetchCurrencies': false,
|
|
46
47
|
'fetchDepositAddress': true,
|
|
47
48
|
'fetchDepositAddresses': false,
|
|
48
49
|
'fetchDepositAddressesByNetwork': false,
|
package/js/src/bitbns.js
CHANGED
|
@@ -32,6 +32,7 @@ export default class bitbns extends Exchange {
|
|
|
32
32
|
'createStopOrder': true,
|
|
33
33
|
'createTriggerOrder': true,
|
|
34
34
|
'fetchBalance': true,
|
|
35
|
+
'fechCurrencies': false,
|
|
35
36
|
'fetchDepositAddress': true,
|
|
36
37
|
'fetchDepositAddresses': false,
|
|
37
38
|
'fetchDepositAddressesByNetwork': false,
|
package/js/src/bitflyer.js
CHANGED
package/js/src/bithumb.js
CHANGED
|
@@ -45,6 +45,7 @@ export default class bithumb extends Exchange {
|
|
|
45
45
|
'fetchBorrowRatesPerSymbol': false,
|
|
46
46
|
'fetchCrossBorrowRate': false,
|
|
47
47
|
'fetchCrossBorrowRates': false,
|
|
48
|
+
'fetchCurrencies': false,
|
|
48
49
|
'fetchFundingHistory': false,
|
|
49
50
|
'fetchFundingInterval': false,
|
|
50
51
|
'fetchFundingIntervals': false,
|
package/js/src/bitso.js
CHANGED
|
@@ -48,6 +48,7 @@ export default class bitso extends Exchange {
|
|
|
48
48
|
'fetchBorrowRatesPerSymbol': false,
|
|
49
49
|
'fetchCrossBorrowRate': false,
|
|
50
50
|
'fetchCrossBorrowRates': false,
|
|
51
|
+
'fetchCurrencies': false,
|
|
51
52
|
'fetchDeposit': true,
|
|
52
53
|
'fetchDepositAddress': true,
|
|
53
54
|
'fetchDepositAddresses': false,
|
package/js/src/bitvavo.d.ts
CHANGED
|
@@ -6,8 +6,6 @@ import type { Balances, Currencies, Currency, Dict, Int, Market, Num, OHLCV, Ord
|
|
|
6
6
|
*/
|
|
7
7
|
export default class bitvavo extends Exchange {
|
|
8
8
|
describe(): any;
|
|
9
|
-
amountToPrecision(symbol: any, amount: any): string;
|
|
10
|
-
priceToPrecision(symbol: any, price: any): string;
|
|
11
9
|
/**
|
|
12
10
|
* @method
|
|
13
11
|
* @name bitvavo#fetchTime
|
package/js/src/bitvavo.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// ----------------------------------------------------------------------------
|
|
2
2
|
import Exchange from './abstract/bitvavo.js';
|
|
3
3
|
import { ExchangeError, BadSymbol, AuthenticationError, InsufficientFunds, InvalidOrder, ArgumentsRequired, OrderNotFound, InvalidAddress, BadRequest, RateLimitExceeded, PermissionDenied, ExchangeNotAvailable, AccountSuspended, OnMaintenance } from './base/errors.js';
|
|
4
|
-
import {
|
|
4
|
+
import { TRUNCATE, TICK_SIZE } from './base/functions/number.js';
|
|
5
5
|
import { Precise } from './base/Precise.js';
|
|
6
6
|
import { sha256 } from './static_dependencies/noble-hashes/sha256.js';
|
|
7
7
|
// ----------------------------------------------------------------------------
|
|
@@ -377,26 +377,12 @@ export default class bitvavo extends Exchange {
|
|
|
377
377
|
'operatorId': undefined,
|
|
378
378
|
'fiatCurrencies': ['EUR'], // only fiat atm
|
|
379
379
|
},
|
|
380
|
-
'precisionMode':
|
|
380
|
+
'precisionMode': TICK_SIZE,
|
|
381
381
|
'commonCurrencies': {
|
|
382
382
|
'MIOTA': 'IOTA', // https://github.com/ccxt/ccxt/issues/7487
|
|
383
383
|
},
|
|
384
384
|
});
|
|
385
385
|
}
|
|
386
|
-
amountToPrecision(symbol, amount) {
|
|
387
|
-
// https://docs.bitfinex.com/docs/introduction#amount-precision
|
|
388
|
-
// The amount field allows up to 8 decimals.
|
|
389
|
-
// Anything exceeding this will be rounded to the 8th decimal.
|
|
390
|
-
return this.decimalToPrecision(amount, TRUNCATE, this.markets[symbol]['precision']['amount'], DECIMAL_PLACES);
|
|
391
|
-
}
|
|
392
|
-
priceToPrecision(symbol, price) {
|
|
393
|
-
price = this.decimalToPrecision(price, ROUND, this.markets[symbol]['precision']['price'], this.precisionMode);
|
|
394
|
-
// https://docs.bitfinex.com/docs/introduction#price-precision
|
|
395
|
-
// The precision level of all trading prices is based on significant figures.
|
|
396
|
-
// All pairs on Bitfinex use up to 5 significant digits and up to 8 decimals (e.g. 1.2345, 123.45, 1234.5, 0.00012345).
|
|
397
|
-
// Prices submit with a precision larger than 5 will be cut by the API.
|
|
398
|
-
return this.decimalToPrecision(price, TRUNCATE, 8, DECIMAL_PLACES);
|
|
399
|
-
}
|
|
400
386
|
/**
|
|
401
387
|
* @method
|
|
402
388
|
* @name bitvavo#fetchTime
|
|
@@ -422,24 +408,27 @@ export default class bitvavo extends Exchange {
|
|
|
422
408
|
async fetchMarkets(params = {}) {
|
|
423
409
|
const response = await this.publicGetMarkets(params);
|
|
424
410
|
//
|
|
425
|
-
//
|
|
426
|
-
//
|
|
427
|
-
//
|
|
428
|
-
//
|
|
429
|
-
//
|
|
430
|
-
//
|
|
431
|
-
//
|
|
432
|
-
//
|
|
433
|
-
//
|
|
434
|
-
//
|
|
435
|
-
//
|
|
436
|
-
//
|
|
411
|
+
// {
|
|
412
|
+
// "market": "BTC-EUR",
|
|
413
|
+
// "status": "trading",
|
|
414
|
+
// "base": "BTC",
|
|
415
|
+
// "quote": "EUR",
|
|
416
|
+
// "pricePrecision": "0", // deprecated, this is mostly 0 across other markets too, which is abnormal, so we ignore this.
|
|
417
|
+
// "tickSize": "1.00",
|
|
418
|
+
// "minOrderInBaseAsset": "0.00006100",
|
|
419
|
+
// "minOrderInQuoteAsset": "5.00",
|
|
420
|
+
// "maxOrderInBaseAsset": "1000000000.00000000",
|
|
421
|
+
// "maxOrderInQuoteAsset": "1000000000.00",
|
|
422
|
+
// "quantityDecimals": "8",
|
|
423
|
+
// "notionalDecimals": "2",
|
|
424
|
+
// "maxOpenOrders": "100",
|
|
425
|
+
// "feeCategory": "A",
|
|
426
|
+
// "orderTypes": [ "market", "limit", "stopLoss", "stopLossLimit", "takeProfit", "takeProfitLimit" ]
|
|
427
|
+
// }
|
|
437
428
|
//
|
|
438
429
|
return this.parseMarkets(response);
|
|
439
430
|
}
|
|
440
431
|
parseMarkets(markets) {
|
|
441
|
-
const currencies = this.currencies;
|
|
442
|
-
const currenciesById = this.indexBy(currencies, 'id');
|
|
443
432
|
const result = [];
|
|
444
433
|
const fees = this.fees;
|
|
445
434
|
for (let i = 0; i < markets.length; i++) {
|
|
@@ -450,8 +439,6 @@ export default class bitvavo extends Exchange {
|
|
|
450
439
|
const base = this.safeCurrencyCode(baseId);
|
|
451
440
|
const quote = this.safeCurrencyCode(quoteId);
|
|
452
441
|
const status = this.safeString(market, 'status');
|
|
453
|
-
const baseCurrency = this.safeValue(currenciesById, baseId);
|
|
454
|
-
const basePrecision = this.safeInteger(baseCurrency, 'precision');
|
|
455
442
|
result.push(this.safeMarketStructure({
|
|
456
443
|
'id': id,
|
|
457
444
|
'symbol': base + '/' + quote,
|
|
@@ -479,8 +466,9 @@ export default class bitvavo extends Exchange {
|
|
|
479
466
|
'taker': fees['trading']['taker'],
|
|
480
467
|
'maker': fees['trading']['maker'],
|
|
481
468
|
'precision': {
|
|
482
|
-
'amount': this.
|
|
483
|
-
'price': this.
|
|
469
|
+
'amount': this.parseNumber(this.parsePrecision(this.safeString(market, 'quantityDecimals'))),
|
|
470
|
+
'price': this.safeNumber(market, 'tickSize'),
|
|
471
|
+
'cost': this.parseNumber(this.parsePrecision(this.safeString(market, 'notionalDecimals'))),
|
|
484
472
|
},
|
|
485
473
|
'limits': {
|
|
486
474
|
'leverage': {
|
|
@@ -489,7 +477,7 @@ export default class bitvavo extends Exchange {
|
|
|
489
477
|
},
|
|
490
478
|
'amount': {
|
|
491
479
|
'min': this.safeNumber(market, 'minOrderInBaseAsset'),
|
|
492
|
-
'max':
|
|
480
|
+
'max': this.safeNumber(market, 'maxOrderInBaseAsset'),
|
|
493
481
|
},
|
|
494
482
|
'price': {
|
|
495
483
|
'min': undefined,
|
|
@@ -497,7 +485,7 @@ export default class bitvavo extends Exchange {
|
|
|
497
485
|
},
|
|
498
486
|
'cost': {
|
|
499
487
|
'min': this.safeNumber(market, 'minOrderInQuoteAsset'),
|
|
500
|
-
'max':
|
|
488
|
+
'max': this.safeNumber(market, 'maxOrderInQuoteAsset'),
|
|
501
489
|
},
|
|
502
490
|
},
|
|
503
491
|
'created': undefined,
|
|
@@ -598,7 +586,7 @@ export default class bitvavo extends Exchange {
|
|
|
598
586
|
const withdrawal = this.safeString(currency, 'withdrawalStatus') === 'OK';
|
|
599
587
|
const active = deposit && withdrawal;
|
|
600
588
|
const withdrawFee = this.safeNumber(currency, 'withdrawalFee');
|
|
601
|
-
const precision = this.
|
|
589
|
+
const precision = this.safeString(currency, 'decimals', '8');
|
|
602
590
|
const minWithdraw = this.safeNumber(currency, 'withdrawalMinAmount');
|
|
603
591
|
// btw, absolutely all of them have 1 network atm
|
|
604
592
|
for (let j = 0; j < networksArray.length; j++) {
|
|
@@ -612,7 +600,7 @@ export default class bitvavo extends Exchange {
|
|
|
612
600
|
'deposit': deposit,
|
|
613
601
|
'withdraw': withdrawal,
|
|
614
602
|
'fee': withdrawFee,
|
|
615
|
-
'precision': precision,
|
|
603
|
+
'precision': this.parseNumber(this.parsePrecision(precision)),
|
|
616
604
|
'limits': {
|
|
617
605
|
'withdraw': {
|
|
618
606
|
'min': minWithdraw,
|
|
@@ -631,7 +619,7 @@ export default class bitvavo extends Exchange {
|
|
|
631
619
|
'withdraw': withdrawal,
|
|
632
620
|
'networks': networks,
|
|
633
621
|
'fee': withdrawFee,
|
|
634
|
-
'precision':
|
|
622
|
+
'precision': undefined,
|
|
635
623
|
'type': isFiat ? 'fiat' : 'crypto',
|
|
636
624
|
'limits': {
|
|
637
625
|
'amount': {
|
|
@@ -649,8 +637,6 @@ export default class bitvavo extends Exchange {
|
|
|
649
637
|
},
|
|
650
638
|
});
|
|
651
639
|
}
|
|
652
|
-
// set currencies here to avoid calling publicGetAssets twice
|
|
653
|
-
this.currencies = this.mapToSafeMap(this.deepExtend(this.currencies, result));
|
|
654
640
|
return result;
|
|
655
641
|
}
|
|
656
642
|
/**
|
package/js/src/blockchaincom.js
CHANGED
package/js/src/btcalpha.js
CHANGED
|
@@ -49,6 +49,7 @@ export default class btcalpha extends Exchange {
|
|
|
49
49
|
'fetchClosedOrders': true,
|
|
50
50
|
'fetchCrossBorrowRate': false,
|
|
51
51
|
'fetchCrossBorrowRates': false,
|
|
52
|
+
'fetchCurrencies': false,
|
|
52
53
|
'fetchDeposit': false,
|
|
53
54
|
'fetchDepositAddress': false,
|
|
54
55
|
'fetchDepositAddresses': false,
|
package/js/src/btcbox.js
CHANGED
|
@@ -47,6 +47,7 @@ export default class btcbox extends Exchange {
|
|
|
47
47
|
'fetchBorrowRatesPerSymbol': false,
|
|
48
48
|
'fetchCrossBorrowRate': false,
|
|
49
49
|
'fetchCrossBorrowRates': false,
|
|
50
|
+
'fetchCurrencies': false,
|
|
50
51
|
'fetchFundingHistory': false,
|
|
51
52
|
'fetchFundingInterval': false,
|
|
52
53
|
'fetchFundingIntervals': false,
|
package/js/src/btcmarkets.js
CHANGED
|
@@ -49,6 +49,7 @@ export default class btcmarkets extends Exchange {
|
|
|
49
49
|
'fetchClosedOrders': 'emulated',
|
|
50
50
|
'fetchCrossBorrowRate': false,
|
|
51
51
|
'fetchCrossBorrowRates': false,
|
|
52
|
+
'fetchCurrencies': false,
|
|
52
53
|
'fetchDepositAddress': false,
|
|
53
54
|
'fetchDepositAddresses': false,
|
|
54
55
|
'fetchDepositAddressesByNetwork': false,
|
package/js/src/btcturk.js
CHANGED
|
@@ -46,6 +46,7 @@ export default class btcturk extends Exchange {
|
|
|
46
46
|
'fetchBorrowRatesPerSymbol': false,
|
|
47
47
|
'fetchCrossBorrowRate': false,
|
|
48
48
|
'fetchCrossBorrowRates': false,
|
|
49
|
+
'fetchCurrencies': false,
|
|
49
50
|
'fetchDepositAddress': false,
|
|
50
51
|
'fetchDepositAddresses': false,
|
|
51
52
|
'fetchDepositAddressesByNetwork': false,
|
package/js/src/deribit.js
CHANGED
|
@@ -2705,8 +2705,9 @@ export default class deribit extends Exchange {
|
|
|
2705
2705
|
'notional': this.parseNumber(notionalStringAbs),
|
|
2706
2706
|
'leverage': this.safeInteger(position, 'leverage'),
|
|
2707
2707
|
'unrealizedPnl': this.parseNumber(unrealizedPnl),
|
|
2708
|
-
'
|
|
2709
|
-
'
|
|
2708
|
+
'realizedPnl': this.safeNumber(position, 'realized_profit_loss'),
|
|
2709
|
+
'contracts': this.safeNumber(position, 'size'),
|
|
2710
|
+
'contractSize': this.safeNumber(position, 'contractSize'),
|
|
2710
2711
|
'marginRatio': undefined,
|
|
2711
2712
|
'liquidationPrice': this.safeNumber(position, 'estimated_liquidation_price'),
|
|
2712
2713
|
'markPrice': this.safeNumber(position, 'mark_price'),
|
package/js/src/digifinex.js
CHANGED
|
@@ -523,7 +523,7 @@ export default class digifinex extends Exchange {
|
|
|
523
523
|
const networks = {};
|
|
524
524
|
for (let j = 0; j < networkEntries.length; j++) {
|
|
525
525
|
const networkEntry = networkEntries[j];
|
|
526
|
-
const networkId = this.
|
|
526
|
+
const networkId = this.safeString2(networkEntry, 'chain', 'currency');
|
|
527
527
|
const networkCode = this.networkIdToCode(networkId);
|
|
528
528
|
networks[networkCode] = {
|
|
529
529
|
'id': networkId,
|
package/js/src/gate.d.ts
CHANGED
package/js/src/gate.js
CHANGED
|
@@ -1439,8 +1439,8 @@ export default class gate extends Exchange {
|
|
|
1439
1439
|
// "leverage_min": "1",
|
|
1440
1440
|
// "leverage_max": "100",
|
|
1441
1441
|
// "risk_limit_max": "8000000",
|
|
1442
|
-
// "maker_fee_rate": "-0.00025",
|
|
1443
|
-
// "taker_fee_rate": "0.00075",
|
|
1442
|
+
// "maker_fee_rate": "-0.00025", // not actual value for regular users
|
|
1443
|
+
// "taker_fee_rate": "0.00075", // not actual value for regular users
|
|
1444
1444
|
// "funding_rate": "0.002053",
|
|
1445
1445
|
// "order_size_max": 1000000,
|
|
1446
1446
|
// "funding_next_apply": 1610035200,
|
|
@@ -1484,8 +1484,8 @@ export default class gate extends Exchange {
|
|
|
1484
1484
|
// "risk_limit_base": "140.726652109199",
|
|
1485
1485
|
// "risk_limit_step": "1000000",
|
|
1486
1486
|
// "risk_limit_max": "8000000",
|
|
1487
|
-
// "maker_fee_rate": "-0.00025",
|
|
1488
|
-
// "taker_fee_rate": "0.00075",
|
|
1487
|
+
// "maker_fee_rate": "-0.00025", // not actual value for regular users
|
|
1488
|
+
// "taker_fee_rate": "0.00075", // not actual value for regular users
|
|
1489
1489
|
// "ref_discount_rate": "0",
|
|
1490
1490
|
// "ref_rebate_rate": "0.2",
|
|
1491
1491
|
// "order_price_deviate": "0.5",
|
|
@@ -1524,8 +1524,6 @@ export default class gate extends Exchange {
|
|
|
1524
1524
|
const maxMultiplier = Precise.stringAdd('1', priceDeviate);
|
|
1525
1525
|
const minPrice = Precise.stringMul(minMultiplier, markPrice);
|
|
1526
1526
|
const maxPrice = Precise.stringMul(maxMultiplier, markPrice);
|
|
1527
|
-
const takerPercent = this.safeString(market, 'taker_fee_rate');
|
|
1528
|
-
const makerPercent = this.safeString(market, 'maker_fee_rate', takerPercent);
|
|
1529
1527
|
const isLinear = quote === settle;
|
|
1530
1528
|
let contractSize = this.safeString(market, 'quanto_multiplier');
|
|
1531
1529
|
// exception only for one market: https://api.gateio.ws/api/v4/futures/btc/contracts
|
|
@@ -1551,8 +1549,8 @@ export default class gate extends Exchange {
|
|
|
1551
1549
|
'contract': true,
|
|
1552
1550
|
'linear': isLinear,
|
|
1553
1551
|
'inverse': !isLinear,
|
|
1554
|
-
'taker':
|
|
1555
|
-
'maker':
|
|
1552
|
+
'taker': undefined,
|
|
1553
|
+
'maker': undefined,
|
|
1556
1554
|
'contractSize': this.parseNumber(contractSize),
|
|
1557
1555
|
'expiry': expiry,
|
|
1558
1556
|
'expiryDatetime': this.iso8601(expiry),
|
|
@@ -1651,8 +1649,6 @@ export default class gate extends Exchange {
|
|
|
1651
1649
|
const maxMultiplier = Precise.stringAdd('1', priceDeviate);
|
|
1652
1650
|
const minPrice = Precise.stringMul(minMultiplier, markPrice);
|
|
1653
1651
|
const maxPrice = Precise.stringMul(maxMultiplier, markPrice);
|
|
1654
|
-
const takerPercent = this.safeString(market, 'taker_fee_rate');
|
|
1655
|
-
const makerPercent = this.safeString(market, 'maker_fee_rate', takerPercent);
|
|
1656
1652
|
result.push({
|
|
1657
1653
|
'id': id,
|
|
1658
1654
|
'symbol': symbol,
|
|
@@ -1672,8 +1668,8 @@ export default class gate extends Exchange {
|
|
|
1672
1668
|
'contract': true,
|
|
1673
1669
|
'linear': true,
|
|
1674
1670
|
'inverse': false,
|
|
1675
|
-
'taker':
|
|
1676
|
-
'maker':
|
|
1671
|
+
'taker': undefined,
|
|
1672
|
+
'maker': undefined,
|
|
1677
1673
|
'contractSize': this.parseNumber('1'),
|
|
1678
1674
|
'expiry': expiry,
|
|
1679
1675
|
'expiryDatetime': this.iso8601(expiry),
|
package/js/src/gemini.js
CHANGED
|
@@ -665,9 +665,9 @@ export default class gemini extends Exchange {
|
|
|
665
665
|
const indexedTradingPairs = this.indexBy(tradingPairs, 0);
|
|
666
666
|
for (let i = 0; i < marketIds.length; i++) {
|
|
667
667
|
const marketId = marketIds[i];
|
|
668
|
-
const
|
|
669
|
-
if (
|
|
670
|
-
result.push(this.parseMarket(
|
|
668
|
+
const pairInfo = this.safeList(indexedTradingPairs, marketId.toUpperCase());
|
|
669
|
+
if (pairInfo !== undefined && !this.inArray(marketId, brokenPairs)) {
|
|
670
|
+
result.push(this.parseMarket(pairInfo));
|
|
671
671
|
}
|
|
672
672
|
}
|
|
673
673
|
}
|
package/js/src/htx.js
CHANGED
|
@@ -2791,7 +2791,17 @@ export default class htx extends Exchange {
|
|
|
2791
2791
|
'currency': feeCurrency,
|
|
2792
2792
|
};
|
|
2793
2793
|
}
|
|
2794
|
-
|
|
2794
|
+
// htx's multi-market trade-id is a bit complex to parse accordingly.
|
|
2795
|
+
// - for `id` which contains hyphen, it would be the unique id, eg. xxxxxx-1, xxxxxx-2 (this happens mostly for contract markets)
|
|
2796
|
+
// - otherwise the least priority is given to the `id` key
|
|
2797
|
+
let id = undefined;
|
|
2798
|
+
const safeId = this.safeString(trade, 'id');
|
|
2799
|
+
if (safeId !== undefined && safeId.indexOf('-') >= 0) {
|
|
2800
|
+
id = safeId;
|
|
2801
|
+
}
|
|
2802
|
+
else {
|
|
2803
|
+
id = this.safeStringN(trade, ['trade_id', 'trade-id', 'id']);
|
|
2804
|
+
}
|
|
2795
2805
|
return this.safeTrade({
|
|
2796
2806
|
'id': id,
|
|
2797
2807
|
'info': trade,
|
|
@@ -47,6 +47,7 @@ export default class independentreserve extends Exchange {
|
|
|
47
47
|
'fetchClosedOrders': true,
|
|
48
48
|
'fetchCrossBorrowRate': false,
|
|
49
49
|
'fetchCrossBorrowRates': false,
|
|
50
|
+
'fetchCurrencies': false,
|
|
50
51
|
'fetchDepositAddress': true,
|
|
51
52
|
'fetchDepositAddresses': false,
|
|
52
53
|
'fetchDepositAddressesByNetwork': false,
|
package/js/src/indodax.js
CHANGED
|
@@ -51,6 +51,7 @@ export default class indodax extends Exchange {
|
|
|
51
51
|
'fetchClosedOrders': true,
|
|
52
52
|
'fetchCrossBorrowRate': false,
|
|
53
53
|
'fetchCrossBorrowRates': false,
|
|
54
|
+
'fetchCurrencies': false,
|
|
54
55
|
'fetchDeposit': false,
|
|
55
56
|
'fetchDepositAddress': 'emulated',
|
|
56
57
|
'fetchDepositAddresses': true,
|
|
@@ -360,7 +361,7 @@ export default class indodax extends Exchange {
|
|
|
360
361
|
const result = [];
|
|
361
362
|
for (let i = 0; i < response.length; i++) {
|
|
362
363
|
const market = response[i];
|
|
363
|
-
const id = this.safeString(market, '
|
|
364
|
+
const id = this.safeString(market, 'id');
|
|
364
365
|
const baseId = this.safeString(market, 'traded_currency');
|
|
365
366
|
const quoteId = this.safeString(market, 'base_currency');
|
|
366
367
|
const base = this.safeCurrencyCode(baseId);
|
|
@@ -499,7 +500,7 @@ export default class indodax extends Exchange {
|
|
|
499
500
|
await this.loadMarkets();
|
|
500
501
|
const market = this.market(symbol);
|
|
501
502
|
const request = {
|
|
502
|
-
'pair': market['
|
|
503
|
+
'pair': market['id'],
|
|
503
504
|
};
|
|
504
505
|
const orderbook = await this.publicGetApiDepthPair(this.extend(request, params));
|
|
505
506
|
return this.parseOrderBook(orderbook, market['symbol'], undefined, 'buy', 'sell');
|
|
@@ -558,7 +559,7 @@ export default class indodax extends Exchange {
|
|
|
558
559
|
await this.loadMarkets();
|
|
559
560
|
const market = this.market(symbol);
|
|
560
561
|
const request = {
|
|
561
|
-
'pair': market['
|
|
562
|
+
'pair': market['id'],
|
|
562
563
|
};
|
|
563
564
|
const response = await this.publicGetApiTickerPair(this.extend(request, params));
|
|
564
565
|
//
|
|
@@ -607,7 +608,17 @@ export default class indodax extends Exchange {
|
|
|
607
608
|
//
|
|
608
609
|
const response = await this.publicGetApiTickerAll(params);
|
|
609
610
|
const tickers = this.safeDict(response, 'tickers', {});
|
|
610
|
-
|
|
611
|
+
const keys = Object.keys(tickers);
|
|
612
|
+
const parsedTickers = {};
|
|
613
|
+
for (let i = 0; i < keys.length; i++) {
|
|
614
|
+
const key = keys[i];
|
|
615
|
+
const rawTicker = tickers[key];
|
|
616
|
+
const marketId = key.replace('_', '');
|
|
617
|
+
const market = this.safeMarket(marketId);
|
|
618
|
+
const parsed = this.parseTicker(rawTicker, market);
|
|
619
|
+
parsedTickers[marketId] = parsed;
|
|
620
|
+
}
|
|
621
|
+
return this.filterByArray(parsedTickers, 'symbol', symbols);
|
|
611
622
|
}
|
|
612
623
|
parseTrade(trade, market = undefined) {
|
|
613
624
|
const timestamp = this.safeTimestamp(trade, 'date');
|
|
@@ -642,7 +653,7 @@ export default class indodax extends Exchange {
|
|
|
642
653
|
await this.loadMarkets();
|
|
643
654
|
const market = this.market(symbol);
|
|
644
655
|
const request = {
|
|
645
|
-
'pair': market['
|
|
656
|
+
'pair': market['id'],
|
|
646
657
|
};
|
|
647
658
|
const response = await this.publicGetApiTradesPair(this.extend(request, params));
|
|
648
659
|
return this.parseTrades(response, market, since, limit);
|
|
@@ -689,7 +700,7 @@ export default class indodax extends Exchange {
|
|
|
689
700
|
const request = {
|
|
690
701
|
'to': until,
|
|
691
702
|
'tf': selectedTimeframe,
|
|
692
|
-
'symbol': market['
|
|
703
|
+
'symbol': market['id'],
|
|
693
704
|
};
|
|
694
705
|
if (limit === undefined) {
|
|
695
706
|
limit = 1000;
|
package/js/src/kraken.d.ts
CHANGED
|
@@ -304,7 +304,7 @@ export default class kraken extends Exchange {
|
|
|
304
304
|
* @name kraken#cancelAllOrders
|
|
305
305
|
* @description cancel all open orders
|
|
306
306
|
* @see https://docs.kraken.com/rest/#tag/Spot-Trading/operation/cancelAllOrders
|
|
307
|
-
* @param {string} symbol unified market symbol,
|
|
307
|
+
* @param {string} symbol unified market symbol, not used by kraken cancelAllOrders (all open orders are cancelled)
|
|
308
308
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
309
309
|
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
310
310
|
*/
|
package/js/src/kraken.js
CHANGED
|
@@ -231,6 +231,23 @@ export default class kraken extends Exchange {
|
|
|
231
231
|
'XBT': 'BTC',
|
|
232
232
|
'XDG': 'DOGE',
|
|
233
233
|
'FEE': 'KFEE',
|
|
234
|
+
'XETC': 'ETC',
|
|
235
|
+
'XETH': 'ETH',
|
|
236
|
+
'XLTC': 'LTC',
|
|
237
|
+
'XMLN': 'MLN',
|
|
238
|
+
'XREP': 'REP',
|
|
239
|
+
'XXBT': 'BTC',
|
|
240
|
+
'XXDG': 'DOGE',
|
|
241
|
+
'XXLM': 'XLM',
|
|
242
|
+
'XXMR': 'XMR',
|
|
243
|
+
'XXRP': 'XRP',
|
|
244
|
+
'XZEC': 'ZEC',
|
|
245
|
+
'ZAUD': 'AUD',
|
|
246
|
+
'ZCAD': 'CAD',
|
|
247
|
+
'ZEUR': 'EUR',
|
|
248
|
+
'ZGBP': 'GBP',
|
|
249
|
+
'ZJPY': 'JPY',
|
|
250
|
+
'ZUSD': 'USD',
|
|
234
251
|
},
|
|
235
252
|
'options': {
|
|
236
253
|
'timeDifference': 0,
|
|
@@ -611,10 +628,12 @@ export default class kraken extends Exchange {
|
|
|
611
628
|
for (let i = 0; i < keys.length; i++) {
|
|
612
629
|
const id = keys[i];
|
|
613
630
|
const market = markets[id];
|
|
614
|
-
const
|
|
615
|
-
const
|
|
616
|
-
const
|
|
617
|
-
const
|
|
631
|
+
const baseIdRaw = this.safeString(market, 'base');
|
|
632
|
+
const quoteIdRaw = this.safeString(market, 'quote');
|
|
633
|
+
const baseId = this.safeCurrencyCode(baseIdRaw);
|
|
634
|
+
const quoteId = this.safeCurrencyCode(quoteIdRaw);
|
|
635
|
+
const base = baseId;
|
|
636
|
+
const quote = quoteId;
|
|
618
637
|
const makerFees = this.safeList(market, 'fees_maker', []);
|
|
619
638
|
const firstMakerFee = this.safeList(makerFees, 0, []);
|
|
620
639
|
const firstMakerFeeRate = this.safeString(firstMakerFee, 1);
|
|
@@ -2524,7 +2543,7 @@ export default class kraken extends Exchange {
|
|
|
2524
2543
|
* @name kraken#cancelAllOrders
|
|
2525
2544
|
* @description cancel all open orders
|
|
2526
2545
|
* @see https://docs.kraken.com/rest/#tag/Spot-Trading/operation/cancelAllOrders
|
|
2527
|
-
* @param {string} symbol unified market symbol,
|
|
2546
|
+
* @param {string} symbol unified market symbol, not used by kraken cancelAllOrders (all open orders are cancelled)
|
|
2528
2547
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2529
2548
|
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2530
2549
|
*/
|
|
@@ -3196,7 +3215,6 @@ export default class kraken extends Exchange {
|
|
|
3196
3215
|
*/
|
|
3197
3216
|
async withdraw(code, amount, address, tag = undefined, params = {}) {
|
|
3198
3217
|
[tag, params] = this.handleWithdrawTagAndParams(tag, params);
|
|
3199
|
-
this.checkAddress(address);
|
|
3200
3218
|
if ('key' in params) {
|
|
3201
3219
|
await this.loadMarkets();
|
|
3202
3220
|
const currency = this.currency(code);
|
|
@@ -3207,6 +3225,7 @@ export default class kraken extends Exchange {
|
|
|
3207
3225
|
};
|
|
3208
3226
|
if (address !== undefined && address !== '') {
|
|
3209
3227
|
request['address'] = address;
|
|
3228
|
+
this.checkAddress(address);
|
|
3210
3229
|
}
|
|
3211
3230
|
const response = await this.privatePostWithdraw(this.extend(request, params));
|
|
3212
3231
|
//
|
package/js/src/krakenfutures.js
CHANGED
|
@@ -47,6 +47,7 @@ export default class krakenfutures extends Exchange {
|
|
|
47
47
|
'fetchClosedOrders': true,
|
|
48
48
|
'fetchCrossBorrowRate': false,
|
|
49
49
|
'fetchCrossBorrowRates': false,
|
|
50
|
+
'fetchCurrencies': false,
|
|
50
51
|
'fetchDepositAddress': false,
|
|
51
52
|
'fetchDepositAddresses': false,
|
|
52
53
|
'fetchDepositAddressesByNetwork': false,
|
package/js/src/mercado.js
CHANGED
|
@@ -47,6 +47,7 @@ export default class mercado extends Exchange {
|
|
|
47
47
|
'fetchBorrowRatesPerSymbol': false,
|
|
48
48
|
'fetchCrossBorrowRate': false,
|
|
49
49
|
'fetchCrossBorrowRates': false,
|
|
50
|
+
'fetchCurrencies': false,
|
|
50
51
|
'fetchDepositAddress': false,
|
|
51
52
|
'fetchDepositAddresses': false,
|
|
52
53
|
'fetchDepositAddressesByNetwork': false,
|
package/js/src/mexc.d.ts
CHANGED
|
@@ -624,10 +624,13 @@ export default class mexc extends Exchange {
|
|
|
624
624
|
* @description fetch a history of internal transfers made on an account
|
|
625
625
|
* @see https://mexcdevelop.github.io/apidocs/spot_v2_en/#get-internal-assets-transfer-records
|
|
626
626
|
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-the-user-39-s-asset-transfer-records
|
|
627
|
-
* @param {string} code unified currency code of the currency transferred
|
|
627
|
+
* @see https://www.mexc.com/api-docs/spot-v3/wallet-endpoints#query-user-universal-transfer-history * @param {string} code unified currency code of the currency transferred
|
|
628
|
+
* @param code
|
|
628
629
|
* @param {int} [since] the earliest time in ms to fetch transfers for
|
|
629
630
|
* @param {int} [limit] the maximum number of transfers structures to retrieve
|
|
630
631
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
632
|
+
* @param {string} [params.fromAccountType] 'SPOT' for spot wallet, 'FUTURES' for contract wallet
|
|
633
|
+
* @param {string} [params.toAccountType] 'SPOT' for spot wallet, 'FUTURES' for contract wallet
|
|
631
634
|
* @returns {object[]} a list of [transfer structures]{@link https://docs.ccxt.com/#/?id=transfer-structure}
|
|
632
635
|
*/
|
|
633
636
|
fetchTransfers(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<TransferEntry[]>;
|