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
@@ -74,7 +74,7 @@ export default class cryptomus extends Exchange {
74
74
  'fetchConvertTradeHistory': false,
75
75
  'fetchCrossBorrowRate': false,
76
76
  'fetchCrossBorrowRates': false,
77
- 'fetchCurrencies': false,
77
+ 'fetchCurrencies': true,
78
78
  'fetchDepositAddress': false,
79
79
  'fetchDeposits': false,
80
80
  'fetchDepositsWithdrawals': false,
@@ -401,46 +401,50 @@ export default class cryptomus extends Exchange {
401
401
  //
402
402
  const coins = this.safeList(response, 'result');
403
403
  const groupedById = this.groupBy(coins, 'currency_code');
404
- const keys = Object.keys(groupedById);
405
- const result = {};
406
- for (let i = 0; i < keys.length; i++) {
407
- const id = keys[i];
408
- const code = this.safeCurrencyCode(id);
409
- const networks = {};
410
- const networkEntries = groupedById[id];
411
- for (let j = 0; j < networkEntries.length; j++) {
412
- const networkEntry = networkEntries[j];
413
- const networkId = this.safeString(networkEntry, 'network_code');
414
- const networkCode = this.networkIdToCode(networkId);
415
- networks[networkCode] = {
416
- 'id': networkId,
417
- 'network': networkCode,
418
- 'limits': {
419
- 'withdraw': {
420
- 'min': this.safeNumber(networkEntry, 'min_withdraw'),
421
- 'max': this.safeNumber(networkEntry, 'max_withdraw'),
422
- },
423
- 'deposit': {
424
- 'min': this.safeNumber(networkEntry, 'min_deposit'),
425
- 'max': this.safeNumber(networkEntry, 'max_deposit'),
426
- },
427
- },
428
- 'active': undefined,
429
- 'deposit': this.safeBool(networkEntry, 'can_withdraw'),
430
- 'withdraw': this.safeBool(networkEntry, 'can_deposit'),
431
- 'fee': undefined,
432
- 'precision': undefined,
433
- 'info': networkEntry,
434
- };
404
+ const groupedArray = Object.values(groupedById);
405
+ return this.parseCurrencies(groupedArray);
406
+ }
407
+ parseCurrency(rawCurrency) {
408
+ // currency here is array of networks
409
+ let id = undefined; // all entried have same id, as they were grouped by
410
+ let code = undefined;
411
+ const networks = {};
412
+ for (let i = 0; i < rawCurrency.length; i++) {
413
+ const networkEntry = rawCurrency[i];
414
+ // set ID on first loop
415
+ if (id === undefined) {
416
+ id = this.safeString(networkEntry, 'currency_code');
417
+ code = this.safeCurrencyCode(id);
435
418
  }
436
- result[code] = this.safeCurrencyStructure({
437
- 'id': id,
438
- 'code': code,
439
- 'networks': networks,
440
- 'info': networkEntries,
441
- });
419
+ const networkId = this.safeString(networkEntry, 'network_code');
420
+ const networkCode = this.networkIdToCode(networkId, code);
421
+ networks[networkCode] = {
422
+ 'id': networkId,
423
+ 'network': networkCode,
424
+ 'limits': {
425
+ 'withdraw': {
426
+ 'min': this.safeNumber(networkEntry, 'min_withdraw'),
427
+ 'max': this.safeNumber(networkEntry, 'max_withdraw'),
428
+ },
429
+ 'deposit': {
430
+ 'min': this.safeNumber(networkEntry, 'min_deposit'),
431
+ 'max': this.safeNumber(networkEntry, 'max_deposit'),
432
+ },
433
+ },
434
+ 'active': undefined,
435
+ 'deposit': this.safeBool(networkEntry, 'can_deposit'),
436
+ 'withdraw': this.safeBool(networkEntry, 'can_withdraw'),
437
+ 'fee': undefined,
438
+ 'precision': undefined,
439
+ 'info': networkEntry,
440
+ };
442
441
  }
443
- return result;
442
+ return this.safeCurrencyStructure({
443
+ 'id': id,
444
+ 'code': code,
445
+ 'networks': networks,
446
+ 'info': rawCurrency,
447
+ });
444
448
  }
445
449
  /**
446
450
  * @method
@@ -508,6 +508,8 @@ export default class deepcoin extends Exchange {
508
508
  const maxLimitSize = this.safeString(market, 'maxLmtSz');
509
509
  const maxAmount = this.parseNumber(Precise.stringMax(maxMarketSize, maxLimitSize));
510
510
  const state = this.safeString(market, 'state');
511
+ const isMargin = spot && (Precise.stringGt(maxLeverage, '1'));
512
+ const isInverse = swap ? (!isLinear) : undefined;
511
513
  return this.extend(fees, {
512
514
  'id': id,
513
515
  'symbol': symbol,
@@ -519,14 +521,14 @@ export default class deepcoin extends Exchange {
519
521
  'settleId': settleId,
520
522
  'type': type,
521
523
  'spot': spot,
522
- 'margin': spot && (Precise.stringGt(maxLeverage, '1')),
524
+ 'margin': isMargin,
523
525
  'swap': swap,
524
526
  'future': false,
525
527
  'option': false,
526
528
  'active': state === 'live',
527
529
  'contract': swap,
528
530
  'linear': isLinear,
529
- 'inverse': swap ? (!isLinear) : undefined,
531
+ 'inverse': isInverse,
530
532
  'contractSize': swap ? this.safeNumber(market, 'ctVal') : undefined,
531
533
  'expiry': undefined,
532
534
  'expiryDatetime': undefined,
@@ -1059,7 +1061,7 @@ export default class deepcoin extends Exchange {
1059
1061
  const amount = this.safeNumber(transaction, 'amount');
1060
1062
  const timestamp = this.safeTimestamp(transaction, 'createTime');
1061
1063
  const networkId = this.safeString(transaction, 'chainName');
1062
- const network = this.networkIdToCode(networkId);
1064
+ const network = this.networkIdToCode(networkId, code);
1063
1065
  const status = this.parseTransactionStatus(this.safeString(transaction, 'status'));
1064
1066
  return {
1065
1067
  'info': transaction,
@@ -1206,10 +1208,11 @@ export default class deepcoin extends Exchange {
1206
1208
  const chain = this.safeString(response, 'chain');
1207
1209
  const address = this.safeString(response, 'address');
1208
1210
  this.checkAddress(address);
1211
+ const code = this.safeString(currency, 'code');
1209
1212
  return {
1210
1213
  'info': response,
1211
1214
  'currency': undefined,
1212
- 'network': this.networkIdToCode(chain),
1215
+ 'network': this.networkIdToCode(chain, code),
1213
1216
  'address': address,
1214
1217
  'tag': this.safeString(response, 'memo'),
1215
1218
  };
@@ -2187,11 +2190,12 @@ export default class deepcoin extends Exchange {
2187
2190
  }
2188
2191
  let merged = true;
2189
2192
  [merged, params] = this.handleOptionAndParams(params, 'cancelAllOrders', 'merged', merged);
2193
+ const isMergedMode = merged ? 1 : 0;
2190
2194
  const request = {
2191
2195
  'InstrumentID': market['id'],
2192
2196
  'ProductGroup': productGroup,
2193
2197
  'IsCrossMargin': encodedMarginMode,
2194
- 'IsMergeMode': merged ? 1 : 0,
2198
+ 'IsMergeMode': isMergedMode,
2195
2199
  };
2196
2200
  const response = await this.privatePostDeepcoinTradeSwapCancelAll(this.extend(request, params));
2197
2201
  const data = this.safeList(response, 'data', []);
package/js/src/delta.d.ts CHANGED
@@ -39,6 +39,7 @@ export default class delta extends Exchange {
39
39
  * @returns {object} an associative dictionary of currencies
40
40
  */
41
41
  fetchCurrencies(params?: {}): Promise<Currencies>;
42
+ parseCurrency(rawCurrency: Dict): Currency;
42
43
  loadMarkets(reload?: boolean, params?: {}): Promise<import("./base/types.js").Dictionary<MarketInterface>>;
43
44
  indexByStringifiedNumericId(input: any): Dict;
44
45
  /**
package/js/src/delta.js CHANGED
@@ -360,6 +360,7 @@ export default class delta extends Exchange {
360
360
  const strike = this.safeString(optionParts, 2);
361
361
  const datetime = this.convertExpireDate(expiry);
362
362
  const timestamp = this.parse8601(datetime);
363
+ const optionTypeUnified = (optionType === 'C') ? 'call' : 'put';
363
364
  return {
364
365
  'id': optionType + '-' + base + '-' + strike + '-' + expiry,
365
366
  'symbol': base + '/' + quote + ':' + settle + '-' + expiry + '-' + strike + '-' + optionType,
@@ -382,7 +383,7 @@ export default class delta extends Exchange {
382
383
  'contractSize': this.parseNumber('1'),
383
384
  'expiry': timestamp,
384
385
  'expiryDatetime': datetime,
385
- 'optionType': (optionType === 'C') ? 'call' : 'put',
386
+ 'optionType': optionTypeUnified,
386
387
  'strike': this.parseNumber(strike),
387
388
  'precision': {
388
389
  'amount': undefined,
@@ -559,62 +560,60 @@ export default class delta extends Exchange {
559
560
  // }
560
561
  //
561
562
  const currencies = this.safeList(response, 'result', []);
562
- const result = {};
563
- for (let i = 0; i < currencies.length; i++) {
564
- const currency = currencies[i];
565
- const id = this.safeString(currency, 'symbol');
566
- const numericId = this.safeInteger(currency, 'id');
567
- const code = this.safeCurrencyCode(id);
568
- const chains = this.safeList(currency, 'networks', []);
569
- const networks = {};
570
- for (let j = 0; j < chains.length; j++) {
571
- const chain = chains[j];
572
- const networkId = this.safeString(chain, 'network');
573
- const networkCode = this.networkIdToCode(networkId);
574
- networks[networkCode] = {
575
- 'id': networkId,
576
- 'network': networkCode,
577
- 'name': this.safeString(chain, 'name'),
578
- 'info': chain,
579
- 'active': this.safeString(chain, 'status') === 'enabled',
580
- 'deposit': this.safeString(chain, 'deposit_status') === 'enabled',
581
- 'withdraw': this.safeString(chain, 'withdrawal_status') === 'enabled',
582
- 'fee': this.safeNumber(chain, 'base_withdrawal_fee'),
583
- 'limits': {
584
- 'deposit': {
585
- 'min': this.safeNumber(chain, 'min_deposit_amount'),
586
- 'max': undefined,
587
- },
588
- 'withdraw': {
589
- 'min': this.safeNumber(chain, 'min_withdrawal_amount'),
590
- 'max': undefined,
591
- },
592
- },
593
- };
594
- }
595
- result[code] = this.safeCurrencyStructure({
596
- 'id': id,
597
- 'numericId': numericId,
598
- 'code': code,
599
- 'name': this.safeString(currency, 'name'),
600
- 'info': currency,
601
- 'active': undefined,
602
- 'deposit': this.safeString(currency, 'deposit_status') === 'enabled',
603
- 'withdraw': this.safeString(currency, 'withdrawal_status') === 'enabled',
604
- 'fee': this.safeNumber(currency, 'base_withdrawal_fee'),
605
- 'precision': this.parseNumber(this.parsePrecision(this.safeString(currency, 'precision'))),
563
+ return this.parseCurrencies(currencies);
564
+ }
565
+ parseCurrency(rawCurrency) {
566
+ const id = this.safeString(rawCurrency, 'symbol');
567
+ const numericId = this.safeInteger(rawCurrency, 'id');
568
+ const code = this.safeCurrencyCode(id);
569
+ const chains = this.safeList(rawCurrency, 'networks', []);
570
+ const networks = {};
571
+ for (let j = 0; j < chains.length; j++) {
572
+ const chain = chains[j];
573
+ const networkId = this.safeString(chain, 'network');
574
+ const networkCode = this.networkIdToCode(networkId, code);
575
+ networks[networkCode] = {
576
+ 'id': networkId,
577
+ 'network': networkCode,
578
+ 'name': this.safeString(chain, 'name'),
579
+ 'info': chain,
580
+ 'active': this.safeString(chain, 'status') === 'enabled',
581
+ 'deposit': this.safeString(chain, 'deposit_status') === 'enabled',
582
+ 'withdraw': this.safeString(chain, 'withdrawal_status') === 'enabled',
583
+ 'fee': this.safeNumber(chain, 'base_withdrawal_fee'),
606
584
  'limits': {
607
- 'amount': { 'min': undefined, 'max': undefined },
585
+ 'deposit': {
586
+ 'min': this.safeNumber(chain, 'min_deposit_amount'),
587
+ 'max': undefined,
588
+ },
608
589
  'withdraw': {
609
- 'min': this.safeNumber(currency, 'min_withdrawal_amount'),
590
+ 'min': this.safeNumber(chain, 'min_withdrawal_amount'),
610
591
  'max': undefined,
611
592
  },
612
593
  },
613
- 'networks': networks,
614
- 'type': 'crypto',
615
- });
594
+ };
616
595
  }
617
- return result;
596
+ return this.safeCurrencyStructure({
597
+ 'id': id,
598
+ 'numericId': numericId,
599
+ 'code': code,
600
+ 'name': this.safeString(rawCurrency, 'name'),
601
+ 'info': rawCurrency,
602
+ 'active': undefined,
603
+ 'deposit': this.safeString(rawCurrency, 'deposit_status') === 'enabled',
604
+ 'withdraw': this.safeString(rawCurrency, 'withdrawal_status') === 'enabled',
605
+ 'fee': this.safeNumber(rawCurrency, 'base_withdrawal_fee'),
606
+ 'precision': this.parseNumber(this.parsePrecision(this.safeString(rawCurrency, 'precision'))),
607
+ 'limits': {
608
+ 'amount': { 'min': undefined, 'max': undefined },
609
+ 'withdraw': {
610
+ 'min': this.safeNumber(rawCurrency, 'min_withdrawal_amount'),
611
+ 'max': undefined,
612
+ },
613
+ },
614
+ 'networks': networks,
615
+ 'type': 'crypto',
616
+ });
618
617
  }
619
618
  async loadMarkets(reload = false, params = {}) {
620
619
  const markets = await super.loadMarkets(reload, params);
@@ -2602,11 +2601,12 @@ export default class delta extends Exchange {
2602
2601
  const address = this.safeString(depositAddress, 'address');
2603
2602
  const marketId = this.safeString(depositAddress, 'asset_symbol');
2604
2603
  const networkId = this.safeString(depositAddress, 'network');
2604
+ const code = this.safeCurrencyCode(marketId, currency);
2605
2605
  this.checkAddress(address);
2606
2606
  return {
2607
2607
  'info': depositAddress,
2608
- 'currency': this.safeCurrencyCode(marketId, currency),
2609
- 'network': this.networkIdToCode(networkId),
2608
+ 'currency': code,
2609
+ 'network': this.networkIdToCode(networkId, code),
2610
2610
  'address': address,
2611
2611
  'tag': this.safeString(depositAddress, 'memo'),
2612
2612
  };
@@ -26,6 +26,7 @@ export default class deribit extends Exchange {
26
26
  * @returns {object} an associative dictionary of currencies
27
27
  */
28
28
  fetchCurrencies(params?: {}): Promise<Currencies>;
29
+ parseCurrency(rawCurrency: Dict): Currency;
29
30
  codeFromOptions(methodName: any, params?: {}): any;
30
31
  /**
31
32
  * @method
package/js/src/deribit.js CHANGED
@@ -526,9 +526,11 @@ export default class deribit extends Exchange {
526
526
  const optionType = this.safeString(optionParts, 3);
527
527
  const datetime = this.convertExpireDate(expiry);
528
528
  const timestamp = this.parse8601(datetime);
529
+ const id = base + '-' + this.convertExpireDateToMarketIdDate(expiry) + '-' + strike + '-' + optionType;
530
+ const symbolExpired = splitBase + '/' + quote + ':' + settle + '-' + expiry + '-' + strike + '-' + optionType;
529
531
  return {
530
- 'id': base + '-' + this.convertExpireDateToMarketIdDate(expiry) + '-' + strike + '-' + optionType,
531
- 'symbol': splitBase + '/' + quote + ':' + settle + '-' + expiry + '-' + strike + '-' + optionType,
532
+ 'id': id,
533
+ 'symbol': symbolExpired,
532
534
  'base': base,
533
535
  'quote': quote,
534
536
  'settle': settle,
@@ -636,40 +638,38 @@ export default class deribit extends Exchange {
636
638
  // }
637
639
  //
638
640
  const data = this.safeList(response, 'result', []);
639
- const result = {};
640
- for (let i = 0; i < data.length; i++) {
641
- const currency = data[i];
642
- const currencyId = this.safeString(currency, 'currency');
643
- const code = this.safeCurrencyCode(currencyId);
644
- result[code] = this.safeCurrencyStructure({
645
- 'info': currency,
646
- 'code': code,
647
- 'id': currencyId,
648
- 'name': this.safeString(currency, 'currency_long'),
649
- 'active': undefined,
650
- 'deposit': undefined,
651
- 'withdraw': undefined,
652
- 'type': 'crypto',
653
- 'fee': this.safeNumber(currency, 'withdrawal_fee'),
654
- 'precision': undefined,
655
- 'limits': {
656
- 'amount': {
657
- 'min': undefined,
658
- 'max': undefined,
659
- },
660
- 'withdraw': {
661
- 'min': undefined,
662
- 'max': undefined,
663
- },
664
- 'deposit': {
665
- 'min': undefined,
666
- 'max': undefined,
667
- },
641
+ return this.parseCurrencies(data);
642
+ }
643
+ parseCurrency(rawCurrency) {
644
+ const currencyId = this.safeString(rawCurrency, 'currency');
645
+ const code = this.safeCurrencyCode(currencyId);
646
+ return this.safeCurrencyStructure({
647
+ 'info': rawCurrency,
648
+ 'code': code,
649
+ 'id': currencyId,
650
+ 'name': this.safeString(rawCurrency, 'currency_long'),
651
+ 'active': undefined,
652
+ 'deposit': undefined,
653
+ 'withdraw': undefined,
654
+ 'type': 'crypto',
655
+ 'fee': this.safeNumber(rawCurrency, 'withdrawal_fee'),
656
+ 'precision': undefined,
657
+ 'limits': {
658
+ 'amount': {
659
+ 'min': undefined,
660
+ 'max': undefined,
668
661
  },
669
- 'networks': undefined,
670
- });
671
- }
672
- return result;
662
+ 'withdraw': {
663
+ 'min': undefined,
664
+ 'max': undefined,
665
+ },
666
+ 'deposit': {
667
+ 'min': undefined,
668
+ 'max': undefined,
669
+ },
670
+ },
671
+ 'networks': undefined,
672
+ });
673
673
  }
674
674
  codeFromOptions(methodName, params = {}) {
675
675
  const defaultCode = this.safeValue(this.options, 'code', 'BTC');
@@ -25,6 +25,7 @@ export default class derive extends Exchange {
25
25
  * @returns {object} an associative dictionary of currencies
26
26
  */
27
27
  fetchCurrencies(params?: {}): Promise<Currencies>;
28
+ parseCurrency(rawCurrency: Dict): Currency;
28
29
  /**
29
30
  * @method
30
31
  * @name derive#fetchMarkets
package/js/src/derive.js CHANGED
@@ -445,7 +445,6 @@ export default class derive extends Exchange {
445
445
  * @returns {object} an associative dictionary of currencies
446
446
  */
447
447
  async fetchCurrencies(params = {}) {
448
- const result = {};
449
448
  const tokenResponse = await this.publicGetGetAllCurrencies(params);
450
449
  //
451
450
  // {
@@ -496,34 +495,33 @@ export default class derive extends Exchange {
496
495
  // }
497
496
  //
498
497
  const currencies = this.safeList(tokenResponse, 'result', []);
499
- for (let i = 0; i < currencies.length; i++) {
500
- const currency = currencies[i];
501
- const currencyId = this.safeString(currency, 'currency');
502
- const code = this.safeCurrencyCode(currencyId);
503
- result[code] = this.safeCurrencyStructure({
504
- 'id': currencyId,
505
- 'name': undefined,
506
- 'code': code,
507
- 'precision': undefined,
508
- 'active': undefined,
509
- 'fee': undefined,
510
- 'networks': undefined,
511
- 'deposit': undefined,
512
- 'withdraw': undefined,
513
- 'limits': {
514
- 'deposit': {
515
- 'min': undefined,
516
- 'max': undefined,
517
- },
518
- 'withdraw': {
519
- 'min': undefined,
520
- 'max': undefined,
521
- },
498
+ return this.parseCurrencies(currencies);
499
+ }
500
+ parseCurrency(rawCurrency) {
501
+ const currencyId = this.safeString(rawCurrency, 'currency');
502
+ const code = this.safeCurrencyCode(currencyId);
503
+ return this.safeCurrencyStructure({
504
+ 'id': currencyId,
505
+ 'name': undefined,
506
+ 'code': code,
507
+ 'precision': undefined,
508
+ 'active': undefined,
509
+ 'fee': undefined,
510
+ 'networks': undefined,
511
+ 'deposit': undefined,
512
+ 'withdraw': undefined,
513
+ 'limits': {
514
+ 'deposit': {
515
+ 'min': undefined,
516
+ 'max': undefined,
522
517
  },
523
- 'info': currency,
524
- });
525
- }
526
- return result;
518
+ 'withdraw': {
519
+ 'min': undefined,
520
+ 'max': undefined,
521
+ },
522
+ },
523
+ 'info': rawCurrency,
524
+ });
527
525
  }
528
526
  /**
529
527
  * @method
@@ -672,6 +670,8 @@ export default class derive extends Exchange {
672
670
  linear = true;
673
671
  inverse = false;
674
672
  }
673
+ const contractSize = (spot) ? undefined : 1;
674
+ const isContract = (swap || option);
675
675
  return this.safeMarketStructure({
676
676
  'id': marketId,
677
677
  'symbol': symbol,
@@ -688,10 +688,10 @@ export default class derive extends Exchange {
688
688
  'future': false,
689
689
  'option': option,
690
690
  'active': this.safeBool(market, 'is_active'),
691
- 'contract': (swap || option),
691
+ 'contract': isContract,
692
692
  'linear': linear,
693
693
  'inverse': inverse,
694
- 'contractSize': (spot) ? undefined : 1,
694
+ 'contractSize': contractSize,
695
695
  'expiry': expiry,
696
696
  'expiryDatetime': this.iso8601(expiry),
697
697
  'taker': this.safeNumber(market, 'taker_fee_rate'),
@@ -1817,7 +1817,7 @@ export default class derive extends Exchange {
1817
1817
  'gtc': 'GTC',
1818
1818
  'post_only': 'PO',
1819
1819
  };
1820
- return this.safeString(timeInForces, timeInForce, undefined);
1820
+ return this.safeString(timeInForces, timeInForce);
1821
1821
  }
1822
1822
  parseOrderStatus(status) {
1823
1823
  if (status !== undefined) {
@@ -14,6 +14,7 @@ export default class digifinex extends Exchange {
14
14
  * @returns {object} an associative dictionary of currencies
15
15
  */
16
16
  fetchCurrencies(params?: {}): Promise<Currencies>;
17
+ parseCurrency(rawCurrency: Dict): Currency;
17
18
  /**
18
19
  * @method
19
20
  * @name digifinex#fetchMarkets