ccxt 4.1.84 → 4.1.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.
Files changed (301) hide show
  1. package/README.md +5 -4
  2. package/dist/ccxt.browser.js +1939 -806
  3. package/dist/ccxt.browser.min.js +3 -3
  4. package/dist/cjs/ccxt.js +1 -1
  5. package/dist/cjs/src/ace.js +1 -1
  6. package/dist/cjs/src/alpaca.js +2 -2
  7. package/dist/cjs/src/ascendex.js +2 -2
  8. package/dist/cjs/src/base/Exchange.js +53 -20
  9. package/dist/cjs/src/bigone.js +1 -1
  10. package/dist/cjs/src/binance.js +2 -2
  11. package/dist/cjs/src/bingx.js +11 -9
  12. package/dist/cjs/src/bit2c.js +1 -1
  13. package/dist/cjs/src/bitbank.js +1 -1
  14. package/dist/cjs/src/bitbns.js +1 -1
  15. package/dist/cjs/src/bitfinex.js +1 -1
  16. package/dist/cjs/src/bitfinex2.js +1 -1
  17. package/dist/cjs/src/bitflyer.js +1 -1
  18. package/dist/cjs/src/bitforex.js +1 -1
  19. package/dist/cjs/src/bitget.js +2 -3
  20. package/dist/cjs/src/bithumb.js +3 -3
  21. package/dist/cjs/src/bitmart.js +91 -74
  22. package/dist/cjs/src/bitmex.js +2 -2
  23. package/dist/cjs/src/bitopro.js +3 -3
  24. package/dist/cjs/src/bitpanda.js +1 -1
  25. package/dist/cjs/src/bitrue.js +1 -1
  26. package/dist/cjs/src/bitso.js +1 -1
  27. package/dist/cjs/src/bitstamp.js +1 -1
  28. package/dist/cjs/src/bittrex.js +1 -1
  29. package/dist/cjs/src/bitvavo.js +1 -1
  30. package/dist/cjs/src/bl3p.js +1 -1
  31. package/dist/cjs/src/blockchaincom.js +1 -1
  32. package/dist/cjs/src/btcalpha.js +1 -1
  33. package/dist/cjs/src/btcbox.js +1 -1
  34. package/dist/cjs/src/btcmarkets.js +1 -1
  35. package/dist/cjs/src/btcturk.js +1 -1
  36. package/dist/cjs/src/bybit.js +3 -5
  37. package/dist/cjs/src/cex.js +1 -1
  38. package/dist/cjs/src/coinbase.js +1 -1
  39. package/dist/cjs/src/coinbasepro.js +1 -1
  40. package/dist/cjs/src/coincheck.js +1 -1
  41. package/dist/cjs/src/coinex.js +3 -2
  42. package/dist/cjs/src/coinlist.js +1 -1
  43. package/dist/cjs/src/coinmate.js +1 -1
  44. package/dist/cjs/src/coinone.js +1 -1
  45. package/dist/cjs/src/coinsph.js +1 -1
  46. package/dist/cjs/src/coinspot.js +1 -1
  47. package/dist/cjs/src/cryptocom.js +3 -3
  48. package/dist/cjs/src/currencycom.js +1 -1
  49. package/dist/cjs/src/delta.js +1 -1
  50. package/dist/cjs/src/deribit.js +1 -1
  51. package/dist/cjs/src/digifinex.js +160 -112
  52. package/dist/cjs/src/exmo.js +1 -1
  53. package/dist/cjs/src/gate.js +1 -1
  54. package/dist/cjs/src/gemini.js +1 -1
  55. package/dist/cjs/src/hitbtc.js +2 -2
  56. package/dist/cjs/src/hitbtc3.js +1 -1
  57. package/dist/cjs/src/hollaex.js +1 -1
  58. package/dist/cjs/src/htx.js +2 -2
  59. package/dist/cjs/src/huobijp.js +1 -1
  60. package/dist/cjs/src/idex.js +1 -1
  61. package/dist/cjs/src/independentreserve.js +1 -1
  62. package/dist/cjs/src/indodax.js +1 -1
  63. package/dist/cjs/src/kraken.js +2 -2
  64. package/dist/cjs/src/krakenfutures.js +3 -3
  65. package/dist/cjs/src/kucoin.js +2 -6
  66. package/dist/cjs/src/kucoinfutures.js +0 -3
  67. package/dist/cjs/src/kuna.js +1 -1
  68. package/dist/cjs/src/latoken.js +2 -2
  69. package/dist/cjs/src/lbank.js +1 -1
  70. package/dist/cjs/src/luno.js +1 -1
  71. package/dist/cjs/src/lykke.js +1 -1
  72. package/dist/cjs/src/mercado.js +1 -1
  73. package/dist/cjs/src/mexc.js +102 -53
  74. package/dist/cjs/src/ndax.js +1 -1
  75. package/dist/cjs/src/novadax.js +1 -1
  76. package/dist/cjs/src/oceanex.js +1 -1
  77. package/dist/cjs/src/okcoin.js +1 -1
  78. package/dist/cjs/src/okx.js +4 -4
  79. package/dist/cjs/src/p2b.js +1 -3
  80. package/dist/cjs/src/paymium.js +1 -1
  81. package/dist/cjs/src/phemex.js +1 -1
  82. package/dist/cjs/src/poloniex.js +51 -51
  83. package/dist/cjs/src/poloniexfutures.js +1 -1
  84. package/dist/cjs/src/pro/bitget.js +1 -1
  85. package/dist/cjs/src/pro/bitmart.js +1026 -250
  86. package/dist/cjs/src/pro/bitmex.js +206 -0
  87. package/dist/cjs/src/pro/krakenfutures.js +6 -6
  88. package/dist/cjs/src/pro/mexc.js +1 -1
  89. package/dist/cjs/src/pro/poloniex.js +1 -1
  90. package/dist/cjs/src/pro/poloniexfutures.js +3 -3
  91. package/dist/cjs/src/probit.js +27 -19
  92. package/dist/cjs/src/static_dependencies/jsencrypt/JSEncrypt.js +1 -1
  93. package/dist/cjs/src/static_dependencies/jsencrypt/JSEncryptRSAKey.js +3 -3
  94. package/dist/cjs/src/timex.js +1 -1
  95. package/dist/cjs/src/tokocrypto.js +8 -4
  96. package/dist/cjs/src/upbit.js +1 -1
  97. package/dist/cjs/src/wavesexchange.js +1 -1
  98. package/dist/cjs/src/wazirx.js +1 -1
  99. package/dist/cjs/src/whitebit.js +1 -1
  100. package/dist/cjs/src/woo.js +1 -1
  101. package/dist/cjs/src/yobit.js +1 -1
  102. package/dist/cjs/src/zaif.js +1 -1
  103. package/dist/cjs/src/zonda.js +1 -1
  104. package/js/ccxt.d.ts +1 -1
  105. package/js/ccxt.js +1 -1
  106. package/js/src/ace.d.ts +1 -1
  107. package/js/src/ace.js +1 -1
  108. package/js/src/alpaca.d.ts +1 -1
  109. package/js/src/alpaca.js +2 -2
  110. package/js/src/ascendex.d.ts +1 -1
  111. package/js/src/ascendex.js +2 -2
  112. package/js/src/base/Exchange.d.ts +5 -0
  113. package/js/src/base/Exchange.js +53 -20
  114. package/js/src/base/types.d.ts +1 -0
  115. package/js/src/bigone.d.ts +1 -1
  116. package/js/src/bigone.js +1 -1
  117. package/js/src/binance.d.ts +1 -1
  118. package/js/src/binance.js +2 -2
  119. package/js/src/bingx.js +11 -9
  120. package/js/src/bit2c.d.ts +1 -1
  121. package/js/src/bit2c.js +1 -1
  122. package/js/src/bitbank.d.ts +1 -1
  123. package/js/src/bitbank.js +1 -1
  124. package/js/src/bitbns.d.ts +1 -1
  125. package/js/src/bitbns.js +1 -1
  126. package/js/src/bitfinex.d.ts +1 -1
  127. package/js/src/bitfinex.js +1 -1
  128. package/js/src/bitfinex2.d.ts +1 -1
  129. package/js/src/bitfinex2.js +1 -1
  130. package/js/src/bitflyer.d.ts +1 -1
  131. package/js/src/bitflyer.js +1 -1
  132. package/js/src/bitforex.d.ts +1 -1
  133. package/js/src/bitforex.js +1 -1
  134. package/js/src/bitget.d.ts +1 -1
  135. package/js/src/bitget.js +2 -3
  136. package/js/src/bithumb.d.ts +1 -1
  137. package/js/src/bithumb.js +3 -3
  138. package/js/src/bitmart.d.ts +1 -1
  139. package/js/src/bitmart.js +91 -74
  140. package/js/src/bitmex.d.ts +1 -1
  141. package/js/src/bitmex.js +2 -2
  142. package/js/src/bitopro.d.ts +1 -1
  143. package/js/src/bitopro.js +3 -3
  144. package/js/src/bitpanda.d.ts +1 -1
  145. package/js/src/bitpanda.js +1 -1
  146. package/js/src/bitrue.d.ts +1 -1
  147. package/js/src/bitrue.js +1 -1
  148. package/js/src/bitso.d.ts +1 -1
  149. package/js/src/bitso.js +1 -1
  150. package/js/src/bitstamp.d.ts +1 -1
  151. package/js/src/bitstamp.js +1 -1
  152. package/js/src/bittrex.d.ts +1 -1
  153. package/js/src/bittrex.js +1 -1
  154. package/js/src/bitvavo.d.ts +1 -1
  155. package/js/src/bitvavo.js +1 -1
  156. package/js/src/bl3p.d.ts +1 -1
  157. package/js/src/bl3p.js +1 -1
  158. package/js/src/blockchaincom.d.ts +1 -1
  159. package/js/src/blockchaincom.js +1 -1
  160. package/js/src/btcalpha.d.ts +1 -1
  161. package/js/src/btcalpha.js +1 -1
  162. package/js/src/btcbox.d.ts +1 -1
  163. package/js/src/btcbox.js +1 -1
  164. package/js/src/btcmarkets.d.ts +1 -1
  165. package/js/src/btcmarkets.js +1 -1
  166. package/js/src/btcturk.d.ts +1 -1
  167. package/js/src/btcturk.js +1 -1
  168. package/js/src/bybit.d.ts +1 -1
  169. package/js/src/bybit.js +3 -5
  170. package/js/src/cex.d.ts +1 -1
  171. package/js/src/cex.js +1 -1
  172. package/js/src/coinbase.d.ts +1 -1
  173. package/js/src/coinbase.js +1 -1
  174. package/js/src/coinbasepro.d.ts +1 -1
  175. package/js/src/coinbasepro.js +1 -1
  176. package/js/src/coincheck.d.ts +1 -1
  177. package/js/src/coincheck.js +1 -1
  178. package/js/src/coinex.d.ts +1 -1
  179. package/js/src/coinex.js +3 -2
  180. package/js/src/coinlist.d.ts +1 -1
  181. package/js/src/coinlist.js +1 -1
  182. package/js/src/coinmate.d.ts +1 -1
  183. package/js/src/coinmate.js +1 -1
  184. package/js/src/coinone.d.ts +1 -1
  185. package/js/src/coinone.js +1 -1
  186. package/js/src/coinsph.d.ts +1 -1
  187. package/js/src/coinsph.js +1 -1
  188. package/js/src/coinspot.d.ts +1 -1
  189. package/js/src/coinspot.js +1 -1
  190. package/js/src/cryptocom.d.ts +1 -1
  191. package/js/src/cryptocom.js +3 -3
  192. package/js/src/currencycom.d.ts +1 -1
  193. package/js/src/currencycom.js +1 -1
  194. package/js/src/delta.d.ts +1 -1
  195. package/js/src/delta.js +1 -1
  196. package/js/src/deribit.d.ts +1 -1
  197. package/js/src/deribit.js +1 -1
  198. package/js/src/digifinex.d.ts +1 -1
  199. package/js/src/digifinex.js +160 -112
  200. package/js/src/exmo.d.ts +1 -1
  201. package/js/src/exmo.js +1 -1
  202. package/js/src/gate.d.ts +1 -1
  203. package/js/src/gate.js +1 -1
  204. package/js/src/gemini.d.ts +1 -1
  205. package/js/src/gemini.js +1 -1
  206. package/js/src/hitbtc.d.ts +1 -1
  207. package/js/src/hitbtc.js +2 -2
  208. package/js/src/hitbtc3.d.ts +1 -1
  209. package/js/src/hitbtc3.js +1 -1
  210. package/js/src/hollaex.d.ts +1 -1
  211. package/js/src/hollaex.js +1 -1
  212. package/js/src/htx.d.ts +1 -1
  213. package/js/src/htx.js +2 -2
  214. package/js/src/huobijp.d.ts +1 -1
  215. package/js/src/huobijp.js +1 -1
  216. package/js/src/idex.d.ts +1 -1
  217. package/js/src/idex.js +1 -1
  218. package/js/src/independentreserve.d.ts +1 -1
  219. package/js/src/independentreserve.js +1 -1
  220. package/js/src/indodax.d.ts +1 -1
  221. package/js/src/indodax.js +1 -1
  222. package/js/src/kraken.d.ts +1 -1
  223. package/js/src/kraken.js +2 -2
  224. package/js/src/krakenfutures.d.ts +1 -1
  225. package/js/src/krakenfutures.js +3 -3
  226. package/js/src/kucoin.d.ts +1 -1
  227. package/js/src/kucoin.js +2 -6
  228. package/js/src/kucoinfutures.d.ts +0 -1
  229. package/js/src/kucoinfutures.js +0 -3
  230. package/js/src/kuna.d.ts +1 -1
  231. package/js/src/kuna.js +1 -1
  232. package/js/src/latoken.d.ts +1 -1
  233. package/js/src/latoken.js +2 -2
  234. package/js/src/lbank.d.ts +1 -1
  235. package/js/src/lbank.js +1 -1
  236. package/js/src/luno.d.ts +1 -1
  237. package/js/src/luno.js +1 -1
  238. package/js/src/lykke.d.ts +1 -1
  239. package/js/src/lykke.js +1 -1
  240. package/js/src/mercado.d.ts +1 -1
  241. package/js/src/mercado.js +1 -1
  242. package/js/src/mexc.d.ts +1 -1
  243. package/js/src/mexc.js +102 -53
  244. package/js/src/ndax.d.ts +1 -1
  245. package/js/src/ndax.js +1 -1
  246. package/js/src/novadax.d.ts +1 -1
  247. package/js/src/novadax.js +1 -1
  248. package/js/src/oceanex.d.ts +1 -1
  249. package/js/src/oceanex.js +1 -1
  250. package/js/src/okcoin.d.ts +1 -1
  251. package/js/src/okcoin.js +1 -1
  252. package/js/src/okx.d.ts +1 -1
  253. package/js/src/okx.js +4 -4
  254. package/js/src/p2b.d.ts +1 -1
  255. package/js/src/p2b.js +1 -3
  256. package/js/src/paymium.d.ts +1 -1
  257. package/js/src/paymium.js +1 -1
  258. package/js/src/phemex.d.ts +1 -1
  259. package/js/src/phemex.js +1 -1
  260. package/js/src/poloniex.d.ts +1 -1
  261. package/js/src/poloniex.js +51 -51
  262. package/js/src/poloniexfutures.d.ts +1 -1
  263. package/js/src/poloniexfutures.js +1 -1
  264. package/js/src/pro/bitget.d.ts +1 -1
  265. package/js/src/pro/bitget.js +1 -1
  266. package/js/src/pro/bitmart.d.ts +17 -6
  267. package/js/src/pro/bitmart.js +1028 -252
  268. package/js/src/pro/bitmex.d.ts +3 -1
  269. package/js/src/pro/bitmex.js +207 -1
  270. package/js/src/pro/krakenfutures.js +6 -6
  271. package/js/src/pro/mexc.js +1 -1
  272. package/js/src/pro/poloniex.js +1 -1
  273. package/js/src/pro/poloniexfutures.js +3 -3
  274. package/js/src/probit.d.ts +1 -1
  275. package/js/src/probit.js +27 -19
  276. package/js/src/static_dependencies/jsencrypt/JSEncrypt.d.ts +1 -1
  277. package/js/src/static_dependencies/jsencrypt/JSEncrypt.js +1 -1
  278. package/js/src/static_dependencies/jsencrypt/JSEncryptRSAKey.d.ts +3 -3
  279. package/js/src/static_dependencies/jsencrypt/JSEncryptRSAKey.js +3 -3
  280. package/js/src/timex.d.ts +1 -1
  281. package/js/src/timex.js +1 -1
  282. package/js/src/tokocrypto.d.ts +1 -1
  283. package/js/src/tokocrypto.js +8 -4
  284. package/js/src/upbit.d.ts +1 -1
  285. package/js/src/upbit.js +1 -1
  286. package/js/src/wavesexchange.d.ts +1 -1
  287. package/js/src/wavesexchange.js +1 -1
  288. package/js/src/wazirx.d.ts +1 -1
  289. package/js/src/wazirx.js +1 -1
  290. package/js/src/whitebit.d.ts +1 -1
  291. package/js/src/whitebit.js +1 -1
  292. package/js/src/woo.d.ts +1 -1
  293. package/js/src/woo.js +1 -1
  294. package/js/src/yobit.d.ts +1 -1
  295. package/js/src/yobit.js +1 -1
  296. package/js/src/zaif.d.ts +1 -1
  297. package/js/src/zaif.js +1 -1
  298. package/js/src/zonda.d.ts +1 -1
  299. package/js/src/zonda.js +1 -1
  300. package/package.json +4 -3
  301. package/skip-tests.json +4 -0
