ccxt 4.2.30 → 4.2.34

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 (318) hide show
  1. package/.gitattributes +1 -0
  2. package/CONTRIBUTING.md +20 -1
  3. package/README.md +9 -9
  4. package/build.sh +9 -2
  5. package/cleanup.sh +3 -0
  6. package/dist/ccxt.browser.js +1136 -561
  7. package/dist/ccxt.browser.min.js +3 -3
  8. package/dist/cjs/ccxt.js +1 -1
  9. package/dist/cjs/src/ace.js +3 -2
  10. package/dist/cjs/src/ascendex.js +1 -1
  11. package/dist/cjs/src/base/Exchange.js +66 -24
  12. package/dist/cjs/src/bigone.js +21 -1
  13. package/dist/cjs/src/binance.js +6 -5
  14. package/dist/cjs/src/bingx.js +4 -3
  15. package/dist/cjs/src/bit2c.js +12 -0
  16. package/dist/cjs/src/bitfinex2.js +415 -41
  17. package/dist/cjs/src/bitforex.js +3 -0
  18. package/dist/cjs/src/bitget.js +3 -3
  19. package/dist/cjs/src/bitmart.js +1 -1
  20. package/dist/cjs/src/bitrue.js +3 -3
  21. package/dist/cjs/src/blockchaincom.js +1 -1
  22. package/dist/cjs/src/bybit.js +1 -1
  23. package/dist/cjs/src/coinbase.js +12 -2
  24. package/dist/cjs/src/coinex.js +1 -1
  25. package/dist/cjs/src/cryptocom.js +10 -10
  26. package/dist/cjs/src/deribit.js +1 -0
  27. package/dist/cjs/src/gate.js +34 -29
  28. package/dist/cjs/src/htx.js +1 -1
  29. package/dist/cjs/src/kraken.js +42 -1
  30. package/dist/cjs/src/krakenfutures.js +3 -0
  31. package/dist/cjs/src/kucoin.js +1 -1
  32. package/dist/cjs/src/lbank.js +27 -26
  33. package/dist/cjs/src/mexc.js +2 -1
  34. package/dist/cjs/src/okx.js +20 -5
  35. package/dist/cjs/src/phemex.js +8 -8
  36. package/dist/cjs/src/poloniexfutures.js +3 -0
  37. package/dist/cjs/src/pro/alpaca.js +8 -4
  38. package/dist/cjs/src/pro/ascendex.js +1 -2
  39. package/dist/cjs/src/pro/binance.js +14 -10
  40. package/dist/cjs/src/pro/bingx.js +1 -1
  41. package/dist/cjs/src/pro/bitfinex.js +21 -24
  42. package/dist/cjs/src/pro/bitfinex2.js +13 -17
  43. package/dist/cjs/src/pro/bitget.js +3 -1
  44. package/dist/cjs/src/pro/bitmart.js +3 -8
  45. package/dist/cjs/src/pro/bitmex.js +4 -7
  46. package/dist/cjs/src/pro/bitopro.js +2 -5
  47. package/dist/cjs/src/pro/bitrue.js +1 -1
  48. package/dist/cjs/src/pro/bitstamp.js +2 -3
  49. package/dist/cjs/src/pro/bitvavo.js +12 -5
  50. package/dist/cjs/src/pro/blockchaincom.js +22 -23
  51. package/dist/cjs/src/pro/bybit.js +5 -5
  52. package/dist/cjs/src/pro/cex.js +7 -7
  53. package/dist/cjs/src/pro/coinbase.js +3 -2
  54. package/dist/cjs/src/pro/coinbasepro.js +1 -1
  55. package/dist/cjs/src/pro/coinex.js +15 -13
  56. package/dist/cjs/src/pro/currencycom.js +5 -7
  57. package/dist/cjs/src/pro/deribit.js +4 -4
  58. package/dist/cjs/src/pro/exmo.js +15 -13
  59. package/dist/cjs/src/pro/gate.js +1 -1
  60. package/dist/cjs/src/pro/gemini.js +4 -2
  61. package/dist/cjs/src/pro/hitbtc.js +9 -8
  62. package/dist/cjs/src/pro/hollaex.js +2 -2
  63. package/dist/cjs/src/pro/htx.js +6 -7
  64. package/dist/cjs/src/pro/huobijp.js +3 -5
  65. package/dist/cjs/src/pro/idex.js +1 -1
  66. package/dist/cjs/src/pro/independentreserve.js +14 -13
  67. package/dist/cjs/src/pro/kraken.js +10 -16
  68. package/dist/cjs/src/pro/krakenfutures.js +10 -6
  69. package/dist/cjs/src/pro/kucoin.js +10 -11
  70. package/dist/cjs/src/pro/kucoinfutures.js +12 -11
  71. package/dist/cjs/src/pro/lbank.js +10 -10
  72. package/dist/cjs/src/pro/luno.js +12 -14
  73. package/dist/cjs/src/pro/mexc.js +3 -2
  74. package/dist/cjs/src/pro/ndax.js +7 -13
  75. package/dist/cjs/src/pro/okcoin.js +7 -12
  76. package/dist/cjs/src/pro/okx.js +6 -11
  77. package/dist/cjs/src/pro/onetrading.js +16 -15
  78. package/dist/cjs/src/pro/p2b.js +5 -3
  79. package/dist/cjs/src/pro/phemex.js +16 -11
  80. package/dist/cjs/src/pro/poloniex.js +6 -4
  81. package/dist/cjs/src/pro/poloniexfutures.js +14 -9
  82. package/dist/cjs/src/pro/probit.js +15 -11
  83. package/dist/cjs/src/pro/upbit.js +8 -8
  84. package/dist/cjs/src/pro/wazirx.js +6 -3
  85. package/dist/cjs/src/pro/woo.js +8 -6
  86. package/dist/cjs/src/probit.js +3 -3
  87. package/dist/cjs/src/timex.js +1 -1
  88. package/dist/cjs/src/tokocrypto.js +2 -2
  89. package/dist/cjs/src/wavesexchange.js +2 -1
  90. package/dist/cjs/src/whitebit.js +1 -1
  91. package/dist/cjs/src/woo.js +1 -1
  92. package/dist/cjs/src/yobit.js +39 -0
  93. package/js/ccxt.d.ts +1 -1
  94. package/js/ccxt.js +1 -1
  95. package/js/src/abstract/coinbase.d.ts +10 -0
  96. package/js/src/abstract/okx.d.ts +12 -1
  97. package/js/src/ace.d.ts +1 -1
  98. package/js/src/ace.js +3 -2
  99. package/js/src/alpaca.d.ts +1 -1
  100. package/js/src/ascendex.d.ts +5 -15
  101. package/js/src/ascendex.js +1 -1
  102. package/js/src/base/Exchange.d.ts +88 -79
  103. package/js/src/base/Exchange.js +66 -24
  104. package/js/src/base/types.d.ts +90 -6
  105. package/js/src/bigone.d.ts +5 -15
  106. package/js/src/bigone.js +21 -1
  107. package/js/src/binance.d.ts +13 -23
  108. package/js/src/binance.js +6 -5
  109. package/js/src/bingx.d.ts +6 -16
  110. package/js/src/bingx.js +4 -3
  111. package/js/src/bit2c.d.ts +1 -1
  112. package/js/src/bit2c.js +12 -0
  113. package/js/src/bitbank.d.ts +2 -2
  114. package/js/src/bitbns.d.ts +1 -1
  115. package/js/src/bitfinex.d.ts +5 -5
  116. package/js/src/bitfinex2.d.ts +11 -16
  117. package/js/src/bitfinex2.js +415 -41
  118. package/js/src/bitflyer.d.ts +5 -5
  119. package/js/src/bitforex.d.ts +1 -1
  120. package/js/src/bitforex.js +3 -0
  121. package/js/src/bitget.d.ts +8 -38
  122. package/js/src/bitget.js +3 -3
  123. package/js/src/bithumb.d.ts +2 -2
  124. package/js/src/bitmart.d.ts +10 -21
  125. package/js/src/bitmart.js +1 -1
  126. package/js/src/bitmex.d.ts +3 -3
  127. package/js/src/bitopro.d.ts +2 -2
  128. package/js/src/bitrue.d.ts +5 -15
  129. package/js/src/bitrue.js +3 -3
  130. package/js/src/bitso.d.ts +4 -4
  131. package/js/src/bitstamp.d.ts +2 -2
  132. package/js/src/bitteam.d.ts +1 -1
  133. package/js/src/bitvavo.d.ts +3 -3
  134. package/js/src/bl3p.d.ts +1 -1
  135. package/js/src/blockchaincom.d.ts +2 -2
  136. package/js/src/blockchaincom.js +1 -1
  137. package/js/src/btcalpha.d.ts +1 -1
  138. package/js/src/btcbox.d.ts +1 -1
  139. package/js/src/btcmarkets.d.ts +3 -3
  140. package/js/src/btcturk.d.ts +1 -1
  141. package/js/src/bybit.d.ts +8 -8
  142. package/js/src/bybit.js +1 -1
  143. package/js/src/cex.d.ts +1 -1
  144. package/js/src/coinbase.d.ts +6 -50
  145. package/js/src/coinbase.js +12 -2
  146. package/js/src/coinbasepro.d.ts +2 -2
  147. package/js/src/coincheck.d.ts +1 -1
  148. package/js/src/coinex.d.ts +8 -8
  149. package/js/src/coinex.js +1 -1
  150. package/js/src/coinlist.d.ts +4 -14
  151. package/js/src/coinmate.d.ts +2 -2
  152. package/js/src/coinmetro.d.ts +2 -2
  153. package/js/src/coinone.d.ts +1 -1
  154. package/js/src/coinsph.d.ts +2 -2
  155. package/js/src/coinspot.d.ts +1 -1
  156. package/js/src/cryptocom.d.ts +4 -4
  157. package/js/src/cryptocom.js +10 -10
  158. package/js/src/currencycom.d.ts +2 -2
  159. package/js/src/delta.d.ts +2 -2
  160. package/js/src/deribit.d.ts +4 -14
  161. package/js/src/deribit.js +1 -0
  162. package/js/src/digifinex.d.ts +10 -38
  163. package/js/src/exmo.d.ts +2 -2
  164. package/js/src/gate.d.ts +8 -18
  165. package/js/src/gate.js +34 -29
  166. package/js/src/gemini.d.ts +2 -2
  167. package/js/src/hitbtc.d.ts +6 -16
  168. package/js/src/hollaex.d.ts +2 -2
  169. package/js/src/htx.d.ts +11 -21
  170. package/js/src/htx.js +1 -1
  171. package/js/src/huobijp.d.ts +4 -4
  172. package/js/src/idex.d.ts +3 -3
  173. package/js/src/independentreserve.d.ts +2 -2
  174. package/js/src/indodax.d.ts +2 -2
  175. package/js/src/kraken.d.ts +5 -5
  176. package/js/src/kraken.js +42 -1
  177. package/js/src/krakenfutures.d.ts +7 -7
  178. package/js/src/krakenfutures.js +3 -0
  179. package/js/src/kucoin.d.ts +8 -29
  180. package/js/src/kucoin.js +1 -1
  181. package/js/src/kucoinfutures.d.ts +4 -4
  182. package/js/src/kuna.d.ts +2 -2
  183. package/js/src/latoken.d.ts +4 -14
  184. package/js/src/lbank.d.ts +3 -6
  185. package/js/src/lbank.js +27 -26
  186. package/js/src/luno.d.ts +1 -1
  187. package/js/src/lykke.d.ts +2 -2
  188. package/js/src/mercado.d.ts +2 -2
  189. package/js/src/mexc.d.ts +6 -6
  190. package/js/src/mexc.js +2 -1
  191. package/js/src/ndax.d.ts +2 -2
  192. package/js/src/novadax.d.ts +4 -15
  193. package/js/src/oceanex.d.ts +1 -1
  194. package/js/src/okcoin.d.ts +5 -15
  195. package/js/src/okx.d.ts +8 -18
  196. package/js/src/okx.js +20 -5
  197. package/js/src/onetrading.d.ts +2 -2
  198. package/js/src/p2b.d.ts +1 -1
  199. package/js/src/paymium.d.ts +3 -13
  200. package/js/src/phemex.d.ts +5 -5
  201. package/js/src/phemex.js +8 -8
  202. package/js/src/poloniex.d.ts +4 -14
  203. package/js/src/poloniexfutures.d.ts +1 -1
  204. package/js/src/poloniexfutures.js +3 -0
  205. package/js/src/pro/alpaca.d.ts +2 -2
  206. package/js/src/pro/alpaca.js +8 -4
  207. package/js/src/pro/ascendex.d.ts +2 -2
  208. package/js/src/pro/ascendex.js +1 -2
  209. package/js/src/pro/binance.d.ts +3 -3
  210. package/js/src/pro/binance.js +14 -10
  211. package/js/src/pro/bingx.d.ts +1 -1
  212. package/js/src/pro/bingx.js +1 -1
  213. package/js/src/pro/bitfinex.d.ts +2 -2
  214. package/js/src/pro/bitfinex.js +21 -24
  215. package/js/src/pro/bitfinex2.d.ts +2 -2
  216. package/js/src/pro/bitfinex2.js +13 -17
  217. package/js/src/pro/bitget.js +3 -1
  218. package/js/src/pro/bitmart.d.ts +3 -3
  219. package/js/src/pro/bitmart.js +3 -8
  220. package/js/src/pro/bitmex.d.ts +1 -1
  221. package/js/src/pro/bitmex.js +4 -7
  222. package/js/src/pro/bitopro.d.ts +1 -1
  223. package/js/src/pro/bitopro.js +2 -5
  224. package/js/src/pro/bitrue.js +1 -1
  225. package/js/src/pro/bitstamp.d.ts +1 -1
  226. package/js/src/pro/bitstamp.js +2 -3
  227. package/js/src/pro/bitvavo.d.ts +3 -3
  228. package/js/src/pro/bitvavo.js +12 -5
  229. package/js/src/pro/blockchaincom.d.ts +8 -8
  230. package/js/src/pro/blockchaincom.js +22 -23
  231. package/js/src/pro/bybit.d.ts +2 -2
  232. package/js/src/pro/bybit.js +5 -5
  233. package/js/src/pro/cex.d.ts +1 -1
  234. package/js/src/pro/cex.js +7 -7
  235. package/js/src/pro/coinbase.d.ts +1 -1
  236. package/js/src/pro/coinbase.js +3 -2
  237. package/js/src/pro/coinbasepro.d.ts +1 -1
  238. package/js/src/pro/coinbasepro.js +1 -1
  239. package/js/src/pro/coinex.d.ts +2 -2
  240. package/js/src/pro/coinex.js +15 -13
  241. package/js/src/pro/currencycom.d.ts +1 -1
  242. package/js/src/pro/currencycom.js +5 -7
  243. package/js/src/pro/deribit.d.ts +2 -2
  244. package/js/src/pro/deribit.js +4 -4
  245. package/js/src/pro/exmo.d.ts +2 -2
  246. package/js/src/pro/exmo.js +15 -13
  247. package/js/src/pro/gate.js +1 -1
  248. package/js/src/pro/gemini.d.ts +1 -1
  249. package/js/src/pro/gemini.js +4 -2
  250. package/js/src/pro/hitbtc.d.ts +2 -2
  251. package/js/src/pro/hitbtc.js +9 -8
  252. package/js/src/pro/hollaex.d.ts +2 -2
  253. package/js/src/pro/hollaex.js +2 -2
  254. package/js/src/pro/htx.d.ts +2 -2
  255. package/js/src/pro/htx.js +6 -7
  256. package/js/src/pro/huobijp.d.ts +1 -1
  257. package/js/src/pro/huobijp.js +3 -5
  258. package/js/src/pro/idex.js +1 -1
  259. package/js/src/pro/independentreserve.d.ts +1 -1
  260. package/js/src/pro/independentreserve.js +14 -13
  261. package/js/src/pro/kraken.d.ts +2 -2
  262. package/js/src/pro/kraken.js +10 -16
  263. package/js/src/pro/krakenfutures.d.ts +1 -1
  264. package/js/src/pro/krakenfutures.js +10 -6
  265. package/js/src/pro/kucoin.d.ts +3 -3
  266. package/js/src/pro/kucoin.js +10 -11
  267. package/js/src/pro/kucoinfutures.d.ts +3 -3
  268. package/js/src/pro/kucoinfutures.js +12 -11
  269. package/js/src/pro/lbank.d.ts +1 -1
  270. package/js/src/pro/lbank.js +10 -10
  271. package/js/src/pro/luno.d.ts +2 -2
  272. package/js/src/pro/luno.js +12 -14
  273. package/js/src/pro/mexc.d.ts +2 -2
  274. package/js/src/pro/mexc.js +3 -2
  275. package/js/src/pro/ndax.d.ts +3 -3
  276. package/js/src/pro/ndax.js +7 -13
  277. package/js/src/pro/okcoin.d.ts +1 -1
  278. package/js/src/pro/okcoin.js +7 -12
  279. package/js/src/pro/okx.d.ts +1 -1
  280. package/js/src/pro/okx.js +6 -11
  281. package/js/src/pro/onetrading.d.ts +1 -1
  282. package/js/src/pro/onetrading.js +16 -15
  283. package/js/src/pro/p2b.d.ts +1 -1
  284. package/js/src/pro/p2b.js +5 -3
  285. package/js/src/pro/phemex.d.ts +3 -3
  286. package/js/src/pro/phemex.js +16 -11
  287. package/js/src/pro/poloniex.d.ts +1 -1
  288. package/js/src/pro/poloniex.js +6 -4
  289. package/js/src/pro/poloniexfutures.d.ts +4 -4
  290. package/js/src/pro/poloniexfutures.js +13 -10
  291. package/js/src/pro/probit.d.ts +1 -1
  292. package/js/src/pro/probit.js +14 -12
  293. package/js/src/pro/upbit.js +8 -8
  294. package/js/src/pro/wazirx.d.ts +1 -1
  295. package/js/src/pro/wazirx.js +6 -3
  296. package/js/src/pro/woo.d.ts +3 -3
  297. package/js/src/pro/woo.js +8 -6
  298. package/js/src/probit.d.ts +3 -3
  299. package/js/src/probit.js +3 -3
  300. package/js/src/timex.d.ts +1 -1
  301. package/js/src/timex.js +1 -1
  302. package/js/src/tokocrypto.d.ts +3 -3
  303. package/js/src/tokocrypto.js +2 -2
  304. package/js/src/upbit.d.ts +2 -2
  305. package/js/src/wavesexchange.d.ts +3 -4
  306. package/js/src/wavesexchange.js +2 -1
  307. package/js/src/wazirx.d.ts +1 -1
  308. package/js/src/whitebit.d.ts +5 -15
  309. package/js/src/whitebit.js +1 -1
  310. package/js/src/woo.d.ts +5 -15
  311. package/js/src/woo.js +1 -1
  312. package/js/src/yobit.d.ts +21 -6
  313. package/js/src/yobit.js +39 -0
  314. package/js/src/zaif.d.ts +2 -2
  315. package/js/src/zonda.d.ts +4 -14
  316. package/package.json +22 -8
  317. package/skip-tests.json +9 -1
  318. package/tests-manager.sh +1 -2
