ccxt-ir 4.5.1__py2.py3-none-any.whl → 4.7.0__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 CHANGED
@@ -22,7 +22,7 @@
22
22
 
23
23
  # ----------------------------------------------------------------------------
24
24
 
25
- __version__ = '4.5.1'
25
+ __version__ = '4.7.0'
26
26
 
27
27
  # ----------------------------------------------------------------------------
28
28
 
@@ -98,6 +98,7 @@ from ccxt.binancecoinm import binancecoinm # noqa: F4
98
98
  from ccxt.binanceus import binanceus # noqa: F401
99
99
  from ccxt.binanceusdm import binanceusdm # noqa: F401
100
100
  from ccxt.bingx import bingx # noqa: F401
101
+ from ccxt.bit24 import bit24 # noqa: F401
101
102
  from ccxt.bit2c import bit2c # noqa: F401
102
103
  from ccxt.bitbank import bitbank # noqa: F401
103
104
  from ccxt.bitbns import bitbns # noqa: F401
@@ -202,6 +203,7 @@ from ccxt.tabdeal import tabdeal # noqa: F4
202
203
  from ccxt.tetherland import tetherland # noqa: F401
203
204
  from ccxt.timex import timex # noqa: F401
204
205
  from ccxt.tokocrypto import tokocrypto # noqa: F401
206
+ from ccxt.toobit import toobit # noqa: F401
205
207
  from ccxt.tradeogre import tradeogre # noqa: F401
206
208
  from ccxt.twox import twox # noqa: F401
207
209
  from ccxt.ubitex import ubitex # noqa: F401
