ccxt-ir 4.9.2__py2.py3-none-any.whl → 4.9.10__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 (46) hide show
  1. ccxt/__init__.py +17 -1
  2. ccxt/abantether.py +88 -69
  3. ccxt/abstract/abantether.py +1 -1
  4. ccxt/abstract/arzplus.py +1 -0
  5. ccxt/abstract/bitbarg.py +5 -0
  6. ccxt/abstract/bydfi.py +8 -0
  7. ccxt/abstract/cafearz.py +5 -0
  8. ccxt/abstract/hamtapay.py +6 -0
  9. ccxt/abstract/kifpoolme.py +6 -0
  10. ccxt/abstract/mazdax.py +8 -0
  11. ccxt/abstract/pingi.py +6 -0
  12. ccxt/abstract/pooleno.py +5 -0
  13. ccxt/afratether.py +84 -36
  14. ccxt/arzplus.py +144 -8
  15. ccxt/async_support/__init__.py +17 -1
  16. ccxt/async_support/abantether.py +88 -69
  17. ccxt/async_support/afratether.py +84 -36
  18. ccxt/async_support/arzplus.py +144 -8
  19. ccxt/async_support/base/exchange.py +1 -1
  20. ccxt/async_support/bitbarg.py +298 -0
  21. ccxt/async_support/bydfi.py +406 -0
  22. ccxt/async_support/cafearz.py +333 -0
  23. ccxt/async_support/hamtapay.py +285 -0
  24. ccxt/async_support/kifpoolme.py +385 -0
  25. ccxt/async_support/mazdax.py +512 -0
  26. ccxt/async_support/pingi.py +426 -0
  27. ccxt/async_support/pooleno.py +331 -0
  28. ccxt/async_support/tetherland.py +4 -4
  29. ccxt/async_support/twox.py +52 -28
  30. ccxt/base/exchange.py +1 -1
  31. ccxt/bitbarg.py +298 -0
  32. ccxt/bydfi.py +406 -0
  33. ccxt/cafearz.py +333 -0
  34. ccxt/hamtapay.py +285 -0
  35. ccxt/kifpoolme.py +385 -0
  36. ccxt/mazdax.py +512 -0
  37. ccxt/pingi.py +426 -0
  38. ccxt/pooleno.py +331 -0
  39. ccxt/pro/__init__.py +1 -1
  40. ccxt/tetherland.py +4 -4
  41. ccxt/twox.py +52 -28
  42. {ccxt_ir-4.9.2.dist-info → ccxt_ir-4.9.10.dist-info}/METADATA +8 -8
  43. {ccxt_ir-4.9.2.dist-info → ccxt_ir-4.9.10.dist-info}/RECORD +46 -22
  44. {ccxt_ir-4.9.2.dist-info → ccxt_ir-4.9.10.dist-info}/WHEEL +0 -0
  45. {ccxt_ir-4.9.2.dist-info → ccxt_ir-4.9.10.dist-info}/licenses/LICENSE.txt +0 -0
  46. {ccxt_ir-4.9.2.dist-info → ccxt_ir-4.9.10.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,298 @@
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.bitbarg import ImplicitAPI
8
+ from ccxt.base.types import Any, Market, Strings, Ticker, Tickers
9
+ from typing import List
10
+
11
+
12
+ class bitbarg(Exchange, ImplicitAPI):
13
+
14
+ def describe(self) -> Any:
15
+ return self.deep_extend(super(bitbarg, self).describe(), {
16
+ 'id': 'bitbarg',
17
+ 'name': 'Bitbarg',
18
+ 'countries': ['IR'],
19
+ 'rateLimit': 1000,
20
+ 'version': '1',
21
+ 'certified': False,
22
+ 'pro': False,
23
+ 'has': {
24
+ 'CORS': None,
25
+ 'spot': True,
26
+ 'margin': False,
27
+ 'swap': False,
28
+ 'future': False,
29
+ 'option': False,
30
+ 'addMargin': False,
31
+ 'cancelAllOrders': False,
32
+ 'cancelOrder': False,
33
+ 'cancelOrders': False,
34
+ 'createDepositAddress': False,
35
+ 'createOrder': False,
36
+ 'createStopLimitOrder': False,
37
+ 'createStopMarketOrder': False,
38
+ 'createStopOrder': False,
39
+ 'editOrder': False,
40
+ 'fetchBalance': False,
41
+ 'fetchBorrowInterest': False,
42
+ 'fetchBorrowRateHistories': False,
43
+ 'fetchBorrowRateHistory': False,
44
+ 'fetchClosedOrders': False,
45
+ 'fetchCrossBorrowRate': False,
46
+ 'fetchCrossBorrowRates': False,
47
+ 'fetchCurrencies': False,
48
+ 'fetchDepositAddress': False,
49
+ 'fetchDeposits': False,
50
+ 'fetchFundingHistory': False,
51
+ 'fetchFundingRate': False,
52
+ 'fetchFundingRateHistory': False,
53
+ 'fetchFundingRates': False,
54
+ 'fetchIndexOHLCV': False,
55
+ 'fetchIsolatedBorrowRate': False,
56
+ 'fetchIsolatedBorrowRates': False,
57
+ 'fetchL2OrderBook': False,
58
+ 'fetchL3OrderBook': False,
59
+ 'fetchLedger': False,
60
+ 'fetchLedgerEntry': False,
61
+ 'fetchLeverageTiers': False,
62
+ 'fetchMarkets': True,
63
+ 'fetchMarkOHLCV': False,
64
+ 'fetchMyTrades': False,
65
+ 'fetchOHLCV': False,
66
+ 'fetchOpenInterestHistory': False,
67
+ 'fetchOpenOrders': False,
68
+ 'fetchOrder': False,
69
+ 'fetchOrderBook': False,
70
+ 'fetchOrders': False,
71
+ 'fetchOrderTrades': 'emulated',
72
+ 'fetchPositions': False,
73
+ 'fetchPremiumIndexOHLCV': False,
74
+ 'fetchTicker': True,
75
+ 'fetchTickers': True,
76
+ 'fetchTime': False,
77
+ 'fetchTrades': False,
78
+ 'fetchTradingFee': False,
79
+ 'fetchTradingFees': False,
80
+ 'fetchWithdrawals': False,
81
+ 'setLeverage': False,
82
+ 'setMarginMode': False,
83
+ 'transfer': False,
84
+ 'withdraw': False,
85
+ },
86
+ 'comment': 'This comment is optional',
87
+ 'urls': {
88
+ 'logo': 'https://cdn.arz.digital/cr-odin/img/exchanges/bitbarg/64x64.png',
89
+ 'api': {
90
+ 'public': 'https://api.bitbarg.com',
91
+ },
92
+ 'www': 'https://bitbarg.com/',
93
+ 'doc': [
94
+ 'https://bitbarg.com/',
95
+ ],
96
+ },
97
+ 'api': {
98
+ 'public': {
99
+ 'get': {
100
+ '/api/v1/currencies': 1,
101
+ },
102
+ },
103
+ },
104
+ 'fees': {
105
+ 'trading': {
106
+ 'tierBased': False,
107
+ 'percentage': True,
108
+ 'maker': self.parse_number('0.001'),
109
+ 'taker': self.parse_number('0.001'),
110
+ },
111
+ },
112
+ })
113
+
114
+ def parse_market(self, market) -> Market:
115
+ # "id": 53,
116
+ # "icon": "https://s3.bitbarg.com/currencies/btc.webp",
117
+ # "tradeActive": True,
118
+ # "faName": "بیت کوین",
119
+ # "enName": "Bitcoin",
120
+ # "coin": "BTC",
121
+ # "path": "bitcoin",
122
+ # "price": 112192,
123
+ # "quote": "813430226.5004",
124
+ # "percent": -5.735,
125
+ # "decimal": 8,
126
+ # "isFavorite": False,
127
+ baseId = self.safe_string(market, 'coin')
128
+ quoteId = 'USDT'
129
+ base = self.safe_currency_code(baseId)
130
+ quote = self.safe_currency_code(quoteId)
131
+ id = baseId + '/' + quoteId
132
+ return {
133
+ 'id': id,
134
+ 'symbol': id,
135
+ 'base': base,
136
+ 'quote': quote,
137
+ 'settle': None,
138
+ 'baseId': baseId,
139
+ 'quoteId': quoteId,
140
+ 'settleId': None,
141
+ 'type': 'otc',
142
+ 'spot': False,
143
+ 'margin': False,
144
+ 'swap': False,
145
+ 'future': False,
146
+ 'option': False,
147
+ 'active': True,
148
+ 'contract': False,
149
+ 'linear': None,
150
+ 'inverse': None,
151
+ 'contractSize': None,
152
+ 'expiry': None,
153
+ 'expiryDatetime': None,
154
+ 'strike': None,
155
+ 'optionType': None,
156
+ 'precision': {
157
+ 'amount': None,
158
+ 'price': None,
159
+ },
160
+ 'limits': {
161
+ 'leverage': {
162
+ 'min': None,
163
+ 'max': None,
164
+ },
165
+ 'amount': {
166
+ 'min': None,
167
+ 'max': None,
168
+ },
169
+ 'price': {
170
+ 'min': None,
171
+ 'max': None,
172
+ },
173
+ 'cost': {
174
+ 'min': None,
175
+ 'max': None,
176
+ },
177
+ },
178
+ 'created': None,
179
+ 'info': market,
180
+ }
181
+
182
+ async def fetch_markets(self, params={}) -> List[Market]:
183
+ """
184
+ retrieves data on all markets for bitbarg
185
+ https://api.bitbarg.com/api/v1/currencies?pageSize=-1
186
+ :param dict [params]: extra parameters specific to the exchange API endpoint
187
+ :returns dict[]: an array of objects representing market data
188
+ """
189
+ request = {
190
+ 'pageSize': -1,
191
+ }
192
+ response = await self.publicGetApiV1Currencies(self.extend(request, params))
193
+ result = []
194
+ data = self.safe_dict(response, 'result', {})
195
+ items = self.safe_list(data, 'items', [])
196
+ # Create markets for each currency with IRT quote
197
+ for i in range(0, len(items)):
198
+ market = self.parse_market(items[i])
199
+ result.append(market)
200
+ return result
201
+
202
+ async def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
203
+ """
204
+ fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
205
+ https://api.bitbarg.com/api/v1/currencies?pageSize=-1
206
+ :param str[]|None symbols: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
207
+ :param dict [params]: extra parameters specific to the exchange API endpoint
208
+ :returns dict: a dictionary of `ticker structures <https://docs.ccxt.com/#/?id=ticker-structure>`
209
+ """
210
+ await self.load_markets()
211
+ if symbols is not None:
212
+ symbols = self.market_symbols(symbols)
213
+ request = {
214
+ 'pageSize': -1,
215
+ }
216
+ response = await self.publicGetApiV1Currencies(self.extend(request, params))
217
+ data = self.safe_dict(response, 'result', {})
218
+ items = self.safe_list(data, 'items', [])
219
+ result = {}
220
+ for i in range(0, len(items)):
221
+ coinData = items[i]
222
+ baseId = self.safe_string(coinData, 'coin')
223
+ # Create ticker for USDT quote
224
+ quoteId = 'USDT'
225
+ base = self.safe_currency_code(baseId)
226
+ quote = self.safe_currency_code(quoteId)
227
+ symbol = base + '/' + quote
228
+ ticker = self.extend({
229
+ 'symbol': symbol,
230
+ 'baseId': baseId,
231
+ 'quoteId': quoteId,
232
+ 'id': baseId + '/' + quoteId,
233
+ }, coinData)
234
+ result[symbol] = self.parse_ticker(ticker)
235
+ return self.filter_by_array_tickers(result, 'symbol', symbols)
236
+
237
+ async def fetch_ticker(self, symbol: str, params={}) -> Ticker:
238
+ """
239
+ fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
240
+ https://api.bitbarg.com/api/v1/currencies?pageSize=-1
241
+ :param str symbol: unified symbol of the market to fetch the ticker for
242
+ :param dict [params]: extra parameters specific to the exchange API endpoint
243
+ :returns dict: a `ticker structure <https://docs.ccxt.com/#/?id=ticker-structure>`
244
+ """
245
+ ticker = await self.fetch_tickers([symbol])
246
+ return ticker[symbol]
247
+
248
+ def parse_ticker(self, ticker, market: Market = None) -> Ticker:
249
+ # {
250
+ # "id": 1,
251
+ # "icon": "https://...",
252
+ # "tradeActive": True,
253
+ # "faName": "بیت کوین",
254
+ # "enName": "Bitcoin",
255
+ # "coin": "BTC",
256
+ # "path": "bitcoin",
257
+ # "price": 110387.56,
258
+ # "quote": "57479298399.76",
259
+ # "percent": -3.01,
260
+ # "decimal": 5,
261
+ # "isFavorite": False,
262
+ # "chart": [...]
263
+ # }
264
+ marketType = 'otc'
265
+ marketId = self.safe_string(ticker, 'coin') + '/' + 'USDT'
266
+ symbol = self.safe_symbol(marketId, market, None, marketType)
267
+ last = self.safe_float(ticker, 'price', 0)
268
+ percentage = self.safe_float(ticker, 'percent', 0)
269
+ baseVolume = self.safe_float(ticker, 'quote')
270
+ return self.safe_ticker({
271
+ 'symbol': symbol,
272
+ 'timestamp': None,
273
+ 'datetime': None,
274
+ 'high': None,
275
+ 'low': None,
276
+ 'bid': last,
277
+ 'bidVolume': None,
278
+ 'ask': last,
279
+ 'askVolume': None,
280
+ 'vwap': None,
281
+ 'open': None,
282
+ 'close': last,
283
+ 'last': last,
284
+ 'previousClose': None,
285
+ 'change': None,
286
+ 'percentage': percentage,
287
+ 'average': None,
288
+ 'baseVolume': baseVolume,
289
+ 'quoteVolume': None,
290
+ 'info': ticker,
291
+ }, market)
292
+
293
+ def sign(self, path, api='public', method='GET', params={}, headers=None, body=None):
294
+ url = self.urls['api']['public'] + path
295
+ if params:
296
+ url += '?' + self.urlencode(params)
297
+ headers = {'Content-Type': 'application/json'}
298
+ return {'url': url, 'method': method, 'body': body, 'headers': headers}