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
package/js/src/gate.js
CHANGED
|
@@ -111,7 +111,7 @@ export default class gate extends Exchange {
|
|
|
111
111
|
'fetchCurrencies': true,
|
|
112
112
|
'fetchDepositAddress': true,
|
|
113
113
|
'fetchDepositAddresses': false,
|
|
114
|
-
'fetchDepositAddressesByNetwork':
|
|
114
|
+
'fetchDepositAddressesByNetwork': true,
|
|
115
115
|
'fetchDeposits': true,
|
|
116
116
|
'fetchDepositWithdrawFee': 'emulated',
|
|
117
117
|
'fetchDepositWithdrawFees': true,
|
|
@@ -720,6 +720,16 @@ export default class gate extends Exchange {
|
|
|
720
720
|
},
|
|
721
721
|
'networksById': {
|
|
722
722
|
'OPETH': 'OP',
|
|
723
|
+
'ETH': 'ERC20',
|
|
724
|
+
'ERC20': 'ERC20',
|
|
725
|
+
'TRX': 'TRC20',
|
|
726
|
+
'TRC20': 'TRC20',
|
|
727
|
+
'HT': 'HRC20',
|
|
728
|
+
'HECO': 'HRC20',
|
|
729
|
+
'BSC': 'BEP20',
|
|
730
|
+
'BEP20': 'BEP20',
|
|
731
|
+
'POLYGON': 'MATIC',
|
|
732
|
+
'POL': 'MATIC',
|
|
723
733
|
},
|
|
724
734
|
'timeInForce': {
|
|
725
735
|
'GTC': 'gtc',
|
|
@@ -1216,6 +1226,9 @@ export default class gate extends Exchange {
|
|
|
1216
1226
|
if (this.options['adjustForTimeDifference']) {
|
|
1217
1227
|
await this.loadTimeDifference();
|
|
1218
1228
|
}
|
|
1229
|
+
if (this.checkRequiredCredentials(false)) {
|
|
1230
|
+
await this.loadUnifiedStatus();
|
|
1231
|
+
}
|
|
1219
1232
|
const sandboxMode = this.safeBool(this.options, 'sandboxMode', false);
|
|
1220
1233
|
let rawPromises = [
|
|
1221
1234
|
this.fetchContractMarkets(params),
|
|
@@ -1829,88 +1842,93 @@ export default class gate extends Exchange {
|
|
|
1829
1842
|
if (apiBackup !== undefined) {
|
|
1830
1843
|
return undefined;
|
|
1831
1844
|
}
|
|
1832
|
-
if (this.checkRequiredCredentials(false)) {
|
|
1833
|
-
await this.loadUnifiedStatus();
|
|
1834
|
-
}
|
|
1835
1845
|
const response = await this.publicSpotGetCurrencies(params);
|
|
1836
1846
|
//
|
|
1837
|
-
//
|
|
1838
|
-
//
|
|
1839
|
-
//
|
|
1840
|
-
//
|
|
1841
|
-
//
|
|
1842
|
-
//
|
|
1843
|
-
//
|
|
1844
|
-
//
|
|
1845
|
-
//
|
|
1846
|
-
//
|
|
1847
|
-
//
|
|
1848
|
-
//
|
|
1847
|
+
// [
|
|
1848
|
+
// {
|
|
1849
|
+
// "currency": "USDT",
|
|
1850
|
+
// "name": "Tether",
|
|
1851
|
+
// "delisted": false,
|
|
1852
|
+
// "withdraw_disabled": false,
|
|
1853
|
+
// "withdraw_delayed": false,
|
|
1854
|
+
// "deposit_disabled": false,
|
|
1855
|
+
// "trade_disabled": false,
|
|
1856
|
+
// "fixed_rate": "",
|
|
1857
|
+
// "chain": "ETH",
|
|
1858
|
+
// "chains": [
|
|
1859
|
+
// {
|
|
1860
|
+
// "name": "ETH",
|
|
1861
|
+
// "addr": "0xdAC17F958D2ee523a2206206994597C13D831ec7",
|
|
1862
|
+
// "withdraw_disabled": false,
|
|
1863
|
+
// "withdraw_delayed": false,
|
|
1864
|
+
// "deposit_disabled": false
|
|
1865
|
+
// },
|
|
1866
|
+
// {
|
|
1867
|
+
// "name": "ARBEVM",
|
|
1868
|
+
// "addr": "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",
|
|
1869
|
+
// "withdraw_disabled": false,
|
|
1870
|
+
// "withdraw_delayed": false,
|
|
1871
|
+
// "deposit_disabled": false
|
|
1872
|
+
// },
|
|
1873
|
+
// {
|
|
1874
|
+
// "name": "BSC",
|
|
1875
|
+
// "addr": "0x55d398326f99059fF775485246999027B3197955",
|
|
1876
|
+
// "withdraw_disabled": false,
|
|
1877
|
+
// "withdraw_delayed": false,
|
|
1878
|
+
// "deposit_disabled": false
|
|
1879
|
+
// },
|
|
1880
|
+
// ]
|
|
1881
|
+
// },
|
|
1882
|
+
// ]
|
|
1849
1883
|
//
|
|
1850
1884
|
const indexedCurrencies = this.indexBy(response, 'currency');
|
|
1851
1885
|
const result = {};
|
|
1852
1886
|
for (let i = 0; i < response.length; i++) {
|
|
1853
1887
|
const entry = response[i];
|
|
1854
1888
|
const currencyId = this.safeString(entry, 'currency');
|
|
1855
|
-
const
|
|
1856
|
-
const partFirst = this.safeString(parts, 0);
|
|
1857
|
-
// if there's an underscore then the second part is always the chain name (except the _OLD suffix)
|
|
1858
|
-
const currencyName = currencyId.endsWith('_OLD') ? currencyId : partFirst;
|
|
1859
|
-
const withdrawDisabled = this.safeBool(entry, 'withdraw_disabled', false);
|
|
1860
|
-
const depositDisabled = this.safeBool(entry, 'deposit_disabled', false);
|
|
1861
|
-
const tradeDisabled = this.safeBool(entry, 'trade_disabled', false);
|
|
1862
|
-
const precision = this.parseNumber('0.0001'); // temporary safe default, because no value provided from API
|
|
1863
|
-
const code = this.safeCurrencyCode(currencyName);
|
|
1889
|
+
const code = this.safeCurrencyCode(currencyId);
|
|
1864
1890
|
// check leveraged tokens (e.g. BTC3S, ETH5L)
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
'
|
|
1882
|
-
'
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
'
|
|
1887
|
-
|
|
1891
|
+
const type = this.isLeveragedCurrency(currencyId, true, indexedCurrencies) ? 'leveraged' : 'crypto';
|
|
1892
|
+
const chains = this.safeList(entry, 'chains', []);
|
|
1893
|
+
const networks = {};
|
|
1894
|
+
for (let j = 0; j < chains.length; j++) {
|
|
1895
|
+
const chain = chains[j];
|
|
1896
|
+
const networkId = this.safeString(chain, 'name');
|
|
1897
|
+
const networkCode = this.networkIdToCode(networkId);
|
|
1898
|
+
networks[networkCode] = {
|
|
1899
|
+
'info': chain,
|
|
1900
|
+
'id': networkId,
|
|
1901
|
+
'network': networkCode,
|
|
1902
|
+
'active': undefined,
|
|
1903
|
+
'deposit': !this.safeBool(chain, 'deposit_disabled'),
|
|
1904
|
+
'withdraw': !this.safeBool(chain, 'withdraw_disabled'),
|
|
1905
|
+
'fee': undefined,
|
|
1906
|
+
'precision': this.parseNumber('0.0001'),
|
|
1907
|
+
'limits': {
|
|
1908
|
+
'deposit': {
|
|
1909
|
+
'min': undefined,
|
|
1910
|
+
'max': undefined,
|
|
1911
|
+
},
|
|
1912
|
+
'withdraw': {
|
|
1913
|
+
'min': undefined,
|
|
1914
|
+
'max': undefined,
|
|
1915
|
+
},
|
|
1888
1916
|
},
|
|
1889
|
-
},
|
|
1890
|
-
'active': !tradeDisabled,
|
|
1891
|
-
'deposit': !depositDisabled,
|
|
1892
|
-
'withdraw': !withdrawDisabled,
|
|
1893
|
-
'fee': undefined,
|
|
1894
|
-
'precision': precision,
|
|
1895
|
-
};
|
|
1896
|
-
// check if first entry for the specific currency
|
|
1897
|
-
if (!(code in result)) {
|
|
1898
|
-
result[code] = {
|
|
1899
|
-
'id': currencyName,
|
|
1900
|
-
'lowerCaseId': currencyName.toLowerCase(),
|
|
1901
|
-
'code': code,
|
|
1902
|
-
'type': type,
|
|
1903
|
-
'precision': precision,
|
|
1904
|
-
'limits': undefined,
|
|
1905
|
-
'networks': {},
|
|
1906
|
-
'info': [], // will be filled below
|
|
1907
1917
|
};
|
|
1908
1918
|
}
|
|
1909
|
-
result[code]
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1919
|
+
result[code] = this.safeCurrencyStructure({
|
|
1920
|
+
'id': currencyId,
|
|
1921
|
+
'code': code,
|
|
1922
|
+
'name': this.safeString(entry, 'name'),
|
|
1923
|
+
'type': type,
|
|
1924
|
+
'active': !this.safeBool(entry, 'delisted'),
|
|
1925
|
+
'deposit': !this.safeBool(entry, 'deposit_disabled'),
|
|
1926
|
+
'withdraw': !this.safeBool(entry, 'withdraw_disabled'),
|
|
1927
|
+
'fee': undefined,
|
|
1928
|
+
'networks': networks,
|
|
1929
|
+
'precision': this.parseNumber('0.0001'),
|
|
1930
|
+
'info': entry,
|
|
1931
|
+
});
|
|
1914
1932
|
}
|
|
1915
1933
|
return result;
|
|
1916
1934
|
}
|
|
@@ -2182,9 +2200,7 @@ export default class gate extends Exchange {
|
|
|
2182
2200
|
const chains = this.safeValue(response, 'multichain_addresses', []);
|
|
2183
2201
|
const currencyId = this.safeString(response, 'currency');
|
|
2184
2202
|
currency = this.safeCurrency(currencyId, currency);
|
|
2185
|
-
const parsed = this.parseDepositAddresses(chains,
|
|
2186
|
-
'currency': currency['id'],
|
|
2187
|
-
});
|
|
2203
|
+
const parsed = this.parseDepositAddresses(chains, undefined, false);
|
|
2188
2204
|
return this.indexBy(parsed, 'network');
|
|
2189
2205
|
}
|
|
2190
2206
|
/**
|
|
@@ -2202,8 +2218,8 @@ export default class gate extends Exchange {
|
|
|
2202
2218
|
let networkCode = undefined;
|
|
2203
2219
|
[networkCode, params] = this.handleNetworkCodeAndParams(params);
|
|
2204
2220
|
const chainsIndexedById = await this.fetchDepositAddressesByNetwork(code, params);
|
|
2205
|
-
const
|
|
2206
|
-
return chainsIndexedById[
|
|
2221
|
+
const selectedNetworkIdOrCode = this.selectNetworkCodeFromUnifiedNetworks(code, networkCode, chainsIndexedById);
|
|
2222
|
+
return chainsIndexedById[selectedNetworkIdOrCode];
|
|
2207
2223
|
}
|
|
2208
2224
|
parseDepositAddress(depositAddress, currency = undefined) {
|
|
2209
2225
|
//
|
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
|
}
|
|
@@ -4567,6 +4543,8 @@ export default class htx extends Exchange {
|
|
|
4567
4543
|
const request = {};
|
|
4568
4544
|
let marketType = undefined;
|
|
4569
4545
|
[marketType, params] = this.handleMarketTypeAndParams('fetchOpenOrders', market, params);
|
|
4546
|
+
let subType = undefined;
|
|
4547
|
+
[subType, params] = this.handleSubTypeAndParams('fetchOpenOrders', market, params, 'linear');
|
|
4570
4548
|
let response = undefined;
|
|
4571
4549
|
if (marketType === 'spot') {
|
|
4572
4550
|
if (symbol !== undefined) {
|
|
@@ -4595,18 +4573,18 @@ export default class htx extends Exchange {
|
|
|
4595
4573
|
response = await this.spotPrivateGetV1OrderOpenOrders(this.extend(request, params));
|
|
4596
4574
|
}
|
|
4597
4575
|
else {
|
|
4598
|
-
if (symbol
|
|
4599
|
-
throw new ArgumentsRequired(this.id + ' fetchOpenOrders() requires a symbol argument');
|
|
4576
|
+
if (symbol !== undefined) {
|
|
4577
|
+
// throw new ArgumentsRequired (this.id + ' fetchOpenOrders() requires a symbol argument');
|
|
4578
|
+
request['contract_code'] = market['id'];
|
|
4600
4579
|
}
|
|
4601
4580
|
if (limit !== undefined) {
|
|
4602
4581
|
request['page_size'] = limit;
|
|
4603
4582
|
}
|
|
4604
|
-
request['contract_code'] = market['id'];
|
|
4605
4583
|
const trigger = this.safeBool2(params, 'stop', 'trigger');
|
|
4606
4584
|
const stopLossTakeProfit = this.safeValue(params, 'stopLossTakeProfit');
|
|
4607
4585
|
const trailing = this.safeBool(params, 'trailing', false);
|
|
4608
4586
|
params = this.omit(params, ['stop', 'stopLossTakeProfit', 'trailing', 'trigger']);
|
|
4609
|
-
if (
|
|
4587
|
+
if (subType === 'linear') {
|
|
4610
4588
|
let marginMode = undefined;
|
|
4611
4589
|
[marginMode, params] = this.handleMarginModeAndParams('fetchOpenOrders', params);
|
|
4612
4590
|
marginMode = (marginMode === undefined) ? 'cross' : marginMode;
|
|
@@ -4639,8 +4617,8 @@ export default class htx extends Exchange {
|
|
|
4639
4617
|
}
|
|
4640
4618
|
}
|
|
4641
4619
|
}
|
|
4642
|
-
else if (
|
|
4643
|
-
if (
|
|
4620
|
+
else if (subType === 'inverse') {
|
|
4621
|
+
if (marketType === 'swap') {
|
|
4644
4622
|
if (trigger) {
|
|
4645
4623
|
response = await this.contractPrivatePostSwapApiV1SwapTriggerOpenorders(this.extend(request, params));
|
|
4646
4624
|
}
|
|
@@ -4654,8 +4632,8 @@ export default class htx extends Exchange {
|
|
|
4654
4632
|
response = await this.contractPrivatePostSwapApiV1SwapOpenorders(this.extend(request, params));
|
|
4655
4633
|
}
|
|
4656
4634
|
}
|
|
4657
|
-
else if (
|
|
4658
|
-
request['symbol'] = market
|
|
4635
|
+
else if (marketType === 'future') {
|
|
4636
|
+
request['symbol'] = this.safeString(market, 'settleId', 'usdt');
|
|
4659
4637
|
if (trigger) {
|
|
4660
4638
|
response = await this.contractPrivatePostApiV1ContractTriggerOpenorders(this.extend(request, params));
|
|
4661
4639
|
}
|