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
@@ -322,6 +322,7 @@ class mexc extends mexc$1["default"] {
322
322
  'position/funding_records': 2,
323
323
  'position/position_mode': 2,
324
324
  'order/list/open_orders/{symbol}': 2,
325
+ 'order/list/open_orders': 2,
325
326
  'order/list/history_orders': 2,
326
327
  'order/list/order_deals/v3': 2,
327
328
  'order/external/{symbol}/{external_oid}': 2,
@@ -1150,56 +1151,54 @@ class mexc extends mexc$1["default"] {
1150
1151
  // ]
1151
1152
  // }
1152
1153
  //
1153
- const result = {};
1154
- for (let i = 0; i < response.length; i++) {
1155
- const currency = response[i];
1156
- const id = this.safeString(currency, 'coin');
1157
- const code = this.safeCurrencyCode(id);
1158
- const networks = {};
1159
- const chains = this.safeValue(currency, 'networkList', []);
1160
- for (let j = 0; j < chains.length; j++) {
1161
- const chain = chains[j];
1162
- const networkId = this.safeString2(chain, 'netWork', 'network');
1163
- const network = this.networkIdToCode(networkId);
1164
- networks[network] = {
1165
- 'info': chain,
1166
- 'id': networkId,
1167
- 'network': network,
1168
- 'active': undefined,
1169
- 'deposit': this.safeBool(chain, 'depositEnable', false),
1170
- 'withdraw': this.safeBool(chain, 'withdrawEnable', false),
1171
- 'fee': this.safeNumber(chain, 'withdrawFee'),
1172
- 'precision': undefined,
1173
- 'limits': {
1174
- 'withdraw': {
1175
- 'min': this.safeString(chain, 'withdrawMin'),
1176
- 'max': this.safeString(chain, 'withdrawMax'),
1177
- },
1178
- },
1179
- 'contract': this.safeString(chain, 'contract'),
1180
- };
1181
- }
1182
- result[code] = this.safeCurrencyStructure({
1183
- 'info': currency,
1184
- 'id': id,
1185
- 'code': code,
1186
- 'name': this.safeString(currency, 'name'),
1154
+ return this.parseCurrencies(response);
1155
+ }
1156
+ parseCurrency(rawCurrency) {
1157
+ const id = this.safeString(rawCurrency, 'coin');
1158
+ const code = this.safeCurrencyCode(id);
1159
+ const networks = {};
1160
+ const chains = this.safeValue(rawCurrency, 'networkList', []);
1161
+ for (let j = 0; j < chains.length; j++) {
1162
+ const chain = chains[j];
1163
+ const networkId = this.safeString2(chain, 'netWork', 'network');
1164
+ const network = this.networkIdToCode(networkId, code);
1165
+ networks[network] = {
1166
+ 'info': chain,
1167
+ 'id': networkId,
1168
+ 'network': network,
1187
1169
  'active': undefined,
1188
- 'deposit': undefined,
1189
- 'withdraw': undefined,
1190
- 'fee': undefined,
1170
+ 'deposit': this.safeBool(chain, 'depositEnable', false),
1171
+ 'withdraw': this.safeBool(chain, 'withdrawEnable', false),
1172
+ 'fee': this.safeNumber(chain, 'withdrawFee'),
1191
1173
  'precision': undefined,
1192
1174
  'limits': {
1193
- 'amount': {
1194
- 'min': undefined,
1195
- 'max': undefined,
1175
+ 'withdraw': {
1176
+ 'min': this.safeString(chain, 'withdrawMin'),
1177
+ 'max': this.safeString(chain, 'withdrawMax'),
1196
1178
  },
1197
1179
  },
1198
- 'type': 'crypto',
1199
- 'networks': networks,
1200
- });
1180
+ 'contract': this.safeString(chain, 'contract'),
1181
+ };
1201
1182
  }
1202
- return result;
1183
+ return this.safeCurrencyStructure({
1184
+ 'info': rawCurrency,
1185
+ 'id': id,
1186
+ 'code': code,
1187
+ 'name': this.safeString(rawCurrency, 'name'),
1188
+ 'active': undefined,
1189
+ 'deposit': undefined,
1190
+ 'withdraw': undefined,
1191
+ 'fee': undefined,
1192
+ 'precision': undefined,
1193
+ 'limits': {
1194
+ 'amount': {
1195
+ 'min': undefined,
1196
+ 'max': undefined,
1197
+ },
1198
+ },
1199
+ 'type': 'crypto',
1200
+ 'networks': networks,
1201
+ });
1203
1202
  }
1204
1203
  /**
1205
1204
  * @method
@@ -1537,7 +1536,7 @@ class mexc extends mexc$1["default"] {
1537
1536
  }
1538
1537
  return orderbook;
1539
1538
  }
1540
- parseBidAsk(bidask, priceKey = 0, amountKey = 1, countOrIdKey = 2) {
1539
+ parseOrderBookBidAsk(bidask, priceKey = 0, amountKey = 1, countOrIdKey = 2) {
1541
1540
  const countKey = 2;
1542
1541
  const price = this.safeNumber(bidask, priceKey);
1543
1542
  const amount = this.safeNumber(bidask, amountKey);
@@ -2596,8 +2595,10 @@ class mexc extends mexc$1["default"] {
2596
2595
  // Trigger
2597
2596
  // {"success":true,"code":0,"data":259208506303929856}
2598
2597
  //
2599
- const data = this.safeString(response, 'data');
2600
- return this.safeOrder({ 'id': data }, market);
2598
+ // {"success":true,"code":0,"data":{"orderId":"814218083416790528","ts":1779795118533}}
2599
+ //
2600
+ const data = this.safeDict(response, 'data');
2601
+ return this.safeOrder({ 'id': this.safeString(data, 'orderId'), 'timestamp': this.safeInteger(data, 'ts') }, market);
2601
2602
  }
2602
2603
  /**
2603
2604
  * @method
@@ -3130,8 +3131,12 @@ class mexc extends mexc$1["default"] {
3130
3131
  return this.parseOrders(response, market, since, limit);
3131
3132
  }
3132
3133
  else {
3133
- // 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)
3134
- return await this.fetchOrdersByState(2, symbol, since, limit, params);
3134
+ if (limit === undefined) {
3135
+ request['page_size'] = 100; // max
3136
+ }
3137
+ const swapResponse = await this.contractPrivateGetOrderListOpenOrders(this.extend(request, params));
3138
+ const data = this.safeList(swapResponse, 'data', []);
3139
+ return this.parseOrders(data, market, since, limit, params);
3135
3140
  }
3136
3141
  }
3137
3142
  /**
@@ -3920,7 +3925,7 @@ class mexc extends mexc$1["default"] {
3920
3925
  for (let i = 0; i < wallet.length; i++) {
3921
3926
  const entry = wallet[i];
3922
3927
  const marketId = this.safeString(entry, 'symbol');
3923
- const symbol = this.safeSymbol(marketId, undefined);
3928
+ const symbol = this.safeSymbol(marketId);
3924
3929
  const base = this.safeValue(entry, 'baseAsset', {});
3925
3930
  const quote = this.safeValue(entry, 'quoteAsset', {});
3926
3931
  const baseCode = this.safeCurrencyCode(this.safeString(base, 'asset'));
@@ -4730,14 +4735,17 @@ class mexc extends mexc$1["default"] {
4730
4735
  }
4731
4736
  while (Precise["default"].stringLt(floor, maxVol)) {
4732
4737
  const cap = Precise["default"].stringAdd(floor, riskIncrVol);
4738
+ const minNotional = this.parseNumber(floor);
4739
+ const mainMarginRate = this.parseNumber(maintenanceMarginRate);
4740
+ const maxLev = this.parseNumber(Precise["default"].stringDiv('1', initialMarginRate));
4733
4741
  tiers.push({
4734
4742
  'tier': this.parseNumber(Precise["default"].stringDiv(cap, riskIncrVol)),
4735
4743
  'symbol': this.safeSymbol(marketId, market, undefined, 'contract'),
4736
4744
  'currency': this.safeCurrencyCode(quoteId),
4737
- 'minNotional': this.parseNumber(floor),
4745
+ 'minNotional': minNotional,
4738
4746
  'maxNotional': this.parseNumber(cap),
4739
- 'maintenanceMarginRate': this.parseNumber(maintenanceMarginRate),
4740
- 'maxLeverage': this.parseNumber(Precise["default"].stringDiv('1', initialMarginRate)),
4747
+ 'maintenanceMarginRate': mainMarginRate,
4748
+ 'maxLeverage': maxLev,
4741
4749
  'info': info,
4742
4750
  });
4743
4751
  initialMarginRate = Precise["default"].stringAdd(initialMarginRate, riskIncrImr);
@@ -4757,11 +4765,12 @@ class mexc extends mexc$1["default"] {
4757
4765
  //
4758
4766
  const address = this.safeString(depositAddress, 'address');
4759
4767
  const currencyId = this.safeString(depositAddress, 'coin');
4768
+ const code = this.safeCurrencyCode(currencyId, currency);
4760
4769
  const networkId = this.safeString(depositAddress, 'netWork');
4761
4770
  return {
4762
4771
  'info': depositAddress,
4763
- 'currency': this.safeCurrencyCode(currencyId, currency),
4764
- 'network': this.networkIdToCode(networkId, currencyId),
4772
+ 'currency': code,
4773
+ 'network': this.networkIdToCode(networkId, code),
4765
4774
  'address': address,
4766
4775
  'tag': this.safeString(depositAddress, 'memo'),
4767
4776
  };
@@ -5080,12 +5089,12 @@ class mexc extends mexc$1["default"] {
5080
5089
  if (currencyWithNetwork !== undefined) {
5081
5090
  currencyId = currencyWithNetwork.split('-')[0];
5082
5091
  }
5092
+ const code = this.safeCurrencyCode(currencyId, currency);
5083
5093
  let network = undefined;
5084
5094
  const rawNetwork = this.safeString(transaction, 'network');
5085
5095
  if (rawNetwork !== undefined) {
5086
- network = this.networkIdToCode(rawNetwork);
5096
+ network = this.networkIdToCode(rawNetwork, code);
5087
5097
  }
5088
- const code = this.safeCurrencyCode(currencyId, currency);
5089
5098
  const status = this.parseTransactionStatusByType(this.safeString(transaction, 'status'), type);
5090
5099
  let amountString = this.safeString(transaction, 'amount');
5091
5100
  const address = this.safeString(transaction, 'address');
@@ -5363,8 +5372,8 @@ class mexc extends mexc$1["default"] {
5363
5372
  * @description fetch a history of internal transfers made on an account
5364
5373
  * @see https://mexcdevelop.github.io/apidocs/spot_v2_en/#get-internal-assets-transfer-records
5365
5374
  * @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-the-user-39-s-asset-transfer-records
5366
- * @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
5367
- * @param code
5375
+ * @see https://www.mexc.com/api-docs/spot-v3/wallet-endpoints#query-user-universal-transfer-history
5376
+ * @param {string} [code] unified currency code of the currency transferred
5368
5377
  * @param {int} [since] the earliest time in ms to fetch transfers for
5369
5378
  * @param {int} [limit] the maximum number of transfers structures to retrieve
5370
5379
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -6102,8 +6111,8 @@ class mexc extends mexc$1["default"] {
6102
6111
  if (market['spot']) {
6103
6112
  throw new errors.BadSymbol(this.id + ' setMarginMode() supports contract markets only');
6104
6113
  }
6105
- marginMode = marginMode.toLowerCase();
6106
- if (marginMode !== 'isolated' && marginMode !== 'cross') {
6114
+ const marginModeLower = marginMode.toLowerCase();
6115
+ if (marginModeLower !== 'isolated' && marginModeLower !== 'cross') {
6107
6116
  throw new errors.BadRequest(this.id + ' setMarginMode() marginMode argument should be isolated or cross');
6108
6117
  }
6109
6118
  const leverage = this.safeInteger(params, 'leverage');
@@ -6113,7 +6122,7 @@ class mexc extends mexc$1["default"] {
6113
6122
  const direction = this.safeStringLower2(params, 'direction', 'positionId');
6114
6123
  const request = {
6115
6124
  'leverage': leverage,
6116
- 'openType': (marginMode === 'isolated') ? 1 : 2,
6125
+ 'openType': (marginModeLower === 'isolated') ? 1 : 2,
6117
6126
  };
6118
6127
  if (symbol !== undefined) {
6119
6128
  request['symbol'] = market['id'];
@@ -6229,7 +6238,7 @@ class mexc extends mexc$1["default"] {
6229
6238
  if (success === true) {
6230
6239
  return undefined;
6231
6240
  }
6232
- const responseCode = this.safeString(response, 'code', undefined);
6241
+ const responseCode = this.safeString(response, 'code');
6233
6242
  if ((responseCode !== undefined) && (responseCode !== '200') && (responseCode !== '0')) {
6234
6243
  const feedback = this.id + ' ' + body;
6235
6244
  this.throwBroadlyMatchedException(this.exceptions['broad'], body, feedback);
@@ -630,7 +630,6 @@ class modetrade extends modetrade$1["default"] {
630
630
  * @returns {object} an associative dictionary of currencies
631
631
  */
632
632
  async fetchCurrencies(params = {}) {
633
- const result = {};
634
633
  const response = await this.v1PublicGetPublicToken(params);
635
634
  //
636
635
  // {
@@ -656,66 +655,65 @@ class modetrade extends modetrade$1["default"] {
656
655
  //
657
656
  const data = this.safeDict(response, 'data', {});
658
657
  const tokenRows = this.safeList(data, 'rows', []);
659
- for (let i = 0; i < tokenRows.length; i++) {
660
- const token = tokenRows[i];
661
- const currencyId = this.safeString(token, 'token');
662
- const networks = this.safeList(token, 'chain_details');
663
- const code = this.safeCurrencyCode(currencyId);
664
- let minPrecision = undefined;
665
- const resultingNetworks = {};
666
- for (let j = 0; j < networks.length; j++) {
667
- const network = networks[j];
668
- // TODO: transform chain id to human readable name
669
- const networkId = this.safeString(network, 'chain_id');
670
- const precision = this.parsePrecision(this.safeString(network, 'decimals'));
671
- if (precision !== undefined) {
672
- minPrecision = (minPrecision === undefined) ? precision : Precise["default"].stringMin(precision, minPrecision);
673
- }
674
- resultingNetworks[networkId] = {
675
- 'id': networkId,
676
- 'network': networkId,
677
- 'limits': {
678
- 'withdraw': {
679
- 'min': undefined,
680
- 'max': undefined,
681
- },
682
- 'deposit': {
683
- 'min': undefined,
684
- 'max': undefined,
685
- },
686
- },
687
- 'active': undefined,
688
- 'deposit': undefined,
689
- 'withdraw': undefined,
690
- 'fee': this.safeNumber(network, 'withdrawal_fee'),
691
- 'precision': this.parseNumber(precision),
692
- 'info': network,
693
- };
658
+ return this.parseCurrencies(tokenRows);
659
+ }
660
+ parseCurrency(rawCurrency) {
661
+ const currencyId = this.safeString(rawCurrency, 'token');
662
+ const networks = this.safeList(rawCurrency, 'chain_details');
663
+ const code = this.safeCurrencyCode(currencyId);
664
+ let minPrecision = undefined;
665
+ const resultingNetworks = {};
666
+ for (let j = 0; j < networks.length; j++) {
667
+ const network = networks[j];
668
+ // TODO: transform chain id to human readable name
669
+ const networkId = this.safeString(network, 'chain_id');
670
+ const precision = this.parsePrecision(this.safeString(network, 'decimals'));
671
+ if (precision !== undefined) {
672
+ minPrecision = (minPrecision === undefined) ? precision : Precise["default"].stringMin(precision, minPrecision);
694
673
  }
695
- result[code] = this.safeCurrencyStructure({
696
- 'id': currencyId,
697
- 'name': currencyId,
698
- 'code': code,
699
- 'precision': this.parseNumber(minPrecision),
700
- 'active': undefined,
701
- 'fee': undefined,
702
- 'networks': resultingNetworks,
703
- 'deposit': undefined,
704
- 'withdraw': undefined,
674
+ resultingNetworks[networkId] = {
675
+ 'id': networkId,
676
+ 'network': networkId,
705
677
  'limits': {
706
- 'deposit': {
678
+ 'withdraw': {
707
679
  'min': undefined,
708
680
  'max': undefined,
709
681
  },
710
- 'withdraw': {
711
- 'min': this.safeNumber(token, 'minimum_withdraw_amount'),
682
+ 'deposit': {
683
+ 'min': undefined,
712
684
  'max': undefined,
713
685
  },
714
686
  },
715
- 'info': token,
716
- });
687
+ 'active': undefined,
688
+ 'deposit': undefined,
689
+ 'withdraw': undefined,
690
+ 'fee': this.safeNumber(network, 'withdrawal_fee'),
691
+ 'precision': this.parseNumber(precision),
692
+ 'info': network,
693
+ };
717
694
  }
718
- return result;
695
+ return this.safeCurrencyStructure({
696
+ 'id': currencyId,
697
+ 'name': currencyId,
698
+ 'code': code,
699
+ 'precision': this.parseNumber(minPrecision),
700
+ 'active': undefined,
701
+ 'fee': undefined,
702
+ 'networks': resultingNetworks,
703
+ 'deposit': undefined,
704
+ 'withdraw': undefined,
705
+ 'limits': {
706
+ 'deposit': {
707
+ 'min': undefined,
708
+ 'max': undefined,
709
+ },
710
+ 'withdraw': {
711
+ 'min': this.safeNumber(rawCurrency, 'minimum_withdraw_amount'),
712
+ 'max': undefined,
713
+ },
714
+ },
715
+ 'info': rawCurrency,
716
+ });
719
717
  }
720
718
  parseTokenAndFeeTemp(item, feeTokenKey, feeAmountKey) {
721
719
  const feeCost = this.safeString(item, feeAmountKey);
@@ -1405,7 +1403,7 @@ class modetrade extends modetrade$1["default"] {
1405
1403
  'fok': 'FOK',
1406
1404
  'post_only': 'PO',
1407
1405
  };
1408
- return this.safeString(timeInForces, timeInForce, undefined);
1406
+ return this.safeString(timeInForces, timeInForce);
1409
1407
  }
1410
1408
  parseOrderStatus(status) {
1411
1409
  if (status !== undefined) {
@@ -480,43 +480,41 @@ class ndax extends ndax$1["default"] {
480
480
  // },
481
481
  // ...
482
482
  //
483
- const result = {};
484
- for (let i = 0; i < response.length; i++) {
485
- const currency = response[i];
486
- const id = this.safeString(currency, 'ProductId');
487
- const code = this.safeCurrencyCode(this.safeString(currency, 'Product'));
488
- const ProductType = this.safeString(currency, 'ProductType');
489
- let type = (ProductType === 'NationalCurrency') ? 'fiat' : 'crypto';
490
- if (ProductType === 'Unknown') {
491
- // such currency is just a blanket entry
492
- type = 'other';
493
- }
494
- result[code] = this.safeCurrencyStructure({
495
- 'id': id,
496
- 'name': this.safeString(currency, 'ProductFullName'),
497
- 'code': code,
498
- 'type': type,
499
- 'precision': this.safeNumber(currency, 'TickSize'),
500
- 'info': currency,
501
- 'active': !this.safeBool(currency, 'IsDisabled'),
502
- 'deposit': this.safeBool(currency, 'DepositEnabled'),
503
- 'withdraw': this.safeBool(currency, 'WithdrawEnabled'),
504
- 'fee': undefined,
505
- 'limits': {
506
- 'amount': {
507
- 'min': undefined,
508
- 'max': undefined,
509
- },
510
- 'withdraw': {
511
- 'min': undefined,
512
- 'max': undefined,
513
- },
514
- },
515
- 'networks': {},
516
- 'margin': this.safeBool(currency, 'MarginEnabled'),
517
- });
483
+ return this.parseCurrencies(response);
484
+ }
485
+ parseCurrency(rawCurrency) {
486
+ const id = this.safeString(rawCurrency, 'ProductId');
487
+ const code = this.safeCurrencyCode(this.safeString(rawCurrency, 'Product'));
488
+ const ProductType = this.safeString(rawCurrency, 'ProductType');
489
+ let type = (ProductType === 'NationalCurrency') ? 'fiat' : 'crypto';
490
+ if (ProductType === 'Unknown') {
491
+ // such currency is just a blanket entry
492
+ type = 'other';
518
493
  }
519
- return result;
494
+ return this.safeCurrencyStructure({
495
+ 'id': id,
496
+ 'name': this.safeString(rawCurrency, 'ProductFullName'),
497
+ 'code': code,
498
+ 'type': type,
499
+ 'precision': this.safeNumber(rawCurrency, 'TickSize'),
500
+ 'info': rawCurrency,
501
+ 'active': !this.safeBool(rawCurrency, 'IsDisabled'),
502
+ 'deposit': this.safeBool(rawCurrency, 'DepositEnabled'),
503
+ 'withdraw': this.safeBool(rawCurrency, 'WithdrawEnabled'),
504
+ 'fee': undefined,
505
+ 'limits': {
506
+ 'amount': {
507
+ 'min': undefined,
508
+ 'max': undefined,
509
+ },
510
+ 'withdraw': {
511
+ 'min': undefined,
512
+ 'max': undefined,
513
+ },
514
+ },
515
+ 'networks': {},
516
+ 'margin': this.safeBool(rawCurrency, 'MarginEnabled'),
517
+ });
520
518
  }
521
519
  /**
522
520
  * @method
@@ -666,7 +664,7 @@ class ndax extends ndax$1["default"] {
666
664
  const newNonce = this.safeInteger(level, 0);
667
665
  nonce = Math.max(nonce, newNonce);
668
666
  }
669
- const bidask = this.parseBidAsk(level, priceKey, amountKey);
667
+ const bidask = this.parseOrderBookBidAsk(level, priceKey, amountKey);
670
668
  const levelSide = this.safeInteger(level, 9);
671
669
  const side = levelSide ? asksKey : bidsKey;
672
670
  const resultSide = result[side];
@@ -1517,7 +1517,18 @@ class okx extends okx$1["default"] {
1517
1517
  };
1518
1518
  }
1519
1519
  safeMarket(marketId = undefined, market = undefined, delimiter = undefined, marketType = undefined) {
1520
- const isOption = (marketId !== undefined) && ((marketId.indexOf('-C') > -1) || (marketId.indexOf('-P') > -1));
1520
+ let isOption = false;
1521
+ if (marketId !== undefined) {
1522
+ const parts = marketId.split('-');
1523
+ const partsLength = parts.length;
1524
+ // a valid OKX option ends with the call/put flag and carries expiry+strike segments,
1525
+ // e.g. the market id BTC-USD-220325-194000-P (5 parts) or the unified symbol
1526
+ // BTC/USD:USD-260611-54000-C (4 parts). Requiring more than 3 dash-separated parts avoids
1527
+ // misclassifying ordinary ids that merely contain "-C"/"-P" (such as a SPOT id like
1528
+ // "PERFTESTA-PERFTESTB") as expired options, which would crash createExpiredOptionMarket
1529
+ // on the missing expiry.
1530
+ isOption = (partsLength > 3) && (marketId.endsWith('-C') || marketId.endsWith('-P'));
1531
+ }
1521
1532
  if (isOption && !(marketId in this.markets_by_id)) {
1522
1533
  // handle expired option contracts
1523
1534
  return this.createExpiredOptionMarket(marketId);
@@ -1823,6 +1834,9 @@ class okx extends okx$1["default"] {
1823
1834
  let maxLeverage = this.safeString(market, 'lever', '1');
1824
1835
  maxLeverage = Precise["default"].stringMax(maxLeverage, '1');
1825
1836
  const maxSpotCost = this.safeNumber(market, 'maxMktSz');
1837
+ const leverageAboveOne = Precise["default"].stringGt(maxLeverage, '1');
1838
+ const quoteEqualSettle = (quoteId === settleId);
1839
+ const baseEqualSettle = (baseId === settleId);
1826
1840
  const status = this.safeString(market, 'state');
1827
1841
  const instIdCode = this.safeInteger(market, 'instIdCode');
1828
1842
  return this.extend(fees, {
@@ -1837,14 +1851,14 @@ class okx extends okx$1["default"] {
1837
1851
  'settleId': settleId,
1838
1852
  'type': type,
1839
1853
  'spot': spot,
1840
- 'margin': spot && (Precise["default"].stringGt(maxLeverage, '1')),
1854
+ 'margin': spot && leverageAboveOne,
1841
1855
  'swap': swap,
1842
1856
  'future': future,
1843
1857
  'option': option,
1844
1858
  'active': status === 'live',
1845
1859
  'contract': contract,
1846
- 'linear': contract ? (quoteId === settleId) : undefined,
1847
- 'inverse': contract ? (baseId === settleId) : undefined,
1860
+ 'linear': contract ? quoteEqualSettle : undefined,
1861
+ 'inverse': contract ? baseEqualSettle : undefined,
1848
1862
  'contractSize': contract ? this.safeNumber(market, 'ctVal') : undefined,
1849
1863
  'expiry': expiry,
1850
1864
  'expiryDatetime': this.iso8601(expiry),
@@ -1935,6 +1949,10 @@ class okx extends okx$1["default"] {
1935
1949
  const marketsWithoutTest = [];
1936
1950
  for (let i = 0; i < dataResponse.length; i++) {
1937
1951
  const data = dataResponse[i];
1952
+ const instId = this.safeString(data, 'instId', '');
1953
+ if (instId === '') {
1954
+ continue; // skip broken "preopen" placeholder instruments that have no instId
1955
+ }
1938
1956
  if (this.isSandboxModeEnabled) {
1939
1957
  const instFamily = this.safeString(data, 'instFamily', '');
1940
1958
  if (instFamily.startsWith('TEST')) {
@@ -9205,7 +9223,7 @@ class okx extends okx$1["default"] {
9205
9223
  request['end'] = until;
9206
9224
  }
9207
9225
  if (timeframe !== undefined) {
9208
- request['period'] = timeframe;
9226
+ request['period'] = this.safeString(this.timeframes, timeframe, timeframe);
9209
9227
  }
9210
9228
  if (since !== undefined) {
9211
9229
  request['begin'] = since;
@@ -435,29 +435,27 @@ class onetrading extends onetrading$1["default"] {
435
435
  // },
436
436
  // ]
437
437
  //
438
- const result = {};
439
- for (let i = 0; i < response.length; i++) {
440
- const currency = response[i];
441
- const id = this.safeString(currency, 'code');
442
- const code = this.safeCurrencyCode(id);
443
- result[code] = this.safeCurrencyStructure({
444
- 'id': id,
445
- 'code': code,
446
- 'name': this.safeString(currency, 'name'),
447
- 'info': currency,
448
- 'active': undefined,
449
- 'fee': undefined,
450
- 'precision': this.parseNumber(this.parsePrecision(this.safeString(currency, 'precision'))),
451
- 'withdraw': undefined,
452
- 'deposit': undefined,
453
- 'limits': {
454
- 'amount': { 'min': undefined, 'max': undefined },
455
- 'withdraw': { 'min': undefined, 'max': undefined },
456
- },
457
- 'networks': {},
458
- });
459
- }
460
- return result;
438
+ return this.parseCurrencies(response);
439
+ }
440
+ parseCurrency(rawCurrency) {
441
+ const id = this.safeString(rawCurrency, 'code');
442
+ const code = this.safeCurrencyCode(id);
443
+ return this.safeCurrencyStructure({
444
+ 'id': id,
445
+ 'code': code,
446
+ 'name': this.safeString(rawCurrency, 'name'),
447
+ 'info': rawCurrency,
448
+ 'active': undefined,
449
+ 'fee': undefined,
450
+ 'precision': this.parseNumber(this.parsePrecision(this.safeString(rawCurrency, 'precision'))),
451
+ 'withdraw': undefined,
452
+ 'deposit': undefined,
453
+ 'limits': {
454
+ 'amount': { 'min': undefined, 'max': undefined },
455
+ 'withdraw': { 'min': undefined, 'max': undefined },
456
+ },
457
+ 'networks': {},
458
+ });
461
459
  }
462
460
  /**
463
461
  * @method
@@ -1113,10 +1113,12 @@ class p2b extends p2b$1["default"] {
1113
1113
  throw new errors.BadRequest(this.id + ' fetchMyTrades () the time between since and params["until"] cannot be greater than 24 hours');
1114
1114
  }
1115
1115
  const market = this.market(symbol);
1116
+ const sinceSec = this.parseToInt(since / 1000);
1117
+ const untilSec = this.parseToInt(until / 1000);
1116
1118
  const request = {
1117
1119
  'market': market['id'],
1118
- 'startTime': this.parseToInt(since / 1000),
1119
- 'endTime': this.parseToInt(until / 1000),
1120
+ 'startTime': sinceSec,
1121
+ 'endTime': untilSec,
1120
1122
  };
1121
1123
  if (limit !== undefined) {
1122
1124
  request['limit'] = limit;
@@ -1189,9 +1191,11 @@ class p2b extends p2b$1["default"] {
1189
1191
  if ((until - since) > 86400000) {
1190
1192
  throw new errors.BadRequest(this.id + ' fetchClosedOrders () the time between since and params["until"] cannot be greater than 24 hours');
1191
1193
  }
1194
+ const sinceSec = this.parseToInt(since / 1000);
1195
+ const untilSec = this.parseToInt(until / 1000);
1192
1196
  const request = {
1193
- 'startTime': this.parseToInt(since / 1000),
1194
- 'endTime': this.parseToInt(until / 1000),
1197
+ 'startTime': sinceSec,
1198
+ 'endTime': untilSec,
1195
1199
  };
1196
1200
  if (market !== undefined) {
1197
1201
  request['market'] = market['id'];
@@ -627,6 +627,7 @@ class paradex extends paradex$1["default"] {
627
627
  else {
628
628
  expiry = undefined;
629
629
  }
630
+ const expireDatetime = (expiry === 0) ? undefined : this.iso8601(expiry);
630
631
  return this.safeMarketStructure({
631
632
  'id': marketId,
632
633
  'symbol': symbol,
@@ -650,7 +651,7 @@ class paradex extends paradex$1["default"] {
650
651
  'maker': makerFee,
651
652
  'contractSize': this.parseNumber('1'),
652
653
  'expiry': expiry,
653
- 'expiryDatetime': (expiry === 0) ? undefined : this.iso8601(expiry),
654
+ 'expiryDatetime': expireDatetime,
654
655
  'strike': this.parseNumber(strikePrice),
655
656
  'optionType': this.safeStringLower(market, 'option_type'),
656
657
  'precision': {
@@ -1496,7 +1497,7 @@ class paradex extends paradex$1["default"] {
1496
1497
  'GTC': 'GTC',
1497
1498
  'POST_ONLY': 'PO',
1498
1499
  };
1499
- return this.safeString(timeInForces, timeInForce, undefined);
1500
+ return this.safeString(timeInForces, timeInForce);
1500
1501
  }
1501
1502
  parseOrderStatus(status) {
1502
1503
  if (status !== undefined) {