ccxt-ir 4.9.22 → 4.9.23

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 (102) hide show
  1. package/README.md +3 -3
  2. package/dist/ccxt.browser.min.js +2 -2
  3. package/dist/cjs/ccxt.js +4 -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 +11 -0
  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/bitbarg.js +303 -303
  18. package/dist/cjs/src/bydfi.js +425 -425
  19. package/dist/cjs/src/cafearz.js +337 -337
  20. package/dist/cjs/src/hamtapay.js +294 -294
  21. package/dist/cjs/src/iranexchange.js +398 -0
  22. package/dist/cjs/src/kcex.js +326 -326
  23. package/dist/cjs/src/kifpoolme.js +401 -401
  24. package/dist/cjs/src/mazdax.js +525 -525
  25. package/dist/cjs/src/ompfinex.js +501 -501
  26. package/dist/cjs/src/pingi.js +437 -437
  27. package/dist/cjs/src/pooleno.js +338 -338
  28. package/dist/cjs/src/sarmayex.js +367 -367
  29. package/dist/cjs/src/tehran_exchange.js +324 -324
  30. package/dist/cjs/src/tetherland.js +358 -358
  31. package/dist/cjs/src/toobit.js +436 -436
  32. package/dist/cjs/src/twox.js +362 -362
  33. package/js/ccxt.d.ts +5 -2
  34. package/js/ccxt.js +4 -2
  35. package/js/src/abantether.js +347 -347
  36. package/js/src/abstract/abantether.d.ts +8 -8
  37. package/js/src/abstract/arzplus.d.ts +11 -11
  38. package/js/src/abstract/bitbarg.d.ts +8 -8
  39. package/js/src/abstract/bitbarg.js +5 -5
  40. package/js/src/abstract/bydfi.d.ts +11 -11
  41. package/js/src/abstract/bydfi.js +5 -5
  42. package/js/src/abstract/cafearz.d.ts +8 -8
  43. package/js/src/abstract/cafearz.js +5 -5
  44. package/js/src/abstract/hamtapay.d.ts +9 -9
  45. package/js/src/abstract/hamtapay.js +5 -5
  46. package/js/src/abstract/iranexchange.d.ts +9 -0
  47. package/js/src/abstract/iranexchange.js +11 -0
  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 -9
  57. package/js/src/abstract/tehran_exchange.js +5 -5
  58. package/js/src/abstract/toobit.d.ts +10 -10
  59. package/js/src/afratether.js +350 -350
  60. package/js/src/arzplus.d.ts +26 -26
  61. package/js/src/arzplus.js +575 -575
  62. package/js/src/base/Exchange.d.ts +2 -2
  63. package/js/src/base/types.d.ts +586 -586
  64. package/js/src/bitbarg.d.ts +21 -21
  65. package/js/src/bitbarg.js +306 -306
  66. package/js/src/bydfi.d.ts +23 -23
  67. package/js/src/bydfi.js +428 -428
  68. package/js/src/cafearz.d.ts +21 -21
  69. package/js/src/cafearz.js +340 -340
  70. package/js/src/coinbaseexchange.d.ts +1 -1
  71. package/js/src/hamtapay.d.ts +21 -21
  72. package/js/src/hamtapay.js +297 -297
  73. package/js/src/iranexchange.d.ts +21 -0
  74. package/js/src/iranexchange.js +397 -0
  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 -528
  80. package/js/src/ompfinex.js +504 -504
  81. package/js/src/pingi.d.ts +22 -22
  82. package/js/src/pingi.js +440 -440
  83. package/js/src/pooleno.d.ts +21 -21
  84. package/js/src/pooleno.js +341 -341
  85. package/js/src/protobuf/mexc/compiled.d.cts +0 -6
  86. package/js/src/sarmayex.js +370 -370
  87. package/js/src/static_dependencies/fflake/browser.d.ts +5 -5
  88. package/js/src/static_dependencies/jsencrypt/lib/asn1js/asn1.d.ts +51 -51
  89. package/js/src/static_dependencies/jsencrypt/lib/jsbn/jsbn.d.ts +101 -101
  90. package/js/src/static_dependencies/noble-curves/abstract/weierstrass.d.ts +204 -204
  91. package/js/src/static_dependencies/qs/formats.d.cts +0 -6
  92. package/js/src/static_dependencies/qs/index.d.cts +0 -6
  93. package/js/src/static_dependencies/qs/parse.d.cts +0 -6
  94. package/js/src/static_dependencies/qs/stringify.d.cts +0 -6
  95. package/js/src/static_dependencies/qs/utils.d.cts +0 -6
  96. package/js/src/static_dependencies/starknet/utils/calldata/parser/index.d.ts +5 -5
  97. package/js/src/tehran_exchange.d.ts +21 -21
  98. package/js/src/tehran_exchange.js +327 -327
  99. package/js/src/tetherland.js +361 -361
  100. package/js/src/toobit.js +439 -439
  101. package/js/src/twox.js +365 -365
  102. package/package.json +1 -1
