ccxt-ir 4.9.13 → 4.9.15

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 (99) hide show
  1. package/README.md +4 -4
  2. package/dist/ccxt.browser.min.js +3 -3
  3. package/dist/cjs/ccxt.js +232 -229
  4. package/dist/cjs/package.json +1 -1
  5. package/dist/cjs/src/abantether.js +344 -344
  6. package/dist/cjs/src/abstract/bitbarg.js +1 -1
  7. package/dist/cjs/src/abstract/bitunix.js +1 -1
  8. package/dist/cjs/src/abstract/bydfi.js +1 -1
  9. package/dist/cjs/src/abstract/cafearz.js +1 -1
  10. package/dist/cjs/src/abstract/hamtapay.js +1 -1
  11. package/dist/cjs/src/abstract/kifpoolme.js +1 -1
  12. package/dist/cjs/src/abstract/mazdax.js +1 -1
  13. package/dist/cjs/src/abstract/pingi.js +1 -1
  14. package/dist/cjs/src/abstract/pooleno.js +1 -1
  15. package/dist/cjs/src/abstract/tehran_exchange.js +11 -0
  16. package/dist/cjs/src/afratether.js +347 -347
  17. package/dist/cjs/src/arzplus.js +572 -572
  18. package/dist/cjs/src/bitbarg.js +303 -303
  19. package/dist/cjs/src/bitunix.js +317 -317
  20. package/dist/cjs/src/bydfi.js +425 -425
  21. package/dist/cjs/src/cafearz.js +337 -337
  22. package/dist/cjs/src/hamtapay.js +291 -291
  23. package/dist/cjs/src/kcex.js +326 -326
  24. package/dist/cjs/src/kifpoolme.js +401 -401
  25. package/dist/cjs/src/mazdax.js +525 -526
  26. package/dist/cjs/src/pingi.js +437 -438
  27. package/dist/cjs/src/pooleno.js +338 -338
  28. package/dist/cjs/src/tehran_exchange.js +334 -0
  29. package/dist/cjs/src/tetherland.js +358 -358
  30. package/dist/cjs/src/twox.js +362 -362
  31. package/dist/cjs/src/xt.js +5171 -5171
  32. package/js/ccxt.d.ts +676 -673
  33. package/js/ccxt.js +493 -491
  34. package/js/src/abantether.js +347 -347
  35. package/js/src/abstract/abantether.d.ts +8 -8
  36. package/js/src/abstract/arzplus.d.ts +11 -11
  37. package/js/src/abstract/bitbarg.d.ts +8 -8
  38. package/js/src/abstract/bitbarg.js +5 -5
  39. package/js/src/abstract/bitunix.d.ts +9 -9
  40. package/js/src/abstract/bitunix.js +5 -5
  41. package/js/src/abstract/bydfi.d.ts +11 -11
  42. package/js/src/abstract/bydfi.js +5 -5
  43. package/js/src/abstract/cafearz.d.ts +8 -8
  44. package/js/src/abstract/cafearz.js +5 -5
  45. package/js/src/abstract/hamtapay.d.ts +9 -9
  46. package/js/src/abstract/hamtapay.js +5 -5
  47. package/js/src/abstract/kcex.d.ts +10 -10
  48. package/js/src/abstract/kifpoolme.d.ts +9 -9
  49. package/js/src/abstract/kifpoolme.js +5 -5
  50. package/js/src/abstract/mazdax.d.ts +11 -11
  51. package/js/src/abstract/mazdax.js +5 -5
  52. package/js/src/abstract/pingi.d.ts +9 -9
  53. package/js/src/abstract/pingi.js +5 -5
  54. package/js/src/abstract/pooleno.d.ts +8 -8
  55. package/js/src/abstract/pooleno.js +5 -5
  56. package/js/src/abstract/tehran_exchange.d.ts +9 -0
  57. package/js/src/abstract/tehran_exchange.js +11 -0
  58. package/js/src/afratether.js +350 -350
  59. package/js/src/arzplus.d.ts +26 -26
  60. package/js/src/arzplus.js +575 -575
  61. package/js/src/base/Exchange.d.ts +926 -926
  62. package/js/src/base/types.d.ts +586 -586
  63. package/js/src/bitbarg.d.ts +21 -21
  64. package/js/src/bitbarg.js +306 -306
  65. package/js/src/bitunix.d.ts +21 -21
  66. package/js/src/bitunix.js +320 -320
  67. package/js/src/bydfi.d.ts +23 -23
  68. package/js/src/bydfi.js +428 -428
  69. package/js/src/cafearz.d.ts +21 -21
  70. package/js/src/cafearz.js +340 -340
  71. package/js/src/coinbaseexchange.d.ts +334 -334
  72. package/js/src/hamtapay.d.ts +21 -21
  73. package/js/src/hamtapay.js +294 -294
  74. package/js/src/kcex.d.ts +21 -21
  75. package/js/src/kcex.js +329 -329
  76. package/js/src/kifpoolme.d.ts +23 -23
  77. package/js/src/kifpoolme.js +404 -404
  78. package/js/src/mazdax.d.ts +23 -23
  79. package/js/src/mazdax.js +528 -529
  80. package/js/src/pingi.d.ts +22 -22
  81. package/js/src/pingi.js +440 -441
  82. package/js/src/pooleno.d.ts +21 -21
  83. package/js/src/pooleno.js +341 -341
  84. package/js/src/protobuf/mexc/compiled.d.cts +2 -2
  85. package/js/src/static_dependencies/fflake/browser.d.ts +222 -222
  86. package/js/src/static_dependencies/jsencrypt/lib/asn1js/asn1.d.ts +51 -51
  87. package/js/src/static_dependencies/jsencrypt/lib/jsbn/jsbn.d.ts +101 -101
  88. package/js/src/static_dependencies/qs/formats.d.cts +8 -8
  89. package/js/src/static_dependencies/qs/index.d.cts +4 -4
  90. package/js/src/static_dependencies/qs/parse.d.cts +2 -2
  91. package/js/src/static_dependencies/qs/stringify.d.cts +2 -2
  92. package/js/src/static_dependencies/qs/utils.d.cts +9 -9
  93. package/js/src/static_dependencies/starknet/utils/calldata/parser/index.d.ts +5 -5
  94. package/js/src/tehran_exchange.d.ts +21 -0
  95. package/js/src/tehran_exchange.js +333 -0
  96. package/js/src/tetherland.js +361 -361
  97. package/js/src/twox.js +365 -365
  98. package/js/src/xt.js +5178 -5178
  99. package/package.json +1 -1
