ccxt 4.4.85 → 4.4.87
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 +18 -7
- package/dist/ccxt.browser.min.js +3 -3
- package/dist/cjs/ccxt.js +16 -9
- package/dist/cjs/src/abstract/bittrade.js +9 -0
- package/dist/cjs/src/abstract/modetrade.js +9 -0
- package/dist/cjs/src/ascendex.js +189 -155
- package/dist/cjs/src/base/Exchange.js +10 -8
- package/dist/cjs/src/bequant.js +1 -1
- package/dist/cjs/src/binance.js +1 -1
- package/dist/cjs/src/bitget.js +5 -4
- package/dist/cjs/src/bitmart.js +1 -1
- package/dist/cjs/src/bitteam.js +31 -0
- package/dist/cjs/src/bittrade.js +2049 -0
- package/dist/cjs/src/coinbase.js +2 -6
- package/dist/cjs/src/coinmetro.js +5 -1
- package/dist/cjs/src/deribit.js +4 -5
- package/dist/cjs/src/derive.js +4 -5
- package/dist/cjs/src/ellipx.js +2 -3
- package/dist/cjs/src/gate.js +92 -76
- package/dist/cjs/src/hollaex.js +107 -49
- package/dist/cjs/src/htx.js +30 -52
- package/dist/cjs/src/hyperliquid.js +36 -20
- package/dist/cjs/src/kraken.js +5 -8
- package/dist/cjs/src/mexc.js +2 -2
- package/dist/cjs/src/modetrade.js +2839 -0
- package/dist/cjs/src/ndax.js +25 -24
- package/dist/cjs/src/okcoin.js +12 -31
- package/dist/cjs/src/okx.js +104 -2
- package/dist/cjs/src/okxus.js +53 -0
- package/dist/cjs/src/onetrading.js +9 -6
- package/dist/cjs/src/oxfun.js +42 -114
- package/dist/cjs/src/paradex.js +10 -1
- package/dist/cjs/src/phemex.js +4 -6
- package/dist/cjs/src/poloniex.js +181 -170
- package/dist/cjs/src/pro/binance.js +1 -0
- package/dist/cjs/src/pro/bittrade.js +605 -0
- package/dist/cjs/src/pro/luno.js +6 -5
- package/dist/cjs/src/pro/mexc.js +3 -0
- package/dist/cjs/src/pro/modetrade.js +1334 -0
- package/dist/cjs/src/pro/okxus.js +38 -0
- package/dist/cjs/src/probit.js +18 -51
- package/dist/cjs/src/timex.js +5 -10
- package/dist/cjs/src/vertex.js +3 -4
- package/dist/cjs/src/whitebit.js +41 -11
- package/dist/cjs/src/woo.js +101 -77
- package/dist/cjs/src/woofipro.js +24 -21
- package/dist/cjs/src/xt.js +36 -44
- package/js/ccxt.d.ts +20 -11
- package/js/ccxt.js +14 -8
- package/js/src/abstract/modetrade.d.ts +122 -0
- package/js/src/abstract/myokx.d.ts +2 -0
- package/js/src/abstract/okx.d.ts +2 -0
- package/js/src/abstract/okxus.d.ts +352 -0
- package/js/src/abstract/okxus.js +11 -0
- package/js/src/ascendex.d.ts +2 -0
- package/js/src/ascendex.js +189 -155
- package/js/src/base/Exchange.js +10 -8
- package/js/src/bequant.js +1 -1
- package/js/src/binance.js +1 -1
- package/js/src/bitget.js +5 -4
- package/js/src/bitmart.js +1 -1
- package/js/src/bitteam.js +31 -0
- package/js/src/{huobijp.d.ts → bittrade.d.ts} +29 -29
- package/js/src/{huobijp.js → bittrade.js} +35 -35
- package/js/src/coinbase.js +2 -6
- package/js/src/coinmetro.js +5 -1
- package/js/src/deribit.js +4 -5
- package/js/src/derive.js +4 -3
- package/js/src/ellipx.d.ts +1 -1
- package/js/src/ellipx.js +3 -5
- package/js/src/gate.js +92 -76
- package/js/src/hollaex.js +107 -49
- package/js/src/htx.js +30 -52
- package/js/src/hyperliquid.js +36 -20
- package/js/src/kraken.js +5 -8
- package/js/src/mexc.js +2 -2
- package/js/src/modetrade.d.ts +475 -0
- package/js/src/modetrade.js +2840 -0
- package/js/src/ndax.js +25 -24
- package/js/src/okcoin.js +12 -31
- package/js/src/okx.d.ts +24 -1
- package/js/src/okx.js +104 -2
- package/js/src/okxus.d.ts +4 -0
- package/js/src/okxus.js +54 -0
- package/js/src/onetrading.js +9 -6
- package/js/src/oxfun.js +42 -114
- package/js/src/paradex.js +10 -1
- package/js/src/phemex.js +4 -6
- package/js/src/poloniex.d.ts +2 -0
- package/js/src/poloniex.js +181 -170
- package/js/src/pro/binance.js +1 -0
- package/js/src/pro/{huobijp.d.ts → bittrade.d.ts} +6 -6
- package/js/src/pro/{huobijp.js → bittrade.js} +7 -7
- package/js/src/pro/luno.js +6 -5
- package/js/src/pro/mexc.js +3 -0
- package/js/src/pro/modetrade.d.ts +155 -0
- package/js/src/pro/modetrade.js +1335 -0
- package/js/src/pro/okxus.d.ts +4 -0
- package/js/src/pro/okxus.js +39 -0
- package/js/src/probit.js +18 -51
- package/js/src/timex.js +5 -10
- package/js/src/vertex.js +3 -4
- package/js/src/whitebit.js +42 -11
- package/js/src/woo.d.ts +2 -0
- package/js/src/woo.js +101 -77
- package/js/src/woofipro.d.ts +2 -1
- package/js/src/woofipro.js +24 -21
- package/js/src/xt.js +36 -44
- package/package.json +1 -1
- package/js/src/abstract/kuna.d.ts +0 -185
- package/js/src/kuna.d.ts +0 -335
- package/js/src/kuna.js +0 -2006
- /package/js/src/abstract/{huobijp.d.ts → bittrade.d.ts} +0 -0
- /package/js/src/abstract/{huobijp.js → bittrade.js} +0 -0
- /package/js/src/abstract/{kuna.js → modetrade.js} +0 -0
package/js/src/ascendex.js
CHANGED
|
@@ -469,6 +469,7 @@ export default class ascendex extends Exchange {
|
|
|
469
469
|
'broad': {},
|
|
470
470
|
},
|
|
471
471
|
'commonCurrencies': {
|
|
472
|
+
'XBT': 'XBT',
|
|
472
473
|
'BOND': 'BONDED',
|
|
473
474
|
'BTCBEAR': 'BEAR',
|
|
474
475
|
'BTCBULL': 'BULL',
|
|
@@ -491,116 +492,83 @@ export default class ascendex extends Exchange {
|
|
|
491
492
|
* @returns {object} an associative dictionary of currencies
|
|
492
493
|
*/
|
|
493
494
|
async fetchCurrencies(params = {}) {
|
|
494
|
-
const
|
|
495
|
-
//
|
|
496
|
-
// {
|
|
497
|
-
// "code":0,
|
|
498
|
-
// "data":[
|
|
499
|
-
// {
|
|
500
|
-
// "assetCode" : "LTCBULL",
|
|
501
|
-
// "assetName" : "3X Long LTC Token",
|
|
502
|
-
// "precisionScale" : 9,
|
|
503
|
-
// "nativeScale" : 4,
|
|
504
|
-
// "withdrawalFee" : "0.2",
|
|
505
|
-
// "minWithdrawalAmt" : "1.0",
|
|
506
|
-
// "status" : "Normal"
|
|
507
|
-
// },
|
|
508
|
-
// ]
|
|
509
|
-
// }
|
|
510
|
-
//
|
|
511
|
-
const marginPromise = this.v1PublicGetMarginAssets(params);
|
|
512
|
-
//
|
|
513
|
-
// {
|
|
514
|
-
// "code":0,
|
|
515
|
-
// "data":[
|
|
516
|
-
// {
|
|
517
|
-
// "assetCode":"BTT",
|
|
518
|
-
// "displayName": "BTT",
|
|
519
|
-
// "borrowAssetCode":"BTT-B",
|
|
520
|
-
// "interestAssetCode":"BTT-I",
|
|
521
|
-
// "nativeScale":0,
|
|
522
|
-
// "numConfirmations":1,
|
|
523
|
-
// "withdrawFee":"100.0",
|
|
524
|
-
// "minWithdrawalAmt":"1000.0",
|
|
525
|
-
// "statusCode":"Normal",
|
|
526
|
-
// "statusMessage":"",
|
|
527
|
-
// "interestRate":"0.001"
|
|
528
|
-
// }
|
|
529
|
-
// ]
|
|
530
|
-
// }
|
|
531
|
-
//
|
|
532
|
-
const cashPromise = this.v1PublicGetCashAssets(params);
|
|
495
|
+
const response = await this.v2PublicGetAssets(params);
|
|
533
496
|
//
|
|
534
|
-
//
|
|
535
|
-
//
|
|
536
|
-
//
|
|
537
|
-
//
|
|
538
|
-
//
|
|
539
|
-
//
|
|
540
|
-
//
|
|
541
|
-
//
|
|
542
|
-
//
|
|
543
|
-
//
|
|
544
|
-
//
|
|
545
|
-
//
|
|
546
|
-
//
|
|
497
|
+
// {
|
|
498
|
+
// "code": "0",
|
|
499
|
+
// "data": [
|
|
500
|
+
// {
|
|
501
|
+
// "assetCode": "USDT",
|
|
502
|
+
// "assetName": "Tether",
|
|
503
|
+
// "precisionScale": 9,
|
|
504
|
+
// "nativeScale": 4,
|
|
505
|
+
// "blockChain": [
|
|
506
|
+
// {
|
|
507
|
+
// "chainName": "Solana",
|
|
508
|
+
// "withdrawFee": "2.0",
|
|
509
|
+
// "allowDeposit": true,
|
|
510
|
+
// "allowWithdraw": true,
|
|
511
|
+
// "minDepositAmt": "0.01",
|
|
512
|
+
// "minWithdrawal": "4.0",
|
|
513
|
+
// "numConfirmations": 1
|
|
514
|
+
// },
|
|
515
|
+
// ...
|
|
516
|
+
// ]
|
|
517
|
+
// },
|
|
547
518
|
// ]
|
|
548
|
-
//
|
|
519
|
+
// }
|
|
549
520
|
//
|
|
550
|
-
const
|
|
551
|
-
const assetsData = this.safeList(assets, 'data', []);
|
|
552
|
-
const marginData = this.safeList(margin, 'data', []);
|
|
553
|
-
const cashData = this.safeList(cash, 'data', []);
|
|
554
|
-
const assetsById = this.indexBy(assetsData, 'assetCode');
|
|
555
|
-
const marginById = this.indexBy(marginData, 'assetCode');
|
|
556
|
-
const cashById = this.indexBy(cashData, 'assetCode');
|
|
557
|
-
const dataById = this.deepExtend(assetsById, marginById, cashById);
|
|
558
|
-
const ids = Object.keys(dataById);
|
|
521
|
+
const data = this.safeList(response, 'data', []);
|
|
559
522
|
const result = {};
|
|
560
|
-
for (let i = 0; i <
|
|
561
|
-
const
|
|
562
|
-
const
|
|
523
|
+
for (let i = 0; i < data.length; i++) {
|
|
524
|
+
const currency = data[i];
|
|
525
|
+
const id = this.safeString(currency, 'assetCode');
|
|
563
526
|
const code = this.safeCurrencyCode(id);
|
|
564
|
-
const
|
|
565
|
-
const precision = this.parseNumber(this.parsePrecision(
|
|
566
|
-
const
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
527
|
+
const chains = this.safeList(currency, 'blockChain', []);
|
|
528
|
+
const precision = this.parseNumber(this.parsePrecision(this.safeString(currency, 'nativeScale')));
|
|
529
|
+
const networks = {};
|
|
530
|
+
for (let j = 0; j < chains.length; j++) {
|
|
531
|
+
const networkEtnry = chains[j];
|
|
532
|
+
const networkId = this.safeString(networkEtnry, 'chainName');
|
|
533
|
+
const networkCode = this.networkCodeToId(networkId);
|
|
534
|
+
networks[networkCode] = {
|
|
535
|
+
'fee': this.safeNumber(networkEtnry, 'withdrawFee'),
|
|
536
|
+
'active': undefined,
|
|
537
|
+
'withdraw': this.safeBool(networkEtnry, 'allowWithdraw'),
|
|
538
|
+
'deposit': this.safeBool(networkEtnry, 'allowDeposit'),
|
|
539
|
+
'precision': precision,
|
|
540
|
+
'limits': {
|
|
541
|
+
'amount': {
|
|
542
|
+
'min': undefined,
|
|
543
|
+
'max': undefined,
|
|
544
|
+
},
|
|
545
|
+
'withdraw': {
|
|
546
|
+
'min': this.safeNumber(networkEtnry, 'minWithdrawal'),
|
|
547
|
+
'max': undefined,
|
|
548
|
+
},
|
|
549
|
+
'deposit': {
|
|
550
|
+
'min': this.safeNumber(networkEtnry, 'minDepositAmt'),
|
|
551
|
+
'max': undefined,
|
|
552
|
+
},
|
|
553
|
+
},
|
|
554
|
+
};
|
|
587
555
|
}
|
|
588
|
-
|
|
589
|
-
result[code] = {
|
|
556
|
+
// todo type: if (chainsLength === 0 && (assetName.endsWith (' Staking') || assetName.indexOf (' Reward ') >= 0 || assetName.indexOf ('Slot Auction') >= 0 || assetName.indexOf (' Freeze Asset') >= 0))
|
|
557
|
+
result[code] = this.safeCurrencyStructure({
|
|
590
558
|
'id': id,
|
|
591
559
|
'code': code,
|
|
592
560
|
'info': currency,
|
|
593
561
|
'type': undefined,
|
|
594
|
-
'margin':
|
|
562
|
+
'margin': undefined,
|
|
595
563
|
'name': this.safeString(currency, 'assetName'),
|
|
596
|
-
'active':
|
|
597
|
-
'deposit':
|
|
598
|
-
'withdraw':
|
|
599
|
-
'fee':
|
|
564
|
+
'active': undefined,
|
|
565
|
+
'deposit': undefined,
|
|
566
|
+
'withdraw': undefined,
|
|
567
|
+
'fee': undefined,
|
|
600
568
|
'precision': precision,
|
|
601
569
|
'limits': {
|
|
602
570
|
'amount': {
|
|
603
|
-
'min':
|
|
571
|
+
'min': undefined,
|
|
604
572
|
'max': undefined,
|
|
605
573
|
},
|
|
606
574
|
'withdraw': {
|
|
@@ -608,8 +576,8 @@ export default class ascendex extends Exchange {
|
|
|
608
576
|
'max': undefined,
|
|
609
577
|
},
|
|
610
578
|
},
|
|
611
|
-
'networks':
|
|
612
|
-
};
|
|
579
|
+
'networks': networks,
|
|
580
|
+
});
|
|
613
581
|
}
|
|
614
582
|
return result;
|
|
615
583
|
}
|
|
@@ -621,6 +589,12 @@ export default class ascendex extends Exchange {
|
|
|
621
589
|
* @returns {object[]} an array of objects representing market data
|
|
622
590
|
*/
|
|
623
591
|
async fetchMarkets(params = {}) {
|
|
592
|
+
const spotPromise = this.fetchSpotMarkets(params);
|
|
593
|
+
const contractPromise = this.fetchContractMarkets(params);
|
|
594
|
+
const [spotMarkets, contractMarkets] = await Promise.all([spotPromise, contractPromise]);
|
|
595
|
+
return this.arrayConcat(spotMarkets, contractMarkets);
|
|
596
|
+
}
|
|
597
|
+
async fetchSpotMarkets(params = {}) {
|
|
624
598
|
const productsPromise = this.v1PublicGetProducts(params);
|
|
625
599
|
//
|
|
626
600
|
// {
|
|
@@ -672,7 +646,94 @@ export default class ascendex extends Exchange {
|
|
|
672
646
|
// ]
|
|
673
647
|
// }
|
|
674
648
|
//
|
|
675
|
-
const
|
|
649
|
+
const [products, cash] = await Promise.all([productsPromise, cashPromise]);
|
|
650
|
+
const productsData = this.safeList(products, 'data', []);
|
|
651
|
+
const productsById = this.indexBy(productsData, 'symbol');
|
|
652
|
+
const cashData = this.safeList(cash, 'data', []);
|
|
653
|
+
const cashAndPerpetualsById = this.indexBy(cashData, 'symbol');
|
|
654
|
+
const dataById = this.deepExtend(productsById, cashAndPerpetualsById);
|
|
655
|
+
const ids = Object.keys(dataById);
|
|
656
|
+
const result = [];
|
|
657
|
+
for (let i = 0; i < ids.length; i++) {
|
|
658
|
+
const id = ids[i];
|
|
659
|
+
if (id.indexOf('-PERP') >= 0) {
|
|
660
|
+
continue; // skip perpetuals, as separate endpoint returns them
|
|
661
|
+
}
|
|
662
|
+
const market = dataById[id];
|
|
663
|
+
const status = this.safeString(market, 'status');
|
|
664
|
+
const domain = this.safeString(market, 'domain');
|
|
665
|
+
let active = false;
|
|
666
|
+
if (((status === 'Normal') || (status === 'InternalTrading')) && (domain !== 'LeveragedETF')) {
|
|
667
|
+
active = true;
|
|
668
|
+
}
|
|
669
|
+
const minQty = this.safeNumber(market, 'minQty');
|
|
670
|
+
const maxQty = this.safeNumber(market, 'maxQty');
|
|
671
|
+
const minPrice = this.safeNumber(market, 'tickSize');
|
|
672
|
+
const maxPrice = undefined;
|
|
673
|
+
const underlying = this.safeString2(market, 'underlying', 'symbol');
|
|
674
|
+
const parts = underlying.split('/');
|
|
675
|
+
const baseId = this.safeString(parts, 0);
|
|
676
|
+
const quoteId = this.safeString(parts, 1);
|
|
677
|
+
const base = this.safeCurrencyCode(baseId);
|
|
678
|
+
const quote = this.safeCurrencyCode(quoteId);
|
|
679
|
+
const fee = this.safeNumber(market, 'commissionReserveRate');
|
|
680
|
+
const marginTradable = this.safeBool(market, 'marginTradable', false);
|
|
681
|
+
result.push({
|
|
682
|
+
'id': id,
|
|
683
|
+
'symbol': base + '/' + quote,
|
|
684
|
+
'base': base,
|
|
685
|
+
'baseId': baseId,
|
|
686
|
+
'quote': quote,
|
|
687
|
+
'quoteId': quoteId,
|
|
688
|
+
'settle': undefined,
|
|
689
|
+
'settleId': undefined,
|
|
690
|
+
'type': 'spot',
|
|
691
|
+
'spot': true,
|
|
692
|
+
'margin': marginTradable,
|
|
693
|
+
'swap': false,
|
|
694
|
+
'future': false,
|
|
695
|
+
'option': false,
|
|
696
|
+
'active': active,
|
|
697
|
+
'contract': false,
|
|
698
|
+
'linear': undefined,
|
|
699
|
+
'inverse': undefined,
|
|
700
|
+
'taker': fee,
|
|
701
|
+
'maker': fee,
|
|
702
|
+
'contractSize': undefined,
|
|
703
|
+
'expiry': undefined,
|
|
704
|
+
'expiryDatetime': undefined,
|
|
705
|
+
'strike': undefined,
|
|
706
|
+
'optionType': undefined,
|
|
707
|
+
'precision': {
|
|
708
|
+
'amount': this.safeNumber(market, 'lotSize'),
|
|
709
|
+
'price': this.safeNumber(market, 'tickSize'),
|
|
710
|
+
},
|
|
711
|
+
'limits': {
|
|
712
|
+
'leverage': {
|
|
713
|
+
'min': undefined,
|
|
714
|
+
'max': undefined,
|
|
715
|
+
},
|
|
716
|
+
'amount': {
|
|
717
|
+
'min': minQty,
|
|
718
|
+
'max': maxQty,
|
|
719
|
+
},
|
|
720
|
+
'price': {
|
|
721
|
+
'min': minPrice,
|
|
722
|
+
'max': maxPrice,
|
|
723
|
+
},
|
|
724
|
+
'cost': {
|
|
725
|
+
'min': this.safeNumber(market, 'minNotional'),
|
|
726
|
+
'max': this.safeNumber(market, 'maxNotional'),
|
|
727
|
+
},
|
|
728
|
+
},
|
|
729
|
+
'created': this.safeInteger(market, 'tradingStartTime'),
|
|
730
|
+
'info': market,
|
|
731
|
+
});
|
|
732
|
+
}
|
|
733
|
+
return result;
|
|
734
|
+
}
|
|
735
|
+
async fetchContractMarkets(params = {}) {
|
|
736
|
+
const contracts = await this.v2PublicGetFuturesContract(params);
|
|
676
737
|
//
|
|
677
738
|
// {
|
|
678
739
|
// "code": 0,
|
|
@@ -685,9 +746,9 @@ export default class ascendex extends Exchange {
|
|
|
685
746
|
// "underlying": "BTC/USDT",
|
|
686
747
|
// "tradingStartTime": 1579701600000,
|
|
687
748
|
// "priceFilter": {
|
|
688
|
-
// "minPrice": "1",
|
|
749
|
+
// "minPrice": "0.1",
|
|
689
750
|
// "maxPrice": "1000000",
|
|
690
|
-
// "tickSize": "1"
|
|
751
|
+
// "tickSize": "0.1"
|
|
691
752
|
// },
|
|
692
753
|
// "lotSizeFilter": {
|
|
693
754
|
// "minQty": "0.0001",
|
|
@@ -710,52 +771,25 @@ export default class ascendex extends Exchange {
|
|
|
710
771
|
// ]
|
|
711
772
|
// }
|
|
712
773
|
//
|
|
713
|
-
const
|
|
714
|
-
const productsData = this.safeList(products, 'data', []);
|
|
715
|
-
const productsById = this.indexBy(productsData, 'symbol');
|
|
716
|
-
const cashData = this.safeList(cash, 'data', []);
|
|
717
|
-
const perpetualsData = this.safeList(perpetuals, 'data', []);
|
|
718
|
-
const cashAndPerpetualsData = this.arrayConcat(cashData, perpetualsData);
|
|
719
|
-
const cashAndPerpetualsById = this.indexBy(cashAndPerpetualsData, 'symbol');
|
|
720
|
-
const dataById = this.deepExtend(productsById, cashAndPerpetualsById);
|
|
721
|
-
const ids = Object.keys(dataById);
|
|
774
|
+
const data = this.safeList(contracts, 'data', []);
|
|
722
775
|
const result = [];
|
|
723
|
-
for (let i = 0; i <
|
|
724
|
-
const
|
|
725
|
-
const
|
|
726
|
-
const
|
|
727
|
-
const settle = this.safeCurrencyCode(settleId);
|
|
728
|
-
const status = this.safeString(market, 'status');
|
|
729
|
-
const domain = this.safeString(market, 'domain');
|
|
730
|
-
let active = false;
|
|
731
|
-
if (((status === 'Normal') || (status === 'InternalTrading')) && (domain !== 'LeveragedETF')) {
|
|
732
|
-
active = true;
|
|
733
|
-
}
|
|
734
|
-
const spot = settle === undefined;
|
|
735
|
-
const swap = !spot;
|
|
736
|
-
const linear = swap ? true : undefined;
|
|
737
|
-
let minQty = this.safeNumber(market, 'minQty');
|
|
738
|
-
let maxQty = this.safeNumber(market, 'maxQty');
|
|
739
|
-
let minPrice = this.safeNumber(market, 'tickSize');
|
|
740
|
-
let maxPrice = undefined;
|
|
741
|
-
const underlying = this.safeString2(market, 'underlying', 'symbol');
|
|
776
|
+
for (let i = 0; i < data.length; i++) {
|
|
777
|
+
const market = data[i];
|
|
778
|
+
const id = this.safeString(market, 'symbol');
|
|
779
|
+
const underlying = this.safeString(market, 'underlying');
|
|
742
780
|
const parts = underlying.split('/');
|
|
743
781
|
const baseId = this.safeString(parts, 0);
|
|
744
|
-
const quoteId = this.safeString(parts, 1);
|
|
745
782
|
const base = this.safeCurrencyCode(baseId);
|
|
783
|
+
const quoteId = this.safeString(parts, 1);
|
|
746
784
|
const quote = this.safeCurrencyCode(quoteId);
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
maxPrice = this.safeNumber(priceFilter, 'maxPrice');
|
|
755
|
-
symbol = base + '/' + quote + ':' + settle;
|
|
756
|
-
}
|
|
785
|
+
const settleId = this.safeString(market, 'settlementAsset');
|
|
786
|
+
const settle = this.safeCurrencyCode(settleId);
|
|
787
|
+
const linear = settle === quote;
|
|
788
|
+
const inverse = settle === base;
|
|
789
|
+
const symbol = base + '/' + quote + ':' + settle;
|
|
790
|
+
const priceFilter = this.safeDict(market, 'priceFilter');
|
|
791
|
+
const lotSizeFilter = this.safeDict(market, 'lotSizeFilter');
|
|
757
792
|
const fee = this.safeNumber(market, 'commissionReserveRate');
|
|
758
|
-
const marginTradable = this.safeBool(market, 'marginTradable', false);
|
|
759
793
|
result.push({
|
|
760
794
|
'id': id,
|
|
761
795
|
'symbol': symbol,
|
|
@@ -765,26 +799,26 @@ export default class ascendex extends Exchange {
|
|
|
765
799
|
'baseId': baseId,
|
|
766
800
|
'quoteId': quoteId,
|
|
767
801
|
'settleId': settleId,
|
|
768
|
-
'type':
|
|
769
|
-
'spot':
|
|
770
|
-
'margin':
|
|
771
|
-
'swap':
|
|
802
|
+
'type': 'swap',
|
|
803
|
+
'spot': false,
|
|
804
|
+
'margin': undefined,
|
|
805
|
+
'swap': true,
|
|
772
806
|
'future': false,
|
|
773
807
|
'option': false,
|
|
774
|
-
'active':
|
|
775
|
-
'contract':
|
|
808
|
+
'active': this.safeString(market, 'status') === 'Normal',
|
|
809
|
+
'contract': true,
|
|
776
810
|
'linear': linear,
|
|
777
|
-
'inverse':
|
|
811
|
+
'inverse': inverse,
|
|
778
812
|
'taker': fee,
|
|
779
813
|
'maker': fee,
|
|
780
|
-
'contractSize':
|
|
814
|
+
'contractSize': this.parseNumber('1'),
|
|
781
815
|
'expiry': undefined,
|
|
782
816
|
'expiryDatetime': undefined,
|
|
783
817
|
'strike': undefined,
|
|
784
818
|
'optionType': undefined,
|
|
785
819
|
'precision': {
|
|
786
|
-
'amount': this.safeNumber(
|
|
787
|
-
'price': this.safeNumber(
|
|
820
|
+
'amount': this.safeNumber(lotSizeFilter, 'lotSize'),
|
|
821
|
+
'price': this.safeNumber(priceFilter, 'tickSize'),
|
|
788
822
|
},
|
|
789
823
|
'limits': {
|
|
790
824
|
'leverage': {
|
|
@@ -792,12 +826,12 @@ export default class ascendex extends Exchange {
|
|
|
792
826
|
'max': undefined,
|
|
793
827
|
},
|
|
794
828
|
'amount': {
|
|
795
|
-
'min': minQty,
|
|
796
|
-
'max': maxQty,
|
|
829
|
+
'min': this.safeNumber(lotSizeFilter, 'minQty'),
|
|
830
|
+
'max': this.safeNumber(lotSizeFilter, 'maxQty'),
|
|
797
831
|
},
|
|
798
832
|
'price': {
|
|
799
|
-
'min': minPrice,
|
|
800
|
-
'max': maxPrice,
|
|
833
|
+
'min': this.safeNumber(priceFilter, 'minPrice'),
|
|
834
|
+
'max': this.safeNumber(priceFilter, 'maxPrice'),
|
|
801
835
|
},
|
|
802
836
|
'cost': {
|
|
803
837
|
'min': this.safeNumber(market, 'minNotional'),
|
package/js/src/base/Exchange.js
CHANGED
|
@@ -725,8 +725,10 @@ export default class Exchange {
|
|
|
725
725
|
// only call if exchange API provides endpoint (true), thus avoid emulated versions ('emulated')
|
|
726
726
|
if (this.has['fetchCurrencies'] === true) {
|
|
727
727
|
currencies = await this.fetchCurrencies();
|
|
728
|
+
this.options['cachedCurrencies'] = currencies;
|
|
728
729
|
}
|
|
729
730
|
const markets = await this.fetchMarkets(params);
|
|
731
|
+
delete this.options['cachedCurrencies'];
|
|
730
732
|
return this.setMarkets(markets, currencies);
|
|
731
733
|
}
|
|
732
734
|
/**
|
|
@@ -3945,12 +3947,12 @@ export default class Exchange {
|
|
|
3945
3947
|
}
|
|
3946
3948
|
else {
|
|
3947
3949
|
// if networkCode was provided by user, we should check it after response, as the referenced exchange doesn't support network-code during request
|
|
3948
|
-
const
|
|
3949
|
-
if (
|
|
3950
|
-
chosenNetworkId =
|
|
3950
|
+
const networkIdOrCode = isIndexedByUnifiedNetworkCode ? networkCode : this.networkCodeToId(networkCode, currencyCode);
|
|
3951
|
+
if (networkIdOrCode in indexedNetworkEntries) {
|
|
3952
|
+
chosenNetworkId = networkIdOrCode;
|
|
3951
3953
|
}
|
|
3952
3954
|
else {
|
|
3953
|
-
throw new NotSupported(this.id + ' - ' +
|
|
3955
|
+
throw new NotSupported(this.id + ' - ' + networkIdOrCode + ' network was not found for ' + currencyCode + ', use one of ' + availableNetworkIds.join(', '));
|
|
3954
3956
|
}
|
|
3955
3957
|
}
|
|
3956
3958
|
}
|
|
@@ -4292,15 +4294,15 @@ export default class Exchange {
|
|
|
4292
4294
|
const cost = this.calculateRateLimiterCost(api, method, path, params, config);
|
|
4293
4295
|
await this.throttle(cost);
|
|
4294
4296
|
}
|
|
4297
|
+
let retries = undefined;
|
|
4298
|
+
[retries, params] = this.handleOptionAndParams(params, path, 'maxRetriesOnFailure', 0);
|
|
4299
|
+
let retryDelay = undefined;
|
|
4300
|
+
[retryDelay, params] = this.handleOptionAndParams(params, path, 'maxRetriesOnFailureDelay', 0);
|
|
4295
4301
|
this.lastRestRequestTimestamp = this.milliseconds();
|
|
4296
4302
|
const request = this.sign(path, api, method, params, headers, body);
|
|
4297
4303
|
this.last_request_headers = request['headers'];
|
|
4298
4304
|
this.last_request_body = request['body'];
|
|
4299
4305
|
this.last_request_url = request['url'];
|
|
4300
|
-
let retries = undefined;
|
|
4301
|
-
[retries, params] = this.handleOptionAndParams(params, path, 'maxRetriesOnFailure', 0);
|
|
4302
|
-
let retryDelay = undefined;
|
|
4303
|
-
[retryDelay, params] = this.handleOptionAndParams(params, path, 'maxRetriesOnFailureDelay', 0);
|
|
4304
4306
|
for (let i = 0; i < retries + 1; i++) {
|
|
4305
4307
|
try {
|
|
4306
4308
|
return await this.fetch(request['url'], request['method'], request['headers'], request['body']);
|
package/js/src/bequant.js
CHANGED
|
@@ -12,8 +12,8 @@ export default class bequant extends hitbtc {
|
|
|
12
12
|
return this.deepExtend(super.describe(), {
|
|
13
13
|
'id': 'bequant',
|
|
14
14
|
'name': 'Bequant',
|
|
15
|
-
'countries': ['MT'],
|
|
16
15
|
'pro': true,
|
|
16
|
+
'countries': ['MT'],
|
|
17
17
|
'urls': {
|
|
18
18
|
'logo': 'https://github.com/user-attachments/assets/0583ef1f-29fe-4b7c-8189-63565a0e2867',
|
|
19
19
|
'api': {
|
package/js/src/binance.js
CHANGED
|
@@ -5198,7 +5198,6 @@ export default class binance extends Exchange {
|
|
|
5198
5198
|
if (postOnly) {
|
|
5199
5199
|
uppercaseType = 'LIMIT_MAKER';
|
|
5200
5200
|
}
|
|
5201
|
-
request['type'] = uppercaseType;
|
|
5202
5201
|
const triggerPrice = this.safeNumber2(params, 'stopPrice', 'triggerPrice');
|
|
5203
5202
|
if (triggerPrice !== undefined) {
|
|
5204
5203
|
if (uppercaseType === 'MARKET') {
|
|
@@ -5208,6 +5207,7 @@ export default class binance extends Exchange {
|
|
|
5208
5207
|
uppercaseType = 'STOP_LOSS_LIMIT';
|
|
5209
5208
|
}
|
|
5210
5209
|
}
|
|
5210
|
+
request['type'] = uppercaseType;
|
|
5211
5211
|
const validOrderTypes = this.safeList(market['info'], 'orderTypes');
|
|
5212
5212
|
if (!this.inArray(uppercaseType, validOrderTypes)) {
|
|
5213
5213
|
if (initialUppercaseType !== uppercaseType) {
|
package/js/src/bitget.js
CHANGED
|
@@ -2393,7 +2393,7 @@ export default class bitget extends Exchange {
|
|
|
2393
2393
|
'coin': currency['id'],
|
|
2394
2394
|
'address': address,
|
|
2395
2395
|
'chain': networkId,
|
|
2396
|
-
'size': amount,
|
|
2396
|
+
'size': this.currencyToPrecision(code, amount, networkCode),
|
|
2397
2397
|
'transferType': 'on_chain',
|
|
2398
2398
|
};
|
|
2399
2399
|
if (tag !== undefined) {
|
|
@@ -2418,8 +2418,6 @@ export default class bitget extends Exchange {
|
|
|
2418
2418
|
const fillResponseFromRequest = this.safeBool(withdrawOptions, 'fillResponseFromRequest', true);
|
|
2419
2419
|
if (fillResponseFromRequest) {
|
|
2420
2420
|
result['currency'] = code;
|
|
2421
|
-
result['timestamp'] = this.milliseconds();
|
|
2422
|
-
result['datetime'] = this.iso8601(this.milliseconds());
|
|
2423
2421
|
result['amount'] = amount;
|
|
2424
2422
|
result['tag'] = tag;
|
|
2425
2423
|
result['address'] = address;
|
|
@@ -2543,7 +2541,10 @@ export default class bitget extends Exchange {
|
|
|
2543
2541
|
const status = this.safeString(transaction, 'status');
|
|
2544
2542
|
const tag = this.safeString(transaction, 'tag');
|
|
2545
2543
|
const feeCostString = this.safeString(transaction, 'fee');
|
|
2546
|
-
|
|
2544
|
+
let feeCostAbsString = undefined;
|
|
2545
|
+
if (feeCostString !== undefined) {
|
|
2546
|
+
feeCostAbsString = Precise.stringAbs(feeCostString);
|
|
2547
|
+
}
|
|
2547
2548
|
let fee = undefined;
|
|
2548
2549
|
let amountString = this.safeString(transaction, 'size');
|
|
2549
2550
|
if (feeCostAbsString !== undefined) {
|
package/js/src/bitmart.js
CHANGED
|
@@ -2374,7 +2374,7 @@ export default class bitmart extends Exchange {
|
|
|
2374
2374
|
const code = this.safeCurrencyCode(currencyId);
|
|
2375
2375
|
const account = this.account();
|
|
2376
2376
|
account['free'] = this.safeString2(balance, 'available', 'available_balance');
|
|
2377
|
-
account['used'] = this.
|
|
2377
|
+
account['used'] = this.safeStringN(balance, ['unAvailable', 'frozen', 'frozen_balance']);
|
|
2378
2378
|
result[code] = account;
|
|
2379
2379
|
}
|
|
2380
2380
|
return this.safeBalance(result);
|
package/js/src/bitteam.js
CHANGED
|
@@ -32,12 +32,18 @@ export default class bitteam extends Exchange {
|
|
|
32
32
|
'future': false,
|
|
33
33
|
'option': false,
|
|
34
34
|
'addMargin': false,
|
|
35
|
+
'borrowCrossMargin': false,
|
|
36
|
+
'borrowIsolatedMargin': false,
|
|
35
37
|
'borrowMargin': false,
|
|
36
38
|
'cancelAllOrders': true,
|
|
37
39
|
'cancelOrder': true,
|
|
38
40
|
'cancelOrders': false,
|
|
41
|
+
'closeAllPositions': false,
|
|
42
|
+
'closePosition': false,
|
|
39
43
|
'createDepositAddress': false,
|
|
40
44
|
'createOrder': true,
|
|
45
|
+
'createOrderWithTakeProfitAndStopLoss': false,
|
|
46
|
+
'createOrderWithTakeProfitAndStopLossWs': false,
|
|
41
47
|
'createPostOnlyOrder': false,
|
|
42
48
|
'createReduceOnlyOrder': false,
|
|
43
49
|
'createStopLimitOrder': false,
|
|
@@ -49,8 +55,11 @@ export default class bitteam extends Exchange {
|
|
|
49
55
|
'fetchBalance': true,
|
|
50
56
|
'fetchBidsAsks': false,
|
|
51
57
|
'fetchBorrowInterest': false,
|
|
58
|
+
'fetchBorrowRate': false,
|
|
52
59
|
'fetchBorrowRateHistories': false,
|
|
53
60
|
'fetchBorrowRateHistory': false,
|
|
61
|
+
'fetchBorrowRates': false,
|
|
62
|
+
'fetchBorrowRatesPerSymbol': false,
|
|
54
63
|
'fetchCanceledOrders': true,
|
|
55
64
|
'fetchClosedOrder': false,
|
|
56
65
|
'fetchClosedOrders': true,
|
|
@@ -66,24 +75,42 @@ export default class bitteam extends Exchange {
|
|
|
66
75
|
'fetchDepositWithdrawFee': false,
|
|
67
76
|
'fetchDepositWithdrawFees': false,
|
|
68
77
|
'fetchFundingHistory': false,
|
|
78
|
+
'fetchFundingInterval': false,
|
|
79
|
+
'fetchFundingIntervals': false,
|
|
69
80
|
'fetchFundingRate': false,
|
|
70
81
|
'fetchFundingRateHistory': false,
|
|
71
82
|
'fetchFundingRates': false,
|
|
83
|
+
'fetchGreeks': false,
|
|
72
84
|
'fetchIndexOHLCV': false,
|
|
73
85
|
'fetchIsolatedBorrowRate': false,
|
|
74
86
|
'fetchIsolatedBorrowRates': false,
|
|
87
|
+
'fetchIsolatedPositions': false,
|
|
75
88
|
'fetchL3OrderBook': false,
|
|
76
89
|
'fetchLedger': false,
|
|
77
90
|
'fetchLeverage': false,
|
|
91
|
+
'fetchLeverages': false,
|
|
78
92
|
'fetchLeverageTiers': false,
|
|
93
|
+
'fetchLiquidations': false,
|
|
94
|
+
'fetchLongShortRatio': false,
|
|
95
|
+
'fetchLongShortRatioHistory': false,
|
|
96
|
+
'fetchMarginAdjustmentHistory': false,
|
|
97
|
+
'fetchMarginMode': false,
|
|
98
|
+
'fetchMarginModes': false,
|
|
79
99
|
'fetchMarketLeverageTiers': false,
|
|
80
100
|
'fetchMarkets': true,
|
|
81
101
|
'fetchMarkOHLCV': false,
|
|
102
|
+
'fetchMarkPrices': false,
|
|
103
|
+
'fetchMyLiquidations': false,
|
|
104
|
+
'fetchMySettlementHistory': false,
|
|
82
105
|
'fetchMyTrades': true,
|
|
83
106
|
'fetchOHLCV': true,
|
|
107
|
+
'fetchOpenInterest': false,
|
|
84
108
|
'fetchOpenInterestHistory': false,
|
|
109
|
+
'fetchOpenInterests': false,
|
|
85
110
|
'fetchOpenOrder': false,
|
|
86
111
|
'fetchOpenOrders': true,
|
|
112
|
+
'fetchOption': false,
|
|
113
|
+
'fetchOptionChain': false,
|
|
87
114
|
'fetchOrder': true,
|
|
88
115
|
'fetchOrderBook': true,
|
|
89
116
|
'fetchOrderBooks': false,
|
|
@@ -97,6 +124,7 @@ export default class bitteam extends Exchange {
|
|
|
97
124
|
'fetchPositionsHistory': false,
|
|
98
125
|
'fetchPositionsRisk': false,
|
|
99
126
|
'fetchPremiumIndexOHLCV': false,
|
|
127
|
+
'fetchSettlementHistory': false,
|
|
100
128
|
'fetchStatus': false,
|
|
101
129
|
'fetchTicker': true,
|
|
102
130
|
'fetchTickers': true,
|
|
@@ -109,10 +137,13 @@ export default class bitteam extends Exchange {
|
|
|
109
137
|
'fetchTransactionFees': false,
|
|
110
138
|
'fetchTransactions': true,
|
|
111
139
|
'fetchTransfers': false,
|
|
140
|
+
'fetchVolatilityHistory': false,
|
|
112
141
|
'fetchWithdrawal': false,
|
|
113
142
|
'fetchWithdrawals': false,
|
|
114
143
|
'fetchWithdrawalWhitelist': false,
|
|
115
144
|
'reduceMargin': false,
|
|
145
|
+
'repayCrossMargin': false,
|
|
146
|
+
'repayIsolatedMargin': false,
|
|
116
147
|
'repayMargin': false,
|
|
117
148
|
'setLeverage': false,
|
|
118
149
|
'setMargin': false,
|