ccxt-ir 4.5.0__py2.py3-none-any.whl → 4.6.1__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.
@@ -262,7 +262,7 @@ class ramzinex(Exchange, ImplicitAPI):
262
262
  symbols = self.market_symbols(symbols)
263
263
  response = await self.publicGetExchangeApiV10ExchangePairs()
264
264
  markets = self.safe_list(response, 'data')
265
- result = []
265
+ result = {}
266
266
  for i in range(0, len(markets)):
267
267
  market = markets[i]
268
268
  if not market or not market['financial'] or market['financial'] == 0:
@@ -469,8 +469,9 @@ class ramzinex(Exchange, ImplicitAPI):
469
469
  def sign(self, path, api='public', method='GET', params={}, headers=None, body=None):
470
470
  query = self.omit(params, self.extract_params(path))
471
471
  url = self.urls['api']['public'] + '/' + path
472
- if params['pair_id'] is not None:
473
- url = url + '/' + params['pair_id']
472
+ pair_id = self.safe_string(params, 'pair_id')
473
+ if pair_id is not None:
474
+ url = url + '/' + pair_id
474
475
  if path == 'exchange/api/v1.0/exchange/chart/tv/history':
475
476
  url = self.urls['api']['public'] + '/' + path + '?' + self.urlencode(query)
476
477
  if path == 'exchange/api/v1.0/exchange/orderbooks':
@@ -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')
@@ -223,7 +223,7 @@ class tabdeal(Exchange, ImplicitAPI):
223
223
  if symbols is not None:
224
224
  symbols = self.market_symbols(symbols)
225
225
  response = await self.publicGetPlotsMarketInformation(params)
226
- result = []
226
+ result = {}
227
227
  for i in range(0, len(response)):
228
228
  market = self.parse_ticker(response[i])
229
229
  symbol = market['symbol']
ccxt/base/exchange.py CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  # -----------------------------------------------------------------------------
6
6
 
7
- __version__ = '4.5.0'
7
+ __version__ = '4.6.1'
8
8
 
9
9
  # -----------------------------------------------------------------------------
10
10
 
ccxt/bit24.py ADDED
@@ -0,0 +1,374 @@
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.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
+ 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 = 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
+ 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
+ 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 = 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
+ 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 = 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
+ if query > 0:
371
+ queryString = self.urlencode(query)
372
+ url += '?' + queryString
373
+ headers = {'Content-Type': 'application/json'}
374
+ return {'url': url, 'method': method, 'body': body, 'headers': headers}
ccxt/exir.py CHANGED
@@ -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 = 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
@@ -268,22 +271,23 @@ class exir(Exchange, ImplicitAPI):
268
271
  symbol = self.safe_symbol(marketId, market, None, marketType)
269
272
  high = self.safe_float(ticker, 'high')
270
273
  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')
274
+ open = self.safe_float(ticker, 'open', 0)
275
+ close = self.safe_float(ticker, 'close', 0)
276
+ last = self.safe_float(ticker, 'last', 0)
277
+ baseVolume = self.safe_float(ticker, 'volume', 0)
277
278
  datetime = self.safe_string(ticker, 'time')
279
+ quoteVolume = None
280
+ if last != 0:
281
+ quoteVolume = baseVolume * last
278
282
  return self.safe_ticker({
279
283
  'symbol': symbol,
280
284
  'timestamp': self.parse8601(datetime),
281
285
  'datetime': datetime,
282
286
  'high': high,
283
287
  'low': low,
284
- 'bid': self.safe_float(bid, 0),
288
+ 'bid': None,
285
289
  'bidVolume': None,
286
- 'ask': self.safe_float(ask, 0),
290
+ 'ask': None,
287
291
  'askVolume': None,
288
292
  'vwap': None,
289
293
  'open': open,
@@ -293,7 +297,7 @@ class exir(Exchange, ImplicitAPI):
293
297
  'change': None,
294
298
  'percentage': None,
295
299
  'average': None,
296
- 'baseVolume': None,
300
+ 'baseVolume': baseVolume,
297
301
  'quoteVolume': quoteVolume,
298
302
  'info': ticker,
299
303
  }, market)
