ccxt 4.4.82 → 4.4.86
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -9
- package/dist/ccxt.browser.min.js +7 -7
- package/dist/cjs/ccxt.js +6 -17
- package/dist/cjs/src/abstract/bittrade.js +9 -0
- package/dist/cjs/src/apex.js +2 -1
- package/dist/cjs/src/ascendex.js +189 -155
- package/dist/cjs/src/base/Exchange.js +15 -2
- package/dist/cjs/src/bequant.js +1 -1
- package/dist/cjs/src/bitget.js +6 -7
- package/dist/cjs/src/bitmart.js +1 -1
- package/dist/cjs/src/bitrue.js +14 -35
- package/dist/cjs/src/bitso.js +33 -0
- package/dist/cjs/src/bitstamp.js +33 -0
- package/dist/cjs/src/bittrade.js +2049 -0
- package/dist/cjs/src/blofin.js +154 -13
- package/dist/cjs/src/btcbox.js +25 -5
- package/dist/cjs/src/bybit.js +16 -40
- package/dist/cjs/src/cex.js +2 -4
- package/dist/cjs/src/coinbase.js +58 -46
- package/dist/cjs/src/coinbaseexchange.js +142 -32
- package/dist/cjs/src/coincatch.js +14 -67
- package/dist/cjs/src/coinex.js +29 -32
- package/dist/cjs/src/coinlist.js +16 -15
- package/dist/cjs/src/coinmetro.js +22 -11
- package/dist/cjs/src/coinone.js +8 -10
- package/dist/cjs/src/coinsph.js +126 -1
- package/dist/cjs/src/cryptocom.js +111 -1
- package/dist/cjs/src/cryptomus.js +43 -89
- package/dist/cjs/src/delta.js +76 -36
- package/dist/cjs/src/deribit.js +4 -5
- package/dist/cjs/src/derive.js +46 -10
- package/dist/cjs/src/ellipx.js +175 -79
- package/dist/cjs/src/gate.js +1 -1
- package/dist/cjs/src/gemini.js +3 -5
- package/dist/cjs/src/hitbtc.js +56 -69
- package/dist/cjs/src/hollaex.js +107 -49
- package/dist/cjs/src/htx.js +20 -44
- package/dist/cjs/src/hyperliquid.js +6 -6
- package/dist/cjs/src/kraken.js +29 -24
- package/dist/cjs/src/kucoinfutures.js +6 -0
- package/dist/cjs/src/lbank.js +1 -1
- package/dist/cjs/src/mexc.js +2 -2
- package/dist/cjs/src/ndax.js +25 -24
- package/dist/cjs/src/okcoin.js +12 -31
- package/dist/cjs/src/okx.js +9 -0
- package/dist/cjs/src/onetrading.js +9 -6
- package/dist/cjs/src/oxfun.js +42 -114
- package/dist/cjs/src/paradex.js +124 -4
- package/dist/cjs/src/pro/binance.js +32 -33
- package/dist/cjs/src/pro/bithumb.js +5 -3
- package/dist/cjs/src/pro/bittrade.js +605 -0
- package/dist/cjs/src/pro/kraken.js +289 -79
- package/dist/cjs/src/pro/luno.js +6 -5
- package/dist/cjs/src/pro/mexc.js +304 -7
- package/dist/cjs/src/pro/poloniex.js +6 -2
- package/examples/js/cli.js +127 -13
- package/js/ccxt.d.ts +8 -20
- package/js/ccxt.js +6 -14
- package/js/src/abstract/blofin.d.ts +8 -0
- package/js/src/abstract/btcbox.d.ts +1 -0
- package/js/src/abstract/myokx.d.ts +2 -0
- package/js/src/abstract/okx.d.ts +2 -0
- package/js/src/apex.js +2 -1
- package/js/src/ascendex.d.ts +2 -0
- package/js/src/ascendex.js +189 -155
- package/js/src/base/Exchange.d.ts +15 -1
- package/js/src/base/Exchange.js +15 -2
- package/js/src/base/types.d.ts +3 -0
- package/js/src/bequant.js +1 -1
- package/js/src/bitget.js +6 -7
- package/js/src/bitmart.js +1 -1
- package/js/src/bitrue.js +14 -35
- package/js/src/bitso.js +33 -0
- package/js/src/bitstamp.js +33 -0
- package/js/src/{huobijp.d.ts → bittrade.d.ts} +29 -29
- package/js/src/{huobijp.js → bittrade.js} +35 -35
- package/js/src/blofin.d.ts +42 -2
- package/js/src/blofin.js +154 -13
- package/js/src/btcbox.js +25 -5
- package/js/src/bybit.js +16 -40
- package/js/src/cex.js +2 -4
- package/js/src/coinbase.js +58 -46
- package/js/src/coinbaseexchange.js +142 -32
- package/js/src/coincatch.js +14 -67
- package/js/src/coinex.js +28 -29
- package/js/src/coinlist.js +16 -15
- package/js/src/coinmetro.js +22 -11
- package/js/src/coinone.js +8 -10
- package/js/src/coinsph.d.ts +10 -1
- package/js/src/coinsph.js +126 -1
- package/js/src/cryptocom.d.ts +10 -1
- package/js/src/cryptocom.js +111 -1
- package/js/src/cryptomus.js +43 -89
- package/js/src/delta.js +76 -36
- package/js/src/deribit.js +4 -5
- package/js/src/derive.js +46 -10
- package/js/src/ellipx.d.ts +2 -3
- package/js/src/ellipx.js +175 -80
- package/js/src/gate.js +1 -1
- package/js/src/gemini.js +3 -5
- package/js/src/hitbtc.js +56 -69
- package/js/src/hollaex.js +107 -49
- package/js/src/htx.js +20 -44
- package/js/src/hyperliquid.js +6 -6
- package/js/src/kraken.js +29 -24
- package/js/src/kucoinfutures.d.ts +1 -0
- package/js/src/kucoinfutures.js +6 -0
- package/js/src/lbank.js +1 -1
- package/js/src/mexc.js +2 -2
- package/js/src/ndax.js +25 -24
- package/js/src/okcoin.js +12 -31
- package/js/src/okx.js +9 -0
- package/js/src/onetrading.js +9 -6
- package/js/src/oxfun.js +42 -114
- package/js/src/paradex.d.ts +12 -1
- package/js/src/paradex.js +124 -4
- package/js/src/pro/binance.d.ts +26 -26
- package/js/src/pro/binance.js +32 -33
- package/js/src/pro/bithumb.js +5 -3
- 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/kraken.d.ts +7 -6
- package/js/src/pro/kraken.js +290 -80
- package/js/src/pro/luno.js +6 -5
- package/js/src/pro/mexc.d.ts +58 -0
- package/js/src/pro/mexc.js +304 -7
- package/js/src/pro/poloniex.d.ts +1 -1
- package/js/src/pro/poloniex.js +6 -2
- package/package.json +1 -1
- package/js/src/abstract/bl3p.d.ts +0 -22
- package/js/src/abstract/huobijp.js +0 -11
- package/js/src/abstract/idex.d.ts +0 -29
- package/js/src/abstract/idex.js +0 -11
- package/js/src/abstract/kuna.d.ts +0 -185
- package/js/src/abstract/kuna.js +0 -11
- package/js/src/bl3p.d.ts +0 -116
- package/js/src/bl3p.js +0 -552
- package/js/src/idex.d.ts +0 -312
- package/js/src/idex.js +0 -1961
- package/js/src/kuna.d.ts +0 -335
- package/js/src/kuna.js +0 -2006
- package/js/src/pro/idex.d.ts +0 -81
- package/js/src/pro/idex.js +0 -720
- /package/js/src/abstract/{huobijp.d.ts → bittrade.d.ts} +0 -0
- /package/js/src/abstract/{bl3p.js → bittrade.js} +0 -0
package/dist/cjs/ccxt.js
CHANGED
|
@@ -36,8 +36,8 @@ var bitrue = require('./src/bitrue.js');
|
|
|
36
36
|
var bitso = require('./src/bitso.js');
|
|
37
37
|
var bitstamp = require('./src/bitstamp.js');
|
|
38
38
|
var bitteam = require('./src/bitteam.js');
|
|
39
|
+
var bittrade = require('./src/bittrade.js');
|
|
39
40
|
var bitvavo = require('./src/bitvavo.js');
|
|
40
|
-
var bl3p = require('./src/bl3p.js');
|
|
41
41
|
var blockchaincom = require('./src/blockchaincom.js');
|
|
42
42
|
var blofin = require('./src/blofin.js');
|
|
43
43
|
var btcalpha = require('./src/btcalpha.js');
|
|
@@ -77,16 +77,13 @@ var hitbtc = require('./src/hitbtc.js');
|
|
|
77
77
|
var hollaex = require('./src/hollaex.js');
|
|
78
78
|
var htx = require('./src/htx.js');
|
|
79
79
|
var huobi = require('./src/huobi.js');
|
|
80
|
-
var huobijp = require('./src/huobijp.js');
|
|
81
80
|
var hyperliquid = require('./src/hyperliquid.js');
|
|
82
|
-
var idex = require('./src/idex.js');
|
|
83
81
|
var independentreserve = require('./src/independentreserve.js');
|
|
84
82
|
var indodax = require('./src/indodax.js');
|
|
85
83
|
var kraken = require('./src/kraken.js');
|
|
86
84
|
var krakenfutures = require('./src/krakenfutures.js');
|
|
87
85
|
var kucoin = require('./src/kucoin.js');
|
|
88
86
|
var kucoinfutures = require('./src/kucoinfutures.js');
|
|
89
|
-
var kuna = require('./src/kuna.js');
|
|
90
87
|
var latoken = require('./src/latoken.js');
|
|
91
88
|
var lbank = require('./src/lbank.js');
|
|
92
89
|
var luno = require('./src/luno.js');
|
|
@@ -136,6 +133,7 @@ var bitmex$1 = require('./src/pro/bitmex.js');
|
|
|
136
133
|
var bitopro$1 = require('./src/pro/bitopro.js');
|
|
137
134
|
var bitrue$1 = require('./src/pro/bitrue.js');
|
|
138
135
|
var bitstamp$1 = require('./src/pro/bitstamp.js');
|
|
136
|
+
var bittrade$1 = require('./src/pro/bittrade.js');
|
|
139
137
|
var bitvavo$1 = require('./src/pro/bitvavo.js');
|
|
140
138
|
var blockchaincom$1 = require('./src/pro/blockchaincom.js');
|
|
141
139
|
var blofin$1 = require('./src/pro/blofin.js');
|
|
@@ -162,9 +160,7 @@ var hitbtc$1 = require('./src/pro/hitbtc.js');
|
|
|
162
160
|
var hollaex$1 = require('./src/pro/hollaex.js');
|
|
163
161
|
var htx$1 = require('./src/pro/htx.js');
|
|
164
162
|
var huobi$1 = require('./src/pro/huobi.js');
|
|
165
|
-
var huobijp$1 = require('./src/pro/huobijp.js');
|
|
166
163
|
var hyperliquid$1 = require('./src/pro/hyperliquid.js');
|
|
167
|
-
var idex$1 = require('./src/pro/idex.js');
|
|
168
164
|
var independentreserve$1 = require('./src/pro/independentreserve.js');
|
|
169
165
|
var kraken$1 = require('./src/pro/kraken.js');
|
|
170
166
|
var krakenfutures$1 = require('./src/pro/krakenfutures.js');
|
|
@@ -194,7 +190,7 @@ var xt$1 = require('./src/pro/xt.js');
|
|
|
194
190
|
|
|
195
191
|
//-----------------------------------------------------------------------------
|
|
196
192
|
// this is updated by vss.js when building
|
|
197
|
-
const version = '4.4.
|
|
193
|
+
const version = '4.4.86';
|
|
198
194
|
Exchange["default"].ccxtVersion = version;
|
|
199
195
|
const exchanges = {
|
|
200
196
|
'alpaca': alpaca,
|
|
@@ -221,8 +217,8 @@ const exchanges = {
|
|
|
221
217
|
'bitso': bitso,
|
|
222
218
|
'bitstamp': bitstamp,
|
|
223
219
|
'bitteam': bitteam,
|
|
220
|
+
'bittrade': bittrade,
|
|
224
221
|
'bitvavo': bitvavo,
|
|
225
|
-
'bl3p': bl3p,
|
|
226
222
|
'blockchaincom': blockchaincom,
|
|
227
223
|
'blofin': blofin,
|
|
228
224
|
'btcalpha': btcalpha,
|
|
@@ -262,16 +258,13 @@ const exchanges = {
|
|
|
262
258
|
'hollaex': hollaex,
|
|
263
259
|
'htx': htx,
|
|
264
260
|
'huobi': huobi,
|
|
265
|
-
'huobijp': huobijp,
|
|
266
261
|
'hyperliquid': hyperliquid,
|
|
267
|
-
'idex': idex,
|
|
268
262
|
'independentreserve': independentreserve,
|
|
269
263
|
'indodax': indodax,
|
|
270
264
|
'kraken': kraken,
|
|
271
265
|
'krakenfutures': krakenfutures,
|
|
272
266
|
'kucoin': kucoin,
|
|
273
267
|
'kucoinfutures': kucoinfutures,
|
|
274
|
-
'kuna': kuna,
|
|
275
268
|
'latoken': latoken,
|
|
276
269
|
'lbank': lbank,
|
|
277
270
|
'luno': luno,
|
|
@@ -323,6 +316,7 @@ const pro = {
|
|
|
323
316
|
'bitopro': bitopro$1,
|
|
324
317
|
'bitrue': bitrue$1,
|
|
325
318
|
'bitstamp': bitstamp$1,
|
|
319
|
+
'bittrade': bittrade$1,
|
|
326
320
|
'bitvavo': bitvavo$1,
|
|
327
321
|
'blockchaincom': blockchaincom$1,
|
|
328
322
|
'blofin': blofin$1,
|
|
@@ -349,9 +343,7 @@ const pro = {
|
|
|
349
343
|
'hollaex': hollaex$1,
|
|
350
344
|
'htx': htx$1,
|
|
351
345
|
'huobi': huobi$1,
|
|
352
|
-
'huobijp': huobijp$1,
|
|
353
346
|
'hyperliquid': hyperliquid$1,
|
|
354
|
-
'idex': idex$1,
|
|
355
347
|
'independentreserve': independentreserve$1,
|
|
356
348
|
'kraken': kraken$1,
|
|
357
349
|
'krakenfutures': krakenfutures$1,
|
|
@@ -453,8 +445,8 @@ exports.bitrue = bitrue;
|
|
|
453
445
|
exports.bitso = bitso;
|
|
454
446
|
exports.bitstamp = bitstamp;
|
|
455
447
|
exports.bitteam = bitteam;
|
|
448
|
+
exports.bittrade = bittrade;
|
|
456
449
|
exports.bitvavo = bitvavo;
|
|
457
|
-
exports.bl3p = bl3p;
|
|
458
450
|
exports.blockchaincom = blockchaincom;
|
|
459
451
|
exports.blofin = blofin;
|
|
460
452
|
exports.btcalpha = btcalpha;
|
|
@@ -494,16 +486,13 @@ exports.hitbtc = hitbtc;
|
|
|
494
486
|
exports.hollaex = hollaex;
|
|
495
487
|
exports.htx = htx;
|
|
496
488
|
exports.huobi = huobi;
|
|
497
|
-
exports.huobijp = huobijp;
|
|
498
489
|
exports.hyperliquid = hyperliquid;
|
|
499
|
-
exports.idex = idex;
|
|
500
490
|
exports.independentreserve = independentreserve;
|
|
501
491
|
exports.indodax = indodax;
|
|
502
492
|
exports.kraken = kraken;
|
|
503
493
|
exports.krakenfutures = krakenfutures;
|
|
504
494
|
exports.kucoin = kucoin;
|
|
505
495
|
exports.kucoinfutures = kucoinfutures;
|
|
506
|
-
exports.kuna = kuna;
|
|
507
496
|
exports.latoken = latoken;
|
|
508
497
|
exports.lbank = lbank;
|
|
509
498
|
exports.luno = luno;
|
package/dist/cjs/src/apex.js
CHANGED
|
@@ -1081,9 +1081,10 @@ class apex extends apex$1 {
|
|
|
1081
1081
|
for (let i = 0; i < resultList.length; i++) {
|
|
1082
1082
|
const entry = resultList[i];
|
|
1083
1083
|
const timestamp = this.safeInteger(entry, 'fundingTimestamp');
|
|
1084
|
+
const marketId = this.safeString(entry, 'symbol');
|
|
1084
1085
|
rates.push({
|
|
1085
1086
|
'info': entry,
|
|
1086
|
-
'symbol': this.
|
|
1087
|
+
'symbol': this.safeSymbol(marketId, market),
|
|
1087
1088
|
'fundingRate': this.safeNumber(entry, 'rate'),
|
|
1088
1089
|
'timestamp': timestamp,
|
|
1089
1090
|
'datetime': this.iso8601(timestamp),
|
package/dist/cjs/src/ascendex.js
CHANGED
|
@@ -466,6 +466,7 @@ class ascendex extends ascendex$1 {
|
|
|
466
466
|
'broad': {},
|
|
467
467
|
},
|
|
468
468
|
'commonCurrencies': {
|
|
469
|
+
'XBT': 'XBT',
|
|
469
470
|
'BOND': 'BONDED',
|
|
470
471
|
'BTCBEAR': 'BEAR',
|
|
471
472
|
'BTCBULL': 'BULL',
|
|
@@ -488,116 +489,83 @@ class ascendex extends ascendex$1 {
|
|
|
488
489
|
* @returns {object} an associative dictionary of currencies
|
|
489
490
|
*/
|
|
490
491
|
async fetchCurrencies(params = {}) {
|
|
491
|
-
const
|
|
492
|
-
//
|
|
493
|
-
// {
|
|
494
|
-
// "code":0,
|
|
495
|
-
// "data":[
|
|
496
|
-
// {
|
|
497
|
-
// "assetCode" : "LTCBULL",
|
|
498
|
-
// "assetName" : "3X Long LTC Token",
|
|
499
|
-
// "precisionScale" : 9,
|
|
500
|
-
// "nativeScale" : 4,
|
|
501
|
-
// "withdrawalFee" : "0.2",
|
|
502
|
-
// "minWithdrawalAmt" : "1.0",
|
|
503
|
-
// "status" : "Normal"
|
|
504
|
-
// },
|
|
505
|
-
// ]
|
|
506
|
-
// }
|
|
507
|
-
//
|
|
508
|
-
const marginPromise = this.v1PublicGetMarginAssets(params);
|
|
509
|
-
//
|
|
510
|
-
// {
|
|
511
|
-
// "code":0,
|
|
512
|
-
// "data":[
|
|
513
|
-
// {
|
|
514
|
-
// "assetCode":"BTT",
|
|
515
|
-
// "displayName": "BTT",
|
|
516
|
-
// "borrowAssetCode":"BTT-B",
|
|
517
|
-
// "interestAssetCode":"BTT-I",
|
|
518
|
-
// "nativeScale":0,
|
|
519
|
-
// "numConfirmations":1,
|
|
520
|
-
// "withdrawFee":"100.0",
|
|
521
|
-
// "minWithdrawalAmt":"1000.0",
|
|
522
|
-
// "statusCode":"Normal",
|
|
523
|
-
// "statusMessage":"",
|
|
524
|
-
// "interestRate":"0.001"
|
|
525
|
-
// }
|
|
526
|
-
// ]
|
|
527
|
-
// }
|
|
528
|
-
//
|
|
529
|
-
const cashPromise = this.v1PublicGetCashAssets(params);
|
|
492
|
+
const response = await this.v2PublicGetAssets(params);
|
|
530
493
|
//
|
|
531
|
-
//
|
|
532
|
-
//
|
|
533
|
-
//
|
|
534
|
-
//
|
|
535
|
-
//
|
|
536
|
-
//
|
|
537
|
-
//
|
|
538
|
-
//
|
|
539
|
-
//
|
|
540
|
-
//
|
|
541
|
-
//
|
|
542
|
-
//
|
|
543
|
-
//
|
|
494
|
+
// {
|
|
495
|
+
// "code": "0",
|
|
496
|
+
// "data": [
|
|
497
|
+
// {
|
|
498
|
+
// "assetCode": "USDT",
|
|
499
|
+
// "assetName": "Tether",
|
|
500
|
+
// "precisionScale": 9,
|
|
501
|
+
// "nativeScale": 4,
|
|
502
|
+
// "blockChain": [
|
|
503
|
+
// {
|
|
504
|
+
// "chainName": "Solana",
|
|
505
|
+
// "withdrawFee": "2.0",
|
|
506
|
+
// "allowDeposit": true,
|
|
507
|
+
// "allowWithdraw": true,
|
|
508
|
+
// "minDepositAmt": "0.01",
|
|
509
|
+
// "minWithdrawal": "4.0",
|
|
510
|
+
// "numConfirmations": 1
|
|
511
|
+
// },
|
|
512
|
+
// ...
|
|
513
|
+
// ]
|
|
514
|
+
// },
|
|
544
515
|
// ]
|
|
545
|
-
//
|
|
516
|
+
// }
|
|
546
517
|
//
|
|
547
|
-
const
|
|
548
|
-
const assetsData = this.safeList(assets, 'data', []);
|
|
549
|
-
const marginData = this.safeList(margin, 'data', []);
|
|
550
|
-
const cashData = this.safeList(cash, 'data', []);
|
|
551
|
-
const assetsById = this.indexBy(assetsData, 'assetCode');
|
|
552
|
-
const marginById = this.indexBy(marginData, 'assetCode');
|
|
553
|
-
const cashById = this.indexBy(cashData, 'assetCode');
|
|
554
|
-
const dataById = this.deepExtend(assetsById, marginById, cashById);
|
|
555
|
-
const ids = Object.keys(dataById);
|
|
518
|
+
const data = this.safeList(response, 'data', []);
|
|
556
519
|
const result = {};
|
|
557
|
-
for (let i = 0; i <
|
|
558
|
-
const
|
|
559
|
-
const
|
|
520
|
+
for (let i = 0; i < data.length; i++) {
|
|
521
|
+
const currency = data[i];
|
|
522
|
+
const id = this.safeString(currency, 'assetCode');
|
|
560
523
|
const code = this.safeCurrencyCode(id);
|
|
561
|
-
const
|
|
562
|
-
const precision = this.parseNumber(this.parsePrecision(
|
|
563
|
-
const
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
524
|
+
const chains = this.safeList(currency, 'blockChain', []);
|
|
525
|
+
const precision = this.parseNumber(this.parsePrecision(this.safeString(currency, 'nativeScale')));
|
|
526
|
+
const networks = {};
|
|
527
|
+
for (let j = 0; j < chains.length; j++) {
|
|
528
|
+
const networkEtnry = chains[j];
|
|
529
|
+
const networkId = this.safeString(networkEtnry, 'chainName');
|
|
530
|
+
const networkCode = this.networkCodeToId(networkId);
|
|
531
|
+
networks[networkCode] = {
|
|
532
|
+
'fee': this.safeNumber(networkEtnry, 'withdrawFee'),
|
|
533
|
+
'active': undefined,
|
|
534
|
+
'withdraw': this.safeBool(networkEtnry, 'allowWithdraw'),
|
|
535
|
+
'deposit': this.safeBool(networkEtnry, 'allowDeposit'),
|
|
536
|
+
'precision': precision,
|
|
537
|
+
'limits': {
|
|
538
|
+
'amount': {
|
|
539
|
+
'min': undefined,
|
|
540
|
+
'max': undefined,
|
|
541
|
+
},
|
|
542
|
+
'withdraw': {
|
|
543
|
+
'min': this.safeNumber(networkEtnry, 'minWithdrawal'),
|
|
544
|
+
'max': undefined,
|
|
545
|
+
},
|
|
546
|
+
'deposit': {
|
|
547
|
+
'min': this.safeNumber(networkEtnry, 'minDepositAmt'),
|
|
548
|
+
'max': undefined,
|
|
549
|
+
},
|
|
550
|
+
},
|
|
551
|
+
};
|
|
584
552
|
}
|
|
585
|
-
|
|
586
|
-
result[code] = {
|
|
553
|
+
// todo type: if (chainsLength === 0 && (assetName.endsWith (' Staking') || assetName.indexOf (' Reward ') >= 0 || assetName.indexOf ('Slot Auction') >= 0 || assetName.indexOf (' Freeze Asset') >= 0))
|
|
554
|
+
result[code] = this.safeCurrencyStructure({
|
|
587
555
|
'id': id,
|
|
588
556
|
'code': code,
|
|
589
557
|
'info': currency,
|
|
590
558
|
'type': undefined,
|
|
591
|
-
'margin':
|
|
559
|
+
'margin': undefined,
|
|
592
560
|
'name': this.safeString(currency, 'assetName'),
|
|
593
|
-
'active':
|
|
594
|
-
'deposit':
|
|
595
|
-
'withdraw':
|
|
596
|
-
'fee':
|
|
561
|
+
'active': undefined,
|
|
562
|
+
'deposit': undefined,
|
|
563
|
+
'withdraw': undefined,
|
|
564
|
+
'fee': undefined,
|
|
597
565
|
'precision': precision,
|
|
598
566
|
'limits': {
|
|
599
567
|
'amount': {
|
|
600
|
-
'min':
|
|
568
|
+
'min': undefined,
|
|
601
569
|
'max': undefined,
|
|
602
570
|
},
|
|
603
571
|
'withdraw': {
|
|
@@ -605,8 +573,8 @@ class ascendex extends ascendex$1 {
|
|
|
605
573
|
'max': undefined,
|
|
606
574
|
},
|
|
607
575
|
},
|
|
608
|
-
'networks':
|
|
609
|
-
};
|
|
576
|
+
'networks': networks,
|
|
577
|
+
});
|
|
610
578
|
}
|
|
611
579
|
return result;
|
|
612
580
|
}
|
|
@@ -618,6 +586,12 @@ class ascendex extends ascendex$1 {
|
|
|
618
586
|
* @returns {object[]} an array of objects representing market data
|
|
619
587
|
*/
|
|
620
588
|
async fetchMarkets(params = {}) {
|
|
589
|
+
const spotPromise = this.fetchSpotMarkets(params);
|
|
590
|
+
const contractPromise = this.fetchContractMarkets(params);
|
|
591
|
+
const [spotMarkets, contractMarkets] = await Promise.all([spotPromise, contractPromise]);
|
|
592
|
+
return this.arrayConcat(spotMarkets, contractMarkets);
|
|
593
|
+
}
|
|
594
|
+
async fetchSpotMarkets(params = {}) {
|
|
621
595
|
const productsPromise = this.v1PublicGetProducts(params);
|
|
622
596
|
//
|
|
623
597
|
// {
|
|
@@ -669,7 +643,94 @@ class ascendex extends ascendex$1 {
|
|
|
669
643
|
// ]
|
|
670
644
|
// }
|
|
671
645
|
//
|
|
672
|
-
const
|
|
646
|
+
const [products, cash] = await Promise.all([productsPromise, cashPromise]);
|
|
647
|
+
const productsData = this.safeList(products, 'data', []);
|
|
648
|
+
const productsById = this.indexBy(productsData, 'symbol');
|
|
649
|
+
const cashData = this.safeList(cash, 'data', []);
|
|
650
|
+
const cashAndPerpetualsById = this.indexBy(cashData, 'symbol');
|
|
651
|
+
const dataById = this.deepExtend(productsById, cashAndPerpetualsById);
|
|
652
|
+
const ids = Object.keys(dataById);
|
|
653
|
+
const result = [];
|
|
654
|
+
for (let i = 0; i < ids.length; i++) {
|
|
655
|
+
const id = ids[i];
|
|
656
|
+
if (id.indexOf('-PERP') >= 0) {
|
|
657
|
+
continue; // skip perpetuals, as separate endpoint returns them
|
|
658
|
+
}
|
|
659
|
+
const market = dataById[id];
|
|
660
|
+
const status = this.safeString(market, 'status');
|
|
661
|
+
const domain = this.safeString(market, 'domain');
|
|
662
|
+
let active = false;
|
|
663
|
+
if (((status === 'Normal') || (status === 'InternalTrading')) && (domain !== 'LeveragedETF')) {
|
|
664
|
+
active = true;
|
|
665
|
+
}
|
|
666
|
+
const minQty = this.safeNumber(market, 'minQty');
|
|
667
|
+
const maxQty = this.safeNumber(market, 'maxQty');
|
|
668
|
+
const minPrice = this.safeNumber(market, 'tickSize');
|
|
669
|
+
const maxPrice = undefined;
|
|
670
|
+
const underlying = this.safeString2(market, 'underlying', 'symbol');
|
|
671
|
+
const parts = underlying.split('/');
|
|
672
|
+
const baseId = this.safeString(parts, 0);
|
|
673
|
+
const quoteId = this.safeString(parts, 1);
|
|
674
|
+
const base = this.safeCurrencyCode(baseId);
|
|
675
|
+
const quote = this.safeCurrencyCode(quoteId);
|
|
676
|
+
const fee = this.safeNumber(market, 'commissionReserveRate');
|
|
677
|
+
const marginTradable = this.safeBool(market, 'marginTradable', false);
|
|
678
|
+
result.push({
|
|
679
|
+
'id': id,
|
|
680
|
+
'symbol': base + '/' + quote,
|
|
681
|
+
'base': base,
|
|
682
|
+
'baseId': baseId,
|
|
683
|
+
'quote': quote,
|
|
684
|
+
'quoteId': quoteId,
|
|
685
|
+
'settle': undefined,
|
|
686
|
+
'settleId': undefined,
|
|
687
|
+
'type': 'spot',
|
|
688
|
+
'spot': true,
|
|
689
|
+
'margin': marginTradable,
|
|
690
|
+
'swap': false,
|
|
691
|
+
'future': false,
|
|
692
|
+
'option': false,
|
|
693
|
+
'active': active,
|
|
694
|
+
'contract': false,
|
|
695
|
+
'linear': undefined,
|
|
696
|
+
'inverse': undefined,
|
|
697
|
+
'taker': fee,
|
|
698
|
+
'maker': fee,
|
|
699
|
+
'contractSize': undefined,
|
|
700
|
+
'expiry': undefined,
|
|
701
|
+
'expiryDatetime': undefined,
|
|
702
|
+
'strike': undefined,
|
|
703
|
+
'optionType': undefined,
|
|
704
|
+
'precision': {
|
|
705
|
+
'amount': this.safeNumber(market, 'lotSize'),
|
|
706
|
+
'price': this.safeNumber(market, 'tickSize'),
|
|
707
|
+
},
|
|
708
|
+
'limits': {
|
|
709
|
+
'leverage': {
|
|
710
|
+
'min': undefined,
|
|
711
|
+
'max': undefined,
|
|
712
|
+
},
|
|
713
|
+
'amount': {
|
|
714
|
+
'min': minQty,
|
|
715
|
+
'max': maxQty,
|
|
716
|
+
},
|
|
717
|
+
'price': {
|
|
718
|
+
'min': minPrice,
|
|
719
|
+
'max': maxPrice,
|
|
720
|
+
},
|
|
721
|
+
'cost': {
|
|
722
|
+
'min': this.safeNumber(market, 'minNotional'),
|
|
723
|
+
'max': this.safeNumber(market, 'maxNotional'),
|
|
724
|
+
},
|
|
725
|
+
},
|
|
726
|
+
'created': this.safeInteger(market, 'tradingStartTime'),
|
|
727
|
+
'info': market,
|
|
728
|
+
});
|
|
729
|
+
}
|
|
730
|
+
return result;
|
|
731
|
+
}
|
|
732
|
+
async fetchContractMarkets(params = {}) {
|
|
733
|
+
const contracts = await this.v2PublicGetFuturesContract(params);
|
|
673
734
|
//
|
|
674
735
|
// {
|
|
675
736
|
// "code": 0,
|
|
@@ -682,9 +743,9 @@ class ascendex extends ascendex$1 {
|
|
|
682
743
|
// "underlying": "BTC/USDT",
|
|
683
744
|
// "tradingStartTime": 1579701600000,
|
|
684
745
|
// "priceFilter": {
|
|
685
|
-
// "minPrice": "1",
|
|
746
|
+
// "minPrice": "0.1",
|
|
686
747
|
// "maxPrice": "1000000",
|
|
687
|
-
// "tickSize": "1"
|
|
748
|
+
// "tickSize": "0.1"
|
|
688
749
|
// },
|
|
689
750
|
// "lotSizeFilter": {
|
|
690
751
|
// "minQty": "0.0001",
|
|
@@ -707,52 +768,25 @@ class ascendex extends ascendex$1 {
|
|
|
707
768
|
// ]
|
|
708
769
|
// }
|
|
709
770
|
//
|
|
710
|
-
const
|
|
711
|
-
const productsData = this.safeList(products, 'data', []);
|
|
712
|
-
const productsById = this.indexBy(productsData, 'symbol');
|
|
713
|
-
const cashData = this.safeList(cash, 'data', []);
|
|
714
|
-
const perpetualsData = this.safeList(perpetuals, 'data', []);
|
|
715
|
-
const cashAndPerpetualsData = this.arrayConcat(cashData, perpetualsData);
|
|
716
|
-
const cashAndPerpetualsById = this.indexBy(cashAndPerpetualsData, 'symbol');
|
|
717
|
-
const dataById = this.deepExtend(productsById, cashAndPerpetualsById);
|
|
718
|
-
const ids = Object.keys(dataById);
|
|
771
|
+
const data = this.safeList(contracts, 'data', []);
|
|
719
772
|
const result = [];
|
|
720
|
-
for (let i = 0; i <
|
|
721
|
-
const
|
|
722
|
-
const
|
|
723
|
-
const
|
|
724
|
-
const settle = this.safeCurrencyCode(settleId);
|
|
725
|
-
const status = this.safeString(market, 'status');
|
|
726
|
-
const domain = this.safeString(market, 'domain');
|
|
727
|
-
let active = false;
|
|
728
|
-
if (((status === 'Normal') || (status === 'InternalTrading')) && (domain !== 'LeveragedETF')) {
|
|
729
|
-
active = true;
|
|
730
|
-
}
|
|
731
|
-
const spot = settle === undefined;
|
|
732
|
-
const swap = !spot;
|
|
733
|
-
const linear = swap ? true : undefined;
|
|
734
|
-
let minQty = this.safeNumber(market, 'minQty');
|
|
735
|
-
let maxQty = this.safeNumber(market, 'maxQty');
|
|
736
|
-
let minPrice = this.safeNumber(market, 'tickSize');
|
|
737
|
-
let maxPrice = undefined;
|
|
738
|
-
const underlying = this.safeString2(market, 'underlying', 'symbol');
|
|
773
|
+
for (let i = 0; i < data.length; i++) {
|
|
774
|
+
const market = data[i];
|
|
775
|
+
const id = this.safeString(market, 'symbol');
|
|
776
|
+
const underlying = this.safeString(market, 'underlying');
|
|
739
777
|
const parts = underlying.split('/');
|
|
740
778
|
const baseId = this.safeString(parts, 0);
|
|
741
|
-
const quoteId = this.safeString(parts, 1);
|
|
742
779
|
const base = this.safeCurrencyCode(baseId);
|
|
780
|
+
const quoteId = this.safeString(parts, 1);
|
|
743
781
|
const quote = this.safeCurrencyCode(quoteId);
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
maxPrice = this.safeNumber(priceFilter, 'maxPrice');
|
|
752
|
-
symbol = base + '/' + quote + ':' + settle;
|
|
753
|
-
}
|
|
782
|
+
const settleId = this.safeString(market, 'settlementAsset');
|
|
783
|
+
const settle = this.safeCurrencyCode(settleId);
|
|
784
|
+
const linear = settle === quote;
|
|
785
|
+
const inverse = settle === base;
|
|
786
|
+
const symbol = base + '/' + quote + ':' + settle;
|
|
787
|
+
const priceFilter = this.safeDict(market, 'priceFilter');
|
|
788
|
+
const lotSizeFilter = this.safeDict(market, 'lotSizeFilter');
|
|
754
789
|
const fee = this.safeNumber(market, 'commissionReserveRate');
|
|
755
|
-
const marginTradable = this.safeBool(market, 'marginTradable', false);
|
|
756
790
|
result.push({
|
|
757
791
|
'id': id,
|
|
758
792
|
'symbol': symbol,
|
|
@@ -762,26 +796,26 @@ class ascendex extends ascendex$1 {
|
|
|
762
796
|
'baseId': baseId,
|
|
763
797
|
'quoteId': quoteId,
|
|
764
798
|
'settleId': settleId,
|
|
765
|
-
'type':
|
|
766
|
-
'spot':
|
|
767
|
-
'margin':
|
|
768
|
-
'swap':
|
|
799
|
+
'type': 'swap',
|
|
800
|
+
'spot': false,
|
|
801
|
+
'margin': undefined,
|
|
802
|
+
'swap': true,
|
|
769
803
|
'future': false,
|
|
770
804
|
'option': false,
|
|
771
|
-
'active':
|
|
772
|
-
'contract':
|
|
805
|
+
'active': this.safeString(market, 'status') === 'Normal',
|
|
806
|
+
'contract': true,
|
|
773
807
|
'linear': linear,
|
|
774
|
-
'inverse':
|
|
808
|
+
'inverse': inverse,
|
|
775
809
|
'taker': fee,
|
|
776
810
|
'maker': fee,
|
|
777
|
-
'contractSize':
|
|
811
|
+
'contractSize': this.parseNumber('1'),
|
|
778
812
|
'expiry': undefined,
|
|
779
813
|
'expiryDatetime': undefined,
|
|
780
814
|
'strike': undefined,
|
|
781
815
|
'optionType': undefined,
|
|
782
816
|
'precision': {
|
|
783
|
-
'amount': this.safeNumber(
|
|
784
|
-
'price': this.safeNumber(
|
|
817
|
+
'amount': this.safeNumber(lotSizeFilter, 'lotSize'),
|
|
818
|
+
'price': this.safeNumber(priceFilter, 'tickSize'),
|
|
785
819
|
},
|
|
786
820
|
'limits': {
|
|
787
821
|
'leverage': {
|
|
@@ -789,12 +823,12 @@ class ascendex extends ascendex$1 {
|
|
|
789
823
|
'max': undefined,
|
|
790
824
|
},
|
|
791
825
|
'amount': {
|
|
792
|
-
'min': minQty,
|
|
793
|
-
'max': maxQty,
|
|
826
|
+
'min': this.safeNumber(lotSizeFilter, 'minQty'),
|
|
827
|
+
'max': this.safeNumber(lotSizeFilter, 'maxQty'),
|
|
794
828
|
},
|
|
795
829
|
'price': {
|
|
796
|
-
'min': minPrice,
|
|
797
|
-
'max': maxPrice,
|
|
830
|
+
'min': this.safeNumber(priceFilter, 'minPrice'),
|
|
831
|
+
'max': this.safeNumber(priceFilter, 'maxPrice'),
|
|
798
832
|
},
|
|
799
833
|
'cost': {
|
|
800
834
|
'min': this.safeNumber(market, 'minNotional'),
|
|
@@ -747,8 +747,21 @@ class Exchange {
|
|
|
747
747
|
const markets = await this.fetchMarkets(params);
|
|
748
748
|
return this.setMarkets(markets, currencies);
|
|
749
749
|
}
|
|
750
|
+
/**
|
|
751
|
+
* @method
|
|
752
|
+
* @name Exchange#loadMarkets
|
|
753
|
+
* @description Loads and prepares the markets for trading.
|
|
754
|
+
* @param {boolean} reload - If true, the markets will be reloaded from the exchange.
|
|
755
|
+
* @param {object} params - Additional exchange-specific parameters for the request.
|
|
756
|
+
* @returns A promise that resolves to a dictionary of markets.
|
|
757
|
+
* @throws An error if the markets cannot be loaded or prepared.
|
|
758
|
+
* @remarks This method is asynchronous and returns a promise.
|
|
759
|
+
* It ensures that the markets are only loaded once, even if the method is called multiple times.
|
|
760
|
+
* If the markets are already loaded and not reloading, the method returns the existing markets.
|
|
761
|
+
* If the markets are being reloaded, the method waits for the reload to complete before returning the markets.
|
|
762
|
+
* If an error occurs during the loading or preparation of the markets, the promise is rejected with the error.
|
|
763
|
+
*/
|
|
750
764
|
async loadMarkets(reload = false, params = {}) {
|
|
751
|
-
// this method is async, it returns a promise
|
|
752
765
|
if ((reload && !this.reloadingMarkets) || !this.marketsLoading) {
|
|
753
766
|
this.reloadingMarkets = true;
|
|
754
767
|
this.marketsLoading = this.loadMarketsHelper(reload, params).then((resolved) => {
|
|
@@ -2595,7 +2608,7 @@ class Exchange {
|
|
|
2595
2608
|
currency['networks'][key]['active'] = false;
|
|
2596
2609
|
}
|
|
2597
2610
|
}
|
|
2598
|
-
active = this.safeBool(
|
|
2611
|
+
active = this.safeBool(currency['networks'][key], 'active'); // dict might have been updated on above lines, so access directly instead of `network` variable
|
|
2599
2612
|
const currencyActive = this.safeBool(currency, 'active');
|
|
2600
2613
|
if (currencyActive === undefined || active) {
|
|
2601
2614
|
currency['active'] = active;
|
package/dist/cjs/src/bequant.js
CHANGED
|
@@ -9,8 +9,8 @@ class bequant extends hitbtc {
|
|
|
9
9
|
return this.deepExtend(super.describe(), {
|
|
10
10
|
'id': 'bequant',
|
|
11
11
|
'name': 'Bequant',
|
|
12
|
-
'countries': ['MT'],
|
|
13
12
|
'pro': true,
|
|
13
|
+
'countries': ['MT'],
|
|
14
14
|
'urls': {
|
|
15
15
|
'logo': 'https://github.com/user-attachments/assets/0583ef1f-29fe-4b7c-8189-63565a0e2867',
|
|
16
16
|
'api': {
|