ccxt 4.3.88 → 4.3.90
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/ace.js +1 -0
- package/dist/cjs/src/alpaca.js +3 -2
- package/dist/cjs/src/ascendex.js +102 -116
- package/dist/cjs/src/bigone.js +1 -0
- package/dist/cjs/src/bingx.js +32 -17
- package/dist/cjs/src/bit2c.js +1 -0
- package/dist/cjs/src/bitbank.js +1 -0
- package/dist/cjs/src/bitfinex.js +1 -0
- package/dist/cjs/src/bitfinex2.js +21 -22
- package/dist/cjs/src/bitflyer.js +1 -0
- package/dist/cjs/src/bitget.js +3 -2
- package/dist/cjs/src/bitmart.js +6 -9
- package/dist/cjs/src/bitmex.js +1 -0
- package/dist/cjs/src/bitopro.js +1 -0
- package/dist/cjs/src/bitrue.js +62 -71
- package/dist/cjs/src/bitso.js +1 -0
- package/dist/cjs/src/bitstamp.js +1 -0
- package/dist/cjs/src/bitvavo.js +1 -0
- 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/bybit.js +2 -0
- package/dist/cjs/src/cex.js +1 -0
- package/dist/cjs/src/coinbaseexchange.js +1 -0
- package/dist/cjs/src/coinbaseinternational.js +2 -1
- package/dist/cjs/src/coinex.js +1 -17
- package/dist/cjs/src/cryptocom.js +0 -12
- package/dist/cjs/src/hitbtc.js +1 -0
- package/dist/cjs/src/htx.js +49 -49
- package/dist/cjs/src/huobijp.js +0 -9
- package/dist/cjs/src/kraken.js +48 -48
- package/dist/cjs/src/latoken.js +1 -0
- package/dist/cjs/src/mexc.js +1 -61
- package/dist/cjs/src/okcoin.js +4 -9
- package/dist/cjs/src/okx.js +1 -8
- package/dist/cjs/src/onetrading.js +1 -0
- package/dist/cjs/src/phemex.js +1 -0
- package/dist/cjs/src/poloniexfutures.js +1 -0
- package/dist/cjs/src/pro/binance.js +323 -0
- package/dist/cjs/src/pro/bingx.js +263 -91
- package/dist/cjs/src/pro/bithumb.js +5 -1
- package/dist/cjs/src/pro/bitvavo.js +1 -0
- package/dist/cjs/src/pro/bybit.js +291 -2
- package/dist/cjs/src/pro/cex.js +1 -0
- package/dist/cjs/src/pro/coinex.js +994 -679
- package/dist/cjs/src/pro/lbank.js +2 -3
- package/dist/cjs/src/pro/okx.js +159 -3
- package/dist/cjs/src/probit.js +1 -0
- package/dist/cjs/src/vertex.js +1 -0
- package/dist/cjs/src/whitebit.js +5 -3
- package/dist/cjs/src/woo.js +1 -0
- package/dist/cjs/src/woofipro.js +1 -0
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/ace.js +1 -0
- package/js/src/alpaca.js +3 -2
- package/js/src/ascendex.d.ts +0 -1
- package/js/src/ascendex.js +102 -116
- package/js/src/bigone.js +1 -0
- package/js/src/bingx.js +32 -17
- package/js/src/bit2c.js +1 -0
- package/js/src/bitbank.js +1 -0
- package/js/src/bitfinex.js +1 -0
- package/js/src/bitfinex2.d.ts +0 -1
- package/js/src/bitfinex2.js +21 -22
- package/js/src/bitflyer.js +1 -0
- package/js/src/bitget.js +3 -2
- package/js/src/bitmart.d.ts +0 -1
- package/js/src/bitmart.js +6 -9
- package/js/src/bitmex.js +1 -0
- package/js/src/bitopro.js +1 -0
- package/js/src/bitrue.d.ts +0 -1
- package/js/src/bitrue.js +62 -71
- package/js/src/bitso.js +1 -0
- package/js/src/bitstamp.js +1 -0
- package/js/src/bitvavo.js +1 -0
- 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/bybit.js +2 -0
- package/js/src/cex.js +1 -0
- package/js/src/coinbaseexchange.js +1 -0
- package/js/src/coinbaseinternational.js +2 -1
- package/js/src/coinex.d.ts +0 -2
- package/js/src/coinex.js +1 -17
- package/js/src/cryptocom.d.ts +0 -1
- package/js/src/cryptocom.js +0 -12
- package/js/src/hitbtc.js +1 -0
- package/js/src/htx.js +49 -49
- package/js/src/huobijp.d.ts +0 -1
- package/js/src/huobijp.js +0 -9
- package/js/src/kraken.js +48 -48
- package/js/src/latoken.js +1 -0
- package/js/src/mexc.js +1 -61
- package/js/src/okcoin.d.ts +0 -1
- package/js/src/okcoin.js +4 -9
- package/js/src/okx.d.ts +0 -1
- package/js/src/okx.js +1 -8
- package/js/src/onetrading.js +1 -0
- package/js/src/phemex.js +1 -0
- package/js/src/poloniexfutures.js +1 -0
- package/js/src/pro/binance.d.ts +9 -1
- package/js/src/pro/binance.js +327 -1
- package/js/src/pro/bingx.d.ts +2 -2
- package/js/src/pro/bingx.js +263 -91
- package/js/src/pro/bithumb.js +5 -1
- package/js/src/pro/bitvavo.js +1 -0
- package/js/src/pro/bybit.d.ts +12 -1
- package/js/src/pro/bybit.js +292 -3
- package/js/src/pro/cex.js +1 -0
- package/js/src/pro/coinex.d.ts +12 -6
- package/js/src/pro/coinex.js +996 -681
- package/js/src/pro/lbank.js +2 -3
- package/js/src/pro/okx.d.ts +7 -0
- package/js/src/pro/okx.js +162 -4
- package/js/src/probit.js +1 -0
- package/js/src/vertex.js +1 -0
- package/js/src/whitebit.js +5 -3
- package/js/src/woo.js +1 -0
- package/js/src/woofipro.js +1 -0
- package/package.json +1 -1
package/dist/cjs/ccxt.js
CHANGED
|
@@ -196,7 +196,7 @@ var xt$1 = require('./src/pro/xt.js');
|
|
|
196
196
|
|
|
197
197
|
//-----------------------------------------------------------------------------
|
|
198
198
|
// this is updated by vss.js when building
|
|
199
|
-
const version = '4.3.
|
|
199
|
+
const version = '4.3.90';
|
|
200
200
|
Exchange["default"].ccxtVersion = version;
|
|
201
201
|
const exchanges = {
|
|
202
202
|
'ace': ace,
|
package/dist/cjs/src/ace.js
CHANGED
|
@@ -673,6 +673,7 @@ class ace extends ace$1 {
|
|
|
673
673
|
* @name ace#fetchOrder
|
|
674
674
|
* @description fetches information on an order made by the user
|
|
675
675
|
* @see https://github.com/ace-exchange/ace-official-api-docs/blob/master/api_v2.md#open-api---order-status
|
|
676
|
+
* @param {string} id the order id
|
|
676
677
|
* @param {string} symbol unified symbol of the market the order was made in
|
|
677
678
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
678
679
|
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
package/dist/cjs/src/alpaca.js
CHANGED
|
@@ -557,8 +557,8 @@ class alpaca extends alpaca$1 {
|
|
|
557
557
|
// }
|
|
558
558
|
// }
|
|
559
559
|
//
|
|
560
|
-
const orderbooks = this.
|
|
561
|
-
const rawOrderbook = this.
|
|
560
|
+
const orderbooks = this.safeDict(response, 'orderbooks', {});
|
|
561
|
+
const rawOrderbook = this.safeDict(orderbooks, id, {});
|
|
562
562
|
const timestamp = this.parse8601(this.safeString(rawOrderbook, 't'));
|
|
563
563
|
return this.parseOrderBook(rawOrderbook, market['symbol'], timestamp, 'b', 'a', 'p', 's');
|
|
564
564
|
}
|
|
@@ -822,6 +822,7 @@ class alpaca extends alpaca$1 {
|
|
|
822
822
|
* @name alpaca#fetchOrder
|
|
823
823
|
* @description fetches information on an order made by the user
|
|
824
824
|
* @see https://docs.alpaca.markets/reference/getorderbyorderid
|
|
825
|
+
* @param {string} id the order id
|
|
825
826
|
* @param {string} symbol unified symbol of the market the order was made in
|
|
826
827
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
827
828
|
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
package/dist/cjs/src/ascendex.js
CHANGED
|
@@ -282,26 +282,17 @@ class ascendex extends ascendex$1 {
|
|
|
282
282
|
'SOL': 'Solana',
|
|
283
283
|
'AVAX': 'avalanche C chain',
|
|
284
284
|
'OMNI': 'Omni',
|
|
285
|
-
'TRC': 'TRC20',
|
|
285
|
+
// 'TRC': 'TRC20',
|
|
286
286
|
'TRX': 'TRC20',
|
|
287
|
-
'ERC': 'ERC20',
|
|
288
|
-
},
|
|
289
|
-
'networksById': {
|
|
290
|
-
'BEP20 (BSC)': 'BSC',
|
|
291
|
-
'arbitrum': 'ARB',
|
|
292
|
-
'Solana': 'SOL',
|
|
293
|
-
'avalanche C chain': 'AVAX',
|
|
294
|
-
'Omni': 'OMNI',
|
|
295
287
|
'TRC20': 'TRC20',
|
|
296
288
|
'ERC20': 'ERC20',
|
|
297
289
|
'GO20': 'GO20',
|
|
298
290
|
'BEP2': 'BEP2',
|
|
299
|
-
'
|
|
300
|
-
'
|
|
301
|
-
'
|
|
302
|
-
'
|
|
303
|
-
'
|
|
304
|
-
'Akash': 'AKT',
|
|
291
|
+
'BTC': 'Bitcoin',
|
|
292
|
+
'BCH': 'Bitcoin ABC',
|
|
293
|
+
'LTC': 'Litecoin',
|
|
294
|
+
'MATIC': 'Matic Network',
|
|
295
|
+
'AKT': 'Akash',
|
|
305
296
|
},
|
|
306
297
|
},
|
|
307
298
|
'exceptions': {
|
|
@@ -448,9 +439,9 @@ class ascendex extends ascendex$1 {
|
|
|
448
439
|
// ]
|
|
449
440
|
// }
|
|
450
441
|
//
|
|
451
|
-
const assetsData = this.
|
|
452
|
-
const marginData = this.
|
|
453
|
-
const cashData = this.
|
|
442
|
+
const assetsData = this.safeList(assets, 'data', []);
|
|
443
|
+
const marginData = this.safeList(margin, 'data', []);
|
|
444
|
+
const cashData = this.safeList(cash, 'data', []);
|
|
454
445
|
const assetsById = this.indexBy(assetsData, 'assetCode');
|
|
455
446
|
const marginById = this.indexBy(marginData, 'assetCode');
|
|
456
447
|
const cashById = this.indexBy(cashData, 'assetCode');
|
|
@@ -591,10 +582,10 @@ class ascendex extends ascendex$1 {
|
|
|
591
582
|
// ]
|
|
592
583
|
// }
|
|
593
584
|
//
|
|
594
|
-
const productsData = this.
|
|
585
|
+
const productsData = this.safeList(products, 'data', []);
|
|
595
586
|
const productsById = this.indexBy(productsData, 'symbol');
|
|
596
|
-
const cashData = this.
|
|
597
|
-
const perpetualsData = this.
|
|
587
|
+
const cashData = this.safeList(cash, 'data', []);
|
|
588
|
+
const perpetualsData = this.safeList(perpetuals, 'data', []);
|
|
598
589
|
const cashAndPerpetualsData = this.arrayConcat(cashData, perpetualsData);
|
|
599
590
|
const cashAndPerpetualsById = this.indexBy(cashAndPerpetualsData, 'symbol');
|
|
600
591
|
const dataById = this.deepExtend(productsById, cashAndPerpetualsById);
|
|
@@ -603,7 +594,7 @@ class ascendex extends ascendex$1 {
|
|
|
603
594
|
for (let i = 0; i < ids.length; i++) {
|
|
604
595
|
const id = ids[i];
|
|
605
596
|
const market = dataById[id];
|
|
606
|
-
const settleId = this.
|
|
597
|
+
const settleId = this.safeString(market, 'settlementAsset');
|
|
607
598
|
const settle = this.safeCurrencyCode(settleId);
|
|
608
599
|
const status = this.safeString(market, 'status');
|
|
609
600
|
const domain = this.safeString(market, 'domain');
|
|
@@ -626,10 +617,10 @@ class ascendex extends ascendex$1 {
|
|
|
626
617
|
const quote = this.safeCurrencyCode(quoteId);
|
|
627
618
|
let symbol = base + '/' + quote;
|
|
628
619
|
if (swap) {
|
|
629
|
-
const lotSizeFilter = this.
|
|
620
|
+
const lotSizeFilter = this.safeDict(market, 'lotSizeFilter');
|
|
630
621
|
minQty = this.safeNumber(lotSizeFilter, 'minQty');
|
|
631
622
|
maxQty = this.safeNumber(lotSizeFilter, 'maxQty');
|
|
632
|
-
const priceFilter = this.
|
|
623
|
+
const priceFilter = this.safeDict(market, 'priceFilter');
|
|
633
624
|
minPrice = this.safeNumber(priceFilter, 'minPrice');
|
|
634
625
|
maxPrice = this.safeNumber(priceFilter, 'maxPrice');
|
|
635
626
|
symbol = base + '/' + quote + ':' + settle;
|
|
@@ -712,7 +703,7 @@ class ascendex extends ascendex$1 {
|
|
|
712
703
|
// }
|
|
713
704
|
// }
|
|
714
705
|
//
|
|
715
|
-
const data = this.
|
|
706
|
+
const data = this.safeDict(response, 'data', {});
|
|
716
707
|
return this.safeInteger(data, 'requestReceiveAt');
|
|
717
708
|
}
|
|
718
709
|
async fetchAccounts(params = {}) {
|
|
@@ -743,7 +734,7 @@ class ascendex extends ascendex$1 {
|
|
|
743
734
|
// }
|
|
744
735
|
// }
|
|
745
736
|
//
|
|
746
|
-
const data = this.
|
|
737
|
+
const data = this.safeDict(response, 'data', {});
|
|
747
738
|
accountGroup = this.safeString(data, 'accountGroup');
|
|
748
739
|
this.options['account-group'] = accountGroup;
|
|
749
740
|
}
|
|
@@ -762,7 +753,7 @@ class ascendex extends ascendex$1 {
|
|
|
762
753
|
'timestamp': undefined,
|
|
763
754
|
'datetime': undefined,
|
|
764
755
|
};
|
|
765
|
-
const balances = this.
|
|
756
|
+
const balances = this.safeList(response, 'data', []);
|
|
766
757
|
for (let i = 0; i < balances.length; i++) {
|
|
767
758
|
const balance = balances[i];
|
|
768
759
|
const code = this.safeCurrencyCode(this.safeString(balance, 'asset'));
|
|
@@ -779,7 +770,7 @@ class ascendex extends ascendex$1 {
|
|
|
779
770
|
'timestamp': undefined,
|
|
780
771
|
'datetime': undefined,
|
|
781
772
|
};
|
|
782
|
-
const balances = this.
|
|
773
|
+
const balances = this.safeList(response, 'data', []);
|
|
783
774
|
for (let i = 0; i < balances.length; i++) {
|
|
784
775
|
const balance = balances[i];
|
|
785
776
|
const code = this.safeCurrencyCode(this.safeString(balance, 'asset'));
|
|
@@ -799,8 +790,8 @@ class ascendex extends ascendex$1 {
|
|
|
799
790
|
'timestamp': undefined,
|
|
800
791
|
'datetime': undefined,
|
|
801
792
|
};
|
|
802
|
-
const data = this.
|
|
803
|
-
const collaterals = this.
|
|
793
|
+
const data = this.safeDict(response, 'data', {});
|
|
794
|
+
const collaterals = this.safeList(data, 'collaterals', []);
|
|
804
795
|
for (let i = 0; i < collaterals.length; i++) {
|
|
805
796
|
const balance = collaterals[i];
|
|
806
797
|
const code = this.safeCurrencyCode(this.safeString(balance, 'asset'));
|
|
@@ -833,9 +824,9 @@ class ascendex extends ascendex$1 {
|
|
|
833
824
|
const isCross = marginMode === 'cross';
|
|
834
825
|
marketType = (isMargin || isCross) ? 'margin' : marketType;
|
|
835
826
|
params = this.omit(params, 'margin');
|
|
836
|
-
const accountsByType = this.
|
|
827
|
+
const accountsByType = this.safeDict(this.options, 'accountsByType', {});
|
|
837
828
|
const accountCategory = this.safeString(accountsByType, marketType, 'cash');
|
|
838
|
-
const account = this.
|
|
829
|
+
const account = this.safeDict(this.accounts, 0, {});
|
|
839
830
|
const accountGroup = this.safeString(account, 'id');
|
|
840
831
|
const request = {
|
|
841
832
|
'account-group': accountGroup,
|
|
@@ -948,8 +939,8 @@ class ascendex extends ascendex$1 {
|
|
|
948
939
|
// }
|
|
949
940
|
// }
|
|
950
941
|
//
|
|
951
|
-
const data = this.
|
|
952
|
-
const orderbook = this.
|
|
942
|
+
const data = this.safeDict(response, 'data', {});
|
|
943
|
+
const orderbook = this.safeDict(data, 'data', {});
|
|
953
944
|
const timestamp = this.safeInteger(orderbook, 'ts');
|
|
954
945
|
const result = this.parseOrderBook(orderbook, symbol, timestamp);
|
|
955
946
|
result['nonce'] = this.safeInteger(orderbook, 'seqnum');
|
|
@@ -975,8 +966,8 @@ class ascendex extends ascendex$1 {
|
|
|
975
966
|
const delimiter = (type === 'spot') ? '/' : undefined;
|
|
976
967
|
const symbol = this.safeSymbol(marketId, market, delimiter);
|
|
977
968
|
const close = this.safeString(ticker, 'close');
|
|
978
|
-
const bid = this.
|
|
979
|
-
const ask = this.
|
|
969
|
+
const bid = this.safeList(ticker, 'bid', []);
|
|
970
|
+
const ask = this.safeList(ticker, 'ask', []);
|
|
980
971
|
const open = this.safeString(ticker, 'open');
|
|
981
972
|
return this.safeTicker({
|
|
982
973
|
'symbol': symbol,
|
|
@@ -1050,7 +1041,7 @@ class ascendex extends ascendex$1 {
|
|
|
1050
1041
|
const request = {};
|
|
1051
1042
|
let market = undefined;
|
|
1052
1043
|
if (symbols !== undefined) {
|
|
1053
|
-
const symbol = this.
|
|
1044
|
+
const symbol = this.safeString(symbols, 0);
|
|
1054
1045
|
market = this.market(symbol);
|
|
1055
1046
|
const marketIds = this.marketIds(symbols);
|
|
1056
1047
|
request['symbol'] = marketIds.join(',');
|
|
@@ -1067,22 +1058,20 @@ class ascendex extends ascendex$1 {
|
|
|
1067
1058
|
//
|
|
1068
1059
|
// {
|
|
1069
1060
|
// "code":0,
|
|
1070
|
-
// "data":
|
|
1071
|
-
//
|
|
1072
|
-
//
|
|
1073
|
-
//
|
|
1074
|
-
//
|
|
1075
|
-
//
|
|
1076
|
-
//
|
|
1077
|
-
//
|
|
1078
|
-
//
|
|
1079
|
-
//
|
|
1080
|
-
//
|
|
1081
|
-
// }
|
|
1082
|
-
// ]
|
|
1061
|
+
// "data": {
|
|
1062
|
+
// "symbol":"QTUM/BTC",
|
|
1063
|
+
// "open":"0.00016537",
|
|
1064
|
+
// "close":"0.00019077",
|
|
1065
|
+
// "high":"0.000192",
|
|
1066
|
+
// "low":"0.00016537",
|
|
1067
|
+
// "volume":"846.6",
|
|
1068
|
+
// "ask":["0.00018698","26.2"],
|
|
1069
|
+
// "bid":["0.00018408","503.7"],
|
|
1070
|
+
// "type":"spot"
|
|
1071
|
+
// }
|
|
1083
1072
|
// }
|
|
1084
1073
|
//
|
|
1085
|
-
const data = this.
|
|
1074
|
+
const data = this.safeList(response, 'data', []);
|
|
1086
1075
|
if (!Array.isArray(data)) {
|
|
1087
1076
|
return this.parseTickers([data], symbols);
|
|
1088
1077
|
}
|
|
@@ -1104,7 +1093,7 @@ class ascendex extends ascendex$1 {
|
|
|
1104
1093
|
// }
|
|
1105
1094
|
// }
|
|
1106
1095
|
//
|
|
1107
|
-
const data = this.
|
|
1096
|
+
const data = this.safeDict(ohlcv, 'data', {});
|
|
1108
1097
|
return [
|
|
1109
1098
|
this.safeInteger(data, 'ts'),
|
|
1110
1099
|
this.safeNumber(data, 'o'),
|
|
@@ -1135,7 +1124,7 @@ class ascendex extends ascendex$1 {
|
|
|
1135
1124
|
// if since and limit are not specified
|
|
1136
1125
|
// the exchange will return just 1 last candle by default
|
|
1137
1126
|
const duration = this.parseTimeframe(timeframe);
|
|
1138
|
-
const options = this.
|
|
1127
|
+
const options = this.safeDict(this.options, 'fetchOHLCV', {});
|
|
1139
1128
|
const defaultLimit = this.safeInteger(options, 'limit', 500);
|
|
1140
1129
|
if (since !== undefined) {
|
|
1141
1130
|
request['from'] = since;
|
|
@@ -1243,7 +1232,7 @@ class ascendex extends ascendex$1 {
|
|
|
1243
1232
|
// }
|
|
1244
1233
|
// }
|
|
1245
1234
|
//
|
|
1246
|
-
const records = this.
|
|
1235
|
+
const records = this.safeDict(response, 'data', {});
|
|
1247
1236
|
const trades = this.safeList(records, 'data', []);
|
|
1248
1237
|
return this.parseTrades(trades, market, since, limit);
|
|
1249
1238
|
}
|
|
@@ -1449,7 +1438,7 @@ class ascendex extends ascendex$1 {
|
|
|
1449
1438
|
*/
|
|
1450
1439
|
await this.loadMarkets();
|
|
1451
1440
|
await this.loadAccounts();
|
|
1452
|
-
const account = this.
|
|
1441
|
+
const account = this.safeDict(this.accounts, 0, {});
|
|
1453
1442
|
const accountGroup = this.safeString(account, 'id');
|
|
1454
1443
|
const request = {
|
|
1455
1444
|
'account-group': accountGroup,
|
|
@@ -1471,14 +1460,14 @@ class ascendex extends ascendex$1 {
|
|
|
1471
1460
|
// }
|
|
1472
1461
|
// }
|
|
1473
1462
|
//
|
|
1474
|
-
const data = this.
|
|
1475
|
-
const fees = this.
|
|
1463
|
+
const data = this.safeDict(response, 'data', {});
|
|
1464
|
+
const fees = this.safeList(data, 'fees', []);
|
|
1476
1465
|
const result = {};
|
|
1477
1466
|
for (let i = 0; i < fees.length; i++) {
|
|
1478
1467
|
const fee = fees[i];
|
|
1479
1468
|
const marketId = this.safeString(fee, 'symbol');
|
|
1480
1469
|
const symbol = this.safeSymbol(marketId, undefined, '/');
|
|
1481
|
-
const takerMaker = this.
|
|
1470
|
+
const takerMaker = this.safeDict(fee, 'fee', {});
|
|
1482
1471
|
result[symbol] = {
|
|
1483
1472
|
'info': fee,
|
|
1484
1473
|
'symbol': symbol,
|
|
@@ -1512,13 +1501,13 @@ class ascendex extends ascendex$1 {
|
|
|
1512
1501
|
let marketType = undefined;
|
|
1513
1502
|
[marginMode, params] = this.handleMarginModeAndParams('createOrderRequest', params);
|
|
1514
1503
|
[marketType, params] = this.handleMarketTypeAndParams('createOrderRequest', market, params);
|
|
1515
|
-
const accountsByType = this.
|
|
1504
|
+
const accountsByType = this.safeDict(this.options, 'accountsByType', {});
|
|
1516
1505
|
let accountCategory = this.safeString(accountsByType, marketType, 'cash');
|
|
1517
1506
|
if (marginMode !== undefined) {
|
|
1518
1507
|
accountCategory = 'margin';
|
|
1519
1508
|
}
|
|
1520
|
-
const account = this.
|
|
1521
|
-
const accountGroup = this.
|
|
1509
|
+
const account = this.safeDict(this.accounts, 0, {});
|
|
1510
|
+
const accountGroup = this.safeString(account, 'id');
|
|
1522
1511
|
const clientOrderId = this.safeString2(params, 'clientOrderId', 'id');
|
|
1523
1512
|
const request = {
|
|
1524
1513
|
'account-group': accountGroup,
|
|
@@ -1536,7 +1525,7 @@ class ascendex extends ascendex$1 {
|
|
|
1536
1525
|
const timeInForce = this.safeString(params, 'timeInForce');
|
|
1537
1526
|
const postOnly = this.isPostOnly(isMarketOrder, false, params);
|
|
1538
1527
|
const reduceOnly = this.safeBool(params, 'reduceOnly', false);
|
|
1539
|
-
const stopPrice = this.
|
|
1528
|
+
const stopPrice = this.safeString2(params, 'triggerPrice', 'stopPrice');
|
|
1540
1529
|
if (isLimitOrder) {
|
|
1541
1530
|
request['orderPrice'] = this.priceToPrecision(symbol, price);
|
|
1542
1531
|
}
|
|
@@ -1674,8 +1663,8 @@ class ascendex extends ascendex$1 {
|
|
|
1674
1663
|
// }
|
|
1675
1664
|
// }
|
|
1676
1665
|
//
|
|
1677
|
-
const data = this.
|
|
1678
|
-
const order = this.
|
|
1666
|
+
const data = this.safeDict(response, 'data', {});
|
|
1667
|
+
const order = this.safeDict2(data, 'order', 'info', {});
|
|
1679
1668
|
return this.parseOrder(order, market);
|
|
1680
1669
|
}
|
|
1681
1670
|
async createOrders(orders, params = {}) {
|
|
@@ -1710,9 +1699,9 @@ class ascendex extends ascendex$1 {
|
|
|
1710
1699
|
}
|
|
1711
1700
|
const type = this.safeString(rawOrder, 'type');
|
|
1712
1701
|
const side = this.safeString(rawOrder, 'side');
|
|
1713
|
-
const amount = this.
|
|
1714
|
-
const price = this.
|
|
1715
|
-
const orderParams = this.
|
|
1702
|
+
const amount = this.safeNumber(rawOrder, 'amount');
|
|
1703
|
+
const price = this.safeNumber(rawOrder, 'price');
|
|
1704
|
+
const orderParams = this.safeDict(rawOrder, 'params', {});
|
|
1716
1705
|
const marginResult = this.handleMarginModeAndParams('createOrders', orderParams);
|
|
1717
1706
|
const currentMarginMode = marginResult[0];
|
|
1718
1707
|
if (currentMarginMode !== undefined) {
|
|
@@ -1729,13 +1718,13 @@ class ascendex extends ascendex$1 {
|
|
|
1729
1718
|
ordersRequests.push(orderRequest);
|
|
1730
1719
|
}
|
|
1731
1720
|
const market = this.market(symbol);
|
|
1732
|
-
const accountsByType = this.
|
|
1721
|
+
const accountsByType = this.safeDict(this.options, 'accountsByType', {});
|
|
1733
1722
|
let accountCategory = this.safeString(accountsByType, market['type'], 'cash');
|
|
1734
1723
|
if (marginMode !== undefined) {
|
|
1735
1724
|
accountCategory = 'margin';
|
|
1736
1725
|
}
|
|
1737
|
-
const account = this.
|
|
1738
|
-
const accountGroup = this.
|
|
1726
|
+
const account = this.safeDict(this.accounts, 0, {});
|
|
1727
|
+
const accountGroup = this.safeString(account, 'id');
|
|
1739
1728
|
const request = {};
|
|
1740
1729
|
let response = undefined;
|
|
1741
1730
|
if (market['swap']) {
|
|
@@ -1773,7 +1762,7 @@ class ascendex extends ascendex$1 {
|
|
|
1773
1762
|
// }
|
|
1774
1763
|
// }
|
|
1775
1764
|
//
|
|
1776
|
-
const data = this.
|
|
1765
|
+
const data = this.safeDict(response, 'data', {});
|
|
1777
1766
|
const info = this.safeList(data, 'info', []);
|
|
1778
1767
|
return this.parseOrders(info, market);
|
|
1779
1768
|
}
|
|
@@ -1784,6 +1773,7 @@ class ascendex extends ascendex$1 {
|
|
|
1784
1773
|
* @description fetches information on an order made by the user
|
|
1785
1774
|
* @see https://ascendex.github.io/ascendex-pro-api/#query-order
|
|
1786
1775
|
* @see https://ascendex.github.io/ascendex-futures-pro-api-v2/#query-order-by-id
|
|
1776
|
+
* @param {string} id the order id
|
|
1787
1777
|
* @param {string} symbol unified symbol of the market the order was made in
|
|
1788
1778
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1789
1779
|
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
@@ -1795,10 +1785,10 @@ class ascendex extends ascendex$1 {
|
|
|
1795
1785
|
market = this.market(symbol);
|
|
1796
1786
|
}
|
|
1797
1787
|
const [type, query] = this.handleMarketTypeAndParams('fetchOrder', market, params);
|
|
1798
|
-
const accountsByType = this.
|
|
1788
|
+
const accountsByType = this.safeDict(this.options, 'accountsByType', {});
|
|
1799
1789
|
const accountCategory = this.safeString(accountsByType, type, 'cash');
|
|
1800
|
-
const account = this.
|
|
1801
|
-
const accountGroup = this.
|
|
1790
|
+
const account = this.safeDict(this.accounts, 0, {});
|
|
1791
|
+
const accountGroup = this.safeString(account, 'id');
|
|
1802
1792
|
const request = {
|
|
1803
1793
|
'account-group': accountGroup,
|
|
1804
1794
|
'account-category': accountCategory,
|
|
@@ -1905,10 +1895,10 @@ class ascendex extends ascendex$1 {
|
|
|
1905
1895
|
market = this.market(symbol);
|
|
1906
1896
|
symbol = market['symbol'];
|
|
1907
1897
|
}
|
|
1908
|
-
const account = this.
|
|
1909
|
-
const accountGroup = this.
|
|
1898
|
+
const account = this.safeDict(this.accounts, 0, {});
|
|
1899
|
+
const accountGroup = this.safeString(account, 'id');
|
|
1910
1900
|
const [type, query] = this.handleMarketTypeAndParams('fetchOpenOrders', market, params);
|
|
1911
|
-
const accountsByType = this.
|
|
1901
|
+
const accountsByType = this.safeDict(this.options, 'accountsByType', {});
|
|
1912
1902
|
const accountCategory = this.safeString(accountsByType, type, 'cash');
|
|
1913
1903
|
const request = {
|
|
1914
1904
|
'account-group': accountGroup,
|
|
@@ -1992,7 +1982,7 @@ class ascendex extends ascendex$1 {
|
|
|
1992
1982
|
// ]
|
|
1993
1983
|
// }
|
|
1994
1984
|
//
|
|
1995
|
-
const data = this.
|
|
1985
|
+
const data = this.safeList(response, 'data', []);
|
|
1996
1986
|
if (accountCategory === 'futures') {
|
|
1997
1987
|
return this.parseOrders(data, market, since, limit);
|
|
1998
1988
|
}
|
|
@@ -2020,8 +2010,8 @@ class ascendex extends ascendex$1 {
|
|
|
2020
2010
|
*/
|
|
2021
2011
|
await this.loadMarkets();
|
|
2022
2012
|
await this.loadAccounts();
|
|
2023
|
-
const account = this.
|
|
2024
|
-
const accountGroup = this.
|
|
2013
|
+
const account = this.safeDict(this.accounts, 0, {});
|
|
2014
|
+
const accountGroup = this.safeString(account, 'id');
|
|
2025
2015
|
const request = {
|
|
2026
2016
|
// 'category': accountCategory,
|
|
2027
2017
|
// 'symbol': market['id'],
|
|
@@ -2039,7 +2029,7 @@ class ascendex extends ascendex$1 {
|
|
|
2039
2029
|
request['symbol'] = market['id'];
|
|
2040
2030
|
}
|
|
2041
2031
|
const [type, query] = this.handleMarketTypeAndParams('fetchClosedOrders', market, params);
|
|
2042
|
-
const options = this.
|
|
2032
|
+
const options = this.safeDict(this.options, 'fetchClosedOrders', {});
|
|
2043
2033
|
const defaultMethod = this.safeString(options, 'method', 'v2PrivateDataGetOrderHist');
|
|
2044
2034
|
const method = this.getSupportedMapping(type, {
|
|
2045
2035
|
'spot': defaultMethod,
|
|
@@ -2053,7 +2043,7 @@ class ascendex extends ascendex$1 {
|
|
|
2053
2043
|
if (until !== undefined) {
|
|
2054
2044
|
request['endTime'] = until;
|
|
2055
2045
|
}
|
|
2056
|
-
const accountsByType = this.
|
|
2046
|
+
const accountsByType = this.safeDict(this.options, 'accountsByType', {});
|
|
2057
2047
|
const accountCategory = this.safeString(accountsByType, type, 'cash'); // margin, futures
|
|
2058
2048
|
let response = undefined;
|
|
2059
2049
|
if (method === 'v1PrivateAccountCategoryGetOrderHistCurrent') {
|
|
@@ -2173,10 +2163,10 @@ class ascendex extends ascendex$1 {
|
|
|
2173
2163
|
// ]
|
|
2174
2164
|
// }
|
|
2175
2165
|
//
|
|
2176
|
-
let data = this.
|
|
2166
|
+
let data = this.safeList(response, 'data', []);
|
|
2177
2167
|
const isArray = Array.isArray(data);
|
|
2178
2168
|
if (!isArray) {
|
|
2179
|
-
data = this.
|
|
2169
|
+
data = this.safeList(data, 'data', []);
|
|
2180
2170
|
}
|
|
2181
2171
|
return this.parseOrders(data, market, since, limit);
|
|
2182
2172
|
}
|
|
@@ -2199,10 +2189,10 @@ class ascendex extends ascendex$1 {
|
|
|
2199
2189
|
await this.loadAccounts();
|
|
2200
2190
|
const market = this.market(symbol);
|
|
2201
2191
|
const [type, query] = this.handleMarketTypeAndParams('cancelOrder', market, params);
|
|
2202
|
-
const accountsByType = this.
|
|
2192
|
+
const accountsByType = this.safeDict(this.options, 'accountsByType', {});
|
|
2203
2193
|
const accountCategory = this.safeString(accountsByType, type, 'cash');
|
|
2204
|
-
const account = this.
|
|
2205
|
-
const accountGroup = this.
|
|
2194
|
+
const account = this.safeDict(this.accounts, 0, {});
|
|
2195
|
+
const accountGroup = this.safeString(account, 'id');
|
|
2206
2196
|
const request = {
|
|
2207
2197
|
'account-group': accountGroup,
|
|
2208
2198
|
'account-category': accountCategory,
|
|
@@ -2292,8 +2282,8 @@ class ascendex extends ascendex$1 {
|
|
|
2292
2282
|
// }
|
|
2293
2283
|
// }
|
|
2294
2284
|
//
|
|
2295
|
-
const data = this.
|
|
2296
|
-
const order = this.
|
|
2285
|
+
const data = this.safeDict(response, 'data', {});
|
|
2286
|
+
const order = this.safeDict2(data, 'order', 'info', {});
|
|
2297
2287
|
return this.parseOrder(order, market);
|
|
2298
2288
|
}
|
|
2299
2289
|
async cancelAllOrders(symbol = undefined, params = {}) {
|
|
@@ -2314,10 +2304,10 @@ class ascendex extends ascendex$1 {
|
|
|
2314
2304
|
market = this.market(symbol);
|
|
2315
2305
|
}
|
|
2316
2306
|
const [type, query] = this.handleMarketTypeAndParams('cancelAllOrders', market, params);
|
|
2317
|
-
const accountsByType = this.
|
|
2307
|
+
const accountsByType = this.safeDict(this.options, 'accountsByType', {});
|
|
2318
2308
|
const accountCategory = this.safeString(accountsByType, type, 'cash');
|
|
2319
|
-
const account = this.
|
|
2320
|
-
const accountGroup = this.
|
|
2309
|
+
const account = this.safeDict(this.accounts, 0, {});
|
|
2310
|
+
const accountGroup = this.safeString(account, 'id');
|
|
2321
2311
|
const request = {
|
|
2322
2312
|
'account-group': accountGroup,
|
|
2323
2313
|
'account-category': accountCategory,
|
|
@@ -2404,10 +2394,6 @@ class ascendex extends ascendex$1 {
|
|
|
2404
2394
|
'info': depositAddress,
|
|
2405
2395
|
};
|
|
2406
2396
|
}
|
|
2407
|
-
safeNetwork(networkId) {
|
|
2408
|
-
const networksById = this.safeDict(this.options, 'networksById');
|
|
2409
|
-
return this.safeString(networksById, networkId, networkId);
|
|
2410
|
-
}
|
|
2411
2397
|
async fetchDepositAddress(code, params = {}) {
|
|
2412
2398
|
/**
|
|
2413
2399
|
* @method
|
|
@@ -2573,7 +2559,7 @@ class ascendex extends ascendex$1 {
|
|
|
2573
2559
|
// }
|
|
2574
2560
|
// }
|
|
2575
2561
|
//
|
|
2576
|
-
const data = this.
|
|
2562
|
+
const data = this.safeDict(response, 'data', {});
|
|
2577
2563
|
const transactions = this.safeList(data, 'data', []);
|
|
2578
2564
|
return this.parseTransactions(transactions, currency, since, limit);
|
|
2579
2565
|
}
|
|
@@ -2605,7 +2591,7 @@ class ascendex extends ascendex$1 {
|
|
|
2605
2591
|
// }
|
|
2606
2592
|
// }
|
|
2607
2593
|
//
|
|
2608
|
-
const destAddress = this.
|
|
2594
|
+
const destAddress = this.safeDict(transaction, 'destAddress', {});
|
|
2609
2595
|
const address = this.safeString(destAddress, 'address');
|
|
2610
2596
|
const tag = this.safeString(destAddress, 'destTag');
|
|
2611
2597
|
const timestamp = this.safeInteger(transaction, 'time');
|
|
@@ -2652,7 +2638,7 @@ class ascendex extends ascendex$1 {
|
|
|
2652
2638
|
*/
|
|
2653
2639
|
await this.loadMarkets();
|
|
2654
2640
|
await this.loadAccounts();
|
|
2655
|
-
const account = this.
|
|
2641
|
+
const account = this.safeDict(this.accounts, 0, {});
|
|
2656
2642
|
const accountGroup = this.safeString(account, 'id');
|
|
2657
2643
|
const request = {
|
|
2658
2644
|
'account-group': accountGroup,
|
|
@@ -2697,8 +2683,8 @@ class ascendex extends ascendex$1 {
|
|
|
2697
2683
|
// }
|
|
2698
2684
|
// }
|
|
2699
2685
|
//
|
|
2700
|
-
const data = this.
|
|
2701
|
-
const position = this.
|
|
2686
|
+
const data = this.safeDict(response, 'data', {});
|
|
2687
|
+
const position = this.safeList(data, 'contracts', []);
|
|
2702
2688
|
const result = [];
|
|
2703
2689
|
for (let i = 0; i < position.length; i++) {
|
|
2704
2690
|
result.push(this.parsePosition(position[i]));
|
|
@@ -2844,8 +2830,8 @@ class ascendex extends ascendex$1 {
|
|
|
2844
2830
|
// }
|
|
2845
2831
|
// }
|
|
2846
2832
|
//
|
|
2847
|
-
const data = this.
|
|
2848
|
-
const contracts = this.
|
|
2833
|
+
const data = this.safeDict(response, 'data', {});
|
|
2834
|
+
const contracts = this.safeList(data, 'contracts', []);
|
|
2849
2835
|
const result = this.parseFundingRates(contracts);
|
|
2850
2836
|
return this.filterByArray(result, 'symbol', symbols);
|
|
2851
2837
|
}
|
|
@@ -2853,7 +2839,7 @@ class ascendex extends ascendex$1 {
|
|
|
2853
2839
|
await this.loadMarkets();
|
|
2854
2840
|
await this.loadAccounts();
|
|
2855
2841
|
const market = this.market(symbol);
|
|
2856
|
-
const account = this.
|
|
2842
|
+
const account = this.safeDict(this.accounts, 0, {});
|
|
2857
2843
|
const accountGroup = this.safeString(account, 'id');
|
|
2858
2844
|
amount = this.amountToPrecision(symbol, amount);
|
|
2859
2845
|
const request = {
|
|
@@ -2947,7 +2933,7 @@ class ascendex extends ascendex$1 {
|
|
|
2947
2933
|
if (!market['swap']) {
|
|
2948
2934
|
throw new errors.BadSymbol(this.id + ' setLeverage() supports swap contracts only');
|
|
2949
2935
|
}
|
|
2950
|
-
const account = this.
|
|
2936
|
+
const account = this.safeDict(this.accounts, 0, {});
|
|
2951
2937
|
const accountGroup = this.safeString(account, 'id');
|
|
2952
2938
|
const request = {
|
|
2953
2939
|
'account-group': accountGroup,
|
|
@@ -2980,7 +2966,7 @@ class ascendex extends ascendex$1 {
|
|
|
2980
2966
|
await this.loadMarkets();
|
|
2981
2967
|
await this.loadAccounts();
|
|
2982
2968
|
const market = this.market(symbol);
|
|
2983
|
-
const account = this.
|
|
2969
|
+
const account = this.safeDict(this.accounts, 0, {});
|
|
2984
2970
|
const accountGroup = this.safeString(account, 'id');
|
|
2985
2971
|
const request = {
|
|
2986
2972
|
'account-group': accountGroup,
|
|
@@ -3031,7 +3017,7 @@ class ascendex extends ascendex$1 {
|
|
|
3031
3017
|
// ]
|
|
3032
3018
|
// }
|
|
3033
3019
|
//
|
|
3034
|
-
const data = this.
|
|
3020
|
+
const data = this.safeList(response, 'data', []);
|
|
3035
3021
|
symbols = this.marketSymbols(symbols);
|
|
3036
3022
|
return this.parseLeverageTiers(data, symbols, 'symbol');
|
|
3037
3023
|
}
|
|
@@ -3063,7 +3049,7 @@ class ascendex extends ascendex$1 {
|
|
|
3063
3049
|
// ]
|
|
3064
3050
|
// }
|
|
3065
3051
|
//
|
|
3066
|
-
const marginRequirements = this.
|
|
3052
|
+
const marginRequirements = this.safeList(info, 'marginRequirements', []);
|
|
3067
3053
|
const id = this.safeString(info, 'symbol');
|
|
3068
3054
|
market = this.safeMarket(id, market);
|
|
3069
3055
|
const tiers = [];
|
|
@@ -3102,7 +3088,7 @@ class ascendex extends ascendex$1 {
|
|
|
3102
3088
|
// ]
|
|
3103
3089
|
// }
|
|
3104
3090
|
//
|
|
3105
|
-
const blockChains = this.
|
|
3091
|
+
const blockChains = this.safeList(fee, 'blockChain', []);
|
|
3106
3092
|
const blockChainsLength = blockChains.length;
|
|
3107
3093
|
const result = {
|
|
3108
3094
|
'info': fee,
|
|
@@ -3161,10 +3147,10 @@ class ascendex extends ascendex$1 {
|
|
|
3161
3147
|
*/
|
|
3162
3148
|
await this.loadMarkets();
|
|
3163
3149
|
await this.loadAccounts();
|
|
3164
|
-
const account = this.
|
|
3150
|
+
const account = this.safeDict(this.accounts, 0, {});
|
|
3165
3151
|
const accountGroup = this.safeString(account, 'id');
|
|
3166
3152
|
const currency = this.currency(code);
|
|
3167
|
-
const accountsByType = this.
|
|
3153
|
+
const accountsByType = this.safeDict(this.options, 'accountsByType', {});
|
|
3168
3154
|
const fromId = this.safeString(accountsByType, fromAccount, fromAccount);
|
|
3169
3155
|
const toId = this.safeString(accountsByType, toAccount, toAccount);
|
|
3170
3156
|
if (fromId !== 'cash' && toId !== 'cash') {
|
|
@@ -3181,7 +3167,7 @@ class ascendex extends ascendex$1 {
|
|
|
3181
3167
|
//
|
|
3182
3168
|
// { "code": "0" }
|
|
3183
3169
|
//
|
|
3184
|
-
const transferOptions = this.
|
|
3170
|
+
const transferOptions = this.safeDict(this.options, 'transfer', {});
|
|
3185
3171
|
const fillResponseFromRequest = this.safeBool(transferOptions, 'fillResponseFromRequest', true);
|
|
3186
3172
|
const transfer = this.parseTransfer(response, currency);
|
|
3187
3173
|
if (fillResponseFromRequest) {
|
|
@@ -3236,7 +3222,7 @@ class ascendex extends ascendex$1 {
|
|
|
3236
3222
|
if (paginate) {
|
|
3237
3223
|
return await this.fetchPaginatedCallIncremental('fetchFundingHistory', symbol, since, limit, params, 'page', 25);
|
|
3238
3224
|
}
|
|
3239
|
-
const account = this.
|
|
3225
|
+
const account = this.safeDict(this.accounts, 0, {});
|
|
3240
3226
|
const accountGroup = this.safeString(account, 'id');
|
|
3241
3227
|
const request = {
|
|
3242
3228
|
'account-group': accountGroup,
|
|
@@ -3268,7 +3254,7 @@ class ascendex extends ascendex$1 {
|
|
|
3268
3254
|
// }
|
|
3269
3255
|
// }
|
|
3270
3256
|
//
|
|
3271
|
-
const data = this.
|
|
3257
|
+
const data = this.safeDict(response, 'data', {});
|
|
3272
3258
|
const rows = this.safeList(data, 'data', []);
|
|
3273
3259
|
return this.parseIncomes(rows, market, since, limit);
|
|
3274
3260
|
}
|
|
@@ -3305,7 +3291,7 @@ class ascendex extends ascendex$1 {
|
|
|
3305
3291
|
*/
|
|
3306
3292
|
await this.loadMarkets();
|
|
3307
3293
|
await this.loadAccounts();
|
|
3308
|
-
const account = this.
|
|
3294
|
+
const account = this.safeDict(this.accounts, 0, {});
|
|
3309
3295
|
const accountGroup = this.safeString(account, 'id');
|
|
3310
3296
|
const request = {
|
|
3311
3297
|
'account-group': accountGroup,
|
|
@@ -3376,7 +3362,7 @@ class ascendex extends ascendex$1 {
|
|
|
3376
3362
|
*/
|
|
3377
3363
|
await this.loadMarkets();
|
|
3378
3364
|
await this.loadAccounts();
|
|
3379
|
-
const account = this.
|
|
3365
|
+
const account = this.safeDict(this.accounts, 0, {});
|
|
3380
3366
|
const accountGroup = this.safeString(account, 'id');
|
|
3381
3367
|
const request = {
|
|
3382
3368
|
'account-group': accountGroup,
|