ccxt-ir 4.9.4__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.
- ccxt/__init__.py +15 -1
- ccxt/abantether.py +88 -69
- ccxt/abstract/abantether.py +1 -1
- ccxt/abstract/bitbarg.py +5 -0
- ccxt/abstract/bydfi.py +8 -0
- ccxt/abstract/cafearz.py +5 -0
- ccxt/abstract/kifpoolme.py +6 -0
- ccxt/abstract/mazdax.py +8 -0
- ccxt/abstract/pingi.py +6 -0
- ccxt/abstract/pooleno.py +5 -0
- ccxt/afratether.py +84 -36
- ccxt/arzplus.py +31 -17
- ccxt/async_support/__init__.py +15 -1
- ccxt/async_support/abantether.py +88 -69
- ccxt/async_support/afratether.py +84 -36
- ccxt/async_support/arzplus.py +31 -17
- ccxt/async_support/base/exchange.py +1 -1
- ccxt/async_support/bitbarg.py +298 -0
- ccxt/async_support/bydfi.py +406 -0
- ccxt/async_support/cafearz.py +333 -0
- ccxt/async_support/kifpoolme.py +385 -0
- ccxt/async_support/mazdax.py +512 -0
- ccxt/async_support/pingi.py +426 -0
- ccxt/async_support/pooleno.py +331 -0
- ccxt/async_support/tetherland.py +4 -4
- ccxt/async_support/twox.py +52 -28
- ccxt/base/exchange.py +1 -1
- ccxt/bitbarg.py +298 -0
- ccxt/bydfi.py +406 -0
- ccxt/cafearz.py +333 -0
- ccxt/kifpoolme.py +385 -0
- ccxt/mazdax.py +512 -0
- ccxt/pingi.py +426 -0
- ccxt/pooleno.py +331 -0
- ccxt/pro/__init__.py +1 -1
- ccxt/tetherland.py +4 -4
- ccxt/twox.py +52 -28
- {ccxt_ir-4.9.4.dist-info → ccxt_ir-4.9.10.dist-info}/METADATA +8 -8
- {ccxt_ir-4.9.4.dist-info → ccxt_ir-4.9.10.dist-info}/RECORD +42 -21
- {ccxt_ir-4.9.4.dist-info → ccxt_ir-4.9.10.dist-info}/WHEEL +0 -0
- {ccxt_ir-4.9.4.dist-info → ccxt_ir-4.9.10.dist-info}/licenses/LICENSE.txt +0 -0
- {ccxt_ir-4.9.4.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}
|