package/js/src/bitunix.js CHANGED
@@ -4,323 +4,323 @@
4
4
  // https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
5
5
  // EDIT THE CORRESPONDENT .ts FILE INSTEAD
6
6
 
7
- // ---------------------------------------------------------------------------
8
- import Exchange from './abstract/bitunix.js';
9
- // ---------------------------------------------------------------------------
10
- /**
11
- * @class bitunix
12
- * @augments Exchange
13
- * @description Set rateLimit to 1000 if fully verified
14
- */
15
- export default class bitunix extends Exchange {
16
- describe() {
17
- return this.deepExtend(super.describe(), {
18
- 'id': 'bitunix',
19
- 'name': 'bitunix',
20
- 'countries': ['IR'],
21
- 'rateLimit': 1000,
22
- 'version': '1',
23
- 'certified': false,
24
- 'pro': false,
25
- 'has': {
26
- 'CORS': undefined,
27
- 'spot': true,
28
- 'margin': false,
29
- 'swap': false,
30
- 'future': true,
31
- 'option': false,
32
- 'addMargin': false,
33
- 'cancelAllOrders': false,
34
- 'cancelOrder': false,
35
- 'cancelOrders': false,
36
- 'createDepositAddress': false,
37
- 'createOrder': false,
38
- 'createStopLimitOrder': false,
39
- 'createStopMarketOrder': false,
40
- 'createStopOrder': false,
41
- 'editOrder': false,
42
- 'fetchBalance': false,
43
- 'fetchBorrowInterest': false,
44
- 'fetchBorrowRateHistories': false,
45
- 'fetchBorrowRateHistory': false,
46
- 'fetchClosedOrders': false,
47
- 'fetchCrossBorrowRate': false,
48
- 'fetchCrossBorrowRates': false,
49
- 'fetchCurrencies': false,
50
- 'fetchDepositAddress': false,
51
- 'fetchDeposits': false,
52
- 'fetchFundingHistory': false,
53
- 'fetchFundingRate': false,
54
- 'fetchFundingRateHistory': false,
55
- 'fetchFundingRates': false,
56
- 'fetchIndexOHLCV': false,
57
- 'fetchIsolatedBorrowRate': false,
58
- 'fetchIsolatedBorrowRates': false,
59
- 'fetchL2OrderBook': false,
60
- 'fetchL3OrderBook': false,
61
- 'fetchLedger': false,
62
- 'fetchLedgerEntry': false,
63
- 'fetchLeverageTiers': false,
64
- 'fetchMarkets': true,
65
- 'fetchMarkOHLCV': false,
66
- 'fetchMyTrades': false,
67
- 'fetchOHLCV': true,
68
- 'fetchOpenInterestHistory': false,
69
- 'fetchOpenOrders': false,
70
- 'fetchOrder': false,
71
- 'fetchOrderBook': true,
72
- 'fetchOrders': false,
73
- 'fetchOrderTrades': 'emulated',
74
- 'fetchPositions': false,
75
- 'fetchPremiumIndexOHLCV': false,
76
- 'fetchTicker': true,
77
- 'fetchTickers': true,
78
- 'fetchTime': false,
79
- 'fetchTrades': false,
80
- 'fetchTradingFee': false,
81
- 'fetchTradingFees': false,
82
- 'fetchWithdrawals': false,
83
- 'setLeverage': false,
84
- 'setMarginMode': false,
85
- 'transfer': false,
86
- 'withdraw': false,
87
- },
88
- 'comment': 'This comment is optional',
89
- 'urls': {
90
- 'logo': 'https://cdn.arz.digital/cr-odin/img/exchanges/bitunix/64x64.png',
91
- 'api': {
92
- 'market': 'https://openapi.bitunix.com/',
93
- 'tickers': 'https://api.bitunix.com/',
94
- },
95
- 'www': 'https://www.bitunix.com/',
96
- 'doc': [
97
- 'https://openapidoc.bitunix.com/',
98
- ],
99
- },
100
- 'timeframes': {
101
- '1m': '1',
102
- '5m': '5',
103
- '15m': '15',
104
- '30m': '30',
105
- '1h': '60',
106
- '3h': '180',
107
- '4h': '240',
108
- '12h': '720',
109
- '1d': '1D',
110
- '1w': '1W',
111
- },
112
- 'api': {
113
- 'public': {
114
- 'get': {
115
- 'api/spot/v1/common/coin_pair/list/': 1,
116
- 'web/api/v1/common/tickers/': 1,
117
- },
118
- },
119
- },
120
- 'fees': {
121
- 'trading': {
122
- 'tierBased': false,
123
- 'percentage': true,
124
- 'maker': this.parseNumber('0.001'),
125
- 'taker': this.parseNumber('0.001'),
126
- },
127
- },
128
- });
129
- }
130
- async fetchMarkets(params = {}) {
131
- /**
132
- * @method
133
- * @name bitunix#fetchMarkets
134
- * @description retrieves data on all markets for bitunix
135
- * @see https://api-docs.bitunix.ir/#be8d9c51a2
136
- * @param {object} [params] extra parameters specific to the exchange API endpoint
137
- * @returns {object[]} an array of objects representing market data
138
- */
139
- const response = await this.publicGetApiSpotV1CommonCoinPairList(params);
140
- const markets = this.safeList(response, 'data');
141
- const result = [];
142
- for (let i = 0; i < markets.length; i++) {
143
- const market = this.parseMarket(markets[i]);
144
- result.push(market);
145
- }
146
- return result;
147
- }
148
- parseMarket(market) {
149
- // {
150
- // id: 1,
151
- // symbol: "btcusdt",
152
- // base: "BTC",
153
- // baseIcon: "https://img.bitunix.com/config/kv/228408.png",
154
- // quote: "USDT",
155
- // quoteIcon: "https://img.bitunix.com/config/coin/USDT.png",
156
- // basePrecision: 5,
157
- // quotePrecision: 2,
158
- // minPrice: "10.0000000000000000",
159
- // minVolume: "0.0000500000000000",
160
- // maxAmount: "500000.0000000000000000",
161
- // minAmount: "0.0000000000000000",
162
- // maxLimitOrderAmount: "1500000.0000000000000000",
163
- // maxMarketOrderAmount: "2000000.0000000000000000",
164
- // maxSlippage: "0.0500",
165
- // premiumFactor: "0.0500",
166
- // minBuyPriceOffset: "-0.8000",
167
- // maxSellPriceOffset: "50.0000",
168
- // isOpen: 1,
169
- // isHot: 1,
170
- // isRecommend: 1,
171
- // isShow: 1,
172
- // tradeArea: "USDT",
173
- // sort: 1,
174
- // openTime: null,
175
- // ctime: "2023-05-12T18:03:08Z",
176
- // precisions: [
177
- // "0.0100000000000000",
178
- // "0.1000000000000000",
179
- // "1.0000000000000000",
180
- // "10.0000000000000000",
181
- // "100.0000000000000000"
182
- // ]
183
- // }
184
- const baseId = this.safeString(market, 'base');
185
- const quoteId = this.safeString(market, 'quote');
186
- const base = this.safeCurrencyCode(baseId);
187
- const quote = this.safeCurrencyCode(quoteId);
188
- const id = (base + quote);
189
- return {
190
- 'id': id,
191
- 'symbol': base + '/' + quote,
192
- 'base': base,
193
- 'quote': quote,
194
- 'settle': undefined,
195
- 'baseId': baseId,
196
- 'quoteId': quoteId,
197
- 'settleId': undefined,
198
- 'type': 'spot',
199
- 'spot': true,
200
- 'margin': false,
201
- 'swap': false,
202
- 'future': false,
203
- 'option': false,
204
- 'active': true,
205
- 'contract': false,
206
- 'linear': undefined,
207
- 'inverse': undefined,
208
- 'contractSize': undefined,
209
- 'expiry': undefined,
210
- 'expiryDatetime': undefined,
211
- 'strike': undefined,
212
- 'optionType': undefined,
213
- 'precision': {
214
- 'amount': undefined,
215
- 'price': undefined,
216
- },
217
- 'limits': {
218
- 'leverage': {
219
- 'min': undefined,
220
- 'max': undefined,
221
- },
222
- 'amount': {
223
- 'min': undefined,
224
- 'max': undefined,
225
- },
226
- 'price': {
227
- 'min': undefined,
228
- 'max': undefined,
229
- },
230
- 'cost': {
231
- 'min': undefined,
232
- 'max': undefined,
233
- },
234
- },
235
- 'created': undefined,
236
- 'info': market,
237
- };
238
- }
239
- async fetchTickers(symbols = undefined, params = {}) {
240
- /**
241
- * @method
242
- * @name bitunix#fetchTickers
243
- * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
244
- * @see https://api-docs.bitunix.ir/#be8d9c51a2
245
- * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
246
- * @param {object} [params] extra parameters specific to the exchange API endpoint
247
- * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
248
- */
249
- await this.loadMarkets();
250
- if (symbols !== undefined) {
251
- symbols = this.marketSymbols(symbols);
252
- }
253
- const response = await this.publicGetWebApiV1CommonTickers();
254
- const markets = this.safeList(response, 'data');
255
- const result = {};
256
- for (let i = 0; i < markets.length; i++) {
257
- const ticker = this.parseTicker(markets[i]);
258
- const symbol = ticker['symbol'];
259
- result[symbol] = ticker;
260
- }
261
- return this.filterByArrayTickers(result, 'symbol', symbols);
262
- }
263
- async fetchTicker(symbol, params = {}) {
264
- /**
265
- * @method
266
- * @name bitunix#fetchTicker
267
- * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
268
- * @see https://api-docs.bitunix.ir/#be8d9c51a2
269
- * @param {string} symbol unified symbol of the market to fetch the ticker for
270
- * @param {object} [params] extra parameters specific to the exchange API endpoint
271
- * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
272
- */
273
- const ticker = await this.fetchTickers([symbol]);
274
- return ticker[symbol];
275
- }
276
- parseTicker(ticker, market = undefined) {
277
- // {
278
- // symbol: "BTCUSDT",
279
- // base: "BTC",
280
- // quote: "USDT",
281
- // close: "112832.34",
282
- // rose24h: "0.2276416293",
283
- // volume: "228310106.7861019"
284
- // },
285
- const marketType = 'spot';
286
- const marketId = this.safeString(ticker, 'symbol');
287
- const symbol = this.safeSymbol(marketId, market, undefined, marketType);
288
- const last = this.safeFloat(ticker, 'close', 0);
289
- const change = this.safeFloat(ticker, 'rose24h', 0);
290
- const quoteVolume = this.safeFloat(ticker, 'volume', 0);
291
- let baseVolume = 0;
292
- if (last !== 0) {
293
- baseVolume = quoteVolume / last;
294
- }
295
- return this.safeTicker({
296
- 'symbol': symbol,
297
- 'timestamp': undefined,
298
- 'datetime': undefined,
299
- 'high': undefined,
300
- 'low': undefined,
301
- 'bid': undefined,
302
- 'bidVolume': undefined,
303
- 'ask': undefined,
304
- 'askVolume': undefined,
305
- 'vwap': undefined,
306
- 'open': undefined,
307
- 'close': last,
308
- 'last': last,
309
- 'previousClose': undefined,
310
- 'change': change,
311
- 'percentage': change,
312
- 'average': undefined,
313
- 'baseVolume': baseVolume,
314
- 'quoteVolume': quoteVolume,
315
- 'info': ticker,
316
- }, market);
317
- }
318
- sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
319
- let url = this.urls['api']['market'] + '/' + path;
320
- if (path === 'web/api/v1/common/tickers/') {
321
- url = this.urls['api']['tickers'] + '/' + path;
322
- }
323
- headers = { 'Content-Type': 'application/json' };
324
- return { 'url': url, 'method': method, 'body': body, 'headers': headers };
325
- }
326
- }
7
+ // ---------------------------------------------------------------------------
8
+ import Exchange from './abstract/bitunix.js';
9
+ // ---------------------------------------------------------------------------
10
+ /**
11
+ * @class bitunix
12
+ * @augments Exchange
13
+ * @description Set rateLimit to 1000 if fully verified
14
+ */
15
+ export default class bitunix extends Exchange {
16
+ describe() {
17
+ return this.deepExtend(super.describe(), {
18
+ 'id': 'bitunix',
19
+ 'name': 'bitunix',
20
+ 'countries': ['IR'],
21
+ 'rateLimit': 1000,
22
+ 'version': '1',
23
+ 'certified': false,
24
+ 'pro': false,
25
+ 'has': {
26
+ 'CORS': undefined,
27
+ 'spot': true,
28
+ 'margin': false,
29
+ 'swap': false,
30
+ 'future': true,
31
+ 'option': false,
32
+ 'addMargin': false,
33
+ 'cancelAllOrders': false,
34
+ 'cancelOrder': false,
35
+ 'cancelOrders': false,
36
+ 'createDepositAddress': false,
37
+ 'createOrder': false,
38
+ 'createStopLimitOrder': false,
39
+ 'createStopMarketOrder': false,
40
+ 'createStopOrder': false,
41
+ 'editOrder': false,
42
+ 'fetchBalance': false,
43
+ 'fetchBorrowInterest': false,
44
+ 'fetchBorrowRateHistories': false,
45
+ 'fetchBorrowRateHistory': false,
46
+ 'fetchClosedOrders': false,
47
+ 'fetchCrossBorrowRate': false,
48
+ 'fetchCrossBorrowRates': false,
49
+ 'fetchCurrencies': false,
50
+ 'fetchDepositAddress': false,
51
+ 'fetchDeposits': false,
52
+ 'fetchFundingHistory': false,
53
+ 'fetchFundingRate': false,
54
+ 'fetchFundingRateHistory': false,
55
+ 'fetchFundingRates': false,
56
+ 'fetchIndexOHLCV': false,
57
+ 'fetchIsolatedBorrowRate': false,
58
+ 'fetchIsolatedBorrowRates': false,
59
+ 'fetchL2OrderBook': false,
60
+ 'fetchL3OrderBook': false,
61
+ 'fetchLedger': false,
62
+ 'fetchLedgerEntry': false,
63
+ 'fetchLeverageTiers': false,
64
+ 'fetchMarkets': true,
65
+ 'fetchMarkOHLCV': false,
66
+ 'fetchMyTrades': false,
67
+ 'fetchOHLCV': true,
68
+ 'fetchOpenInterestHistory': false,
69
+ 'fetchOpenOrders': false,
70
+ 'fetchOrder': false,
71
+ 'fetchOrderBook': true,
72
+ 'fetchOrders': false,
73
+ 'fetchOrderTrades': 'emulated',
74
+ 'fetchPositions': false,
75
+ 'fetchPremiumIndexOHLCV': false,
76
+ 'fetchTicker': true,
77
+ 'fetchTickers': true,
78
+ 'fetchTime': false,
79
+ 'fetchTrades': false,
80
+ 'fetchTradingFee': false,
81
+ 'fetchTradingFees': false,
82
+ 'fetchWithdrawals': false,
83
+ 'setLeverage': false,
84
+ 'setMarginMode': false,
85
+ 'transfer': false,
86
+ 'withdraw': false,
87
+ },
88
+ 'comment': 'This comment is optional',
89
+ 'urls': {
90
+ 'logo': 'https://cdn.arz.digital/cr-odin/img/exchanges/bitunix/64x64.png',
91
+ 'api': {
92
+ 'market': 'https://openapi.bitunix.com/',
93
+ 'tickers': 'https://api.bitunix.com/',
94
+ },
95
+ 'www': 'https://www.bitunix.com/',
96
+ 'doc': [
97
+ 'https://openapidoc.bitunix.com/',
98
+ ],
99
+ },
100
+ 'timeframes': {
101
+ '1m': '1',
102
+ '5m': '5',
103
+ '15m': '15',
104
+ '30m': '30',
105
+ '1h': '60',
106
+ '3h': '180',
107
+ '4h': '240',
108
+ '12h': '720',
109
+ '1d': '1D',
110
+ '1w': '1W',
111
+ },
112
+ 'api': {
113
+ 'public': {
114
+ 'get': {
115
+ 'api/spot/v1/common/coin_pair/list/': 1,
116
+ 'web/api/v1/common/tickers/': 1,
117
+ },
118
+ },
119
+ },
120
+ 'fees': {
121
+ 'trading': {
122
+ 'tierBased': false,
123
+ 'percentage': true,
124
+ 'maker': this.parseNumber('0.001'),
125
+ 'taker': this.parseNumber('0.001'),
126
+ },
127
+ },
128
+ });
129
+ }
130
+ async fetchMarkets(params = {}) {
131
+ /**
132
+ * @method
133
+ * @name bitunix#fetchMarkets
134
+ * @description retrieves data on all markets for bitunix
135
+ * @see https://api-docs.bitunix.ir/#be8d9c51a2
136
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
137
+ * @returns {object[]} an array of objects representing market data
138
+ */
139
+ const response = await this.publicGetApiSpotV1CommonCoinPairList(params);
140
+ const markets = this.safeList(response, 'data');
141
+ const result = [];
142
+ for (let i = 0; i < markets.length; i++) {
143
+ const market = this.parseMarket(markets[i]);
144
+ result.push(market);
145
+ }
146
+ return result;
147
+ }
148
+ parseMarket(market) {
149
+ // {
150
+ // id: 1,
151
+ // symbol: "btcusdt",
152
+ // base: "BTC",
153
+ // baseIcon: "https://img.bitunix.com/config/kv/228408.png",
154
+ // quote: "USDT",
155
+ // quoteIcon: "https://img.bitunix.com/config/coin/USDT.png",
156
+ // basePrecision: 5,
157
+ // quotePrecision: 2,
158
+ // minPrice: "10.0000000000000000",
159
+ // minVolume: "0.0000500000000000",
160
+ // maxAmount: "500000.0000000000000000",
161
+ // minAmount: "0.0000000000000000",
162
+ // maxLimitOrderAmount: "1500000.0000000000000000",
163
+ // maxMarketOrderAmount: "2000000.0000000000000000",
164
+ // maxSlippage: "0.0500",
165
+ // premiumFactor: "0.0500",
166
+ // minBuyPriceOffset: "-0.8000",
167
+ // maxSellPriceOffset: "50.0000",
168
+ // isOpen: 1,
169
+ // isHot: 1,
170
+ // isRecommend: 1,
171
+ // isShow: 1,
172
+ // tradeArea: "USDT",
173
+ // sort: 1,
174
+ // openTime: null,
175
+ // ctime: "2023-05-12T18:03:08Z",
176
+ // precisions: [
177
+ // "0.0100000000000000",
178
+ // "0.1000000000000000",
179
+ // "1.0000000000000000",
180
+ // "10.0000000000000000",
181
+ // "100.0000000000000000"
182
+ // ]
183
+ // }
184
+ const baseId = this.safeString(market, 'base');
185
+ const quoteId = this.safeString(market, 'quote');
186
+ const base = this.safeCurrencyCode(baseId);
187
+ const quote = this.safeCurrencyCode(quoteId);
188
+ const id = (base + quote);
189
+ return {
190
+ 'id': id,
191
+ 'symbol': base + '/' + quote,
192
+ 'base': base,
193
+ 'quote': quote,
194
+ 'settle': undefined,
195
+ 'baseId': baseId,
196
+ 'quoteId': quoteId,
197
+ 'settleId': undefined,
198
+ 'type': 'spot',
199
+ 'spot': true,
200
+ 'margin': false,
201
+ 'swap': false,
202
+ 'future': false,
203
+ 'option': false,
204
+ 'active': true,
205
+ 'contract': false,
206
+ 'linear': undefined,
207
+ 'inverse': undefined,
208
+ 'contractSize': undefined,
209
+ 'expiry': undefined,
210
+ 'expiryDatetime': undefined,
211
+ 'strike': undefined,
212
+ 'optionType': undefined,
213
+ 'precision': {
214
+ 'amount': undefined,
215
+ 'price': undefined,
216
+ },
217
+ 'limits': {
218
+ 'leverage': {
219
+ 'min': undefined,
220
+ 'max': undefined,
221
+ },
222
+ 'amount': {
223
+ 'min': undefined,
224
+ 'max': undefined,
225
+ },
226
+ 'price': {
227
+ 'min': undefined,
228
+ 'max': undefined,
229
+ },
230
+ 'cost': {
231
+ 'min': undefined,
232
+ 'max': undefined,
233
+ },
234
+ },
235
+ 'created': undefined,
236
+ 'info': market,
237
+ };
238
+ }
239
+ async fetchTickers(symbols = undefined, params = {}) {
240
+ /**
241
+ * @method
242
+ * @name bitunix#fetchTickers
243
+ * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
244
+ * @see https://api-docs.bitunix.ir/#be8d9c51a2
245
+ * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
246
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
247
+ * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
248
+ */
249
+ await this.loadMarkets();
250
+ if (symbols !== undefined) {
251
+ symbols = this.marketSymbols(symbols);
252
+ }
253
+ const response = await this.publicGetWebApiV1CommonTickers();
254
+ const markets = this.safeList(response, 'data');
255
+ const result = {};
256
+ for (let i = 0; i < markets.length; i++) {
257
+ const ticker = this.parseTicker(markets[i]);
258
+ const symbol = ticker['symbol'];
259
+ result[symbol] = ticker;
260
+ }
261
+ return this.filterByArrayTickers(result, 'symbol', symbols);
262
+ }
263
+ async fetchTicker(symbol, params = {}) {
264
+ /**
265
+ * @method
266
+ * @name bitunix#fetchTicker
267
+ * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
268
+ * @see https://api-docs.bitunix.ir/#be8d9c51a2
269
+ * @param {string} symbol unified symbol of the market to fetch the ticker for
270
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
271
+ * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
272
+ */
273
+ const ticker = await this.fetchTickers([symbol]);
274
+ return ticker[symbol];
275
+ }
276
+ parseTicker(ticker, market = undefined) {
277
+ // {
278
+ // symbol: "BTCUSDT",
279
+ // base: "BTC",
280
+ // quote: "USDT",
281
+ // close: "112832.34",
282
+ // rose24h: "0.2276416293",
283
+ // volume: "228310106.7861019"
284
+ // },
285
+ const marketType = 'spot';
286
+ const marketId = this.safeString(ticker, 'symbol');
287
+ const symbol = this.safeSymbol(marketId, market, undefined, marketType);
288
+ const last = this.safeFloat(ticker, 'close', 0);
289
+ const change = this.safeFloat(ticker, 'rose24h', 0);
290
+ const quoteVolume = this.safeFloat(ticker, 'volume', 0);
291
+ let baseVolume = 0;
292
+ if (last !== 0) {
293
+ baseVolume = quoteVolume / last;
294
+ }
295
+ return this.safeTicker({
296
+ 'symbol': symbol,
297
+ 'timestamp': undefined,
298
+ 'datetime': undefined,
299
+ 'high': undefined,
300
+ 'low': undefined,
301
+ 'bid': undefined,
302
+ 'bidVolume': undefined,
303
+ 'ask': undefined,
304
+ 'askVolume': undefined,
305
+ 'vwap': undefined,
306
+ 'open': undefined,
307
+ 'close': last,
308
+ 'last': last,
309
+ 'previousClose': undefined,
310
+ 'change': change,
311
+ 'percentage': change,
312
+ 'average': undefined,
313
+ 'baseVolume': baseVolume,
314
+ 'quoteVolume': quoteVolume,
315
+ 'info': ticker,
316
+ }, market);
317
+ }
318
+ sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
319
+ let url = this.urls['api']['market'] + '/' + path;
320
+ if (path === 'web/api/v1/common/tickers/') {
321
+ url = this.urls['api']['tickers'] + '/' + path;
322
+ }
323
+ headers = { 'Content-Type': 'application/json' };
324
+ return { 'url': url, 'method': method, 'body': body, 'headers': headers };
325
+ }
326
+ }