ccxt-ir 4.9.13 → 4.9.14

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 (82) hide show
  1. package/README.md +3 -3
  2. package/dist/ccxt.browser.min.js +2 -2
  3. package/dist/cjs/ccxt.js +229 -229
  4. package/dist/cjs/package.json +1 -1
  5. package/dist/cjs/src/abantether.js +344 -344
  6. package/dist/cjs/src/abstract/bitbarg.js +1 -1
  7. package/dist/cjs/src/abstract/bydfi.js +1 -1
  8. package/dist/cjs/src/abstract/cafearz.js +1 -1
  9. package/dist/cjs/src/abstract/hamtapay.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/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 +291 -291
  20. package/dist/cjs/src/kifpoolme.js +401 -401
  21. package/dist/cjs/src/mazdax.js +525 -526
  22. package/dist/cjs/src/pingi.js +437 -438
  23. package/dist/cjs/src/pooleno.js +338 -338
  24. package/dist/cjs/src/tetherland.js +358 -358
  25. package/dist/cjs/src/twox.js +362 -362
  26. package/js/ccxt.d.ts +673 -673
  27. package/js/ccxt.js +491 -491
  28. package/js/src/abantether.js +347 -347
  29. package/js/src/abstract/abantether.d.ts +8 -8
  30. package/js/src/abstract/arzplus.d.ts +11 -11
  31. package/js/src/abstract/bitbarg.d.ts +8 -8
  32. package/js/src/abstract/bitbarg.js +5 -5
  33. package/js/src/abstract/bydfi.d.ts +11 -11
  34. package/js/src/abstract/bydfi.js +5 -5
  35. package/js/src/abstract/cafearz.d.ts +8 -8
  36. package/js/src/abstract/cafearz.js +5 -5
  37. package/js/src/abstract/hamtapay.d.ts +9 -9
  38. package/js/src/abstract/hamtapay.js +5 -5
  39. package/js/src/abstract/kifpoolme.d.ts +9 -9
  40. package/js/src/abstract/kifpoolme.js +5 -5
  41. package/js/src/abstract/mazdax.d.ts +11 -11
  42. package/js/src/abstract/mazdax.js +5 -5
  43. package/js/src/abstract/pingi.d.ts +9 -9
  44. package/js/src/abstract/pingi.js +5 -5
  45. package/js/src/abstract/pooleno.d.ts +8 -8
  46. package/js/src/abstract/pooleno.js +5 -5
  47. package/js/src/afratether.js +350 -350
  48. package/js/src/arzplus.d.ts +26 -26
  49. package/js/src/arzplus.js +575 -575
  50. package/js/src/base/Exchange.d.ts +926 -926
  51. package/js/src/base/types.d.ts +586 -586
  52. package/js/src/bitbarg.d.ts +21 -21
  53. package/js/src/bitbarg.js +306 -306
  54. package/js/src/bydfi.d.ts +23 -23
  55. package/js/src/bydfi.js +428 -428
  56. package/js/src/cafearz.d.ts +21 -21
  57. package/js/src/cafearz.js +340 -340
  58. package/js/src/coinbaseexchange.d.ts +334 -334
  59. package/js/src/hamtapay.d.ts +21 -21
  60. package/js/src/hamtapay.js +294 -294
  61. package/js/src/kifpoolme.d.ts +23 -23
  62. package/js/src/kifpoolme.js +404 -404
  63. package/js/src/mazdax.d.ts +23 -23
  64. package/js/src/mazdax.js +528 -529
  65. package/js/src/pingi.d.ts +22 -22
  66. package/js/src/pingi.js +440 -441
  67. package/js/src/pooleno.d.ts +21 -21
  68. package/js/src/pooleno.js +341 -341
  69. package/js/src/protobuf/mexc/compiled.d.cts +2 -2
  70. package/js/src/static_dependencies/fflake/browser.d.ts +222 -222
  71. package/js/src/static_dependencies/jsencrypt/lib/asn1js/asn1.d.ts +51 -51
  72. package/js/src/static_dependencies/jsencrypt/lib/jsbn/jsbn.d.ts +101 -101
  73. package/js/src/static_dependencies/noble-curves/abstract/weierstrass.d.ts +204 -204
  74. package/js/src/static_dependencies/qs/formats.d.cts +8 -8
  75. package/js/src/static_dependencies/qs/index.d.cts +4 -4
  76. package/js/src/static_dependencies/qs/parse.d.cts +2 -2
  77. package/js/src/static_dependencies/qs/stringify.d.cts +2 -2
  78. package/js/src/static_dependencies/qs/utils.d.cts +9 -9
  79. package/js/src/static_dependencies/starknet/utils/calldata/parser/index.d.ts +5 -5
  80. package/js/src/tetherland.js +361 -361
  81. package/js/src/twox.js +365 -365
  82. package/package.json +1 -1
