ccxt-ir 4.3.46.0.3__py2.py3-none-any.whl → 4.5.1__py2.py3-none-any.whl

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 (529) hide show
  1. ccxt/__init__.py +39 -35
  2. ccxt/abantether.py +8 -8
  3. ccxt/abstract/alpaca.py +4 -0
  4. ccxt/abstract/apex.py +31 -0
  5. ccxt/abstract/bigone.py +1 -1
  6. ccxt/abstract/binance.py +106 -48
  7. ccxt/abstract/binancecoinm.py +106 -48
  8. ccxt/abstract/binanceus.py +141 -83
  9. ccxt/abstract/binanceusdm.py +106 -48
  10. ccxt/abstract/bingx.py +50 -1
  11. ccxt/abstract/bitbank.py +5 -0
  12. ccxt/abstract/bitfinex.py +136 -65
  13. ccxt/abstract/bitflyer.py +1 -0
  14. ccxt/abstract/bitget.py +67 -0
  15. ccxt/abstract/bitmart.py +19 -1
  16. ccxt/abstract/bitopro.py +1 -0
  17. ccxt/abstract/bitrue.py +68 -68
  18. ccxt/abstract/bitstamp.py +1 -0
  19. ccxt/abstract/blofin.py +30 -0
  20. ccxt/abstract/btcbox.py +2 -0
  21. ccxt/abstract/bybit.py +28 -13
  22. ccxt/abstract/cex.py +28 -29
  23. ccxt/abstract/coinbaseexchange.py +1 -0
  24. ccxt/abstract/coinbaseinternational.py +1 -1
  25. ccxt/abstract/cryptocom.py +16 -0
  26. ccxt/abstract/cryptomus.py +20 -0
  27. ccxt/abstract/defx.py +69 -0
  28. ccxt/abstract/deribit.py +1 -0
  29. ccxt/abstract/derive.py +117 -0
  30. ccxt/abstract/digifinex.py +1 -0
  31. ccxt/abstract/ellipx.py +25 -0
  32. ccxt/abstract/foxbit.py +26 -0
  33. ccxt/abstract/gate.py +19 -0
  34. ccxt/abstract/gateio.py +19 -0
  35. ccxt/abstract/gemini.py +1 -0
  36. ccxt/abstract/hibachi.py +26 -0
  37. ccxt/abstract/hyperliquid.py +1 -1
  38. ccxt/abstract/independentreserve.py +6 -0
  39. ccxt/abstract/kraken.py +1 -0
  40. ccxt/abstract/krakenfutures.py +4 -0
  41. ccxt/abstract/kucoin.py +10 -0
  42. ccxt/abstract/kucoinfutures.py +18 -0
  43. ccxt/abstract/lbank.py +2 -1
  44. ccxt/abstract/luno.py +1 -0
  45. ccxt/abstract/mexc.py +2 -0
  46. ccxt/abstract/modetrade.py +119 -0
  47. ccxt/abstract/myokx.py +349 -0
  48. ccxt/abstract/oceanex.py +5 -0
  49. ccxt/abstract/okx.py +25 -0
  50. ccxt/abstract/okxus.py +349 -0
  51. ccxt/abstract/onetrading.py +0 -12
  52. ccxt/abstract/paradex.py +23 -0
  53. ccxt/abstract/phemex.py +2 -0
  54. ccxt/abstract/poloniex.py +36 -0
  55. ccxt/abstract/tradeogre.py +3 -1
  56. ccxt/abstract/upbit.py +51 -34
  57. ccxt/abstract/whitebit.py +16 -0
  58. ccxt/abstract/woo.py +64 -6
  59. ccxt/abstract/xt.py +10 -5
  60. ccxt/afratether.py +8 -8
  61. ccxt/alpaca.py +828 -51
  62. ccxt/apex.py +1875 -0
  63. ccxt/arzinja.py +7 -7
  64. ccxt/arzplus.py +9 -9
  65. ccxt/ascendex.py +501 -306
  66. ccxt/async_support/__init__.py +39 -35
  67. ccxt/async_support/abantether.py +8 -8
  68. ccxt/async_support/afratether.py +10 -10
  69. ccxt/async_support/alpaca.py +828 -51
  70. ccxt/async_support/apex.py +1875 -0
  71. ccxt/async_support/arzinja.py +10 -10
  72. ccxt/async_support/arzplus.py +12 -12
  73. ccxt/async_support/ascendex.py +502 -306
  74. ccxt/async_support/base/exchange.py +303 -89
  75. ccxt/async_support/base/ws/cache.py +9 -3
  76. ccxt/async_support/base/ws/client.py +173 -38
  77. ccxt/async_support/base/ws/future.py +25 -37
  78. ccxt/async_support/bequant.py +5 -3
  79. ccxt/async_support/bigone.py +279 -144
  80. ccxt/async_support/binance.py +2347 -1158
  81. ccxt/async_support/binancecoinm.py +9 -3
  82. ccxt/async_support/binanceus.py +17 -3
  83. ccxt/async_support/binanceusdm.py +9 -4
  84. ccxt/async_support/bingx.py +2962 -920
  85. ccxt/async_support/bit2c.py +147 -27
  86. ccxt/async_support/bitbank.py +151 -23
  87. ccxt/async_support/bitbns.py +104 -30
  88. ccxt/async_support/bitfinex.py +3291 -1113
  89. ccxt/async_support/bitflyer.py +202 -27
  90. ccxt/async_support/bitget.py +3683 -1538
  91. ccxt/async_support/bithumb.py +195 -38
  92. ccxt/async_support/bitimen.py +12 -12
  93. ccxt/async_support/bitir.py +38 -38
  94. ccxt/async_support/bitmart.py +1288 -350
  95. ccxt/async_support/bitmex.py +260 -75
  96. ccxt/async_support/bitopro.py +262 -62
  97. ccxt/async_support/bitpin.py +17 -16
  98. ccxt/async_support/bitrue.py +459 -290
  99. ccxt/async_support/bitso.py +199 -54
  100. ccxt/async_support/bitstamp.py +230 -96
  101. ccxt/async_support/bitteam.py +167 -25
  102. ccxt/async_support/{huobijp.py → bittrade.py} +158 -30
  103. ccxt/async_support/bitvavo.py +213 -49
  104. ccxt/async_support/blockchaincom.py +160 -46
  105. ccxt/async_support/blofin.py +502 -120
  106. ccxt/async_support/btcalpha.py +169 -31
  107. ccxt/async_support/btcbox.py +292 -23
  108. ccxt/async_support/btcmarkets.py +211 -58
  109. ccxt/async_support/btcturk.py +161 -38
  110. ccxt/async_support/bybit.py +1775 -1030
  111. ccxt/async_support/cex.py +1440 -1303
  112. ccxt/async_support/coinbase.py +724 -212
  113. ccxt/async_support/coinbaseadvanced.py +2 -1
  114. ccxt/async_support/coinbaseexchange.py +388 -89
  115. ccxt/async_support/coinbaseinternational.py +412 -57
  116. ccxt/async_support/coincatch.py +177 -78
  117. ccxt/async_support/coincheck.py +135 -19
  118. ccxt/async_support/coinex.py +606 -232
  119. ccxt/async_support/coinmate.py +189 -63
  120. ccxt/async_support/coinmetro.py +195 -54
  121. ccxt/async_support/coinone.py +158 -51
  122. ccxt/async_support/coinsph.py +336 -61
  123. ccxt/async_support/coinspot.py +151 -52
  124. ccxt/async_support/cryptocom.py +661 -111
  125. ccxt/async_support/cryptomus.py +1137 -0
  126. ccxt/async_support/defx.py +2071 -0
  127. ccxt/async_support/delta.py +299 -99
  128. ccxt/async_support/deribit.py +348 -126
  129. ccxt/async_support/derive.py +2572 -0
  130. ccxt/async_support/digifinex.py +430 -214
  131. ccxt/async_support/ellipx.py +2029 -0
  132. ccxt/async_support/eterex.py +10 -10
  133. ccxt/async_support/excoino.py +31 -31
  134. ccxt/async_support/exir.py +14 -14
  135. ccxt/async_support/exmo.py +344 -131
  136. ccxt/async_support/exnovin.py +10 -10
  137. ccxt/async_support/farhadexchange.py +12 -12
  138. ccxt/async_support/fmfwio.py +2 -1
  139. ccxt/async_support/foxbit.py +1935 -0
  140. ccxt/async_support/gate.py +1351 -529
  141. ccxt/async_support/gateio.py +2 -1
  142. ccxt/async_support/gemini.py +144 -39
  143. ccxt/async_support/hashkey.py +152 -109
  144. ccxt/async_support/hibachi.py +2080 -0
  145. ccxt/async_support/hitbtc.py +395 -167
  146. ccxt/async_support/hitobit.py +12 -12
  147. ccxt/async_support/hollaex.py +307 -119
  148. ccxt/async_support/htx.py +851 -383
  149. ccxt/async_support/huobi.py +2 -1
  150. ccxt/async_support/hyperliquid.py +1848 -536
  151. ccxt/async_support/independentreserve.py +288 -15
  152. ccxt/async_support/indodax.py +190 -33
  153. ccxt/async_support/jibitex.py +12 -12
  154. ccxt/async_support/kraken.py +795 -351
  155. ccxt/async_support/krakenfutures.py +214 -62
  156. ccxt/async_support/kucoin.py +715 -396
  157. ccxt/async_support/kucoinfutures.py +652 -89
  158. ccxt/async_support/latoken.py +217 -113
  159. ccxt/async_support/lbank.py +425 -97
  160. ccxt/async_support/luno.py +382 -35
  161. ccxt/async_support/mercado.py +113 -6
  162. ccxt/async_support/mexc.py +874 -437
  163. ccxt/async_support/modetrade.py +2818 -0
  164. ccxt/async_support/myokx.py +54 -0
  165. ccxt/async_support/ndax.py +221 -64
  166. ccxt/async_support/nobitex.py +32 -38
  167. ccxt/async_support/novadax.py +190 -34
  168. ccxt/async_support/oceanex.py +217 -28
  169. ccxt/async_support/okcoin.py +253 -145
  170. ccxt/async_support/okexchange.py +11 -11
  171. ccxt/async_support/okx.py +1088 -351
  172. ccxt/async_support/okxus.py +54 -0
  173. ccxt/async_support/ompfinex.py +32 -27
  174. ccxt/async_support/onetrading.py +213 -392
  175. ccxt/async_support/oxfun.py +245 -166
  176. ccxt/async_support/p2b.py +151 -29
  177. ccxt/async_support/paradex.py +562 -49
  178. ccxt/async_support/paymium.py +82 -19
  179. ccxt/async_support/phemex.py +713 -172
  180. ccxt/async_support/poloniex.py +1602 -283
  181. ccxt/async_support/probit.py +224 -95
  182. ccxt/async_support/ramzinex.py +34 -30
  183. ccxt/async_support/sarmayex.py +9 -9
  184. ccxt/async_support/sarrafex.py +13 -13
  185. ccxt/async_support/tabdeal.py +15 -14
  186. ccxt/async_support/tetherland.py +9 -9
  187. ccxt/async_support/timex.py +210 -51
  188. ccxt/async_support/tokocrypto.py +167 -47
  189. ccxt/async_support/tradeogre.py +266 -31
  190. ccxt/async_support/twox.py +9 -9
  191. ccxt/async_support/ubitex.py +12 -12
  192. ccxt/async_support/upbit.py +568 -165
  193. ccxt/async_support/vertex.py +160 -32
  194. ccxt/async_support/wallex.py +12 -12
  195. ccxt/async_support/wavesexchange.py +165 -30
  196. ccxt/async_support/whitebit.py +975 -127
  197. ccxt/async_support/woo.py +1918 -1016
  198. ccxt/async_support/woofipro.py +433 -141
  199. ccxt/async_support/xt.py +649 -193
  200. ccxt/async_support/yobit.py +195 -70
  201. ccxt/async_support/zaif.py +91 -15
  202. ccxt/async_support/zonda.py +151 -36
  203. ccxt/base/decimal_to_precision.py +14 -10
  204. ccxt/base/errors.py +49 -18
  205. ccxt/base/exchange.py +1556 -450
  206. ccxt/base/precise.py +10 -0
  207. ccxt/base/types.py +114 -6
  208. ccxt/bequant.py +5 -3
  209. ccxt/bigone.py +279 -144
  210. ccxt/binance.py +2347 -1158
  211. ccxt/binancecoinm.py +9 -3
  212. ccxt/binanceus.py +17 -3
  213. ccxt/binanceusdm.py +9 -4
  214. ccxt/bingx.py +2962 -920
  215. ccxt/bit2c.py +147 -27
  216. ccxt/bitbank.py +151 -23
  217. ccxt/bitbns.py +104 -30
  218. ccxt/bitfinex.py +3290 -1113
  219. ccxt/bitflyer.py +202 -27
  220. ccxt/bitget.py +3683 -1538
  221. ccxt/bithumb.py +194 -38
  222. ccxt/bitimen.py +9 -9
  223. ccxt/bitir.py +35 -35
  224. ccxt/bitmart.py +1288 -350
  225. ccxt/bitmex.py +260 -75
  226. ccxt/bitopro.py +262 -62
  227. ccxt/bitpin.py +15 -14
  228. ccxt/bitrue.py +459 -290
  229. ccxt/bitso.py +199 -54
  230. ccxt/bitstamp.py +230 -96
  231. ccxt/bitteam.py +167 -25
  232. ccxt/{huobijp.py → bittrade.py} +158 -30
  233. ccxt/bitvavo.py +213 -49
  234. ccxt/blockchaincom.py +160 -46
  235. ccxt/blofin.py +502 -120
  236. ccxt/btcalpha.py +169 -31
  237. ccxt/btcbox.py +291 -23
  238. ccxt/btcmarkets.py +211 -58
  239. ccxt/btcturk.py +161 -38
  240. ccxt/bybit.py +1775 -1030
  241. ccxt/cex.py +1439 -1303
  242. ccxt/coinbase.py +724 -212
  243. ccxt/coinbaseadvanced.py +2 -1
  244. ccxt/coinbaseexchange.py +388 -89
  245. ccxt/coinbaseinternational.py +412 -57
  246. ccxt/coincatch.py +177 -78
  247. ccxt/coincheck.py +135 -19
  248. ccxt/coinex.py +606 -232
  249. ccxt/coinmate.py +189 -63
  250. ccxt/coinmetro.py +194 -54
  251. ccxt/coinone.py +158 -51
  252. ccxt/coinsph.py +336 -61
  253. ccxt/coinspot.py +151 -52
  254. ccxt/cryptocom.py +661 -111
  255. ccxt/cryptomus.py +1137 -0
  256. ccxt/defx.py +2070 -0
  257. ccxt/delta.py +299 -99
  258. ccxt/deribit.py +348 -126
  259. ccxt/derive.py +2571 -0
  260. ccxt/digifinex.py +430 -214
  261. ccxt/ellipx.py +2029 -0
  262. ccxt/eterex.py +7 -7
  263. ccxt/excoino.py +29 -29
  264. ccxt/exir.py +11 -11
  265. ccxt/exmo.py +343 -131
  266. ccxt/exnovin.py +8 -8
  267. ccxt/farhadexchange.py +10 -10
  268. ccxt/fmfwio.py +2 -1
  269. ccxt/foxbit.py +1935 -0
  270. ccxt/gate.py +1351 -529
  271. ccxt/gateio.py +2 -1
  272. ccxt/gemini.py +144 -39
  273. ccxt/hashkey.py +152 -109
  274. ccxt/hibachi.py +2079 -0
  275. ccxt/hitbtc.py +395 -167
  276. ccxt/hitobit.py +9 -9
  277. ccxt/hollaex.py +307 -119
  278. ccxt/htx.py +851 -383
  279. ccxt/huobi.py +2 -1
  280. ccxt/hyperliquid.py +1848 -536
  281. ccxt/independentreserve.py +287 -15
  282. ccxt/indodax.py +190 -33
  283. ccxt/jibitex.py +9 -9
  284. ccxt/kraken.py +794 -351
  285. ccxt/krakenfutures.py +214 -62
  286. ccxt/kucoin.py +715 -396
  287. ccxt/kucoinfutures.py +652 -89
  288. ccxt/latoken.py +217 -113
  289. ccxt/lbank.py +425 -97
  290. ccxt/luno.py +382 -35
  291. ccxt/mercado.py +113 -6
  292. ccxt/mexc.py +873 -437
  293. ccxt/modetrade.py +2818 -0
  294. ccxt/myokx.py +54 -0
  295. ccxt/ndax.py +221 -64
  296. ccxt/nobitex.py +30 -36
  297. ccxt/novadax.py +190 -34
  298. ccxt/oceanex.py +217 -28
  299. ccxt/okcoin.py +253 -145
  300. ccxt/okexchange.py +9 -9
  301. ccxt/okx.py +1088 -351
  302. ccxt/okxus.py +54 -0
  303. ccxt/ompfinex.py +29 -24
  304. ccxt/onetrading.py +213 -392
  305. ccxt/oxfun.py +245 -166
  306. ccxt/p2b.py +151 -29
  307. ccxt/paradex.py +562 -49
  308. ccxt/paymium.py +82 -19
  309. ccxt/phemex.py +712 -172
  310. ccxt/poloniex.py +1601 -283
  311. ccxt/pro/__init__.py +76 -17
  312. ccxt/pro/alpaca.py +21 -6
  313. ccxt/pro/apex.py +984 -0
  314. ccxt/pro/ascendex.py +58 -10
  315. ccxt/pro/bequant.py +6 -1
  316. ccxt/pro/binance.py +728 -156
  317. ccxt/pro/binancecoinm.py +6 -2
  318. ccxt/pro/binanceus.py +8 -4
  319. ccxt/pro/binanceusdm.py +7 -2
  320. ccxt/pro/bingx.py +333 -142
  321. ccxt/pro/bitfinex.py +727 -262
  322. ccxt/pro/bitget.py +570 -79
  323. ccxt/pro/bithumb.py +20 -6
  324. ccxt/pro/bitmart.py +216 -87
  325. ccxt/pro/bitmex.py +47 -9
  326. ccxt/pro/bitopro.py +26 -14
  327. ccxt/pro/bitrue.py +22 -22
  328. ccxt/pro/bitstamp.py +54 -21
  329. ccxt/pro/{huobijp.py → bittrade.py} +7 -6
  330. ccxt/pro/bitvavo.py +191 -67
  331. ccxt/pro/blockchaincom.py +21 -8
  332. ccxt/pro/blofin.py +9 -1
  333. ccxt/pro/bybit.py +632 -245
  334. ccxt/pro/cex.py +59 -24
  335. ccxt/pro/coinbase.py +102 -73
  336. ccxt/pro/coinbaseadvanced.py +2 -1
  337. ccxt/pro/coinbaseexchange.py +8 -8
  338. ccxt/pro/coinbaseinternational.py +181 -25
  339. ccxt/pro/coincatch.py +6 -7
  340. ccxt/pro/coincheck.py +11 -6
  341. ccxt/pro/coinex.py +967 -665
  342. ccxt/pro/coinone.py +16 -9
  343. ccxt/pro/cryptocom.py +448 -45
  344. ccxt/pro/defx.py +831 -0
  345. ccxt/pro/deribit.py +150 -14
  346. ccxt/pro/derive.py +704 -0
  347. ccxt/pro/exmo.py +239 -6
  348. ccxt/pro/gate.py +623 -65
  349. ccxt/pro/gateio.py +2 -1
  350. ccxt/pro/gemini.py +27 -11
  351. ccxt/pro/hashkey.py +2 -2
  352. ccxt/pro/hitbtc.py +196 -91
  353. ccxt/pro/hollaex.py +23 -7
  354. ccxt/pro/htx.py +51 -14
  355. ccxt/pro/huobi.py +2 -1
  356. ccxt/pro/hyperliquid.py +591 -27
  357. ccxt/pro/independentreserve.py +9 -6
  358. ccxt/pro/kraken.py +640 -320
  359. ccxt/pro/krakenfutures.py +62 -35
  360. ccxt/pro/kucoin.py +267 -46
  361. ccxt/pro/kucoinfutures.py +165 -21
  362. ccxt/pro/lbank.py +102 -21
  363. ccxt/pro/luno.py +12 -8
  364. ccxt/pro/mexc.py +877 -111
  365. ccxt/pro/modetrade.py +1271 -0
  366. ccxt/pro/myokx.py +38 -0
  367. ccxt/pro/ndax.py +15 -2
  368. ccxt/pro/okcoin.py +23 -4
  369. ccxt/pro/okx.py +573 -98
  370. ccxt/pro/okxus.py +38 -0
  371. ccxt/pro/onetrading.py +30 -13
  372. ccxt/pro/oxfun.py +131 -27
  373. ccxt/pro/p2b.py +88 -22
  374. ccxt/pro/paradex.py +3 -3
  375. ccxt/pro/phemex.py +75 -21
  376. ccxt/pro/poloniex.py +124 -41
  377. ccxt/pro/probit.py +87 -80
  378. ccxt/pro/tradeogre.py +272 -0
  379. ccxt/pro/upbit.py +152 -12
  380. ccxt/pro/vertex.py +8 -3
  381. ccxt/pro/whitebit.py +58 -5
  382. ccxt/pro/woo.py +228 -37
  383. ccxt/pro/woofipro.py +106 -18
  384. ccxt/pro/xt.py +111 -5
  385. ccxt/probit.py +224 -95
  386. ccxt/protobuf/__init__.py +0 -0
  387. ccxt/protobuf/mexc/PrivateAccountV3Api_pb2.py +37 -0
  388. ccxt/protobuf/mexc/PrivateDealsV3Api_pb2.py +37 -0
  389. ccxt/protobuf/mexc/PrivateOrdersV3Api_pb2.py +37 -0
  390. ccxt/protobuf/mexc/PublicAggreBookTickerV3Api_pb2.py +37 -0
  391. ccxt/protobuf/mexc/PublicAggreDealsV3Api_pb2.py +39 -0
  392. ccxt/protobuf/mexc/PublicAggreDepthsV3Api_pb2.py +39 -0
  393. ccxt/protobuf/mexc/PublicBookTickerBatchV3Api_pb2.py +38 -0
  394. ccxt/protobuf/mexc/PublicBookTickerV3Api_pb2.py +37 -0
  395. ccxt/protobuf/mexc/PublicDealsV3Api_pb2.py +39 -0
  396. ccxt/protobuf/mexc/PublicIncreaseDepthsBatchV3Api_pb2.py +38 -0
  397. ccxt/protobuf/mexc/PublicIncreaseDepthsV3Api_pb2.py +39 -0
  398. ccxt/protobuf/mexc/PublicLimitDepthsV3Api_pb2.py +39 -0
  399. ccxt/protobuf/mexc/PublicMiniTickerV3Api_pb2.py +37 -0
  400. ccxt/protobuf/mexc/PublicMiniTickersV3Api_pb2.py +38 -0
  401. ccxt/protobuf/mexc/PublicSpotKlineV3Api_pb2.py +37 -0
  402. ccxt/protobuf/mexc/PushDataV3ApiWrapper_pb2.py +52 -0
  403. ccxt/protobuf/mexc/__init__.py +0 -0
  404. ccxt/ramzinex.py +32 -28
  405. ccxt/sarmayex.py +7 -7
  406. ccxt/sarrafex.py +10 -10
  407. ccxt/static_dependencies/__init__.py +1 -1
  408. ccxt/static_dependencies/lark/py.typed +0 -0
  409. ccxt/static_dependencies/marshmallow/py.typed +0 -0
  410. ccxt/static_dependencies/marshmallow_dataclass/py.typed +0 -0
  411. ccxt/static_dependencies/marshmallow_oneofschema/py.typed +0 -0
  412. ccxt/tabdeal.py +13 -12
  413. ccxt/test/tests_async.py +261 -57
  414. ccxt/test/tests_helpers.py +1 -3
  415. ccxt/test/tests_init.py +4 -3
  416. ccxt/test/tests_sync.py +261 -57
  417. ccxt/tetherland.py +7 -7
  418. ccxt/timex.py +210 -51
  419. ccxt/tokocrypto.py +167 -47
  420. ccxt/tradeogre.py +266 -31
  421. ccxt/twox.py +7 -7
  422. ccxt/ubitex.py +9 -9
  423. ccxt/upbit.py +568 -165
  424. ccxt/vertex.py +160 -32
  425. ccxt/wallex.py +9 -9
  426. ccxt/wavesexchange.py +165 -30
  427. ccxt/whitebit.py +975 -127
  428. ccxt/woo.py +1917 -1016
  429. ccxt/woofipro.py +432 -141
  430. ccxt/xt.py +649 -193
  431. ccxt/yobit.py +194 -70
  432. ccxt/zaif.py +91 -15
  433. ccxt/zonda.py +151 -36
  434. {ccxt_ir-4.3.46.0.3.dist-info → ccxt_ir-4.5.1.dist-info}/METADATA +225 -73
  435. ccxt_ir-4.5.1.dist-info/RECORD +743 -0
  436. {ccxt_ir-4.3.46.0.3.dist-info → ccxt_ir-4.5.1.dist-info}/WHEEL +1 -1
  437. ccxt/__test__.py +0 -7
  438. ccxt/abstract/ace.py +0 -15
  439. ccxt/abstract/bitbay.py +0 -53
  440. ccxt/abstract/bitcoincom.py +0 -115
  441. ccxt/abstract/bitfinex2.py +0 -139
  442. ccxt/abstract/bitpanda.py +0 -35
  443. ccxt/abstract/bl3p.py +0 -19
  444. ccxt/abstract/coinlist.py +0 -54
  445. ccxt/abstract/currencycom.py +0 -68
  446. ccxt/abstract/hitbtc3.py +0 -115
  447. ccxt/abstract/idex.py +0 -26
  448. ccxt/abstract/kuna.py +0 -182
  449. ccxt/abstract/lykke.py +0 -29
  450. ccxt/abstract/poloniexfutures.py +0 -48
  451. ccxt/abstract/wazirx.py +0 -30
  452. ccxt/ace.py +0 -1012
  453. ccxt/async_support/ace.py +0 -1012
  454. ccxt/async_support/base/ws/aiohttp_client.py +0 -125
  455. ccxt/async_support/base/ws/fast_client.py +0 -96
  456. ccxt/async_support/bitbay.py +0 -17
  457. ccxt/async_support/bitcoincom.py +0 -17
  458. ccxt/async_support/bitfinex2.py +0 -3552
  459. ccxt/async_support/bitpanda.py +0 -16
  460. ccxt/async_support/bl3p.py +0 -485
  461. ccxt/async_support/coinlist.py +0 -2243
  462. ccxt/async_support/currencycom.py +0 -1950
  463. ccxt/async_support/hitbtc3.py +0 -16
  464. ccxt/async_support/idex.py +0 -1766
  465. ccxt/async_support/kuna.py +0 -1841
  466. ccxt/async_support/lykke.py +0 -1270
  467. ccxt/async_support/poloniexfutures.py +0 -1717
  468. ccxt/async_support/wazirx.py +0 -1224
  469. ccxt/bitbay.py +0 -17
  470. ccxt/bitcoincom.py +0 -17
  471. ccxt/bitfinex2.py +0 -3552
  472. ccxt/bitpanda.py +0 -16
  473. ccxt/bl3p.py +0 -485
  474. ccxt/coinlist.py +0 -2243
  475. ccxt/currencycom.py +0 -1950
  476. ccxt/hitbtc3.py +0 -16
  477. ccxt/idex.py +0 -1766
  478. ccxt/kuna.py +0 -1841
  479. ccxt/lykke.py +0 -1270
  480. ccxt/poloniexfutures.py +0 -1717
  481. ccxt/pro/bitcoincom.py +0 -34
  482. ccxt/pro/bitfinex2.py +0 -1083
  483. ccxt/pro/bitpanda.py +0 -15
  484. ccxt/pro/currencycom.py +0 -536
  485. ccxt/pro/idex.py +0 -672
  486. ccxt/pro/poloniexfutures.py +0 -990
  487. ccxt/pro/wazirx.py +0 -749
  488. ccxt/test/base/__init__.py +0 -29
  489. ccxt/test/base/test_account.py +0 -26
  490. ccxt/test/base/test_balance.py +0 -56
  491. ccxt/test/base/test_borrow_interest.py +0 -35
  492. ccxt/test/base/test_borrow_rate.py +0 -32
  493. ccxt/test/base/test_calculate_fee.py +0 -51
  494. ccxt/test/base/test_crypto.py +0 -127
  495. ccxt/test/base/test_currency.py +0 -76
  496. ccxt/test/base/test_datetime.py +0 -109
  497. ccxt/test/base/test_decimal_to_precision.py +0 -392
  498. ccxt/test/base/test_deep_extend.py +0 -68
  499. ccxt/test/base/test_deposit_withdrawal.py +0 -50
  500. ccxt/test/base/test_exchange_datetime_functions.py +0 -76
  501. ccxt/test/base/test_funding_rate_history.py +0 -29
  502. ccxt/test/base/test_last_price.py +0 -31
  503. ccxt/test/base/test_ledger_entry.py +0 -45
  504. ccxt/test/base/test_ledger_item.py +0 -48
  505. ccxt/test/base/test_leverage_tier.py +0 -33
  506. ccxt/test/base/test_liquidation.py +0 -50
  507. ccxt/test/base/test_margin_mode.py +0 -24
  508. ccxt/test/base/test_margin_modification.py +0 -35
  509. ccxt/test/base/test_market.py +0 -193
  510. ccxt/test/base/test_number.py +0 -411
  511. ccxt/test/base/test_ohlcv.py +0 -33
  512. ccxt/test/base/test_open_interest.py +0 -32
  513. ccxt/test/base/test_order.py +0 -64
  514. ccxt/test/base/test_order_book.py +0 -69
  515. ccxt/test/base/test_position.py +0 -60
  516. ccxt/test/base/test_shared_methods.py +0 -353
  517. ccxt/test/base/test_status.py +0 -24
  518. ccxt/test/base/test_throttle.py +0 -126
  519. ccxt/test/base/test_ticker.py +0 -92
  520. ccxt/test/base/test_trade.py +0 -47
  521. ccxt/test/base/test_trading_fee.py +0 -26
  522. ccxt/test/base/test_transaction.py +0 -39
  523. ccxt/test/test_async.py +0 -1649
  524. ccxt/test/test_sync.py +0 -1648
  525. ccxt/wazirx.py +0 -1224
  526. ccxt_ir-4.3.46.0.3.dist-info/RECORD +0 -773
  527. /ccxt/abstract/{huobijp.py → bittrade.py} +0 -0
  528. {ccxt_ir-4.3.46.0.3.dist-info → ccxt_ir-4.5.1.dist-info/licenses}/LICENSE.txt +0 -0
  529. {ccxt_ir-4.3.46.0.3.dist-info → ccxt_ir-4.5.1.dist-info}/top_level.txt +0 -0
