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,39 @@
|
|
|
1
|
+
// ----------------------------------------------------------------------------
|
|
2
|
+
|
|
3
|
+
// PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
|
|
4
|
+
// https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
|
|
5
|
+
// EDIT THE CORRESPONDENT .ts FILE INSTEAD
|
|
6
|
+
|
|
7
|
+
// ---------------------------------------------------------------------------
|
|
8
|
+
import okx from './okx.js';
|
|
9
|
+
// ---------------------------------------------------------------------------
|
|
10
|
+
export default class okxus extends okx {
|
|
11
|
+
describe() {
|
|
12
|
+
return this.deepExtend(super.describe(), {
|
|
13
|
+
'id': 'okxus',
|
|
14
|
+
'name': 'OKX (US)',
|
|
15
|
+
'hostname': 'us.okx.com',
|
|
16
|
+
'urls': {
|
|
17
|
+
'api': {
|
|
18
|
+
'rest': 'https://{hostname}',
|
|
19
|
+
'ws': 'wss://wsus.okx.com:8443/ws/v5',
|
|
20
|
+
},
|
|
21
|
+
'www': 'https://app.okx.com',
|
|
22
|
+
'doc': 'https://app.okx.com/docs-v5/en/#overview',
|
|
23
|
+
'fees': 'https://app.okx.com/pages/products/fees.html',
|
|
24
|
+
'referral': {
|
|
25
|
+
'url': 'https://www.app.okx.com/join/CCXT2023',
|
|
26
|
+
'discount': 0.2,
|
|
27
|
+
},
|
|
28
|
+
'test': {
|
|
29
|
+
'ws': 'wss://wsuspap.okx.com:8443/ws/v5',
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
'has': {
|
|
33
|
+
'swap': false,
|
|
34
|
+
'future': false,
|
|
35
|
+
'option': false,
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}
|
package/js/src/probit.js
CHANGED
|
@@ -470,33 +470,23 @@ export default class probit extends Exchange {
|
|
|
470
470
|
// ]
|
|
471
471
|
// }
|
|
472
472
|
//
|
|
473
|
-
const currencies = this.
|
|
473
|
+
const currencies = this.safeList(response, 'data', []);
|
|
474
474
|
const result = {};
|
|
475
475
|
for (let i = 0; i < currencies.length; i++) {
|
|
476
476
|
const currency = currencies[i];
|
|
477
477
|
const id = this.safeString(currency, 'id');
|
|
478
478
|
const code = this.safeCurrencyCode(id);
|
|
479
|
-
const displayName = this.
|
|
479
|
+
const displayName = this.safeDict(currency, 'display_name');
|
|
480
480
|
const name = this.safeString(displayName, 'en-us');
|
|
481
|
-
const platforms = this.
|
|
481
|
+
const platforms = this.safeList(currency, 'platform', []);
|
|
482
482
|
const platformsByPriority = this.sortBy(platforms, 'priority');
|
|
483
|
-
let platform = undefined;
|
|
484
483
|
const networkList = {};
|
|
485
484
|
for (let j = 0; j < platformsByPriority.length; j++) {
|
|
486
485
|
const network = platformsByPriority[j];
|
|
487
486
|
const idInner = this.safeString(network, 'id');
|
|
488
487
|
const networkCode = this.networkIdToCode(idInner);
|
|
489
|
-
const
|
|
490
|
-
|
|
491
|
-
const currentDeposit = !currentDepositSuspended;
|
|
492
|
-
const currentWithdraw = !currentWithdrawalSuspended;
|
|
493
|
-
const currentActive = currentDeposit && currentWithdraw;
|
|
494
|
-
if (currentActive) {
|
|
495
|
-
platform = network;
|
|
496
|
-
}
|
|
497
|
-
const precision = this.parsePrecision(this.safeString(network, 'precision'));
|
|
498
|
-
const withdrawFee = this.safeValue(network, 'withdrawal_fee', []);
|
|
499
|
-
let networkFee = this.safeValue(withdrawFee, 0, {});
|
|
488
|
+
const withdrawFee = this.safeList(network, 'withdrawal_fee', []);
|
|
489
|
+
let networkFee = this.safeDict(withdrawFee, 0, {});
|
|
500
490
|
for (let k = 0; k < withdrawFee.length; k++) {
|
|
501
491
|
const withdrawPlatform = withdrawFee[k];
|
|
502
492
|
const feeCurrencyId = this.safeString(withdrawPlatform, 'currency_id');
|
|
@@ -508,11 +498,11 @@ export default class probit extends Exchange {
|
|
|
508
498
|
networkList[networkCode] = {
|
|
509
499
|
'id': idInner,
|
|
510
500
|
'network': networkCode,
|
|
511
|
-
'active':
|
|
512
|
-
'deposit':
|
|
513
|
-
'withdraw':
|
|
501
|
+
'active': undefined,
|
|
502
|
+
'deposit': !this.safeBool(network, 'deposit_suspended'),
|
|
503
|
+
'withdraw': !this.safeBool(network, 'withdrawal_suspended'),
|
|
514
504
|
'fee': this.safeNumber(networkFee, 'amount'),
|
|
515
|
-
'precision': this.parseNumber(precision),
|
|
505
|
+
'precision': this.parseNumber(this.parsePrecision(this.safeString(network, 'precision'))),
|
|
516
506
|
'limits': {
|
|
517
507
|
'withdraw': {
|
|
518
508
|
'min': this.safeNumber(network, 'min_withdrawal_amount'),
|
|
@@ -526,56 +516,33 @@ export default class probit extends Exchange {
|
|
|
526
516
|
'info': network,
|
|
527
517
|
};
|
|
528
518
|
}
|
|
529
|
-
|
|
530
|
-
platform = this.safeValue(platformsByPriority, 0, {});
|
|
531
|
-
}
|
|
532
|
-
const depositSuspended = this.safeValue(platform, 'deposit_suspended');
|
|
533
|
-
const withdrawalSuspended = this.safeValue(platform, 'withdrawal_suspended');
|
|
534
|
-
const deposit = !depositSuspended;
|
|
535
|
-
const withdraw = !withdrawalSuspended;
|
|
536
|
-
const active = deposit && withdraw;
|
|
537
|
-
const withdrawalFees = this.safeValue(platform, 'withdrawal_fee', {});
|
|
538
|
-
const fees = [];
|
|
539
|
-
// sometimes the withdrawal fee is an empty object
|
|
540
|
-
// [ { 'amount': '0.015', 'priority': 1, 'currency_id': 'ETH' }, {} ]
|
|
541
|
-
for (let j = 0; j < withdrawalFees.length; j++) {
|
|
542
|
-
const withdrawalFeeInner = withdrawalFees[j];
|
|
543
|
-
const amount = this.safeNumber(withdrawalFeeInner, 'amount');
|
|
544
|
-
const priority = this.safeInteger(withdrawalFeeInner, 'priority');
|
|
545
|
-
if ((amount !== undefined) && (priority !== undefined)) {
|
|
546
|
-
fees.push(withdrawalFeeInner);
|
|
547
|
-
}
|
|
548
|
-
}
|
|
549
|
-
const withdrawalFeesByPriority = this.sortBy(fees, 'priority');
|
|
550
|
-
const withdrawalFee = this.safeValue(withdrawalFeesByPriority, 0, {});
|
|
551
|
-
const fee = this.safeNumber(withdrawalFee, 'amount');
|
|
552
|
-
result[code] = {
|
|
519
|
+
result[code] = this.safeCurrencyStructure({
|
|
553
520
|
'id': id,
|
|
554
521
|
'code': code,
|
|
555
522
|
'info': currency,
|
|
556
523
|
'name': name,
|
|
557
|
-
'active':
|
|
558
|
-
'deposit':
|
|
559
|
-
'withdraw':
|
|
524
|
+
'active': undefined,
|
|
525
|
+
'deposit': undefined,
|
|
526
|
+
'withdraw': undefined,
|
|
560
527
|
'type': 'crypto',
|
|
561
|
-
'fee':
|
|
562
|
-
'precision':
|
|
528
|
+
'fee': undefined,
|
|
529
|
+
'precision': undefined,
|
|
563
530
|
'limits': {
|
|
564
531
|
'amount': {
|
|
565
532
|
'min': undefined,
|
|
566
533
|
'max': undefined,
|
|
567
534
|
},
|
|
568
535
|
'deposit': {
|
|
569
|
-
'min':
|
|
536
|
+
'min': undefined,
|
|
570
537
|
'max': undefined,
|
|
571
538
|
},
|
|
572
539
|
'withdraw': {
|
|
573
|
-
'min':
|
|
540
|
+
'min': undefined,
|
|
574
541
|
'max': undefined,
|
|
575
542
|
},
|
|
576
543
|
},
|
|
577
544
|
'networks': networkList,
|
|
578
|
-
};
|
|
545
|
+
});
|
|
579
546
|
}
|
|
580
547
|
return result;
|
|
581
548
|
}
|
package/js/src/timex.js
CHANGED
|
@@ -1417,11 +1417,6 @@ export default class timex extends Exchange {
|
|
|
1417
1417
|
//
|
|
1418
1418
|
const id = this.safeString(currency, 'symbol');
|
|
1419
1419
|
const code = this.safeCurrencyCode(id);
|
|
1420
|
-
const name = this.safeString(currency, 'name');
|
|
1421
|
-
const depositEnabled = this.safeValue(currency, 'depositEnabled');
|
|
1422
|
-
const withdrawEnabled = this.safeValue(currency, 'withdrawalEnabled');
|
|
1423
|
-
const isActive = this.safeValue(currency, 'active');
|
|
1424
|
-
const active = depositEnabled && withdrawEnabled && isActive;
|
|
1425
1420
|
// const fee = this.safeNumber (currency, 'withdrawalFee');
|
|
1426
1421
|
const feeString = this.safeString(currency, 'withdrawalFee');
|
|
1427
1422
|
const tradeDecimals = this.safeInteger(currency, 'tradeDecimals');
|
|
@@ -1447,14 +1442,14 @@ export default class timex extends Exchange {
|
|
|
1447
1442
|
'code': code,
|
|
1448
1443
|
'info': currency,
|
|
1449
1444
|
'type': undefined,
|
|
1450
|
-
'name': name,
|
|
1451
|
-
'active': active,
|
|
1452
|
-
'deposit': depositEnabled,
|
|
1453
|
-
'withdraw':
|
|
1445
|
+
'name': this.safeString(currency, 'name'),
|
|
1446
|
+
'active': this.safeBool(currency, 'active'),
|
|
1447
|
+
'deposit': this.safeBool(currency, 'depositEnabled'),
|
|
1448
|
+
'withdraw': this.safeBool(currency, 'withdrawalEnabled'),
|
|
1454
1449
|
'fee': fee,
|
|
1455
1450
|
'precision': this.parseNumber(this.parsePrecision(this.safeString(currency, 'decimals'))),
|
|
1456
1451
|
'limits': {
|
|
1457
|
-
'withdraw': { 'min':
|
|
1452
|
+
'withdraw': { 'min': undefined, 'max': undefined },
|
|
1458
1453
|
'amount': { 'min': undefined, 'max': undefined },
|
|
1459
1454
|
},
|
|
1460
1455
|
'networks': {},
|
package/js/src/vertex.js
CHANGED
|
@@ -454,11 +454,10 @@ export default class vertex extends Exchange {
|
|
|
454
454
|
if ((tickerId !== undefined) && (tickerId.indexOf('PERP') > 0)) {
|
|
455
455
|
continue;
|
|
456
456
|
}
|
|
457
|
-
const id = this.safeString(data, 'product_id');
|
|
458
457
|
const name = this.safeString(data, 'symbol');
|
|
459
458
|
const code = this.safeCurrencyCode(name);
|
|
460
|
-
result[code] = {
|
|
461
|
-
'id':
|
|
459
|
+
result[code] = this.safeCurrencyStructure({
|
|
460
|
+
'id': this.safeString(data, 'product_id'),
|
|
462
461
|
'name': name,
|
|
463
462
|
'code': code,
|
|
464
463
|
'precision': undefined,
|
|
@@ -478,7 +477,7 @@ export default class vertex extends Exchange {
|
|
|
478
477
|
'max': undefined,
|
|
479
478
|
},
|
|
480
479
|
},
|
|
481
|
-
};
|
|
480
|
+
});
|
|
482
481
|
}
|
|
483
482
|
return result;
|
|
484
483
|
}
|
package/js/src/whitebit.js
CHANGED
|
@@ -616,25 +616,52 @@ export default class whitebit extends Exchange {
|
|
|
616
616
|
for (let i = 0; i < ids.length; i++) {
|
|
617
617
|
const id = ids[i];
|
|
618
618
|
const currency = response[id];
|
|
619
|
-
// breaks down in Python due to utf8 encoding issues on the exchange side
|
|
620
|
-
// const name = this.safeString (currency, 'name');
|
|
621
|
-
const canDeposit = this.safeBool(currency, 'can_deposit', true);
|
|
622
|
-
const canWithdraw = this.safeBool(currency, 'can_withdraw', true);
|
|
623
|
-
const active = canDeposit && canWithdraw;
|
|
619
|
+
// const name = this.safeString (currency, 'name'); // breaks down in Python due to utf8 encoding issues on the exchange side
|
|
624
620
|
const code = this.safeCurrencyCode(id);
|
|
625
621
|
const hasProvider = ('providers' in currency);
|
|
626
|
-
|
|
622
|
+
const networks = {};
|
|
623
|
+
const rawNetworks = this.safeDict(currency, 'networks', {});
|
|
624
|
+
const depositsNetworks = this.safeList(rawNetworks, 'deposits', []);
|
|
625
|
+
const withdrawsNetworks = this.safeList(rawNetworks, 'withdraws', []);
|
|
626
|
+
const networkLimits = this.safeDict(currency, 'limits', {});
|
|
627
|
+
const depositLimits = this.safeDict(networkLimits, 'deposit', {});
|
|
628
|
+
const withdrawLimits = this.safeDict(networkLimits, 'withdraw', {});
|
|
629
|
+
const allNetworks = this.arrayConcat(depositsNetworks, withdrawsNetworks);
|
|
630
|
+
for (let j = 0; j < allNetworks.length; j++) {
|
|
631
|
+
const networkId = allNetworks[j];
|
|
632
|
+
const networkCode = this.networkIdToCode(networkId);
|
|
633
|
+
networks[networkCode] = {
|
|
634
|
+
'id': networkId,
|
|
635
|
+
'network': networkCode,
|
|
636
|
+
'active': undefined,
|
|
637
|
+
'deposit': this.inArray(networkId, depositsNetworks),
|
|
638
|
+
'withdraw': this.inArray(networkId, withdrawsNetworks),
|
|
639
|
+
'fee': undefined,
|
|
640
|
+
'precision': undefined,
|
|
641
|
+
'limits': {
|
|
642
|
+
'deposit': {
|
|
643
|
+
'min': this.safeNumber(depositLimits, 'min', undefined),
|
|
644
|
+
'max': this.safeNumber(depositLimits, 'max', undefined),
|
|
645
|
+
},
|
|
646
|
+
'withdraw': {
|
|
647
|
+
'min': this.safeNumber(withdrawLimits, 'min', undefined),
|
|
648
|
+
'max': this.safeNumber(withdrawLimits, 'max', undefined),
|
|
649
|
+
},
|
|
650
|
+
},
|
|
651
|
+
};
|
|
652
|
+
}
|
|
653
|
+
result[code] = this.safeCurrencyStructure({
|
|
627
654
|
'id': id,
|
|
628
655
|
'code': code,
|
|
629
656
|
'info': currency,
|
|
630
657
|
'name': undefined,
|
|
631
|
-
'active':
|
|
632
|
-
'deposit':
|
|
633
|
-
'withdraw':
|
|
658
|
+
'active': undefined,
|
|
659
|
+
'deposit': this.safeBool(currency, 'can_deposit'),
|
|
660
|
+
'withdraw': this.safeBool(currency, 'can_withdraw'),
|
|
634
661
|
'fee': undefined,
|
|
635
662
|
'networks': undefined,
|
|
636
663
|
'type': hasProvider ? 'fiat' : 'crypto',
|
|
637
|
-
'precision':
|
|
664
|
+
'precision': this.parseNumber(this.parsePrecision(this.safeString(currency, 'currency_precision'))),
|
|
638
665
|
'limits': {
|
|
639
666
|
'amount': {
|
|
640
667
|
'min': undefined,
|
|
@@ -644,8 +671,12 @@ export default class whitebit extends Exchange {
|
|
|
644
671
|
'min': this.safeNumber(currency, 'min_withdraw'),
|
|
645
672
|
'max': this.safeNumber(currency, 'max_withdraw'),
|
|
646
673
|
},
|
|
674
|
+
'deposit': {
|
|
675
|
+
'min': this.safeNumber(currency, 'min_deposit'),
|
|
676
|
+
'max': this.safeNumber(currency, 'max_deposit'),
|
|
677
|
+
},
|
|
647
678
|
},
|
|
648
|
-
};
|
|
679
|
+
});
|
|
649
680
|
}
|
|
650
681
|
return result;
|
|
651
682
|
}
|
package/js/src/woo.d.ts
CHANGED
|
@@ -373,6 +373,8 @@ export default class woo extends Exchange {
|
|
|
373
373
|
* @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
|
|
374
374
|
*/
|
|
375
375
|
fetchDepositAddress(code: string, params?: {}): Promise<DepositAddress>;
|
|
376
|
+
getDedicatedNetworkId(currency: any, params: Dict): any;
|
|
377
|
+
parseDepositAddress(depositEntry: any, currency?: Currency): DepositAddress;
|
|
376
378
|
getAssetHistoryRows(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<any>;
|
|
377
379
|
/**
|
|
378
380
|
* @method
|
package/js/src/woo.js
CHANGED
|
@@ -304,6 +304,11 @@ export default class woo extends Exchange {
|
|
|
304
304
|
'TRC20': 'TRON',
|
|
305
305
|
'ERC20': 'ETH',
|
|
306
306
|
'BEP20': 'BSC',
|
|
307
|
+
'ARB': 'Arbitrum',
|
|
308
|
+
},
|
|
309
|
+
'networksById': {
|
|
310
|
+
'TRX': 'TRC20',
|
|
311
|
+
'TRON': 'TRC20',
|
|
307
312
|
},
|
|
308
313
|
// override defaultNetworkCodePriorities for a specific currency
|
|
309
314
|
'defaultNetworkCodeForCurrencies': {
|
|
@@ -822,33 +827,45 @@ export default class woo extends Exchange {
|
|
|
822
827
|
*/
|
|
823
828
|
async fetchCurrencies(params = {}) {
|
|
824
829
|
const result = {};
|
|
825
|
-
const
|
|
830
|
+
const tokenResponsePromise = this.v1PublicGetToken(params);
|
|
826
831
|
//
|
|
827
|
-
//
|
|
828
|
-
//
|
|
832
|
+
// {
|
|
833
|
+
// "rows": [
|
|
829
834
|
// {
|
|
830
835
|
// "token": "ETH_USDT",
|
|
831
836
|
// "fullname": "Tether",
|
|
832
|
-
// "
|
|
837
|
+
// "network": "ETH",
|
|
838
|
+
// "decimals": "6",
|
|
839
|
+
// "delisted": false,
|
|
833
840
|
// "balance_token": "USDT",
|
|
834
|
-
// "created_time": "
|
|
835
|
-
// "updated_time": "
|
|
841
|
+
// "created_time": "1710123398",
|
|
842
|
+
// "updated_time": "1746528481",
|
|
843
|
+
// "can_collateral": true,
|
|
844
|
+
// "can_short": true
|
|
836
845
|
// },
|
|
837
846
|
// {
|
|
838
847
|
// "token": "BSC_USDT",
|
|
839
848
|
// "fullname": "Tether",
|
|
840
|
-
// "
|
|
849
|
+
// "network": "BSC",
|
|
850
|
+
// "decimals": "18",
|
|
851
|
+
// "delisted": false,
|
|
841
852
|
// "balance_token": "USDT",
|
|
842
|
-
// "created_time": "
|
|
843
|
-
// "updated_time": "
|
|
853
|
+
// "created_time": "1710123395",
|
|
854
|
+
// "updated_time": "1746528601",
|
|
855
|
+
// "can_collateral": true,
|
|
856
|
+
// "can_short": true
|
|
844
857
|
// },
|
|
845
858
|
// {
|
|
846
|
-
// "token": "
|
|
847
|
-
// "fullname": "
|
|
848
|
-
// "
|
|
849
|
-
// "
|
|
850
|
-
// "
|
|
851
|
-
// "
|
|
859
|
+
// "token": "ALGO",
|
|
860
|
+
// "fullname": "Algorand",
|
|
861
|
+
// "network": "ALGO",
|
|
862
|
+
// "decimals": "6",
|
|
863
|
+
// "delisted": false,
|
|
864
|
+
// "balance_token": "ALGO",
|
|
865
|
+
// "created_time": "1710123394",
|
|
866
|
+
// "updated_time": "1723087518",
|
|
867
|
+
// "can_collateral": true,
|
|
868
|
+
// "can_short": true
|
|
852
869
|
// },
|
|
853
870
|
// ...
|
|
854
871
|
// ],
|
|
@@ -856,59 +873,66 @@ export default class woo extends Exchange {
|
|
|
856
873
|
// }
|
|
857
874
|
//
|
|
858
875
|
// only make one request for currrencies...
|
|
859
|
-
|
|
876
|
+
const tokenNetworkResponsePromise = this.v1PublicGetTokenNetwork(params);
|
|
860
877
|
//
|
|
861
878
|
// {
|
|
862
879
|
// "rows": [
|
|
863
880
|
// {
|
|
864
881
|
// "protocol": "ERC20",
|
|
882
|
+
// "network": "ETH",
|
|
865
883
|
// "token": "USDT",
|
|
866
|
-
// "name": "Ethereum",
|
|
867
|
-
// "minimum_withdrawal":
|
|
868
|
-
// "withdrawal_fee":
|
|
869
|
-
// "allow_deposit": 1,
|
|
870
|
-
// "allow_withdraw": 1
|
|
884
|
+
// "name": "Ethereum (ERC20)",
|
|
885
|
+
// "minimum_withdrawal": "10.00000000",
|
|
886
|
+
// "withdrawal_fee": "2.00000000",
|
|
887
|
+
// "allow_deposit": "1",
|
|
888
|
+
// "allow_withdraw": "1"
|
|
871
889
|
// },
|
|
872
890
|
// {
|
|
873
891
|
// "protocol": "TRC20",
|
|
892
|
+
// "network": "TRX",
|
|
874
893
|
// "token": "USDT",
|
|
875
|
-
// "name": "Tron",
|
|
876
|
-
// "minimum_withdrawal":
|
|
877
|
-
// "withdrawal_fee":
|
|
878
|
-
// "allow_deposit": 1,
|
|
879
|
-
// "allow_withdraw": 1
|
|
894
|
+
// "name": "Tron (TRC20)",
|
|
895
|
+
// "minimum_withdrawal": "10.00000000",
|
|
896
|
+
// "withdrawal_fee": "4.50000000",
|
|
897
|
+
// "allow_deposit": "1",
|
|
898
|
+
// "allow_withdraw": "1"
|
|
880
899
|
// },
|
|
881
900
|
// ...
|
|
882
901
|
// ],
|
|
883
902
|
// "success": true
|
|
884
903
|
// }
|
|
885
904
|
//
|
|
905
|
+
const [tokenResponse, tokenNetworkResponse] = await Promise.all([tokenResponsePromise, tokenNetworkResponsePromise]);
|
|
886
906
|
const tokenRows = this.safeList(tokenResponse, 'rows', []);
|
|
887
|
-
const
|
|
888
|
-
const
|
|
907
|
+
const tokenNetworkRows = this.safeList(tokenNetworkResponse, 'rows', []);
|
|
908
|
+
const networksById = this.groupBy(tokenNetworkRows, 'token');
|
|
909
|
+
const tokensById = this.groupBy(tokenRows, 'balance_token');
|
|
910
|
+
const currencyIds = Object.keys(tokensById);
|
|
889
911
|
for (let i = 0; i < currencyIds.length; i++) {
|
|
890
912
|
const currencyId = currencyIds[i];
|
|
891
|
-
const networks = networksByCurrencyId[currencyId];
|
|
892
913
|
const code = this.safeCurrencyCode(currencyId);
|
|
893
|
-
|
|
894
|
-
|
|
914
|
+
const tokensByNetworkId = this.indexBy(tokensById[currencyId], 'network');
|
|
915
|
+
const chainsByNetworkId = this.indexBy(networksById[currencyId], 'network');
|
|
916
|
+
const keys = Object.keys(chainsByNetworkId);
|
|
895
917
|
const resultingNetworks = {};
|
|
896
|
-
for (let j = 0; j <
|
|
897
|
-
const
|
|
898
|
-
|
|
899
|
-
const
|
|
900
|
-
const
|
|
901
|
-
const
|
|
902
|
-
|
|
903
|
-
if (precision !== undefined) {
|
|
904
|
-
minPrecision = (minPrecision === undefined) ? precision : Precise.stringMin(precision, minPrecision);
|
|
905
|
-
}
|
|
906
|
-
resultingNetworks[unifiedNetwork] = {
|
|
918
|
+
for (let j = 0; j < keys.length; j++) {
|
|
919
|
+
const networkId = keys[j];
|
|
920
|
+
const tokenEntry = this.safeDict(tokensByNetworkId, networkId, {});
|
|
921
|
+
const networkEntry = this.safeDict(chainsByNetworkId, networkId, {});
|
|
922
|
+
const networkCode = this.networkIdToCode(networkId, code);
|
|
923
|
+
const specialNetworkId = this.safeString(tokenEntry, 'token');
|
|
924
|
+
resultingNetworks[networkCode] = {
|
|
907
925
|
'id': networkId,
|
|
908
|
-
'
|
|
926
|
+
'currencyNetworkId': specialNetworkId,
|
|
927
|
+
'network': networkCode,
|
|
928
|
+
'active': undefined,
|
|
929
|
+
'deposit': this.safeString(networkEntry, 'allow_deposit') === '1',
|
|
930
|
+
'withdraw': this.safeString(networkEntry, 'allow_withdraw') === '1',
|
|
931
|
+
'fee': this.safeNumber(networkEntry, 'withdrawal_fee'),
|
|
932
|
+
'precision': this.parseNumber(this.parsePrecision(this.safeString(tokenEntry, 'decimals'))),
|
|
909
933
|
'limits': {
|
|
910
934
|
'withdraw': {
|
|
911
|
-
'min':
|
|
935
|
+
'min': this.safeNumber(networkEntry, 'minimum_withdrawal'),
|
|
912
936
|
'max': undefined,
|
|
913
937
|
},
|
|
914
938
|
'deposit': {
|
|
@@ -916,19 +940,14 @@ export default class woo extends Exchange {
|
|
|
916
940
|
'max': undefined,
|
|
917
941
|
},
|
|
918
942
|
},
|
|
919
|
-
'
|
|
920
|
-
'deposit': undefined,
|
|
921
|
-
'withdraw': undefined,
|
|
922
|
-
'fee': undefined,
|
|
923
|
-
'precision': this.parseNumber(precision),
|
|
924
|
-
'info': network,
|
|
943
|
+
'info': [networkEntry, tokenEntry],
|
|
925
944
|
};
|
|
926
945
|
}
|
|
927
|
-
result[code] = {
|
|
946
|
+
result[code] = this.safeCurrencyStructure({
|
|
928
947
|
'id': currencyId,
|
|
929
|
-
'name':
|
|
948
|
+
'name': undefined,
|
|
930
949
|
'code': code,
|
|
931
|
-
'precision':
|
|
950
|
+
'precision': undefined,
|
|
932
951
|
'active': undefined,
|
|
933
952
|
'fee': undefined,
|
|
934
953
|
'networks': resultingNetworks,
|
|
@@ -945,8 +964,8 @@ export default class woo extends Exchange {
|
|
|
945
964
|
'max': undefined,
|
|
946
965
|
},
|
|
947
966
|
},
|
|
948
|
-
'info':
|
|
949
|
-
};
|
|
967
|
+
'info': [tokensByNetworkId, chainsByNetworkId],
|
|
968
|
+
});
|
|
950
969
|
}
|
|
951
970
|
return result;
|
|
952
971
|
}
|
|
@@ -1583,7 +1602,7 @@ export default class woo extends Exchange {
|
|
|
1583
1602
|
request['size'] = limit;
|
|
1584
1603
|
}
|
|
1585
1604
|
else {
|
|
1586
|
-
request['size'] = 500;
|
|
1605
|
+
request['size'] = trailing ? 50 : 500;
|
|
1587
1606
|
}
|
|
1588
1607
|
if (trigger) {
|
|
1589
1608
|
request['algoType'] = 'stop';
|
|
@@ -2164,12 +2183,10 @@ export default class woo extends Exchange {
|
|
|
2164
2183
|
// this method is TODO because of networks unification
|
|
2165
2184
|
await this.loadMarkets();
|
|
2166
2185
|
const currency = this.currency(code);
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
params = this.omit(params, 'network');
|
|
2170
|
-
const codeForExchange = networkCode + '_' + currency['code'];
|
|
2186
|
+
let specialNetworkId = undefined;
|
|
2187
|
+
[specialNetworkId, params] = this.getDedicatedNetworkId(currency, params);
|
|
2171
2188
|
const request = {
|
|
2172
|
-
'token':
|
|
2189
|
+
'token': specialNetworkId,
|
|
2173
2190
|
};
|
|
2174
2191
|
const response = await this.v1PrivateGetAssetDeposit(this.extend(request, params));
|
|
2175
2192
|
// {
|
|
@@ -2177,15 +2194,29 @@ export default class woo extends Exchange {
|
|
|
2177
2194
|
// "address": "3Jmtjx5544T4smrit9Eroe4PCrRkpDeKjP",
|
|
2178
2195
|
// "extra": ''
|
|
2179
2196
|
// }
|
|
2180
|
-
|
|
2181
|
-
|
|
2197
|
+
return this.parseDepositAddress(response, currency);
|
|
2198
|
+
}
|
|
2199
|
+
getDedicatedNetworkId(currency, params) {
|
|
2200
|
+
let networkCode = undefined;
|
|
2201
|
+
[networkCode, params] = this.handleNetworkCodeAndParams(params);
|
|
2202
|
+
networkCode = this.networkIdToCode(networkCode, currency['code']);
|
|
2203
|
+
const networkEntry = this.safeDict(currency['networks'], networkCode);
|
|
2204
|
+
if (networkEntry === undefined) {
|
|
2205
|
+
const supportedNetworks = Object.keys(currency['networks']);
|
|
2206
|
+
throw new BadRequest(this.id + ' can not determine a network code, please provide unified "network" param, one from the following: ' + this.json(supportedNetworks));
|
|
2207
|
+
}
|
|
2208
|
+
const currentyNetworkId = this.safeString(networkEntry, 'currencyNetworkId');
|
|
2209
|
+
return [currentyNetworkId, params];
|
|
2210
|
+
}
|
|
2211
|
+
parseDepositAddress(depositEntry, currency = undefined) {
|
|
2212
|
+
const address = this.safeString(depositEntry, 'address');
|
|
2182
2213
|
this.checkAddress(address);
|
|
2183
2214
|
return {
|
|
2184
|
-
'info':
|
|
2185
|
-
'currency': code,
|
|
2186
|
-
'network':
|
|
2215
|
+
'info': depositEntry,
|
|
2216
|
+
'currency': this.safeString(currency, 'code'),
|
|
2217
|
+
'network': undefined,
|
|
2187
2218
|
'address': address,
|
|
2188
|
-
'tag':
|
|
2219
|
+
'tag': this.safeString(depositEntry, 'extra'),
|
|
2189
2220
|
};
|
|
2190
2221
|
}
|
|
2191
2222
|
async getAssetHistoryRows(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
@@ -2591,16 +2622,9 @@ export default class woo extends Exchange {
|
|
|
2591
2622
|
if (tag !== undefined) {
|
|
2592
2623
|
request['extra'] = tag;
|
|
2593
2624
|
}
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
const networkId = this.safeString(networks, network, network);
|
|
2598
|
-
const coinNetwork = this.safeDict(currencyNetworks, networkId, {});
|
|
2599
|
-
const coinNetworkId = this.safeString(coinNetwork, 'id');
|
|
2600
|
-
if (coinNetworkId === undefined) {
|
|
2601
|
-
throw new BadRequest(this.id + ' withdraw() require network parameter');
|
|
2602
|
-
}
|
|
2603
|
-
request['token'] = coinNetworkId;
|
|
2625
|
+
let specialNetworkId = undefined;
|
|
2626
|
+
[specialNetworkId, params] = this.getDedicatedNetworkId(currency, params);
|
|
2627
|
+
request['token'] = specialNetworkId;
|
|
2604
2628
|
const response = await this.v1PrivatePostAssetWithdraw(this.extend(request, params));
|
|
2605
2629
|
//
|
|
2606
2630
|
// {
|
package/js/src/woofipro.d.ts
CHANGED
|
@@ -45,7 +45,8 @@ export default class woofipro extends Exchange {
|
|
|
45
45
|
* @method
|
|
46
46
|
* @name woofipro#fetchCurrencies
|
|
47
47
|
* @description fetches all available currencies on an exchange
|
|
48
|
-
* @see https://orderly.network/docs/build-on-
|
|
48
|
+
* @see https://orderly.network/docs/build-on-omnichain/evm-api/restful-api/public/get-supported-collateral-info#get-supported-collateral-info
|
|
49
|
+
* @see https://orderly.network/docs/build-on-omnichain/evm-api/restful-api/public/get-supported-chains-per-builder#get-supported-chains-per-builder
|
|
49
50
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
50
51
|
* @returns {object} an associative dictionary of currencies
|
|
51
52
|
*/
|