package/js/src/pooleno.js CHANGED
@@ -4,344 +4,344 @@
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/pooleno.js';
9
- // ---------------------------------------------------------------------------
10
- /**
11
- * @class pooleno
12
- * @augments Exchange
13
- * @description Set rateLimit to 1000 if fully verified
14
- */
15
- export default class pooleno extends Exchange {
16
- describe() {
17
- return this.deepExtend(super.describe(), {
18
- 'id': 'pooleno',
19
- 'name': 'Pooleno',
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/pooleno/64x64.png',
91
- 'api': {
92
- 'public': 'https://api-beta.pooleno.ir',
93
- },
94
- 'www': 'https://pooleno.ir',
95
- 'doc': [
96
- 'https://pooleno.ir',
97
- ],
98
- },
99
- 'api': {
100
- 'public': {
101
- 'get': {
102
- 'api/v1/tokens/public': 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 pooleno#fetchMarkets
120
- * @description retrieves data on all markets for pooleno
121
- * @see https://api-beta.pooleno.ir/api/v1/tokens/public
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.publicGetApiV1TokensPublic(params);
126
- const payload = this.safeList(response, 'payload', []);
127
- const result = [];
128
- for (let i = 0; i < payload.length; i++) {
129
- const token = payload[i];
130
- const baseAsset = this.safeString(token, 'baseAsset');
131
- const quoteAsset = this.safeString(token, 'quoteAsset');
132
- // Skip if base equals quote
133
- if (baseAsset === quoteAsset) {
134
- continue;
135
- }
136
- const market = this.parseMarket(token);
137
- result.push(market);
138
- }
139
- return result;
140
- }
141
- parseMarket(market) {
142
- // {
143
- // "baseAsset": "USDT",
144
- // "quoteAsset": "TMN",
145
- // "symbolName": "USDT",
146
- // "longEnName": "Tether",
147
- // "longFaName": "تتر",
148
- // "createdAt": "2025-02-25T13:47:27.102Z",
149
- // "id": "cm43t74jo00000hrm8tw9aspo",
150
- // "price": "1",
151
- // "priceTMN": "112950",
152
- // "sparkline": {
153
- // "data": [...],
154
- // "change": -538,
155
- // "percentage": -0.48,
156
- // "isPositive": false
157
- // },
158
- // "market": {
159
- // "totalSupply": null,
160
- // "maxSupply": null,
161
- // "circulatingSupply": null,
162
- // "volume24hBase": null,
163
- // "high24h": null,
164
- // "low24h": null,
165
- // "volume24h": null,
166
- // "marketCap": null
167
- // },
168
- // "blockchains": [...]
169
- // }
170
- let baseId = this.safeString(market, 'baseAsset');
171
- let quoteId = this.safeString(market, 'quoteAsset');
172
- const base = this.safeCurrencyCode(baseId);
173
- const quote = this.safeCurrencyCode(quoteId);
174
- const id = base + quote;
175
- baseId = baseId.toLowerCase();
176
- quoteId = quoteId.toLowerCase();
177
- return {
178
- 'id': id,
179
- 'symbol': base + '/' + quote,
180
- 'base': base,
181
- 'quote': quote,
182
- 'settle': undefined,
183
- 'baseId': baseId,
184
- 'quoteId': quoteId,
185
- 'settleId': undefined,
186
- 'type': 'spot',
187
- 'spot': true,
188
- 'margin': false,
189
- 'swap': false,
190
- 'future': false,
191
- 'option': false,
192
- 'active': true,
193
- 'contract': false,
194
- 'linear': undefined,
195
- 'inverse': undefined,
196
- 'contractSize': undefined,
197
- 'expiry': undefined,
198
- 'expiryDatetime': undefined,
199
- 'strike': undefined,
200
- 'optionType': undefined,
201
- 'precision': {
202
- 'amount': undefined,
203
- 'price': undefined,
204
- },
205
- 'limits': {
206
- 'leverage': {
207
- 'min': undefined,
208
- 'max': undefined,
209
- },
210
- 'amount': {
211
- 'min': undefined,
212
- 'max': undefined,
213
- },
214
- 'price': {
215
- 'min': undefined,
216
- 'max': undefined,
217
- },
218
- 'cost': {
219
- 'min': undefined,
220
- 'max': undefined,
221
- },
222
- },
223
- 'created': undefined,
224
- 'info': market,
225
- };
226
- }
227
- async fetchTickers(symbols = undefined, params = {}) {
228
- /**
229
- * @method
230
- * @name pooleno#fetchTickers
231
- * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
232
- * @see https://api-beta.pooleno.ir/api/v1/tokens/public
233
- * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
234
- * @param {object} [params] extra parameters specific to the exchange API endpoint
235
- * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
236
- */
237
- await this.loadMarkets();
238
- if (symbols !== undefined) {
239
- symbols = this.marketSymbols(symbols);
240
- }
241
- const response = await this.publicGetApiV1TokensPublic(params);
242
- const payload = this.safeList(response, 'payload', []);
243
- const result = {};
244
- for (let i = 0; i < payload.length; i++) {
245
- const token = payload[i];
246
- const ticker = this.parseTicker(token);
247
- const symbol = ticker['symbol'];
248
- result[symbol] = ticker;
249
- }
250
- return this.filterByArrayTickers(result, 'symbol', symbols);
251
- }
252
- async fetchTicker(symbol, params = {}) {
253
- /**
254
- * @method
255
- * @name pooleno#fetchTicker
256
- * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
257
- * @see https://api-beta.pooleno.ir/api/v1/tokens/public
258
- * @param {string} symbol unified symbol of the market to fetch the ticker for
259
- * @param {object} [params] extra parameters specific to the exchange API endpoint
260
- * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
261
- */
262
- const ticker = await this.fetchTickers([symbol]);
263
- return ticker[symbol];
264
- }
265
- parseTicker(ticker, market = undefined) {
266
- // {
267
- // "baseAsset": "BTC",
268
- // "quoteAsset": "USDT",
269
- // "symbolName": "BTC",
270
- // "longEnName": "Bitcoin",
271
- // "longFaName": "بیتکوین",
272
- // "createdAt": "2025-02-25T13:47:27.103Z",
273
- // "id": "cm43t74jp00010hrmed9i7l76",
274
- // "price": "115024.7",
275
- // "priceTMN": "12980537395",
276
- // "sparkline": {
277
- // "data": [...],
278
- // "change": -538,
279
- // "percentage": -0.48,
280
- // "isPositive": false
281
- // },
282
- // "market": {
283
- // "totalSupply": null,
284
- // "maxSupply": null,
285
- // "circulatingSupply": null,
286
- // "volume24hBase": null,
287
- // "high24h": null,
288
- // "low24h": null,
289
- // "volume24h": null,
290
- // "marketCap": null
291
- // },
292
- // "blockchains": [...]
293
- // }
294
- const marketType = 'spot';
295
- const baseAsset = this.safeString(ticker, 'baseAsset');
296
- const quoteAsset = this.safeString(ticker, 'quoteAsset');
297
- const marketId = baseAsset + '/' + quoteAsset;
298
- const symbol = this.safeSymbol(marketId, market, undefined, marketType);
299
- const price = this.safeFloat(ticker, 'price');
300
- const priceTMN = this.safeFloat(ticker, 'priceTMN');
301
- const sparkline = this.safeDict(ticker, 'sparkline', {});
302
- const change = this.safeFloat(sparkline, 'change');
303
- const percentage = this.safeFloat(sparkline, 'percentage');
304
- const marketData = this.safeDict(ticker, 'market', {});
305
- const high24h = this.safeFloat(marketData, 'high24h');
306
- const low24h = this.safeFloat(marketData, 'low24h');
307
- const volume24h = this.safeFloat(marketData, 'volume24h');
308
- let last = undefined;
309
- let baseVolume = undefined;
310
- if (quoteAsset === 'TMN' || quoteAsset === 'IRT') {
311
- // For TMN/IRT pairs, use priceTMN
312
- last = priceTMN;
313
- }
314
- else {
315
- // For other pairs (like USDT), use price
316
- last = price;
317
- baseVolume = volume24h;
318
- }
319
- return this.safeTicker({
320
- 'symbol': symbol,
321
- 'timestamp': undefined,
322
- 'datetime': undefined,
323
- 'high': high24h,
324
- 'low': low24h,
325
- 'bid': last,
326
- 'bidVolume': undefined,
327
- 'ask': last,
328
- 'askVolume': undefined,
329
- 'vwap': undefined,
330
- 'open': undefined,
331
- 'close': last,
332
- 'last': last,
333
- 'previousClose': undefined,
334
- 'change': change,
335
- 'percentage': percentage,
336
- 'average': undefined,
337
- 'baseVolume': baseVolume,
338
- 'quoteVolume': undefined,
339
- 'info': ticker,
340
- }, market);
341
- }
342
- sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
343
- const url = this.urls['api']['public'] + '/' + path;
344
- headers = { 'Content-Type': 'application/json' };
345
- return { 'url': url, 'method': method, 'body': body, 'headers': headers };
346
- }
347
- }
7
+ // ---------------------------------------------------------------------------
8
+ import Exchange from './abstract/pooleno.js';
9
+ // ---------------------------------------------------------------------------
10
+ /**
11
+ * @class pooleno
12
+ * @augments Exchange
13
+ * @description Set rateLimit to 1000 if fully verified
14
+ */
15
+ export default class pooleno extends Exchange {
16
+ describe() {
17
+ return this.deepExtend(super.describe(), {
18
+ 'id': 'pooleno',
19
+ 'name': 'Pooleno',
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/pooleno/64x64.png',
91
+ 'api': {
92
+ 'public': 'https://api-beta.pooleno.ir',
93
+ },
94
+ 'www': 'https://pooleno.ir',
95
+ 'doc': [
96
+ 'https://pooleno.ir',
97
+ ],
98
+ },
99
+ 'api': {
100
+ 'public': {
101
+ 'get': {
102
+ 'api/v1/tokens/public': 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 pooleno#fetchMarkets
120
+ * @description retrieves data on all markets for pooleno
121
+ * @see https://api-beta.pooleno.ir/api/v1/tokens/public
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.publicGetApiV1TokensPublic(params);
126
+ const payload = this.safeList(response, 'payload', []);
127
+ const result = [];
128
+ for (let i = 0; i < payload.length; i++) {
129
+ const token = payload[i];
130
+ const baseAsset = this.safeString(token, 'baseAsset');
131
+ const quoteAsset = this.safeString(token, 'quoteAsset');
132
+ // Skip if base equals quote
133
+ if (baseAsset === quoteAsset) {
134
+ continue;
135
+ }
136
+ const market = this.parseMarket(token);
137
+ result.push(market);
138
+ }
139
+ return result;
140
+ }
141
+ parseMarket(market) {
142
+ // {
143
+ // "baseAsset": "USDT",
144
+ // "quoteAsset": "TMN",
145
+ // "symbolName": "USDT",
146
+ // "longEnName": "Tether",
147
+ // "longFaName": "تتر",
148
+ // "createdAt": "2025-02-25T13:47:27.102Z",
149
+ // "id": "cm43t74jo00000hrm8tw9aspo",
150
+ // "price": "1",
151
+ // "priceTMN": "112950",
152
+ // "sparkline": {
153
+ // "data": [...],
154
+ // "change": -538,
155
+ // "percentage": -0.48,
156
+ // "isPositive": false
157
+ // },
158
+ // "market": {
159
+ // "totalSupply": null,
160
+ // "maxSupply": null,
161
+ // "circulatingSupply": null,
162
+ // "volume24hBase": null,
163
+ // "high24h": null,
164
+ // "low24h": null,
165
+ // "volume24h": null,
166
+ // "marketCap": null
167
+ // },
168
+ // "blockchains": [...]
169
+ // }
170
+ let baseId = this.safeString(market, 'baseAsset');
171
+ let quoteId = this.safeString(market, 'quoteAsset');
172
+ const base = this.safeCurrencyCode(baseId);
173
+ const quote = this.safeCurrencyCode(quoteId);
174
+ const id = base + quote;
175
+ baseId = baseId.toLowerCase();
176
+ quoteId = quoteId.toLowerCase();
177
+ return {
178
+ 'id': id,
179
+ 'symbol': base + '/' + quote,
180
+ 'base': base,
181
+ 'quote': quote,
182
+ 'settle': undefined,
183
+ 'baseId': baseId,
184
+ 'quoteId': quoteId,
185
+ 'settleId': undefined,
186
+ 'type': 'spot',
187
+ 'spot': true,
188
+ 'margin': false,
189
+ 'swap': false,
190
+ 'future': false,
191
+ 'option': false,
192
+ 'active': true,
193
+ 'contract': false,
194
+ 'linear': undefined,
195
+ 'inverse': undefined,
196
+ 'contractSize': undefined,
197
+ 'expiry': undefined,
198
+ 'expiryDatetime': undefined,
199
+ 'strike': undefined,
200
+ 'optionType': undefined,
201
+ 'precision': {
202
+ 'amount': undefined,
203
+ 'price': undefined,
204
+ },
205
+ 'limits': {
206
+ 'leverage': {
207
+ 'min': undefined,
208
+ 'max': undefined,
209
+ },
210
+ 'amount': {
211
+ 'min': undefined,
212
+ 'max': undefined,
213
+ },
214
+ 'price': {
215
+ 'min': undefined,
216
+ 'max': undefined,
217
+ },
218
+ 'cost': {
219
+ 'min': undefined,
220
+ 'max': undefined,
221
+ },
222
+ },
223
+ 'created': undefined,
224
+ 'info': market,
225
+ };
226
+ }
227
+ async fetchTickers(symbols = undefined, params = {}) {
228
+ /**
229
+ * @method
230
+ * @name pooleno#fetchTickers
231
+ * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
232
+ * @see https://api-beta.pooleno.ir/api/v1/tokens/public
233
+ * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
234
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
235
+ * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
236
+ */
237
+ await this.loadMarkets();
238
+ if (symbols !== undefined) {
239
+ symbols = this.marketSymbols(symbols);
240
+ }
241
+ const response = await this.publicGetApiV1TokensPublic(params);
242
+ const payload = this.safeList(response, 'payload', []);
243
+ const result = {};
244
+ for (let i = 0; i < payload.length; i++) {
245
+ const token = payload[i];
246
+ const ticker = this.parseTicker(token);
247
+ const symbol = ticker['symbol'];
248
+ result[symbol] = ticker;
249
+ }
250
+ return this.filterByArrayTickers(result, 'symbol', symbols);
251
+ }
252
+ async fetchTicker(symbol, params = {}) {
253
+ /**
254
+ * @method
255
+ * @name pooleno#fetchTicker
256
+ * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
257
+ * @see https://api-beta.pooleno.ir/api/v1/tokens/public
258
+ * @param {string} symbol unified symbol of the market to fetch the ticker for
259
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
260
+ * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
261
+ */
262
+ const ticker = await this.fetchTickers([symbol]);
263
+ return ticker[symbol];
264
+ }
265
+ parseTicker(ticker, market = undefined) {
266
+ // {
267
+ // "baseAsset": "BTC",
268
+ // "quoteAsset": "USDT",
269
+ // "symbolName": "BTC",
270
+ // "longEnName": "Bitcoin",
271
+ // "longFaName": "بیتکوین",
272
+ // "createdAt": "2025-02-25T13:47:27.103Z",
273
+ // "id": "cm43t74jp00010hrmed9i7l76",
274
+ // "price": "115024.7",
275
+ // "priceTMN": "12980537395",
276
+ // "sparkline": {
277
+ // "data": [...],
278
+ // "change": -538,
279
+ // "percentage": -0.48,
280
+ // "isPositive": false
281
+ // },
282
+ // "market": {
283
+ // "totalSupply": null,
284
+ // "maxSupply": null,
285
+ // "circulatingSupply": null,
286
+ // "volume24hBase": null,
287
+ // "high24h": null,
288
+ // "low24h": null,
289
+ // "volume24h": null,
290
+ // "marketCap": null
291
+ // },
292
+ // "blockchains": [...]
293
+ // }
294
+ const marketType = 'spot';
295
+ const baseAsset = this.safeString(ticker, 'baseAsset');
296
+ const quoteAsset = this.safeString(ticker, 'quoteAsset');
297
+ const marketId = baseAsset + '/' + quoteAsset;
298
+ const symbol = this.safeSymbol(marketId, market, undefined, marketType);
299
+ const price = this.safeFloat(ticker, 'price');
300
+ const priceTMN = this.safeFloat(ticker, 'priceTMN');
301
+ const sparkline = this.safeDict(ticker, 'sparkline', {});
302
+ const change = this.safeFloat(sparkline, 'change');
303
+ const percentage = this.safeFloat(sparkline, 'percentage');
304
+ const marketData = this.safeDict(ticker, 'market', {});
305
+ const high24h = this.safeFloat(marketData, 'high24h');
306
+ const low24h = this.safeFloat(marketData, 'low24h');
307
+ const volume24h = this.safeFloat(marketData, 'volume24h');
308
+ let last = undefined;
309
+ let baseVolume = undefined;
310
+ if (quoteAsset === 'TMN' || quoteAsset === 'IRT') {
311
+ // For TMN/IRT pairs, use priceTMN
312
+ last = priceTMN;
313
+ }
314
+ else {
315
+ // For other pairs (like USDT), use price
316
+ last = price;
317
+ baseVolume = volume24h;
318
+ }
319
+ return this.safeTicker({
320
+ 'symbol': symbol,
321
+ 'timestamp': undefined,
322
+ 'datetime': undefined,
323
+ 'high': high24h,
324
+ 'low': low24h,
325
+ 'bid': last,
326
+ 'bidVolume': undefined,
327
+ 'ask': last,
328
+ 'askVolume': undefined,
329
+ 'vwap': undefined,
330
+ 'open': undefined,
331
+ 'close': last,
332
+ 'last': last,
333
+ 'previousClose': undefined,
334
+ 'change': change,
335
+ 'percentage': percentage,
336
+ 'average': undefined,
337
+ 'baseVolume': baseVolume,
338
+ 'quoteVolume': undefined,
339
+ 'info': ticker,
340
+ }, market);
341
+ }
342
+ sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
343
+ const url = this.urls['api']['public'] + '/' + path;
344
+ headers = { 'Content-Type': 'application/json' };
345
+ return { 'url': url, 'method': method, 'body': body, 'headers': headers };
346
+ }
347
+ }