ccxt 4.5.55 → 4.5.57

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 (321) hide show
  1. package/README.md +215 -10
  2. package/dist/ccxt.browser.min.js +10 -10
  3. package/dist/cjs/ccxt.js +6 -11
  4. package/dist/cjs/src/aftermath.js +10 -5
  5. package/dist/cjs/src/alpaca.js +2 -2
  6. package/dist/cjs/src/apex.js +26 -17
  7. package/dist/cjs/src/arkham.js +10 -7
  8. package/dist/cjs/src/ascendex.js +8 -5
  9. package/dist/cjs/src/aster.js +7 -4
  10. package/dist/cjs/src/backpack.js +4 -4
  11. package/dist/cjs/src/base/Exchange.js +72 -35
  12. package/dist/cjs/src/base/functions/io.js +25 -0
  13. package/dist/cjs/src/base/functions.js +1 -0
  14. package/dist/cjs/src/bigone.js +10 -7
  15. package/dist/cjs/src/binance.js +196 -198
  16. package/dist/cjs/src/bingx.js +7 -7
  17. package/dist/cjs/src/bitfinex.js +71 -58
  18. package/dist/cjs/src/bitflyer.js +2 -1
  19. package/dist/cjs/src/bitget.js +16 -5
  20. package/dist/cjs/src/bitmart.js +18 -10
  21. package/dist/cjs/src/bitmex.js +8 -5
  22. package/dist/cjs/src/bitopro.js +2 -2
  23. package/dist/cjs/src/bitrue.js +4 -3
  24. package/dist/cjs/src/bitso.js +7 -4
  25. package/dist/cjs/src/bitstamp.js +7 -4
  26. package/dist/cjs/src/bitteam.js +1 -1
  27. package/dist/cjs/src/bittrade.js +2 -2
  28. package/dist/cjs/src/bitvavo.js +457 -34
  29. package/dist/cjs/src/blofin.js +28 -4
  30. package/dist/cjs/src/bullish.js +6 -5
  31. package/dist/cjs/src/bybit.js +19 -17
  32. package/dist/cjs/src/bybiteu.js +1 -0
  33. package/dist/cjs/src/bydfi.js +1 -1
  34. package/dist/cjs/src/cex.js +3 -3
  35. package/dist/cjs/src/coinbase.js +75 -65
  36. package/dist/cjs/src/coinbaseexchange.js +4 -3
  37. package/dist/cjs/src/coinbaseinternational.js +17 -10
  38. package/dist/cjs/src/coinex.js +79 -77
  39. package/dist/cjs/src/coinmetro.js +1 -1
  40. package/dist/cjs/src/coinsph.js +5 -5
  41. package/dist/cjs/src/cryptocom.js +52 -54
  42. package/dist/cjs/src/cryptomus.js +43 -39
  43. package/dist/cjs/src/deepcoin.js +9 -5
  44. package/dist/cjs/src/delta.js +53 -53
  45. package/dist/cjs/src/deribit.js +35 -35
  46. package/dist/cjs/src/derive.js +31 -31
  47. package/dist/cjs/src/digifinex.js +45 -45
  48. package/dist/cjs/src/exmo.js +104 -122
  49. package/dist/cjs/src/extended.js +3497 -0
  50. package/dist/cjs/src/foxbit.js +72 -76
  51. package/dist/cjs/src/gate.js +53 -53
  52. package/dist/cjs/src/gemini.js +45 -45
  53. package/dist/cjs/src/grvt.js +17 -11
  54. package/dist/cjs/src/hashkey.js +56 -58
  55. package/dist/cjs/src/hibachi.js +1 -1
  56. package/dist/cjs/src/hitbtc.js +5 -14
  57. package/dist/cjs/src/hollaex.js +51 -54
  58. package/dist/cjs/src/htx.js +84 -72
  59. package/dist/cjs/src/hyperliquid.js +60 -55
  60. package/dist/cjs/src/indodax.js +4 -3
  61. package/dist/cjs/src/kraken.js +71 -71
  62. package/dist/cjs/src/krakenfutures.js +2 -1
  63. package/dist/cjs/src/kucoin.js +3 -2
  64. package/dist/cjs/src/latoken.js +30 -32
  65. package/dist/cjs/src/lbank.js +64 -60
  66. package/dist/cjs/src/lighter.js +36 -38
  67. package/dist/cjs/src/luno.js +36 -44
  68. package/dist/cjs/src/mercado.js +2 -1
  69. package/dist/cjs/src/mexc.js +72 -63
  70. package/dist/cjs/src/modetrade.js +51 -53
  71. package/dist/cjs/src/ndax.js +35 -37
  72. package/dist/cjs/src/okx.js +23 -5
  73. package/dist/cjs/src/onetrading.js +21 -23
  74. package/dist/cjs/src/p2b.js +8 -4
  75. package/dist/cjs/src/paradex.js +3 -2
  76. package/dist/cjs/src/phemex.js +47 -47
  77. package/dist/cjs/src/poloniex.js +19 -13
  78. package/dist/cjs/src/pro/alpaca.js +1 -1
  79. package/dist/cjs/src/pro/apex.js +11 -2
  80. package/dist/cjs/src/pro/arkham.js +1 -1
  81. package/dist/cjs/src/pro/aster.js +10 -9
  82. package/dist/cjs/src/pro/backpack.js +1 -1
  83. package/dist/cjs/src/pro/binance.js +6 -6
  84. package/dist/cjs/src/pro/bingx.js +7 -2
  85. package/dist/cjs/src/pro/bitget.js +1 -1
  86. package/dist/cjs/src/pro/bithumb.js +1 -1
  87. package/dist/cjs/src/pro/bitmart.js +10 -0
  88. package/dist/cjs/src/pro/bitmex.js +1 -1
  89. package/dist/cjs/src/pro/bitstamp.js +1 -1
  90. package/dist/cjs/src/pro/blockchaincom.js +1 -1
  91. package/dist/cjs/src/pro/bybit.js +1 -1
  92. package/dist/cjs/src/pro/cex.js +1 -1
  93. package/dist/cjs/src/pro/coinex.js +1 -1
  94. package/dist/cjs/src/pro/coinone.js +1 -1
  95. package/dist/cjs/src/pro/cryptocom.js +3 -1
  96. package/dist/cjs/src/pro/dydx.js +1 -1
  97. package/dist/cjs/src/pro/exmo.js +1 -1
  98. package/dist/cjs/src/pro/extended.js +865 -0
  99. package/dist/cjs/src/pro/gate.js +1 -1
  100. package/dist/cjs/src/pro/grvt.js +8 -0
  101. package/dist/cjs/src/pro/htx.js +4 -4
  102. package/dist/cjs/src/pro/independentreserve.js +1 -1
  103. package/dist/cjs/src/pro/krakenfutures.js +16 -4
  104. package/dist/cjs/src/pro/kucoin.js +1 -1
  105. package/dist/cjs/src/pro/luno.js +3 -3
  106. package/dist/cjs/src/pro/modetrade.js +3 -3
  107. package/dist/cjs/src/pro/okx.js +4 -4
  108. package/dist/cjs/src/pro/onetrading.js +1 -1
  109. package/dist/cjs/src/pro/toobit.js +1 -1
  110. package/dist/cjs/src/pro/weex.js +1 -1
  111. package/dist/cjs/src/pro/woo.js +4 -4
  112. package/dist/cjs/src/pro/woofipro.js +3 -3
  113. package/dist/cjs/src/pro/xt.js +1 -1
  114. package/dist/cjs/src/static_dependencies/starknet/utils/hash/classHash.js +7 -7
  115. package/dist/cjs/src/tokocrypto.js +1 -1
  116. package/dist/cjs/src/toobit.js +3 -3
  117. package/dist/cjs/src/upbit.js +3 -3
  118. package/dist/cjs/src/weex.js +57 -62
  119. package/dist/cjs/src/whitebit.js +61 -63
  120. package/dist/cjs/src/woo.js +66 -55
  121. package/dist/cjs/src/woofipro.js +54 -48
  122. package/dist/cjs/src/xt.js +3 -2
  123. package/dist/cjs/src/yobit.js +4 -2
  124. package/dist/cjs/src/zebpay.js +73 -75
  125. package/js/ccxt.d.ts +8 -14
  126. package/js/ccxt.js +6 -10
  127. package/js/src/abstract/bitvavo.d.ts +15 -7
  128. package/js/src/abstract/extended.d.ts +58 -0
  129. package/js/src/abstract/mexc.d.ts +1 -0
  130. package/js/src/aftermath.js +10 -5
  131. package/js/src/alpaca.js +2 -2
  132. package/js/src/apex.d.ts +1 -1
  133. package/js/src/apex.js +26 -17
  134. package/js/src/arkham.js +10 -7
  135. package/js/src/ascendex.js +8 -5
  136. package/js/src/aster.js +7 -4
  137. package/js/src/backpack.js +4 -4
  138. package/js/src/base/Exchange.d.ts +10 -6
  139. package/js/src/base/Exchange.js +72 -35
  140. package/js/src/base/functions/io.d.ts +7 -0
  141. package/js/src/base/functions/io.js +24 -0
  142. package/js/src/bigone.js +10 -7
  143. package/js/src/binance.d.ts +2 -0
  144. package/js/src/binance.js +200 -202
  145. package/js/src/bingx.js +7 -7
  146. package/js/src/bitfinex.d.ts +2 -0
  147. package/js/src/bitfinex.js +71 -58
  148. package/js/src/bitflyer.js +2 -1
  149. package/js/src/bitget.js +16 -5
  150. package/js/src/bitmart.js +18 -10
  151. package/js/src/bitmex.js +8 -5
  152. package/js/src/bitopro.js +2 -2
  153. package/js/src/bitrue.js +4 -3
  154. package/js/src/bitso.js +7 -4
  155. package/js/src/bitstamp.js +7 -4
  156. package/js/src/bitteam.js +1 -1
  157. package/js/src/bittrade.js +2 -2
  158. package/js/src/bitvavo.d.ts +114 -21
  159. package/js/src/bitvavo.js +457 -34
  160. package/js/src/blofin.d.ts +1 -0
  161. package/js/src/blofin.js +28 -4
  162. package/js/src/bullish.js +6 -5
  163. package/js/src/bybit.d.ts +1 -1
  164. package/js/src/bybit.js +19 -17
  165. package/js/src/bybiteu.js +1 -0
  166. package/js/src/bydfi.js +1 -1
  167. package/js/src/cex.js +3 -3
  168. package/js/src/coinbase.d.ts +63 -56
  169. package/js/src/coinbase.js +75 -65
  170. package/js/src/coinbaseexchange.js +4 -3
  171. package/js/src/coinbaseinternational.d.ts +1 -1
  172. package/js/src/coinbaseinternational.js +17 -10
  173. package/js/src/coinex.d.ts +2 -1
  174. package/js/src/coinex.js +79 -77
  175. package/js/src/coinmetro.d.ts +1 -1
  176. package/js/src/coinmetro.js +1 -1
  177. package/js/src/coinsph.js +5 -5
  178. package/js/src/cryptocom.d.ts +1 -0
  179. package/js/src/cryptocom.js +52 -54
  180. package/js/src/cryptomus.d.ts +2 -1
  181. package/js/src/cryptomus.js +43 -39
  182. package/js/src/deepcoin.js +9 -5
  183. package/js/src/delta.d.ts +1 -0
  184. package/js/src/delta.js +53 -53
  185. package/js/src/deribit.d.ts +1 -0
  186. package/js/src/deribit.js +35 -35
  187. package/js/src/derive.d.ts +1 -0
  188. package/js/src/derive.js +31 -31
  189. package/js/src/digifinex.d.ts +1 -0
  190. package/js/src/digifinex.js +45 -45
  191. package/js/src/exmo.d.ts +1 -0
  192. package/js/src/exmo.js +104 -122
  193. package/js/src/extended.d.ts +554 -0
  194. package/js/src/extended.js +3490 -0
  195. package/js/src/foxbit.d.ts +1 -0
  196. package/js/src/foxbit.js +72 -76
  197. package/js/src/gate.d.ts +1 -0
  198. package/js/src/gate.js +53 -53
  199. package/js/src/gemini.d.ts +2 -1
  200. package/js/src/gemini.js +45 -45
  201. package/js/src/grvt.d.ts +1 -1
  202. package/js/src/grvt.js +17 -11
  203. package/js/src/hashkey.d.ts +1 -0
  204. package/js/src/hashkey.js +56 -58
  205. package/js/src/hibachi.d.ts +1 -1
  206. package/js/src/hibachi.js +1 -1
  207. package/js/src/hitbtc.d.ts +0 -1
  208. package/js/src/hitbtc.js +5 -14
  209. package/js/src/hollaex.d.ts +1 -0
  210. package/js/src/hollaex.js +51 -54
  211. package/js/src/htx.d.ts +1 -0
  212. package/js/src/htx.js +84 -72
  213. package/js/src/hyperliquid.d.ts +5 -4
  214. package/js/src/hyperliquid.js +60 -55
  215. package/js/src/indodax.js +4 -3
  216. package/js/src/kraken.d.ts +2 -1
  217. package/js/src/kraken.js +71 -71
  218. package/js/src/krakenfutures.js +2 -1
  219. package/js/src/kucoin.js +3 -2
  220. package/js/src/latoken.d.ts +1 -0
  221. package/js/src/latoken.js +30 -32
  222. package/js/src/lbank.d.ts +1 -0
  223. package/js/src/lbank.js +64 -60
  224. package/js/src/lighter.d.ts +2 -1
  225. package/js/src/lighter.js +36 -38
  226. package/js/src/luno.d.ts +1 -0
  227. package/js/src/luno.js +36 -44
  228. package/js/src/mercado.js +2 -1
  229. package/js/src/mexc.d.ts +4 -3
  230. package/js/src/mexc.js +72 -63
  231. package/js/src/modetrade.d.ts +1 -0
  232. package/js/src/modetrade.js +51 -53
  233. package/js/src/ndax.d.ts +1 -0
  234. package/js/src/ndax.js +35 -37
  235. package/js/src/okx.js +23 -5
  236. package/js/src/onetrading.d.ts +2 -1
  237. package/js/src/onetrading.js +21 -23
  238. package/js/src/p2b.js +8 -4
  239. package/js/src/paradex.js +3 -2
  240. package/js/src/phemex.d.ts +1 -0
  241. package/js/src/phemex.js +47 -47
  242. package/js/src/poloniex.js +19 -13
  243. package/js/src/pro/alpaca.js +1 -1
  244. package/js/src/pro/apex.js +11 -2
  245. package/js/src/pro/arkham.js +1 -1
  246. package/js/src/pro/aster.js +10 -9
  247. package/js/src/pro/backpack.js +1 -1
  248. package/js/src/pro/binance.d.ts +1 -1
  249. package/js/src/pro/binance.js +6 -6
  250. package/js/src/pro/bingx.js +7 -2
  251. package/js/src/pro/bitget.js +1 -1
  252. package/js/src/pro/bithumb.js +1 -1
  253. package/js/src/pro/bitmart.js +10 -0
  254. package/js/src/pro/bitmex.js +1 -1
  255. package/js/src/pro/bitstamp.js +1 -1
  256. package/js/src/pro/blockchaincom.js +1 -1
  257. package/js/src/pro/bybit.js +1 -1
  258. package/js/src/pro/cex.js +1 -1
  259. package/js/src/pro/coinex.js +1 -1
  260. package/js/src/pro/coinone.js +1 -1
  261. package/js/src/pro/cryptocom.js +3 -1
  262. package/js/src/pro/dydx.js +1 -1
  263. package/js/src/pro/exmo.js +1 -1
  264. package/js/src/pro/extended.d.ts +126 -0
  265. package/js/src/pro/extended.js +858 -0
  266. package/js/src/pro/gate.js +1 -1
  267. package/js/src/pro/grvt.js +8 -0
  268. package/js/src/pro/htx.d.ts +4 -4
  269. package/js/src/pro/htx.js +4 -4
  270. package/js/src/pro/independentreserve.js +1 -1
  271. package/js/src/pro/krakenfutures.d.ts +4 -4
  272. package/js/src/pro/krakenfutures.js +16 -4
  273. package/js/src/pro/kucoin.js +1 -1
  274. package/js/src/pro/luno.d.ts +1 -1
  275. package/js/src/pro/luno.js +3 -3
  276. package/js/src/pro/modetrade.d.ts +3 -3
  277. package/js/src/pro/modetrade.js +3 -3
  278. package/js/src/pro/okx.d.ts +4 -4
  279. package/js/src/pro/okx.js +4 -4
  280. package/js/src/pro/onetrading.js +1 -1
  281. package/js/src/pro/toobit.js +1 -1
  282. package/js/src/pro/weex.js +1 -1
  283. package/js/src/pro/woo.d.ts +4 -4
  284. package/js/src/pro/woo.js +4 -4
  285. package/js/src/pro/woofipro.d.ts +3 -3
  286. package/js/src/pro/woofipro.js +3 -3
  287. package/js/src/pro/xt.js +1 -1
  288. package/js/src/tokocrypto.js +1 -1
  289. package/js/src/toobit.d.ts +1 -1
  290. package/js/src/toobit.js +3 -3
  291. package/js/src/upbit.js +3 -3
  292. package/js/src/weex.d.ts +1 -0
  293. package/js/src/weex.js +57 -62
  294. package/js/src/whitebit.d.ts +1 -0
  295. package/js/src/whitebit.js +61 -63
  296. package/js/src/woo.d.ts +1 -0
  297. package/js/src/woo.js +66 -55
  298. package/js/src/woofipro.d.ts +1 -0
  299. package/js/src/woofipro.js +54 -48
  300. package/js/src/xt.js +3 -2
  301. package/js/src/yobit.js +4 -2
  302. package/js/src/zebpay.d.ts +2 -1
  303. package/js/src/zebpay.js +73 -75
  304. package/package.json +25 -11
  305. package/dist/cjs/src/gateio.js +0 -18
  306. package/dist/cjs/src/oxfun.js +0 -2931
  307. package/dist/cjs/src/pro/gateio.js +0 -18
  308. package/dist/cjs/src/pro/oxfun.js +0 -1113
  309. package/js/src/abstract/gateio.d.ts +0 -346
  310. package/js/src/abstract/gateio.js +0 -5
  311. package/js/src/abstract/oxfun.d.ts +0 -37
  312. package/js/src/gateio.d.ts +0 -4
  313. package/js/src/gateio.js +0 -11
  314. package/js/src/oxfun.d.ts +0 -442
  315. package/js/src/oxfun.js +0 -2924
  316. package/js/src/pro/gateio.d.ts +0 -4
  317. package/js/src/pro/gateio.js +0 -11
  318. package/js/src/pro/oxfun.d.ts +0 -234
  319. package/js/src/pro/oxfun.js +0 -1106
  320. /package/dist/cjs/src/abstract/{oxfun.js → extended.js} +0 -0
  321. /package/js/src/abstract/{oxfun.js → extended.js} +0 -0
