ccxt-ir 4.9.13 → 4.9.15

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 (99) hide show
  1. package/README.md +4 -4
  2. package/dist/ccxt.browser.min.js +3 -3
  3. package/dist/cjs/ccxt.js +232 -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/bitunix.js +1 -1
  8. package/dist/cjs/src/abstract/bydfi.js +1 -1
  9. package/dist/cjs/src/abstract/cafearz.js +1 -1
  10. package/dist/cjs/src/abstract/hamtapay.js +1 -1
  11. package/dist/cjs/src/abstract/kifpoolme.js +1 -1
  12. package/dist/cjs/src/abstract/mazdax.js +1 -1
  13. package/dist/cjs/src/abstract/pingi.js +1 -1
  14. package/dist/cjs/src/abstract/pooleno.js +1 -1
  15. package/dist/cjs/src/abstract/tehran_exchange.js +11 -0
  16. package/dist/cjs/src/afratether.js +347 -347
  17. package/dist/cjs/src/arzplus.js +572 -572
  18. package/dist/cjs/src/bitbarg.js +303 -303
  19. package/dist/cjs/src/bitunix.js +317 -317
  20. package/dist/cjs/src/bydfi.js +425 -425
  21. package/dist/cjs/src/cafearz.js +337 -337
  22. package/dist/cjs/src/hamtapay.js +291 -291
  23. package/dist/cjs/src/kcex.js +326 -326
  24. package/dist/cjs/src/kifpoolme.js +401 -401
  25. package/dist/cjs/src/mazdax.js +525 -526
  26. package/dist/cjs/src/pingi.js +437 -438
  27. package/dist/cjs/src/pooleno.js +338 -338
  28. package/dist/cjs/src/tehran_exchange.js +334 -0
  29. package/dist/cjs/src/tetherland.js +358 -358
  30. package/dist/cjs/src/twox.js +362 -362
  31. package/dist/cjs/src/xt.js +5171 -5171
  32. package/js/ccxt.d.ts +676 -673
  33. package/js/ccxt.js +493 -491
  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/bitunix.d.ts +9 -9
  40. package/js/src/abstract/bitunix.js +5 -5
  41. package/js/src/abstract/bydfi.d.ts +11 -11
  42. package/js/src/abstract/bydfi.js +5 -5
  43. package/js/src/abstract/cafearz.d.ts +8 -8
  44. package/js/src/abstract/cafearz.js +5 -5
  45. package/js/src/abstract/hamtapay.d.ts +9 -9
  46. package/js/src/abstract/hamtapay.js +5 -5
  47. package/js/src/abstract/kcex.d.ts +10 -10
  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 -0
  57. package/js/src/abstract/tehran_exchange.js +11 -0
  58. package/js/src/afratether.js +350 -350
  59. package/js/src/arzplus.d.ts +26 -26
  60. package/js/src/arzplus.js +575 -575
  61. package/js/src/base/Exchange.d.ts +926 -926
  62. package/js/src/base/types.d.ts +586 -586
  63. package/js/src/bitbarg.d.ts +21 -21
  64. package/js/src/bitbarg.js +306 -306
  65. package/js/src/bitunix.d.ts +21 -21
  66. package/js/src/bitunix.js +320 -320
  67. package/js/src/bydfi.d.ts +23 -23
  68. package/js/src/bydfi.js +428 -428
  69. package/js/src/cafearz.d.ts +21 -21
  70. package/js/src/cafearz.js +340 -340
  71. package/js/src/coinbaseexchange.d.ts +334 -334
  72. package/js/src/hamtapay.d.ts +21 -21
  73. package/js/src/hamtapay.js +294 -294
  74. package/js/src/kcex.d.ts +21 -21
  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 -529
  80. package/js/src/pingi.d.ts +22 -22
  81. package/js/src/pingi.js +440 -441
  82. package/js/src/pooleno.d.ts +21 -21
  83. package/js/src/pooleno.js +341 -341
  84. package/js/src/protobuf/mexc/compiled.d.cts +2 -2
  85. package/js/src/static_dependencies/fflake/browser.d.ts +222 -222
  86. package/js/src/static_dependencies/jsencrypt/lib/asn1js/asn1.d.ts +51 -51
  87. package/js/src/static_dependencies/jsencrypt/lib/jsbn/jsbn.d.ts +101 -101
  88. package/js/src/static_dependencies/qs/formats.d.cts +8 -8
  89. package/js/src/static_dependencies/qs/index.d.cts +4 -4
  90. package/js/src/static_dependencies/qs/parse.d.cts +2 -2
  91. package/js/src/static_dependencies/qs/stringify.d.cts +2 -2
  92. package/js/src/static_dependencies/qs/utils.d.cts +9 -9
  93. package/js/src/static_dependencies/starknet/utils/calldata/parser/index.d.ts +5 -5
  94. package/js/src/tehran_exchange.d.ts +21 -0
  95. package/js/src/tehran_exchange.js +333 -0
  96. package/js/src/tetherland.js +361 -361
  97. package/js/src/twox.js +365 -365
  98. package/js/src/xt.js +5178 -5178
  99. package/package.json +1 -1
