ccxt-ir 4.9.23 → 4.9.25

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 (89) hide show
  1. package/README.md +3 -3
  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/kifpoolme.js +1 -1
  10. package/dist/cjs/src/abstract/mazdax.js +1 -1
  11. package/dist/cjs/src/abstract/pingi.js +1 -1
  12. package/dist/cjs/src/abstract/pooleno.js +1 -1
  13. package/dist/cjs/src/abstract/tehran_exchange.js +1 -1
  14. package/dist/cjs/src/afratether.js +347 -347
  15. package/dist/cjs/src/arzplus.js +572 -572
  16. package/dist/cjs/src/bitbarg.js +303 -303
  17. package/dist/cjs/src/bydfi.js +425 -425
  18. package/dist/cjs/src/cafearz.js +337 -337
  19. package/dist/cjs/src/hamtapay.js +294 -294
  20. package/dist/cjs/src/iranexchange.js +9 -7
  21. package/dist/cjs/src/kcex.js +326 -326
  22. package/dist/cjs/src/kifpoolme.js +401 -401
  23. package/dist/cjs/src/mazdax.js +525 -525
  24. package/dist/cjs/src/ompfinex.js +501 -501
  25. package/dist/cjs/src/pingi.js +437 -437
  26. package/dist/cjs/src/pooleno.js +338 -338
  27. package/dist/cjs/src/sarmayex.js +367 -367
  28. package/dist/cjs/src/tehran_exchange.js +324 -324
  29. package/dist/cjs/src/tetherland.js +358 -358
  30. package/dist/cjs/src/toobit.js +436 -436
  31. package/dist/cjs/src/twox.js +362 -362
  32. package/js/ccxt.d.ts +1 -1
  33. package/js/ccxt.js +1 -1
  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/bydfi.d.ts +11 -11
  40. package/js/src/abstract/bydfi.js +5 -5
  41. package/js/src/abstract/cafearz.d.ts +8 -8
  42. package/js/src/abstract/cafearz.js +5 -5
  43. package/js/src/abstract/hamtapay.d.ts +9 -9
  44. package/js/src/abstract/hamtapay.js +5 -5
  45. package/js/src/abstract/kifpoolme.d.ts +9 -9
  46. package/js/src/abstract/kifpoolme.js +5 -5
  47. package/js/src/abstract/mazdax.d.ts +11 -11
  48. package/js/src/abstract/mazdax.js +5 -5
  49. package/js/src/abstract/pingi.d.ts +9 -9
  50. package/js/src/abstract/pingi.js +5 -5
  51. package/js/src/abstract/pooleno.d.ts +8 -8
  52. package/js/src/abstract/pooleno.js +5 -5
  53. package/js/src/abstract/tehran_exchange.d.ts +9 -9
  54. package/js/src/abstract/tehran_exchange.js +5 -5
  55. package/js/src/abstract/toobit.d.ts +10 -10
  56. package/js/src/afratether.js +350 -350
  57. package/js/src/arzplus.d.ts +26 -26
  58. package/js/src/arzplus.js +575 -575
  59. package/js/src/base/types.d.ts +586 -586
  60. package/js/src/bitbarg.d.ts +21 -21
  61. package/js/src/bitbarg.js +306 -306
  62. package/js/src/bydfi.d.ts +23 -23
  63. package/js/src/bydfi.js +428 -428
  64. package/js/src/cafearz.d.ts +21 -21
  65. package/js/src/cafearz.js +340 -340
  66. package/js/src/hamtapay.d.ts +21 -21
  67. package/js/src/hamtapay.js +297 -297
  68. package/js/src/iranexchange.js +9 -7
  69. package/js/src/kcex.js +329 -329
  70. package/js/src/kifpoolme.d.ts +23 -23
  71. package/js/src/kifpoolme.js +404 -404
  72. package/js/src/mazdax.d.ts +23 -23
  73. package/js/src/mazdax.js +528 -528
  74. package/js/src/ompfinex.js +504 -504
  75. package/js/src/pingi.d.ts +22 -22
  76. package/js/src/pingi.js +440 -440
  77. package/js/src/pooleno.d.ts +21 -21
  78. package/js/src/pooleno.js +341 -341
  79. package/js/src/sarmayex.js +370 -370
  80. package/js/src/static_dependencies/jsencrypt/lib/asn1js/asn1.d.ts +51 -51
  81. package/js/src/static_dependencies/jsencrypt/lib/jsbn/jsbn.d.ts +101 -101
  82. package/js/src/static_dependencies/noble-curves/abstract/weierstrass.d.ts +204 -204
  83. package/js/src/static_dependencies/starknet/utils/calldata/parser/index.d.ts +5 -5
  84. package/js/src/tehran_exchange.d.ts +21 -21
  85. package/js/src/tehran_exchange.js +327 -327
  86. package/js/src/tetherland.js +361 -361
  87. package/js/src/toobit.js +439 -439
  88. package/js/src/twox.js +365 -365
  89. package/package.json +1 -1