package/js/src/mexc.js CHANGED
@@ -317,6 +317,7 @@ export default class mexc extends Exchange {
317
317
  'position/funding_records': 2,
318
318
  'position/position_mode': 2,
319
319
  'order/list/open_orders/{symbol}': 2,
320
+ 'order/list/open_orders': 2,
320
321
  'order/list/history_orders': 2,
321
322
  'order/list/order_deals/v3': 2,
322
323
  'order/external/{symbol}/{external_oid}': 2,
@@ -1145,56 +1146,54 @@ export default class mexc extends Exchange {
1145
1146
  // ]
1146
1147
  // }
1147
1148
  //
1148
- const result = {};
1149
- for (let i = 0; i < response.length; i++) {
1150
- const currency = response[i];
1151
- const id = this.safeString(currency, 'coin');
1152
- const code = this.safeCurrencyCode(id);
1153
- const networks = {};
1154
- const chains = this.safeValue(currency, 'networkList', []);
1155
- for (let j = 0; j < chains.length; j++) {
1156
- const chain = chains[j];
1157
- const networkId = this.safeString2(chain, 'netWork', 'network');
1158
- const network = this.networkIdToCode(networkId);
1159
- networks[network] = {
1160
- 'info': chain,
1161
- 'id': networkId,
1162
- 'network': network,
1163
- 'active': undefined,
1164
- 'deposit': this.safeBool(chain, 'depositEnable', false),
1165
- 'withdraw': this.safeBool(chain, 'withdrawEnable', false),
1166
- 'fee': this.safeNumber(chain, 'withdrawFee'),
1167
- 'precision': undefined,
1168
- 'limits': {
1169
- 'withdraw': {
1170
- 'min': this.safeString(chain, 'withdrawMin'),
1171
- 'max': this.safeString(chain, 'withdrawMax'),
1172
- },
1173
- },
1174
- 'contract': this.safeString(chain, 'contract'),
1175
- };
1176
- }
1177
- result[code] = this.safeCurrencyStructure({
1178
- 'info': currency,
1179
- 'id': id,
1180
- 'code': code,
1181
- 'name': this.safeString(currency, 'name'),
1149
+ return this.parseCurrencies(response);
1150
+ }
1151
+ parseCurrency(rawCurrency) {
1152
+ const id = this.safeString(rawCurrency, 'coin');
1153
+ const code = this.safeCurrencyCode(id);
1154
+ const networks = {};
1155
+ const chains = this.safeValue(rawCurrency, 'networkList', []);
1156
+ for (let j = 0; j < chains.length; j++) {
1157
+ const chain = chains[j];
1158
+ const networkId = this.safeString2(chain, 'netWork', 'network');
1159
+ const network = this.networkIdToCode(networkId, code);
1160
+ networks[network] = {
1161
+ 'info': chain,
1162
+ 'id': networkId,
1163
+ 'network': network,
1182
1164
  'active': undefined,
1183
- 'deposit': undefined,
1184
- 'withdraw': undefined,
1185
- 'fee': undefined,
1165
+ 'deposit': this.safeBool(chain, 'depositEnable', false),
1166
+ 'withdraw': this.safeBool(chain, 'withdrawEnable', false),
1167
+ 'fee': this.safeNumber(chain, 'withdrawFee'),
1186
1168
  'precision': undefined,
1187
1169
  'limits': {
1188
- 'amount': {
1189
- 'min': undefined,
1190
- 'max': undefined,
1170
+ 'withdraw': {
1171
+ 'min': this.safeString(chain, 'withdrawMin'),
1172
+ 'max': this.safeString(chain, 'withdrawMax'),
1191
1173
  },
1192
1174
  },
1193
- 'type': 'crypto',
1194
- 'networks': networks,
1195
- });
1175
+ 'contract': this.safeString(chain, 'contract'),
1176
+ };
1196
1177
  }
1197
- return result;
1178
+ return this.safeCurrencyStructure({
1179
+ 'info': rawCurrency,
1180
+ 'id': id,
1181
+ 'code': code,
1182
+ 'name': this.safeString(rawCurrency, 'name'),
1183
+ 'active': undefined,
1184
+ 'deposit': undefined,
1185
+ 'withdraw': undefined,
1186
+ 'fee': undefined,
1187
+ 'precision': undefined,
1188
+ 'limits': {
1189
+ 'amount': {
1190
+ 'min': undefined,
1191
+ 'max': undefined,
1192
+ },
1193
+ },
1194
+ 'type': 'crypto',
1195
+ 'networks': networks,
1196
+ });
1198
1197
  }
1199
1198
  /**
1200
1199
  * @method
@@ -1532,7 +1531,7 @@ export default class mexc extends Exchange {
1532
1531
  }
1533
1532
  return orderbook;
1534
1533
  }
1535
- parseBidAsk(bidask, priceKey = 0, amountKey = 1, countOrIdKey = 2) {
1534
+ parseOrderBookBidAsk(bidask, priceKey = 0, amountKey = 1, countOrIdKey = 2) {
1536
1535
  const countKey = 2;
1537
1536
  const price = this.safeNumber(bidask, priceKey);
1538
1537
  const amount = this.safeNumber(bidask, amountKey);
@@ -2591,8 +2590,10 @@ export default class mexc extends Exchange {
2591
2590
  // Trigger
2592
2591
  // {"success":true,"code":0,"data":259208506303929856}
2593
2592
  //
2594
- const data = this.safeString(response, 'data');
2595
- return this.safeOrder({ 'id': data }, market);
2593
+ // {"success":true,"code":0,"data":{"orderId":"814218083416790528","ts":1779795118533}}
2594
+ //
2595
+ const data = this.safeDict(response, 'data');
2596
+ return this.safeOrder({ 'id': this.safeString(data, 'orderId'), 'timestamp': this.safeInteger(data, 'ts') }, market);
2596
2597
  }
2597
2598
  /**
2598
2599
  * @method
@@ -3125,8 +3126,12 @@ export default class mexc extends Exchange {
3125
3126
  return this.parseOrders(response, market, since, limit);
3126
3127
  }
3127
3128
  else {
3128
- // TO_DO: another possible way is through: open_orders/{symbol}, but as they have same ratelimits, and less granularity, i think historical orders are more convenient, as it supports more params (however, theoretically, open-orders endpoint might be sligthly fast)
3129
- return await this.fetchOrdersByState(2, symbol, since, limit, params);
3129
+ if (limit === undefined) {
3130
+ request['page_size'] = 100; // max
3131
+ }
3132
+ const swapResponse = await this.contractPrivateGetOrderListOpenOrders(this.extend(request, params));
3133
+ const data = this.safeList(swapResponse, 'data', []);
3134
+ return this.parseOrders(data, market, since, limit, params);
3130
3135
  }
3131
3136
  }
3132
3137
  /**
@@ -3916,7 +3921,7 @@ export default class mexc extends Exchange {
3916
3921
  for (let i = 0; i < wallet.length; i++) {
3917
3922
  const entry = wallet[i];
3918
3923
  const marketId = this.safeString(entry, 'symbol');
3919
- const symbol = this.safeSymbol(marketId, undefined);
3924
+ const symbol = this.safeSymbol(marketId);
3920
3925
  const base = this.safeValue(entry, 'baseAsset', {});
3921
3926
  const quote = this.safeValue(entry, 'quoteAsset', {});
3922
3927
  const baseCode = this.safeCurrencyCode(this.safeString(base, 'asset'));
@@ -4726,14 +4731,17 @@ export default class mexc extends Exchange {
4726
4731
  }
4727
4732
  while (Precise.stringLt(floor, maxVol)) {
4728
4733
  const cap = Precise.stringAdd(floor, riskIncrVol);
4734
+ const minNotional = this.parseNumber(floor);
4735
+ const mainMarginRate = this.parseNumber(maintenanceMarginRate);
4736
+ const maxLev = this.parseNumber(Precise.stringDiv('1', initialMarginRate));
4729
4737
  tiers.push({
4730
4738
  'tier': this.parseNumber(Precise.stringDiv(cap, riskIncrVol)),
4731
4739
  'symbol': this.safeSymbol(marketId, market, undefined, 'contract'),
4732
4740
  'currency': this.safeCurrencyCode(quoteId),
4733
- 'minNotional': this.parseNumber(floor),
4741
+ 'minNotional': minNotional,
4734
4742
  'maxNotional': this.parseNumber(cap),
4735
- 'maintenanceMarginRate': this.parseNumber(maintenanceMarginRate),
4736
- 'maxLeverage': this.parseNumber(Precise.stringDiv('1', initialMarginRate)),
4743
+ 'maintenanceMarginRate': mainMarginRate,
4744
+ 'maxLeverage': maxLev,
4737
4745
  'info': info,
4738
4746
  });
4739
4747
  initialMarginRate = Precise.stringAdd(initialMarginRate, riskIncrImr);
@@ -4753,11 +4761,12 @@ export default class mexc extends Exchange {
4753
4761
  //
4754
4762
  const address = this.safeString(depositAddress, 'address');
4755
4763
  const currencyId = this.safeString(depositAddress, 'coin');
4764
+ const code = this.safeCurrencyCode(currencyId, currency);
4756
4765
  const networkId = this.safeString(depositAddress, 'netWork');
4757
4766
  return {
4758
4767
  'info': depositAddress,
4759
- 'currency': this.safeCurrencyCode(currencyId, currency),
4760
- 'network': this.networkIdToCode(networkId, currencyId),
4768
+ 'currency': code,
4769
+ 'network': this.networkIdToCode(networkId, code),
4761
4770
  'address': address,
4762
4771
  'tag': this.safeString(depositAddress, 'memo'),
4763
4772
  };
@@ -5076,12 +5085,12 @@ export default class mexc extends Exchange {
5076
5085
  if (currencyWithNetwork !== undefined) {
5077
5086
  currencyId = currencyWithNetwork.split('-')[0];
5078
5087
  }
5088
+ const code = this.safeCurrencyCode(currencyId, currency);
5079
5089
  let network = undefined;
5080
5090
  const rawNetwork = this.safeString(transaction, 'network');
5081
5091
  if (rawNetwork !== undefined) {
5082
- network = this.networkIdToCode(rawNetwork);
5092
+ network = this.networkIdToCode(rawNetwork, code);
5083
5093
  }
5084
- const code = this.safeCurrencyCode(currencyId, currency);
5085
5094
  const status = this.parseTransactionStatusByType(this.safeString(transaction, 'status'), type);
5086
5095
  let amountString = this.safeString(transaction, 'amount');
5087
5096
  const address = this.safeString(transaction, 'address');
@@ -5359,8 +5368,8 @@ export default class mexc extends Exchange {
5359
5368
  * @description fetch a history of internal transfers made on an account
5360
5369
  * @see https://mexcdevelop.github.io/apidocs/spot_v2_en/#get-internal-assets-transfer-records
5361
5370
  * @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-the-user-39-s-asset-transfer-records
5362
- * @see https://www.mexc.com/api-docs/spot-v3/wallet-endpoints#query-user-universal-transfer-history * @param {string} code unified currency code of the currency transferred
5363
- * @param code
5371
+ * @see https://www.mexc.com/api-docs/spot-v3/wallet-endpoints#query-user-universal-transfer-history
5372
+ * @param {string} [code] unified currency code of the currency transferred
5364
5373
  * @param {int} [since] the earliest time in ms to fetch transfers for
5365
5374
  * @param {int} [limit] the maximum number of transfers structures to retrieve
5366
5375
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -6098,8 +6107,8 @@ export default class mexc extends Exchange {
6098
6107
  if (market['spot']) {
6099
6108
  throw new BadSymbol(this.id + ' setMarginMode() supports contract markets only');
6100
6109
  }
6101
- marginMode = marginMode.toLowerCase();
6102
- if (marginMode !== 'isolated' && marginMode !== 'cross') {
6110
+ const marginModeLower = marginMode.toLowerCase();
6111
+ if (marginModeLower !== 'isolated' && marginModeLower !== 'cross') {
6103
6112
  throw new BadRequest(this.id + ' setMarginMode() marginMode argument should be isolated or cross');
6104
6113
  }
6105
6114
  const leverage = this.safeInteger(params, 'leverage');
@@ -6109,7 +6118,7 @@ export default class mexc extends Exchange {
6109
6118
  const direction = this.safeStringLower2(params, 'direction', 'positionId');
6110
6119
  const request = {
6111
6120
  'leverage': leverage,
6112
- 'openType': (marginMode === 'isolated') ? 1 : 2,
6121
+ 'openType': (marginModeLower === 'isolated') ? 1 : 2,
6113
6122
  };
6114
6123
  if (symbol !== undefined) {
6115
6124
  request['symbol'] = market['id'];
@@ -6225,7 +6234,7 @@ export default class mexc extends Exchange {
6225
6234
  if (success === true) {
6226
6235
  return undefined;
6227
6236
  }
6228
- const responseCode = this.safeString(response, 'code', undefined);
6237
+ const responseCode = this.safeString(response, 'code');
6229
6238
  if ((responseCode !== undefined) && (responseCode !== '200') && (responseCode !== '0')) {
6230
6239
  const feedback = this.id + ' ' + body;
6231
6240
  this.throwBroadlyMatchedException(this.exceptions['broad'], body, feedback);
@@ -50,6 +50,7 @@ export default class modetrade extends Exchange {
50
50
  * @returns {object} an associative dictionary of currencies
51
51
  */
52
52
  fetchCurrencies(params?: {}): Promise<Currencies>;
53
+ parseCurrency(rawCurrency: Dict): Currency;
53
54
  parseTokenAndFeeTemp(item: any, feeTokenKey: any, feeAmountKey: any): any;
54
55
  parseTrade(trade: Dict, market?: Market): Trade;
55
56
  /**
@@ -625,7 +625,6 @@ export default class modetrade extends Exchange {
625
625
  * @returns {object} an associative dictionary of currencies
626
626
  */
627
627
  async fetchCurrencies(params = {}) {
628
- const result = {};
629
628
  const response = await this.v1PublicGetPublicToken(params);
630
629
  //
631
630
  // {
@@ -651,66 +650,65 @@ export default class modetrade extends Exchange {
651
650
  //
652
651
  const data = this.safeDict(response, 'data', {});
653
652
  const tokenRows = this.safeList(data, 'rows', []);
654
- for (let i = 0; i < tokenRows.length; i++) {
655
- const token = tokenRows[i];
656
- const currencyId = this.safeString(token, 'token');
657
- const networks = this.safeList(token, 'chain_details');
658
- const code = this.safeCurrencyCode(currencyId);
659
- let minPrecision = undefined;
660
- const resultingNetworks = {};
661
- for (let j = 0; j < networks.length; j++) {
662
- const network = networks[j];
663
- // TODO: transform chain id to human readable name
664
- const networkId = this.safeString(network, 'chain_id');
665
- const precision = this.parsePrecision(this.safeString(network, 'decimals'));
666
- if (precision !== undefined) {
667
- minPrecision = (minPrecision === undefined) ? precision : Precise.stringMin(precision, minPrecision);
668
- }
669
- resultingNetworks[networkId] = {
670
- 'id': networkId,
671
- 'network': networkId,
672
- 'limits': {
673
- 'withdraw': {
674
- 'min': undefined,
675
- 'max': undefined,
676
- },
677
- 'deposit': {
678
- 'min': undefined,
679
- 'max': undefined,
680
- },
681
- },
682
- 'active': undefined,
683
- 'deposit': undefined,
684
- 'withdraw': undefined,
685
- 'fee': this.safeNumber(network, 'withdrawal_fee'),
686
- 'precision': this.parseNumber(precision),
687
- 'info': network,
688
- };
653
+ return this.parseCurrencies(tokenRows);
654
+ }
655
+ parseCurrency(rawCurrency) {
656
+ const currencyId = this.safeString(rawCurrency, 'token');
657
+ const networks = this.safeList(rawCurrency, 'chain_details');
658
+ const code = this.safeCurrencyCode(currencyId);
659
+ let minPrecision = undefined;
660
+ const resultingNetworks = {};
661
+ for (let j = 0; j < networks.length; j++) {
662
+ const network = networks[j];
663
+ // TODO: transform chain id to human readable name
664
+ const networkId = this.safeString(network, 'chain_id');
665
+ const precision = this.parsePrecision(this.safeString(network, 'decimals'));
666
+ if (precision !== undefined) {
667
+ minPrecision = (minPrecision === undefined) ? precision : Precise.stringMin(precision, minPrecision);
689
668
  }
690
- result[code] = this.safeCurrencyStructure({
691
- 'id': currencyId,
692
- 'name': currencyId,
693
- 'code': code,
694
- 'precision': this.parseNumber(minPrecision),
695
- 'active': undefined,
696
- 'fee': undefined,
697
- 'networks': resultingNetworks,
698
- 'deposit': undefined,
699
- 'withdraw': undefined,
669
+ resultingNetworks[networkId] = {
670
+ 'id': networkId,
671
+ 'network': networkId,
700
672
  'limits': {
701
- 'deposit': {
673
+ 'withdraw': {
702
674
  'min': undefined,
703
675
  'max': undefined,
704
676
  },
705
- 'withdraw': {
706
- 'min': this.safeNumber(token, 'minimum_withdraw_amount'),
677
+ 'deposit': {
678
+ 'min': undefined,
707
679
  'max': undefined,
708
680
  },
709
681
  },
710
- 'info': token,
711
- });
682
+ 'active': undefined,
683
+ 'deposit': undefined,
684
+ 'withdraw': undefined,
685
+ 'fee': this.safeNumber(network, 'withdrawal_fee'),
686
+ 'precision': this.parseNumber(precision),
687
+ 'info': network,
688
+ };
712
689
  }
713
- return result;
690
+ return this.safeCurrencyStructure({
691
+ 'id': currencyId,
692
+ 'name': currencyId,
693
+ 'code': code,
694
+ 'precision': this.parseNumber(minPrecision),
695
+ 'active': undefined,
696
+ 'fee': undefined,
697
+ 'networks': resultingNetworks,
698
+ 'deposit': undefined,
699
+ 'withdraw': undefined,
700
+ 'limits': {
701
+ 'deposit': {
702
+ 'min': undefined,
703
+ 'max': undefined,
704
+ },
705
+ 'withdraw': {
706
+ 'min': this.safeNumber(rawCurrency, 'minimum_withdraw_amount'),
707
+ 'max': undefined,
708
+ },
709
+ },
710
+ 'info': rawCurrency,
711
+ });
714
712
  }
715
713
  parseTokenAndFeeTemp(item, feeTokenKey, feeAmountKey) {
716
714
  const feeCost = this.safeString(item, feeAmountKey);
@@ -1400,7 +1398,7 @@ export default class modetrade extends Exchange {
1400
1398
  'fok': 'FOK',
1401
1399
  'post_only': 'PO',
1402
1400
  };
1403
- return this.safeString(timeInForces, timeInForce, undefined);
1401
+ return this.safeString(timeInForces, timeInForce);
1404
1402
  }
1405
1403
  parseOrderStatus(status) {
1406
1404
  if (status !== undefined) {
package/js/src/ndax.d.ts CHANGED
@@ -24,6 +24,7 @@ export default class ndax extends Exchange {
24
24
  * @returns {object} an associative dictionary of currencies
25
25
  */
26
26
  fetchCurrencies(params?: {}): Promise<Currencies>;
27
+ parseCurrency(rawCurrency: Dict): Currency;
27
28
  /**
28
29
  * @method
29
30
  * @name ndax#fetchMarkets
package/js/src/ndax.js CHANGED
@@ -475,43 +475,41 @@ export default class ndax extends Exchange {
475
475
  // },
476
476
  // ...
477
477
  //
478
- const result = {};
479
- for (let i = 0; i < response.length; i++) {
480
- const currency = response[i];
481
- const id = this.safeString(currency, 'ProductId');
482
- const code = this.safeCurrencyCode(this.safeString(currency, 'Product'));
483
- const ProductType = this.safeString(currency, 'ProductType');
484
- let type = (ProductType === 'NationalCurrency') ? 'fiat' : 'crypto';
485
- if (ProductType === 'Unknown') {
486
- // such currency is just a blanket entry
487
- type = 'other';
488
- }
489
- result[code] = this.safeCurrencyStructure({
490
- 'id': id,
491
- 'name': this.safeString(currency, 'ProductFullName'),
492
- 'code': code,
493
- 'type': type,
494
- 'precision': this.safeNumber(currency, 'TickSize'),
495
- 'info': currency,
496
- 'active': !this.safeBool(currency, 'IsDisabled'),
497
- 'deposit': this.safeBool(currency, 'DepositEnabled'),
498
- 'withdraw': this.safeBool(currency, 'WithdrawEnabled'),
499
- 'fee': undefined,
500
- 'limits': {
501
- 'amount': {
502
- 'min': undefined,
503
- 'max': undefined,
504
- },
505
- 'withdraw': {
506
- 'min': undefined,
507
- 'max': undefined,
508
- },
509
- },
510
- 'networks': {},
511
- 'margin': this.safeBool(currency, 'MarginEnabled'),
512
- });
478
+ return this.parseCurrencies(response);
479
+ }
480
+ parseCurrency(rawCurrency) {
481
+ const id = this.safeString(rawCurrency, 'ProductId');
482
+ const code = this.safeCurrencyCode(this.safeString(rawCurrency, 'Product'));
483
+ const ProductType = this.safeString(rawCurrency, 'ProductType');
484
+ let type = (ProductType === 'NationalCurrency') ? 'fiat' : 'crypto';
485
+ if (ProductType === 'Unknown') {
486
+ // such currency is just a blanket entry
487
+ type = 'other';
513
488
  }
514
- return result;
489
+ return this.safeCurrencyStructure({
490
+ 'id': id,
491
+ 'name': this.safeString(rawCurrency, 'ProductFullName'),
492
+ 'code': code,
493
+ 'type': type,
494
+ 'precision': this.safeNumber(rawCurrency, 'TickSize'),
495
+ 'info': rawCurrency,
496
+ 'active': !this.safeBool(rawCurrency, 'IsDisabled'),
497
+ 'deposit': this.safeBool(rawCurrency, 'DepositEnabled'),
498
+ 'withdraw': this.safeBool(rawCurrency, 'WithdrawEnabled'),
499
+ 'fee': undefined,
500
+ 'limits': {
501
+ 'amount': {
502
+ 'min': undefined,
503
+ 'max': undefined,
504
+ },
505
+ 'withdraw': {
506
+ 'min': undefined,
507
+ 'max': undefined,
508
+ },
509
+ },
510
+ 'networks': {},
511
+ 'margin': this.safeBool(rawCurrency, 'MarginEnabled'),
512
+ });
515
513
  }
516
514
  /**
517
515
  * @method
@@ -661,7 +659,7 @@ export default class ndax extends Exchange {
661
659
  const newNonce = this.safeInteger(level, 0);
662
660
  nonce = Math.max(nonce, newNonce);
663
661
  }
664
- const bidask = this.parseBidAsk(level, priceKey, amountKey);
662
+ const bidask = this.parseOrderBookBidAsk(level, priceKey, amountKey);
665
663
  const levelSide = this.safeInteger(level, 9);
666
664
  const side = levelSide ? asksKey : bidsKey;
667
665
  const resultSide = result[side];
package/js/src/okx.js CHANGED
@@ -1512,7 +1512,18 @@ export default class okx extends Exchange {
1512
1512
  };
1513
1513
  }
1514
1514
  safeMarket(marketId = undefined, market = undefined, delimiter = undefined, marketType = undefined) {
1515
- const isOption = (marketId !== undefined) && ((marketId.indexOf('-C') > -1) || (marketId.indexOf('-P') > -1));
1515
+ let isOption = false;
1516
+ if (marketId !== undefined) {
1517
+ const parts = marketId.split('-');
1518
+ const partsLength = parts.length;
1519
+ // a valid OKX option ends with the call/put flag and carries expiry+strike segments,
1520
+ // e.g. the market id BTC-USD-220325-194000-P (5 parts) or the unified symbol
1521
+ // BTC/USD:USD-260611-54000-C (4 parts). Requiring more than 3 dash-separated parts avoids
1522
+ // misclassifying ordinary ids that merely contain "-C"/"-P" (such as a SPOT id like
1523
+ // "PERFTESTA-PERFTESTB") as expired options, which would crash createExpiredOptionMarket
1524
+ // on the missing expiry.
1525
+ isOption = (partsLength > 3) && (marketId.endsWith('-C') || marketId.endsWith('-P'));
1526
+ }
1516
1527
  if (isOption && !(marketId in this.markets_by_id)) {
1517
1528
  // handle expired option contracts
1518
1529
  return this.createExpiredOptionMarket(marketId);
@@ -1818,6 +1829,9 @@ export default class okx extends Exchange {
1818
1829
  let maxLeverage = this.safeString(market, 'lever', '1');
1819
1830
  maxLeverage = Precise.stringMax(maxLeverage, '1');
1820
1831
  const maxSpotCost = this.safeNumber(market, 'maxMktSz');
1832
+ const leverageAboveOne = Precise.stringGt(maxLeverage, '1');
1833
+ const quoteEqualSettle = (quoteId === settleId);
1834
+ const baseEqualSettle = (baseId === settleId);
1821
1835
  const status = this.safeString(market, 'state');
1822
1836
  const instIdCode = this.safeInteger(market, 'instIdCode');
1823
1837
  return this.extend(fees, {
@@ -1832,14 +1846,14 @@ export default class okx extends Exchange {
1832
1846
  'settleId': settleId,
1833
1847
  'type': type,
1834
1848
  'spot': spot,
1835
- 'margin': spot && (Precise.stringGt(maxLeverage, '1')),
1849
+ 'margin': spot && leverageAboveOne,
1836
1850
  'swap': swap,
1837
1851
  'future': future,
1838
1852
  'option': option,
1839
1853
  'active': status === 'live',
1840
1854
  'contract': contract,
1841
- 'linear': contract ? (quoteId === settleId) : undefined,
1842
- 'inverse': contract ? (baseId === settleId) : undefined,
1855
+ 'linear': contract ? quoteEqualSettle : undefined,
1856
+ 'inverse': contract ? baseEqualSettle : undefined,
1843
1857
  'contractSize': contract ? this.safeNumber(market, 'ctVal') : undefined,
1844
1858
  'expiry': expiry,
1845
1859
  'expiryDatetime': this.iso8601(expiry),
@@ -1930,6 +1944,10 @@ export default class okx extends Exchange {
1930
1944
  const marketsWithoutTest = [];
1931
1945
  for (let i = 0; i < dataResponse.length; i++) {
1932
1946
  const data = dataResponse[i];
1947
+ const instId = this.safeString(data, 'instId', '');
1948
+ if (instId === '') {
1949
+ continue; // skip broken "preopen" placeholder instruments that have no instId
1950
+ }
1933
1951
  if (this.isSandboxModeEnabled) {
1934
1952
  const instFamily = this.safeString(data, 'instFamily', '');
1935
1953
  if (instFamily.startsWith('TEST')) {
@@ -9200,7 +9218,7 @@ export default class okx extends Exchange {
9200
9218
  request['end'] = until;
9201
9219
  }
9202
9220
  if (timeframe !== undefined) {
9203
- request['period'] = timeframe;
9221
+ request['period'] = this.safeString(this.timeframes, timeframe, timeframe);
9204
9222
  }
9205
9223
  if (since !== undefined) {
9206
9224
  request['begin'] = since;
@@ -1,5 +1,5 @@
1
1
  import Exchange from './abstract/onetrading.js';
2
- import type { Balances, Currencies, Dict, Int, Market, Num, OHLCV, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFees, int } from './base/types.js';
2
+ import type { Balances, Currencies, Currency, Dict, Int, Market, Num, OHLCV, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFees, int } from './base/types.js';
3
3
  /**
4
4
  * @class onetrading
5
5
  * @augments Exchange
@@ -24,6 +24,7 @@ export default class onetrading extends Exchange {
24
24
  * @returns {object} an associative dictionary of currencies
25
25
  */
26
26
  fetchCurrencies(params?: {}): Promise<Currencies>;
27
+ parseCurrency(rawCurrency: Dict): Currency;
27
28
  /**
28
29
  * @method
29
30
  * @name onetrading#fetchMarkets
@@ -430,29 +430,27 @@ export default class onetrading extends Exchange {
430
430
  // },
431
431
  // ]
432
432
  //
433
- const result = {};
434
- for (let i = 0; i < response.length; i++) {
435
- const currency = response[i];
436
- const id = this.safeString(currency, 'code');
437
- const code = this.safeCurrencyCode(id);
438
- result[code] = this.safeCurrencyStructure({
439
- 'id': id,
440
- 'code': code,
441
- 'name': this.safeString(currency, 'name'),
442
- 'info': currency,
443
- 'active': undefined,
444
- 'fee': undefined,
445
- 'precision': this.parseNumber(this.parsePrecision(this.safeString(currency, 'precision'))),
446
- 'withdraw': undefined,
447
- 'deposit': undefined,
448
- 'limits': {
449
- 'amount': { 'min': undefined, 'max': undefined },
450
- 'withdraw': { 'min': undefined, 'max': undefined },
451
- },
452
- 'networks': {},
453
- });
454
- }
455
- return result;
433
+ return this.parseCurrencies(response);
434
+ }
435
+ parseCurrency(rawCurrency) {
436
+ const id = this.safeString(rawCurrency, 'code');
437
+ const code = this.safeCurrencyCode(id);
438
+ return this.safeCurrencyStructure({
439
+ 'id': id,
440
+ 'code': code,
441
+ 'name': this.safeString(rawCurrency, 'name'),
442
+ 'info': rawCurrency,
443
+ 'active': undefined,
444
+ 'fee': undefined,
445
+ 'precision': this.parseNumber(this.parsePrecision(this.safeString(rawCurrency, 'precision'))),
446
+ 'withdraw': undefined,
447
+ 'deposit': undefined,
448
+ 'limits': {
449
+ 'amount': { 'min': undefined, 'max': undefined },
450
+ 'withdraw': { 'min': undefined, 'max': undefined },
451
+ },
452
+ 'networks': {},
453
+ });
456
454
  }
457
455
  /**
458
456
  * @method
package/js/src/p2b.js CHANGED
@@ -1108,10 +1108,12 @@ export default class p2b extends Exchange {
1108
1108
  throw new BadRequest(this.id + ' fetchMyTrades () the time between since and params["until"] cannot be greater than 24 hours');
1109
1109
  }
1110
1110
  const market = this.market(symbol);
1111
+ const sinceSec = this.parseToInt(since / 1000);
1112
+ const untilSec = this.parseToInt(until / 1000);
1111
1113
  const request = {
1112
1114
  'market': market['id'],
1113
- 'startTime': this.parseToInt(since / 1000),
1114
- 'endTime': this.parseToInt(until / 1000),
1115
+ 'startTime': sinceSec,
1116
+ 'endTime': untilSec,
1115
1117
  };
1116
1118
  if (limit !== undefined) {
1117
1119
  request['limit'] = limit;
@@ -1184,9 +1186,11 @@ export default class p2b extends Exchange {
1184
1186
  if ((until - since) > 86400000) {
1185
1187
  throw new BadRequest(this.id + ' fetchClosedOrders () the time between since and params["until"] cannot be greater than 24 hours');
1186
1188
  }
1189
+ const sinceSec = this.parseToInt(since / 1000);
1190
+ const untilSec = this.parseToInt(until / 1000);
1187
1191
  const request = {
1188
- 'startTime': this.parseToInt(since / 1000),
1189
- 'endTime': this.parseToInt(until / 1000),
1192
+ 'startTime': sinceSec,
1193
+ 'endTime': untilSec,
1190
1194
  };
1191
1195
  if (market !== undefined) {
1192
1196
  request['market'] = market['id'];