ccxt-ir 4.9.16 → 4.9.22

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 (36) hide show
  1. package/README.md +3 -3
  2. package/dist/ccxt.browser.min.js +3 -3
  3. package/dist/cjs/ccxt.js +1 -1
  4. package/dist/cjs/src/abstract/bitunix.js +1 -1
  5. package/dist/cjs/src/bitunix.js +317 -317
  6. package/dist/cjs/src/kcex.js +4 -4
  7. package/dist/cjs/src/ompfinex.js +501 -498
  8. package/dist/cjs/src/sarmayex.js +1 -1
  9. package/dist/cjs/src/toobit.js +2 -2
  10. package/dist/cjs/src/xt.js +5171 -5171
  11. package/js/ccxt.d.ts +1 -1
  12. package/js/ccxt.js +1 -1
  13. package/js/src/abstract/bitunix.d.ts +9 -9
  14. package/js/src/abstract/bitunix.js +5 -5
  15. package/js/src/abstract/kcex.d.ts +10 -10
  16. package/js/src/base/Exchange.d.ts +2 -2
  17. package/js/src/bitunix.d.ts +21 -21
  18. package/js/src/bitunix.js +320 -320
  19. package/js/src/coinbaseexchange.d.ts +1 -1
  20. package/js/src/kcex.d.ts +21 -21
  21. package/js/src/kcex.js +4 -4
  22. package/js/src/ompfinex.js +504 -501
  23. package/js/src/protobuf/mexc/compiled.d.cts +6 -0
  24. package/js/src/sarmayex.js +1 -1
  25. package/js/src/static_dependencies/fflake/browser.d.ts +5 -5
  26. package/js/src/static_dependencies/jsencrypt/lib/jsbn/jsbn.d.ts +1 -1
  27. package/js/src/static_dependencies/noble-curves/abstract/weierstrass.d.ts +204 -204
  28. package/js/src/static_dependencies/qs/formats.d.cts +6 -0
  29. package/js/src/static_dependencies/qs/index.d.cts +6 -0
  30. package/js/src/static_dependencies/qs/parse.d.cts +6 -0
  31. package/js/src/static_dependencies/qs/stringify.d.cts +6 -0
  32. package/js/src/static_dependencies/qs/utils.d.cts +6 -0
  33. package/js/src/static_dependencies/starknet/utils/calldata/parser/index.d.ts +1 -1
  34. package/js/src/toobit.js +2 -2
  35. package/js/src/xt.js +5178 -5178
  36. package/package.json +1 -1
