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
|
@@ -377,24 +377,35 @@ class coinmetro extends coinmetro$1 {
|
|
|
377
377
|
const currency = response[i];
|
|
378
378
|
const id = this.safeString(currency, 'symbol');
|
|
379
379
|
const code = this.safeCurrencyCode(id);
|
|
380
|
-
const
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
380
|
+
const typeRaw = this.safeString(currency, 'type');
|
|
381
|
+
let type = undefined;
|
|
382
|
+
if (typeRaw === 'coin' || typeRaw === 'token' || typeRaw === 'erc20') {
|
|
383
|
+
type = 'crypto';
|
|
384
|
+
}
|
|
385
|
+
else if (typeRaw === 'fiat') {
|
|
386
|
+
type = 'fiat';
|
|
387
|
+
}
|
|
388
|
+
const precisionDigits = this.safeString2(currency, 'digits', 'notabeneDecimals');
|
|
385
389
|
result[code] = this.safeCurrencyStructure({
|
|
386
390
|
'id': id,
|
|
387
391
|
'code': code,
|
|
388
392
|
'name': code,
|
|
393
|
+
'type': type,
|
|
389
394
|
'info': currency,
|
|
390
|
-
'active':
|
|
391
|
-
'deposit':
|
|
392
|
-
'withdraw':
|
|
395
|
+
'active': this.safeBool(currency, 'canTrade'),
|
|
396
|
+
'deposit': this.safeBool(currency, 'canDeposit'),
|
|
397
|
+
'withdraw': this.safeBool(currency, 'canWithdraw'),
|
|
393
398
|
'fee': undefined,
|
|
394
|
-
'precision': this.parseNumber(this.parsePrecision(
|
|
399
|
+
'precision': this.parseNumber(this.parsePrecision(precisionDigits)),
|
|
395
400
|
'limits': {
|
|
396
|
-
'amount': {
|
|
397
|
-
|
|
401
|
+
'amount': {
|
|
402
|
+
'min': this.safeNumber(currency, 'minQty'),
|
|
403
|
+
'max': undefined,
|
|
404
|
+
},
|
|
405
|
+
'withdraw': {
|
|
406
|
+
'min': undefined,
|
|
407
|
+
'max': undefined,
|
|
408
|
+
},
|
|
398
409
|
},
|
|
399
410
|
'networks': {},
|
|
400
411
|
});
|
package/dist/cjs/src/coinone.js
CHANGED
|
@@ -296,18 +296,16 @@ class coinone extends coinone$1 {
|
|
|
296
296
|
for (let i = 0; i < currencies.length; i++) {
|
|
297
297
|
const entry = currencies[i];
|
|
298
298
|
const id = this.safeString(entry, 'symbol');
|
|
299
|
-
const name = this.safeString(entry, 'name');
|
|
300
299
|
const code = this.safeCurrencyCode(id);
|
|
301
|
-
const
|
|
302
|
-
const
|
|
303
|
-
const
|
|
304
|
-
|
|
305
|
-
result[code] = {
|
|
300
|
+
const isWithdrawEnabled = this.safeString(entry, 'withdraw_status', '') === 'normal';
|
|
301
|
+
const isDepositEnabled = this.safeString(entry, 'deposit_status', '') === 'normal';
|
|
302
|
+
const type = (code !== 'KRW') ? 'crypto' : 'fiat';
|
|
303
|
+
result[code] = this.safeCurrencyStructure({
|
|
306
304
|
'id': id,
|
|
307
305
|
'code': code,
|
|
308
306
|
'info': entry,
|
|
309
|
-
'name': name,
|
|
310
|
-
'active':
|
|
307
|
+
'name': this.safeString(entry, 'name'),
|
|
308
|
+
'active': undefined,
|
|
311
309
|
'deposit': isDepositEnabled,
|
|
312
310
|
'withdraw': isWithdrawEnabled,
|
|
313
311
|
'fee': this.safeNumber(entry, 'withdrawal_fee'),
|
|
@@ -323,8 +321,8 @@ class coinone extends coinone$1 {
|
|
|
323
321
|
},
|
|
324
322
|
},
|
|
325
323
|
'networks': {},
|
|
326
|
-
'type':
|
|
327
|
-
};
|
|
324
|
+
'type': type,
|
|
325
|
+
});
|
|
328
326
|
}
|
|
329
327
|
return result;
|
|
330
328
|
}
|
package/dist/cjs/src/coinsph.js
CHANGED
|
@@ -57,7 +57,7 @@ class coinsph extends coinsph$1 {
|
|
|
57
57
|
'fetchClosedOrders': true,
|
|
58
58
|
'fetchCrossBorrowRate': false,
|
|
59
59
|
'fetchCrossBorrowRates': false,
|
|
60
|
-
'fetchCurrencies':
|
|
60
|
+
'fetchCurrencies': true,
|
|
61
61
|
'fetchDeposit': undefined,
|
|
62
62
|
'fetchDepositAddress': true,
|
|
63
63
|
'fetchDepositAddresses': false,
|
|
@@ -483,6 +483,131 @@ class coinsph extends coinsph$1 {
|
|
|
483
483
|
},
|
|
484
484
|
});
|
|
485
485
|
}
|
|
486
|
+
/**
|
|
487
|
+
* @method
|
|
488
|
+
* @name coinsph#fetchCurrencies
|
|
489
|
+
* @description fetches all available currencies on an exchange
|
|
490
|
+
* @see https://docs.coins.ph/rest-api/#all-coins-information-user_data
|
|
491
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
492
|
+
* @returns {object} an associative dictionary of currencies
|
|
493
|
+
*/
|
|
494
|
+
async fetchCurrencies(params = {}) {
|
|
495
|
+
if (!this.checkRequiredCredentials(false)) {
|
|
496
|
+
return undefined;
|
|
497
|
+
}
|
|
498
|
+
const response = await this.privateGetOpenapiWalletV1ConfigGetall(params);
|
|
499
|
+
//
|
|
500
|
+
// [
|
|
501
|
+
// {
|
|
502
|
+
// "coin": "PHP",
|
|
503
|
+
// "name": "PHP",
|
|
504
|
+
// "depositAllEnable": false,
|
|
505
|
+
// "withdrawAllEnable": false,
|
|
506
|
+
// "free": "0",
|
|
507
|
+
// "locked": "0",
|
|
508
|
+
// "transferPrecision": "2",
|
|
509
|
+
// "transferMinQuantity": "0",
|
|
510
|
+
// "networkList": [],
|
|
511
|
+
// "legalMoney": true
|
|
512
|
+
// },
|
|
513
|
+
// {
|
|
514
|
+
// "coin": "USDT",
|
|
515
|
+
// "name": "USDT",
|
|
516
|
+
// "depositAllEnable": true,
|
|
517
|
+
// "withdrawAllEnable": true,
|
|
518
|
+
// "free": "0",
|
|
519
|
+
// "locked": "0",
|
|
520
|
+
// "transferPrecision": "8",
|
|
521
|
+
// "transferMinQuantity": "0",
|
|
522
|
+
// "networkList": [
|
|
523
|
+
// {
|
|
524
|
+
// "addressRegex": "^0x[0-9a-fA-F]{40}$",
|
|
525
|
+
// "memoRegex": " ",
|
|
526
|
+
// "network": "ETH",
|
|
527
|
+
// "name": "Ethereum (ERC20)",
|
|
528
|
+
// "depositEnable": true,
|
|
529
|
+
// "minConfirm": "12",
|
|
530
|
+
// "unLockConfirm": "-1",
|
|
531
|
+
// "withdrawDesc": "",
|
|
532
|
+
// "withdrawEnable": true,
|
|
533
|
+
// "withdrawFee": "6",
|
|
534
|
+
// "withdrawIntegerMultiple": "0.000001",
|
|
535
|
+
// "withdrawMax": "500000",
|
|
536
|
+
// "withdrawMin": "10",
|
|
537
|
+
// "sameAddress": false
|
|
538
|
+
// },
|
|
539
|
+
// {
|
|
540
|
+
// "addressRegex": "^T[0-9a-zA-Z]{33}$",
|
|
541
|
+
// "memoRegex": "",
|
|
542
|
+
// "network": "TRX",
|
|
543
|
+
// "name": "TRON",
|
|
544
|
+
// "depositEnable": true,
|
|
545
|
+
// "minConfirm": "19",
|
|
546
|
+
// "unLockConfirm": "-1",
|
|
547
|
+
// "withdrawDesc": "",
|
|
548
|
+
// "withdrawEnable": true,
|
|
549
|
+
// "withdrawFee": "3",
|
|
550
|
+
// "withdrawIntegerMultiple": "0.000001",
|
|
551
|
+
// "withdrawMax": "1000000",
|
|
552
|
+
// "withdrawMin": "20",
|
|
553
|
+
// "sameAddress": false
|
|
554
|
+
// }
|
|
555
|
+
// ],
|
|
556
|
+
// "legalMoney": false
|
|
557
|
+
// }
|
|
558
|
+
// ]
|
|
559
|
+
//
|
|
560
|
+
const result = {};
|
|
561
|
+
for (let i = 0; i < response.length; i++) {
|
|
562
|
+
const entry = response[i];
|
|
563
|
+
const id = this.safeString(entry, 'coin');
|
|
564
|
+
const code = this.safeCurrencyCode(id);
|
|
565
|
+
const isFiat = this.safeBool(entry, 'isLegalMoney');
|
|
566
|
+
const networkList = this.safeList(entry, 'networkList', []);
|
|
567
|
+
const networks = {};
|
|
568
|
+
for (let j = 0; j < networkList.length; j++) {
|
|
569
|
+
const networkItem = networkList[j];
|
|
570
|
+
const network = this.safeString(networkItem, 'network');
|
|
571
|
+
const networkCode = this.networkIdToCode(network);
|
|
572
|
+
networks[networkCode] = {
|
|
573
|
+
'info': networkItem,
|
|
574
|
+
'id': network,
|
|
575
|
+
'network': networkCode,
|
|
576
|
+
'active': undefined,
|
|
577
|
+
'deposit': this.safeBool(networkItem, 'depositEnable'),
|
|
578
|
+
'withdraw': this.safeBool(networkItem, 'withdrawEnable'),
|
|
579
|
+
'fee': this.safeNumber(networkItem, 'withdrawFee'),
|
|
580
|
+
'precision': this.safeNumber(networkItem, 'withdrawIntegerMultiple'),
|
|
581
|
+
'limits': {
|
|
582
|
+
'withdraw': {
|
|
583
|
+
'min': this.safeNumber(networkItem, 'withdrawMin'),
|
|
584
|
+
'max': this.safeNumber(networkItem, 'withdrawMax'),
|
|
585
|
+
},
|
|
586
|
+
'deposit': {
|
|
587
|
+
'min': undefined,
|
|
588
|
+
'max': undefined,
|
|
589
|
+
},
|
|
590
|
+
},
|
|
591
|
+
};
|
|
592
|
+
}
|
|
593
|
+
result[code] = this.safeCurrencyStructure({
|
|
594
|
+
'id': id,
|
|
595
|
+
'name': this.safeString(entry, 'name'),
|
|
596
|
+
'code': code,
|
|
597
|
+
'type': isFiat ? 'fiat' : 'crypto',
|
|
598
|
+
'precision': this.parseNumber(this.parsePrecision(this.safeString(entry, 'transferPrecision'))),
|
|
599
|
+
'info': entry,
|
|
600
|
+
'active': undefined,
|
|
601
|
+
'deposit': this.safeBool(entry, 'depositAllEnable'),
|
|
602
|
+
'withdraw': this.safeBool(entry, 'withdrawAllEnable'),
|
|
603
|
+
'networks': networks,
|
|
604
|
+
'fee': undefined,
|
|
605
|
+
'fees': undefined,
|
|
606
|
+
'limits': {},
|
|
607
|
+
});
|
|
608
|
+
}
|
|
609
|
+
return result;
|
|
610
|
+
}
|
|
486
611
|
calculateRateLimiterCost(api, method, path, params, config = {}) {
|
|
487
612
|
if (('noSymbol' in config) && !('symbol' in params)) {
|
|
488
613
|
return config['noSymbol'];
|
|
@@ -51,7 +51,7 @@ class cryptocom extends cryptocom$1 {
|
|
|
51
51
|
'fetchClosedOrders': 'emulated',
|
|
52
52
|
'fetchCrossBorrowRate': false,
|
|
53
53
|
'fetchCrossBorrowRates': false,
|
|
54
|
-
'fetchCurrencies':
|
|
54
|
+
'fetchCurrencies': true,
|
|
55
55
|
'fetchDepositAddress': true,
|
|
56
56
|
'fetchDepositAddresses': false,
|
|
57
57
|
'fetchDepositAddressesByNetwork': true,
|
|
@@ -508,6 +508,116 @@ class cryptocom extends cryptocom$1 {
|
|
|
508
508
|
},
|
|
509
509
|
});
|
|
510
510
|
}
|
|
511
|
+
/**
|
|
512
|
+
* @method
|
|
513
|
+
* @name cryptocom#fetchCurrencies
|
|
514
|
+
* @description fetches all available currencies on an exchange
|
|
515
|
+
* @see https://exchange-docs.crypto.com/exchange/v1/rest-ws/index.html#private-get-currency-networks
|
|
516
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
517
|
+
* @returns {object} an associative dictionary of currencies
|
|
518
|
+
*/
|
|
519
|
+
async fetchCurrencies(params = {}) {
|
|
520
|
+
// this endpoint requires authentication
|
|
521
|
+
if (!this.checkRequiredCredentials(false)) {
|
|
522
|
+
return undefined;
|
|
523
|
+
}
|
|
524
|
+
const response = await this.v1PrivatePostPrivateGetCurrencyNetworks(params);
|
|
525
|
+
//
|
|
526
|
+
// {
|
|
527
|
+
// "id": "1747502328559",
|
|
528
|
+
// "method": "private/get-currency-networks",
|
|
529
|
+
// "code": "0",
|
|
530
|
+
// "result": {
|
|
531
|
+
// "update_time": "1747502281000",
|
|
532
|
+
// "currency_map": {
|
|
533
|
+
// "USDT": {
|
|
534
|
+
// "full_name": "Tether USD",
|
|
535
|
+
// "default_network": "ETH",
|
|
536
|
+
// "network_list": [
|
|
537
|
+
// {
|
|
538
|
+
// "network_id": "ETH",
|
|
539
|
+
// "withdrawal_fee": "10.00000000",
|
|
540
|
+
// "withdraw_enabled": true,
|
|
541
|
+
// "min_withdrawal_amount": "20.0",
|
|
542
|
+
// "deposit_enabled": true,
|
|
543
|
+
// "confirmation_required": "32"
|
|
544
|
+
// },
|
|
545
|
+
// {
|
|
546
|
+
// "network_id": "CRONOS",
|
|
547
|
+
// "withdrawal_fee": "0.18000000",
|
|
548
|
+
// "withdraw_enabled": true,
|
|
549
|
+
// "min_withdrawal_amount": "0.36",
|
|
550
|
+
// "deposit_enabled": true,
|
|
551
|
+
// "confirmation_required": "15"
|
|
552
|
+
// },
|
|
553
|
+
// {
|
|
554
|
+
// "network_id": "SOL",
|
|
555
|
+
// "withdrawal_fee": "5.31000000",
|
|
556
|
+
// "withdraw_enabled": true,
|
|
557
|
+
// "min_withdrawal_amount": "10.62",
|
|
558
|
+
// "deposit_enabled": true,
|
|
559
|
+
// "confirmation_required": "1"
|
|
560
|
+
// }
|
|
561
|
+
// ]
|
|
562
|
+
// }
|
|
563
|
+
// }
|
|
564
|
+
// }
|
|
565
|
+
// }
|
|
566
|
+
//
|
|
567
|
+
const resultData = this.safeDict(response, 'result', {});
|
|
568
|
+
const currencyMap = this.safeDict(resultData, 'currency_map', {});
|
|
569
|
+
const keys = Object.keys(currencyMap);
|
|
570
|
+
const result = {};
|
|
571
|
+
for (let i = 0; i < keys.length; i++) {
|
|
572
|
+
const key = keys[i];
|
|
573
|
+
const currency = currencyMap[key];
|
|
574
|
+
const id = key;
|
|
575
|
+
const code = this.safeCurrencyCode(id);
|
|
576
|
+
const networks = {};
|
|
577
|
+
const chains = this.safeList(currency, 'network_list', []);
|
|
578
|
+
for (let j = 0; j < chains.length; j++) {
|
|
579
|
+
const chain = chains[j];
|
|
580
|
+
const networkId = this.safeString(chain, 'network_id');
|
|
581
|
+
const network = this.networkIdToCode(networkId);
|
|
582
|
+
networks[network] = {
|
|
583
|
+
'info': chain,
|
|
584
|
+
'id': networkId,
|
|
585
|
+
'network': network,
|
|
586
|
+
'active': undefined,
|
|
587
|
+
'deposit': this.safeBool(chain, 'deposit_enabled', false),
|
|
588
|
+
'withdraw': this.safeBool(chain, 'withdraw_enabled', false),
|
|
589
|
+
'fee': this.safeNumber(chain, 'withdrawal_fee'),
|
|
590
|
+
'precision': undefined,
|
|
591
|
+
'limits': {
|
|
592
|
+
'withdraw': {
|
|
593
|
+
'min': this.safeNumber(chain, 'min_withdrawal_amount'),
|
|
594
|
+
'max': undefined,
|
|
595
|
+
},
|
|
596
|
+
},
|
|
597
|
+
};
|
|
598
|
+
}
|
|
599
|
+
result[code] = this.safeCurrencyStructure({
|
|
600
|
+
'info': currency,
|
|
601
|
+
'id': id,
|
|
602
|
+
'code': code,
|
|
603
|
+
'name': this.safeString(currency, 'full_name'),
|
|
604
|
+
'active': undefined,
|
|
605
|
+
'deposit': undefined,
|
|
606
|
+
'withdraw': undefined,
|
|
607
|
+
'fee': undefined,
|
|
608
|
+
'precision': undefined,
|
|
609
|
+
'limits': {
|
|
610
|
+
'amount': {
|
|
611
|
+
'min': undefined,
|
|
612
|
+
'max': undefined,
|
|
613
|
+
},
|
|
614
|
+
},
|
|
615
|
+
'type': 'crypto',
|
|
616
|
+
'networks': networks,
|
|
617
|
+
});
|
|
618
|
+
}
|
|
619
|
+
return result;
|
|
620
|
+
}
|
|
511
621
|
/**
|
|
512
622
|
* @method
|
|
513
623
|
* @name cryptocom#fetchMarkets
|
|
@@ -365,41 +365,9 @@ class cryptomus extends cryptomus$1 {
|
|
|
365
365
|
const coins = this.safeList(response, 'result');
|
|
366
366
|
const result = {};
|
|
367
367
|
for (let i = 0; i < coins.length; i++) {
|
|
368
|
-
const
|
|
369
|
-
const currencyId = this.safeString(
|
|
368
|
+
const networkEntry = coins[i];
|
|
369
|
+
const currencyId = this.safeString(networkEntry, 'currency_code');
|
|
370
370
|
const code = this.safeCurrencyCode(currencyId);
|
|
371
|
-
const allowWithdraw = this.safeBool(currency, 'can_withdraw');
|
|
372
|
-
const allowDeposit = this.safeBool(currency, 'can_deposit');
|
|
373
|
-
const isActive = allowWithdraw && allowDeposit;
|
|
374
|
-
const networkId = this.safeString(currency, 'network_code');
|
|
375
|
-
const networksById = this.safeDict(this.options, 'networksById');
|
|
376
|
-
const networkName = this.safeString(networksById, networkId, networkId);
|
|
377
|
-
const minWithdraw = this.safeNumber(currency, 'min_withdraw');
|
|
378
|
-
const maxWithdraw = this.safeNumber(currency, 'max_withdraw');
|
|
379
|
-
const minDeposit = this.safeNumber(currency, 'min_deposit');
|
|
380
|
-
const maxDeposit = this.safeNumber(currency, 'max_deposit');
|
|
381
|
-
const network = {
|
|
382
|
-
'id': networkId,
|
|
383
|
-
'network': networkName,
|
|
384
|
-
'limits': {
|
|
385
|
-
'withdraw': {
|
|
386
|
-
'min': minWithdraw,
|
|
387
|
-
'max': maxWithdraw,
|
|
388
|
-
},
|
|
389
|
-
'deposit': {
|
|
390
|
-
'min': minDeposit,
|
|
391
|
-
'max': maxDeposit,
|
|
392
|
-
},
|
|
393
|
-
},
|
|
394
|
-
'active': isActive,
|
|
395
|
-
'deposit': allowDeposit,
|
|
396
|
-
'withdraw': allowWithdraw,
|
|
397
|
-
'fee': undefined,
|
|
398
|
-
'precision': undefined,
|
|
399
|
-
'info': currency,
|
|
400
|
-
};
|
|
401
|
-
const networks = {};
|
|
402
|
-
networks[networkName] = network;
|
|
403
371
|
if (!(code in result)) {
|
|
404
372
|
result[code] = {
|
|
405
373
|
'id': currencyId,
|
|
@@ -407,70 +375,56 @@ class cryptomus extends cryptomus$1 {
|
|
|
407
375
|
'precision': undefined,
|
|
408
376
|
'type': undefined,
|
|
409
377
|
'name': undefined,
|
|
410
|
-
'active':
|
|
411
|
-
'deposit':
|
|
412
|
-
'withdraw':
|
|
378
|
+
'active': undefined,
|
|
379
|
+
'deposit': undefined,
|
|
380
|
+
'withdraw': undefined,
|
|
413
381
|
'fee': undefined,
|
|
414
382
|
'limits': {
|
|
415
383
|
'withdraw': {
|
|
416
|
-
'min':
|
|
417
|
-
'max':
|
|
384
|
+
'min': undefined,
|
|
385
|
+
'max': undefined,
|
|
418
386
|
},
|
|
419
387
|
'deposit': {
|
|
420
|
-
'min':
|
|
421
|
-
'max':
|
|
388
|
+
'min': undefined,
|
|
389
|
+
'max': undefined,
|
|
422
390
|
},
|
|
423
391
|
},
|
|
424
|
-
'networks':
|
|
425
|
-
'info':
|
|
392
|
+
'networks': {},
|
|
393
|
+
'info': {},
|
|
426
394
|
};
|
|
427
395
|
}
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
withdrawLimits['max'] = parsedWithdrawLimits['max'] ? Math.max(parsedWithdrawLimits['max'], maxWithdraw) : maxWithdraw;
|
|
461
|
-
}
|
|
462
|
-
if (minDeposit) {
|
|
463
|
-
depositLimits['min'] = parsedDepositLimits['min'] ? Math.min(parsedDepositLimits['min'], minDeposit) : minDeposit;
|
|
464
|
-
}
|
|
465
|
-
if (maxDeposit) {
|
|
466
|
-
depositLimits['max'] = parsedDepositLimits['max'] ? Math.max(parsedDepositLimits['max'], maxDeposit) : maxDeposit;
|
|
467
|
-
}
|
|
468
|
-
const limits = {
|
|
469
|
-
'withdraw': withdrawLimits,
|
|
470
|
-
'deposit': depositLimits,
|
|
471
|
-
};
|
|
472
|
-
parsed['limits'] = limits;
|
|
473
|
-
}
|
|
396
|
+
const networkId = this.safeString(networkEntry, 'network_code');
|
|
397
|
+
const networkCode = this.networkIdToCode(networkId);
|
|
398
|
+
result[code]['networks'][networkCode] = {
|
|
399
|
+
'id': networkId,
|
|
400
|
+
'network': networkCode,
|
|
401
|
+
'limits': {
|
|
402
|
+
'withdraw': {
|
|
403
|
+
'min': this.safeNumber(networkEntry, 'min_withdraw'),
|
|
404
|
+
'max': this.safeNumber(networkEntry, 'max_withdraw'),
|
|
405
|
+
},
|
|
406
|
+
'deposit': {
|
|
407
|
+
'min': this.safeNumber(networkEntry, 'min_deposit'),
|
|
408
|
+
'max': this.safeNumber(networkEntry, 'max_deposit'),
|
|
409
|
+
},
|
|
410
|
+
},
|
|
411
|
+
'active': undefined,
|
|
412
|
+
'deposit': this.safeBool(networkEntry, 'can_withdraw'),
|
|
413
|
+
'withdraw': this.safeBool(networkEntry, 'can_deposit'),
|
|
414
|
+
'fee': undefined,
|
|
415
|
+
'precision': undefined,
|
|
416
|
+
'info': networkEntry,
|
|
417
|
+
};
|
|
418
|
+
// add entry in info
|
|
419
|
+
const info = this.safeList(result[code], 'info', []);
|
|
420
|
+
info.push(networkEntry);
|
|
421
|
+
result[code]['info'] = info;
|
|
422
|
+
}
|
|
423
|
+
// only after all entries are formed in currencies, restructure each entry
|
|
424
|
+
const allKeys = Object.keys(result);
|
|
425
|
+
for (let i = 0; i < allKeys.length; i++) {
|
|
426
|
+
const code = allKeys[i];
|
|
427
|
+
result[code] = this.safeCurrencyStructure(result[code]); // this is needed after adding network entry
|
|
474
428
|
}
|
|
475
429
|
return result;
|
|
476
430
|
}
|