ccxt 4.4.57__py2.py3-none-any.whl → 4.4.59__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 (310) hide show
  1. ccxt/__init__.py +1 -3
  2. ccxt/abstract/xt.py +1 -0
  3. ccxt/ace.py +2 -2
  4. ccxt/alpaca.py +4 -4
  5. ccxt/ascendex.py +5 -3
  6. ccxt/async_support/__init__.py +1 -3
  7. ccxt/async_support/ace.py +2 -2
  8. ccxt/async_support/alpaca.py +4 -4
  9. ccxt/async_support/ascendex.py +5 -3
  10. ccxt/async_support/base/exchange.py +1 -1
  11. ccxt/async_support/bequant.py +2 -1
  12. ccxt/async_support/bigone.py +5 -5
  13. ccxt/async_support/binance.py +22 -6
  14. ccxt/async_support/binancecoinm.py +2 -1
  15. ccxt/async_support/binanceus.py +2 -1
  16. ccxt/async_support/binanceusdm.py +2 -1
  17. ccxt/async_support/bingx.py +3 -3
  18. ccxt/async_support/bit2c.py +9 -9
  19. ccxt/async_support/bitbank.py +2 -2
  20. ccxt/async_support/bitbns.py +2 -2
  21. ccxt/async_support/bitcoincom.py +2 -1
  22. ccxt/async_support/bitfinex.py +2 -2
  23. ccxt/async_support/bitfinex1.py +2 -2
  24. ccxt/async_support/bitflyer.py +2 -2
  25. ccxt/async_support/bitget.py +8 -3
  26. ccxt/async_support/bithumb.py +2 -2
  27. ccxt/async_support/bitmart.py +150 -89
  28. ccxt/async_support/bitmex.py +2 -2
  29. ccxt/async_support/bitopro.py +2 -2
  30. ccxt/async_support/bitpanda.py +2 -1
  31. ccxt/async_support/bitrue.py +3 -3
  32. ccxt/async_support/bitso.py +2 -2
  33. ccxt/async_support/bitstamp.py +2 -2
  34. ccxt/async_support/bitteam.py +2 -2
  35. ccxt/async_support/bitvavo.py +3 -3
  36. ccxt/async_support/bl3p.py +2 -2
  37. ccxt/async_support/blockchaincom.py +2 -2
  38. ccxt/async_support/blofin.py +3 -4
  39. ccxt/async_support/btcalpha.py +2 -2
  40. ccxt/async_support/btcbox.py +2 -2
  41. ccxt/async_support/btcmarkets.py +3 -3
  42. ccxt/async_support/btcturk.py +2 -2
  43. ccxt/async_support/bybit.py +17 -6
  44. ccxt/async_support/cex.py +3 -3
  45. ccxt/async_support/coinbase.py +12 -5
  46. ccxt/async_support/coinbaseadvanced.py +2 -1
  47. ccxt/async_support/coinbaseexchange.py +3 -3
  48. ccxt/async_support/coinbaseinternational.py +3 -4
  49. ccxt/async_support/coincatch.py +3 -3
  50. ccxt/async_support/coincheck.py +2 -2
  51. ccxt/async_support/coinex.py +3 -3
  52. ccxt/async_support/coinlist.py +3 -3
  53. ccxt/async_support/coinmate.py +2 -2
  54. ccxt/async_support/coinmetro.py +2 -2
  55. ccxt/async_support/coinone.py +2 -2
  56. ccxt/async_support/coinsph.py +3 -3
  57. ccxt/async_support/coinspot.py +2 -2
  58. ccxt/async_support/cryptocom.py +2 -2
  59. ccxt/async_support/currencycom.py +3 -3
  60. ccxt/async_support/defx.py +3 -3
  61. ccxt/async_support/delta.py +3 -3
  62. ccxt/async_support/deribit.py +3 -3
  63. ccxt/async_support/digifinex.py +3 -3
  64. ccxt/async_support/ellipx.py +1 -1
  65. ccxt/async_support/exmo.py +2 -2
  66. ccxt/async_support/fmfwio.py +2 -1
  67. ccxt/async_support/gate.py +3 -3
  68. ccxt/async_support/gateio.py +2 -1
  69. ccxt/async_support/gemini.py +2 -2
  70. ccxt/async_support/hashkey.py +2 -2
  71. ccxt/async_support/hitbtc.py +3 -3
  72. ccxt/async_support/hollaex.py +2 -2
  73. ccxt/async_support/htx.py +3 -3
  74. ccxt/async_support/huobi.py +2 -1
  75. ccxt/async_support/huobijp.py +3 -3
  76. ccxt/async_support/hyperliquid.py +91 -6
  77. ccxt/async_support/idex.py +3 -3
  78. ccxt/async_support/independentreserve.py +2 -2
  79. ccxt/async_support/indodax.py +3 -3
  80. ccxt/async_support/kraken.py +3 -3
  81. ccxt/async_support/krakenfutures.py +2 -2
  82. ccxt/async_support/kucoin.py +3 -3
  83. ccxt/async_support/kucoinfutures.py +3 -3
  84. ccxt/async_support/kuna.py +3 -3
  85. ccxt/async_support/latoken.py +3 -3
  86. ccxt/async_support/lbank.py +3 -3
  87. ccxt/async_support/luno.py +2 -2
  88. ccxt/async_support/mercado.py +2 -2
  89. ccxt/async_support/mexc.py +3 -3
  90. ccxt/async_support/myokx.py +2 -1
  91. ccxt/async_support/ndax.py +2 -2
  92. ccxt/async_support/novadax.py +3 -3
  93. ccxt/async_support/oceanex.py +3 -3
  94. ccxt/async_support/okcoin.py +3 -3
  95. ccxt/async_support/okx.py +3 -4
  96. ccxt/async_support/onetrading.py +3 -3
  97. ccxt/async_support/oxfun.py +2 -2
  98. ccxt/async_support/p2b.py +2 -2
  99. ccxt/async_support/paradex.py +3 -3
  100. ccxt/async_support/paymium.py +2 -2
  101. ccxt/async_support/phemex.py +2 -2
  102. ccxt/async_support/poloniex.py +3 -3
  103. ccxt/async_support/poloniexfutures.py +3 -3
  104. ccxt/async_support/probit.py +3 -3
  105. ccxt/async_support/timex.py +15 -5
  106. ccxt/async_support/tokocrypto.py +3 -3
  107. ccxt/async_support/tradeogre.py +2 -2
  108. ccxt/async_support/upbit.py +2 -2
  109. ccxt/async_support/vertex.py +5 -5
  110. ccxt/async_support/wavesexchange.py +2 -3
  111. ccxt/async_support/whitebit.py +5 -4
  112. ccxt/async_support/woo.py +3 -4
  113. ccxt/async_support/woofipro.py +3 -4
  114. ccxt/async_support/xt.py +57 -4
  115. ccxt/async_support/yobit.py +2 -2
  116. ccxt/async_support/zaif.py +2 -2
  117. ccxt/async_support/zonda.py +2 -2
  118. ccxt/base/exchange.py +5 -4
  119. ccxt/bequant.py +2 -1
  120. ccxt/bigone.py +5 -5
  121. ccxt/binance.py +22 -6
  122. ccxt/binancecoinm.py +2 -1
  123. ccxt/binanceus.py +2 -1
  124. ccxt/binanceusdm.py +2 -1
  125. ccxt/bingx.py +3 -3
  126. ccxt/bit2c.py +9 -9
  127. ccxt/bitbank.py +2 -2
  128. ccxt/bitbns.py +2 -2
  129. ccxt/bitcoincom.py +2 -1
  130. ccxt/bitfinex.py +2 -2
  131. ccxt/bitfinex1.py +2 -2
  132. ccxt/bitflyer.py +2 -2
  133. ccxt/bitget.py +8 -3
  134. ccxt/bithumb.py +2 -2
  135. ccxt/bitmart.py +150 -89
  136. ccxt/bitmex.py +2 -2
  137. ccxt/bitopro.py +2 -2
  138. ccxt/bitpanda.py +2 -1
  139. ccxt/bitrue.py +3 -3
  140. ccxt/bitso.py +2 -2
  141. ccxt/bitstamp.py +2 -2
  142. ccxt/bitteam.py +2 -2
  143. ccxt/bitvavo.py +3 -3
  144. ccxt/bl3p.py +2 -2
  145. ccxt/blockchaincom.py +2 -2
  146. ccxt/blofin.py +3 -4
  147. ccxt/btcalpha.py +2 -2
  148. ccxt/btcbox.py +2 -2
  149. ccxt/btcmarkets.py +3 -3
  150. ccxt/btcturk.py +2 -2
  151. ccxt/bybit.py +17 -6
  152. ccxt/cex.py +3 -3
  153. ccxt/coinbase.py +12 -5
  154. ccxt/coinbaseadvanced.py +2 -1
  155. ccxt/coinbaseexchange.py +3 -3
  156. ccxt/coinbaseinternational.py +3 -4
  157. ccxt/coincatch.py +3 -3
  158. ccxt/coincheck.py +2 -2
  159. ccxt/coinex.py +3 -3
  160. ccxt/coinlist.py +3 -3
  161. ccxt/coinmate.py +2 -2
  162. ccxt/coinmetro.py +2 -2
  163. ccxt/coinone.py +2 -2
  164. ccxt/coinsph.py +3 -3
  165. ccxt/coinspot.py +2 -2
  166. ccxt/cryptocom.py +2 -2
  167. ccxt/currencycom.py +3 -3
  168. ccxt/defx.py +3 -3
  169. ccxt/delta.py +3 -3
  170. ccxt/deribit.py +3 -3
  171. ccxt/digifinex.py +3 -3
  172. ccxt/ellipx.py +1 -1
  173. ccxt/exmo.py +2 -2
  174. ccxt/fmfwio.py +2 -1
  175. ccxt/gate.py +3 -3
  176. ccxt/gateio.py +2 -1
  177. ccxt/gemini.py +2 -2
  178. ccxt/hashkey.py +2 -2
  179. ccxt/hitbtc.py +3 -3
  180. ccxt/hollaex.py +2 -2
  181. ccxt/htx.py +3 -3
  182. ccxt/huobi.py +2 -1
  183. ccxt/huobijp.py +3 -3
  184. ccxt/hyperliquid.py +91 -6
  185. ccxt/idex.py +3 -3
  186. ccxt/independentreserve.py +2 -2
  187. ccxt/indodax.py +3 -3
  188. ccxt/kraken.py +3 -3
  189. ccxt/krakenfutures.py +2 -2
  190. ccxt/kucoin.py +3 -3
  191. ccxt/kucoinfutures.py +3 -3
  192. ccxt/kuna.py +3 -3
  193. ccxt/latoken.py +3 -3
  194. ccxt/lbank.py +3 -3
  195. ccxt/luno.py +2 -2
  196. ccxt/mercado.py +2 -2
  197. ccxt/mexc.py +3 -3
  198. ccxt/myokx.py +2 -1
  199. ccxt/ndax.py +2 -2
  200. ccxt/novadax.py +3 -3
  201. ccxt/oceanex.py +3 -3
  202. ccxt/okcoin.py +3 -3
  203. ccxt/okx.py +3 -4
  204. ccxt/onetrading.py +3 -3
  205. ccxt/oxfun.py +2 -2
  206. ccxt/p2b.py +2 -2
  207. ccxt/paradex.py +3 -3
  208. ccxt/paymium.py +2 -2
  209. ccxt/phemex.py +2 -2
  210. ccxt/poloniex.py +3 -3
  211. ccxt/poloniexfutures.py +3 -3
  212. ccxt/pro/__init__.py +1 -3
  213. ccxt/pro/alpaca.py +2 -2
  214. ccxt/pro/ascendex.py +2 -2
  215. ccxt/pro/bequant.py +2 -1
  216. ccxt/pro/binance.py +2 -3
  217. ccxt/pro/binancecoinm.py +2 -1
  218. ccxt/pro/binanceus.py +3 -2
  219. ccxt/pro/binanceusdm.py +2 -1
  220. ccxt/pro/bingx.py +2 -2
  221. ccxt/pro/bitcoincom.py +2 -1
  222. ccxt/pro/bitfinex.py +2 -2
  223. ccxt/pro/bitfinex1.py +2 -2
  224. ccxt/pro/bitget.py +2 -3
  225. ccxt/pro/bithumb.py +2 -2
  226. ccxt/pro/bitmart.py +2 -2
  227. ccxt/pro/bitmex.py +2 -2
  228. ccxt/pro/bitopro.py +2 -2
  229. ccxt/pro/bitpanda.py +2 -1
  230. ccxt/pro/bitrue.py +2 -2
  231. ccxt/pro/bitstamp.py +2 -2
  232. ccxt/pro/bitvavo.py +2 -2
  233. ccxt/pro/blockchaincom.py +2 -2
  234. ccxt/pro/blofin.py +1 -1
  235. ccxt/pro/bybit.py +6 -4
  236. ccxt/pro/cex.py +2 -2
  237. ccxt/pro/coinbase.py +2 -2
  238. ccxt/pro/coinbaseadvanced.py +2 -1
  239. ccxt/pro/coinbaseexchange.py +2 -2
  240. ccxt/pro/coinbaseinternational.py +2 -2
  241. ccxt/pro/coincatch.py +2 -3
  242. ccxt/pro/coincheck.py +2 -2
  243. ccxt/pro/coinex.py +2 -2
  244. ccxt/pro/coinone.py +2 -2
  245. ccxt/pro/cryptocom.py +2 -3
  246. ccxt/pro/currencycom.py +2 -2
  247. ccxt/pro/defx.py +2 -3
  248. ccxt/pro/deribit.py +2 -2
  249. ccxt/pro/exmo.py +2 -2
  250. ccxt/pro/gate.py +2 -3
  251. ccxt/pro/gateio.py +2 -1
  252. ccxt/pro/gemini.py +2 -2
  253. ccxt/pro/hashkey.py +2 -2
  254. ccxt/pro/hitbtc.py +2 -2
  255. ccxt/pro/hollaex.py +2 -2
  256. ccxt/pro/htx.py +2 -2
  257. ccxt/pro/huobi.py +2 -1
  258. ccxt/pro/huobijp.py +2 -2
  259. ccxt/pro/hyperliquid.py +2 -3
  260. ccxt/pro/idex.py +2 -2
  261. ccxt/pro/independentreserve.py +2 -2
  262. ccxt/pro/kraken.py +2 -2
  263. ccxt/pro/krakenfutures.py +2 -2
  264. ccxt/pro/kucoin.py +2 -3
  265. ccxt/pro/kucoinfutures.py +2 -3
  266. ccxt/pro/lbank.py +2 -2
  267. ccxt/pro/luno.py +2 -2
  268. ccxt/pro/mexc.py +5 -3
  269. ccxt/pro/myokx.py +2 -1
  270. ccxt/pro/ndax.py +2 -2
  271. ccxt/pro/okcoin.py +2 -2
  272. ccxt/pro/okx.py +2 -3
  273. ccxt/pro/onetrading.py +2 -2
  274. ccxt/pro/oxfun.py +2 -2
  275. ccxt/pro/p2b.py +2 -2
  276. ccxt/pro/paradex.py +2 -2
  277. ccxt/pro/phemex.py +2 -2
  278. ccxt/pro/poloniex.py +2 -2
  279. ccxt/pro/poloniexfutures.py +2 -2
  280. ccxt/pro/probit.py +2 -2
  281. ccxt/pro/upbit.py +2 -2
  282. ccxt/pro/vertex.py +2 -2
  283. ccxt/pro/wazirx.py +2 -2
  284. ccxt/pro/whitebit.py +2 -2
  285. ccxt/pro/woo.py +2 -2
  286. ccxt/pro/woofipro.py +2 -2
  287. ccxt/pro/xt.py +2 -2
  288. ccxt/probit.py +3 -3
  289. ccxt/test/tests_init.py +2 -2
  290. ccxt/timex.py +15 -5
  291. ccxt/tokocrypto.py +3 -3
  292. ccxt/tradeogre.py +2 -2
  293. ccxt/upbit.py +2 -2
  294. ccxt/vertex.py +5 -5
  295. ccxt/wavesexchange.py +2 -3
  296. ccxt/whitebit.py +5 -4
  297. ccxt/woo.py +3 -4
  298. ccxt/woofipro.py +3 -4
  299. ccxt/xt.py +57 -4
  300. ccxt/yobit.py +2 -2
  301. ccxt/zaif.py +2 -2
  302. ccxt/zonda.py +2 -2
  303. {ccxt-4.4.57.dist-info → ccxt-4.4.59.dist-info}/METADATA +30 -33
  304. {ccxt-4.4.57.dist-info → ccxt-4.4.59.dist-info}/RECORD +307 -310
  305. ccxt/abstract/wazirx.py +0 -30
  306. ccxt/async_support/wazirx.py +0 -1336
  307. ccxt/wazirx.py +0 -1336
  308. {ccxt-4.4.57.dist-info → ccxt-4.4.59.dist-info}/LICENSE.txt +0 -0
  309. {ccxt-4.4.57.dist-info → ccxt-4.4.59.dist-info}/WHEEL +0 -0
  310. {ccxt-4.4.57.dist-info → ccxt-4.4.59.dist-info}/top_level.txt +0 -0
