ccxt 4.4.85 → 4.4.87
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -7
- package/dist/ccxt.browser.min.js +3 -3
- package/dist/cjs/ccxt.js +16 -9
- package/dist/cjs/src/abstract/bittrade.js +9 -0
- package/dist/cjs/src/abstract/modetrade.js +9 -0
- package/dist/cjs/src/ascendex.js +189 -155
- package/dist/cjs/src/base/Exchange.js +10 -8
- package/dist/cjs/src/bequant.js +1 -1
- package/dist/cjs/src/binance.js +1 -1
- package/dist/cjs/src/bitget.js +5 -4
- package/dist/cjs/src/bitmart.js +1 -1
- package/dist/cjs/src/bitteam.js +31 -0
- package/dist/cjs/src/bittrade.js +2049 -0
- package/dist/cjs/src/coinbase.js +2 -6
- package/dist/cjs/src/coinmetro.js +5 -1
- package/dist/cjs/src/deribit.js +4 -5
- package/dist/cjs/src/derive.js +4 -5
- package/dist/cjs/src/ellipx.js +2 -3
- package/dist/cjs/src/gate.js +92 -76
- package/dist/cjs/src/hollaex.js +107 -49
- package/dist/cjs/src/htx.js +30 -52
- package/dist/cjs/src/hyperliquid.js +36 -20
- package/dist/cjs/src/kraken.js +5 -8
- package/dist/cjs/src/mexc.js +2 -2
- package/dist/cjs/src/modetrade.js +2839 -0
- package/dist/cjs/src/ndax.js +25 -24
- package/dist/cjs/src/okcoin.js +12 -31
- package/dist/cjs/src/okx.js +104 -2
- package/dist/cjs/src/okxus.js +53 -0
- package/dist/cjs/src/onetrading.js +9 -6
- package/dist/cjs/src/oxfun.js +42 -114
- package/dist/cjs/src/paradex.js +10 -1
- package/dist/cjs/src/phemex.js +4 -6
- package/dist/cjs/src/poloniex.js +181 -170
- package/dist/cjs/src/pro/binance.js +1 -0
- package/dist/cjs/src/pro/bittrade.js +605 -0
- package/dist/cjs/src/pro/luno.js +6 -5
- package/dist/cjs/src/pro/mexc.js +3 -0
- package/dist/cjs/src/pro/modetrade.js +1334 -0
- package/dist/cjs/src/pro/okxus.js +38 -0
- package/dist/cjs/src/probit.js +18 -51
- package/dist/cjs/src/timex.js +5 -10
- package/dist/cjs/src/vertex.js +3 -4
- package/dist/cjs/src/whitebit.js +41 -11
- package/dist/cjs/src/woo.js +101 -77
- package/dist/cjs/src/woofipro.js +24 -21
- package/dist/cjs/src/xt.js +36 -44
- package/js/ccxt.d.ts +20 -11
- package/js/ccxt.js +14 -8
- package/js/src/abstract/modetrade.d.ts +122 -0
- package/js/src/abstract/myokx.d.ts +2 -0
- package/js/src/abstract/okx.d.ts +2 -0
- package/js/src/abstract/okxus.d.ts +352 -0
- package/js/src/abstract/okxus.js +11 -0
- package/js/src/ascendex.d.ts +2 -0
- package/js/src/ascendex.js +189 -155
- package/js/src/base/Exchange.js +10 -8
- package/js/src/bequant.js +1 -1
- package/js/src/binance.js +1 -1
- package/js/src/bitget.js +5 -4
- package/js/src/bitmart.js +1 -1
- package/js/src/bitteam.js +31 -0
- package/js/src/{huobijp.d.ts → bittrade.d.ts} +29 -29
- package/js/src/{huobijp.js → bittrade.js} +35 -35
- package/js/src/coinbase.js +2 -6
- package/js/src/coinmetro.js +5 -1
- package/js/src/deribit.js +4 -5
- package/js/src/derive.js +4 -3
- package/js/src/ellipx.d.ts +1 -1
- package/js/src/ellipx.js +3 -5
- package/js/src/gate.js +92 -76
- package/js/src/hollaex.js +107 -49
- package/js/src/htx.js +30 -52
- package/js/src/hyperliquid.js +36 -20
- package/js/src/kraken.js +5 -8
- package/js/src/mexc.js +2 -2
- package/js/src/modetrade.d.ts +475 -0
- package/js/src/modetrade.js +2840 -0
- package/js/src/ndax.js +25 -24
- package/js/src/okcoin.js +12 -31
- package/js/src/okx.d.ts +24 -1
- package/js/src/okx.js +104 -2
- package/js/src/okxus.d.ts +4 -0
- package/js/src/okxus.js +54 -0
- package/js/src/onetrading.js +9 -6
- package/js/src/oxfun.js +42 -114
- package/js/src/paradex.js +10 -1
- package/js/src/phemex.js +4 -6
- package/js/src/poloniex.d.ts +2 -0
- package/js/src/poloniex.js +181 -170
- package/js/src/pro/binance.js +1 -0
- package/js/src/pro/{huobijp.d.ts → bittrade.d.ts} +6 -6
- package/js/src/pro/{huobijp.js → bittrade.js} +7 -7
- package/js/src/pro/luno.js +6 -5
- package/js/src/pro/mexc.js +3 -0
- package/js/src/pro/modetrade.d.ts +155 -0
- package/js/src/pro/modetrade.js +1335 -0
- package/js/src/pro/okxus.d.ts +4 -0
- package/js/src/pro/okxus.js +39 -0
- package/js/src/probit.js +18 -51
- package/js/src/timex.js +5 -10
- package/js/src/vertex.js +3 -4
- package/js/src/whitebit.js +42 -11
- package/js/src/woo.d.ts +2 -0
- package/js/src/woo.js +101 -77
- package/js/src/woofipro.d.ts +2 -1
- package/js/src/woofipro.js +24 -21
- package/js/src/xt.js +36 -44
- package/package.json +1 -1
- package/js/src/abstract/kuna.d.ts +0 -185
- package/js/src/kuna.d.ts +0 -335
- package/js/src/kuna.js +0 -2006
- /package/js/src/abstract/{huobijp.d.ts → bittrade.d.ts} +0 -0
- /package/js/src/abstract/{huobijp.js → bittrade.js} +0 -0
- /package/js/src/abstract/{kuna.js → modetrade.js} +0 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var okx = require('./okx.js');
|
|
4
|
+
|
|
5
|
+
// ----------------------------------------------------------------------------
|
|
6
|
+
// ---------------------------------------------------------------------------
|
|
7
|
+
class okxus extends okx {
|
|
8
|
+
describe() {
|
|
9
|
+
return this.deepExtend(super.describe(), {
|
|
10
|
+
'id': 'okxus',
|
|
11
|
+
'name': 'OKX (US)',
|
|
12
|
+
'hostname': 'us.okx.com',
|
|
13
|
+
'urls': {
|
|
14
|
+
'api': {
|
|
15
|
+
'rest': 'https://{hostname}',
|
|
16
|
+
'ws': 'wss://wsus.okx.com:8443/ws/v5',
|
|
17
|
+
},
|
|
18
|
+
'www': 'https://app.okx.com',
|
|
19
|
+
'doc': 'https://app.okx.com/docs-v5/en/#overview',
|
|
20
|
+
'fees': 'https://app.okx.com/pages/products/fees.html',
|
|
21
|
+
'referral': {
|
|
22
|
+
'url': 'https://www.app.okx.com/join/CCXT2023',
|
|
23
|
+
'discount': 0.2,
|
|
24
|
+
},
|
|
25
|
+
'test': {
|
|
26
|
+
'ws': 'wss://wsuspap.okx.com:8443/ws/v5',
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
'has': {
|
|
30
|
+
'swap': false,
|
|
31
|
+
'future': false,
|
|
32
|
+
'option': false,
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
module.exports = okxus;
|
package/dist/cjs/src/probit.js
CHANGED
|
@@ -467,33 +467,23 @@ class probit extends probit$1 {
|
|
|
467
467
|
// ]
|
|
468
468
|
// }
|
|
469
469
|
//
|
|
470
|
-
const currencies = this.
|
|
470
|
+
const currencies = this.safeList(response, 'data', []);
|
|
471
471
|
const result = {};
|
|
472
472
|
for (let i = 0; i < currencies.length; i++) {
|
|
473
473
|
const currency = currencies[i];
|
|
474
474
|
const id = this.safeString(currency, 'id');
|
|
475
475
|
const code = this.safeCurrencyCode(id);
|
|
476
|
-
const displayName = this.
|
|
476
|
+
const displayName = this.safeDict(currency, 'display_name');
|
|
477
477
|
const name = this.safeString(displayName, 'en-us');
|
|
478
|
-
const platforms = this.
|
|
478
|
+
const platforms = this.safeList(currency, 'platform', []);
|
|
479
479
|
const platformsByPriority = this.sortBy(platforms, 'priority');
|
|
480
|
-
let platform = undefined;
|
|
481
480
|
const networkList = {};
|
|
482
481
|
for (let j = 0; j < platformsByPriority.length; j++) {
|
|
483
482
|
const network = platformsByPriority[j];
|
|
484
483
|
const idInner = this.safeString(network, 'id');
|
|
485
484
|
const networkCode = this.networkIdToCode(idInner);
|
|
486
|
-
const
|
|
487
|
-
|
|
488
|
-
const currentDeposit = !currentDepositSuspended;
|
|
489
|
-
const currentWithdraw = !currentWithdrawalSuspended;
|
|
490
|
-
const currentActive = currentDeposit && currentWithdraw;
|
|
491
|
-
if (currentActive) {
|
|
492
|
-
platform = network;
|
|
493
|
-
}
|
|
494
|
-
const precision = this.parsePrecision(this.safeString(network, 'precision'));
|
|
495
|
-
const withdrawFee = this.safeValue(network, 'withdrawal_fee', []);
|
|
496
|
-
let networkFee = this.safeValue(withdrawFee, 0, {});
|
|
485
|
+
const withdrawFee = this.safeList(network, 'withdrawal_fee', []);
|
|
486
|
+
let networkFee = this.safeDict(withdrawFee, 0, {});
|
|
497
487
|
for (let k = 0; k < withdrawFee.length; k++) {
|
|
498
488
|
const withdrawPlatform = withdrawFee[k];
|
|
499
489
|
const feeCurrencyId = this.safeString(withdrawPlatform, 'currency_id');
|
|
@@ -505,11 +495,11 @@ class probit extends probit$1 {
|
|
|
505
495
|
networkList[networkCode] = {
|
|
506
496
|
'id': idInner,
|
|
507
497
|
'network': networkCode,
|
|
508
|
-
'active':
|
|
509
|
-
'deposit':
|
|
510
|
-
'withdraw':
|
|
498
|
+
'active': undefined,
|
|
499
|
+
'deposit': !this.safeBool(network, 'deposit_suspended'),
|
|
500
|
+
'withdraw': !this.safeBool(network, 'withdrawal_suspended'),
|
|
511
501
|
'fee': this.safeNumber(networkFee, 'amount'),
|
|
512
|
-
'precision': this.parseNumber(precision),
|
|
502
|
+
'precision': this.parseNumber(this.parsePrecision(this.safeString(network, 'precision'))),
|
|
513
503
|
'limits': {
|
|
514
504
|
'withdraw': {
|
|
515
505
|
'min': this.safeNumber(network, 'min_withdrawal_amount'),
|
|
@@ -523,56 +513,33 @@ class probit extends probit$1 {
|
|
|
523
513
|
'info': network,
|
|
524
514
|
};
|
|
525
515
|
}
|
|
526
|
-
|
|
527
|
-
platform = this.safeValue(platformsByPriority, 0, {});
|
|
528
|
-
}
|
|
529
|
-
const depositSuspended = this.safeValue(platform, 'deposit_suspended');
|
|
530
|
-
const withdrawalSuspended = this.safeValue(platform, 'withdrawal_suspended');
|
|
531
|
-
const deposit = !depositSuspended;
|
|
532
|
-
const withdraw = !withdrawalSuspended;
|
|
533
|
-
const active = deposit && withdraw;
|
|
534
|
-
const withdrawalFees = this.safeValue(platform, 'withdrawal_fee', {});
|
|
535
|
-
const fees = [];
|
|
536
|
-
// sometimes the withdrawal fee is an empty object
|
|
537
|
-
// [ { 'amount': '0.015', 'priority': 1, 'currency_id': 'ETH' }, {} ]
|
|
538
|
-
for (let j = 0; j < withdrawalFees.length; j++) {
|
|
539
|
-
const withdrawalFeeInner = withdrawalFees[j];
|
|
540
|
-
const amount = this.safeNumber(withdrawalFeeInner, 'amount');
|
|
541
|
-
const priority = this.safeInteger(withdrawalFeeInner, 'priority');
|
|
542
|
-
if ((amount !== undefined) && (priority !== undefined)) {
|
|
543
|
-
fees.push(withdrawalFeeInner);
|
|
544
|
-
}
|
|
545
|
-
}
|
|
546
|
-
const withdrawalFeesByPriority = this.sortBy(fees, 'priority');
|
|
547
|
-
const withdrawalFee = this.safeValue(withdrawalFeesByPriority, 0, {});
|
|
548
|
-
const fee = this.safeNumber(withdrawalFee, 'amount');
|
|
549
|
-
result[code] = {
|
|
516
|
+
result[code] = this.safeCurrencyStructure({
|
|
550
517
|
'id': id,
|
|
551
518
|
'code': code,
|
|
552
519
|
'info': currency,
|
|
553
520
|
'name': name,
|
|
554
|
-
'active':
|
|
555
|
-
'deposit':
|
|
556
|
-
'withdraw':
|
|
521
|
+
'active': undefined,
|
|
522
|
+
'deposit': undefined,
|
|
523
|
+
'withdraw': undefined,
|
|
557
524
|
'type': 'crypto',
|
|
558
|
-
'fee':
|
|
559
|
-
'precision':
|
|
525
|
+
'fee': undefined,
|
|
526
|
+
'precision': undefined,
|
|
560
527
|
'limits': {
|
|
561
528
|
'amount': {
|
|
562
529
|
'min': undefined,
|
|
563
530
|
'max': undefined,
|
|
564
531
|
},
|
|
565
532
|
'deposit': {
|
|
566
|
-
'min':
|
|
533
|
+
'min': undefined,
|
|
567
534
|
'max': undefined,
|
|
568
535
|
},
|
|
569
536
|
'withdraw': {
|
|
570
|
-
'min':
|
|
537
|
+
'min': undefined,
|
|
571
538
|
'max': undefined,
|
|
572
539
|
},
|
|
573
540
|
},
|
|
574
541
|
'networks': networkList,
|
|
575
|
-
};
|
|
542
|
+
});
|
|
576
543
|
}
|
|
577
544
|
return result;
|
|
578
545
|
}
|
package/dist/cjs/src/timex.js
CHANGED
|
@@ -1415,11 +1415,6 @@ class timex extends timex$1 {
|
|
|
1415
1415
|
//
|
|
1416
1416
|
const id = this.safeString(currency, 'symbol');
|
|
1417
1417
|
const code = this.safeCurrencyCode(id);
|
|
1418
|
-
const name = this.safeString(currency, 'name');
|
|
1419
|
-
const depositEnabled = this.safeValue(currency, 'depositEnabled');
|
|
1420
|
-
const withdrawEnabled = this.safeValue(currency, 'withdrawalEnabled');
|
|
1421
|
-
const isActive = this.safeValue(currency, 'active');
|
|
1422
|
-
const active = depositEnabled && withdrawEnabled && isActive;
|
|
1423
1418
|
// const fee = this.safeNumber (currency, 'withdrawalFee');
|
|
1424
1419
|
const feeString = this.safeString(currency, 'withdrawalFee');
|
|
1425
1420
|
const tradeDecimals = this.safeInteger(currency, 'tradeDecimals');
|
|
@@ -1445,14 +1440,14 @@ class timex extends timex$1 {
|
|
|
1445
1440
|
'code': code,
|
|
1446
1441
|
'info': currency,
|
|
1447
1442
|
'type': undefined,
|
|
1448
|
-
'name': name,
|
|
1449
|
-
'active': active,
|
|
1450
|
-
'deposit': depositEnabled,
|
|
1451
|
-
'withdraw':
|
|
1443
|
+
'name': this.safeString(currency, 'name'),
|
|
1444
|
+
'active': this.safeBool(currency, 'active'),
|
|
1445
|
+
'deposit': this.safeBool(currency, 'depositEnabled'),
|
|
1446
|
+
'withdraw': this.safeBool(currency, 'withdrawalEnabled'),
|
|
1452
1447
|
'fee': fee,
|
|
1453
1448
|
'precision': this.parseNumber(this.parsePrecision(this.safeString(currency, 'decimals'))),
|
|
1454
1449
|
'limits': {
|
|
1455
|
-
'withdraw': { 'min':
|
|
1450
|
+
'withdraw': { 'min': undefined, 'max': undefined },
|
|
1456
1451
|
'amount': { 'min': undefined, 'max': undefined },
|
|
1457
1452
|
},
|
|
1458
1453
|
'networks': {},
|
package/dist/cjs/src/vertex.js
CHANGED
|
@@ -451,11 +451,10 @@ class vertex extends vertex$1 {
|
|
|
451
451
|
if ((tickerId !== undefined) && (tickerId.indexOf('PERP') > 0)) {
|
|
452
452
|
continue;
|
|
453
453
|
}
|
|
454
|
-
const id = this.safeString(data, 'product_id');
|
|
455
454
|
const name = this.safeString(data, 'symbol');
|
|
456
455
|
const code = this.safeCurrencyCode(name);
|
|
457
|
-
result[code] = {
|
|
458
|
-
'id':
|
|
456
|
+
result[code] = this.safeCurrencyStructure({
|
|
457
|
+
'id': this.safeString(data, 'product_id'),
|
|
459
458
|
'name': name,
|
|
460
459
|
'code': code,
|
|
461
460
|
'precision': undefined,
|
|
@@ -475,7 +474,7 @@ class vertex extends vertex$1 {
|
|
|
475
474
|
'max': undefined,
|
|
476
475
|
},
|
|
477
476
|
},
|
|
478
|
-
};
|
|
477
|
+
});
|
|
479
478
|
}
|
|
480
479
|
return result;
|
|
481
480
|
}
|
package/dist/cjs/src/whitebit.js
CHANGED
|
@@ -613,25 +613,51 @@ class whitebit extends whitebit$1 {
|
|
|
613
613
|
for (let i = 0; i < ids.length; i++) {
|
|
614
614
|
const id = ids[i];
|
|
615
615
|
const currency = response[id];
|
|
616
|
-
// breaks down in Python due to utf8 encoding issues on the exchange side
|
|
617
|
-
// const name = this.safeString (currency, 'name');
|
|
618
|
-
const canDeposit = this.safeBool(currency, 'can_deposit', true);
|
|
619
|
-
const canWithdraw = this.safeBool(currency, 'can_withdraw', true);
|
|
620
|
-
const active = canDeposit && canWithdraw;
|
|
616
|
+
// const name = this.safeString (currency, 'name'); // breaks down in Python due to utf8 encoding issues on the exchange side
|
|
621
617
|
const code = this.safeCurrencyCode(id);
|
|
622
618
|
const hasProvider = ('providers' in currency);
|
|
623
|
-
|
|
619
|
+
const rawNetworks = this.safeDict(currency, 'networks', {});
|
|
620
|
+
const depositsNetworks = this.safeList(rawNetworks, 'deposits', []);
|
|
621
|
+
const withdrawsNetworks = this.safeList(rawNetworks, 'withdraws', []);
|
|
622
|
+
const networkLimits = this.safeDict(currency, 'limits', {});
|
|
623
|
+
const depositLimits = this.safeDict(networkLimits, 'deposit', {});
|
|
624
|
+
const withdrawLimits = this.safeDict(networkLimits, 'withdraw', {});
|
|
625
|
+
const allNetworks = this.arrayConcat(depositsNetworks, withdrawsNetworks);
|
|
626
|
+
for (let j = 0; j < allNetworks.length; j++) {
|
|
627
|
+
const networkId = allNetworks[j];
|
|
628
|
+
const networkCode = this.networkIdToCode(networkId);
|
|
629
|
+
({
|
|
630
|
+
'id': networkId,
|
|
631
|
+
'network': networkCode,
|
|
632
|
+
'active': undefined,
|
|
633
|
+
'deposit': this.inArray(networkId, depositsNetworks),
|
|
634
|
+
'withdraw': this.inArray(networkId, withdrawsNetworks),
|
|
635
|
+
'fee': undefined,
|
|
636
|
+
'precision': undefined,
|
|
637
|
+
'limits': {
|
|
638
|
+
'deposit': {
|
|
639
|
+
'min': this.safeNumber(depositLimits, 'min', undefined),
|
|
640
|
+
'max': this.safeNumber(depositLimits, 'max', undefined),
|
|
641
|
+
},
|
|
642
|
+
'withdraw': {
|
|
643
|
+
'min': this.safeNumber(withdrawLimits, 'min', undefined),
|
|
644
|
+
'max': this.safeNumber(withdrawLimits, 'max', undefined),
|
|
645
|
+
},
|
|
646
|
+
},
|
|
647
|
+
});
|
|
648
|
+
}
|
|
649
|
+
result[code] = this.safeCurrencyStructure({
|
|
624
650
|
'id': id,
|
|
625
651
|
'code': code,
|
|
626
652
|
'info': currency,
|
|
627
653
|
'name': undefined,
|
|
628
|
-
'active':
|
|
629
|
-
'deposit':
|
|
630
|
-
'withdraw':
|
|
654
|
+
'active': undefined,
|
|
655
|
+
'deposit': this.safeBool(currency, 'can_deposit'),
|
|
656
|
+
'withdraw': this.safeBool(currency, 'can_withdraw'),
|
|
631
657
|
'fee': undefined,
|
|
632
658
|
'networks': undefined,
|
|
633
659
|
'type': hasProvider ? 'fiat' : 'crypto',
|
|
634
|
-
'precision':
|
|
660
|
+
'precision': this.parseNumber(this.parsePrecision(this.safeString(currency, 'currency_precision'))),
|
|
635
661
|
'limits': {
|
|
636
662
|
'amount': {
|
|
637
663
|
'min': undefined,
|
|
@@ -641,8 +667,12 @@ class whitebit extends whitebit$1 {
|
|
|
641
667
|
'min': this.safeNumber(currency, 'min_withdraw'),
|
|
642
668
|
'max': this.safeNumber(currency, 'max_withdraw'),
|
|
643
669
|
},
|
|
670
|
+
'deposit': {
|
|
671
|
+
'min': this.safeNumber(currency, 'min_deposit'),
|
|
672
|
+
'max': this.safeNumber(currency, 'max_deposit'),
|
|
673
|
+
},
|
|
644
674
|
},
|
|
645
|
-
};
|
|
675
|
+
});
|
|
646
676
|
}
|
|
647
677
|
return result;
|
|
648
678
|
}
|
package/dist/cjs/src/woo.js
CHANGED
|
@@ -301,6 +301,11 @@ class woo extends woo$1 {
|
|
|
301
301
|
'TRC20': 'TRON',
|
|
302
302
|
'ERC20': 'ETH',
|
|
303
303
|
'BEP20': 'BSC',
|
|
304
|
+
'ARB': 'Arbitrum',
|
|
305
|
+
},
|
|
306
|
+
'networksById': {
|
|
307
|
+
'TRX': 'TRC20',
|
|
308
|
+
'TRON': 'TRC20',
|
|
304
309
|
},
|
|
305
310
|
// override defaultNetworkCodePriorities for a specific currency
|
|
306
311
|
'defaultNetworkCodeForCurrencies': {
|
|
@@ -819,33 +824,45 @@ class woo extends woo$1 {
|
|
|
819
824
|
*/
|
|
820
825
|
async fetchCurrencies(params = {}) {
|
|
821
826
|
const result = {};
|
|
822
|
-
const
|
|
827
|
+
const tokenResponsePromise = this.v1PublicGetToken(params);
|
|
823
828
|
//
|
|
824
|
-
//
|
|
825
|
-
//
|
|
829
|
+
// {
|
|
830
|
+
// "rows": [
|
|
826
831
|
// {
|
|
827
832
|
// "token": "ETH_USDT",
|
|
828
833
|
// "fullname": "Tether",
|
|
829
|
-
// "
|
|
834
|
+
// "network": "ETH",
|
|
835
|
+
// "decimals": "6",
|
|
836
|
+
// "delisted": false,
|
|
830
837
|
// "balance_token": "USDT",
|
|
831
|
-
// "created_time": "
|
|
832
|
-
// "updated_time": "
|
|
838
|
+
// "created_time": "1710123398",
|
|
839
|
+
// "updated_time": "1746528481",
|
|
840
|
+
// "can_collateral": true,
|
|
841
|
+
// "can_short": true
|
|
833
842
|
// },
|
|
834
843
|
// {
|
|
835
844
|
// "token": "BSC_USDT",
|
|
836
845
|
// "fullname": "Tether",
|
|
837
|
-
// "
|
|
846
|
+
// "network": "BSC",
|
|
847
|
+
// "decimals": "18",
|
|
848
|
+
// "delisted": false,
|
|
838
849
|
// "balance_token": "USDT",
|
|
839
|
-
// "created_time": "
|
|
840
|
-
// "updated_time": "
|
|
850
|
+
// "created_time": "1710123395",
|
|
851
|
+
// "updated_time": "1746528601",
|
|
852
|
+
// "can_collateral": true,
|
|
853
|
+
// "can_short": true
|
|
841
854
|
// },
|
|
842
855
|
// {
|
|
843
|
-
// "token": "
|
|
844
|
-
// "fullname": "
|
|
845
|
-
// "
|
|
846
|
-
// "
|
|
847
|
-
// "
|
|
848
|
-
// "
|
|
856
|
+
// "token": "ALGO",
|
|
857
|
+
// "fullname": "Algorand",
|
|
858
|
+
// "network": "ALGO",
|
|
859
|
+
// "decimals": "6",
|
|
860
|
+
// "delisted": false,
|
|
861
|
+
// "balance_token": "ALGO",
|
|
862
|
+
// "created_time": "1710123394",
|
|
863
|
+
// "updated_time": "1723087518",
|
|
864
|
+
// "can_collateral": true,
|
|
865
|
+
// "can_short": true
|
|
849
866
|
// },
|
|
850
867
|
// ...
|
|
851
868
|
// ],
|
|
@@ -853,59 +870,66 @@ class woo extends woo$1 {
|
|
|
853
870
|
// }
|
|
854
871
|
//
|
|
855
872
|
// only make one request for currrencies...
|
|
856
|
-
|
|
873
|
+
const tokenNetworkResponsePromise = this.v1PublicGetTokenNetwork(params);
|
|
857
874
|
//
|
|
858
875
|
// {
|
|
859
876
|
// "rows": [
|
|
860
877
|
// {
|
|
861
878
|
// "protocol": "ERC20",
|
|
879
|
+
// "network": "ETH",
|
|
862
880
|
// "token": "USDT",
|
|
863
|
-
// "name": "Ethereum",
|
|
864
|
-
// "minimum_withdrawal":
|
|
865
|
-
// "withdrawal_fee":
|
|
866
|
-
// "allow_deposit": 1,
|
|
867
|
-
// "allow_withdraw": 1
|
|
881
|
+
// "name": "Ethereum (ERC20)",
|
|
882
|
+
// "minimum_withdrawal": "10.00000000",
|
|
883
|
+
// "withdrawal_fee": "2.00000000",
|
|
884
|
+
// "allow_deposit": "1",
|
|
885
|
+
// "allow_withdraw": "1"
|
|
868
886
|
// },
|
|
869
887
|
// {
|
|
870
888
|
// "protocol": "TRC20",
|
|
889
|
+
// "network": "TRX",
|
|
871
890
|
// "token": "USDT",
|
|
872
|
-
// "name": "Tron",
|
|
873
|
-
// "minimum_withdrawal":
|
|
874
|
-
// "withdrawal_fee":
|
|
875
|
-
// "allow_deposit": 1,
|
|
876
|
-
// "allow_withdraw": 1
|
|
891
|
+
// "name": "Tron (TRC20)",
|
|
892
|
+
// "minimum_withdrawal": "10.00000000",
|
|
893
|
+
// "withdrawal_fee": "4.50000000",
|
|
894
|
+
// "allow_deposit": "1",
|
|
895
|
+
// "allow_withdraw": "1"
|
|
877
896
|
// },
|
|
878
897
|
// ...
|
|
879
898
|
// ],
|
|
880
899
|
// "success": true
|
|
881
900
|
// }
|
|
882
901
|
//
|
|
902
|
+
const [tokenResponse, tokenNetworkResponse] = await Promise.all([tokenResponsePromise, tokenNetworkResponsePromise]);
|
|
883
903
|
const tokenRows = this.safeList(tokenResponse, 'rows', []);
|
|
884
|
-
const
|
|
885
|
-
const
|
|
904
|
+
const tokenNetworkRows = this.safeList(tokenNetworkResponse, 'rows', []);
|
|
905
|
+
const networksById = this.groupBy(tokenNetworkRows, 'token');
|
|
906
|
+
const tokensById = this.groupBy(tokenRows, 'balance_token');
|
|
907
|
+
const currencyIds = Object.keys(tokensById);
|
|
886
908
|
for (let i = 0; i < currencyIds.length; i++) {
|
|
887
909
|
const currencyId = currencyIds[i];
|
|
888
|
-
const networks = networksByCurrencyId[currencyId];
|
|
889
910
|
const code = this.safeCurrencyCode(currencyId);
|
|
890
|
-
|
|
891
|
-
|
|
911
|
+
const tokensByNetworkId = this.indexBy(tokensById[currencyId], 'network');
|
|
912
|
+
const chainsByNetworkId = this.indexBy(networksById[currencyId], 'network');
|
|
913
|
+
const keys = Object.keys(chainsByNetworkId);
|
|
892
914
|
const resultingNetworks = {};
|
|
893
|
-
for (let j = 0; j <
|
|
894
|
-
const
|
|
895
|
-
|
|
896
|
-
const
|
|
897
|
-
const
|
|
898
|
-
const
|
|
899
|
-
|
|
900
|
-
if (precision !== undefined) {
|
|
901
|
-
minPrecision = (minPrecision === undefined) ? precision : Precise["default"].stringMin(precision, minPrecision);
|
|
902
|
-
}
|
|
903
|
-
resultingNetworks[unifiedNetwork] = {
|
|
915
|
+
for (let j = 0; j < keys.length; j++) {
|
|
916
|
+
const networkId = keys[j];
|
|
917
|
+
const tokenEntry = this.safeDict(tokensByNetworkId, networkId, {});
|
|
918
|
+
const networkEntry = this.safeDict(chainsByNetworkId, networkId, {});
|
|
919
|
+
const networkCode = this.networkIdToCode(networkId, code);
|
|
920
|
+
const specialNetworkId = this.safeString(tokenEntry, 'token');
|
|
921
|
+
resultingNetworks[networkCode] = {
|
|
904
922
|
'id': networkId,
|
|
905
|
-
'
|
|
923
|
+
'currencyNetworkId': specialNetworkId,
|
|
924
|
+
'network': networkCode,
|
|
925
|
+
'active': undefined,
|
|
926
|
+
'deposit': this.safeString(networkEntry, 'allow_deposit') === '1',
|
|
927
|
+
'withdraw': this.safeString(networkEntry, 'allow_withdraw') === '1',
|
|
928
|
+
'fee': this.safeNumber(networkEntry, 'withdrawal_fee'),
|
|
929
|
+
'precision': this.parseNumber(this.parsePrecision(this.safeString(tokenEntry, 'decimals'))),
|
|
906
930
|
'limits': {
|
|
907
931
|
'withdraw': {
|
|
908
|
-
'min':
|
|
932
|
+
'min': this.safeNumber(networkEntry, 'minimum_withdrawal'),
|
|
909
933
|
'max': undefined,
|
|
910
934
|
},
|
|
911
935
|
'deposit': {
|
|
@@ -913,19 +937,14 @@ class woo extends woo$1 {
|
|
|
913
937
|
'max': undefined,
|
|
914
938
|
},
|
|
915
939
|
},
|
|
916
|
-
'
|
|
917
|
-
'deposit': undefined,
|
|
918
|
-
'withdraw': undefined,
|
|
919
|
-
'fee': undefined,
|
|
920
|
-
'precision': this.parseNumber(precision),
|
|
921
|
-
'info': network,
|
|
940
|
+
'info': [networkEntry, tokenEntry],
|
|
922
941
|
};
|
|
923
942
|
}
|
|
924
|
-
result[code] = {
|
|
943
|
+
result[code] = this.safeCurrencyStructure({
|
|
925
944
|
'id': currencyId,
|
|
926
|
-
'name':
|
|
945
|
+
'name': undefined,
|
|
927
946
|
'code': code,
|
|
928
|
-
'precision':
|
|
947
|
+
'precision': undefined,
|
|
929
948
|
'active': undefined,
|
|
930
949
|
'fee': undefined,
|
|
931
950
|
'networks': resultingNetworks,
|
|
@@ -942,8 +961,8 @@ class woo extends woo$1 {
|
|
|
942
961
|
'max': undefined,
|
|
943
962
|
},
|
|
944
963
|
},
|
|
945
|
-
'info':
|
|
946
|
-
};
|
|
964
|
+
'info': [tokensByNetworkId, chainsByNetworkId],
|
|
965
|
+
});
|
|
947
966
|
}
|
|
948
967
|
return result;
|
|
949
968
|
}
|
|
@@ -1580,7 +1599,7 @@ class woo extends woo$1 {
|
|
|
1580
1599
|
request['size'] = limit;
|
|
1581
1600
|
}
|
|
1582
1601
|
else {
|
|
1583
|
-
request['size'] = 500;
|
|
1602
|
+
request['size'] = trailing ? 50 : 500;
|
|
1584
1603
|
}
|
|
1585
1604
|
if (trigger) {
|
|
1586
1605
|
request['algoType'] = 'stop';
|
|
@@ -2161,12 +2180,10 @@ class woo extends woo$1 {
|
|
|
2161
2180
|
// this method is TODO because of networks unification
|
|
2162
2181
|
await this.loadMarkets();
|
|
2163
2182
|
const currency = this.currency(code);
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
params = this.omit(params, 'network');
|
|
2167
|
-
const codeForExchange = networkCode + '_' + currency['code'];
|
|
2183
|
+
let specialNetworkId = undefined;
|
|
2184
|
+
[specialNetworkId, params] = this.getDedicatedNetworkId(currency, params);
|
|
2168
2185
|
const request = {
|
|
2169
|
-
'token':
|
|
2186
|
+
'token': specialNetworkId,
|
|
2170
2187
|
};
|
|
2171
2188
|
const response = await this.v1PrivateGetAssetDeposit(this.extend(request, params));
|
|
2172
2189
|
// {
|
|
@@ -2174,15 +2191,29 @@ class woo extends woo$1 {
|
|
|
2174
2191
|
// "address": "3Jmtjx5544T4smrit9Eroe4PCrRkpDeKjP",
|
|
2175
2192
|
// "extra": ''
|
|
2176
2193
|
// }
|
|
2177
|
-
|
|
2178
|
-
|
|
2194
|
+
return this.parseDepositAddress(response, currency);
|
|
2195
|
+
}
|
|
2196
|
+
getDedicatedNetworkId(currency, params) {
|
|
2197
|
+
let networkCode = undefined;
|
|
2198
|
+
[networkCode, params] = this.handleNetworkCodeAndParams(params);
|
|
2199
|
+
networkCode = this.networkIdToCode(networkCode, currency['code']);
|
|
2200
|
+
const networkEntry = this.safeDict(currency['networks'], networkCode);
|
|
2201
|
+
if (networkEntry === undefined) {
|
|
2202
|
+
const supportedNetworks = Object.keys(currency['networks']);
|
|
2203
|
+
throw new errors.BadRequest(this.id + ' can not determine a network code, please provide unified "network" param, one from the following: ' + this.json(supportedNetworks));
|
|
2204
|
+
}
|
|
2205
|
+
const currentyNetworkId = this.safeString(networkEntry, 'currencyNetworkId');
|
|
2206
|
+
return [currentyNetworkId, params];
|
|
2207
|
+
}
|
|
2208
|
+
parseDepositAddress(depositEntry, currency = undefined) {
|
|
2209
|
+
const address = this.safeString(depositEntry, 'address');
|
|
2179
2210
|
this.checkAddress(address);
|
|
2180
2211
|
return {
|
|
2181
|
-
'info':
|
|
2182
|
-
'currency': code,
|
|
2183
|
-
'network':
|
|
2212
|
+
'info': depositEntry,
|
|
2213
|
+
'currency': this.safeString(currency, 'code'),
|
|
2214
|
+
'network': undefined,
|
|
2184
2215
|
'address': address,
|
|
2185
|
-
'tag':
|
|
2216
|
+
'tag': this.safeString(depositEntry, 'extra'),
|
|
2186
2217
|
};
|
|
2187
2218
|
}
|
|
2188
2219
|
async getAssetHistoryRows(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
@@ -2588,16 +2619,9 @@ class woo extends woo$1 {
|
|
|
2588
2619
|
if (tag !== undefined) {
|
|
2589
2620
|
request['extra'] = tag;
|
|
2590
2621
|
}
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
const networkId = this.safeString(networks, network, network);
|
|
2595
|
-
const coinNetwork = this.safeDict(currencyNetworks, networkId, {});
|
|
2596
|
-
const coinNetworkId = this.safeString(coinNetwork, 'id');
|
|
2597
|
-
if (coinNetworkId === undefined) {
|
|
2598
|
-
throw new errors.BadRequest(this.id + ' withdraw() require network parameter');
|
|
2599
|
-
}
|
|
2600
|
-
request['token'] = coinNetworkId;
|
|
2622
|
+
let specialNetworkId = undefined;
|
|
2623
|
+
[specialNetworkId, params] = this.getDedicatedNetworkId(currency, params);
|
|
2624
|
+
request['token'] = specialNetworkId;
|
|
2601
2625
|
const response = await this.v1PrivatePostAssetWithdraw(this.extend(request, params));
|
|
2602
2626
|
//
|
|
2603
2627
|
// {
|