ccxt-ir 4.23.0 → 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,309 +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
- const quoteId = 'USDT';
131
- const base = this.safeCurrencyCode(baseId);
132
- const quote = this.safeCurrencyCode(quoteId);
133
- const id = baseId + '/' + quoteId;
134
- return {
135
- 'id': id,
136
- 'symbol': id,
137
- 'base': base,
138
- 'quote': quote,
139
- 'settle': undefined,
140
- 'baseId': baseId,
141
- 'quoteId': quoteId,
142
- 'settleId': undefined,
143
- 'type': 'spot',
144
- 'spot': true,
145
- 'margin': false,
146
- 'swap': false,
147
- 'future': false,
148
- 'option': false,
149
- 'active': true,
150
- 'contract': false,
151
- 'linear': undefined,
152
- 'inverse': undefined,
153
- 'contractSize': undefined,
154
- 'expiry': undefined,
155
- 'expiryDatetime': undefined,
156
- 'strike': undefined,
157
- 'optionType': undefined,
158
- 'precision': {
159
- 'amount': undefined,
160
- 'price': undefined,
161
- },
162
- 'limits': {
163
- 'leverage': {
164
- 'min': undefined,
165
- 'max': undefined,
166
- },
167
- 'amount': {
168
- 'min': undefined,
169
- 'max': undefined,
170
- },
171
- 'price': {
172
- 'min': undefined,
173
- 'max': undefined,
174
- },
175
- 'cost': {
176
- 'min': undefined,
177
- 'max': undefined,
178
- },
179
- },
180
- 'created': undefined,
181
- 'info': market,
182
- };
183
- }
184
- async fetchMarkets(params = {}) {
185
- /**
186
- * @method
187
- * @name bitbarg#fetchMarkets
188
- * @description retrieves data on all markets for bitbarg
189
- * @see https://api.bitbarg.com/api/v1/currencies?pageSize=-1
190
- * @param {object} [params] extra parameters specific to the exchange API endpoint
191
- * @returns {object[]} an array of objects representing market data
192
- */
193
- const request = {
194
- 'pageSize': -1,
195
- };
196
- const response = await this.publicGetApiV1Currencies(this.extend(request, params));
197
- const result = [];
198
- const data = this.safeDict(response, 'result', {});
199
- const items = this.safeList(data, 'items', []);
200
- // Create markets for each currency with IRT quote
201
- for (let i = 0; i < items.length; i++) {
202
- const market = this.parseMarket(items[i]);
203
- result.push(market);
204
- }
205
- return result;
206
- }
207
- async fetchTickers(symbols = undefined, params = {}) {
208
- /**
209
- * @method
210
- * @name bitbarg#fetchTickers
211
- * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
212
- * @see https://api.bitbarg.com/api/v1/currencies?pageSize=-1
213
- * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
214
- * @param {object} [params] extra parameters specific to the exchange API endpoint
215
- * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
216
- */
217
- await this.loadMarkets();
218
- if (symbols !== undefined) {
219
- symbols = this.marketSymbols(symbols);
220
- }
221
- const request = {
222
- 'pageSize': -1,
223
- };
224
- const response = await this.publicGetApiV1Currencies(request);
225
- const data = this.safeDict(response, 'result', {});
226
- const items = this.safeList(data, 'items', []);
227
- const result = {};
228
- for (let i = 0; i < items.length; i++) {
229
- const coinData = items[i];
230
- const baseId = this.safeString(coinData, 'coin');
231
- // Create ticker for USDT quote
232
- const quoteId = 'USDT';
233
- const base = this.safeCurrencyCode(baseId);
234
- const quote = this.safeCurrencyCode(quoteId);
235
- const symbol = base + '/' + quote;
236
- const ticker = this.extend({
237
- 'symbol': symbol,
238
- 'baseId': baseId,
239
- 'quoteId': quoteId,
240
- 'id': baseId + '/' + quoteId,
241
- }, coinData);
242
- result[symbol] = this.parseTicker(ticker);
243
- }
244
- return this.filterByArrayTickers(result, 'symbol', symbols);
245
- }
246
- async fetchTicker(symbol, params = {}) {
247
- /**
248
- * @method
249
- * @name bitbarg#fetchTicker
250
- * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
251
- * @see https://api.bitbarg.com/api/v1/currencies?pageSize=-1
252
- * @param {string} symbol unified symbol of the market to fetch the ticker for
253
- * @param {object} [params] extra parameters specific to the exchange API endpoint
254
- * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
255
- */
256
- const ticker = await this.fetchTickers([symbol]);
257
- return ticker[symbol];
258
- }
259
- parseTicker(ticker, market = undefined) {
260
- // {
261
- // "id": 1,
262
- // "icon": "https://...",
263
- // "tradeActive": true,
264
- // "faName": "بیت کوین",
265
- // "enName": "Bitcoin",
266
- // "coin": "BTC",
267
- // "path": "bitcoin",
268
- // "price": 110387.56,
269
- // "quote": "57479298399.76",
270
- // "percent": -3.01,
271
- // "decimal": 5,
272
- // "isFavorite": false,
273
- // "chart": [...]
274
- // }
275
- const marketType = 'spot';
276
- const marketId = this.safeString(ticker, 'coin') + '/' + 'USDT';
277
- const symbol = this.safeSymbol(marketId, market, undefined, marketType);
278
- const last = this.safeFloat(ticker, 'price', 0);
279
- const percentage = this.safeFloat(ticker, 'percent', 0);
280
- const baseVolume = this.safeFloat(ticker, 'quote');
281
- return this.safeTicker({
282
- 'symbol': symbol,
283
- 'timestamp': undefined,
284
- 'datetime': undefined,
285
- 'high': undefined,
286
- 'low': undefined,
287
- 'bid': last,
288
- 'bidVolume': undefined,
289
- 'ask': last,
290
- 'askVolume': undefined,
291
- 'vwap': undefined,
292
- 'open': undefined,
293
- 'close': last,
294
- 'last': last,
295
- 'previousClose': undefined,
296
- 'change': undefined,
297
- 'percentage': percentage,
298
- 'average': undefined,
299
- 'baseVolume': baseVolume,
300
- 'quoteVolume': undefined,
301
- 'info': ticker,
302
- }, market);
303
- }
304
- sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
305
- let url = this.urls['api']['public'] + path;
306
- if (Object.keys(params).length) {
307
- url += '?' + this.urlencode(params);
308
- }
309
- headers = { 'Content-Type': 'application/json' };
310
- return { 'url': url, 'method': method, 'body': body, 'headers': headers };
311
- }
312
- }
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
+ }