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