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,333 @@
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.cafearz import ImplicitAPI
8
+ from ccxt.base.types import Any, Market, Strings, Ticker, Tickers
9
+ from typing import List
10
+
11
+
12
+ class cafearz(Exchange, ImplicitAPI):
13
+
14
+ def describe(self) -> Any:
15
+ return self.deep_extend(super(cafearz, self).describe(), {
16
+ 'id': 'cafearz',
17
+ 'name': 'Cafearz',
18
+ 'countries': ['IR'],
19
+ 'rateLimit': 1000,
20
+ 'version': '1',
21
+ 'certified': False,
22
+ 'pro': False,
23
+ 'has': {
24
+ 'CORS': None,
25
+ 'spot': False,
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
+ 'otc': True,
82
+ 'setLeverage': False,
83
+ 'setMarginMode': False,
84
+ 'transfer': False,
85
+ 'withdraw': False,
86
+ },
87
+ 'comment': 'This comment is optional',
88
+ 'urls': {
89
+ 'logo': 'https://cdn.arz.digital/cr-odin/img/exchanges/cafearz/64x64.png',
90
+ 'api': {
91
+ 'public': 'https://api2.cafearz.com',
92
+ },
93
+ 'www': 'https://cafearz.com/',
94
+ 'doc': [
95
+ 'https://cafearz.com/',
96
+ ],
97
+ },
98
+ 'api': {
99
+ 'public': {
100
+ 'get': {
101
+ '/api/client/v1/currencies/prices/digital': 1,
102
+ },
103
+ },
104
+ },
105
+ 'fees': {
106
+ 'trading': {
107
+ 'tierBased': False,
108
+ 'percentage': True,
109
+ 'maker': self.parse_number('0.001'),
110
+ 'taker': self.parse_number('0.001'),
111
+ },
112
+ },
113
+ })
114
+
115
+ def parse_market(self, market) -> Market:
116
+ # {
117
+ # "symbol": "BTC",
118
+ # "name": "Bitcoin",
119
+ # "title": "بیت کوین",
120
+ # "service_id": 14,
121
+ # "rank": 1,
122
+ # "price": {
123
+ # "buy": 12726581792.3999996185302734375,
124
+ # "sell": 12571941095.936672210693359375,
125
+ # "dollar": 110387.5599999999976716935634613037109375
126
+ # },
127
+ # "chart": {
128
+ # "changes": "down",
129
+ # "changes_percentage": 107.0799999999999982946974341757595539093017578125,
130
+ # "data": {
131
+ # "1404/07/05": "109643.46000000",
132
+ # "1404/07/06": "109635.85000000",
133
+ # "1404/07/07": "112163.95000000",
134
+ # "1404/07/08": "114311.96000000",
135
+ # "1404/07/09": "114048.93000000",
136
+ # "1404/07/10": "118594.99000000",
137
+ # "1404/07/11": "120529.35000000",
138
+ # "1404/07/12": "122232.00000000",
139
+ # "1404/07/13": "122391.00000000",
140
+ # "1404/07/14": "123482.31000000",
141
+ # "1404/07/15": "124658.54000000",
142
+ # "1404/07/16": "121332.95000000",
143
+ # "1404/07/17": "123306.00000000",
144
+ # "1404/07/18": "121662.40000000",
145
+ # "1404/07/19": "113613.18000000"
146
+ # }
147
+ # },
148
+ # "decimal_digit": "5",
149
+ # "market_cap": 2018807729876.182861328125,
150
+ # "volume_24h": 57479298399.76000213623046875,
151
+ # "percent_change_1h": 0.00643466000000000003244959856374407536350190639495849609375,
152
+ # "percent_change_24h": -3.013435680000000171929741554777137935161590576171875,
153
+ # "percent_change_7d": -3.848675339999999778228811919689178466796875,
154
+ # "base_icon": "https://api2.cafearz.com/assets/images/coins/1.png",
155
+ # "icon": "https://storage.cafearz.com/wp-content/uploads/coins/BTC.png"
156
+ # },
157
+ baseId = self.safe_string(market, 'symbol')
158
+ quoteId = 'IRT'
159
+ base = self.safe_currency_code(baseId)
160
+ quote = self.safe_currency_code(quoteId)
161
+ id = baseId + '/' + quoteId
162
+ return {
163
+ 'id': id,
164
+ 'symbol': base + '/' + quote,
165
+ 'base': base,
166
+ 'quote': quote,
167
+ 'settle': None,
168
+ 'baseId': baseId,
169
+ 'quoteId': quoteId,
170
+ 'settleId': None,
171
+ 'type': 'otc',
172
+ 'spot': False,
173
+ 'margin': False,
174
+ 'swap': False,
175
+ 'future': False,
176
+ 'option': False,
177
+ 'active': True,
178
+ 'contract': False,
179
+ 'linear': None,
180
+ 'inverse': None,
181
+ 'contractSize': None,
182
+ 'expiry': None,
183
+ 'expiryDatetime': None,
184
+ 'strike': None,
185
+ 'optionType': None,
186
+ 'precision': {
187
+ 'amount': None,
188
+ 'price': None,
189
+ },
190
+ 'limits': {
191
+ 'leverage': {
192
+ 'min': None,
193
+ 'max': None,
194
+ },
195
+ 'amount': {
196
+ 'min': None,
197
+ 'max': None,
198
+ },
199
+ 'price': {
200
+ 'min': None,
201
+ 'max': None,
202
+ },
203
+ 'cost': {
204
+ 'min': None,
205
+ 'max': None,
206
+ },
207
+ },
208
+ 'created': None,
209
+ 'info': market,
210
+ }
211
+
212
+ async def fetch_markets(self, params={}) -> List[Market]:
213
+ """
214
+ retrieves data on all markets for cafearz
215
+ https://api2.cafearz.com/api/client/v1/currencies/prices/digital
216
+ :param dict [params]: extra parameters specific to the exchange API endpoint
217
+ :returns dict[]: an array of objects representing market data
218
+ """
219
+ response = await self.publicGetApiClientV1CurrenciesPricesDigital(params)
220
+ result = []
221
+ prices = self.safe_dict(response, 'prices', {})
222
+ symbols = list(prices.keys())
223
+ # Create markets for each symbol with IRT quote
224
+ for i in range(0, len(symbols)):
225
+ market = self.parse_market(prices[symbols[i]])
226
+ result.append(market)
227
+ return result
228
+
229
+ async def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
230
+ """
231
+ fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
232
+ https://api2.cafearz.com/api/client/v1/currencies/prices/digital
233
+ :param str[]|None symbols: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
234
+ :param dict [params]: extra parameters specific to the exchange API endpoint
235
+ :returns dict: a dictionary of `ticker structures <https://docs.ccxt.com/#/?id=ticker-structure>`
236
+ """
237
+ await self.load_markets()
238
+ if symbols is not None:
239
+ symbols = self.market_symbols(symbols)
240
+ response = await self.publicGetApiClientV1CurrenciesPricesDigital(params)
241
+ prices = self.safe_dict(response, 'prices', {})
242
+ result = {}
243
+ coinSymbols = list(prices.keys())
244
+ for i in range(0, len(coinSymbols)):
245
+ baseId = coinSymbols[i]
246
+ coinData = prices[baseId]
247
+ # Create ticker for IRT quote
248
+ quoteId = 'IRT'
249
+ base = self.safe_currency_code(baseId)
250
+ quote = self.safe_currency_code(quoteId)
251
+ symbol = base + '/' + quote
252
+ ticker = self.extend({
253
+ 'symbol': symbol,
254
+ 'baseId': baseId,
255
+ 'quoteId': quoteId,
256
+ 'id': baseId + '/' + quoteId,
257
+ }, coinData)
258
+ result[symbol] = self.parse_ticker(ticker)
259
+ return self.filter_by_array_tickers(result, 'symbol', symbols)
260
+
261
+ async def fetch_ticker(self, symbol: str, params={}) -> Ticker:
262
+ """
263
+ fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
264
+ https://api2.cafearz.com/api/client/v1/currencies/prices/digital
265
+ :param str symbol: unified symbol of the market to fetch the ticker for
266
+ :param dict [params]: extra parameters specific to the exchange API endpoint
267
+ :returns dict: a `ticker structure <https://docs.ccxt.com/#/?id=ticker-structure>`
268
+ """
269
+ ticker = await self.fetch_tickers([symbol])
270
+ return ticker[symbol]
271
+
272
+ def parse_ticker(self, ticker, market: Market = None) -> Ticker:
273
+ # {
274
+ # "symbol": "BTC",
275
+ # "name": "Bitcoin",
276
+ # "title": "بیت کوین",
277
+ # "service_id": 14,
278
+ # "rank": 1,
279
+ # "price": {
280
+ # "buy": 13462469875.799999,
281
+ # "sell": 13298881860,
282
+ # "dollar": 117689.22
283
+ # },
284
+ # "chart": {
285
+ # "changes": "down",
286
+ # "changes_percentage": 101.33,
287
+ # "data": {...}
288
+ # },
289
+ # "decimal_digit": "5",
290
+ # "market_cap": 2018807729876.182861,
291
+ # "volume_24h": 57479298399.76,
292
+ # "percent_change_1h": 0.00643466,
293
+ # "percent_change_24h": -3.013435,
294
+ # "percent_change_7d": -3.848675,
295
+ # "base_icon": "...",
296
+ # "icon": "..."
297
+ # }
298
+ marketType = 'otc'
299
+ marketId = self.safe_string(ticker, 'id')
300
+ symbol = self.safe_symbol(marketId, market, None, marketType)
301
+ priceData = self.safe_dict(ticker, 'price', {})
302
+ last = self.safe_float(priceData, 'buy', 0)
303
+ bid = self.safe_float(priceData, 'sell', 0)
304
+ ask = self.safe_float(priceData, 'buy', 0)
305
+ percentage = self.safe_float(ticker, 'percent_change_24h', 0)
306
+ baseVolume = self.safe_float(ticker, 'volume_24h')
307
+ return self.safe_ticker({
308
+ 'symbol': symbol,
309
+ 'timestamp': None,
310
+ 'datetime': None,
311
+ 'high': None,
312
+ 'low': None,
313
+ 'bid': bid,
314
+ 'bidVolume': None,
315
+ 'ask': ask,
316
+ 'askVolume': None,
317
+ 'vwap': None,
318
+ 'open': None,
319
+ 'close': last,
320
+ 'last': last,
321
+ 'previousClose': None,
322
+ 'change': None,
323
+ 'percentage': percentage,
324
+ 'average': None,
325
+ 'baseVolume': baseVolume,
326
+ 'quoteVolume': None,
327
+ 'info': ticker,
328
+ }, market)
329
+
330
+ def sign(self, path, api='public', method='GET', params={}, headers=None, body=None):
331
+ url = self.urls['api']['public'] + path
332
+ headers = {'Content-Type': 'application/json'}
333
+ return {'url': url, 'method': method, 'body': body, 'headers': headers}
@@ -0,0 +1,285 @@
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.hamtapay import ImplicitAPI
8
+ from ccxt.base.types import Any, Market, Strings, Ticker, Tickers
9
+ from typing import List
10
+
11
+
12
+ class hamtapay(Exchange, ImplicitAPI):
13
+
14
+ def describe(self) -> Any:
15
+ return self.deep_extend(super(hamtapay, self).describe(), {
16
+ 'id': 'hamtapay',
17
+ 'name': 'Hamtapay',
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/hamtapay/64x64.png',
89
+ 'api': {
90
+ 'public': 'https://api.hamtapay.org',
91
+ },
92
+ 'www': 'https://hamtapay.net/',
93
+ 'doc': [
94
+ 'https://hamtapay.net/',
95
+ ],
96
+ },
97
+ 'api': {
98
+ 'public': {
99
+ 'get': {
100
+ '/financial/api/market': 1,
101
+ '/financial/api/vitrin/prices': 1,
102
+ },
103
+ },
104
+ },
105
+ 'fees': {
106
+ 'trading': {
107
+ 'tierBased': False,
108
+ 'percentage': True,
109
+ 'maker': self.parse_number('0.001'),
110
+ 'taker': self.parse_number('0.001'),
111
+ },
112
+ },
113
+ })
114
+
115
+ async def fetch_markets(self, params={}) -> List[Market]:
116
+ """
117
+ retrieves data on all markets for hamtapay
118
+ https://api.hamtapay.org/financial/api/market
119
+ :param dict [params]: extra parameters specific to the exchange API endpoint
120
+ :returns dict[]: an array of objects representing market data
121
+ """
122
+ response = await self.publicGetFinancialApiMarket(params)
123
+ result = []
124
+ marketData = self.safe_list(response, 'data', [])
125
+ for i in range(0, len(marketData)):
126
+ market = self.parse_market(marketData[i])
127
+ result.append(market)
128
+ return result
129
+
130
+ def parse_market(self, market) -> Market:
131
+ # {
132
+ # "symbol": "USDT-IRT",
133
+ # "base": "USDT",
134
+ # "quote": "IRT",
135
+ # "base_currency_decimals": 3,
136
+ # "quote_currency_decimals": 0,
137
+ # "amount_decimals": 0,
138
+ # "price_decimals": 0
139
+ # }
140
+ baseId = self.safe_string(market, 'base')
141
+ quoteId = self.safe_string(market, 'quote')
142
+ base = self.safe_currency_code(baseId)
143
+ quote = self.safe_currency_code(quoteId)
144
+ id = self.safe_string(market, 'symbol')
145
+ return {
146
+ 'id': id,
147
+ 'symbol': base + '/' + quote,
148
+ 'base': base,
149
+ 'quote': quote,
150
+ 'settle': None,
151
+ 'baseId': baseId,
152
+ 'quoteId': quoteId,
153
+ 'settleId': None,
154
+ 'type': 'otc',
155
+ 'spot': False,
156
+ 'margin': False,
157
+ 'swap': False,
158
+ 'future': False,
159
+ 'option': False,
160
+ 'active': True,
161
+ 'contract': False,
162
+ 'linear': None,
163
+ 'inverse': None,
164
+ 'contractSize': None,
165
+ 'expiry': None,
166
+ 'expiryDatetime': None,
167
+ 'strike': None,
168
+ 'optionType': None,
169
+ 'precision': {
170
+ 'amount': None,
171
+ 'price': None,
172
+ },
173
+ 'limits': {
174
+ 'leverage': {
175
+ 'min': None,
176
+ 'max': None,
177
+ },
178
+ 'amount': {
179
+ 'min': None,
180
+ 'max': None,
181
+ },
182
+ 'price': {
183
+ 'min': None,
184
+ 'max': None,
185
+ },
186
+ 'cost': {
187
+ 'min': None,
188
+ 'max': None,
189
+ },
190
+ },
191
+ 'created': None,
192
+ 'info': market,
193
+ }
194
+
195
+ async def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
196
+ """
197
+ fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
198
+ https://api.hamtapay.org/financial/api/vitrin/prices
199
+ :param str[]|None symbols: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
200
+ :param dict [params]: extra parameters specific to the exchange API endpoint
201
+ :returns dict: a dictionary of `ticker structures <https://docs.ccxt.com/#/?id=ticker-structure>`
202
+ """
203
+ await self.load_markets()
204
+ if symbols is not None:
205
+ symbols = self.market_symbols(symbols)
206
+ response = await self.publicGetFinancialApiVitrinPrices(params)
207
+ data = self.safe_dict(response, 'data', {})
208
+ result = {}
209
+ quotes = ['IRT', 'USDT']
210
+ for i in range(0, len(quotes)):
211
+ current_qoute = quotes[i]
212
+ corresponding_data = self.safe_dict(data, current_qoute, {})
213
+ for j in range(0, corresponding_data):
214
+ current_base = list(corresponding_data.keys())[j]
215
+ current_ticker = corresponding_data[current_base]
216
+ current_ticker['base'] = current_base
217
+ current_ticker['quote'] = current_qoute
218
+ current_ticker['symbol'] = current_base + '/' + current_qoute
219
+ current_ticker['id'] = current_base + '-' + current_qoute
220
+ result[current_ticker['symbol']] = self.parse_ticker(current_ticker)
221
+ return self.filter_by_array_tickers(result, 'symbol', symbols)
222
+
223
+ async def fetch_ticker(self, symbol: str, params={}) -> Ticker:
224
+ """
225
+ fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
226
+ https://hamtapay.com/management/all-coins/?format=json
227
+ :param str symbol: unified symbol of the market to fetch the ticker for
228
+ :param dict [params]: extra parameters specific to the exchange API endpoint
229
+ :returns dict: a `ticker structure <https://docs.ccxt.com/#/?id=ticker-structure>`
230
+ """
231
+ ticker = await self.fetch_tickers([symbol])
232
+ return ticker[symbol]
233
+
234
+ def parse_ticker(self, ticker, market: Market = None) -> Ticker:
235
+ # {
236
+ # "id": "USDT-IRT",
237
+ # "symbol": "USDT/IRT",
238
+ # "base": "USDT",
239
+ # "quote": "IRT",
240
+ # "min_price_24h": "111702",
241
+ # "max_price_24h": "115872",
242
+ # "market_price": "115942",
243
+ # "buy_price": "117101",
244
+ # "sell_price": "114782",
245
+ # "change_rate_24h": 3.29,
246
+ # "amount_decimals": 0,
247
+ # "price_decimals": 0,
248
+ # "status": "ACTIVE"
249
+ # }
250
+ marketType = 'otc'
251
+ marketId = self.safe_string(ticker, 'id')
252
+ symbol = self.safe_symbol(marketId, market, None, marketType)
253
+ last = self.safe_float(ticker, 'buy_price', 0)
254
+ change = self.safe_float(ticker, 'change_rate_24h', 0)
255
+ ask = self.safe_float(ticker, 'buy_price', 0)
256
+ bid = self.safe_float(ticker, 'sell_price', 0)
257
+ high = self.safe_float(ticker, 'max_price_24h', 0)
258
+ low = self.safe_float(ticker, 'min_price_24h', 0)
259
+ return self.safe_ticker({
260
+ 'symbol': symbol,
261
+ 'timestamp': None,
262
+ 'datetime': None,
263
+ 'high': high,
264
+ 'low': low,
265
+ 'bid': bid,
266
+ 'bidVolume': None,
267
+ 'ask': ask,
268
+ 'askVolume': None,
269
+ 'vwap': None,
270
+ 'open': None,
271
+ 'close': last,
272
+ 'last': last,
273
+ 'previousClose': None,
274
+ 'change': None,
275
+ 'percentage': change,
276
+ 'average': None,
277
+ 'baseVolume': None,
278
+ 'quoteVolume': None,
279
+ 'info': ticker,
280
+ }, market)
281
+
282
+ def sign(self, path, api='public', method='GET', params={}, headers=None, body=None):
283
+ url = self.urls['api']['public'] + '/' + path
284
+ headers = {'Content-Type': 'application/json'}
285
+ return {'url': url, 'method': method, 'body': body, 'headers': headers}