ccxt 4.2.85__py2.py3-none-any.whl → 4.2.87__py2.py3-none-any.whl
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.
- ccxt/__init__.py +1 -1
- ccxt/abstract/coinex.py +232 -123
- ccxt/ascendex.py +16 -6
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/ascendex.py +16 -6
- ccxt/async_support/base/exchange.py +1 -1
- ccxt/async_support/binance.py +18 -5
- ccxt/async_support/bingx.py +72 -22
- ccxt/async_support/bitbank.py +19 -21
- ccxt/async_support/bitfinex.py +2 -0
- ccxt/async_support/bitfinex2.py +18 -4
- ccxt/async_support/bitflyer.py +18 -0
- ccxt/async_support/bitget.py +20 -6
- ccxt/async_support/bitopro.py +2 -0
- ccxt/async_support/bitrue.py +16 -8
- ccxt/async_support/bitvavo.py +2 -0
- ccxt/async_support/btcmarkets.py +1 -1
- ccxt/async_support/btcturk.py +2 -1
- ccxt/async_support/coinex.py +572 -306
- ccxt/async_support/currencycom.py +1 -1
- ccxt/async_support/delta.py +8 -6
- ccxt/async_support/digifinex.py +9 -7
- ccxt/async_support/exmo.py +15 -15
- ccxt/async_support/gate.py +9 -6
- ccxt/async_support/hitbtc.py +31 -7
- ccxt/async_support/htx.py +2 -2
- ccxt/async_support/huobijp.py +1 -1
- ccxt/async_support/hyperliquid.py +242 -16
- ccxt/async_support/idex.py +11 -11
- ccxt/async_support/krakenfutures.py +2 -4
- ccxt/async_support/kucoinfutures.py +2 -2
- ccxt/async_support/lbank.py +2 -0
- ccxt/async_support/mexc.py +3 -3
- ccxt/async_support/oceanex.py +1 -1
- ccxt/async_support/okcoin.py +2 -1
- ccxt/async_support/okx.py +29 -15
- ccxt/async_support/phemex.py +6 -4
- ccxt/async_support/wazirx.py +1 -1
- ccxt/async_support/zonda.py +2 -0
- ccxt/base/exchange.py +1 -1
- ccxt/base/types.py +12 -0
- ccxt/binance.py +18 -5
- ccxt/bingx.py +72 -22
- ccxt/bitbank.py +19 -21
- ccxt/bitfinex.py +2 -0
- ccxt/bitfinex2.py +18 -4
- ccxt/bitflyer.py +18 -0
- ccxt/bitget.py +20 -6
- ccxt/bitopro.py +2 -0
- ccxt/bitrue.py +16 -8
- ccxt/bitvavo.py +2 -0
- ccxt/btcmarkets.py +1 -1
- ccxt/btcturk.py +2 -1
- ccxt/coinex.py +572 -306
- ccxt/currencycom.py +1 -1
- ccxt/delta.py +8 -6
- ccxt/digifinex.py +9 -7
- ccxt/exmo.py +15 -15
- ccxt/gate.py +9 -6
- ccxt/hitbtc.py +31 -7
- ccxt/htx.py +2 -2
- ccxt/huobijp.py +1 -1
- ccxt/hyperliquid.py +241 -16
- ccxt/idex.py +11 -11
- ccxt/krakenfutures.py +2 -4
- ccxt/kucoinfutures.py +2 -2
- ccxt/lbank.py +2 -0
- ccxt/mexc.py +3 -3
- ccxt/oceanex.py +1 -1
- ccxt/okcoin.py +2 -1
- ccxt/okx.py +29 -15
- ccxt/phemex.py +6 -4
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/bitget.py +1 -0
- ccxt/pro/kucoin.py +10 -6
- ccxt/test/base/test_last_price.py +0 -1
- ccxt/test/base/test_shared_methods.py +1 -2
- ccxt/test/base/test_status.py +1 -1
- ccxt/wazirx.py +1 -1
- ccxt/zonda.py +2 -0
- {ccxt-4.2.85.dist-info → ccxt-4.2.87.dist-info}/METADATA +6 -6
- {ccxt-4.2.85.dist-info → ccxt-4.2.87.dist-info}/RECORD +84 -84
- {ccxt-4.2.85.dist-info → ccxt-4.2.87.dist-info}/WHEEL +0 -0
- {ccxt-4.2.85.dist-info → ccxt-4.2.87.dist-info}/top_level.txt +0 -0
ccxt/coinex.py
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
from ccxt.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.coinex import ImplicitAPI
|
8
|
-
from ccxt.base.types import Balances, Currency, Int, Leverage, Leverages, Market, Num, Order, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntry
|
8
|
+
from ccxt.base.types import Balances, Currency, Int, Leverage, Leverages, MarginModification, Market, Num, Order, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntry
|
9
9
|
from typing import List
|
10
10
|
from ccxt.base.errors import ExchangeError
|
11
11
|
from ccxt.base.errors import PermissionDenied
|
@@ -40,6 +40,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
40
40
|
# 60 per 2 seconds => 30 per second => weight = 13.334
|
41
41
|
# 40 per 2 seconds => 20 per second => weight = 20
|
42
42
|
# 20 per 2 seconds => 10 per second => weight = 40
|
43
|
+
# v1 is per 2 seconds and v2 is per 1 second
|
43
44
|
'rateLimit': 2.5,
|
44
45
|
'pro': True,
|
45
46
|
'certified': True,
|
@@ -146,156 +147,279 @@ class coinex(Exchange, ImplicitAPI):
|
|
146
147
|
'perpetualPrivate': 'https://api.coinex.com/perpetual',
|
147
148
|
},
|
148
149
|
'www': 'https://www.coinex.com',
|
149
|
-
'doc': 'https://
|
150
|
+
'doc': 'https://docs.coinex.com/api/v2',
|
150
151
|
'fees': 'https://www.coinex.com/fees',
|
151
152
|
'referral': 'https://www.coinex.com/register?refer_code=yw5fz',
|
152
153
|
},
|
153
154
|
'api': {
|
154
|
-
'
|
155
|
-
'
|
156
|
-
'
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
'private': {
|
173
|
-
'get': {
|
174
|
-
'account/amm/balance': 40,
|
175
|
-
'account/investment/balance': 40,
|
176
|
-
'account/balance/history': 40,
|
177
|
-
'account/market/fee': 40,
|
178
|
-
'balance/coin/deposit': 40,
|
179
|
-
'balance/coin/withdraw': 40,
|
180
|
-
'balance/info': 40,
|
181
|
-
'balance/deposit/address/{coin_type}': 40,
|
182
|
-
'contract/transfer/history': 40,
|
183
|
-
'credit/info': 40,
|
184
|
-
'credit/balance': 40,
|
185
|
-
'investment/transfer/history': 40,
|
186
|
-
'margin/account': 1,
|
187
|
-
'margin/config': 1,
|
188
|
-
'margin/loan/history': 40,
|
189
|
-
'margin/transfer/history': 40,
|
190
|
-
'order/deals': 40,
|
191
|
-
'order/finished': 40,
|
192
|
-
'order/pending': 8,
|
193
|
-
'order/status': 8,
|
194
|
-
'order/status/batch': 8,
|
195
|
-
'order/user/deals': 40,
|
196
|
-
'order/stop/finished': 40,
|
197
|
-
'order/stop/pending': 8,
|
198
|
-
'order/user/trade/fee': 1,
|
199
|
-
'order/market/trade/info': 1,
|
200
|
-
'sub_account/balance': 1,
|
201
|
-
'sub_account/transfer/history': 40,
|
202
|
-
'sub_account/auth/api': 40,
|
203
|
-
'sub_account/auth/api/{user_auth_id}': 40,
|
204
|
-
},
|
205
|
-
'post': {
|
206
|
-
'balance/coin/withdraw': 40,
|
207
|
-
'contract/balance/transfer': 40,
|
208
|
-
'margin/flat': 40,
|
209
|
-
'margin/loan': 40,
|
210
|
-
'margin/transfer': 40,
|
211
|
-
'order/limit/batch': 40,
|
212
|
-
'order/ioc': 13.334,
|
213
|
-
'order/limit': 13.334,
|
214
|
-
'order/market': 13.334,
|
215
|
-
'order/modify': 13.334,
|
216
|
-
'order/stop/limit': 13.334,
|
217
|
-
'order/stop/market': 13.334,
|
218
|
-
'order/stop/modify': 13.334,
|
219
|
-
'sub_account/transfer': 40,
|
220
|
-
'sub_account/register': 1,
|
221
|
-
'sub_account/unfrozen': 40,
|
222
|
-
'sub_account/frozen': 40,
|
223
|
-
'sub_account/auth/api': 40,
|
155
|
+
'v1': {
|
156
|
+
'public': {
|
157
|
+
'get': {
|
158
|
+
'amm/market': 1,
|
159
|
+
'common/currency/rate': 1,
|
160
|
+
'common/asset/config': 1,
|
161
|
+
'common/maintain/info': 1,
|
162
|
+
'common/temp-maintain/info': 1,
|
163
|
+
'margin/market': 1,
|
164
|
+
'market/info': 1,
|
165
|
+
'market/list': 1,
|
166
|
+
'market/ticker': 1,
|
167
|
+
'market/ticker/all': 1,
|
168
|
+
'market/depth': 1,
|
169
|
+
'market/deals': 1,
|
170
|
+
'market/kline': 1,
|
171
|
+
'market/detail': 1,
|
172
|
+
},
|
224
173
|
},
|
225
|
-
'
|
226
|
-
'
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
174
|
+
'private': {
|
175
|
+
'get': {
|
176
|
+
'account/amm/balance': 40,
|
177
|
+
'account/investment/balance': 40,
|
178
|
+
'account/balance/history': 40,
|
179
|
+
'account/market/fee': 40,
|
180
|
+
'balance/coin/deposit': 40,
|
181
|
+
'balance/coin/withdraw': 40,
|
182
|
+
'balance/info': 40,
|
183
|
+
'balance/deposit/address/{coin_type}': 40,
|
184
|
+
'contract/transfer/history': 40,
|
185
|
+
'credit/info': 40,
|
186
|
+
'credit/balance': 40,
|
187
|
+
'investment/transfer/history': 40,
|
188
|
+
'margin/account': 1,
|
189
|
+
'margin/config': 1,
|
190
|
+
'margin/loan/history': 40,
|
191
|
+
'margin/transfer/history': 40,
|
192
|
+
'order/deals': 40,
|
193
|
+
'order/finished': 40,
|
194
|
+
'order/pending': 8,
|
195
|
+
'order/status': 8,
|
196
|
+
'order/status/batch': 8,
|
197
|
+
'order/user/deals': 40,
|
198
|
+
'order/stop/finished': 40,
|
199
|
+
'order/stop/pending': 8,
|
200
|
+
'order/user/trade/fee': 1,
|
201
|
+
'order/market/trade/info': 1,
|
202
|
+
'sub_account/balance': 1,
|
203
|
+
'sub_account/transfer/history': 40,
|
204
|
+
'sub_account/auth/api': 40,
|
205
|
+
'sub_account/auth/api/{user_auth_id}': 40,
|
206
|
+
},
|
207
|
+
'post': {
|
208
|
+
'balance/coin/withdraw': 40,
|
209
|
+
'contract/balance/transfer': 40,
|
210
|
+
'margin/flat': 40,
|
211
|
+
'margin/loan': 40,
|
212
|
+
'margin/transfer': 40,
|
213
|
+
'order/limit/batch': 40,
|
214
|
+
'order/ioc': 13.334,
|
215
|
+
'order/limit': 13.334,
|
216
|
+
'order/market': 13.334,
|
217
|
+
'order/modify': 13.334,
|
218
|
+
'order/stop/limit': 13.334,
|
219
|
+
'order/stop/market': 13.334,
|
220
|
+
'order/stop/modify': 13.334,
|
221
|
+
'sub_account/transfer': 40,
|
222
|
+
'sub_account/register': 1,
|
223
|
+
'sub_account/unfrozen': 40,
|
224
|
+
'sub_account/frozen': 40,
|
225
|
+
'sub_account/auth/api': 40,
|
226
|
+
},
|
227
|
+
'put': {
|
228
|
+
'balance/deposit/address/{coin_type}': 40,
|
229
|
+
'sub_account/unfrozen': 40,
|
230
|
+
'sub_account/frozen': 40,
|
231
|
+
'sub_account/auth/api/{user_auth_id}': 40,
|
232
|
+
'v1/account/settings': 40,
|
233
|
+
},
|
234
|
+
'delete': {
|
235
|
+
'balance/coin/withdraw': 40,
|
236
|
+
'order/pending/batch': 40,
|
237
|
+
'order/pending': 13.334,
|
238
|
+
'order/stop/pending': 40,
|
239
|
+
'order/stop/pending/{id}': 13.334,
|
240
|
+
'order/pending/by_client_id': 40,
|
241
|
+
'order/stop/pending/by_client_id': 40,
|
242
|
+
'sub_account/auth/api/{user_auth_id}': 40,
|
243
|
+
'sub_account/authorize/{id}': 40,
|
244
|
+
},
|
231
245
|
},
|
232
|
-
'
|
233
|
-
'
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
246
|
+
'perpetualPublic': {
|
247
|
+
'get': {
|
248
|
+
'ping': 1,
|
249
|
+
'time': 1,
|
250
|
+
'market/list': 1,
|
251
|
+
'market/limit_config': 1,
|
252
|
+
'market/ticker': 1,
|
253
|
+
'market/ticker/all': 1,
|
254
|
+
'market/depth': 1,
|
255
|
+
'market/deals': 1,
|
256
|
+
'market/funding_history': 1,
|
257
|
+
'market/kline': 1,
|
258
|
+
},
|
242
259
|
},
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
260
|
+
'perpetualPrivate': {
|
261
|
+
'get': {
|
262
|
+
'market/user_deals': 1,
|
263
|
+
'asset/query': 40,
|
264
|
+
'order/pending': 8,
|
265
|
+
'order/finished': 40,
|
266
|
+
'order/stop_finished': 40,
|
267
|
+
'order/stop_pending': 8,
|
268
|
+
'order/status': 8,
|
269
|
+
'order/stop_status': 8,
|
270
|
+
'position/finished': 40,
|
271
|
+
'position/pending': 40,
|
272
|
+
'position/funding': 40,
|
273
|
+
'position/adl_history': 40,
|
274
|
+
'market/preference': 40,
|
275
|
+
'position/margin_history': 40,
|
276
|
+
'position/settle_history': 40,
|
277
|
+
},
|
278
|
+
'post': {
|
279
|
+
'market/adjust_leverage': 1,
|
280
|
+
'market/position_expect': 1,
|
281
|
+
'order/put_limit': 20,
|
282
|
+
'order/put_market': 20,
|
283
|
+
'order/put_stop_limit': 20,
|
284
|
+
'order/put_stop_market': 20,
|
285
|
+
'order/modify': 20,
|
286
|
+
'order/modify_stop': 20,
|
287
|
+
'order/cancel': 20,
|
288
|
+
'order/cancel_all': 40,
|
289
|
+
'order/cancel_batch': 40,
|
290
|
+
'order/cancel_stop': 20,
|
291
|
+
'order/cancel_stop_all': 40,
|
292
|
+
'order/close_limit': 20,
|
293
|
+
'order/close_market': 20,
|
294
|
+
'position/adjust_margin': 20,
|
295
|
+
'position/stop_loss': 20,
|
296
|
+
'position/take_profit': 20,
|
297
|
+
'position/market_close': 20,
|
298
|
+
'order/cancel/by_client_id': 20,
|
299
|
+
'order/cancel_stop/by_client_id': 20,
|
300
|
+
'market/preference': 20,
|
301
|
+
},
|
256
302
|
},
|
257
303
|
},
|
258
|
-
'
|
259
|
-
'
|
260
|
-
'
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
304
|
+
'v2': {
|
305
|
+
'public': {
|
306
|
+
'get': {
|
307
|
+
'maintain-info': 1,
|
308
|
+
'ping': 1,
|
309
|
+
'time': 1,
|
310
|
+
'spot/market': 1,
|
311
|
+
'spot/ticker': 1,
|
312
|
+
'spot/depth': 1,
|
313
|
+
'spot/deals': 1,
|
314
|
+
'spot/kline': 1,
|
315
|
+
'spot/index': 1,
|
316
|
+
'futures/market': 1,
|
317
|
+
'futures/ticker': 1,
|
318
|
+
'futures/depth': 1,
|
319
|
+
'futures/deals': 1,
|
320
|
+
'futures/kline': 1,
|
321
|
+
'futures/index': 1,
|
322
|
+
'futures/funding-rate': 1,
|
323
|
+
'futures/funding-rate-history': 1,
|
324
|
+
'futures/position-level': 1,
|
325
|
+
'futures/liquidation-history': 1,
|
326
|
+
'futures/basis-history': 1,
|
327
|
+
},
|
275
328
|
},
|
276
|
-
'
|
277
|
-
'
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
329
|
+
'private': {
|
330
|
+
'get': {
|
331
|
+
'account/subs': 1,
|
332
|
+
'account/subs/api-detail': 40,
|
333
|
+
'account/subs/info': 1,
|
334
|
+
'account/subs/api': 40,
|
335
|
+
'account/subs/transfer-history': 40,
|
336
|
+
'account/subs/spot-balance': 1,
|
337
|
+
'account/trade-fee-rate': 40,
|
338
|
+
'assets/spot/balance': 40,
|
339
|
+
'assets/futures/balance': 40,
|
340
|
+
'assets/margin/balance': 1,
|
341
|
+
'assets/financial/balance': 40,
|
342
|
+
'assets/amm/liquidity': 40,
|
343
|
+
'assets/credit/info': 40,
|
344
|
+
'assets/margin/borrow-history': 40,
|
345
|
+
'assets/margin/interest-limit': 1,
|
346
|
+
'assets/deposit-address': 40,
|
347
|
+
'assets/deposit-history': 40,
|
348
|
+
'assets/withdraw': 40,
|
349
|
+
'assets/deposit-withdraw-config': 1,
|
350
|
+
'assets/transfer-history': 40,
|
351
|
+
'spot/order-status': 8,
|
352
|
+
'spot/batch-order-status': 8,
|
353
|
+
'spot/pending-order': 8,
|
354
|
+
'spot/finished-order': 40,
|
355
|
+
'spot/pending-stop-order': 8,
|
356
|
+
'spot/finished-stop-order': 40,
|
357
|
+
'spot/user-deals': 40,
|
358
|
+
'spot/order-deals': 40,
|
359
|
+
'futures/order-status': 8,
|
360
|
+
'futures/batch-order-status': 1,
|
361
|
+
'futures/pending-order': 8,
|
362
|
+
'futures/finished-order': 40,
|
363
|
+
'futures/pending-stop-order': 8,
|
364
|
+
'futures/finished-stop-order': 40,
|
365
|
+
'futures/user-deals': 1,
|
366
|
+
'futures/order-deals': 1,
|
367
|
+
'futures/pending-position': 40,
|
368
|
+
'futures/finished-position': 1,
|
369
|
+
'futures/position-margin-history': 1,
|
370
|
+
'futures/position-funding-history': 40,
|
371
|
+
'futures/position-adl-history': 1,
|
372
|
+
'futures/position-settle-history': 1,
|
373
|
+
},
|
374
|
+
'post': {
|
375
|
+
'account/subs': 40,
|
376
|
+
'account/subs/frozen': 40,
|
377
|
+
'account/subs/unfrozen': 40,
|
378
|
+
'account/subs/api': 40,
|
379
|
+
'account/subs/edit-api': 40,
|
380
|
+
'account/subs/delete-api': 40,
|
381
|
+
'account/subs/transfer': 40,
|
382
|
+
'account/settings': 40,
|
383
|
+
'assets/margin/borrow': 40,
|
384
|
+
'assets/margin/repay': 40,
|
385
|
+
'assets/renewal-deposit-address': 40,
|
386
|
+
'assets/withdraw': 40,
|
387
|
+
'assets/cancel-withdraw': 40,
|
388
|
+
'assets/transfer': 40,
|
389
|
+
'assets/amm/add-liquidity': 1,
|
390
|
+
'assets/amm/remove-liquidity': 1,
|
391
|
+
'spot/order': 13.334,
|
392
|
+
'spot/stop-order': 13.334,
|
393
|
+
'spot/batch-order': 40,
|
394
|
+
'spot/batch-stop-order': 1,
|
395
|
+
'spot/modify-order': 13.334,
|
396
|
+
'spot/modify-stop-order': 13.334,
|
397
|
+
'spot/cancel-all-order': 1,
|
398
|
+
'spot/cancel-order': 6.667,
|
399
|
+
'spot/cancel-stop-order': 6.667,
|
400
|
+
'spot/cancel-batch-order': 10,
|
401
|
+
'spot/cancel-batch-stop-order': 10,
|
402
|
+
'spot/cancel-order-by-client-id': 1,
|
403
|
+
'spot/cancel-stop-order-by-client-id': 1,
|
404
|
+
'futures/order': 20,
|
405
|
+
'futures/stop-order': 20,
|
406
|
+
'futures/batch-order': 1,
|
407
|
+
'futures/batch-stop-order': 1,
|
408
|
+
'futures/modify-order': 20,
|
409
|
+
'futures/modify-stop-order': 20,
|
410
|
+
'futures/cancel-all-order': 1,
|
411
|
+
'futures/cancel-order': 10,
|
412
|
+
'futures/cancel-stop-order': 10,
|
413
|
+
'futures/cancel-batch-order': 20,
|
414
|
+
'futures/cancel-batch-stop-order': 20,
|
415
|
+
'futures/cancel-order-by-client-id': 1,
|
416
|
+
'futures/cancel-stop-order-by-client-id': 1,
|
417
|
+
'futures/close-position': 20,
|
418
|
+
'futures/adjust-position-margin': 20,
|
419
|
+
'futures/adjust-position-leverage': 20,
|
420
|
+
'futures/set-position-stop-loss': 20,
|
421
|
+
'futures/set-position-take-profit': 20,
|
422
|
+
},
|
299
423
|
},
|
300
424
|
},
|
301
425
|
},
|
@@ -366,7 +490,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
366
490
|
})
|
367
491
|
|
368
492
|
def fetch_currencies(self, params={}):
|
369
|
-
response = self.
|
493
|
+
response = self.v1PublicGetCommonAssetConfig(params)
|
370
494
|
# {
|
371
495
|
# "code": 0,
|
372
496
|
# "data": {
|
@@ -506,7 +630,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
506
630
|
return self.array_concat(spotMarkets, swapMarkets)
|
507
631
|
|
508
632
|
def fetch_spot_markets(self, params):
|
509
|
-
response = self.
|
633
|
+
response = self.v1PublicGetMarketInfo(params)
|
510
634
|
#
|
511
635
|
# {
|
512
636
|
# "code": 0,
|
@@ -593,7 +717,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
593
717
|
return result
|
594
718
|
|
595
719
|
def fetch_contract_markets(self, params):
|
596
|
-
response = self.
|
720
|
+
response = self.v1PerpetualPublicGetMarketList(params)
|
597
721
|
#
|
598
722
|
# {
|
599
723
|
# "code": 0,
|
@@ -772,9 +896,9 @@ class coinex(Exchange, ImplicitAPI):
|
|
772
896
|
}
|
773
897
|
response = None
|
774
898
|
if market['swap']:
|
775
|
-
response = self.
|
899
|
+
response = self.v1PerpetualPublicGetMarketTicker(self.extend(request, params))
|
776
900
|
else:
|
777
|
-
response = self.
|
901
|
+
response = self.v1PublicGetMarketTicker(self.extend(request, params))
|
778
902
|
#
|
779
903
|
# Spot
|
780
904
|
#
|
@@ -849,9 +973,9 @@ class coinex(Exchange, ImplicitAPI):
|
|
849
973
|
marketType, query = self.handle_market_type_and_params('fetchTickers', market, params)
|
850
974
|
response = None
|
851
975
|
if marketType == 'swap':
|
852
|
-
response = self.
|
976
|
+
response = self.v1PerpetualPublicGetMarketTickerAll(query)
|
853
977
|
else:
|
854
|
-
response = self.
|
978
|
+
response = self.v1PublicGetMarketTickerAll()
|
855
979
|
#
|
856
980
|
# Spot
|
857
981
|
#
|
@@ -930,19 +1054,22 @@ class coinex(Exchange, ImplicitAPI):
|
|
930
1054
|
def fetch_time(self, params={}):
|
931
1055
|
"""
|
932
1056
|
fetches the current integer timestamp in milliseconds from the exchange server
|
933
|
-
:see: https://
|
1057
|
+
:see: https://docs.coinex.com/api/v2/common/http/time
|
934
1058
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
935
1059
|
:returns int: the current integer timestamp in milliseconds from the exchange server
|
936
1060
|
"""
|
937
|
-
response = self.
|
1061
|
+
response = self.v2PublicGetTime(params)
|
938
1062
|
#
|
939
1063
|
# {
|
940
|
-
# "code":
|
941
|
-
# "data":
|
1064
|
+
# "code": 0,
|
1065
|
+
# "data": {
|
1066
|
+
# "timestamp": 1711699867777
|
1067
|
+
# },
|
942
1068
|
# "message": "OK"
|
943
1069
|
# }
|
944
1070
|
#
|
945
|
-
|
1071
|
+
data = self.safe_dict(response, 'data', {})
|
1072
|
+
return self.safe_integer(data, 'timestamp')
|
946
1073
|
|
947
1074
|
def fetch_order_book(self, symbol: str, limit: Int = 20, params={}):
|
948
1075
|
"""
|
@@ -965,9 +1092,9 @@ class coinex(Exchange, ImplicitAPI):
|
|
965
1092
|
}
|
966
1093
|
response = None
|
967
1094
|
if market['swap']:
|
968
|
-
response = self.
|
1095
|
+
response = self.v1PerpetualPublicGetMarketDepth(self.extend(request, params))
|
969
1096
|
else:
|
970
|
-
response = self.
|
1097
|
+
response = self.v1PublicGetMarketDepth(self.extend(request, params))
|
971
1098
|
#
|
972
1099
|
# Spot
|
973
1100
|
#
|
@@ -1155,9 +1282,9 @@ class coinex(Exchange, ImplicitAPI):
|
|
1155
1282
|
request['limit'] = limit
|
1156
1283
|
response = None
|
1157
1284
|
if market['swap']:
|
1158
|
-
response = self.
|
1285
|
+
response = self.v1PerpetualPublicGetMarketDeals(self.extend(request, params))
|
1159
1286
|
else:
|
1160
|
-
response = self.
|
1287
|
+
response = self.v1PublicGetMarketDeals(self.extend(request, params))
|
1161
1288
|
#
|
1162
1289
|
# Spot and Swap
|
1163
1290
|
#
|
@@ -1181,7 +1308,8 @@ class coinex(Exchange, ImplicitAPI):
|
|
1181
1308
|
def fetch_trading_fee(self, symbol: str, params={}):
|
1182
1309
|
"""
|
1183
1310
|
fetch the trading fees for a market
|
1184
|
-
:see: https://
|
1311
|
+
:see: https://docs.coinex.com/api/v2/spot/market/http/list-market
|
1312
|
+
:see: https://docs.coinex.com/api/v2/futures/market/http/list-market
|
1185
1313
|
:param str symbol: unified market symbol
|
1186
1314
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1187
1315
|
:returns dict: a `fee structure <https://docs.ccxt.com/#/?id=fee-structure>`
|
@@ -1191,64 +1319,125 @@ class coinex(Exchange, ImplicitAPI):
|
|
1191
1319
|
request = {
|
1192
1320
|
'market': market['id'],
|
1193
1321
|
}
|
1194
|
-
response =
|
1195
|
-
|
1196
|
-
|
1197
|
-
|
1198
|
-
|
1199
|
-
|
1200
|
-
|
1201
|
-
|
1202
|
-
|
1203
|
-
|
1204
|
-
|
1205
|
-
|
1206
|
-
|
1207
|
-
|
1208
|
-
|
1209
|
-
|
1210
|
-
|
1211
|
-
|
1212
|
-
|
1322
|
+
response = None
|
1323
|
+
if market['spot']:
|
1324
|
+
response = self.v2PublicGetSpotMarket(self.extend(request, params))
|
1325
|
+
#
|
1326
|
+
# {
|
1327
|
+
# "code": 0,
|
1328
|
+
# "data": [
|
1329
|
+
# {
|
1330
|
+
# "base_ccy": "BTC",
|
1331
|
+
# "base_ccy_precision": 8,
|
1332
|
+
# "is_amm_available": False,
|
1333
|
+
# "is_margin_available": True,
|
1334
|
+
# "maker_fee_rate": "0.002",
|
1335
|
+
# "market": "BTCUSDT",
|
1336
|
+
# "min_amount": "0.0001",
|
1337
|
+
# "quote_ccy": "USDT",
|
1338
|
+
# "quote_ccy_precision": 2,
|
1339
|
+
# "taker_fee_rate": "0.002"
|
1340
|
+
# }
|
1341
|
+
# ],
|
1342
|
+
# "message": "OK"
|
1343
|
+
# }
|
1344
|
+
#
|
1345
|
+
else:
|
1346
|
+
response = self.v2PublicGetFuturesMarket(self.extend(request, params))
|
1347
|
+
#
|
1348
|
+
# {
|
1349
|
+
# "code": 0,
|
1350
|
+
# "data": [
|
1351
|
+
# {
|
1352
|
+
# "base_ccy": "BTC",
|
1353
|
+
# "base_ccy_precision": 8,
|
1354
|
+
# "contract_type": "linear",
|
1355
|
+
# "leverage": ["1","2","3","5","8","10","15","20","30","50","100"],
|
1356
|
+
# "maker_fee_rate": "0",
|
1357
|
+
# "market": "BTCUSDT",
|
1358
|
+
# "min_amount": "0.0001",
|
1359
|
+
# "open_interest_volume": "185.7498",
|
1360
|
+
# "quote_ccy": "USDT",
|
1361
|
+
# "quote_ccy_precision": 2,
|
1362
|
+
# "taker_fee_rate": "0"
|
1363
|
+
# }
|
1364
|
+
# ],
|
1365
|
+
# "message": "OK"
|
1366
|
+
# }
|
1367
|
+
#
|
1368
|
+
data = self.safe_list(response, 'data', [])
|
1369
|
+
result = self.safe_dict(data, 0, {})
|
1370
|
+
return self.parse_trading_fee(result, market)
|
1213
1371
|
|
1214
1372
|
def fetch_trading_fees(self, params={}):
|
1215
1373
|
"""
|
1216
1374
|
fetch the trading fees for multiple markets
|
1217
|
-
:see: https://
|
1375
|
+
:see: https://docs.coinex.com/api/v2/spot/market/http/list-market
|
1376
|
+
:see: https://docs.coinex.com/api/v2/futures/market/http/list-market
|
1218
1377
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1219
1378
|
:returns dict: a dictionary of `fee structures <https://docs.ccxt.com/#/?id=fee-structure>` indexed by market symbols
|
1220
1379
|
"""
|
1221
1380
|
self.load_markets()
|
1222
|
-
|
1223
|
-
|
1224
|
-
|
1225
|
-
|
1226
|
-
|
1227
|
-
|
1228
|
-
|
1229
|
-
|
1230
|
-
|
1231
|
-
|
1232
|
-
|
1233
|
-
|
1234
|
-
|
1235
|
-
|
1236
|
-
|
1237
|
-
|
1238
|
-
|
1239
|
-
|
1240
|
-
|
1241
|
-
|
1381
|
+
type = None
|
1382
|
+
type, params = self.handle_market_type_and_params('fetchTradingFees', None, params)
|
1383
|
+
response = None
|
1384
|
+
if type == 'swap':
|
1385
|
+
response = self.v2PublicGetFuturesMarket(params)
|
1386
|
+
#
|
1387
|
+
# {
|
1388
|
+
# "code": 0,
|
1389
|
+
# "data": [
|
1390
|
+
# {
|
1391
|
+
# "base_ccy": "BTC",
|
1392
|
+
# "base_ccy_precision": 8,
|
1393
|
+
# "contract_type": "linear",
|
1394
|
+
# "leverage": ["1","2","3","5","8","10","15","20","30","50","100"],
|
1395
|
+
# "maker_fee_rate": "0",
|
1396
|
+
# "market": "BTCUSDT",
|
1397
|
+
# "min_amount": "0.0001",
|
1398
|
+
# "open_interest_volume": "185.7498",
|
1399
|
+
# "quote_ccy": "USDT",
|
1400
|
+
# "quote_ccy_precision": 2,
|
1401
|
+
# "taker_fee_rate": "0"
|
1402
|
+
# }
|
1403
|
+
# ],
|
1404
|
+
# "message": "OK"
|
1405
|
+
# }
|
1406
|
+
#
|
1407
|
+
else:
|
1408
|
+
response = self.v2PublicGetSpotMarket(params)
|
1409
|
+
#
|
1410
|
+
# {
|
1411
|
+
# "code": 0,
|
1412
|
+
# "data": [
|
1413
|
+
# {
|
1414
|
+
# "base_ccy": "BTC",
|
1415
|
+
# "base_ccy_precision": 8,
|
1416
|
+
# "is_amm_available": False,
|
1417
|
+
# "is_margin_available": True,
|
1418
|
+
# "maker_fee_rate": "0.002",
|
1419
|
+
# "market": "BTCUSDT",
|
1420
|
+
# "min_amount": "0.0001",
|
1421
|
+
# "quote_ccy": "USDT",
|
1422
|
+
# "quote_ccy_precision": 2,
|
1423
|
+
# "taker_fee_rate": "0.002"
|
1424
|
+
# },
|
1425
|
+
# ],
|
1426
|
+
# "message": "OK"
|
1427
|
+
# }
|
1428
|
+
#
|
1429
|
+
data = self.safe_list(response, 'data', [])
|
1242
1430
|
result = {}
|
1243
|
-
for i in range(0, len(
|
1244
|
-
|
1245
|
-
|
1246
|
-
|
1247
|
-
|
1431
|
+
for i in range(0, len(data)):
|
1432
|
+
entry = data[i]
|
1433
|
+
marketId = self.safe_string(entry, 'market')
|
1434
|
+
market = self.safe_market(marketId, None, None, type)
|
1435
|
+
symbol = market['symbol']
|
1436
|
+
result[symbol] = self.parse_trading_fee(entry, market)
|
1248
1437
|
return result
|
1249
1438
|
|
1250
1439
|
def parse_trading_fee(self, fee, market: Market = None):
|
1251
|
-
marketId = self.safe_value(fee, '
|
1440
|
+
marketId = self.safe_value(fee, 'market')
|
1252
1441
|
symbol = self.safe_symbol(marketId, market)
|
1253
1442
|
return {
|
1254
1443
|
'info': fee,
|
@@ -1303,9 +1492,9 @@ class coinex(Exchange, ImplicitAPI):
|
|
1303
1492
|
request['limit'] = limit
|
1304
1493
|
response = None
|
1305
1494
|
if market['swap']:
|
1306
|
-
response = self.
|
1495
|
+
response = self.v1PerpetualPublicGetMarketKline(self.extend(request, params))
|
1307
1496
|
else:
|
1308
|
-
response = self.
|
1497
|
+
response = self.v1PublicGetMarketKline(self.extend(request, params))
|
1309
1498
|
#
|
1310
1499
|
# Spot
|
1311
1500
|
#
|
@@ -1348,7 +1537,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
1348
1537
|
request = {
|
1349
1538
|
'market': marketId,
|
1350
1539
|
}
|
1351
|
-
response = self.
|
1540
|
+
response = self.v1PrivateGetMarginAccount(self.extend(request, params))
|
1352
1541
|
#
|
1353
1542
|
# {
|
1354
1543
|
# "code": 0,
|
@@ -1415,7 +1604,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
1415
1604
|
|
1416
1605
|
def fetch_spot_balance(self, params={}):
|
1417
1606
|
self.load_markets()
|
1418
|
-
response = self.
|
1607
|
+
response = self.v1PrivateGetBalanceInfo(params)
|
1419
1608
|
#
|
1420
1609
|
# {
|
1421
1610
|
# "code": 0,
|
@@ -1451,7 +1640,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
1451
1640
|
|
1452
1641
|
def fetch_swap_balance(self, params={}):
|
1453
1642
|
self.load_markets()
|
1454
|
-
response = self.
|
1643
|
+
response = self.v1PerpetualPrivateGetAssetQuery(params)
|
1455
1644
|
#
|
1456
1645
|
# {
|
1457
1646
|
# "code": 0,
|
@@ -1484,7 +1673,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
1484
1673
|
|
1485
1674
|
def fetch_financial_balance(self, params={}):
|
1486
1675
|
self.load_markets()
|
1487
|
-
response = self.
|
1676
|
+
response = self.v1PrivateGetAccountInvestmentBalance(params)
|
1488
1677
|
#
|
1489
1678
|
# {
|
1490
1679
|
# "code": 0,
|
@@ -2061,36 +2250,36 @@ class coinex(Exchange, ImplicitAPI):
|
|
2061
2250
|
if market['spot']:
|
2062
2251
|
if isTriggerOrder:
|
2063
2252
|
if type == 'limit':
|
2064
|
-
response = self.
|
2253
|
+
response = self.v1PrivatePostOrderStopLimit(request)
|
2065
2254
|
else:
|
2066
|
-
response = self.
|
2255
|
+
response = self.v1PrivatePostOrderStopMarket(request)
|
2067
2256
|
else:
|
2068
2257
|
if type == 'limit':
|
2069
|
-
response = self.
|
2258
|
+
response = self.v1PrivatePostOrderLimit(request)
|
2070
2259
|
else:
|
2071
|
-
response = self.
|
2260
|
+
response = self.v1PrivatePostOrderMarket(request)
|
2072
2261
|
else:
|
2073
2262
|
if isTriggerOrder:
|
2074
2263
|
if type == 'limit':
|
2075
|
-
response = self.
|
2264
|
+
response = self.v1PerpetualPrivatePostOrderPutStopLimit(request)
|
2076
2265
|
else:
|
2077
|
-
response = self.
|
2266
|
+
response = self.v1PerpetualPrivatePostOrderPutStopMarket(request)
|
2078
2267
|
elif isStopLossOrTakeProfitTrigger:
|
2079
2268
|
if isStopLossTriggerOrder:
|
2080
|
-
response = self.
|
2269
|
+
response = self.v1PerpetualPrivatePostPositionStopLoss(request)
|
2081
2270
|
elif isTakeProfitTriggerOrder:
|
2082
|
-
response = self.
|
2271
|
+
response = self.v1PerpetualPrivatePostPositionTakeProfit(request)
|
2083
2272
|
else:
|
2084
2273
|
if reduceOnly:
|
2085
2274
|
if type == 'limit':
|
2086
|
-
response = self.
|
2275
|
+
response = self.v1PerpetualPrivatePostOrderCloseLimit(request)
|
2087
2276
|
else:
|
2088
|
-
response = self.
|
2277
|
+
response = self.v1PerpetualPrivatePostOrderCloseMarket(request)
|
2089
2278
|
else:
|
2090
2279
|
if type == 'limit':
|
2091
|
-
response = self.
|
2280
|
+
response = self.v1PerpetualPrivatePostOrderPutLimit(request)
|
2092
2281
|
else:
|
2093
|
-
response = self.
|
2282
|
+
response = self.v1PerpetualPrivatePostOrderPutMarket(request)
|
2094
2283
|
#
|
2095
2284
|
# Spot and Margin
|
2096
2285
|
#
|
@@ -2206,7 +2395,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
2206
2395
|
'market': market['id'],
|
2207
2396
|
'batch_orders': self.json(ordersRequests),
|
2208
2397
|
}
|
2209
|
-
response = self.
|
2398
|
+
response = self.v1PrivatePostOrderLimitBatch(request)
|
2210
2399
|
#
|
2211
2400
|
# {
|
2212
2401
|
# "code": 0,
|
@@ -2282,10 +2471,10 @@ class coinex(Exchange, ImplicitAPI):
|
|
2282
2471
|
response = None
|
2283
2472
|
if market['spot']:
|
2284
2473
|
request['batch_ids'] = idsString
|
2285
|
-
response = self.
|
2474
|
+
response = self.v1PrivateDeleteOrderPendingBatch(self.extend(request, params))
|
2286
2475
|
else:
|
2287
2476
|
request['order_ids'] = idsString
|
2288
|
-
response = self.
|
2477
|
+
response = self.v1PerpetualPrivatePostOrderCancelBatch(self.extend(request, params))
|
2289
2478
|
#
|
2290
2479
|
# spot
|
2291
2480
|
#
|
@@ -2414,7 +2603,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
2414
2603
|
request['amount'] = self.amount_to_precision(symbol, amount)
|
2415
2604
|
if price is not None:
|
2416
2605
|
request['price'] = self.price_to_precision(symbol, price)
|
2417
|
-
response = self.
|
2606
|
+
response = self.v1PrivatePostOrderModify(self.extend(request, params))
|
2418
2607
|
#
|
2419
2608
|
# {
|
2420
2609
|
# "code": 0,
|
@@ -2490,27 +2679,27 @@ class coinex(Exchange, ImplicitAPI):
|
|
2490
2679
|
request['client_id'] = clientOrderId
|
2491
2680
|
if stop:
|
2492
2681
|
if swap:
|
2493
|
-
response = self.
|
2682
|
+
response = self.v1PerpetualPrivatePostOrderCancelStopByClientId(self.extend(request, query))
|
2494
2683
|
else:
|
2495
|
-
response = self.
|
2684
|
+
response = self.v1PrivateDeleteOrderStopPendingByClientId(self.extend(request, query))
|
2496
2685
|
else:
|
2497
2686
|
if swap:
|
2498
|
-
response = self.
|
2687
|
+
response = self.v1PerpetualPrivatePostOrderCancelByClientId(self.extend(request, query))
|
2499
2688
|
else:
|
2500
|
-
response = self.
|
2689
|
+
response = self.v1PrivateDeleteOrderPendingByClientId(self.extend(request, query))
|
2501
2690
|
else:
|
2502
2691
|
idRequest = 'order_id' if swap else 'id'
|
2503
2692
|
request[idRequest] = id
|
2504
2693
|
if stop:
|
2505
2694
|
if swap:
|
2506
|
-
response = self.
|
2695
|
+
response = self.v1PerpetualPrivatePostOrderCancelStop(self.extend(request, query))
|
2507
2696
|
else:
|
2508
|
-
response = self.
|
2697
|
+
response = self.v1PrivateDeleteOrderStopPendingId(self.extend(request, query))
|
2509
2698
|
else:
|
2510
2699
|
if swap:
|
2511
|
-
response = self.
|
2700
|
+
response = self.v1PerpetualPrivatePostOrderCancel(self.extend(request, query))
|
2512
2701
|
else:
|
2513
|
-
response = self.
|
2702
|
+
response = self.v1PrivateDeleteOrderPending(self.extend(request, query))
|
2514
2703
|
#
|
2515
2704
|
# Spot and Margin
|
2516
2705
|
#
|
@@ -2648,15 +2837,15 @@ class coinex(Exchange, ImplicitAPI):
|
|
2648
2837
|
response = None
|
2649
2838
|
if swap:
|
2650
2839
|
if stop:
|
2651
|
-
response = self.
|
2840
|
+
response = self.v1PerpetualPrivatePostOrderCancelStopAll(self.extend(request, params))
|
2652
2841
|
else:
|
2653
|
-
response = self.
|
2842
|
+
response = self.v1PerpetualPrivatePostOrderCancelAll(self.extend(request, params))
|
2654
2843
|
else:
|
2655
2844
|
request['account_id'] = accountId
|
2656
2845
|
if stop:
|
2657
|
-
response = self.
|
2846
|
+
response = self.v1PrivateDeleteOrderStopPending(self.extend(request, params))
|
2658
2847
|
else:
|
2659
|
-
response = self.
|
2848
|
+
response = self.v1PrivateDeleteOrderPending(self.extend(request, params))
|
2660
2849
|
#
|
2661
2850
|
# Spot and Margin
|
2662
2851
|
#
|
@@ -2695,11 +2884,11 @@ class coinex(Exchange, ImplicitAPI):
|
|
2695
2884
|
response = None
|
2696
2885
|
if swap:
|
2697
2886
|
if stop:
|
2698
|
-
response = self.
|
2887
|
+
response = self.v1PerpetualPrivateGetOrderStopStatus(self.extend(request, params))
|
2699
2888
|
else:
|
2700
|
-
response = self.
|
2889
|
+
response = self.v1PerpetualPrivateGetOrderStatus(self.extend(request, params))
|
2701
2890
|
else:
|
2702
|
-
response = self.
|
2891
|
+
response = self.v1PrivateGetOrderStatus(self.extend(request, params))
|
2703
2892
|
#
|
2704
2893
|
# Spot
|
2705
2894
|
#
|
@@ -2836,24 +3025,24 @@ class coinex(Exchange, ImplicitAPI):
|
|
2836
3025
|
request['side'] = 0
|
2837
3026
|
request['offset'] = 0
|
2838
3027
|
if stop:
|
2839
|
-
response = self.
|
3028
|
+
response = self.v1PerpetualPrivateGetOrderStopPending(self.extend(request, params))
|
2840
3029
|
else:
|
2841
3030
|
if status == 'finished':
|
2842
|
-
response = self.
|
3031
|
+
response = self.v1PerpetualPrivateGetOrderFinished(self.extend(request, params))
|
2843
3032
|
elif status == 'pending':
|
2844
|
-
response = self.
|
3033
|
+
response = self.v1PerpetualPrivateGetOrderPending(self.extend(request, params))
|
2845
3034
|
else:
|
2846
3035
|
request['page'] = 1
|
2847
3036
|
if status == 'finished':
|
2848
3037
|
if stop:
|
2849
|
-
response = self.
|
3038
|
+
response = self.v1PrivateGetOrderStopFinished(self.extend(request, params))
|
2850
3039
|
else:
|
2851
|
-
response = self.
|
3040
|
+
response = self.v1PrivateGetOrderFinished(self.extend(request, params))
|
2852
3041
|
elif status == 'pending':
|
2853
3042
|
if stop:
|
2854
|
-
response = self.
|
3043
|
+
response = self.v1PrivateGetOrderStopPending(self.extend(request, params))
|
2855
3044
|
else:
|
2856
|
-
response = self.
|
3045
|
+
response = self.v1PrivateGetOrderPending(self.extend(request, params))
|
2857
3046
|
#
|
2858
3047
|
# Spot and Margin
|
2859
3048
|
#
|
@@ -3055,7 +3244,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
3055
3244
|
network = self.safe_string(params, 'network')
|
3056
3245
|
params = self.omit(params, 'network')
|
3057
3246
|
request['smart_contract_name'] = network
|
3058
|
-
response = self.
|
3247
|
+
response = self.v1PrivatePutBalanceDepositAddressCoinType(self.extend(request, params))
|
3059
3248
|
#
|
3060
3249
|
# {
|
3061
3250
|
# "code": 0,
|
@@ -3093,7 +3282,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
3093
3282
|
raise ExchangeError(self.id + ' fetchDepositAddress() ' + network + ' network not supported for ' + code)
|
3094
3283
|
if network is not None:
|
3095
3284
|
request['smart_contract_name'] = network
|
3096
|
-
response = self.
|
3285
|
+
response = self.v1PrivateGetBalanceDepositAddressCoinType(self.extend(request, params))
|
3097
3286
|
#
|
3098
3287
|
# {
|
3099
3288
|
# "code": 0,
|
@@ -3197,10 +3386,10 @@ class coinex(Exchange, ImplicitAPI):
|
|
3197
3386
|
if since is not None:
|
3198
3387
|
request['start_time'] = since
|
3199
3388
|
request['side'] = 0
|
3200
|
-
response = self.
|
3389
|
+
response = self.v1PerpetualPrivateGetMarketUserDeals(self.extend(request, params))
|
3201
3390
|
else:
|
3202
3391
|
request['page'] = 1
|
3203
|
-
response = self.
|
3392
|
+
response = self.v1PrivateGetOrderUserDeals(self.extend(request, params))
|
3204
3393
|
#
|
3205
3394
|
# Spot and Margin
|
3206
3395
|
#
|
@@ -3291,8 +3480,8 @@ class coinex(Exchange, ImplicitAPI):
|
|
3291
3480
|
"""
|
3292
3481
|
self.load_markets()
|
3293
3482
|
defaultMethod = None
|
3294
|
-
defaultMethod, params = self.handle_option_and_params(params, 'fetchPositions', 'method', '
|
3295
|
-
isHistory = (defaultMethod == '
|
3483
|
+
defaultMethod, params = self.handle_option_and_params(params, 'fetchPositions', 'method', 'v1PerpetualPrivateGetPositionPending')
|
3484
|
+
isHistory = (defaultMethod == 'v1PerpetualPrivateGetPositionFinished')
|
3296
3485
|
symbols = self.market_symbols(symbols)
|
3297
3486
|
request = {}
|
3298
3487
|
market = None
|
@@ -3314,10 +3503,10 @@ class coinex(Exchange, ImplicitAPI):
|
|
3314
3503
|
request['limit'] = 100
|
3315
3504
|
request['side'] = self.safe_integer(params, 'side', 0) # 0: All, 1: Sell, 2: Buy
|
3316
3505
|
response = None
|
3317
|
-
if defaultMethod == '
|
3318
|
-
response = self.
|
3506
|
+
if defaultMethod == 'v1PerpetualPrivateGetPositionPending':
|
3507
|
+
response = self.v1PerpetualPrivateGetPositionPending(self.extend(request, params))
|
3319
3508
|
else:
|
3320
|
-
response = self.
|
3509
|
+
response = self.v1PerpetualPrivateGetPositionFinished(self.extend(request, params))
|
3321
3510
|
#
|
3322
3511
|
# {
|
3323
3512
|
# "code": 0,
|
@@ -3396,7 +3585,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
3396
3585
|
request = {
|
3397
3586
|
'market': market['id'],
|
3398
3587
|
}
|
3399
|
-
response = self.
|
3588
|
+
response = self.v1PerpetualPrivateGetPositionPending(self.extend(request, params))
|
3400
3589
|
#
|
3401
3590
|
# {
|
3402
3591
|
# "code": 0,
|
@@ -3600,7 +3789,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
3600
3789
|
'leverage': str(leverage),
|
3601
3790
|
'position_type': positionType, # 1: isolated, 2: cross
|
3602
3791
|
}
|
3603
|
-
return self.
|
3792
|
+
return self.v1PerpetualPrivatePostMarketAdjustLeverage(self.extend(request, params))
|
3604
3793
|
|
3605
3794
|
def set_leverage(self, leverage: Int, symbol: Str = None, params={}):
|
3606
3795
|
"""
|
@@ -3634,7 +3823,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
3634
3823
|
'leverage': str(leverage),
|
3635
3824
|
'position_type': positionType, # 1: isolated, 2: cross
|
3636
3825
|
}
|
3637
|
-
return self.
|
3826
|
+
return self.v1PerpetualPrivatePostMarketAdjustLeverage(self.extend(request, params))
|
3638
3827
|
|
3639
3828
|
def fetch_leverage_tiers(self, symbols: Strings = None, params={}):
|
3640
3829
|
"""
|
@@ -3645,7 +3834,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
3645
3834
|
:returns dict: a dictionary of `leverage tiers structures <https://docs.ccxt.com/#/?id=leverage-tiers-structure>`, indexed by market symbols
|
3646
3835
|
"""
|
3647
3836
|
self.load_markets()
|
3648
|
-
response = self.
|
3837
|
+
response = self.v1PerpetualPublicGetMarketLimitConfig(params)
|
3649
3838
|
#
|
3650
3839
|
# {
|
3651
3840
|
# "code": 0,
|
@@ -3719,7 +3908,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
3719
3908
|
'amount': self.amount_to_precision(symbol, amount),
|
3720
3909
|
'type': addOrReduce,
|
3721
3910
|
}
|
3722
|
-
response = self.
|
3911
|
+
response = self.v1PerpetualPrivatePostPositionAdjustMargin(self.extend(request, params))
|
3723
3912
|
#
|
3724
3913
|
# {
|
3725
3914
|
# "code": 0,
|
@@ -3785,17 +3974,76 @@ class coinex(Exchange, ImplicitAPI):
|
|
3785
3974
|
'status': status,
|
3786
3975
|
})
|
3787
3976
|
|
3788
|
-
def parse_margin_modification(self, data, market: Market = None):
|
3977
|
+
def parse_margin_modification(self, data, market: Market = None) -> MarginModification:
|
3978
|
+
#
|
3979
|
+
# addMargin/reduceMargin
|
3980
|
+
#
|
3981
|
+
# {
|
3982
|
+
# "adl_sort": 1,
|
3983
|
+
# "adl_sort_val": "0.00004320",
|
3984
|
+
# "amount": "0.0005",
|
3985
|
+
# "amount_max": "0.0005",
|
3986
|
+
# "amount_max_margin": "6.57352000000000000000",
|
3987
|
+
# "bkr_price": "16294.08000000000000011090",
|
3988
|
+
# "bkr_price_imply": "0.00000000000000000000",
|
3989
|
+
# "close_left": "0.0005",
|
3990
|
+
# "create_time": 1651202571.320778,
|
3991
|
+
# "deal_all": "19.72000000000000000000",
|
3992
|
+
# "deal_asset_fee": "0.00000000000000000000",
|
3993
|
+
# "fee_asset": "",
|
3994
|
+
# "finish_type": 1,
|
3995
|
+
# "first_price": "39441.12",
|
3996
|
+
# "insurance": "0.00000000000000000000",
|
3997
|
+
# "latest_price": "39441.12",
|
3998
|
+
# "leverage": "3",
|
3999
|
+
# "liq_amount": "0.00000000000000000000",
|
4000
|
+
# "liq_order_price": "0",
|
4001
|
+
# "liq_order_time": 0,
|
4002
|
+
# "liq_price": "16491.28560000000000011090",
|
4003
|
+
# "liq_price_imply": "0.00000000000000000000",
|
4004
|
+
# "liq_profit": "0.00000000000000000000",
|
4005
|
+
# "liq_time": 0,
|
4006
|
+
# "mainten_margin": "0.005",
|
4007
|
+
# "mainten_margin_amount": "0.09860280000000000000",
|
4008
|
+
# "maker_fee": "0.00000000000000000000",
|
4009
|
+
# "margin_amount": "11.57352000000000000000",
|
4010
|
+
# "market": "BTCUSDT",
|
4011
|
+
# "open_margin": "0.58687582908396110455",
|
4012
|
+
# "open_margin_imply": "0.00000000000000000000",
|
4013
|
+
# "open_price": "39441.12000000000000000000",
|
4014
|
+
# "open_val": "19.72056000000000000000",
|
4015
|
+
# "open_val_max": "19.72056000000000000000",
|
4016
|
+
# "position_id": 65171206,
|
4017
|
+
# "profit_clearing": "-0.00986028000000000000",
|
4018
|
+
# "profit_real": "-0.00986028000000000000",
|
4019
|
+
# "profit_unreal": "0.00",
|
4020
|
+
# "side": 2,
|
4021
|
+
# "stop_loss_price": "0.00000000000000000000",
|
4022
|
+
# "stop_loss_type": 0,
|
4023
|
+
# "sys": 0,
|
4024
|
+
# "take_profit_price": "0.00000000000000000000",
|
4025
|
+
# "take_profit_type": 0,
|
4026
|
+
# "taker_fee": "0.00000000000000000000",
|
4027
|
+
# "total": 3464,
|
4028
|
+
# "type": 1,
|
4029
|
+
# "update_time": 1651202638.911212,
|
4030
|
+
# "user_id": 3620173
|
4031
|
+
# }
|
4032
|
+
#
|
4033
|
+
timestamp = self.safe_integer_product(data, 'update_time', 1000)
|
3789
4034
|
return {
|
3790
4035
|
'info': data,
|
4036
|
+
'symbol': self.safe_symbol(None, market),
|
3791
4037
|
'type': None,
|
3792
|
-
'amount':
|
4038
|
+
'amount': self.safe_number(data, 'margin_amount'),
|
4039
|
+
'total': None,
|
3793
4040
|
'code': market['quote'],
|
3794
|
-
'symbol': self.safe_symbol(None, market),
|
3795
4041
|
'status': None,
|
4042
|
+
'timestamp': timestamp,
|
4043
|
+
'datetime': self.iso8601(timestamp),
|
3796
4044
|
}
|
3797
4045
|
|
3798
|
-
def add_margin(self, symbol: str, amount, params={}):
|
4046
|
+
def add_margin(self, symbol: str, amount, params={}) -> MarginModification:
|
3799
4047
|
"""
|
3800
4048
|
add margin
|
3801
4049
|
:see: https://viabtc.github.io/coinex_api_en_doc/futures/#docsfutures001_http032_adjust_position_margin
|
@@ -3806,7 +4054,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
3806
4054
|
"""
|
3807
4055
|
return self.modify_margin_helper(symbol, amount, 1, params)
|
3808
4056
|
|
3809
|
-
def reduce_margin(self, symbol: str, amount, params={}):
|
4057
|
+
def reduce_margin(self, symbol: str, amount, params={}) -> MarginModification:
|
3810
4058
|
"""
|
3811
4059
|
remove margin from a position
|
3812
4060
|
:see: https://viabtc.github.io/coinex_api_en_doc/futures/#docsfutures001_http032_adjust_position_margin
|
@@ -3841,7 +4089,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
3841
4089
|
}
|
3842
4090
|
if since is not None:
|
3843
4091
|
request['start_time'] = since
|
3844
|
-
response = self.
|
4092
|
+
response = self.v1PerpetualPrivateGetPositionFunding(self.extend(request, params))
|
3845
4093
|
#
|
3846
4094
|
# {
|
3847
4095
|
# "code": 0,
|
@@ -3903,7 +4151,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
3903
4151
|
request = {
|
3904
4152
|
'market': market['id'],
|
3905
4153
|
}
|
3906
|
-
response = self.
|
4154
|
+
response = self.v1PerpetualPublicGetMarketTicker(self.extend(request, params))
|
3907
4155
|
#
|
3908
4156
|
# {
|
3909
4157
|
# "code": 0,
|
@@ -4011,7 +4259,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
4011
4259
|
market = self.market(symbol)
|
4012
4260
|
if not market['swap']:
|
4013
4261
|
raise BadSymbol(self.id + ' fetchFundingRates() supports swap contracts only')
|
4014
|
-
response = self.
|
4262
|
+
response = self.v1PerpetualPublicGetMarketTickerAll(params)
|
4015
4263
|
#
|
4016
4264
|
# {
|
4017
4265
|
# "code": 0,
|
@@ -4087,7 +4335,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
4087
4335
|
}
|
4088
4336
|
if networkCode is not None:
|
4089
4337
|
request['smart_contract_name'] = self.network_code_to_id(networkCode)
|
4090
|
-
response = self.
|
4338
|
+
response = self.v1PrivatePostBalanceCoinWithdraw(self.extend(request, params))
|
4091
4339
|
#
|
4092
4340
|
# {
|
4093
4341
|
# "code": 0,
|
@@ -4153,7 +4401,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
4153
4401
|
if since is not None:
|
4154
4402
|
request['start_time'] = since
|
4155
4403
|
request, params = self.handle_until_option('end_time', request, params)
|
4156
|
-
response = self.
|
4404
|
+
response = self.v1PerpetualPublicGetMarketFundingHistory(self.extend(request, params))
|
4157
4405
|
#
|
4158
4406
|
# {
|
4159
4407
|
# "code": 0,
|
@@ -4321,10 +4569,10 @@ class coinex(Exchange, ImplicitAPI):
|
|
4321
4569
|
response = None
|
4322
4570
|
if (fromAccount == 'spot') and (toAccount == 'swap'):
|
4323
4571
|
request['transfer_side'] = 'in' # 'in' spot to swap, 'out' swap to spot
|
4324
|
-
response = self.
|
4572
|
+
response = self.v1PrivatePostContractBalanceTransfer(self.extend(request, params))
|
4325
4573
|
elif (fromAccount == 'swap') and (toAccount == 'spot'):
|
4326
4574
|
request['transfer_side'] = 'out' # 'in' spot to swap, 'out' swap to spot
|
4327
|
-
response = self.
|
4575
|
+
response = self.v1PrivatePostContractBalanceTransfer(self.extend(request, params))
|
4328
4576
|
else:
|
4329
4577
|
accountsById = self.safe_value(self.options, 'accountsById', {})
|
4330
4578
|
fromId = self.safe_string(accountsById, fromAccount, fromAccount)
|
@@ -4333,7 +4581,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
4333
4581
|
# spot is 0, use fetchBalance() to find the margin account id
|
4334
4582
|
request['from_account'] = int(fromId)
|
4335
4583
|
request['to_account'] = int(toId)
|
4336
|
-
response = self.
|
4584
|
+
response = self.v1PrivatePostMarginTransfer(self.extend(request, params))
|
4337
4585
|
#
|
4338
4586
|
# {"code": 0, "data": null, "message": "Success"}
|
4339
4587
|
#
|
@@ -4444,9 +4692,9 @@ class coinex(Exchange, ImplicitAPI):
|
|
4444
4692
|
marginMode, params = self.handle_margin_mode_and_params('fetchTransfers', params)
|
4445
4693
|
response = None
|
4446
4694
|
if marginMode is not None:
|
4447
|
-
response = self.
|
4695
|
+
response = self.v1PrivateGetMarginTransferHistory(self.extend(request, params))
|
4448
4696
|
else:
|
4449
|
-
response = self.
|
4697
|
+
response = self.v1PrivateGetContractTransferHistory(self.extend(request, params))
|
4450
4698
|
#
|
4451
4699
|
# Swap
|
4452
4700
|
#
|
@@ -4513,7 +4761,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
4513
4761
|
request['coin_type'] = currency['id']
|
4514
4762
|
if limit is not None:
|
4515
4763
|
request['Limit'] = limit
|
4516
|
-
response = self.
|
4764
|
+
response = self.v1PrivateGetBalanceCoinWithdraw(self.extend(request, params))
|
4517
4765
|
#
|
4518
4766
|
# {
|
4519
4767
|
# "code": 0,
|
@@ -4575,7 +4823,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
4575
4823
|
request['coin_type'] = currency['id']
|
4576
4824
|
if limit is not None:
|
4577
4825
|
request['Limit'] = limit
|
4578
|
-
response = self.
|
4826
|
+
response = self.v1PrivateGetBalanceCoinDeposit(self.extend(request, params))
|
4579
4827
|
#
|
4580
4828
|
# {
|
4581
4829
|
# "code": 0,
|
@@ -4665,7 +4913,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
4665
4913
|
request = {
|
4666
4914
|
'market': market['id'],
|
4667
4915
|
}
|
4668
|
-
response = self.
|
4916
|
+
response = self.v1PrivateGetMarginConfig(self.extend(request, params))
|
4669
4917
|
#
|
4670
4918
|
# {
|
4671
4919
|
# "code": 0,
|
@@ -4697,7 +4945,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
4697
4945
|
:returns dict: a list of `isolated borrow rate structures <https://github.com/ccxt/ccxt/wiki/Manual#isolated-borrow-rate-structure>`
|
4698
4946
|
"""
|
4699
4947
|
self.load_markets()
|
4700
|
-
response = self.
|
4948
|
+
response = self.v1PrivateGetMarginConfig(params)
|
4701
4949
|
#
|
4702
4950
|
# {
|
4703
4951
|
# "code": 0,
|
@@ -4735,7 +4983,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
4735
4983
|
request['market'] = market['id']
|
4736
4984
|
if limit is not None:
|
4737
4985
|
request['limit'] = limit
|
4738
|
-
response = self.
|
4986
|
+
response = self.v1PrivateGetMarginLoanHistory(self.extend(request, params))
|
4739
4987
|
#
|
4740
4988
|
# {
|
4741
4989
|
# "code": 0,
|
@@ -4828,7 +5076,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
4828
5076
|
'coin_type': currency['id'],
|
4829
5077
|
'amount': self.currency_to_precision(code, amount),
|
4830
5078
|
}
|
4831
|
-
response = self.
|
5079
|
+
response = self.v1PrivatePostMarginLoan(self.extend(request, params))
|
4832
5080
|
#
|
4833
5081
|
# {
|
4834
5082
|
# "code": 0,
|
@@ -4864,7 +5112,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
4864
5112
|
'coin_type': currency['id'],
|
4865
5113
|
'amount': self.currency_to_precision(code, amount),
|
4866
5114
|
}
|
4867
|
-
response = self.
|
5115
|
+
response = self.v1PrivatePostMarginFlat(self.extend(request, params))
|
4868
5116
|
#
|
4869
5117
|
# {
|
4870
5118
|
# "code": 0,
|
@@ -4918,7 +5166,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
4918
5166
|
codesLength = len(codes)
|
4919
5167
|
if codesLength == 1:
|
4920
5168
|
request['coin_type'] = self.safe_value(codes, 0)
|
4921
|
-
response = self.
|
5169
|
+
response = self.v1PublicGetCommonAssetConfig(self.extend(request, params))
|
4922
5170
|
#
|
4923
5171
|
# {
|
4924
5172
|
# "code": 0,
|
@@ -5008,7 +5256,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
5008
5256
|
marketType, params = self.handle_market_type_and_params('fetchLeverages', market, params)
|
5009
5257
|
if marketType != 'spot':
|
5010
5258
|
raise NotSupported(self.id + ' fetchLeverages() supports spot margin markets only')
|
5011
|
-
response = self.
|
5259
|
+
response = self.v1PrivateGetMarginConfig(params)
|
5012
5260
|
#
|
5013
5261
|
# {
|
5014
5262
|
# "code": 0,
|
@@ -5064,9 +5312,11 @@ class coinex(Exchange, ImplicitAPI):
|
|
5064
5312
|
def nonce(self):
|
5065
5313
|
return self.milliseconds()
|
5066
5314
|
|
5067
|
-
def sign(self, path, api=
|
5315
|
+
def sign(self, path, api=[], method='GET', params={}, headers=None, body=None):
|
5068
5316
|
path = self.implode_params(path, params)
|
5069
|
-
|
5317
|
+
version = api[0]
|
5318
|
+
requestUrl = api[1]
|
5319
|
+
url = self.urls['api'][requestUrl] + '/' + version + '/' + path
|
5070
5320
|
query = self.omit(params, self.extract_params(path))
|
5071
5321
|
nonce = str(self.nonce())
|
5072
5322
|
if method == 'POST':
|
@@ -5092,7 +5342,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
5092
5342
|
defaultId = 'x-167673045'
|
5093
5343
|
brokerId = self.safe_value(self.options, 'brokerId', defaultId)
|
5094
5344
|
query['client_id'] = brokerId + '_' + self.uuid16()
|
5095
|
-
if
|
5345
|
+
if requestUrl == 'perpetualPrivate':
|
5096
5346
|
self.check_required_credentials()
|
5097
5347
|
query = self.extend({
|
5098
5348
|
'access_id': self.apiKey,
|
@@ -5110,26 +5360,42 @@ class coinex(Exchange, ImplicitAPI):
|
|
5110
5360
|
else:
|
5111
5361
|
headers['Content-Type'] = 'application/x-www-form-urlencoded'
|
5112
5362
|
body = urlencoded
|
5113
|
-
elif
|
5363
|
+
elif requestUrl == 'public' or requestUrl == 'perpetualPublic':
|
5114
5364
|
if query:
|
5115
5365
|
url += '?' + self.urlencode(query)
|
5116
5366
|
else:
|
5117
|
-
|
5118
|
-
|
5119
|
-
|
5120
|
-
|
5121
|
-
|
5122
|
-
|
5123
|
-
|
5124
|
-
|
5125
|
-
|
5126
|
-
|
5127
|
-
|
5128
|
-
|
5129
|
-
|
5130
|
-
|
5131
|
-
|
5132
|
-
|
5367
|
+
if version == 'v1':
|
5368
|
+
self.check_required_credentials()
|
5369
|
+
query = self.extend({
|
5370
|
+
'access_id': self.apiKey,
|
5371
|
+
'tonce': nonce,
|
5372
|
+
}, query)
|
5373
|
+
query = self.keysort(query)
|
5374
|
+
urlencoded = self.rawencode(query)
|
5375
|
+
signature = self.hash(self.encode(urlencoded + '&secret_key=' + self.secret), 'md5')
|
5376
|
+
headers = {
|
5377
|
+
'Authorization': signature.upper(),
|
5378
|
+
'Content-Type': 'application/json',
|
5379
|
+
}
|
5380
|
+
if (method == 'GET') or (method == 'DELETE') or (method == 'PUT'):
|
5381
|
+
url += '?' + urlencoded
|
5382
|
+
else:
|
5383
|
+
body = self.json(query)
|
5384
|
+
elif version == 'v2':
|
5385
|
+
self.check_required_credentials()
|
5386
|
+
query = self.keysort(query)
|
5387
|
+
urlencoded = self.rawencode(query)
|
5388
|
+
preparedString = method + '/' + version + '/' + path + '?' + urlencoded + nonce + self.secret
|
5389
|
+
signature = self.hash(self.encode(preparedString), 'sha256')
|
5390
|
+
headers = {
|
5391
|
+
'X-COINEX-KEY': self.apiKey,
|
5392
|
+
'X-COINEX-SIGN': signature,
|
5393
|
+
'X-COINEX-TIMESTAMP': nonce,
|
5394
|
+
}
|
5395
|
+
if (method == 'GET') or (method == 'DELETE') or (method == 'PUT'):
|
5396
|
+
url += '?' + urlencoded
|
5397
|
+
else:
|
5398
|
+
body = self.json(query)
|
5133
5399
|
return {'url': url, 'method': method, 'body': body, 'headers': headers}
|
5134
5400
|
|
5135
5401
|
def handle_errors(self, httpCode, reason, url, method, headers, body, response, requestHeaders, requestBody):
|