@@ -5,9 +5,9 @@
5
5
 
6
6
  from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.woofipro import ImplicitAPI
8
- from ccxt.base.types import Balances, Currencies, Currency, Int, Leverage, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Trade, TradingFees, Transaction
8
+ import asyncio
9
+ from ccxt.base.types import Any, Balances, Currencies, Currency, Int, LedgerEntry, Leverage, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Position, Str, Strings, FundingRate, FundingRates, Trade, TradingFees, Transaction
9
10
  from typing import List
10
- from typing import Any
11
11
  from ccxt.base.errors import ExchangeError
12
12
  from ccxt.base.errors import AuthenticationError
13
13
  from ccxt.base.errors import ArgumentsRequired
@@ -23,7 +23,7 @@ from ccxt.base.precise import Precise
23
23
 
24
24
  class woofipro(Exchange, ImplicitAPI):
25
25
 
26
- def describe(self):
26
+ def describe(self) -> Any:
27
27
  return self.deep_extend(super(woofipro, self).describe(), {
28
28
  'id': 'woofipro',
29
29
  'name': 'WOOFI PRO',
@@ -77,6 +77,8 @@ class woofipro(Exchange, ImplicitAPI):
77
77
  'fetchDeposits': True,
78
78
  'fetchDepositsWithdrawals': True,
79
79
  'fetchFundingHistory': True,
80
+ 'fetchFundingInterval': True,
81
+ 'fetchFundingIntervals': False,
80
82
  'fetchFundingRate': True,
81
83
  'fetchFundingRateHistory': True,
82
84
  'fetchFundingRates': True,
@@ -131,7 +133,7 @@ class woofipro(Exchange, ImplicitAPI):
131
133
  '1y': '1y',
132
134
  },
133
135
  'urls': {
134
- 'logo': 'https://github.com/ccxt/ccxt/assets/43336371/b1e7b348-a0fc-4605-8b7f-91176958fd69',
136
+ 'logo': 'https://github.com/user-attachments/assets/9ba21b8a-a9c7-4770-b7f1-ce3bcbde68c1',
135
137
  'api': {
136
138
  'public': 'https://api-evm.orderly.org',
137
139
  'private': 'https://api-evm.orderly.org',
@@ -306,6 +308,95 @@ class woofipro(Exchange, ImplicitAPI):
306
308
  'brokerId': 'CCXT',
307
309
  'verifyingContractAddress': '0x6F7a338F2aA472838dEFD3283eB360d4Dff5D203',
308
310
  },
311
+ 'features': {
312
+ 'default': {
313
+ 'sandbox': True,
314
+ 'createOrder': {
315
+ 'marginMode': False,
316
+ 'triggerPrice': True,
317
+ 'triggerPriceType': None,
318
+ 'triggerDirection': False,
319
+ 'stopLossPrice': False, # todo by triggerPrice
320
+ 'takeProfitPrice': False, # todo by triggerPrice
321
+ 'attachedStopLossTakeProfit': None,
322
+ 'timeInForce': {
323
+ 'IOC': True,
324
+ 'FOK': True,
325
+ 'PO': True,
326
+ 'GTD': False,
327
+ },
328
+ 'hedged': False,
329
+ 'trailing': True,
330
+ 'leverage': True, # todo implement
331
+ 'marketBuyByCost': False,
332
+ 'marketBuyRequiresPrice': False,
333
+ 'selfTradePrevention': False,
334
+ 'iceberg': True, # todo implement
335
+ },
336
+ 'createOrders': {
337
+ 'max': 10,
338
+ },
339
+ 'fetchMyTrades': {
340
+ 'marginMode': False,
341
+ 'limit': 500,
342
+ 'daysBack': None,
343
+ 'untilDays': 100000,
344
+ 'symbolRequired': False,
345
+ },
346
+ 'fetchOrder': {
347
+ 'marginMode': False,
348
+ 'trigger': True,
349
+ 'trailing': False,
350
+ 'symbolRequired': False,
351
+ },
352
+ 'fetchOpenOrders': {
353
+ 'marginMode': False,
354
+ 'limit': 500,
355
+ 'trigger': True,
356
+ 'trailing': False,
357
+ 'symbolRequired': False,
358
+ },
359
+ 'fetchOrders': None,
360
+ 'fetchClosedOrders': {
361
+ 'marginMode': False,
362
+ 'limit': 500,
363
+ 'daysBack': None,
364
+ 'daysBackCanceled': None,
365
+ 'untilDays': 100000,
366
+ 'trigger': True,
367
+ 'trailing': False,
368
+ 'symbolRequired': False,
369
+ },
370
+ 'fetchOHLCV': {
371
+ 'limit': 1000,
372
+ },
373
+ },
374
+ 'spot': {
375
+ 'extends': 'default',
376
+ },
377
+ 'forDerivatives': {
378
+ 'extends': 'default',
379
+ 'createOrder': {
380
+ # todo: implementation needs unification
381
+ 'triggerPriceType': None,
382
+ 'attachedStopLossTakeProfit': {
383
+ # todo: implementation needs unification
384
+ 'triggerPriceType': None,
385
+ 'price': False,
386
+ },
387
+ },
388
+ },
389
+ 'swap': {
390
+ 'linear': {
391
+ 'extends': 'forDerivatives',
392
+ },
393
+ 'inverse': None,
394
+ },
395
+ 'future': {
396
+ 'linear': None,
397
+ 'inverse': None,
398
+ },
399
+ },
309
400
  'commonCurrencies': {},
310
401
  'exceptions': {
311
402
  'exact': {
@@ -347,7 +438,9 @@ class woofipro(Exchange, ImplicitAPI):
347
438
  async def fetch_status(self, params={}):
348
439
  """
349
440
  the latest known information on the availability of the exchange API
350
- :see: https://orderly.network/docs/build-on-evm/evm-api/restful-api/public/get-system-maintenance-status
441
+
442
+ https://orderly.network/docs/build-on-evm/evm-api/restful-api/public/get-system-maintenance-status
443
+
351
444
  :param dict [params]: extra parameters specific to the exchange API endpoint
352
445
  :returns dict: a `status structure <https://docs.ccxt.com/#/?id=exchange-status-structure>`
353
446
  """
@@ -378,10 +471,12 @@ class woofipro(Exchange, ImplicitAPI):
378
471
  'info': response,
379
472
  }
380
473
 
381
- async def fetch_time(self, params={}):
474
+ async def fetch_time(self, params={}) -> Int:
382
475
  """
383
476
  fetches the current integer timestamp in milliseconds from the exchange server
384
- :see: https://orderly.network/docs/build-on-evm/evm-api/restful-api/public/get-system-maintenance-status
477
+
478
+ https://orderly.network/docs/build-on-evm/evm-api/restful-api/public/get-system-maintenance-status
479
+
385
480
  :param dict [params]: extra parameters specific to the exchange API endpoint
386
481
  :returns int: the current integer timestamp in milliseconds from the exchange server
387
482
  """
@@ -454,7 +549,7 @@ class woofipro(Exchange, ImplicitAPI):
454
549
  'active': None,
455
550
  'contract': True,
456
551
  'linear': True,
457
- 'inverse': None,
552
+ 'inverse': False,
458
553
  'contractSize': self.parse_number('1'),
459
554
  'expiry': None,
460
555
  'expiryDatetime': None,
@@ -489,7 +584,9 @@ class woofipro(Exchange, ImplicitAPI):
489
584
  async def fetch_markets(self, params={}) -> List[Market]:
490
585
  """
491
586
  retrieves data on all markets for woofipro
492
- :see: https://orderly.network/docs/build-on-evm/evm-api/restful-api/public/get-available-symbols
587
+
588
+ https://orderly.network/docs/build-on-evm/evm-api/restful-api/public/get-available-symbols
589
+
493
590
  :param dict [params]: extra parameters specific to the exchange API endpoint
494
591
  :returns dict[]: an array of objects representing market data
495
592
  """
@@ -536,12 +633,15 @@ class woofipro(Exchange, ImplicitAPI):
536
633
  async def fetch_currencies(self, params={}) -> Currencies:
537
634
  """
538
635
  fetches all available currencies on an exchange
539
- :see: https://orderly.network/docs/build-on-evm/evm-api/restful-api/public/get-token-info
636
+
637
+ https://orderly.network/docs/build-on-omnichain/evm-api/restful-api/public/get-supported-collateral-info#get-supported-collateral-info
638
+ https://orderly.network/docs/build-on-omnichain/evm-api/restful-api/public/get-supported-chains-per-builder#get-supported-chains-per-builder
639
+
540
640
  :param dict [params]: extra parameters specific to the exchange API endpoint
541
641
  :returns dict: an associative dictionary of currencies
542
642
  """
543
643
  result: dict = {}
544
- response = await self.v1PublicGetPublicToken(params)
644
+ tokenPromise = self.v1PublicGetPublicToken(params)
545
645
  #
546
646
  # {
547
647
  # "success": True,
@@ -564,25 +664,28 @@ class woofipro(Exchange, ImplicitAPI):
564
664
  # }
565
665
  # }
566
666
  #
567
- data = self.safe_dict(response, 'data', {})
568
- tokenRows = self.safe_list(data, 'rows', [])
667
+ chainPromise = self.v1PublicGetPublicChainInfo(params)
668
+ tokenResponse, chainResponse = await asyncio.gather(*[tokenPromise, chainPromise])
669
+ tokenData = self.safe_dict(tokenResponse, 'data', {})
670
+ tokenRows = self.safe_list(tokenData, 'rows', [])
671
+ chainData = self.safe_dict(chainResponse, 'data', {})
672
+ chainRows = self.safe_list(chainData, 'rows', [])
673
+ indexedChains = self.index_by(chainRows, 'chain_id')
569
674
  for i in range(0, len(tokenRows)):
570
675
  token = tokenRows[i]
571
676
  currencyId = self.safe_string(token, 'token')
572
677
  networks = self.safe_list(token, 'chain_details')
573
678
  code = self.safe_currency_code(currencyId)
574
- minPrecision = None
575
679
  resultingNetworks: dict = {}
576
680
  for j in range(0, len(networks)):
577
- network = networks[j]
578
- # TODO: transform chain id to human readable name
579
- networkId = self.safe_string(network, 'chain_id')
580
- precision = self.parse_precision(self.safe_string(network, 'decimals'))
581
- if precision is not None:
582
- minPrecision = precision if (minPrecision is None) else Precise.string_min(precision, minPrecision)
583
- resultingNetworks[networkId] = {
681
+ networkEntry = networks[j]
682
+ networkId = self.safe_string(networkEntry, 'chain_id')
683
+ networkRow = self.safe_dict(indexedChains, networkId)
684
+ networkName = self.safe_string(networkRow, 'name')
685
+ networkCode = self.network_id_to_code(networkName, code)
686
+ resultingNetworks[networkCode] = {
584
687
  'id': networkId,
585
- 'network': networkId,
688
+ 'network': networkCode,
586
689
  'limits': {
587
690
  'withdraw': {
588
691
  'min': None,
@@ -596,15 +699,15 @@ class woofipro(Exchange, ImplicitAPI):
596
699
  'active': None,
597
700
  'deposit': None,
598
701
  'withdraw': None,
599
- 'fee': self.safe_number(network, 'withdrawal_fee'),
600
- 'precision': self.parse_number(precision),
601
- 'info': network,
702
+ 'fee': self.safe_number(networkEntry, 'withdrawal_fee'),
703
+ 'precision': self.parse_number(self.parse_precision(self.safe_string(networkEntry, 'decimals'))),
704
+ 'info': [networkEntry, networkRow],
602
705
  }
603
- result[code] = {
706
+ result[code] = self.safe_currency_structure({
604
707
  'id': currencyId,
605
- 'name': currencyId,
708
+ 'name': None,
606
709
  'code': code,
607
- 'precision': self.parse_number(minPrecision),
710
+ 'precision': None,
608
711
  'active': None,
609
712
  'fee': None,
610
713
  'networks': resultingNetworks,
@@ -621,7 +724,7 @@ class woofipro(Exchange, ImplicitAPI):
621
724
  },
622
725
  },
623
726
  'info': token,
624
- }
727
+ })
625
728
  return result
626
729
 
627
730
  def parse_token_and_fee_temp(self, item, feeTokenKey, feeAmountKey):
@@ -673,6 +776,9 @@ class woofipro(Exchange, ImplicitAPI):
673
776
  amount = self.safe_string(trade, 'executed_quantity')
674
777
  order_id = self.safe_string(trade, 'order_id')
675
778
  fee = self.parse_token_and_fee_temp(trade, 'fee_asset', 'fee')
779
+ feeCost = self.safe_string(fee, 'cost')
780
+ if feeCost is not None:
781
+ fee['cost'] = feeCost
676
782
  cost = Precise.string_mul(price, amount)
677
783
  side = self.safe_string_lower(trade, 'side')
678
784
  id = self.safe_string(trade, 'id')
@@ -699,7 +805,9 @@ class woofipro(Exchange, ImplicitAPI):
699
805
  async def fetch_trades(self, symbol: str, since: Int = None, limit: Int = None, params={}) -> List[Trade]:
700
806
  """
701
807
  get the list of most recent trades for a particular symbol
702
- :see: https://orderly.network/docs/build-on-evm/evm-api/restful-api/public/get-market-trades
808
+
809
+ https://orderly.network/docs/build-on-evm/evm-api/restful-api/public/get-market-trades
810
+
703
811
  :param str symbol: unified symbol of the market to fetch trades for
704
812
  :param int [since]: timestamp in ms of the earliest trade to fetch
705
813
  :param int [limit]: the maximum amount of trades to fetch
@@ -733,7 +841,7 @@ class woofipro(Exchange, ImplicitAPI):
733
841
  rows = self.safe_list(data, 'rows', [])
734
842
  return self.parse_trades(rows, market, since, limit)
735
843
 
736
- def parse_funding_rate(self, fundingRate, market: Market = None):
844
+ def parse_funding_rate(self, fundingRate, market: Market = None) -> FundingRate:
737
845
  #
738
846
  # {
739
847
  # "symbol":"PERP_AAVE_USDT",
@@ -745,12 +853,14 @@ class woofipro(Exchange, ImplicitAPI):
745
853
  # "sum_unitary_funding": 521.367
746
854
  # }
747
855
  #
748
- #
749
856
  symbol = self.safe_string(fundingRate, 'symbol')
750
857
  market = self.market(symbol)
751
858
  nextFundingTimestamp = self.safe_integer(fundingRate, 'next_funding_time')
752
859
  estFundingRateTimestamp = self.safe_integer(fundingRate, 'est_funding_rate_timestamp')
753
860
  lastFundingRateTimestamp = self.safe_integer(fundingRate, 'last_funding_rate_timestamp')
861
+ fundingTimeString = self.safe_string(fundingRate, 'last_funding_rate_timestamp')
862
+ nextFundingTimeString = self.safe_string(fundingRate, 'next_funding_time')
863
+ millisecondsInterval = Precise.string_sub(nextFundingTimeString, fundingTimeString)
754
864
  return {
755
865
  'info': fundingRate,
756
866
  'symbol': market['symbol'],
@@ -769,12 +879,37 @@ class woofipro(Exchange, ImplicitAPI):
769
879
  'previousFundingRate': self.safe_number(fundingRate, 'last_funding_rate'),
770
880
  'previousFundingTimestamp': lastFundingRateTimestamp,
771
881
  'previousFundingDatetime': self.iso8601(lastFundingRateTimestamp),
882
+ 'interval': self.parse_funding_interval(millisecondsInterval),
883
+ }
884
+
885
+ def parse_funding_interval(self, interval):
886
+ intervals: dict = {
887
+ '3600000': '1h',
888
+ '14400000': '4h',
889
+ '28800000': '8h',
890
+ '57600000': '16h',
891
+ '86400000': '24h',
772
892
  }
893
+ return self.safe_string(intervals, interval, interval)
773
894
 
774
- async def fetch_funding_rate(self, symbol: str, params={}):
895
+ async def fetch_funding_interval(self, symbol: str, params={}) -> FundingRate:
896
+ """
897
+ fetch the current funding rate interval
898
+
899
+ https://orderly.network/docs/build-on-evm/evm-api/restful-api/public/get-predicted-funding-rate-for-one-market
900
+
901
+ :param str symbol: unified market symbol
902
+ :param dict [params]: extra parameters specific to the exchange API endpoint
903
+ :returns dict: a `funding rate structure <https://docs.ccxt.com/#/?id=funding-rate-structure>`
904
+ """
905
+ return await self.fetch_funding_rate(symbol, params)
906
+
907
+ async def fetch_funding_rate(self, symbol: str, params={}) -> FundingRate:
775
908
  """
776
909
  fetch the current funding rate
777
- :see: https://orderly.network/docs/build-on-evm/evm-api/restful-api/public/get-predicted-funding-rate-for-one-market
910
+
911
+ https://orderly.network/docs/build-on-evm/evm-api/restful-api/public/get-predicted-funding-rate-for-one-market
912
+
778
913
  :param str symbol: unified market symbol
779
914
  :param dict [params]: extra parameters specific to the exchange API endpoint
780
915
  :returns dict: a `funding rate structure <https://docs.ccxt.com/#/?id=funding-rate-structure>`
@@ -803,10 +938,12 @@ class woofipro(Exchange, ImplicitAPI):
803
938
  data = self.safe_dict(response, 'data', {})
804
939
  return self.parse_funding_rate(data, market)
805
940
 
806
- async def fetch_funding_rates(self, symbols: Strings = None, params={}):
941
+ async def fetch_funding_rates(self, symbols: Strings = None, params={}) -> FundingRates:
807
942
  """
808
- fetch the current funding rates
809
- :see: https://orderly.network/docs/build-on-evm/evm-api/restful-api/public/get-predicted-funding-rates-for-all-markets
943
+ fetch the current funding rate for multiple markets
944
+
945
+ https://orderly.network/docs/build-on-evm/evm-api/restful-api/public/get-predicted-funding-rates-for-all-markets
946
+
810
947
  :param str[] symbols: unified market symbols
811
948
  :param dict [params]: extra parameters specific to the exchange API endpoint
812
949
  :returns dict[]: an array of `funding rate structures <https://docs.ccxt.com/#/?id=funding-rate-structure>`
@@ -833,13 +970,14 @@ class woofipro(Exchange, ImplicitAPI):
833
970
  #
834
971
  data = self.safe_dict(response, 'data', {})
835
972
  rows = self.safe_list(data, 'rows', [])
836
- result = self.parse_funding_rates(rows)
837
- return self.filter_by_array(result, 'symbol', symbols)
973
+ return self.parse_funding_rates(rows, symbols)
838
974
 
839
975
  async def fetch_funding_rate_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
840
976
  """
841
977
  fetches historical funding rate prices
842
- :see: https://orderly.network/docs/build-on-evm/evm-api/restful-api/public/get-funding-rate-history-for-one-market
978
+
979
+ https://orderly.network/docs/build-on-evm/evm-api/restful-api/public/get-funding-rate-history-for-one-market
980
+
843
981
  :param str symbol: unified symbol of the market to fetch the funding rate history for
844
982
  :param int [since]: timestamp in ms of the earliest funding rate to fetch
845
983
  :param int [limit]: the maximum amount of `funding rate structures <https://docs.ccxt.com/#/?id=funding-rate-history-structure>` to fetch
@@ -898,10 +1036,103 @@ class woofipro(Exchange, ImplicitAPI):
898
1036
  sorted = self.sort_by(rates, 'timestamp')
899
1037
  return self.filter_by_symbol_since_limit(sorted, symbol, since, limit)
900
1038
 
1039
+ def parse_income(self, income, market: Market = None):
1040
+ #
1041
+ # {
1042
+ # "symbol": "PERP_ETH_USDC",
1043
+ # "funding_rate": 0.00046875,
1044
+ # "mark_price": 2100,
1045
+ # "funding_fee": 0.000016,
1046
+ # "payment_type": "Pay",
1047
+ # "status": "Accrued",
1048
+ # "created_time": 1682235722003,
1049
+ # "updated_time": 1682235722003
1050
+ # }
1051
+ #
1052
+ marketId = self.safe_string(income, 'symbol')
1053
+ symbol = self.safe_symbol(marketId, market)
1054
+ amount = self.safe_string(income, 'funding_fee')
1055
+ code = self.safe_currency_code('USDC')
1056
+ timestamp = self.safe_integer(income, 'updated_time')
1057
+ rate = self.safe_number(income, 'funding_rate')
1058
+ paymentType = self.safe_string(income, 'payment_type')
1059
+ amount = Precise.string_neg(amount) if (paymentType == 'Pay') else amount
1060
+ return {
1061
+ 'info': income,
1062
+ 'symbol': symbol,
1063
+ 'code': code,
1064
+ 'timestamp': timestamp,
1065
+ 'datetime': self.iso8601(timestamp),
1066
+ 'id': None,
1067
+ 'amount': self.parse_number(amount),
1068
+ 'rate': rate,
1069
+ }
1070
+
1071
+ async def fetch_funding_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
1072
+ """
1073
+ fetch the history of funding payments paid and received on self account
1074
+
1075
+ https://orderly.network/docs/build-on-omnichain/evm-api/restful-api/private/get-funding-fee-history
1076
+
1077
+ :param str [symbol]: unified market symbol
1078
+ :param int [since]: the earliest time in ms to fetch funding history for
1079
+ :param int [limit]: the maximum number of funding history structures to retrieve
1080
+ :param dict [params]: extra parameters specific to the exchange API endpoint
1081
+ :param boolean [params.paginate]: default False, when True will automatically paginate by calling self endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
1082
+ :returns dict: a `funding history structure <https://docs.ccxt.com/#/?id=funding-history-structure>`
1083
+ """
1084
+ await self.load_markets()
1085
+ paginate = False
1086
+ paginate, params = self.handle_option_and_params(params, 'fetchFundingHistory', 'paginate')
1087
+ if paginate:
1088
+ return await self.fetch_paginated_call_incremental('fetchFundingHistory', symbol, since, limit, params, 'page', 500)
1089
+ request: dict = {}
1090
+ market: Market = None
1091
+ if symbol is not None:
1092
+ market = self.market(symbol)
1093
+ request['symbol'] = market['id']
1094
+ if since is not None:
1095
+ request['start_t'] = since
1096
+ until = self.safe_integer(params, 'until') # unified in milliseconds
1097
+ params = self.omit(params, ['until'])
1098
+ if until is not None:
1099
+ request['end_t'] = until
1100
+ if limit is not None:
1101
+ request['size'] = min(limit, 500)
1102
+ response = await self.v1PrivateGetFundingFeeHistory(self.extend(request, params))
1103
+ #
1104
+ # {
1105
+ # "success": True,
1106
+ # "timestamp": 1702989203989,
1107
+ # "data": {
1108
+ # "meta": {
1109
+ # "total": 9,
1110
+ # "records_per_page": 25,
1111
+ # "current_page": 1
1112
+ # },
1113
+ # "rows": [{
1114
+ # "symbol": "PERP_ETH_USDC",
1115
+ # "funding_rate": 0.00046875,
1116
+ # "mark_price": 2100,
1117
+ # "funding_fee": 0.000016,
1118
+ # "payment_type": "Pay",
1119
+ # "status": "Accrued",
1120
+ # "created_time": 1682235722003,
1121
+ # "updated_time": 1682235722003
1122
+ # }]
1123
+ # }
1124
+ # }
1125
+ #
1126
+ data = self.safe_dict(response, 'data', {})
1127
+ rows = self.safe_list(data, 'rows', [])
1128
+ return self.parse_incomes(rows, market, since, limit)
1129
+
901
1130
  async def fetch_trading_fees(self, params={}) -> TradingFees:
902
1131
  """
903
1132
  fetch the trading fees for multiple markets
904
- :see: https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/get-account-information
1133
+
1134
+ https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/get-account-information
1135
+
905
1136
  :param dict [params]: extra parameters specific to the exchange API endpoint
906
1137
  :returns dict: a dictionary of `fee structures <https://docs.ccxt.com/#/?id=fee-structure>` indexed by market symbols
907
1138
  """
@@ -953,7 +1184,9 @@ class woofipro(Exchange, ImplicitAPI):
953
1184
  async def fetch_order_book(self, symbol: str, limit: Int = None, params={}) -> OrderBook:
954
1185
  """
955
1186
  fetches information on open orders with bid(buy) and ask(sell) prices, volumes and other data
956
- :see: https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/orderbook-snapshot
1187
+
1188
+ https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/orderbook-snapshot
1189
+
957
1190
  :param str symbol: unified symbol of the market to fetch the order book for
958
1191
  :param int [limit]: the maximum amount of order book entries to return
959
1192
  :param dict [params]: extra parameters specific to the exchange API endpoint
@@ -1001,7 +1234,9 @@ class woofipro(Exchange, ImplicitAPI):
1001
1234
 
1002
1235
  async def fetch_ohlcv(self, symbol: str, timeframe='1m', since: Int = None, limit: Int = None, params={}) -> List[list]:
1003
1236
  """
1004
- :see: https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/get-kline
1237
+
1238
+ https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/get-kline
1239
+
1005
1240
  fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
1006
1241
  :param str symbol: unified symbol of the market to fetch OHLCV data for
1007
1242
  :param str timeframe: the length of time each candle represents
@@ -1110,7 +1345,7 @@ class woofipro(Exchange, ImplicitAPI):
1110
1345
  fee = self.safe_value_2(order, 'total_fee', 'totalFee')
1111
1346
  feeCurrency = self.safe_string_2(order, 'fee_asset', 'feeAsset')
1112
1347
  transactions = self.safe_value(order, 'Transactions')
1113
- stopPrice = self.safe_number(order, 'triggerPrice')
1348
+ triggerPrice = self.safe_number(order, 'triggerPrice')
1114
1349
  takeProfitPrice: Num = None
1115
1350
  stopLossPrice: Num = None
1116
1351
  childOrders = self.safe_value(order, 'childOrders')
@@ -1139,8 +1374,7 @@ class woofipro(Exchange, ImplicitAPI):
1139
1374
  'reduceOnly': self.safe_bool(order, 'reduce_only'),
1140
1375
  'side': side,
1141
1376
  'price': price,
1142
- 'stopPrice': stopPrice,
1143
- 'triggerPrice': stopPrice,
1377
+ 'triggerPrice': triggerPrice,
1144
1378
  'takeProfitPrice': takeProfitPrice,
1145
1379
  'stopLossPrice': stopLossPrice,
1146
1380
  'average': average,
@@ -1190,13 +1424,13 @@ class woofipro(Exchange, ImplicitAPI):
1190
1424
 
1191
1425
  def create_order_request(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
1192
1426
  """
1193
- * @ignore
1427
+ @ignore
1194
1428
  helper function to build the request
1195
1429
  :param str symbol: unified symbol of the market to create an order in
1196
1430
  :param str type: 'market' or 'limit'
1197
1431
  :param str side: 'buy' or 'sell'
1198
1432
  :param float amount: how much you want to trade in units of the base currency
1199
- :param float [price]: the price that the order is to be fullfilled, in units of the quote currency, ignored in market orders
1433
+ :param float [price]: the price that the order is to be fulfilled, in units of the quote currency, ignored in market orders
1200
1434
  :param dict [params]: extra parameters specific to the exchange API endpoint
1201
1435
  :returns dict: request to be sent to the exchange
1202
1436
  """
@@ -1208,19 +1442,19 @@ class woofipro(Exchange, ImplicitAPI):
1208
1442
  'symbol': market['id'],
1209
1443
  'side': orderSide,
1210
1444
  }
1211
- stopPrice = self.safe_string_2(params, 'triggerPrice', 'stopPrice')
1445
+ triggerPrice = self.safe_string_2(params, 'triggerPrice', 'stopPrice')
1212
1446
  stopLoss = self.safe_value(params, 'stopLoss')
1213
1447
  takeProfit = self.safe_value(params, 'takeProfit')
1214
1448
  algoType = self.safe_string(params, 'algoType')
1215
- isStop = stopPrice is not None or stopLoss is not None or takeProfit is not None or (self.safe_value(params, 'childOrders') is not None)
1449
+ isConditional = triggerPrice is not None or stopLoss is not None or takeProfit is not None or (self.safe_value(params, 'childOrders') is not None)
1216
1450
  isMarket = orderType == 'MARKET'
1217
1451
  timeInForce = self.safe_string_lower(params, 'timeInForce')
1218
1452
  postOnly = self.is_post_only(isMarket, None, params)
1219
- orderQtyKey = 'quantity' if isStop else 'order_quantity'
1220
- priceKey = 'price' if isStop else 'order_price'
1221
- typeKey = 'type' if isStop else 'order_type'
1453
+ orderQtyKey = 'quantity' if isConditional else 'order_quantity'
1454
+ priceKey = 'price' if isConditional else 'order_price'
1455
+ typeKey = 'type' if isConditional else 'order_type'
1222
1456
  request[typeKey] = orderType # LIMIT/MARKET/IOC/FOK/POST_ONLY/ASK/BID
1223
- if not isStop:
1457
+ if not isConditional:
1224
1458
  if postOnly:
1225
1459
  request['order_type'] = 'POST_ONLY'
1226
1460
  elif timeInForce == 'fok':
@@ -1231,15 +1465,15 @@ class woofipro(Exchange, ImplicitAPI):
1231
1465
  request['reduce_only'] = reduceOnly
1232
1466
  if price is not None:
1233
1467
  request[priceKey] = self.price_to_precision(symbol, price)
1234
- if isMarket and not isStop:
1468
+ if isMarket and not isConditional:
1235
1469
  request[orderQtyKey] = self.amount_to_precision(symbol, amount)
1236
1470
  elif algoType != 'POSITIONAL_TP_SL':
1237
1471
  request[orderQtyKey] = self.amount_to_precision(symbol, amount)
1238
1472
  clientOrderId = self.safe_string_n(params, ['clOrdID', 'clientOrderId', 'client_order_id'])
1239
1473
  if clientOrderId is not None:
1240
1474
  request['client_order_id'] = clientOrderId
1241
- if stopPrice is not None:
1242
- request['trigger_price'] = self.price_to_precision(symbol, stopPrice)
1475
+ if triggerPrice is not None:
1476
+ request['trigger_price'] = self.price_to_precision(symbol, triggerPrice)
1243
1477
  request['algo_type'] = 'STOP'
1244
1478
  elif (stopLoss is not None) or (takeProfit is not None):
1245
1479
  request['algo_type'] = 'TP_SL'
@@ -1249,6 +1483,7 @@ class woofipro(Exchange, ImplicitAPI):
1249
1483
  'algo_type': 'POSITIONAL_TP_SL',
1250
1484
  'child_orders': [],
1251
1485
  }
1486
+ childOrders = outterOrder['child_orders']
1252
1487
  closeSide = 'SELL' if (orderSide == 'BUY') else 'BUY'
1253
1488
  if stopLoss is not None:
1254
1489
  stopLossPrice = self.safe_number_2(stopLoss, 'triggerPrice', 'price', stopLoss)
@@ -1259,7 +1494,7 @@ class woofipro(Exchange, ImplicitAPI):
1259
1494
  'type': 'LIMIT',
1260
1495
  'reduce_only': True,
1261
1496
  }
1262
- outterOrder['child_orders'].append(stopLossOrder)
1497
+ childOrders.append(stopLossOrder)
1263
1498
  if takeProfit is not None:
1264
1499
  takeProfitPrice = self.safe_number_2(takeProfit, 'triggerPrice', 'price', takeProfit)
1265
1500
  takeProfitOrder: dict = {
@@ -1269,7 +1504,7 @@ class woofipro(Exchange, ImplicitAPI):
1269
1504
  'type': 'LIMIT',
1270
1505
  'reduce_only': True,
1271
1506
  }
1272
- outterOrder['child_orders'].append(takeProfitOrder)
1507
+ outterOrder.append(takeProfitOrder)
1273
1508
  request['child_orders'] = [outterOrder]
1274
1509
  params = self.omit(params, ['reduceOnly', 'reduce_only', 'clOrdID', 'clientOrderId', 'client_order_id', 'postOnly', 'timeInForce', 'stopPrice', 'triggerPrice', 'stopLoss', 'takeProfit'])
1275
1510
  return self.extend(request, params)
@@ -1277,13 +1512,15 @@ class woofipro(Exchange, ImplicitAPI):
1277
1512
  async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
1278
1513
  """
1279
1514
  create a trade order
1280
- :see: https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/create-order
1281
- :see: https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/create-algo-order
1515
+
1516
+ https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/create-order
1517
+ https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/create-algo-order
1518
+
1282
1519
  :param str symbol: unified symbol of the market to create an order in
1283
1520
  :param str type: 'market' or 'limit'
1284
1521
  :param str side: 'buy' or 'sell'
1285
1522
  :param float amount: how much of currency you want to trade in units of base currency
1286
- :param float [price]: the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
1523
+ :param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
1287
1524
  :param dict [params]: extra parameters specific to the exchange API endpoint
1288
1525
  :param float [params.triggerPrice]: The price a trigger order is triggered at
1289
1526
  :param dict [params.takeProfit]: *takeProfit object in params* containing the triggerPrice at which the attached take profit order will be triggered(perpetual swap markets only)
@@ -1298,12 +1535,12 @@ class woofipro(Exchange, ImplicitAPI):
1298
1535
  await self.load_markets()
1299
1536
  market = self.market(symbol)
1300
1537
  request = self.create_order_request(symbol, type, side, amount, price, params)
1301
- stopPrice = self.safe_string_2(params, 'triggerPrice', 'stopPrice')
1538
+ triggerPrice = self.safe_string_2(params, 'triggerPrice', 'stopPrice')
1302
1539
  stopLoss = self.safe_value(params, 'stopLoss')
1303
1540
  takeProfit = self.safe_value(params, 'takeProfit')
1304
- isStop = stopPrice is not None or stopLoss is not None or takeProfit is not None or (self.safe_value(params, 'childOrders') is not None)
1541
+ isConditional = triggerPrice is not None or stopLoss is not None or takeProfit is not None or (self.safe_value(params, 'childOrders') is not None)
1305
1542
  response = None
1306
- if isStop:
1543
+ if isConditional:
1307
1544
  response = await self.v1PrivatePostAlgoOrder(request)
1308
1545
  #
1309
1546
  # {
@@ -1343,8 +1580,11 @@ class woofipro(Exchange, ImplicitAPI):
1343
1580
  async def create_orders(self, orders: List[OrderRequest], params={}):
1344
1581
  """
1345
1582
  *contract only* create a list of trade orders
1346
- :see: https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/batch-create-order
1583
+
1584
+ https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/batch-create-order
1585
+
1347
1586
  :param Array orders: list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
1587
+ :param dict [params]: extra parameters specific to the exchange API endpoint
1348
1588
  :returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
1349
1589
  """
1350
1590
  await self.load_markets()
@@ -1357,12 +1597,12 @@ class woofipro(Exchange, ImplicitAPI):
1357
1597
  amount = self.safe_value(rawOrder, 'amount')
1358
1598
  price = self.safe_value(rawOrder, 'price')
1359
1599
  orderParams = self.safe_dict(rawOrder, 'params', {})
1360
- stopPrice = self.safe_string_2(orderParams, 'triggerPrice', 'stopPrice')
1600
+ triggerPrice = self.safe_string_2(orderParams, 'triggerPrice', 'stopPrice')
1361
1601
  stopLoss = self.safe_value(orderParams, 'stopLoss')
1362
1602
  takeProfit = self.safe_value(orderParams, 'takeProfit')
1363
- isStop = stopPrice is not None or stopLoss is not None or takeProfit is not None or (self.safe_value(orderParams, 'childOrders') is not None)
1364
- if isStop:
1365
- raise NotSupported(self.id + 'createOrders() only support non-stop order')
1603
+ isConditional = triggerPrice is not None or stopLoss is not None or takeProfit is not None or (self.safe_value(orderParams, 'childOrders') is not None)
1604
+ if isConditional:
1605
+ raise NotSupported(self.id + ' createOrders() only support non-stop order')
1366
1606
  orderRequest = self.create_order_request(marketId, type, side, amount, price, orderParams)
1367
1607
  ordersRequests.append(orderRequest)
1368
1608
  request: dict = {
@@ -1393,14 +1633,16 @@ class woofipro(Exchange, ImplicitAPI):
1393
1633
  async def edit_order(self, id: str, symbol: str, type: OrderType, side: OrderSide, amount: Num = None, price: Num = None, params={}):
1394
1634
  """
1395
1635
  edit a trade order
1396
- :see: https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/edit-order
1397
- :see: https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/edit-algo-order
1636
+
1637
+ https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/edit-order
1638
+ https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/edit-algo-order
1639
+
1398
1640
  :param str id: order id
1399
1641
  :param str symbol: unified symbol of the market to create an order in
1400
1642
  :param str type: 'market' or 'limit'
1401
1643
  :param str side: 'buy' or 'sell'
1402
1644
  :param float amount: how much of currency you want to trade in units of base currency
1403
- :param float [price]: the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
1645
+ :param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
1404
1646
  :param dict [params]: extra parameters specific to the exchange API endpoint
1405
1647
  :param float [params.triggerPrice]: The price a trigger order is triggered at
1406
1648
  :param float [params.stopLossPrice]: price to trigger stop-loss orders
@@ -1412,19 +1654,19 @@ class woofipro(Exchange, ImplicitAPI):
1412
1654
  request: dict = {
1413
1655
  'order_id': id,
1414
1656
  }
1415
- stopPrice = self.safe_string_n(params, ['triggerPrice', 'stopPrice', 'takeProfitPrice', 'stopLossPrice'])
1416
- if stopPrice is not None:
1417
- request['triggerPrice'] = self.price_to_precision(symbol, stopPrice)
1418
- isStop = (stopPrice is not None) or (self.safe_value(params, 'childOrders') is not None)
1419
- orderQtyKey = 'quantity' if isStop else 'order_quantity'
1420
- priceKey = 'price' if isStop else 'order_price'
1657
+ triggerPrice = self.safe_string_n(params, ['triggerPrice', 'stopPrice', 'takeProfitPrice', 'stopLossPrice'])
1658
+ if triggerPrice is not None:
1659
+ request['triggerPrice'] = self.price_to_precision(symbol, triggerPrice)
1660
+ isConditional = (triggerPrice is not None) or (self.safe_value(params, 'childOrders') is not None)
1661
+ orderQtyKey = 'quantity' if isConditional else 'order_quantity'
1662
+ priceKey = 'price' if isConditional else 'order_price'
1421
1663
  if price is not None:
1422
1664
  request[priceKey] = self.price_to_precision(symbol, price)
1423
1665
  if amount is not None:
1424
1666
  request[orderQtyKey] = self.amount_to_precision(symbol, amount)
1425
1667
  params = self.omit(params, ['stopPrice', 'triggerPrice', 'takeProfitPrice', 'stopLossPrice', 'trailingTriggerPrice', 'trailingAmount', 'trailingPercent'])
1426
1668
  response = None
1427
- if isStop:
1669
+ if isConditional:
1428
1670
  response = await self.v1PrivatePutAlgoOrder(self.extend(request, params))
1429
1671
  else:
1430
1672
  request['symbol'] = market['id']
@@ -1463,10 +1705,12 @@ class woofipro(Exchange, ImplicitAPI):
1463
1705
 
1464
1706
  async def cancel_order(self, id: str, symbol: Str = None, params={}):
1465
1707
  """
1466
- :see: https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/cancel-order
1467
- :see: https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/cancel-order-by-client_order_id
1468
- :see: https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/cancel-algo-order
1469
- :see: https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/cancel-algo-order-by-client_order_id
1708
+
1709
+ https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/cancel-order
1710
+ https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/cancel-order-by-client_order_id
1711
+ https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/cancel-algo-order
1712
+ https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/cancel-algo-order-by-client_order_id
1713
+
1470
1714
  cancels an open order
1471
1715
  :param str id: order id
1472
1716
  :param str symbol: unified symbol of the market the order was made in
@@ -1475,9 +1719,9 @@ class woofipro(Exchange, ImplicitAPI):
1475
1719
  :param str [params.clientOrderId]: a unique id for the order
1476
1720
  :returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
1477
1721
  """
1478
- stop = self.safe_bool_2(params, 'stop', 'trigger', False)
1722
+ trigger = self.safe_bool_2(params, 'stop', 'trigger', False)
1479
1723
  params = self.omit(params, ['stop', 'trigger'])
1480
- if not stop and (symbol is None):
1724
+ if not trigger and (symbol is None):
1481
1725
  raise ArgumentsRequired(self.id + ' cancelOrder() requires a symbol argument')
1482
1726
  await self.load_markets()
1483
1727
  market: Market = None
@@ -1490,7 +1734,7 @@ class woofipro(Exchange, ImplicitAPI):
1490
1734
  clientOrderIdExchangeSpecific = self.safe_string(params, 'client_order_id', clientOrderIdUnified)
1491
1735
  isByClientOrder = clientOrderIdExchangeSpecific is not None
1492
1736
  response = None
1493
- if stop:
1737
+ if trigger:
1494
1738
  if isByClientOrder:
1495
1739
  request['client_order_id'] = clientOrderIdExchangeSpecific
1496
1740
  params = self.omit(params, ['clOrdID', 'clientOrderId', 'client_order_id'])
@@ -1526,7 +1770,7 @@ class woofipro(Exchange, ImplicitAPI):
1526
1770
  extendParams['client_order_id'] = clientOrderIdExchangeSpecific
1527
1771
  else:
1528
1772
  extendParams['id'] = id
1529
- if stop:
1773
+ if trigger:
1530
1774
  return self.extend(self.parse_order(response), extendParams)
1531
1775
  data = self.safe_dict(response, 'data', {})
1532
1776
  return self.extend(self.parse_order(data), extendParams)
@@ -1534,8 +1778,10 @@ class woofipro(Exchange, ImplicitAPI):
1534
1778
  async def cancel_orders(self, ids: List[str], symbol: Str = None, params={}):
1535
1779
  """
1536
1780
  cancel multiple orders
1537
- :see: https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/batch-cancel-orders
1538
- :see: https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/batch-cancel-orders-by-client_order_id
1781
+
1782
+ https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/batch-cancel-orders
1783
+ https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/batch-cancel-orders-by-client_order_id
1784
+
1539
1785
  :param str[] ids: order ids
1540
1786
  :param str [symbol]: unified market symbol
1541
1787
  :param dict [params]: extra parameters specific to the exchange API endpoint
@@ -1568,8 +1814,10 @@ class woofipro(Exchange, ImplicitAPI):
1568
1814
 
1569
1815
  async def cancel_all_orders(self, symbol: Str = None, params={}):
1570
1816
  """
1571
- :see: https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/cancel-all-pending-algo-orders
1572
- :see: https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/cancel-orders-in-bulk
1817
+
1818
+ https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/cancel-all-pending-algo-orders
1819
+ https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/cancel-orders-in-bulk
1820
+
1573
1821
  cancel all open orders in a market
1574
1822
  :param str symbol: unified market symbol
1575
1823
  :param dict [params]: extra parameters specific to the exchange API endpoint
@@ -1577,18 +1825,18 @@ class woofipro(Exchange, ImplicitAPI):
1577
1825
  :returns dict: an list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
1578
1826
  """
1579
1827
  await self.load_markets()
1580
- stop = self.safe_bool_2(params, 'stop', 'trigger')
1828
+ trigger = self.safe_bool_2(params, 'stop', 'trigger')
1581
1829
  params = self.omit(params, ['stop', 'trigger'])
1582
1830
  request: dict = {}
1583
1831
  if symbol is not None:
1584
1832
  market = self.market(symbol)
1585
1833
  request['symbol'] = market['id']
1586
1834
  response = None
1587
- if stop:
1835
+ if trigger:
1588
1836
  response = await self.v1PrivateDeleteAlgoOrders(self.extend(request, params))
1589
1837
  else:
1590
1838
  response = await self.v1PrivateDeleteOrders(self.extend(request, params))
1591
- # stop
1839
+ # trigger
1592
1840
  # {
1593
1841
  # "success": True,
1594
1842
  # "timestamp": 1702989203989,
@@ -1604,18 +1852,21 @@ class woofipro(Exchange, ImplicitAPI):
1604
1852
  # }
1605
1853
  #
1606
1854
  return [
1607
- {
1855
+ self.safe_order({
1608
1856
  'info': response,
1609
- },
1857
+ }),
1610
1858
  ]
1611
1859
 
1612
1860
  async def fetch_order(self, id: str, symbol: Str = None, params={}):
1613
1861
  """
1614
- :see: https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/get-order-by-order_id
1615
- :see: https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/get-order-by-client_order_id
1616
- :see: https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/get-algo-order-by-order_id
1617
- :see: https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/get-algo-order-by-client_order_id
1862
+
1863
+ https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/get-order-by-order_id
1864
+ https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/get-order-by-client_order_id
1865
+ https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/get-algo-order-by-order_id
1866
+ https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/get-algo-order-by-client_order_id
1867
+
1618
1868
  fetches information on an order made by the user
1869
+ :param str id: the order id
1619
1870
  :param str symbol: unified symbol of the market the order was made in
1620
1871
  :param dict [params]: extra parameters specific to the exchange API endpoint
1621
1872
  :param boolean [params.trigger]: whether the order is a stop/algo order
@@ -1623,13 +1874,15 @@ class woofipro(Exchange, ImplicitAPI):
1623
1874
  :returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
1624
1875
  """
1625
1876
  await self.load_markets()
1626
- market = self.market(symbol) if (symbol is not None) else None
1627
- stop = self.safe_bool_2(params, 'stop', 'trigger', False)
1877
+ market = None
1878
+ if symbol is not None:
1879
+ market = self.market(symbol)
1880
+ trigger = self.safe_bool_2(params, 'stop', 'trigger', False)
1628
1881
  request: dict = {}
1629
1882
  clientOrderId = self.safe_string_n(params, ['clOrdID', 'clientOrderId', 'client_order_id'])
1630
1883
  params = self.omit(params, ['stop', 'trigger', 'clOrdID', 'clientOrderId', 'client_order_id'])
1631
1884
  response = None
1632
- if stop:
1885
+ if trigger:
1633
1886
  if clientOrderId:
1634
1887
  request['client_order_id'] = clientOrderId
1635
1888
  response = await self.v1PrivateGetAlgoClientOrderClientOrderId(self.extend(request, params))
@@ -1676,8 +1929,10 @@ class woofipro(Exchange, ImplicitAPI):
1676
1929
  async def fetch_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
1677
1930
  """
1678
1931
  fetches information on multiple orders made by the user
1679
- :see: https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/get-orders
1680
- :see: https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/get-algo-orders
1932
+
1933
+ https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/get-orders
1934
+ https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/get-algo-orders
1935
+
1681
1936
  :param str symbol: unified market symbol of the market orders were made in
1682
1937
  :param int [since]: the earliest time in ms to fetch orders for
1683
1938
  :param int [limit]: the maximum number of order structures to retrieve
@@ -1757,8 +2012,10 @@ class woofipro(Exchange, ImplicitAPI):
1757
2012
  async def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
1758
2013
  """
1759
2014
  fetches information on multiple orders made by the user
1760
- :see: https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/get-orders
1761
- :see: https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/get-algo-orders
2015
+
2016
+ https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/get-orders
2017
+ https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/get-algo-orders
2018
+
1762
2019
  :param str symbol: unified market symbol of the market orders were made in
1763
2020
  :param int [since]: the earliest time in ms to fetch orders for
1764
2021
  :param int [limit]: the maximum number of order structures to retrieve
@@ -1777,8 +2034,10 @@ class woofipro(Exchange, ImplicitAPI):
1777
2034
  async def fetch_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
1778
2035
  """
1779
2036
  fetches information on multiple orders made by the user
1780
- :see: https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/get-orders
1781
- :see: https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/get-algo-orders
2037
+
2038
+ https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/get-orders
2039
+ https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/get-algo-orders
2040
+
1782
2041
  :param str symbol: unified market symbol of the market orders were made in
1783
2042
  :param int [since]: the earliest time in ms to fetch orders for
1784
2043
  :param int [limit]: the maximum number of order structures to retrieve
@@ -1797,7 +2056,9 @@ class woofipro(Exchange, ImplicitAPI):
1797
2056
  async def fetch_order_trades(self, id: str, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
1798
2057
  """
1799
2058
  fetch all the trades made from a single order
1800
- :see: https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/get-all-trades-of-specific-order
2059
+
2060
+ https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/get-all-trades-of-specific-order
2061
+
1801
2062
  :param str id: order id
1802
2063
  :param str symbol: unified market symbol
1803
2064
  :param int [since]: the earliest time in ms to fetch trades for
@@ -1840,7 +2101,9 @@ class woofipro(Exchange, ImplicitAPI):
1840
2101
 
1841
2102
  async def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
1842
2103
  """
1843
- :see: https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/get-trades
2104
+
2105
+ https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/get-trades
2106
+
1844
2107
  fetch all trades made by the user
1845
2108
  :param str symbol: unified market symbol
1846
2109
  :param int [since]: the earliest time in ms to fetch trades for
@@ -1915,7 +2178,9 @@ class woofipro(Exchange, ImplicitAPI):
1915
2178
  async def fetch_balance(self, params={}) -> Balances:
1916
2179
  """
1917
2180
  query for balance and get the amount of funds available for trading or funds locked in orders
1918
- :see: https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/get-current-holding
2181
+
2182
+ https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/get-current-holding
2183
+
1919
2184
  :param dict [params]: extra parameters specific to the exchange API endpoint
1920
2185
  :returns dict: a `balance structure <https://docs.ccxt.com/#/?id=balance-structure>`
1921
2186
  """
@@ -1983,14 +2248,16 @@ class woofipro(Exchange, ImplicitAPI):
1983
2248
  data = self.safe_dict(response, 'data', {})
1984
2249
  return [currency, self.safe_list(data, 'rows', [])]
1985
2250
 
1986
- def parse_ledger_entry(self, item: dict, currency: Currency = None):
1987
- code = self.safe_string(item, 'token')
2251
+ def parse_ledger_entry(self, item: dict, currency: Currency = None) -> LedgerEntry:
2252
+ currencyId = self.safe_string(item, 'token')
2253
+ code = self.safe_currency_code(currencyId, currency)
2254
+ currency = self.safe_currency(currencyId, currency)
1988
2255
  amount = self.safe_number(item, 'amount')
1989
2256
  side = self.safe_string(item, 'token_side')
1990
2257
  direction = 'in' if (side == 'DEPOSIT') else 'out'
1991
2258
  timestamp = self.safe_integer(item, 'created_time')
1992
2259
  fee = self.parse_token_and_fee_temp(item, 'fee_token', 'fee_amount')
1993
- return {
2260
+ return self.safe_ledger_entry({
1994
2261
  'id': self.safe_string(item, 'id'),
1995
2262
  'currency': code,
1996
2263
  'account': self.safe_string(item, 'account'),
@@ -2006,7 +2273,7 @@ class woofipro(Exchange, ImplicitAPI):
2006
2273
  'datetime': self.iso8601(timestamp),
2007
2274
  'type': self.parse_ledger_entry_type(self.safe_string(item, 'type')),
2008
2275
  'info': item,
2009
- }
2276
+ }, currency)
2010
2277
 
2011
2278
  def parse_ledger_entry_type(self, type):
2012
2279
  types: dict = {
@@ -2015,17 +2282,21 @@ class woofipro(Exchange, ImplicitAPI):
2015
2282
  }
2016
2283
  return self.safe_string(types, type, type)
2017
2284
 
2018
- async def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
2285
+ async def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[LedgerEntry]:
2019
2286
  """
2020
- fetch the history of changes, actions done by the user or operations that altered balance of the user
2021
- :see: https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/get-asset-history
2022
- :param str code: unified currency code, default is None
2287
+ fetch the history of changes, actions done by the user or operations that altered the balance of the user
2288
+
2289
+ https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/get-asset-history
2290
+
2291
+ :param str [code]: unified currency code, default is None
2023
2292
  :param int [since]: timestamp in ms of the earliest ledger entry, default is None
2024
- :param int [limit]: max number of ledger entrys to return, default is None
2293
+ :param int [limit]: max number of ledger entries to return, default is None
2025
2294
  :param dict [params]: extra parameters specific to the exchange API endpoint
2026
- :returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger-structure>`
2295
+ :returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger>`
2027
2296
  """
2028
- currency, rows = await self.get_asset_history_rows(code, since, limit, params)
2297
+ currencyRows = await self.get_asset_history_rows(code, since, limit, params)
2298
+ currency = self.safe_value(currencyRows, 0)
2299
+ rows = self.safe_list(currencyRows, 1)
2029
2300
  return self.parse_ledger(rows, currency, since, limit, params)
2030
2301
 
2031
2302
  def parse_transaction(self, transaction: dict, currency: Currency = None) -> Transaction:
@@ -2074,7 +2345,9 @@ class woofipro(Exchange, ImplicitAPI):
2074
2345
  async def fetch_deposits(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
2075
2346
  """
2076
2347
  fetch all deposits made to an account
2077
- :see: https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/get-asset-history
2348
+
2349
+ https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/get-asset-history
2350
+
2078
2351
  :param str code: unified currency code
2079
2352
  :param int [since]: the earliest time in ms to fetch deposits for
2080
2353
  :param int [limit]: the maximum number of deposits structures to retrieve
@@ -2089,7 +2362,9 @@ class woofipro(Exchange, ImplicitAPI):
2089
2362
  async def fetch_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
2090
2363
  """
2091
2364
  fetch all withdrawals made from an account
2092
- :see: https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/get-asset-history
2365
+
2366
+ https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/get-asset-history
2367
+
2093
2368
  :param str code: unified currency code
2094
2369
  :param int [since]: the earliest time in ms to fetch withdrawals for
2095
2370
  :param int [limit]: the maximum number of withdrawals structures to retrieve
@@ -2104,7 +2379,9 @@ class woofipro(Exchange, ImplicitAPI):
2104
2379
  async def fetch_deposits_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
2105
2380
  """
2106
2381
  fetch history of deposits and withdrawals
2107
- :see: https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/get-asset-history
2382
+
2383
+ https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/get-asset-history
2384
+
2108
2385
  :param str [code]: unified currency code for the currency of the deposit/withdrawals, default is None
2109
2386
  :param int [since]: timestamp in ms of the earliest deposit/withdrawal, default is None
2110
2387
  :param int [limit]: max number of deposit/withdrawals to return, default is None
@@ -2112,7 +2389,9 @@ class woofipro(Exchange, ImplicitAPI):
2112
2389
  :returns dict: a list of `transaction structure <https://docs.ccxt.com/#/?id=transaction-structure>`
2113
2390
  """
2114
2391
  request: dict = {}
2115
- currency, rows = await self.get_asset_history_rows(code, since, limit, self.extend(request, params))
2392
+ currencyRows = await self.get_asset_history_rows(code, since, limit, self.extend(request, params))
2393
+ currency = self.safe_value(currencyRows, 0)
2394
+ rows = self.safe_list(currencyRows, 1)
2116
2395
  #
2117
2396
  # {
2118
2397
  # "rows":[],
@@ -2153,10 +2432,12 @@ class woofipro(Exchange, ImplicitAPI):
2153
2432
  def sign_message(self, message, privateKey):
2154
2433
  return self.sign_hash(self.hash_message(message), privateKey[-64:])
2155
2434
 
2156
- async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}):
2435
+ async def withdraw(self, code: str, amount: float, address: str, tag: Str = None, params={}) -> Transaction:
2157
2436
  """
2158
2437
  make a withdrawal
2159
- :see: https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/create-withdraw-request
2438
+
2439
+ https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/create-withdraw-request
2440
+
2160
2441
  :param str code: unified currency code
2161
2442
  :param float amount: the amount to withdraw
2162
2443
  :param str address: the address to withdraw to
@@ -2169,7 +2450,7 @@ class woofipro(Exchange, ImplicitAPI):
2169
2450
  if code is not None:
2170
2451
  code = code.upper()
2171
2452
  if code != 'USDC':
2172
- raise NotSupported(self.id + 'withdraw() only support USDC')
2453
+ raise NotSupported(self.id + ' withdraw() only support USDC')
2173
2454
  currency = self.currency(code)
2174
2455
  verifyingContractAddress = self.safe_string(self.options, 'verifyingContractAddress')
2175
2456
  chainId = self.safe_string(params, 'chainId')
@@ -2241,7 +2522,9 @@ class woofipro(Exchange, ImplicitAPI):
2241
2522
  async def fetch_leverage(self, symbol: str, params={}) -> Leverage:
2242
2523
  """
2243
2524
  fetch the set leverage for a market
2244
- :see: https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/get-account-information
2525
+
2526
+ https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/get-account-information
2527
+
2245
2528
  :param str symbol: unified market symbol
2246
2529
  :param dict [params]: extra parameters specific to the exchange API endpoint
2247
2530
  :returns dict: a `leverage structure <https://docs.ccxt.com/#/?id=leverage-structure>`
@@ -2279,11 +2562,14 @@ class woofipro(Exchange, ImplicitAPI):
2279
2562
  data = self.safe_dict(response, 'data', {})
2280
2563
  return self.parse_leverage(data, market)
2281
2564
 
2282
- async def set_leverage(self, leverage: Int, symbol: Str = None, params={}):
2565
+ async def set_leverage(self, leverage: int, symbol: Str = None, params={}):
2283
2566
  """
2284
2567
  set the level of leverage for a market
2285
- :see: https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/update-leverage-setting
2286
- :param str symbol: unified market symbol
2568
+
2569
+ https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/update-leverage-setting
2570
+
2571
+ :param int [leverage]: the rate of leverage
2572
+ :param str [symbol]: unified market symbol
2287
2573
  :param dict [params]: extra parameters specific to the exchange API endpoint
2288
2574
  :returns dict: response from the exchange
2289
2575
  """
@@ -2364,9 +2650,11 @@ class woofipro(Exchange, ImplicitAPI):
2364
2650
  'takeProfitPrice': None,
2365
2651
  })
