ccxt-ir 4.20.1 → 4.22.0

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 (75) hide show
  1. package/README.md +4 -4
  2. package/dist/ccxt.browser.min.js +3 -3
  3. package/dist/cjs/ccxt.js +10 -1
  4. package/dist/cjs/src/abstract/exino.js +11 -0
  5. package/dist/cjs/src/ariomex.js +198 -0
  6. package/dist/cjs/src/arzplus.js +2 -2
  7. package/dist/cjs/src/bitimen.js +2 -2
  8. package/dist/cjs/src/bitir.js +2 -2
  9. package/dist/cjs/src/bitpin.js +3 -3
  10. package/dist/cjs/src/excoino.js +2 -2
  11. package/dist/cjs/src/exino.js +215 -0
  12. package/dist/cjs/src/exir.js +2 -2
  13. package/dist/cjs/src/exnovin.js +1 -1
  14. package/dist/cjs/src/hitobit.js +2 -2
  15. package/dist/cjs/src/jibitex.js +2 -2
  16. package/dist/cjs/src/kifpoolme.js +1 -1
  17. package/dist/cjs/src/nobitex.js +3 -3
  18. package/dist/cjs/src/okexchange.js +2 -2
  19. package/dist/cjs/src/ompfinex.js +2 -2
  20. package/dist/cjs/src/pingi.js +1 -1
  21. package/dist/cjs/src/poulyar.js +190 -0
  22. package/dist/cjs/src/raastin.js +1 -1
  23. package/dist/cjs/src/ramzinex.js +10 -10
  24. package/dist/cjs/src/sarrafex.js +2 -2
  25. package/dist/cjs/src/tabdeal.js +2 -2
  26. package/dist/cjs/src/ubitex.js +3 -3
  27. package/dist/cjs/src/wallex.js +2 -2
  28. package/js/ccxt.d.ts +11 -2
  29. package/js/ccxt.js +8 -2
  30. package/js/src/abstract/ariomex.d.ts +8 -0
  31. package/js/src/abstract/ariomex.js +11 -0
  32. package/js/src/abstract/exino.d.ts +8 -0
  33. package/js/src/abstract/exino.js +11 -0
  34. package/js/src/abstract/poulyar.d.ts +8 -0
  35. package/js/src/abstract/poulyar.js +11 -0
  36. package/js/src/ariomex.d.ts +21 -0
  37. package/js/src/ariomex.js +197 -0
  38. package/js/src/arzplus.js +2 -2
  39. package/js/src/base/Exchange.d.ts +2 -2
  40. package/js/src/bitimen.js +2 -2
  41. package/js/src/bitir.js +2 -2
  42. package/js/src/bitpin.js +3 -3
  43. package/js/src/coinbaseexchange.d.ts +1 -1
  44. package/js/src/excoino.js +2 -2
  45. package/js/src/exino.d.ts +16 -0
  46. package/js/src/exino.js +214 -0
  47. package/js/src/exir.js +2 -2
  48. package/js/src/exnovin.js +1 -1
  49. package/js/src/hitobit.js +2 -2
  50. package/js/src/jibitex.js +2 -2
  51. package/js/src/kifpoolme.js +1 -1
  52. package/js/src/nobitex.js +3 -3
  53. package/js/src/okexchange.js +2 -2
  54. package/js/src/ompfinex.js +2 -2
  55. package/js/src/pingi.js +1 -1
  56. package/js/src/poulyar.d.ts +20 -0
  57. package/js/src/poulyar.js +189 -0
  58. package/js/src/protobuf/mexc/compiled.d.cts +6 -0
  59. package/js/src/raastin.js +1 -1
  60. package/js/src/ramzinex.js +10 -10
  61. package/js/src/sarrafex.js +2 -2
  62. package/js/src/static_dependencies/fflake/browser.d.ts +5 -5
  63. package/js/src/static_dependencies/jsencrypt/lib/jsbn/jsbn.d.ts +1 -1
  64. package/js/src/static_dependencies/qs/formats.d.cts +6 -0
  65. package/js/src/static_dependencies/qs/index.d.cts +6 -0
  66. package/js/src/static_dependencies/qs/parse.d.cts +6 -0
  67. package/js/src/static_dependencies/qs/stringify.d.cts +6 -0
  68. package/js/src/static_dependencies/qs/utils.d.cts +6 -0
  69. package/js/src/static_dependencies/starknet/utils/calldata/parser/index.d.ts +1 -1
  70. package/js/src/tabdeal.js +2 -2
  71. package/js/src/ubitex.js +3 -3
  72. package/js/src/wallex.js +2 -2
  73. package/js/test.d.ts +1 -1
  74. package/js/test.js +35 -63
  75. package/package.json +1 -1
