ccxt 4.4.85 → 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 -7
- package/dist/ccxt.browser.min.js +2 -2
- package/dist/cjs/ccxt.js +6 -9
- package/dist/cjs/src/abstract/bittrade.js +9 -0
- package/dist/cjs/src/ascendex.js +189 -155
- package/dist/cjs/src/bequant.js +1 -1
- package/dist/cjs/src/bitget.js +5 -4
- package/dist/cjs/src/bitmart.js +1 -1
- package/dist/cjs/src/bittrade.js +2049 -0
- package/dist/cjs/src/coinbase.js +2 -6
- package/dist/cjs/src/deribit.js +4 -5
- package/dist/cjs/src/hollaex.js +107 -49
- package/dist/cjs/src/htx.js +20 -44
- package/dist/cjs/src/hyperliquid.js +4 -4
- 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 +5 -1
- 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/js/ccxt.d.ts +8 -11
- package/js/ccxt.js +6 -8
- package/js/src/abstract/myokx.d.ts +2 -0
- package/js/src/abstract/okx.d.ts +2 -0
- package/js/src/ascendex.d.ts +2 -0
- package/js/src/ascendex.js +189 -155
- package/js/src/bequant.js +1 -1
- package/js/src/bitget.js +5 -4
- package/js/src/bitmart.js +1 -1
- 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/deribit.js +4 -5
- package/js/src/hollaex.js +107 -49
- package/js/src/htx.js +20 -44
- package/js/src/hyperliquid.js +4 -4
- 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.js +5 -1
- 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/package.json +1 -1
- package/js/src/abstract/kuna.d.ts +0 -185
- package/js/src/abstract/kuna.js +0 -11
- 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/hollaex.js
CHANGED
|
@@ -287,6 +287,14 @@ export default class hollaex extends Exchange {
|
|
|
287
287
|
'BNB': 'bnb',
|
|
288
288
|
'MATIC': 'matic',
|
|
289
289
|
},
|
|
290
|
+
'networksById': {
|
|
291
|
+
'eth': 'ERC20',
|
|
292
|
+
'ETH': 'ERC20',
|
|
293
|
+
'ERC20': 'ERC20',
|
|
294
|
+
'trx': 'TRC20',
|
|
295
|
+
'TRX': 'TRC20',
|
|
296
|
+
'TRC20': 'TRC20',
|
|
297
|
+
},
|
|
290
298
|
},
|
|
291
299
|
});
|
|
292
300
|
}
|
|
@@ -417,66 +425,116 @@ export default class hollaex extends Exchange {
|
|
|
417
425
|
async fetchCurrencies(params = {}) {
|
|
418
426
|
const response = await this.publicGetConstants(params);
|
|
419
427
|
//
|
|
420
|
-
//
|
|
421
|
-
//
|
|
422
|
-
//
|
|
423
|
-
//
|
|
424
|
-
//
|
|
425
|
-
//
|
|
426
|
-
//
|
|
427
|
-
//
|
|
428
|
-
//
|
|
429
|
-
//
|
|
430
|
-
//
|
|
431
|
-
//
|
|
432
|
-
//
|
|
433
|
-
//
|
|
434
|
-
//
|
|
435
|
-
//
|
|
436
|
-
//
|
|
437
|
-
//
|
|
438
|
-
//
|
|
439
|
-
//
|
|
440
|
-
//
|
|
441
|
-
//
|
|
442
|
-
//
|
|
443
|
-
//
|
|
444
|
-
//
|
|
445
|
-
//
|
|
446
|
-
//
|
|
447
|
-
//
|
|
448
|
-
//
|
|
449
|
-
//
|
|
428
|
+
// {
|
|
429
|
+
// "coins": {
|
|
430
|
+
// "usdt": {
|
|
431
|
+
// "id": "6",
|
|
432
|
+
// "fullname": "USD Tether",
|
|
433
|
+
// "symbol": "usdt",
|
|
434
|
+
// "active": true,
|
|
435
|
+
// "verified": true,
|
|
436
|
+
// "allow_deposit": true,
|
|
437
|
+
// "allow_withdrawal": true,
|
|
438
|
+
// "withdrawal_fee": "20",
|
|
439
|
+
// "min": "1",
|
|
440
|
+
// "max": "10000000",
|
|
441
|
+
// "increment_unit": "0.0001",
|
|
442
|
+
// "logo": "https://hollaex-resources.s3.ap-southeast-1.amazonaws.com/icons/usdt.svg",
|
|
443
|
+
// "code": "usdt",
|
|
444
|
+
// "is_public": true,
|
|
445
|
+
// "meta": {
|
|
446
|
+
// "color": "#27a17a",
|
|
447
|
+
// "website": "https://tether.to",
|
|
448
|
+
// "explorer": "https://blockchair.com/tether",
|
|
449
|
+
// "decimal_points": "6"
|
|
450
|
+
// },
|
|
451
|
+
// "estimated_price": "1",
|
|
452
|
+
// "description": "<p>Tether (USDT) is a stablecoin pegged 1:1 to the US dollar. It is a digital currency that aims to maintain its value while allowing for fast and secure transfer of funds. It was the first stablecoin, and is the most widely used due stablecoin due to its stability and low volatility compared to other cryptocurrencies. It was launched in 2014 by Tether Limited.</p>",
|
|
453
|
+
// "type": "blockchain",
|
|
454
|
+
// "network": "eth,trx,bnb,matic",
|
|
455
|
+
// "standard": "",
|
|
456
|
+
// "issuer": "HollaEx",
|
|
457
|
+
// "withdrawal_fees": {
|
|
458
|
+
// "bnb": {
|
|
459
|
+
// "value": "0.8",
|
|
460
|
+
// "active": true,
|
|
461
|
+
// "symbol": "usdt"
|
|
462
|
+
// },
|
|
463
|
+
// "eth": {
|
|
464
|
+
// "value": "1.5",
|
|
465
|
+
// "active": true,
|
|
466
|
+
// "symbol": "usdt"
|
|
467
|
+
// },
|
|
468
|
+
// "trx": {
|
|
469
|
+
// "value": "4",
|
|
470
|
+
// "active": true,
|
|
471
|
+
// "symbol": "usdt"
|
|
472
|
+
// },
|
|
473
|
+
// "matic": {
|
|
474
|
+
// "value": "0.3",
|
|
475
|
+
// "active": true,
|
|
476
|
+
// "symbol": "usdt"
|
|
477
|
+
// }
|
|
478
|
+
// },
|
|
479
|
+
// "display_name": null,
|
|
480
|
+
// "deposit_fees": null,
|
|
481
|
+
// "is_risky": false,
|
|
482
|
+
// "market_cap": "144568098696.29",
|
|
483
|
+
// "category": "stable",
|
|
484
|
+
// "created_at": "2019-08-09T10:45:43.367Z",
|
|
485
|
+
// "updated_at": "2025-03-25T17:12:37.970Z",
|
|
486
|
+
// "created_by": "168",
|
|
487
|
+
// "owner_id": "1"
|
|
488
|
+
// },
|
|
450
489
|
// },
|
|
451
490
|
// "network":"https://api.hollaex.network"
|
|
452
491
|
// }
|
|
453
492
|
//
|
|
454
|
-
const coins = this.
|
|
493
|
+
const coins = this.safeDict(response, 'coins', {});
|
|
455
494
|
const keys = Object.keys(coins);
|
|
456
495
|
const result = {};
|
|
457
496
|
for (let i = 0; i < keys.length; i++) {
|
|
458
497
|
const key = keys[i];
|
|
459
498
|
const currency = coins[key];
|
|
460
499
|
const id = this.safeString(currency, 'symbol');
|
|
461
|
-
const numericId = this.safeInteger(currency, 'id');
|
|
462
500
|
const code = this.safeCurrencyCode(id);
|
|
463
|
-
const
|
|
464
|
-
const
|
|
465
|
-
const
|
|
466
|
-
const
|
|
467
|
-
const
|
|
468
|
-
const
|
|
469
|
-
|
|
470
|
-
|
|
501
|
+
const withdrawalLimits = this.safeList(currency, 'withdrawal_limits', []);
|
|
502
|
+
const rawType = this.safeString(currency, 'type');
|
|
503
|
+
const type = (rawType === 'blockchain') ? 'crypto' : 'other';
|
|
504
|
+
const rawNetworks = this.safeDict(currency, 'withdrawal_fees', {});
|
|
505
|
+
const networks = {};
|
|
506
|
+
const networkIds = Object.keys(rawNetworks);
|
|
507
|
+
for (let j = 0; j < networkIds.length; j++) {
|
|
508
|
+
const networkId = networkIds[j];
|
|
509
|
+
const networkEntry = this.safeDict(rawNetworks, networkId);
|
|
510
|
+
const networkCode = this.networkIdToCode(networkId);
|
|
511
|
+
networks[networkCode] = {
|
|
512
|
+
'id': networkId,
|
|
513
|
+
'network': networkCode,
|
|
514
|
+
'active': this.safeBool(networkEntry, 'active'),
|
|
515
|
+
'deposit': undefined,
|
|
516
|
+
'withdraw': undefined,
|
|
517
|
+
'fee': this.safeNumber(networkEntry, 'value'),
|
|
518
|
+
'precision': undefined,
|
|
519
|
+
'limits': {
|
|
520
|
+
'withdraw': {
|
|
521
|
+
'min': undefined,
|
|
522
|
+
'max': undefined,
|
|
523
|
+
},
|
|
524
|
+
},
|
|
525
|
+
'info': networkEntry,
|
|
526
|
+
};
|
|
527
|
+
}
|
|
528
|
+
result[code] = this.safeCurrencyStructure({
|
|
471
529
|
'id': id,
|
|
472
|
-
'numericId':
|
|
530
|
+
'numericId': this.safeInteger(currency, 'id'),
|
|
473
531
|
'code': code,
|
|
474
532
|
'info': currency,
|
|
475
|
-
'name':
|
|
476
|
-
'active': active,
|
|
477
|
-
'deposit':
|
|
478
|
-
'withdraw':
|
|
479
|
-
'fee':
|
|
533
|
+
'name': this.safeString(currency, 'fullname'),
|
|
534
|
+
'active': this.safeBool(currency, 'active'),
|
|
535
|
+
'deposit': this.safeBool(currency, 'allow_deposit'),
|
|
536
|
+
'withdraw': this.safeBool(currency, 'allow_withdrawal'),
|
|
537
|
+
'fee': this.safeNumber(currency, 'withdrawal_fee'),
|
|
480
538
|
'precision': this.safeNumber(currency, 'increment_unit'),
|
|
481
539
|
'limits': {
|
|
482
540
|
'amount': {
|
|
@@ -488,9 +546,9 @@ export default class hollaex extends Exchange {
|
|
|
488
546
|
'max': this.safeValue(withdrawalLimits, 0),
|
|
489
547
|
},
|
|
490
548
|
},
|
|
491
|
-
'networks':
|
|
492
|
-
'type':
|
|
493
|
-
};
|
|
549
|
+
'networks': networks,
|
|
550
|
+
'type': type,
|
|
551
|
+
});
|
|
494
552
|
}
|
|
495
553
|
return result;
|
|
496
554
|
}
|
package/js/src/htx.js
CHANGED
|
@@ -3436,9 +3436,8 @@ export default class htx extends Exchange {
|
|
|
3436
3436
|
// }
|
|
3437
3437
|
// ]
|
|
3438
3438
|
// }
|
|
3439
|
-
// }
|
|
3440
3439
|
//
|
|
3441
|
-
const data = this.
|
|
3440
|
+
const data = this.safeList(response, 'data', []);
|
|
3442
3441
|
const result = {};
|
|
3443
3442
|
this.options['networkChainIdsByNames'] = {};
|
|
3444
3443
|
this.options['networkNamesByChainIds'] = {};
|
|
@@ -3446,19 +3445,11 @@ export default class htx extends Exchange {
|
|
|
3446
3445
|
const entry = data[i];
|
|
3447
3446
|
const currencyId = this.safeString(entry, 'currency');
|
|
3448
3447
|
const code = this.safeCurrencyCode(currencyId);
|
|
3449
|
-
this.options['networkChainIdsByNames'][code] = {};
|
|
3450
|
-
const chains = this.safeValue(entry, 'chains', []);
|
|
3451
|
-
const networks = {};
|
|
3452
|
-
const instStatus = this.safeString(entry, 'instStatus');
|
|
3453
3448
|
const assetType = this.safeString(entry, 'assetType');
|
|
3454
3449
|
const type = assetType === '1' ? 'crypto' : 'fiat';
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
|
|
3458
|
-
let minWithdraw = undefined;
|
|
3459
|
-
let maxWithdraw = undefined;
|
|
3460
|
-
let deposit = false;
|
|
3461
|
-
let withdraw = false;
|
|
3450
|
+
this.options['networkChainIdsByNames'][code] = {};
|
|
3451
|
+
const chains = this.safeList(entry, 'chains', []);
|
|
3452
|
+
const networks = {};
|
|
3462
3453
|
for (let j = 0; j < chains.length; j++) {
|
|
3463
3454
|
const chainEntry = chains[j];
|
|
3464
3455
|
const uniqueChainId = this.safeString(chainEntry, 'chain'); // i.e. usdterc20, trc20usdt ...
|
|
@@ -3466,49 +3457,34 @@ export default class htx extends Exchange {
|
|
|
3466
3457
|
this.options['networkChainIdsByNames'][code][title] = uniqueChainId;
|
|
3467
3458
|
this.options['networkNamesByChainIds'][uniqueChainId] = title;
|
|
3468
3459
|
const networkCode = this.networkIdToCode(uniqueChainId);
|
|
3469
|
-
minDeposit = this.safeNumber(chainEntry, 'minDepositAmt');
|
|
3470
|
-
minWithdraw = this.safeNumber(chainEntry, 'minWithdrawAmt');
|
|
3471
|
-
maxWithdraw = this.safeNumber(chainEntry, 'maxWithdrawAmt');
|
|
3472
|
-
const withdrawStatus = this.safeString(chainEntry, 'withdrawStatus');
|
|
3473
|
-
const depositStatus = this.safeString(chainEntry, 'depositStatus');
|
|
3474
|
-
const withdrawEnabled = (withdrawStatus === 'allowed');
|
|
3475
|
-
const depositEnabled = (depositStatus === 'allowed');
|
|
3476
|
-
withdraw = (withdrawEnabled) ? withdrawEnabled : withdraw;
|
|
3477
|
-
deposit = (depositEnabled) ? depositEnabled : deposit;
|
|
3478
|
-
const active = withdrawEnabled && depositEnabled;
|
|
3479
|
-
const precision = this.parsePrecision(this.safeString(chainEntry, 'withdrawPrecision'));
|
|
3480
|
-
if (precision !== undefined) {
|
|
3481
|
-
minPrecision = (minPrecision === undefined) ? precision : Precise.stringMin(precision, minPrecision);
|
|
3482
|
-
}
|
|
3483
|
-
const fee = this.safeNumber(chainEntry, 'transactFeeWithdraw');
|
|
3484
3460
|
networks[networkCode] = {
|
|
3485
3461
|
'info': chainEntry,
|
|
3486
3462
|
'id': uniqueChainId,
|
|
3487
3463
|
'network': networkCode,
|
|
3488
3464
|
'limits': {
|
|
3489
3465
|
'deposit': {
|
|
3490
|
-
'min':
|
|
3466
|
+
'min': this.safeNumber(chainEntry, 'minDepositAmt'),
|
|
3491
3467
|
'max': undefined,
|
|
3492
3468
|
},
|
|
3493
3469
|
'withdraw': {
|
|
3494
|
-
'min':
|
|
3495
|
-
'max':
|
|
3470
|
+
'min': this.safeNumber(chainEntry, 'minWithdrawAmt'),
|
|
3471
|
+
'max': this.safeNumber(chainEntry, 'maxWithdrawAmt'),
|
|
3496
3472
|
},
|
|
3497
3473
|
},
|
|
3498
|
-
'active':
|
|
3499
|
-
'deposit':
|
|
3500
|
-
'withdraw':
|
|
3501
|
-
'fee':
|
|
3502
|
-
'precision': this.parseNumber(
|
|
3474
|
+
'active': undefined,
|
|
3475
|
+
'deposit': this.safeString(chainEntry, 'depositStatus') === 'allowed',
|
|
3476
|
+
'withdraw': this.safeString(chainEntry, 'withdrawStatus') === 'allowed',
|
|
3477
|
+
'fee': this.safeNumber(chainEntry, 'transactFeeWithdraw'),
|
|
3478
|
+
'precision': this.parseNumber(this.parsePrecision(this.safeString(chainEntry, 'withdrawPrecision'))),
|
|
3503
3479
|
};
|
|
3504
3480
|
}
|
|
3505
|
-
result[code] = {
|
|
3481
|
+
result[code] = this.safeCurrencyStructure({
|
|
3506
3482
|
'info': entry,
|
|
3507
3483
|
'code': code,
|
|
3508
3484
|
'id': currencyId,
|
|
3509
|
-
'active':
|
|
3510
|
-
'deposit':
|
|
3511
|
-
'withdraw':
|
|
3485
|
+
'active': this.safeString(entry, 'instStatus') === 'normal',
|
|
3486
|
+
'deposit': undefined,
|
|
3487
|
+
'withdraw': undefined,
|
|
3512
3488
|
'fee': undefined,
|
|
3513
3489
|
'name': undefined,
|
|
3514
3490
|
'type': type,
|
|
@@ -3518,17 +3494,17 @@ export default class htx extends Exchange {
|
|
|
3518
3494
|
'max': undefined,
|
|
3519
3495
|
},
|
|
3520
3496
|
'withdraw': {
|
|
3521
|
-
'min':
|
|
3522
|
-
'max':
|
|
3497
|
+
'min': undefined,
|
|
3498
|
+
'max': undefined,
|
|
3523
3499
|
},
|
|
3524
3500
|
'deposit': {
|
|
3525
3501
|
'min': undefined,
|
|
3526
3502
|
'max': undefined,
|
|
3527
3503
|
},
|
|
3528
3504
|
},
|
|
3529
|
-
'precision':
|
|
3505
|
+
'precision': undefined,
|
|
3530
3506
|
'networks': networks,
|
|
3531
|
-
};
|
|
3507
|
+
});
|
|
3532
3508
|
}
|
|
3533
3509
|
return result;
|
|
3534
3510
|
}
|
package/js/src/hyperliquid.js
CHANGED
|
@@ -178,12 +178,12 @@ export default class hyperliquid extends Exchange {
|
|
|
178
178
|
},
|
|
179
179
|
'fees': {
|
|
180
180
|
'swap': {
|
|
181
|
-
'taker': this.parseNumber('0.
|
|
182
|
-
'maker': this.parseNumber('0.
|
|
181
|
+
'taker': this.parseNumber('0.00045'),
|
|
182
|
+
'maker': this.parseNumber('0.00015'),
|
|
183
183
|
},
|
|
184
184
|
'spot': {
|
|
185
|
-
'taker': this.parseNumber('0.
|
|
186
|
-
'maker': this.parseNumber('0.
|
|
185
|
+
'taker': this.parseNumber('0.0007'),
|
|
186
|
+
'maker': this.parseNumber('0.0004'),
|
|
187
187
|
},
|
|
188
188
|
},
|
|
189
189
|
'requiredCredentials': {
|
package/js/src/mexc.js
CHANGED
|
@@ -1090,7 +1090,6 @@ export default class mexc extends Exchange {
|
|
|
1090
1090
|
const currency = response[i];
|
|
1091
1091
|
const id = this.safeString(currency, 'coin');
|
|
1092
1092
|
const code = this.safeCurrencyCode(id);
|
|
1093
|
-
const name = this.safeString(currency, 'name');
|
|
1094
1093
|
const networks = {};
|
|
1095
1094
|
const chains = this.safeValue(currency, 'networkList', []);
|
|
1096
1095
|
for (let j = 0; j < chains.length; j++) {
|
|
@@ -1112,13 +1111,14 @@ export default class mexc extends Exchange {
|
|
|
1112
1111
|
'max': this.safeString(chain, 'withdrawMax'),
|
|
1113
1112
|
},
|
|
1114
1113
|
},
|
|
1114
|
+
'contract': this.safeString(chain, 'contract'),
|
|
1115
1115
|
};
|
|
1116
1116
|
}
|
|
1117
1117
|
result[code] = this.safeCurrencyStructure({
|
|
1118
1118
|
'info': currency,
|
|
1119
1119
|
'id': id,
|
|
1120
1120
|
'code': code,
|
|
1121
|
-
'name': name,
|
|
1121
|
+
'name': this.safeString(currency, 'name'),
|
|
1122
1122
|
'active': undefined,
|
|
1123
1123
|
'deposit': undefined,
|
|
1124
1124
|
'withdraw': undefined,
|
package/js/src/ndax.js
CHANGED
|
@@ -455,45 +455,45 @@ export default class ndax extends Exchange {
|
|
|
455
455
|
};
|
|
456
456
|
const response = await this.publicGetGetProducts(this.extend(request, params));
|
|
457
457
|
//
|
|
458
|
-
//
|
|
459
|
-
//
|
|
460
|
-
//
|
|
461
|
-
//
|
|
462
|
-
//
|
|
463
|
-
//
|
|
464
|
-
//
|
|
465
|
-
//
|
|
466
|
-
//
|
|
467
|
-
//
|
|
468
|
-
//
|
|
469
|
-
//
|
|
470
|
-
//
|
|
471
|
-
//
|
|
458
|
+
// [
|
|
459
|
+
// {
|
|
460
|
+
// "OMSId": "1",
|
|
461
|
+
// "ProductId": "1",
|
|
462
|
+
// "Product": "BTC",
|
|
463
|
+
// "ProductFullName": "Bitcoin",
|
|
464
|
+
// "MasterDataUniqueProductSymbol": "",
|
|
465
|
+
// "ProductType": "CryptoCurrency",
|
|
466
|
+
// "DecimalPlaces": "8",
|
|
467
|
+
// "TickSize": "0.0000000100000000000000000000",
|
|
468
|
+
// "DepositEnabled": true,
|
|
469
|
+
// "WithdrawEnabled": true,
|
|
470
|
+
// "NoFees": false,
|
|
471
|
+
// "IsDisabled": false,
|
|
472
|
+
// "MarginEnabled": false
|
|
473
|
+
// },
|
|
474
|
+
// ...
|
|
472
475
|
//
|
|
473
476
|
const result = {};
|
|
474
477
|
for (let i = 0; i < response.length; i++) {
|
|
475
478
|
const currency = response[i];
|
|
476
479
|
const id = this.safeString(currency, 'ProductId');
|
|
477
|
-
const
|
|
480
|
+
const code = this.safeCurrencyCode(this.safeString(currency, 'Product'));
|
|
478
481
|
const ProductType = this.safeString(currency, 'ProductType');
|
|
479
482
|
let type = (ProductType === 'NationalCurrency') ? 'fiat' : 'crypto';
|
|
480
483
|
if (ProductType === 'Unknown') {
|
|
481
484
|
// such currency is just a blanket entry
|
|
482
485
|
type = 'other';
|
|
483
486
|
}
|
|
484
|
-
|
|
485
|
-
const isDisabled = this.safeValue(currency, 'IsDisabled');
|
|
486
|
-
const active = !isDisabled;
|
|
487
|
-
result[code] = {
|
|
487
|
+
result[code] = this.safeCurrencyStructure({
|
|
488
488
|
'id': id,
|
|
489
|
-
'name':
|
|
489
|
+
'name': this.safeString(currency, 'ProductFullName'),
|
|
490
490
|
'code': code,
|
|
491
491
|
'type': type,
|
|
492
492
|
'precision': this.safeNumber(currency, 'TickSize'),
|
|
493
493
|
'info': currency,
|
|
494
|
-
'active':
|
|
495
|
-
'deposit':
|
|
496
|
-
'withdraw':
|
|
494
|
+
'active': !this.safeBool(currency, 'IsDisabled'),
|
|
495
|
+
'deposit': this.safeBool(currency, 'DepositEnabled'),
|
|
496
|
+
'withdraw': this.safeBool(currency, 'WithdrawEnabled'),
|
|
497
497
|
'fee': undefined,
|
|
498
498
|
'limits': {
|
|
499
499
|
'amount': {
|
|
@@ -506,7 +506,8 @@ export default class ndax extends Exchange {
|
|
|
506
506
|
},
|
|
507
507
|
},
|
|
508
508
|
'networks': {},
|
|
509
|
-
|
|
509
|
+
'margin': this.safeBool(currency, 'MarginEnabled'),
|
|
510
|
+
});
|
|
510
511
|
}
|
|
511
512
|
return result;
|
|
512
513
|
}
|
package/js/src/okcoin.js
CHANGED
|
@@ -829,49 +829,30 @@ export default class okcoin extends Exchange {
|
|
|
829
829
|
}
|
|
830
830
|
else {
|
|
831
831
|
const response = await this.privateGetAssetCurrencies(params);
|
|
832
|
-
const data = this.
|
|
832
|
+
const data = this.safeList(response, 'data', []);
|
|
833
833
|
const result = {};
|
|
834
834
|
const dataByCurrencyId = this.groupBy(data, 'ccy');
|
|
835
835
|
const currencyIds = Object.keys(dataByCurrencyId);
|
|
836
836
|
for (let i = 0; i < currencyIds.length; i++) {
|
|
837
837
|
const currencyId = currencyIds[i];
|
|
838
|
-
const
|
|
839
|
-
const code = currency['code'];
|
|
838
|
+
const code = this.safeCurrencyCode(currencyId);
|
|
840
839
|
const chains = dataByCurrencyId[currencyId];
|
|
841
840
|
const networks = {};
|
|
842
|
-
let currencyActive = false;
|
|
843
|
-
let depositEnabled = false;
|
|
844
|
-
let withdrawEnabled = false;
|
|
845
|
-
let maxPrecision = undefined;
|
|
846
841
|
for (let j = 0; j < chains.length; j++) {
|
|
847
842
|
const chain = chains[j];
|
|
848
|
-
const canDeposit = this.safeValue(chain, 'canDep');
|
|
849
|
-
depositEnabled = (canDeposit) ? canDeposit : depositEnabled;
|
|
850
|
-
const canWithdraw = this.safeValue(chain, 'canWd');
|
|
851
|
-
withdrawEnabled = (canWithdraw) ? canWithdraw : withdrawEnabled;
|
|
852
|
-
const canInternal = this.safeValue(chain, 'canInternal');
|
|
853
|
-
const active = (canDeposit && canWithdraw && canInternal) ? true : false;
|
|
854
|
-
currencyActive = (active) ? active : currencyActive;
|
|
855
843
|
const networkId = this.safeString(chain, 'chain');
|
|
856
844
|
if ((networkId !== undefined) && (networkId.indexOf('-') >= 0)) {
|
|
857
845
|
const parts = networkId.split('-');
|
|
858
846
|
const chainPart = this.safeString(parts, 1, networkId);
|
|
859
847
|
const networkCode = this.networkIdToCode(chainPart);
|
|
860
|
-
const precision = this.parsePrecision(this.safeString(chain, 'wdTickSz'));
|
|
861
|
-
if (maxPrecision === undefined) {
|
|
862
|
-
maxPrecision = precision;
|
|
863
|
-
}
|
|
864
|
-
else {
|
|
865
|
-
maxPrecision = Precise.stringMin(maxPrecision, precision);
|
|
866
|
-
}
|
|
867
848
|
networks[networkCode] = {
|
|
868
849
|
'id': networkId,
|
|
869
850
|
'network': networkCode,
|
|
870
|
-
'active':
|
|
871
|
-
'deposit':
|
|
872
|
-
'withdraw':
|
|
851
|
+
'active': undefined,
|
|
852
|
+
'deposit': this.safeBool(chain, 'canDep'),
|
|
853
|
+
'withdraw': this.safeBool(chain, 'canWd'),
|
|
873
854
|
'fee': this.safeNumber(chain, 'minFee'),
|
|
874
|
-
'precision': this.parseNumber(
|
|
855
|
+
'precision': this.parseNumber(this.parsePrecision(this.safeString(chain, 'wdTickSz'))),
|
|
875
856
|
'limits': {
|
|
876
857
|
'withdraw': {
|
|
877
858
|
'min': this.safeNumber(chain, 'minWd'),
|
|
@@ -883,16 +864,16 @@ export default class okcoin extends Exchange {
|
|
|
883
864
|
}
|
|
884
865
|
}
|
|
885
866
|
const firstChain = this.safeValue(chains, 0);
|
|
886
|
-
result[code] = {
|
|
867
|
+
result[code] = this.safeCurrencyStructure({
|
|
887
868
|
'info': chains,
|
|
888
869
|
'code': code,
|
|
889
870
|
'id': currencyId,
|
|
890
871
|
'name': this.safeString(firstChain, 'name'),
|
|
891
|
-
'active':
|
|
892
|
-
'deposit':
|
|
893
|
-
'withdraw':
|
|
872
|
+
'active': undefined,
|
|
873
|
+
'deposit': undefined,
|
|
874
|
+
'withdraw': undefined,
|
|
894
875
|
'fee': undefined,
|
|
895
|
-
'precision':
|
|
876
|
+
'precision': undefined,
|
|
896
877
|
'limits': {
|
|
897
878
|
'amount': {
|
|
898
879
|
'min': undefined,
|
|
@@ -900,7 +881,7 @@ export default class okcoin extends Exchange {
|
|
|
900
881
|
},
|
|
901
882
|
},
|
|
902
883
|
'networks': networks,
|
|
903
|
-
};
|
|
884
|
+
});
|
|
904
885
|
}
|
|
905
886
|
return result;
|
|
906
887
|
}
|
package/js/src/okx.js
CHANGED
|
@@ -366,6 +366,7 @@ export default class okx extends Exchange {
|
|
|
366
366
|
'account/spot-manual-borrow-repay': 10,
|
|
367
367
|
'account/set-auto-repay': 4,
|
|
368
368
|
'account/spot-borrow-repay-history': 4,
|
|
369
|
+
'account/move-positions-history': 10,
|
|
369
370
|
// subaccount
|
|
370
371
|
'users/subaccount/list': 10,
|
|
371
372
|
'account/subaccount/balances': 10 / 3,
|
|
@@ -503,6 +504,7 @@ export default class okx extends Exchange {
|
|
|
503
504
|
'account/fixed-loan/manual-reborrow': 5,
|
|
504
505
|
'account/fixed-loan/repay-borrowing-order': 5,
|
|
505
506
|
'account/bills-history-archive': 72000,
|
|
507
|
+
'account/move-positions': 10,
|
|
506
508
|
// subaccount
|
|
507
509
|
'users/subaccount/modify-apikey': 10,
|
|
508
510
|
'asset/subaccount/transfer': 10,
|
|
@@ -969,6 +971,13 @@ export default class okx extends Exchange {
|
|
|
969
971
|
'70010': BadRequest,
|
|
970
972
|
'70013': BadRequest,
|
|
971
973
|
'70016': BadRequest,
|
|
974
|
+
'70060': BadRequest,
|
|
975
|
+
'70061': BadRequest,
|
|
976
|
+
'70062': BadRequest,
|
|
977
|
+
'70064': BadRequest,
|
|
978
|
+
'70065': BadRequest,
|
|
979
|
+
'70066': BadRequest,
|
|
980
|
+
'70067': BadRequest,
|
|
972
981
|
'1009': BadRequest,
|
|
973
982
|
'4001': AuthenticationError,
|
|
974
983
|
'4002': BadRequest,
|
package/js/src/onetrading.js
CHANGED
|
@@ -395,9 +395,12 @@ export default class onetrading extends Exchange {
|
|
|
395
395
|
//
|
|
396
396
|
// [
|
|
397
397
|
// {
|
|
398
|
-
// "code":"
|
|
399
|
-
// "precision":
|
|
400
|
-
//
|
|
398
|
+
// "code": "USDT",
|
|
399
|
+
// "precision": 6,
|
|
400
|
+
// "unified_cryptoasset_id": 825,
|
|
401
|
+
// "name": "Tether USDt",
|
|
402
|
+
// "collateral_percentage": 0
|
|
403
|
+
// },
|
|
401
404
|
// ]
|
|
402
405
|
//
|
|
403
406
|
const result = {};
|
|
@@ -405,10 +408,10 @@ export default class onetrading extends Exchange {
|
|
|
405
408
|
const currency = response[i];
|
|
406
409
|
const id = this.safeString(currency, 'code');
|
|
407
410
|
const code = this.safeCurrencyCode(id);
|
|
408
|
-
result[code] = {
|
|
411
|
+
result[code] = this.safeCurrencyStructure({
|
|
409
412
|
'id': id,
|
|
410
413
|
'code': code,
|
|
411
|
-
'name':
|
|
414
|
+
'name': this.safeString(currency, 'name'),
|
|
412
415
|
'info': currency,
|
|
413
416
|
'active': undefined,
|
|
414
417
|
'fee': undefined,
|
|
@@ -420,7 +423,7 @@ export default class onetrading extends Exchange {
|
|
|
420
423
|
'withdraw': { 'min': undefined, 'max': undefined },
|
|
421
424
|
},
|
|
422
425
|
'networks': {},
|
|
423
|
-
};
|
|
426
|
+
});
|
|
424
427
|
}
|
|
425
428
|
return result;
|
|
426
429
|
}
|