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
@@ -5,350 +5,350 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var abantether$1 = require('./abstract/abantether.js');
6
6
 
7
7
  // ----------------------------------------------------------------------------
8
- // ---------------------------------------------------------------------------
9
- /**
10
- * @class abantether
11
- * @augments Exchange
12
- * @description Set rateLimit to 1000 if fully verified
13
- */
14
- class abantether extends abantether$1["default"] {
15
- describe() {
16
- return this.deepExtend(super.describe(), {
17
- 'id': 'abantether',
18
- 'name': 'Aban tether',
19
- 'countries': ['IR'],
20
- 'rateLimit': 1000,
21
- 'version': '1',
22
- 'certified': false,
23
- 'pro': false,
24
- 'has': {
25
- 'CORS': undefined,
26
- 'spot': false,
27
- 'margin': false,
28
- 'swap': false,
29
- 'future': false,
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': false,
67
- 'fetchOpenInterestHistory': false,
68
- 'fetchOpenOrders': false,
69
- 'fetchOrder': false,
70
- 'fetchOrderBook': false,
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
- 'otc': true,
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/abantether/64x64.png',
91
- 'api': {
92
- 'public': 'https://api.abantether.com',
93
- },
94
- 'www': 'https://abantether.com',
95
- 'doc': [
96
- 'https://abantether.com',
97
- ],
98
- },
99
- 'api': {
100
- 'public': {
101
- 'get': {
102
- 'manager/coins/data': 1,
103
- },
104
- },
105
- },
106
- 'fees': {
107
- 'trading': {
108
- 'tierBased': false,
109
- 'percentage': true,
110
- 'maker': this.parseNumber('0.001'),
111
- 'taker': this.parseNumber('0.001'),
112
- },
113
- },
114
- });
115
- }
116
- async fetchMarkets(params = {}) {
117
- /**
118
- * @method
119
- * @name abantether#fetchMarkets
120
- * @description retrieves data on all markets for abantether
121
- * @see https://api.abantether.com/manager/coins/data
122
- * @param {object} [params] extra parameters specific to the exchange API endpoint
123
- * @returns {object[]} an array of objects representing market data
124
- */
125
- const response = await this.publicGetManagerCoinsData(params);
126
- const data = this.safeList(response, 'data', []);
127
- const result = [];
128
- const quotes = ['IRT', 'USDT'];
129
- for (let i = 0; i < data.length; i++) {
130
- const base = this.safeString(data[i], 'symbol');
131
- for (let index = 0; index < quotes.length; index++) {
132
- const quote = quotes[index];
133
- data[i]['base'] = base;
134
- data[i]['quote'] = quote;
135
- if (base === quote) {
136
- continue;
137
- }
138
- const market = this.parseMarket(data[i]);
139
- result.push(market);
140
- }
141
- }
142
- return result;
143
- }
144
- parseMarket(market) {
145
- // {
146
- // "id": 1,
147
- // "name": "Tether USDt",
148
- // "symbol": "USDT",
149
- // "persian_name": "تتر",
150
- // "is_active": true,
151
- // "is_withdrawal_active": true,
152
- // "is_deposit_active": true,
153
- // "is_mid_wallet_transfer_active": true,
154
- // "is_buy_active": true,
155
- // "is_sell_active": true,
156
- // "is_credit_active": true,
157
- // "min_trade": "1.00",
158
- // "max_trade": "100000.00",
159
- // "tether_price": "1",
160
- // "price_buy": "113540.0",
161
- // "price_sell": "112630.0",
162
- // "volume24h": "225163179366.25",
163
- // "percent_change_1h": "0.00",
164
- // "percent_change_24h": "0.00",
165
- // "percent_change_7d": "0.04",
166
- // "market_cap": "179884960573.99",
167
- // "coin_type": "COIN",
168
- // "exchange_type": "fake",
169
- // "icon": "f71021586005413ea6f3a0bd1f7d8a55",
170
- // "fund_tether_buy": "0",
171
- // "fund_tether_sell": "0",
172
- // "irt_decimal_point": 2,
173
- // "tether_decimal_point": 6,
174
- // "amount_decimal_point": 6,
175
- // "base": "BTC",
176
- // "qoute": "USDT",
177
- // },
178
- let baseId = this.safeString(market, 'base');
179
- let quoteId = this.safeString(market, 'quote');
180
- const base = this.safeCurrencyCode(baseId);
181
- const quote = this.safeCurrencyCode(quoteId);
182
- const id = base + quote;
183
- baseId = baseId.toLowerCase();
184
- quoteId = quoteId.toLowerCase();
185
- return {
186
- 'id': id,
187
- 'symbol': base + '/' + quote,
188
- 'base': base,
189
- 'quote': quote,
190
- 'settle': undefined,
191
- 'baseId': baseId,
192
- 'quoteId': quoteId,
193
- 'settleId': undefined,
194
- 'type': 'otc',
195
- 'spot': false,
196
- 'margin': false,
197
- 'swap': false,
198
- 'future': false,
199
- 'option': false,
200
- 'active': true,
201
- 'contract': false,
202
- 'linear': undefined,
203
- 'inverse': undefined,
204
- 'contractSize': undefined,
205
- 'expiry': undefined,
206
- 'expiryDatetime': undefined,
207
- 'strike': undefined,
208
- 'optionType': undefined,
209
- 'precision': {
210
- 'amount': undefined,
211
- 'price': undefined,
212
- },
213
- 'limits': {
214
- 'leverage': {
215
- 'min': undefined,
216
- 'max': undefined,
217
- },
218
- 'amount': {
219
- 'min': undefined,
220
- 'max': undefined,
221
- },
222
- 'price': {
223
- 'min': undefined,
224
- 'max': undefined,
225
- },
226
- 'cost': {
227
- 'min': undefined,
228
- 'max': undefined,
229
- },
230
- },
231
- 'created': undefined,
232
- 'info': market,
233
- };
234
- }
235
- async fetchTickers(symbols = undefined, params = {}) {
236
- /**
237
- * @method
238
- * @name abantether#fetchTickers
239
- * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
240
- * @see https://api.abantether.com/manager/coins/data
241
- * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
242
- * @param {object} [params] extra parameters specific to the exchange API endpoint
243
- * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
244
- */
245
- await this.loadMarkets();
246
- if (symbols !== undefined) {
247
- symbols = this.marketSymbols(symbols);
248
- }
249
- const response = await this.publicGetManagerCoinsData(params);
250
- const data = this.safeList(response, 'data', []);
251
- const result = {};
252
- const quotes = ['IRT', 'USDT'];
253
- for (let i = 0; i < data.length; i++) {
254
- const base = this.safeString(data[i], 'symbol');
255
- for (let index = 0; index < quotes.length; index++) {
256
- const quote = quotes[index];
257
- if (base === quote) {
258
- continue;
259
- }
260
- data[i]['base'] = base;
261
- data[i]['quote'] = quote;
262
- data[i]['symbol'] = base + quote;
263
- const ticker = this.parseTicker(data[i]);
264
- const symbol = ticker['symbol'];
265
- result[symbol] = ticker;
266
- }
267
- }
268
- return this.filterByArrayTickers(result, 'symbol', symbols);
269
- }
270
- async fetchTicker(symbol, params = {}) {
271
- /**
272
- * @method
273
- * @name abantether#fetchTicker
274
- * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
275
- * @see https://api.abantether.com/manager/coins/data
276
- * @param {string} symbol unified symbol of the market to fetch the ticker for
277
- * @param {object} [params] extra parameters specific to the exchange API endpoint
278
- * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
279
- */
280
- const ticker = await this.fetchTickers([symbol]);
281
- return ticker[symbol];
282
- }
283
- parseTicker(ticker, market = undefined) {
284
- // {
285
- // "id": 2,
286
- // "name": "Bitcoin",
287
- // "symbol": "BTC",
288
- // "persian_name": "بیت کوین",
289
- // "is_active": true,
290
- // "is_withdrawal_active": true,
291
- // "is_deposit_active": true,
292
- // "is_mid_wallet_transfer_active": true,
293
- // "is_buy_active": true,
294
- // "is_sell_active": true,
295
- // "is_credit_active": true,
296
- // "min_trade": "1.00",
297
- // "max_trade": "65000.00",
298
- // "tether_price": "114909.43000000",
299
- // "price_buy": "13049114870.800000000",
300
- // "price_sell": "12944547289.500000000",
301
- // "volume24h": "93585526493.26",
302
- // "percent_change_1h": "-0.29",
303
- // "percent_change_24h": "3.22",
304
- // "percent_change_7d": "-7.19",
305
- // "market_cap": "2292874615411.72",
306
- // "coin_type": "COIN",
307
- // "exchange_type": "binance",
308
- // "icon": "561aa10abc0c45f7aa4499f48d618c80",
309
- // "fund_tether_buy": "0",
310
- // "fund_tether_sell": "0",
311
- // "irt_decimal_point": 0,
312
- // "tether_decimal_point": 2,
313
- // "amount_decimal_point": 9
314
- // },
315
- const marketType = 'otc';
316
- const marketId = this.safeString(ticker, 'symbol');
317
- const symbol = this.safeSymbol(marketId, market, undefined, marketType);
318
- let last = this.safeFloat(ticker, 'tether_price', 0);
319
- if (ticker['quote'] === 'IRT') {
320
- last = this.safeFloat(ticker, 'price_buy', 0);
321
- }
322
- const change = this.safeFloat(ticker, 'percent_change_24h', 0);
323
- const baseVolume = this.safeFloat(ticker, 'volume24h', 0);
324
- return this.safeTicker({
325
- 'symbol': symbol,
326
- 'timestamp': undefined,
327
- 'datetime': undefined,
328
- 'high': undefined,
329
- 'low': undefined,
330
- 'bid': undefined,
331
- 'bidVolume': undefined,
332
- 'ask': undefined,
333
- 'askVolume': undefined,
334
- 'vwap': undefined,
335
- 'open': undefined,
336
- 'close': last,
337
- 'last': last,
338
- 'previousClose': undefined,
339
- 'change': change,
340
- 'percentage': undefined,
341
- 'average': undefined,
342
- 'baseVolume': baseVolume,
343
- 'quoteVolume': undefined,
344
- 'info': ticker,
345
- }, market);
346
- }
347
- sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
348
- const url = this.urls['api']['public'] + '/' + path + '?format=json';
349
- headers = { 'Content-Type': 'application/json', 'Cookie': '__arcsco=42f03956ded5873c087d9f052b33cbff' };
350
- return { 'url': url, 'method': method, 'body': body, 'headers': headers };
351
- }
8
+ // ---------------------------------------------------------------------------
9
+ /**
10
+ * @class abantether
11
+ * @augments Exchange
12
+ * @description Set rateLimit to 1000 if fully verified
13
+ */
14
+ class abantether extends abantether$1["default"] {
15
+ describe() {
16
+ return this.deepExtend(super.describe(), {
17
+ 'id': 'abantether',
18
+ 'name': 'Aban tether',
19
+ 'countries': ['IR'],
20
+ 'rateLimit': 1000,
21
+ 'version': '1',
22
+ 'certified': false,
23
+ 'pro': false,
24
+ 'has': {
25
+ 'CORS': undefined,
26
+ 'spot': false,
27
+ 'margin': false,
28
+ 'swap': false,
29
+ 'future': false,
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': false,
67
+ 'fetchOpenInterestHistory': false,
68
+ 'fetchOpenOrders': false,
69
+ 'fetchOrder': false,
70
+ 'fetchOrderBook': false,
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
+ 'otc': true,
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/abantether/64x64.png',
91
+ 'api': {
92
+ 'public': 'https://api.abantether.com',
93
+ },
94
+ 'www': 'https://abantether.com',
95
+ 'doc': [
96
+ 'https://abantether.com',
97
+ ],
98
+ },
99
+ 'api': {
100
+ 'public': {
101
+ 'get': {
102
+ 'manager/coins/data': 1,
103
+ },
104
+ },
105
+ },
106
+ 'fees': {
107
+ 'trading': {
108
+ 'tierBased': false,
109
+ 'percentage': true,
110
+ 'maker': this.parseNumber('0.001'),
111
+ 'taker': this.parseNumber('0.001'),
112
+ },
113
+ },
114
+ });
115
+ }
116
+ async fetchMarkets(params = {}) {
117
+ /**
118
+ * @method
119
+ * @name abantether#fetchMarkets
120
+ * @description retrieves data on all markets for abantether
121
+ * @see https://api.abantether.com/manager/coins/data
122
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
123
+ * @returns {object[]} an array of objects representing market data
124
+ */
125
+ const response = await this.publicGetManagerCoinsData(params);
126
+ const data = this.safeList(response, 'data', []);
127
+ const result = [];
128
+ const quotes = ['IRT', 'USDT'];
129
+ for (let i = 0; i < data.length; i++) {
130
+ const base = this.safeString(data[i], 'symbol');
131
+ for (let index = 0; index < quotes.length; index++) {
132
+ const quote = quotes[index];
133
+ data[i]['base'] = base;
134
+ data[i]['quote'] = quote;
135
+ if (base === quote) {
136
+ continue;
137
+ }
138
+ const market = this.parseMarket(data[i]);
139
+ result.push(market);
140
+ }
141
+ }
142
+ return result;
143
+ }
144
+ parseMarket(market) {
145
+ // {
146
+ // "id": 1,
147
+ // "name": "Tether USDt",
148
+ // "symbol": "USDT",
149
+ // "persian_name": "تتر",
150
+ // "is_active": true,
151
+ // "is_withdrawal_active": true,
152
+ // "is_deposit_active": true,
153
+ // "is_mid_wallet_transfer_active": true,
154
+ // "is_buy_active": true,
155
+ // "is_sell_active": true,
156
+ // "is_credit_active": true,
157
+ // "min_trade": "1.00",
158
+ // "max_trade": "100000.00",
159
+ // "tether_price": "1",
160
+ // "price_buy": "113540.0",
161
+ // "price_sell": "112630.0",
162
+ // "volume24h": "225163179366.25",
163
+ // "percent_change_1h": "0.00",
164
+ // "percent_change_24h": "0.00",
165
+ // "percent_change_7d": "0.04",
166
+ // "market_cap": "179884960573.99",
167
+ // "coin_type": "COIN",
168
+ // "exchange_type": "fake",
169
+ // "icon": "f71021586005413ea6f3a0bd1f7d8a55",
170
+ // "fund_tether_buy": "0",
171
+ // "fund_tether_sell": "0",
172
+ // "irt_decimal_point": 2,
173
+ // "tether_decimal_point": 6,
174
+ // "amount_decimal_point": 6,
175
+ // "base": "BTC",
176
+ // "qoute": "USDT",
177
+ // },
178
+ let baseId = this.safeString(market, 'base');
179
+ let quoteId = this.safeString(market, 'quote');
180
+ const base = this.safeCurrencyCode(baseId);
181
+ const quote = this.safeCurrencyCode(quoteId);
182
+ const id = base + quote;
183
+ baseId = baseId.toLowerCase();
184
+ quoteId = quoteId.toLowerCase();
185
+ return {
186
+ 'id': id,
187
+ 'symbol': base + '/' + quote,
188
+ 'base': base,
189
+ 'quote': quote,
190
+ 'settle': undefined,
191
+ 'baseId': baseId,
192
+ 'quoteId': quoteId,
193
+ 'settleId': undefined,
194
+ 'type': 'otc',
195
+ 'spot': false,
196
+ 'margin': false,
197
+ 'swap': false,
198
+ 'future': false,
199
+ 'option': false,
200
+ 'active': true,
201
+ 'contract': false,
202
+ 'linear': undefined,
203
+ 'inverse': undefined,
204
+ 'contractSize': undefined,
205
+ 'expiry': undefined,
206
+ 'expiryDatetime': undefined,
207
+ 'strike': undefined,
208
+ 'optionType': undefined,
209
+ 'precision': {
210
+ 'amount': undefined,
211
+ 'price': undefined,
212
+ },
213
+ 'limits': {
214
+ 'leverage': {
215
+ 'min': undefined,
216
+ 'max': undefined,
217
+ },
218
+ 'amount': {
219
+ 'min': undefined,
220
+ 'max': undefined,
221
+ },
222
+ 'price': {
223
+ 'min': undefined,
224
+ 'max': undefined,
225
+ },
226
+ 'cost': {
227
+ 'min': undefined,
228
+ 'max': undefined,
229
+ },
230
+ },
231
+ 'created': undefined,
232
+ 'info': market,
233
+ };
234
+ }
235
+ async fetchTickers(symbols = undefined, params = {}) {
236
+ /**
237
+ * @method
238
+ * @name abantether#fetchTickers
239
+ * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
240
+ * @see https://api.abantether.com/manager/coins/data
241
+ * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
242
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
243
+ * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
244
+ */
245
+ await this.loadMarkets();
246
+ if (symbols !== undefined) {
247
+ symbols = this.marketSymbols(symbols);
248
+ }
249
+ const response = await this.publicGetManagerCoinsData(params);
250
+ const data = this.safeList(response, 'data', []);
251
+ const result = {};
252
+ const quotes = ['IRT', 'USDT'];
253
+ for (let i = 0; i < data.length; i++) {
254
+ const base = this.safeString(data[i], 'symbol');
255
+ for (let index = 0; index < quotes.length; index++) {
256
+ const quote = quotes[index];
257
+ if (base === quote) {
258
+ continue;
259
+ }
260
+ data[i]['base'] = base;
261
+ data[i]['quote'] = quote;
262
+ data[i]['symbol'] = base + quote;
263
+ const ticker = this.parseTicker(data[i]);
264
+ const symbol = ticker['symbol'];
265
+ result[symbol] = ticker;
266
+ }
267
+ }
268
+ return this.filterByArrayTickers(result, 'symbol', symbols);
269
+ }
270
+ async fetchTicker(symbol, params = {}) {
271
+ /**
272
+ * @method
273
+ * @name abantether#fetchTicker
274
+ * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
275
+ * @see https://api.abantether.com/manager/coins/data
276
+ * @param {string} symbol unified symbol of the market to fetch the ticker for
277
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
278
+ * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
279
+ */
280
+ const ticker = await this.fetchTickers([symbol]);
281
+ return ticker[symbol];
282
+ }
283
+ parseTicker(ticker, market = undefined) {
284
+ // {
285
+ // "id": 2,
286
+ // "name": "Bitcoin",
287
+ // "symbol": "BTC",
288
+ // "persian_name": "بیت کوین",
289
+ // "is_active": true,
290
+ // "is_withdrawal_active": true,
291
+ // "is_deposit_active": true,
292
+ // "is_mid_wallet_transfer_active": true,
293
+ // "is_buy_active": true,
294
+ // "is_sell_active": true,
295
+ // "is_credit_active": true,
296
+ // "min_trade": "1.00",
297
+ // "max_trade": "65000.00",
298
+ // "tether_price": "114909.43000000",
299
+ // "price_buy": "13049114870.800000000",
300
+ // "price_sell": "12944547289.500000000",
301
+ // "volume24h": "93585526493.26",
302
+ // "percent_change_1h": "-0.29",
303
+ // "percent_change_24h": "3.22",
304
+ // "percent_change_7d": "-7.19",
305
+ // "market_cap": "2292874615411.72",
306
+ // "coin_type": "COIN",
307
+ // "exchange_type": "binance",
308
+ // "icon": "561aa10abc0c45f7aa4499f48d618c80",
309
+ // "fund_tether_buy": "0",
310
+ // "fund_tether_sell": "0",
311
+ // "irt_decimal_point": 0,
312
+ // "tether_decimal_point": 2,
313
+ // "amount_decimal_point": 9
314
+ // },
315
+ const marketType = 'otc';
316
+ const marketId = this.safeString(ticker, 'symbol');
317
+ const symbol = this.safeSymbol(marketId, market, undefined, marketType);
318
+ let last = this.safeFloat(ticker, 'tether_price', 0);
319
+ if (ticker['quote'] === 'IRT') {
320
+ last = this.safeFloat(ticker, 'price_buy', 0);
321
+ }
322
+ const change = this.safeFloat(ticker, 'percent_change_24h', 0);
323
+ const baseVolume = this.safeFloat(ticker, 'volume24h', 0);
324
+ return this.safeTicker({
325
+ 'symbol': symbol,
326
+ 'timestamp': undefined,
327
+ 'datetime': undefined,
328
+ 'high': undefined,
329
+ 'low': undefined,
330
+ 'bid': undefined,
331
+ 'bidVolume': undefined,
332
+ 'ask': undefined,
333
+ 'askVolume': undefined,
334
+ 'vwap': undefined,
335
+ 'open': undefined,
336
+ 'close': last,
337
+ 'last': last,
338
+ 'previousClose': undefined,
339
+ 'change': change,
340
+ 'percentage': undefined,
341
+ 'average': undefined,
342
+ 'baseVolume': baseVolume,
343
+ 'quoteVolume': undefined,
344
+ 'info': ticker,
345
+ }, market);
346
+ }
347
+ sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
348
+ const url = this.urls['api']['public'] + '/' + path + '?format=json';
349
+ headers = { 'Content-Type': 'application/json', 'Cookie': '__arcsco=42f03956ded5873c087d9f052b33cbff' };
350
+ return { 'url': url, 'method': method, 'body': body, 'headers': headers };
351
+ }
352
352
  }
353
353
 
354
354
  exports["default"] = abantether;