2366
2652
 
2367
- async def fetch_position(self, symbol: Str = None, params={}):
2653
+ async def fetch_position(self, symbol: Str, params={}):
2368
2654
  """
2369
- :see: https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/get-one-position-info
2655
+
2656
+ https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/get-one-position-info
2657
+
2370
2658
  fetch data on an open position
2371
2659
  :param str symbol: unified market symbol of the market the position is held in
2372
2660
  :param dict [params]: extra parameters specific to the exchange API endpoint
@@ -2407,13 +2695,14 @@ class woofipro(Exchange, ImplicitAPI):
2407
2695
  data = self.safe_dict(response, 'data')
2408
2696
  return self.parse_position(data, market)
2409
2697
 
2410
- async def fetch_positions(self, symbols: Strings = None, params={}):
2698
+ async def fetch_positions(self, symbols: Strings = None, params={}) -> List[Position]:
2411
2699
  """
2412
2700
  fetch all open positions
2413
- :see: https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/get-all-positions-info
2701
+
2702
+ https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/get-all-positions-info
2703
+
2414
2704
  :param str[] [symbols]: list of unified market symbols
2415
2705
  :param dict [params]: extra parameters specific to the exchange API endpoint
2416
- :param str [method]: method name to call, "positionRisk", "account" or "option", default is "positionRisk"
2417
2706
  :returns dict[]: a list of `position structure <https://docs.ccxt.com/#/?id=position-structure>`
2418
2707
  """
2419
2708
  await self.load_markets()
@@ -2491,9 +2780,12 @@ class woofipro(Exchange, ImplicitAPI):
2491
2780
  auth = ''
2492
2781
  ts = str(self.nonce())
2493
2782
  url += pathWithParams
2783
+ apiKey = self.apiKey
2784
+ if apiKey.find('ed25519:') < 0:
2785
+ apiKey = 'ed25519:' + apiKey
2494
2786
  headers = {
2495
2787
  'orderly-account-id': self.accountId,
2496
- 'orderly-key': self.apiKey,
2788
+ 'orderly-key': apiKey,
2497
2789
  'orderly-timestamp': ts,
2498
2790
  }
2499
2791
  auth = ts + method + '/' + version + '/' + pathWithParams