@@ -4,407 +4,407 @@
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/kifpoolme.js';
9
- // ---------------------------------------------------------------------------
10
- /**
11
- * @class kifpoolme
12
- * @augments Exchange
13
- * @description Set rateLimit to 1000 if fully verified
14
- */
15
- export default class kifpoolme extends Exchange {
16
- describe() {
17
- return this.deepExtend(super.describe(), {
18
- 'id': 'kifpoolme',
19
- 'name': 'Kifpool',
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': true,
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/kifpoolme/64x64.png',
91
- 'api': {
92
- 'public': 'https://api.kifpool.app',
93
- },
94
- 'www': 'https://kifpool.me/',
95
- 'doc': [
96
- 'https://kifpool.me/',
97
- ],
98
- },
99
- 'timeframes': {
100
- '1m': '1m',
101
- '5m': '5m',
102
- '15m': '15m',
103
- '30m': '30m',
104
- '1h': '1h',
105
- '4h': '4h',
106
- '1d': '1d',
107
- '1w': '1w',
108
- },
109
- 'api': {
110
- 'public': {
111
- 'get': {
112
- 'api/spot/price': 1,
113
- 'api/spot/tickers/1m': 1,
114
- },
115
- },
116
- },
117
- 'fees': {
118
- 'trading': {
119
- 'tierBased': false,
120
- 'percentage': true,
121
- 'maker': this.parseNumber('0.001'),
122
- 'taker': this.parseNumber('0.001'),
123
- },
124
- },
125
- });
126
- }
127
- parseMarket(market) {
128
- // {
129
- // "symbol": "BTC",
130
- // "faName": "بیت کوین",
131
- // "name": "Bitcoin",
132
- // "smallImage": "https://kifpool.me/uploads/coin-new-images/bitcoin.png",
133
- // "price": 115430,
134
- // "priceBuyIRT": 13043590000,
135
- // "priceSellIRT": 13135934000,
136
- // "volume": 1700068128.9919832,
137
- // "priceChangePercent": 3.4799999999999995,
138
- // "high": 115968.8,
139
- // "low": 111145.4,
140
- // "slug": "bitcoin-BTC"
141
- // }
142
- const baseId = this.safeString(market, 'symbol');
143
- const quoteId = this.safeString(market, 'quoteId', 'USDT');
144
- const base = this.safeCurrencyCode(baseId);
145
- const quote = this.safeCurrencyCode(quoteId);
146
- const id = baseId + '/' + quoteId;
147
- return {
148
- 'id': id,
149
- 'symbol': base + '/' + quote,
150
- 'base': base,
151
- 'quote': quote,
152
- 'settle': undefined,
153
- 'baseId': baseId,
154
- 'quoteId': quoteId,
155
- 'settleId': undefined,
156
- 'type': 'spot',
157
- 'spot': true,
158
- 'margin': false,
159
- 'swap': false,
160
- 'future': false,
161
- 'option': false,
162
- 'active': true,
163
- 'contract': false,
164
- 'linear': undefined,
165
- 'inverse': undefined,
166
- 'contractSize': undefined,
167
- 'expiry': undefined,
168
- 'expiryDatetime': undefined,
169
- 'strike': undefined,
170
- 'optionType': undefined,
171
- 'precision': {
172
- 'amount': undefined,
173
- 'price': undefined,
174
- },
175
- 'limits': {
176
- 'leverage': {
177
- 'min': undefined,
178
- 'max': undefined,
179
- },
180
- 'amount': {
181
- 'min': undefined,
182
- 'max': undefined,
183
- },
184
- 'price': {
185
- 'min': undefined,
186
- 'max': undefined,
187
- },
188
- 'cost': {
189
- 'min': undefined,
190
- 'max': undefined,
191
- },
192
- },
193
- 'created': undefined,
194
- 'info': market,
195
- };
196
- }
197
- async fetchMarkets(params = {}) {
198
- /**
199
- * @method
200
- * @name kifpoolme#fetchMarkets
201
- * @description retrieves data on all markets for kifpoolme
202
- * @see https://api.kifpool.app/api/spot/price
203
- * @param {object} [params] extra parameters specific to the exchange API endpoint
204
- * @returns {object[]} an array of objects representing market data
205
- */
206
- const response = await this.publicGetApiSpotPrice();
207
- const result = [];
208
- // Response is an array of coin objects
209
- for (let i = 0; i < response.length; i++) {
210
- const item = response[i];
211
- // Create markets for both USDT and IRT quotes
212
- const quotes = ['USDT', 'IRT'];
213
- for (let j = 0; j < quotes.length; j++) {
214
- const quoteId = quotes[j];
215
- const marketData = this.extend(item, {
216
- 'quoteId': quoteId,
217
- });
218
- const market = this.parseMarket(marketData);
219
- result.push(market);
220
- }
221
- }
222
- return result;
223
- }
224
- async fetchTickers(symbols = undefined, params = {}) {
225
- /**
226
- * @method
227
- * @name kifpoolme#fetchTickers
228
- * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
229
- * @see https://api.kifpool.app/api/spot/price
230
- * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
231
- * @param {object} [params] extra parameters specific to the exchange API endpoint
232
- * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
233
- */
234
- await this.loadMarkets();
235
- if (symbols !== undefined) {
236
- symbols = this.marketSymbols(symbols);
237
- }
238
- // Extract base symbols from the requested symbols
239
- let symbolsParam = undefined;
240
- if (symbols !== undefined && symbols.length > 0) {
241
- const baseSymbols = [];
242
- for (let i = 0; i < symbols.length; i++) {
243
- const market = this.market(symbols[i]);
244
- if (!(market['baseId'] in baseSymbols)) {
245
- baseSymbols.push(market['baseId']);
246
- }
247
- }
248
- symbolsParam = baseSymbols.join(',');
249
- }
250
- const request = {};
251
- if (symbolsParam !== undefined) {
252
- request['symbol'] = symbolsParam;
253
- }
254
- const response = await this.publicGetApiSpotPrice(this.extend(request));
255
- const result = {};
256
- for (let i = 0; i < response.length; i++) {
257
- const item = response[i];
258
- const baseId = this.safeString(item, 'symbol');
259
- // Create tickers for both USDT and IRT quotes
260
- const quotes = ['USDT', 'IRT'];
261
- for (let j = 0; j < quotes.length; j++) {
262
- const quoteId = quotes[j];
263
- const base = this.safeCurrencyCode(baseId);
264
- const quote = this.safeCurrencyCode(quoteId);
265
- const symbol = base + '/' + quote;
266
- const ticker = this.extend(item, {
267
- 'quoteId': quoteId,
268
- 'marketId': baseId + '/' + quoteId,
269
- });
270
- result[symbol] = this.parseTicker(ticker);
271
- }
272
- }
273
- return this.filterByArrayTickers(result, 'symbol', symbols);
274
- }
275
- async fetchTicker(symbol, params = {}) {
276
- /**
277
- * @method
278
- * @name kifpoolme#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://api.kifpool.app/api/spot/price
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
- const ticker = await this.fetchTickers([symbol], params);
286
- return ticker[symbol];
287
- }
288
- parseTicker(ticker, market = undefined) {
289
- // {
290
- // "symbol": "BTC",
291
- // "faName": "بیت کوین",
292
- // "name": "Bitcoin",
293
- // "smallImage": "https://kifpool.me/uploads/coin-new-images/bitcoin.png",
294
- // "price": 115430, // USDT price
295
- // "priceBuyIRT": 13043590000, // IRT buy price
296
- // "priceSellIRT": 13135934000, // IRT sell price
297
- // "volume": 1700068128.9919832,
298
- // "priceChangePercent": 3.48,
299
- // "high": 115968.8,
300
- // "low": 111145.4,
301
- // "slug": "bitcoin-BTC",
302
- // "quoteId": "USDT" or "IRT"
303
- // }
304
- const marketType = 'spot';
305
- const marketId = this.safeString(ticker, 'marketId');
306
- const symbol = this.safeSymbol(marketId, market, undefined, marketType);
307
- const quoteId = this.safeString(ticker, 'quoteId', 'USDT');
308
- let last = undefined;
309
- let bid = undefined;
310
- let ask = undefined;
311
- if (quoteId === 'IRT') {
312
- // For IRT: priceSellIRT is the sell price (bid), priceBuyIRT is the buy price (ask)
313
- bid = this.safeNumber(ticker, 'priceSellIRT');
314
- ask = this.safeNumber(ticker, 'priceBuyIRT');
315
- last = ask;
316
- }
317
- else {
318
- // For USDT: price is in USDT
319
- const price = this.safeNumber(ticker, 'price');
320
- last = price;
321
- bid = price;
322
- ask = price;
323
- }
324
- const high = this.safeNumber(ticker, 'high');
325
- const low = this.safeNumber(ticker, 'low');
326
- const percentage = this.safeNumber(ticker, 'priceChangePercent');
327
- const baseVolume = this.safeNumber(ticker, 'volume');
328
- return this.safeTicker({
329
- 'symbol': symbol,
330
- 'timestamp': undefined,
331
- 'datetime': undefined,
332
- 'high': high,
333
- 'low': low,
334
- 'bid': bid,
335
- 'bidVolume': undefined,
336
- 'ask': ask,
337
- 'askVolume': undefined,
338
- 'vwap': undefined,
339
- 'open': undefined,
340
- 'close': last,
341
- 'last': last,
342
- 'previousClose': undefined,
343
- 'change': undefined,
344
- 'percentage': percentage,
345
- 'average': undefined,
346
- 'baseVolume': baseVolume,
347
- 'quoteVolume': undefined,
348
- 'info': ticker,
349
- }, market);
350
- }
351
- async fetchOHLCV(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
352
- /**
353
- * @method
354
- * @name kifpoolme#fetchOHLCV
355
- * @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
356
- * @see https://api.kifpool.app/api/spot/tickers/1m
357
- * @param {string} symbol unified symbol of the market to fetch OHLCV data for
358
- * @param {string} timeframe the length of time each candle represents
359
- * @param {int} [since] timestamp in ms of the earliest candle to fetch
360
- * @param {int} [limit] the maximum amount of candles to fetch
361
- * @param {object} [params] extra parameters specific to the exchange API endpoint
362
- * @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
363
- */
364
- await this.loadMarkets();
365
- const market = this.market(symbol);
366
- const endTime = Date.now();
367
- const request = {
368
- 'symbol': market['baseId'],
369
- 'currency': market['quoteId'],
370
- 'fromTs': Math.floor((endTime / 1000) - (24 * 60 * 60)),
371
- 'toTs': Math.floor(endTime / 1000),
372
- };
373
- if (since !== undefined) {
374
- request['fromTs'] = Math.floor(since / 1000);
375
- }
376
- if (limit !== undefined) {
377
- request['limit'] = limit;
378
- }
379
- const response = await this.publicGetApiSpotTickers1m(request);
380
- return this.parseOHLCVs(response, market, timeframe, since, limit);
381
- }
382
- parseOHLCV(ohlcv, market = undefined) {
383
- // {
384
- // "data_captured_datetime": 1760169720,
385
- // "open": 110419.9,
386
- // "high": 110468.4,
387
- // "low": 110330.7,
388
- // "close": 110330.7,
389
- // "volume": 3356941116.288925,
390
- // "changePercentage": -0.0808
391
- // }
392
- return [
393
- this.safeTimestamp(ohlcv, 'data_captured_datetime'),
394
- this.safeNumber(ohlcv, 'open'),
395
- this.safeNumber(ohlcv, 'high'),
396
- this.safeNumber(ohlcv, 'low'),
397
- this.safeNumber(ohlcv, 'close'),
398
- this.safeNumber(ohlcv, 'volume'),
399
- ];
400
- }
401
- sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
402
- const query = this.omit(params, this.extractParams(path));
403
- let url = this.urls['api']['public'] + '/' + path;
404
- if (Object.keys(query).length) {
405
- url += '?' + this.urlencode(query);
406
- }
407
- headers = { 'Content-Type': 'application/json' };
408
- return { 'url': url, 'method': method, 'body': body, 'headers': headers };
409
- }
410
- }
7
+ // ---------------------------------------------------------------------------
8
+ import Exchange from './abstract/kifpoolme.js';
9
+ // ---------------------------------------------------------------------------
10
+ /**
11
+ * @class kifpoolme
12
+ * @augments Exchange
13
+ * @description Set rateLimit to 1000 if fully verified
14
+ */
15
+ export default class kifpoolme extends Exchange {
16
+ describe() {
17
+ return this.deepExtend(super.describe(), {
18
+ 'id': 'kifpoolme',
19
+ 'name': 'Kifpool',
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': true,
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/kifpoolme/64x64.png',
91
+ 'api': {
92
+ 'public': 'https://api.kifpool.app',
93
+ },
94
+ 'www': 'https://kifpool.me/',
95
+ 'doc': [
96
+ 'https://kifpool.me/',
97
+ ],
98
+ },
99
+ 'timeframes': {
100
+ '1m': '1m',
101
+ '5m': '5m',
102
+ '15m': '15m',
103
+ '30m': '30m',
104
+ '1h': '1h',
105
+ '4h': '4h',
106
+ '1d': '1d',
107
+ '1w': '1w',
108
+ },
109
+ 'api': {
110
+ 'public': {
111
+ 'get': {
112
+ 'api/spot/price': 1,
113
+ 'api/spot/tickers/1m': 1,
114
+ },
115
+ },
116
+ },
117
+ 'fees': {
118
+ 'trading': {
119
+ 'tierBased': false,
120
+ 'percentage': true,
121
+ 'maker': this.parseNumber('0.001'),
122
+ 'taker': this.parseNumber('0.001'),
123
+ },
124
+ },
125
+ });
126
+ }
127
+ parseMarket(market) {
128
+ // {
129
+ // "symbol": "BTC",
130
+ // "faName": "بیت کوین",
131
+ // "name": "Bitcoin",
132
+ // "smallImage": "https://kifpool.me/uploads/coin-new-images/bitcoin.png",
133
+ // "price": 115430,
134
+ // "priceBuyIRT": 13043590000,
135
+ // "priceSellIRT": 13135934000,
136
+ // "volume": 1700068128.9919832,
137
+ // "priceChangePercent": 3.4799999999999995,
138
+ // "high": 115968.8,
139
+ // "low": 111145.4,
140
+ // "slug": "bitcoin-BTC"
141
+ // }
142
+ const baseId = this.safeString(market, 'symbol');
143
+ const quoteId = this.safeString(market, 'quoteId', 'USDT');
144
+ const base = this.safeCurrencyCode(baseId);
145
+ const quote = this.safeCurrencyCode(quoteId);
146
+ const id = baseId + '/' + quoteId;
147
+ return {
148
+ 'id': id,
149
+ 'symbol': base + '/' + quote,
150
+ 'base': base,
151
+ 'quote': quote,
152
+ 'settle': undefined,
153
+ 'baseId': baseId,
154
+ 'quoteId': quoteId,
155
+ 'settleId': undefined,
156
+ 'type': 'spot',
157
+ 'spot': true,
158
+ 'margin': false,
159
+ 'swap': false,
160
+ 'future': false,
161
+ 'option': false,
162
+ 'active': true,
163
+ 'contract': false,
164
+ 'linear': undefined,
165
+ 'inverse': undefined,
166
+ 'contractSize': undefined,
167
+ 'expiry': undefined,
168
+ 'expiryDatetime': undefined,
169
+ 'strike': undefined,
170
+ 'optionType': undefined,
171
+ 'precision': {
172
+ 'amount': undefined,
173
+ 'price': undefined,
174
+ },
175
+ 'limits': {
176
+ 'leverage': {
177
+ 'min': undefined,
178
+ 'max': undefined,
179
+ },
180
+ 'amount': {
181
+ 'min': undefined,
182
+ 'max': undefined,
183
+ },
184
+ 'price': {
185
+ 'min': undefined,
186
+ 'max': undefined,
187
+ },
188
+ 'cost': {
189
+ 'min': undefined,
190
+ 'max': undefined,
191
+ },
192
+ },
193
+ 'created': undefined,
194
+ 'info': market,
195
+ };
196
+ }
197
+ async fetchMarkets(params = {}) {
198
+ /**
199
+ * @method
200
+ * @name kifpoolme#fetchMarkets
201
+ * @description retrieves data on all markets for kifpoolme
202
+ * @see https://api.kifpool.app/api/spot/price
203
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
204
+ * @returns {object[]} an array of objects representing market data
205
+ */
206
+ const response = await this.publicGetApiSpotPrice();
207
+ const result = [];
208
+ // Response is an array of coin objects
209
+ for (let i = 0; i < response.length; i++) {
210
+ const item = response[i];
211
+ // Create markets for both USDT and IRT quotes
212
+ const quotes = ['USDT', 'IRT'];
213
+ for (let j = 0; j < quotes.length; j++) {
214
+ const quoteId = quotes[j];
215
+ const marketData = this.extend(item, {
216
+ 'quoteId': quoteId,
217
+ });
218
+ const market = this.parseMarket(marketData);
219
+ result.push(market);
220
+ }
221
+ }
222
+ return result;
223
+ }
224
+ async fetchTickers(symbols = undefined, params = {}) {
225
+ /**
226
+ * @method
227
+ * @name kifpoolme#fetchTickers
228
+ * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
229
+ * @see https://api.kifpool.app/api/spot/price
230
+ * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
231
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
232
+ * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
233
+ */
234
+ await this.loadMarkets();
235
+ if (symbols !== undefined) {
236
+ symbols = this.marketSymbols(symbols);
237
+ }
238
+ // Extract base symbols from the requested symbols
239
+ let symbolsParam = undefined;
240
+ if (symbols !== undefined && symbols.length > 0) {
241
+ const baseSymbols = [];
242
+ for (let i = 0; i < symbols.length; i++) {
243
+ const market = this.market(symbols[i]);
244
+ if (!(market['baseId'] in baseSymbols)) {
245
+ baseSymbols.push(market['baseId']);
246
+ }
247
+ }
248
+ symbolsParam = baseSymbols.join(',');
249
+ }
250
+ const request = {};
251
+ if (symbolsParam !== undefined) {
252
+ request['symbol'] = symbolsParam;
253
+ }
254
+ const response = await this.publicGetApiSpotPrice(this.extend(request));
255
+ const result = {};
256
+ for (let i = 0; i < response.length; i++) {
257
+ const item = response[i];
258
+ const baseId = this.safeString(item, 'symbol');
259
+ // Create tickers for both USDT and IRT quotes
260
+ const quotes = ['USDT', 'IRT'];
261
+ for (let j = 0; j < quotes.length; j++) {
262
+ const quoteId = quotes[j];
263
+ const base = this.safeCurrencyCode(baseId);
264
+ const quote = this.safeCurrencyCode(quoteId);
265
+ const symbol = base + '/' + quote;
266
+ const ticker = this.extend(item, {
267
+ 'quoteId': quoteId,
268
+ 'marketId': baseId + '/' + quoteId,
269
+ });
270
+ result[symbol] = this.parseTicker(ticker);
271
+ }
272
+ }
273
+ return this.filterByArrayTickers(result, 'symbol', symbols);
274
+ }
275
+ async fetchTicker(symbol, params = {}) {
276
+ /**
277
+ * @method
278
+ * @name kifpoolme#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://api.kifpool.app/api/spot/price
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
+ const ticker = await this.fetchTickers([symbol], params);
286
+ return ticker[symbol];
287
+ }
288
+ parseTicker(ticker, market = undefined) {
289
+ // {
290
+ // "symbol": "BTC",
291
+ // "faName": "بیت کوین",
292
+ // "name": "Bitcoin",
293
+ // "smallImage": "https://kifpool.me/uploads/coin-new-images/bitcoin.png",
294
+ // "price": 115430, // USDT price
295
+ // "priceBuyIRT": 13043590000, // IRT buy price
296
+ // "priceSellIRT": 13135934000, // IRT sell price
297
+ // "volume": 1700068128.9919832,
298
+ // "priceChangePercent": 3.48,
299
+ // "high": 115968.8,
300
+ // "low": 111145.4,
301
+ // "slug": "bitcoin-BTC",
302
+ // "quoteId": "USDT" or "IRT"
303
+ // }
304
+ const marketType = 'spot';
305
+ const marketId = this.safeString(ticker, 'marketId');
306
+ const symbol = this.safeSymbol(marketId, market, undefined, marketType);
307
+ const quoteId = this.safeString(ticker, 'quoteId', 'USDT');
308
+ let last = undefined;
309
+ let bid = undefined;
310
+ let ask = undefined;
311
+ if (quoteId === 'IRT') {
312
+ // For IRT: priceSellIRT is the sell price (bid), priceBuyIRT is the buy price (ask)
313
+ bid = this.safeNumber(ticker, 'priceSellIRT');
314
+ ask = this.safeNumber(ticker, 'priceBuyIRT');
315
+ last = ask;
316
+ }
317
+ else {
318
+ // For USDT: price is in USDT
319
+ const price = this.safeNumber(ticker, 'price');
320
+ last = price;
321
+ bid = price;
322
+ ask = price;
323
+ }
324
+ const high = this.safeNumber(ticker, 'high');
325
+ const low = this.safeNumber(ticker, 'low');
326
+ const percentage = this.safeNumber(ticker, 'priceChangePercent');
327
+ const baseVolume = this.safeNumber(ticker, 'volume');
328
+ return this.safeTicker({
329
+ 'symbol': symbol,
330
+ 'timestamp': undefined,
331
+ 'datetime': undefined,
332
+ 'high': high,
333
+ 'low': low,
334
+ 'bid': bid,
335
+ 'bidVolume': undefined,
336
+ 'ask': ask,
337
+ 'askVolume': undefined,
338
+ 'vwap': undefined,
339
+ 'open': undefined,
340
+ 'close': last,
341
+ 'last': last,
342
+ 'previousClose': undefined,
343
+ 'change': undefined,
344
+ 'percentage': percentage,
345
+ 'average': undefined,
346
+ 'baseVolume': baseVolume,
347
+ 'quoteVolume': undefined,
348
+ 'info': ticker,
349
+ }, market);
350
+ }
351
+ async fetchOHLCV(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
352
+ /**
353
+ * @method
354
+ * @name kifpoolme#fetchOHLCV
355
+ * @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
356
+ * @see https://api.kifpool.app/api/spot/tickers/1m
357
+ * @param {string} symbol unified symbol of the market to fetch OHLCV data for
358
+ * @param {string} timeframe the length of time each candle represents
359
+ * @param {int} [since] timestamp in ms of the earliest candle to fetch
360
+ * @param {int} [limit] the maximum amount of candles to fetch
361
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
362
+ * @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
363
+ */
364
+ await this.loadMarkets();
365
+ const market = this.market(symbol);
366
+ const endTime = Date.now();
367
+ const request = {
368
+ 'symbol': market['baseId'],
369
+ 'currency': market['quoteId'],
370
+ 'fromTs': Math.floor((endTime / 1000) - (24 * 60 * 60)),
371
+ 'toTs': Math.floor(endTime / 1000),
372
+ };
373
+ if (since !== undefined) {
374
+ request['fromTs'] = Math.floor(since / 1000);
375
+ }
376
+ if (limit !== undefined) {
377
+ request['limit'] = limit;
378
+ }
379
+ const response = await this.publicGetApiSpotTickers1m(request);
380
+ return this.parseOHLCVs(response, market, timeframe, since, limit);
381
+ }
382
+ parseOHLCV(ohlcv, market = undefined) {
383
+ // {
384
+ // "data_captured_datetime": 1760169720,
385
+ // "open": 110419.9,
386
+ // "high": 110468.4,
387
+ // "low": 110330.7,
388
+ // "close": 110330.7,
389
+ // "volume": 3356941116.288925,
390
+ // "changePercentage": -0.0808
391
+ // }
392
+ return [
393
+ this.safeTimestamp(ohlcv, 'data_captured_datetime'),
394
+ this.safeNumber(ohlcv, 'open'),
395
+ this.safeNumber(ohlcv, 'high'),
396
+ this.safeNumber(ohlcv, 'low'),
397
+ this.safeNumber(ohlcv, 'close'),
398
+ this.safeNumber(ohlcv, 'volume'),
399
+ ];
400
+ }
401
+ sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
402
+ const query = this.omit(params, this.extractParams(path));
403
+ let url = this.urls['api']['public'] + '/' + path;
404
+ if (Object.keys(query).length) {
405
+ url += '?' + this.urlencode(query);
406
+ }
407
+ headers = { 'Content-Type': 'application/json' };
408
+ return { 'url': url, 'method': method, 'body': body, 'headers': headers };
409
+ }
410
+ }