@@ -1,1336 +0,0 @@
1
- # -*- coding: utf-8 -*-
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
-
6
- from ccxt.async_support.base.exchange import Exchange
7
- from ccxt.abstract.wazirx import ImplicitAPI
8
- import hashlib
9
- from ccxt.base.types import Balances, Currencies, Currency, DepositAddress, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
10
- from typing import List
11
- from ccxt.base.errors import ExchangeError
12
- from ccxt.base.errors import PermissionDenied
13
- from ccxt.base.errors import ArgumentsRequired
14
- from ccxt.base.errors import BadRequest
15
- from ccxt.base.errors import BadSymbol
16
- from ccxt.base.errors import InsufficientFunds
17
- from ccxt.base.errors import InvalidOrder
18
- from ccxt.base.errors import RateLimitExceeded
19
- from ccxt.base.decimal_to_precision import TICK_SIZE
20
- from ccxt.base.precise import Precise
21
-
22
-
23
- class wazirx(Exchange, ImplicitAPI):
24
-
25
- def describe(self):
26
- return self.deep_extend(super(wazirx, self).describe(), {
27
- 'id': 'wazirx',
28
- 'name': 'WazirX',
29
- 'countries': ['IN'],
30
- 'version': 'v2',
31
- 'rateLimit': 1000,
32
- 'pro': True,
33
- 'has': {
34
- 'CORS': False,
35
- 'spot': True,
36
- 'margin': False,
37
- 'swap': False,
38
- 'future': False,
39
- 'option': False,
40
- 'addMargin': False,
41
- 'cancelAllOrders': True,
42
- 'cancelOrder': True,
43
- 'closeAllPositions': False,
44
- 'closePosition': False,
45
- 'createOrder': True,
46
- 'createReduceOnlyOrder': False,
47
- 'createStopLimitOrder': True,
48
- 'createStopMarketOrder': True,
49
- 'createStopOrder': True,
50
- 'fetchBalance': True,
51
- 'fetchBidsAsks': False,
52
- 'fetchBorrowInterest': False,
53
- 'fetchBorrowRate': False,
54
- 'fetchBorrowRateHistories': False,
55
- 'fetchBorrowRateHistory': False,
56
- 'fetchBorrowRates': False,
57
- 'fetchBorrowRatesPerSymbol': False,
58
- 'fetchClosedOrders': False,
59
- 'fetchCrossBorrowRate': False,
60
- 'fetchCrossBorrowRates': False,
61
- 'fetchCurrencies': True,
62
- 'fetchDepositAddress': True,
63
- 'fetchDepositAddresses': False,
64
- 'fetchDepositAddressesByNetwork': False,
65
- 'fetchDeposits': True,
66
- 'fetchDepositsWithdrawals': False,
67
- 'fetchFundingHistory': False,
68
- 'fetchFundingInterval': False,
69
- 'fetchFundingIntervals': False,
70
- 'fetchFundingRate': False,
71
- 'fetchFundingRateHistory': False,
72
- 'fetchFundingRates': False,
73
- 'fetchGreeks': False,
74
- 'fetchIndexOHLCV': False,
75
- 'fetchIsolatedBorrowRate': False,
76
- 'fetchIsolatedBorrowRates': False,
77
- 'fetchIsolatedPositions': False,
78
- 'fetchLeverage': False,
79
- 'fetchLeverages': False,
80
- 'fetchLeverageTiers': False,
81
- 'fetchLiquidations': False,
82
- 'fetchMarginAdjustmentHistory': False,
83
- 'fetchMarginMode': False,
84
- 'fetchMarginModes': False,
85
- 'fetchMarketLeverageTiers': False,
86
- 'fetchMarkets': True,
87
- 'fetchMarkOHLCV': False,
88
- 'fetchMarkPrices': False,
89
- 'fetchMyLiquidations': False,
90
- 'fetchMySettlementHistory': False,
91
- 'fetchMyTrades': False,
92
- 'fetchOHLCV': True,
93
- 'fetchOpenInterest': False,
94
- 'fetchOpenInterestHistory': False,
95
- 'fetchOpenOrders': True,
96
- 'fetchOption': False,
97
- 'fetchOptionChain': False,
98
- 'fetchOrder': False,
99
- 'fetchOrderBook': True,
100
- 'fetchOrders': True,
101
- 'fetchPosition': False,
102
- 'fetchPositionHistory': False,
103
- 'fetchPositionMode': False,
104
- 'fetchPositions': False,
105
- 'fetchPositionsForSymbol': False,
106
- 'fetchPositionsHistory': False,
107
- 'fetchPositionsRisk': False,
108
- 'fetchPremiumIndexOHLCV': False,
109
- 'fetchSettlementHistory': False,
110
- 'fetchStatus': True,
111
- 'fetchTicker': True,
112
- 'fetchTickers': True,
113
- 'fetchTime': True,
114
- 'fetchTrades': True,
115
- 'fetchTradingFee': False,
116
- 'fetchTradingFees': False,
117
- 'fetchTransactionFees': False,
118
- 'fetchTransactions': False,
119
- 'fetchTransfers': False,
120
- 'fetchUnderlyingAssets': False,
121
- 'fetchVolatilityHistory': False,
122
- 'fetchWithdrawals': True,
123
- 'reduceMargin': False,
124
- 'repayCrossMargin': False,
125
- 'repayIsolatedMargin': False,
126
- 'setLeverage': False,
127
- 'setMargin': False,
128
- 'setMarginMode': False,
129
- 'setPositionMode': False,
130
- 'transfer': False,
131
- 'withdraw': False,
132
- },
133
- 'urls': {
134
- 'logo': 'https://user-images.githubusercontent.com/1294454/148647666-c109c20b-f8ac-472f-91c3-5f658cb90f49.jpeg',
135
- 'api': {
136
- 'rest': 'https://api.wazirx.com/sapi/v1',
137
- },
138
- 'www': 'https://wazirx.com',
139
- 'doc': 'https://docs.wazirx.com/#public-rest-api-for-wazirx',
140
- 'fees': 'https://wazirx.com/fees',
141
- 'referral': 'https://wazirx.com/invite/k7rrnks5',
142
- },
143
- 'api': {
144
- 'public': {
145
- 'get': {
146
- 'exchangeInfo': 1,
147
- 'depth': 0.5,
148
- 'ping': 1,
149
- 'systemStatus': 1,
150
- 'tickers/24hr': 1,
151
- 'ticker/24hr': 1,
152
- 'time': 1,
153
- 'trades': 1,
154
- 'klines': 1,
155
- },
156
- },
157
- 'private': {
158
- 'get': {
159
- 'account': 1,
160
- 'allOrders': 1,
161
- 'funds': 1,
162
- 'historicalTrades': 1,
163
- 'openOrders': 1,
164
- 'order': 0.5,
165
- 'myTrades': 0.5,
166
- 'coins': 12,
167
- 'crypto/withdraws': 12,
168
- 'crypto/deposits/address': 60,
169
- 'sub_account/fund_transfer/history': 1,
170
- 'sub_account/accounts': 1,
171
- },
172
- 'post': {
173
- 'order': 0.1,
174
- 'order/test': 0.5,
175
- },
176
- 'delete': {
177
- 'order': 0.1,
178
- 'openOrders': 1,
179
- },
180
- },
181
- },
182
- 'fees': {
183
- 'WRX': {'maker': self.parse_number('0.0'), 'taker': self.parse_number('0.0')},
184
- },
185
- 'precisionMode': TICK_SIZE,
186
- 'exceptions': {
187
- 'exact': {
188
- '-1121': BadSymbol, # {"code": -1121, "message": "Invalid symbol."}
189
- '1999': BadRequest, # {"code":1999,"message":"symbol is missing, symbol does not have a valid value"} message varies depending on the error
190
- '2002': InsufficientFunds, # {"code":2002,"message":"Not enough USDT balance to execute self order"}
191
- '2005': BadRequest, # {"code":2005,"message":"Signature is incorrect."}
192
- '2078': PermissionDenied, # {"code":2078,"message":"Permission denied."}
193
- '2098': BadRequest, # {"code":2098,"message":"Request out of receiving window."}
194
- '2031': InvalidOrder, # {"code":2031,"message":"Minimum buy amount must be worth 2.0 USDT"}
195
- '2113': BadRequest, # {"code":2113,"message":"RecvWindow must be in range 1..60000"}
196
- '2115': BadRequest, # {"code":2115,"message":"Signature not found."}
197
- '2136': RateLimitExceeded, # {"code":2136,"message":"Too many api request"}
198
- '94001': InvalidOrder, # {"code":94001,"message":"Stop price not found."}
199
- },
200
- },
201
- 'timeframes': {
202
- '1m': '1m',
203
- '5m': '5m',
204
- '30m': '30m',
205
- '1h': '1h',
206
- '2h': '2h',
207
- '4h': '4h',
208
- '6h': '6h',
209
- '12h': '12h',
210
- '1d': '1d',
211
- '1w': '1w',
212
- },
213
- 'options': {
214
- # 'fetchTradesMethod': 'privateGetHistoricalTrades',
215
- 'recvWindow': 10000,
216
- 'networks': {
217
- # You can get network from fetchCurrencies
218
- },
219
- },
220
- 'features': {
221
- 'spot': {
222
- 'sandbox': False,
223
- 'createOrder': {
224
- 'marginMode': False,
225
- 'triggerPrice': True,
226
- 'triggerDirection': False,
227
- 'triggerPriceType': None,
228
- 'stopLossPrice': False, # todo
229
- 'takeProfitPrice': False, # todo
230
- 'attachedStopLossTakeProfit': None,
231
- 'timeInForce': {
232
- 'IOC': False,
233
- 'FOK': False,
234
- 'PO': False,
235
- 'GTD': False,
236
- },
237
- 'hedged': False,
238
- 'trailing': False,
239
- 'leverage': False,
240
- 'marketBuyByCost': False,
241
- 'marketBuyRequiresPrice': False,
242
- 'selfTradePrevention': False,
243
- 'iceberg': False,
244
- },
245
- 'createOrders': None,
246
- 'fetchMyTrades': None,
247
- 'fetchOrder': None, # todo
248
- 'fetchOpenOrders': {
249
- 'marginMode': False,
250
- 'limit': None,
251
- 'trigger': False,
252
- 'trailing': False,
253
- 'symbolRequired': True,
254
- },
255
- 'fetchOrders': {
256
- 'marginMode': False,
257
- 'limit': 1000,
258
- 'daysBack': 100000, # todo
259
- 'untilDays': 100000, # todo
260
- 'trigger': False,
261
- 'trailing': False,
262
- 'symbolRequired': True,
263
- },
264
- 'fetchClosedOrders': None,
265
- 'fetchOHLCV': {
266
- 'limit': 2000,
267
- },
268
- },
269
- 'swap': {
270
- 'linear': None,
271
- 'inverse': None,
272
- },
273
- 'future': {
274
- 'linear': None,
275
- 'inverse': None,
276
- },
277
- },
278
- })
279
-
280
- async def fetch_markets(self, params={}) -> List[Market]:
281
- """
282
-
283
- https://docs.wazirx.com/#exchange-info
284
-
285
- retrieves data on all markets for wazirx
286
- :param dict [params]: extra parameters specific to the exchange API endpoint
287
- :returns dict[]: an array of objects representing market data
288
- """
289
- response = await self.publicGetExchangeInfo(params)
290
- #
291
- # {
292
- # "timezone":"UTC",
293
- # "serverTime":1641336850932,
294
- # "symbols":[
295
- # {
296
- # "symbol":"btcinr",
297
- # "status":"trading",
298
- # "baseAsset":"btc",
299
- # "quoteAsset":"inr",
300
- # "baseAssetPrecision":5,
301
- # "quoteAssetPrecision":0,
302
- # "orderTypes":[
303
- # "limit",
304
- # "stop_limit"
305
- # ],
306
- # "isSpotTradingAllowed":true,
307
- # "filters":[
308
- # {
309
- # "filterType":"PRICE_FILTER",
310
- # "minPrice":"1",
311
- # "tickSize":"1"
312
- # }
313
- # ]
314
- # },
315
- #
316
- markets = self.safe_value(response, 'symbols', [])
317
- return self.parse_markets(markets)
318
-
319
- def parse_market(self, market: dict) -> Market:
320
- id = self.safe_string(market, 'symbol')
321
- baseId = self.safe_string(market, 'baseAsset')
322
- quoteId = self.safe_string(market, 'quoteAsset')
323
- base = self.safe_currency_code(baseId)
324
- quote = self.safe_currency_code(quoteId)
325
- isSpot = self.safe_value(market, 'isSpotTradingAllowed')
326
- filters = self.safe_value(market, 'filters')
327
- minPrice: Num = None
328
- for j in range(0, len(filters)):
329
- filter = filters[j]
330
- filterType = self.safe_string(filter, 'filterType')
331
- if filterType == 'PRICE_FILTER':
332
- minPrice = self.safe_number(filter, 'minPrice')
333
- fee = self.safe_value(self.fees, quote, {})
334
- takerString: Str = self.safe_string(fee, 'taker', '0.2')
335
- takerString = Precise.string_div(takerString, '100')
336
- makerString: Str = self.safe_string(fee, 'maker', '0.2')
337
- makerString = Precise.string_div(makerString, '100')
338
- status = self.safe_string(market, 'status')
339
- return {
340
- 'id': id,
341
- 'symbol': base + '/' + quote,
342
- 'base': base,
343
- 'quote': quote,
344
- 'settle': None,
345
- 'baseId': baseId,
346
- 'quoteId': quoteId,
347
- 'settleId': None,
348
- 'type': 'spot',
349
- 'spot': isSpot,
350
- 'margin': False,
351
- 'swap': False,
352
- 'future': False,
353
- 'option': False,
354
- 'active': (status == 'trading'),
355
- 'contract': False,
356
- 'linear': None,
357
- 'inverse': None,
358
- 'taker': self.parse_number(takerString),
359
- 'maker': self.parse_number(makerString),
360
- 'contractSize': None,
361
- 'expiry': None,
362
- 'expiryDatetime': None,
363
- 'strike': None,
364
- 'optionType': None,
365
- 'precision': {
366
- 'amount': self.parse_number(self.parse_precision(self.safe_string(market, 'baseAssetPrecision'))),
367
- 'price': self.parse_number(self.parse_precision(self.safe_string(market, 'quoteAssetPrecision'))),
368
- },
369
- 'limits': {
370
- 'leverage': {
371
- 'min': None,
372
- 'max': None,
373
- },
374
- 'price': {
375
- 'min': minPrice,
376
- 'max': None,
377
- },
378
- 'amount': {
379
- 'min': None,
380
- 'max': None,
381
- },
382
- 'cost': {
383
- 'min': None,
384
- 'max': None,
385
- },
386
- },
387
- 'created': None,
388
- 'info': market,
389
- }
390
-
391
- async def fetch_ohlcv(self, symbol: str, timeframe='1m', since: Int = None, limit: Int = None, params={}) -> List[list]:
392
- """
393
-
394
- https://docs.wazirx.com/#kline-candlestick-data
395
-
396
- fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
397
- :param str symbol: unified symbol of the market to fetch OHLCV data for
398
- :param str timeframe: the length of time each candle represents. Available values [1m,5m,15m,30m,1h,2h,4h,6h,12h,1d,1w]
399
- :param int [since]: timestamp in ms of the earliest candle to fetch
400
- :param int [limit]: the maximum amount of candles to fetch
401
- :param dict [params]: extra parameters specific to the exchange API endpoint
402
- :param int [params.until]: timestamp in s of the latest candle to fetch
403
- :returns int[][]: A list of candles ordered, open, high, low, close, volume
404
- """
405
- await self.load_markets()
406
- market = self.market(symbol)
407
- request: dict = {
408
- 'symbol': market['id'],
409
- 'interval': self.safe_string(self.timeframes, timeframe, timeframe),
410
- }
411
- if limit is not None:
412
- request['limit'] = min(limit, 2000)
413
- until = self.safe_integer(params, 'until')
414
- params = self.omit(params, ['until'])
415
- if since is not None:
416
- request['startTime'] = self.parse_to_int(since / 1000)
417
- if until is not None:
418
- request['endTime'] = until
419
- response = await self.publicGetKlines(self.extend(request, params))
420
- #
421
- # [
422
- # [1669014360,1402001,1402001,1402001,1402001,0],
423
- # ...
424
- # ]
425
- #
426
- return self.parse_ohlcvs(response, market, timeframe, since, limit)
427
-
428
- def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
429
- #
430
- # [1669014300,1402001,1402001,1402001,1402001,0],
431
- #
432
- return [
433
- self.safe_timestamp(ohlcv, 0),
434
- self.safe_number(ohlcv, 1),
435
- self.safe_number(ohlcv, 2),
436
- self.safe_number(ohlcv, 3),
437
- self.safe_number(ohlcv, 4),
438
- self.safe_number(ohlcv, 5),
439
- ]
440
-
441
- async def fetch_order_book(self, symbol: str, limit: Int = None, params={}) -> OrderBook:
442
- """
443
-
444
- https://docs.wazirx.com/#order-book
445
-
446
- fetches information on open orders with bid(buy) and ask(sell) prices, volumes and other data
447
- :param str symbol: unified symbol of the market to fetch the order book for
448
- :param int [limit]: the maximum amount of order book entries to return
449
- :param dict [params]: extra parameters specific to the exchange API endpoint
450
- :returns dict: A dictionary of `order book structures <https://docs.ccxt.com/#/?id=order-book-structure>` indexed by market symbols
451
- """
452
- await self.load_markets()
453
- market = self.market(symbol)
454
- request: dict = {
455
- 'symbol': market['id'],
456
- }
457
- if limit is not None:
458
- request['limit'] = limit # [1, 5, 10, 20, 50, 100, 500, 1000]
459
- response = await self.publicGetDepth(self.extend(request, params))
460
- #
461
- # {
462
- # "timestamp":1559561187,
463
- # "asks":[
464
- # ["8540.0","1.5"],
465
- # ["8541.0","0.0042"]
466
- # ],
467
- # "bids":[
468
- # ["8530.0","0.8814"],
469
- # ["8524.0","1.4"]
470
- # ]
471
- # }
472
- #
473
- timestamp = self.safe_integer(response, 'timestamp')
474
- return self.parse_order_book(response, symbol, timestamp)
475
-
476
- async def fetch_ticker(self, symbol: str, params={}) -> Ticker:
477
- """
478
-
479
- https://docs.wazirx.com/#24hr-ticker-price-change-statistics
480
-
481
- fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
482
- :param str symbol: unified symbol of the market to fetch the ticker for
483
- :param dict [params]: extra parameters specific to the exchange API endpoint
484
- :returns dict: a `ticker structure <https://docs.ccxt.com/#/?id=ticker-structure>`
485
- """
486
- await self.load_markets()
487
- market = self.market(symbol)
488
- request: dict = {
489
- 'symbol': market['id'],
490
- }
491
- ticker = await self.publicGetTicker24hr(self.extend(request, params))
492
- #
493
- # {
494
- # "symbol":"wrxinr",
495
- # "baseAsset":"wrx",
496
- # "quoteAsset":"inr",
497
- # "openPrice":"94.77",
498
- # "lowPrice":"92.7",
499
- # "highPrice":"95.17",
500
- # "lastPrice":"94.03",
501
- # "volume":"1118700.0",
502
- # "bidPrice":"94.02",
503
- # "askPrice":"94.03",
504
- # "at":1641382455000
505
- # }
506
- #
507
- return self.parse_ticker(ticker, market)
508
-
509
- async def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
510
- """
511
-
512
- https://docs.wazirx.com/#24hr-tickers-price-change-statistics
513
-
514
- fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
515
- :param str[]|None symbols: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
516
- :param dict [params]: extra parameters specific to the exchange API endpoint
517
- :returns dict: a dictionary of `ticker structures <https://docs.ccxt.com/#/?id=ticker-structure>`
518
- """
519
- await self.load_markets()
520
- tickers = await self.publicGetTickers24hr()
521
- #
522
- # [
523
- # {
524
- # "symbol":"btcinr",
525
- # "baseAsset":"btc",
526
- # "quoteAsset":"inr",
527
- # "openPrice":"3698486",
528
- # "lowPrice":"3641155.0",
529
- # "highPrice":"3767999.0",
530
- # "lastPrice":"3713212.0",
531
- # "volume":"254.11582",
532
- # "bidPrice":"3715021.0",
533
- # "askPrice":"3715022.0",
534
- # }
535
- # ...
536
- # ]
537
- #
538
- result: dict = {}
539
- for i in range(0, len(tickers)):
540
- ticker = tickers[i]
541
- parsedTicker = self.parse_ticker(ticker)
542
- symbol = parsedTicker['symbol']
543
- result[symbol] = parsedTicker
544
- return self.filter_by_array_tickers(result, 'symbol', symbols)
545
-
546
- async def fetch_trades(self, symbol: str, since: Int = None, limit: Int = None, params={}) -> List[Trade]:
547
- """
548
-
549
- https://docs.wazirx.com/#recent-trades-list
550
-
551
- get the list of most recent trades for a particular symbol
552
- :param str symbol: unified symbol of the market to fetch trades for
553
- :param int [since]: timestamp in ms of the earliest trade to fetch
554
- :param int [limit]: the maximum amount of trades to fetch
555
- :param dict [params]: extra parameters specific to the exchange API endpoint
556
- :returns Trade[]: a list of `trade structures <https://docs.ccxt.com/#/?id=public-trades>`
557
- """
558
- await self.load_markets()
559
- market = self.market(symbol)
560
- request: dict = {
561
- 'symbol': market['id'],
562
- }
563
- if limit is not None:
564
- request['limit'] = min(limit, 1000) # Default 500; max 1000.
565
- method = self.safe_string(self.options, 'fetchTradesMethod', 'publicGetTrades')
566
- response = None
567
- if method == 'privateGetHistoricalTrades':
568
- response = await self.privateGetHistoricalTrades(self.extend(request, params))
569
- else:
570
- response = await self.publicGetTrades(self.extend(request, params))
571
- # [
572
- # {
573
- # "id":322307791,
574
- # "price":"93.7",
575
- # "qty":"0.7",
576
- # "quoteQty":"65.59",
577
- # "time":1641386701000,
578
- # "isBuyerMaker":false
579
- # },
580
- # ]
581
- return self.parse_trades(response, market, since, limit)
582
-
583
- def parse_trade(self, trade: dict, market: Market = None) -> Trade:
584
- #
585
- # {
586
- # "id":322307791,
587
- # "price":"93.7",
588
- # "qty":"0.7",
589
- # "quoteQty":"65.59",
590
- # "time":1641386701000,
591
- # "isBuyerMaker":false
592
- # }
593
- #
594
- id = self.safe_string(trade, 'id')
595
- timestamp = self.safe_integer(trade, 'time')
596
- datetime = self.iso8601(timestamp)
597
- market = self.safe_market(None, market)
598
- isBuyerMaker = self.safe_value(trade, 'isBuyerMaker')
599
- side = 'sell' if isBuyerMaker else 'buy'
600
- price = self.safe_number(trade, 'price')
601
- amount = self.safe_number(trade, 'qty')
602
- cost = self.safe_number(trade, 'quoteQty')
603
- return self.safe_trade({
604
- 'info': trade,
605
- 'id': id,
606
- 'timestamp': timestamp,
607
- 'datetime': datetime,
608
- 'symbol': market['symbol'],
609
- 'order': id,
610
- 'type': None,
611
- 'side': side,
612
- 'takerOrMaker': None,
613
- 'price': price,
614
- 'amount': amount,
615
- 'cost': cost,
616
- 'fee': None,
617
- }, market)
618
-
619
- async def fetch_status(self, params={}):
620
- """
621
-
622
- https://docs.wazirx.com/#system-status
623
-
624
- the latest known information on the availability of the exchange API
625
- :param dict [params]: extra parameters specific to the exchange API endpoint
626
- :returns dict: a `status structure <https://docs.ccxt.com/#/?id=exchange-status-structure>`
627
- """
628
- response = await self.publicGetSystemStatus(params)
629
- #
630
- # {
631
- # "status":"normal", # normal, system maintenance
632
- # "message":"System is running normally."
633
- # }
634
- #
635
- status = self.safe_string(response, 'status')
636
- return {
637
- 'status': 'ok' if (status == 'normal') else 'maintenance',
638
- 'updated': None,
639
- 'eta': None,
640
- 'url': None,
641
- 'info': response,
642
- }
643
-
644
- async def fetch_time(self, params={}):
645
- """
646
-
647
- https://docs.wazirx.com/#check-server-time
648
-
649
- fetches the current integer timestamp in milliseconds from the exchange server
650
- :param dict [params]: extra parameters specific to the exchange API endpoint
651
- :returns int: the current integer timestamp in milliseconds from the exchange server
652
- """
653
- response = await self.publicGetTime(params)
654
- #
655
- # {
656
- # "serverTime":1635467280514
657
- # }
658
- #
659
- return self.safe_integer(response, 'serverTime')
660
-
661
- def parse_ticker(self, ticker: dict, market: Market = None) -> Ticker:
662
- #
663
- # {
664
- # "symbol":"btcinr",
665
- # "baseAsset":"btc",
666
- # "quoteAsset":"inr",
667
- # "openPrice":"3698486",
668
- # "lowPrice":"3641155.0",
669
- # "highPrice":"3767999.0",
670
- # "lastPrice":"3713212.0",
671
- # "volume":"254.11582", # base volume
672
- # "bidPrice":"3715021.0",
673
- # "askPrice":"3715022.0",
674
- # "at":1641382455000 # only on fetchTicker
675
- # }
676
- #
677
- marketId = self.safe_string(ticker, 'symbol')
678
- market = self.safe_market(marketId, market)
679
- symbol = market['symbol']
680
- last = self.safe_string(ticker, 'lastPrice')
681
- open = self.safe_string(ticker, 'openPrice')
682
- high = self.safe_string(ticker, 'highPrice')
683
- low = self.safe_string(ticker, 'lowPrice')
684
- baseVolume = self.safe_string(ticker, 'volume')
685
- bid = self.safe_string(ticker, 'bidPrice')
686
- ask = self.safe_string(ticker, 'askPrice')
687
- timestamp = self.safe_integer(ticker, 'at')
688
- return self.safe_ticker({
689
- 'symbol': symbol,
690
- 'timestamp': timestamp,
691
- 'datetime': self.iso8601(timestamp),
692
- 'high': high,
693
- 'low': low,
694
- 'bid': bid,
695
- 'bidVolume': None,
696
- 'ask': ask,
697
- 'askVolume': None,
698
- 'vwap': None,
699
- 'open': open,
700
- 'close': last,
701
- 'last': last,
702
- 'previousClose': None,
703
- 'change': None,
704
- 'percentage': None,
705
- 'average': None,
706
- 'baseVolume': baseVolume,
707
- 'quoteVolume': None,
708
- 'info': ticker,
709
- }, market)
710
-
711
- def parse_balance(self, response) -> Balances:
712
- result: dict = {'info': response}
713
- for i in range(0, len(response)):
714
- balance = response[i]
715
- id = self.safe_string(balance, 'asset')
716
- code = self.safe_currency_code(id)
717
- account = self.account()
718
- account['free'] = self.safe_string(balance, 'free')
719
- account['used'] = self.safe_string(balance, 'locked')
720
- result[code] = account
721
- return self.safe_balance(result)
722
-
723
- async def fetch_balance(self, params={}) -> Balances:
724
- """
725
-
726
- https://docs.wazirx.com/#fund-details-user_data
727
-
728
- query for balance and get the amount of funds available for trading or funds locked in orders
729
- :param dict [params]: extra parameters specific to the exchange API endpoint
730
- :returns dict: a `balance structure <https://docs.ccxt.com/#/?id=balance-structure>`
731
- """
732
- await self.load_markets()
733
- response = await self.privateGetFunds(params)
734
- #
735
- # [
736
- # {
737
- # "asset":"inr",
738
- # "free":"0.0",
739
- # "locked":"0.0"
740
- # },
741
- # ]
742
- #
743
- return self.parse_balance(response)
744
-
745
- async def fetch_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
746
- """
747
-
748
- https://docs.wazirx.com/#all-orders-user_data
749
-
750
- fetches information on multiple orders made by the user
751
- :param str symbol: unified market symbol of the market orders were made in
752
- :param int [since]: the earliest time in ms to fetch orders for
753
- :param int [limit]: the maximum number of order structures to retrieve
754
- :param dict [params]: extra parameters specific to the exchange API endpoint
755
- :returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
756
- """
757
- if symbol is None:
758
- raise ArgumentsRequired(self.id + ' fetchOrders() requires a symbol argument')
759
- await self.load_markets()
760
- market = self.market(symbol)
761
- request: dict = {
762
- 'symbol': market['id'],
763
- }
764
- if since is not None:
765
- request['startTime'] = since
766
- if limit is not None:
767
- request['limit'] = limit
768
- response = await self.privateGetAllOrders(self.extend(request, params))
769
- #
770
- # [
771
- # {
772
- # "id": 28,
773
- # "symbol": "wrxinr",
774
- # "price": "9293.0",
775
- # "origQty": "10.0",
776
- # "executedQty": "8.2",
777
- # "status": "cancel",
778
- # "type": "limit",
779
- # "side": "sell",
780
- # "createdTime": 1499827319559,
781
- # "updatedTime": 1499827319559
782
- # },
783
- # {
784
- # "id": 30,
785
- # "symbol": "wrxinr",
786
- # "price": "9293.0",
787
- # "stopPrice": "9200.0",
788
- # "origQty": "10.0",
789
- # "executedQty": "0.0",
790
- # "status": "cancel",
791
- # "type": "stop_limit",
792
- # "side": "sell",
793
- # "createdTime": 1499827319559,
794
- # "updatedTime": 1507725176595
795
- # }
796
- # ]
797
- #
798
- orders = self.parse_orders(response, market, since, limit)
799
- orders = self.filter_by(orders, 'symbol', symbol)
800
- return orders
801
-
802
- async def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
803
- """
804
-
805
- https://docs.wazirx.com/#current-open-orders-user_data
806
-
807
- fetch all unfilled currently open orders
808
- :param str symbol: unified market symbol
809
- :param int [since]: the earliest time in ms to fetch open orders for
810
- :param int [limit]: the maximum number of open orders structures to retrieve
811
- :param dict [params]: extra parameters specific to the exchange API endpoint
812
- :returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
813
- """
814
- await self.load_markets()
815
- request: dict = {}
816
- market: Market = None
817
- if symbol is not None:
818
- market = self.market(symbol)
819
- request['symbol'] = market['id']
820
- response = await self.privateGetOpenOrders(self.extend(request, params))
821
- # [
822
- # {
823
- # "id": 28,
824
- # "symbol": "wrxinr",
825
- # "price": "9293.0",
826
- # "origQty": "10.0",
827
- # "executedQty": "8.2",
828
- # "status": "cancel",
829
- # "type": "limit",
830
- # "side": "sell",
831
- # "createdTime": 1499827319559,
832
- # "updatedTime": 1499827319559
833
- # },
834
- # {
835
- # "id": 30,
836
- # "symbol": "wrxinr",
837
- # "price": "9293.0",
838
- # "stopPrice": "9200.0",
839
- # "origQty": "10.0",
840
- # "executedQty": "0.0",
841
- # "status": "cancel",
842
- # "type": "stop_limit",
843
- # "side": "sell",
844
- # "createdTime": 1499827319559,
845
- # "updatedTime": 1507725176595
846
- # }
847
- # ]
848
- orders = self.parse_orders(response, market, since, limit)
849
- return orders
850
-
851
- async def cancel_all_orders(self, symbol: Str = None, params={}):
852
- """
853
-
854
- https://docs.wazirx.com/#cancel-all-open-orders-on-a-symbol-trade
855
-
856
- cancel all open orders in a market
857
- :param str symbol: unified market symbol of the market to cancel orders in
858
- :param dict [params]: extra parameters specific to the exchange API endpoint
859
- :returns dict[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
860
- """
861
- if symbol is None:
862
- raise ArgumentsRequired(self.id + ' cancelAllOrders() requires a symbol argument')
863
- await self.load_markets()
864
- market = self.market(symbol)
865
- request: dict = {
866
- 'symbol': market['id'],
867
- }
868
- response = await self.privateDeleteOpenOrders(self.extend(request, params))
869
- #
870
- # [
871
- # {
872
- # id: "4565421197",
873
- # symbol: "adausdt",
874
- # type: "limit",
875
- # side: "buy",
876
- # status: "wait",
877
- # price: "0.41",
878
- # origQty: "11.00",
879
- # executedQty: "0.00",
880
- # avgPrice: "0.00",
881
- # createdTime: "1718089507000",
882
- # updatedTime: "1718089507000",
883
- # clientOrderId: "93d2a838-e272-405d-91e7-3a7bc6d3a003"
884
- # }
885
- # ]
886
- #
887
- return self.parse_orders(response)
888
-
889
- async def cancel_order(self, id: str, symbol: Str = None, params={}):
890
- """
891
-
892
- https://docs.wazirx.com/#cancel-order-trade
893
-
894
- cancels an open order
895
- :param str id: order id
896
- :param str symbol: unified symbol of the market the order was made in
897
- :param dict [params]: extra parameters specific to the exchange API endpoint
898
- :returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
899
- """
900
- if symbol is None:
901
- raise ArgumentsRequired(self.id + ' cancelOrder() requires a symbol argument')
902
- await self.load_markets()
903
- market = self.market(symbol)
904
- request: dict = {
905
- 'symbol': market['id'],
906
- 'orderId': id,
907
- }
908
- response = await self.privateDeleteOrder(self.extend(request, params))
909
- return self.parse_order(response)
910
-
911
- async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
912
- """
913
-
914
- https://docs.wazirx.com/#new-order-trade
915
-
916
- create a trade order
917
- :param str symbol: unified symbol of the market to create an order in
918
- :param str type: 'market' or 'limit'
919
- :param str side: 'buy' or 'sell'
920
- :param float amount: how much of currency you want to trade in units of base currency
921
- :param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
922
- :param dict [params]: extra parameters specific to the exchange API endpoint
923
- :returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
924
- """
925
- type = type.lower()
926
- if (type != 'limit') and (type != 'stop_limit'):
927
- raise ExchangeError(self.id + ' createOrder() supports limit and stop_limit orders only')
928
- if price is None:
929
- raise ExchangeError(self.id + ' createOrder() requires a price argument')
930
- await self.load_markets()
931
- market = self.market(symbol)
932
- request: dict = {
933
- 'symbol': market['id'],
934
- 'side': side,
935
- 'quantity': amount,
936
- 'type': 'limit',
937
- }
938
- request['price'] = self.price_to_precision(symbol, price)
939
- triggerPrice = self.safe_string_2(params, 'triggerPrice', 'stopPrice')
940
- if triggerPrice is not None:
941
- request['type'] = 'stop_limit'
942
- request['stopPrice'] = self.price_to_precision(symbol, triggerPrice)
943
- response = await self.privatePostOrder(self.extend(request, params))
944
- # {
945
- # "id": 28,
946
- # "symbol": "wrxinr",
947
- # "price": "9293.0",
948
- # "origQty": "10.0",
949
- # "executedQty": "8.2",
950
- # "status": "wait",
951
- # "type": "limit",
952
- # "side": "sell",
953
- # "createdTime": 1499827319559,
954
- # "updatedTime": 1499827319559
955
- # }
956
- return self.parse_order(response, market)
957
-
958
- def parse_order(self, order: dict, market: Market = None) -> Order:
959
- #
960
- # {
961
- # "id": 1949417813,
962
- # "symbol": "ltcusdt",
963
- # "type": "limit",
964
- # "side": "sell",
965
- # "status": "done",
966
- # "price": "146.2",
967
- # "origQty": "0.05",
968
- # "executedQty": "0.05",
969
- # "avgPrice": "0.00",
970
- # "createdTime": 1641252564000,
971
- # "updatedTime": 1641252564000
972
- # "clientOrderId": "93d2a838-e272-405d-91e7-3a7bc6d3a003"
973
- # }
974
- #
975
- created = self.safe_integer(order, 'createdTime')
976
- updated = self.safe_integer(order, 'updatedTime')
977
- marketId = self.safe_string(order, 'symbol')
978
- symbol = self.safe_symbol(marketId, market)
979
- amount = self.safe_string(order, 'quantity')
980
- filled = self.safe_string(order, 'executedQty')
981
- status = self.parse_order_status(self.safe_string(order, 'status'))
982
- id = self.safe_string(order, 'id')
983
- price = self.safe_string(order, 'price')
984
- type = self.safe_string_lower(order, 'type')
985
- side = self.safe_string_lower(order, 'side')
986
- return self.safe_order({
987
- 'info': order,
988
- 'id': id,
989
- 'clientOrderId': self.safe_string(order, 'clientOrderId'),
990
- 'timestamp': created,
991
- 'datetime': self.iso8601(created),
992
- 'lastTradeTimestamp': updated,
993
- 'status': status,
994
- 'symbol': symbol,
995
- 'type': type,
996
- 'timeInForce': None,
997
- 'postOnly': None,
998
- 'side': side,
999
- 'price': price,
1000
- 'amount': amount,
1001
- 'filled': filled,
1002
- 'remaining': None,
1003
- 'cost': None,
1004
- 'fee': None,
1005
- 'average': self.safe_string(order, 'avgPrice'),
1006
- 'trades': [],
1007
- }, market)
1008
-
1009
- def parse_order_status(self, status: Str):
1010
- statuses: dict = {
1011
- 'wait': 'open',
1012
- 'done': 'closed',
1013
- 'cancel': 'canceled',
1014
- }
1015
- return self.safe_string(statuses, status, status)
1016
-
1017
- async def fetch_currencies(self, params={}) -> Currencies:
1018
- """
1019
- fetches all available currencies on an exchange
1020
-
1021
- https://docs.wazirx.com/#all-coins-39-information-user_data
1022
-
1023
- :param dict [params]: extra parameters specific to the exchange API endpoint
1024
- :returns dict: an associative dictionary of currencies
1025
- """
1026
- if not self.check_required_credentials(False):
1027
- return None
1028
- response = await self.privateGetCoins(params)
1029
- #
1030
- # [
1031
- # {
1032
- # "currency": "btc",
1033
- # "name": "Bitcoin",
1034
- # "networkList": [
1035
- # {
1036
- # "addressRegex": "^[13][a-km-zA-HJ-NP-Z1-9]{25,34}$|^(bc1)[0-9A-Za-z]{39,59}$",
1037
- # "confirmations": 4,
1038
- # "depositDesc": {
1039
- # "description": ""
1040
- # },
1041
- # "depositDust": "0.00000001",
1042
- # "depositEnable": True,
1043
- # "disclaimer": "• \u003cb\u003eSend only using the Bitcoin network.\u003c/b\u003e Using any other network will result in loss of funds.\u003cbr/\u003e• \u003cb\u003eDeposit only BTC to self deposit address.\u003c/b\u003e Depositing any other asset will result in a loss of funds.\u003cbr/\u003e",
1044
- # "fullName": null,
1045
- # "hidden": {
1046
- # "deposit": False,
1047
- # "withdraw": False
1048
- # },
1049
- # "isDefault": True,
1050
- # "maxWithdrawAmount": "3",
1051
- # "minConfirm": 4,
1052
- # "minWithdrawAmount": "0.003",
1053
- # "name": "Bitcoin",
1054
- # "network": "btc",
1055
- # "order": 3,
1056
- # "precision": 8,
1057
- # "requestId": "6d67a13d-26f7-4941-9856-94eba4adfe78",
1058
- # "shortName": "BTC",
1059
- # "specialTip": "Please ensure to select \u003cb\u003eBitcoin\u003c/b\u003e network at sender's wallet.",
1060
- # "withdrawConsent": {
1061
- # "helpUrl": null,
1062
- # "message": "I confirm that self withdrawal of crypto assets is being done to my own wallet, above. I authorize you to share travel rule information with the destination wallet service provider wherever applicable."
1063
- # },
1064
- # "withdrawDesc": {
1065
- # "description": ""
1066
- # },
1067
- # "withdrawEnable": True,
1068
- # "withdrawFee": "0.0015"
1069
- # }
1070
- # ],
1071
- # "rapidListed": False
1072
- # }
1073
- # ]
1074
- #
1075
- result: dict = {}
1076
- for i in range(0, len(response)):
1077
- currency = response[i]
1078
- currencyId = self.safe_string(currency, 'currency')
1079
- code = self.safe_currency_code(currencyId)
1080
- name = self.safe_string(currency, 'name')
1081
- chains = self.safe_list(currency, 'networkList', [])
1082
- networks: dict = {}
1083
- minPrecision = None
1084
- minWithdrawFeeString = None
1085
- minWithdrawString = None
1086
- maxWithdrawString = None
1087
- minDepositString = None
1088
- deposit = False
1089
- withdraw = False
1090
- for j in range(0, len(chains)):
1091
- chain = chains[j]
1092
- networkId = self.safe_string(chain, 'network')
1093
- networkCode = self.network_id_to_code(networkId)
1094
- precision = self.parse_number(self.parse_precision(self.safe_string(chain, 'precision')))
1095
- minPrecision = precision if (minPrecision is None) else min(minPrecision, precision)
1096
- depositAllowed = self.safe_bool(chain, 'depositEnable')
1097
- deposit = depositAllowed if (depositAllowed) else deposit
1098
- withdrawAllowed = self.safe_bool(chain, 'withdrawEnable')
1099
- withdraw = withdrawAllowed if (withdrawAllowed) else withdraw
1100
- withdrawFeeString = self.safe_string(chain, 'withdrawFee')
1101
- if withdrawFeeString is not None:
1102
- minWithdrawFeeString = withdrawFeeString if (minWithdrawFeeString is None) else Precise.string_min(withdrawFeeString, minWithdrawFeeString)
1103
- minNetworkWithdrawString = self.safe_string(chain, 'minWithdrawAmount')
1104
- if minNetworkWithdrawString is not None:
1105
- minWithdrawString = minNetworkWithdrawString if (minWithdrawString is None) else Precise.string_min(minNetworkWithdrawString, minWithdrawString)
1106
- maxNetworkWithdrawString = self.safe_string(chain, 'maxWithdrawAmount')
1107
- if maxNetworkWithdrawString is not None:
1108
- maxWithdrawString = maxNetworkWithdrawString if (maxWithdrawString is None) else Precise.string_min(maxNetworkWithdrawString, maxWithdrawString)
1109
- minNetworkDepositString = self.safe_string(chain, 'depositDust')
1110
- if minNetworkDepositString is not None:
1111
- minDepositString = minNetworkDepositString if (minDepositString is None) else Precise.string_min(minNetworkDepositString, minDepositString)
1112
- networks[networkCode] = {
1113
- 'info': chain,
1114
- 'id': networkId,
1115
- 'network': networkCode,
1116
- 'active': depositAllowed and withdrawAllowed,
1117
- 'deposit': depositAllowed,
1118
- 'withdraw': withdrawAllowed,
1119
- 'fee': self.parse_number(withdrawFeeString),
1120
- 'precision': precision,
1121
- 'limits': {
1122
- 'withdraw': {
1123
- 'min': self.parse_number(minNetworkWithdrawString),
1124
- 'max': self.parse_number(maxNetworkWithdrawString),
1125
- },
1126
- 'deposit': {
1127
- 'min': self.parse_number(minNetworkDepositString),
1128
- 'max': None,
1129
- },
1130
- },
1131
- }
1132
- result[code] = {
1133
- 'info': currency,
1134
- 'code': code,
1135
- 'id': currencyId,
1136
- 'name': name,
1137
- 'active': deposit and withdraw,
1138
- 'deposit': deposit,
1139
- 'withdraw': withdraw,
1140
- 'fee': self.parse_number(minWithdrawFeeString),
1141
- 'precision': minPrecision,
1142
- 'limits': {
1143
- 'amount': {
1144
- 'min': None,
1145
- 'max': None,
1146
- },
1147
- 'withdraw': {
1148
- 'min': self.parse_number(minWithdrawString),
1149
- 'max': self.parse_number(maxWithdrawString),
1150
- },
1151
- 'deposit': {
1152
- 'min': self.parse_number(minDepositString),
1153
- 'max': None,
1154
- },
1155
- },
1156
- 'networks': networks,
1157
- }
1158
- return result
1159
-
1160
- async def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
1161
- """
1162
- fetch the deposit address for a currency associated with self account
1163
-
1164
- https://docs.wazirx.com/#deposit-address-supporting-network-user_data
1165
-
1166
- :param str code: unified currency code of the currency for the deposit address
1167
- :param dict [params]: extra parameters specific to the exchange API endpoint
1168
- :param str [params.network]: unified network code, you can get network from fetchCurrencies
1169
- :returns dict: an `address structure <https://docs.ccxt.com/#/?id=address-structure>`
1170
- """
1171
- await self.load_markets()
1172
- currency = self.currency(code)
1173
- networkCode = self.safe_string(params, 'network')
1174
- params = self.omit(params, 'network')
1175
- if networkCode is None:
1176
- raise ArgumentsRequired(self.id + ' fetchDepositAddress() requires a network parameter')
1177
- request: dict = {
1178
- 'coin': currency['id'],
1179
- 'network': self.network_code_to_id(networkCode, code),
1180
- }
1181
- response = await self.privateGetCryptoDepositsAddress(self.extend(request, params))
1182
- #
1183
- # {
1184
- # "address": "bc1qrzpyzh69pfclpqy7c3yg8rkjsy49se7642v4q3",
1185
- # "coin": "btc",
1186
- # "url": "https: #live.blockcypher.com/btc/address/bc1qrzpyzh69pfclpqy7c3yg8rkjsy49se7642v4q3"
1187
- # }
1188
- #
1189
- return {
1190
- 'info': response,
1191
- 'currency': code,
1192
- 'network': self.network_code_to_id(networkCode, code),
1193
- 'address': self.safe_string(response, 'address'),
1194
- 'tag': None,
1195
- }
1196
-
1197
- async def fetch_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
1198
- """
1199
- fetch all withdrawals made from an account
1200
-
1201
- https://docs.wazirx.com/#withdraw-history-supporting-network-user_data
1202
-
1203
- :param str code: unified currency code
1204
- :param int [since]: the earliest time in ms to fetch withdrawals for
1205
- :param int [limit]: the maximum number of withdrawals structures to retrieve
1206
- :param dict [params]: extra parameters specific to the exchange API endpoint
1207
- :param int [params.until]: the latest time in ms to fetch entries for
1208
- :returns dict[]: a list of `transaction structures <https://docs.ccxt.com/#/?id=transaction-structure>`
1209
- """
1210
- await self.load_markets()
1211
- request: dict = {}
1212
- currency = None
1213
- if code is not None:
1214
- currency = self.currency(code)
1215
- request['coin'] = currency['id']
1216
- if limit is not None:
1217
- request['limit'] = limit
1218
- until = self.safe_integer(params, 'until')
1219
- params = self.omit(params, ['until'])
1220
- if since is not None:
1221
- request['startTime'] = since
1222
- if until is not None:
1223
- request['endTime'] = until
1224
- response = await self.privateGetCryptoWithdraws(self.extend(request, params))
1225
- #
1226
- # [
1227
- # {
1228
- # "address": "0x94df8b352de7f46f64b01d3666bf6e936e44ce60",
1229
- # "amount": "8.91000000",
1230
- # "createdAt": "2019-10-12 09:12:02",
1231
- # "lastUpdated": "2019-10-12 11:12:02",
1232
- # "coin": "USDT",
1233
- # "id": "b6ae22b3aa844210a7041aee7589627c",
1234
- # "withdrawOrderId": "WITHDRAWtest123",
1235
- # "network": "ETH",
1236
- # "status": 1,
1237
- # "transactionFee": "0.004",
1238
- # "failureInfo":"The address is not valid. Please confirm with the recipient",
1239
- # "txId": "0xb5ef8c13b968a406cc62a93a8bd80f9e9a906ef1b3fcf20a2e48573c17659268"
1240
- # }
1241
- # ]
1242
- #
1243
- return self.parse_transactions(response, currency, since, limit)
1244
-
1245
- def parse_transaction_status(self, status: Str):
1246
- statuses: dict = {
1247
- '0': 'ok',
1248
- '1': 'fail',
1249
- '2': 'pending',
1250
- '3': 'canceled',
1251
- }
1252
- return self.safe_string(statuses, status, status)
1253
-
1254
- def parse_transaction(self, transaction: dict, currency: Currency = None) -> Transaction:
1255
- #
1256
- # {
1257
- # "address": "0x94df8b352de7f46f64b01d3666bf6e936e44ce60",
1258
- # "amount": "8.91000000",
1259
- # "createdAt": "2019-10-12 09:12:02",
1260
- # "lastUpdated": "2019-10-12 11:12:02",
1261
- # "coin": "USDT",
1262
- # "id": "b6ae22b3aa844210a7041aee7589627c",
1263
- # "withdrawOrderId": "WITHDRAWtest123",
1264
- # "network": "ETH",
1265
- # "status": 1,
1266
- # "transactionFee": "0.004",
1267
- # "failureInfo": "The address is not valid. Please confirm with the recipient",
1268
- # "txId": "0xb5ef8c13b968a406cc62a93a8bd80f9e9a906ef1b3fcf20a2e48573c17659268"
1269
- # }
1270
- #
1271
- currencyId = self.safe_string(transaction, 'coin')
1272
- code = self.safe_currency_code(currencyId, currency)
1273
- timestamp = self.parse8601(self.safe_string(transaction, 'createdAt'))
1274
- updated = self.parse8601(self.safe_string(transaction, 'lastUpdated'))
1275
- status = self.parse_transaction_status(self.safe_string(transaction, 'status'))
1276
- feeCost = self.safe_number(transaction, 'transactionFee')
1277
- fee = None
1278
- if feeCost is not None:
1279
- fee = {
1280
- 'cost': feeCost,
1281
- 'currency': code,
1282
- }
1283
- return {
1284
- 'info': transaction,
1285
- 'id': self.safe_string(transaction, 'id'),
1286
- 'txid': self.safe_string(transaction, 'txId'),
1287
- 'timestamp': timestamp,
1288
- 'datetime': self.iso8601(timestamp),
1289
- 'network': self.network_id_to_code(self.safe_string(transaction, 'network')),
1290
- 'address': self.safe_string(transaction, 'address'),
1291
- 'addressTo': self.safe_string(transaction, 'address'),
1292
- 'addressFrom': None,
1293
- 'tag': None,
1294
- 'tagTo': None,
1295
- 'tagFrom': None,
1296
- 'type': 'withdrawal',
1297
- 'amount': self.safe_number(transaction, 'amount'),
1298
- 'currency': code,
1299
- 'status': status,
1300
- 'updated': updated,
1301
- 'fee': fee,
1302
- 'internal': None,
1303
- 'comment': None,
1304
- }
1305
-
1306
- def sign(self, path, api='public', method='GET', params={}, headers=None, body=None):
1307
- url = self.urls['api']['rest'] + '/' + path
1308
- if api == 'public':
1309
- if params:
1310
- url += '?' + self.urlencode(params)
1311
- if api == 'private':
1312
- self.check_required_credentials()
1313
- timestamp = self.milliseconds()
1314
- data = self.extend({'recvWindow': self.options['recvWindow'], 'timestamp': timestamp}, params)
1315
- data = self.keysort(data)
1316
- signature = self.hmac(self.encode(self.urlencode(data)), self.encode(self.secret), hashlib.sha256)
1317
- url += '?' + self.urlencode(data)
1318
- url += '&' + 'signature=' + signature
1319
- headers = {
1320
- 'Content-Type': 'application/x-www-form-urlencoded',
1321
- 'X-Api-Key': self.apiKey,
1322
- }
1323
- return {'url': url, 'method': method, 'body': body, 'headers': headers}
1324
-
1325
- def handle_errors(self, code: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody):
1326
- #
1327
- # {"code":2098,"message":"Request out of receiving window."}
1328
- #
1329
- if response is None:
1330
- return None
1331
- errorCode = self.safe_string(response, 'code')
1332
- if errorCode is not None:
1333
- feedback = self.id + ' ' + body
1334
- self.throw_exactly_matched_exception(self.exceptions['exact'], errorCode, feedback)
1335
- raise ExchangeError(feedback)
1336
- return None