ccxt 4.1.75 → 4.1.77

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 (131) hide show
  1. package/README.md +3 -3
  2. package/dist/ccxt.browser.js +287 -235
  3. package/dist/ccxt.browser.min.js +5 -5
  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 +80 -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/bitmex.js +6 -0
  17. package/dist/cjs/src/bitopro.js +2 -0
  18. package/dist/cjs/src/bitpanda.js +2 -0
  19. package/dist/cjs/src/bitrue.js +27 -1
  20. package/dist/cjs/src/bitso.js +2 -0
  21. package/dist/cjs/src/bitstamp.js +5 -2
  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 +37 -6
  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 +2 -0
  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/kucoin.js +2 -0
  44. package/dist/cjs/src/kuna.js +2 -0
  45. package/dist/cjs/src/latoken.js +2 -0
  46. package/dist/cjs/src/luno.js +2 -0
  47. package/dist/cjs/src/mercado.js +2 -0
  48. package/dist/cjs/src/mexc.js +2 -0
  49. package/dist/cjs/src/ndax.js +2 -0
  50. package/dist/cjs/src/novadax.js +2 -0
  51. package/dist/cjs/src/okx.js +25 -10
  52. package/dist/cjs/src/p2b.js +2 -0
  53. package/dist/cjs/src/static_dependencies/proxies/http-proxy-agent/index.js +8 -11
  54. package/dist/cjs/src/static_dependencies/proxies/https-proxy-agent/index.js +5 -8
  55. package/dist/cjs/src/static_dependencies/proxies/https-proxy-agent/parse-proxy-response.js +5 -12
  56. package/dist/cjs/src/wavesexchange.js +2 -0
  57. package/dist/cjs/src/wazirx.js +2 -0
  58. package/dist/cjs/src/woo.js +2 -0
  59. package/dist/cjs/src/yobit.js +2 -0
  60. package/dist/cjs/src/zonda.js +2 -0
  61. package/js/ccxt.d.ts +1 -1
  62. package/js/ccxt.js +1 -1
  63. package/js/src/abstract/binance.d.ts +2 -0
  64. package/js/src/abstract/binancecoinm.d.ts +2 -0
  65. package/js/src/abstract/binanceus.d.ts +2 -0
  66. package/js/src/abstract/binanceusdm.d.ts +2 -0
  67. package/js/src/abstract/okx.d.ts +14 -0
  68. package/js/src/ace.js +2 -0
  69. package/js/src/alpaca.js +2 -0
  70. package/js/src/base/Exchange.d.ts +4 -0
  71. package/js/src/base/Exchange.js +8 -0
  72. package/js/src/base/errors.d.ts +4 -4
  73. package/js/src/base/errors.js +7 -7
  74. package/js/src/base/ws/Client.js +2 -0
  75. package/js/src/binance.js +4 -0
  76. package/js/src/binanceus.js +2 -0
  77. package/js/src/bingx.d.ts +4 -3
  78. package/js/src/bingx.js +80 -23
  79. package/js/src/bit2c.js +2 -0
  80. package/js/src/bitbank.js +2 -0
  81. package/js/src/bithumb.js +2 -0
  82. package/js/src/bitmex.d.ts +1 -1
  83. package/js/src/bitmex.js +6 -0
  84. package/js/src/bitopro.js +2 -0
  85. package/js/src/bitpanda.js +2 -0
  86. package/js/src/bitrue.d.ts +1 -0
  87. package/js/src/bitrue.js +27 -1
  88. package/js/src/bitso.js +2 -0
  89. package/js/src/bitstamp.js +5 -2
  90. package/js/src/bittrex.js +2 -0
  91. package/js/src/bitvavo.js +2 -0
  92. package/js/src/bl3p.js +2 -0
  93. package/js/src/btcalpha.js +2 -0
  94. package/js/src/btcbox.js +2 -0
  95. package/js/src/btcmarkets.js +2 -0
  96. package/js/src/btcturk.js +2 -0
  97. package/js/src/bybit.js +2 -0
  98. package/js/src/coinbase.d.ts +1 -0
  99. package/js/src/coinbase.js +37 -6
  100. package/js/src/coincheck.js +2 -0
  101. package/js/src/coinlist.js +2 -0
  102. package/js/src/coinmate.js +2 -0
  103. package/js/src/coinone.js +2 -0
  104. package/js/src/coinsph.js +2 -0
  105. package/js/src/coinspot.js +2 -0
  106. package/js/src/cryptocom.d.ts +0 -24
  107. package/js/src/cryptocom.js +2 -185
  108. package/js/src/gate.js +1 -0
  109. package/js/src/gemini.js +2 -0
  110. package/js/src/idex.js +2 -0
  111. package/js/src/independentreserve.js +2 -0
  112. package/js/src/indodax.js +2 -0
  113. package/js/src/kucoin.js +2 -0
  114. package/js/src/kuna.js +2 -0
  115. package/js/src/latoken.js +2 -0
  116. package/js/src/luno.js +2 -0
  117. package/js/src/mercado.js +2 -0
  118. package/js/src/mexc.js +2 -0
  119. package/js/src/ndax.js +2 -0
  120. package/js/src/novadax.js +2 -0
  121. package/js/src/okx.js +25 -10
  122. package/js/src/p2b.js +2 -0
  123. package/js/src/static_dependencies/proxies/http-proxy-agent/index.js +9 -8
  124. package/js/src/static_dependencies/proxies/https-proxy-agent/index.js +5 -7
  125. package/js/src/static_dependencies/proxies/https-proxy-agent/parse-proxy-response.js +5 -7
  126. package/js/src/wavesexchange.js +2 -0
  127. package/js/src/wazirx.js +2 -0
  128. package/js/src/woo.js +2 -0
  129. package/js/src/yobit.js +2 -0
  130. package/js/src/zonda.js +2 -0
  131. package/package.json +1 -1