@@ -0,0 +1,398 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var iranexchange$1 = require('./abstract/iranexchange.js');
6
+
7
+ // ----------------------------------------------------------------------------
8
+ // ---------------------------------------------------------------------------
9
+ /**
10
+ * @class iranexchange
11
+ * @augments Exchange
12
+ * @description Set rateLimit to 1000 if fully verified
13
+ */
14
+ class iranexchange extends iranexchange$1["default"] {
15
+ describe() {
16
+ return this.deepExtend(super.describe(), {
17
+ 'id': 'iranexchange',
18
+ 'name': 'Iran Exchange',
19
+ 'countries': ['IR'],
20
+ 'rateLimit': 1000,
21
+ 'version': '1',
22
+ 'certified': false,
23
+ 'pro': false,
24
+ 'timeout': 30000,
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
+ '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/iran-exchange/64x64.png',
91
+ 'api': {
92
+ 'public': 'https://api.iranexchange.com/api/public/modules/crypto',
93
+ },
94
+ 'www': 'https://iranexchange.com/',
95
+ 'doc': [
96
+ 'https://iranexchange.com/',
97
+ ],
98
+ },
99
+ 'api': {
100
+ 'public': {
101
+ 'get': {
102
+ 'v1/client/listProduct': 1,
103
+ 'v1/client/getBySymbol': 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 iranexchange#fetchMarkets
121
+ * @description retrieves data on all markets for iranexchange
122
+ * @see https://iranexchange.co/
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.publicGetV1ClientListProduct();
127
+ const markets = this.safeList(response, 'data');
128
+ const result = [];
129
+ for (let i = 0; i < markets.length; i++) {
130
+ const market = this.parseMarket(markets[i]);
131
+ result.push(market);
132
+ }
133
+ return result;
134
+ }
135
+ parseMarket(market) {
136
+ // {
137
+ // _id: "60b08a57b202353abb592032",
138
+ // name: "Bitcoin",
139
+ // fa_name: "بیت کوین",
140
+ // symbol: "BTC",
141
+ // slug: "bitcoin",
142
+ // is_sell_to_customer_active: 1,
143
+ // is_fast_sell_to_customer_active: 1,
144
+ // is_buy_from_customer_active: 1,
145
+ // logo: "https://iranexchange.com/strapi/media/BTC_78d99b9d12.png",
146
+ // dollar_price: 89240.18,
147
+ // sell_to_iranicard_currency_price: 1234526,
148
+ // buy_from_iranicard_currency_price: 1239474,
149
+ // fast_sell_to_iranicard_currency_price: 1234526,
150
+ // buy_from_iranicard_network_list: [
151
+ // {
152
+ // network: "BTC",
153
+ // name: "Bitcoin",
154
+ // addressRegex: "^[13][a-km-zA-HJ-NP-Z1-9]{25,34}$|^[(bc1q)|(bc1p)][0-9A-Za-z]{37,62}$",
155
+ // coin: "BTC",
156
+ // withdrawEnable: true,
157
+ // depositEnable: true,
158
+ // withdrawMin: "0.000100000",
159
+ // withdrawMax: null,
160
+ // withdrawFee: "0.000100000",
161
+ // sameAddress: false,
162
+ // memoRegex: null,
163
+ // tradeEnable: true
164
+ // }
165
+ // ],
166
+ // sell_to_iranicard_network_list: [
167
+ // {
168
+ // network: "BTC",
169
+ // name: "Bitcoin",
170
+ // addressRegex: "^[13][a-km-zA-HJ-NP-Z1-9]{25,34}$|^[(bc1q)|(bc1p)][0-9A-Za-z]{37,62}$",
171
+ // coin: "BTC",
172
+ // withdrawEnable: true,
173
+ // depositEnable: true,
174
+ // withdrawMin: "0.000100000",
175
+ // withdrawMax: null,
176
+ // withdrawFee: "0.000100000",
177
+ // sameAddress: false,
178
+ // memoRegex: null,
179
+ // tradeEnable: true
180
+ // }
181
+ // ],
182
+ // is_price_maker_active: 1,
183
+ // quotation: {
184
+ // maxPrice: "90199.99",
185
+ // minPrice: "88925",
186
+ // dailyChangePercent: "-0.26"
187
+ // },
188
+ // dailyChangePercent: -0.26,
189
+ // order: 0,
190
+ // stock_status: "in_stock",
191
+ // stock_label: null,
192
+ // stock_description: null
193
+ // },
194
+ const id = this.safeString(market, 'symbol') + '_' + 'IRT';
195
+ let baseId = this.safeString(market, 'symbol');
196
+ let quoteId = 'IRT';
197
+ const base = this.safeCurrencyCode(baseId);
198
+ const quote = this.safeCurrencyCode(quoteId);
199
+ baseId = baseId.toLowerCase();
200
+ quoteId = quoteId.toLowerCase();
201
+ return {
202
+ 'id': id,
203
+ 'symbol': base + '/' + quote,
204
+ 'base': base,
205
+ 'quote': quote,
206
+ 'settle': undefined,
207
+ 'baseId': baseId,
208
+ 'quoteId': quoteId,
209
+ 'settleId': undefined,
210
+ 'type': 'otc',
211
+ 'spot': false,
212
+ 'margin': false,
213
+ 'swap': false,
214
+ 'future': false,
215
+ 'option': false,
216
+ 'active': true,
217
+ 'contract': false,
218
+ 'linear': undefined,
219
+ 'inverse': undefined,
220
+ 'contractSize': undefined,
221
+ 'expiry': undefined,
222
+ 'expiryDatetime': undefined,
223
+ 'strike': undefined,
224
+ 'optionType': undefined,
225
+ 'precision': {
226
+ 'amount': undefined,
227
+ 'price': undefined,
228
+ },
229
+ 'limits': {
230
+ 'leverage': {
231
+ 'min': undefined,
232
+ 'max': undefined,
233
+ },
234
+ 'amount': {
235
+ 'min': undefined,
236
+ 'max': undefined,
237
+ },
238
+ 'price': {
239
+ 'min': undefined,
240
+ 'max': undefined,
241
+ },
242
+ 'cost': {
243
+ 'min': undefined,
244
+ 'max': undefined,
245
+ },
246
+ },
247
+ 'created': undefined,
248
+ 'info': market,
249
+ };
250
+ }
251
+ async fetchTickers(symbols = undefined, params = {}) {
252
+ /**
253
+ * @method
254
+ * @name iranexchange#fetchTickers
255
+ * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
256
+ * @see https://iranexchange.co/
257
+ * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
258
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
259
+ * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
260
+ */
261
+ await this.loadMarkets();
262
+ if (symbols !== undefined) {
263
+ symbols = this.marketSymbols(symbols);
264
+ }
265
+ const response = await this.publicGetV1ClientListProduct();
266
+ const markets = this.safeList(response, 'data');
267
+ const result = {};
268
+ for (let i = 0; i < markets.length; i++) {
269
+ const ticker = this.parseTicker(markets[i]);
270
+ const symbol = ticker['symbol'];
271
+ result[symbol] = ticker;
272
+ }
273
+ return this.filterByArrayTickers(result, 'symbol', symbols);
274
+ }
275
+ async fetchTicker(symbol, params = {}) {
276
+ /**
277
+ * @method
278
+ * @name iranexchange#fetchTicker
279
+ * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
280
+ * @see https://iranexchange.co/
281
+ * @param {string} symbol unified symbol of the market to fetch the ticker for
282
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
283
+ * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
284
+ */
285
+ await this.loadMarkets();
286
+ const market = this.market(symbol);
287
+ const request = {
288
+ 'id': market['base'],
289
+ };
290
+ const response = await this.publicGetV1ClientGetBySymbol(request);
291
+ const marketData = this.safeDict(response, 'data');
292
+ const ticker = this.parseTicker(marketData);
293
+ return ticker;
294
+ }
295
+ parseTicker(ticker, market = undefined) {
296
+ // {
297
+ // _id: "60b08a57b202353abb592032",
298
+ // name: "Bitcoin",
299
+ // fa_name: "بیت کوین",
300
+ // symbol: "BTC",
301
+ // slug: "bitcoin",
302
+ // is_sell_to_customer_active: 1,
303
+ // is_fast_sell_to_customer_active: 1,
304
+ // is_buy_from_customer_active: 1,
305
+ // logo: "https://iranexchange.com/strapi/media/BTC_78d99b9d12.png",
306
+ // dollar_price: 89240.18,
307
+ // sell_to_iranicard_currency_price: 1234526,
308
+ // buy_from_iranicard_currency_price: 1239474,
309
+ // fast_sell_to_iranicard_currency_price: 1234526,
310
+ // buy_from_iranicard_network_list: [
311
+ // {
312
+ // network: "BTC",
313
+ // name: "Bitcoin",
314
+ // addressRegex: "^[13][a-km-zA-HJ-NP-Z1-9]{25,34}$|^[(bc1q)|(bc1p)][0-9A-Za-z]{37,62}$",
315
+ // coin: "BTC",
316
+ // withdrawEnable: true,
317
+ // depositEnable: true,
318
+ // withdrawMin: "0.000100000",
319
+ // withdrawMax: null,
320
+ // withdrawFee: "0.000100000",
321
+ // sameAddress: false,
322
+ // memoRegex: null,
323
+ // tradeEnable: true
324
+ // }
325
+ // ],
326
+ // sell_to_iranicard_network_list: [
327
+ // {
328
+ // network: "BTC",
329
+ // name: "Bitcoin",
330
+ // addressRegex: "^[13][a-km-zA-HJ-NP-Z1-9]{25,34}$|^[(bc1q)|(bc1p)][0-9A-Za-z]{37,62}$",
331
+ // coin: "BTC",
332
+ // withdrawEnable: true,
333
+ // depositEnable: true,
334
+ // withdrawMin: "0.000100000",
335
+ // withdrawMax: null,
336
+ // withdrawFee: "0.000100000",
337
+ // sameAddress: false,
338
+ // memoRegex: null,
339
+ // tradeEnable: true
340
+ // }
341
+ // ],
342
+ // is_price_maker_active: 1,
343
+ // quotation: {
344
+ // maxPrice: "90199.99",
345
+ // minPrice: "88925",
346
+ // dailyChangePercent: "-0.26"
347
+ // },
348
+ // dailyChangePercent: -0.26,
349
+ // order: 0,
350
+ // stock_status: "in_stock",
351
+ // stock_label: null,
352
+ // stock_description: null
353
+ // }
354
+ const marketType = 'otc';
355
+ const marketId = this.safeString(ticker, 'symbol') + '_' + 'IRT';
356
+ const symbol = this.safeSymbol(marketId, market, undefined, marketType);
357
+ const quotation = this.safeValue(ticker, 'quotation', {});
358
+ const high = this.safeFloat(quotation, 'maxPrice', 0);
359
+ const low = this.safeFloat(quotation, 'minPrice', 0);
360
+ const bid = this.safeFloat(ticker, 'sell_to_iranicard_currency_price', 0);
361
+ const ask = this.safeFloat(ticker, 'buy_from_iranicard_currency_price', 0);
362
+ const last = this.safeFloat(ticker, 'sell_to_iranicard_currency_price', 0);
363
+ const change = this.safeFloat(quotation, 'dailyChangePercent', 0);
364
+ return this.safeTicker({
365
+ 'symbol': symbol,
366
+ 'timestamp': undefined,
367
+ 'datetime': undefined,
368
+ 'high': high,
369
+ 'low': low,
370
+ 'bid': bid,
371
+ 'bidVolume': undefined,
372
+ 'ask': ask,
373
+ 'askVolume': undefined,
374
+ 'vwap': undefined,
375
+ 'open': last,
376
+ 'close': last,
377
+ 'last': last,
378
+ 'previousClose': undefined,
379
+ 'change': change,
380
+ 'percentage': change,
381
+ 'average': undefined,
382
+ 'baseVolume': undefined,
383
+ 'quoteVolume': undefined,
384
+ 'info': ticker,
385
+ }, market);
386
+ }
387
+ sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
388
+ const query = this.omit(params, this.extractParams(path));
389
+ let url = this.urls['api']['public'] + '/' + path + '?' + this.urlencode(query);
390
+ if (params['id'] !== undefined) {
391
+ url = this.urls['api']['public'] + '/' + path + '/' + params['id'];
392
+ }
393
+ headers = { 'Content-Type': 'application/json' };
394
+ return { 'url': url, 'method': method, 'body': body, 'headers': headers };
395
+ }
396
+ }
397
+
398
+ exports["default"] = iranexchange;