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