ccxt-ir 4.9.3 → 4.9.10

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 (79) hide show
  1. package/README.md +7 -7
  2. package/dist/ccxt.browser.min.js +4 -4
  3. package/dist/cjs/ccxt.js +25 -1
  4. package/dist/cjs/src/abantether.js +88 -69
  5. package/dist/cjs/src/abstract/bitbarg.js +11 -0
  6. package/dist/cjs/src/abstract/bydfi.js +11 -0
  7. package/dist/cjs/src/abstract/cafearz.js +11 -0
  8. package/dist/cjs/src/abstract/hamtapay.js +11 -0
  9. package/dist/cjs/src/abstract/kifpoolme.js +11 -0
  10. package/dist/cjs/src/abstract/mazdax.js +11 -0
  11. package/dist/cjs/src/abstract/pingi.js +11 -0
  12. package/dist/cjs/src/abstract/pooleno.js +11 -0
  13. package/dist/cjs/src/afratether.js +84 -36
  14. package/dist/cjs/src/arzplus.js +33 -16
  15. package/dist/cjs/src/bitbarg.js +313 -0
  16. package/dist/cjs/src/bydfi.js +435 -0
  17. package/dist/cjs/src/cafearz.js +347 -0
  18. package/dist/cjs/src/hamtapay.js +300 -0
  19. package/dist/cjs/src/kifpoolme.js +411 -0
  20. package/dist/cjs/src/mazdax.js +536 -0
  21. package/dist/cjs/src/pingi.js +448 -0
  22. package/dist/cjs/src/pooleno.js +348 -0
  23. package/dist/cjs/src/tetherland.js +8 -4
  24. package/dist/cjs/src/twox.js +55 -28
  25. package/js/ccxt.d.ts +26 -2
  26. package/js/ccxt.js +18 -2
  27. package/js/src/abantether.js +88 -69
  28. package/js/src/abstract/abantether.d.ts +1 -1
  29. package/js/src/abstract/bitbarg.d.ts +8 -0
  30. package/js/src/abstract/bitbarg.js +11 -0
  31. package/js/src/abstract/bydfi.d.ts +11 -0
  32. package/js/src/abstract/bydfi.js +11 -0
  33. package/js/src/abstract/cafearz.d.ts +8 -0
  34. package/js/src/abstract/cafearz.js +11 -0
  35. package/js/src/abstract/hamtapay.d.ts +9 -0
  36. package/js/src/abstract/hamtapay.js +11 -0
  37. package/js/src/abstract/kifpoolme.d.ts +9 -0
  38. package/js/src/abstract/kifpoolme.js +11 -0
  39. package/js/src/abstract/mazdax.d.ts +11 -0
  40. package/js/src/abstract/mazdax.js +11 -0
  41. package/js/src/abstract/pingi.d.ts +9 -0
  42. package/js/src/abstract/pingi.js +11 -0
  43. package/js/src/abstract/pooleno.d.ts +8 -0
  44. package/js/src/abstract/pooleno.js +11 -0
  45. package/js/src/afratether.js +84 -36
  46. package/js/src/arzplus.d.ts +4 -3
  47. package/js/src/arzplus.js +33 -16
  48. package/js/src/base/Exchange.d.ts +2 -2
  49. package/js/src/base/types.d.ts +1 -1
  50. package/js/src/bitbarg.d.ts +21 -0
  51. package/js/src/bitbarg.js +312 -0
  52. package/js/src/bydfi.d.ts +23 -0
  53. package/js/src/bydfi.js +434 -0
  54. package/js/src/cafearz.d.ts +21 -0
  55. package/js/src/cafearz.js +346 -0
  56. package/js/src/coinbaseexchange.d.ts +1 -1
  57. package/js/src/hamtapay.d.ts +21 -0
  58. package/js/src/hamtapay.js +299 -0
  59. package/js/src/kifpoolme.d.ts +23 -0
  60. package/js/src/kifpoolme.js +410 -0
  61. package/js/src/mazdax.d.ts +23 -0
  62. package/js/src/mazdax.js +535 -0
  63. package/js/src/pingi.d.ts +22 -0
  64. package/js/src/pingi.js +447 -0
  65. package/js/src/pooleno.d.ts +21 -0
  66. package/js/src/pooleno.js +347 -0
  67. package/js/src/protobuf/mexc/compiled.d.cts +0 -6
  68. package/js/src/static_dependencies/fflake/browser.d.ts +5 -5
  69. package/js/src/static_dependencies/jsencrypt/lib/asn1js/asn1.d.ts +2 -2
  70. package/js/src/static_dependencies/jsencrypt/lib/jsbn/jsbn.d.ts +1 -1
  71. package/js/src/static_dependencies/qs/formats.d.cts +0 -6
  72. package/js/src/static_dependencies/qs/index.d.cts +0 -6
  73. package/js/src/static_dependencies/qs/parse.d.cts +0 -6
  74. package/js/src/static_dependencies/qs/stringify.d.cts +0 -6
  75. package/js/src/static_dependencies/qs/utils.d.cts +0 -6
  76. package/js/src/static_dependencies/starknet/utils/calldata/parser/index.d.ts +1 -1
  77. package/js/src/tetherland.js +5 -4
  78. package/js/src/twox.js +55 -28
  79. package/package.json +1 -1