ccxt/nobitex.py CHANGED
@@ -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)
@@ -235,7 +235,7 @@ class nobitex(Exchange, ImplicitAPI):
235
235
  response = self.publicGetMarketStats()
236
236
  markets = self.safe_dict(response, 'stats')
237
237
  marketKeys = list(markets.keys())
238
- result = []
238
+ result = {}
239
239
  for i in range(0, len(marketKeys)):
240
240
  symbol = marketKeys[i]
241
241
  if markets[symbol]['isClosed']:
@@ -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),
ccxt/ompfinex.py CHANGED
@@ -264,7 +264,7 @@ class ompfinex(Exchange, ImplicitAPI):
264
264
  symbols = self.market_symbols(symbols)
265
265
  response = self.publicGetV1Market()
266
266
  markets = self.safe_list(response, 'data')
267
- result = []
267
+ result = {}
268
268
  for i in range(0, len(markets)):
269
269
  ticker = self.parse_ticker(markets[i])
270
270
  symbol = ticker['symbol']
@@ -356,7 +356,9 @@ class ompfinex(Exchange, ImplicitAPI):
356
356
  low = low / 10 if low else 0
357
357
  last = last / 10 if last else 0
358
358
  quoteVolume = quoteVolume / 10 if quoteVolume else 0
359
- baseVolume = quoteVolume / last
359
+ baseVolume = 0
360
+ if last:
361
+ baseVolume = quoteVolume / last
360
362
  return self.safe_ticker({
361
363
  'symbol': symbol,
362
364
  'timestamp': None,
@@ -465,8 +467,10 @@ class ompfinex(Exchange, ImplicitAPI):
465
467
  def sign(self, path, api='public', method='GET', params={}, headers=None, body=None):
466
468
  query = self.omit(params, self.extract_params(path))
467
469
  url = self.urls['api']['public'] + '/' + path
468
- if params['id'] is not None:
469
- url = url + '/' + params['id']
470
+ # safer check
471
+ pair_id = self.safe_string(params, 'id')
472
+ if pair_id is not None:
473
+ url = url + '/' + pair_id
470
474
  if path == 'v2/udf/real/history':
471
475
  url = self.urls['api']['public'] + '/' + path + '?' + self.urlencode(query)
472
476
  headers = {'Content-Type': 'application/json'}
ccxt/pro/__init__.py CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  # ----------------------------------------------------------------------------
6
6
 
7
- __version__ = '4.5.0'
7
+ __version__ = '4.6.1'
8
8
 
9
9
  # ----------------------------------------------------------------------------
10
10
 
ccxt/ramzinex.py CHANGED
@@ -262,7 +262,7 @@ class ramzinex(Exchange, ImplicitAPI):
262
262
  symbols = self.market_symbols(symbols)
263
263
  response = self.publicGetExchangeApiV10ExchangePairs()
264
264
  markets = self.safe_list(response, 'data')
265
- result = []
265
+ result = {}
266
266
  for i in range(0, len(markets)):
267
267
  market = markets[i]
268
268
  if not market or not market['financial'] or market['financial'] == 0:
@@ -469,8 +469,9 @@ class ramzinex(Exchange, ImplicitAPI):
469
469
  def sign(self, path, api='public', method='GET', params={}, headers=None, body=None):
470
470
  query = self.omit(params, self.extract_params(path))
471
471
  url = self.urls['api']['public'] + '/' + path
472
- if params['pair_id'] is not None:
473
- url = url + '/' + params['pair_id']
472
+ pair_id = self.safe_string(params, 'pair_id')
473
+ if pair_id is not None:
474
+ url = url + '/' + pair_id
474
475
  if path == 'exchange/api/v1.0/exchange/chart/tv/history':
475
476
  url = self.urls['api']['public'] + '/' + path + '?' + self.urlencode(query)
476
477
  if path == 'exchange/api/v1.0/exchange/orderbooks':
ccxt/sarmayex.py CHANGED
@@ -248,7 +248,7 @@ class sarmayex(Exchange, ImplicitAPI):
248
248
  response = 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')