ccxt-ir 4.9.25 → 4.9.27

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 (107) hide show
  1. package/README.md +4 -4
  2. package/dist/ccxt.browser.min.js +2 -2
  3. package/dist/cjs/ccxt.js +1 -1
  4. package/dist/cjs/src/abantether.js +344 -344
  5. package/dist/cjs/src/abstract/bitbarg.js +1 -1
  6. package/dist/cjs/src/abstract/bydfi.js +1 -1
  7. package/dist/cjs/src/abstract/cafearz.js +1 -1
  8. package/dist/cjs/src/abstract/hamtapay.js +1 -1
  9. package/dist/cjs/src/abstract/iranexchange.js +1 -1
  10. package/dist/cjs/src/abstract/kifpoolme.js +1 -1
  11. package/dist/cjs/src/abstract/mazdax.js +1 -1
  12. package/dist/cjs/src/abstract/pingi.js +1 -1
  13. package/dist/cjs/src/abstract/pooleno.js +1 -1
  14. package/dist/cjs/src/abstract/tehran_exchange.js +1 -1
  15. package/dist/cjs/src/afratether.js +347 -347
  16. package/dist/cjs/src/arzplus.js +572 -572
  17. package/dist/cjs/src/bit24.js +380 -379
  18. package/dist/cjs/src/bitbarg.js +303 -303
  19. package/dist/cjs/src/bitpin.js +478 -469
  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 +294 -294
  23. package/dist/cjs/src/iranexchange.js +390 -390
  24. package/dist/cjs/src/kcex.js +326 -326
  25. package/dist/cjs/src/kifpoolme.js +401 -401
  26. package/dist/cjs/src/mazdax.js +525 -525
  27. package/dist/cjs/src/ompfinex.js +501 -501
  28. package/dist/cjs/src/pingi.js +437 -437
  29. package/dist/cjs/src/pooleno.js +338 -338
  30. package/dist/cjs/src/sarmayex.js +367 -367
  31. package/dist/cjs/src/tehran_exchange.js +324 -324
  32. package/dist/cjs/src/tetherland.js +358 -358
  33. package/dist/cjs/src/toobit.js +436 -436
  34. package/dist/cjs/src/twox.js +362 -362
  35. package/js/ccxt.d.ts +1 -1
  36. package/js/ccxt.js +1 -1
  37. package/js/src/abantether.js +347 -347
  38. package/js/src/abstract/abantether.d.ts +8 -8
  39. package/js/src/abstract/arzplus.d.ts +11 -11
  40. package/js/src/abstract/bitbarg.d.ts +8 -8
  41. package/js/src/abstract/bitbarg.js +5 -5
  42. package/js/src/abstract/bitpin.d.ts +11 -10
  43. package/js/src/abstract/bydfi.d.ts +11 -11
  44. package/js/src/abstract/bydfi.js +5 -5
  45. package/js/src/abstract/cafearz.d.ts +8 -8
  46. package/js/src/abstract/cafearz.js +5 -5
  47. package/js/src/abstract/hamtapay.d.ts +9 -9
  48. package/js/src/abstract/hamtapay.js +5 -5
  49. package/js/src/abstract/iranexchange.d.ts +9 -9
  50. package/js/src/abstract/iranexchange.js +5 -5
  51. package/js/src/abstract/kifpoolme.d.ts +9 -9
  52. package/js/src/abstract/kifpoolme.js +5 -5
  53. package/js/src/abstract/mazdax.d.ts +11 -11
  54. package/js/src/abstract/mazdax.js +5 -5
  55. package/js/src/abstract/pingi.d.ts +9 -9
  56. package/js/src/abstract/pingi.js +5 -5
  57. package/js/src/abstract/pooleno.d.ts +8 -8
  58. package/js/src/abstract/pooleno.js +5 -5
  59. package/js/src/abstract/tehran_exchange.d.ts +9 -9
  60. package/js/src/abstract/tehran_exchange.js +5 -5
  61. package/js/src/abstract/toobit.d.ts +10 -10
  62. package/js/src/afratether.js +350 -350
  63. package/js/src/arzplus.d.ts +26 -26
  64. package/js/src/arzplus.js +575 -575
  65. package/js/src/base/Exchange.d.ts +926 -926
  66. package/js/src/base/types.d.ts +586 -586
  67. package/js/src/bit24.js +383 -382
  68. package/js/src/bitbarg.d.ts +21 -21
  69. package/js/src/bitbarg.js +306 -306
  70. package/js/src/bitpin.js +481 -472
  71. package/js/src/bydfi.d.ts +23 -23
  72. package/js/src/bydfi.js +428 -428
  73. package/js/src/cafearz.d.ts +21 -21
  74. package/js/src/cafearz.js +340 -340
  75. package/js/src/coinbaseexchange.d.ts +334 -334
  76. package/js/src/hamtapay.d.ts +21 -21
  77. package/js/src/hamtapay.js +297 -297
  78. package/js/src/iranexchange.d.ts +21 -21
  79. package/js/src/iranexchange.js +393 -393
  80. package/js/src/kcex.js +329 -329
  81. package/js/src/kifpoolme.d.ts +23 -23
  82. package/js/src/kifpoolme.js +404 -404
  83. package/js/src/mazdax.d.ts +23 -23
  84. package/js/src/mazdax.js +528 -528
  85. package/js/src/ompfinex.js +504 -504
  86. package/js/src/pingi.d.ts +22 -22
  87. package/js/src/pingi.js +440 -440
  88. package/js/src/pooleno.d.ts +21 -21
  89. package/js/src/pooleno.js +341 -341
  90. package/js/src/protobuf/mexc/compiled.d.cts +2 -2
  91. package/js/src/sarmayex.js +370 -370
  92. package/js/src/static_dependencies/fflake/browser.d.ts +222 -222
  93. package/js/src/static_dependencies/jsencrypt/lib/asn1js/asn1.d.ts +51 -51
  94. package/js/src/static_dependencies/jsencrypt/lib/jsbn/jsbn.d.ts +1 -1
  95. package/js/src/static_dependencies/noble-curves/abstract/weierstrass.d.ts +204 -204
  96. package/js/src/static_dependencies/qs/formats.d.cts +8 -8
  97. package/js/src/static_dependencies/qs/index.d.cts +4 -4
  98. package/js/src/static_dependencies/qs/parse.d.cts +2 -2
  99. package/js/src/static_dependencies/qs/stringify.d.cts +2 -2
  100. package/js/src/static_dependencies/qs/utils.d.cts +9 -9
  101. package/js/src/static_dependencies/starknet/utils/calldata/parser/index.d.ts +1 -1
  102. package/js/src/tehran_exchange.d.ts +21 -21
  103. package/js/src/tehran_exchange.js +327 -327
  104. package/js/src/tetherland.js +361 -361
  105. package/js/src/toobit.js +439 -439
  106. package/js/src/twox.js +365 -365
  107. package/package.json +1 -1
