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
@@ -0,0 +1,11 @@
1
+ // ----------------------------------------------------------------------------
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
+ // EDIT THE CORRESPONDENT .ts FILE INSTEAD
6
+
7
+ // -------------------------------------------------------------------------------
8
+ import { Exchange as _Exchange } from '../base/Exchange.js';
9
+ class Exchange extends _Exchange {
10
+ }
11
+ export default Exchange;
@@ -0,0 +1,8 @@
1
+ import { implicitReturnType } from '../base/types.js';
2
+ import { Exchange as _Exchange } from '../base/Exchange.js';
3
+ interface Exchange {
4
+ publicGetApiV2MarketData(params?: {}): Promise<implicitReturnType>;
5
+ }
6
+ declare abstract class Exchange extends _Exchange {
7
+ }
8
+ export default Exchange;
@@ -0,0 +1,11 @@
1
+ // ----------------------------------------------------------------------------
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
+ // EDIT THE CORRESPONDENT .ts FILE INSTEAD
6
+
7
+ // -------------------------------------------------------------------------------
8
+ import { Exchange as _Exchange } from '../base/Exchange.js';
9
+ class Exchange extends _Exchange {
10
+ }
11
+ export default Exchange;
@@ -0,0 +1,21 @@
1
+ import Exchange from './base/Exchange.js';
2
+ import { Market, Strings, Ticker, Tickers } from './base/types.js';
3
+ /**
4
+ * @class ariomex
5
+ * @augments Exchange
6
+ */
7
+ export default class ariomex extends Exchange {
8
+ describe(): any;
9
+ fetchMarkets(params?: {}): Promise<Market[]>;
10
+ parseMarket(market: any): Market;
11
+ fetchTime(params?: {}): Promise<number>;
12
+ fetchTicker(symbol: string, params?: {}): Promise<Ticker>;
13
+ fetchTickers(symbols?: Strings, params?: {}): Promise<Tickers>;
14
+ parseTicker(ticker: any, market?: Market): Ticker;
15
+ sign(path: any, api?: string, method?: string, params?: {}, headers?: any, body?: any): {
16
+ url: string;
17
+ method: string;
18
+ body: any;
19
+ headers: any;
20
+ };
21
+ }
@@ -0,0 +1,197 @@
1
+ // ----------------------------------------------------------------------------
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
+ // EDIT THE CORRESPONDENT .ts FILE INSTEAD
6
+
7
+ // ---------------------------------------------------------------------------
8
+ import Exchange from './base/Exchange.js';
9
+ // ---------------------------------------------------------------------------
10
+ /**
11
+ * @class ariomex
12
+ * @augments Exchange
13
+ */
14
+ export default class ariomex extends Exchange {
15
+ describe() {
16
+ return this.deepExtend(super.describe(), {
17
+ 'id': 'ariomex',
18
+ 'name': 'Ariomex',
19
+ 'countries': ['IR'],
20
+ 'rateLimit': 1000,
21
+ 'version': 'v1',
22
+ 'certified': false,
23
+ 'pro': false,
24
+ 'has': {
25
+ 'CORS': undefined,
26
+ 'spot': true,
27
+ 'margin': false,
28
+ 'swap': false,
29
+ 'future': false,
30
+ 'option': false,
31
+ 'fetchMarkets': true,
32
+ 'fetchTicker': true,
33
+ 'fetchTickers': true,
34
+ 'fetchTime': true,
35
+ },
36
+ 'urls': {
37
+ 'api': {
38
+ 'public': 'https://api.ariomex.ir',
39
+ },
40
+ 'www': 'https://ariomex.ir',
41
+ 'doc': 'https://api.ariomex.ir/v1/public/markets_details',
42
+ },
43
+ 'api': {
44
+ 'public': {
45
+ 'get': {
46
+ 'v1/public/markets_details': 1,
47
+ },
48
+ },
49
+ },
50
+ });
51
+ }
52
+ async fetchMarkets(params = {}) {
53
+ /**
54
+ * @method
55
+ * @name ariomex#fetchMarkets
56
+ * @description retrieves data on all markets for ariomex
57
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
58
+ * @returns {object[]} an array of objects representing market data
59
+ */
60
+ const response = await this.publicGetV1PublicMarketsDetails(params);
61
+ const markets = this.safeList(response, 'result');
62
+ const result = [];
63
+ for (let i = 0; i < markets.length; i++) {
64
+ result.push(this.parseMarket(markets[i]));
65
+ }
66
+ return result;
67
+ }
68
+ parseMarket(market) {
69
+ // {
70
+ // 'symbol': 'btcusdt',
71
+ // 'base': 'btc',
72
+ // 'quote': 'usdt',
73
+ // 'spot_enabled': 'true',
74
+ // 'base_market_precision': '5',
75
+ // 'quote_market_precision': '2',
76
+ // 'base_coin_precision': '8',
77
+ // 'quote_coin_precision': '8',
78
+ // }
79
+ const id = this.safeString(market, 'symbol');
80
+ const baseId = this.safeString(market, 'base');
81
+ const quoteId = this.safeString(market, 'quote');
82
+ const base = this.safeCurrencyCode(baseId);
83
+ const quote = this.safeCurrencyCode(quoteId);
84
+ return {
85
+ 'id': id,
86
+ 'symbol': base + '/' + quote,
87
+ 'base': base,
88
+ 'quote': quote,
89
+ 'settle': undefined,
90
+ 'baseId': baseId,
91
+ 'quoteId': quoteId,
92
+ 'settleId': undefined,
93
+ 'type': 'spot',
94
+ 'spot': true,
95
+ 'margin': false,
96
+ 'swap': false,
97
+ 'future': false,
98
+ 'option': false,
99
+ 'active': this.safeBool(market, 'spot_enabled'),
100
+ 'contract': false,
101
+ 'linear': undefined,
102
+ 'inverse': undefined,
103
+ 'contractSize': undefined,
104
+ 'expiry': undefined,
105
+ 'expiryDatetime': undefined,
106
+ 'strike': undefined,
107
+ 'optionType': undefined,
108
+ 'precision': {
109
+ 'amount': this.safeNumber(market, 'base_market_precision'),
110
+ 'price': this.safeNumber(market, 'quote_market_precision'),
111
+ },
112
+ 'limits': {
113
+ 'leverage': { 'min': undefined, 'max': undefined },
114
+ 'amount': { 'min': undefined, 'max': undefined },
115
+ 'price': { 'min': undefined, 'max': undefined },
116
+ 'cost': { 'min': undefined, 'max': undefined },
117
+ },
118
+ 'created': this.safeInteger(market, 'time_listed'),
119
+ 'info': market,
120
+ };
121
+ }
122
+ async fetchTime(params = {}) {
123
+ const response = await this.publicGetV1PublicMarketsDetails(params);
124
+ return this.safeInteger(response, 'serverTime');
125
+ }
126
+ async fetchTicker(symbol, params = {}) {
127
+ /**
128
+ * @method
129
+ * @name ariomex#fetchTicker
130
+ * @description fetches a price ticker for a market
131
+ * @param {string} symbol unified symbol of the market to fetch the ticker for
132
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
133
+ * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
134
+ */
135
+ const tickers = await this.fetchTickers([symbol], params);
136
+ return tickers[symbol];
137
+ }
138
+ async fetchTickers(symbols = undefined, params = {}) {
139
+ /**
140
+ * @method
141
+ * @name ariomex#fetchTickers
142
+ * @description fetches price tickers for all markets
143
+ * @param {string[]|undefined} symbols unified symbols of the markets to fetch the tickers for
144
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
145
+ * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
146
+ */
147
+ await this.loadMarkets();
148
+ if (symbols !== undefined) {
149
+ symbols = this.marketSymbols(symbols);
150
+ }
151
+ const response = await this.publicGetV1PublicMarketsDetails(params);
152
+ const timestamp = this.safeInteger(response, 'serverTime');
153
+ const markets = this.safeList(response, 'result');
154
+ const result = {};
155
+ for (let i = 0; i < markets.length; i++) {
156
+ markets[i]['timestamp'] = timestamp;
157
+ const ticker = this.parseTicker(markets[i]);
158
+ result[ticker['symbol']] = ticker;
159
+ }
160
+ return this.filterByArrayTickers(result, 'symbol', symbols);
161
+ }
162
+ parseTicker(ticker, market = undefined) {
163
+ const marketId = this.safeString(ticker, 'symbol');
164
+ market = this.safeMarket(marketId, market);
165
+ return this.safeTicker({
166
+ 'symbol': market['symbol'],
167
+ 'timestamp': this.safeInteger(ticker, 'timestamp'),
168
+ 'datetime': undefined,
169
+ 'high': this.safeString(ticker, 'highest_price'),
170
+ 'low': this.safeString(ticker, 'lowest_price'),
171
+ 'bid': this.safeString(ticker, 'bid_price'),
172
+ 'bidVolume': undefined,
173
+ 'ask': this.safeString(ticker, 'ask_price'),
174
+ 'askVolume': undefined,
175
+ 'vwap': undefined,
176
+ 'open': undefined,
177
+ 'close': this.safeString(ticker, 'last_price'),
178
+ 'last': this.safeString(ticker, 'last_price'),
179
+ 'previousClose': undefined,
180
+ 'change': this.safeString(ticker, 'change_price'),
181
+ 'percentage': this.safeString(ticker, 'change_percentage'),
182
+ 'average': undefined,
183
+ 'baseVolume': this.safeString(ticker, 'volume'),
184
+ 'quoteVolume': undefined,
185
+ 'info': ticker,
186
+ }, market);
187
+ }
188
+ sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
189
+ let url = this.urls['api'][api] + '/' + this.implodeParams(path, params);
190
+ const query = this.omit(params, this.extractParams(path));
191
+ if (Object.keys(query).length) {
192
+ url += '?' + this.urlencode(query);
193
+ }
194
+ headers = { 'Accept': 'application/json' };
195
+ return { 'url': url, 'method': method, 'body': body, 'headers': headers };
196
+ }
197
+ }
package/js/src/arzplus.js CHANGED
@@ -508,7 +508,7 @@ export default class arzplus extends Exchange {
508
508
  */
509
509
  await this.loadMarkets(false, { 'type': 'otc' });
510
510
  const market = this.market(symbol);
511
- const endTime = Date.now();
511
+ const endTime = this.milliseconds();
512
512
  const request = {
513
513
  'symbol': market['id'],
514
514
  'from': (endTime / 1000) - (24 * 60 * 60),
@@ -558,7 +558,7 @@ export default class arzplus extends Exchange {
558
558
  'symbol': market['id'],
559
559
  };
560
560
  const orderBook = await this.publicGetApiV1MarketDepth(request);
561
- const timestamp = Date.now();
561
+ const timestamp = this.milliseconds();
562
562
  return this.parseOrderBook(orderBook, symbol, timestamp, 'bids', 'asks', 'price', 'amount');
563
563
  }
564
564
  sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
@@ -252,7 +252,7 @@ export default class Exchange {
252
252
  outputLen: number;
253
253
  blockLen: number;
254
254
  create(): import("../static_dependencies/noble-hashes/utils.js").Hash<import("../static_dependencies/noble-hashes/utils.js").Hash<any>>;
255
- }, digest?: "binary" | "hex" | "base64") => any;
255
+ }, digest?: "hex" | "base64" | "binary") => any;
256
256
  arrayConcat: (a: any[], b: any[]) => any[];
