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
@@ -1170,65 +1170,63 @@ class hashkey extends hashkey$1["default"] {
1170
1170
  // ]
1171
1171
  // }
1172
1172
  //
1173
- const result = {};
1174
- for (let i = 0; i < coins.length; i++) {
1175
- const currecy = coins[i];
1176
- const currencyId = this.safeString(currecy, 'coinId');
1177
- const code = this.safeCurrencyCode(currencyId);
1178
- const networks = this.safeList(currecy, 'chainTypes');
1179
- const parsedNetworks = {};
1180
- for (let j = 0; j < networks.length; j++) {
1181
- const network = networks[j];
1182
- const networkId = this.safeString(network, 'chainType');
1183
- const networkCode = this.networkCodeToId(networkId);
1184
- parsedNetworks[networkCode] = {
1185
- 'id': networkId,
1186
- 'network': networkCode,
1187
- 'limits': {
1188
- 'withdraw': {
1189
- 'min': this.safeNumber(network, 'minWithdrawQuantity'),
1190
- 'max': this.parseNumber(this.omitZero(this.safeString(network, 'maxWithdrawQuantity'))),
1191
- },
1192
- 'deposit': {
1193
- 'min': this.safeNumber(network, 'minDepositQuantity'),
1194
- 'max': undefined,
1195
- },
1196
- },
1197
- 'active': undefined,
1198
- 'deposit': this.safeBool(network, 'allowDeposit'),
1199
- 'withdraw': this.safeBool(network, 'allowWithdraw'),
1200
- 'fee': this.safeNumber(network, 'withdrawFee'),
1201
- 'precision': undefined,
1202
- 'info': network,
1203
- };
1204
- }
1205
- const rawType = this.safeString(currecy, 'tokenType');
1206
- const type = (rawType === 'REAL_MONEY') ? 'fiat' : 'crypto';
1207
- result[code] = this.safeCurrencyStructure({
1208
- 'id': currencyId,
1209
- 'code': code,
1210
- 'precision': undefined,
1211
- 'type': type,
1212
- 'name': this.safeString(currecy, 'coinFullName'),
1213
- 'active': undefined,
1214
- 'deposit': this.safeBool(currecy, 'allowDeposit'),
1215
- 'withdraw': this.safeBool(currecy, 'allowWithdraw'),
1216
- 'fee': undefined,
1173
+ return this.parseCurrencies(coins);
1174
+ }
1175
+ parseCurrency(rawCurrency) {
1176
+ const currencyId = this.safeString(rawCurrency, 'coinId');
1177
+ const code = this.safeCurrencyCode(currencyId);
1178
+ const networks = this.safeList(rawCurrency, 'chainTypes');
1179
+ const parsedNetworks = {};
1180
+ for (let j = 0; j < networks.length; j++) {
1181
+ const network = networks[j];
1182
+ const networkId = this.safeString(network, 'chainType');
1183
+ const networkCode = this.networkCodeToId(networkId, code);
1184
+ parsedNetworks[networkCode] = {
1185
+ 'id': networkId,
1186
+ 'network': networkCode,
1217
1187
  'limits': {
1218
- 'deposit': {
1219
- 'min': undefined,
1220
- 'max': undefined,
1221
- },
1222
1188
  'withdraw': {
1223
- 'min': undefined,
1189
+ 'min': this.safeNumber(network, 'minWithdrawQuantity'),
1190
+ 'max': this.parseNumber(this.omitZero(this.safeString(network, 'maxWithdrawQuantity'))),
1191
+ },
1192
+ 'deposit': {
1193
+ 'min': this.safeNumber(network, 'minDepositQuantity'),
1224
1194
  'max': undefined,
1225
1195
  },
1226
1196
  },
1227
- 'networks': parsedNetworks,
1228
- 'info': currecy,
1229
- });
1197
+ 'active': undefined,
1198
+ 'deposit': this.safeBool(network, 'allowDeposit'),
1199
+ 'withdraw': this.safeBool(network, 'allowWithdraw'),
1200
+ 'fee': this.safeNumber(network, 'withdrawFee'),
1201
+ 'precision': undefined,
1202
+ 'info': network,
1203
+ };
1230
1204
  }
1231
- return result;
1205
+ const rawType = this.safeString(rawCurrency, 'tokenType');
1206
+ const type = (rawType === 'REAL_MONEY') ? 'fiat' : 'crypto';
1207
+ return this.safeCurrencyStructure({
1208
+ 'id': currencyId,
1209
+ 'code': code,
1210
+ 'precision': undefined,
1211
+ 'type': type,
1212
+ 'name': this.safeString(rawCurrency, 'coinFullName'),
1213
+ 'active': undefined,
1214
+ 'deposit': this.safeBool(rawCurrency, 'allowDeposit'),
1215
+ 'withdraw': this.safeBool(rawCurrency, 'allowWithdraw'),
1216
+ 'fee': undefined,
1217
+ 'limits': {
1218
+ 'deposit': {
1219
+ 'min': undefined,
1220
+ 'max': undefined,
1221
+ },
1222
+ 'withdraw': {
1223
+ 'min': undefined,
1224
+ 'max': undefined,
1225
+ },
1226
+ },
1227
+ 'networks': parsedNetworks,
1228
+ 'info': rawCurrency,
1229
+ });
1232
1230
  }
1233
1231
  /**
1234
1232
  * @method
@@ -2054,7 +2052,7 @@ class hashkey extends hashkey$1["default"] {
2054
2052
  let networkCode = undefined;
2055
2053
  [networkCode, params] = this.handleNetworkCodeAndParams(params);
2056
2054
  if (networkCode !== undefined) {
2057
- request['chainType'] = this.networkCodeToId(networkCode);
2055
+ request['chainType'] = this.networkCodeToId(networkCode, currency['code']);
2058
2056
  }
2059
2057
  const response = await this.privatePostApiV1AccountWithdraw(this.extend(request, params));
2060
2058
  //
@@ -3048,7 +3046,7 @@ class hashkey extends hashkey$1["default"] {
3048
3046
  [marketType, params] = this.handleMarketTypeAndParams(methodName, market, params, marketType);
3049
3047
  let response = undefined;
3050
3048
  if (marketType === 'spot') {
3051
- response = await this.privateDeleteApiV1SpotCancelOrderByIds(this.extend(request));
3049
+ response = await this.privateDeleteApiV1SpotCancelOrderByIds(request);
3052
3050
  //
3053
3051
  // {
3054
3052
  // "code": "0000",
@@ -3057,7 +3055,7 @@ class hashkey extends hashkey$1["default"] {
3057
3055
  //
3058
3056
  }
3059
3057
  else if (marketType === 'swap') {
3060
- response = this.privateDeleteApiV1FuturesCancelOrderByIds(this.extend(request));
3058
+ response = await this.privateDeleteApiV1FuturesCancelOrderByIds(request);
3061
3059
  }
3062
3060
  else {
3063
3061
  throw new errors.NotSupported(this.id + ' ' + methodName + '() is not supported for ' + marketType + ' type of markets');
@@ -4338,8 +4336,8 @@ class hashkey extends hashkey$1["default"] {
4338
4336
  return undefined;
4339
4337
  }
4340
4338
  let errorInArray = false;
4341
- let responseCodeString = this.safeString(response, 'code', undefined);
4342
- const responseCodeInteger = this.safeInteger(response, 'code', undefined); // some codes in response are returned as '0000' others as 0
4339
+ let responseCodeString = this.safeString(response, 'code');
4340
+ const responseCodeInteger = this.safeInteger(response, 'code'); // some codes in response are returned as '0000' others as 0
4343
4341
  if (responseCodeInteger === 0) {
4344
4342
  const result = this.safeList(response, 'result', []); // for batch methods
4345
4343
  for (let i = 0; i < result.length; i++) {
@@ -750,7 +750,7 @@ class hibachi extends hibachi$1["default"] {
750
750
  * @method
751
751
  * @name hibachi#fetchTradingFees
752
752
  * @description fetch the trading fee
753
- * @param params extra parameters
753
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
754
754
  * @returns {object} a map of market symbols to [fee structures]{@link https://docs.ccxt.com/?id=fee-structure}
755
755
  */
756
756
  async fetchTradingFees(params = {}) {
@@ -973,7 +973,7 @@ class hitbtc extends hitbtc$1["default"] {
973
973
  for (let j = 0; j < rawNetworks.length; j++) {
974
974
  const rawNetwork = rawNetworks[j];
975
975
  const networkId = this.safeString2(rawNetwork, 'protocol', 'network');
976
- let networkCode = this.networkIdToCode(networkId);
976
+ let networkCode = this.networkIdToCode(networkId, code);
977
977
  networkCode = (networkCode !== undefined) ? networkCode.toUpperCase() : code; // as hitbtc is white label, ensure we safeguard from possible bugs
978
978
  networks[networkCode] = {
979
979
  'info': rawNetwork,
@@ -1012,17 +1012,6 @@ class hitbtc extends hitbtc$1["default"] {
1012
1012
  'type': undefined, // 'crypto' field emits incorrect values
1013
1013
  });
1014
1014
  }
1015
- addKeyInArrayItems(obj, keyName) {
1016
- const result = [];
1017
- const keys = Object.keys(obj);
1018
- for (let i = 0; i < keys.length; i++) {
1019
- const key = keys[i];
1020
- const item = obj[key];
1021
- item[keyName] = key;
1022
- result.push(item);
1023
- }
1024
- return result;
1025
- }
1026
1015
  /**
1027
1016
  * @method
1028
1017
  * @name hitbtc#createDepositAddress
@@ -3445,8 +3434,9 @@ class hitbtc extends hitbtc$1["default"] {
3445
3434
  // "positions": null
3446
3435
  // }
3447
3436
  //
3437
+ const parsedAmount = this.parseNumber(amount);
3448
3438
  return this.extend(this.parseMarginModification(response, market), {
3449
- 'amount': this.parseNumber(amount),
3439
+ 'amount': parsedAmount,
3450
3440
  'type': type,
3451
3441
  });
3452
3442
  }
@@ -3707,7 +3697,8 @@ class hitbtc extends hitbtc$1["default"] {
3707
3697
  for (let j = 0; j < networks.length; j++) {
3708
3698
  const networkEntry = networks[j];
3709
3699
  const networkId = this.safeString(networkEntry, 'network');
3710
- let networkCode = this.networkIdToCode(networkId);
3700
+ const code = this.safeString(currency, 'code');
3701
+ let networkCode = this.networkIdToCode(networkId, code);
3711
3702
  networkCode = (networkCode !== undefined) ? networkCode.toUpperCase() : undefined;
3712
3703
  const withdrawFee = this.safeNumber(networkEntry, 'payout_fee');
3713
3704
  const isDefault = this.safeValue(networkEntry, 'default');
@@ -491,66 +491,63 @@ class hollaex extends hollaex$1["default"] {
491
491
  // }
492
492
  //
493
493
  const coins = this.safeDict(response, 'coins', {});
494
- const keys = Object.keys(coins);
495
- const result = {};
496
- for (let i = 0; i < keys.length; i++) {
497
- const key = keys[i];
498
- const currency = coins[key];
499
- const id = this.safeString(currency, 'symbol');
500
- const code = this.safeCurrencyCode(id);
501
- const withdrawalLimits = this.safeList(currency, 'withdrawal_limits', []);
502
- const rawType = this.safeString(currency, 'type');
503
- const type = (rawType === 'blockchain') ? 'crypto' : 'other';
504
- const rawNetworks = this.safeDict(currency, 'withdrawal_fees', {});
505
- const networks = {};
506
- const networkIds = Object.keys(rawNetworks);
507
- for (let j = 0; j < networkIds.length; j++) {
508
- const networkId = networkIds[j];
509
- const networkEntry = this.safeDict(rawNetworks, networkId);
510
- const networkCode = this.networkIdToCode(networkId);
511
- networks[networkCode] = {
512
- 'id': networkId,
513
- 'network': networkCode,
514
- 'active': this.safeBool(networkEntry, 'active'),
515
- 'deposit': undefined,
516
- 'withdraw': undefined,
517
- 'fee': this.safeNumber(networkEntry, 'value'),
518
- 'precision': undefined,
519
- 'limits': {
520
- 'withdraw': {
521
- 'min': undefined,
522
- 'max': undefined,
523
- },
524
- },
525
- 'info': networkEntry,
526
- };
527
- }
528
- result[code] = this.safeCurrencyStructure({
529
- 'id': id,
530
- 'numericId': this.safeInteger(currency, 'id'),
531
- 'code': code,
532
- 'info': currency,
533
- 'name': this.safeString(currency, 'fullname'),
534
- 'active': this.safeBool(currency, 'active'),
535
- 'deposit': this.safeBool(currency, 'allow_deposit'),
536
- 'withdraw': this.safeBool(currency, 'allow_withdrawal'),
537
- 'fee': this.safeNumber(currency, 'withdrawal_fee'),
538
- 'precision': this.safeNumber(currency, 'increment_unit'),
494
+ const values = Object.values(coins);
495
+ return this.parseCurrencies(values);
496
+ }
497
+ parseCurrency(rawCurrency) {
498
+ const id = this.safeString(rawCurrency, 'symbol');
499
+ const code = this.safeCurrencyCode(id);
500
+ const withdrawalLimits = this.safeList(rawCurrency, 'withdrawal_limits', []);
501
+ const rawType = this.safeString(rawCurrency, 'type');
502
+ const type = (rawType === 'blockchain') ? 'crypto' : 'other';
503
+ const rawNetworks = this.safeDict(rawCurrency, 'withdrawal_fees', {});
504
+ const networks = {};
505
+ const networkIds = Object.keys(rawNetworks);
506
+ for (let j = 0; j < networkIds.length; j++) {
507
+ const networkId = networkIds[j];
508
+ const networkEntry = this.safeDict(rawNetworks, networkId);
509
+ const networkCode = this.networkIdToCode(networkId, code);
510
+ networks[networkCode] = {
511
+ 'id': networkId,
512
+ 'network': networkCode,
513
+ 'active': this.safeBool(networkEntry, 'active'),
514
+ 'deposit': undefined,
515
+ 'withdraw': undefined,
516
+ 'fee': this.safeNumber(networkEntry, 'value'),
517
+ 'precision': undefined,
539
518
  'limits': {
540
- 'amount': {
541
- 'min': this.safeNumber(currency, 'min'),
542
- 'max': this.safeNumber(currency, 'max'),
543
- },
544
519
  'withdraw': {
545
520
  'min': undefined,
546
- 'max': this.safeValue(withdrawalLimits, 0),
521
+ 'max': undefined,
547
522
  },
548
523
  },
549
- 'networks': networks,
550
- 'type': type,
551
- });
524
+ 'info': networkEntry,
525
+ };
552
526
  }
553
- return result;
527
+ return this.safeCurrencyStructure({
528
+ 'id': id,
529
+ 'numericId': this.safeInteger(rawCurrency, 'id'),
530
+ 'code': code,
531
+ 'info': rawCurrency,
532
+ 'name': this.safeString(rawCurrency, 'fullname'),
533
+ 'active': this.safeBool(rawCurrency, 'active'),
534
+ 'deposit': this.safeBool(rawCurrency, 'allow_deposit'),
535
+ 'withdraw': this.safeBool(rawCurrency, 'allow_withdrawal'),
536
+ 'fee': this.safeNumber(rawCurrency, 'withdrawal_fee'),
537
+ 'precision': this.safeNumber(rawCurrency, 'increment_unit'),
538
+ 'limits': {
539
+ 'amount': {
540
+ 'min': this.safeNumber(rawCurrency, 'min'),
541
+ 'max': this.safeNumber(rawCurrency, 'max'),
542
+ },
543
+ 'withdraw': {
544
+ 'min': undefined,
545
+ 'max': this.safeValue(withdrawalLimits, 0),
546
+ },
547
+ },
548
+ 'networks': networks,
549
+ 'type': type,
550
+ });
554
551
  }
555
552
  /**
556
553
  * @method
@@ -189,7 +189,7 @@ class htx extends htx$1["default"] {
189
189
  },
190
190
  'www': 'https://www.huobi.com',
191
191
  'referral': {
192
- 'url': 'https://www.htx.com.vc/invite/en-us/1h?invite_code=6rmm2223',
192
+ 'url': 'https://www.htx.com/invite/en-us/1h?invite_code=6rmm2223',
193
193
  'discount': 0.15,
194
194
  },
195
195
  'doc': [
@@ -1194,6 +1194,9 @@ class htx extends htx$1["default"] {
1194
1194
  // 'BCC': 'BCC', BCH's somewhat chain
1195
1195
  // 'DBC1': 'DBC1',
1196
1196
  },
1197
+ 'networksById': {
1198
+ 'MATIC': 'MATIC',
1199
+ },
1197
1200
  // https://github.com/ccxt/ccxt/issues/5376
1198
1201
  'fetchOrdersByStatesMethod': 'spot_private_get_v1_order_orders',
1199
1202
  'createMarketBuyOrderRequiresPrice': true,
@@ -3419,7 +3422,7 @@ class htx extends htx$1["default"] {
3419
3422
  for (let i = 0; i < accounts.length; i++) {
3420
3423
  const account = accounts[i];
3421
3424
  const info = this.safeValue(account, 'info');
3422
- const subtype = this.safeString(info, 'subtype', undefined);
3425
+ const subtype = this.safeString(info, 'subtype');
3423
3426
  const typeFromAccount = this.safeString(account, 'type');
3424
3427
  if (type === 'margin') {
3425
3428
  if (subtype === marketId) {
@@ -3480,75 +3483,79 @@ class htx extends htx$1["default"] {
3480
3483
  // }
3481
3484
  //
3482
3485
  const data = this.safeList(response, 'data', []);
3483
- const result = {};
3484
- this.options['networkChainIdsByNames'] = {};
3485
3486
  this.options['networkNamesByChainIds'] = {};
3486
- for (let i = 0; i < data.length; i++) {
3487
- const entry = data[i];
3488
- const currencyId = this.safeString(entry, 'currency');
3489
- const code = this.safeCurrencyCode(currencyId);
3490
- const assetType = this.safeString(entry, 'assetType');
3491
- const type = assetType === '1' ? 'crypto' : 'fiat';
3492
- this.options['networkChainIdsByNames'][code] = {};
3493
- const chains = this.safeList(entry, 'chains', []);
3494
- const networks = {};
3495
- for (let j = 0; j < chains.length; j++) {
3496
- const chainEntry = chains[j];
3497
- const uniqueChainId = this.safeString(chainEntry, 'chain'); // i.e. usdterc20, trc20usdt ...
3498
- const title = this.safeString2(chainEntry, 'baseChain', 'displayName'); // baseChain and baseChainProtocol are together existent or inexistent in entries, but baseChain is preferred. when they are both inexistent, then we use generic displayName
3499
- this.options['networkChainIdsByNames'][code][title] = uniqueChainId;
3500
- this.options['networkNamesByChainIds'][uniqueChainId] = title;
3501
- const networkCode = this.networkIdToCode(uniqueChainId);
3502
- networks[networkCode] = {
3503
- 'info': chainEntry,
3504
- 'id': uniqueChainId,
3505
- 'network': networkCode,
3506
- 'limits': {
3507
- 'deposit': {
3508
- 'min': this.safeNumber(chainEntry, 'minDepositAmt'),
3509
- 'max': undefined,
3510
- },
3511
- 'withdraw': {
3512
- 'min': this.safeNumber(chainEntry, 'minWithdrawAmt'),
3513
- 'max': this.safeNumber(chainEntry, 'maxWithdrawAmt'),
3514
- },
3515
- },
3516
- 'active': undefined,
3517
- 'deposit': this.safeString(chainEntry, 'depositStatus') === 'allowed',
3518
- 'withdraw': this.safeString(chainEntry, 'withdrawStatus') === 'allowed',
3519
- 'fee': this.safeNumber(chainEntry, 'transactFeeWithdraw'),
3520
- 'precision': this.parseNumber(this.parsePrecision(this.safeString(chainEntry, 'withdrawPrecision'))),
3521
- };
3522
- }
3523
- result[code] = this.safeCurrencyStructure({
3524
- 'info': entry,
3525
- 'code': code,
3526
- 'id': currencyId,
3527
- 'active': this.safeString(entry, 'instStatus') === 'normal',
3528
- 'deposit': undefined,
3529
- 'withdraw': undefined,
3530
- 'fee': undefined,
3531
- 'name': undefined,
3532
- 'type': type,
3487
+ this.options['networkChainIdsByNames'] = {};
3488
+ return this.parseCurrencies(data);
3489
+ }
3490
+ parseCurrency(rawCurrency) {
3491
+ if (!('networkNamesByChainIds' in this.options)) {
3492
+ this.options['networkNamesByChainIds'] = {};
3493
+ }
3494
+ if (!('networkChainIdsByNames' in this.options)) {
3495
+ this.options['networkChainIdsByNames'] = {};
3496
+ }
3497
+ const currencyId = this.safeString(rawCurrency, 'currency');
3498
+ const code = this.safeCurrencyCode(currencyId);
3499
+ const assetType = this.safeString(rawCurrency, 'assetType');
3500
+ const type = (assetType === '1') ? 'crypto' : 'fiat';
3501
+ this.options['networkChainIdsByNames'][code] = {};
3502
+ const chains = this.safeList(rawCurrency, 'chains', []);
3503
+ const networks = {};
3504
+ for (let j = 0; j < chains.length; j++) {
3505
+ const chainEntry = chains[j];
3506
+ const uniqueChainId = this.safeString(chainEntry, 'chain'); // i.e. usdterc20, trc20usdt ...
3507
+ const title = this.safeString2(chainEntry, 'baseChain', 'displayName'); // baseChain and baseChainProtocol are together existent or inexistent in entries, but baseChain is preferred. when they are both inexistent, then we use generic displayName
3508
+ this.options['networkChainIdsByNames'][code][title] = uniqueChainId;
3509
+ this.options['networkNamesByChainIds'][uniqueChainId] = title;
3510
+ const networkCode = this.networkIdToCode(uniqueChainId, code);
3511
+ networks[networkCode] = {
3512
+ 'info': chainEntry,
3513
+ 'id': uniqueChainId,
3514
+ 'network': networkCode,
3533
3515
  'limits': {
3534
- 'amount': {
3535
- 'min': undefined,
3516
+ 'deposit': {
3517
+ 'min': this.safeNumber(chainEntry, 'minDepositAmt'),
3536
3518
  'max': undefined,
3537
3519
  },
3538
3520
  'withdraw': {
3539
- 'min': undefined,
3540
- 'max': undefined,
3541
- },
3542
- 'deposit': {
3543
- 'min': undefined,
3544
- 'max': undefined,
3521
+ 'min': this.safeNumber(chainEntry, 'minWithdrawAmt'),
3522
+ 'max': this.safeNumber(chainEntry, 'maxWithdrawAmt'),
3545
3523
  },
3546
3524
  },
3547
- 'precision': undefined,
3548
- 'networks': networks,
3549
- });
3525
+ 'active': undefined,
3526
+ 'deposit': this.safeString(chainEntry, 'depositStatus') === 'allowed',
3527
+ 'withdraw': this.safeString(chainEntry, 'withdrawStatus') === 'allowed',
3528
+ 'fee': this.safeNumber(chainEntry, 'transactFeeWithdraw'),
3529
+ 'precision': this.parseNumber(this.parsePrecision(this.safeString(chainEntry, 'withdrawPrecision'))),
3530
+ };
3550
3531
  }
3551
- return result;
3532
+ return this.safeCurrencyStructure({
3533
+ 'info': rawCurrency,
3534
+ 'code': code,
3535
+ 'id': currencyId,
3536
+ 'active': this.safeString(rawCurrency, 'instStatus') === 'normal',
3537
+ 'deposit': undefined,
3538
+ 'withdraw': undefined,
3539
+ 'fee': undefined,
3540
+ 'name': undefined,
3541
+ 'type': type,
3542
+ 'limits': {
3543
+ 'amount': {
3544
+ 'min': undefined,
3545
+ 'max': undefined,
3546
+ },
3547
+ 'withdraw': {
3548
+ 'min': undefined,
3549
+ 'max': undefined,
3550
+ },
3551
+ 'deposit': {
3552
+ 'min': undefined,
3553
+ 'max': undefined,
3554
+ },
3555
+ },
3556
+ 'precision': undefined,
3557
+ 'networks': networks,
3558
+ });
3552
3559
  }
3553
3560
  networkIdToCode(networkId = undefined, currencyCode = undefined) {
3554
3561
  // here network-id is provided as a pair of currency & chain (i.e. trc20usdt)
@@ -3558,7 +3565,7 @@ class htx extends htx$1["default"] {
3558
3565
  throw new errors.ExchangeError(this.id + ' networkIdToCode() - markets need to be loaded at first');
3559
3566
  }
3560
3567
  const networkTitle = this.safeValue(this.options['networkNamesByChainIds'], networkId, networkId);
3561
- return super.networkIdToCode(networkTitle);
3568
+ return super.networkIdToCode(networkTitle, currencyCode);
3562
3569
  }
3563
3570
  networkCodeToId(networkCode, currencyCode = undefined) {
3564
3571
  if (currencyCode === undefined) {
@@ -3574,7 +3581,7 @@ class htx extends htx$1["default"] {
3574
3581
  return uniqueNetworkIds[networkCode];
3575
3582
  }
3576
3583
  else {
3577
- const networkTitle = super.networkCodeToId(networkCode);
3584
+ const networkTitle = super.networkCodeToId(networkCode, currencyCode);
3578
3585
  return this.safeValue(uniqueNetworkIds, networkTitle, networkTitle);
3579
3586
  }
3580
3587
  }
@@ -3852,7 +3859,8 @@ class htx extends htx$1["default"] {
3852
3859
  // "ts": 1770293281344
3853
3860
  // }
3854
3861
  //
3855
- let result = { 'info': response };
3862
+ const finalResponse = response;
3863
+ let result = { 'info': finalResponse };
3856
3864
  const data = this.safeValue(response, 'data');
3857
3865
  if (isMultiAssetMode) {
3858
3866
  const details = this.safeList(data, 'details', []);
@@ -6598,7 +6606,7 @@ class htx extends htx$1["default"] {
6598
6606
  'currency': code,
6599
6607
  'address': address,
6600
6608
  'tag': tag,
6601
- 'network': this.networkIdToCode(networkId),
6609
+ 'network': this.networkIdToCode(networkId, code),
6602
6610
  'note': note,
6603
6611
  'info': depositAddress,
6604
6612
  };
@@ -6879,7 +6887,7 @@ class htx extends htx$1["default"] {
6879
6887
  'txid': txHash,
6880
6888
  'timestamp': timestamp,
6881
6889
  'datetime': this.iso8601(timestamp),
6882
- 'network': this.networkIdToCode(networkId),
6890
+ 'network': this.networkIdToCode(networkId, code),
6883
6891
  'address': this.safeString(transaction, 'address'),
6884
6892
  'addressTo': undefined,
6885
6893
  'addressFrom': undefined,
@@ -7587,7 +7595,8 @@ class htx extends htx$1["default"] {
7587
7595
  const sortedRequest = this.keysort(request);
7588
7596
  let auth = this.urlencode(sortedRequest, true); // true is a go only requirment
7589
7597
  // unfortunately, PHP demands double quotes for the escaped newline symbol
7590
- const payload = [method, this.hostname, url, auth].join("\n"); // eslint-disable-line quotes
7598
+ const content = [method, this.hostname, url, auth];
7599
+ const payload = content.join("\n"); // eslint-disable-line quotes
7591
7600
  const signature = this.hmac(this.encode(payload), this.encode(this.secret), sha256.sha256, 'base64');
7592
7601
  auth += '&' + this.urlencode({ 'Signature': signature });
7593
7602
  url += '?' + auth;
@@ -7669,7 +7678,8 @@ class htx extends htx$1["default"] {
7669
7678
  }
7670
7679
  let auth = this.urlencode(request, true).replace('%2c', '%2C'); // in c# it manually needs to be uppercased
7671
7680
  // unfortunately, PHP demands double quotes for the escaped newline symbol
7672
- const payload = [method, hostname, url, auth].join("\n"); // eslint-disable-line quotes
7681
+ const content2 = [method, hostname, url, auth];
7682
+ const payload = content2.join("\n"); // eslint-disable-line quotes
7673
7683
  const signature = this.hmac(this.encode(payload), this.encode(this.secret), sha256.sha256, 'base64');
7674
7684
  auth += '&' + this.urlencode({ 'Signature': signature });
7675
7685
  url += '?' + auth;
@@ -7688,8 +7698,9 @@ class htx extends htx$1["default"] {
7688
7698
  };
7689
7699
  }
7690
7700
  }
7701
+ const finalHostname = hostname; // java req
7691
7702
  url = this.implodeParams(this.urls['api'][type], {
7692
- 'hostname': hostname,
7703
+ 'hostname': finalHostname,
7693
7704
  }) + url;
7694
7705
  }
7695
7706
  return { 'url': url, 'method': method, 'body': body, 'headers': headers };
@@ -9410,12 +9421,13 @@ class htx extends htx$1["default"] {
9410
9421
  // }
9411
9422
  //
9412
9423
  const chains = this.safeValue(fee, 'chains', []);
9424
+ const code = this.safeString(currency, 'code');
9413
9425
  let result = this.depositWithdrawFee(fee);
9414
9426
  for (let j = 0; j < chains.length; j++) {
9415
9427
  const chainEntry = chains[j];
9416
9428
  const networkId = this.safeString(chainEntry, 'chain');
9417
9429
  const withdrawFeeType = this.safeString(chainEntry, 'withdrawFeeType');
9418
- const networkCode = this.networkIdToCode(networkId);
9430
+ const networkCode = this.networkIdToCode(networkId, code);
9419
9431
  let withdrawFee = undefined;
9420
9432
  let withdrawResult = undefined;
9421
9433
  if (withdrawFeeType === 'fixed') {