package/dist/cjs/ccxt.js CHANGED
@@ -16,6 +16,7 @@ var abantether = require('./src/abantether.js');
16
16
  var afratether = require('./src/afratether.js');
17
17
  var alpaca = require('./src/alpaca.js');
18
18
  var apex = require('./src/apex.js');
19
+ var ariomex = require('./src/ariomex.js');
19
20
  var arzinja = require('./src/arzinja.js');
20
21
  var arzplus = require('./src/arzplus.js');
21
22
  var asacoine = require('./src/asacoine.js');
@@ -88,6 +89,7 @@ var digikalagold = require('./src/digikalagold.js');
88
89
  var ellipx = require('./src/ellipx.js');
89
90
  var eterex = require('./src/eterex.js');
90
91
  var excoino = require('./src/excoino.js');
92
+ var exino = require('./src/exino.js');
91
93
  var exir = require('./src/exir.js');
92
94
  var exmo = require('./src/exmo.js');
93
95
  var exnovin = require('./src/exnovin.js');
@@ -149,6 +151,7 @@ var phemex = require('./src/phemex.js');
149
151
  var pingi = require('./src/pingi.js');
150
152
  var poloniex = require('./src/poloniex.js');
151
153
  var pooleno = require('./src/pooleno.js');
154
+ var poulyar = require('./src/poulyar.js');
152
155
  var probit = require('./src/probit.js');
153
156
  var raastin = require('./src/raastin.js');
154
157
  var ramzinex = require('./src/ramzinex.js');
@@ -260,13 +263,14 @@ var xt$1 = require('./src/pro/xt.js');
260
263
 
261
264
  //-----------------------------------------------------------------------------
262
265
  // this is updated by vss.js when building
263
- const version = '4.20.1';
266
+ const version = '4.22.0';
264
267
  Exchange["default"].ccxtVersion = version;