@@ -0,0 +1,348 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var pooleno$1 = require('./abstract/pooleno.js');
6
+
7
+ // ----------------------------------------------------------------------------
8
+ // ---------------------------------------------------------------------------
9
+ /**
10
+ * @class pooleno
11
+ * @augments Exchange
12
+ * @description Set rateLimit to 1000 if fully verified
13
+ */
14
+ class pooleno extends pooleno$1["default"] {
15
+ describe() {
16
+ return this.deepExtend(super.describe(), {
17
+ 'id': 'pooleno',
18
+ 'name': 'Pooleno',
19
+ 'countries': ['IR'],
20
+ 'rateLimit': 1000,
21
+ 'version': '1',
22
+ 'certified': false,
23
+ 'pro': false,
24
+ 'has': {
25
+ 'CORS': undefined,
26
+ 'spot': true,
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
+ 'setLeverage': false,
83
+ 'setMarginMode': false,
84
+ 'transfer': false,
85
+ 'withdraw': false,
86
+ },
87
+ 'comment': 'This comment is optional',
88
+ 'urls': {
89
+ 'logo': 'https://cdn.arz.digital/cr-odin/img/exchanges/pooleno/64x64.png',
90
+ 'api': {
91
+ 'public': 'https://api-beta.pooleno.ir',
92
+ },
93
+ 'www': 'https://pooleno.ir',
94
+ 'doc': [
95
+ 'https://pooleno.ir',
96
+ ],
97
+ },
98
+ 'api': {
99
+ 'public': {
100
+ 'get': {
101
+ 'api/v1/tokens/public': 1,
102
+ },
103
+ },
104
+ },
105
+ 'fees': {
106
+ 'trading': {
107
+ 'tierBased': false,
108
+ 'percentage': true,
109
+ 'maker': this.parseNumber('0.001'),
110
+ 'taker': this.parseNumber('0.001'),
111
+ },
112
+ },
113
+ });
114
+ }
115
+ async fetchMarkets(params = {}) {
116
+ /**
117
+ * @method
118
+ * @name pooleno#fetchMarkets
119
+ * @description retrieves data on all markets for pooleno
120
+ * @see https://api-beta.pooleno.ir/api/v1/tokens/public
121
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
122
+ * @returns {object[]} an array of objects representing market data
123
+ */
124
+ const response = await this.publicGetApiV1TokensPublic(params);
125
+ const payload = this.safeList(response, 'payload', []);
126
+ const result = [];
127
+ for (let i = 0; i < payload.length; i++) {
128
+ const token = payload[i];
129
+ const baseAsset = this.safeString(token, 'baseAsset');
130
+ const quoteAsset = this.safeString(token, 'quoteAsset');
131
+ // Skip if base equals quote
132
+ if (baseAsset === quoteAsset) {
133
+ continue;
134
+ }
135
+ const market = this.parseMarket(token);
136
+ result.push(market);
137
+ }
138
+ return result;
139
+ }
140
+ parseMarket(market) {
141
+ // {
142
+ // "baseAsset": "USDT",
143
+ // "quoteAsset": "TMN",
144
+ // "symbolName": "USDT",
145
+ // "longEnName": "Tether",
146
+ // "longFaName": "تتر",
147
+ // "createdAt": "2025-02-25T13:47:27.102Z",
148
+ // "id": "cm43t74jo00000hrm8tw9aspo",
149
+ // "price": "1",
150
+ // "priceTMN": "112950",
151
+ // "sparkline": {
152
+ // "data": [...],
153
+ // "change": -538,
154
+ // "percentage": -0.48,
155
+ // "isPositive": false
156
+ // },
157
+ // "market": {
158
+ // "totalSupply": null,
159
+ // "maxSupply": null,
160
+ // "circulatingSupply": null,
161
+ // "volume24hBase": null,
162
+ // "high24h": null,
163
+ // "low24h": null,
164
+ // "volume24h": null,
165
+ // "marketCap": null
166
+ // },
167
+ // "blockchains": [...]
168
+ // }
169
+ let baseId = this.safeString(market, 'baseAsset');
170
+ let quoteId = this.safeString(market, 'quoteAsset');
171
+ const base = this.safeCurrencyCode(baseId);
172
+ const quote = this.safeCurrencyCode(quoteId);
173
+ const id = base + quote;
174
+ baseId = baseId.toLowerCase();
175
+ quoteId = quoteId.toLowerCase();
176
+ return {
177
+ 'id': id,
178
+ 'symbol': base + '/' + quote,
179
+ 'base': base,
180
+ 'quote': quote,
181
+ 'settle': undefined,
182
+ 'baseId': baseId,
183
+ 'quoteId': quoteId,
184
+ 'settleId': undefined,
185
+ 'type': 'spot',
186
+ 'spot': true,
187
+ 'margin': false,
188
+ 'swap': false,
189
+ 'future': false,
190
+ 'option': false,
191
+ 'active': true,
192
+ 'contract': false,
193
+ 'linear': undefined,
194
+ 'inverse': undefined,
195
+ 'contractSize': undefined,
196
+ 'expiry': undefined,
197
+ 'expiryDatetime': undefined,
198
+ 'strike': undefined,
199
+ 'optionType': undefined,
200
+ 'precision': {
201
+ 'amount': undefined,
202
+ 'price': undefined,
203
+ },
204
+ 'limits': {
205
+ 'leverage': {
206
+ 'min': undefined,
207
+ 'max': undefined,
208
+ },
209
+ 'amount': {
210
+ 'min': undefined,
211
+ 'max': undefined,
212
+ },
213
+ 'price': {
214
+ 'min': undefined,
215
+ 'max': undefined,
216
+ },
217
+ 'cost': {
218
+ 'min': undefined,
219
+ 'max': undefined,
220
+ },
221
+ },
222
+ 'created': undefined,
223
+ 'info': market,
224
+ };
225
+ }
226
+ async fetchTickers(symbols = undefined, params = {}) {
227
+ /**
228
+ * @method
229
+ * @name pooleno#fetchTickers
230
+ * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
231
+ * @see https://api-beta.pooleno.ir/api/v1/tokens/public
232
+ * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
233
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
234
+ * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
235
+ */
236
+ await this.loadMarkets();
237
+ if (symbols !== undefined) {
238
+ symbols = this.marketSymbols(symbols);
239
+ }
240
+ const response = await this.publicGetApiV1TokensPublic(params);
241
+ const payload = this.safeList(response, 'payload', []);
242
+ const result = {};
243
+ for (let i = 0; i < payload.length; i++) {
244
+ const token = payload[i];
245
+ const ticker = this.parseTicker(token);
246
+ const symbol = ticker['symbol'];
247
+ result[symbol] = ticker;
248
+ }
249
+ return this.filterByArrayTickers(result, 'symbol', symbols);
250
+ }
251
+ async fetchTicker(symbol, params = {}) {
252
+ /**
253
+ * @method
254
+ * @name pooleno#fetchTicker
255
+ * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
256
+ * @see https://api-beta.pooleno.ir/api/v1/tokens/public
257
+ * @param {string} symbol unified symbol of the market to fetch the ticker for
258
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
259
+ * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
260
+ */
261
+ const ticker = await this.fetchTickers([symbol]);
262
+ return ticker[symbol];
263
+ }
264
+ parseTicker(ticker, market = undefined) {
265
+ // {
266
+ // "baseAsset": "BTC",
267
+ // "quoteAsset": "USDT",
268
+ // "symbolName": "BTC",
269
+ // "longEnName": "Bitcoin",
270
+ // "longFaName": "بیتکوین",
271
+ // "createdAt": "2025-02-25T13:47:27.103Z",
272
+ // "id": "cm43t74jp00010hrmed9i7l76",
273
+ // "price": "115024.7",
274
+ // "priceTMN": "12980537395",
275
+ // "sparkline": {
276
+ // "data": [...],
277
+ // "change": -538,
278
+ // "percentage": -0.48,
279
+ // "isPositive": false
280
+ // },
281
+ // "market": {
282
+ // "totalSupply": null,
283
+ // "maxSupply": null,
284
+ // "circulatingSupply": null,
285
+ // "volume24hBase": null,
286
+ // "high24h": null,
287
+ // "low24h": null,
288
+ // "volume24h": null,
289
+ // "marketCap": null
290
+ // },
291
+ // "blockchains": [...]
292
+ // }
293
+ const marketType = 'spot';
294
+ const baseAsset = this.safeString(ticker, 'baseAsset');
295
+ const quoteAsset = this.safeString(ticker, 'quoteAsset');
296
+ const marketId = baseAsset + '/' + quoteAsset;
297
+ const symbol = this.safeSymbol(marketId, market, undefined, marketType);
298
+ const price = this.safeFloat(ticker, 'price');
299
+ const priceTMN = this.safeFloat(ticker, 'priceTMN');
300
+ const sparkline = this.safeDict(ticker, 'sparkline', {});
301
+ const change = this.safeFloat(sparkline, 'change');
302
+ const percentage = this.safeFloat(sparkline, 'percentage');
303
+ const marketData = this.safeDict(ticker, 'market', {});
304
+ const high24h = this.safeFloat(marketData, 'high24h');
305
+ const low24h = this.safeFloat(marketData, 'low24h');
306
+ const volume24h = this.safeFloat(marketData, 'volume24h');
307
+ let last = undefined;
308
+ let baseVolume = undefined;
309
+ if (quoteAsset === 'TMN' || quoteAsset === 'IRT') {
310
+ // For TMN/IRT pairs, use priceTMN
311
+ last = priceTMN;
312
+ }
313
+ else {
314
+ // For other pairs (like USDT), use price
315
+ last = price;
316
+ baseVolume = volume24h;
317
+ }
318
+ return this.safeTicker({
319
+ 'symbol': symbol,
320
+ 'timestamp': undefined,
321
+ 'datetime': undefined,
322
+ 'high': high24h,
323
+ 'low': low24h,
324
+ 'bid': last,
325
+ 'bidVolume': undefined,
326
+ 'ask': last,
327
+ 'askVolume': undefined,
328
+ 'vwap': undefined,
329
+ 'open': undefined,
330
+ 'close': last,
331
+ 'last': last,
332
+ 'previousClose': undefined,
333
+ 'change': change,
334
+ 'percentage': percentage,
335
+ 'average': undefined,
336
+ 'baseVolume': baseVolume,
337
+ 'quoteVolume': undefined,
338
+ 'info': ticker,
339
+ }, market);
340
+ }
341
+ sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
342
+ const url = this.urls['api']['public'] + '/' + path;
343
+ headers = { 'Content-Type': 'application/json' };
344
+ return { 'url': url, 'method': method, 'body': body, 'headers': headers };
345
+ }
346
+ }
347
+
348
+ exports["default"] = pooleno;
@@ -3,6 +3,10 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var tetherland$1 = require('./abstract/tetherland.js');
6
+ require('./base/functions/platform.js');
7
+ var type = require('./base/functions/type.js');
8
+ require('./base/functions/encode.js');
9
+ require('./base/functions/crypto.js');
6
10
 