@@ -232,6 +234,7 @@ exchanges = [
232
234
  'binanceus',
233
235
  'binanceusdm',
234
236
  'bingx',
237
+ 'bit24',
235
238
  'bit2c',
236
239
  'bitbank',
237
240
  'bitbns',
@@ -336,6 +339,7 @@ exchanges = [
336
339
  'tetherland',
337
340
  'timex',
338
341
  'tokocrypto',
342
+ 'toobit',
339
343
  'tradeogre',
340
344
  'twox',
341
345
  'ubitex',
ccxt/abstract/bit24.py ADDED
@@ -0,0 +1,5 @@
1
+ from ccxt.base.types import Entry
2
+
3
+
4
+ class ImplicitAPI:
5
+ public_get_pro_v3_markets = publicGetProV3Markets = Entry('pro/v3/markets', 'public', 'GET', {'cost': 1})
@@ -0,0 +1,6 @@
1
+ from ccxt.base.types import Entry
2
+
3
+
4
+ class ImplicitAPI:
5
+ public_get_quote_v1_ticker_24hr = publicGetQuoteV1Ticker24hr = Entry('quote/v1/ticker/24hr', 'public', 'GET', {'cost': 1})
6
+ public_get_quote_v1_klines = publicGetQuoteV1Klines = Entry('quote/v1/klines', 'public', 'GET', {'cost': 1})
@@ -4,7 +4,7 @@
4
4
 
5
5
  # -----------------------------------------------------------------------------
6
6
 
7
- __version__ = '4.5.1'
7
+ __version__ = '4.7.0'
8
8
 
9
9
  # -----------------------------------------------------------------------------
10
10
 
@@ -78,6 +78,7 @@ from ccxt.async_support.binancecoinm import binancecoinm
78
78
  from ccxt.async_support.binanceus import binanceus # noqa: F401
79
79
  from ccxt.async_support.binanceusdm import binanceusdm # noqa: F401
80
80
  from ccxt.async_support.bingx import bingx # noqa: F401
81
+ from ccxt.async_support.bit24 import bit24 # noqa: F401
81
82
  from ccxt.async_support.bit2c import bit2c # noqa: F401
82
83
  from ccxt.async_support.bitbank import bitbank # noqa: F401
83
84
  from ccxt.async_support.bitbns import bitbns # noqa: F401
@@ -182,6 +183,7 @@ from ccxt.async_support.tabdeal import tabdeal
182
183
  from ccxt.async_support.tetherland import tetherland # noqa: F401
183
184
  from ccxt.async_support.timex import timex # noqa: F401
184
185
  from ccxt.async_support.tokocrypto import tokocrypto # noqa: F401
186
+ from ccxt.async_support.toobit import toobit # noqa: F401
185
187
  from ccxt.async_support.tradeogre import tradeogre # noqa: F401
186
188
  from ccxt.async_support.twox import twox # noqa: F401
187
189
  from ccxt.async_support.ubitex import ubitex # noqa: F401
@@ -212,6 +214,7 @@ exchanges = [
212
214
  'binanceus',
213
215
  'binanceusdm',
214
216
  'bingx',
217
+ 'bit24',
215
218
  'bit2c',
216
219
  'bitbank',
217
220
  'bitbns',
@@ -316,6 +319,7 @@ exchanges = [
316
319
  'tetherland',
317
320
  'timex',
318
321
  'tokocrypto',
322
+ 'toobit',
319
323
  'tradeogre',
320
324
  'twox',
321
325
  'ubitex',
@@ -129,7 +129,7 @@ class abantether(Exchange, ImplicitAPI):
129
129
  response[i]['quote'] = quote
130
130
  if base == quote:
131
131
  continue
132
- market = await self.parse_market(response[i])
132
+ market = self.parse_market(response[i])
133
133
  result.append(market)
134
134
  return result
135
135
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  # -----------------------------------------------------------------------------
4
4
 
5
- __version__ = '4.5.1'
5
+ __version__ = '4.7.0'
6
6
 
7
7
  # -----------------------------------------------------------------------------
8
8
 
@@ -0,0 +1,372 @@
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.bit24 import ImplicitAPI
8
+ from ccxt.base.types import Any, Market, Strings, Ticker, Tickers
9
+ from typing import List
10
+
11
+
12
+ class bit24(Exchange, ImplicitAPI):
13
+
14
+ def describe(self) -> Any:
15
+ return self.deep_extend(super(bit24, self).describe(), {
16
+ 'id': 'bit24',
17
+ 'name': 'Bit24',
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/bit24/64x64.png',
89
+ 'api': {
90
+ 'public': 'https://bit24.cash/api/',
91
+ },
92
+ 'www': 'https://bit24.cash/',
93
+ 'doc': [
94
+ 'https://bit24.cash/',
95
+ ],
96
+ },
97
+ 'api': {
98
+ 'public': {
99
+ 'get': {
100
+ 'pro/v3/markets': 1,
101
+ },
102
+ },
103
+ },
104
+ 'fees': {
105
+ },
106
+ })
107
+
108
+ async def fetch_markets(self, params={}) -> List[Market]:
109
+ """
110
+ retrieves data on all markets for bit24 with pagination
111
+ https://bit24.cash/api/pro/v3/markets
112
+ :param dict [params]: extra parameters specific to the exchange API endpoint
113
+ :returns dict[]: an array of objects representing market data
114
+ """
115
+ result = []
116
+ page = 1
117
+ limit = 100 # check Bit24 docs for max allowed per page
118
+ while(True):
119
+ response = await self.publicGetProV3Markets(self.extend(params, {
120
+ 'page': page,
121
+ 'per_page': limit,
122
+ }))
123
+ markets = self.safe_dict(response, 'data')
124
+ marketList = self.safe_list(markets, 'results', [])
125
+ for i in range(0, len(marketList)):
126
+ marketdata = marketList[i]
127
+ market = self.parse_market(marketdata)
128
+ result.append(market)
129
+ # stop condition: if fewer results than limit, last page reached
130
+ if len(marketList) < limit:
131
+ break
132
+ page += 1
133
+ return result
134
+
135
+ def parse_market(self, market) -> Market:
136
+ # {
137
+ # id: 59,
138
+ # market_name: "FTT/IRT",
139
+ # quote_coin_decimal: 0,
140
+ # base_coin_decimal: 2,
141
+ # each_price: "83669.0000000000000000",
142
+ # is_favorite: False,
143
+ # max_leverage: null,
144
+ # margin_profit_retention_fee: null,
145
+ # margin_order_expire_days: null,
146
+ # max_long_margin_leverage: null,
147
+ # max_short_margin_leverage: null,
148
+ # base_coin: {
149
+ # symbol: "FTT",
150
+ # name: "FTX Token",
151
+ # fa_name: "اف تی ایکس توکن",
152
+ # logo: "https://exchange-storage.bit24.cash/exchange/icons/ftt.png",
153
+ # coin_type: 0
154
+ # },
155
+ # quote_coin: {
156
+ # symbol: "IRT",
157
+ # name: "Toman",
158
+ # fa_name: "تومان",
159
+ # logo: "https://exchange-storage.bit24.cash/exchange/icons/IRT.png",
160
+ # coin_type: 1
161
+ # },
162
+ # margin_order_status: {
163
+ # index: 0,
164
+ # name: "غیرفعال"
165
+ # },
166
+ # bot_order_status: {
167
+ # index: 1,
168
+ # name: "فعال"
169
+ # },
170
+ # market_24h_information: {
171
+ # base_volume: "467.86",
172
+ # quote_volume: "39880070",
173
+ # change_percent: "-1.687",
174
+ # change_amount: "-1436",
175
+ # min_price: "83137",
176
+ # max_price: "87128",
177
+ # first_price: "85105",
178
+ # last_price: "83669"
179
+ # }
180
+ # }
181
+ base_coin = self.safe_dict(market, 'base_coin')
182
+ baseId = self.safe_string(base_coin, 'symbol')
183
+ quote_coin = self.safe_dict(market, 'quote_coin')
184
+ quoteId = self.safe_string(quote_coin, 'symbol')
185
+ base = self.safe_currency_code(baseId)
186
+ quote = self.safe_currency_code(quoteId)
187
+ baseId = baseId.lower()
188
+ quoteId = quoteId.lower()
189
+ id = baseId + '-' + quoteId
190
+ return {
191
+ 'id': id,
192
+ 'symbol': base + '/' + quote,
193
+ 'base': base,
194
+ 'quote': quote,
195
+ 'settle': None,
196
+ 'baseId': baseId,
197
+ 'quoteId': quoteId,
198
+ 'settleId': None,
199
+ 'type': 'spot',
200
+ 'spot': True,
201
+ 'margin': False,
202
+ 'swap': False,
203
+ 'future': False,
204
+ 'option': False,
205
+ 'active': True,
206
+ 'contract': False,
207
+ 'linear': None,
208
+ 'inverse': None,
209
+ 'contractSize': None,
210
+ 'expiry': None,
211
+ 'expiryDatetime': None,
212
+ 'strike': None,
213
+ 'optionType': None,
214
+ 'precision': {
215
+ 'amount': None,
216
+ 'price': None,
217
+ },
218
+ 'limits': {
219
+ 'leverage': {
220
+ 'min': None,
221
+ 'max': None,
222
+ },
223
+ 'amount': {
224
+ 'min': None,
225
+ 'max': None,
226
+ },
227
+ 'price': {
228
+ 'min': None,
229
+ 'max': None,
230
+ },
231
+ 'cost': {
232
+ 'min': None,
233
+ 'max': None,
234
+ },
235
+ },
236
+ 'created': None,
237
+ 'info': market,
238
+ }
239
+
240
+ async def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
241
+ """
242
+ fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
243
+ https://bit24.com/pro/v3/tickers
244
+ :param str[]|None symbols: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
245
+ :param dict [params]: extra parameters specific to the exchange API endpoint
246
+ :returns dict: a dictionary of `ticker structures <https://docs.ccxt.com/#/?id=ticker-structure>`
247
+ """
248
+ await self.load_markets()
249
+ if symbols is not None:
250
+ symbols = self.market_symbols(symbols)
251
+ page = 1
252
+ limit = 100 # adjust if Bit24 docs show a different default
253
+ result = {}
254
+ while(True):
255
+ response = await self.publicGetProV3Markets(self.extend(params, {
256
+ 'page': page,
257
+ 'per_page': limit,
258
+ }))
259
+ data = self.safe_dict(response, 'data', {})
260
+ tickerList = self.safe_list(data, 'results', [])
261
+ for i in range(0, len(tickerList)):
262
+ tickerData = tickerList[i]
263
+ ticker = self.parse_ticker(tickerData)
264
+ symbol = ticker['symbol']
265
+ result[symbol] = ticker
266
+ if len(tickerList) < limit:
267
+ break
268
+ page += 1
269
+ return self.filter_by_array_tickers(result, 'symbol', symbols)
270
+
271
+ async def fetch_ticker(self, symbol: str, params={}) -> Ticker:
272
+ """
273
+ fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
274
+ https://bit24.com/management/all-coins/?format=json
275
+ :param str symbol: unified symbol of the market to fetch the ticker for
276
+ :param dict [params]: extra parameters specific to the exchange API endpoint
277
+ :returns dict: a `ticker structure <https://docs.ccxt.com/#/?id=ticker-structure>`
278
+ """
279
+ ticker = await self.fetch_tickers([symbol])
280
+ return ticker[symbol]
281
+
282
+ def parse_ticker(self, ticker, market: Market = None) -> Ticker:
283
+ # {
284
+ # id: 59,
285
+ # market_name: "FTT/IRT",
286
+ # quote_coin_decimal: 0,
287
+ # base_coin_decimal: 2,
288
+ # each_price: "83669.0000000000000000",
289
+ # is_favorite: False,
290
+ # max_leverage: null,
291
+ # margin_profit_retention_fee: null,
292
+ # margin_order_expire_days: null,
293
+ # max_long_margin_leverage: null,
294
+ # max_short_margin_leverage: null,
295
+ # base_coin: {
296
+ # symbol: "FTT",
297
+ # name: "FTX Token",
298
+ # fa_name: "اف تی ایکس توکن",
299
+ # logo: "https://exchange-storage.bit24.cash/exchange/icons/ftt.png",
300
+ # coin_type: 0
301
+ # },
302
+ # quote_coin: {
303
+ # symbol: "IRT",
304
+ # name: "Toman",
305
+ # fa_name: "تومان",
306
+ # logo: "https://exchange-storage.bit24.cash/exchange/icons/IRT.png",
307
+ # coin_type: 1
308
+ # },
309
+ # margin_order_status: {
310
+ # index: 0,
311
+ # name: "غیرفعال"
312
+ # },
313
+ # bot_order_status: {
314
+ # index: 1,
315
+ # name: "فعال"
316
+ # },
317
+ # market_24h_information: {
318
+ # base_volume: "467.86",
319
+ # quote_volume: "39880070",
320
+ # change_percent: "-1.687",
321
+ # change_amount: "-1436",
322
+ # min_price: "83137",
323
+ # max_price: "87128",
324
+ # first_price: "85105",
325
+ # last_price: "83669"
326
+ # }
327
+ # },
328
+ marketType = 'spot'
329
+ base_coin = self.safe_dict(ticker, 'base_coin', {})
330
+ base_symbol = self.safe_string(base_coin, 'symbol')
331
+ base_symbol = base_symbol.lower()
332
+ quote_coin = self.safe_dict(ticker, 'quote_coin', {})
333
+ quote_symbol = self.safe_string(quote_coin, 'symbol')
334
+ quote_symbol = quote_symbol.lower()
335
+ marketId = base_symbol + '-' + quote_symbol
336
+ symbol = self.safe_symbol(marketId, market, None, marketType)
337
+ last = self.safe_float(ticker, 'each_price', 0)
338
+ markerInfo = self.safe_dict(ticker, 'market_24h_information', {})
339
+ change = self.safe_float(markerInfo, 'change_percent', 0)
340
+ minPrice = self.safe_float(markerInfo, 'min_price', 0)
341
+ maxPrice = self.safe_float(markerInfo, 'max_price', 0)
342
+ baseVolume = self.safe_float(markerInfo, 'base_volume', 0)
343
+ quoteVolume = self.safe_float(markerInfo, 'quote_volume', 0)
344
+ return self.safe_ticker({
345
+ 'symbol': symbol,
346
+ 'timestamp': None,
347
+ 'datetime': None,
348
+ 'high': maxPrice,
349
+ 'low': minPrice,
350
+ 'bid': None,
351
+ 'bidVolume': None,
352
+ 'ask': None,
353
+ 'askVolume': None,
354
+ 'vwap': None,
355
+ 'open': None,
356
+ 'close': last,
357
+ 'last': last,
358
+ 'previousClose': None,
359
+ 'change': change,
360
+ 'percentage': None,
361
+ 'average': None,
362
+ 'baseVolume': baseVolume,
363
+ 'quoteVolume': quoteVolume,
364
+ 'info': ticker,
365
+ }, market)
366
+
367
+ def sign(self, path, api='public', method='GET', params={}, headers=None, body=None):
368
+ query = self.omit(params, self.extract_params(path))
369
+ url = self.urls['api'][api] + '/' + self.implode_params(path, params)
370
+ url = url + '?' + self.urlencode(query)
371
+ headers = {'Content-Type': 'application/json'}
372
+ return {'url': url, 'method': method, 'body': body, 'headers': headers}
@@ -133,6 +133,9 @@ class exir(Exchange, ImplicitAPI):
133
133
  for i in range(0, len(marketKeys)):
134
134
  symbol = marketKeys[i]
135
135
  response[symbol]['symbol'] = symbol
136
+ lastPrice = self.safe_float(response[symbol], 'last')
137
+ if lastPrice == 0:
138
+ continue
136
139
  market = self.parse_market(response[symbol])
137
140
  result.append(market)
138
141
  return result
@@ -223,7 +226,7 @@ class exir(Exchange, ImplicitAPI):
223
226
  symbols = self.market_symbols(symbols)
224
227
  response = await self.publicGetV2Tickers()
225
228
  marketKeys = list(response.keys())
226
- result = []
229
+ result = {}
227
230
  for i in range(0, len(marketKeys)):
228
231
  symbol = marketKeys[i]
229
232
  response[symbol]['symbol'] = symbol
@@ -247,7 +250,6 @@ class exir(Exchange, ImplicitAPI):
247
250
  }
248
251
  response = await self.publicGetV2Ticker(request)
249
252
  response['symbol'] = market['id']
250
- response['time'] = response['timestamp']
251
253
  ticker = self.parse_ticker(response)
252
254
  return ticker
253
255
 
@@ -268,22 +270,23 @@ class exir(Exchange, ImplicitAPI):
268
270
  symbol = self.safe_symbol(marketId, market, None, marketType)
269
271
  high = self.safe_float(ticker, 'high')
270
272
  low = self.safe_float(ticker, 'low')
271
- bid = self.safe_float(ticker, 'last')
272
- ask = self.safe_float(ticker, 'last')
273
- open = self.safe_float(ticker, 'open')
274
- close = self.safe_float(ticker, 'close')
275
- last = self.safe_float(ticker, 'last')
276
- quoteVolume = self.safe_float(ticker, 'volume')
273
+ open = self.safe_float(ticker, 'open', 0)
274
+ close = self.safe_float(ticker, 'close', 0)
275
+ last = self.safe_float(ticker, 'last', 0)
276
+ baseVolume = self.safe_float(ticker, 'volume', 0)
277
277
  datetime = self.safe_string(ticker, 'time')
278
+ quoteVolume = None
279
+ if last != 0:
280
+ quoteVolume = baseVolume * last
278
281
  return self.safe_ticker({
279
282
  'symbol': symbol,
280
283
  'timestamp': self.parse8601(datetime),
281
284
  'datetime': datetime,
282
285
  'high': high,
283
286
  'low': low,
284
- 'bid': self.safe_float(bid, 0),
287
+ 'bid': None,
285
288
  'bidVolume': None,
286
- 'ask': self.safe_float(ask, 0),
289
+ 'ask': None,
287
290
  'askVolume': None,
288
291
  'vwap': None,
289
292
  'open': open,
@@ -293,7 +296,7 @@ class exir(Exchange, ImplicitAPI):
293
296
  'change': None,
294
297
  'percentage': None,
295
298
  'average': None,
296
- 'baseVolume': None,
299
+ 'baseVolume': baseVolume,
297
300
  'quoteVolume': quoteVolume,
298
301
  'info': ticker,
299
302
  }, market)
@@ -164,8 +164,8 @@ class nobitex(Exchange, ImplicitAPI):
164
164
  # dayClose: "38819999960",
165
165
  # dayChange: "0.05"
166
166
  # },
167
+ id = self.safe_string(market, 'symbol')
167
168
  symbol = self.safe_string_upper(market, 'symbol')
168
- id = symbol.replace('-', '')
169
169
  baseId, quoteId = symbol.split('-')
170
170
  base = self.safe_currency_code(baseId)
171
171
  quote = self.safe_currency_code(quoteId)
@@ -258,23 +258,31 @@ class nobitex(Exchange, ImplicitAPI):
258
258
  return ticker[symbol]
259
259
 
260
260
  def parse_ticker(self, ticker, market: Market = None) -> Ticker:
261
- #
262
- # {
263
- # symbol: "USDT-IRT",
264
- # last: "61338.0",
265
- # best_ask: "61338.0",
266
- # best_bid: "61338.0",
267
- # open_24h: "61419",
268
- # high_24h: 61739,
269
- # low_24h: 60942,
270
- # vol_24h_pair: 11017655160,
271
- # vol_24h: 17968,
272
- # ts: 1715074621
273
- # }
274
- #
261
+ # {
262
+ # symbol: "btc-rls",
263
+ # isClosed: False,
264
+ # bestSell: "112800000000",
265
+ # bestBuy: "112790000000",
266
+ # volumeSrc: "8.4585865026",
267
+ # volumeDst: "952507404308.593429632",
268
+ # latest: "112800000000",
269
+ # mark: "112770303030",
270
+ # dayLow: "111700000000",
271
+ # dayHigh: "114608341550",
272
+ # dayOpen: "112783203040",
273
+ # dayClose: "112800000000",
274
+ # dayChange: "0.01"
275
+ # }
275
276
  marketType = 'spot'
276
- symbol = self.safe_string_upper(ticker, 'symbol')
277
- marketId = symbol.replace('-', '')
277
+ rawSymbol = self.safe_string_lower(ticker, 'symbol')
278
+ parts = rawSymbol.split('-')
279
+ baseId = parts[0]
280
+ quoteId = parts[1]
281
+ if quoteId == 'rls':
282
+ quoteId = 'irt'
283
+ base = self.safe_currency_code(baseId.upper())
284
+ quote = self.safe_currency_code(quoteId.upper())
285
+ marketId = base + '/' + quote
278
286
  marketinfo = self.market(marketId)
279
287
  symbol = self.safe_symbol(marketId, market, None, marketType)
280
288
  high = self.safe_float(ticker, 'dayHigh')
@@ -287,8 +295,9 @@ class nobitex(Exchange, ImplicitAPI):
287
295
  last = self.safe_float(ticker, 'latest')
288
296
  quoteVolume = self.safe_float(ticker, 'volumeDst')
289
297
  baseVolume = self.safe_float(ticker, 'volumeSrc')
298
+ # adjust Nobitex IRT scaling
290
299
  if marketinfo['quote'] == 'IRT':
291
- high = high * 10 if high else 0
300
+ high = high / 10 if high else 0
292
301
  low = low / 10 if low else 0
293
302
  bid = bid / 10 if bid else 0
294
303
  ask = ask / 10 if ask else 0
@@ -297,14 +306,14 @@ class nobitex(Exchange, ImplicitAPI):
297
306
  last = last / 10 if last else 0
298
307
  quoteVolume = quoteVolume / 10 if quoteVolume else 0
299
308
  return self.safe_ticker({
300
- 'symbol': symbol.replace('-', '/'),
309
+ 'symbol': symbol,
301
310
  'timestamp': None,
302
311
  'datetime': None,
303
312
  'high': high,
304
313
  'low': low,
305
- 'bid': self.safe_float(bid, 0),
314
+ 'bid': bid,
306
315
  'bidVolume': None,
307
- 'ask': self.safe_float(ask, 0),
316
+ 'ask': ask,
308
317
  'askVolume': None,
309
318
  'vwap': None,
310
319
  'open': open,
@@ -334,7 +343,7 @@ class nobitex(Exchange, ImplicitAPI):
334
343
  market = self.market(symbol)
335
344
  endTime = Date.now()
336
345
  if market['quote'] == 'IRT':
337
- market['id'] = market['id'].replace('RLS', 'IRT')
346
+ market['id'] = market['symbol'].replace('/', '')
338
347
  request = {
339
348
  'symbol': market['id'],
340
349
  'from': (endTime / 1000) - (24 * 60 * 60),
@@ -248,7 +248,7 @@ class sarmayex(Exchange, ImplicitAPI):
248
248
  response = await self.publicGetApiV1PublicCurrencies(params)
249
249
  response = self.safe_dict(response, 'data')
250
250
  markets = self.safe_list(response, 'currencies')
251
- result = []
251
+ result = {}
252
252
  quotes = ['IRT', 'USDT']
253
253
  for i in range(0, len(markets)):
254
254
  base = self.safe_string(markets[i], 'symbol')