ccxt-ir 4.9.22 → 4.9.23

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