ccxt 4.1.75 → 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 (122) hide show
  1. package/README.md +3 -3
  2. package/dist/ccxt.browser.js +212 -225
  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 +8 -0
  8. package/dist/cjs/src/base/errors.js +7 -7
  9. package/dist/cjs/src/base/ws/Client.js +2 -0
  10. package/dist/cjs/src/binance.js +4 -0
  11. package/dist/cjs/src/binanceus.js +2 -0
  12. package/dist/cjs/src/bingx.js +78 -23
  13. package/dist/cjs/src/bit2c.js +2 -0
  14. package/dist/cjs/src/bitbank.js +2 -0
  15. package/dist/cjs/src/bithumb.js +2 -0
  16. package/dist/cjs/src/bitopro.js +2 -0
  17. package/dist/cjs/src/bitpanda.js +2 -0
  18. package/dist/cjs/src/bitso.js +2 -0
  19. package/dist/cjs/src/bitstamp.js +2 -0
  20. package/dist/cjs/src/bittrex.js +2 -0
  21. package/dist/cjs/src/bitvavo.js +2 -0
  22. package/dist/cjs/src/bl3p.js +2 -0
  23. package/dist/cjs/src/btcalpha.js +2 -0
  24. package/dist/cjs/src/btcbox.js +2 -0
  25. package/dist/cjs/src/btcmarkets.js +2 -0
  26. package/dist/cjs/src/btcturk.js +2 -0
  27. package/dist/cjs/src/bybit.js +2 -0
  28. package/dist/cjs/src/coinbase.js +2 -0
  29. package/dist/cjs/src/coincheck.js +2 -0
  30. package/dist/cjs/src/coinlist.js +2 -0
  31. package/dist/cjs/src/coinmate.js +2 -0
  32. package/dist/cjs/src/coinone.js +2 -0
  33. package/dist/cjs/src/coinsph.js +2 -0
  34. package/dist/cjs/src/coinspot.js +2 -0
  35. package/dist/cjs/src/cryptocom.js +2 -185
  36. package/dist/cjs/src/gemini.js +2 -0
  37. package/dist/cjs/src/idex.js +2 -0
  38. package/dist/cjs/src/independentreserve.js +2 -0
  39. package/dist/cjs/src/indodax.js +2 -0
  40. package/dist/cjs/src/kucoin.js +2 -0
  41. package/dist/cjs/src/kuna.js +2 -0
  42. package/dist/cjs/src/latoken.js +2 -0
  43. package/dist/cjs/src/luno.js +2 -0
  44. package/dist/cjs/src/mercado.js +2 -0
  45. package/dist/cjs/src/mexc.js +2 -0
  46. package/dist/cjs/src/ndax.js +2 -0
  47. package/dist/cjs/src/novadax.js +2 -0
  48. package/dist/cjs/src/okx.js +24 -9
  49. package/dist/cjs/src/p2b.js +2 -0
  50. package/dist/cjs/src/static_dependencies/proxies/http-proxy-agent/index.js +8 -11
  51. package/dist/cjs/src/static_dependencies/proxies/https-proxy-agent/index.js +5 -8
  52. package/dist/cjs/src/static_dependencies/proxies/https-proxy-agent/parse-proxy-response.js +5 -12
  53. package/dist/cjs/src/wavesexchange.js +2 -0
  54. package/dist/cjs/src/wazirx.js +2 -0
  55. package/dist/cjs/src/woo.js +2 -0
  56. package/dist/cjs/src/yobit.js +2 -0
  57. package/dist/cjs/src/zonda.js +2 -0
  58. package/js/ccxt.d.ts +1 -1
  59. package/js/ccxt.js +1 -1
  60. package/js/src/abstract/binance.d.ts +2 -0
  61. package/js/src/abstract/binancecoinm.d.ts +2 -0
  62. package/js/src/abstract/binanceus.d.ts +2 -0
  63. package/js/src/abstract/binanceusdm.d.ts +2 -0
  64. package/js/src/abstract/okx.d.ts +14 -0
  65. package/js/src/ace.js +2 -0
  66. package/js/src/alpaca.js +2 -0
  67. package/js/src/base/Exchange.d.ts +4 -0
  68. package/js/src/base/Exchange.js +8 -0
  69. package/js/src/base/errors.d.ts +4 -4
  70. package/js/src/base/errors.js +7 -7
  71. package/js/src/base/ws/Client.js +2 -0
  72. package/js/src/binance.js +4 -0
  73. package/js/src/binanceus.js +2 -0
  74. package/js/src/bingx.d.ts +4 -3
  75. package/js/src/bingx.js +78 -23
  76. package/js/src/bit2c.js +2 -0
  77. package/js/src/bitbank.js +2 -0
  78. package/js/src/bithumb.js +2 -0
  79. package/js/src/bitopro.js +2 -0
  80. package/js/src/bitpanda.js +2 -0
  81. package/js/src/bitso.js +2 -0
  82. package/js/src/bitstamp.js +2 -0
  83. package/js/src/bittrex.js +2 -0
  84. package/js/src/bitvavo.js +2 -0
  85. package/js/src/bl3p.js +2 -0
  86. package/js/src/btcalpha.js +2 -0
  87. package/js/src/btcbox.js +2 -0
  88. package/js/src/btcmarkets.js +2 -0
  89. package/js/src/btcturk.js +2 -0
  90. package/js/src/bybit.js +2 -0
  91. package/js/src/coinbase.js +2 -0
  92. package/js/src/coincheck.js +2 -0
  93. package/js/src/coinlist.js +2 -0
  94. package/js/src/coinmate.js +2 -0
  95. package/js/src/coinone.js +2 -0
  96. package/js/src/coinsph.js +2 -0
  97. package/js/src/coinspot.js +2 -0
  98. package/js/src/cryptocom.d.ts +0 -24
  99. package/js/src/cryptocom.js +2 -185
  100. package/js/src/gemini.js +2 -0
  101. package/js/src/idex.js +2 -0
  102. package/js/src/independentreserve.js +2 -0
  103. package/js/src/indodax.js +2 -0
  104. package/js/src/kucoin.js +2 -0
  105. package/js/src/kuna.js +2 -0
  106. package/js/src/latoken.js +2 -0
  107. package/js/src/luno.js +2 -0
  108. package/js/src/mercado.js +2 -0
  109. package/js/src/mexc.js +2 -0
  110. package/js/src/ndax.js +2 -0
  111. package/js/src/novadax.js +2 -0
  112. package/js/src/okx.js +24 -9
  113. package/js/src/p2b.js +2 -0
  114. package/js/src/static_dependencies/proxies/http-proxy-agent/index.js +9 -8
  115. package/js/src/static_dependencies/proxies/https-proxy-agent/index.js +5 -7
  116. package/js/src/static_dependencies/proxies/https-proxy-agent/parse-proxy-response.js +5 -7
  117. package/js/src/wavesexchange.js +2 -0
  118. package/js/src/wazirx.js +2 -0
  119. package/js/src/woo.js +2 -0
  120. package/js/src/yobit.js +2 -0
  121. package/js/src/zonda.js +2 -0
  122. package/package.json +1 -1