package/dist/cjs/ccxt.js CHANGED
@@ -172,7 +172,7 @@ var woo$1 = require('./src/pro/woo.js');
172
172
 
173
173
  //-----------------------------------------------------------------------------
174
174
  // this is updated by vss.js when building
175
- const version = '4.1.84';
175
+ const version = '4.1.86';
176
176
  Exchange["default"].ccxtVersion = version;
177
177
  const exchanges = {
178
178
  'ace': ace,
@@ -10,7 +10,7 @@ var sha256 = require('./static_dependencies/noble-hashes/sha256.js');
10
10
  // ---------------------------------------------------------------------------
11
11
  /**
12
12
  * @class ace
13
- * @extends Exchange
13
+ * @augments Exchange
14
14
  */
15
15
  class ace extends ace$1 {
16
16
  describe() {
@@ -8,7 +8,7 @@ var number = require('./base/functions/number.js');
8
8
  // ---------------------------------------------------------------------------xs
9
9
  /**
10
10
  * @class alpaca
11
- * @extends Exchange
11
+ * @augments Exchange
12
12
  */
13
13
  class alpaca extends alpaca$1 {
14
14
  describe() {
@@ -496,7 +496,7 @@ class alpaca extends alpaca$1 {
496
496
  * @param {object} [params] extra parameters specific to the exchange API endpoint
497
497
  * @param {string} [params.loc] crypto location, default: us
498
498
  * @returns {object} A dictionary of [order book structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-book-structure} indexed by market symbols
499
- */
499
+ */
500
500
  await this.loadMarkets();
501
501
  const market = this.market(symbol);
502
502
  const id = market['id'];
@@ -10,7 +10,7 @@ var sha256 = require('./static_dependencies/noble-hashes/sha256.js');
10
10
  // ---------------------------------------------------------------------------
11
11
  /**
12
12
  * @class ascendex
13
- * @extends Exchange
13
+ * @augments Exchange
14
14
  */
15
15
  class ascendex extends ascendex$1 {
16
16
  describe() {
@@ -1661,7 +1661,7 @@ class ascendex extends ascendex$1 {
1661
1661
  * @description create a list of trade orders
1662
1662
  * @see https://ascendex.github.io/ascendex-pro-api/#place-batch-orders
1663
1663
  * @see https://ascendex.github.io/ascendex-futures-pro-api-v2/#place-batch-orders
1664
- * @param {array} orders list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
1664
+ * @param {Array} orders list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
1665
1665
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1666
1666
  * @param {string} [params.timeInForce] "GTC", "IOC", "FOK", or "PO"
1667
1667
  * @param {bool} [params.postOnly] true or false
@@ -705,6 +705,26 @@ class Exchange {
705
705
  }
706
706
  return chosenAgent;
707
707
  }
708
+ async loadHttpProxyAgent() {
709
+ // for `http://` protocol proxy-urls, we need to load `http` module only on first call
710
+ if (!this.httpAgent) {
711
+ const httpModule = await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(/* webpackIgnore: true */ 'node:http')); });
712
+ this.httpAgent = new httpModule.Agent();
713
+ }
714
+ return this.httpAgent;
715
+ }
716
+ getHttpAgentIfNeeded(url) {
717
+ if (isNode) {
718
+ // only for non-ssl proxy
719
+ if (url.substring(0, 5) === 'ws://') {
720
+ if (this.httpAgent === undefined) {
721
+ throw new errors.NotSupported(this.id + ' to use proxy with non-ssl ws:// urls, at first run `await exchange.loadHttpProxyAgent()` method');
722
+ }
723
+ return this.httpAgent;
724
+ }
725
+ }
726
+ return undefined;
727
+ }
708
728
  async fetch(url, method = 'GET', headers = undefined, body = undefined) {
709
729
  // load node-http(s) modules only on first call
710
730
  if (isNode) {
@@ -718,18 +738,16 @@ class Exchange {
718
738
  headers = this.extend(this.headers, headers);
719
739
  // proxy-url
720
740
  const proxyUrl = this.checkProxyUrlSettings(url, method, headers, body);
721
- let isHttpAgentNeeded = false;
741
+ let httpProxyAgent = false;
722
742
  if (proxyUrl !== undefined) {
723
- // in node we need to set header to *
743
+ // part only for node-js
724
744
  if (isNode) {
745
+ // in node we need to set header to *
725
746
  headers = this.extend({ 'Origin': this.origin }, headers);
726
- if (proxyUrl.substring(0, 5) !== 'https') {
727
- // for `http://` protocol proxy-urls, we need to load `http` module only on first call
728
- if (!this.httpAgent) {
729
- const httpModule = await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(/* webpackIgnore: true */ 'node:http')); });
730
- this.httpAgent = new httpModule.Agent();
731
- }
732
- isHttpAgentNeeded = true;
747
+ // only for http proxy
748
+ if (proxyUrl.substring(0, 5) === 'http:') {
749
+ await this.loadHttpProxyAgent();
750
+ httpProxyAgent = this.httpAgent;
733
751
  }
734
752
  }
735
753
  url = proxyUrl + url;
@@ -782,9 +800,9 @@ class Exchange {
782
800
  params['agent'] = this.agent;
783
801
  }
784
802
  // override agent, if needed
785
- if (isHttpAgentNeeded) {
786
- // if proxyUrl is being used, so we don't overwrite `this.agent` itself
787
- params['agent'] = this.httpAgent;
803
+ if (httpProxyAgent) {
804
+ // if proxyUrl is being used, then specifically in nodejs, we need http module, not https
805
+ params['agent'] = httpProxyAgent;
788
806
  }
789
807
  else if (chosenAgent) {
790
808
  // if http(s)Proxy is being used
@@ -993,7 +1011,9 @@ class Exchange {
993
1011
  // proxy agents
994
1012
  const [httpProxy, httpsProxy, socksProxy] = this.checkWsProxySettings();
995
1013
  const chosenAgent = this.setProxyAgents(httpProxy, httpsProxy, socksProxy);
996
- const finalAgent = chosenAgent ? chosenAgent : this.agent;
1014
+ // part only for node-js
1015
+ const httpProxyAgent = this.getHttpAgentIfNeeded(url);
1016
+ const finalAgent = chosenAgent ? chosenAgent : (httpProxyAgent ? httpProxyAgent : this.agent);
997
1017
  //
998
1018
  const options = this.deepExtend(this.streaming, {
999
1019
  'log': this.log ? this.log.bind(this) : this.log,
@@ -1341,7 +1361,8 @@ class Exchange {
1341
1361
  const usedProxies = [];
1342
1362
  let wsProxy = undefined;
1343
1363
  let wssProxy = undefined;
1344
- // wsProxy
1364
+ let wsSocksProxy = undefined;
1365
+ // ws proxy
1345
1366
  if (this.wsProxy !== undefined) {
1346
1367
  usedProxies.push('wsProxy');
1347
1368
  wsProxy = this.wsProxy;
@@ -1350,7 +1371,7 @@ class Exchange {
1350
1371
  usedProxies.push('ws_proxy');
1351
1372
  wsProxy = this.ws_proxy;
1352
1373
  }
1353
- // wsProxy
1374
+ // wss proxy
1354
1375
  if (this.wssProxy !== undefined) {
1355
1376
  usedProxies.push('wssProxy');
1356
1377
  wssProxy = this.wssProxy;
@@ -1359,13 +1380,22 @@ class Exchange {
1359
1380
  usedProxies.push('wss_proxy');
1360
1381
  wssProxy = this.wss_proxy;
1361
1382
  }
1383
+ // ws socks proxy
1384
+ if (this.wsSocksProxy !== undefined) {
1385
+ usedProxies.push('wsSocksProxy');
1386
+ wsSocksProxy = this.wsSocksProxy;
1387
+ }
1388
+ if (this.ws_socks_proxy !== undefined) {
1389
+ usedProxies.push('ws_socks_proxy');
1390
+ wsSocksProxy = this.ws_socks_proxy;
1391
+ }
1362
1392
  // check
1363
1393
  const length = usedProxies.length;
1364
1394
  if (length > 1) {
1365
1395
  const joinedProxyNames = usedProxies.join(',');
1366
- throw new errors.ExchangeError(this.id + ' you have multiple conflicting settings (' + joinedProxyNames + '), please use only one from: wsProxy, wssProxy');
1396
+ throw new errors.ExchangeError(this.id + ' you have multiple conflicting settings (' + joinedProxyNames + '), please use only one from: wsProxy, wssProxy, socksProxy');
1367
1397
  }
1368
- return [wsProxy, wssProxy];
1398
+ return [wsProxy, wssProxy, wsSocksProxy];
1369
1399
  }
1370
1400
  checkConflictingProxies(proxyAgentSet, proxyUrlSet) {
1371
1401
  if (proxyAgentSet && proxyUrlSet) {
@@ -3706,6 +3736,9 @@ class Exchange {
3706
3736
  async closeAllPositions(params = {}) {
3707
3737
  throw new errors.NotSupported(this.id + ' closeAllPositions() is not supported yet');
3708
3738
  }
3739
+ async fetchL3OrderBook(symbol, limit = undefined, params = {}) {
3740
+ throw new errors.BadRequest(this.id + ' fetchL3OrderBook() is not supported yet');
3741
+ }
3709
3742
  parseLastPrice(price, market = undefined) {
3710
3743
  throw new errors.NotSupported(this.id + ' parseLastPrice() is not supported yet');
3711
3744
  }
@@ -4272,8 +4305,8 @@ class Exchange {
4272
4305
  /**
4273
4306
  * @ignore
4274
4307
  * @method
4275
- * * Must add timeInForce to this.options to use this method
4276
- * @return {string} returns the exchange specific value for timeInForce
4308
+ * Must add timeInForce to this.options to use this method
4309
+ * @returns {string} returns the exchange specific value for timeInForce
4277
4310
  */
4278
4311
  const timeInForce = this.safeStringUpper(params, 'timeInForce'); // supported values GTC, IOC, PO
4279
4312
  if (timeInForce !== undefined) {
@@ -4289,7 +4322,7 @@ class Exchange {
4289
4322
  /**
4290
4323
  * @ignore
4291
4324
  * @method
4292
- * * Must add accountsByType to this.options to use this method
4325
+ * Must add accountsByType to this.options to use this method
4293
4326
  * @param {string} account key for account name in this.options['accountsByType']
4294
4327
  * @returns the exchange specific account name or the isolated margin id for transfers
4295
4328
  */
@@ -11,7 +11,7 @@ var Precise = require('./base/Precise.js');
11
11
  // ---------------------------------------------------------------------------
12
12
  /**
13
13
  * @class bigone
14
- * @extends Exchange
14
+ * @augments Exchange
15
15
  */
16
16
  class bigone extends bigone$1 {
17
17
  describe() {
@@ -13,7 +13,7 @@ var ed25519 = require('./static_dependencies/noble-curves/ed25519.js');
13
13
  // ---------------------------------------------------------------------------
14
14
  /**
15
15
  * @class binance
16
- * @extends Exchange
16
+ * @augments Exchange
17
17
  */
18
18
  class binance extends binance$1 {
19
19
  describe() {
@@ -4393,7 +4393,7 @@ class binance extends binance$1 {
4393
4393
  * @name binance#createOrders
4394
4394
  * @description *contract only* create a list of trade orders
4395
4395
  * @see https://binance-docs.github.io/apidocs/futures/en/#place-multiple-orders-trade
4396
- * @param {array} orders list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
4396
+ * @param {Array} orders list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
4397
4397
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
4398
4398
  */
4399
4399
  await this.loadMarkets();
@@ -1815,7 +1815,7 @@ class bingx extends bingx$1 {
1815
1815
  * @description create a list of trade orders
1816
1816
  * @see https://bingx-api.github.io/docs/#/spot/trade-api.html#Batch%20Placing%20Orders
1817
1817
  * @see https://bingx-api.github.io/docs/#/swapV2/trade-api.html#Bulk%20order
1818
- * @param {array} orders list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
1818
+ * @param {Array} orders list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
1819
1819
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1820
1820
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
1821
1821
  */
@@ -2012,6 +2012,9 @@ class bingx extends bingx$1 {
2012
2012
  const positionSide = this.safeString2(order, 'positionSide', 'ps');
2013
2013
  const marketType = (positionSide === undefined) ? 'spot' : 'swap';
2014
2014
  const marketId = this.safeString2(order, 'symbol', 's');
2015
+ if (market === undefined) {
2016
+ market = this.safeMarket(marketId, undefined, undefined, marketType);
2017
+ }
2015
2018
  const symbol = this.safeSymbol(marketId, market, '-', marketType);
2016
2019
  const orderId = this.safeString2(order, 'orderId', 'i');
2017
2020
  const side = this.safeStringLower2(order, 'side', 'S');
@@ -2377,16 +2380,15 @@ class bingx extends bingx$1 {
2377
2380
  * @param {object} [params] extra parameters specific to the exchange API endpoint
2378
2381
  * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
2379
2382
  */
2380
- if (symbol === undefined) {
2381
- throw new errors.ArgumentsRequired(this.id + ' fetchOrders() requires a symbol argument');
2382
- }
2383
2383
  await this.loadMarkets();
2384
- const market = this.market(symbol);
2385
- const request = {
2386
- 'symbol': market['id'],
2387
- };
2384
+ let market = undefined;
2385
+ const request = {};
2386
+ if (symbol !== undefined) {
2387
+ market = this.market(symbol);
2388
+ request['symbol'] = market['id'];
2389
+ }
2388
2390
  let response = undefined;
2389
- const [marketType, query] = this.handleMarketTypeAndParams('fetchOrder', market, params);
2391
+ const [marketType, query] = this.handleMarketTypeAndParams('fetchOpenOrders', market, params);
2390
2392
  if (marketType === 'spot') {
2391
2393
  response = await this.spotV1PrivateGetTradeOpenOrders(this.extend(request, query));
2392
2394
  }
@@ -10,7 +10,7 @@ var sha512 = require('./static_dependencies/noble-hashes/sha512.js');
10
10
  // ---------------------------------------------------------------------------
11
11
  /**
12
12
  * @class bit2c
13
- * @extends Exchange
13
+ * @augments Exchange
14
14
  */
15
15
  class bit2c extends bit2c$1 {
16
16
  describe() {
@@ -9,7 +9,7 @@ var sha256 = require('./static_dependencies/noble-hashes/sha256.js');
9
9
  // ---------------------------------------------------------------------------
10
10
  /**
11
11
  * @class bitbank
12
- * @extends Exchange
12
+ * @augments Exchange
13
13
  */
14
14
  class bitbank extends bitbank$1 {
15
15
  describe() {
@@ -10,7 +10,7 @@ var sha512 = require('./static_dependencies/noble-hashes/sha512.js');
10
10
  // ---------------------------------------------------------------------------
11
11
  /**
12
12
  * @class bitbns
13
- * @extends Exchange
13
+ * @augments Exchange
14
14
  */
15
15
  class bitbns extends bitbns$1 {
16
16
  describe() {
@@ -10,7 +10,7 @@ var sha512 = require('./static_dependencies/noble-hashes/sha512.js');
10
10
  // ---------------------------------------------------------------------------
11
11
  /**
12
12
  * @class bitfinex
13
- * @extends Exchange
13
+ * @augments Exchange
14
14
  */
15
15
  class bitfinex extends bitfinex$1 {
16
16
  describe() {
@@ -10,7 +10,7 @@ var sha512 = require('./static_dependencies/noble-hashes/sha512.js');
10
10
  // ---------------------------------------------------------------------------
11
11
  /**
12
12
  * @class bitfinex2
13
- * @extends Exchange
13
+ * @augments Exchange
14
14
  */
15
15
  class bitfinex2 extends bitfinex2$1 {
16
16
  describe() {
@@ -10,7 +10,7 @@ var Precise = require('./base/Precise.js');
10
10
  // ---------------------------------------------------------------------------
11
11
  /**
12
12
  * @class bitflyer
13
- * @extends Exchange
13
+ * @augments Exchange
14
14
  */
15
15
  class bitflyer extends bitflyer$1 {
16
16
  describe() {
@@ -9,7 +9,7 @@ var sha256 = require('./static_dependencies/noble-hashes/sha256.js');
9
9
  // ---------------------------------------------------------------------------
10
10
  /**
11
11
  * @class bitforex
12
- * @extends Exchange
12
+ * @augments Exchange
13
13
  */
14
14
  class bitforex extends bitforex$1 {
15
15
  describe() {
@@ -10,7 +10,7 @@ var sha256 = require('./static_dependencies/noble-hashes/sha256.js');
10
10
  // ---------------------------------------------------------------------------
11
11
  /**
12
12
  * @class bitget
13
- * @extends Exchange
13
+ * @augments Exchange
14
14
  */
15
15
  class bitget extends bitget$1 {
16
16
  describe() {
@@ -3727,7 +3727,7 @@ class bitget extends bitget$1 {
3727
3727
  * @see https://bitgetlimited.github.io/apidoc/en/mix/#batch-order
3728
3728
  * @see https://bitgetlimited.github.io/apidoc/en/margin/#isolated-batch-order
3729
3729
  * @see https://bitgetlimited.github.io/apidoc/en/margin/#cross-batch-order
3730
- * @param {array} orders list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
3730
+ * @param {Array} orders list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
3731
3731
  * @param {object} [params] extra parameters specific to the api endpoint
3732
3732
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
3733
3733
  */
@@ -5981,7 +5981,6 @@ class bitget extends bitget$1 {
5981
5981
  * @param {string} symbol not used by bitget setPositionMode ()
5982
5982
  * @param {object} [params] extra parameters specific to the exchange API endpoint
5983
5983
  * @returns {object} response from the exchange
5984
- *
5985
5984
  */
5986
5985
  await this.loadMarkets();
5987
5986
  const sandboxMode = this.safeValue(this.options, 'sandboxMode', false);
@@ -10,7 +10,7 @@ var sha512 = require('./static_dependencies/noble-hashes/sha512.js');
10
10
  // ---------------------------------------------------------------------------
11
11
  /**
12
12
  * @class bithumb
13
- * @extends Exchange
13
+ * @augments Exchange
14
14
  */
15
15
  class bithumb extends bithumb$1 {
16
16
  describe() {
@@ -945,11 +945,11 @@ class bithumb extends bithumb$1 {
945
945
  };
946
946
  return await this.privatePostTradeCancel(this.extend(request, params));
947
947
  }
948
- cancelUnifiedOrder(order, params = {}) {
948
+ async cancelUnifiedOrder(order, params = {}) {
949
949
  const request = {
950
950
  'side': order['side'],
951
951
  };
952
- return this.cancelOrder(order['id'], order['symbol'], this.extend(request, params));
952
+ return await this.cancelOrder(order['id'], order['symbol'], this.extend(request, params));
953
953
  }
954
954
  async withdraw(code, amount, address, tag = undefined, params = {}) {
955
955
  /**
@@ -10,7 +10,7 @@ var sha256 = require('./static_dependencies/noble-hashes/sha256.js');
10
10
  // ---------------------------------------------------------------------------
11
11
  /**
12
12
  * @class bitmart
13
- * @extends Exchange
13
+ * @augments Exchange
14
14
  */
15
15
  class bitmart extends bitmart$1 {
16
16
  describe() {
@@ -1334,48 +1334,58 @@ class bitmart extends bitmart$1 {
1334
1334
  //
1335
1335
  // public fetchTrades spot ( amount = count * price )
1336
1336
  //
1337
- // {
1338
- // "amount": "818.94",
1339
- // "order_time": "1637601839035", // ETH/USDT
1340
- // "price": "4221.99",
1341
- // "count": "0.19397",
1342
- // "type": "buy"
1343
- // }
1337
+ // {
1338
+ // "amount": "818.94",
1339
+ // "order_time": "1637601839035", // ETH/USDT
1340
+ // "price": "4221.99",
1341
+ // "count": "0.19397",
1342
+ // "type": "buy"
1343
+ // }
1344
1344
  //
1345
1345
  // spot: fetchMyTrades
1346
1346
  //
1347
- // {
1348
- // "tradeId":"182342999769370687",
1349
- // "orderId":"183270218784142990",
1350
- // "clientOrderId":"183270218784142990",
1351
- // "symbol":"ADA_USDT",
1352
- // "side":"buy",
1353
- // "orderMode":"spot",
1354
- // "type":"market",
1355
- // "price":"0.245948",
1356
- // "size":"20.71",
1357
- // "notional":"5.09358308",
1358
- // "fee":"0.00509358",
1359
- // "feeCoinName":"USDT",
1360
- // "tradeRole":"taker",
1361
- // "createTime":1695658457836,
1362
- // }
1347
+ // {
1348
+ // "tradeId":"182342999769370687",
1349
+ // "orderId":"183270218784142990",
1350
+ // "clientOrderId":"183270218784142990",
1351
+ // "symbol":"ADA_USDT",
1352
+ // "side":"buy",
1353
+ // "orderMode":"spot",
1354
+ // "type":"market",
1355
+ // "price":"0.245948",
1356
+ // "size":"20.71",
1357
+ // "notional":"5.09358308",
1358
+ // "fee":"0.00509358",
1359
+ // "feeCoinName":"USDT",
1360
+ // "tradeRole":"taker",
1361
+ // "createTime":1695658457836,
1362
+ // }
1363
1363
  //
1364
1364
  // swap: fetchMyTrades
1365
1365
  //
1366
- // {
1367
- // "order_id": "230930336848609",
1368
- // "trade_id": "6212604014",
1369
- // "symbol": "BTCUSDT",
1370
- // "side": 3,
1371
- // "price": "26910.4",
1372
- // "vol": "1",
1373
- // "exec_type": "Taker",
1374
- // "profit": false,
1375
- // "create_time": 1695961596692,
1376
- // "realised_profit": "-0.0003",
1377
- // "paid_fees": "0.01614624"
1378
- // }
1366
+ // {
1367
+ // "order_id": "230930336848609",
1368
+ // "trade_id": "6212604014",
1369
+ // "symbol": "BTCUSDT",
1370
+ // "side": 3,
1371
+ // "price": "26910.4",
1372
+ // "vol": "1",
1373
+ // "exec_type": "Taker",
1374
+ // "profit": false,
1375
+ // "create_time": 1695961596692,
1376
+ // "realised_profit": "-0.0003",
1377
+ // "paid_fees": "0.01614624"
1378
+ // }
1379
+ //
1380
+ // ws swap
1381
+ //
1382
+ // {
1383
+ // 'fee': '-0.000044502',
1384
+ // 'feeCcy': 'USDT',
1385
+ // 'fillPrice': '74.17',
1386
+ // 'fillQty': '1',
1387
+ // 'lastTradeID': 6802340762
1388
+ // }
1379
1389
  //
1380
1390
  const timestamp = this.safeIntegerN(trade, ['order_time', 'createTime', 'create_time']);
1381
1391
  const isPublicTrade = ('order_time' in trade);
@@ -1389,7 +1399,7 @@ class bitmart extends bitmart$1 {
1389
1399
  side = this.safeString(trade, 'type');
1390
1400
  }
1391
1401
  else {
1392
- amount = this.safeString2(trade, 'size', 'vol');
1402
+ amount = this.safeStringN(trade, ['size', 'vol', 'fillQty']);
1393
1403
  cost = this.safeString(trade, 'notional');
1394
1404
  type = this.safeString(trade, 'type');
1395
1405
  side = this.parseOrderSide(this.safeString(trade, 'side'));
@@ -1411,14 +1421,14 @@ class bitmart extends bitmart$1 {
1411
1421
  }
1412
1422
  return this.safeTrade({
1413
1423
  'info': trade,
1414
- 'id': this.safeString2(trade, 'tradeId', 'trade_id'),
1424
+ 'id': this.safeStringN(trade, ['tradeId', 'trade_id', 'lastTradeID']),
1415
1425
  'order': this.safeString2(trade, 'orderId', 'order_id'),
1416
1426
  'timestamp': timestamp,
1417
1427
  'datetime': this.iso8601(timestamp),
1418
1428
  'symbol': market['symbol'],
1419
1429
  'type': type,
1420
1430
  'side': side,
1421
- 'price': this.safeString(trade, 'price'),
1431
+ 'price': this.safeString2(trade, 'price', 'fillPrice'),
1422
1432
  'amount': amount,
1423
1433
  'cost': cost,
1424
1434
  'takerOrMaker': this.safeStringLower2(trade, 'tradeRole', 'exec_type'),
@@ -1472,38 +1482,45 @@ class bitmart extends bitmart$1 {
1472
1482
  parseOHLCV(ohlcv, market = undefined) {
1473
1483
  //
1474
1484
  // spot
1475
- //
1476
- // [
1477
- // "1699512060", // timestamp
1478
- // "36746.49", // open
1479
- // "36758.71", // high
1480
- // "36736.13", // low
1481
- // "36755.99", // close
1482
- // "2.83965", // base volume
1483
- // "104353.57" // quote volume
1484
- // ]
1485
+ // [
1486
+ // "1699512060", // timestamp
1487
+ // "36746.49", // open
1488
+ // "36758.71", // high
1489
+ // "36736.13", // low
1490
+ // "36755.99", // close
1491
+ // "2.83965", // base volume
1492
+ // "104353.57" // quote volume
1493
+ // ]
1485
1494
  //
1486
1495
  // swap
1487
- //
1488
- // {
1489
- // "low_price": "20090.3",
1490
- // "high_price": "20095.5",
1491
- // "open_price": "20092.6",
1492
- // "close_price": "20091.4",
1493
- // "volume": "8748",
1494
- // "timestamp": 1665002281
1495
- // }
1496
+ // {
1497
+ // "low_price": "20090.3",
1498
+ // "high_price": "20095.5",
1499
+ // "open_price": "20092.6",
1500
+ // "close_price": "20091.4",
1501
+ // "volume": "8748",
1502
+ // "timestamp": 1665002281
1503
+ // }
1496
1504
  //
1497
1505
  // ws
1498
- //
1499
- // [
1500
- // 1631056350, // timestamp
1501
- // "46532.83", // open
1502
- // "46555.71", // high
1503
- // "46511.41", // low
1504
- // "46555.71", // close
1505
- // "0.25", // volume
1506
- // ]
1506
+ // [
1507
+ // 1631056350, // timestamp
1508
+ // "46532.83", // open
1509
+ // "46555.71", // high
1510
+ // "46511.41", // low
1511
+ // "46555.71", // close
1512
+ // "0.25", // volume
1513
+ // ]
1514
+ //
1515
+ // ws swap
1516
+ // {
1517
+ // "symbol":"BTCUSDT",
1518
+ // "o":"146.24",
1519
+ // "h":"146.24",
1520
+ // "l":"146.24",
1521
+ // "c":"146.24",
1522
+ // "v":"146"
1523
+ // }
1507
1524
  //
1508
1525
  if (Array.isArray(ohlcv)) {
1509
1526
  return [
@@ -1517,12 +1534,12 @@ class bitmart extends bitmart$1 {
1517
1534
  }
1518
1535
  else {
1519
1536
  return [
1520
- this.safeTimestamp(ohlcv, 'timestamp'),
1521
- this.safeNumber(ohlcv, 'open_price'),
1522
- this.safeNumber(ohlcv, 'high_price'),
1523
- this.safeNumber(ohlcv, 'low_price'),
1524
- this.safeNumber(ohlcv, 'close_price'),
1525
- this.safeNumber(ohlcv, 'volume'),
1537
+ this.safeTimestamp2(ohlcv, 'timestamp', 'ts'),
1538
+ this.safeNumber2(ohlcv, 'open_price', 'o'),
1539
+ this.safeNumber2(ohlcv, 'high_price', 'h'),
1540
+ this.safeNumber2(ohlcv, 'low_price', 'l'),
1541
+ this.safeNumber2(ohlcv, 'close_price', 'c'),
1542
+ this.safeNumber2(ohlcv, 'volume', 'v'),
1526
1543
  ];
1527
1544
  }
1528
1545
  }