ccxt 4.5.55 → 4.5.57
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 +215 -10
- package/dist/ccxt.browser.min.js +10 -10
- package/dist/cjs/ccxt.js +6 -11
- package/dist/cjs/src/aftermath.js +10 -5
- package/dist/cjs/src/alpaca.js +2 -2
- package/dist/cjs/src/apex.js +26 -17
- package/dist/cjs/src/arkham.js +10 -7
- package/dist/cjs/src/ascendex.js +8 -5
- package/dist/cjs/src/aster.js +7 -4
- package/dist/cjs/src/backpack.js +4 -4
- package/dist/cjs/src/base/Exchange.js +72 -35
- package/dist/cjs/src/base/functions/io.js +25 -0
- package/dist/cjs/src/base/functions.js +1 -0
- package/dist/cjs/src/bigone.js +10 -7
- package/dist/cjs/src/binance.js +196 -198
- package/dist/cjs/src/bingx.js +7 -7
- package/dist/cjs/src/bitfinex.js +71 -58
- package/dist/cjs/src/bitflyer.js +2 -1
- package/dist/cjs/src/bitget.js +16 -5
- package/dist/cjs/src/bitmart.js +18 -10
- package/dist/cjs/src/bitmex.js +8 -5
- package/dist/cjs/src/bitopro.js +2 -2
- package/dist/cjs/src/bitrue.js +4 -3
- package/dist/cjs/src/bitso.js +7 -4
- package/dist/cjs/src/bitstamp.js +7 -4
- package/dist/cjs/src/bitteam.js +1 -1
- package/dist/cjs/src/bittrade.js +2 -2
- package/dist/cjs/src/bitvavo.js +457 -34
- package/dist/cjs/src/blofin.js +28 -4
- package/dist/cjs/src/bullish.js +6 -5
- package/dist/cjs/src/bybit.js +19 -17
- package/dist/cjs/src/bybiteu.js +1 -0
- package/dist/cjs/src/bydfi.js +1 -1
- package/dist/cjs/src/cex.js +3 -3
- package/dist/cjs/src/coinbase.js +75 -65
- package/dist/cjs/src/coinbaseexchange.js +4 -3
- package/dist/cjs/src/coinbaseinternational.js +17 -10
- package/dist/cjs/src/coinex.js +79 -77
- package/dist/cjs/src/coinmetro.js +1 -1
- package/dist/cjs/src/coinsph.js +5 -5
- package/dist/cjs/src/cryptocom.js +52 -54
- package/dist/cjs/src/cryptomus.js +43 -39
- package/dist/cjs/src/deepcoin.js +9 -5
- package/dist/cjs/src/delta.js +53 -53
- package/dist/cjs/src/deribit.js +35 -35
- package/dist/cjs/src/derive.js +31 -31
- package/dist/cjs/src/digifinex.js +45 -45
- package/dist/cjs/src/exmo.js +104 -122
- package/dist/cjs/src/extended.js +3497 -0
- package/dist/cjs/src/foxbit.js +72 -76
- package/dist/cjs/src/gate.js +53 -53
- package/dist/cjs/src/gemini.js +45 -45
- package/dist/cjs/src/grvt.js +17 -11
- package/dist/cjs/src/hashkey.js +56 -58
- package/dist/cjs/src/hibachi.js +1 -1
- package/dist/cjs/src/hitbtc.js +5 -14
- package/dist/cjs/src/hollaex.js +51 -54
- package/dist/cjs/src/htx.js +84 -72
- package/dist/cjs/src/hyperliquid.js +60 -55
- package/dist/cjs/src/indodax.js +4 -3
- package/dist/cjs/src/kraken.js +71 -71
- package/dist/cjs/src/krakenfutures.js +2 -1
- package/dist/cjs/src/kucoin.js +3 -2
- package/dist/cjs/src/latoken.js +30 -32
- package/dist/cjs/src/lbank.js +64 -60
- package/dist/cjs/src/lighter.js +36 -38
- package/dist/cjs/src/luno.js +36 -44
- package/dist/cjs/src/mercado.js +2 -1
- package/dist/cjs/src/mexc.js +72 -63
- package/dist/cjs/src/modetrade.js +51 -53
- package/dist/cjs/src/ndax.js +35 -37
- package/dist/cjs/src/okx.js +23 -5
- package/dist/cjs/src/onetrading.js +21 -23
- package/dist/cjs/src/p2b.js +8 -4
- package/dist/cjs/src/paradex.js +3 -2
- package/dist/cjs/src/phemex.js +47 -47
- package/dist/cjs/src/poloniex.js +19 -13
- package/dist/cjs/src/pro/alpaca.js +1 -1
- package/dist/cjs/src/pro/apex.js +11 -2
- package/dist/cjs/src/pro/arkham.js +1 -1
- package/dist/cjs/src/pro/aster.js +10 -9
- package/dist/cjs/src/pro/backpack.js +1 -1
- package/dist/cjs/src/pro/binance.js +6 -6
- package/dist/cjs/src/pro/bingx.js +7 -2
- package/dist/cjs/src/pro/bitget.js +1 -1
- package/dist/cjs/src/pro/bithumb.js +1 -1
- package/dist/cjs/src/pro/bitmart.js +10 -0
- package/dist/cjs/src/pro/bitmex.js +1 -1
- package/dist/cjs/src/pro/bitstamp.js +1 -1
- package/dist/cjs/src/pro/blockchaincom.js +1 -1
- package/dist/cjs/src/pro/bybit.js +1 -1
- package/dist/cjs/src/pro/cex.js +1 -1
- package/dist/cjs/src/pro/coinex.js +1 -1
- package/dist/cjs/src/pro/coinone.js +1 -1
- package/dist/cjs/src/pro/cryptocom.js +3 -1
- package/dist/cjs/src/pro/dydx.js +1 -1
- package/dist/cjs/src/pro/exmo.js +1 -1
- package/dist/cjs/src/pro/extended.js +865 -0
- package/dist/cjs/src/pro/gate.js +1 -1
- package/dist/cjs/src/pro/grvt.js +8 -0
- package/dist/cjs/src/pro/htx.js +4 -4
- package/dist/cjs/src/pro/independentreserve.js +1 -1
- package/dist/cjs/src/pro/krakenfutures.js +16 -4
- package/dist/cjs/src/pro/kucoin.js +1 -1
- package/dist/cjs/src/pro/luno.js +3 -3
- package/dist/cjs/src/pro/modetrade.js +3 -3
- package/dist/cjs/src/pro/okx.js +4 -4
- package/dist/cjs/src/pro/onetrading.js +1 -1
- package/dist/cjs/src/pro/toobit.js +1 -1
- package/dist/cjs/src/pro/weex.js +1 -1
- package/dist/cjs/src/pro/woo.js +4 -4
- package/dist/cjs/src/pro/woofipro.js +3 -3
- package/dist/cjs/src/pro/xt.js +1 -1
- package/dist/cjs/src/static_dependencies/starknet/utils/hash/classHash.js +7 -7
- package/dist/cjs/src/tokocrypto.js +1 -1
- package/dist/cjs/src/toobit.js +3 -3
- package/dist/cjs/src/upbit.js +3 -3
- package/dist/cjs/src/weex.js +57 -62
- package/dist/cjs/src/whitebit.js +61 -63
- package/dist/cjs/src/woo.js +66 -55
- package/dist/cjs/src/woofipro.js +54 -48
- package/dist/cjs/src/xt.js +3 -2
- package/dist/cjs/src/yobit.js +4 -2
- package/dist/cjs/src/zebpay.js +73 -75
- package/js/ccxt.d.ts +8 -14
- package/js/ccxt.js +6 -10
- package/js/src/abstract/bitvavo.d.ts +15 -7
- package/js/src/abstract/extended.d.ts +58 -0
- package/js/src/abstract/mexc.d.ts +1 -0
- package/js/src/aftermath.js +10 -5
- package/js/src/alpaca.js +2 -2
- package/js/src/apex.d.ts +1 -1
- package/js/src/apex.js +26 -17
- package/js/src/arkham.js +10 -7
- package/js/src/ascendex.js +8 -5
- package/js/src/aster.js +7 -4
- package/js/src/backpack.js +4 -4
- package/js/src/base/Exchange.d.ts +10 -6
- package/js/src/base/Exchange.js +72 -35
- package/js/src/base/functions/io.d.ts +7 -0
- package/js/src/base/functions/io.js +24 -0
- package/js/src/bigone.js +10 -7
- package/js/src/binance.d.ts +2 -0
- package/js/src/binance.js +200 -202
- package/js/src/bingx.js +7 -7
- package/js/src/bitfinex.d.ts +2 -0
- package/js/src/bitfinex.js +71 -58
- package/js/src/bitflyer.js +2 -1
- package/js/src/bitget.js +16 -5
- package/js/src/bitmart.js +18 -10
- package/js/src/bitmex.js +8 -5
- package/js/src/bitopro.js +2 -2
- package/js/src/bitrue.js +4 -3
- package/js/src/bitso.js +7 -4
- package/js/src/bitstamp.js +7 -4
- package/js/src/bitteam.js +1 -1
- package/js/src/bittrade.js +2 -2
- package/js/src/bitvavo.d.ts +114 -21
- package/js/src/bitvavo.js +457 -34
- package/js/src/blofin.d.ts +1 -0
- package/js/src/blofin.js +28 -4
- package/js/src/bullish.js +6 -5
- package/js/src/bybit.d.ts +1 -1
- package/js/src/bybit.js +19 -17
- package/js/src/bybiteu.js +1 -0
- package/js/src/bydfi.js +1 -1
- package/js/src/cex.js +3 -3
- package/js/src/coinbase.d.ts +63 -56
- package/js/src/coinbase.js +75 -65
- package/js/src/coinbaseexchange.js +4 -3
- package/js/src/coinbaseinternational.d.ts +1 -1
- package/js/src/coinbaseinternational.js +17 -10
- package/js/src/coinex.d.ts +2 -1
- package/js/src/coinex.js +79 -77
- package/js/src/coinmetro.d.ts +1 -1
- package/js/src/coinmetro.js +1 -1
- package/js/src/coinsph.js +5 -5
- package/js/src/cryptocom.d.ts +1 -0
- package/js/src/cryptocom.js +52 -54
- package/js/src/cryptomus.d.ts +2 -1
- package/js/src/cryptomus.js +43 -39
- package/js/src/deepcoin.js +9 -5
- package/js/src/delta.d.ts +1 -0
- package/js/src/delta.js +53 -53
- package/js/src/deribit.d.ts +1 -0
- package/js/src/deribit.js +35 -35
- package/js/src/derive.d.ts +1 -0
- package/js/src/derive.js +31 -31
- package/js/src/digifinex.d.ts +1 -0
- package/js/src/digifinex.js +45 -45
- package/js/src/exmo.d.ts +1 -0
- package/js/src/exmo.js +104 -122
- package/js/src/extended.d.ts +554 -0
- package/js/src/extended.js +3490 -0
- package/js/src/foxbit.d.ts +1 -0
- package/js/src/foxbit.js +72 -76
- package/js/src/gate.d.ts +1 -0
- package/js/src/gate.js +53 -53
- package/js/src/gemini.d.ts +2 -1
- package/js/src/gemini.js +45 -45
- package/js/src/grvt.d.ts +1 -1
- package/js/src/grvt.js +17 -11
- package/js/src/hashkey.d.ts +1 -0
- package/js/src/hashkey.js +56 -58
- package/js/src/hibachi.d.ts +1 -1
- package/js/src/hibachi.js +1 -1
- package/js/src/hitbtc.d.ts +0 -1
- package/js/src/hitbtc.js +5 -14
- package/js/src/hollaex.d.ts +1 -0
- package/js/src/hollaex.js +51 -54
- package/js/src/htx.d.ts +1 -0
- package/js/src/htx.js +84 -72
- package/js/src/hyperliquid.d.ts +5 -4
- package/js/src/hyperliquid.js +60 -55
- package/js/src/indodax.js +4 -3
- package/js/src/kraken.d.ts +2 -1
- package/js/src/kraken.js +71 -71
- package/js/src/krakenfutures.js +2 -1
- package/js/src/kucoin.js +3 -2
- package/js/src/latoken.d.ts +1 -0
- package/js/src/latoken.js +30 -32
- package/js/src/lbank.d.ts +1 -0
- package/js/src/lbank.js +64 -60
- package/js/src/lighter.d.ts +2 -1
- package/js/src/lighter.js +36 -38
- package/js/src/luno.d.ts +1 -0
- package/js/src/luno.js +36 -44
- package/js/src/mercado.js +2 -1
- package/js/src/mexc.d.ts +4 -3
- package/js/src/mexc.js +72 -63
- package/js/src/modetrade.d.ts +1 -0
- package/js/src/modetrade.js +51 -53
- package/js/src/ndax.d.ts +1 -0
- package/js/src/ndax.js +35 -37
- package/js/src/okx.js +23 -5
- package/js/src/onetrading.d.ts +2 -1
- package/js/src/onetrading.js +21 -23
- package/js/src/p2b.js +8 -4
- package/js/src/paradex.js +3 -2
- package/js/src/phemex.d.ts +1 -0
- package/js/src/phemex.js +47 -47
- package/js/src/poloniex.js +19 -13
- package/js/src/pro/alpaca.js +1 -1
- package/js/src/pro/apex.js +11 -2
- package/js/src/pro/arkham.js +1 -1
- package/js/src/pro/aster.js +10 -9
- package/js/src/pro/backpack.js +1 -1
- package/js/src/pro/binance.d.ts +1 -1
- package/js/src/pro/binance.js +6 -6
- package/js/src/pro/bingx.js +7 -2
- package/js/src/pro/bitget.js +1 -1
- package/js/src/pro/bithumb.js +1 -1
- package/js/src/pro/bitmart.js +10 -0
- package/js/src/pro/bitmex.js +1 -1
- package/js/src/pro/bitstamp.js +1 -1
- package/js/src/pro/blockchaincom.js +1 -1
- package/js/src/pro/bybit.js +1 -1
- package/js/src/pro/cex.js +1 -1
- package/js/src/pro/coinex.js +1 -1
- package/js/src/pro/coinone.js +1 -1
- package/js/src/pro/cryptocom.js +3 -1
- package/js/src/pro/dydx.js +1 -1
- package/js/src/pro/exmo.js +1 -1
- package/js/src/pro/extended.d.ts +126 -0
- package/js/src/pro/extended.js +858 -0
- package/js/src/pro/gate.js +1 -1
- package/js/src/pro/grvt.js +8 -0
- package/js/src/pro/htx.d.ts +4 -4
- package/js/src/pro/htx.js +4 -4
- package/js/src/pro/independentreserve.js +1 -1
- package/js/src/pro/krakenfutures.d.ts +4 -4
- package/js/src/pro/krakenfutures.js +16 -4
- package/js/src/pro/kucoin.js +1 -1
- package/js/src/pro/luno.d.ts +1 -1
- package/js/src/pro/luno.js +3 -3
- package/js/src/pro/modetrade.d.ts +3 -3
- package/js/src/pro/modetrade.js +3 -3
- package/js/src/pro/okx.d.ts +4 -4
- package/js/src/pro/okx.js +4 -4
- package/js/src/pro/onetrading.js +1 -1
- package/js/src/pro/toobit.js +1 -1
- package/js/src/pro/weex.js +1 -1
- package/js/src/pro/woo.d.ts +4 -4
- package/js/src/pro/woo.js +4 -4
- package/js/src/pro/woofipro.d.ts +3 -3
- package/js/src/pro/woofipro.js +3 -3
- package/js/src/pro/xt.js +1 -1
- package/js/src/tokocrypto.js +1 -1
- package/js/src/toobit.d.ts +1 -1
- package/js/src/toobit.js +3 -3
- package/js/src/upbit.js +3 -3
- package/js/src/weex.d.ts +1 -0
- package/js/src/weex.js +57 -62
- package/js/src/whitebit.d.ts +1 -0
- package/js/src/whitebit.js +61 -63
- package/js/src/woo.d.ts +1 -0
- package/js/src/woo.js +66 -55
- package/js/src/woofipro.d.ts +1 -0
- package/js/src/woofipro.js +54 -48
- package/js/src/xt.js +3 -2
- package/js/src/yobit.js +4 -2
- package/js/src/zebpay.d.ts +2 -1
- package/js/src/zebpay.js +73 -75
- package/package.json +25 -11
- package/dist/cjs/src/gateio.js +0 -18
- package/dist/cjs/src/oxfun.js +0 -2931
- package/dist/cjs/src/pro/gateio.js +0 -18
- package/dist/cjs/src/pro/oxfun.js +0 -1113
- package/js/src/abstract/gateio.d.ts +0 -346
- package/js/src/abstract/gateio.js +0 -5
- package/js/src/abstract/oxfun.d.ts +0 -37
- package/js/src/gateio.d.ts +0 -4
- package/js/src/gateio.js +0 -11
- package/js/src/oxfun.d.ts +0 -442
- package/js/src/oxfun.js +0 -2924
- package/js/src/pro/gateio.d.ts +0 -4
- package/js/src/pro/gateio.js +0 -11
- package/js/src/pro/oxfun.d.ts +0 -234
- package/js/src/pro/oxfun.js +0 -1106
- /package/dist/cjs/src/abstract/{oxfun.js → extended.js} +0 -0
- /package/js/src/abstract/{oxfun.js → extended.js} +0 -0
|
@@ -351,7 +351,7 @@ class coinbaseinternational extends coinbaseinternational$1["default"] {
|
|
|
351
351
|
}
|
|
352
352
|
throw new errors.ArgumentsRequired(this.id + ' ' + methodName + '() requires a portfolio parameter or set the default portfolio with this.options["portfolio"]');
|
|
353
353
|
}
|
|
354
|
-
async handleNetworkIdAndParams(currencyCode, methodName, params) {
|
|
354
|
+
async handleNetworkIdAndParams(currencyCode, methodName, params = {}) {
|
|
355
355
|
let networkId = undefined;
|
|
356
356
|
[networkId, params] = this.handleOptionAndParams(params, methodName, 'network_arn_id');
|
|
357
357
|
if (networkId === undefined) {
|
|
@@ -527,9 +527,10 @@ class coinbaseinternational extends coinbaseinternational$1["default"] {
|
|
|
527
527
|
}
|
|
528
528
|
const market = this.market(symbol);
|
|
529
529
|
const page = this.safeInteger(params, pageKey, 1) - 1;
|
|
530
|
+
const offSet = this.safeInteger2(params, 'offset', 'result_offset', page * maxEntriesPerRequest);
|
|
530
531
|
const request = {
|
|
531
532
|
'instrument': market['id'],
|
|
532
|
-
'result_offset':
|
|
533
|
+
'result_offset': offSet,
|
|
533
534
|
};
|
|
534
535
|
if (limit !== undefined) {
|
|
535
536
|
request['result_limit'] = limit;
|
|
@@ -949,8 +950,9 @@ class coinbaseinternational extends coinbaseinternational$1["default"] {
|
|
|
949
950
|
return await this.fetchPaginatedCallIncremental('fetchDepositsWithdrawals', code, since, limit, params, pageKey, maxEntriesPerRequest);
|
|
950
951
|
}
|
|
951
952
|
const page = this.safeInteger(params, pageKey, 1) - 1;
|
|
953
|
+
const offSet = this.safeInteger2(params, 'offset', 'result_offset', page * maxEntriesPerRequest);
|
|
952
954
|
const request = {
|
|
953
|
-
'result_offset':
|
|
955
|
+
'result_offset': offSet,
|
|
954
956
|
};
|
|
955
957
|
if (since !== undefined) {
|
|
956
958
|
request['time_from'] = this.iso8601(since);
|
|
@@ -1187,13 +1189,14 @@ class coinbaseinternational extends coinbaseinternational$1["default"] {
|
|
|
1187
1189
|
const addressFrom = this.safeStringN(transaction, ['from_address', 'from_cb_account', this.safeStringN(fromPorfolio, ['id', 'uuid', 'name']), 'from_counterparty_id']);
|
|
1188
1190
|
const toPorfolio = this.safeDict(transaction, 'from_portfolio', {});
|
|
1189
1191
|
const addressTo = this.safeStringN(transaction, ['to_address', 'to_cb_account', this.safeStringN(toPorfolio, ['id', 'uuid', 'name']), 'to_counterparty_id']);
|
|
1192
|
+
const code = this.safeString(currency, 'code');
|
|
1190
1193
|
return {
|
|
1191
1194
|
'info': transaction,
|
|
1192
1195
|
'id': this.safeString(transaction, 'transfer_uuid'),
|
|
1193
1196
|
'txid': this.safeString(transaction, 'transaction_uuid'),
|
|
1194
1197
|
'timestamp': this.parse8601(datetime),
|
|
1195
1198
|
'datetime': datetime,
|
|
1196
|
-
'network': this.networkIdToCode(this.safeString(transaction, 'network_name')),
|
|
1199
|
+
'network': this.networkIdToCode(this.safeString(transaction, 'network_name'), code),
|
|
1197
1200
|
'address': undefined,
|
|
1198
1201
|
'addressTo': addressTo,
|
|
1199
1202
|
'addressFrom': addressFrom,
|
|
@@ -1385,16 +1388,18 @@ class coinbaseinternational extends coinbaseinternational$1["default"] {
|
|
|
1385
1388
|
settleId = quoteId;
|
|
1386
1389
|
symbol += ':' + quoteId;
|
|
1387
1390
|
}
|
|
1391
|
+
const isLinear = isSpot ? undefined : (settleId === quoteId);
|
|
1392
|
+
const isInverse = isSpot ? undefined : (settleId !== quoteId);
|
|
1388
1393
|
return {
|
|
1389
1394
|
'id': marketId,
|
|
1390
1395
|
'lowercaseId': marketId.toLowerCase(),
|
|
1391
1396
|
'symbol': symbol,
|
|
1392
1397
|
'base': baseId,
|
|
1393
1398
|
'quote': quoteId,
|
|
1394
|
-
'settle': settleId
|
|
1399
|
+
'settle': settleId,
|
|
1395
1400
|
'baseId': baseId,
|
|
1396
1401
|
'quoteId': quoteId,
|
|
1397
|
-
'settleId': settleId
|
|
1402
|
+
'settleId': settleId,
|
|
1398
1403
|
'type': isSpot ? 'spot' : 'swap',
|
|
1399
1404
|
'spot': isSpot,
|
|
1400
1405
|
'margin': false,
|
|
@@ -1403,8 +1408,8 @@ class coinbaseinternational extends coinbaseinternational$1["default"] {
|
|
|
1403
1408
|
'option': false,
|
|
1404
1409
|
'active': this.safeString(market, 'trading_state') === 'TRADING',
|
|
1405
1410
|
'contract': !isSpot,
|
|
1406
|
-
'linear':
|
|
1407
|
-
'inverse':
|
|
1411
|
+
'linear': isLinear,
|
|
1412
|
+
'inverse': isInverse,
|
|
1408
1413
|
'taker': fees['trading']['taker'],
|
|
1409
1414
|
'maker': fees['trading']['maker'],
|
|
1410
1415
|
'contractSize': isSpot ? undefined : 1,
|
|
@@ -2053,9 +2058,10 @@ class coinbaseinternational extends coinbaseinternational$1["default"] {
|
|
|
2053
2058
|
return await this.fetchPaginatedCallIncremental('fetchOpenOrders', symbol, since, limit, params, pageKey, maxEntriesPerRequest);
|
|
2054
2059
|
}
|
|
2055
2060
|
const page = this.safeInteger(params, pageKey, 1) - 1;
|
|
2061
|
+
const offSet = this.safeInteger2(params, 'offset', 'result_offset', page * maxEntriesPerRequest);
|
|
2056
2062
|
const request = {
|
|
2057
2063
|
'portfolio': portfolio,
|
|
2058
|
-
'result_offset':
|
|
2064
|
+
'result_offset': offSet,
|
|
2059
2065
|
};
|
|
2060
2066
|
let market = undefined;
|
|
2061
2067
|
if (symbol) {
|
|
@@ -2137,8 +2143,9 @@ class coinbaseinternational extends coinbaseinternational$1["default"] {
|
|
|
2137
2143
|
market = this.market(symbol);
|
|
2138
2144
|
}
|
|
2139
2145
|
const page = this.safeInteger(params, pageKey, 1) - 1;
|
|
2146
|
+
const offSet = this.safeInteger2(params, 'offset', 'result_offset', page * maxEntriesPerRequest);
|
|
2140
2147
|
const request = {
|
|
2141
|
-
'result_offset':
|
|
2148
|
+
'result_offset': offSet,
|
|
2142
2149
|
};
|
|
2143
2150
|
if (limit !== undefined) {
|
|
2144
2151
|
if (limit > 100) {
|
package/dist/cjs/src/coinex.js
CHANGED
|
@@ -730,90 +730,88 @@ class coinex extends coinex$1["default"] {
|
|
|
730
730
|
// }
|
|
731
731
|
//
|
|
732
732
|
const data = this.safeList(response, 'data', []);
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
}
|
|
755
|
-
const precisionString = this.parsePrecision(this.safeString(chain, 'withdrawal_precision'));
|
|
756
|
-
const feeString = this.safeString(chain, 'withdrawal_fee');
|
|
757
|
-
const minNetworkDepositString = this.safeString(chain, 'min_deposit_amount');
|
|
758
|
-
const minNetworkWithdrawString = this.safeString(chain, 'min_withdraw_amount');
|
|
759
|
-
const canDepositChain = this.safeBool(chain, 'deposit_enabled');
|
|
760
|
-
const canWithdrawChain = this.safeBool(chain, 'withdraw_enabled');
|
|
761
|
-
const network = {
|
|
762
|
-
'id': networkId,
|
|
763
|
-
'network': networkCode,
|
|
764
|
-
'name': undefined,
|
|
765
|
-
'active': canDepositChain && canWithdrawChain,
|
|
766
|
-
'deposit': canDepositChain,
|
|
767
|
-
'withdraw': canWithdrawChain,
|
|
768
|
-
'fee': this.parseNumber(feeString),
|
|
769
|
-
'precision': this.parseNumber(precisionString),
|
|
770
|
-
'limits': {
|
|
771
|
-
'amount': {
|
|
772
|
-
'min': undefined,
|
|
773
|
-
'max': undefined,
|
|
774
|
-
},
|
|
775
|
-
'deposit': {
|
|
776
|
-
'min': this.parseNumber(minNetworkDepositString),
|
|
777
|
-
'max': undefined,
|
|
778
|
-
},
|
|
779
|
-
'withdraw': {
|
|
780
|
-
'min': this.parseNumber(minNetworkWithdrawString),
|
|
781
|
-
'max': undefined,
|
|
782
|
-
},
|
|
783
|
-
},
|
|
784
|
-
'info': chain,
|
|
785
|
-
};
|
|
786
|
-
networks[networkCode] = network;
|
|
733
|
+
return this.parseCurrencies(data);
|
|
734
|
+
}
|
|
735
|
+
parseCurrency(coin) {
|
|
736
|
+
const asset = this.safeDict(coin, 'asset', {});
|
|
737
|
+
const chains = this.safeList(coin, 'chains', []);
|
|
738
|
+
const currencyId = this.safeString(asset, 'ccy');
|
|
739
|
+
if (currencyId === undefined) {
|
|
740
|
+
return undefined; // coinex returns empty structures for some reason
|
|
741
|
+
}
|
|
742
|
+
const code = this.safeCurrencyCode(currencyId);
|
|
743
|
+
const canDeposit = this.safeBool(asset, 'deposit_enabled');
|
|
744
|
+
const canWithdraw = this.safeBool(asset, 'withdraw_enabled');
|
|
745
|
+
const firstChain = this.safeDict(chains, 0, {});
|
|
746
|
+
const firstPrecisionString = this.parsePrecision(this.safeString(firstChain, 'withdrawal_precision'));
|
|
747
|
+
const networks = {};
|
|
748
|
+
for (let j = 0; j < chains.length; j++) {
|
|
749
|
+
const chain = chains[j];
|
|
750
|
+
const networkId = this.safeString(chain, 'chain');
|
|
751
|
+
const networkCode = this.networkIdToCode(networkId, code);
|
|
752
|
+
if (networkId === undefined) {
|
|
753
|
+
continue;
|
|
787
754
|
}
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
755
|
+
const precisionString = this.parsePrecision(this.safeString(chain, 'withdrawal_precision'));
|
|
756
|
+
const feeString = this.safeString(chain, 'withdrawal_fee');
|
|
757
|
+
const minNetworkDepositString = this.safeString(chain, 'min_deposit_amount');
|
|
758
|
+
const minNetworkWithdrawString = this.safeString(chain, 'min_withdraw_amount');
|
|
759
|
+
const canDepositChain = this.safeBool(chain, 'deposit_enabled');
|
|
760
|
+
const canWithdrawChain = this.safeBool(chain, 'withdraw_enabled');
|
|
761
|
+
const network = {
|
|
762
|
+
'id': networkId,
|
|
763
|
+
'network': networkCode,
|
|
791
764
|
'name': undefined,
|
|
792
|
-
'active':
|
|
793
|
-
'deposit':
|
|
794
|
-
'withdraw':
|
|
795
|
-
'fee':
|
|
796
|
-
'precision': this.parseNumber(
|
|
765
|
+
'active': canDepositChain && canWithdrawChain,
|
|
766
|
+
'deposit': canDepositChain,
|
|
767
|
+
'withdraw': canWithdrawChain,
|
|
768
|
+
'fee': this.parseNumber(feeString),
|
|
769
|
+
'precision': this.parseNumber(precisionString),
|
|
797
770
|
'limits': {
|
|
798
771
|
'amount': {
|
|
799
772
|
'min': undefined,
|
|
800
773
|
'max': undefined,
|
|
801
774
|
},
|
|
802
775
|
'deposit': {
|
|
803
|
-
'min':
|
|
776
|
+
'min': this.parseNumber(minNetworkDepositString),
|
|
804
777
|
'max': undefined,
|
|
805
778
|
},
|
|
806
779
|
'withdraw': {
|
|
807
|
-
'min':
|
|
780
|
+
'min': this.parseNumber(minNetworkWithdrawString),
|
|
808
781
|
'max': undefined,
|
|
809
782
|
},
|
|
810
783
|
},
|
|
811
|
-
'
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
784
|
+
'info': chain,
|
|
785
|
+
};
|
|
786
|
+
networks[networkCode] = network;
|
|
787
|
+
}
|
|
788
|
+
return this.safeCurrencyStructure({
|
|
789
|
+
'id': currencyId,
|
|
790
|
+
'code': code,
|
|
791
|
+
'name': undefined,
|
|
792
|
+
'active': canDeposit && canWithdraw,
|
|
793
|
+
'deposit': canDeposit,
|
|
794
|
+
'withdraw': canWithdraw,
|
|
795
|
+
'fee': undefined,
|
|
796
|
+
'precision': this.parseNumber(firstPrecisionString),
|
|
797
|
+
'limits': {
|
|
798
|
+
'amount': {
|
|
799
|
+
'min': undefined,
|
|
800
|
+
'max': undefined,
|
|
801
|
+
},
|
|
802
|
+
'deposit': {
|
|
803
|
+
'min': undefined,
|
|
804
|
+
'max': undefined,
|
|
805
|
+
},
|
|
806
|
+
'withdraw': {
|
|
807
|
+
'min': undefined,
|
|
808
|
+
'max': undefined,
|
|
809
|
+
},
|
|
810
|
+
},
|
|
811
|
+
'networks': networks,
|
|
812
|
+
'type': 'crypto',
|
|
813
|
+
'info': coin,
|
|
814
|
+
});
|
|
817
815
|
}
|
|
818
816
|
/**
|
|
819
817
|
* @method
|
|
@@ -3998,7 +3996,7 @@ class coinex extends coinex$1["default"] {
|
|
|
3998
3996
|
if (networkCode === undefined) {
|
|
3999
3997
|
throw new errors.ArgumentsRequired(this.id + ' fetchDepositAddress() requires a "network" parameter');
|
|
4000
3998
|
}
|
|
4001
|
-
request['chain'] = this.networkCodeToId(networkCode); // required for on-chain, not required for inter-user transfer
|
|
3999
|
+
request['chain'] = this.networkCodeToId(networkCode, currency['code']); // required for on-chain, not required for inter-user transfer
|
|
4002
4000
|
const response = await this.v2PrivateGetAssetsDepositAddress(this.extend(request, params));
|
|
4003
4001
|
//
|
|
4004
4002
|
// {
|
|
@@ -4503,11 +4501,13 @@ class coinex extends coinex$1["default"] {
|
|
|
4503
4501
|
const marketId = this.safeString(info, 'market');
|
|
4504
4502
|
market = this.safeMarket(marketId, market, undefined, 'swap');
|
|
4505
4503
|
const maxNotional = this.safeNumber(tier, 'amount');
|
|
4504
|
+
const curr = market['linear'] ? market['base'] : market['quote'];
|
|
4505
|
+
const notional = minNotional;
|
|
4506
4506
|
tiers.push({
|
|
4507
4507
|
'tier': this.sum(i, 1),
|
|
4508
4508
|
'symbol': this.safeSymbol(marketId, market, undefined, 'swap'),
|
|
4509
|
-
'currency':
|
|
4510
|
-
'minNotional':
|
|
4509
|
+
'currency': curr,
|
|
4510
|
+
'minNotional': notional,
|
|
4511
4511
|
'maxNotional': maxNotional,
|
|
4512
4512
|
'maintenanceMarginRate': this.safeNumber(tier, 'maintenance_margin_rate'),
|
|
4513
4513
|
'maxLeverage': this.safeInteger(tier, 'leverage'),
|
|
@@ -4922,7 +4922,7 @@ class coinex extends coinex$1["default"] {
|
|
|
4922
4922
|
let networkCode = undefined;
|
|
4923
4923
|
[networkCode, params] = this.handleNetworkCodeAndParams(params);
|
|
4924
4924
|
if (networkCode !== undefined) {
|
|
4925
|
-
request['chain'] = this.networkCodeToId(networkCode); // required for on-chain, not required for inter-user transfer
|
|
4925
|
+
request['chain'] = this.networkCodeToId(networkCode, currency['code']); // required for on-chain, not required for inter-user transfer
|
|
4926
4926
|
}
|
|
4927
4927
|
const response = await this.v2PrivatePostAssetsWithdraw(this.extend(request, params));
|
|
4928
4928
|
//
|
|
@@ -5129,7 +5129,7 @@ class coinex extends coinex$1["default"] {
|
|
|
5129
5129
|
'txid': txid,
|
|
5130
5130
|
'timestamp': timestamp,
|
|
5131
5131
|
'datetime': this.iso8601(timestamp),
|
|
5132
|
-
'network': this.networkIdToCode(networkId),
|
|
5132
|
+
'network': this.networkIdToCode(networkId, code),
|
|
5133
5133
|
'address': address,
|
|
5134
5134
|
'addressTo': address,
|
|
5135
5135
|
'addressFrom': undefined,
|
|
@@ -5722,7 +5722,7 @@ class coinex extends coinex$1["default"] {
|
|
|
5722
5722
|
* @name coinex#fetchDepositWithdrawFees
|
|
5723
5723
|
* @description fetch the fees for deposits and withdrawals
|
|
5724
5724
|
* @see https://docs.coinex.com/api/v2/assets/deposit-withdrawal/http/list-all-deposit-withdrawal-config
|
|
5725
|
-
* @param codes
|
|
5725
|
+
* @param {string[]} [codes] list of unified currency codes
|
|
5726
5726
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5727
5727
|
* @returns {object} a dictionary of [fee structures]{@link https://docs.ccxt.com/?id=fee-structure}
|
|
5728
5728
|
*/
|
|
@@ -5832,7 +5832,9 @@ class coinex extends coinex$1["default"] {
|
|
|
5832
5832
|
result['withdraw']['percentage'] = false;
|
|
5833
5833
|
const networkId = this.safeString(entry, 'chain');
|
|
5834
5834
|
if (networkId) {
|
|
5835
|
-
const
|
|
5835
|
+
const currencyId = this.safeString(asset, 'ccy');
|
|
5836
|
+
const feeCode = this.safeCurrencyCode(currencyId, currency);
|
|
5837
|
+
const networkCode = this.networkIdToCode(networkId, feeCode);
|
|
5836
5838
|
result['networks'][networkCode] = {
|
|
5837
5839
|
'withdraw': {
|
|
5838
5840
|
'fee': this.safeNumber(entry, 'withdrawal_fee'),
|
|
@@ -891,7 +891,7 @@ class coinmetro extends coinmetro$1["default"] {
|
|
|
891
891
|
orderbook['nonce'] = this.safeInteger(book, 'seqNumber');
|
|
892
892
|
return orderbook;
|
|
893
893
|
}
|
|
894
|
-
|
|
894
|
+
parseOrderBookBidsAsks(bidasks, priceKey = 0, amountKey = 1, countOrIdKey = 2) {
|
|
895
895
|
const prices = Object.keys(bidasks);
|
|
896
896
|
const result = [];
|
|
897
897
|
for (let i = 0; i < prices.length; i++) {
|
package/dist/cjs/src/coinsph.js
CHANGED
|
@@ -628,7 +628,7 @@ class coinsph extends coinsph$1["default"] {
|
|
|
628
628
|
for (let j = 0; j < networkList.length; j++) {
|
|
629
629
|
const networkItem = networkList[j];
|
|
630
630
|
const network = this.safeString(networkItem, 'network');
|
|
631
|
-
const networkCode = this.networkIdToCode(network);
|
|
631
|
+
const networkCode = this.networkIdToCode(network, code);
|
|
632
632
|
networks[networkCode] = {
|
|
633
633
|
'info': networkItem,
|
|
634
634
|
'id': network,
|
|
@@ -1277,12 +1277,12 @@ class coinsph extends coinsph$1["default"] {
|
|
|
1277
1277
|
'currency': this.safeCurrencyCode(feeCurrencyId),
|
|
1278
1278
|
};
|
|
1279
1279
|
}
|
|
1280
|
-
const isBuyer = this.safeBool2(trade, 'isBuyer', 'isBuyerMaker'
|
|
1280
|
+
const isBuyer = this.safeBool2(trade, 'isBuyer', 'isBuyerMaker');
|
|
1281
1281
|
let side = undefined;
|
|
1282
1282
|
if (isBuyer !== undefined) {
|
|
1283
1283
|
side = (isBuyer === true) ? 'buy' : 'sell';
|
|
1284
1284
|
}
|
|
1285
|
-
const isMaker = this.
|
|
1285
|
+
const isMaker = this.safeString(trade, 'isMaker');
|
|
1286
1286
|
let takerOrMaker = undefined;
|
|
1287
1287
|
if (isMaker !== undefined) {
|
|
1288
1288
|
takerOrMaker = (isMaker === 'true') ? 'maker' : 'taker';
|
|
@@ -1677,7 +1677,7 @@ class coinsph extends coinsph$1["default"] {
|
|
|
1677
1677
|
const marketId = this.safeString(order, 'symbol');
|
|
1678
1678
|
market = this.safeMarket(marketId, market);
|
|
1679
1679
|
const timestamp = this.safeInteger2(order, 'time', 'transactTime');
|
|
1680
|
-
const trades = this.safeValue(order, 'fills'
|
|
1680
|
+
const trades = this.safeValue(order, 'fills');
|
|
1681
1681
|
let triggerPrice = this.safeString(order, 'stopPrice');
|
|
1682
1682
|
if (Precise["default"].stringEq(triggerPrice, '0')) {
|
|
1683
1683
|
triggerPrice = undefined;
|
|
@@ -2218,7 +2218,7 @@ class coinsph extends coinsph$1["default"] {
|
|
|
2218
2218
|
if (response === undefined) {
|
|
2219
2219
|
return undefined;
|
|
2220
2220
|
}
|
|
2221
|
-
const responseCode = this.safeString(response, 'code'
|
|
2221
|
+
const responseCode = this.safeString(response, 'code');
|
|
2222
2222
|
if ((responseCode !== undefined) && (responseCode !== '200') && (responseCode !== '0')) {
|
|
2223
2223
|
const feedback = this.id + ' ' + body;
|
|
2224
2224
|
this.throwBroadlyMatchedException(this.exceptions['broad'], body, feedback);
|
|
@@ -564,7 +564,8 @@ class cryptocom extends cryptocom$1["default"] {
|
|
|
564
564
|
response = await this.v1PrivatePostPrivateGetCurrencyNetworks(params);
|
|
565
565
|
}
|
|
566
566
|
catch (e) {
|
|
567
|
-
|
|
567
|
+
const erString = this.exceptionMessage(e);
|
|
568
|
+
if (erString.indexOf('"msg":"SYS_ERROR"') >= 0) {
|
|
568
569
|
// sub-accounts can't access this endpoint
|
|
569
570
|
// {"code":"10001","msg":"SYS_ERROR"}
|
|
570
571
|
return {};
|
|
@@ -617,57 +618,54 @@ class cryptocom extends cryptocom$1["default"] {
|
|
|
617
618
|
//
|
|
618
619
|
const resultData = this.safeDict(response, 'result', {});
|
|
619
620
|
const currencyMap = this.safeDict(resultData, 'currency_map', {});
|
|
620
|
-
const
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
'network': network,
|
|
637
|
-
'active': undefined,
|
|
638
|
-
'deposit': this.safeBool(chain, 'deposit_enabled', false),
|
|
639
|
-
'withdraw': this.safeBool(chain, 'withdraw_enabled', false),
|
|
640
|
-
'fee': this.safeNumber(chain, 'withdrawal_fee'),
|
|
641
|
-
'precision': undefined,
|
|
642
|
-
'limits': {
|
|
643
|
-
'withdraw': {
|
|
644
|
-
'min': this.safeNumber(chain, 'min_withdrawal_amount'),
|
|
645
|
-
'max': undefined,
|
|
646
|
-
},
|
|
647
|
-
},
|
|
648
|
-
};
|
|
649
|
-
}
|
|
650
|
-
result[code] = this.safeCurrencyStructure({
|
|
651
|
-
'info': currency,
|
|
652
|
-
'id': id,
|
|
653
|
-
'code': code,
|
|
654
|
-
'name': this.safeString(currency, 'full_name'),
|
|
621
|
+
const enhancedArray = this.addKeyInArrayItems(currencyMap, '_coin_id');
|
|
622
|
+
return this.parseCurrencies(enhancedArray);
|
|
623
|
+
}
|
|
624
|
+
parseCurrency(currency) {
|
|
625
|
+
const id = this.safeString(currency, '_coin_id');
|
|
626
|
+
const code = this.safeCurrencyCode(id);
|
|
627
|
+
const networks = {};
|
|
628
|
+
const chains = this.safeList(currency, 'network_list', []);
|
|
629
|
+
for (let j = 0; j < chains.length; j++) {
|
|
630
|
+
const chain = chains[j];
|
|
631
|
+
const networkId = this.safeString(chain, 'network_id');
|
|
632
|
+
const network = this.networkIdToCode(networkId, code);
|
|
633
|
+
networks[network] = {
|
|
634
|
+
'info': chain,
|
|
635
|
+
'id': networkId,
|
|
636
|
+
'network': network,
|
|
655
637
|
'active': undefined,
|
|
656
|
-
'deposit':
|
|
657
|
-
'withdraw':
|
|
658
|
-
'fee':
|
|
638
|
+
'deposit': this.safeBool(chain, 'deposit_enabled', false),
|
|
639
|
+
'withdraw': this.safeBool(chain, 'withdraw_enabled', false),
|
|
640
|
+
'fee': this.safeNumber(chain, 'withdrawal_fee'),
|
|
659
641
|
'precision': undefined,
|
|
660
642
|
'limits': {
|
|
661
|
-
'
|
|
662
|
-
'min':
|
|
643
|
+
'withdraw': {
|
|
644
|
+
'min': this.safeNumber(chain, 'min_withdrawal_amount'),
|
|
663
645
|
'max': undefined,
|
|
664
646
|
},
|
|
665
647
|
},
|
|
666
|
-
|
|
667
|
-
'networks': networks,
|
|
668
|
-
});
|
|
648
|
+
};
|
|
669
649
|
}
|
|
670
|
-
return
|
|
650
|
+
return this.safeCurrencyStructure({
|
|
651
|
+
'info': currency,
|
|
652
|
+
'id': id,
|
|
653
|
+
'code': code,
|
|
654
|
+
'name': this.safeString(currency, 'full_name'),
|
|
655
|
+
'active': undefined,
|
|
656
|
+
'deposit': undefined,
|
|
657
|
+
'withdraw': undefined,
|
|
658
|
+
'fee': undefined,
|
|
659
|
+
'precision': undefined,
|
|
660
|
+
'limits': {
|
|
661
|
+
'amount': {
|
|
662
|
+
'min': undefined,
|
|
663
|
+
'max': undefined,
|
|
664
|
+
},
|
|
665
|
+
},
|
|
666
|
+
'type': 'crypto',
|
|
667
|
+
'networks': networks,
|
|
668
|
+
});
|
|
671
669
|
}
|
|
672
670
|
/**
|
|
673
671
|
* @method
|
|
@@ -811,6 +809,8 @@ class cryptocom extends cryptocom$1["default"] {
|
|
|
811
809
|
symbol = symbol + ':' + quote + '-' + this.yymmdd(expiry) + '-' + strike + '-' + symbolOptionType;
|
|
812
810
|
contract = true;
|
|
813
811
|
}
|
|
812
|
+
const isLinear = (contract) ? true : undefined;
|
|
813
|
+
const isInverse = (contract) ? false : undefined;
|
|
814
814
|
result.push({
|
|
815
815
|
'id': this.safeString(market, 'symbol'),
|
|
816
816
|
'symbol': symbol,
|
|
@@ -828,8 +828,8 @@ class cryptocom extends cryptocom$1["default"] {
|
|
|
828
828
|
'option': option,
|
|
829
829
|
'active': this.safeBool(market, 'tradable'),
|
|
830
830
|
'contract': contract,
|
|
831
|
-
'linear':
|
|
832
|
-
'inverse':
|
|
831
|
+
'linear': isLinear,
|
|
832
|
+
'inverse': isInverse,
|
|
833
833
|
'contractSize': this.safeNumber(market, 'contract_size'),
|
|
834
834
|
'expiry': expiry,
|
|
835
835
|
'expiryDatetime': this.iso8601(expiry),
|
|
@@ -2019,7 +2019,7 @@ class cryptocom extends cryptocom$1["default"] {
|
|
|
2019
2019
|
}
|
|
2020
2020
|
let networkCode = undefined;
|
|
2021
2021
|
[networkCode, params] = this.handleNetworkCodeAndParams(params);
|
|
2022
|
-
const networkId = this.networkCodeToId(networkCode);
|
|
2022
|
+
const networkId = this.networkCodeToId(networkCode, code);
|
|
2023
2023
|
if (networkId !== undefined) {
|
|
2024
2024
|
request['network_id'] = networkId;
|
|
2025
2025
|
}
|
|
@@ -2120,10 +2120,8 @@ class cryptocom extends cryptocom$1["default"] {
|
|
|
2120
2120
|
if (network in depositAddresses) {
|
|
2121
2121
|
return depositAddresses[network];
|
|
2122
2122
|
}
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
return depositAddresses[keys[0]];
|
|
2126
|
-
}
|
|
2123
|
+
const keys = Object.keys(depositAddresses);
|
|
2124
|
+
return depositAddresses[keys[0]];
|
|
2127
2125
|
}
|
|
2128
2126
|
/**
|
|
2129
2127
|
* @method
|
|
@@ -3334,8 +3332,8 @@ class cryptocom extends cryptocom$1["default"] {
|
|
|
3334
3332
|
paramsKeys = object;
|
|
3335
3333
|
}
|
|
3336
3334
|
else {
|
|
3337
|
-
const
|
|
3338
|
-
paramsKeys =
|
|
3335
|
+
const objectKeys = Object.keys(object);
|
|
3336
|
+
paramsKeys = this.sort(objectKeys);
|
|
3339
3337
|
}
|
|
3340
3338
|
for (let i = 0; i < paramsKeys.length; i++) {
|
|
3341
3339
|
const key = paramsKeys[i];
|
|
@@ -79,7 +79,7 @@ class cryptomus extends cryptomus$1["default"] {
|
|
|
79
79
|
'fetchConvertTradeHistory': false,
|
|
80
80
|
'fetchCrossBorrowRate': false,
|
|
81
81
|
'fetchCrossBorrowRates': false,
|
|
82
|
-
'fetchCurrencies':
|
|
82
|
+
'fetchCurrencies': true,
|
|
83
83
|
'fetchDepositAddress': false,
|
|
84
84
|
'fetchDeposits': false,
|
|
85
85
|
'fetchDepositsWithdrawals': false,
|
|
@@ -406,46 +406,50 @@ class cryptomus extends cryptomus$1["default"] {
|
|
|
406
406
|
//
|
|
407
407
|
const coins = this.safeList(response, 'result');
|
|
408
408
|
const groupedById = this.groupBy(coins, 'currency_code');
|
|
409
|
-
const
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
'limits': {
|
|
424
|
-
'withdraw': {
|
|
425
|
-
'min': this.safeNumber(networkEntry, 'min_withdraw'),
|
|
426
|
-
'max': this.safeNumber(networkEntry, 'max_withdraw'),
|
|
427
|
-
},
|
|
428
|
-
'deposit': {
|
|
429
|
-
'min': this.safeNumber(networkEntry, 'min_deposit'),
|
|
430
|
-
'max': this.safeNumber(networkEntry, 'max_deposit'),
|
|
431
|
-
},
|
|
432
|
-
},
|
|
433
|
-
'active': undefined,
|
|
434
|
-
'deposit': this.safeBool(networkEntry, 'can_withdraw'),
|
|
435
|
-
'withdraw': this.safeBool(networkEntry, 'can_deposit'),
|
|
436
|
-
'fee': undefined,
|
|
437
|
-
'precision': undefined,
|
|
438
|
-
'info': networkEntry,
|
|
439
|
-
};
|
|
409
|
+
const groupedArray = Object.values(groupedById);
|
|
410
|
+
return this.parseCurrencies(groupedArray);
|
|
411
|
+
}
|
|
412
|
+
parseCurrency(rawCurrency) {
|
|
413
|
+
// currency here is array of networks
|
|
414
|
+
let id = undefined; // all entried have same id, as they were grouped by
|
|
415
|
+
let code = undefined;
|
|
416
|
+
const networks = {};
|
|
417
|
+
for (let i = 0; i < rawCurrency.length; i++) {
|
|
418
|
+
const networkEntry = rawCurrency[i];
|
|
419
|
+
// set ID on first loop
|
|
420
|
+
if (id === undefined) {
|
|
421
|
+
id = this.safeString(networkEntry, 'currency_code');
|
|
422
|
+
code = this.safeCurrencyCode(id);
|
|
440
423
|
}
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
'
|
|
445
|
-
'
|
|
446
|
-
|
|
424
|
+
const networkId = this.safeString(networkEntry, 'network_code');
|
|
425
|
+
const networkCode = this.networkIdToCode(networkId, code);
|
|
426
|
+
networks[networkCode] = {
|
|
427
|
+
'id': networkId,
|
|
428
|
+
'network': networkCode,
|
|
429
|
+
'limits': {
|
|
430
|
+
'withdraw': {
|
|
431
|
+
'min': this.safeNumber(networkEntry, 'min_withdraw'),
|
|
432
|
+
'max': this.safeNumber(networkEntry, 'max_withdraw'),
|
|
433
|
+
},
|
|
434
|
+
'deposit': {
|
|
435
|
+
'min': this.safeNumber(networkEntry, 'min_deposit'),
|
|
436
|
+
'max': this.safeNumber(networkEntry, 'max_deposit'),
|
|
437
|
+
},
|
|
438
|
+
},
|
|
439
|
+
'active': undefined,
|
|
440
|
+
'deposit': this.safeBool(networkEntry, 'can_deposit'),
|
|
441
|
+
'withdraw': this.safeBool(networkEntry, 'can_withdraw'),
|
|
442
|
+
'fee': undefined,
|
|
443
|
+
'precision': undefined,
|
|
444
|
+
'info': networkEntry,
|
|
445
|
+
};
|
|
447
446
|
}
|
|
448
|
-
return
|
|
447
|
+
return this.safeCurrencyStructure({
|
|
448
|
+
'id': id,
|
|
449
|
+
'code': code,
|
|
450
|
+
'networks': networks,
|
|
451
|
+
'info': rawCurrency,
|
|
452
|
+
});
|
|
449
453
|
}
|
|
450
454
|
/**
|
|
451
455
|
* @method
|