ccxt 4.5.60 → 4.5.61

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 (521) hide show
  1. package/README.md +46 -45
  2. package/dist/ccxt.browser.min.js +4 -4
  3. package/dist/cjs/ccxt.js +6 -2
  4. package/dist/cjs/src/aftermath.js +1 -1
  5. package/dist/cjs/src/apex.js +2 -2
  6. package/dist/cjs/src/ascendex.js +1 -1
  7. package/dist/cjs/src/aster.js +3 -4
  8. package/dist/cjs/src/backpack.js +1 -1
  9. package/dist/cjs/src/base/Exchange.js +6 -38
  10. package/dist/cjs/src/base/functions/crypto.js +72 -15
  11. package/dist/cjs/src/base/functions/rsa.js +25 -10
  12. package/dist/cjs/src/base/functions.js +1 -0
  13. package/dist/cjs/src/bequant.js +1 -1
  14. package/dist/cjs/src/bigone.js +1 -1
  15. package/dist/cjs/src/binance.js +1 -1
  16. package/dist/cjs/src/bingx.js +1 -1
  17. package/dist/cjs/src/bit2c.js +1 -1
  18. package/dist/cjs/src/bitbank.js +1 -1
  19. package/dist/cjs/src/bitbns.js +1 -1
  20. package/dist/cjs/src/bitfinex.js +5 -5
  21. package/dist/cjs/src/bitflyer.js +1 -1
  22. package/dist/cjs/src/bitget.js +2 -2
  23. package/dist/cjs/src/bithumb.js +1 -1
  24. package/dist/cjs/src/bitmart.js +2 -2
  25. package/dist/cjs/src/bitmex.js +2 -2
  26. package/dist/cjs/src/bitopro.js +1 -1
  27. package/dist/cjs/src/bitrue.js +1 -1
  28. package/dist/cjs/src/bitso.js +2 -2
  29. package/dist/cjs/src/bitstamp.js +1 -1
  30. package/dist/cjs/src/bittrade.js +2 -2
  31. package/dist/cjs/src/bitvavo.js +1 -1
  32. package/dist/cjs/src/blockchaincom.js +1 -1
  33. package/dist/cjs/src/blofin.js +3 -4
  34. package/dist/cjs/src/btcbox.js +1 -1
  35. package/dist/cjs/src/btcmarkets.js +1 -1
  36. package/dist/cjs/src/btcturk.js +1 -1
  37. package/dist/cjs/src/bullish.js +1 -1
  38. package/dist/cjs/src/bybit.js +1 -1
  39. package/dist/cjs/src/bydfi.js +1 -1
  40. package/dist/cjs/src/cex.js +2 -2
  41. package/dist/cjs/src/coinbase.js +1 -1
  42. package/dist/cjs/src/coinbaseexchange.js +2 -2
  43. package/dist/cjs/src/coincheck.js +2 -2
  44. package/dist/cjs/src/coinex.js +1 -1
  45. package/dist/cjs/src/coinmate.js +1 -1
  46. package/dist/cjs/src/coinmetro.js +1 -1
  47. package/dist/cjs/src/coinone.js +1 -1
  48. package/dist/cjs/src/coinsph.js +1 -1
  49. package/dist/cjs/src/coinspot.js +1 -1
  50. package/dist/cjs/src/cryptocom.js +1 -1
  51. package/dist/cjs/src/cryptomus.js +2 -2
  52. package/dist/cjs/src/deepcoin.js +1 -1
  53. package/dist/cjs/src/delta.js +1 -1
  54. package/dist/cjs/src/deribit.js +1 -1
  55. package/dist/cjs/src/derive.js +2 -3
  56. package/dist/cjs/src/digifinex.js +1 -1
  57. package/dist/cjs/src/dydx.js +2 -2
  58. package/dist/cjs/src/exmo.js +1 -1
  59. package/dist/cjs/src/extended.js +3 -3
  60. package/dist/cjs/src/foxbit.js +1 -1
  61. package/dist/cjs/src/gate.js +2 -2
  62. package/dist/cjs/src/gateeu.js +60 -0
  63. package/dist/cjs/src/gemini.js +1 -1
  64. package/dist/cjs/src/grvt.js +1 -1
  65. package/dist/cjs/src/hashkey.js +2 -2
  66. package/dist/cjs/src/hibachi.js +1 -1
  67. package/dist/cjs/src/hitbtc.js +1 -1
  68. package/dist/cjs/src/hollaex.js +1 -1
  69. package/dist/cjs/src/htx.js +1 -1
  70. package/dist/cjs/src/hyperliquid.js +1 -1
  71. package/dist/cjs/src/independentreserve.js +1 -1
  72. package/dist/cjs/src/indodax.js +1 -1
  73. package/dist/cjs/src/kraken.js +1 -1
  74. package/dist/cjs/src/kucoin.js +1 -1
  75. package/dist/cjs/src/latoken.js +1 -1
  76. package/dist/cjs/src/lbank.js +1 -1
  77. package/dist/cjs/src/lighter.js +1 -1
  78. package/dist/cjs/src/luno.js +2 -2
  79. package/dist/cjs/src/mercado.js +1 -1
  80. package/dist/cjs/src/mexc.js +1 -1
  81. package/dist/cjs/src/modetrade.js +3 -5
  82. package/dist/cjs/src/ndax.js +1 -1
  83. package/dist/cjs/src/novadax.js +1 -1
  84. package/dist/cjs/src/okx.js +1 -1
  85. package/dist/cjs/src/onetrading.js +2 -2
  86. package/dist/cjs/src/p2b.js +2 -3
  87. package/dist/cjs/src/pacifica.js +2 -2
  88. package/dist/cjs/src/paradex.js +1 -1
  89. package/dist/cjs/src/paymium.js +1 -1
  90. package/dist/cjs/src/phemex.js +1 -1
  91. package/dist/cjs/src/poloniex.js +1 -1
  92. package/dist/cjs/src/pro/aftermath.js +1 -1
  93. package/dist/cjs/src/pro/alpaca.js +1 -1
  94. package/dist/cjs/src/pro/apex.js +2 -2
  95. package/dist/cjs/src/pro/ascendex.js +1 -1
  96. package/dist/cjs/src/pro/aster.js +4 -4
  97. package/dist/cjs/src/pro/backpack.js +4 -4
  98. package/dist/cjs/src/pro/binance.js +5 -5
  99. package/dist/cjs/src/pro/bingx.js +2 -2
  100. package/dist/cjs/src/pro/bitfinex.js +1 -1
  101. package/dist/cjs/src/pro/bitget.js +4 -4
  102. package/dist/cjs/src/pro/bitmart.js +4 -4
  103. package/dist/cjs/src/pro/bitmex.js +2 -2
  104. package/dist/cjs/src/pro/bitopro.js +1 -1
  105. package/dist/cjs/src/pro/bitstamp.js +1 -1
  106. package/dist/cjs/src/pro/bittrade.js +1 -1
  107. package/dist/cjs/src/pro/bitvavo.js +1 -1
  108. package/dist/cjs/src/pro/blockchaincom.js +1 -1
  109. package/dist/cjs/src/pro/blofin.js +2 -2
  110. package/dist/cjs/src/pro/bullish.js +1 -1
  111. package/dist/cjs/src/pro/bybit.js +4 -4
  112. package/dist/cjs/src/pro/bydfi.js +4 -4
  113. package/dist/cjs/src/pro/cex.js +1 -1
  114. package/dist/cjs/src/pro/coinbase.js +3 -3
  115. package/dist/cjs/src/pro/coinbaseexchange.js +2 -2
  116. package/dist/cjs/src/pro/coinbaseinternational.js +2 -2
  117. package/dist/cjs/src/pro/coincheck.js +1 -1
  118. package/dist/cjs/src/pro/coinex.js +2 -2
  119. package/dist/cjs/src/pro/coinone.js +1 -1
  120. package/dist/cjs/src/pro/cryptocom.js +4 -4
  121. package/dist/cjs/src/pro/deepcoin.js +2 -2
  122. package/dist/cjs/src/pro/deribit.js +2 -2
  123. package/dist/cjs/src/pro/derive.js +2 -2
  124. package/dist/cjs/src/pro/dydx.js +2 -2
  125. package/dist/cjs/src/pro/exmo.js +1 -1
  126. package/dist/cjs/src/pro/extended.js +1 -1
  127. package/dist/cjs/src/pro/gate.js +46 -15
  128. package/dist/cjs/src/pro/gateeu.js +32 -0
  129. package/dist/cjs/src/pro/gemini.js +2 -3
  130. package/dist/cjs/src/pro/grvt.js +2 -2
  131. package/dist/cjs/src/pro/hashkey.js +1 -1
  132. package/dist/cjs/src/pro/hitbtc.js +1 -1
  133. package/dist/cjs/src/pro/hollaex.js +1 -1
  134. package/dist/cjs/src/pro/htx.js +2 -2
  135. package/dist/cjs/src/pro/hyperliquid.js +2 -2
  136. package/dist/cjs/src/pro/independentreserve.js +1 -1
  137. package/dist/cjs/src/pro/kraken.js +2 -2
  138. package/dist/cjs/src/pro/krakenfutures.js +2 -2
  139. package/dist/cjs/src/pro/kucoin.js +4 -4
  140. package/dist/cjs/src/pro/lighter.js +2 -2
  141. package/dist/cjs/src/pro/luno.js +1 -1
  142. package/dist/cjs/src/pro/mexc.js +2 -2
  143. package/dist/cjs/src/pro/modetrade.js +1 -1
  144. package/dist/cjs/src/pro/ndax.js +1 -1
  145. package/dist/cjs/src/pro/okx.js +4 -4
  146. package/dist/cjs/src/pro/onetrading.js +1 -1
  147. package/dist/cjs/src/pro/p2b.js +1 -1
  148. package/dist/cjs/src/pro/pacifica.js +2 -2
  149. package/dist/cjs/src/pro/paradex.js +1 -1
  150. package/dist/cjs/src/pro/phemex.js +1 -1
  151. package/dist/cjs/src/pro/poloniex.js +1 -1
  152. package/dist/cjs/src/pro/toobit.js +2 -2
  153. package/dist/cjs/src/pro/upbit.js +1 -1
  154. package/dist/cjs/src/pro/weex.js +4 -4
  155. package/dist/cjs/src/pro/whitebit.js +1 -1
  156. package/dist/cjs/src/pro/woo.js +2 -2
  157. package/dist/cjs/src/pro/woofipro.js +1 -1
  158. package/dist/cjs/src/tokocrypto.js +1 -1
  159. package/dist/cjs/src/toobit.js +2 -2
  160. package/dist/cjs/src/upbit.js +1 -1
  161. package/dist/cjs/src/weex.js +2 -2
  162. package/dist/cjs/src/whitebit.js +1 -1
  163. package/dist/cjs/src/woo.js +1 -1
  164. package/dist/cjs/src/woofipro.js +2 -4
  165. package/dist/cjs/src/xt.js +1 -1
  166. package/dist/cjs/src/zaif.js +2 -2
  167. package/dist/cjs/src/zebpay.js +2 -2
  168. package/js/ccxt.d.ts +8 -2
  169. package/js/ccxt.js +6 -3
  170. package/js/src/abstract/gateeu.d.ts +346 -0
  171. package/js/src/{static_dependencies/jsencrypt/index.js → abstract/gateeu.js} +5 -3
  172. package/js/src/aftermath.d.ts +1 -1
  173. package/js/src/aftermath.js +1 -1
  174. package/js/src/apex.d.ts +1 -1
  175. package/js/src/apex.js +2 -2
  176. package/js/src/ascendex.d.ts +1 -1
  177. package/js/src/ascendex.js +1 -1
  178. package/js/src/aster.d.ts +1 -1
  179. package/js/src/aster.js +3 -4
  180. package/js/src/backpack.js +1 -1
  181. package/js/src/base/Exchange.d.ts +1 -1
  182. package/js/src/base/Exchange.js +6 -38
  183. package/js/src/base/functions/crypto.d.ts +2 -1
  184. package/js/src/base/functions/crypto.js +72 -16
  185. package/js/src/base/functions/rsa.js +18 -7
  186. package/js/src/bequant.js +1 -1
  187. package/js/src/bigone.d.ts +1 -1
  188. package/js/src/bigone.js +1 -1
  189. package/js/src/binance.d.ts +1 -1
  190. package/js/src/binance.js +1 -1
  191. package/js/src/bingx.d.ts +1 -1
  192. package/js/src/bingx.js +1 -1
  193. package/js/src/bit2c.d.ts +1 -1
  194. package/js/src/bit2c.js +1 -1
  195. package/js/src/bitbank.d.ts +1 -1
  196. package/js/src/bitbank.js +1 -1
  197. package/js/src/bitbns.d.ts +1 -1
  198. package/js/src/bitbns.js +1 -1
  199. package/js/src/bitfinex.d.ts +1 -1
  200. package/js/src/bitfinex.js +5 -5
  201. package/js/src/bitflyer.d.ts +1 -1
  202. package/js/src/bitflyer.js +1 -1
  203. package/js/src/bitget.d.ts +1 -1
  204. package/js/src/bitget.js +2 -2
  205. package/js/src/bithumb.d.ts +1 -1
  206. package/js/src/bithumb.js +1 -1
  207. package/js/src/bitmart.d.ts +1 -1
  208. package/js/src/bitmart.js +2 -2
  209. package/js/src/bitmex.d.ts +1 -1
  210. package/js/src/bitmex.js +2 -2
  211. package/js/src/bitopro.d.ts +1 -1
  212. package/js/src/bitopro.js +1 -1
  213. package/js/src/bitrue.d.ts +1 -1
  214. package/js/src/bitrue.js +1 -1
  215. package/js/src/bitso.d.ts +1 -1
  216. package/js/src/bitso.js +2 -2
  217. package/js/src/bitstamp.d.ts +1 -1
  218. package/js/src/bitstamp.js +1 -1
  219. package/js/src/bittrade.d.ts +1 -1
  220. package/js/src/bittrade.js +2 -2
  221. package/js/src/bitvavo.d.ts +1 -1
  222. package/js/src/bitvavo.js +1 -1
  223. package/js/src/blockchaincom.d.ts +1 -1
  224. package/js/src/blockchaincom.js +1 -1
  225. package/js/src/blofin.d.ts +1 -1
  226. package/js/src/blofin.js +3 -4
  227. package/js/src/btcbox.d.ts +1 -1
  228. package/js/src/btcbox.js +1 -1
  229. package/js/src/btcmarkets.d.ts +1 -1
  230. package/js/src/btcmarkets.js +1 -1
  231. package/js/src/btcturk.d.ts +1 -1
  232. package/js/src/btcturk.js +1 -1
  233. package/js/src/bullish.d.ts +1 -1
  234. package/js/src/bullish.js +1 -1
  235. package/js/src/bybit.d.ts +1 -1
  236. package/js/src/bybit.js +1 -1
  237. package/js/src/bydfi.js +1 -1
  238. package/js/src/cex.d.ts +1 -1
  239. package/js/src/cex.js +2 -2
  240. package/js/src/coinbase.d.ts +1 -1
  241. package/js/src/coinbase.js +1 -1
  242. package/js/src/coinbaseexchange.d.ts +1 -1
  243. package/js/src/coinbaseexchange.js +2 -2
  244. package/js/src/coincheck.d.ts +1 -1
  245. package/js/src/coincheck.js +2 -2
  246. package/js/src/coinex.d.ts +1 -1
  247. package/js/src/coinex.js +1 -1
  248. package/js/src/coinmate.d.ts +1 -1
  249. package/js/src/coinmate.js +1 -1
  250. package/js/src/coinmetro.d.ts +1 -1
  251. package/js/src/coinmetro.js +1 -1
  252. package/js/src/coinone.d.ts +1 -1
  253. package/js/src/coinone.js +1 -1
  254. package/js/src/coinsph.d.ts +1 -1
  255. package/js/src/coinsph.js +1 -1
  256. package/js/src/coinspot.d.ts +1 -1
  257. package/js/src/coinspot.js +1 -1
  258. package/js/src/cryptocom.d.ts +1 -1
  259. package/js/src/cryptocom.js +1 -1
  260. package/js/src/cryptomus.d.ts +1 -1
  261. package/js/src/cryptomus.js +2 -2
  262. package/js/src/deepcoin.d.ts +1 -1
  263. package/js/src/deepcoin.js +1 -1
  264. package/js/src/delta.d.ts +1 -1
  265. package/js/src/delta.js +1 -1
  266. package/js/src/deribit.d.ts +1 -1
  267. package/js/src/deribit.js +1 -1
  268. package/js/src/derive.js +2 -3
  269. package/js/src/digifinex.d.ts +1 -1
  270. package/js/src/digifinex.js +1 -1
  271. package/js/src/dydx.d.ts +1 -1
  272. package/js/src/dydx.js +2 -2
  273. package/js/src/exmo.d.ts +1 -1
  274. package/js/src/exmo.js +1 -1
  275. package/js/src/extended.d.ts +1 -1
  276. package/js/src/extended.js +3 -3
  277. package/js/src/foxbit.d.ts +1 -1
  278. package/js/src/foxbit.js +1 -1
  279. package/js/src/gate.d.ts +1 -1
  280. package/js/src/gate.js +2 -2
  281. package/js/src/gateeu.d.ts +4 -0
  282. package/js/src/gateeu.js +59 -0
  283. package/js/src/gemini.d.ts +1 -1
  284. package/js/src/gemini.js +1 -1
  285. package/js/src/grvt.js +1 -1
  286. package/js/src/hashkey.d.ts +1 -1
  287. package/js/src/hashkey.js +2 -2
  288. package/js/src/hibachi.js +1 -1
  289. package/js/src/hitbtc.d.ts +1 -1
  290. package/js/src/hitbtc.js +1 -1
  291. package/js/src/hollaex.d.ts +1 -1
  292. package/js/src/hollaex.js +1 -1
  293. package/js/src/htx.d.ts +1 -1
  294. package/js/src/htx.js +1 -1
  295. package/js/src/hyperliquid.d.ts +1 -1
  296. package/js/src/hyperliquid.js +1 -1
  297. package/js/src/independentreserve.d.ts +1 -1
  298. package/js/src/independentreserve.js +1 -1
  299. package/js/src/indodax.d.ts +1 -1
  300. package/js/src/indodax.js +1 -1
  301. package/js/src/kraken.d.ts +1 -1
  302. package/js/src/kraken.js +1 -1
  303. package/js/src/kucoin.d.ts +1 -1
  304. package/js/src/kucoin.js +1 -1
  305. package/js/src/latoken.d.ts +1 -1
  306. package/js/src/latoken.js +1 -1
  307. package/js/src/lbank.d.ts +1 -1
  308. package/js/src/lbank.js +1 -1
  309. package/js/src/lighter.d.ts +1 -1
  310. package/js/src/lighter.js +1 -1
  311. package/js/src/luno.d.ts +1 -1
  312. package/js/src/luno.js +2 -2
  313. package/js/src/mercado.d.ts +1 -1
  314. package/js/src/mercado.js +1 -1
  315. package/js/src/mexc.d.ts +1 -1
  316. package/js/src/mexc.js +1 -1
  317. package/js/src/modetrade.d.ts +1 -1
  318. package/js/src/modetrade.js +3 -5
  319. package/js/src/ndax.d.ts +1 -1
  320. package/js/src/ndax.js +1 -1
  321. package/js/src/novadax.d.ts +1 -1
  322. package/js/src/novadax.js +1 -1
  323. package/js/src/okx.d.ts +1 -1
  324. package/js/src/okx.js +1 -1
  325. package/js/src/onetrading.d.ts +1 -1
  326. package/js/src/onetrading.js +2 -2
  327. package/js/src/p2b.d.ts +1 -1
  328. package/js/src/p2b.js +2 -3
  329. package/js/src/pacifica.d.ts +1 -1
  330. package/js/src/pacifica.js +2 -2
  331. package/js/src/paradex.d.ts +1 -1
  332. package/js/src/paradex.js +1 -1
  333. package/js/src/paymium.d.ts +1 -1
  334. package/js/src/paymium.js +1 -1
  335. package/js/src/phemex.d.ts +1 -1
  336. package/js/src/phemex.js +1 -1
  337. package/js/src/poloniex.d.ts +1 -1
  338. package/js/src/poloniex.js +1 -1
  339. package/js/src/pro/aftermath.d.ts +1 -1
  340. package/js/src/pro/aftermath.js +1 -1
  341. package/js/src/pro/alpaca.d.ts +1 -1
  342. package/js/src/pro/alpaca.js +1 -1
  343. package/js/src/pro/apex.d.ts +2 -2
  344. package/js/src/pro/apex.js +2 -2
  345. package/js/src/pro/ascendex.d.ts +1 -1
  346. package/js/src/pro/ascendex.js +1 -1
  347. package/js/src/pro/aster.d.ts +4 -4
  348. package/js/src/pro/aster.js +4 -4
  349. package/js/src/pro/backpack.d.ts +4 -4
  350. package/js/src/pro/backpack.js +4 -4
  351. package/js/src/pro/binance.d.ts +5 -5
  352. package/js/src/pro/binance.js +5 -5
  353. package/js/src/pro/bingx.d.ts +2 -2
  354. package/js/src/pro/bingx.js +2 -2
  355. package/js/src/pro/bitfinex.d.ts +1 -1
  356. package/js/src/pro/bitfinex.js +1 -1
  357. package/js/src/pro/bitget.d.ts +4 -4
  358. package/js/src/pro/bitget.js +4 -4
  359. package/js/src/pro/bitmart.d.ts +4 -4
  360. package/js/src/pro/bitmart.js +4 -4
  361. package/js/src/pro/bitmex.d.ts +2 -2
  362. package/js/src/pro/bitmex.js +2 -2
  363. package/js/src/pro/bitopro.d.ts +1 -1
  364. package/js/src/pro/bitopro.js +1 -1
  365. package/js/src/pro/bitstamp.d.ts +1 -1
  366. package/js/src/pro/bitstamp.js +1 -1
  367. package/js/src/pro/bittrade.d.ts +1 -1
  368. package/js/src/pro/bittrade.js +1 -1
  369. package/js/src/pro/bitvavo.d.ts +1 -1
  370. package/js/src/pro/bitvavo.js +1 -1
  371. package/js/src/pro/blockchaincom.d.ts +1 -1
  372. package/js/src/pro/blockchaincom.js +1 -1
  373. package/js/src/pro/blofin.d.ts +2 -2
  374. package/js/src/pro/blofin.js +2 -2
  375. package/js/src/pro/bullish.d.ts +1 -1
  376. package/js/src/pro/bullish.js +1 -1
  377. package/js/src/pro/bybit.d.ts +4 -4
  378. package/js/src/pro/bybit.js +4 -4
  379. package/js/src/pro/bydfi.d.ts +4 -4
  380. package/js/src/pro/bydfi.js +4 -4
  381. package/js/src/pro/cex.d.ts +1 -1
  382. package/js/src/pro/cex.js +1 -1
  383. package/js/src/pro/coinbase.d.ts +3 -3
  384. package/js/src/pro/coinbase.js +3 -3
  385. package/js/src/pro/coinbaseexchange.d.ts +2 -2
  386. package/js/src/pro/coinbaseexchange.js +2 -2
  387. package/js/src/pro/coinbaseinternational.d.ts +2 -2
  388. package/js/src/pro/coinbaseinternational.js +2 -2
  389. package/js/src/pro/coincheck.d.ts +1 -1
  390. package/js/src/pro/coincheck.js +1 -1
  391. package/js/src/pro/coinex.d.ts +2 -2
  392. package/js/src/pro/coinex.js +2 -2
  393. package/js/src/pro/coinone.d.ts +1 -1
  394. package/js/src/pro/coinone.js +1 -1
  395. package/js/src/pro/cryptocom.d.ts +4 -4
  396. package/js/src/pro/cryptocom.js +4 -4
  397. package/js/src/pro/deepcoin.d.ts +2 -2
  398. package/js/src/pro/deepcoin.js +2 -2
  399. package/js/src/pro/deribit.d.ts +2 -2
  400. package/js/src/pro/deribit.js +2 -2
  401. package/js/src/pro/derive.d.ts +2 -2
  402. package/js/src/pro/derive.js +2 -2
  403. package/js/src/pro/dydx.d.ts +2 -2
  404. package/js/src/pro/dydx.js +2 -2
  405. package/js/src/pro/exmo.d.ts +1 -1
  406. package/js/src/pro/exmo.js +1 -1
  407. package/js/src/pro/extended.d.ts +1 -1
  408. package/js/src/pro/extended.js +1 -1
  409. package/js/src/pro/gate.d.ts +3 -2
  410. package/js/src/pro/gate.js +46 -15
  411. package/js/src/pro/gateeu.d.ts +4 -0
  412. package/js/src/pro/gateeu.js +31 -0
  413. package/js/src/pro/gemini.d.ts +2 -2
  414. package/js/src/pro/gemini.js +2 -3
  415. package/js/src/pro/grvt.d.ts +2 -2
  416. package/js/src/pro/grvt.js +2 -2
  417. package/js/src/pro/hashkey.d.ts +1 -1
  418. package/js/src/pro/hashkey.js +1 -1
  419. package/js/src/pro/hitbtc.d.ts +1 -1
  420. package/js/src/pro/hitbtc.js +1 -1
  421. package/js/src/pro/hollaex.d.ts +1 -1
  422. package/js/src/pro/hollaex.js +1 -1
  423. package/js/src/pro/htx.d.ts +2 -2
  424. package/js/src/pro/htx.js +2 -2
  425. package/js/src/pro/hyperliquid.d.ts +2 -2
  426. package/js/src/pro/hyperliquid.js +2 -2
  427. package/js/src/pro/independentreserve.d.ts +1 -1
  428. package/js/src/pro/independentreserve.js +1 -1
  429. package/js/src/pro/kraken.d.ts +2 -2
  430. package/js/src/pro/kraken.js +2 -2
  431. package/js/src/pro/krakenfutures.d.ts +2 -2
  432. package/js/src/pro/krakenfutures.js +2 -2
  433. package/js/src/pro/kucoin.d.ts +4 -4
  434. package/js/src/pro/kucoin.js +4 -4
  435. package/js/src/pro/lighter.d.ts +2 -2
  436. package/js/src/pro/lighter.js +2 -2
  437. package/js/src/pro/luno.d.ts +1 -1
  438. package/js/src/pro/luno.js +1 -1
  439. package/js/src/pro/mexc.d.ts +2 -2
  440. package/js/src/pro/mexc.js +2 -2
  441. package/js/src/pro/modetrade.d.ts +1 -1
  442. package/js/src/pro/modetrade.js +1 -1
  443. package/js/src/pro/ndax.d.ts +1 -1
  444. package/js/src/pro/ndax.js +1 -1
  445. package/js/src/pro/okx.d.ts +4 -4
  446. package/js/src/pro/okx.js +4 -4
  447. package/js/src/pro/onetrading.d.ts +1 -1
  448. package/js/src/pro/onetrading.js +1 -1
  449. package/js/src/pro/p2b.d.ts +1 -1
  450. package/js/src/pro/p2b.js +1 -1
  451. package/js/src/pro/pacifica.d.ts +2 -2
  452. package/js/src/pro/pacifica.js +2 -2
  453. package/js/src/pro/paradex.d.ts +1 -1
  454. package/js/src/pro/paradex.js +1 -1
  455. package/js/src/pro/phemex.d.ts +1 -1
  456. package/js/src/pro/phemex.js +1 -1
  457. package/js/src/pro/poloniex.d.ts +1 -1
  458. package/js/src/pro/poloniex.js +1 -1
  459. package/js/src/pro/toobit.d.ts +2 -2
  460. package/js/src/pro/toobit.js +2 -2
  461. package/js/src/pro/upbit.d.ts +1 -1
  462. package/js/src/pro/upbit.js +1 -1
  463. package/js/src/pro/weex.d.ts +4 -4
  464. package/js/src/pro/weex.js +4 -4
  465. package/js/src/pro/whitebit.d.ts +1 -1
  466. package/js/src/pro/whitebit.js +1 -1
  467. package/js/src/pro/woo.d.ts +2 -2
  468. package/js/src/pro/woo.js +2 -2
  469. package/js/src/pro/woofipro.d.ts +1 -1
  470. package/js/src/pro/woofipro.js +1 -1
  471. package/js/src/tokocrypto.d.ts +1 -1
  472. package/js/src/tokocrypto.js +1 -1
  473. package/js/src/toobit.d.ts +1 -1
  474. package/js/src/toobit.js +2 -2
  475. package/js/src/upbit.d.ts +1 -1
  476. package/js/src/upbit.js +1 -1
  477. package/js/src/weex.d.ts +1 -1
  478. package/js/src/weex.js +2 -2
  479. package/js/src/whitebit.d.ts +1 -1
  480. package/js/src/whitebit.js +1 -1
  481. package/js/src/woo.d.ts +1 -1
  482. package/js/src/woo.js +1 -1
  483. package/js/src/woofipro.d.ts +1 -1
  484. package/js/src/woofipro.js +2 -4
  485. package/js/src/xt.js +1 -1
  486. package/js/src/zaif.d.ts +1 -1
  487. package/js/src/zaif.js +2 -2
  488. package/js/src/zebpay.d.ts +1 -1
  489. package/js/src/zebpay.js +2 -2
  490. package/package.json +17 -7
  491. package/js/src/static_dependencies/jsencrypt/JSEncrypt.d.ts +0 -116
  492. package/js/src/static_dependencies/jsencrypt/JSEncrypt.js +0 -194
  493. package/js/src/static_dependencies/jsencrypt/JSEncryptRSAKey.d.ts +0 -142
  494. package/js/src/static_dependencies/jsencrypt/JSEncryptRSAKey.js +0 -307
  495. package/js/src/static_dependencies/jsencrypt/index.d.ts +0 -3
  496. package/js/src/static_dependencies/jsencrypt/lib/asn1js/asn1.d.ts +0 -51
  497. package/js/src/static_dependencies/jsencrypt/lib/asn1js/asn1.js +0 -565
  498. package/js/src/static_dependencies/jsencrypt/lib/asn1js/base64.d.ts +0 -5
  499. package/js/src/static_dependencies/jsencrypt/lib/asn1js/base64.js +0 -94
  500. package/js/src/static_dependencies/jsencrypt/lib/asn1js/hex.d.ts +0 -3
  501. package/js/src/static_dependencies/jsencrypt/lib/asn1js/hex.js +0 -70
  502. package/js/src/static_dependencies/jsencrypt/lib/asn1js/int10.d.ts +0 -9
  503. package/js/src/static_dependencies/jsencrypt/lib/asn1js/int10.js +0 -91
  504. package/js/src/static_dependencies/jsencrypt/lib/asn1js/oids.d.ts +0 -9778
  505. package/js/src/static_dependencies/jsencrypt/lib/asn1js/oids.js +0 -1968
  506. package/js/src/static_dependencies/jsencrypt/lib/jsbn/base64.d.ts +0 -3
  507. package/js/src/static_dependencies/jsencrypt/lib/jsbn/base64.js +0 -25
  508. package/js/src/static_dependencies/jsencrypt/lib/jsbn/jsbn.d.ts +0 -101
  509. package/js/src/static_dependencies/jsencrypt/lib/jsbn/jsbn.js +0 -1757
  510. package/js/src/static_dependencies/jsencrypt/lib/jsbn/prng4.d.ts +0 -10
  511. package/js/src/static_dependencies/jsencrypt/lib/jsbn/prng4.js +0 -50
  512. package/js/src/static_dependencies/jsencrypt/lib/jsbn/rng.d.ts +0 -3
  513. package/js/src/static_dependencies/jsencrypt/lib/jsbn/rng.js +0 -80
  514. package/js/src/static_dependencies/jsencrypt/lib/jsbn/rsa.d.ts +0 -23
  515. package/js/src/static_dependencies/jsencrypt/lib/jsbn/rsa.js +0 -377
  516. package/js/src/static_dependencies/jsencrypt/lib/jsbn/util.d.ts +0 -7
  517. package/js/src/static_dependencies/jsencrypt/lib/jsbn/util.js +0 -64
  518. package/js/src/static_dependencies/jsencrypt/lib/jsrsasign/asn1-1.0.d.ts +0 -24
  519. package/js/src/static_dependencies/jsencrypt/lib/jsrsasign/asn1-1.0.js +0 -1627
  520. package/js/src/static_dependencies/jsencrypt/lib/jsrsasign/yahoo.d.ts +0 -5
  521. package/js/src/static_dependencies/jsencrypt/lib/jsrsasign/yahoo.js +0 -75
