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
package/js/src/hitbtc.js
CHANGED
|
@@ -920,29 +920,46 @@ export default class hitbtc extends Exchange {
|
|
|
920
920
|
async fetchCurrencies(params = {}) {
|
|
921
921
|
const response = await this.publicGetPublicCurrency(params);
|
|
922
922
|
//
|
|
923
|
-
//
|
|
924
|
-
//
|
|
925
|
-
//
|
|
926
|
-
//
|
|
927
|
-
//
|
|
928
|
-
//
|
|
929
|
-
//
|
|
930
|
-
//
|
|
931
|
-
//
|
|
932
|
-
//
|
|
933
|
-
//
|
|
934
|
-
//
|
|
935
|
-
//
|
|
936
|
-
//
|
|
937
|
-
//
|
|
938
|
-
//
|
|
939
|
-
//
|
|
940
|
-
//
|
|
941
|
-
//
|
|
942
|
-
//
|
|
943
|
-
//
|
|
944
|
-
//
|
|
945
|
-
//
|
|
923
|
+
// {
|
|
924
|
+
// "DFC": {
|
|
925
|
+
// "full_name": "DeFiScale",
|
|
926
|
+
// "crypto": true,
|
|
927
|
+
// "payin_enabled": false,
|
|
928
|
+
// "payout_enabled": true,
|
|
929
|
+
// "transfer_enabled": false,
|
|
930
|
+
// "transfer_to_wallet_enabled": true,
|
|
931
|
+
// "transfer_to_exchange_enabled": false,
|
|
932
|
+
// "sign": "D",
|
|
933
|
+
// "crypto_payment_id_name": "",
|
|
934
|
+
// "crypto_explorer": "https://etherscan.io/tx/{tx}",
|
|
935
|
+
// "precision_transfer": "0.00000001",
|
|
936
|
+
// "delisted": false,
|
|
937
|
+
// "networks": [
|
|
938
|
+
// {
|
|
939
|
+
// "code": "ETH",
|
|
940
|
+
// "network_name": "Ethereum",
|
|
941
|
+
// "network": "ETH",
|
|
942
|
+
// "protocol": "ERC-20",
|
|
943
|
+
// "default": true,
|
|
944
|
+
// "is_ens_available": true,
|
|
945
|
+
// "payin_enabled": true,
|
|
946
|
+
// "payout_enabled": true,
|
|
947
|
+
// "precision_payout": "0.000000000000000001",
|
|
948
|
+
// "payout_fee": "277000.0000000000",
|
|
949
|
+
// "payout_is_payment_id": false,
|
|
950
|
+
// "payin_payment_id": false,
|
|
951
|
+
// "payin_confirmations": "2",
|
|
952
|
+
// "contract_address": "0x1b2a76da77d03b7fc21189d9838f55bd849014af",
|
|
953
|
+
// "crypto_payment_id_name": "",
|
|
954
|
+
// "crypto_explorer": "https://etherscan.io/tx/{tx}",
|
|
955
|
+
// "is_multichain": true,
|
|
956
|
+
// "asset_id": {
|
|
957
|
+
// "contract_address": "0x1b2a76da77d03b7fc21189d9838f55bd849014af"
|
|
958
|
+
// }
|
|
959
|
+
// }
|
|
960
|
+
// ]
|
|
961
|
+
// },
|
|
962
|
+
// }
|
|
946
963
|
//
|
|
947
964
|
const result = {};
|
|
948
965
|
const currencies = Object.keys(response);
|
|
@@ -950,50 +967,22 @@ export default class hitbtc extends Exchange {
|
|
|
950
967
|
const currencyId = currencies[i];
|
|
951
968
|
const code = this.safeCurrencyCode(currencyId);
|
|
952
969
|
const entry = response[currencyId];
|
|
953
|
-
const
|
|
954
|
-
const precision = this.safeNumber(entry, 'precision_transfer');
|
|
955
|
-
const payinEnabled = this.safeBool(entry, 'payin_enabled', false);
|
|
956
|
-
const payoutEnabled = this.safeBool(entry, 'payout_enabled', false);
|
|
957
|
-
const transferEnabled = this.safeBool(entry, 'transfer_enabled', false);
|
|
958
|
-
const active = payinEnabled && payoutEnabled && transferEnabled;
|
|
959
|
-
const rawNetworks = this.safeValue(entry, 'networks', []);
|
|
960
|
-
const isCrypto = this.safeBool(entry, 'crypto');
|
|
961
|
-
const type = isCrypto ? 'crypto' : 'fiat';
|
|
970
|
+
const rawNetworks = this.safeList(entry, 'networks', []);
|
|
962
971
|
const networks = {};
|
|
963
|
-
let fee = undefined;
|
|
964
|
-
let depositEnabled = undefined;
|
|
965
|
-
let withdrawEnabled = undefined;
|
|
966
972
|
for (let j = 0; j < rawNetworks.length; j++) {
|
|
967
973
|
const rawNetwork = rawNetworks[j];
|
|
968
974
|
const networkId = this.safeString2(rawNetwork, 'protocol', 'network');
|
|
969
975
|
let networkCode = this.networkIdToCode(networkId);
|
|
970
|
-
networkCode = (networkCode !== undefined) ? networkCode.toUpperCase() :
|
|
971
|
-
fee = this.safeNumber(rawNetwork, 'payout_fee');
|
|
972
|
-
const networkPrecision = this.safeNumber(rawNetwork, 'precision_payout');
|
|
973
|
-
const payinEnabledNetwork = this.safeBool(rawNetwork, 'payin_enabled', false);
|
|
974
|
-
const payoutEnabledNetwork = this.safeBool(rawNetwork, 'payout_enabled', false);
|
|
975
|
-
const activeNetwork = payinEnabledNetwork && payoutEnabledNetwork;
|
|
976
|
-
if (payinEnabledNetwork && !depositEnabled) {
|
|
977
|
-
depositEnabled = true;
|
|
978
|
-
}
|
|
979
|
-
else if (!payinEnabledNetwork) {
|
|
980
|
-
depositEnabled = false;
|
|
981
|
-
}
|
|
982
|
-
if (payoutEnabledNetwork && !withdrawEnabled) {
|
|
983
|
-
withdrawEnabled = true;
|
|
984
|
-
}
|
|
985
|
-
else if (!payoutEnabledNetwork) {
|
|
986
|
-
withdrawEnabled = false;
|
|
987
|
-
}
|
|
976
|
+
networkCode = (networkCode !== undefined) ? networkCode.toUpperCase() : code; // as hitbtc is white label, ensure we safeguard from possible bugs
|
|
988
977
|
networks[networkCode] = {
|
|
989
978
|
'info': rawNetwork,
|
|
990
979
|
'id': networkId,
|
|
991
980
|
'network': networkCode,
|
|
992
|
-
'
|
|
993
|
-
'
|
|
994
|
-
'deposit':
|
|
995
|
-
'withdraw':
|
|
996
|
-
'precision':
|
|
981
|
+
'active': undefined,
|
|
982
|
+
'fee': this.safeNumber(rawNetwork, 'payout_fee'),
|
|
983
|
+
'deposit': this.safeBool(rawNetwork, 'payin_enabled'),
|
|
984
|
+
'withdraw': this.safeBool(rawNetwork, 'payout_enabled'),
|
|
985
|
+
'precision': this.safeNumber(rawNetwork, 'precision_payout'),
|
|
997
986
|
'limits': {
|
|
998
987
|
'withdraw': {
|
|
999
988
|
'min': undefined,
|
|
@@ -1002,27 +991,25 @@ export default class hitbtc extends Exchange {
|
|
|
1002
991
|
},
|
|
1003
992
|
};
|
|
1004
993
|
}
|
|
1005
|
-
|
|
1006
|
-
const networksLength = networksKeys.length;
|
|
1007
|
-
result[code] = {
|
|
994
|
+
result[code] = this.safeCurrencyStructure({
|
|
1008
995
|
'info': entry,
|
|
1009
996
|
'code': code,
|
|
1010
997
|
'id': currencyId,
|
|
1011
|
-
'precision':
|
|
1012
|
-
'name':
|
|
1013
|
-
'active':
|
|
1014
|
-
'deposit':
|
|
1015
|
-
'withdraw':
|
|
998
|
+
'precision': this.safeNumber(entry, 'precision_transfer'),
|
|
999
|
+
'name': this.safeString(entry, 'full_name'),
|
|
1000
|
+
'active': !this.safeBool(entry, 'delisted'),
|
|
1001
|
+
'deposit': this.safeBool(entry, 'payin_enabled'),
|
|
1002
|
+
'withdraw': this.safeBool(entry, 'payout_enabled'),
|
|
1016
1003
|
'networks': networks,
|
|
1017
|
-
'fee':
|
|
1004
|
+
'fee': undefined,
|
|
1018
1005
|
'limits': {
|
|
1019
1006
|
'amount': {
|
|
1020
1007
|
'min': undefined,
|
|
1021
1008
|
'max': undefined,
|
|
1022
1009
|
},
|
|
1023
1010
|
},
|
|
1024
|
-
'type':
|
|
1025
|
-
};
|
|
1011
|
+
'type': undefined, // 'crypto' field emits incorrect values
|
|
1012
|
+
});
|
|
1026
1013
|
}
|
|
1027
1014
|
return result;
|
|
1028
1015
|
}
|
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': {
|
|
@@ -360,7 +360,7 @@ export default class hyperliquid extends Exchange {
|
|
|
360
360
|
const id = i;
|
|
361
361
|
const name = this.safeString(data, 'name');
|
|
362
362
|
const code = this.safeCurrencyCode(name);
|
|
363
|
-
result[code] = {
|
|
363
|
+
result[code] = this.safeCurrencyStructure({
|
|
364
364
|
'id': id,
|
|
365
365
|
'name': name,
|
|
366
366
|
'code': code,
|
|
@@ -382,7 +382,7 @@ export default class hyperliquid extends Exchange {
|
|
|
382
382
|
'max': undefined,
|
|
383
383
|
},
|
|
384
384
|
},
|
|
385
|
-
};
|
|
385
|
+
});
|
|
386
386
|
}
|
|
387
387
|
return result;
|
|
388
388
|
}
|
package/js/src/kraken.js
CHANGED
|
@@ -1649,6 +1649,8 @@ export default class kraken extends Exchange {
|
|
|
1649
1649
|
'volume': this.amountToPrecision(symbol, amount),
|
|
1650
1650
|
};
|
|
1651
1651
|
const orderRequest = this.orderRequest('createOrder', symbol, type, request, amount, price, params);
|
|
1652
|
+
const flags = this.safeString(orderRequest[0], 'oflags', '');
|
|
1653
|
+
const isUsingCost = flags.indexOf('viqc') > -1;
|
|
1652
1654
|
const response = await this.privatePostAddOrder(this.extend(orderRequest[0], orderRequest[1]));
|
|
1653
1655
|
//
|
|
1654
1656
|
// {
|
|
@@ -1660,6 +1662,10 @@ export default class kraken extends Exchange {
|
|
|
1660
1662
|
// }
|
|
1661
1663
|
//
|
|
1662
1664
|
const result = this.safeDict(response, 'result');
|
|
1665
|
+
result['usingCost'] = isUsingCost;
|
|
1666
|
+
// it's impossible to know if the order was created using cost or base currency
|
|
1667
|
+
// becuase kraken only returns something like this: { order: 'buy 10.00000000 LTCUSD @ market' }
|
|
1668
|
+
// this usingCost flag is used to help the parsing but omited from the order
|
|
1663
1669
|
return this.parseOrder(result);
|
|
1664
1670
|
}
|
|
1665
1671
|
findMarketByAltnameOrId(id) {
|
|
@@ -1752,22 +1758,15 @@ export default class kraken extends Exchange {
|
|
|
1752
1758
|
// }
|
|
1753
1759
|
//
|
|
1754
1760
|
// ws - createOrder
|
|
1755
|
-
//
|
|
1756
|
-
//
|
|
1757
|
-
//
|
|
1758
|
-
//
|
|
1759
|
-
// "status": 'ok',
|
|
1760
|
-
// "txid": 'OAVXZH-XIE54-JCYYDG'
|
|
1761
|
-
// }
|
|
1761
|
+
// {
|
|
1762
|
+
// "order_id": "OXM2QD-EALR2-YBAVEU"
|
|
1763
|
+
// }
|
|
1764
|
+
//
|
|
1762
1765
|
// ws - editOrder
|
|
1763
|
-
//
|
|
1764
|
-
//
|
|
1765
|
-
//
|
|
1766
|
-
//
|
|
1767
|
-
// "reqid": 3,
|
|
1768
|
-
// "status": "ok",
|
|
1769
|
-
// "txid": "OTI672-HJFAO-XOIPPK"
|
|
1770
|
-
// }
|
|
1766
|
+
// {
|
|
1767
|
+
// "amend_id": "TJSMEH-AA67V-YUSQ6O",
|
|
1768
|
+
// "order_id": "OXM2QD-EALR2-YBAVEU"
|
|
1769
|
+
// }
|
|
1771
1770
|
//
|
|
1772
1771
|
// {
|
|
1773
1772
|
// "error": [],
|
|
@@ -1835,6 +1834,8 @@ export default class kraken extends Exchange {
|
|
|
1835
1834
|
// "oflags": "fciq"
|
|
1836
1835
|
// }
|
|
1837
1836
|
//
|
|
1837
|
+
const isUsingCost = this.safeBool(order, 'usingCost', false);
|
|
1838
|
+
order = this.omit(order, 'usingCost');
|
|
1838
1839
|
const description = this.safeDict(order, 'descr', {});
|
|
1839
1840
|
const orderDescriptionObj = this.safeDict(order, 'descr'); // can be null
|
|
1840
1841
|
let orderDescription = undefined;
|
|
@@ -1849,11 +1850,17 @@ export default class kraken extends Exchange {
|
|
|
1849
1850
|
let marketId = undefined;
|
|
1850
1851
|
let price = undefined;
|
|
1851
1852
|
let amount = undefined;
|
|
1853
|
+
let cost = undefined;
|
|
1852
1854
|
let triggerPrice = undefined;
|
|
1853
1855
|
if (orderDescription !== undefined) {
|
|
1854
1856
|
const parts = orderDescription.split(' ');
|
|
1855
1857
|
side = this.safeString(parts, 0);
|
|
1856
|
-
|
|
1858
|
+
if (!isUsingCost) {
|
|
1859
|
+
amount = this.safeString(parts, 1);
|
|
1860
|
+
}
|
|
1861
|
+
else {
|
|
1862
|
+
cost = this.safeString(parts, 1);
|
|
1863
|
+
}
|
|
1857
1864
|
marketId = this.safeString(parts, 2);
|
|
1858
1865
|
const part4 = this.safeString(parts, 4);
|
|
1859
1866
|
const part5 = this.safeString(parts, 5);
|
|
@@ -1890,15 +1897,13 @@ export default class kraken extends Exchange {
|
|
|
1890
1897
|
// kraken truncates the cost in the api response so we will ignore it and calculate it from average & filled
|
|
1891
1898
|
// const cost = this.safeString (order, 'cost');
|
|
1892
1899
|
price = this.safeString(description, 'price', price);
|
|
1893
|
-
// when type =
|
|
1894
|
-
if ((price !== undefined) && price.endsWith('%')) {
|
|
1900
|
+
// when type = trailing stop returns price = '+50.0000%'
|
|
1901
|
+
if ((price !== undefined) && (price.endsWith('%') || Precise.stringEquals(price, '0.00000') || Precise.stringEquals(price, '0'))) {
|
|
1895
1902
|
price = undefined; // this is not the price we want
|
|
1896
1903
|
}
|
|
1897
|
-
if (
|
|
1904
|
+
if (price === undefined) {
|
|
1898
1905
|
price = this.safeString(description, 'price2');
|
|
1899
|
-
|
|
1900
|
-
if ((price === undefined) || Precise.stringEquals(price, '0')) {
|
|
1901
|
-
price = this.safeString(order, 'price', price);
|
|
1906
|
+
price = this.safeString2(order, 'limitprice', 'price', price);
|
|
1902
1907
|
}
|
|
1903
1908
|
const flags = this.safeString(order, 'oflags', '');
|
|
1904
1909
|
let isPostOnly = flags.indexOf('post') > -1;
|
|
@@ -1920,7 +1925,7 @@ export default class kraken extends Exchange {
|
|
|
1920
1925
|
}
|
|
1921
1926
|
}
|
|
1922
1927
|
const status = this.parseOrderStatus(this.safeString(order, 'status'));
|
|
1923
|
-
let id = this.safeStringN(order, ['id', 'txid', 'amend_id']);
|
|
1928
|
+
let id = this.safeStringN(order, ['id', 'txid', 'order_id', 'amend_id']);
|
|
1924
1929
|
if ((id === undefined) || (id.startsWith('['))) {
|
|
1925
1930
|
const txid = this.safeList(order, 'txid');
|
|
1926
1931
|
id = this.safeString(txid, 0);
|
|
@@ -1988,7 +1993,7 @@ export default class kraken extends Exchange {
|
|
|
1988
1993
|
'triggerPrice': triggerPrice,
|
|
1989
1994
|
'takeProfitPrice': takeProfitPrice,
|
|
1990
1995
|
'stopLossPrice': stopLossPrice,
|
|
1991
|
-
'cost':
|
|
1996
|
+
'cost': cost,
|
|
1992
1997
|
'amount': amount,
|
|
1993
1998
|
'filled': filled,
|
|
1994
1999
|
'average': average,
|
|
@@ -184,6 +184,7 @@ export default class kucoinfutures extends kucoin {
|
|
|
184
184
|
* @param {string} [params.timeInForce] GTC, GTT, IOC, or FOK, default is GTC, limit orders only
|
|
185
185
|
* @param {string} [params.postOnly] Post only flag, invalid when timeInForce is IOC or FOK
|
|
186
186
|
* @param {float} [params.cost] the cost of the order in units of USDT
|
|
187
|
+
* @param {string} [params.marginMode] 'cross' or 'isolated', default is 'isolated'
|
|
187
188
|
* ----------------- Exchange Specific Parameters -----------------
|
|
188
189
|
* @param {float} [params.leverage] Leverage size of the order (mandatory param in request, default is 1)
|
|
189
190
|
* @param {string} [params.clientOid] client order id, defaults to uuid if not passed
|