7
11
  // ----------------------------------------------------------------------------
8
12
  // ---------------------------------------------------------------------------
@@ -88,7 +92,7 @@ class tetherland extends tetherland$1["default"] {
88
92
  'urls': {
89
93
  'logo': 'https://cdn.arz.digital/cr-odin/img/exchanges/tetherland/64x64.png',
90
94
  'api': {
91
- 'public': 'https://api.teterlands.com',
95
+ 'public': 'https://service.tetherland.com',
92
96
  },
93
97
  'www': 'https://tetherland.org',
94
98
  'doc': [
@@ -122,7 +126,7 @@ class tetherland extends tetherland$1["default"] {
122
126
  * @returns {object[]} an array of objects representing market data
123
127
  */
124
128
  const response = await this.publicGetApiV5Currencies(params);
125
- const markets = this.safeDict(response, 'data');
129
+ const markets = this.safeList(response, 'data');
126
130
  const result = [];
127
131
  const quotes = ['USDT', 'IRT'];
128
132
  for (let i = 0; i < markets.length; i++) {
@@ -252,7 +256,7 @@ class tetherland extends tetherland$1["default"] {
252
256
  symbols = this.marketSymbols(symbols);
253
257
  }
254
258
  const response = await this.publicGetApiV5Currencies(params);
255
- const markets = this.safeDict(response, 'data');
259
+ const markets = this.safeList(response, 'data');
256
260
  const result = [];
257
261
  const quotes = ['USDT', 'IRT'];
258
262
  for (let i = 0; i < markets.length; i++) {
@@ -330,7 +334,7 @@ class tetherland extends tetherland$1["default"] {
330
334
  const marketId = this.safeString(ticker, 'id');
331
335
  const quote = this.safeString(ticker, 'quote');
332
336
  const symbol = this.safeSymbol(marketId, market, undefined, marketType);
333
- let last = this.safeFloat(ticker, 'price', 0);
337
+ let last = type.asFloat(this.safeString(ticker, 'price', '').replace(',', ''));
334
338
  if (quote === 'IRT') {
335
339
  last = this.safeFloat(ticker, 'toman_amount', 0);
336
340
  }
@@ -23,7 +23,7 @@ class twox extends twox$1["default"] {
23
23
  'pro': false,
24
24
  'has': {
25
25
  'CORS': undefined,
26
- 'spot': true,
26
+ 'spot': false,
27
27
  'margin': false,
28
28
  'swap': false,
29
29
  'future': false,
@@ -79,6 +79,7 @@ class twox extends twox$1["default"] {
79
79
  'fetchTradingFee': false,
80
80
  'fetchTradingFees': false,
81
81
  'fetchWithdrawals': false,
82
+ 'otc': true,
82
83
  'setLeverage': false,
83
84
  'setMarginMode': false,
84
85
  'transfer': false,
@@ -276,51 +277,77 @@ class twox extends twox$1["default"] {
276
277
  }
277
278
  parseTicker(ticker, market = undefined) {
278
279
  // {
279
- // sellPrice: 0,
280
- // buyPrice: 0,
281
- // latestPrice: 0,
282
- // weeklyChart: "https://cdn.twox.trade/currencies/charts/7d/irt_toman.svg?v=2024061017",
283
- // priceChangePercent: 0,
284
- // minAmount: 10000,
280
+ // sellPrice: 113201.0,
281
+ // buyPrice: 112151.0,
282
+ // latestPrice: 1.0,
283
+ // weeklyChart: "https://cdn.twox.info/resource/w/tether.webp?v=101313",
284
+ // priceChangePercent: 0.0,
285
+ // sellPriceChange: 0.00,
286
+ // buyPriceChange: 0.00,
287
+ // minAmount: 2.0,
285
288
  // tags: [ ],
286
289
  // marketCategories: [ ],
287
- // id: 1,
288
- // symbol: "IRT",
289
- // name: "Toman",
290
- // icon: "https://cdn.twox.trade/currencies/icons/128x128/irt_toman.png",
291
- // persianName: "تومان",
292
- // isStableCoin: false,
290
+ // id: 2,
291
+ // symbol: "USDT",
292
+ // name: "Tether USDt",
293
+ // icon: "https://cdn.twox.info/resource/c/tether.webp",
294
+ // persianName: "تتر",
295
+ // isStableCoin: true,
293
296
  // isActive: true,
294
- // colorCode: null,
295
- // type: 0,
297
+ // type: 2,
296
298
  // isNeedRiskWarning: false,
297
- // assetPrecision: 0,
298
- // isLeveragedToken: false,
299
- // commissionPrecision: 0,
299
+ // assetPrecision: 2,
300
300
  // isDepositAllEnable: true,
301
- // isTrading: true,
301
+ // tradeStatus: 1,
302
302
  // isWithdrawAllEnable: true,
303
- // currencySlug: "IRT_Toman",
304
- // marketCurrencyId: 0,
305
- // order: 0
303
+ // currencySlug: "tether",
304
+ // marketCurrencyId: 825,
305
+ // order: 1,
306
+ // isTrading: true,
307
+ // commissionPrecision: 8,
308
+ // isDepositNeedManualConfirm: false,
309
+ // supportedBy: [ ]
306
310
  // },
307
311
  const marketType = 'otc';
308
312
  const marketId = this.safeString(ticker, 'symbol');
309
313
  const symbol = this.safeSymbol(marketId, market, undefined, marketType);
310
- let last = this.safeFloat(ticker, 'latestPrice', 0);
314
+ const sellPrice = this.safeFloat(ticker, 'sellPrice');
315
+ const buyPrice = this.safeFloat(ticker, 'buyPrice');
316
+ const latestPrice = this.safeFloat(ticker, 'latestPrice');
317
+ let last = undefined;
318
+ let bid = undefined;
319
+ let ask = undefined;
320
+ if (ticker['quote'] === 'IRT') {
321
+ // For IRT pairs, sellPrice is what user pays (ask), buyPrice is what user receives (bid)
322
+ last = sellPrice;
323
+ bid = buyPrice;
324
+ ask = sellPrice;
325
+ }
326
+ else {
327
+ // For USDT pairs, use latestPrice
328
+ last = latestPrice;
329
+ bid = buyPrice;
330
+ ask = sellPrice;
331
+ }
332
+ const percentage = this.safeFloat(ticker, 'priceChangePercent');
333
+ const sellPriceChange = this.safeFloat(ticker, 'sellPriceChange');
334
+ const buyPriceChange = this.safeFloat(ticker, 'buyPriceChange');
335
+ let change = undefined;
311
336
  if (ticker['quote'] === 'IRT') {
312
- last = this.safeFloat(ticker, 'sell_price', 0);
337
+ change = sellPriceChange;
338
+ }
339
+ else {
340
+ change = buyPriceChange;
313
341
  }
314
- const change = this.safeFloat(ticker, 'priceChangePercent', 0);
315
342
  return this.safeTicker({
316
343
  'symbol': symbol,
317
344
  'timestamp': undefined,
318
345
  'datetime': undefined,
319
346
  'high': undefined,
320
347
  'low': undefined,
321
- 'bid': undefined,
348
+ 'bid': bid,
322
349
  'bidVolume': undefined,
323
- 'ask': undefined,
350
+ 'ask': ask,
324
351
  'askVolume': undefined,
325
352
  'vwap': undefined,
326
353
  'open': undefined,
@@ -328,7 +355,7 @@ class twox extends twox$1["default"] {
328
355
  'last': last,
329
356
  'previousClose': undefined,
330
357
  'change': change,
331
- 'percentage': undefined,
358
+ 'percentage': percentage,
332
359
  'average': undefined,
333
360
  'baseVolume': undefined,
334
361
  'quoteVolume': undefined,