@@ -4,364 +4,364 @@
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/tetherland.js';
9
- // ---------------------------------------------------------------------------
10
- /**
11
- * @class tetherland
12
- * @augments Exchange
13
- * @description Set rateLimit to 1000 if fully verified
14
- */
15
- export default class tetherland extends Exchange {
16
- describe() {
17
- return this.deepExtend(super.describe(), {
18
- 'id': 'tetherland',
19
- 'name': 'TetherLand',
20
- 'countries': ['IR'],
21
- 'rateLimit': 1000,
22
- 'version': '1',
23
- 'certified': false,
24
- 'pro': false,
25
- 'has': {
26
- 'CORS': undefined,
27
- 'spot': true,
28
- 'margin': false,
29
- 'swap': false,
30
- 'future': 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
- '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/tetherland/64x64.png',
91
- 'api': {
92
- 'public': 'https://service.tetherland.com',
93
- },
94
- 'www': 'https://tetherland.org',
95
- 'doc': [
96
- 'https://docs.tetherland.com/docs/tetherland/71ca11f41704f-user-api',
97
- ],
98
- },
99
- 'api': {
100
- 'public': {
101
- 'get': {
102
- 'api/v5/currencies': 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 tetherland#fetchMarkets
120
- * @description retrieves data on all markets for tetherland
121
- * @see https://docs.tetherland.com/docs/tetherland/71ca11f41704f-user-api
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.publicGetApiV5Currencies(params);
126
- const markets = this.safeList(response, 'data');
127
- const result = [];
128
- const quotes = ['USDT', 'IRT'];
129
- for (let i = 0; i < markets.length; i++) {
130
- for (let key = 0; key < quotes.length; key++) {
131
- if (markets[i]['symbol'] === 'USDT' && quotes[key] === 'USDT') {
132
- continue;
133
- }
134
- markets[i]['quote'] = quotes[key];
135
- const market = this.parseMarket(markets[i]);
136
- result.push(market);
137
- }
138
- }
139
- return result;
140
- }
141
- parseMarket(market) {
142
- // {
143
- // 'name': 'Bitcoin',
144
- // 'fa_name': 'بیت کوین',
145
- // 'logo': '/uploads/images/2022/8/masc3iMjEPBTC.svg',
146
- // 'accent_color': '#ff8d00',
147
- // 'symbol': 'BTC',
148
- // 'price': '69,497.50',
149
- // 'toman_amount': 4117726875,
150
- // 'min_usdt_value': null,
151
- // 'min_usdt_amount': 15,
152
- // 'max_usdt_amount': 10000,
153
- // 'min_value': null,
154
- // 'max_amount': '0.200000000000',
155
- // 'min_irr_amount': 883500,
156
- // 'max_irr_amount': 589000000,
157
- // 'priority': 1,
158
- // 'price_round_digit': 2,
159
- // 'amount_round_digit': 6,
160
- // 'changes_24h': -2.68,
161
- // 'changes_7d': 7.522256527082521,
162
- // 'trendy': 0,
163
- // 'exchange': null,
164
- // 'categories': [ ],
165
- // 'createdAt': null,
166
- // 'has_staking': true,
167
- // 'staking_plan': {
168
- // 'id': 38,
169
- // 'coin_id': 1,
170
- // 'periods': { '30': '1.2', '60': '1.5', 'flex': '1' },
171
- // 'capacity': '5.00000',
172
- // 'minimum_staking_amount': '0.00150',
173
- // 'maximum_staking_amount': '1.00000',
174
- // 'total_staked': '5.00000',
175
- // 'largest_benefit': 1.5,
176
- // 'trendy': 0,
177
- // 'status': 'COMPLETED',
178
- // 'info': 'رمزارز مورد نظر PoS نیست و پاداش حاصل از نگه‌داری آن از طریق دیفای استیکینگ تامین می‌شود.',
179
- // 'created_at': '2023-07-15T13:01:25.000000Z',
180
- // 'updated_at': '2024-06-01T14:56:40.000000Z',
181
- // 'deleted_at': null,
182
- // 'priority': 18,
183
- // },
184
- // }
185
- let [baseId, quoteId] = [this.safeString(market, 'symbol'), this.safeString(market, 'quote')];
186
- const base = this.safeCurrencyCode(baseId);
187
- const quote = this.safeCurrencyCode(quoteId);
188
- const id = base + '/' + quote;
189
- baseId = baseId.toLowerCase();
190
- quoteId = quoteId.toLowerCase();
191
- return {
192
- 'id': id,
193
- 'symbol': base + '/' + quote,
194
- 'base': base,
195
- 'quote': quote,
196
- 'settle': undefined,
197
- 'baseId': baseId,
198
- 'quoteId': quoteId,
199
- 'settleId': undefined,
200
- 'type': 'spot',
201
- 'spot': true,
202
- 'margin': false,
203
- 'swap': false,
204
- 'future': false,
205
- 'option': false,
206
- 'active': true,
207
- 'contract': false,
208
- 'linear': undefined,
209
- 'inverse': undefined,
210
- 'contractSize': undefined,
211
- 'expiry': undefined,
212
- 'expiryDatetime': undefined,
213
- 'strike': undefined,
214
- 'optionType': undefined,
215
- 'precision': {
216
- 'amount': undefined,
217
- 'price': undefined,
218
- },
219
- 'limits': {
220
- 'leverage': {
221
- 'min': undefined,
222
- 'max': undefined,
223
- },
224
- 'amount': {
225
- 'min': undefined,
226
- 'max': undefined,
227
- },
228
- 'price': {
229
- 'min': undefined,
230
- 'max': undefined,
231
- },
232
- 'cost': {
233
- 'min': undefined,
234
- 'max': undefined,
235
- },
236
- },
237
- 'created': undefined,
238
- 'info': market,
239
- };
240
- }
241
- async fetchTickers(symbols = undefined, params = {}) {
242
- /**
243
- * @method
244
- * @name tetherland#fetchTickers
245
- * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
246
- * @see https://docs.tetherland.com/docs/tetherland/71ca11f41704f-user-api
247
- * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
248
- * @param {object} [params] extra parameters specific to the exchange API endpoint
249
- * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
250
- */
251
- await this.loadMarkets();
252
- if (symbols !== undefined) {
253
- symbols = this.marketSymbols(symbols);
254
- }
255
- const response = await this.publicGetApiV5Currencies(params);
256
- const markets = this.safeList(response, 'data');
257
- const result = {};
258
- const quotes = ['USDT', 'IRT'];
259
- for (let i = 0; i < markets.length; i++) {
260
- for (let key = 0; key < quotes.length; key++) {
261
- if (markets[i]['symbol'] === 'USDT' && quotes[key] === 'USDT') {
262
- continue;
263
- }
264
- markets[i]['quote'] = quotes[key];
265
- markets[i]['id'] = markets[i]['symbol'] + '/' + markets[i]['quote'];
266
- const market = this.parseTicker(markets[i]);
267
- const symbol = market['symbol'];
268
- result[symbol] = market;
269
- }
270
- }
271
- return this.filterByArrayTickers(result, 'symbol', symbols);
272
- }
273
- async fetchTicker(symbol, params = {}) {
274
- /**
275
- * @method
276
- * @name tetherland#fetchTicker
277
- * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
278
- * @see https://docs.tetherland.com/docs/tetherland/71ca11f41704f-user-api
279
- * @param {string} symbol unified symbol of the market to fetch the ticker for
280
- * @param {object} [params] extra parameters specific to the exchange API endpoint
281
- * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
282
- */
283
- const ticker = await this.fetchTickers([symbol]);
284
- return ticker[symbol];
285
- }
286
- parseTicker(ticker, market = undefined) {
287
- // {
288
- // 'name': 'Bitcoin',
289
- // 'fa_name': 'بیت کوین',
290
- // 'logo': '/uploads/images/2022/8/masc3iMjEPBTC.svg',
291
- // 'accent_color': '#ff8d00',
292
- // 'symbol': 'BTC',
293
- // 'price': '69,497.50',
294
- // 'toman_amount': 4117726875,
295
- // 'min_usdt_value': null,
296
- // 'min_usdt_amount': 15,
297
- // 'max_usdt_amount': 10000,
298
- // 'min_value': null,
299
- // 'max_amount': '0.200000000000',
300
- // 'min_irr_amount': 883500,
301
- // 'max_irr_amount': 589000000,
302
- // 'priority': 1,
303
- // 'price_round_digit': 2,
304
- // 'amount_round_digit': 6,
305
- // 'changes_24h': -2.68,
306
- // 'changes_7d': 7.522256527082521,
307
- // 'trendy': 0,
308
- // 'exchange': null,
309
- // 'categories': [ ],
310
- // 'createdAt': null,
311
- // 'has_staking': true,
312
- // 'staking_plan': {
313
- // 'id': 38,
314
- // 'coin_id': 1,
315
- // 'periods': { '30': '1.2', '60': '1.5', 'flex': '1' },
316
- // 'capacity': '5.00000',
317
- // 'minimum_staking_amount': '0.00150',
318
- // 'maximum_staking_amount': '1.00000',
319
- // 'total_staked': '5.00000',
320
- // 'largest_benefit': 1.5,
321
- // 'trendy': 0,
322
- // 'status': 'COMPLETED',
323
- // 'info': 'رمزارز مورد نظر PoS نیست و پاداش حاصل از نگه‌داری آن از طریق دیفای استیکینگ تامین می‌شود.',
324
- // 'created_at': '2023-07-15T13:01:25.000000Z',
325
- // 'updated_at': '2024-06-01T14:56:40.000000Z',
326
- // 'deleted_at': null,
327
- // 'priority': 18,
328
- // },
329
- // }
330
- const marketType = 'spot';
331
- const marketId = this.safeString(ticker, 'id');
332
- const quote = this.safeString(ticker, 'quote');
333
- const symbol = this.safeSymbol(marketId, market, undefined, marketType);
334
- let last = parseFloat(this.safeString(ticker, 'price', '').replace(',', ''));
335
- if (quote === 'IRT') {
336
- last = this.safeFloat(ticker, 'toman_amount', 0);
337
- }
338
- const change = this.safeFloat(ticker, 'changes_24h', 0);
339
- return this.safeTicker({
340
- 'symbol': symbol,
341
- 'timestamp': undefined,
342
- 'datetime': undefined,
343
- 'high': undefined,
344
- 'low': undefined,
345
- 'bid': undefined,
346
- 'bidVolume': undefined,
347
- 'ask': undefined,
348
- 'askVolume': undefined,
349
- 'vwap': undefined,
350
- 'open': undefined,
351
- 'close': last,
352
- 'last': last,
353
- 'previousClose': undefined,
354
- 'change': change,
355
- 'percentage': undefined,
356
- 'average': undefined,
357
- 'baseVolume': undefined,
358
- 'quoteVolume': undefined,
359
- 'info': ticker,
360
- }, market);
361
- }
362
- sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
363
- const url = this.urls['api']['public'] + '/' + path;
364
- headers = { 'Content-Type': 'application/json' };
365
- return { 'url': url, 'method': method, 'body': body, 'headers': headers };
366
- }
367
- }
7
+ // ---------------------------------------------------------------------------
8
+ import Exchange from './abstract/tetherland.js';
9
+ // ---------------------------------------------------------------------------
10
+ /**
11
+ * @class tetherland
12
+ * @augments Exchange
13
+ * @description Set rateLimit to 1000 if fully verified
14
+ */
15
+ export default class tetherland extends Exchange {
16
+ describe() {
17
+ return this.deepExtend(super.describe(), {
18
+ 'id': 'tetherland',
19
+ 'name': 'TetherLand',
20
+ 'countries': ['IR'],
21
+ 'rateLimit': 1000,
22
+ 'version': '1',
23
+ 'certified': false,
24
+ 'pro': false,
25
+ 'has': {
26
+ 'CORS': undefined,
27
+ 'spot': true,
28
+ 'margin': false,
29
+ 'swap': false,
30
+ 'future': 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
+ '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/tetherland/64x64.png',
91
+ 'api': {
92
+ 'public': 'https://service.tetherland.com',
93
+ },
94
+ 'www': 'https://tetherland.org',
95
+ 'doc': [
96
+ 'https://docs.tetherland.com/docs/tetherland/71ca11f41704f-user-api',
97
+ ],
98
+ },
99
+ 'api': {
100
+ 'public': {
101
+ 'get': {
102
+ 'api/v5/currencies': 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 tetherland#fetchMarkets
120
+ * @description retrieves data on all markets for tetherland
121
+ * @see https://docs.tetherland.com/docs/tetherland/71ca11f41704f-user-api
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.publicGetApiV5Currencies(params);
126
+ const markets = this.safeList(response, 'data');
127
+ const result = [];
128
+ const quotes = ['USDT', 'IRT'];
129
+ for (let i = 0; i < markets.length; i++) {
130
+ for (let key = 0; key < quotes.length; key++) {
131
+ if (markets[i]['symbol'] === 'USDT' && quotes[key] === 'USDT') {
132
+ continue;
133
+ }
134
+ markets[i]['quote'] = quotes[key];
135
+ const market = this.parseMarket(markets[i]);
136
+ result.push(market);
137
+ }
138
+ }
139
+ return result;
140
+ }
141
+ parseMarket(market) {
142
+ // {
143
+ // 'name': 'Bitcoin',
144
+ // 'fa_name': 'بیت کوین',
145
+ // 'logo': '/uploads/images/2022/8/masc3iMjEPBTC.svg',
146
+ // 'accent_color': '#ff8d00',
147
+ // 'symbol': 'BTC',
148
+ // 'price': '69,497.50',
149
+ // 'toman_amount': 4117726875,
150
+ // 'min_usdt_value': null,
151
+ // 'min_usdt_amount': 15,
152
+ // 'max_usdt_amount': 10000,
153
+ // 'min_value': null,
154
+ // 'max_amount': '0.200000000000',
155
+ // 'min_irr_amount': 883500,
156
+ // 'max_irr_amount': 589000000,
157
+ // 'priority': 1,
158
+ // 'price_round_digit': 2,
159
+ // 'amount_round_digit': 6,
160
+ // 'changes_24h': -2.68,
161
+ // 'changes_7d': 7.522256527082521,
162
+ // 'trendy': 0,
163
+ // 'exchange': null,
164
+ // 'categories': [ ],
165
+ // 'createdAt': null,
166
+ // 'has_staking': true,
167
+ // 'staking_plan': {
168
+ // 'id': 38,
169
+ // 'coin_id': 1,
170
+ // 'periods': { '30': '1.2', '60': '1.5', 'flex': '1' },
171
+ // 'capacity': '5.00000',
172
+ // 'minimum_staking_amount': '0.00150',
173
+ // 'maximum_staking_amount': '1.00000',
174
+ // 'total_staked': '5.00000',
175
+ // 'largest_benefit': 1.5,
176
+ // 'trendy': 0,
177
+ // 'status': 'COMPLETED',
178
+ // 'info': 'رمزارز مورد نظر PoS نیست و پاداش حاصل از نگه‌داری آن از طریق دیفای استیکینگ تامین می‌شود.',
179
+ // 'created_at': '2023-07-15T13:01:25.000000Z',
180
+ // 'updated_at': '2024-06-01T14:56:40.000000Z',
181
+ // 'deleted_at': null,
182
+ // 'priority': 18,
183
+ // },
184
+ // }
185
+ let [baseId, quoteId] = [this.safeString(market, 'symbol'), this.safeString(market, 'quote')];
186
+ const base = this.safeCurrencyCode(baseId);
187
+ const quote = this.safeCurrencyCode(quoteId);
188
+ const id = base + '/' + quote;
189
+ baseId = baseId.toLowerCase();
190
+ quoteId = quoteId.toLowerCase();
191
+ return {
192
+ 'id': id,
193
+ 'symbol': base + '/' + quote,
194
+ 'base': base,
195
+ 'quote': quote,
196
+ 'settle': undefined,
197
+ 'baseId': baseId,
198
+ 'quoteId': quoteId,
199
+ 'settleId': undefined,
200
+ 'type': 'spot',
201
+ 'spot': true,
202
+ 'margin': false,
203
+ 'swap': false,
204
+ 'future': false,
205
+ 'option': false,
206
+ 'active': true,
207
+ 'contract': false,
208
+ 'linear': undefined,
209
+ 'inverse': undefined,
210
+ 'contractSize': undefined,
211
+ 'expiry': undefined,
212
+ 'expiryDatetime': undefined,
213
+ 'strike': undefined,
214
+ 'optionType': undefined,
215
+ 'precision': {
216
+ 'amount': undefined,
217
+ 'price': undefined,
218
+ },
219
+ 'limits': {
220
+ 'leverage': {
221
+ 'min': undefined,
222
+ 'max': undefined,
223
+ },
224
+ 'amount': {
225
+ 'min': undefined,
226
+ 'max': undefined,
227
+ },
228
+ 'price': {
229
+ 'min': undefined,
230
+ 'max': undefined,
231
+ },
232
+ 'cost': {
233
+ 'min': undefined,
234
+ 'max': undefined,
235
+ },
236
+ },
237
+ 'created': undefined,
238
+ 'info': market,
239
+ };
240
+ }
241
+ async fetchTickers(symbols = undefined, params = {}) {
242
+ /**
243
+ * @method
244
+ * @name tetherland#fetchTickers
245
+ * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
246
+ * @see https://docs.tetherland.com/docs/tetherland/71ca11f41704f-user-api
247
+ * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
248
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
249
+ * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
250
+ */
251
+ await this.loadMarkets();
252
+ if (symbols !== undefined) {
253
+ symbols = this.marketSymbols(symbols);
254
+ }
255
+ const response = await this.publicGetApiV5Currencies(params);
256
+ const markets = this.safeList(response, 'data');
257
+ const result = {};
258
+ const quotes = ['USDT', 'IRT'];
259
+ for (let i = 0; i < markets.length; i++) {
260
+ for (let key = 0; key < quotes.length; key++) {
261
+ if (markets[i]['symbol'] === 'USDT' && quotes[key] === 'USDT') {
262
+ continue;
263
+ }
264
+ markets[i]['quote'] = quotes[key];
265
+ markets[i]['id'] = markets[i]['symbol'] + '/' + markets[i]['quote'];
266
+ const market = this.parseTicker(markets[i]);
267
+ const symbol = market['symbol'];
268
+ result[symbol] = market;
269
+ }
270
+ }
271
+ return this.filterByArrayTickers(result, 'symbol', symbols);
272
+ }
273
+ async fetchTicker(symbol, params = {}) {
274
+ /**
275
+ * @method
276
+ * @name tetherland#fetchTicker
277
+ * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
278
+ * @see https://docs.tetherland.com/docs/tetherland/71ca11f41704f-user-api
279
+ * @param {string} symbol unified symbol of the market to fetch the ticker for
280
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
281
+ * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
282
+ */
283
+ const ticker = await this.fetchTickers([symbol]);
284
+ return ticker[symbol];
285
+ }
286
+ parseTicker(ticker, market = undefined) {
287
+ // {
288
+ // 'name': 'Bitcoin',
289
+ // 'fa_name': 'بیت کوین',
290
+ // 'logo': '/uploads/images/2022/8/masc3iMjEPBTC.svg',
291
+ // 'accent_color': '#ff8d00',
292
+ // 'symbol': 'BTC',
293
+ // 'price': '69,497.50',
294
+ // 'toman_amount': 4117726875,
295
+ // 'min_usdt_value': null,
296
+ // 'min_usdt_amount': 15,
297
+ // 'max_usdt_amount': 10000,
298
+ // 'min_value': null,
299
+ // 'max_amount': '0.200000000000',
300
+ // 'min_irr_amount': 883500,
301
+ // 'max_irr_amount': 589000000,
302
+ // 'priority': 1,
303
+ // 'price_round_digit': 2,
304
+ // 'amount_round_digit': 6,
305
+ // 'changes_24h': -2.68,
306
+ // 'changes_7d': 7.522256527082521,
307
+ // 'trendy': 0,
308
+ // 'exchange': null,
309
+ // 'categories': [ ],
310
+ // 'createdAt': null,
311
+ // 'has_staking': true,
312
+ // 'staking_plan': {
313
+ // 'id': 38,
314
+ // 'coin_id': 1,
315
+ // 'periods': { '30': '1.2', '60': '1.5', 'flex': '1' },
316
+ // 'capacity': '5.00000',
317
+ // 'minimum_staking_amount': '0.00150',
318
+ // 'maximum_staking_amount': '1.00000',
319
+ // 'total_staked': '5.00000',
320
+ // 'largest_benefit': 1.5,
321
+ // 'trendy': 0,
322
+ // 'status': 'COMPLETED',
323
+ // 'info': 'رمزارز مورد نظر PoS نیست و پاداش حاصل از نگه‌داری آن از طریق دیفای استیکینگ تامین می‌شود.',
324
+ // 'created_at': '2023-07-15T13:01:25.000000Z',
325
+ // 'updated_at': '2024-06-01T14:56:40.000000Z',
326
+ // 'deleted_at': null,
327
+ // 'priority': 18,
328
+ // },
329
+ // }
330
+ const marketType = 'spot';
331
+ const marketId = this.safeString(ticker, 'id');
332
+ const quote = this.safeString(ticker, 'quote');
333
+ const symbol = this.safeSymbol(marketId, market, undefined, marketType);
334
+ let last = parseFloat(this.safeString(ticker, 'price', '').replace(',', ''));
335
+ if (quote === 'IRT') {
336
+ last = this.safeFloat(ticker, 'toman_amount', 0);
337
+ }
338
+ const change = this.safeFloat(ticker, 'changes_24h', 0);
339
+ return this.safeTicker({
340
+ 'symbol': symbol,
341
+ 'timestamp': undefined,
342
+ 'datetime': undefined,
343
+ 'high': undefined,
344
+ 'low': undefined,
345
+ 'bid': undefined,
346
+ 'bidVolume': undefined,
347
+ 'ask': undefined,
348
+ 'askVolume': undefined,
349
+ 'vwap': undefined,
350
+ 'open': undefined,
351
+ 'close': last,
352
+ 'last': last,
353
+ 'previousClose': undefined,
354
+ 'change': change,
355
+ 'percentage': undefined,
356
+ 'average': undefined,
357
+ 'baseVolume': undefined,
358
+ 'quoteVolume': undefined,
359
+ 'info': ticker,
360
+ }, market);
361
+ }
362
+ sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
363
+ const url = this.urls['api']['public'] + '/' + path;
364
+ headers = { 'Content-Type': 'application/json' };
365
+ return { 'url': url, 'method': method, 'body': body, 'headers': headers };
366
+ }
367
+ }