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
ccxt/arzplus.py
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
from ccxt.base.exchange import Exchange
|
|
7
7
|
from ccxt.abstract.arzplus import ImplicitAPI
|
|
8
|
-
from ccxt.base.types import Any, Int, Market, OrderBook, Strings, Ticker, Tickers
|
|
8
|
+
from ccxt.base.types import Any, Int, Market, MarketType, OrderBook, Strings, Ticker, Tickers
|
|
9
9
|
from typing import List
|
|
10
10
|
|
|
11
11
|
|
|
@@ -128,8 +128,13 @@ class arzplus(Exchange, ImplicitAPI):
|
|
|
128
128
|
'stats': '1',
|
|
129
129
|
'enable': 'true',
|
|
130
130
|
}
|
|
131
|
-
|
|
132
|
-
|
|
131
|
+
typedRequest = self.safe_string(params, 'type', 'spot')
|
|
132
|
+
response = []
|
|
133
|
+
otcMarkets = []
|
|
134
|
+
if typedRequest == 'otc':
|
|
135
|
+
otcMarkets = self.publicGetApiV1MarketIrtInfo(request)
|
|
136
|
+
else:
|
|
137
|
+
response = self.publicGetApiV1MarketSymbols(request)
|
|
133
138
|
result = []
|
|
134
139
|
for i in range(0, len(response)):
|
|
135
140
|
market = self.parse_market(response[i])
|
|
@@ -140,11 +145,14 @@ class arzplus(Exchange, ImplicitAPI):
|
|
|
140
145
|
marketdata['id'] = 'OTC_' + marketdata['symbol'] + marketdata['quote']
|
|
141
146
|
parsedMarket = self.parse_otc_markets(marketdata)
|
|
142
147
|
result.append(parsedMarket)
|
|
143
|
-
if params['type']:
|
|
144
|
-
return self.filter_by_array(result, 'type', params['type'], False)
|
|
145
148
|
return result
|
|
146
149
|
|
|
147
|
-
def parse_market(self, market) -> Market:
|
|
150
|
+
def parse_market(self, market, type: MarketType = 'spot') -> Market:
|
|
151
|
+
if type == 'otc':
|
|
152
|
+
return self.parse_otc_markets(market)
|
|
153
|
+
return self.parse_spot_market(market)
|
|
154
|
+
|
|
155
|
+
def parse_spot_market(self, market) -> Market:
|
|
148
156
|
# {
|
|
149
157
|
# 'name': 'USDTIRT',
|
|
150
158
|
# 'asset': {
|
|
@@ -240,12 +248,14 @@ class arzplus(Exchange, ImplicitAPI):
|
|
|
240
248
|
'info': market,
|
|
241
249
|
}
|
|
242
250
|
|
|
243
|
-
def parse_otc_markets(self, market) ->
|
|
251
|
+
def parse_otc_markets(self, market) -> Market:
|
|
244
252
|
# {
|
|
245
|
-
#
|
|
246
|
-
#
|
|
247
|
-
#
|
|
248
|
-
#
|
|
253
|
+
# symbol: "BTC",
|
|
254
|
+
# ask: "13877900000",
|
|
255
|
+
# bid: "13860999995",
|
|
256
|
+
# name: "bitcoin"
|
|
257
|
+
# qoute: "IRT",
|
|
258
|
+
# id: "OTC_BTCIRT"
|
|
249
259
|
# },
|
|
250
260
|
baseAsset = self.safe_string(market, 'symbol')
|
|
251
261
|
quoteAsset = self.safe_string(market, 'quote')
|
|
@@ -264,7 +274,7 @@ class arzplus(Exchange, ImplicitAPI):
|
|
|
264
274
|
'quoteId': quoteId,
|
|
265
275
|
'settleId': None,
|
|
266
276
|
'type': 'otc',
|
|
267
|
-
'spot':
|
|
277
|
+
'spot': False,
|
|
268
278
|
'margin': False,
|
|
269
279
|
'swap': False,
|
|
270
280
|
'future': False,
|
|
@@ -312,11 +322,12 @@ class arzplus(Exchange, ImplicitAPI):
|
|
|
312
322
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
313
323
|
:returns dict: a dictionary of `ticker structures <https://docs.ccxt.com/#/?id=ticker-structure>`
|
|
314
324
|
"""
|
|
315
|
-
self.
|
|
325
|
+
marketType = self.safe_string(params, 'type', 'spot')
|
|
326
|
+
self.load_markets(False, {'type': marketType})
|
|
316
327
|
if symbols is not None:
|
|
317
328
|
symbols = self.market_symbols(symbols)
|
|
318
329
|
result = {}
|
|
319
|
-
if
|
|
330
|
+
if marketType == 'otc':
|
|
320
331
|
otcMarkets = self.publicGetApiV1MarketIrtInfo(params)
|
|
321
332
|
for i in range(0, len(otcMarkets)):
|
|
322
333
|
marketdata = otcMarkets[i]
|
|
@@ -345,7 +356,10 @@ class arzplus(Exchange, ImplicitAPI):
|
|
|
345
356
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
346
357
|
:returns dict: a `ticker structure <https://docs.ccxt.com/#/?id=ticker-structure>`
|
|
347
358
|
"""
|
|
348
|
-
self.
|
|
359
|
+
marketType = self.safe_string(params, 'type', 'spot')
|
|
360
|
+
if marketType == 'otc':
|
|
361
|
+
raise Error('OTC markets are not supported')
|
|
362
|
+
self.load_markets(False, {'type': marketType})
|
|
349
363
|
market = self.market(symbol)
|
|
350
364
|
request = {
|
|
351
365
|
'symbol': market['id'],
|
|
@@ -472,7 +486,7 @@ class arzplus(Exchange, ImplicitAPI):
|
|
|
472
486
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
473
487
|
:returns int[][]: A list of candles ordered, open, high, low, close, volume
|
|
474
488
|
"""
|
|
475
|
-
self.load_markets()
|
|
489
|
+
self.load_markets(False, {'type': 'otc'})
|
|
476
490
|
market = self.market(symbol)
|
|
477
491
|
endTime = Date.now()
|
|
478
492
|
request = {
|
|
@@ -512,7 +526,7 @@ class arzplus(Exchange, ImplicitAPI):
|
|
|
512
526
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
513
527
|
:returns dict: a dictionary of `order book structures <https://docs.ccxt.com/#/?id=order-book-structure>` indexed by market symbol
|
|
514
528
|
"""
|
|
515
|
-
self.load_markets()
|
|
529
|
+
self.load_markets(False, {'type': 'otc'})
|
|
516
530
|
market = self.market(symbol)
|
|
517
531
|
request = {
|
|
518
532
|
'symbol': market['id'],
|
ccxt/async_support/__init__.py
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
# -----------------------------------------------------------------------------
|
|
6
6
|
|
|
7
|
-
__version__ = '4.9.
|
|
7
|
+
__version__ = '4.9.10'
|
|
8
8
|
|
|
9
9
|
# -----------------------------------------------------------------------------
|
|
10
10
|
|
|
@@ -81,6 +81,7 @@ from ccxt.async_support.bingx import bingx
|
|
|
81
81
|
from ccxt.async_support.bit24 import bit24 # noqa: F401
|
|
82
82
|
from ccxt.async_support.bit2c import bit2c # noqa: F401
|
|
83
83
|
from ccxt.async_support.bitbank import bitbank # noqa: F401
|
|
84
|
+
from ccxt.async_support.bitbarg import bitbarg # noqa: F401
|
|
84
85
|
from ccxt.async_support.bitbns import bitbns # noqa: F401
|
|
85
86
|
from ccxt.async_support.bitfinex import bitfinex # noqa: F401
|
|
86
87
|
from ccxt.async_support.bitflyer import bitflyer # noqa: F401
|
|
@@ -106,6 +107,8 @@ from ccxt.async_support.btcbox import btcbox
|
|
|
106
107
|
from ccxt.async_support.btcmarkets import btcmarkets # noqa: F401
|
|
107
108
|
from ccxt.async_support.btcturk import btcturk # noqa: F401
|
|
108
109
|
from ccxt.async_support.bybit import bybit # noqa: F401
|
|
110
|
+
from ccxt.async_support.bydfi import bydfi # noqa: F401
|
|
111
|
+
from ccxt.async_support.cafearz import cafearz # noqa: F401
|
|
109
112
|
from ccxt.async_support.cex import cex # noqa: F401
|
|
110
113
|
from ccxt.async_support.coinbase import coinbase # noqa: F401
|
|
111
114
|
from ccxt.async_support.coinbaseadvanced import coinbaseadvanced # noqa: F401
|
|
@@ -151,6 +154,7 @@ from ccxt.async_support.independentreserve import independentreserve
|
|
|
151
154
|
from ccxt.async_support.indodax import indodax # noqa: F401
|
|
152
155
|
from ccxt.async_support.jibitex import jibitex # noqa: F401
|
|
153
156
|
from ccxt.async_support.kcex import kcex # noqa: F401
|
|
157
|
+
from ccxt.async_support.kifpoolme import kifpoolme # noqa: F401
|
|
154
158
|
from ccxt.async_support.kraken import kraken # noqa: F401
|
|
155
159
|
from ccxt.async_support.krakenfutures import krakenfutures # noqa: F401
|
|
156
160
|
from ccxt.async_support.kucoin import kucoin # noqa: F401
|
|
@@ -158,6 +162,7 @@ from ccxt.async_support.kucoinfutures import kucoinfutures
|
|
|
158
162
|
from ccxt.async_support.latoken import latoken # noqa: F401
|
|
159
163
|
from ccxt.async_support.lbank import lbank # noqa: F401
|
|
160
164
|
from ccxt.async_support.luno import luno # noqa: F401
|
|
165
|
+
from ccxt.async_support.mazdax import mazdax # noqa: F401
|
|
161
166
|
from ccxt.async_support.mercado import mercado # noqa: F401
|
|
162
167
|
from ccxt.async_support.mexc import mexc # noqa: F401
|
|
163
168
|
from ccxt.async_support.modetrade import modetrade # noqa: F401
|
|
@@ -177,7 +182,9 @@ from ccxt.async_support.p2b import p2b
|
|
|
177
182
|
from ccxt.async_support.paradex import paradex # noqa: F401
|
|
178
183
|
from ccxt.async_support.paymium import paymium # noqa: F401
|
|
179
184
|
from ccxt.async_support.phemex import phemex # noqa: F401
|
|
185
|
+
from ccxt.async_support.pingi import pingi # noqa: F401
|
|
180
186
|
from ccxt.async_support.poloniex import poloniex # noqa: F401
|
|
187
|
+
from ccxt.async_support.pooleno import pooleno # noqa: F401
|
|
181
188
|
from ccxt.async_support.probit import probit # noqa: F401
|
|
182
189
|
from ccxt.async_support.ramzinex import ramzinex # noqa: F401
|
|
183
190
|
from ccxt.async_support.sarmayex import sarmayex # noqa: F401
|
|
@@ -220,6 +227,7 @@ exchanges = [
|
|
|
220
227
|
'bit24',
|
|
221
228
|
'bit2c',
|
|
222
229
|
'bitbank',
|
|
230
|
+
'bitbarg',
|
|
223
231
|
'bitbns',
|
|
224
232
|
'bitfinex',
|
|
225
233
|
'bitflyer',
|
|
@@ -245,6 +253,8 @@ exchanges = [
|
|
|
245
253
|
'btcmarkets',
|
|
246
254
|
'btcturk',
|
|
247
255
|
'bybit',
|
|
256
|
+
'bydfi',
|
|
257
|
+
'cafearz',
|
|
248
258
|
'cex',
|
|
249
259
|
'coinbase',
|
|
250
260
|
'coinbaseadvanced',
|
|
@@ -290,6 +300,7 @@ exchanges = [
|
|
|
290
300
|
'indodax',
|
|
291
301
|
'jibitex',
|
|
292
302
|
'kcex',
|
|
303
|
+
'kifpoolme',
|
|
293
304
|
'kraken',
|
|
294
305
|
'krakenfutures',
|
|
295
306
|
'kucoin',
|
|
@@ -297,6 +308,7 @@ exchanges = [
|
|
|
297
308
|
'latoken',
|
|
298
309
|
'lbank',
|
|
299
310
|
'luno',
|
|
311
|
+
'mazdax',
|
|
300
312
|
'mercado',
|
|
301
313
|
'mexc',
|
|
302
314
|
'modetrade',
|
|
@@ -316,7 +328,9 @@ exchanges = [
|
|
|
316
328
|
'paradex',
|
|
317
329
|
'paymium',
|
|
318
330
|
'phemex',
|
|
331
|
+
'pingi',
|
|
319
332
|
'poloniex',
|
|
333
|
+
'pooleno',
|
|
320
334
|
'probit',
|
|
321
335
|
'ramzinex',
|
|
322
336
|
'sarmayex',
|
ccxt/async_support/abantether.py
CHANGED
|
@@ -22,7 +22,7 @@ class abantether(Exchange, ImplicitAPI):
|
|
|
22
22
|
'pro': False,
|
|
23
23
|
'has': {
|
|
24
24
|
'CORS': None,
|
|
25
|
-
'spot':
|
|
25
|
+
'spot': False,
|
|
26
26
|
'margin': False,
|
|
27
27
|
'swap': False,
|
|
28
28
|
'future': False,
|
|
@@ -78,6 +78,7 @@ class abantether(Exchange, ImplicitAPI):
|
|
|
78
78
|
'fetchTradingFee': False,
|
|
79
79
|
'fetchTradingFees': False,
|
|
80
80
|
'fetchWithdrawals': False,
|
|
81
|
+
'otc': True,
|
|
81
82
|
'setLeverage': False,
|
|
82
83
|
'setMarginMode': False,
|
|
83
84
|
'transfer': False,
|
|
@@ -87,7 +88,7 @@ class abantether(Exchange, ImplicitAPI):
|
|
|
87
88
|
'urls': {
|
|
88
89
|
'logo': 'https://cdn.arz.digital/cr-odin/img/exchanges/abantether/64x64.png',
|
|
89
90
|
'api': {
|
|
90
|
-
'public': 'https://abantether.com',
|
|
91
|
+
'public': 'https://api.abantether.com',
|
|
91
92
|
},
|
|
92
93
|
'www': 'https://abantether.com',
|
|
93
94
|
'doc': [
|
|
@@ -97,7 +98,7 @@ class abantether(Exchange, ImplicitAPI):
|
|
|
97
98
|
'api': {
|
|
98
99
|
'public': {
|
|
99
100
|
'get': {
|
|
100
|
-
'
|
|
101
|
+
'manager/coins/data': 1,
|
|
101
102
|
},
|
|
102
103
|
},
|
|
103
104
|
},
|
|
@@ -114,50 +115,60 @@ class abantether(Exchange, ImplicitAPI):
|
|
|
114
115
|
async def fetch_markets(self, params={}) -> List[Market]:
|
|
115
116
|
"""
|
|
116
117
|
retrieves data on all markets for abantether
|
|
117
|
-
https://abantether.com/
|
|
118
|
+
https://api.abantether.com/manager/coins/data
|
|
118
119
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
119
120
|
:returns dict[]: an array of objects representing market data
|
|
120
121
|
"""
|
|
121
|
-
response = await self.
|
|
122
|
+
response = await self.publicGetManagerCoinsData(params)
|
|
123
|
+
data = self.safe_list(response, 'data', [])
|
|
122
124
|
result = []
|
|
123
125
|
quotes = ['IRT', 'USDT']
|
|
124
|
-
for i in range(0, len(
|
|
125
|
-
base = self.safe_string(
|
|
126
|
+
for i in range(0, len(data)):
|
|
127
|
+
base = self.safe_string(data[i], 'symbol')
|
|
126
128
|
for index in range(0, len(quotes)):
|
|
127
129
|
quote = quotes[index]
|
|
128
|
-
|
|
129
|
-
|
|
130
|
+
data[i]['base'] = base
|
|
131
|
+
data[i]['quote'] = quote
|
|
130
132
|
if base == quote:
|
|
131
133
|
continue
|
|
132
|
-
market = self.parse_market(
|
|
134
|
+
market = self.parse_market(data[i])
|
|
133
135
|
result.append(market)
|
|
134
136
|
return result
|
|
135
137
|
|
|
136
138
|
def parse_market(self, market) -> Market:
|
|
137
139
|
# {
|
|
138
|
-
#
|
|
139
|
-
#
|
|
140
|
-
#
|
|
141
|
-
#
|
|
142
|
-
#
|
|
143
|
-
#
|
|
144
|
-
#
|
|
145
|
-
#
|
|
146
|
-
#
|
|
147
|
-
#
|
|
148
|
-
#
|
|
149
|
-
#
|
|
150
|
-
#
|
|
151
|
-
#
|
|
152
|
-
#
|
|
153
|
-
#
|
|
154
|
-
#
|
|
155
|
-
#
|
|
156
|
-
#
|
|
157
|
-
#
|
|
158
|
-
#
|
|
159
|
-
#
|
|
160
|
-
#
|
|
140
|
+
# "id": 1,
|
|
141
|
+
# "name": "Tether USDt",
|
|
142
|
+
# "symbol": "USDT",
|
|
143
|
+
# "persian_name": "تتر",
|
|
144
|
+
# "is_active": True,
|
|
145
|
+
# "is_withdrawal_active": True,
|
|
146
|
+
# "is_deposit_active": True,
|
|
147
|
+
# "is_mid_wallet_transfer_active": True,
|
|
148
|
+
# "is_buy_active": True,
|
|
149
|
+
# "is_sell_active": True,
|
|
150
|
+
# "is_credit_active": True,
|
|
151
|
+
# "min_trade": "1.00",
|
|
152
|
+
# "max_trade": "100000.00",
|
|
153
|
+
# "tether_price": "1",
|
|
154
|
+
# "price_buy": "113540.0",
|
|
155
|
+
# "price_sell": "112630.0",
|
|
156
|
+
# "volume24h": "225163179366.25",
|
|
157
|
+
# "percent_change_1h": "0.00",
|
|
158
|
+
# "percent_change_24h": "0.00",
|
|
159
|
+
# "percent_change_7d": "0.04",
|
|
160
|
+
# "market_cap": "179884960573.99",
|
|
161
|
+
# "coin_type": "COIN",
|
|
162
|
+
# "exchange_type": "fake",
|
|
163
|
+
# "icon": "f71021586005413ea6f3a0bd1f7d8a55",
|
|
164
|
+
# "fund_tether_buy": "0",
|
|
165
|
+
# "fund_tether_sell": "0",
|
|
166
|
+
# "irt_decimal_point": 2,
|
|
167
|
+
# "tether_decimal_point": 6,
|
|
168
|
+
# "amount_decimal_point": 6,
|
|
169
|
+
# "base": "BTC",
|
|
170
|
+
# "qoute": "USDT",
|
|
171
|
+
# },
|
|
161
172
|
baseId = self.safe_string(market, 'base')
|
|
162
173
|
quoteId = self.safe_string(market, 'quote')
|
|
163
174
|
base = self.safe_currency_code(baseId)
|
|
@@ -218,7 +229,7 @@ class abantether(Exchange, ImplicitAPI):
|
|
|
218
229
|
async def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
|
|
219
230
|
"""
|
|
220
231
|
fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
|
221
|
-
https://abantether.com/
|
|
232
|
+
https://api.abantether.com/manager/coins/data
|
|
222
233
|
:param str[]|None symbols: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
223
234
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
224
235
|
:returns dict: a dictionary of `ticker structures <https://docs.ccxt.com/#/?id=ticker-structure>`
|
|
@@ -226,19 +237,20 @@ class abantether(Exchange, ImplicitAPI):
|
|
|
226
237
|
await self.load_markets()
|
|
227
238
|
if symbols is not None:
|
|
228
239
|
symbols = self.market_symbols(symbols)
|
|
229
|
-
response = await self.
|
|
240
|
+
response = await self.publicGetManagerCoinsData(params)
|
|
241
|
+
data = self.safe_list(response, 'data', [])
|
|
230
242
|
result = {}
|
|
231
243
|
quotes = ['IRT', 'USDT']
|
|
232
|
-
for i in range(0, len(
|
|
233
|
-
base = self.safe_string(
|
|
244
|
+
for i in range(0, len(data)):
|
|
245
|
+
base = self.safe_string(data[i], 'symbol')
|
|
234
246
|
for index in range(0, len(quotes)):
|
|
235
247
|
quote = quotes[index]
|
|
236
248
|
if base == quote:
|
|
237
249
|
continue
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
ticker = self.parse_ticker(
|
|
250
|
+
data[i]['base'] = base
|
|
251
|
+
data[i]['quote'] = quote
|
|
252
|
+
data[i]['symbol'] = base + quote
|
|
253
|
+
ticker = self.parse_ticker(data[i])
|
|
242
254
|
symbol = ticker['symbol']
|
|
243
255
|
result[symbol] = ticker
|
|
244
256
|
return self.filter_by_array_tickers(result, 'symbol', symbols)
|
|
@@ -246,7 +258,7 @@ class abantether(Exchange, ImplicitAPI):
|
|
|
246
258
|
async def fetch_ticker(self, symbol: str, params={}) -> Ticker:
|
|
247
259
|
"""
|
|
248
260
|
fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
249
|
-
https://abantether.com/
|
|
261
|
+
https://api.abantether.com/manager/coins/data
|
|
250
262
|
:param str symbol: unified symbol of the market to fetch the ticker for
|
|
251
263
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
252
264
|
:returns dict: a `ticker structure <https://docs.ccxt.com/#/?id=ticker-structure>`
|
|
@@ -256,37 +268,44 @@ class abantether(Exchange, ImplicitAPI):
|
|
|
256
268
|
|
|
257
269
|
def parse_ticker(self, ticker, market: Market = None) -> Ticker:
|
|
258
270
|
# {
|
|
259
|
-
#
|
|
260
|
-
#
|
|
261
|
-
#
|
|
262
|
-
#
|
|
263
|
-
#
|
|
264
|
-
#
|
|
265
|
-
#
|
|
266
|
-
#
|
|
267
|
-
#
|
|
268
|
-
#
|
|
269
|
-
#
|
|
270
|
-
#
|
|
271
|
-
#
|
|
272
|
-
#
|
|
273
|
-
#
|
|
274
|
-
#
|
|
275
|
-
#
|
|
276
|
-
#
|
|
277
|
-
#
|
|
278
|
-
#
|
|
279
|
-
#
|
|
280
|
-
#
|
|
281
|
-
#
|
|
271
|
+
# "id": 2,
|
|
272
|
+
# "name": "Bitcoin",
|
|
273
|
+
# "symbol": "BTC",
|
|
274
|
+
# "persian_name": "بیت کوین",
|
|
275
|
+
# "is_active": True,
|
|
276
|
+
# "is_withdrawal_active": True,
|
|
277
|
+
# "is_deposit_active": True,
|
|
278
|
+
# "is_mid_wallet_transfer_active": True,
|
|
279
|
+
# "is_buy_active": True,
|
|
280
|
+
# "is_sell_active": True,
|
|
281
|
+
# "is_credit_active": True,
|
|
282
|
+
# "min_trade": "1.00",
|
|
283
|
+
# "max_trade": "65000.00",
|
|
284
|
+
# "tether_price": "114909.43000000",
|
|
285
|
+
# "price_buy": "13049114870.800000000",
|
|
286
|
+
# "price_sell": "12944547289.500000000",
|
|
287
|
+
# "volume24h": "93585526493.26",
|
|
288
|
+
# "percent_change_1h": "-0.29",
|
|
289
|
+
# "percent_change_24h": "3.22",
|
|
290
|
+
# "percent_change_7d": "-7.19",
|
|
291
|
+
# "market_cap": "2292874615411.72",
|
|
292
|
+
# "coin_type": "COIN",
|
|
293
|
+
# "exchange_type": "binance",
|
|
294
|
+
# "icon": "561aa10abc0c45f7aa4499f48d618c80",
|
|
295
|
+
# "fund_tether_buy": "0",
|
|
296
|
+
# "fund_tether_sell": "0",
|
|
297
|
+
# "irt_decimal_point": 0,
|
|
298
|
+
# "tether_decimal_point": 2,
|
|
299
|
+
# "amount_decimal_point": 9
|
|
300
|
+
# },
|
|
282
301
|
marketType = 'otc'
|
|
283
302
|
marketId = self.safe_string(ticker, 'symbol')
|
|
284
303
|
symbol = self.safe_symbol(marketId, market, None, marketType)
|
|
285
|
-
last = self.safe_float(ticker, '
|
|
304
|
+
last = self.safe_float(ticker, 'tether_price', 0)
|
|
286
305
|
if ticker['quote'] == 'IRT':
|
|
287
|
-
last = self.safe_float(ticker, '
|
|
288
|
-
change = self.safe_float(ticker, '
|
|
289
|
-
baseVolume = self.safe_float(ticker, '
|
|
306
|
+
last = self.safe_float(ticker, 'price_buy', 0)
|
|
307
|
+
change = self.safe_float(ticker, 'percent_change_24h', 0)
|
|
308
|
+
baseVolume = self.safe_float(ticker, 'volume24h', 0)
|
|
290
309
|
return self.safe_ticker({
|
|
291
310
|
'symbol': symbol,
|
|
292
311
|
'timestamp': None,
|
ccxt/async_support/afratether.py
CHANGED
|
@@ -22,7 +22,7 @@ class afratether(Exchange, ImplicitAPI):
|
|
|
22
22
|
'pro': False,
|
|
23
23
|
'has': {
|
|
24
24
|
'CORS': None,
|
|
25
|
-
'spot':
|
|
25
|
+
'spot': False,
|
|
26
26
|
'margin': False,
|
|
27
27
|
'swap': False,
|
|
28
28
|
'future': False,
|
|
@@ -78,6 +78,7 @@ class afratether(Exchange, ImplicitAPI):
|
|
|
78
78
|
'fetchTradingFee': False,
|
|
79
79
|
'fetchTradingFees': False,
|
|
80
80
|
'fetchWithdrawals': False,
|
|
81
|
+
'otc': True,
|
|
81
82
|
'setLeverage': False,
|
|
82
83
|
'setMarginMode': False,
|
|
83
84
|
'transfer': False,
|
|
@@ -134,21 +135,43 @@ class afratether(Exchange, ImplicitAPI):
|
|
|
134
135
|
|
|
135
136
|
def parse_market(self, market) -> Market:
|
|
136
137
|
# {
|
|
137
|
-
# "currencyAbb": "
|
|
138
|
-
# "nameEn": "
|
|
139
|
-
# "nameFa": "
|
|
140
|
-
# "icon": "/assets/crypto/
|
|
141
|
-
# "
|
|
142
|
-
# "
|
|
143
|
-
#
|
|
144
|
-
#
|
|
145
|
-
#
|
|
138
|
+
# "currencyAbb": "USDT",
|
|
139
|
+
# "nameEn": "Tether",
|
|
140
|
+
# "nameFa": "تتر",
|
|
141
|
+
# "icon": "/assets/crypto/usdt.png",
|
|
142
|
+
# "round": 1000000,
|
|
143
|
+
# "currency": "USDT",
|
|
144
|
+
# "changeRate24h": "-0.0065",
|
|
145
|
+
# "Klines": [
|
|
146
|
+
# [
|
|
147
|
+
# "1760227200000",
|
|
148
|
+
# "1147500",
|
|
149
|
+
# "1140000",
|
|
150
|
+
# "1145500",
|
|
151
|
+
# "1125000",
|
|
152
|
+
# "0",
|
|
153
|
+
# "0"
|
|
154
|
+
# ],
|
|
155
|
+
# ],
|
|
156
|
+
# "info": {
|
|
157
|
+
# "birth_date": 1412553600000,
|
|
158
|
+
# "open_24h": 1,
|
|
159
|
+
# "open_1w": 1,
|
|
160
|
+
# "open_3M": 1,
|
|
161
|
+
# "open_1y": 1
|
|
162
|
+
# },
|
|
163
|
+
# "prices": {
|
|
164
|
+
# "USDT": {
|
|
165
|
+
# "price": "1"
|
|
166
|
+
# },
|
|
167
|
+
# "IRR": {
|
|
168
|
+
# "price_sell": 1135000,
|
|
169
|
+
# "price_buy": 1123000
|
|
146
170
|
# }
|
|
147
|
-
#
|
|
148
|
-
# }
|
|
149
|
-
details = self.safe_list(market, 'prices')
|
|
171
|
+
# }
|
|
172
|
+
# }
|
|
150
173
|
baseId = self.safe_string(market, 'currency')
|
|
151
|
-
quoteId =
|
|
174
|
+
quoteId = 'IRR'
|
|
152
175
|
base = self.safe_currency_code(baseId)
|
|
153
176
|
quote = self.safe_currency_code(quoteId)
|
|
154
177
|
id = base + quote
|
|
@@ -163,8 +186,8 @@ class afratether(Exchange, ImplicitAPI):
|
|
|
163
186
|
'baseId': baseId,
|
|
164
187
|
'quoteId': quoteId,
|
|
165
188
|
'settleId': None,
|
|
166
|
-
'type': '
|
|
167
|
-
'spot':
|
|
189
|
+
'type': 'otc',
|
|
190
|
+
'spot': False,
|
|
168
191
|
'margin': False,
|
|
169
192
|
'swap': False,
|
|
170
193
|
'future': False,
|
|
@@ -241,41 +264,66 @@ class afratether(Exchange, ImplicitAPI):
|
|
|
241
264
|
|
|
242
265
|
def parse_ticker(self, ticker, market: Market = None) -> Ticker:
|
|
243
266
|
# {
|
|
244
|
-
# "currencyAbb": "
|
|
245
|
-
# "nameEn": "
|
|
246
|
-
# "nameFa": "
|
|
247
|
-
# "icon": "/assets/crypto/
|
|
248
|
-
# "
|
|
249
|
-
# "
|
|
250
|
-
#
|
|
251
|
-
#
|
|
252
|
-
#
|
|
267
|
+
# "currencyAbb": "USDT",
|
|
268
|
+
# "nameEn": "Tether",
|
|
269
|
+
# "nameFa": "تتر",
|
|
270
|
+
# "icon": "/assets/crypto/usdt.png",
|
|
271
|
+
# "round": 1000000,
|
|
272
|
+
# "currency": "USDT",
|
|
273
|
+
# "changeRate24h": "-0.0065",
|
|
274
|
+
# "Klines": [
|
|
275
|
+
# [
|
|
276
|
+
# "1760227200000",
|
|
277
|
+
# "1147500",
|
|
278
|
+
# "1140000",
|
|
279
|
+
# "1145500",
|
|
280
|
+
# "1125000",
|
|
281
|
+
# "0",
|
|
282
|
+
# "0"
|
|
283
|
+
# ],
|
|
284
|
+
# ],
|
|
285
|
+
# "info": {
|
|
286
|
+
# "birth_date": 1412553600000,
|
|
287
|
+
# "open_24h": 1,
|
|
288
|
+
# "open_1w": 1,
|
|
289
|
+
# "open_3M": 1,
|
|
290
|
+
# "open_1y": 1
|
|
291
|
+
# },
|
|
292
|
+
# "prices": {
|
|
293
|
+
# "USDT": {
|
|
294
|
+
# "price": "1"
|
|
295
|
+
# },
|
|
296
|
+
# "IRR": {
|
|
297
|
+
# "price_sell": 1135000,
|
|
298
|
+
# "price_buy": 1123000
|
|
253
299
|
# }
|
|
254
|
-
#
|
|
255
|
-
# }
|
|
300
|
+
# }
|
|
301
|
+
# }
|
|
256
302
|
marketType = 'otc'
|
|
257
|
-
details = self.safe_list(ticker, 'prices')
|
|
258
303
|
base = self.safe_string(ticker, 'currency')
|
|
259
|
-
quote =
|
|
260
|
-
marketId = base + quote
|
|
304
|
+
quote = 'IRR'
|
|
305
|
+
marketId = base + '/' + quote
|
|
261
306
|
symbol = self.safe_symbol(marketId, market, None, marketType)
|
|
262
|
-
|
|
307
|
+
prices = self.safe_dict(ticker, 'prices', {})
|
|
308
|
+
irrPrices = self.safe_dict(prices, 'IRR', {})
|
|
309
|
+
sell = self.safe_float(irrPrices, 'price_sell', 0)
|
|
310
|
+
buy = self.safe_float(irrPrices, 'price_buy', 0)
|
|
263
311
|
return self.safe_ticker({
|
|
264
312
|
'symbol': symbol,
|
|
265
313
|
'timestamp': None,
|
|
266
314
|
'datetime': None,
|
|
267
315
|
'high': None,
|
|
268
316
|
'low': None,
|
|
269
|
-
'bid':
|
|
317
|
+
'bid': sell,
|
|
270
318
|
'bidVolume': None,
|
|
271
|
-
'ask':
|
|
319
|
+
'ask': buy,
|
|
272
320
|
'askVolume': None,
|
|
273
321
|
'vwap': None,
|
|
274
322
|
'open': None,
|
|
275
|
-
'close':
|
|
276
|
-
'last':
|
|
323
|
+
'close': buy,
|
|
324
|
+
'last': buy,
|
|
277
325
|
'previousClose': None,
|
|
278
|
-
'change': None,
|
|
326
|
+
'change': self.safe_float(ticker, 'changeRate24h', None),
|
|
279
327
|
'percentage': None,
|
|
280
328
|
'average': None,
|
|
281
329
|
'baseVolume': None,
|