package/js/src/bitunix.js CHANGED
@@ -4,323 +4,323 @@
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/bitunix.js';
9
- // ---------------------------------------------------------------------------
10
- /**
11
- * @class bitunix
12
- * @augments Exchange
13
- * @description Set rateLimit to 1000 if fully verified
14
- */
15
- export default class bitunix extends Exchange {
16
- describe() {
17
- return this.deepExtend(super.describe(), {
18
- 'id': 'bitunix',
19
- 'name': 'bitunix',
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': true,
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
- '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/bitunix/64x64.png',
91
- 'api': {
92
- 'market': 'https://openapi.bitunix.com/',
93
- 'tickers': 'https://api.bitunix.com/',
94
- },
95
- 'www': 'https://www.bitunix.com/',
96
- 'doc': [
97
- 'https://openapidoc.bitunix.com/',
98
- ],
99
- },
100
- 'timeframes': {
101
- '1m': '1',
102
- '5m': '5',
103
- '15m': '15',
104
- '30m': '30',
105
- '1h': '60',
106
- '3h': '180',
107
- '4h': '240',
108
- '12h': '720',
109
- '1d': '1D',
110
- '1w': '1W',
111
- },
112
- 'api': {
113
- 'public': {
114
- 'get': {
115
- 'api/spot/v1/common/coin_pair/list/': 1,
116
- 'web/api/v1/common/tickers/': 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 bitunix#fetchMarkets
134
- * @description retrieves data on all markets for bitunix
135
- * @see https://api-docs.bitunix.ir/#be8d9c51a2
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.publicGetApiSpotV1CommonCoinPairList(params);
140
- const markets = this.safeList(response, 'data');
141
- const result = [];
142
- for (let i = 0; i < markets.length; i++) {
143
- const market = this.parseMarket(markets[i]);
144
- result.push(market);
145
- }
146
- return result;
147
- }
148
- parseMarket(market) {
149
- // {
150
- // id: 1,
151
- // symbol: "btcusdt",
152
- // base: "BTC",
153
- // baseIcon: "https://img.bitunix.com/config/kv/228408.png",
154
- // quote: "USDT",
155
- // quoteIcon: "https://img.bitunix.com/config/coin/USDT.png",
156
- // basePrecision: 5,
157
- // quotePrecision: 2,
158
- // minPrice: "10.0000000000000000",
159
- // minVolume: "0.0000500000000000",
160
- // maxAmount: "500000.0000000000000000",
161
- // minAmount: "0.0000000000000000",
162
- // maxLimitOrderAmount: "1500000.0000000000000000",
163
- // maxMarketOrderAmount: "2000000.0000000000000000",
164
- // maxSlippage: "0.0500",
165
- // premiumFactor: "0.0500",
166
- // minBuyPriceOffset: "-0.8000",
167
- // maxSellPriceOffset: "50.0000",
168
- // isOpen: 1,
169
- // isHot: 1,
170
- // isRecommend: 1,
171
- // isShow: 1,
172
- // tradeArea: "USDT",
173
- // sort: 1,
174
- // openTime: null,
175
- // ctime: "2023-05-12T18:03:08Z",
176
- // precisions: [
177
- // "0.0100000000000000",
178
- // "0.1000000000000000",
179
- // "1.0000000000000000",
180
- // "10.0000000000000000",
181
- // "100.0000000000000000"
182
- // ]
183
- // }
184
- const baseId = this.safeString(market, 'base');
185
- const quoteId = this.safeString(market, 'quote');
186
- const base = this.safeCurrencyCode(baseId);
187
- const quote = this.safeCurrencyCode(quoteId);
188
- const id = (base + quote);
189
- return {
190
- 'id': id,
191
- 'symbol': base + '/' + quote,
192
- 'base': base,
193
- 'quote': quote,
194
- 'settle': undefined,
195
- 'baseId': baseId,
196
- 'quoteId': quoteId,
197
- 'settleId': undefined,
198
- 'type': 'spot',
199
- 'spot': true,
200
- 'margin': false,
201
- 'swap': false,
202
- 'future': false,
203
- 'option': false,
204
- 'active': true,
205
- 'contract': false,
206
- 'linear': undefined,
207
- 'inverse': undefined,
208
- 'contractSize': undefined,
209
- 'expiry': undefined,
210
- 'expiryDatetime': undefined,
211
- 'strike': undefined,
212
- 'optionType': undefined,
213
- 'precision': {
214
- 'amount': undefined,
215
- 'price': undefined,
216
- },
217
- 'limits': {
218
- 'leverage': {
219
- 'min': undefined,
220
- 'max': undefined,
221
- },
222
- 'amount': {
223
- 'min': undefined,
224
- 'max': undefined,
225
- },
226
- 'price': {
227
- 'min': undefined,
228
- 'max': undefined,
229
- },
230
- 'cost': {
231
- 'min': undefined,
232
- 'max': undefined,
233
- },
234
- },
235
- 'created': undefined,
236
- 'info': market,
237
- };
238
- }
239
- async fetchTickers(symbols = undefined, params = {}) {
240
- /**
241
- * @method
242
- * @name bitunix#fetchTickers
243
- * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
244
- * @see https://api-docs.bitunix.ir/#be8d9c51a2
245
- * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
246
- * @param {object} [params] extra parameters specific to the exchange API endpoint
247
- * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
248
- */
249
- await this.loadMarkets();
250
- if (symbols !== undefined) {
251
- symbols = this.marketSymbols(symbols);
252
- }
253
- const response = await this.publicGetWebApiV1CommonTickers();
254
- const markets = this.safeList(response, 'data');
255
- const result = {};
256
- for (let i = 0; i < markets.length; i++) {
257
- const ticker = this.parseTicker(markets[i]);
258
- const symbol = ticker['symbol'];
259
- result[symbol] = ticker;
260
- }
261
- return this.filterByArrayTickers(result, 'symbol', symbols);
262
- }
263
- async fetchTicker(symbol, params = {}) {
264
- /**
265
- * @method
266
- * @name bitunix#fetchTicker
267
- * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
268
- * @see https://api-docs.bitunix.ir/#be8d9c51a2
269
- * @param {string} symbol unified symbol of the market to fetch the ticker for
270
- * @param {object} [params] extra parameters specific to the exchange API endpoint
271
- * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
272
- */
273
- const ticker = await this.fetchTickers([symbol]);
274
- return ticker[symbol];
275
- }
276
- parseTicker(ticker, market = undefined) {
277
- // {
278
- // symbol: "BTCUSDT",
279
- // base: "BTC",
280
- // quote: "USDT",
281
- // close: "112832.34",
282
- // rose24h: "0.2276416293",
283
- // volume: "228310106.7861019"
284
- // },
285
- const marketType = 'spot';
286
- const marketId = this.safeString(ticker, 'symbol');
287
- const symbol = this.safeSymbol(marketId, market, undefined, marketType);
288
- const last = this.safeFloat(ticker, 'close', 0);
289
- const change = this.safeFloat(ticker, 'rose24h', 0);
290
- const quoteVolume = this.safeFloat(ticker, 'volume', 0);
291
- let baseVolume = 0;
292
- if (last !== 0) {
293
- baseVolume = quoteVolume / last;
294
- }
295
- return this.safeTicker({
296
- 'symbol': symbol,
297
- 'timestamp': undefined,
298
- 'datetime': undefined,
299
- 'high': undefined,
300
- 'low': undefined,
301
- 'bid': undefined,
302
- 'bidVolume': undefined,
303
- 'ask': undefined,
304
- 'askVolume': undefined,
305
- 'vwap': undefined,
306
- 'open': undefined,
307
- 'close': last,
308
- 'last': last,
309
- 'previousClose': undefined,
310
- 'change': change,
311
- 'percentage': change,
312
- 'average': undefined,
313
- 'baseVolume': baseVolume,
314
- 'quoteVolume': quoteVolume,
315
- 'info': ticker,
316
- }, market);
317
- }
318
- sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
319
- let url = this.urls['api']['market'] + '/' + path;
320
- if (path === 'web/api/v1/common/tickers/') {
321
- url = this.urls['api']['tickers'] + '/' + path;
322
- }
323
- headers = { 'Content-Type': 'application/json' };
324
- return { 'url': url, 'method': method, 'body': body, 'headers': headers };
325
- }
326
- }
7
+ // ---------------------------------------------------------------------------
8
+ import Exchange from './abstract/bitunix.js';
9
+ // ---------------------------------------------------------------------------
10
+ /**
11
+ * @class bitunix
12
+ * @augments Exchange
13
+ * @description Set rateLimit to 1000 if fully verified
14
+ */
15
+ export default class bitunix extends Exchange {
16
+ describe() {
17
+ return this.deepExtend(super.describe(), {
18
+ 'id': 'bitunix',
19
+ 'name': 'bitunix',
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': true,
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
+ '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/bitunix/64x64.png',
91
+ 'api': {
92
+ 'market': 'https://openapi.bitunix.com/',
93
+ 'tickers': 'https://api.bitunix.com/',
94
+ },
95
+ 'www': 'https://www.bitunix.com/',
96
+ 'doc': [
97
+ 'https://openapidoc.bitunix.com/',
98
+ ],
99
+ },
100
+ 'timeframes': {
101
+ '1m': '1',
102
+ '5m': '5',
103
+ '15m': '15',
104
+ '30m': '30',
105
+ '1h': '60',
106
+ '3h': '180',
107
+ '4h': '240',
108
+ '12h': '720',
109
+ '1d': '1D',
110
+ '1w': '1W',
111
+ },
112
+ 'api': {
113
+ 'public': {
114
+ 'get': {
115
+ 'api/spot/v1/common/coin_pair/list/': 1,
116
+ 'web/api/v1/common/tickers/': 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 bitunix#fetchMarkets
134
+ * @description retrieves data on all markets for bitunix
135
+ * @see https://api-docs.bitunix.ir/#be8d9c51a2
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.publicGetApiSpotV1CommonCoinPairList(params);
140
+ const markets = this.safeList(response, 'data');
141
+ const result = [];
142
+ for (let i = 0; i < markets.length; i++) {
143
+ const market = this.parseMarket(markets[i]);
144
+ result.push(market);
145
+ }
146
+ return result;
147
+ }
148
+ parseMarket(market) {
149
+ // {
150
+ // id: 1,
151
+ // symbol: "btcusdt",
152
+ // base: "BTC",
153
+ // baseIcon: "https://img.bitunix.com/config/kv/228408.png",
154
+ // quote: "USDT",
155
+ // quoteIcon: "https://img.bitunix.com/config/coin/USDT.png",
156
+ // basePrecision: 5,
157
+ // quotePrecision: 2,
158
+ // minPrice: "10.0000000000000000",
159
+ // minVolume: "0.0000500000000000",
160
+ // maxAmount: "500000.0000000000000000",
161
+ // minAmount: "0.0000000000000000",
162
+ // maxLimitOrderAmount: "1500000.0000000000000000",
163
+ // maxMarketOrderAmount: "2000000.0000000000000000",
164
+ // maxSlippage: "0.0500",
165
+ // premiumFactor: "0.0500",
166
+ // minBuyPriceOffset: "-0.8000",
167
+ // maxSellPriceOffset: "50.0000",
168
+ // isOpen: 1,
169
+ // isHot: 1,
170
+ // isRecommend: 1,
171
+ // isShow: 1,
172
+ // tradeArea: "USDT",
173
+ // sort: 1,
174
+ // openTime: null,
175
+ // ctime: "2023-05-12T18:03:08Z",
176
+ // precisions: [
177
+ // "0.0100000000000000",
178
+ // "0.1000000000000000",
179
+ // "1.0000000000000000",
180
+ // "10.0000000000000000",
181
+ // "100.0000000000000000"
182
+ // ]
183
+ // }
184
+ const baseId = this.safeString(market, 'base');
185
+ const quoteId = this.safeString(market, 'quote');
186
+ const base = this.safeCurrencyCode(baseId);
187
+ const quote = this.safeCurrencyCode(quoteId);
188
+ const id = (base + quote);
189
+ return {
190
+ 'id': id,
191
+ 'symbol': base + '/' + quote,
192
+ 'base': base,
193
+ 'quote': quote,
194
+ 'settle': undefined,
195
+ 'baseId': baseId,
196
+ 'quoteId': quoteId,
197
+ 'settleId': undefined,
198
+ 'type': 'spot',
199
+ 'spot': true,
200
+ 'margin': false,
201
+ 'swap': false,
202
+ 'future': false,
203
+ 'option': false,
204
+ 'active': true,
205
+ 'contract': false,
206
+ 'linear': undefined,
207
+ 'inverse': undefined,
208
+ 'contractSize': undefined,
209
+ 'expiry': undefined,
210
+ 'expiryDatetime': undefined,
211
+ 'strike': undefined,
212
+ 'optionType': undefined,
213
+ 'precision': {
214
+ 'amount': undefined,
215
+ 'price': undefined,
216
+ },
217
+ 'limits': {
218
+ 'leverage': {
219
+ 'min': undefined,
220
+ 'max': undefined,
221
+ },
222
+ 'amount': {
223
+ 'min': undefined,
224
+ 'max': undefined,
225
+ },
226
+ 'price': {
227
+ 'min': undefined,
228
+ 'max': undefined,
229
+ },
230
+ 'cost': {
231
+ 'min': undefined,
232
+ 'max': undefined,
233
+ },
234
+ },
235
+ 'created': undefined,
236
+ 'info': market,
237
+ };
238
+ }
239
+ async fetchTickers(symbols = undefined, params = {}) {
240
+ /**
241
+ * @method
242
+ * @name bitunix#fetchTickers
243
+ * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
244
+ * @see https://api-docs.bitunix.ir/#be8d9c51a2
245
+ * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
246
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
247
+ * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
248
+ */
249
+ await this.loadMarkets();
250
+ if (symbols !== undefined) {
251
+ symbols = this.marketSymbols(symbols);
252
+ }
253
+ const response = await this.publicGetWebApiV1CommonTickers();
254
+ const markets = this.safeList(response, 'data');
255
+ const result = {};
256
+ for (let i = 0; i < markets.length; i++) {
257
+ const ticker = this.parseTicker(markets[i]);
258
+ const symbol = ticker['symbol'];
259
+ result[symbol] = ticker;
260
+ }
261
+ return this.filterByArrayTickers(result, 'symbol', symbols);
262
+ }
263
+ async fetchTicker(symbol, params = {}) {
264
+ /**
265
+ * @method
266
+ * @name bitunix#fetchTicker
267
+ * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
268
+ * @see https://api-docs.bitunix.ir/#be8d9c51a2
269
+ * @param {string} symbol unified symbol of the market to fetch the ticker for
270
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
271
+ * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
272
+ */
273
+ const ticker = await this.fetchTickers([symbol]);
274
+ return ticker[symbol];
275
+ }
276
+ parseTicker(ticker, market = undefined) {
277
+ // {
278
+ // symbol: "BTCUSDT",
279
+ // base: "BTC",
280
+ // quote: "USDT",
281
+ // close: "112832.34",
282
+ // rose24h: "0.2276416293",
283
+ // volume: "228310106.7861019"
284
+ // },
285
+ const marketType = 'spot';
286
+ const marketId = this.safeString(ticker, 'symbol');
287
+ const symbol = this.safeSymbol(marketId, market, undefined, marketType);
288
+ const last = this.safeFloat(ticker, 'close', 0);
289
+ const change = this.safeFloat(ticker, 'rose24h', 0);
290
+ const quoteVolume = this.safeFloat(ticker, 'volume', 0);
291
+ let baseVolume = 0;
292
+ if (last !== 0) {
293
+ baseVolume = quoteVolume / last;
294
+ }
295
+ return this.safeTicker({
296
+ 'symbol': symbol,
297
+ 'timestamp': undefined,
298
+ 'datetime': undefined,
299
+ 'high': undefined,
300
+ 'low': undefined,
301
+ 'bid': undefined,
302
+ 'bidVolume': undefined,
303
+ 'ask': undefined,
304
+ 'askVolume': undefined,
305
+ 'vwap': undefined,
306
+ 'open': undefined,
307
+ 'close': last,
308
+ 'last': last,
309
+ 'previousClose': undefined,
310
+ 'change': change,
311
+ 'percentage': change,
312
+ 'average': undefined,
313
+ 'baseVolume': baseVolume,
314
+ 'quoteVolume': quoteVolume,
315
+ 'info': ticker,
316
+ }, market);
317
+ }
318
+ sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
319
+ let url = this.urls['api']['market'] + '/' + path;
320
+ if (path === 'web/api/v1/common/tickers/') {
321
+ url = this.urls['api']['tickers'] + '/' + path;
322
+ }
323
+ headers = { 'Content-Type': 'application/json' };
324
+ return { 'url': url, 'method': method, 'body': body, 'headers': headers };
325
+ }
326
+ }
@@ -311,7 +311,7 @@ export default class coinbaseexchange extends Exchange {
311
311
  * @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
312
312
  */
313
313
  fetchWithdrawals(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
314
- parseTransactionStatus(transaction: any): "pending" | "ok" | "failed" | "canceled";
314
+ parseTransactionStatus(transaction: any): "canceled" | "pending" | "ok" | "failed";
315
315
  parseTransaction(transaction: Dict, currency?: Currency): Transaction;
316
316
  /**
317
317
  * @method