@@ -35,6 +35,8 @@ export default class coinlist extends Exchange {
35
35
  'cancelAllOrders': true,
36
36
  'cancelOrder': true,
37
37
  'cancelOrders': true,
38
+ 'closeAllPositions': false,
39
+ 'closePosition': false,
38
40
  'createDepositAddress': false,
39
41
  'createOrder': true,
40
42
  'createPostOnlyOrder': true,
@@ -31,6 +31,8 @@ export default class coinmate 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
  'fetchBalance': true,
package/js/src/coinone.js CHANGED
@@ -34,6 +34,8 @@ export default class coinone extends Exchange {
34
34
  'option': false,
35
35
  'addMargin': false,
36
36
  'cancelOrder': true,
37
+ 'closeAllPositions': false,
38
+ 'closePosition': false,
37
39
  'createMarketOrder': false,
38
40
  'createOrder': true,
39
41
  'createReduceOnlyOrder': false,
package/js/src/coinsph.js CHANGED
@@ -35,6 +35,8 @@ export default class coinsph extends Exchange {
35
35
  'cancelAllOrders': true,
36
36
  'cancelOrder': true,
37
37
  'cancelOrders': false,
38
+ 'closeAllPositions': false,
39
+ 'closePosition': false,
38
40
  'createDepositAddress': false,
39
41
  'createOrder': true,
40
42
  'createPostOnlyOrder': false,
@@ -32,6 +32,8 @@ export default class coinspot extends Exchange {
32
32
  'option': false,
33
33
  'addMargin': false,
34
34
  'cancelOrder': true,
35
+ 'closeAllPositions': false,
36
+ 'closePosition': false,
35
37
  'createMarketOrder': false,
36
38
  'createOrder': true,
37
39
  'createReduceOnlyOrder': false,
@@ -32,30 +32,6 @@ export default class cryptocom extends Exchange {
32
32
  safeNetwork(networkId: any): string;
33
33
  fetchDeposits(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
34
34
  fetchWithdrawals(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
35
- transfer(code: string, amount: any, fromAccount: any, toAccount: any, params?: {}): Promise<{
36
- info: any;
37
- id: string;
38
- timestamp: any;
39
- datetime: string;
40
- currency: any;
41
- amount: any;
42
- fromAccount: any;
43
- toAccount: any;
44
- status: any;
45
- }>;
46
- fetchTransfers(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<any>;
47
- parseTransferStatus(status: any): string;
48
- parseTransfer(transfer: any, currency?: Currency): {
49
- info: any;
50
- id: string;
51
- timestamp: any;
52
- datetime: string;
53
- currency: any;
54
- amount: any;
55
- fromAccount: any;
56
- toAccount: any;
57
- status: any;
58
- };
59
35
  parseTicker(ticker: any, market?: Market): Ticker;
60
36
  parseTrade(trade: any, market?: Market): Trade;
61
37
  parseOHLCV(ohlcv: any, market?: Market): OHLCV;
@@ -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/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,
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,
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,
package/js/src/okx.js CHANGED
@@ -238,6 +238,13 @@ export default class okx extends Exchange {
238
238
  'finance/savings/lending-rate-history': 5 / 3,
239
239
  // public broker
240
240
  'finance/sfp/dcd/products': 2 / 3,
241
+ // copytrading
242
+ 'copytrading/public-lead-traders': 4,
243
+ 'copytrading/public-weekly-pnl': 4,
244
+ 'copytrading/public-stats': 4,
245
+ 'copytrading/public-preference-currency': 4,
246
+ 'copytrading/public-current-subpositions': 4,
247
+ 'copytrading/public-subpositions-history': 4,
241
248
  },
242
249
  },
243
250
  'private': {
@@ -347,12 +354,16 @@ export default class okx extends Exchange {
347
354
  'finance/staking-defi/eth/balance': 5 / 3,
348
355
  'finance/staking-defi/eth/purchase-redeem-history': 5 / 3,
349
356
  // copytrading
350
- 'copytrading/current-subpositions': 4,
351
- 'copytrading/subpositions-history': 10,
352
- 'copytrading/instruments': 10,
353
- 'copytrading/profit-sharing-details': 10,
354
- 'copytrading/total-profit-sharing': 10,
355
- 'copytrading/unrealized-profit-sharing-details': 10,
357
+ 'copytrading/current-subpositions': 1,
358
+ 'copytrading/subpositions-history': 1,
359
+ 'copytrading/instruments': 4,
360
+ 'copytrading/profit-sharing-details': 4,
361
+ 'copytrading/total-profit-sharing': 4,
362
+ 'copytrading/unrealized-profit-sharing-details': 4,
363
+ 'copytrading/copy-settings': 4,
364
+ 'copytrading/batch-leverage-info': 4,
365
+ 'copytrading/current-lead-traders': 4,
366
+ 'copytrading/lead-traders-history': 4,
356
367
  // broker
357
368
  'broker/nd/info': 10,
358
369
  'broker/nd/subaccount-info': 10,
@@ -457,9 +468,13 @@ export default class okx extends Exchange {
457
468
  'finance/staking-defi/eth/purchase': 5,
458
469
  'finance/staking-defi/eth/redeem': 5,
459
470
  // copytrading
460
- 'copytrading/algo-order': 20,
461
- 'copytrading/close-subposition': 4,
462
- 'copytrading/set-instruments': 10,
471
+ 'copytrading/algo-order': 1,
472
+ 'copytrading/close-subposition': 1,
473
+ 'copytrading/set-instruments': 4,
474
+ 'copytrading/first-copy-settings': 4,
475
+ 'copytrading/amend-copy-settings': 4,
476
+ 'copytrading/stop-copy-trading': 4,
477
+ 'copytrading/batch-set-leverage': 4,
463
478
  // broker
464
479
  'broker/nd/create-subaccount': 0.25,
465
480
  'broker/nd/delete-subaccount': 1,
package/js/src/p2b.js CHANGED
@@ -33,6 +33,8 @@ export default class p2b extends Exchange {
33
33
  'cancelAllOrders': false,
34
34
  'cancelOrder': true,
35
35
  'cancelOrders': false,
36
+ 'closeAllPositions': false,
37
+ 'closePosition': false,
36
38
  'createDepositAddress': false,
37
39
  'createMarketOrder': false,
38
40
  'createOrder': true,
@@ -6,10 +6,9 @@
6
6
 
7
7
  import * as net from 'net';
8
8
  import * as tls from 'tls';
9
- import createDebug from 'debug';
9
+ // import createDebug from 'debug';
10
10
  import { once } from 'events';
11
11
  import { Agent } from './../agent-base/index.js';
12
- const debug = createDebug('http-proxy-agent');
13
12
  function isHTTPS(protocol) {
14
13
  return typeof protocol === 'string' ? /^https:?$/i.test(protocol) : false;
15
14
  }
@@ -22,7 +21,7 @@ export class HttpProxyAgent extends Agent {
22
21
  super(opts);
23
22
  this.proxy = typeof proxy === 'string' ? new URL(proxy) : proxy;
24
23
  this.proxyHeaders = opts?.headers ?? {};
25
- debug('Creating new HttpProxyAgent instance: %o', this.proxy.href);
24
+ // debug('Creating new HttpProxyAgent instance: %o', this.proxy.href);
26
25
  // Trim off the brackets from IPv6 addresses
27
26
  const host = (this.proxy.hostname || this.proxy.host).replace(/^\[|\]$/g, '');
28
27
  const port = this.proxy.port
@@ -74,11 +73,11 @@ export class HttpProxyAgent extends Agent {
74
73
  // Create a socket connection to the proxy server.
75
74
  let socket;
76
75
  if (this.secureProxy) {
77
- debug('Creating `tls.Socket`: %o', this.connectOpts);
76
+ // debug('Creating `tls.Socket`: %o', this.connectOpts);
78
77
  socket = tls.connect(this.connectOpts);
79
78
  }
80
79
  else {
81
- debug('Creating `net.Socket`: %o', this.connectOpts);
80
+ // debug('Creating `net.Socket`: %o', this.connectOpts);
82
81
  socket = net.connect(this.connectOpts);
83
82
  }
84
83
  // At this point, the http ClientRequest's internal `_header` field
@@ -86,16 +85,18 @@ export class HttpProxyAgent extends Agent {
86
85
  // to re-generate the string since we just changed the `req.path`.
87
86
  let first;
88
87
  let endOfHeaders;
89
- debug('Regenerating stored HTTP header string for request');
88
+ // debug('Regenerating stored HTTP header string for request');
90
89
  req._implicitHeader();
91
90
  if (req.outputData && req.outputData.length > 0) {
92
91
  // Node >= 12
93
- debug('Patching connection write() output buffer with updated header');
92
+ // debug(
93
+ // 'Patching connection write() output buffer with updated header'
94
+ // );
94
95
  first = req.outputData[0].data;
95
96
  endOfHeaders = first.indexOf('\r\n\r\n') + 4;
96
97
  req.outputData[0].data =
97
98
  req._header + first.substring(endOfHeaders);
98
- debug('Output buffer: %o', req.outputData[0].data);
99
+ // debug('Output buffer: %o', req.outputData[0].data);
99
100
  }
100
101
  // Wait for the socket's `connect` event, so that this `callback()`
101
102
  // function throws instead of the `http` request machinery. This is
@@ -7,10 +7,8 @@
7
7
  import * as net from 'net';
8
8
  import * as tls from 'tls';
9
9
  import assert from 'assert';
10
- import createDebug from 'debug';
11
10
  import { Agent } from './../agent-base/index.js';
12
11
  import { parseProxyResponse } from './parse-proxy-response.js';
13
- const debug = createDebug('https-proxy-agent');
14
12
  /**
15
13
  * The `HttpsProxyAgent` implements an HTTP Agent subclass that connects to
16
14
  * the specified "HTTP(s) proxy server" in order to proxy HTTPS requests.
@@ -29,7 +27,7 @@ export class HttpsProxyAgent extends Agent {
29
27
  this.options = { path: undefined };
30
28
  this.proxy = typeof proxy === 'string' ? new URL(proxy) : proxy;
31
29
  this.proxyHeaders = opts?.headers ?? {};
32
- debug('Creating new HttpsProxyAgent instance: %o', this.proxy.href);
30
+ // debug('Creating new HttpsProxyAgent instance: %o', this.proxy.href);
33
31
  // Trim off the brackets from IPv6 addresses
34
32
  const host = (this.proxy.hostname || this.proxy.host).replace(/^\[|\]$/g, '');
35
33
  const port = this.proxy.port
@@ -60,11 +58,11 @@ export class HttpsProxyAgent extends Agent {
60
58
  // Create a socket connection to the proxy server.
61
59
  let socket;
62
60
  if (secureProxy) {
63
- debug('Creating `tls.Socket`: %o', this.connectOpts);
61
+ // debug('Creating `tls.Socket`: %o', this.connectOpts);
64
62
  socket = tls.connect(this.connectOpts);
65
63
  }
66
64
  else {
67
- debug('Creating `net.Socket`: %o', this.connectOpts);
65
+ // debug('Creating `net.Socket`: %o', this.connectOpts);
68
66
  socket = net.connect(this.connectOpts);
69
67
  }
70
68
  const headers = typeof this.proxyHeaders === 'function'
@@ -97,7 +95,7 @@ export class HttpsProxyAgent extends Agent {
97
95
  if (opts.secureEndpoint) {
98
96
  // The proxy is connecting to a TLS server, so upgrade
99
97
  // this socket connection to a TLS connection.
100
- debug('Upgrading socket connection to TLS');
98
+ // debug('Upgrading socket connection to TLS');
101
99
  const servername = opts.servername || opts.host;
102
100
  return tls.connect({
103
101
  ...omit(opts, 'host', 'path', 'port'),
@@ -122,7 +120,7 @@ export class HttpsProxyAgent extends Agent {
122
120
  fakeSocket.readable = true;
123
121
  // Need to wait for the "socket" event to re-play the "data" events.
124
122
  req.once('socket', (s) => {
125
- debug('Replaying proxy buffer for failed request');
123
+ // debug('Replaying proxy buffer for failed request');
126
124
  assert(s.listenerCount('data') > 0);
127
125
  // Replay the "buffered" Buffer onto the fake `socket`, since at
128
126
  // this point the HTTP module machinery has been hooked up for
@@ -4,8 +4,6 @@
4
4
  // https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
5
5
  // EDIT THE CORRESPONDENT .ts FILE INSTEAD
6
6
 
7
- import createDebug from 'debug';
8
- const debug = createDebug('https-proxy-agent:parse-proxy-response');
9
7
  export function parseProxyResponse(socket) {
10
8
  return new Promise((resolve, reject) => {
11
9
  // we need to buffer any HTTP traffic that happens with the proxy before we get
@@ -28,14 +26,14 @@ export function parseProxyResponse(socket) {
28
26
  socket.removeListener('readable', read);
29
27
  }
30
28
  function onclose(err) {
31
- debug('onclose had error %o', err);
29
+ // debug('onclose had error %o', err);
32
30
  }
33
31
  function onend() {
34
- debug('onend');
32
+ // debug('onend');
35
33
  }
36
34
  function onerror(err) {
37
35
  cleanup();
38
- debug('onerror %o', err);
36
+ // debug('onerror %o', err);
39
37
  reject(err);
40
38
  }
41
39
  function ondata(b) {
@@ -45,7 +43,7 @@ export function parseProxyResponse(socket) {
45
43
  const endOfHeaders = buffered.indexOf('\r\n\r\n');
46
44
  if (endOfHeaders === -1) {
47
45
  // keep buffering
48
- debug('have not received end of HTTP headers yet...');
46
+ // debug('have not received end of HTTP headers yet...');
49
47
  read();
50
48
  return;
51
49
  }
@@ -78,7 +76,7 @@ export function parseProxyResponse(socket) {
78
76
  headers[key] = value;
79
77
  }
80
78
  }
81
- debug('got proxy server response: %o', firstLine);
79
+ // debug('got proxy server response: %o', firstLine);
82
80
  cleanup();
83
81
  resolve({
84
82
  connect: {
@@ -32,6 +32,8 @@ export default class wavesexchange extends Exchange {
32
32
  'option': false,
33
33
  'addMargin': false,
34
34
  'cancelOrder': true,
35
+ 'closeAllPositions': false,
36
+ 'closePosition': false,
35
37
  'createMarketOrder': true,
36
38
  'createOrder': true,
37
39
  'createReduceOnlyOrder': false,
package/js/src/wazirx.js CHANGED
@@ -33,6 +33,8 @@ export default class wazirx extends Exchange {
33
33
  'borrowMargin': false,
34
34
  'cancelAllOrders': true,
35
35
  'cancelOrder': true,
36
+ 'closeAllPositions': false,
37
+ 'closePosition': false,
36
38
  'createOrder': true,
37
39
  'createReduceOnlyOrder': false,
38
40
  'createStopLimitOrder': true,