ccxt-ir 4.23.2 → 4.24.0

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.
package/js/src/bitbarg.js CHANGED
@@ -4,328 +4,328 @@
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/bitbarg.js';
9
- // ---------------------------------------------------------------------------
10
- /**
11
- * @class bitbarg
12
- * @augments Exchange
13
- * @description Set rateLimit to 1000 if fully verified
14
- */
15
- export default class bitbarg extends Exchange {
16
- describe() {
17
- return this.deepExtend(super.describe(), {
18
- 'id': 'bitbarg',
19
- 'name': 'Bitbarg',
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': false,
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/bitbarg/64x64.png',
91
- 'api': {
92
- 'public': 'https://api.bitbarg.com',
93
- },
94
- 'www': 'https://bitbarg.com/',
95
- 'doc': [
96
- 'https://bitbarg.com/',
97
- ],
98
- },
99
- 'api': {
100
- 'public': {
101
- 'get': {
102
- '/api/v1/currencies': 1,
103
- },
104
- },
105
- },
106
- 'fees': {
107
- 'trading': {
108
- 'tierBased': false,
109
- 'percentage': true,
110
- 'maker': this.parseNumber('0.001'),
111
- 'taker': this.parseNumber('0.001'),
112
- },
113
- },
114
- });
115
- }
116
- parseMarket(market) {
117
- // "id": 53,
118
- // "icon": "https://s3.bitbarg.com/currencies/btc.webp",
119
- // "tradeActive": true,
120
- // "faName": "بیت کوین",
121
- // "enName": "Bitcoin",
122
- // "coin": "BTC",
123
- // "path": "bitcoin",
124
- // "price": 112192,
125
- // "quote": "813430226.5004",
126
- // "percent": -5.735,
127
- // "decimal": 8,
128
- // "isFavorite": false,
129
- const baseId = this.safeString(market, 'coin');
130
- // Bitbarg reports USDT's price in IRT; all other currencies are
131
- // quoted in USDT.
132
- let quoteId = 'USDT';
133
- if (baseId === 'USDT') {
134
- quoteId = 'IRT';
135
- }
136
- const base = this.safeCurrencyCode(baseId);
137
- const quote = this.safeCurrencyCode(quoteId);
138
- const id = baseId + '/' + quoteId;
139
- return {
140
- 'id': id,
141
- 'symbol': id,
142
- 'base': base,
143
- 'quote': quote,
144
- 'settle': undefined,
145
- 'baseId': baseId,
146
- 'quoteId': quoteId,
147
- 'settleId': undefined,
148
- 'type': 'spot',
149
- 'spot': true,
150
- 'margin': false,
151
- 'swap': false,
152
- 'future': false,
153
- 'option': false,
154
- 'active': true,
155
- 'contract': false,
156
- 'linear': undefined,
157
- 'inverse': undefined,
158
- 'contractSize': undefined,
159
- 'expiry': undefined,
160
- 'expiryDatetime': undefined,
161
- 'strike': undefined,
162
- 'optionType': undefined,
163
- 'precision': {
164
- 'amount': undefined,
165
- 'price': undefined,
166
- },
167
- 'limits': {
168
- 'leverage': {
169
- 'min': undefined,
170
- 'max': undefined,
171
- },
172
- 'amount': {
173
- 'min': undefined,
174
- 'max': undefined,
175
- },
176
- 'price': {
177
- 'min': undefined,
178
- 'max': undefined,
179
- },
180
- 'cost': {
181
- 'min': undefined,
182
- 'max': undefined,
183
- },
184
- },
185
- 'created': undefined,
186
- 'info': market,
187
- };
188
- }
189
- async fetchMarkets(params = {}) {
190
- /**
191
- * @method
192
- * @name bitbarg#fetchMarkets
193
- * @description retrieves data on all markets for bitbarg
194
- * @see https://api.bitbarg.com/api/v1/currencies?pageSize=-1
195
- * @param {object} [params] extra parameters specific to the exchange API endpoint
196
- * @returns {object[]} an array of objects representing market data
197
- */
198
- const request = {
199
- 'pageSize': -1,
200
- };
201
- const response = await this.publicGetApiV1Currencies(this.extend(request, params));
202
- const result = [];
203
- const data = this.safeDict(response, 'result', {});
204
- const items = this.safeList(data, 'items', []);
205
- // Create markets for each currency with IRT quote
206
- for (let i = 0; i < items.length; i++) {
207
- const market = this.parseMarket(items[i]);
208
- result.push(market);
209
- }
210
- return result;
211
- }
212
- async fetchTickers(symbols = undefined, params = {}) {
213
- /**
214
- * @method
215
- * @name bitbarg#fetchTickers
216
- * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
217
- * @see https://api.bitbarg.com/api/v1/currencies?pageSize=-1
218
- * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
219
- * @param {object} [params] extra parameters specific to the exchange API endpoint
220
- * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
221
- */
222
- await this.loadMarkets();
223
- if (symbols !== undefined) {
224
- symbols = this.marketSymbols(symbols);
225
- }
226
- const request = {
227
- 'pageSize': -1,
228
- };
229
- const response = await this.publicGetApiV1Currencies(request);
230
- const data = this.safeDict(response, 'result', {});
231
- const meta = this.safeDict(data, 'meta', {});
232
- const usdtPrice = this.safeFloat(meta, 'usdtPrice');
233
- const items = this.safeList(data, 'items', []);
234
- const result = {};
235
- for (let i = 0; i < items.length; i++) {
236
- const coinData = items[i];
237
- const baseId = this.safeString(coinData, 'coin');
238
- // All currencies are quoted in USDT except USDT itself, which is
239
- // quoted in IRT by the API.
240
- let quoteId = 'USDT';
241
- if (baseId === 'USDT') {
242
- quoteId = 'IRT';
243
- }
244
- const base = this.safeCurrencyCode(baseId);
245
- const quote = this.safeCurrencyCode(quoteId);
246
- const symbol = base + '/' + quote;
247
- const ticker = this.extend({
248
- 'symbol': symbol,
249
- 'baseId': baseId,
250
- 'quoteId': quoteId,
251
- 'id': baseId + '/' + quoteId,
252
- }, coinData);
253
- if (baseId === 'USDT' && usdtPrice !== undefined) {
254
- ticker['price'] = usdtPrice;
255
- }
256
- result[symbol] = this.parseTicker(ticker);
257
- }
258
- return this.filterByArrayTickers(result, 'symbol', symbols);
259
- }
260
- async fetchTicker(symbol, params = {}) {
261
- /**
262
- * @method
263
- * @name bitbarg#fetchTicker
264
- * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
265
- * @see https://api.bitbarg.com/api/v1/currencies?pageSize=-1
266
- * @param {string} symbol unified symbol of the market to fetch the ticker for
267
- * @param {object} [params] extra parameters specific to the exchange API endpoint
268
- * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
269
- */
270
- const ticker = await this.fetchTickers([symbol]);
271
- return ticker[symbol];
272
- }
273
- parseTicker(ticker, market = undefined) {
274
- // {
275
- // "id": 1,
276
- // "icon": "https://...",
277
- // "tradeActive": true,
278
- // "faName": "بیت کوین",
279
- // "enName": "Bitcoin",
280
- // "coin": "BTC",
281
- // "path": "bitcoin",
282
- // "price": 110387.56,
283
- // "quote": "57479298399.76",
284
- // "percent": -3.01,
285
- // "decimal": 5,
286
- // "isFavorite": false,
287
- // "chart": [...]
288
- // }
289
- const marketType = 'spot';
290
- const baseId = this.safeString(ticker, 'coin');
291
- let quoteId = 'USDT';
292
- if (baseId === 'USDT') {
293
- quoteId = 'IRT';
294
- }
295
- const marketId = baseId + '/' + quoteId;
296
- const symbol = this.safeSymbol(marketId, market, undefined, marketType);
297
- const last = this.safeFloat(ticker, 'price', 0);
298
- const percentage = this.safeFloat(ticker, 'percent', 0);
299
- const baseVolume = this.safeFloat(ticker, 'quote');
300
- return this.safeTicker({
301
- 'symbol': symbol,
302
- 'timestamp': undefined,
303
- 'datetime': undefined,
304
- 'high': undefined,
305
- 'low': undefined,
306
- 'bid': last,
307
- 'bidVolume': undefined,
308
- 'ask': last,
309
- 'askVolume': undefined,
310
- 'vwap': undefined,
311
- 'open': undefined,
312
- 'close': last,
313
- 'last': last,
314
- 'previousClose': undefined,
315
- 'change': undefined,
316
- 'percentage': percentage,
317
- 'average': undefined,
318
- 'baseVolume': baseVolume,
319
- 'quoteVolume': undefined,
320
- 'info': ticker,
321
- }, market);
322
- }
323
- sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
324
- let url = this.urls['api']['public'] + path;
325
- if (Object.keys(params).length) {
326
- url += '?' + this.urlencode(params);
327
- }
328
- headers = { 'Content-Type': 'application/json' };
329
- return { 'url': url, 'method': method, 'body': body, 'headers': headers };
330
- }
331
- }
7
+ // ---------------------------------------------------------------------------
8
+ import Exchange from './abstract/bitbarg.js';
9
+ // ---------------------------------------------------------------------------
10
+ /**
11
+ * @class bitbarg
12
+ * @augments Exchange
13
+ * @description Set rateLimit to 1000 if fully verified
14
+ */
15
+ export default class bitbarg extends Exchange {
16
+ describe() {
17
+ return this.deepExtend(super.describe(), {
18
+ 'id': 'bitbarg',
19
+ 'name': 'Bitbarg',
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': false,
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/bitbarg/64x64.png',
91
+ 'api': {
92
+ 'public': 'https://api.bitbarg.com',
93
+ },
94
+ 'www': 'https://bitbarg.com/',
95
+ 'doc': [
96
+ 'https://bitbarg.com/',
97
+ ],
98
+ },
99
+ 'api': {
100
+ 'public': {
101
+ 'get': {
102
+ '/api/v1/currencies': 1,
103
+ },
104
+ },
105
+ },
106
+ 'fees': {
107
+ 'trading': {
108
+ 'tierBased': false,
109
+ 'percentage': true,
110
+ 'maker': this.parseNumber('0.001'),
111
+ 'taker': this.parseNumber('0.001'),
112
+ },
113
+ },
114
+ });
115
+ }
116
+ parseMarket(market) {
117
+ // "id": 53,
118
+ // "icon": "https://s3.bitbarg.com/currencies/btc.webp",
119
+ // "tradeActive": true,
120
+ // "faName": "بیت کوین",
121
+ // "enName": "Bitcoin",
122
+ // "coin": "BTC",
123
+ // "path": "bitcoin",
124
+ // "price": 112192,
125
+ // "quote": "813430226.5004",
126
+ // "percent": -5.735,
127
+ // "decimal": 8,
128
+ // "isFavorite": false,
129
+ const baseId = this.safeString(market, 'coin');
130
+ // Bitbarg reports USDT's price in IRT; all other currencies are
131
+ // quoted in USDT.
132
+ let quoteId = 'USDT';
133
+ if (baseId === 'USDT') {
134
+ quoteId = 'IRT';
135
+ }
136
+ const base = this.safeCurrencyCode(baseId);
137
+ const quote = this.safeCurrencyCode(quoteId);
138
+ const id = baseId + '/' + quoteId;
139
+ return {
140
+ 'id': id,
141
+ 'symbol': id,
142
+ 'base': base,
143
+ 'quote': quote,
144
+ 'settle': undefined,
145
+ 'baseId': baseId,
146
+ 'quoteId': quoteId,
147
+ 'settleId': undefined,
148
+ 'type': 'spot',
149
+ 'spot': true,
150
+ 'margin': false,
151
+ 'swap': false,
152
+ 'future': false,
153
+ 'option': false,
154
+ 'active': true,
155
+ 'contract': false,
156
+ 'linear': undefined,
157
+ 'inverse': undefined,
158
+ 'contractSize': undefined,
159
+ 'expiry': undefined,
160
+ 'expiryDatetime': undefined,
161
+ 'strike': undefined,
162
+ 'optionType': undefined,
163
+ 'precision': {
164
+ 'amount': undefined,
165
+ 'price': undefined,
166
+ },
167
+ 'limits': {
168
+ 'leverage': {
169
+ 'min': undefined,
170
+ 'max': undefined,
171
+ },
172
+ 'amount': {
173
+ 'min': undefined,
174
+ 'max': undefined,
175
+ },
176
+ 'price': {
177
+ 'min': undefined,
178
+ 'max': undefined,
179
+ },
180
+ 'cost': {
181
+ 'min': undefined,
182
+ 'max': undefined,
183
+ },
184
+ },
185
+ 'created': undefined,
186
+ 'info': market,
187
+ };
188
+ }
189
+ async fetchMarkets(params = {}) {
190
+ /**
191
+ * @method
192
+ * @name bitbarg#fetchMarkets
193
+ * @description retrieves data on all markets for bitbarg
194
+ * @see https://api.bitbarg.com/api/v1/currencies?pageSize=-1
195
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
196
+ * @returns {object[]} an array of objects representing market data
197
+ */
198
+ const request = {
199
+ 'pageSize': -1,
200
+ };
201
+ const response = await this.publicGetApiV1Currencies(this.extend(request, params));
202
+ const result = [];
203
+ const data = this.safeDict(response, 'result', {});
204
+ const items = this.safeList(data, 'items', []);
205
+ // Create markets for each currency with IRT quote
206
+ for (let i = 0; i < items.length; i++) {
207
+ const market = this.parseMarket(items[i]);
208
+ result.push(market);
209
+ }
210
+ return result;
211
+ }
212
+ async fetchTickers(symbols = undefined, params = {}) {
213
+ /**
214
+ * @method
215
+ * @name bitbarg#fetchTickers
216
+ * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
217
+ * @see https://api.bitbarg.com/api/v1/currencies?pageSize=-1
218
+ * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
219
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
220
+ * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
221
+ */
222
+ await this.loadMarkets();
223
+ if (symbols !== undefined) {
224
+ symbols = this.marketSymbols(symbols);
225
+ }
226
+ const request = {
227
+ 'pageSize': -1,
228
+ };
229
+ const response = await this.publicGetApiV1Currencies(request);
230
+ const data = this.safeDict(response, 'result', {});
231
+ const meta = this.safeDict(data, 'meta', {});
232
+ const usdtPrice = this.safeFloat(meta, 'usdtPrice');
233
+ const items = this.safeList(data, 'items', []);
234
+ const result = {};
235
+ for (let i = 0; i < items.length; i++) {
236
+ const coinData = items[i];
237
+ const baseId = this.safeString(coinData, 'coin');
238
+ // All currencies are quoted in USDT except USDT itself, which is
239
+ // quoted in IRT by the API.
240
+ let quoteId = 'USDT';
241
+ if (baseId === 'USDT') {
242
+ quoteId = 'IRT';
243
+ }
244
+ const base = this.safeCurrencyCode(baseId);
245
+ const quote = this.safeCurrencyCode(quoteId);
246
+ const symbol = base + '/' + quote;
247
+ const ticker = this.extend({
248
+ 'symbol': symbol,
249
+ 'baseId': baseId,
250
+ 'quoteId': quoteId,
251
+ 'id': baseId + '/' + quoteId,
252
+ }, coinData);
253
+ if (baseId === 'USDT' && usdtPrice !== undefined) {
254
+ ticker['price'] = usdtPrice;
255
+ }
256
+ result[symbol] = this.parseTicker(ticker);
257
+ }
258
+ return this.filterByArrayTickers(result, 'symbol', symbols);
259
+ }
260
+ async fetchTicker(symbol, params = {}) {
261
+ /**
262
+ * @method
263
+ * @name bitbarg#fetchTicker
264
+ * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
265
+ * @see https://api.bitbarg.com/api/v1/currencies?pageSize=-1
266
+ * @param {string} symbol unified symbol of the market to fetch the ticker for
267
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
268
+ * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
269
+ */
270
+ const ticker = await this.fetchTickers([symbol]);
271
+ return ticker[symbol];
272
+ }
273
+ parseTicker(ticker, market = undefined) {
274
+ // {
275
+ // "id": 1,
276
+ // "icon": "https://...",
277
+ // "tradeActive": true,
278
+ // "faName": "بیت کوین",
279
+ // "enName": "Bitcoin",
280
+ // "coin": "BTC",
281
+ // "path": "bitcoin",
282
+ // "price": 110387.56,
283
+ // "quote": "57479298399.76",
284
+ // "percent": -3.01,
285
+ // "decimal": 5,
286
+ // "isFavorite": false,
287
+ // "chart": [...]
288
+ // }
289
+ const marketType = 'spot';
290
+ const baseId = this.safeString(ticker, 'coin');
291
+ let quoteId = 'USDT';
292
+ if (baseId === 'USDT') {
293
+ quoteId = 'IRT';
294
+ }
295
+ const marketId = baseId + '/' + quoteId;
296
+ const symbol = this.safeSymbol(marketId, market, undefined, marketType);
297
+ const last = this.safeFloat(ticker, 'price', 0);
298
+ const percentage = this.safeFloat(ticker, 'percent', 0);
299
+ const baseVolume = this.safeFloat(ticker, 'quote');
300
+ return this.safeTicker({
301
+ 'symbol': symbol,
302
+ 'timestamp': undefined,
303
+ 'datetime': undefined,
304
+ 'high': undefined,
305
+ 'low': undefined,
306
+ 'bid': last,
307
+ 'bidVolume': undefined,
308
+ 'ask': last,
309
+ 'askVolume': undefined,
310
+ 'vwap': undefined,
311
+ 'open': undefined,
312
+ 'close': last,
313
+ 'last': last,
314
+ 'previousClose': undefined,
315
+ 'change': undefined,
316
+ 'percentage': percentage,
317
+ 'average': undefined,
318
+ 'baseVolume': baseVolume,
319
+ 'quoteVolume': undefined,
320
+ 'info': ticker,
321
+ }, market);
322
+ }
323
+ sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
324
+ let url = this.urls['api']['public'] + path;
325
+ if (Object.keys(params).length) {
326
+ url += '?' + this.urlencode(params);
327
+ }
328
+ headers = { 'Content-Type': 'application/json' };
329
+ return { 'url': url, 'method': method, 'body': body, 'headers': headers };
330
+ }
331
+ }