ccxt 4.1.74 → 4.1.76

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.
Files changed (140) hide show
  1. package/README.md +3 -3
  2. package/dist/ccxt.browser.js +620 -342
  3. package/dist/ccxt.browser.min.js +3 -3
  4. package/dist/cjs/ccxt.js +1 -1
  5. package/dist/cjs/src/ace.js +2 -0
  6. package/dist/cjs/src/alpaca.js +2 -0
  7. package/dist/cjs/src/base/Exchange.js +14 -2
  8. package/dist/cjs/src/base/errors.js +7 -7
  9. package/dist/cjs/src/base/ws/Client.js +13 -14
  10. package/dist/cjs/src/bigone.js +38 -9
  11. package/dist/cjs/src/binance.js +4 -0
  12. package/dist/cjs/src/binanceus.js +2 -0
  13. package/dist/cjs/src/bingx.js +134 -40
  14. package/dist/cjs/src/bit2c.js +2 -0
  15. package/dist/cjs/src/bitbank.js +2 -0
  16. package/dist/cjs/src/bithumb.js +2 -0
  17. package/dist/cjs/src/bitmart.js +33 -11
  18. package/dist/cjs/src/bitopro.js +2 -0
  19. package/dist/cjs/src/bitpanda.js +2 -0
  20. package/dist/cjs/src/bitso.js +2 -0
  21. package/dist/cjs/src/bitstamp.js +2 -0
  22. package/dist/cjs/src/bittrex.js +2 -0
  23. package/dist/cjs/src/bitvavo.js +2 -0
  24. package/dist/cjs/src/bl3p.js +2 -0
  25. package/dist/cjs/src/btcalpha.js +2 -0
  26. package/dist/cjs/src/btcbox.js +2 -0
  27. package/dist/cjs/src/btcmarkets.js +2 -0
  28. package/dist/cjs/src/btcturk.js +2 -0
  29. package/dist/cjs/src/bybit.js +2 -0
  30. package/dist/cjs/src/coinbase.js +2 -0
  31. package/dist/cjs/src/coincheck.js +2 -0
  32. package/dist/cjs/src/coinlist.js +2 -0
  33. package/dist/cjs/src/coinmate.js +2 -0
  34. package/dist/cjs/src/coinone.js +2 -0
  35. package/dist/cjs/src/coinsph.js +2 -0
  36. package/dist/cjs/src/coinspot.js +2 -0
  37. package/dist/cjs/src/cryptocom.js +2 -185
  38. package/dist/cjs/src/gate.js +1 -0
  39. package/dist/cjs/src/gemini.js +23 -19
  40. package/dist/cjs/src/idex.js +2 -0
  41. package/dist/cjs/src/independentreserve.js +2 -0
  42. package/dist/cjs/src/indodax.js +2 -0
  43. package/dist/cjs/src/kraken.js +154 -11
  44. package/dist/cjs/src/kucoin.js +2 -0
  45. package/dist/cjs/src/kuna.js +2 -0
  46. package/dist/cjs/src/latoken.js +2 -0
  47. package/dist/cjs/src/luno.js +2 -0
  48. package/dist/cjs/src/mercado.js +2 -0
  49. package/dist/cjs/src/mexc.js +2 -0
  50. package/dist/cjs/src/ndax.js +2 -0
  51. package/dist/cjs/src/novadax.js +2 -0
  52. package/dist/cjs/src/okx.js +24 -9
  53. package/dist/cjs/src/p2b.js +2 -0
  54. package/dist/cjs/src/poloniex.js +27 -25
  55. package/dist/cjs/src/pro/binance.js +60 -8
  56. package/dist/cjs/src/pro/coinbasepro.js +1 -1
  57. package/dist/cjs/src/static_dependencies/proxies/http-proxy-agent/index.js +8 -11
  58. package/dist/cjs/src/static_dependencies/proxies/https-proxy-agent/index.js +5 -8
  59. package/dist/cjs/src/static_dependencies/proxies/https-proxy-agent/parse-proxy-response.js +5 -12
  60. package/dist/cjs/src/wavesexchange.js +2 -0
  61. package/dist/cjs/src/wazirx.js +2 -0
  62. package/dist/cjs/src/woo.js +2 -0
  63. package/dist/cjs/src/yobit.js +2 -0
  64. package/dist/cjs/src/zonda.js +2 -0
  65. package/js/ccxt.d.ts +1 -1
  66. package/js/ccxt.js +1 -1
  67. package/js/src/abstract/binance.d.ts +2 -0
  68. package/js/src/abstract/binancecoinm.d.ts +2 -0
  69. package/js/src/abstract/binanceus.d.ts +2 -0
  70. package/js/src/abstract/binanceusdm.d.ts +2 -0
  71. package/js/src/abstract/okx.d.ts +14 -0
  72. package/js/src/ace.js +2 -0
  73. package/js/src/alpaca.js +2 -0
  74. package/js/src/base/Exchange.d.ts +4 -0
  75. package/js/src/base/Exchange.js +14 -2
  76. package/js/src/base/errors.d.ts +4 -4
  77. package/js/src/base/errors.js +7 -7
  78. package/js/src/base/ws/Client.js +13 -14
  79. package/js/src/bigone.d.ts +1 -0
  80. package/js/src/bigone.js +38 -9
  81. package/js/src/binance.js +4 -0
  82. package/js/src/binanceus.js +2 -0
  83. package/js/src/bingx.d.ts +7 -3
  84. package/js/src/bingx.js +135 -41
  85. package/js/src/bit2c.js +2 -0
  86. package/js/src/bitbank.js +2 -0
  87. package/js/src/bithumb.js +2 -0
  88. package/js/src/bitmart.d.ts +1 -0
  89. package/js/src/bitmart.js +33 -11
  90. package/js/src/bitopro.js +2 -0
  91. package/js/src/bitpanda.js +2 -0
  92. package/js/src/bitso.js +2 -0
  93. package/js/src/bitstamp.js +2 -0
  94. package/js/src/bittrex.js +2 -0
  95. package/js/src/bitvavo.js +2 -0
  96. package/js/src/bl3p.js +2 -0
  97. package/js/src/btcalpha.js +2 -0
  98. package/js/src/btcbox.js +2 -0
  99. package/js/src/btcmarkets.js +2 -0
  100. package/js/src/btcturk.js +2 -0
  101. package/js/src/bybit.js +2 -0
  102. package/js/src/coinbase.js +2 -0
  103. package/js/src/coincheck.js +2 -0
  104. package/js/src/coinlist.js +2 -0
  105. package/js/src/coinmate.js +2 -0
  106. package/js/src/coinone.js +2 -0
  107. package/js/src/coinsph.js +2 -0
  108. package/js/src/coinspot.js +2 -0
  109. package/js/src/cryptocom.d.ts +0 -24
  110. package/js/src/cryptocom.js +2 -185
  111. package/js/src/gate.js +1 -0
  112. package/js/src/gemini.js +23 -19
  113. package/js/src/idex.js +2 -0
  114. package/js/src/independentreserve.js +2 -0
  115. package/js/src/indodax.js +2 -0
  116. package/js/src/kraken.d.ts +2 -0
  117. package/js/src/kraken.js +154 -11
  118. package/js/src/kucoin.js +2 -0
  119. package/js/src/kuna.js +2 -0
  120. package/js/src/latoken.js +2 -0
  121. package/js/src/luno.js +2 -0
  122. package/js/src/mercado.js +2 -0
  123. package/js/src/mexc.js +2 -0
  124. package/js/src/ndax.js +2 -0
  125. package/js/src/novadax.js +2 -0
  126. package/js/src/okx.js +24 -9
  127. package/js/src/p2b.js +2 -0
  128. package/js/src/poloniex.js +27 -25
  129. package/js/src/pro/binance.d.ts +1 -0
  130. package/js/src/pro/binance.js +61 -9
  131. package/js/src/pro/coinbasepro.js +1 -1
  132. package/js/src/static_dependencies/proxies/http-proxy-agent/index.js +9 -8
  133. package/js/src/static_dependencies/proxies/https-proxy-agent/index.js +5 -7
  134. package/js/src/static_dependencies/proxies/https-proxy-agent/parse-proxy-response.js +5 -7
  135. package/js/src/wavesexchange.js +2 -0
  136. package/js/src/wazirx.js +2 -0
  137. package/js/src/woo.js +2 -0
  138. package/js/src/yobit.js +2 -0
  139. package/js/src/zonda.js +2 -0
  140. package/package.json +1 -1
