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