@@ -27,6 +27,8 @@ class coincheck extends coincheck$1 {
27
27
  'option': false,
28
28
  'addMargin': false,
29
29
  'cancelOrder': true,
30
+ 'closeAllPositions': false,
31
+ 'closePosition': false,
30
32
  'createOrder': true,
31
33
  'createReduceOnlyOrder': false,
32
34
  'fetchBalance': true,
@@ -32,6 +32,8 @@ class coinlist extends coinlist$1 {
32
32
  'cancelAllOrders': true,
33
33
  'cancelOrder': true,
34
34
  'cancelOrders': true,
35
+ 'closeAllPositions': false,
36
+ 'closePosition': false,
35
37
  'createDepositAddress': false,
36
38
  'createOrder': true,
37
39
  'createPostOnlyOrder': true,
@@ -28,6 +28,8 @@ class coinmate extends coinmate$1 {
28
28
  'option': false,
29
29
  'addMargin': false,
30
30
  'cancelOrder': true,
31
+ 'closeAllPositions': false,
32
+ 'closePosition': false,
31
33
  'createOrder': true,
32
34
  'createReduceOnlyOrder': false,
33
35
  'fetchBalance': true,
@@ -31,6 +31,8 @@ class coinone extends coinone$1 {
31
31
  'option': false,
32
32
  'addMargin': false,
33
33
  'cancelOrder': true,
34
+ 'closeAllPositions': false,
35
+ 'closePosition': false,
34
36
  'createMarketOrder': false,
35
37
  'createOrder': true,
36
38
  'createReduceOnlyOrder': false,
@@ -32,6 +32,8 @@ class coinsph extends coinsph$1 {
32
32
  'cancelAllOrders': true,
33
33
  'cancelOrder': true,
34
34
  'cancelOrders': false,
35
+ 'closeAllPositions': false,
36
+ 'closePosition': false,
35
37
  'createDepositAddress': false,
36
38
  'createOrder': true,
37
39
  'createPostOnlyOrder': false,
@@ -29,6 +29,8 @@ class coinspot extends coinspot$1 {
29
29
  'option': false,
30
30
  'addMargin': false,
31
31
  'cancelOrder': true,
32
+ 'closeAllPositions': false,
33
+ 'closePosition': false,
32
34
  'createMarketOrder': false,
33
35
  'createOrder': true,
34
36
  'createReduceOnlyOrder': false,
@@ -87,7 +87,7 @@ class cryptocom extends cryptocom$1 {
87
87
  'fetchTradingFees': false,
88
88
  'fetchTransactionFees': false,
89
89
  'fetchTransactions': false,
90
- 'fetchTransfers': true,
90
+ 'fetchTransfers': false,
91
91
  'fetchUnderlyingAssets': false,
92
92
  'fetchVolatilityHistory': false,
93
93
  'fetchWithdrawals': true,
@@ -96,7 +96,7 @@ class cryptocom extends cryptocom$1 {
96
96
  'setLeverage': false,
97
97
  'setMarginMode': false,
98
98
  'setPositionMode': false,
99
- 'transfer': true,
99
+ 'transfer': false,
100
100
  'withdraw': true,
101
101
  },
102
102
  'timeframes': {
@@ -1853,189 +1853,6 @@ class cryptocom extends cryptocom$1 {
1853
1853
  const withdrawalList = this.safeValue(data, 'withdrawal_list', []);
1854
1854
  return this.parseTransactions(withdrawalList, currency, since, limit);
1855
1855
  }
1856
- async transfer(code, amount, fromAccount, toAccount, params = {}) {
1857
- /**
1858
- * @method
1859
- * @name cryptocom#transfer
1860
- * @description transfer currency internally between wallets on the same account
1861
- * @param {string} code unified currency code
1862
- * @param {float} amount amount to transfer
1863
- * @param {string} fromAccount account to transfer from
1864
- * @param {string} toAccount account to transfer to
1865
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1866
- * @returns {object} a [transfer structure]{@link https://docs.ccxt.com/#/?id=transfer-structure}
1867
- */
1868
- await this.loadMarkets();
1869
- const currency = this.currency(code);
1870
- fromAccount = fromAccount.toLowerCase();
1871
- toAccount = toAccount.toLowerCase();
1872
- const accountsById = this.safeValue(this.options, 'accountsById', {});
1873
- const fromId = this.safeString(accountsById, fromAccount, fromAccount);
1874
- const toId = this.safeString(accountsById, toAccount, toAccount);
1875
- const request = {
1876
- 'currency': currency['id'],
1877
- 'amount': parseFloat(amount),
1878
- 'from': fromId,
1879
- 'to': toId,
1880
- };
1881
- let method = 'v2PrivatePostPrivateDerivTransfer';
1882
- if ((fromAccount === 'margin') || (toAccount === 'margin')) {
1883
- method = 'v2PrivatePostPrivateMarginTransfer';
1884
- }
1885
- const response = await this[method](this.extend(request, params));
1886
- //
1887
- // {
1888
- // "id": 11,
1889
- // "method": "private/deriv/transfer",
1890
- // "code": 0
1891
- // }
1892
- //
1893
- return this.parseTransfer(response, currency);
1894
- }
1895
- async fetchTransfers(code = undefined, since = undefined, limit = undefined, params = {}) {
1896
- /**
1897
- * @method
1898
- * @name cryptocom#fetchTransfers
1899
- * @description fetch a history of internal transfers made on an account
1900
- * @param {string} code unified currency code of the currency transferred
1901
- * @param {int} [since] the earliest time in ms to fetch transfers for
1902
- * @param {int} [limit] the maximum number of transfers structures to retrieve
1903
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1904
- * @returns {object[]} a list of [transfer structures]{@link https://docs.ccxt.com/#/?id=transfer-structure}
1905
- */
1906
- if (!('direction' in params)) {
1907
- throw new errors.ArgumentsRequired(this.id + ' fetchTransfers() requires a direction param to be either "IN" or "OUT"');
1908
- }
1909
- await this.loadMarkets();
1910
- let currency = undefined;
1911
- const request = {
1912
- 'direction': 'OUT',
1913
- };
1914
- if (code !== undefined) {
1915
- currency = this.currency(code);
1916
- request['currency'] = currency['id'];
1917
- }
1918
- if (since !== undefined) {
1919
- request['start_ts'] = since;
1920
- }
1921
- if (limit !== undefined) {
1922
- request['page_size'] = limit;
1923
- }
1924
- let method = 'v2PrivatePostPrivateDerivGetTransferHistory';
1925
- const [marginMode, query] = this.customHandleMarginModeAndParams('fetchTransfers', params);
1926
- if (marginMode !== undefined) {
1927
- method = 'v2PrivatePostPrivateMarginGetTransferHistory';
1928
- }
1929
- const response = await this[method](this.extend(request, query));
1930
- //
1931
- // {
1932
- // "id": "1641032709328",
1933
- // "method": "private/deriv/get-transfer-history",
1934
- // "code": "0",
1935
- // "result": {
1936
- // "transfer_list": [
1937
- // {
1938
- // "direction": "IN",
1939
- // "time": "1641025185223",
1940
- // "amount": "109.56",
1941
- // "status": "COMPLETED",
1942
- // "information": "From Spot Wallet",
1943
- // "currency": "USDC"
1944
- // }
1945
- // ]
1946
- // }
1947
- // }
1948
- //
1949
- const transfer = [];
1950
- transfer.push({
1951
- 'response': response,
1952
- });
1953
- return this.parseTransfers(transfer, currency, since, limit, params);
1954
- }
1955
- parseTransferStatus(status) {
1956
- const statuses = {
1957
- 'COMPLETED': 'ok',
1958
- 'PROCESSING': 'pending',
1959
- };
1960
- return this.safeString(statuses, status, status);
1961
- }
1962
- parseTransfer(transfer, currency = undefined) {
1963
- //
1964
- // {
1965
- // "response": {
1966
- // "id": "1641032709328",
1967
- // "method": "private/deriv/get-transfer-history",
1968
- // "code": "0",
1969
- // "result": {
1970
- // "transfer_list": [
1971
- // {
1972
- // "direction": "IN",
1973
- // "time": "1641025185223",
1974
- // "amount": "109.56",
1975
- // "status": "COMPLETED",
1976
- // "information": "From Spot Wallet",
1977
- // "currency": "USDC"
1978
- // }
1979
- // ]
1980
- // }
1981
- // }
1982
- // }
1983
- //
1984
- const response = this.safeValue(transfer, 'response', {});
1985
- const result = this.safeValue(response, 'result', {});
1986
- const transferList = this.safeValue(result, 'transfer_list', []);
1987
- let timestamp = undefined;
1988
- let amount = undefined;
1989
- let code = undefined;
1990
- let information = undefined;
1991
- let status = undefined;
1992
- for (let i = 0; i < transferList.length; i++) {
1993
- const entry = transferList[i];
1994
- timestamp = this.safeInteger(entry, 'time');
1995
- amount = this.safeNumber(entry, 'amount');
1996
- const currencyId = this.safeString(entry, 'currency');
1997
- code = this.safeCurrencyCode(currencyId);
1998
- information = this.safeString(entry, 'information');
1999
- const rawStatus = this.safeString(entry, 'status');
2000
- status = this.parseTransferStatus(rawStatus);
2001
- }
2002
- let fromAccount = undefined;
2003
- let toAccount = undefined;
2004
- if (information !== undefined) {
2005
- const parts = information.split(' ');
2006
- const direction = this.safeStringLower(parts, 0);
2007
- const method = this.safeString(response, 'method');
2008
- if (direction === 'from') {
2009
- fromAccount = this.safeStringLower(parts, 1);
2010
- if (method === 'private/margin/get-transfer-history') {
2011
- toAccount = 'margin';
2012
- }
2013
- else {
2014
- toAccount = 'derivative';
2015
- }
2016
- }
2017
- else if (direction === 'to') {
2018
- toAccount = this.safeStringLower(parts, 1);
2019
- if (method === 'private/margin/get-transfer-history') {
2020
- fromAccount = 'margin';
2021
- }
2022
- else {
2023
- fromAccount = 'derivative';
2024
- }
2025
- }
2026
- }
2027
- return {
2028
- 'info': transferList,
2029
- 'id': this.safeString(response, 'id'),
2030
- 'timestamp': timestamp,
2031
- 'datetime': this.iso8601(timestamp),
2032
- 'currency': code,
2033
- 'amount': amount,
2034
- 'fromAccount': fromAccount,
2035
- 'toAccount': toAccount,
2036
- 'status': status,
2037
- };
2038
- }
2039
1856
  parseTicker(ticker, market = undefined) {
2040
1857
  //
2041
1858
  // fetchTicker
@@ -542,6 +542,7 @@ class gate extends gate$1 {
542
542
  '15m': '15m',
543
543
  '30m': '30m',
544
544
  '1h': '1h',
545
+ '2h': '2h',
545
546
  '4h': '4h',
546
547
  '8h': '8h',
547
548
  '1d': '1d',
@@ -32,6 +32,8 @@ class gemini extends gemini$1 {
32
32
  'option': false,
33
33
  'addMargin': false,
34
34
  'cancelOrder': true,
35
+ 'closeAllPositions': false,
36
+ 'closePosition': false,
35
37
  'createDepositAddress': true,
36
38
  'createMarketOrder': false,
37
39
  'createOrder': true,
@@ -37,6 +37,8 @@ class idex extends idex$1 {
37
37
  'cancelAllOrders': true,
38
38
  'cancelOrder': true,
39
39
  'cancelOrders': false,
40
+ 'closeAllPositions': false,
41
+ 'closePosition': false,
40
42
  'createDepositAddress': false,
41
43
  'createOrder': true,
42
44
  'createReduceOnlyOrder': false,
@@ -28,6 +28,8 @@ class independentreserve extends independentreserve$1 {
28
28
  'option': false,
29
29
  'addMargin': false,
30
30
  'cancelOrder': true,
31
+ 'closeAllPositions': false,
32
+ 'closePosition': false,
31
33
  'createOrder': true,
32
34
  'createReduceOnlyOrder': false,
33
35
  'createStopLimitOrder': false,
@@ -31,6 +31,8 @@ class indodax extends indodax$1 {
31
31
  'cancelAllOrders': false,
32
32
  'cancelOrder': true,
33
33
  'cancelOrders': false,
34
+ 'closeAllPositions': false,
35
+ 'closePosition': false,
34
36
  'createDepositAddress': false,
35
37
  'createOrder': true,
36
38
  'createReduceOnlyOrder': false,
@@ -35,6 +35,8 @@ class kucoin extends kucoin$1 {
35
35
  'borrowIsolatedMargin': true,
36
36
  'cancelAllOrders': true,
37
37
  'cancelOrder': true,
38
+ 'closeAllPositions': false,
39
+ 'closePosition': false,
38
40
  'createDepositAddress': true,
39
41
  'createOrder': true,
40
42
  'createOrders': true,
@@ -33,6 +33,8 @@ class kuna extends kuna$1 {
33
33
  'borrowMargin': false,
34
34
  'cancelOrder': true,
35
35
  'cancelOrders': true,
36
+ 'closeAllPositions': false,
37
+ 'closePosition': false,
36
38
  'createDepositAddress': true,
37
39
  'createOrder': true,
38
40
  'createPostOnlyOrder': false,
@@ -28,6 +28,8 @@ class latoken extends latoken$1 {
28
28
  'option': false,
29
29
  'cancelAllOrders': true,
30
30
  'cancelOrder': true,
31
+ 'closeAllPositions': false,
32
+ 'closePosition': false,
31
33
  'createOrder': true,
32
34
  'createPostOnlyOrder': false,
33
35
  'createStopLimitOrder': true,
@@ -30,6 +30,8 @@ class luno extends luno$1 {
30
30
  'option': false,
31
31
  'addMargin': false,
32
32
  'cancelOrder': true,
33
+ 'closeAllPositions': false,
34
+ 'closePosition': false,
33
35
  'createOrder': true,
34
36
  'createReduceOnlyOrder': false,
35
37
  'fetchAccounts': true,
@@ -28,6 +28,8 @@ class mercado extends mercado$1 {
28
28
  'option': false,
29
29
  'addMargin': false,
30
30
  'cancelOrder': true,
31
+ 'closeAllPositions': false,
32
+ 'closePosition': false,
31
33
  'createMarketOrder': true,
32
34
  'createOrder': true,
33
35
  'createReduceOnlyOrder': false,
@@ -34,6 +34,8 @@ class mexc extends mexc$1 {
34
34
  'cancelAllOrders': true,
35
35
  'cancelOrder': true,
36
36
  'cancelOrders': undefined,
37
+ 'closeAllPositions': false,
38
+ 'closePosition': false,
37
39
  'createDepositAddress': true,
38
40
  'createOrder': true,
39
41
  'createOrders': true,
@@ -31,6 +31,8 @@ class ndax extends ndax$1 {
31
31
  'addMargin': false,
32
32
  'cancelAllOrders': true,
33
33
  'cancelOrder': true,
34
+ 'closeAllPositions': false,
35
+ 'closePosition': false,
34
36
  'createDepositAddress': true,
35
37
  'createOrder': true,
36
38
  'createReduceOnlyOrder': false,
@@ -32,6 +32,8 @@ class novadax extends novadax$1 {
32
32
  'option': false,
33
33
  'addMargin': false,
34
34
  'cancelOrder': true,
35
+ 'closeAllPositions': false,
36
+ 'closePosition': false,
35
37
  'createOrder': true,
36
38
  'createReduceOnlyOrder': false,
37
39
  'createStopLimitOrder': true,
@@ -19,7 +19,7 @@ class okx extends okx$1 {
19
19
  'name': 'OKX',
20
20
  'countries': ['CN', 'US'],
21
21
  'version': 'v5',
22
- 'rateLimit': 100,
22
+ 'rateLimit': 100 * 1.03,
23
23
  'pro': true,
24
24
  'certified': true,
25
25
  'has': {
@@ -235,6 +235,13 @@ class okx extends okx$1 {
235
235
  'finance/savings/lending-rate-history': 5 / 3,
236
236
  // public broker
237
237
  'finance/sfp/dcd/products': 2 / 3,
238
+ // copytrading
239
+ 'copytrading/public-lead-traders': 4,
240
+ 'copytrading/public-weekly-pnl': 4,
241
+ 'copytrading/public-stats': 4,
242
+ 'copytrading/public-preference-currency': 4,
243
+ 'copytrading/public-current-subpositions': 4,
244
+ 'copytrading/public-subpositions-history': 4,
238
245
  },
239
246
  },
240
247
  'private': {
@@ -344,12 +351,16 @@ class okx extends okx$1 {
344
351
  'finance/staking-defi/eth/balance': 5 / 3,
345
352
  'finance/staking-defi/eth/purchase-redeem-history': 5 / 3,
346
353
  // copytrading
347
- 'copytrading/current-subpositions': 4,
348
- 'copytrading/subpositions-history': 10,
349
- 'copytrading/instruments': 10,
350
- 'copytrading/profit-sharing-details': 10,
351
- 'copytrading/total-profit-sharing': 10,
352
- 'copytrading/unrealized-profit-sharing-details': 10,
354
+ 'copytrading/current-subpositions': 1,
355
+ 'copytrading/subpositions-history': 1,
356
+ 'copytrading/instruments': 4,
357
+ 'copytrading/profit-sharing-details': 4,
358
+ 'copytrading/total-profit-sharing': 4,
359
+ 'copytrading/unrealized-profit-sharing-details': 4,
360
+ 'copytrading/copy-settings': 4,
361
+ 'copytrading/batch-leverage-info': 4,
362
+ 'copytrading/current-lead-traders': 4,
363
+ 'copytrading/lead-traders-history': 4,
353
364
  // broker
354
365
  'broker/nd/info': 10,
355
366
  'broker/nd/subaccount-info': 10,
@@ -454,9 +465,13 @@ class okx extends okx$1 {
454
465
  'finance/staking-defi/eth/purchase': 5,
455
466
  'finance/staking-defi/eth/redeem': 5,
456
467
  // copytrading
457
- 'copytrading/algo-order': 20,
458
- 'copytrading/close-subposition': 4,
459
- 'copytrading/set-instruments': 10,
468
+ 'copytrading/algo-order': 1,
469
+ 'copytrading/close-subposition': 1,
470
+ 'copytrading/set-instruments': 4,
471
+ 'copytrading/first-copy-settings': 4,
472
+ 'copytrading/amend-copy-settings': 4,
473
+ 'copytrading/stop-copy-trading': 4,
474
+ 'copytrading/batch-set-leverage': 4,
460
475
  // broker
461
476
  'broker/nd/create-subaccount': 0.25,
462
477
  'broker/nd/delete-subaccount': 1,
@@ -30,6 +30,8 @@ class p2b extends p2b$1 {
30
30
  'cancelAllOrders': false,
31
31
  'cancelOrder': true,
32
32
  'cancelOrders': false,
33
+ 'closeAllPositions': false,
34
+ 'closePosition': false,
33
35
  'createDepositAddress': false,
34
36
  'createMarketOrder': false,
35
37
  'createOrder': true,
@@ -4,12 +4,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var net = require('net');
6
6
  var tls = require('tls');
7
- var createDebug = require('debug');
8
7
  var events = require('events');
9
8
  var index = require('../agent-base/index.js');
10
9
 
11
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
12
-
13
10
  function _interopNamespace(e) {
14
11
  if (e && e.__esModule) return e;
15
12
  var n = Object.create(null);
@@ -30,9 +27,7 @@ function _interopNamespace(e) {
30
27
 
31
28
  var net__namespace = /*#__PURE__*/_interopNamespace(net);
32
29
  var tls__namespace = /*#__PURE__*/_interopNamespace(tls);
33
- var createDebug__default = /*#__PURE__*/_interopDefaultLegacy(createDebug);
34
30
 
35
- const debug = createDebug__default["default"]('http-proxy-agent');
36
31
  function isHTTPS(protocol) {
37
32
  return typeof protocol === 'string' ? /^https:?$/i.test(protocol) : false;
38
33
  }
@@ -45,7 +40,7 @@ class HttpProxyAgent extends index.Agent {
45
40
  super(opts);
46
41
  this.proxy = typeof proxy === 'string' ? new URL(proxy) : proxy;
47
42
  this.proxyHeaders = opts?.headers ?? {};
48
- debug('Creating new HttpProxyAgent instance: %o', this.proxy.href);
43
+ // debug('Creating new HttpProxyAgent instance: %o', this.proxy.href);
49
44
  // Trim off the brackets from IPv6 addresses
50
45
  const host = (this.proxy.hostname || this.proxy.host).replace(/^\[|\]$/g, '');
51
46
  const port = this.proxy.port
@@ -97,11 +92,11 @@ class HttpProxyAgent extends index.Agent {
97
92
  // Create a socket connection to the proxy server.
98
93
  let socket;
99
94
  if (this.secureProxy) {
100
- debug('Creating `tls.Socket`: %o', this.connectOpts);
95
+ // debug('Creating `tls.Socket`: %o', this.connectOpts);
101
96
  socket = tls__namespace.connect(this.connectOpts);
102
97
  }
103
98
  else {
104
- debug('Creating `net.Socket`: %o', this.connectOpts);
99
+ // debug('Creating `net.Socket`: %o', this.connectOpts);
105
100
  socket = net__namespace.connect(this.connectOpts);
106
101
  }
107
102
  // At this point, the http ClientRequest's internal `_header` field
@@ -109,16 +104,18 @@ class HttpProxyAgent extends index.Agent {
109
104
  // to re-generate the string since we just changed the `req.path`.
110
105
  let first;
111
106
  let endOfHeaders;
112
- debug('Regenerating stored HTTP header string for request');
107
+ // debug('Regenerating stored HTTP header string for request');
113
108
  req._implicitHeader();
114
109
  if (req.outputData && req.outputData.length > 0) {
115
110
  // Node >= 12
116
- debug('Patching connection write() output buffer with updated header');
111
+ // debug(
112
+ // 'Patching connection write() output buffer with updated header'
113
+ // );
117
114
  first = req.outputData[0].data;
118
115
  endOfHeaders = first.indexOf('\r\n\r\n') + 4;
119
116
  req.outputData[0].data =
120
117
  req._header + first.substring(endOfHeaders);
121
- debug('Output buffer: %o', req.outputData[0].data);
118
+ // debug('Output buffer: %o', req.outputData[0].data);
122
119
  }
123
120
  // Wait for the socket's `connect` event, so that this `callback()`
124
121
  // function throws instead of the `http` request machinery. This is
@@ -5,7 +5,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var net = require('net');
6
6
  var tls = require('tls');
7
7
  var assert = require('assert');
8
- var createDebug = require('debug');
9
8
  var index = require('../agent-base/index.js');
10
9
  var parseProxyResponse = require('./parse-proxy-response.js');
11
10
 
@@ -32,9 +31,7 @@ function _interopNamespace(e) {
32
31
  var net__namespace = /*#__PURE__*/_interopNamespace(net);
33
32
  var tls__namespace = /*#__PURE__*/_interopNamespace(tls);
34
33
  var assert__default = /*#__PURE__*/_interopDefaultLegacy(assert);
35
- var createDebug__default = /*#__PURE__*/_interopDefaultLegacy(createDebug);
36
34
 
37
- const debug = createDebug__default["default"]('https-proxy-agent');
38
35
  /**
39
36
  * The `HttpsProxyAgent` implements an HTTP Agent subclass that connects to
40
37
  * the specified "HTTP(s) proxy server" in order to proxy HTTPS requests.
@@ -53,7 +50,7 @@ class HttpsProxyAgent extends index.Agent {
53
50
  this.options = { path: undefined };
54
51
  this.proxy = typeof proxy === 'string' ? new URL(proxy) : proxy;
55
52
  this.proxyHeaders = opts?.headers ?? {};
56
- debug('Creating new HttpsProxyAgent instance: %o', this.proxy.href);
53
+ // debug('Creating new HttpsProxyAgent instance: %o', this.proxy.href);
57
54
  // Trim off the brackets from IPv6 addresses
58
55
  const host = (this.proxy.hostname || this.proxy.host).replace(/^\[|\]$/g, '');
59
56
  const port = this.proxy.port
@@ -84,11 +81,11 @@ class HttpsProxyAgent extends index.Agent {
84
81
  // Create a socket connection to the proxy server.
85
82
  let socket;
86
83
  if (secureProxy) {
87
- debug('Creating `tls.Socket`: %o', this.connectOpts);
84
+ // debug('Creating `tls.Socket`: %o', this.connectOpts);
88
85
  socket = tls__namespace.connect(this.connectOpts);
89
86
  }
90
87
  else {
91
- debug('Creating `net.Socket`: %o', this.connectOpts);
88
+ // debug('Creating `net.Socket`: %o', this.connectOpts);
92
89
  socket = net__namespace.connect(this.connectOpts);
93
90
  }
94
91
  const headers = typeof this.proxyHeaders === 'function'
@@ -121,7 +118,7 @@ class HttpsProxyAgent extends index.Agent {
121
118
  if (opts.secureEndpoint) {
122
119
  // The proxy is connecting to a TLS server, so upgrade
123
120
  // this socket connection to a TLS connection.
124
- debug('Upgrading socket connection to TLS');
121
+ // debug('Upgrading socket connection to TLS');
125
122
  const servername = opts.servername || opts.host;
126
123
  return tls__namespace.connect({
127
124
  ...omit(opts, 'host', 'path', 'port'),
@@ -146,7 +143,7 @@ class HttpsProxyAgent extends index.Agent {
146
143
  fakeSocket.readable = true;
147
144
  // Need to wait for the "socket" event to re-play the "data" events.
148
145
  req.once('socket', (s) => {
149
- debug('Replaying proxy buffer for failed request');
146
+ // debug('Replaying proxy buffer for failed request');
150
147
  assert__default["default"](s.listenerCount('data') > 0);
151
148
  // Replay the "buffered" Buffer onto the fake `socket`, since at
152
149
  // this point the HTTP module machinery has been hooked up for
@@ -2,13 +2,6 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var createDebug = require('debug');
6
-
7
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
-
9
- var createDebug__default = /*#__PURE__*/_interopDefaultLegacy(createDebug);
10
-
11
- const debug = createDebug__default["default"]('https-proxy-agent:parse-proxy-response');
12
5
  function parseProxyResponse(socket) {
13
6
  return new Promise((resolve, reject) => {
14
7
  // we need to buffer any HTTP traffic that happens with the proxy before we get
@@ -31,14 +24,14 @@ function parseProxyResponse(socket) {
31
24
  socket.removeListener('readable', read);
32
25
  }
33
26
  function onclose(err) {
34
- debug('onclose had error %o', err);
27
+ // debug('onclose had error %o', err);
35
28
  }
36
29
  function onend() {
37
- debug('onend');
30
+ // debug('onend');
38
31
  }
39
32
  function onerror(err) {
40
33
  cleanup();
41
- debug('onerror %o', err);
34
+ // debug('onerror %o', err);
42
35
  reject(err);
43
36
  }
44
37
  function ondata(b) {
@@ -48,7 +41,7 @@ function parseProxyResponse(socket) {
48
41
  const endOfHeaders = buffered.indexOf('\r\n\r\n');
49
42
  if (endOfHeaders === -1) {
50
43
  // keep buffering
51
- debug('have not received end of HTTP headers yet...');
44
+ // debug('have not received end of HTTP headers yet...');
52
45
  read();
53
46
  return;
54
47
  }
@@ -81,7 +74,7 @@ function parseProxyResponse(socket) {
81
74
  headers[key] = value;
82
75
  }
83
76
  }
84
- debug('got proxy server response: %o', firstLine);
77
+ // debug('got proxy server response: %o', firstLine);
85
78
  cleanup();
86
79
  resolve({
87
80
  connect: {