@@ -4,350 +4,350 @@
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/abantether.js';
9
- // ---------------------------------------------------------------------------
10
- /**
11
- * @class abantether
12
- * @augments Exchange
13
- * @description Set rateLimit to 1000 if fully verified
14
- */
15
- export default class abantether extends Exchange {
16
- describe() {
17
- return this.deepExtend(super.describe(), {
18
- 'id': 'abantether',
19
- 'name': 'Aban tether',
20
- 'countries': ['IR'],
21
- 'rateLimit': 1000,
22
- 'version': '1',
23
- 'certified': false,
24
- 'pro': false,
25
- 'has': {
26
- 'CORS': undefined,
27
- 'spot': false,
28
- 'margin': false,
29
- 'swap': false,
30
- 'future': false,
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': false,
68
- 'fetchOpenInterestHistory': false,
69
- 'fetchOpenOrders': false,
70
- 'fetchOrder': false,
71
- 'fetchOrderBook': false,
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
- 'otc': true,
84
- 'setLeverage': false,
85
- 'setMarginMode': false,
86
- 'transfer': false,
87
- 'withdraw': false,
88
- },
89
- 'comment': 'This comment is optional',
90
- 'urls': {
91
- 'logo': 'https://cdn.arz.digital/cr-odin/img/exchanges/abantether/64x64.png',
92
- 'api': {
93
- 'public': 'https://api.abantether.com',
94
- },
95
- 'www': 'https://abantether.com',
96
- 'doc': [
97
- 'https://abantether.com',
98
- ],
99
- },
100
- 'api': {
101
- 'public': {
102
- 'get': {
103
- 'manager/coins/data': 1,
104
- },
105
- },
106
- },
107
- 'fees': {
108
- 'trading': {
109
- 'tierBased': false,
110
- 'percentage': true,
111
- 'maker': this.parseNumber('0.001'),
112
- 'taker': this.parseNumber('0.001'),
113
- },
114
- },
115
- });
116
- }
117
- async fetchMarkets(params = {}) {
118
- /**
119
- * @method
120
- * @name abantether#fetchMarkets
121
- * @description retrieves data on all markets for abantether
122
- * @see https://api.abantether.com/manager/coins/data
123
- * @param {object} [params] extra parameters specific to the exchange API endpoint
124
- * @returns {object[]} an array of objects representing market data
125
- */
126
- const response = await this.publicGetManagerCoinsData(params);
127
- const data = this.safeList(response, 'data', []);
128
- const result = [];
129
- const quotes = ['IRT', 'USDT'];
130
- for (let i = 0; i < data.length; i++) {
131
- const base = this.safeString(data[i], 'symbol');
132
- for (let index = 0; index < quotes.length; index++) {
133
- const quote = quotes[index];
134
- data[i]['base'] = base;
135
- data[i]['quote'] = quote;
136
- if (base === quote) {
137
- continue;
138
- }
139
- const market = this.parseMarket(data[i]);
140
- result.push(market);
141
- }
142
- }
143
- return result;
144
- }
145
- parseMarket(market) {
146
- // {
147
- // "id": 1,
148
- // "name": "Tether USDt",
149
- // "symbol": "USDT",
150
- // "persian_name": "تتر",
151
- // "is_active": true,
152
- // "is_withdrawal_active": true,
153
- // "is_deposit_active": true,
154
- // "is_mid_wallet_transfer_active": true,
155
- // "is_buy_active": true,
156
- // "is_sell_active": true,
157
- // "is_credit_active": true,
158
- // "min_trade": "1.00",
159
- // "max_trade": "100000.00",
160
- // "tether_price": "1",
161
- // "price_buy": "113540.0",
162
- // "price_sell": "112630.0",
163
- // "volume24h": "225163179366.25",
164
- // "percent_change_1h": "0.00",
165
- // "percent_change_24h": "0.00",
166
- // "percent_change_7d": "0.04",
167
- // "market_cap": "179884960573.99",
168
- // "coin_type": "COIN",
169
- // "exchange_type": "fake",
170
- // "icon": "f71021586005413ea6f3a0bd1f7d8a55",
171
- // "fund_tether_buy": "0",
172
- // "fund_tether_sell": "0",
173
- // "irt_decimal_point": 2,
174
- // "tether_decimal_point": 6,
175
- // "amount_decimal_point": 6,
176
- // "base": "BTC",
177
- // "qoute": "USDT",
178
- // },
179
- let baseId = this.safeString(market, 'base');
180
- let quoteId = this.safeString(market, 'quote');
181
- const base = this.safeCurrencyCode(baseId);
182
- const quote = this.safeCurrencyCode(quoteId);
183
- const id = base + quote;
184
- baseId = baseId.toLowerCase();
185
- quoteId = quoteId.toLowerCase();
186
- return {
187
- 'id': id,
188
- 'symbol': base + '/' + quote,
189
- 'base': base,
190
- 'quote': quote,
191
- 'settle': undefined,
192
- 'baseId': baseId,
193
- 'quoteId': quoteId,
194
- 'settleId': undefined,
195
- 'type': 'otc',
196
- 'spot': false,
197
- 'margin': false,
198
- 'swap': false,
199
- 'future': false,
200
- 'option': false,
201
- 'active': true,
202
- 'contract': false,
203
- 'linear': undefined,
204
- 'inverse': undefined,
205
- 'contractSize': undefined,
206
- 'expiry': undefined,
207
- 'expiryDatetime': undefined,
208
- 'strike': undefined,
209
- 'optionType': undefined,
210
- 'precision': {
211
- 'amount': undefined,
212
- 'price': undefined,
213
- },
214
- 'limits': {
215
- 'leverage': {
216
- 'min': undefined,
217
- 'max': undefined,
218
- },
219
- 'amount': {
220
- 'min': undefined,
221
- 'max': undefined,
222
- },
223
- 'price': {
224
- 'min': undefined,
225
- 'max': undefined,
226
- },
227
- 'cost': {
228
- 'min': undefined,
229
- 'max': undefined,
230
- },
231
- },
232
- 'created': undefined,
233
- 'info': market,
234
- };
235
- }
236
- async fetchTickers(symbols = undefined, params = {}) {
237
- /**
238
- * @method
239
- * @name abantether#fetchTickers
240
- * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
241
- * @see https://api.abantether.com/manager/coins/data
242
- * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
243
- * @param {object} [params] extra parameters specific to the exchange API endpoint
244
- * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
245
- */
246
- await this.loadMarkets();
247
- if (symbols !== undefined) {
248
- symbols = this.marketSymbols(symbols);
249
- }
250
- const response = await this.publicGetManagerCoinsData(params);
251
- const data = this.safeList(response, 'data', []);
252
- const result = {};
253
- const quotes = ['IRT', 'USDT'];
254
- for (let i = 0; i < data.length; i++) {
255
- const base = this.safeString(data[i], 'symbol');
256
- for (let index = 0; index < quotes.length; index++) {
257
- const quote = quotes[index];
258
- if (base === quote) {
259
- continue;
260
- }
261
- data[i]['base'] = base;
262
- data[i]['quote'] = quote;
263
- data[i]['symbol'] = base + quote;
264
- const ticker = this.parseTicker(data[i]);
265
- const symbol = ticker['symbol'];
266
- result[symbol] = ticker;
267
- }
268
- }
269
- return this.filterByArrayTickers(result, 'symbol', symbols);
270
- }
271
- async fetchTicker(symbol, params = {}) {
272
- /**
273
- * @method
274
- * @name abantether#fetchTicker
275
- * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
276
- * @see https://api.abantether.com/manager/coins/data
277
- * @param {string} symbol unified symbol of the market to fetch the ticker for
278
- * @param {object} [params] extra parameters specific to the exchange API endpoint
279
- * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
280
- */
281
- const ticker = await this.fetchTickers([symbol]);
282
- return ticker[symbol];
283
- }
284
- parseTicker(ticker, market = undefined) {
285
- // {
286
- // "id": 2,
287
- // "name": "Bitcoin",
288
- // "symbol": "BTC",
289
- // "persian_name": "بیت کوین",
290
- // "is_active": true,
291
- // "is_withdrawal_active": true,
292
- // "is_deposit_active": true,
293
- // "is_mid_wallet_transfer_active": true,
294
- // "is_buy_active": true,
295
- // "is_sell_active": true,
296
- // "is_credit_active": true,
297
- // "min_trade": "1.00",
298
- // "max_trade": "65000.00",
299
- // "tether_price": "114909.43000000",
300
- // "price_buy": "13049114870.800000000",
301
- // "price_sell": "12944547289.500000000",
302
- // "volume24h": "93585526493.26",
303
- // "percent_change_1h": "-0.29",
304
- // "percent_change_24h": "3.22",
305
- // "percent_change_7d": "-7.19",
306
- // "market_cap": "2292874615411.72",
307
- // "coin_type": "COIN",
308
- // "exchange_type": "binance",
309
- // "icon": "561aa10abc0c45f7aa4499f48d618c80",
310
- // "fund_tether_buy": "0",
311
- // "fund_tether_sell": "0",
312
- // "irt_decimal_point": 0,
313
- // "tether_decimal_point": 2,
314
- // "amount_decimal_point": 9
315
- // },
316
- const marketType = 'otc';
317
- const marketId = this.safeString(ticker, 'symbol');
318
- const symbol = this.safeSymbol(marketId, market, undefined, marketType);
319
- let last = this.safeFloat(ticker, 'tether_price', 0);
320
- if (ticker['quote'] === 'IRT') {
321
- last = this.safeFloat(ticker, 'price_buy', 0);
322
- }
323
- const change = this.safeFloat(ticker, 'percent_change_24h', 0);
324
- const baseVolume = this.safeFloat(ticker, 'volume24h', 0);
325
- return this.safeTicker({
326
- 'symbol': symbol,
327
- 'timestamp': undefined,
328
- 'datetime': undefined,
329
- 'high': undefined,
330
- 'low': undefined,
331
- 'bid': undefined,
332
- 'bidVolume': undefined,
333
- 'ask': undefined,
334
- 'askVolume': undefined,
335
- 'vwap': undefined,
336
- 'open': undefined,
337
- 'close': last,
338
- 'last': last,
339
- 'previousClose': undefined,
340
- 'change': change,
341
- 'percentage': undefined,
342
- 'average': undefined,
343
- 'baseVolume': baseVolume,
344
- 'quoteVolume': undefined,
345
- 'info': ticker,
346
- }, market);
347
- }
348
- sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
349
- const url = this.urls['api']['public'] + '/' + path + '?format=json';
350
- headers = { 'Content-Type': 'application/json', 'Cookie': '__arcsco=42f03956ded5873c087d9f052b33cbff' };
351
- return { 'url': url, 'method': method, 'body': body, 'headers': headers };
352
- }
353
- }
7
+ // ---------------------------------------------------------------------------
8
+ import Exchange from './abstract/abantether.js';
9
+ // ---------------------------------------------------------------------------
10
+ /**
11
+ * @class abantether
12
+ * @augments Exchange
13
+ * @description Set rateLimit to 1000 if fully verified
14
+ */
15
+ export default class abantether extends Exchange {
16
+ describe() {
17
+ return this.deepExtend(super.describe(), {
18
+ 'id': 'abantether',
19
+ 'name': 'Aban tether',
20
+ 'countries': ['IR'],
21
+ 'rateLimit': 1000,
22
+ 'version': '1',
23
+ 'certified': false,
24
+ 'pro': false,
25
+ 'has': {
26
+ 'CORS': undefined,
27
+ 'spot': false,
28
+ 'margin': false,
29
+ 'swap': false,
30
+ 'future': false,
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': false,
68
+ 'fetchOpenInterestHistory': false,
69
+ 'fetchOpenOrders': false,
70
+ 'fetchOrder': false,
71
+ 'fetchOrderBook': false,
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
+ 'otc': true,
84
+ 'setLeverage': false,
85
+ 'setMarginMode': false,
86
+ 'transfer': false,
87
+ 'withdraw': false,
88
+ },
89
+ 'comment': 'This comment is optional',
90
+ 'urls': {
91
+ 'logo': 'https://cdn.arz.digital/cr-odin/img/exchanges/abantether/64x64.png',
92
+ 'api': {
93
+ 'public': 'https://api.abantether.com',
94
+ },
95
+ 'www': 'https://abantether.com',
96
+ 'doc': [
97
+ 'https://abantether.com',
98
+ ],
99
+ },
100
+ 'api': {
101
+ 'public': {
102
+ 'get': {
103
+ 'manager/coins/data': 1,
104
+ },
105
+ },
106
+ },
107
+ 'fees': {
108
+ 'trading': {
109
+ 'tierBased': false,
110
+ 'percentage': true,
111
+ 'maker': this.parseNumber('0.001'),
112
+ 'taker': this.parseNumber('0.001'),
113
+ },
114
+ },
115
+ });
116
+ }
117
+ async fetchMarkets(params = {}) {
118
+ /**
119
+ * @method
120
+ * @name abantether#fetchMarkets
121
+ * @description retrieves data on all markets for abantether
122
+ * @see https://api.abantether.com/manager/coins/data
123
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
124
+ * @returns {object[]} an array of objects representing market data
125
+ */
126
+ const response = await this.publicGetManagerCoinsData(params);
127
+ const data = this.safeList(response, 'data', []);
128
+ const result = [];
129
+ const quotes = ['IRT', 'USDT'];
130
+ for (let i = 0; i < data.length; i++) {
131
+ const base = this.safeString(data[i], 'symbol');
132
+ for (let index = 0; index < quotes.length; index++) {
133
+ const quote = quotes[index];
134
+ data[i]['base'] = base;
135
+ data[i]['quote'] = quote;
136
+ if (base === quote) {
137
+ continue;
138
+ }
139
+ const market = this.parseMarket(data[i]);
140
+ result.push(market);
141
+ }
142
+ }
143
+ return result;
144
+ }
145
+ parseMarket(market) {
146
+ // {
147
+ // "id": 1,
148
+ // "name": "Tether USDt",
149
+ // "symbol": "USDT",
150
+ // "persian_name": "تتر",
151
+ // "is_active": true,
152
+ // "is_withdrawal_active": true,
153
+ // "is_deposit_active": true,
154
+ // "is_mid_wallet_transfer_active": true,
155
+ // "is_buy_active": true,
156
+ // "is_sell_active": true,
157
+ // "is_credit_active": true,
158
+ // "min_trade": "1.00",
159
+ // "max_trade": "100000.00",
160
+ // "tether_price": "1",
161
+ // "price_buy": "113540.0",
162
+ // "price_sell": "112630.0",
163
+ // "volume24h": "225163179366.25",
164
+ // "percent_change_1h": "0.00",
165
+ // "percent_change_24h": "0.00",
166
+ // "percent_change_7d": "0.04",
167
+ // "market_cap": "179884960573.99",
168
+ // "coin_type": "COIN",
169
+ // "exchange_type": "fake",
170
+ // "icon": "f71021586005413ea6f3a0bd1f7d8a55",
171
+ // "fund_tether_buy": "0",
172
+ // "fund_tether_sell": "0",
173
+ // "irt_decimal_point": 2,
174
+ // "tether_decimal_point": 6,
175
+ // "amount_decimal_point": 6,
176
+ // "base": "BTC",
177
+ // "qoute": "USDT",
178
+ // },
179
+ let baseId = this.safeString(market, 'base');
180
+ let quoteId = this.safeString(market, 'quote');
181
+ const base = this.safeCurrencyCode(baseId);
182
+ const quote = this.safeCurrencyCode(quoteId);
183
+ const id = base + quote;
184
+ baseId = baseId.toLowerCase();
185
+ quoteId = quoteId.toLowerCase();
186
+ return {
187
+ 'id': id,
188
+ 'symbol': base + '/' + quote,
189
+ 'base': base,
190
+ 'quote': quote,
191
+ 'settle': undefined,
192
+ 'baseId': baseId,
193
+ 'quoteId': quoteId,
194
+ 'settleId': undefined,
195
+ 'type': 'otc',
196
+ 'spot': false,
197
+ 'margin': false,
198
+ 'swap': false,
199
+ 'future': false,
200
+ 'option': false,
201
+ 'active': true,
202
+ 'contract': false,
203
+ 'linear': undefined,
204
+ 'inverse': undefined,
205
+ 'contractSize': undefined,
206
+ 'expiry': undefined,
207
+ 'expiryDatetime': undefined,
208
+ 'strike': undefined,
209
+ 'optionType': undefined,
210
+ 'precision': {
211
+ 'amount': undefined,
212
+ 'price': undefined,
213
+ },
214
+ 'limits': {
215
+ 'leverage': {
216
+ 'min': undefined,
217
+ 'max': undefined,
218
+ },
219
+ 'amount': {
220
+ 'min': undefined,
221
+ 'max': undefined,
222
+ },
223
+ 'price': {
224
+ 'min': undefined,
225
+ 'max': undefined,
226
+ },
227
+ 'cost': {
228
+ 'min': undefined,
229
+ 'max': undefined,
230
+ },
231
+ },
232
+ 'created': undefined,
233
+ 'info': market,
234
+ };
235
+ }
236
+ async fetchTickers(symbols = undefined, params = {}) {
237
+ /**
238
+ * @method
239
+ * @name abantether#fetchTickers
240
+ * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
241
+ * @see https://api.abantether.com/manager/coins/data
242
+ * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
243
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
244
+ * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
245
+ */
246
+ await this.loadMarkets();
247
+ if (symbols !== undefined) {
248
+ symbols = this.marketSymbols(symbols);
249
+ }
250
+ const response = await this.publicGetManagerCoinsData(params);
251
+ const data = this.safeList(response, 'data', []);
252
+ const result = {};
253
+ const quotes = ['IRT', 'USDT'];
254
+ for (let i = 0; i < data.length; i++) {
255
+ const base = this.safeString(data[i], 'symbol');
256
+ for (let index = 0; index < quotes.length; index++) {
257
+ const quote = quotes[index];
258
+ if (base === quote) {
259
+ continue;
260
+ }
261
+ data[i]['base'] = base;
262
+ data[i]['quote'] = quote;
263
+ data[i]['symbol'] = base + quote;
264
+ const ticker = this.parseTicker(data[i]);
265
+ const symbol = ticker['symbol'];
266
+ result[symbol] = ticker;
267
+ }
268
+ }
269
+ return this.filterByArrayTickers(result, 'symbol', symbols);
270
+ }
271
+ async fetchTicker(symbol, params = {}) {
272
+ /**
273
+ * @method
274
+ * @name abantether#fetchTicker
275
+ * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
276
+ * @see https://api.abantether.com/manager/coins/data
277
+ * @param {string} symbol unified symbol of the market to fetch the ticker for
278
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
279
+ * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
280
+ */
281
+ const ticker = await this.fetchTickers([symbol]);
282
+ return ticker[symbol];
283
+ }
284
+ parseTicker(ticker, market = undefined) {
285
+ // {
286
+ // "id": 2,
287
+ // "name": "Bitcoin",
288
+ // "symbol": "BTC",
289
+ // "persian_name": "بیت کوین",
290
+ // "is_active": true,
291
+ // "is_withdrawal_active": true,
292
+ // "is_deposit_active": true,
293
+ // "is_mid_wallet_transfer_active": true,
294
+ // "is_buy_active": true,
295
+ // "is_sell_active": true,
296
+ // "is_credit_active": true,
297
+ // "min_trade": "1.00",
298
+ // "max_trade": "65000.00",
299
+ // "tether_price": "114909.43000000",
300
+ // "price_buy": "13049114870.800000000",
301
+ // "price_sell": "12944547289.500000000",
302
+ // "volume24h": "93585526493.26",
303
+ // "percent_change_1h": "-0.29",
304
+ // "percent_change_24h": "3.22",
305
+ // "percent_change_7d": "-7.19",
306
+ // "market_cap": "2292874615411.72",
307
+ // "coin_type": "COIN",
308
+ // "exchange_type": "binance",
309
+ // "icon": "561aa10abc0c45f7aa4499f48d618c80",
310
+ // "fund_tether_buy": "0",
311
+ // "fund_tether_sell": "0",
312
+ // "irt_decimal_point": 0,
313
+ // "tether_decimal_point": 2,
314
+ // "amount_decimal_point": 9
315
+ // },
316
+ const marketType = 'otc';
317
+ const marketId = this.safeString(ticker, 'symbol');
318
+ const symbol = this.safeSymbol(marketId, market, undefined, marketType);
319
+ let last = this.safeFloat(ticker, 'tether_price', 0);
320
+ if (ticker['quote'] === 'IRT') {
321
+ last = this.safeFloat(ticker, 'price_buy', 0);
322
+ }
323
+ const change = this.safeFloat(ticker, 'percent_change_24h', 0);
324
+ const baseVolume = this.safeFloat(ticker, 'volume24h', 0);
325
+ return this.safeTicker({
326
+ 'symbol': symbol,
327
+ 'timestamp': undefined,
328
+ 'datetime': undefined,
329
+ 'high': undefined,
330
+ 'low': undefined,
331
+ 'bid': undefined,
332
+ 'bidVolume': undefined,
333
+ 'ask': undefined,
334
+ 'askVolume': undefined,
335
+ 'vwap': undefined,
336
+ 'open': undefined,
337
+ 'close': last,
338
+ 'last': last,
339
+ 'previousClose': undefined,
340
+ 'change': change,
341
+ 'percentage': undefined,
342
+ 'average': undefined,
343
+ 'baseVolume': baseVolume,
344
+ 'quoteVolume': undefined,
345
+ 'info': ticker,
346
+ }, market);
347
+ }
348
+ sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
349
+ const url = this.urls['api']['public'] + '/' + path + '?format=json';
350
+ headers = { 'Content-Type': 'application/json', 'Cookie': '__arcsco=42f03956ded5873c087d9f052b33cbff' };
351
+ return { 'url': url, 'method': method, 'body': body, 'headers': headers };
352
+ }
353
+ }