257
257
  encode: (str: string) => Uint8Array;
258
258
  urlencode: (object: object, sort?: boolean) => string;
@@ -261,7 +261,7 @@ export default class Exchange {
261
261
  outputLen: number;
262
262
  blockLen: number;
263
263
  create(): import("../static_dependencies/noble-hashes/utils.js").Hash<import("../static_dependencies/noble-hashes/utils.js").Hash<any>>;
264
- }, digest?: "binary" | "hex" | "base64") => any;
264
+ }, digest?: "hex" | "base64" | "binary") => any;
265
265
  numberToString: typeof functions.numberToString;
266
266
  parseTimeframe: (timeframe: string) => number;
267
267
  safeInteger2: (o: any, k1: IndexType, k2: IndexType, $default?: number) => number;
package/js/src/bitimen.js CHANGED
@@ -360,7 +360,7 @@ export default class bitimen extends Exchange {
360
360
  */
361
361
  await this.loadMarkets();
362
362
  const market = this.market(symbol);
363
- const endTime = Date.now();
363
+ const endTime = this.milliseconds();
364
364
  const request = {
365
365
  'symbol': market['id'],
366
366
  'from': (endTime / 1000) - (24 * 60 * 60),
@@ -406,7 +406,7 @@ export default class bitimen extends Exchange {
406
406
  'symbol': market['id'],
407
407
  };
408
408
  const response = await this.publicGetApiOrderbookDepth(request);
409
- const timestamp = Date.now();
409
+ const timestamp = this.milliseconds();
410
410
  return this.parseOrderBook(response, symbol, timestamp, 'bids', 'asks');
411
411
  }
412
412
  sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
package/js/src/bitir.js CHANGED
@@ -422,7 +422,7 @@ export default class bitir extends Exchange {
422
422
  if (market['quote'] === 'IRT') {
423
423
  symbol = market['base'] + 'IRR';
424
424
  }
425
- const endTime = Date.now();
425
+ const endTime = this.milliseconds();
426
426
  const request = {
427
427
  'symbol': symbol,
428
428
  'from': (endTime / 1000) - (24 * 60 * 60),
@@ -500,7 +500,7 @@ export default class bitir extends Exchange {
500
500
  orberbook['bids'].push([price, amount]);
501
501
  }
502
502
  }
503
- const timestamp = Date.now();
503
+ const timestamp = this.milliseconds();
504
504
  return this.parseOrderBook(orberbook, symbol, timestamp);
505
505
  }
506
506
  sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
package/js/src/bitpin.js CHANGED
@@ -409,7 +409,7 @@ export default class bitpin extends Exchange {
409
409
  */
410
410
  await this.loadMarkets();
411
411
  const market = this.market(symbol);
412
- const endTime = Date.now();
412
+ const endTime = this.milliseconds();
413
413
  const request = {
414
414
  'symbol': market['symbol'].replace('/', '_'),
415
415
  'from': (endTime / 1000) - (24 * 60 * 60),
@@ -469,7 +469,7 @@ export default class bitpin extends Exchange {
469
469
  askslist.push({ 'price': this.safeFloat(ask, 0), 'amount': this.safeFloat(ask, 1) });
470
470
  }
471
471
  const orderBook = { 'bid': bidlist, 'ask': askslist };
472
- const timestamp = Date.now();
472
+ const timestamp = this.milliseconds();
473
473
  return this.parseOrderBook(orderBook, symbol, timestamp, 'bid', 'ask', 'price', 'amount');
474
474
  }
475
475
  sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
@@ -479,7 +479,7 @@ export default class bitpin extends Exchange {
479
479
  url = this.urls['api']['OHLCV'] + '/' + path + '?' + this.urlencode(query);
480
480
  }
481
481
  if (path === 'v4/mth/orderbook/') {
482
- url = url + params['symbol'] + '/?limit=' + params['limit'];
482
+ url = url + params['symbol'] + '/?limit=' + this.numberToString(params['limit']);
483
483
  }
484
484
  headers = { 'Content-Type': 'application/json' };
485
485
  return { 'url': url, 'method': method, 'body': body, 'headers': headers };
@@ -311,7 +311,7 @@ export default class coinbaseexchange extends Exchange {
311
311
  * @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
312
312
  */
313
313
  fetchWithdrawals(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
314
- parseTransactionStatus(transaction: any): "pending" | "ok" | "failed" | "canceled";
314
+ parseTransactionStatus(transaction: any): "canceled" | "pending" | "ok" | "failed";
315
315
  parseTransaction(transaction: Dict, currency?: Currency): Transaction;
316
316
  /**
317
317
  * @method
package/js/src/excoino.js CHANGED
@@ -345,7 +345,7 @@ export default class excoino extends Exchange {
345
345
  */
346
346
  await this.loadMarkets();
347
347
  const market = this.market(symbol);
348
- const endTime = Date.now();
348
+ const endTime = this.milliseconds();
349
349
  const request = {
350
350
  'symbol': market['id'],
351
351
  'from': endTime - (24 * 60 * 60 * 1000),
@@ -411,7 +411,7 @@ export default class excoino extends Exchange {
411
411
  orderBook['bids'] = bids;
412
412
  orderBook['asks'] = asks;
413
413
  }
414
- const timestamp = Date.now();
414
+ const timestamp = this.milliseconds();
415
415
  return this.parseOrderBook(orderBook, symbol, timestamp, 'bids', 'asks', 'price', 'amount');
416
416
  }
417
417
  sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
@@ -0,0 +1,16 @@
1
+ import Exchange from './abstract/exino.js';
2
+ import { Market, Strings, Ticker, Tickers } from './base/types.js';
3
+ export default class exino extends Exchange {
4
+ describe(): any;
5
+ fetchMarkets(params?: {}): Promise<Market[]>;
6
+ parseMarket(market: any): Market;
7
+ fetchTickers(symbols?: Strings, params?: {}): Promise<Tickers>;
8
+ fetchTicker(symbol: string, params?: {}): Promise<Ticker>;
9
+ parseTicker(ticker: any, market?: Market): Ticker;
10
+ sign(path: any, api?: string, method?: string, params?: {}, headers?: any, body?: any): {
11
+ url: string;
12
+ method: string;
13
+ body: any;
14
+ headers: any;
15
+ };
16
+ }
@@ -0,0 +1,214 @@
1
+ // ----------------------------------------------------------------------------
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
+ // EDIT THE CORRESPONDENT .ts FILE INSTEAD
6
+
7
+ // ---------------------------------------------------------------------------
8
+ import Exchange from './abstract/exino.js';
9
+ // ---------------------------------------------------------------------------
10
+ export default class exino extends Exchange {
11
+ describe() {
12
+ return this.deepExtend(super.describe(), {
13
+ 'id': 'exino',
14
+ 'name': 'Exino',
15
+ 'countries': ['IR'],
16
+ 'rateLimit': 1000,
17
+ 'version': '2',
18
+ 'certified': false,
19
+ 'pro': false,
20
+ 'has': {
21
+ 'CORS': undefined,
22
+ 'spot': false,
23
+ 'margin': false,
24
+ 'swap': false,
25
+ 'future': false,
26
+ 'option': false,
27
+ 'fetchMarkets': true,
28
+ 'fetchTicker': true,
29
+ 'fetchTickers': true,
30
+ 'otc': true,
31
+ },
32
+ 'urls': {
33
+ 'logo': 'https://exino.org/favicon.ico',
34
+ 'api': {
35
+ 'public': 'https://exino.org/api',
36
+ },
37
+ 'www': 'https://exino.org',
38
+ 'doc': [
39
+ 'https://exino.org/api/crypto/v2/public/market',
40
+ ],
41
+ },
42
+ 'api': {
43
+ 'public': {
44
+ 'post': {
45
+ 'crypto/v2/public/market': 1,
46
+ },
47
+ },
48
+ },
49
+ });
50
+ }
51
+ async fetchMarkets(params = {}) {
52
+ /**
53
+ * @method
54
+ * @name exino#fetchMarkets
55
+ * @description retrieves all OTC markets for exino
56
+ * @see https://exino.org/api/crypto/v2/public/market
57
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
58
+ * @returns {object[]} an array of market structures
59
+ */
60
+ const response = await this.publicPostCryptoV2PublicMarket(params);
61
+ const data = this.safeDict(response, 'data', {});
62
+ const coins = this.safeDict(data, 'coins', {});
63
+ const items = this.safeList(coins, 'items', []);
64
+ const result = [];
65
+ const quotes = ['IRT', 'USDT'];
66
+ for (let i = 0; i < items.length; i++) {
67
+ const base = this.safeString(items[i], 'sym');
68
+ if (base === undefined) {
69
+ continue;
70
+ }
71
+ for (let j = 0; j < quotes.length; j++) {
72
+ const quote = quotes[j];
73
+ if (base === quote) {
74
+ continue;
75
+ }
76
+ result.push(this.parseMarket({
77
+ 'base': base,
78
+ 'quote': quote,
79
+ 'info': items[i],
80
+ }));
81
+ }
82
+ }
83
+ return result;
84
+ }
85
+ parseMarket(market) {
86
+ const baseId = this.safeString(market, 'base');
87
+ const quoteId = this.safeString(market, 'quote');
88
+ const base = this.safeCurrencyCode(baseId);
89
+ const quote = this.safeCurrencyCode(quoteId);
90
+ return {
91
+ 'id': base + quote,
92
+ 'symbol': base + '/' + quote,
93
+ 'base': base,
94
+ 'quote': quote,
95
+ 'settle': undefined,
96
+ 'baseId': baseId,
97
+ 'quoteId': quoteId,
98
+ 'settleId': undefined,
99
+ 'type': 'otc',
100
+ 'spot': false,
101
+ 'margin': false,
102
+ 'swap': false,
103
+ 'future': false,
104
+ 'option': false,
105
+ 'active': true,
106
+ 'contract': false,
107
+ 'linear': undefined,
108
+ 'inverse': undefined,
109
+ 'contractSize': undefined,
110
+ 'expiry': undefined,
111
+ 'expiryDatetime': undefined,
112
+ 'strike': undefined,
113
+ 'optionType': undefined,
114
+ 'precision': {
115
+ 'amount': undefined,
116
+ 'price': undefined,
117
+ },
118
+ 'limits': {
119
+ 'leverage': { 'min': undefined, 'max': undefined },
120
+ 'amount': { 'min': undefined, 'max': undefined },
121
+ 'price': { 'min': undefined, 'max': undefined },
122
+ 'cost': { 'min': undefined, 'max': undefined },
123
+ },
124
+ 'created': undefined,
125
+ 'info': this.safeDict(market, 'info', market),
126
+ };
127
+ }
128
+ async fetchTickers(symbols = undefined, params = {}) {
129
+ /**
130
+ * @method
131
+ * @name exino#fetchTickers
132
+ * @description fetches OTC tickers for all exino assets
133
+ * @see https://exino.org/api/crypto/v2/public/market
134
+ * @param {string[]|undefined} symbols unified symbols of the markets to fetch
135
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
136
+ * @returns {object} a dictionary of ticker structures
137
+ */
138
+ await this.loadMarkets();
139
+ if (symbols !== undefined) {
140
+ symbols = this.marketSymbols(symbols);
141
+ }
142
+ const response = await this.publicPostCryptoV2PublicMarket(params);
143
+ const data = this.safeDict(response, 'data', {});
144
+ const coins = this.safeDict(data, 'coins', {});
145
+ const items = this.safeList(coins, 'items', []);
146
+ const result = {};
147
+ const quotes = ['IRT', 'USDT'];
148
+ for (let i = 0; i < items.length; i++) {
149
+ const base = this.safeString(items[i], 'sym');
150
+ if (base === undefined) {
151
+ continue;
152
+ }
153
+ for (let j = 0; j < quotes.length; j++) {
154
+ const quote = quotes[j];
155
+ if (base === quote) {
156
+ continue;
157
+ }
158
+ const market = this.market(base + '/' + quote);
159
+ const ticker = this.parseTicker(items[i], market);
160
+ result[ticker['symbol']] = ticker;
161
+ }
162
+ }
163
+ return this.filterByArrayTickers(result, 'symbol', symbols);
164
+ }
165
+ async fetchTicker(symbol, params = {}) {
166
+ const tickers = await this.fetchTickers([symbol], params);
167
+ return tickers[symbol];
168
+ }
169
+ parseTicker(ticker, market = undefined) {
170
+ const base = this.safeString(market, 'base');
171
+ const quote = this.safeString(market, 'quote');
172
+ const marketId = base + quote;
173
+ const symbol = this.safeSymbol(marketId, market, undefined, 'otc');
174
+ let last = this.safeFloat(ticker, 'priceUsd');
175
+ let bid = this.safeFloat(ticker, 'sellPriceUsd');
176
+ let ask = this.safeFloat(ticker, 'buyPriceUsd');
177
+ if (quote === 'IRT') {
178
+ last = this.safeFloat(ticker, 'priceToman');
179
+ bid = this.safeFloat(ticker, 'sellPriceToman');
180
+ ask = this.safeFloat(ticker, 'buyPriceToman');
181
+ }
182
+ const percentage = this.safeFloat(ticker, 'chg24h');
183
+ return this.safeTicker({
184
+ 'symbol': symbol,
185
+ 'timestamp': undefined,
186
+ 'datetime': undefined,
187
+ 'high': undefined,
188
+ 'low': undefined,
189
+ 'bid': bid,
190
+ 'bidVolume': undefined,
191
+ 'ask': ask,
192
+ 'askVolume': undefined,
193
+ 'vwap': undefined,
194
+ 'open': undefined,
195
+ 'close': last,
196
+ 'last': last,
197
+ 'previousClose': undefined,
198
+ 'change': undefined,
199
+ 'percentage': percentage,
200
+ 'average': undefined,
201
+ 'baseVolume': this.safeFloat(ticker, 'volume24h'),
202
+ 'quoteVolume': undefined,
203
+ 'info': ticker,
204
+ }, market);
205
+ }
206
+ sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
207
+ const url = this.urls['api'][api] + '/' + path;
208
+ if (method === 'POST') {
209
+ body = this.json(params);
210
+ headers = { 'Content-Type': 'application/json' };
211
+ }
212
+ return { 'url': url, 'method': method, 'body': body, 'headers': headers };
213
+ }
214
+ }
package/js/src/exir.js CHANGED
@@ -329,7 +329,7 @@ export default class exir extends Exchange {
329
329
  */
330
330
  await this.loadMarkets();
331
331
  const market = this.market(symbol);
332
- const endTime = Date.now();
332
+ const endTime = this.milliseconds();
333
333
  const request = {
334
334
  'symbol': market['id'],
335
335
  'from': (endTime / 1000) - (24 * 60 * 60),
@@ -382,7 +382,7 @@ export default class exir extends Exchange {
382
382
  'symbol': market['id'],
383
383
  };
384
384
  const response = await this.publicGetV2Orderbook(request);
385
- const timestamp = this.safeTimestamp(response[market['id']], 'timestamp') / 1000;
385
+ const timestamp = this.safeTimestamp(response[market['id']], 'timestamp', 0) / 1000;
386
386
  return this.parseOrderBook(response[market['id']], symbol, timestamp);
387
387
  }
388
388
  sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
package/js/src/exnovin.js CHANGED
@@ -366,7 +366,7 @@ export default class exnovin extends Exchange {
366
366
  }
367
367
  }
368
368
  orderBook = { 'bids': bids, 'asks': asks };
369
- const timestamp = Date.now();
369
+ const timestamp = this.milliseconds();
370
370
  return this.parseOrderBook(orderBook, symbol, timestamp, 'bids', 'asks', 'price', 'amount');
371
371
  }
372
372
  sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
package/js/src/hitobit.js CHANGED
@@ -351,7 +351,7 @@ export default class hitobit extends Exchange {
351
351
  */
352
352
  await this.loadMarkets();
353
353
  const market = this.market(symbol);
354
- const endTime = Date.now();
354
+ const endTime = this.milliseconds();
355
355
  const request = {
356
356
  'symbol': market['id'],
357
357
  'from': this.iso8601((endTime) - (24 * 60 * 60)),
@@ -400,7 +400,7 @@ export default class hitobit extends Exchange {
400
400
  'limit': 30,
401
401
  };
402
402
  const orderBook = await this.publicGetHapiExchangeV1PublicDepth(request);
403
- const timestamp = Date.now();
403
+ const timestamp = this.milliseconds();
404
404
  return this.parseOrderBook(orderBook, symbol, timestamp, 'bids', 'asks');
405
405
  }
406
406
  sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {