ccxt-ir 4.9.4 → 4.9.12

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 (62) hide show
  1. package/README.md +157 -164
  2. package/dist/ccxt.browser.min.js +4 -4
  3. package/dist/cjs/ccxt.js +22 -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/kifpoolme.js +11 -0
  9. package/dist/cjs/src/abstract/mazdax.js +11 -0
  10. package/dist/cjs/src/abstract/pingi.js +11 -0
  11. package/dist/cjs/src/abstract/pooleno.js +11 -0
  12. package/dist/cjs/src/afratether.js +84 -36
  13. package/dist/cjs/src/arzplus.js +32 -15
  14. package/dist/cjs/src/bitbarg.js +313 -0
  15. package/dist/cjs/src/bydfi.js +435 -0
  16. package/dist/cjs/src/cafearz.js +347 -0
  17. package/dist/cjs/src/hamtapay.js +3 -2
  18. package/dist/cjs/src/kifpoolme.js +411 -0
  19. package/dist/cjs/src/mazdax.js +536 -0
  20. package/dist/cjs/src/pingi.js +448 -0
  21. package/dist/cjs/src/pooleno.js +348 -0
  22. package/dist/cjs/src/tetherland.js +5 -5
  23. package/dist/cjs/src/twox.js +56 -29
  24. package/js/ccxt.d.ts +23 -2
  25. package/js/ccxt.js +16 -2
  26. package/js/src/abantether.js +88 -69
  27. package/js/src/abstract/abantether.d.ts +1 -1
  28. package/js/src/abstract/bitbarg.d.ts +8 -0
  29. package/js/src/abstract/bitbarg.js +11 -0
  30. package/js/src/abstract/bydfi.d.ts +11 -0
  31. package/js/src/abstract/bydfi.js +11 -0
  32. package/js/src/abstract/cafearz.d.ts +8 -0
  33. package/js/src/abstract/cafearz.js +11 -0
  34. package/js/src/abstract/kifpoolme.d.ts +9 -0
  35. package/js/src/abstract/kifpoolme.js +11 -0
  36. package/js/src/abstract/mazdax.d.ts +11 -0
  37. package/js/src/abstract/mazdax.js +11 -0
  38. package/js/src/abstract/pingi.d.ts +9 -0
  39. package/js/src/abstract/pingi.js +11 -0
  40. package/js/src/abstract/pooleno.d.ts +8 -0
  41. package/js/src/abstract/pooleno.js +11 -0
  42. package/js/src/afratether.js +84 -36
  43. package/js/src/arzplus.d.ts +3 -2
  44. package/js/src/arzplus.js +32 -15
  45. package/js/src/bitbarg.d.ts +21 -0
  46. package/js/src/bitbarg.js +312 -0
  47. package/js/src/bydfi.d.ts +23 -0
  48. package/js/src/bydfi.js +434 -0
  49. package/js/src/cafearz.d.ts +21 -0
  50. package/js/src/cafearz.js +346 -0
  51. package/js/src/hamtapay.js +3 -2
  52. package/js/src/kifpoolme.d.ts +23 -0
  53. package/js/src/kifpoolme.js +410 -0
  54. package/js/src/mazdax.d.ts +23 -0
  55. package/js/src/mazdax.js +535 -0
  56. package/js/src/pingi.d.ts +22 -0
  57. package/js/src/pingi.js +447 -0
  58. package/js/src/pooleno.d.ts +21 -0
  59. package/js/src/pooleno.js +347 -0
  60. package/js/src/tetherland.js +5 -5
  61. package/js/src/twox.js +56 -29
  62. package/package.json +1 -1
@@ -0,0 +1,535 @@
1
+ // ----------------------------------------------------------------------------
2
+
3
+ // PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
4
+ // https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
5
+ // EDIT THE CORRESPONDENT .ts FILE INSTEAD
6
+
7
+ // ---------------------------------------------------------------------------
8
+ import Exchange from './abstract/mazdax.js';
9
+ // ---------------------------------------------------------------------------
10
+ /**
11
+ * @class mazdax
12
+ * @augments Exchange
13
+ * @description Mazdax OTC exchange implementation
14
+ */
15
+ export default class mazdax extends Exchange {
16
+ describe() {
17
+ return this.deepExtend(super.describe(), {
18
+ 'id': 'mazdax',
19
+ 'name': 'Mazdax',
20
+ 'countries': ['IR'],
21
+ 'rateLimit': 1000,
22
+ 'version': '1',
23
+ 'certified': false,
24
+ 'pro': false,
25
+ 'has': {
26
+ 'CORS': undefined,
27
+ 'spot': false,
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': true,
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
+ 'otc': true,
84
+ 'setLeverage': false,
85
+ 'setMarginMode': false,
86
+ 'transfer': false,
87
+ 'withdraw': false,
88
+ },
89
+ 'comment': 'Mazdax OTC Exchange',
90
+ 'urls': {
91
+ 'logo': 'https://cdn.arz.digital/cr-odin/img/exchanges/mazdax/64x64.png',
92
+ 'api': {
93
+ 'public': 'https://api.mazdax.ir',
94
+ },
95
+ 'www': 'https://mazdax.ir',
96
+ 'doc': [
97
+ 'https://api.mazdax.ir',
98
+ ],
99
+ },
100
+ 'timeframes': {
101
+ '1m': '1m',
102
+ '5m': '5m',
103
+ '15m': '15m',
104
+ '30m': '30m',
105
+ '1h': '1h',
106
+ '4h': '4h',
107
+ '1d': '1d',
108
+ '1w': '1w',
109
+ },
110
+ 'api': {
111
+ 'public': {
112
+ 'get': {
113
+ 'market/symbols': 1,
114
+ 'market/rollingprice': 1,
115
+ 'market/candle': 1,
116
+ 'market/order': 1,
117
+ },
118
+ },
119
+ },
120
+ 'fees': {
121
+ 'trading': {
122
+ 'tierBased': false,
123
+ 'percentage': true,
124
+ 'maker': this.parseNumber('0.001'),
125
+ 'taker': this.parseNumber('0.001'),
126
+ },
127
+ },
128
+ });
129
+ }
130
+ async fetchMarkets(params = {}) {
131
+ /**
132
+ * @method
133
+ * @name mazdax#fetchMarkets
134
+ * @description retrieves data on all markets for mazdax
135
+ * @see https://api.mazdax.ir/market/symbols
136
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
137
+ * @returns {object[]} an array of objects representing market data
138
+ */
139
+ const response = await this.publicGetMarketSymbols(params);
140
+ // Response is an array of market objects:
141
+ // [
142
+ // {
143
+ // "id": 67,
144
+ // "createdAt": "2022-12-26T07:33:25Z",
145
+ // "updatedAt": "2025-07-04T16:18:57Z",
146
+ // "order": 2,
147
+ // "symbol": "AHRM1IRR",
148
+ // "baseAsset": "AHRM1",
149
+ // "baseAssetTranslate": "AHRM1",
150
+ // "baseAssetPrecision": 0,
151
+ // "quoteAsset": "IRR",
152
+ // "quoteAssetTranslate": "IRR",
153
+ // "takerFee": "0.00116",
154
+ // "makerFee": "0.001044",
155
+ // "quoteAssetPrecision": 0,
156
+ // "isTradable": true,
157
+ // "isActive": true,
158
+ // "isPublic": true,
159
+ // "minimumOrderSize": "100000",
160
+ // "maximumOrderSize": "0",
161
+ // "minimumPrice": "0",
162
+ // "maximumPrice": "0",
163
+ // "marketCOV": "0.01",
164
+ // "marketCap": "10",
165
+ // "tickSize": "1",
166
+ // "stepSize": "1",
167
+ // ...
168
+ // }
169
+ // ]
170
+ const result = [];
171
+ for (let i = 0; i < response.length; i++) {
172
+ const market = this.parseMarket(response[i]);
173
+ result.push(market);
174
+ }
175
+ return result;
176
+ }
177
+ parseMarket(market) {
178
+ // {
179
+ // "id": 67,
180
+ // "createdAt": "2022-12-26T07:33:25Z",
181
+ // "updatedAt": "2025-07-04T16:18:57Z",
182
+ // "order": 2,
183
+ // "symbol": "AHRM1IRR",
184
+ // "baseAsset": "AHRM1",
185
+ // "baseAssetTranslate": "AHRM1",
186
+ // "baseAssetPrecision": 0,
187
+ // "quoteAsset": "IRR",
188
+ // "quoteAssetTranslate": "IRR",
189
+ // "takerFee": "0.00116",
190
+ // "makerFee": "0.001044",
191
+ // "quoteAssetPrecision": 0,
192
+ // "isTradable": true,
193
+ // "isActive": true,
194
+ // "isPublic": true,
195
+ // "minimumOrderSize": "100000",
196
+ // "maximumOrderSize": "0",
197
+ // "minimumPrice": "0",
198
+ // "maximumPrice": "0",
199
+ // "marketCOV": "0.01",
200
+ // "marketCap": "10",
201
+ // "tickSize": "1",
202
+ // "stepSize": "1",
203
+ // ...
204
+ // }
205
+ const id = this.safeString(market, 'symbol');
206
+ let baseId = this.safeString(market, 'baseAsset');
207
+ let quoteId = this.safeString(market, 'quoteAsset');
208
+ const base = this.safeCurrencyCode(baseId);
209
+ const quote = this.safeCurrencyCode(quoteId);
210
+ baseId = baseId.toLowerCase();
211
+ quoteId = quoteId.toLowerCase();
212
+ const isActive = this.safeBool(market, 'isActive', false);
213
+ const isTradable = this.safeBool(market, 'isTradable', false);
214
+ const active = isActive && isTradable;
215
+ return {
216
+ 'id': id,
217
+ 'symbol': base + '/' + quote,
218
+ 'base': base,
219
+ 'quote': quote,
220
+ 'settle': undefined,
221
+ 'baseId': baseId,
222
+ 'quoteId': quoteId,
223
+ 'settleId': undefined,
224
+ 'type': 'otc',
225
+ 'spot': false,
226
+ 'margin': false,
227
+ 'swap': false,
228
+ 'future': false,
229
+ 'option': false,
230
+ 'active': active,
231
+ 'contract': false,
232
+ 'linear': undefined,
233
+ 'inverse': undefined,
234
+ 'contractSize': undefined,
235
+ 'expiry': undefined,
236
+ 'expiryDatetime': undefined,
237
+ 'strike': undefined,
238
+ 'optionType': undefined,
239
+ 'precision': {
240
+ 'amount': this.parseNumber(this.parsePrecision(this.safeString(market, 'baseAssetPrecision'))),
241
+ 'price': this.parseNumber(this.parsePrecision(this.safeString(market, 'quoteAssetPrecision'))),
242
+ },
243
+ 'limits': {
244
+ 'leverage': {
245
+ 'min': undefined,
246
+ 'max': undefined,
247
+ },
248
+ 'amount': {
249
+ 'min': this.safeNumber(market, 'minimumOrderSize'),
250
+ 'max': this.safeNumber(market, 'maximumOrderSize'),
251
+ },
252
+ 'price': {
253
+ 'min': this.safeNumber(market, 'minimumPrice'),
254
+ 'max': this.safeNumber(market, 'maximumPrice'),
255
+ },
256
+ 'cost': {
257
+ 'min': undefined,
258
+ 'max': undefined,
259
+ },
260
+ },
261
+ 'created': this.parse8601(this.safeString(market, 'createdAt')),
262
+ 'info': market,
263
+ };
264
+ }
265
+ async fetchTickers(symbols = undefined, params = {}) {
266
+ /**
267
+ * @method
268
+ * @name mazdax#fetchTickers
269
+ * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
270
+ * @see https://api.mazdax.ir/market/rollingprice
271
+ * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
272
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
273
+ * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
274
+ */
275
+ await this.loadMarkets();
276
+ if (symbols !== undefined) {
277
+ symbols = this.marketSymbols(symbols);
278
+ }
279
+ const markets = await this.fetchMarkets();
280
+ const result = {};
281
+ for (let i = 0; i < markets.length; i++) {
282
+ const market = markets[i];
283
+ const marketId = market['id'];
284
+ const request = {
285
+ 'from': 'mazdax',
286
+ 'symbol': marketId,
287
+ };
288
+ try {
289
+ const response = await this.publicGetMarketRollingprice(request);
290
+ // {
291
+ // "AHRM1IRR": {
292
+ // "symbol": "AHRM1IRR",
293
+ // "priceChange": "525",
294
+ // "priceChangePercent": "2.077",
295
+ // "weightedAvgPrice": "0",
296
+ // "prevClosePrice": "0",
297
+ // "lastPrice": "25800",
298
+ // "lastQty": "14050",
299
+ // "bidPrice": "0",
300
+ // "askPrice": "0",
301
+ // "openPrice": "25275",
302
+ // "highPrice": "26200",
303
+ // "lowPrice": "25274",
304
+ // "volume": "1076873",
305
+ // "valueIrr": "55104642690",
306
+ // "openTime": 1760271737577,
307
+ // "closeTime": 1760351215075,
308
+ // "count": 348
309
+ // }
310
+ // }
311
+ const tickerData = this.safeDict(response, marketId);
312
+ if (tickerData !== undefined) {
313
+ const ticker = this.parseTicker(tickerData, market);
314
+ const symbol = ticker['symbol'];
315
+ result[symbol] = ticker;
316
+ }
317
+ }
318
+ catch (e) {
319
+ // Skip markets that fail
320
+ continue;
321
+ }
322
+ }
323
+ return this.filterByArrayTickers(result, 'symbol', symbols);
324
+ }
325
+ async fetchTicker(symbol, params = {}) {
326
+ /**
327
+ * @method
328
+ * @name mazdax#fetchTicker
329
+ * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
330
+ * @see https://api.mazdax.ir/market/rollingprice
331
+ * @param {string} symbol unified symbol of the market to fetch the ticker for
332
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
333
+ * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
334
+ */
335
+ await this.loadMarkets();
336
+ const market = this.market(symbol);
337
+ const request = {
338
+ 'from': 'mazdax',
339
+ 'symbol': market['id'],
340
+ };
341
+ const response = await this.publicGetMarketRollingprice(request);
342
+ // {
343
+ // "AHRM1IRR": {
344
+ // "symbol": "AHRM1IRR",
345
+ // "priceChange": "525",
346
+ // "priceChangePercent": "2.077",
347
+ // "weightedAvgPrice": "0",
348
+ // "prevClosePrice": "0",
349
+ // "lastPrice": "25800",
350
+ // "lastQty": "14050",
351
+ // "bidPrice": "0",
352
+ // "askPrice": "0",
353
+ // "openPrice": "25275",
354
+ // "highPrice": "26200",
355
+ // "lowPrice": "25274",
356
+ // "volume": "1076873",
357
+ // "valueIrr": "55104642690",
358
+ // "openTime": 1760271737577,
359
+ // "closeTime": 1760351215075,
360
+ // "count": 348
361
+ // }
362
+ // }
363
+ const tickerData = this.safeDict(response, market['id']);
364
+ return this.parseTicker(tickerData, market);
365
+ }
366
+ parseTicker(ticker, market = undefined) {
367
+ // {
368
+ // "symbol": "AHRM1IRR",
369
+ // "priceChange": "525",
370
+ // "priceChangePercent": "2.077",
371
+ // "weightedAvgPrice": "0",
372
+ // "prevClosePrice": "0",
373
+ // "lastPrice": "25800",
374
+ // "lastQty": "14050",
375
+ // "bidPrice": "0",
376
+ // "askPrice": "0",
377
+ // "openPrice": "25275",
378
+ // "highPrice": "26200",
379
+ // "lowPrice": "25274",
380
+ // "volume": "1076873",
381
+ // "valueIrr": "55104642690",
382
+ // "openTime": 1760271737577,
383
+ // "closeTime": 1760351215075,
384
+ // "count": 348
385
+ // }
386
+ const marketType = 'otc';
387
+ const marketId = this.safeString(ticker, 'symbol');
388
+ const symbol = this.safeSymbol(marketId, market, undefined, marketType);
389
+ const timestamp = this.safeInteger(ticker, 'closeTime');
390
+ const high = this.safeString(ticker, 'highPrice');
391
+ const low = this.safeString(ticker, 'lowPrice');
392
+ const bid = this.safeString(ticker, 'bidPrice');
393
+ const ask = this.safeString(ticker, 'askPrice');
394
+ const last = this.safeString(ticker, 'lastPrice');
395
+ const open = this.safeString(ticker, 'openPrice');
396
+ const baseVolume = this.safeString(ticker, 'volume');
397
+ const quoteVolume = this.safeString(ticker, 'valueIrr');
398
+ const priceChange = this.safeString(ticker, 'priceChange');
399
+ const percentage = this.safeString(ticker, 'priceChangePercent');
400
+ return this.safeTicker({
401
+ 'symbol': symbol,
402
+ 'timestamp': timestamp,
403
+ 'datetime': this.iso8601(timestamp),
404
+ 'high': high,
405
+ 'low': low,
406
+ 'bid': bid,
407
+ 'bidVolume': undefined,
408
+ 'ask': ask,
409
+ 'askVolume': undefined,
410
+ 'vwap': undefined,
411
+ 'open': open,
412
+ 'close': last,
413
+ 'last': last,
414
+ 'previousClose': undefined,
415
+ 'change': priceChange,
416
+ 'percentage': percentage,
417
+ 'average': undefined,
418
+ 'baseVolume': baseVolume,
419
+ 'quoteVolume': quoteVolume,
420
+ 'info': ticker,
421
+ }, market);
422
+ }
423
+ async fetchOHLCV(symbol, timeframe = '1d', since = undefined, limit = undefined, params = {}) {
424
+ /**
425
+ * @method
426
+ * @name mazdax#fetchOHLCV
427
+ * @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
428
+ * @see https://api.mazdax.ir/market/candle
429
+ * @param {string} symbol unified symbol of the market to fetch OHLCV data for
430
+ * @param {string} timeframe the length of time each candle represents
431
+ * @param {int} [since] timestamp in ms of the earliest candle to fetch
432
+ * @param {int} [limit] the maximum amount of candles to fetch
433
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
434
+ * @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
435
+ */
436
+ await this.loadMarkets();
437
+ const market = this.market(symbol);
438
+ const endTime = Date.now();
439
+ const request = {
440
+ 'from': 'binance',
441
+ 'symbol': market['id'],
442
+ 'interval': this.safeString(this.timeframes, timeframe, timeframe),
443
+ 'limit': limit !== undefined ? limit : 1000,
444
+ 'starttime': (endTime) - (30 * 24 * 60 * 60 * 1000),
445
+ 'endtime': endTime,
446
+ };
447
+ if (since !== undefined) {
448
+ request['starttime'] = since / 1000;
449
+ }
450
+ const response = await this.publicGetMarketCandle(request);
451
+ // {
452
+ // "Candles": [
453
+ // {
454
+ // "openTime": "2021-12-20T03:30:00+03:30",
455
+ // "openPrice": "10000",
456
+ // "highPrice": "10000",
457
+ // "lowPrice": "10000",
458
+ // "closePrice": "10000",
459
+ // "volume": "490000000",
460
+ // "closeTime": "2021-12-20T03:30:00+03:30",
461
+ // "quoteAssetVolume": "0",
462
+ // "numberOfTrades": 0,
463
+ // "takerBuyBaseAssetVolume": "0",
464
+ // "takerBuyQuoteAssetVolume": "0",
465
+ // "ignore": "0"
466
+ // },
467
+ // ...
468
+ // ]
469
+ // }
470
+ const candles = this.safeList(response, 'Candles', []);
471
+ const ohlcvs = [];
472
+ for (let i = 0; i < candles.length; i++) {
473
+ const candle = candles[i];
474
+ const timestamp = this.parse8601(this.safeString(candle, 'openTime'));
475
+ const open = this.safeString(candle, 'openPrice');
476
+ const high = this.safeString(candle, 'highPrice');
477
+ const low = this.safeString(candle, 'lowPrice');
478
+ const close = this.safeString(candle, 'closePrice');
479
+ const volume = this.safeString(candle, 'volume');
480
+ ohlcvs.push([
481
+ timestamp,
482
+ open,
483
+ high,
484
+ low,
485
+ close,
486
+ volume,
487
+ ]);
488
+ }
489
+ return this.parseOHLCVs(ohlcvs, market, timeframe, since, limit);
490
+ }
491
+ async fetchOrderBook(symbol, limit = undefined, params = {}) {
492
+ /**
493
+ * @method
494
+ * @name mazdax#fetchOrderBook
495
+ * @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
496
+ * @see https://api.mazdax.ir/market/order
497
+ * @param {string} symbol unified symbol of the market to fetch the order book for
498
+ * @param {int} [limit] the maximum amount of order book entries to return
499
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
500
+ * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
501
+ */
502
+ await this.loadMarkets();
503
+ const market = this.market(symbol);
504
+ const request = {
505
+ 'from': 'mazdax',
506
+ 'symbol': market['id'],
507
+ 'limit': limit !== undefined ? limit : 25,
508
+ };
509
+ const response = await this.publicGetMarketOrder(request);
510
+ // {
511
+ // "timestamp": "0001-01-01T00:00:00Z",
512
+ // "bids": [
513
+ // ["25321", "9344"],
514
+ // ["25320", "15000"],
515
+ // ...
516
+ // ],
517
+ // "asks": [
518
+ // ["26190", "5341"],
519
+ // ["26195", "2310"],
520
+ // ...
521
+ // ]
522
+ // }
523
+ const timestamp = this.parse8601(this.safeString(response, 'timestamp'));
524
+ return this.parseOrderBook(response, symbol, timestamp, 'bids', 'asks', 0, 1);
525
+ }
526
+ sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
527
+ const query = this.omit(params, this.extractParams(path));
528
+ let url = this.urls['api']['public'] + '/' + path;
529
+ if (Object.keys(query).length) {
530
+ url = url + '?' + this.urlencode(query);
531
+ }
532
+ headers = { 'Content-Type': 'application/json' };
533
+ return { 'url': url, 'method': method, 'body': body, 'headers': headers };
534
+ }
535
+ }
@@ -0,0 +1,22 @@
1
+ import Exchange from './abstract/pingi.js';
2
+ import { Int, Market, OHLCV, Strings, Ticker, Tickers } from './base/types.js';
3
+ /**
4
+ * @class pingi
5
+ * @augments Exchange
6
+ * @description Pingi OTC exchange implementation
7
+ */
8
+ export default class pingi extends Exchange {
9
+ describe(): any;
10
+ fetchMarkets(params?: {}): Promise<Market[]>;
11
+ parseMarket(market: any): Market;
12
+ fetchTickers(symbols?: Strings, params?: {}): Promise<Tickers>;
13
+ fetchTicker(symbol: string, params?: {}): Promise<Ticker>;
14
+ parseTicker(ticker: any, market?: Market): Ticker;
15
+ fetchOHLCV(symbol: string, timeframe?: string, since?: Int, limit?: Int, params?: {}): Promise<OHLCV[]>;
16
+ sign(path: any, api?: string, method?: string, params?: {}, headers?: any, body?: any): {
17
+ url: string;
18
+ method: string;
19
+ body: any;
20
+ headers: any;
21
+ };
22
+ }