package/js/src/weex.js CHANGED
@@ -189,7 +189,7 @@ export default class weex extends Exchange {
189
189
  'withdraw': false,
190
190
  },
191
191
  'urls': {
192
- 'logo': 'https://github.com/user-attachments/assets/ccbadb2d-5035-403d-898f-dce831bdc936', // todo
192
+ 'logo': 'https://github.com/user-attachments/assets/bc67b9f2-75d2-4b8d-963a-18f2fcd9d13c', // todo
193
193
  'api': {
194
194
  'public': 'https://api-spot.weex.com',
195
195
  'private': 'https://api-spot.weex.com',
@@ -1278,7 +1278,7 @@ export default class weex extends Exchange {
1278
1278
  * @param {string} symbol unified symbol of the market to fetch the order book for
1279
1279
  * @param {int} [limit] the maximum amount of order book entries to return (default 15, max 200)
1280
1280
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1281
- * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/?id=order-book-structure} indexed by market symbols
1281
+ * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/?id=order-book-structure}
1282
1282
  */
1283
1283
  async fetchOrderBook(symbol, limit = undefined, params = {}) {
1284
1284
  await this.loadMarkets();
@@ -127,7 +127,7 @@ export default class whitebit extends Exchange {
127
127
  * @param {string} symbol unified symbol of the market to fetch the order book for
128
128
  * @param {int} [limit] the maximum amount of order book entries to return
129
129
  * @param {object} [params] extra parameters specific to the exchange API endpoint
130
- * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/?id=order-book-structure} indexed by market symbols
130
+ * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/?id=order-book-structure}
131
131
  */
132
132
  fetchOrderBook(symbol: string, limit?: Int, params?: {}): Promise<OrderBook>;
133
133
  /**
@@ -1577,7 +1577,7 @@ export default class whitebit extends Exchange {
1577
1577
  * @param {string} symbol unified symbol of the market to fetch the order book for
1578
1578
  * @param {int} [limit] the maximum amount of order book entries to return
1579
1579
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1580
- * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/?id=order-book-structure} indexed by market symbols
1580
+ * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/?id=order-book-structure}
1581
1581
  */
1582
1582
  async fetchOrderBook(symbol, limit = undefined, params = {}) {
1583
1583
  await this.loadMarkets();
package/js/src/woo.d.ts CHANGED
@@ -304,7 +304,7 @@ export default class woo extends Exchange {
304
304
  * @param {string} symbol unified symbol of the market to fetch the order book for
305
305
  * @param {int} [limit] the maximum amount of order book entries to return
306
306
  * @param {object} [params] extra parameters specific to the exchange API endpoint
307
- * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/?id=order-book-structure} indexed by market symbols
307
+ * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/?id=order-book-structure}
308
308
  */
309
309
  fetchOrderBook(symbol: string, limit?: Int, params?: {}): Promise<OrderBook>;
310
310
  /**
package/js/src/woo.js CHANGED
@@ -2107,7 +2107,7 @@ export default class woo extends Exchange {
2107
2107
  * @param {string} symbol unified symbol of the market to fetch the order book for
2108
2108
  * @param {int} [limit] the maximum amount of order book entries to return
2109
2109
  * @param {object} [params] extra parameters specific to the exchange API endpoint
2110
- * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/?id=order-book-structure} indexed by market symbols
2110
+ * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/?id=order-book-structure}
2111
2111
  */
2112
2112
  async fetchOrderBook(symbol, limit = undefined, params = {}) {
2113
2113
  await this.loadMarkets();
@@ -152,7 +152,7 @@ export default class woofipro extends Exchange {
152
152
  * @param {string} symbol unified symbol of the market to fetch the order book for
153
153
  * @param {int} [limit] the maximum amount of order book entries to return
154
154
  * @param {object} [params] extra parameters specific to the exchange API endpoint
155
- * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/?id=order-book-structure} indexed by market symbols
155
+ * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/?id=order-book-structure}
156
156
  */
157
157
  fetchOrderBook(symbol: string, limit?: Int, params?: {}): Promise<OrderBook>;
158
158
  parseOHLCV(ohlcv: any, market?: Market): OHLCV;
@@ -29,7 +29,6 @@ export default class woofipro extends Exchange {
29
29
  'certified': true,
30
30
  'pro': true,
31
31
  'dex': true,
32
- 'hostname': 'dex.woo.org',
33
32
  'has': {
34
33
  'CORS': undefined,
35
34
  'spot': false,
@@ -1229,7 +1228,7 @@ export default class woofipro extends Exchange {
1229
1228
  * @param {string} symbol unified symbol of the market to fetch the order book for
1230
1229
  * @param {int} [limit] the maximum amount of order book entries to return
1231
1230
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1232
- * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/?id=order-book-structure} indexed by market symbols
1231
+ * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/?id=order-book-structure}
1233
1232
  */
1234
1233
  async fetchOrderBook(symbol, limit = undefined, params = {}) {
1235
1234
  await this.loadMarkets();
@@ -2882,8 +2881,7 @@ export default class woofipro extends Exchange {
2882
2881
  const version = section[0];
2883
2882
  const access = section[1];
2884
2883
  const pathWithParams = this.implodeParams(path, params);
2885
- let url = this.implodeHostname(this.urls['api'][access]);
2886
- url += '/' + version + '/';
2884
+ let url = this.urls['api'][access] + '/' + version + '/';
2887
2885
  params = this.omit(params, this.extractParams(path));
2888
2886
  params = this.keysort(params);
2889
2887
  if (access === 'public') {
package/js/src/xt.js CHANGED
@@ -130,7 +130,7 @@ export default class xt extends Exchange {
130
130
  },
131
131
  'precisionMode': TICK_SIZE,
132
132
  'urls': {
133
- 'logo': 'https://user-images.githubusercontent.com/14319357/232636712-466df2fc-560a-4ca4-aab2-b1d954a58e24.jpg',
133
+ 'logo': 'https://github.com/user-attachments/assets/1f916564-6507-4549-af96-22837bb0a0c7',
134
134
  'api': {
135
135
  'spot': 'https://sapi.xt.com',
136
136
  'linear': 'https://fapi.xt.com',
package/js/src/zaif.d.ts CHANGED
@@ -34,7 +34,7 @@ export default class zaif extends Exchange {
34
34
  * @param {string} symbol unified symbol of the market to fetch the order book for
35
35
  * @param {int} [limit] the maximum amount of order book entries to return
36
36
  * @param {object} [params] extra parameters specific to the exchange API endpoint
37
- * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/?id=order-book-structure} indexed by market symbols
37
+ * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/?id=order-book-structure}
38
38
  */
39
39
  fetchOrderBook(symbol: string, limit?: Int, params?: {}): Promise<OrderBook>;
40
40
  parseTicker(ticker: Dict, market?: Market): Ticker;
package/js/src/zaif.js CHANGED
@@ -84,7 +84,7 @@ export default class zaif extends Exchange {
84
84
  'withdraw': true,
85
85
  },
86
86
  'urls': {
87
- 'logo': 'https://user-images.githubusercontent.com/1294454/27766927-39ca2ada-5eeb-11e7-972f-1b4199518ca6.jpg',
87
+ 'logo': 'https://github.com/user-attachments/assets/c6c97d18-5bde-46ed-8eb1-85404d36150e',
88
88
  'api': {
89
89
  'rest': 'https://api.zaif.jp',
90
90
  },
@@ -365,7 +365,7 @@ export default class zaif extends Exchange {
365
365
  * @param {string} symbol unified symbol of the market to fetch the order book for
366
366
  * @param {int} [limit] the maximum amount of order book entries to return
367
367
  * @param {object} [params] extra parameters specific to the exchange API endpoint
368
- * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/?id=order-book-structure} indexed by market symbols
368
+ * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/?id=order-book-structure}
369
369
  */
370
370
  async fetchOrderBook(symbol, limit = undefined, params = {}) {
371
371
  await this.loadMarkets();
@@ -82,7 +82,7 @@ export default class zebpay extends Exchange {
82
82
  * @param {string} symbol unified symbol of the market to fetch the order book for
83
83
  * @param {int} [limit] the maximum amount of order book entries to return
84
84
  * @param {object} [params] extra parameters specific to the exchange API endpoint
85
- * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/?id=order-book-structure} indexed by market symbols
85
+ * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/?id=order-book-structure}
86
86
  */
87
87
  fetchOrderBook(symbol: string, limit?: Int, params?: {}): Promise<OrderBook>;
88
88
  /**
package/js/src/zebpay.js CHANGED
@@ -85,7 +85,7 @@ export default class zebpay extends Exchange {
85
85
  '1w': 10080,
86
86
  },
87
87
  'urls': {
88
- 'logo': 'https://github.com/user-attachments/assets/8094e7be-55a7-46f4-a087-0ca31b48ecad',
88
+ 'logo': 'https://github.com/user-attachments/assets/0e88d86a-a1cd-49df-a826-054cd8caafa6',
89
89
  'api': {
90
90
  'spot': 'https://sapi.zebpay.com',
91
91
  'swap': 'https://futuresbe.zebpay.com',
@@ -558,7 +558,7 @@ export default class zebpay extends Exchange {
558
558
  * @param {string} symbol unified symbol of the market to fetch the order book for
559
559
  * @param {int} [limit] the maximum amount of order book entries to return
560
560
  * @param {object} [params] extra parameters specific to the exchange API endpoint
561
- * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/?id=order-book-structure} indexed by market symbols
561
+ * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/?id=order-book-structure}
562
562
  */
563
563
  async fetchOrderBook(symbol, limit = undefined, params = {}) {
564
564
  await this.loadMarkets();
package/package.json CHANGED
@@ -1,13 +1,10 @@
1
1
  {
2
2
  "name": "ccxt",
3
- "version": "4.5.60",
3
+ "version": "4.5.61",
4
4
  "description": "A cryptocurrency trading API with more than 100 exchanges in JavaScript / TypeScript / Python / C# / PHP / Go",
5
5
  "unpkg": "dist/ccxt.browser.min.js",
6
6
  "type": "module",
7
- "sideEffects": [
8
- "./js/ccxt.js",
9
- "./dist/ccxt.cjs"
10
- ],
7
+ "sideEffects": false,
11
8
  "exports": {
12
9
  ".": {
13
10
  "import": {
@@ -87,7 +84,7 @@
87
84
  "pre-transpile-js-simple": "npm run export-exchanges && npm run emitAPITs && tsc && npm run validate-types",
88
85
  "pre-transpile-cs": "npm run export-exchanges && npm run emitAPICs",
89
86
  "pre-transpile-java": "npm run export-exchanges && npm run emitAPIJava",
90
- "pre-transpile": "npm run export-exchanges && npm run vss && npm run tsBuild && npm run emitAPI && npm run validate-types && npm run tsBuildExamples && npm run copy-python-files && npm run check-js-syntax && npm run bundle",
87
+ "pre-transpile": "npm run export-exchanges && npm run vss && npm run tsBuild && npm run emitAPI && npm run validate-types && npm run tsBuildExamples && npm run check-js-syntax && npm run bundle",
91
88
  "pre-transpile-pr": "npm run export-exchanges && npm run tsBuild && npm run emitAPI && npm run check-js-syntax",
92
89
  "post-transpile": "npm run check-python-syntax && npm run check-php-syntax",
93
90
  "cli.ts": "tsx ./cli/ts/cli.ts",
@@ -125,11 +122,12 @@
125
122
  "check-js-syntax": "node -e \"console.log(process.cwd())\" && eslint --version && npm run lint",
126
123
  "eslint": "eslint",
127
124
  "check-python-syntax": "cd python && tox -e qa && cd ..",
128
- "check-python-ruff": "ruff check ./python/ccxt",
125
+ "check-python-style": "ruff check ./python/ccxt",
129
126
  "check-python-types": "cd python && tox -e type && cd ..",
130
127
  "check-php-syntax": "npm run check-rest-php-syntax && npm run check-ws-php-syntax",
131
128
  "check-rest-php-syntax": "php -f php/test/custom/syntax.php",
132
129
  "check-ws-php-syntax": "php -f php/pro/test/custom/syntax.php",
130
+ "check-php-style": "php vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php --dry-run",
133
131
  "bundle": "npm run bundle-cjs && npm run bundle-browser",
134
132
  "bundle-cjs": "rollup -c rollup.config.js",
135
133
  "bundle-browser": "rspack build -c rspack.config.js && CCXT_MINIMIZE=true CCXT_OUTPUT_FILENAME=ccxt.browser.min.js rspack build -c rspack.config.js",
@@ -365,7 +363,19 @@
365
363
  "@scure/starknet": "2.2.0",
366
364
  "ws": "8.21.0"
367
365
  },
366
+ "overrides": {
367
+ "marked": "^4.0.10",
368
+ "piscina": "^4.9.3"
369
+ },
368
370
  "optionalDependencies": {
369
371
  "bufferutil": "4.1.0"
372
+ },
373
+ "peerDependencies": {
374
+ "protobufjs": "^7.5.3"
375
+ },
376
+ "peerDependenciesMeta": {
377
+ "protobufjs": {
378
+ "optional": true
379
+ }
370
380
  }
371
381
  }
@@ -1,116 +0,0 @@
1
- import { JSEncryptRSAKey } from "./JSEncryptRSAKey.js";
2
- export interface IJSEncryptOptions {
3
- default_key_size?: string;
4
- default_public_exponent?: string;
5
- log?: boolean;
6
- }
7
- /**
8
- *
9
- * @param {object} [options = {}] - An object to customize JSEncrypt behaviour
10
- * possible parameters are:
11
- * - default_key_size {number} default: 1024 the key size in bit
12
- * - default_public_exponent {string} default: '010001' the hexadecimal representation of the public exponent
13
- * - log {boolean} default: false whether log warn/error or not
14
- * @constructor
15
- */
16
- export declare class JSEncrypt {
17
- constructor(options?: IJSEncryptOptions);
18
- private default_key_size;
19
- private default_public_exponent;
20
- private log;
21
- private key;
22
- static version: string;
23
- /**
24
- * Method to set the rsa key parameter (one method is enough to set both the public
25
- * and the private key, since the private key contains the public key paramenters)
26
- * Log a warning if logs are enabled
27
- * @param {Object|string} key the pem encoded string or an object (with or without header/footer)
28
- * @public
29
- */
30
- setKey(key: string): void;
31
- /**
32
- * Proxy method for setKey, for api compatibility
33
- * @see setKey
34
- * @public
35
- */
36
- setPrivateKey(privkey: string): void;
37
- /**
38
- * Proxy method for setKey, for api compatibility
39
- * @see setKey
40
- * @public
41
- */
42
- setPublicKey(pubkey: string): void;
43
- /**
44
- * Proxy method for RSAKey object's decrypt, decrypt the string using the private
45
- * components of the rsa key object. Note that if the object was not set will be created
46
- * on the fly (by the getKey method) using the parameters passed in the JSEncrypt constructor
47
- * @param {string} str base64 encoded crypted string to decrypt
48
- * @return {string} the decrypted string
49
- * @public
50
- */
51
- decrypt(str: string): string | false;
52
- /**
53
- * Proxy method for RSAKey object's encrypt, encrypt the string using the public
54
- * components of the rsa key object. Note that if the object was not set will be created
55
- * on the fly (by the getKey method) using the parameters passed in the JSEncrypt constructor
56
- * @param {string} str the string to encrypt
57
- * @return {string} the encrypted string encoded in base64
58
- * @public
59
- */
60
- encrypt(str: string): string | false;
61
- /**
62
- * Proxy method for RSAKey object's sign.
63
- * @param {string} str the string to sign
64
- * @param {function} digestMethod hash method
65
- * @param {string} digestName the name of the hash algorithm
66
- * @return {string} the signature encoded in base64
67
- * @public
68
- */
69
- sign(str: string, digestMethod: (str: string) => string, digestName: string): string | false;
70
- /**
71
- * Proxy method for RSAKey object's verify.
72
- * @param {string} str the string to verify
73
- * @param {string} signature the signature encoded in base64 to compare the string to
74
- * @param {function} digestMethod hash method
75
- * @return {boolean} whether the data and signature match
76
- * @public
77
- */
78
- verify(str: string, signature: string, digestMethod: (str: string) => string): boolean;
79
- /**
80
- * Getter for the current JSEncryptRSAKey object. If it doesn't exists a new object
81
- * will be created and returned
82
- * @param {callback} [cb] the callback to be called if we want the key to be generated
83
- * in an async fashion
84
- * @returns {JSEncryptRSAKey} the JSEncryptRSAKey object
85
- * @public
86
- */
87
- getKey(cb?: () => void): JSEncryptRSAKey;
88
- /**
89
- * Returns the pem encoded representation of the private key
90
- * If the key doesn't exists a new key will be created
91
- * @returns {string} pem encoded representation of the private key WITH header and footer
92
- * @public
93
- */
94
- getPrivateKey(): string;
95
- /**
96
- * Returns the pem encoded representation of the private key
97
- * If the key doesn't exists a new key will be created
98
- * @returns {string} pem encoded representation of the private key WITHOUT header and footer
99
- * @public
100
- */
101
- getPrivateKeyB64(): string;
102
- /**
103
- * Returns the pem encoded representation of the public key
104
- * If the key doesn't exists a new key will be created
105
- * @returns {string} pem encoded representation of the public key WITH header and footer
106
- * @public
107
- */
108
- getPublicKey(): string;
109
- /**
110
- * Returns the pem encoded representation of the public key
111
- * If the key doesn't exists a new key will be created
112
- * @returns {string} pem encoded representation of the public key WITHOUT header and footer
113
- * @public
114
- */
115
- getPublicKeyB64(): string;
116
- }
@@ -1,194 +0,0 @@
1
- // ----------------------------------------------------------------------------
2
-
3
- // PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
4
- // https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
5
- // EDIT THE CORRESPONDENT .ts FILE INSTEAD
6
-
7
- import { b64tohex, hex2b64 } from "./lib/jsbn/base64.js";
8
- import { JSEncryptRSAKey } from "./JSEncryptRSAKey.js";
9
- const version = typeof process !== 'undefined'
10
- ? process.env?.npm_package_version
11
- : undefined;
12
- /**
13
- *
14
- * @param {object} [options = {}] - An object to customize JSEncrypt behaviour
15
- * possible parameters are:
16
- * - default_key_size {number} default: 1024 the key size in bit
17
- * - default_public_exponent {string} default: '010001' the hexadecimal representation of the public exponent
18
- * - log {boolean} default: false whether log warn/error or not
19
- * @constructor
20
- */
21
- export class JSEncrypt {
22
- constructor(options = {}) {
23
- options = options || {};
24
- this.default_key_size = options.default_key_size
25
- ? parseInt(options.default_key_size, 10)
26
- : 1024;
27
- this.default_public_exponent = options.default_public_exponent || "010001"; // 65537 default openssl public exponent for rsa key type
28
- this.log = options.log || false;
29
- // The private and public key.
30
- this.key = null;
31
- }
32
- static { this.version = version; }
33
- /**
34
- * Method to set the rsa key parameter (one method is enough to set both the public
35
- * and the private key, since the private key contains the public key paramenters)
36
- * Log a warning if logs are enabled
37
- * @param {Object|string} key the pem encoded string or an object (with or without header/footer)
38
- * @public
39
- */
40
- setKey(key) {
41
- if (this.log && this.key) {
42
- console.warn("A key was already set, overriding existing.");
43
- }
44
- this.key = new JSEncryptRSAKey(key);
45
- }
46
- /**
47
- * Proxy method for setKey, for api compatibility
48
- * @see setKey
49
- * @public
50
- */
51
- setPrivateKey(privkey) {
52
- // Create the key.
53
- this.setKey(privkey);
54
- }
55
- /**
56
- * Proxy method for setKey, for api compatibility
57
- * @see setKey
58
- * @public
59
- */
60
- setPublicKey(pubkey) {
61
- // Sets the public key.
62
- this.setKey(pubkey);
63
- }
64
- /**
65
- * Proxy method for RSAKey object's decrypt, decrypt the string using the private
66
- * components of the rsa key object. Note that if the object was not set will be created
67
- * on the fly (by the getKey method) using the parameters passed in the JSEncrypt constructor
68
- * @param {string} str base64 encoded crypted string to decrypt
69
- * @return {string} the decrypted string
70
- * @public
71
- */
72
- decrypt(str) {
73
- // Return the decrypted string.
74
- try {
75
- return this.getKey().decrypt(b64tohex(str));
76
- }
77
- catch (ex) {
78
- return false;
79
- }
80
- }
81
- /**
82
- * Proxy method for RSAKey object's encrypt, encrypt the string using the public
83
- * components of the rsa key object. Note that if the object was not set will be created
84
- * on the fly (by the getKey method) using the parameters passed in the JSEncrypt constructor
85
- * @param {string} str the string to encrypt
86
- * @return {string} the encrypted string encoded in base64
87
- * @public
88
- */
89
- encrypt(str) {
90
- // Return the encrypted string.
91
- try {
92
- return hex2b64(this.getKey().encrypt(str));
93
- }
94
- catch (ex) {
95
- return false;
96
- }
97
- }
98
- /**
99
- * Proxy method for RSAKey object's sign.
100
- * @param {string} str the string to sign
101
- * @param {function} digestMethod hash method
102
- * @param {string} digestName the name of the hash algorithm
103
- * @return {string} the signature encoded in base64
104
- * @public
105
- */
106
- sign(str, digestMethod, digestName) {
107
- // return the RSA signature of 'str' in 'hex' format.
108
- try {
109
- return hex2b64(this.getKey().sign(str, digestMethod, digestName));
110
- }
111
- catch (ex) {
112
- return false;
113
- }
114
- }
115
- /**
116
- * Proxy method for RSAKey object's verify.
117
- * @param {string} str the string to verify
118
- * @param {string} signature the signature encoded in base64 to compare the string to
119
- * @param {function} digestMethod hash method
120
- * @return {boolean} whether the data and signature match
121
- * @public
122
- */
123
- verify(str, signature, digestMethod) {
124
- // Return the decrypted 'digest' of the signature.
125
- try {
126
- return this.getKey().verify(str, b64tohex(signature), digestMethod);
127
- }
128
- catch (ex) {
129
- return false;
130
- }
131
- }
132
- /**
133
- * Getter for the current JSEncryptRSAKey object. If it doesn't exists a new object
134
- * will be created and returned
135
- * @param {callback} [cb] the callback to be called if we want the key to be generated
136
- * in an async fashion
137
- * @returns {JSEncryptRSAKey} the JSEncryptRSAKey object
138
- * @public
139
- */
140
- getKey(cb) {
141
- // Only create new if it does not exist.
142
- if (!this.key) {
143
- // Get a new private key.
144
- this.key = new JSEncryptRSAKey();
145
- if (cb && {}.toString.call(cb) === "[object Function]") {
146
- this.key.generateAsync(this.default_key_size, this.default_public_exponent, cb);
147
- return;
148
- }
149
- // Generate the key.
150
- this.key.generate(this.default_key_size, this.default_public_exponent);
151
- }
152
- return this.key;
153
- }
154
- /**
155
- * Returns the pem encoded representation of the private key
156
- * If the key doesn't exists a new key will be created
157
- * @returns {string} pem encoded representation of the private key WITH header and footer
158
- * @public
159
- */
160
- getPrivateKey() {
161
- // Return the private representation of this key.
162
- return this.getKey().getPrivateKey();
163
- }
164
- /**
165
- * Returns the pem encoded representation of the private key
166
- * If the key doesn't exists a new key will be created
167
- * @returns {string} pem encoded representation of the private key WITHOUT header and footer
168
- * @public
169
- */
170
- getPrivateKeyB64() {
171
- // Return the private representation of this key.
172
- return this.getKey().getPrivateBaseKeyB64();
173
- }
174
- /**
175
- * Returns the pem encoded representation of the public key
176
- * If the key doesn't exists a new key will be created
177
- * @returns {string} pem encoded representation of the public key WITH header and footer
178
- * @public
179
- */
180
- getPublicKey() {
181
- // Return the private representation of this key.
182
- return this.getKey().getPublicKey();
183
- }
184
- /**
185
- * Returns the pem encoded representation of the public key
186
- * If the key doesn't exists a new key will be created
187
- * @returns {string} pem encoded representation of the public key WITHOUT header and footer
188
- * @public
189
- */
190
- getPublicKeyB64() {
191
- // Return the private representation of this key.
192
- return this.getKey().getPublicBaseKeyB64();
193
- }
194
- }