265
268
  const exchanges = {
266
269
  'abantether': abantether["default"],
267
270
  'afratether': afratether["default"],
268
271
  'alpaca': alpaca["default"],
269
272
  'apex': apex["default"],
273
+ 'ariomex': ariomex["default"],
270
274
  'arzinja': arzinja["default"],
271
275
  'arzplus': arzplus["default"],
272
276
  'asacoine': asacoine["default"],
@@ -339,6 +343,7 @@ const exchanges = {
339
343
  'ellipx': ellipx["default"],
340
344
  'eterex': eterex["default"],
341
345
  'excoino': excoino["default"],
346
+ 'exino': exino["default"],
342
347
  'exir': exir["default"],
343
348
  'exmo': exmo["default"],
344
349
  'exnovin': exnovin["default"],
@@ -400,6 +405,7 @@ const exchanges = {
400
405
  'pingi': pingi["default"],
401
406
  'poloniex': poloniex["default"],
402
407
  'pooleno': pooleno["default"],
408
+ 'poulyar': poulyar["default"],
403
409
  'probit': probit["default"],
404
410
  'raastin': raastin["default"],
405
411
  'ramzinex': ramzinex["default"],
@@ -566,6 +572,7 @@ exports.abantether = abantether["default"];
566
572
  exports.afratether = afratether["default"];
567
573
  exports.alpaca = alpaca["default"];
568
574
  exports.apex = apex["default"];
575
+ exports.ariomex = ariomex["default"];
569
576
  exports.arzinja = arzinja["default"];
570
577
  exports.arzplus = arzplus["default"];
571
578
  exports.asacoine = asacoine["default"];
@@ -638,6 +645,7 @@ exports.digikalagold = digikalagold["default"];
638
645
  exports.ellipx = ellipx["default"];
639
646
  exports.eterex = eterex["default"];
640
647
  exports.excoino = excoino["default"];
648
+ exports.exino = exino["default"];
641
649
  exports.exir = exir["default"];
642
650
  exports.exmo = exmo["default"];
643
651
  exports.exnovin = exnovin["default"];
@@ -699,6 +707,7 @@ exports.phemex = phemex["default"];
699
707
  exports.pingi = pingi["default"];
700
708
  exports.poloniex = poloniex["default"];
701
709
  exports.pooleno = pooleno["default"];
710
+ exports.poulyar = poulyar["default"];
702
711
  exports.probit = probit["default"];
703
712
  exports.raastin = raastin["default"];
704
713
  exports.ramzinex = ramzinex["default"];
@@ -0,0 +1,11 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var Exchange$1 = require('../base/Exchange.js');
6
+
7
+ // ----------------------------------------------------------------------------
8
+ class Exchange extends Exchange$1["default"] {
9
+ }
10
+
11
+ exports["default"] = Exchange;
@@ -0,0 +1,198 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var Exchange = require('./base/Exchange.js');
6
+
7
+ // ----------------------------------------------------------------------------
8
+ // ---------------------------------------------------------------------------
9
+ /**
10
+ * @class ariomex
11
+ * @augments Exchange
12
+ */
13
+ class ariomex extends Exchange["default"] {
14
+ describe() {
15
+ return this.deepExtend(super.describe(), {
16
+ 'id': 'ariomex',
17
+ 'name': 'Ariomex',
18
+ 'countries': ['IR'],
19
+ 'rateLimit': 1000,
20
+ 'version': 'v1',
21
+ 'certified': false,
22
+ 'pro': false,
23
+ 'has': {
24
+ 'CORS': undefined,
25
+ 'spot': true,
26
+ 'margin': false,
27
+ 'swap': false,
28
+ 'future': false,
29
+ 'option': false,
30
+ 'fetchMarkets': true,
31
+ 'fetchTicker': true,
32
+ 'fetchTickers': true,
33
+ 'fetchTime': true,
34
+ },
35
+ 'urls': {
36
+ 'api': {
37
+ 'public': 'https://api.ariomex.ir',
38
+ },
39
+ 'www': 'https://ariomex.ir',
40
+ 'doc': 'https://api.ariomex.ir/v1/public/markets_details',
41
+ },
42
+ 'api': {
43
+ 'public': {
44
+ 'get': {
45
+ 'v1/public/markets_details': 1,
46
+ },
47
+ },
48
+ },
49
+ });
50
+ }
51
+ async fetchMarkets(params = {}) {
52
+ /**
53
+ * @method
54
+ * @name ariomex#fetchMarkets
55
+ * @description retrieves data on all markets for ariomex
56
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
57
+ * @returns {object[]} an array of objects representing market data
58
+ */
59
+ const response = await this.publicGetV1PublicMarketsDetails(params);
60
+ const markets = this.safeList(response, 'result');
61
+ const result = [];
62
+ for (let i = 0; i < markets.length; i++) {
63
+ result.push(this.parseMarket(markets[i]));
64
+ }
65
+ return result;
66
+ }
67
+ parseMarket(market) {
68
+ // {
69
+ // 'symbol': 'btcusdt',
70
+ // 'base': 'btc',
71
+ // 'quote': 'usdt',
72
+ // 'spot_enabled': 'true',
73
+ // 'base_market_precision': '5',
74
+ // 'quote_market_precision': '2',
75
+ // 'base_coin_precision': '8',
76
+ // 'quote_coin_precision': '8',
77
+ // }
78
+ const id = this.safeString(market, 'symbol');
79
+ const baseId = this.safeString(market, 'base');
80
+ const quoteId = this.safeString(market, 'quote');
81
+ const base = this.safeCurrencyCode(baseId);
82
+ const quote = this.safeCurrencyCode(quoteId);
83
+ return {
84
+ 'id': id,
85
+ 'symbol': base + '/' + quote,
86
+ 'base': base,
87
+ 'quote': quote,
88
+ 'settle': undefined,
89
+ 'baseId': baseId,
90
+ 'quoteId': quoteId,
91
+ 'settleId': undefined,
92
+ 'type': 'spot',
93
+ 'spot': true,
94
+ 'margin': false,
95
+ 'swap': false,
96
+ 'future': false,
97
+ 'option': false,
98
+ 'active': this.safeBool(market, 'spot_enabled'),
99
+ 'contract': false,
100
+ 'linear': undefined,
101
+ 'inverse': undefined,
102
+ 'contractSize': undefined,
103
+ 'expiry': undefined,
104
+ 'expiryDatetime': undefined,
105
+ 'strike': undefined,
106
+ 'optionType': undefined,
107
+ 'precision': {
108
+ 'amount': this.safeNumber(market, 'base_market_precision'),
109
+ 'price': this.safeNumber(market, 'quote_market_precision'),
110
+ },
111
+ 'limits': {
112
+ 'leverage': { 'min': undefined, 'max': undefined },
113
+ 'amount': { 'min': undefined, 'max': undefined },
114
+ 'price': { 'min': undefined, 'max': undefined },
115
+ 'cost': { 'min': undefined, 'max': undefined },
116
+ },
117
+ 'created': this.safeInteger(market, 'time_listed'),
118
+ 'info': market,
119
+ };
120
+ }
121
+ async fetchTime(params = {}) {
122
+ const response = await this.publicGetV1PublicMarketsDetails(params);
123
+ return this.safeInteger(response, 'serverTime');
124
+ }
125
+ async fetchTicker(symbol, params = {}) {
126
+ /**
127
+ * @method
128
+ * @name ariomex#fetchTicker
129
+ * @description fetches a price ticker for a market
130
+ * @param {string} symbol unified symbol of the market to fetch the ticker for
131
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
132
+ * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
133
+ */
134
+ const tickers = await this.fetchTickers([symbol], params);
135
+ return tickers[symbol];
136
+ }
137
+ async fetchTickers(symbols = undefined, params = {}) {
138
+ /**
139
+ * @method
140
+ * @name ariomex#fetchTickers
141
+ * @description fetches price tickers for all markets
142
+ * @param {string[]|undefined} symbols unified symbols of the markets to fetch the tickers for
143
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
144
+ * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
145
+ */
146
+ await this.loadMarkets();
147
+ if (symbols !== undefined) {
148
+ symbols = this.marketSymbols(symbols);
149
+ }
150
+ const response = await this.publicGetV1PublicMarketsDetails(params);
151
+ const timestamp = this.safeInteger(response, 'serverTime');
152
+ const markets = this.safeList(response, 'result');
153
+ const result = {};
154
+ for (let i = 0; i < markets.length; i++) {
155
+ markets[i]['timestamp'] = timestamp;
156
+ const ticker = this.parseTicker(markets[i]);
157
+ result[ticker['symbol']] = ticker;
158
+ }
159
+ return this.filterByArrayTickers(result, 'symbol', symbols);
160
+ }
161
+ parseTicker(ticker, market = undefined) {
162
+ const marketId = this.safeString(ticker, 'symbol');
163
+ market = this.safeMarket(marketId, market);
164
+ return this.safeTicker({
165
+ 'symbol': market['symbol'],
166
+ 'timestamp': this.safeInteger(ticker, 'timestamp'),
167
+ 'datetime': undefined,
168
+ 'high': this.safeString(ticker, 'highest_price'),
169
+ 'low': this.safeString(ticker, 'lowest_price'),
170
+ 'bid': this.safeString(ticker, 'bid_price'),
171
+ 'bidVolume': undefined,
172
+ 'ask': this.safeString(ticker, 'ask_price'),
173
+ 'askVolume': undefined,
174
+ 'vwap': undefined,
175
+ 'open': undefined,
176
+ 'close': this.safeString(ticker, 'last_price'),
177
+ 'last': this.safeString(ticker, 'last_price'),
178
+ 'previousClose': undefined,
179
+ 'change': this.safeString(ticker, 'change_price'),
180
+ 'percentage': this.safeString(ticker, 'change_percentage'),
181
+ 'average': undefined,
182
+ 'baseVolume': this.safeString(ticker, 'volume'),
183
+ 'quoteVolume': undefined,
184
+ 'info': ticker,
185
+ }, market);
186
+ }
187
+ sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
188
+ let url = this.urls['api'][api] + '/' + this.implodeParams(path, params);
189
+ const query = this.omit(params, this.extractParams(path));
190
+ if (Object.keys(query).length) {
191
+ url += '?' + this.urlencode(query);
192
+ }
193
+ headers = { 'Accept': 'application/json' };
194
+ return { 'url': url, 'method': method, 'body': body, 'headers': headers };
195
+ }
196
+ }
197
+
198
+ exports["default"] = ariomex;
@@ -507,7 +507,7 @@ class arzplus extends arzplus$1["default"] {
507
507
  */
508
508
  await this.loadMarkets(false, { 'type': 'otc' });
509
509
  const market = this.market(symbol);
510
- const endTime = Date.now();
510
+ const endTime = this.milliseconds();
511
511
  const request = {
512
512
  'symbol': market['id'],
513
513
  'from': (endTime / 1000) - (24 * 60 * 60),
@@ -557,7 +557,7 @@ class arzplus extends arzplus$1["default"] {
557
557
  'symbol': market['id'],
558
558
  };
559
559
  const orderBook = await this.publicGetApiV1MarketDepth(request);
560
- const timestamp = Date.now();
560
+ const timestamp = this.milliseconds();
561
561
  return this.parseOrderBook(orderBook, symbol, timestamp, 'bids', 'asks', 'price', 'amount');
562
562
  }
563
563
  sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
@@ -359,7 +359,7 @@ class bitimen extends bitimen$1["default"] {
359
359
  */
360
360
  await this.loadMarkets();
361
361
  const market = this.market(symbol);
362
- const endTime = Date.now();
362
+ const endTime = this.milliseconds();
363
363
  const request = {
364
364
  'symbol': market['id'],
365
365
  'from': (endTime / 1000) - (24 * 60 * 60),
@@ -405,7 +405,7 @@ class bitimen extends bitimen$1["default"] {
405
405
  'symbol': market['id'],
406
406
  };
407
407
  const response = await this.publicGetApiOrderbookDepth(request);
408
- const timestamp = Date.now();
408
+ const timestamp = this.milliseconds();
409
409
  return this.parseOrderBook(response, symbol, timestamp, 'bids', 'asks');
410
410
  }
411
411
  sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
@@ -421,7 +421,7 @@ class bitir extends bitir$1["default"] {
421
421
  if (market['quote'] === 'IRT') {
422
422
  symbol = market['base'] + 'IRR';
423
423
  }
424
- const endTime = Date.now();
424
+ const endTime = this.milliseconds();
425
425
  const request = {
426
426
  'symbol': symbol,
427
427
  'from': (endTime / 1000) - (24 * 60 * 60),
@@ -499,7 +499,7 @@ class bitir extends bitir$1["default"] {
499
499
  orberbook['bids'].push([price, amount]);
500
500
  }
501
501
  }
502
- const timestamp = Date.now();
502
+ const timestamp = this.milliseconds();
503
503
  return this.parseOrderBook(orberbook, symbol, timestamp);
504
504
  }
505
505
  sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
@@ -408,7 +408,7 @@ class bitpin extends bitpin$1["default"] {
408
408
  */
409
409
  await this.loadMarkets();
410
410
  const market = this.market(symbol);
411
- const endTime = Date.now();
411
+ const endTime = this.milliseconds();
412
412
  const request = {
413
413
  'symbol': market['symbol'].replace('/', '_'),
414
414
  'from': (endTime / 1000) - (24 * 60 * 60),
@@ -468,7 +468,7 @@ class bitpin extends bitpin$1["default"] {
468
468
  askslist.push({ 'price': this.safeFloat(ask, 0), 'amount': this.safeFloat(ask, 1) });
469
469
  }
470
470
  const orderBook = { 'bid': bidlist, 'ask': askslist };
471
- const timestamp = Date.now();
471
+ const timestamp = this.milliseconds();
472
472
  return this.parseOrderBook(orderBook, symbol, timestamp, 'bid', 'ask', 'price', 'amount');
473
473
  }
474
474
  sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
@@ -478,7 +478,7 @@ class bitpin extends bitpin$1["default"] {
478
478
  url = this.urls['api']['OHLCV'] + '/' + path + '?' + this.urlencode(query);
479
479
  }
480
480
  if (path === 'v4/mth/orderbook/') {
481
- url = url + params['symbol'] + '/?limit=' + params['limit'];
481
+ url = url + params['symbol'] + '/?limit=' + this.numberToString(params['limit']);
482
482
  }
483
483
  headers = { 'Content-Type': 'application/json' };
484
484
  return { 'url': url, 'method': method, 'body': body, 'headers': headers };
@@ -344,7 +344,7 @@ class excoino extends excoino$1["default"] {
344
344
  */
345
345
  await this.loadMarkets();
346
346
  const market = this.market(symbol);
347
- const endTime = Date.now();
347
+ const endTime = this.milliseconds();
348
348
  const request = {
349
349
  'symbol': market['id'],
350
350
  'from': endTime - (24 * 60 * 60 * 1000),
@@ -410,7 +410,7 @@ class excoino extends excoino$1["default"] {
410
410
  orderBook['bids'] = bids;
411
411
  orderBook['asks'] = asks;
412
412
  }
413
- const timestamp = Date.now();
413
+ const timestamp = this.milliseconds();
414
414
  return this.parseOrderBook(orderBook, symbol, timestamp, 'bids', 'asks', 'price', 'amount');
415
415
  }
416
416
  sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
@@ -0,0 +1,215 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var exino$1 = require('./abstract/exino.js');
6
+
7
+ // ----------------------------------------------------------------------------
8
+ // ---------------------------------------------------------------------------
9
+ class exino extends exino$1["default"] {
10
+ describe() {
11
+ return this.deepExtend(super.describe(), {
12
+ 'id': 'exino',
13
+ 'name': 'Exino',
14
+ 'countries': ['IR'],
15
+ 'rateLimit': 1000,
16
+ 'version': '2',
17
+ 'certified': false,
18
+ 'pro': false,
19
+ 'has': {
20
+ 'CORS': undefined,
21
+ 'spot': false,
22
+ 'margin': false,
23
+ 'swap': false,
24
+ 'future': false,
25
+ 'option': false,
26
+ 'fetchMarkets': true,
27
+ 'fetchTicker': true,
28
+ 'fetchTickers': true,
29
+ 'otc': true,
30
+ },
31
+ 'urls': {
32
+ 'logo': 'https://exino.org/favicon.ico',
33
+ 'api': {
34
+ 'public': 'https://exino.org/api',
35
+ },
36
+ 'www': 'https://exino.org',
37
+ 'doc': [
38
+ 'https://exino.org/api/crypto/v2/public/market',
39
+ ],
40
+ },
41
+ 'api': {
42
+ 'public': {
43
+ 'post': {
44
+ 'crypto/v2/public/market': 1,
45
+ },
46
+ },
47
+ },
48
+ });
49
+ }
50
+ async fetchMarkets(params = {}) {
51
+ /**
52
+ * @method
53
+ * @name exino#fetchMarkets
54
+ * @description retrieves all OTC markets for exino
55
+ * @see https://exino.org/api/crypto/v2/public/market
56
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
57
+ * @returns {object[]} an array of market structures
58
+ */
59
+ const response = await this.publicPostCryptoV2PublicMarket(params);
60
+ const data = this.safeDict(response, 'data', {});
61
+ const coins = this.safeDict(data, 'coins', {});
62
+ const items = this.safeList(coins, 'items', []);
63
+ const result = [];
64
+ const quotes = ['IRT', 'USDT'];
65
+ for (let i = 0; i < items.length; i++) {
66
+ const base = this.safeString(items[i], 'sym');
67
+ if (base === undefined) {
68
+ continue;
69
+ }
70
+ for (let j = 0; j < quotes.length; j++) {
71
+ const quote = quotes[j];
72
+ if (base === quote) {
73
+ continue;
74
+ }
75
+ result.push(this.parseMarket({
76
+ 'base': base,
77
+ 'quote': quote,
78
+ 'info': items[i],
79
+ }));
80
+ }
81
+ }
82
+ return result;
83
+ }
84
+ parseMarket(market) {
85
+ const baseId = this.safeString(market, 'base');
86
+ const quoteId = this.safeString(market, 'quote');
87
+ const base = this.safeCurrencyCode(baseId);
88
+ const quote = this.safeCurrencyCode(quoteId);
89
+ return {
90
+ 'id': base + quote,
91
+ 'symbol': base + '/' + quote,
92
+ 'base': base,
93
+ 'quote': quote,
94
+ 'settle': undefined,
95
+ 'baseId': baseId,
96
+ 'quoteId': quoteId,
97
+ 'settleId': undefined,
98
+ 'type': 'otc',
99
+ 'spot': false,
100
+ 'margin': false,
101
+ 'swap': false,
102
+ 'future': false,
103
+ 'option': false,
104
+ 'active': true,
105
+ 'contract': false,
106
+ 'linear': undefined,
107
+ 'inverse': undefined,
108
+ 'contractSize': undefined,
109
+ 'expiry': undefined,
110
+ 'expiryDatetime': undefined,
111
+ 'strike': undefined,
112
+ 'optionType': undefined,
113
+ 'precision': {
114
+ 'amount': undefined,
115
+ 'price': undefined,
116
+ },
117
+ 'limits': {
118
+ 'leverage': { 'min': undefined, 'max': undefined },
119
+ 'amount': { 'min': undefined, 'max': undefined },
120
+ 'price': { 'min': undefined, 'max': undefined },
121
+ 'cost': { 'min': undefined, 'max': undefined },
122
+ },
123
+ 'created': undefined,
124
+ 'info': this.safeDict(market, 'info', market),
125
+ };
126
+ }
127
+ async fetchTickers(symbols = undefined, params = {}) {
128
+ /**
129
+ * @method
130
+ * @name exino#fetchTickers
131
+ * @description fetches OTC tickers for all exino assets
132
+ * @see https://exino.org/api/crypto/v2/public/market
133
+ * @param {string[]|undefined} symbols unified symbols of the markets to fetch
134
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
135
+ * @returns {object} a dictionary of ticker structures
136
+ */
137
+ await this.loadMarkets();
138
+ if (symbols !== undefined) {
139
+ symbols = this.marketSymbols(symbols);
140
+ }
141
+ const response = await this.publicPostCryptoV2PublicMarket(params);
142
+ const data = this.safeDict(response, 'data', {});
143
+ const coins = this.safeDict(data, 'coins', {});
144
+ const items = this.safeList(coins, 'items', []);
145
+ const result = {};
146
+ const quotes = ['IRT', 'USDT'];
147
+ for (let i = 0; i < items.length; i++) {
148
+ const base = this.safeString(items[i], 'sym');
149
+ if (base === undefined) {
150
+ continue;
151
+ }
152
+ for (let j = 0; j < quotes.length; j++) {
153
+ const quote = quotes[j];
154
+ if (base === quote) {
155
+ continue;
156
+ }
157
+ const market = this.market(base + '/' + quote);
158
+ const ticker = this.parseTicker(items[i], market);
159
+ result[ticker['symbol']] = ticker;
160
+ }
161
+ }
162
+ return this.filterByArrayTickers(result, 'symbol', symbols);
163
+ }
164
+ async fetchTicker(symbol, params = {}) {
165
+ const tickers = await this.fetchTickers([symbol], params);
166
+ return tickers[symbol];
167
+ }
168
+ parseTicker(ticker, market = undefined) {
169
+ const base = this.safeString(market, 'base');
170
+ const quote = this.safeString(market, 'quote');
171
+ const marketId = base + quote;
172
+ const symbol = this.safeSymbol(marketId, market, undefined, 'otc');
173
+ let last = this.safeFloat(ticker, 'priceUsd');
174
+ let bid = this.safeFloat(ticker, 'sellPriceUsd');
175
+ let ask = this.safeFloat(ticker, 'buyPriceUsd');
176
+ if (quote === 'IRT') {
177
+ last = this.safeFloat(ticker, 'priceToman');
178
+ bid = this.safeFloat(ticker, 'sellPriceToman');
179
+ ask = this.safeFloat(ticker, 'buyPriceToman');
180
+ }
181
+ const percentage = this.safeFloat(ticker, 'chg24h');
182
+ return this.safeTicker({
183
+ 'symbol': symbol,
184
+ 'timestamp': undefined,
185
+ 'datetime': undefined,
186
+ 'high': undefined,
187
+ 'low': undefined,
188
+ 'bid': bid,
189
+ 'bidVolume': undefined,
190
+ 'ask': ask,
191
+ 'askVolume': undefined,
192
+ 'vwap': undefined,
193
+ 'open': undefined,
194
+ 'close': last,
195
+ 'last': last,
196
+ 'previousClose': undefined,
197
+ 'change': undefined,
198
+ 'percentage': percentage,
199
+ 'average': undefined,
200
+ 'baseVolume': this.safeFloat(ticker, 'volume24h'),
201
+ 'quoteVolume': undefined,
202
+ 'info': ticker,
203
+ }, market);
204
+ }
205
+ sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
206
+ const url = this.urls['api'][api] + '/' + path;
207
+ if (method === 'POST') {
208
+ body = this.json(params);
209
+ headers = { 'Content-Type': 'application/json' };
210
+ }
211
+ return { 'url': url, 'method': method, 'body': body, 'headers': headers };
212
+ }
213
+ }
214
+
215
+ exports["default"] = exino;
@@ -328,7 +328,7 @@ class exir extends exir$1["default"] {
328
328
  */
329
329
  await this.loadMarkets();
330
330
  const market = this.market(symbol);
331
- const endTime = Date.now();
331
+ const endTime = this.milliseconds();
332
332
  const request = {
333
333
  'symbol': market['id'],
334
334
  'from': (endTime / 1000) - (24 * 60 * 60),
@@ -381,7 +381,7 @@ class exir extends exir$1["default"] {
381
381
  'symbol': market['id'],
382
382
  };
383
383
  const response = await this.publicGetV2Orderbook(request);
384
- const timestamp = this.safeTimestamp(response[market['id']], 'timestamp') / 1000;
384
+ const timestamp = this.safeTimestamp(response[market['id']], 'timestamp', 0) / 1000;
385
385
  return this.parseOrderBook(response[market['id']], symbol, timestamp);
386
386
  }
387
387
  sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
@@ -365,7 +365,7 @@ class exnovin extends exnovin$1["default"] {
365
365
  }
366
366
  }
367
367
  orderBook = { 'bids': bids, 'asks': asks };
368
- const timestamp = Date.now();
368
+ const timestamp = this.milliseconds();
369
369
  return this.parseOrderBook(orderBook, symbol, timestamp, 'bids', 'asks', 'price', 'amount');
370
370
  }
371
371
  sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
@@ -350,7 +350,7 @@ class hitobit extends hitobit$1["default"] {
350
350
  */
351
351
  await this.loadMarkets();
352
352
  const market = this.market(symbol);
353
- const endTime = Date.now();
353
+ const endTime = this.milliseconds();
354
354
  const request = {
355
355
  'symbol': market['id'],
356
356
  'from': this.iso8601((endTime) - (24 * 60 * 60)),
@@ -399,7 +399,7 @@ class hitobit extends hitobit$1["default"] {
399
399
  'limit': 30,
400
400
  };
401
401
  const orderBook = await this.publicGetHapiExchangeV1PublicDepth(request);
402
- const timestamp = Date.now();
402
+ const timestamp = this.milliseconds();
403
403
  return this.parseOrderBook(orderBook, symbol, timestamp, 'bids', 'asks');
404
404
  }
405
405
  sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {