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/dist/cjs/src/coinbase.js
CHANGED
|
@@ -1452,10 +1452,6 @@ class coinbase extends coinbase$1 {
|
|
|
1452
1452
|
this.v3PublicGetBrokerageMarketProducts(this.extend(params, { 'product_type': 'FUTURE' })),
|
|
1453
1453
|
this.v3PublicGetBrokerageMarketProducts(this.extend(params, { 'product_type': 'FUTURE', 'contract_expiry_type': 'PERPETUAL' })),
|
|
1454
1454
|
];
|
|
1455
|
-
if (this.checkRequiredCredentials(false)) {
|
|
1456
|
-
unresolvedContractPromises.push(this.extend(params, { 'product_type': 'FUTURE' }));
|
|
1457
|
-
unresolvedContractPromises.push(this.extend(params, { 'product_type': 'FUTURE', 'contract_expiry_type': 'PERPETUAL' }));
|
|
1458
|
-
}
|
|
1459
1455
|
}
|
|
1460
1456
|
catch (e) {
|
|
1461
1457
|
unresolvedContractPromises = []; // the sync version of ccxt won't have the promise.all line so the request is made here. Some users can't access perpetual products
|
|
@@ -1472,8 +1468,8 @@ class coinbase extends coinbase$1 {
|
|
|
1472
1468
|
const fees = this.safeDict(promises, 1, {});
|
|
1473
1469
|
const expiringFutures = this.safeDict(contractPromises, 0, {});
|
|
1474
1470
|
const perpetualFutures = this.safeDict(contractPromises, 1, {});
|
|
1475
|
-
const expiringFees = this.safeDict(contractPromises,
|
|
1476
|
-
const perpetualFees = this.safeDict(contractPromises,
|
|
1471
|
+
const expiringFees = this.safeDict(contractPromises, 0, {});
|
|
1472
|
+
const perpetualFees = this.safeDict(contractPromises, 1, {});
|
|
1477
1473
|
//
|
|
1478
1474
|
// {
|
|
1479
1475
|
// "total_volume": 0,
|
|
@@ -1874,45 +1870,46 @@ class coinbase extends coinbase$1 {
|
|
|
1874
1870
|
* @returns {object} an associative dictionary of currencies
|
|
1875
1871
|
*/
|
|
1876
1872
|
async fetchCurrencies(params = {}) {
|
|
1877
|
-
const
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
// name: 'Isle of Man Pound',
|
|
1885
|
-
// min_size: '0.01'
|
|
1886
|
-
// },
|
|
1887
|
-
//
|
|
1888
|
-
// crypto
|
|
1873
|
+
const promises = [
|
|
1874
|
+
this.v2PublicGetCurrencies(params),
|
|
1875
|
+
this.v2PublicGetCurrenciesCrypto(params),
|
|
1876
|
+
this.v2PublicGetExchangeRates(params),
|
|
1877
|
+
];
|
|
1878
|
+
const promisesResult = await Promise.all(promises);
|
|
1879
|
+
const fiatResponse = this.safeDict(promisesResult, 0, {});
|
|
1889
1880
|
//
|
|
1890
|
-
//
|
|
1891
|
-
//
|
|
1892
|
-
//
|
|
1893
|
-
//
|
|
1894
|
-
//
|
|
1895
|
-
//
|
|
1896
|
-
//
|
|
1897
|
-
//
|
|
1898
|
-
// address_regex: '^(?:0x)?[0-9a-fA-F]{40}$'
|
|
1899
|
-
// }
|
|
1881
|
+
// [
|
|
1882
|
+
// "data": [
|
|
1883
|
+
// {
|
|
1884
|
+
// id: 'IMP',
|
|
1885
|
+
// name: 'Isle of Man Pound',
|
|
1886
|
+
// min_size: '0.01'
|
|
1887
|
+
// },
|
|
1888
|
+
// ...
|
|
1900
1889
|
//
|
|
1890
|
+
const cryptoResponse = this.safeDict(promisesResult, 1, {});
|
|
1901
1891
|
//
|
|
1902
|
-
//
|
|
1903
|
-
//
|
|
1904
|
-
//
|
|
1905
|
-
//
|
|
1906
|
-
//
|
|
1907
|
-
//
|
|
1908
|
-
//
|
|
1909
|
-
//
|
|
1910
|
-
//
|
|
1911
|
-
//
|
|
1912
|
-
//
|
|
1913
|
-
//
|
|
1914
|
-
//
|
|
1915
|
-
//
|
|
1892
|
+
// [
|
|
1893
|
+
// "data": [
|
|
1894
|
+
// {
|
|
1895
|
+
// asset_id: '9476e3be-b731-47fa-82be-347fabc573d9',
|
|
1896
|
+
// code: 'AERO',
|
|
1897
|
+
// name: 'Aerodrome Finance',
|
|
1898
|
+
// color: '#0433FF',
|
|
1899
|
+
// sort_index: '340',
|
|
1900
|
+
// exponent: '8',
|
|
1901
|
+
// type: 'crypto',
|
|
1902
|
+
// address_regex: '^(?:0x)?[0-9a-fA-F]{40}$'
|
|
1903
|
+
// },
|
|
1904
|
+
// ...
|
|
1905
|
+
//
|
|
1906
|
+
const ratesResponse = this.safeDict(promisesResult, 2, {});
|
|
1907
|
+
const fiatData = this.safeList(fiatResponse, 'data', []);
|
|
1908
|
+
const cryptoData = this.safeList(cryptoResponse, 'data', []);
|
|
1909
|
+
const ratesData = this.safeDict(ratesResponse, 'data', {});
|
|
1910
|
+
const rates = this.safeDict(ratesData, 'rates', {});
|
|
1911
|
+
const ratesIds = Object.keys(rates);
|
|
1912
|
+
const currencies = this.arrayConcat(fiatData, cryptoData);
|
|
1916
1913
|
const result = {};
|
|
1917
1914
|
const networks = {};
|
|
1918
1915
|
const networksById = {};
|
|
@@ -1924,12 +1921,13 @@ class coinbase extends coinbase$1 {
|
|
|
1924
1921
|
const name = this.safeString(currency, 'name');
|
|
1925
1922
|
this.options['networks'][code] = name.toLowerCase();
|
|
1926
1923
|
this.options['networksById'][code] = name.toLowerCase();
|
|
1927
|
-
|
|
1924
|
+
const type = (assetId !== undefined) ? 'crypto' : 'fiat';
|
|
1925
|
+
result[code] = this.safeCurrencyStructure({
|
|
1928
1926
|
'info': currency,
|
|
1929
1927
|
'id': id,
|
|
1930
1928
|
'code': code,
|
|
1931
|
-
'type':
|
|
1932
|
-
'name':
|
|
1929
|
+
'type': type,
|
|
1930
|
+
'name': name,
|
|
1933
1931
|
'active': true,
|
|
1934
1932
|
'deposit': undefined,
|
|
1935
1933
|
'withdraw': undefined,
|
|
@@ -1946,13 +1944,27 @@ class coinbase extends coinbase$1 {
|
|
|
1946
1944
|
'max': undefined,
|
|
1947
1945
|
},
|
|
1948
1946
|
},
|
|
1949
|
-
};
|
|
1947
|
+
});
|
|
1950
1948
|
if (assetId !== undefined) {
|
|
1951
1949
|
const lowerCaseName = name.toLowerCase();
|
|
1952
1950
|
networks[code] = lowerCaseName;
|
|
1953
1951
|
networksById[lowerCaseName] = code;
|
|
1954
1952
|
}
|
|
1955
1953
|
}
|
|
1954
|
+
// we have to add other currencies here ( https://discord.com/channels/1220414409550336183/1220464770239430761/1372215891940479098 )
|
|
1955
|
+
for (let i = 0; i < ratesIds.length; i++) {
|
|
1956
|
+
const currencyId = ratesIds[i];
|
|
1957
|
+
const code = this.safeCurrencyCode(currencyId);
|
|
1958
|
+
if (!(code in result)) {
|
|
1959
|
+
result[code] = this.safeCurrencyStructure({
|
|
1960
|
+
'info': {},
|
|
1961
|
+
'id': currencyId,
|
|
1962
|
+
'code': code,
|
|
1963
|
+
'type': 'crypto',
|
|
1964
|
+
'networks': {}, // todo
|
|
1965
|
+
});
|
|
1966
|
+
}
|
|
1967
|
+
}
|
|
1956
1968
|
this.options['networks'] = this.extend(networks, this.options['networks']);
|
|
1957
1969
|
this.options['networksById'] = this.extend(networksById, this.options['networksById']);
|
|
1958
1970
|
return result;
|
|
@@ -296,6 +296,78 @@ class coinbaseexchange extends coinbaseexchange$1 {
|
|
|
296
296
|
'inverse': undefined,
|
|
297
297
|
},
|
|
298
298
|
},
|
|
299
|
+
'options': {
|
|
300
|
+
'networks': {
|
|
301
|
+
'BTC': 'bitcoin',
|
|
302
|
+
// LIGHTNING unsupported
|
|
303
|
+
'ETH': 'ethereum',
|
|
304
|
+
// TRON unsupported
|
|
305
|
+
'SOL': 'solana',
|
|
306
|
+
// BSC unsupported
|
|
307
|
+
'ARBONE': 'arbitrum',
|
|
308
|
+
'AVAXC': 'avacchain',
|
|
309
|
+
'MATIC': 'polygon',
|
|
310
|
+
'BASE': 'base',
|
|
311
|
+
'SUI': 'sui',
|
|
312
|
+
'OP': 'optimism',
|
|
313
|
+
'NEAR': 'near',
|
|
314
|
+
// CRONOS unsupported
|
|
315
|
+
// GNO unsupported
|
|
316
|
+
'APT': 'aptos',
|
|
317
|
+
// SCROLL unsupported
|
|
318
|
+
'KAVA': 'kava',
|
|
319
|
+
// TAIKO unsupported
|
|
320
|
+
// BOB unsupported
|
|
321
|
+
// LINEA unsupported
|
|
322
|
+
'BLAST': 'blast',
|
|
323
|
+
'XLM': 'stellar',
|
|
324
|
+
// RSK unsupported
|
|
325
|
+
'SEI': 'sei',
|
|
326
|
+
// TON unsupported
|
|
327
|
+
// MANTLE unsupported
|
|
328
|
+
'ADA': 'cardano',
|
|
329
|
+
// HYPE unsupported
|
|
330
|
+
'CORE': 'coredao',
|
|
331
|
+
'ALGO': 'algorand',
|
|
332
|
+
// RUNE unsupported
|
|
333
|
+
'OSMO': 'osmosis',
|
|
334
|
+
// XIN unsupported
|
|
335
|
+
'CELO': 'celo',
|
|
336
|
+
'HBAR': 'hedera',
|
|
337
|
+
// FTM unsupported
|
|
338
|
+
// WEMIX unsupported
|
|
339
|
+
'ZKSYNC': 'zksync',
|
|
340
|
+
// KLAY unsupported
|
|
341
|
+
// HT unsupported
|
|
342
|
+
// FSN unsupported
|
|
343
|
+
// EOS unsupported, eosio?
|
|
344
|
+
// ACA unsupported
|
|
345
|
+
'STX': 'stacks',
|
|
346
|
+
'XTZ': 'tezos',
|
|
347
|
+
// NEO unsupported
|
|
348
|
+
// METIS unsupported
|
|
349
|
+
// TLOS unsupported
|
|
350
|
+
'EGLD': 'elrond',
|
|
351
|
+
// ASTR unsupported
|
|
352
|
+
// CFX unsupported
|
|
353
|
+
// GLMR unsupported
|
|
354
|
+
// CANTO unsupported
|
|
355
|
+
// SCRT unsupported
|
|
356
|
+
'LTC': 'litecoin',
|
|
357
|
+
// AURORA unsupported
|
|
358
|
+
// ONG unsupported
|
|
359
|
+
'ATOM': 'cosmos',
|
|
360
|
+
// CHZ unsupported
|
|
361
|
+
'FIL': 'filecoin',
|
|
362
|
+
'DOT': 'polkadot',
|
|
363
|
+
'DOGE': 'dogecoin',
|
|
364
|
+
// BRC20 unsupported
|
|
365
|
+
'XRP': 'ripple',
|
|
366
|
+
// XMR unsupported
|
|
367
|
+
'DASH': 'dash',
|
|
368
|
+
// akash, aleo, axelar, bitcoincash, berachain, deso, ethereumclassic, unichain, flow, flare, dfinity, story,kusama, mina, ronin, oasis, bittensor, celestia, noble, vara, vechain, zcash, horizen, zetachain
|
|
369
|
+
},
|
|
370
|
+
},
|
|
299
371
|
'exceptions': {
|
|
300
372
|
'exact': {
|
|
301
373
|
'Insufficient funds': errors.InsufficientFunds,
|
|
@@ -331,30 +403,45 @@ class coinbaseexchange extends coinbaseexchange$1 {
|
|
|
331
403
|
async fetchCurrencies(params = {}) {
|
|
332
404
|
const response = await this.publicGetCurrencies(params);
|
|
333
405
|
//
|
|
334
|
-
//
|
|
335
|
-
//
|
|
336
|
-
//
|
|
337
|
-
//
|
|
338
|
-
//
|
|
339
|
-
//
|
|
340
|
-
//
|
|
341
|
-
//
|
|
342
|
-
//
|
|
343
|
-
//
|
|
344
|
-
//
|
|
345
|
-
//
|
|
346
|
-
//
|
|
347
|
-
//
|
|
348
|
-
//
|
|
349
|
-
//
|
|
350
|
-
//
|
|
351
|
-
//
|
|
352
|
-
//
|
|
353
|
-
//
|
|
354
|
-
//
|
|
355
|
-
//
|
|
356
|
-
//
|
|
357
|
-
//
|
|
406
|
+
// {
|
|
407
|
+
// "id": "USDT",
|
|
408
|
+
// "name": "Tether",
|
|
409
|
+
// "min_size": "0.000001",
|
|
410
|
+
// "status": "online",
|
|
411
|
+
// "message": "",
|
|
412
|
+
// "max_precision": "0.000001",
|
|
413
|
+
// "convertible_to": [],
|
|
414
|
+
// "details": {
|
|
415
|
+
// "type": "crypto",
|
|
416
|
+
// "symbol": null,
|
|
417
|
+
// "network_confirmations": 14,
|
|
418
|
+
// "sort_order": 0,
|
|
419
|
+
// "crypto_address_link": "https://etherscan.io/token/0xdac17f958d2ee523a2206206994597c13d831ec7?a={{address}}",
|
|
420
|
+
// "crypto_transaction_link": "https://etherscan.io/tx/0x{{txId}}",
|
|
421
|
+
// "push_payment_methods": [],
|
|
422
|
+
// "group_types": [],
|
|
423
|
+
// "display_name": null,
|
|
424
|
+
// "processing_time_seconds": null,
|
|
425
|
+
// "min_withdrawal_amount": 0.000001,
|
|
426
|
+
// "max_withdrawal_amount": 20000000
|
|
427
|
+
// },
|
|
428
|
+
// "default_network": "ethereum",
|
|
429
|
+
// "supported_networks": [
|
|
430
|
+
// {
|
|
431
|
+
// "id": "ethereum",
|
|
432
|
+
// "name": "Ethereum",
|
|
433
|
+
// "status": "online",
|
|
434
|
+
// "contract_address": "0xdac17f958d2ee523a2206206994597c13d831ec7",
|
|
435
|
+
// "crypto_address_link": "https://etherscan.io/token/0xdac17f958d2ee523a2206206994597c13d831ec7?a={{address}}",
|
|
436
|
+
// "crypto_transaction_link": "https://etherscan.io/tx/0x{{txId}}",
|
|
437
|
+
// "min_withdrawal_amount": 0.000001,
|
|
438
|
+
// "max_withdrawal_amount": 20000000,
|
|
439
|
+
// "network_confirmations": 14,
|
|
440
|
+
// "processing_time_seconds": null
|
|
441
|
+
// }
|
|
442
|
+
// ],
|
|
443
|
+
// "display_name": "USDT"
|
|
444
|
+
// }
|
|
358
445
|
//
|
|
359
446
|
const result = {};
|
|
360
447
|
for (let i = 0; i < response.length; i++) {
|
|
@@ -362,16 +449,39 @@ class coinbaseexchange extends coinbaseexchange$1 {
|
|
|
362
449
|
const id = this.safeString(currency, 'id');
|
|
363
450
|
const name = this.safeString(currency, 'name');
|
|
364
451
|
const code = this.safeCurrencyCode(id);
|
|
365
|
-
const details = this.
|
|
366
|
-
const
|
|
367
|
-
const
|
|
368
|
-
|
|
452
|
+
const details = this.safeDict(currency, 'details', {});
|
|
453
|
+
const networks = {};
|
|
454
|
+
const supportedNetworks = this.safeList(currency, 'supported_networks', []);
|
|
455
|
+
for (let j = 0; j < supportedNetworks.length; j++) {
|
|
456
|
+
const network = supportedNetworks[j];
|
|
457
|
+
const networkId = this.safeString(network, 'id');
|
|
458
|
+
const networkCode = this.networkIdToCode(networkId);
|
|
459
|
+
networks[networkCode] = {
|
|
460
|
+
'id': networkId,
|
|
461
|
+
'name': this.safeString(network, 'name'),
|
|
462
|
+
'network': networkCode,
|
|
463
|
+
'active': this.safeString(network, 'status') === 'online',
|
|
464
|
+
'withdraw': undefined,
|
|
465
|
+
'deposit': undefined,
|
|
466
|
+
'fee': undefined,
|
|
467
|
+
'precision': undefined,
|
|
468
|
+
'limits': {
|
|
469
|
+
'withdraw': {
|
|
470
|
+
'min': this.safeNumber(network, 'min_withdrawal_amount'),
|
|
471
|
+
'max': this.safeNumber(network, 'max_withdrawal_amount'),
|
|
472
|
+
},
|
|
473
|
+
},
|
|
474
|
+
'contract': this.safeString(network, 'contract_address'),
|
|
475
|
+
'info': network,
|
|
476
|
+
};
|
|
477
|
+
}
|
|
478
|
+
result[code] = this.safeCurrencyStructure({
|
|
369
479
|
'id': id,
|
|
370
480
|
'code': code,
|
|
371
481
|
'info': currency,
|
|
372
482
|
'type': this.safeString(details, 'type'),
|
|
373
483
|
'name': name,
|
|
374
|
-
'active':
|
|
484
|
+
'active': this.safeString(currency, 'status') === 'online',
|
|
375
485
|
'deposit': undefined,
|
|
376
486
|
'withdraw': undefined,
|
|
377
487
|
'fee': undefined,
|
|
@@ -383,11 +493,11 @@ class coinbaseexchange extends coinbaseexchange$1 {
|
|
|
383
493
|
},
|
|
384
494
|
'withdraw': {
|
|
385
495
|
'min': this.safeNumber(details, 'min_withdrawal_amount'),
|
|
386
|
-
'max':
|
|
496
|
+
'max': this.safeNumber(details, 'max_withdrawal_amount'),
|
|
387
497
|
},
|
|
388
498
|
},
|
|
389
|
-
'networks':
|
|
390
|
-
};
|
|
499
|
+
'networks': networks,
|
|
500
|
+
});
|
|
391
501
|
}
|
|
392
502
|
return result;
|
|
393
503
|
}
|
|
@@ -358,56 +358,18 @@ class coincatch extends coincatch$1 {
|
|
|
358
358
|
'CRO': 'CronosChain',
|
|
359
359
|
},
|
|
360
360
|
'networksById': {
|
|
361
|
-
'BITCOIN': 'BTC',
|
|
362
|
-
'ERC20': 'ERC20',
|
|
363
361
|
'TRC20': 'TRC20',
|
|
364
362
|
'TRX(TRC20)': 'TRC20',
|
|
365
|
-
'BEP20': 'BEP20',
|
|
366
363
|
'ArbitrumOne': 'ARB',
|
|
367
|
-
'Optimism': 'OPTIMISM',
|
|
368
|
-
'LTC': 'LTC',
|
|
369
|
-
'BCH': 'BCH',
|
|
370
|
-
'ETC': 'ETC',
|
|
371
|
-
'SOL': 'SOL',
|
|
372
|
-
'NEO3': 'NEO3',
|
|
373
|
-
'stacks': 'STX',
|
|
374
|
-
'Elrond': 'EGLD',
|
|
375
|
-
'NEARProtocol': 'NEAR',
|
|
376
|
-
'AcalaToken': 'ACA',
|
|
377
|
-
'Klaytn': 'KLAY',
|
|
378
|
-
'Fantom': 'FTM',
|
|
379
|
-
'Terra': 'TERRA',
|
|
380
|
-
'WAVES': 'WAVES',
|
|
381
|
-
'TAO': 'TAO',
|
|
382
|
-
'SUI': 'SUI',
|
|
383
|
-
'SEI': 'SEI',
|
|
384
364
|
'THORChain': 'RUNE',
|
|
385
|
-
'ZIL': 'ZIL',
|
|
386
365
|
'Solar': 'SXP',
|
|
387
|
-
'FET': 'FET',
|
|
388
366
|
'C-Chain': 'AVAX',
|
|
389
|
-
'XRP': 'XRP',
|
|
390
|
-
'EOS': 'EOS',
|
|
391
|
-
'DOGECOIN': 'DOGE',
|
|
392
367
|
'CAP20': 'CAP20',
|
|
393
|
-
'Polygon': 'MATIC',
|
|
394
|
-
'CSPR': 'CSPR',
|
|
395
|
-
'Moonbeam': 'GLMR',
|
|
396
|
-
'MINA': 'MINA',
|
|
397
368
|
'CFXeSpace': 'CFX',
|
|
398
369
|
'CFX': 'CFX',
|
|
399
370
|
'StratisEVM': 'STRAT',
|
|
400
|
-
'Celestia': 'TIA',
|
|
401
371
|
'ChilizChain': 'ChilizChain',
|
|
402
|
-
'Aptos': 'APT',
|
|
403
|
-
'Ontology': 'ONT',
|
|
404
|
-
'ICP': 'ICP',
|
|
405
|
-
'Cardano': 'ADA',
|
|
406
|
-
'FIL': 'FIL',
|
|
407
|
-
'CELO': 'CELO',
|
|
408
|
-
'DOT': 'DOT',
|
|
409
372
|
'StellarLumens': 'XLM',
|
|
410
|
-
'ATOM': 'ATOM',
|
|
411
373
|
'CronosChain': 'CRO', // todo check
|
|
412
374
|
},
|
|
413
375
|
},
|
|
@@ -641,72 +603,57 @@ class coincatch extends coincatch$1 {
|
|
|
641
603
|
const currencyId = this.safeString(currecy, 'coinName');
|
|
642
604
|
currenciesIds.push(currencyId);
|
|
643
605
|
const code = this.safeCurrencyCode(currencyId);
|
|
644
|
-
let allowDeposit = false;
|
|
645
|
-
let allowWithdraw = false;
|
|
646
|
-
let minDeposit = undefined;
|
|
647
|
-
let minWithdraw = undefined;
|
|
648
606
|
const networks = this.safeList(currecy, 'chains');
|
|
649
|
-
const networksById = this.safeDict(this.options, 'networksById');
|
|
650
607
|
const parsedNetworks = {};
|
|
651
608
|
for (let j = 0; j < networks.length; j++) {
|
|
652
609
|
const network = networks[j];
|
|
653
610
|
const networkId = this.safeString(network, 'chain');
|
|
654
|
-
const
|
|
655
|
-
const networkDepositString = this.safeString(network, 'rechargeable');
|
|
656
|
-
const networkDeposit = networkDepositString === 'true';
|
|
657
|
-
const networkWithdrawString = this.safeString(network, 'withdrawable');
|
|
658
|
-
const networkWithdraw = networkWithdrawString === 'true';
|
|
659
|
-
const networkMinDeposit = this.safeString(network, 'minDepositAmount');
|
|
660
|
-
const networkMinWithdraw = this.safeString(network, 'minWithdrawAmount');
|
|
611
|
+
const networkCode = this.networkCodeToId(networkId);
|
|
661
612
|
parsedNetworks[networkId] = {
|
|
662
613
|
'id': networkId,
|
|
663
|
-
'network':
|
|
614
|
+
'network': networkCode,
|
|
664
615
|
'limits': {
|
|
665
616
|
'deposit': {
|
|
666
|
-
'min': this.
|
|
617
|
+
'min': this.safeNumber(network, 'minDepositAmount'),
|
|
667
618
|
'max': undefined,
|
|
668
619
|
},
|
|
669
620
|
'withdraw': {
|
|
670
|
-
'min': this.
|
|
621
|
+
'min': this.safeNumber(network, 'minWithdrawAmount'),
|
|
671
622
|
'max': undefined,
|
|
672
623
|
},
|
|
673
624
|
},
|
|
674
|
-
'active':
|
|
675
|
-
'deposit':
|
|
676
|
-
'withdraw':
|
|
625
|
+
'active': undefined,
|
|
626
|
+
'deposit': this.safeString(network, 'rechargeable') === 'true',
|
|
627
|
+
'withdraw': this.safeString(network, 'withdrawable') === 'true',
|
|
677
628
|
'fee': this.safeNumber(network, 'withdrawFee'),
|
|
678
629
|
'precision': undefined,
|
|
679
630
|
'info': network,
|
|
680
631
|
};
|
|
681
|
-
allowDeposit = allowDeposit ? allowDeposit : networkDeposit;
|
|
682
|
-
allowWithdraw = allowWithdraw ? allowWithdraw : networkWithdraw;
|
|
683
|
-
minDeposit = minDeposit ? Precise["default"].stringMin(networkMinDeposit, minDeposit) : networkMinDeposit;
|
|
684
|
-
minWithdraw = minWithdraw ? Precise["default"].stringMin(networkMinWithdraw, minWithdraw) : networkMinWithdraw;
|
|
685
632
|
}
|
|
686
|
-
result[code] = {
|
|
633
|
+
result[code] = this.safeCurrencyStructure({
|
|
687
634
|
'id': currencyId,
|
|
688
635
|
'numericId': this.safeInteger(currecy, 'coinId'),
|
|
689
636
|
'code': code,
|
|
690
637
|
'precision': undefined,
|
|
691
638
|
'type': undefined,
|
|
692
639
|
'name': undefined,
|
|
693
|
-
'active':
|
|
694
|
-
'deposit':
|
|
695
|
-
'withdraw':
|
|
640
|
+
'active': undefined,
|
|
641
|
+
'deposit': undefined,
|
|
642
|
+
'withdraw': undefined,
|
|
696
643
|
'fee': undefined,
|
|
697
644
|
'limits': {
|
|
698
645
|
'deposit': {
|
|
699
|
-
'min':
|
|
646
|
+
'min': undefined,
|
|
700
647
|
'max': undefined,
|
|
701
648
|
},
|
|
702
649
|
'withdraw': {
|
|
703
|
-
'min':
|
|
650
|
+
'min': undefined,
|
|
704
651
|
'max': undefined,
|
|
705
652
|
},
|
|
706
653
|
},
|
|
707
654
|
'networks': parsedNetworks,
|
|
708
655
|
'info': currecy,
|
|
709
|
-
};
|
|
656
|
+
});
|
|
710
657
|
}
|
|
711
658
|
if (this.safeList(this.options, 'currencyIdsListForParseMarket') === undefined) {
|
|
712
659
|
this.options['currencyIdsListForParseMarket'] = currenciesIds;
|
package/dist/cjs/src/coinex.js
CHANGED
|
@@ -721,33 +721,6 @@ class coinex extends coinex$1 {
|
|
|
721
721
|
const canWithdraw = this.safeBool(asset, 'withdraw_enabled');
|
|
722
722
|
const firstChain = this.safeDict(chains, 0, {});
|
|
723
723
|
const firstPrecisionString = this.parsePrecision(this.safeString(firstChain, 'withdrawal_precision'));
|
|
724
|
-
result[code] = {
|
|
725
|
-
'id': currencyId,
|
|
726
|
-
'code': code,
|
|
727
|
-
'name': undefined,
|
|
728
|
-
'active': canDeposit && canWithdraw,
|
|
729
|
-
'deposit': canDeposit,
|
|
730
|
-
'withdraw': canWithdraw,
|
|
731
|
-
'fee': undefined,
|
|
732
|
-
'precision': this.parseNumber(firstPrecisionString),
|
|
733
|
-
'limits': {
|
|
734
|
-
'amount': {
|
|
735
|
-
'min': undefined,
|
|
736
|
-
'max': undefined,
|
|
737
|
-
},
|
|
738
|
-
'deposit': {
|
|
739
|
-
'min': undefined,
|
|
740
|
-
'max': undefined,
|
|
741
|
-
},
|
|
742
|
-
'withdraw': {
|
|
743
|
-
'min': undefined,
|
|
744
|
-
'max': undefined,
|
|
745
|
-
},
|
|
746
|
-
},
|
|
747
|
-
'networks': {},
|
|
748
|
-
'type': 'crypto',
|
|
749
|
-
'info': coin,
|
|
750
|
-
};
|
|
751
724
|
for (let j = 0; j < chains.length; j++) {
|
|
752
725
|
const chain = chains[j];
|
|
753
726
|
const networkId = this.safeString(chain, 'chain');
|
|
@@ -760,7 +733,7 @@ class coinex extends coinex$1 {
|
|
|
760
733
|
const minNetworkWithdrawString = this.safeString(chain, 'min_withdraw_amount');
|
|
761
734
|
const canDepositChain = this.safeBool(chain, 'deposit_enabled');
|
|
762
735
|
const canWithdrawChain = this.safeBool(chain, 'withdraw_enabled');
|
|
763
|
-
|
|
736
|
+
({
|
|
764
737
|
'id': networkId,
|
|
765
738
|
'network': networkId,
|
|
766
739
|
'name': undefined,
|
|
@@ -784,11 +757,35 @@ class coinex extends coinex$1 {
|
|
|
784
757
|
},
|
|
785
758
|
},
|
|
786
759
|
'info': chain,
|
|
787
|
-
};
|
|
788
|
-
const networks = this.safeDict(result[code], 'networks', {});
|
|
789
|
-
networks[networkId] = network;
|
|
790
|
-
result[code]['networks'] = networks;
|
|
760
|
+
});
|
|
791
761
|
}
|
|
762
|
+
result[code] = this.safeCurrencyStructure({
|
|
763
|
+
'id': currencyId,
|
|
764
|
+
'code': code,
|
|
765
|
+
'name': undefined,
|
|
766
|
+
'active': canDeposit && canWithdraw,
|
|
767
|
+
'deposit': canDeposit,
|
|
768
|
+
'withdraw': canWithdraw,
|
|
769
|
+
'fee': undefined,
|
|
770
|
+
'precision': this.parseNumber(firstPrecisionString),
|
|
771
|
+
'limits': {
|
|
772
|
+
'amount': {
|
|
773
|
+
'min': undefined,
|
|
774
|
+
'max': undefined,
|
|
775
|
+
},
|
|
776
|
+
'deposit': {
|
|
777
|
+
'min': undefined,
|
|
778
|
+
'max': undefined,
|
|
779
|
+
},
|
|
780
|
+
'withdraw': {
|
|
781
|
+
'min': undefined,
|
|
782
|
+
'max': undefined,
|
|
783
|
+
},
|
|
784
|
+
},
|
|
785
|
+
'networks': {},
|
|
786
|
+
'type': 'crypto',
|
|
787
|
+
'info': coin,
|
|
788
|
+
});
|
|
792
789
|
}
|
|
793
790
|
return result;
|
|
794
791
|
}
|
package/dist/cjs/src/coinlist.js
CHANGED
|
@@ -453,30 +453,31 @@ class coinlist extends coinlist$1 {
|
|
|
453
453
|
const currency = currencies[i];
|
|
454
454
|
const id = this.safeString(currency, 'asset');
|
|
455
455
|
const code = this.safeCurrencyCode(id);
|
|
456
|
+
const isFiat = code === 'USD';
|
|
456
457
|
const isTransferable = this.safeBool(currency, 'is_transferable', false);
|
|
457
|
-
|
|
458
|
-
const depositEnabled = isTransferable;
|
|
459
|
-
const active = isTransferable;
|
|
460
|
-
const decimalPlaces = this.safeString(currency, 'decimal_places');
|
|
461
|
-
const precision = this.parseNumber(this.parsePrecision(decimalPlaces));
|
|
462
|
-
const minWithdrawal = this.safeString(currency, 'min_withdrawal');
|
|
463
|
-
result[code] = {
|
|
458
|
+
result[code] = this.safeCurrencyStructure({
|
|
464
459
|
'id': id,
|
|
465
460
|
'code': code,
|
|
466
461
|
'name': code,
|
|
467
462
|
'info': currency,
|
|
468
|
-
'active':
|
|
469
|
-
'deposit':
|
|
470
|
-
'withdraw':
|
|
463
|
+
'active': undefined,
|
|
464
|
+
'deposit': isTransferable,
|
|
465
|
+
'withdraw': isTransferable,
|
|
471
466
|
'fee': undefined,
|
|
472
|
-
'precision':
|
|
467
|
+
'precision': this.parseNumber(this.parsePrecision(this.safeString(currency, 'decimal_places'))),
|
|
473
468
|
'limits': {
|
|
474
|
-
'amount': {
|
|
475
|
-
|
|
469
|
+
'amount': {
|
|
470
|
+
'min': undefined,
|
|
471
|
+
'max': undefined,
|
|
472
|
+
},
|
|
473
|
+
'withdraw': {
|
|
474
|
+
'min': this.safeNumber(currency, 'min_withdrawal'),
|
|
475
|
+
'max': undefined,
|
|
476
|
+
},
|
|
476
477
|
},
|
|
477
478
|
'networks': {},
|
|
478
|
-
'type': 'crypto',
|
|
479
|
-
};
|
|
479
|
+
'type': isFiat ? 'fiat' : 'crypto',
|
|
480
|
+
});
|
|
480
481
|
}
|
|
481
482
|
return result;
|
|
482
483
|
}
|