package/dist/cjs/ccxt.js CHANGED
@@ -176,7 +176,7 @@ var woo$1 = require('./src/pro/woo.js');
176
176
 
177
177
  //-----------------------------------------------------------------------------
178
178
  // this is updated by vss.js when building
179
- const version = '4.2.30';
179
+ const version = '4.2.34';
180
180
  Exchange["default"].ccxtVersion = version;
181
181
  const exchanges = {
182
182
  'ace': ace,
@@ -1048,8 +1048,9 @@ class ace extends ace$1 {
1048
1048
  const feedback = this.id + ' ' + body;
1049
1049
  const status = this.safeNumber(response, 'status', 200);
1050
1050
  if (status > 200) {
1051
- this.throwExactlyMatchedException(this.exceptions['exact'], status, feedback);
1052
- this.throwBroadlyMatchedException(this.exceptions['broad'], status, feedback);
1051
+ const statusStr = status.toString();
1052
+ this.throwExactlyMatchedException(this.exceptions['exact'], statusStr, feedback);
1053
+ this.throwBroadlyMatchedException(this.exceptions['broad'], statusStr, feedback);
1053
1054
  }
1054
1055
  return undefined;
1055
1056
  }
@@ -3130,7 +3130,7 @@ class ascendex extends ascendex$1 {
3130
3130
  * @method
3131
3131
  * @name ascendex#transfer
3132
3132
  * @description transfer currency internally between wallets on the same account
3133
- * @param {string} code unified currency code
3133
+ * @param {string} code unified currency codeåå
3134
3134
  * @param {float} amount amount to transfer
3135
3135
  * @param {string} fromAccount account to transfer from
3136
3136
  * @param {string} toAccount account to transfer to
@@ -39,6 +39,7 @@ const { isNode, deepExtend, extend, clone, flatten, unique, indexBy, sortBy, sor
39
39
  */
40
40
  class Exchange {
41
41
  constructor(userConfig = {}) {
42
+ this.throttleProp = undefined;
42
43
  this.api = undefined;
43
44
  this.userAgent = undefined;
44
45
  this.user_agent = undefined;
@@ -120,6 +121,7 @@ class Exchange {
120
121
  this.clients = {};
121
122
  this.newUpdates = true;
122
123
  this.streaming = {};
124
+ this.alias = false;
123
125
  this.deepExtend = deepExtend;
124
126
  this.isNode = isNode;
125
127
  this.keys = generic.keys;
@@ -695,7 +697,7 @@ class Exchange {
695
697
  // @ts-ignore
696
698
  this.httpProxyAgentModule = await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(/* webpackIgnore: true */ 'https-proxy-agent')); });
697
699
  }
698
- catch { }
700
+ catch (e) { }
699
701
  }
700
702
  if (this.socksProxyAgentModuleChecked === false) {
701
703
  this.socksProxyAgentModuleChecked = true;
@@ -957,7 +959,7 @@ class Exchange {
957
959
  const markets = await this.fetchMarkets(params);
958
960
  return this.setMarkets(markets, currencies);
959
961
  }
960
- loadMarkets(reload = false, params = {}) {
962
+ async loadMarkets(reload = false, params = {}) {
961
963
  // this method is async, it returns a promise
962
964
  if ((reload && !this.reloadingMarkets) || !this.marketsLoading) {
963
965
  this.reloadingMarkets = true;
@@ -971,28 +973,28 @@ class Exchange {
971
973
  }
972
974
  return this.marketsLoading;
973
975
  }
974
- fetchCurrencies(params = {}) {
976
+ async fetchCurrencies(params = {}) {
975
977
  // markets are returned as a list
976
978
  // currencies are returned as a dict
977
979
  // this is for historical reasons
978
980
  // and may be changed for consistency later
979
981
  return new Promise((resolve, reject) => resolve(this.currencies));
980
982
  }
981
- fetchCurrenciesWs(params = {}) {
983
+ async fetchCurrenciesWs(params = {}) {
982
984
  // markets are returned as a list
983
985
  // currencies are returned as a dict
984
986
  // this is for historical reasons
985
987
  // and may be changed for consistency later
986
988
  return new Promise((resolve, reject) => resolve(this.currencies));
987
989
  }
988
- fetchMarkets(params = {}) {
990
+ async fetchMarkets(params = {}) {
989
991
  // markets are returned as a list
990
992
  // currencies are returned as a dict
991
993
  // this is for historical reasons
992
994
  // and may be changed for consistency later
993
995
  return new Promise((resolve, reject) => resolve(Object.values(this.markets)));
994
996
  }
995
- fetchMarketsWs(params = {}) {
997
+ async fetchMarketsWs(params = {}) {
996
998
  // markets are returned as a list
997
999
  // currencies are returned as a dict
998
1000
  // this is for historical reasons
@@ -1067,6 +1069,9 @@ class Exchange {
1067
1069
  }
1068
1070
  handleMessage(client, message) { } // stub to override
1069
1071
  // ping (client) {} // stub to override
1072
+ ping(client) {
1073
+ return undefined;
1074
+ }
1070
1075
  client(url) {
1071
1076
  this.clients = this.clients || {};
1072
1077
  if (!this.clients[url]) {
@@ -1681,7 +1686,7 @@ class Exchange {
1681
1686
  }
1682
1687
  return result;
1683
1688
  }
1684
- filterByLimit(array, limit = undefined, key = 'timestamp') {
1689
+ filterByLimit(array, limit = undefined, key = 'timestamp', fromStart = false) {
1685
1690
  if (this.valueIsDefined(limit)) {
1686
1691
  const arrayLength = array.length;
1687
1692
  if (arrayLength > 0) {
@@ -1693,7 +1698,15 @@ class Exchange {
1693
1698
  ascending = first <= last; // true if array is sorted in ascending order based on 'timestamp'
1694
1699
  }
1695
1700
  }
1696
- array = ascending ? this.arraySlice(array, -limit) : this.arraySlice(array, 0, limit);
1701
+ if (fromStart) {
1702
+ if (limit > arrayLength) {
1703
+ limit = arrayLength;
1704
+ }
1705
+ array = ascending ? this.arraySlice(array, 0, limit) : this.arraySlice(array, -limit);
1706
+ }
1707
+ else {
1708
+ array = ascending ? this.arraySlice(array, -limit) : this.arraySlice(array, 0, limit);
1709
+ }
1697
1710
  }
1698
1711
  }
1699
1712
  return array;
@@ -1715,7 +1728,10 @@ class Exchange {
1715
1728
  if (tail && limit !== undefined) {
1716
1729
  return this.arraySlice(result, -limit);
1717
1730
  }
1718
- return this.filterByLimit(result, limit, key);
1731
+ // if the user provided a 'since' argument
1732
+ // we want to limit the result starting from the 'since'
1733
+ const shouldFilterFromStart = !tail && sinceIsDefined;
1734
+ return this.filterByLimit(result, limit, key, shouldFilterFromStart);
1719
1735
  }
1720
1736
  filterByValueSinceLimit(array, field, value = undefined, since = undefined, limit = undefined, key = 'timestamp', tail = false) {
1721
1737
  const valueIsDefined = this.valueIsDefined(value);
@@ -1740,7 +1756,7 @@ class Exchange {
1740
1756
  if (tail && limit !== undefined) {
1741
1757
  return this.arraySlice(result, -limit);
1742
1758
  }
1743
- return this.filterByLimit(result, limit, key);
1759
+ return this.filterByLimit(result, limit, key, sinceIsDefined);
1744
1760
  }
1745
1761
  setSandboxMode(enabled) {
1746
1762
  if (enabled) {
@@ -1914,6 +1930,18 @@ class Exchange {
1914
1930
  async setLeverage(leverage, symbol = undefined, params = {}) {
1915
1931
  throw new errors.NotSupported(this.id + ' setLeverage() is not supported yet');
1916
1932
  }
1933
+ async fetchOpenInterestHistory(symbol, timeframe = '1h', since = undefined, limit = undefined, params = {}) {
1934
+ throw new errors.NotSupported(this.id + ' fetchOpenInterestHistory() is not supported yet');
1935
+ }
1936
+ async fetchOpenInterest(symbol, params = {}) {
1937
+ throw new errors.NotSupported(this.id + ' fetchOpenInterest() is not supported yet');
1938
+ }
1939
+ async signIn(params = {}) {
1940
+ throw new errors.NotSupported(this.id + ' signIn() is not supported yet');
1941
+ }
1942
+ async fetchPaymentMethods(params = {}) {
1943
+ throw new errors.NotSupported(this.id + ' fetchPaymentMethods() is not supported yet');
1944
+ }
1917
1945
  parseToInt(number) {
1918
1946
  // Solve Common parseInt misuse ex: parseInt ((since / 1000).toString ())
1919
1947
  // using a number as parameter which is not valid in ts
@@ -3524,6 +3552,15 @@ class Exchange {
3524
3552
  async fetchBidsAsks(symbols = undefined, params = {}) {
3525
3553
  throw new errors.NotSupported(this.id + ' fetchBidsAsks() is not supported yet');
3526
3554
  }
3555
+ async fetchBorrowInterest(code = undefined, symbol = undefined, since = undefined, limit = undefined, params = {}) {
3556
+ throw new errors.NotSupported(this.id + ' fetchBorrowInterest() is not supported yet');
3557
+ }
3558
+ async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
3559
+ throw new errors.NotSupported(this.id + ' fetchLedger() is not supported yet');
3560
+ }
3561
+ async fetchLedgerEntry(id, code = undefined, params = {}) {
3562
+ throw new errors.NotSupported(this.id + ' fetchLedgerEntry() is not supported yet');
3563
+ }
3527
3564
  parseBidAsk(bidask, priceKey = 0, amountKey = 1, countOrIdKey = 2) {
3528
3565
  const price = this.safeNumber(bidask, priceKey);
3529
3566
  const amount = this.safeNumber(bidask, amountKey);
@@ -3824,6 +3861,9 @@ class Exchange {
3824
3861
  return this.handleOptionAndParams(params, methodName, 'marginMode', defaultValue);
3825
3862
  }
3826
3863
  throwExactlyMatchedException(exact, string, message) {
3864
+ if (string === undefined) {
3865
+ return;
3866
+ }
3827
3867
  if (string in exact) {
3828
3868
  throw new exact[string](message);
3829
3869
  }
@@ -4247,21 +4287,18 @@ class Exchange {
4247
4287
  */
4248
4288
  throw new errors.NotSupported(this.id + ' fetchDepositsWithdrawals() is not supported yet');
4249
4289
  }
4250
- async fetchDeposits(code = undefined, since = undefined, limit = undefined, params = {}) {
4290
+ async fetchDeposits(symbol = undefined, since = undefined, limit = undefined, params = {}) {
4251
4291
  throw new errors.NotSupported(this.id + ' fetchDeposits() is not supported yet');
4252
4292
  }
4293
+ async fetchWithdrawals(symbol = undefined, since = undefined, limit = undefined, params = {}) {
4294
+ throw new errors.NotSupported(this.id + ' fetchWithdrawals() is not supported yet');
4295
+ }
4253
4296
  async fetchDepositsWs(code = undefined, since = undefined, limit = undefined, params = {}) {
4254
4297
  throw new errors.NotSupported(this.id + ' fetchDepositsWs() is not supported yet');
4255
4298
  }
4256
- async fetchWithdrawals(code = undefined, since = undefined, limit = undefined, params = {}) {
4257
- throw new errors.NotSupported(this.id + ' fetchWithdrawals() is not supported yet');
4258
- }
4259
4299
  async fetchWithdrawalsWs(code = undefined, since = undefined, limit = undefined, params = {}) {
4260
4300
  throw new errors.NotSupported(this.id + ' fetchWithdrawalsWs() is not supported yet');
4261
4301
  }
4262
- async fetchOpenInterest(symbol, params = {}) {
4263
- throw new errors.NotSupported(this.id + ' fetchOpenInterest() is not supported yet');
4264
- }
4265
4302
  async fetchFundingRateHistory(symbol = undefined, since = undefined, limit = undefined, params = {}) {
4266
4303
  throw new errors.NotSupported(this.id + ' fetchFundingRateHistory() is not supported yet');
4267
4304
  }
@@ -4349,7 +4386,7 @@ class Exchange {
4349
4386
  throw new errors.NotSupported(this.id + ' createExpiredOptionMarket () is not supported yet');
4350
4387
  }
4351
4388
  handleWithdrawTagAndParams(tag, params) {
4352
- if (typeof tag === 'object') {
4389
+ if ((tag !== undefined) && (typeof tag === 'object')) {
4353
4390
  params = this.extend(tag, params);
4354
4391
  tag = undefined;
4355
4392
  }
@@ -4483,14 +4520,14 @@ class Exchange {
4483
4520
  throw new errors.NotSupported(this.id + ' fetchMarketLeverageTiers() is not supported yet');
4484
4521
  }
4485
4522
  }
4486
- async createPostOnlyOrder(symbol, type, side, amount, price, params = {}) {
4523
+ async createPostOnlyOrder(symbol, type, side, amount, price = undefined, params = {}) {
4487
4524
  if (!this.has['createPostOnlyOrder']) {
4488
4525
  throw new errors.NotSupported(this.id + 'createPostOnlyOrder() is not supported yet');
4489
4526
  }
4490
4527
  const query = this.extend(params, { 'postOnly': true });
4491
4528
  return await this.createOrder(symbol, type, side, amount, price, query);
4492
4529
  }
4493
- async createReduceOnlyOrder(symbol, type, side, amount, price, params = {}) {
4530
+ async createReduceOnlyOrder(symbol, type, side, amount, price = undefined, params = {}) {
4494
4531
  if (!this.has['createReduceOnlyOrder']) {
4495
4532
  throw new errors.NotSupported(this.id + 'createReduceOnlyOrder() is not supported yet');
4496
4533
  }
@@ -5113,7 +5150,8 @@ class Exchange {
5113
5150
  const response = await this[method](symbol, undefined, maxEntriesPerRequest, params);
5114
5151
  const responseLength = response.length;
5115
5152
  if (this.verbose) {
5116
- this.log('Dynamic pagination call', calls, 'method', method, 'response length', responseLength, 'timestamp', paginationTimestamp);
5153
+ const backwardMessage = 'Dynamic pagination call ' + calls + ' method ' + method + ' response length ' + responseLength + ' timestamp ' + paginationTimestamp;
5154
+ this.log(backwardMessage);
5117
5155
  }
5118
5156
  if (responseLength === 0) {
5119
5157
  break;
@@ -5131,7 +5169,8 @@ class Exchange {
5131
5169
  const response = await this[method](symbol, paginationTimestamp, maxEntriesPerRequest, params);
5132
5170
  const responseLength = response.length;
5133
5171
  if (this.verbose) {
5134
- this.log('Dynamic pagination call', calls, 'method', method, 'response length', responseLength, 'timestamp', paginationTimestamp);
5172
+ const forwardMessage = 'Dynamic pagination call ' + calls + ' method ' + method + ' response length ' + responseLength + ' timestamp ' + paginationTimestamp;
5173
+ this.log(forwardMessage);
5135
5174
  }
5136
5175
  if (responseLength === 0) {
5137
5176
  break;
@@ -5177,6 +5216,7 @@ class Exchange {
5177
5216
  throw e;
5178
5217
  }
5179
5218
  }
5219
+ return undefined;
5180
5220
  }
5181
5221
  async fetchPaginatedCallDeterministic(method, symbol = undefined, since = undefined, limit = undefined, timeframe = undefined, params = {}, maxEntriesPerRequest = undefined) {
5182
5222
  let maxCalls = undefined;
@@ -5241,7 +5281,8 @@ class Exchange {
5241
5281
  errors = 0;
5242
5282
  const responseLength = response.length;
5243
5283
  if (this.verbose) {
5244
- this.log('Cursor pagination call', i + 1, 'method', method, 'response length', responseLength, 'cursor', cursorValue);
5284
+ const cursorMessage = 'Cursor pagination call ' + i + 1 + ' method ' + method + ' response length ' + responseLength + ' cursor ' + cursorValue;
5285
+ this.log(cursorMessage);
5245
5286
  }
5246
5287
  if (responseLength === 0) {
5247
5288
  break;
@@ -5285,7 +5326,8 @@ class Exchange {
5285
5326
  errors = 0;
5286
5327
  const responseLength = response.length;
5287
5328
  if (this.verbose) {
5288
- this.log('Incremental pagination call', i + 1, 'method', method, 'response length', responseLength);
5329
+ const incrementalMessage = 'Incremental pagination call ' + i + 1 + ' method ' + method + ' response length ' + responseLength;
5330
+ this.log(incrementalMessage);
5289
5331
  }
5290
5332
  if (responseLength === 0) {
5291
5333
  break;
@@ -518,6 +518,7 @@ class bigone extends bigone$1 {
518
518
  * @method
519
519
  * @name bigone#fetchMarkets
520
520
  * @description retrieves data on all markets for bigone
521
+ * @see https://open.big.one/docs/spot_asset_pair.html
521
522
  * @param {object} [params] extra parameters specific to the exchange API endpoint
522
523
  * @returns {object[]} an array of objects representing market data
523
524
  */
@@ -780,6 +781,7 @@ class bigone extends bigone$1 {
780
781
  * @method
781
782
  * @name bigone#fetchTicker
782
783
  * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
784
+ * @see https://open.big.one/docs/spot_tickers.html
783
785
  * @param {string} symbol unified symbol of the market to fetch the ticker for
784
786
  * @param {object} [params] extra parameters specific to the exchange API endpoint
785
787
  * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
@@ -822,6 +824,7 @@ class bigone extends bigone$1 {
822
824
  * @method
823
825
  * @name bigone#fetchTickers
824
826
  * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
827
+ * @see https://open.big.one/docs/spot_tickers.html
825
828
  * @param {string[]} [symbols] unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
826
829
  * @param {object} [params] extra parameters specific to the exchange API endpoint
827
830
  * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
@@ -909,6 +912,7 @@ class bigone extends bigone$1 {
909
912
  * @method
910
913
  * @name bigone#fetchTime
911
914
  * @description fetches the current integer timestamp in milliseconds from the exchange server
915
+ * @see https://open.big.one/docs/spot_ping.html
912
916
  * @param {object} [params] extra parameters specific to the exchange API endpoint
913
917
  * @returns {int} the current integer timestamp in milliseconds from the exchange server
914
918
  */
@@ -929,6 +933,7 @@ class bigone extends bigone$1 {
929
933
  * @method
930
934
  * @name bigone#fetchOrderBook
931
935
  * @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
936
+ * @see https://open.big.one/docs/contract_misc.html#get-orderbook-snapshot
932
937
  * @param {string} symbol unified symbol of the market to fetch the order book for
933
938
  * @param {int} [limit] the maximum amount of order book entries to return
934
939
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -1171,6 +1176,7 @@ class bigone extends bigone$1 {
1171
1176
  * @method
1172
1177
  * @name bigone#fetchTrades
1173
1178
  * @description get the list of most recent trades for a particular symbol
1179
+ * @see https://open.big.one/docs/spot_asset_pair_trade.html
1174
1180
  * @param {string} symbol unified symbol of the market to fetch trades for
1175
1181
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
1176
1182
  * @param {int} [limit] the maximum amount of trades to fetch
@@ -1235,6 +1241,7 @@ class bigone extends bigone$1 {
1235
1241
  * @method
1236
1242
  * @name bigone#fetchOHLCV
1237
1243
  * @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
1244
+ * @see https://open.big.one/docs/spot_asset_pair_candle.html
1238
1245
  * @param {string} symbol unified symbol of the market to fetch OHLCV data for
1239
1246
  * @param {string} timeframe the length of time each candle represents
1240
1247
  * @param {int} [since] timestamp in ms of the earliest candle to fetch
@@ -1311,6 +1318,8 @@ class bigone extends bigone$1 {
1311
1318
  * @method
1312
1319
  * @name bigone#fetchBalance
1313
1320
  * @description query for balance and get the amount of funds available for trading or funds locked in orders
1321
+ * @see https://open.big.one/docs/fund_accounts.html
1322
+ * @see https://open.big.one/docs/spot_accounts.html
1314
1323
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1315
1324
  * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
1316
1325
  */
@@ -1556,6 +1565,7 @@ class bigone extends bigone$1 {
1556
1565
  * @method
1557
1566
  * @name bigone#cancelOrder
1558
1567
  * @description cancels an open order
1568
+ * @see https://open.big.one/docs/spot_orders.html#cancel-order
1559
1569
  * @param {string} id order id
1560
1570
  * @param {string} symbol Not used by bigone cancelOrder ()
1561
1571
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -1584,6 +1594,7 @@ class bigone extends bigone$1 {
1584
1594
  * @method
1585
1595
  * @name bigone#cancelAllOrders
1586
1596
  * @description cancel all open orders
1597
+ * @see https://open.big.one/docs/spot_orders.html#cancel-all-orders
1587
1598
  * @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
1588
1599
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1589
1600
  * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
@@ -1613,6 +1624,7 @@ class bigone extends bigone$1 {
1613
1624
  * @method
1614
1625
  * @name bigone#fetchOrder
1615
1626
  * @description fetches information on an order made by the user
1627
+ * @see https://open.big.one/docs/spot_orders.html#get-one-order
1616
1628
  * @param {string} symbol not used by bigone fetchOrder
1617
1629
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1618
1630
  * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
@@ -1628,6 +1640,7 @@ class bigone extends bigone$1 {
1628
1640
  * @method
1629
1641
  * @name bigone#fetchOrders
1630
1642
  * @description fetches information on multiple orders made by the user
1643
+ * @see https://open.big.one/docs/spot_orders.html#get-user-orders-in-one-asset-pair
1631
1644
  * @param {string} symbol unified market symbol of the market orders were made in
1632
1645
  * @param {int} [since] the earliest time in ms to fetch orders for
1633
1646
  * @param {int} [limit] the maximum number of order structures to retrieve
@@ -1678,6 +1691,7 @@ class bigone extends bigone$1 {
1678
1691
  * @method
1679
1692
  * @name bigone#fetchMyTrades
1680
1693
  * @description fetch all trades made by the user
1694
+ * @see https://open.big.one/docs/spot_trade.html#trades-of-user
1681
1695
  * @param {string} symbol unified market symbol
1682
1696
  * @param {int} [since] the earliest time in ms to fetch trades for
1683
1697
  * @param {int} [limit] the maximum number of trades structures to retrieve
@@ -1747,6 +1761,7 @@ class bigone extends bigone$1 {
1747
1761
  * @method
1748
1762
  * @name bigone#fetchOpenOrders
1749
1763
  * @description fetch all unfilled currently open orders
1764
+ * @see https://open.big.one/docs/spot_orders.html#get-user-orders-in-one-asset-pair
1750
1765
  * @param {string} symbol unified market symbol
1751
1766
  * @param {int} [since] the earliest time in ms to fetch open orders for
1752
1767
  * @param {int} [limit] the maximum number of open orders structures to retrieve
@@ -1763,6 +1778,7 @@ class bigone extends bigone$1 {
1763
1778
  * @method
1764
1779
  * @name bigone#fetchClosedOrders
1765
1780
  * @description fetches information on multiple closed orders made by the user
1781
+ * @see https://open.big.one/docs/spot_orders.html#get-user-orders-in-one-asset-pair
1766
1782
  * @param {string} symbol unified market symbol of the market orders were made in
1767
1783
  * @param {int} [since] the earliest time in ms to fetch orders for
1768
1784
  * @param {int} [limit] the maximum number of order structures to retrieve
@@ -1817,6 +1833,7 @@ class bigone extends bigone$1 {
1817
1833
  * @method
1818
1834
  * @name bigone#fetchDepositAddress
1819
1835
  * @description fetch the deposit address for a currency associated with this account
1836
+ * @see https://open.big.one/docs/spot_deposit.html#get-deposite-address-of-one-asset-of-user
1820
1837
  * @param {string} code unified currency code
1821
1838
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1822
1839
  * @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
@@ -1967,6 +1984,7 @@ class bigone extends bigone$1 {
1967
1984
  * @method
1968
1985
  * @name bigone#fetchDeposits
1969
1986
  * @description fetch all deposits made to an account
1987
+ * @see https://open.big.one/docs/spot_deposit.html#deposit-of-user
1970
1988
  * @param {string} code unified currency code
1971
1989
  * @param {int} [since] the earliest time in ms to fetch deposits for
1972
1990
  * @param {int} [limit] the maximum number of deposits structures to retrieve
@@ -2018,6 +2036,7 @@ class bigone extends bigone$1 {
2018
2036
  * @method
2019
2037
  * @name bigone#fetchWithdrawals
2020
2038
  * @description fetch all withdrawals made from an account
2039
+ * @see https://open.big.one/docs/spot_withdrawal.html#get-withdrawals-of-user
2021
2040
  * @param {string} code unified currency code
2022
2041
  * @param {int} [since] the earliest time in ms to fetch withdrawals for
2023
2042
  * @param {int} [limit] the maximum number of withdrawals structures to retrieve
@@ -2123,7 +2142,7 @@ class bigone extends bigone$1 {
2123
2142
  'id': undefined,
2124
2143
  'timestamp': undefined,
2125
2144
  'datetime': undefined,
2126
- 'currency': code,
2145
+ 'currency': undefined,
2127
2146
  'amount': undefined,
2128
2147
  'fromAccount': undefined,
2129
2148
  'toAccount': undefined,
@@ -2141,6 +2160,7 @@ class bigone extends bigone$1 {
2141
2160
  * @method
2142
2161
  * @name bigone#withdraw
2143
2162
  * @description make a withdrawal
2163
+ * @see https://open.big.one/docs/spot_withdrawal.html#create-withdrawal-of-user
2144
2164
  * @param {string} code unified currency code
2145
2165
  * @param {float} amount the amount to withdraw
2146
2166
  * @param {string} address the address to withdraw to
@@ -3136,7 +3136,7 @@ class binance extends binance$1 {
3136
3136
  account['debt'] = Precise["default"].stringAdd(debt, interest);
3137
3137
  return account;
3138
3138
  }
3139
- parseBalance(response, type = undefined, marginMode = undefined) {
3139
+ parseBalanceCustom(response, type = undefined, marginMode = undefined) {
3140
3140
  const result = {
3141
3141
  'info': response,
3142
3142
  };
@@ -3479,7 +3479,7 @@ class binance extends binance$1 {
3479
3479
  // }
3480
3480
  // ]
3481
3481
  //
3482
- return this.parseBalance(response, type, marginMode);
3482
+ return this.parseBalanceCustom(response, type, marginMode);
3483
3483
  }
3484
3484
  async fetchOrderBook(symbol, limit = undefined, params = {}) {
3485
3485
  /**
@@ -5251,7 +5251,7 @@ class binance extends binance$1 {
5251
5251
  const stopLossPrice = this.safeValue(params, 'stopLossPrice', triggerPrice); // fallback to stopLoss
5252
5252
  const takeProfitPrice = this.safeValue(params, 'takeProfitPrice');
5253
5253
  const trailingDelta = this.safeValue(params, 'trailingDelta');
5254
- const trailingTriggerPrice = this.safeString2(params, 'trailingTriggerPrice', 'activationPrice', price);
5254
+ const trailingTriggerPrice = this.safeString2(params, 'trailingTriggerPrice', 'activationPrice', this.numberToString(price));
5255
5255
  const trailingPercent = this.safeString2(params, 'trailingPercent', 'callbackRate');
5256
5256
  const isTrailingPercentOrder = trailingPercent !== undefined;
5257
5257
  const isStopLoss = stopLossPrice !== undefined || trailingDelta !== undefined;
@@ -5853,7 +5853,7 @@ class binance extends binance$1 {
5853
5853
  params = this.omit(params, 'type');
5854
5854
  const orders = await this.fetchOrders(symbol, since, undefined, params);
5855
5855
  const filteredOrders = this.filterBy(orders, 'status', 'canceled');
5856
- return this.filterByLimit(filteredOrders, limit);
5856
+ return this.filterBySinceLimit(filteredOrders, since, limit);
5857
5857
  }
5858
5858
  async cancelOrder(id, symbol = undefined, params = {}) {
5859
5859
  /**
@@ -9584,7 +9584,7 @@ class binance extends binance$1 {
9584
9584
  }
9585
9585
  return this.safeValue(config, 'cost', 1);
9586
9586
  }
9587
- async request(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined, config = {}, context = {}) {
9587
+ async request(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined, config = {}) {
9588
9588
  const response = await this.fetch2(path, api, method, params, headers, body, config);
9589
9589
  // a workaround for {"code":-2015,"msg":"Invalid API-key, IP, or permissions for action."}
9590
9590
  if (api === 'private') {
@@ -10217,6 +10217,7 @@ class binance extends binance$1 {
10217
10217
  else {
10218
10218
  return this.parseOpenInterest(response, market);
10219
10219
  }
10220
+ return undefined;
10220
10221
  }
10221
10222
  parseOpenInterest(interest, market = undefined) {
10222
10223
  const timestamp = this.safeInteger2(interest, 'timestamp', 'time');
@@ -1885,6 +1885,7 @@ class bingx extends bingx$1 {
1885
1885
  }
1886
1886
  }
1887
1887
  if (isStopLoss || isTakeProfit) {
1888
+ const stringifiedAmount = this.numberToString(amount);
1888
1889
  if (isStopLoss) {
1889
1890
  const slTriggerPrice = this.safeString2(stopLoss, 'triggerPrice', 'stopPrice', stopLoss);
1890
1891
  const slWorkingType = this.safeString(stopLoss, 'workingType', 'MARK_PRICE');
@@ -1898,7 +1899,7 @@ class bingx extends bingx$1 {
1898
1899
  if (slPrice !== undefined) {
1899
1900
  slRequest['price'] = this.parseToNumeric(this.priceToPrecision(symbol, slPrice));
1900
1901
  }
1901
- const slQuantity = this.safeString(stopLoss, 'quantity', amount);
1902
+ const slQuantity = this.safeString(stopLoss, 'quantity', stringifiedAmount);
1902
1903
  slRequest['quantity'] = this.parseToNumeric(this.amountToPrecision(symbol, slQuantity));
1903
1904
  request['stopLoss'] = this.json(slRequest);
1904
1905
  }
@@ -1915,7 +1916,7 @@ class bingx extends bingx$1 {
1915
1916
  if (slPrice !== undefined) {
1916
1917
  tpRequest['price'] = this.parseToNumeric(this.priceToPrecision(symbol, slPrice));
1917
1918
  }
1918
- const tkQuantity = this.safeString(takeProfit, 'quantity', amount);
1919
+ const tkQuantity = this.safeString(takeProfit, 'quantity', stringifiedAmount);
1919
1920
  tpRequest['quantity'] = this.parseToNumeric(this.amountToPrecision(symbol, tkQuantity));
1920
1921
  request['takeProfit'] = this.json(tpRequest);
1921
1922
  }
@@ -3601,7 +3602,7 @@ class bingx extends bingx$1 {
3601
3602
  // "id":"1197073063359000577"
3602
3603
  // }
3603
3604
  // }
3604
- this.parseTransaction(data);
3605
+ return this.parseTransaction(data);
3605
3606
  }
3606
3607
  parseParams(params) {
3607
3608
  const sortedParams = this.keysort(params);
@@ -208,6 +208,7 @@ class bit2c extends bit2c$1 {
208
208
  * @method
209
209
  * @name bit2c#fetchBalance
210
210
  * @description query for balance and get the amount of funds available for trading or funds locked in orders
211
+ * @see https://bit2c.co.il/home/api#balance
211
212
  * @param {object} [params] extra parameters specific to the exchange API endpoint
212
213
  * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
213
214
  */
@@ -262,6 +263,7 @@ class bit2c extends bit2c$1 {
262
263
  * @method
263
264
  * @name bit2c#fetchOrderBook
264
265
  * @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
266
+ * @see https://bit2c.co.il/home/api#orderb
265
267
  * @param {string} symbol unified symbol of the market to fetch the order book for
266
268
  * @param {int} [limit] the maximum amount of order book entries to return
267
269
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -308,6 +310,7 @@ class bit2c extends bit2c$1 {
308
310
  * @method
309
311
  * @name bit2c#fetchTicker
310
312
  * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
313
+ * @see https://bit2c.co.il/home/api#ticker
311
314
  * @param {string} symbol unified symbol of the market to fetch the ticker for
312
315
  * @param {object} [params] extra parameters specific to the exchange API endpoint
313
316
  * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
@@ -325,6 +328,8 @@ class bit2c extends bit2c$1 {
325
328
  * @method
326
329
  * @name bit2c#fetchTrades
327
330
  * @description get the list of most recent trades for a particular symbol
331
+ * @see https://bit2c.co.il/home/api#transactions
332
+ * @see https://bit2c.co.il/home/api#trades
328
333
  * @param {string} symbol unified symbol of the market to fetch trades for
329
334
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
330
335
  * @param {int} [limit] the maximum amount of trades to fetch
@@ -367,6 +372,7 @@ class bit2c extends bit2c$1 {
367
372
  * @method
368
373
  * @name bit2c#fetchTradingFees
369
374
  * @description fetch the trading fees for multiple markets
375
+ * @see https://bit2c.co.il/home/api#balance
370
376
  * @param {object} [params] extra parameters specific to the exchange API endpoint
371
377
  * @returns {object} a dictionary of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure} indexed by market symbols
372
378
  */
@@ -415,6 +421,7 @@ class bit2c extends bit2c$1 {
415
421
  * @method
416
422
  * @name bit2c#createOrder
417
423
  * @description create a trade order
424
+ * @see https://bit2c.co.il/home/api#addo
418
425
  * @param {string} symbol unified symbol of the market to create an order in
419
426
  * @param {string} type 'market' or 'limit'
420
427
  * @param {string} side 'buy' or 'sell'
@@ -448,6 +455,7 @@ class bit2c extends bit2c$1 {
448
455
  * @method
449
456
  * @name bit2c#cancelOrder
450
457
  * @description cancels an open order
458
+ * @see https://bit2c.co.il/home/api#cancelo
451
459
  * @param {string} id order id
452
460
  * @param {string} symbol Not used by bit2c cancelOrder ()
453
461
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -463,6 +471,7 @@ class bit2c extends bit2c$1 {
463
471
  * @method
464
472
  * @name bit2c#fetchOpenOrders
465
473
  * @description fetch all unfilled currently open orders
474
+ * @see https://bit2c.co.il/home/api#geto
466
475
  * @param {string} symbol unified market symbol
467
476
  * @param {int} [since] the earliest time in ms to fetch open orders for
468
477
  * @param {int} [limit] the maximum number of open order structures to retrieve
@@ -488,6 +497,7 @@ class bit2c extends bit2c$1 {
488
497
  * @method
489
498
  * @name bit2c#fetchOrder
490
499
  * @description fetches information on an order made by the user
500
+ * @see https://bit2c.co.il/home/api#getoid
491
501
  * @param {string} symbol unified market symbol
492
502
  * @param {object} [params] extra parameters specific to the exchange API endpoint
493
503
  * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
@@ -640,6 +650,7 @@ class bit2c extends bit2c$1 {
640
650
  * @method
641
651
  * @name bit2c#fetchMyTrades
642
652
  * @description fetch all trades made by the user
653
+ * @see https://bit2c.co.il/home/api#orderh
643
654
  * @param {string} symbol unified market symbol
644
655
  * @param {int} [since] the earliest time in ms to fetch trades for
645
656
  * @param {int} [limit] the maximum number of trades structures to retrieve
@@ -820,6 +831,7 @@ class bit2c extends bit2c$1 {
820
831
  * @method
821
832
  * @name bit2c#fetchDepositAddress
822
833
  * @description fetch the deposit address for a currency associated with this account
834
+ * @see https://bit2c.co.il/home/api#addc
823
835
  * @param {string} code unified currency code
824
836
  * @param {object} [params] extra parameters specific to the exchange API endpoint
825
837
  * @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}