@@ -90,7 +90,7 @@ export default class cryptocom extends Exchange {
90
90
  'fetchTradingFees': false,
91
91
  'fetchTransactionFees': false,
92
92
  'fetchTransactions': false,
93
- 'fetchTransfers': true,
93
+ 'fetchTransfers': false,
94
94
  'fetchUnderlyingAssets': false,
95
95
  'fetchVolatilityHistory': false,
96
96
  'fetchWithdrawals': true,
@@ -99,7 +99,7 @@ export default class cryptocom extends Exchange {
99
99
  'setLeverage': false,
100
100
  'setMarginMode': false,
101
101
  'setPositionMode': false,
102
- 'transfer': true,
102
+ 'transfer': false,
103
103
  'withdraw': true,
104
104
  },
105
105
  'timeframes': {
@@ -1856,189 +1856,6 @@ export default class cryptocom extends Exchange {
1856
1856
  const withdrawalList = this.safeValue(data, 'withdrawal_list', []);
1857
1857
  return this.parseTransactions(withdrawalList, currency, since, limit);
1858
1858
  }
1859
- async transfer(code, amount, fromAccount, toAccount, params = {}) {
1860
- /**
1861
- * @method
1862
- * @name cryptocom#transfer
1863
- * @description transfer currency internally between wallets on the same account
1864
- * @param {string} code unified currency code
1865
- * @param {float} amount amount to transfer
1866
- * @param {string} fromAccount account to transfer from
1867
- * @param {string} toAccount account to transfer to
1868
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1869
- * @returns {object} a [transfer structure]{@link https://docs.ccxt.com/#/?id=transfer-structure}
1870
- */
1871
- await this.loadMarkets();
1872
- const currency = this.currency(code);
1873
- fromAccount = fromAccount.toLowerCase();
1874
- toAccount = toAccount.toLowerCase();
1875
- const accountsById = this.safeValue(this.options, 'accountsById', {});
1876
- const fromId = this.safeString(accountsById, fromAccount, fromAccount);
1877
- const toId = this.safeString(accountsById, toAccount, toAccount);
1878
- const request = {
1879
- 'currency': currency['id'],
1880
- 'amount': parseFloat(amount),
1881
- 'from': fromId,
1882
- 'to': toId,
1883
- };
1884
- let method = 'v2PrivatePostPrivateDerivTransfer';
1885
- if ((fromAccount === 'margin') || (toAccount === 'margin')) {
1886
- method = 'v2PrivatePostPrivateMarginTransfer';
1887
- }
1888
- const response = await this[method](this.extend(request, params));
1889
- //
1890
- // {
1891
- // "id": 11,
1892
- // "method": "private/deriv/transfer",
1893
- // "code": 0
1894
- // }
1895
- //
1896
- return this.parseTransfer(response, currency);
1897
- }
1898
- async fetchTransfers(code = undefined, since = undefined, limit = undefined, params = {}) {
1899
- /**
1900
- * @method
1901
- * @name cryptocom#fetchTransfers
1902
- * @description fetch a history of internal transfers made on an account
1903
- * @param {string} code unified currency code of the currency transferred
1904
- * @param {int} [since] the earliest time in ms to fetch transfers for
1905
- * @param {int} [limit] the maximum number of transfers structures to retrieve
1906
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1907
- * @returns {object[]} a list of [transfer structures]{@link https://docs.ccxt.com/#/?id=transfer-structure}
1908
- */
1909
- if (!('direction' in params)) {
1910
- throw new ArgumentsRequired(this.id + ' fetchTransfers() requires a direction param to be either "IN" or "OUT"');
1911
- }
1912
- await this.loadMarkets();
1913
- let currency = undefined;
1914
- const request = {
1915
- 'direction': 'OUT',
1916
- };
1917
- if (code !== undefined) {
1918
- currency = this.currency(code);
1919
- request['currency'] = currency['id'];
1920
- }
1921
- if (since !== undefined) {
1922
- request['start_ts'] = since;
1923
- }
1924
- if (limit !== undefined) {
1925
- request['page_size'] = limit;
1926
- }
1927
- let method = 'v2PrivatePostPrivateDerivGetTransferHistory';
1928
- const [marginMode, query] = this.customHandleMarginModeAndParams('fetchTransfers', params);
1929
- if (marginMode !== undefined) {
1930
- method = 'v2PrivatePostPrivateMarginGetTransferHistory';
1931
- }
1932
- const response = await this[method](this.extend(request, query));
1933
- //
1934
- // {
1935
- // "id": "1641032709328",
1936
- // "method": "private/deriv/get-transfer-history",
1937
- // "code": "0",
1938
- // "result": {
1939
- // "transfer_list": [
1940
- // {
1941
- // "direction": "IN",
1942
- // "time": "1641025185223",
1943
- // "amount": "109.56",
1944
- // "status": "COMPLETED",
1945
- // "information": "From Spot Wallet",
1946
- // "currency": "USDC"
1947
- // }
1948
- // ]
1949
- // }
1950
- // }
1951
- //
1952
- const transfer = [];
1953
- transfer.push({
1954
- 'response': response,
1955
- });
1956
- return this.parseTransfers(transfer, currency, since, limit, params);
1957
- }
1958
- parseTransferStatus(status) {
1959
- const statuses = {
1960
- 'COMPLETED': 'ok',
1961
- 'PROCESSING': 'pending',
1962
- };
1963
- return this.safeString(statuses, status, status);
1964
- }
1965
- parseTransfer(transfer, currency = undefined) {
1966
- //
1967
- // {
1968
- // "response": {
1969
- // "id": "1641032709328",
1970
- // "method": "private/deriv/get-transfer-history",
1971
- // "code": "0",
1972
- // "result": {
1973
- // "transfer_list": [
1974
- // {
1975
- // "direction": "IN",
1976
- // "time": "1641025185223",
1977
- // "amount": "109.56",
1978
- // "status": "COMPLETED",
1979
- // "information": "From Spot Wallet",
1980
- // "currency": "USDC"
1981
- // }
1982
- // ]
1983
- // }
1984
- // }
1985
- // }
1986
- //
1987
- const response = this.safeValue(transfer, 'response', {});
1988
- const result = this.safeValue(response, 'result', {});
1989
- const transferList = this.safeValue(result, 'transfer_list', []);
1990
- let timestamp = undefined;
1991
- let amount = undefined;
1992
- let code = undefined;
1993
- let information = undefined;
1994
- let status = undefined;
1995
- for (let i = 0; i < transferList.length; i++) {
1996
- const entry = transferList[i];
1997
- timestamp = this.safeInteger(entry, 'time');
1998
- amount = this.safeNumber(entry, 'amount');
1999
- const currencyId = this.safeString(entry, 'currency');
2000
- code = this.safeCurrencyCode(currencyId);
2001
- information = this.safeString(entry, 'information');
2002
- const rawStatus = this.safeString(entry, 'status');
2003
- status = this.parseTransferStatus(rawStatus);
2004
- }
2005
- let fromAccount = undefined;
2006
- let toAccount = undefined;
2007
- if (information !== undefined) {
2008
- const parts = information.split(' ');
2009
- const direction = this.safeStringLower(parts, 0);
2010
- const method = this.safeString(response, 'method');
2011
- if (direction === 'from') {
2012
- fromAccount = this.safeStringLower(parts, 1);
2013
- if (method === 'private/margin/get-transfer-history') {
2014
- toAccount = 'margin';
2015
- }
2016
- else {
2017
- toAccount = 'derivative';
2018
- }
2019
- }
2020
- else if (direction === 'to') {
2021
- toAccount = this.safeStringLower(parts, 1);
2022
- if (method === 'private/margin/get-transfer-history') {
2023
- fromAccount = 'margin';
2024
- }
2025
- else {
2026
- fromAccount = 'derivative';
2027
- }
2028
- }
2029
- }
2030
- return {
2031
- 'info': transferList,
2032
- 'id': this.safeString(response, 'id'),
2033
- 'timestamp': timestamp,
2034
- 'datetime': this.iso8601(timestamp),
2035
- 'currency': code,
2036
- 'amount': amount,
2037
- 'fromAccount': fromAccount,
2038
- 'toAccount': toAccount,
2039
- 'status': status,
2040
- };
2041
- }
2042
1859
  parseTicker(ticker, market = undefined) {
2043
1860
  //
2044
1861
  // fetchTicker
package/js/src/gate.js CHANGED
@@ -50,6 +50,7 @@ export default class gate extends Exchange {
50
50
  'subAccounts': 'https://api.gateio.ws/api/v4',
51
51
  'rebate': 'https://api.gateio.ws/api/v4',
52
52
  'earn': 'https://api.gateio.ws/api/v4',
53
+ 'account': 'https://api.gateio.ws/api/v4',
53
54
  },
54
55
  },
55
56
  'test': {
package/js/src/gemini.js CHANGED
@@ -35,6 +35,8 @@ export default class gemini extends Exchange {
35
35
  'option': false,
36
36
  'addMargin': false,
37
37
  'cancelOrder': true,
38
+ 'closeAllPositions': false,
39
+ 'closePosition': false,
38
40
  'createDepositAddress': true,
39
41
  'createMarketOrder': false,
40
42
  'createOrder': true,
@@ -344,26 +346,28 @@ export default class gemini extends Exchange {
344
346
  const networks = {};
345
347
  const networkId = this.safeString(currency, 9);
346
348
  const networkCode = this.networkIdToCode(networkId);
347
- networks[networkCode] = {
348
- 'info': currency,
349
- 'id': networkId,
350
- 'network': networkCode,
351
- 'active': undefined,
352
- 'deposit': undefined,
353
- 'withdraw': undefined,
354
- 'fee': undefined,
355
- 'precision': precision,
356
- 'limits': {
357
- 'deposit': {
358
- 'min': undefined,
359
- 'max': undefined,
360
- },
361
- 'withdraw': {
362
- 'min': undefined,
363
- 'max': undefined,
349
+ if (networkCode !== undefined) {
350
+ networks[networkCode] = {
351
+ 'info': currency,
352
+ 'id': networkId,
353
+ 'network': networkCode,
354
+ 'active': undefined,
355
+ 'deposit': undefined,
356
+ 'withdraw': undefined,
357
+ 'fee': undefined,
358
+ 'precision': precision,
359
+ 'limits': {
360
+ 'deposit': {
361
+ 'min': undefined,
362
+ 'max': undefined,
363
+ },
364
+ 'withdraw': {
365
+ 'min': undefined,
366
+ 'max': undefined,
367
+ },
364
368
  },
365
- },
366
- };
369
+ };
370
+ }
367
371
  result[code] = {
368
372
  'info': currency,
369
373
  'id': id,
package/js/src/idex.js CHANGED
@@ -40,6 +40,8 @@ export default class idex extends Exchange {
40
40
  'cancelAllOrders': true,
41
41
  'cancelOrder': true,
42
42
  'cancelOrders': false,
43
+ 'closeAllPositions': false,
44
+ 'closePosition': false,
43
45
  'createDepositAddress': false,
44
46
  'createOrder': true,
45
47
  'createReduceOnlyOrder': false,
@@ -31,6 +31,8 @@ export default class independentreserve extends Exchange {
31
31
  'option': false,
32
32
  'addMargin': false,
33
33
  'cancelOrder': true,
34
+ 'closeAllPositions': false,
35
+ 'closePosition': false,
34
36
  'createOrder': true,
35
37
  'createReduceOnlyOrder': false,
36
38
  'createStopLimitOrder': false,
package/js/src/indodax.js CHANGED
@@ -34,6 +34,8 @@ export default class indodax extends Exchange {
34
34
  'cancelAllOrders': false,
35
35
  'cancelOrder': true,
36
36
  'cancelOrders': false,
37
+ 'closeAllPositions': false,
38
+ 'closePosition': false,
37
39
  'createDepositAddress': false,
38
40
  'createOrder': true,
39
41
  'createReduceOnlyOrder': false,
@@ -79,11 +79,13 @@ export default class kraken extends Exchange {
79
79
  fetchOpenOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
80
80
  fetchClosedOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
81
81
  parseTransactionStatus(status: any): string;
82
+ parseNetwork(network: any): string;
82
83
  parseTransaction(transaction: any, currency?: Currency): Transaction;
83
84
  parseTransactionsByType(type: any, transactions: any, code?: Str, since?: Int, limit?: Int): any;
84
85
  fetchDeposits(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
85
86
  fetchTime(params?: {}): Promise<number>;
86
87
  fetchWithdrawals(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
88
+ addPaginationCursorToResult(result: any): any;
87
89
  createDepositAddress(code: string, params?: {}): Promise<{
88
90
  currency: string;
89
91
  address: string;
package/js/src/kraken.js CHANGED
@@ -328,6 +328,91 @@ export default class kraken extends Exchange {
328
328
  'ZEC': 'Zcash (Transparent)',
329
329
  'ZRX': '0x (ZRX)',
330
330
  },
331
+ 'withdrawMethods': {
332
+ 'Lightning': 'Lightning',
333
+ 'Bitcoin': 'BTC',
334
+ 'Ripple': 'XRP',
335
+ 'Litecoin': 'LTC',
336
+ 'Dogecoin': 'DOGE',
337
+ 'Stellar': 'XLM',
338
+ 'Ethereum': 'ERC20',
339
+ 'Arbitrum One': 'Arbitrum',
340
+ 'Polygon': 'MATIC',
341
+ 'Arbitrum Nova': 'Arbitrum',
342
+ 'Optimism': 'Optimism',
343
+ 'zkSync Era': 'zkSync',
344
+ 'Ethereum Classic': 'ETC',
345
+ 'Zcash': 'ZEC',
346
+ 'Monero': 'XMR',
347
+ 'Tron': 'TRC20',
348
+ 'Solana': 'SOL',
349
+ 'EOS': 'EOS',
350
+ 'Bitcoin Cash': 'BCH',
351
+ 'Cardano': 'ADA',
352
+ 'Qtum': 'QTUM',
353
+ 'Tezos': 'XTZ',
354
+ 'Cosmos': 'ATOM',
355
+ 'Nano': 'NANO',
356
+ 'Siacoin': 'SC',
357
+ 'Lisk': 'LSK',
358
+ 'Waves': 'WAVES',
359
+ 'ICON': 'ICX',
360
+ 'Algorand': 'ALGO',
361
+ 'Polygon - USDC.e': 'MATIC',
362
+ 'Arbitrum One - USDC.e': 'Arbitrum',
363
+ 'Polkadot': 'DOT',
364
+ 'Kava': 'KAVA',
365
+ 'Filecoin': 'FIL',
366
+ 'Kusama': 'KSM',
367
+ 'Flow': 'FLOW',
368
+ 'Energy Web': 'EW',
369
+ 'Mina': 'MINA',
370
+ 'Centrifuge': 'CFG',
371
+ 'Karura': 'KAR',
372
+ 'Moonriver': 'MOVR',
373
+ 'Shiden': 'SDN',
374
+ 'Khala': 'PHA',
375
+ 'Bifrost Kusama': 'BNC',
376
+ 'Songbird': 'SGB',
377
+ 'Terra classic': 'LUNC',
378
+ 'KILT': 'KILT',
379
+ 'Basilisk': 'BSX',
380
+ 'Flare': 'FLR',
381
+ 'Avalanche C-Chain': 'AVAX',
382
+ 'Kintsugi': 'KINT',
383
+ 'Altair': 'AIR',
384
+ 'Moonbeam': 'GLMR',
385
+ 'Acala': 'ACA',
386
+ 'Astar': 'ASTR',
387
+ 'Akash': 'AKT',
388
+ 'Robonomics': 'XRT',
389
+ 'Fantom': 'FTM',
390
+ 'Elrond': 'EGLD',
391
+ 'THORchain': 'RUNE',
392
+ 'Secret': 'SCRT',
393
+ 'Near': 'NEAR',
394
+ 'Internet Computer Protocol': 'ICP',
395
+ 'Picasso': 'PICA',
396
+ 'Crust Shadow': 'CSM',
397
+ 'Integritee': 'TEER',
398
+ 'Parallel Finance': 'PARA',
399
+ 'HydraDX': 'HDX',
400
+ 'Interlay': 'INTR',
401
+ 'Fetch.ai': 'FET',
402
+ 'NYM': 'NYM',
403
+ 'Terra 2.0': 'LUNA2',
404
+ 'Juno': 'JUNO',
405
+ 'Nodle': 'NODL',
406
+ 'Stacks': 'STX',
407
+ 'Ethereum PoW': 'ETHW',
408
+ 'Aptos': 'APT',
409
+ 'Sui': 'SUI',
410
+ 'Genshiro': 'GENS',
411
+ 'Aventus': 'AVT',
412
+ 'Sei': 'SEI',
413
+ 'OriginTrail': 'OTP',
414
+ 'Celestia': 'TIA',
415
+ },
331
416
  },
332
417
  'precisionMode': TICK_SIZE,
333
418
  'exceptions': {
@@ -2074,6 +2159,10 @@ export default class kraken extends Exchange {
2074
2159
  };
2075
2160
  return this.safeString(statuses, status, status);
2076
2161
  }
2162
+ parseNetwork(network) {
2163
+ const withdrawMethods = this.safeValue(this.options, 'withdrawMethods', {});
2164
+ return this.safeString(withdrawMethods, network, network);
2165
+ }
2077
2166
  parseTransaction(transaction, currency = undefined) {
2078
2167
  //
2079
2168
  // fetchDeposits
@@ -2124,6 +2213,8 @@ export default class kraken extends Exchange {
2124
2213
  // "fee": "0.0050000000",
2125
2214
  // "time": 1530481750,
2126
2215
  // "status": "Success"
2216
+ // "key":"Huobi wallet",
2217
+ // "network":"Tron"
2127
2218
  // status-prop: 'on-hold' // this field might not be present in some cases
2128
2219
  // }
2129
2220
  //
@@ -2160,7 +2251,7 @@ export default class kraken extends Exchange {
2160
2251
  'id': id,
2161
2252
  'currency': code,
2162
2253
  'amount': amount,
2163
- 'network': undefined,
2254
+ 'network': this.parseNetwork(this.safeString(transaction, 'network')),
2164
2255
  'address': address,
2165
2256
  'addressTo': undefined,
2166
2257
  'addressFrom': undefined,
@@ -2264,19 +2355,28 @@ export default class kraken extends Exchange {
2264
2355
  * @param {int} [since] the earliest time in ms to fetch withdrawals for
2265
2356
  * @param {int} [limit] the maximum number of withdrawals structures to retrieve
2266
2357
  * @param {object} [params] extra parameters specific to the exchange API endpoint
2358
+ * @param {object} [params.end] End timestamp, withdrawals created strictly after will be not be included in the response
2359
+ * @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times
2267
2360
  * @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
2268
- */
2269
- // https://www.kraken.com/en-us/help/api#withdraw-status
2270
- if (code === undefined) {
2271
- throw new ArgumentsRequired(this.id + ' fetchWithdrawals() requires a currency code argument');
2272
- }
2361
+ */
2273
2362
  await this.loadMarkets();
2274
- const currency = this.currency(code);
2275
- const request = {
2276
- 'asset': currency['id'],
2277
- };
2363
+ let paginate = false;
2364
+ [paginate, params] = this.handleOptionAndParams(params, 'fetchWithdrawals', 'paginate');
2365
+ if (paginate) {
2366
+ params['cursor'] = true;
2367
+ return await this.fetchPaginatedCallCursor('fetchWithdrawals', code, since, limit, params, 'next_cursor', 'cursor');
2368
+ }
2369
+ const request = {};
2370
+ if (code !== undefined) {
2371
+ const currency = this.currency(code);
2372
+ request['asset'] = currency['id'];
2373
+ }
2374
+ if (since !== undefined) {
2375
+ request['since'] = since.toString();
2376
+ }
2278
2377
  const response = await this.privatePostWithdrawStatus(this.extend(request, params));
2279
2378
  //
2379
+ // with no pagination
2280
2380
  // { error: [],
2281
2381
  // "result": [ { "method": "Ether",
2282
2382
  // "aclass": "currency",
@@ -2288,8 +2388,51 @@ export default class kraken extends Exchange {
2288
2388
  // "fee": "0.0050000000",
2289
2389
  // "time": 1530481750,
2290
2390
  // "status": "Success" } ] }
2391
+ // with pagination
2392
+ // {
2393
+ // "error":[],
2394
+ // "result":{
2395
+ // "withdrawals":[
2396
+ // {
2397
+ // "method":"Tether USD (TRC20)",
2398
+ // "aclass":"currency",
2399
+ // "asset":"USDT",
2400
+ // "refid":"BSNFZU2-MEFN4G-J3NEZV",
2401
+ // "txid":"1c7a642fb7387bbc2c6a2c509fd1ae146937f4cf793b4079a4f0715e3a02615a",
2402
+ // "info":"TQmdxSuC16EhFg8FZWtYgrfFRosoRF7bCp",
2403
+ // "amount":"1996.50000000",
2404
+ // "fee":"2.50000000",
2405
+ // "time":1669126657,
2406
+ // "status":"Success",
2407
+ // "key":"poloniex",
2408
+ // "network":"Tron"
2409
+ // },
2410
+ // ...
2411
+ // ],
2412
+ // "next_cursor":"HgAAAAAAAABGVFRSd3k1LVF4Y0JQY05Gd0xRY0NxenFndHpybkwBAQH2AwEBAAAAAQAAAAAAAAABAAAAAAAZAAAAAAAAAA=="
2413
+ // }
2414
+ // }
2291
2415
  //
2292
- return this.parseTransactionsByType('withdrawal', response['result'], code, since, limit);
2416
+ let rawWithdrawals = undefined;
2417
+ const result = this.safeValue(response, 'result');
2418
+ if (!Array.isArray(result)) {
2419
+ rawWithdrawals = this.addPaginationCursorToResult(result);
2420
+ }
2421
+ else {
2422
+ rawWithdrawals = result;
2423
+ }
2424
+ return this.parseTransactionsByType('withdrawal', rawWithdrawals, code, since, limit);
2425
+ }
2426
+ addPaginationCursorToResult(result) {
2427
+ const cursor = this.safeString(result, 'next_cursor');
2428
+ const data = this.safeValue(result, 'withdrawals');
2429
+ const dataLength = data.length;
2430
+ if (cursor !== undefined && dataLength > 0) {
2431
+ const last = data[dataLength - 1];
2432
+ last['next_cursor'] = cursor;
2433
+ data[dataLength - 1] = last;
2434
+ }
2435
+ return data;
2293
2436
  }
2294
2437
  async createDepositAddress(code, params = {}) {
2295
2438
  /**
package/js/src/kucoin.js CHANGED
@@ -38,6 +38,8 @@ export default class kucoin extends Exchange {
38
38
  'borrowIsolatedMargin': true,
39
39
  'cancelAllOrders': true,
40
40
  'cancelOrder': true,
41
+ 'closeAllPositions': false,
42
+ 'closePosition': false,
41
43
  'createDepositAddress': true,
42
44
  'createOrder': true,
43
45
  'createOrders': true,
package/js/src/kuna.js CHANGED
@@ -36,6 +36,8 @@ export default class kuna extends Exchange {
36
36
  'borrowMargin': false,
37
37
  'cancelOrder': true,
38
38
  'cancelOrders': true,
39
+ 'closeAllPositions': false,
40
+ 'closePosition': false,
39
41
  'createDepositAddress': true,
40
42
  'createOrder': true,
41
43
  'createPostOnlyOrder': false,
package/js/src/latoken.js CHANGED
@@ -31,6 +31,8 @@ export default class latoken extends Exchange {
31
31
  'option': false,
32
32
  'cancelAllOrders': true,
33
33
  'cancelOrder': true,
34
+ 'closeAllPositions': false,
35
+ 'closePosition': false,
34
36
  'createOrder': true,
35
37
  'createPostOnlyOrder': false,
36
38
  'createStopLimitOrder': true,
package/js/src/luno.js CHANGED
@@ -33,6 +33,8 @@ export default class luno extends Exchange {
33
33
  'option': false,
34
34
  'addMargin': false,
35
35
  'cancelOrder': true,
36
+ 'closeAllPositions': false,
37
+ 'closePosition': false,
36
38
  'createOrder': true,
37
39
  'createReduceOnlyOrder': false,
38
40
  'fetchAccounts': true,
package/js/src/mercado.js CHANGED
@@ -31,6 +31,8 @@ export default class mercado extends Exchange {
31
31
  'option': false,
32
32
  'addMargin': false,
33
33
  'cancelOrder': true,
34
+ 'closeAllPositions': false,
35
+ 'closePosition': false,
34
36
  'createMarketOrder': true,
35
37
  'createOrder': true,
36
38
  'createReduceOnlyOrder': false,
package/js/src/mexc.js CHANGED
@@ -37,6 +37,8 @@ export default class mexc extends Exchange {
37
37
  'cancelAllOrders': true,
38
38
  'cancelOrder': true,
39
39
  'cancelOrders': undefined,
40
+ 'closeAllPositions': false,
41
+ 'closePosition': false,
40
42
  'createDepositAddress': true,
41
43
  'createOrder': true,
42
44
  'createOrders': true,
package/js/src/ndax.js CHANGED
@@ -34,6 +34,8 @@ export default class ndax extends Exchange {
34
34
  'addMargin': false,
35
35
  'cancelAllOrders': true,
36
36
  'cancelOrder': true,
37
+ 'closeAllPositions': false,
38
+ 'closePosition': false,
37
39
  'createDepositAddress': true,
38
40
  'createOrder': true,
39
41
  'createReduceOnlyOrder': false,
package/js/src/novadax.js CHANGED
@@ -35,6 +35,8 @@ export default class novadax extends Exchange {
35
35
  'option': false,
36
36
  'addMargin': false,
37
37
  'cancelOrder': true,
38
+ 'closeAllPositions': false,
39
+ 'closePosition': false,
38
40
  'createOrder': true,
39
41
  'createReduceOnlyOrder': false,
40
42
  'createStopLimitOrder': true,