ccxt 4.4.39__py2.py3-none-any.whl → 4.4.41__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/bitmart.py +2 -0
- ccxt/abstract/okx.py +5 -0
- ccxt/ascendex.py +9 -9
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/ascendex.py +9 -9
- ccxt/async_support/base/exchange.py +10 -3
- ccxt/async_support/base/ws/aiohttp_client.py +2 -2
- ccxt/async_support/binance.py +37 -41
- ccxt/async_support/bingx.py +4 -3
- ccxt/async_support/bit2c.py +0 -1
- ccxt/async_support/bitbank.py +0 -1
- ccxt/async_support/bitbns.py +0 -1
- ccxt/async_support/bitfinex.py +16 -17
- ccxt/async_support/bitfinex1.py +0 -1
- ccxt/async_support/bitflyer.py +0 -1
- ccxt/async_support/bitget.py +2 -2
- ccxt/async_support/bithumb.py +0 -1
- ccxt/async_support/bitmart.py +246 -6
- ccxt/async_support/bitmex.py +5 -6
- ccxt/async_support/bitopro.py +4 -5
- ccxt/async_support/bitrue.py +5 -7
- ccxt/async_support/bitso.py +1 -2
- ccxt/async_support/bitstamp.py +1 -2
- ccxt/async_support/bitteam.py +1 -3
- ccxt/async_support/bitvavo.py +2 -4
- ccxt/async_support/blockchaincom.py +5 -5
- ccxt/async_support/blofin.py +10 -10
- ccxt/async_support/btcalpha.py +0 -1
- ccxt/async_support/btcbox.py +0 -1
- ccxt/async_support/btcmarkets.py +1 -3
- ccxt/async_support/bybit.py +10 -11
- ccxt/async_support/cex.py +1 -1
- ccxt/async_support/coinbase.py +77 -1
- ccxt/async_support/coinbaseexchange.py +1 -1
- ccxt/async_support/coinbaseinternational.py +62 -0
- ccxt/async_support/coincatch.py +1 -1
- ccxt/async_support/coinex.py +9 -9
- ccxt/async_support/coinlist.py +1 -1
- ccxt/async_support/coinmetro.py +1 -1
- ccxt/async_support/cryptocom.py +91 -2
- ccxt/async_support/currencycom.py +1 -1
- ccxt/async_support/defx.py +1 -2
- ccxt/async_support/delta.py +1 -1
- ccxt/async_support/digifinex.py +1 -1
- ccxt/async_support/exmo.py +62 -6
- ccxt/async_support/gate.py +2 -2
- ccxt/async_support/hashkey.py +3 -5
- ccxt/async_support/htx.py +2 -2
- ccxt/async_support/hyperliquid.py +61 -2
- ccxt/async_support/kraken.py +124 -26
- ccxt/async_support/kucoin.py +29 -25
- ccxt/async_support/luno.py +1 -1
- ccxt/async_support/mexc.py +137 -1
- ccxt/async_support/ndax.py +1 -1
- ccxt/async_support/okcoin.py +18 -18
- ccxt/async_support/okx.py +27 -22
- ccxt/async_support/phemex.py +12 -8
- ccxt/async_support/poloniex.py +1 -1
- ccxt/async_support/poloniexfutures.py +6 -6
- ccxt/async_support/vertex.py +11 -11
- ccxt/async_support/woo.py +33 -33
- ccxt/async_support/woofipro.py +24 -24
- ccxt/async_support/xt.py +29 -27
- ccxt/async_support/zonda.py +1 -1
- ccxt/base/exchange.py +31 -19
- ccxt/base/types.py +10 -0
- ccxt/binance.py +37 -41
- ccxt/bingx.py +4 -3
- ccxt/bit2c.py +0 -1
- ccxt/bitbank.py +0 -1
- ccxt/bitbns.py +0 -1
- ccxt/bitfinex.py +16 -17
- ccxt/bitfinex1.py +0 -1
- ccxt/bitflyer.py +0 -1
- ccxt/bitget.py +2 -2
- ccxt/bithumb.py +0 -1
- ccxt/bitmart.py +246 -6
- ccxt/bitmex.py +5 -6
- ccxt/bitopro.py +4 -5
- ccxt/bitrue.py +5 -7
- ccxt/bitso.py +1 -2
- ccxt/bitstamp.py +1 -2
- ccxt/bitteam.py +1 -3
- ccxt/bitvavo.py +2 -4
- ccxt/blockchaincom.py +5 -5
- ccxt/blofin.py +10 -10
- ccxt/btcalpha.py +0 -1
- ccxt/btcbox.py +0 -1
- ccxt/btcmarkets.py +1 -3
- ccxt/bybit.py +10 -11
- ccxt/cex.py +1 -1
- ccxt/coinbase.py +77 -1
- ccxt/coinbaseexchange.py +1 -1
- ccxt/coinbaseinternational.py +62 -0
- ccxt/coincatch.py +1 -1
- ccxt/coinex.py +9 -9
- ccxt/coinlist.py +1 -1
- ccxt/coinmetro.py +1 -1
- ccxt/cryptocom.py +91 -2
- ccxt/currencycom.py +1 -1
- ccxt/defx.py +1 -2
- ccxt/delta.py +1 -1
- ccxt/digifinex.py +1 -1
- ccxt/exmo.py +62 -6
- ccxt/gate.py +2 -2
- ccxt/hashkey.py +3 -5
- ccxt/htx.py +2 -2
- ccxt/hyperliquid.py +61 -2
- ccxt/kraken.py +124 -26
- ccxt/kucoin.py +29 -25
- ccxt/luno.py +1 -1
- ccxt/mexc.py +137 -1
- ccxt/ndax.py +1 -1
- ccxt/okcoin.py +18 -18
- ccxt/okx.py +27 -22
- ccxt/phemex.py +12 -8
- ccxt/poloniex.py +1 -1
- ccxt/poloniexfutures.py +6 -6
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/bitget.py +1 -1
- ccxt/pro/bybit.py +12 -1
- ccxt/pro/coinex.py +2 -2
- ccxt/pro/gate.py +6 -6
- ccxt/pro/kucoin.py +3 -3
- ccxt/pro/okx.py +11 -11
- ccxt/pro/upbit.py +2 -2
- ccxt/vertex.py +11 -11
- ccxt/woo.py +33 -33
- ccxt/woofipro.py +24 -24
- ccxt/xt.py +29 -27
- ccxt/zonda.py +1 -1
- {ccxt-4.4.39.dist-info → ccxt-4.4.41.dist-info}/METADATA +4 -4
- {ccxt-4.4.39.dist-info → ccxt-4.4.41.dist-info}/RECORD +137 -137
- {ccxt-4.4.39.dist-info → ccxt-4.4.41.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.4.39.dist-info → ccxt-4.4.41.dist-info}/WHEEL +0 -0
- {ccxt-4.4.39.dist-info → ccxt-4.4.41.dist-info}/top_level.txt +0 -0
ccxt/async_support/kraken.py
CHANGED
@@ -1129,7 +1129,7 @@ class kraken(Exchange, ImplicitAPI):
|
|
1129
1129
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1130
1130
|
:param int [params.until]: timestamp in ms of the latest ledger entry
|
1131
1131
|
:param int [params.end]: timestamp in seconds of the latest ledger entry
|
1132
|
-
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger
|
1132
|
+
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger>`
|
1133
1133
|
"""
|
1134
1134
|
# https://www.kraken.com/features/api#get-ledgers-info
|
1135
1135
|
await self.load_markets()
|
@@ -1621,6 +1621,37 @@ class kraken(Exchange, ImplicitAPI):
|
|
1621
1621
|
# }
|
1622
1622
|
# }
|
1623
1623
|
#
|
1624
|
+
# fetchOpenOrders
|
1625
|
+
#
|
1626
|
+
# {
|
1627
|
+
# "refid": null,
|
1628
|
+
# "userref": null,
|
1629
|
+
# "cl_ord_id": "1234",
|
1630
|
+
# "status": "open",
|
1631
|
+
# "opentm": 1733815269.370054,
|
1632
|
+
# "starttm": 0,
|
1633
|
+
# "expiretm": 0,
|
1634
|
+
# "descr": {
|
1635
|
+
# "pair": "XBTUSD",
|
1636
|
+
# "type": "buy",
|
1637
|
+
# "ordertype": "limit",
|
1638
|
+
# "price": "70000.0",
|
1639
|
+
# "price2": "0",
|
1640
|
+
# "leverage": "none",
|
1641
|
+
# "order": "buy 0.00010000 XBTUSD @ limit 70000.0",
|
1642
|
+
# "close": ""
|
1643
|
+
# },
|
1644
|
+
# "vol": "0.00010000",
|
1645
|
+
# "vol_exec": "0.00000000",
|
1646
|
+
# "cost": "0.00000",
|
1647
|
+
# "fee": "0.00000",
|
1648
|
+
# "price": "0.00000",
|
1649
|
+
# "stopprice": "0.00000",
|
1650
|
+
# "limitprice": "0.00000",
|
1651
|
+
# "misc": "",
|
1652
|
+
# "oflags": "fciq"
|
1653
|
+
# }
|
1654
|
+
#
|
1624
1655
|
description = self.safe_dict(order, 'descr', {})
|
1625
1656
|
orderDescriptionObj = self.safe_dict(order, 'descr') # can be null
|
1626
1657
|
orderDescription = None
|
@@ -1694,7 +1725,8 @@ class kraken(Exchange, ImplicitAPI):
|
|
1694
1725
|
if (id is None) or (id.startswith('[')):
|
1695
1726
|
txid = self.safe_list(order, 'txid')
|
1696
1727
|
id = self.safe_string(txid, 0)
|
1697
|
-
|
1728
|
+
userref = self.safe_string(order, 'userref')
|
1729
|
+
clientOrderId = self.safe_string(order, 'cl_ord_id', userref)
|
1698
1730
|
rawTrades = self.safe_value(order, 'trades', [])
|
1699
1731
|
trades = []
|
1700
1732
|
for i in range(0, len(rawTrades)):
|
@@ -1888,10 +1920,10 @@ class kraken(Exchange, ImplicitAPI):
|
|
1888
1920
|
request: dict = {
|
1889
1921
|
'txid': id,
|
1890
1922
|
}
|
1891
|
-
clientOrderId = self.
|
1923
|
+
clientOrderId = self.safe_string_2(params, 'clientOrderId', 'cl_ord_id')
|
1892
1924
|
if clientOrderId is not None:
|
1893
1925
|
request['cl_ord_id'] = clientOrderId
|
1894
|
-
params = self.omit(params, 'clientOrderId')
|
1926
|
+
params = self.omit(params, ['clientOrderId', 'cl_ord_id'])
|
1895
1927
|
request = self.omit(request, 'txid')
|
1896
1928
|
isMarket = (type == 'market')
|
1897
1929
|
postOnly = None
|
@@ -2158,20 +2190,27 @@ class kraken(Exchange, ImplicitAPI):
|
|
2158
2190
|
"""
|
2159
2191
|
cancels an open order
|
2160
2192
|
|
2161
|
-
https://docs.kraken.com/rest
|
2193
|
+
https://docs.kraken.com/api/docs/rest-api/cancel-order
|
2162
2194
|
|
2163
2195
|
:param str id: order id
|
2164
|
-
:param str symbol: unified symbol of the market the order was made in
|
2196
|
+
:param str [symbol]: unified symbol of the market the order was made in
|
2165
2197
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2166
|
-
:
|
2198
|
+
:param str [params.clientOrderId]: the orders client order id
|
2199
|
+
:param int [params.userref]: the orders user reference id
|
2200
|
+
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
2167
2201
|
"""
|
2168
2202
|
await self.load_markets()
|
2169
2203
|
response = None
|
2170
|
-
|
2204
|
+
requestId = self.safe_value(params, 'userref', id) # string or integer
|
2205
|
+
params = self.omit(params, 'userref')
|
2171
2206
|
request: dict = {
|
2172
|
-
'txid':
|
2207
|
+
'txid': requestId, # order id or userref
|
2173
2208
|
}
|
2174
|
-
|
2209
|
+
clientOrderId = self.safe_string_2(params, 'clientOrderId', 'cl_ord_id')
|
2210
|
+
if clientOrderId is not None:
|
2211
|
+
request['cl_ord_id'] = clientOrderId
|
2212
|
+
params = self.omit(params, ['clientOrderId', 'cl_ord_id'])
|
2213
|
+
request = self.omit(request, 'txid')
|
2175
2214
|
try:
|
2176
2215
|
response = await self.privatePostCancelOrder(self.extend(request, params))
|
2177
2216
|
#
|
@@ -2278,55 +2317,108 @@ class kraken(Exchange, ImplicitAPI):
|
|
2278
2317
|
"""
|
2279
2318
|
fetch all unfilled currently open orders
|
2280
2319
|
|
2281
|
-
https://docs.kraken.com/rest
|
2320
|
+
https://docs.kraken.com/api/docs/rest-api/get-open-orders
|
2282
2321
|
|
2283
|
-
:param str symbol: unified market symbol
|
2322
|
+
:param str [symbol]: unified market symbol
|
2284
2323
|
:param int [since]: the earliest time in ms to fetch open orders for
|
2285
2324
|
:param int [limit]: the maximum number of open orders structures to retrieve
|
2286
2325
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2326
|
+
:param str [params.clientOrderId]: the orders client order id
|
2327
|
+
:param int [params.userref]: the orders user reference id
|
2287
2328
|
:returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
2288
2329
|
"""
|
2289
2330
|
await self.load_markets()
|
2290
2331
|
request: dict = {}
|
2291
2332
|
if since is not None:
|
2292
2333
|
request['start'] = self.parse_to_int(since / 1000)
|
2293
|
-
|
2294
|
-
|
2334
|
+
userref = self.safe_integer(params, 'userref')
|
2335
|
+
if userref is not None:
|
2336
|
+
request['userref'] = userref
|
2337
|
+
params = self.omit(params, 'userref')
|
2338
|
+
clientOrderId = self.safe_string(params, 'clientOrderId')
|
2295
2339
|
if clientOrderId is not None:
|
2296
|
-
request['
|
2297
|
-
|
2298
|
-
response = await self.privatePostOpenOrders(self.extend(request,
|
2340
|
+
request['cl_ord_id'] = clientOrderId
|
2341
|
+
params = self.omit(params, 'clientOrderId')
|
2342
|
+
response = await self.privatePostOpenOrders(self.extend(request, params))
|
2343
|
+
#
|
2344
|
+
# {
|
2345
|
+
# "error": [],
|
2346
|
+
# "result": {
|
2347
|
+
# "open": {
|
2348
|
+
# "O45M52-BFD5S-YXKQOU": {
|
2349
|
+
# "refid": null,
|
2350
|
+
# "userref": null,
|
2351
|
+
# "cl_ord_id": "1234",
|
2352
|
+
# "status": "open",
|
2353
|
+
# "opentm": 1733815269.370054,
|
2354
|
+
# "starttm": 0,
|
2355
|
+
# "expiretm": 0,
|
2356
|
+
# "descr": {
|
2357
|
+
# "pair": "XBTUSD",
|
2358
|
+
# "type": "buy",
|
2359
|
+
# "ordertype": "limit",
|
2360
|
+
# "price": "70000.0",
|
2361
|
+
# "price2": "0",
|
2362
|
+
# "leverage": "none",
|
2363
|
+
# "order": "buy 0.00010000 XBTUSD @ limit 70000.0",
|
2364
|
+
# "close": ""
|
2365
|
+
# },
|
2366
|
+
# "vol": "0.00010000",
|
2367
|
+
# "vol_exec": "0.00000000",
|
2368
|
+
# "cost": "0.00000",
|
2369
|
+
# "fee": "0.00000",
|
2370
|
+
# "price": "0.00000",
|
2371
|
+
# "stopprice": "0.00000",
|
2372
|
+
# "limitprice": "0.00000",
|
2373
|
+
# "misc": "",
|
2374
|
+
# "oflags": "fciq"
|
2375
|
+
# }
|
2376
|
+
# }
|
2377
|
+
# }
|
2378
|
+
# }
|
2379
|
+
#
|
2299
2380
|
market = None
|
2300
2381
|
if symbol is not None:
|
2301
2382
|
market = self.market(symbol)
|
2302
2383
|
result = self.safe_dict(response, 'result', {})
|
2303
|
-
|
2384
|
+
open = self.safe_dict(result, 'open', {})
|
2385
|
+
orders = []
|
2386
|
+
orderIds = list(open.keys())
|
2387
|
+
for i in range(0, len(orderIds)):
|
2388
|
+
id = orderIds[i]
|
2389
|
+
item = open[id]
|
2390
|
+
orders.append(self.extend({'id': id}, item))
|
2304
2391
|
return self.parse_orders(orders, market, since, limit)
|
2305
2392
|
|
2306
2393
|
async def fetch_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
2307
2394
|
"""
|
2308
2395
|
fetches information on multiple closed orders made by the user
|
2309
2396
|
|
2310
|
-
https://docs.kraken.com/rest
|
2397
|
+
https://docs.kraken.com/api/docs/rest-api/get-closed-orders
|
2311
2398
|
|
2312
|
-
:param str symbol: unified market symbol of the market orders were made in
|
2399
|
+
:param str [symbol]: unified market symbol of the market orders were made in
|
2313
2400
|
:param int [since]: the earliest time in ms to fetch orders for
|
2314
2401
|
:param int [limit]: the maximum number of order structures to retrieve
|
2315
2402
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2316
2403
|
:param int [params.until]: timestamp in ms of the latest entry
|
2404
|
+
:param str [params.clientOrderId]: the orders client order id
|
2405
|
+
:param int [params.userref]: the orders user reference id
|
2317
2406
|
:returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
2318
2407
|
"""
|
2319
2408
|
await self.load_markets()
|
2320
2409
|
request: dict = {}
|
2321
2410
|
if since is not None:
|
2322
2411
|
request['start'] = self.parse_to_int(since / 1000)
|
2323
|
-
|
2324
|
-
|
2412
|
+
userref = self.safe_integer(params, 'userref')
|
2413
|
+
if userref is not None:
|
2414
|
+
request['userref'] = userref
|
2415
|
+
params = self.omit(params, 'userref')
|
2416
|
+
clientOrderId = self.safe_string(params, 'clientOrderId')
|
2325
2417
|
if clientOrderId is not None:
|
2326
|
-
request['
|
2327
|
-
|
2418
|
+
request['cl_ord_id'] = clientOrderId
|
2419
|
+
params = self.omit(params, 'clientOrderId')
|
2328
2420
|
request, params = self.handle_until_option('end', request, params)
|
2329
|
-
response = await self.privatePostClosedOrders(self.extend(request,
|
2421
|
+
response = await self.privatePostClosedOrders(self.extend(request, params))
|
2330
2422
|
#
|
2331
2423
|
# {
|
2332
2424
|
# "error":[],
|
@@ -2370,7 +2462,13 @@ class kraken(Exchange, ImplicitAPI):
|
|
2370
2462
|
if symbol is not None:
|
2371
2463
|
market = self.market(symbol)
|
2372
2464
|
result = self.safe_dict(response, 'result', {})
|
2373
|
-
|
2465
|
+
closed = self.safe_dict(result, 'closed', {})
|
2466
|
+
orders = []
|
2467
|
+
orderIds = list(closed.keys())
|
2468
|
+
for i in range(0, len(orderIds)):
|
2469
|
+
id = orderIds[i]
|
2470
|
+
item = closed[id]
|
2471
|
+
orders.append(self.extend({'id': id}, item))
|
2374
2472
|
return self.parse_orders(orders, market, since, limit)
|
2375
2473
|
|
2376
2474
|
def parse_transaction_status(self, status: Str):
|
ccxt/async_support/kucoin.py
CHANGED
@@ -660,6 +660,8 @@ class kucoin(Exchange, ImplicitAPI):
|
|
660
660
|
'version': 'v1',
|
661
661
|
'symbolSeparator': '-',
|
662
662
|
'fetchMyTradesMethod': 'private_get_fills',
|
663
|
+
'timeDifference': 0, # the difference between system clock and Binance clock
|
664
|
+
'adjustForTimeDifference': False, # controls the adjustment logic upon instantiation
|
663
665
|
'fetchCurrencies': {
|
664
666
|
'webApiEnable': True, # fetches from WEB
|
665
667
|
'webApiRetries': 1,
|
@@ -1076,7 +1078,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
1076
1078
|
})
|
1077
1079
|
|
1078
1080
|
def nonce(self):
|
1079
|
-
return self.milliseconds()
|
1081
|
+
return self.milliseconds() - self.options['timeDifference']
|
1080
1082
|
|
1081
1083
|
async def fetch_time(self, params={}):
|
1082
1084
|
"""
|
@@ -1313,6 +1315,8 @@ class kucoin(Exchange, ImplicitAPI):
|
|
1313
1315
|
'created': None,
|
1314
1316
|
'info': market,
|
1315
1317
|
})
|
1318
|
+
if self.options['adjustForTimeDifference']:
|
1319
|
+
await self.load_time_difference()
|
1316
1320
|
return result
|
1317
1321
|
|
1318
1322
|
async def load_migration_status(self, force: bool = False):
|
@@ -2214,7 +2218,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2214
2218
|
market orders --------------------------------------------------
|
2215
2219
|
:param str [params.funds]: # Amount of quote currency to use
|
2216
2220
|
stop orders ----------------------------------------------------
|
2217
|
-
:param str [params.stop]: Either loss or entry, the default is loss. Requires
|
2221
|
+
:param str [params.stop]: Either loss or entry, the default is loss. Requires triggerPrice to be defined
|
2218
2222
|
margin orders --------------------------------------------------
|
2219
2223
|
:param float [params.leverage]: Leverage size of the order
|
2220
2224
|
:param str [params.stp]: '', # self trade prevention, CN, CO, CB or DC
|
@@ -2519,7 +2523,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2519
2523
|
:param str id: order id
|
2520
2524
|
:param str symbol: unified symbol of the market the order was made in
|
2521
2525
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2522
|
-
:param bool [params.
|
2526
|
+
:param bool [params.trigger]: True if cancelling a stop order
|
2523
2527
|
:param bool [params.hf]: False, # True for hf order
|
2524
2528
|
:param bool [params.sync]: False, # True to use the hf sync call
|
2525
2529
|
:returns: Response from the exchange
|
@@ -2527,7 +2531,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2527
2531
|
await self.load_markets()
|
2528
2532
|
request: dict = {}
|
2529
2533
|
clientOrderId = self.safe_string_2(params, 'clientOid', 'clientOrderId')
|
2530
|
-
|
2534
|
+
trigger = self.safe_bool_2(params, 'stop', 'trigger', False)
|
2531
2535
|
hf = None
|
2532
2536
|
hf, params = self.handle_hf_and_params(params)
|
2533
2537
|
useSync = False
|
@@ -2541,7 +2545,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2541
2545
|
params = self.omit(params, ['clientOid', 'clientOrderId', 'stop', 'trigger'])
|
2542
2546
|
if clientOrderId is not None:
|
2543
2547
|
request['clientOid'] = clientOrderId
|
2544
|
-
if
|
2548
|
+
if trigger:
|
2545
2549
|
response = await self.privateDeleteStopOrderCancelOrderByClientOid(self.extend(request, params))
|
2546
2550
|
#
|
2547
2551
|
# {
|
@@ -2580,7 +2584,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2580
2584
|
return self.parse_order(response)
|
2581
2585
|
else:
|
2582
2586
|
request['orderId'] = id
|
2583
|
-
if
|
2587
|
+
if trigger:
|
2584
2588
|
response = await self.privateDeleteStopOrderOrderId(self.extend(request, params))
|
2585
2589
|
#
|
2586
2590
|
# {
|
@@ -2628,7 +2632,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2628
2632
|
|
2629
2633
|
:param str symbol: unified market symbol, only orders in the market of self symbol are cancelled when symbol is not None
|
2630
2634
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2631
|
-
:param bool [params.
|
2635
|
+
:param bool [params.trigger]: *invalid for isolated margin* True if cancelling all stop orders
|
2632
2636
|
:param str [params.marginMode]: 'cross' or 'isolated'
|
2633
2637
|
:param str [params.orderIds]: *stop orders only* Comma seperated order IDs
|
2634
2638
|
:param bool [params.hf]: False, # True for hf order
|
@@ -2636,7 +2640,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2636
2640
|
"""
|
2637
2641
|
await self.load_markets()
|
2638
2642
|
request: dict = {}
|
2639
|
-
|
2643
|
+
trigger = self.safe_bool(params, 'stop', False)
|
2640
2644
|
hf = None
|
2641
2645
|
hf, params = self.handle_hf_and_params(params)
|
2642
2646
|
params = self.omit(params, 'stop')
|
@@ -2645,10 +2649,10 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2645
2649
|
request['symbol'] = self.market_id(symbol)
|
2646
2650
|
if marginMode is not None:
|
2647
2651
|
request['tradeType'] = self.options['marginModes'][marginMode]
|
2648
|
-
if marginMode == 'isolated' and
|
2652
|
+
if marginMode == 'isolated' and trigger:
|
2649
2653
|
raise BadRequest(self.id + ' cancelAllOrders does not support isolated margin for stop orders')
|
2650
2654
|
response = None
|
2651
|
-
if
|
2655
|
+
if trigger:
|
2652
2656
|
response = await self.privateDeleteStopOrderCancel(self.extend(request, query))
|
2653
2657
|
elif hf:
|
2654
2658
|
if symbol is None:
|
@@ -2677,9 +2681,9 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2677
2681
|
:param str [params.side]: buy or sell
|
2678
2682
|
:param str [params.type]: limit, market, limit_stop or market_stop
|
2679
2683
|
:param str [params.tradeType]: TRADE for spot trading, MARGIN_TRADE for Margin Trading
|
2680
|
-
:param int [params.currentPage]: *
|
2681
|
-
:param str [params.orderIds]: *
|
2682
|
-
:param bool [params.
|
2684
|
+
:param int [params.currentPage]: *trigger orders only* current page
|
2685
|
+
:param str [params.orderIds]: *trigger orders only* comma seperated order ID list
|
2686
|
+
:param bool [params.trigger]: True if fetching a trigger order
|
2683
2687
|
:param bool [params.hf]: False, # True for hf order
|
2684
2688
|
:returns: An `array of order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
2685
2689
|
"""
|
@@ -2788,7 +2792,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2788
2792
|
:param str [params.side]: buy or sell
|
2789
2793
|
:param str [params.type]: limit, market, limit_stop or market_stop
|
2790
2794
|
:param str [params.tradeType]: TRADE for spot trading, MARGIN_TRADE for Margin Trading
|
2791
|
-
:param bool [params.
|
2795
|
+
:param bool [params.trigger]: True if fetching a trigger order
|
2792
2796
|
:param bool [params.hf]: False, # True for hf order
|
2793
2797
|
:param boolean [params.paginate]: default False, when True will automatically paginate by calling self endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
2794
2798
|
:returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
@@ -2814,12 +2818,12 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2814
2818
|
:param int [limit]: the maximum number of open orders structures to retrieve
|
2815
2819
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2816
2820
|
:param int [params.until]: end time in ms
|
2817
|
-
:param bool [params.
|
2821
|
+
:param bool [params.trigger]: True if fetching trigger orders
|
2818
2822
|
:param str [params.side]: buy or sell
|
2819
2823
|
:param str [params.type]: limit, market, limit_stop or market_stop
|
2820
2824
|
:param str [params.tradeType]: TRADE for spot trading, MARGIN_TRADE for Margin Trading
|
2821
|
-
:param int [params.currentPage]: *
|
2822
|
-
:param str [params.orderIds]: *
|
2825
|
+
:param int [params.currentPage]: *trigger orders only* current page
|
2826
|
+
:param str [params.orderIds]: *trigger orders only* comma seperated order ID list
|
2823
2827
|
:param bool [params.hf]: False, # True for hf order
|
2824
2828
|
:param boolean [params.paginate]: default False, when True will automatically paginate by calling self endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
2825
2829
|
:returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
@@ -2843,9 +2847,9 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2843
2847
|
https://docs.kucoin.com/spot-hf/#obtain-details-of-a-single-hf-order-using-clientoid
|
2844
2848
|
|
2845
2849
|
:param str id: Order id
|
2846
|
-
:param str symbol: not sent to exchange except for
|
2850
|
+
:param str symbol: not sent to exchange except for trigger orders with clientOid, but used internally by CCXT to filter
|
2847
2851
|
:param dict [params]: exchange specific parameters
|
2848
|
-
:param bool [params.
|
2852
|
+
:param bool [params.trigger]: True if fetching a trigger order
|
2849
2853
|
:param bool [params.hf]: False, # True for hf order
|
2850
2854
|
:param bool [params.clientOid]: unique order id created by users to identify their orders
|
2851
2855
|
:returns: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
@@ -2853,7 +2857,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2853
2857
|
await self.load_markets()
|
2854
2858
|
request: dict = {}
|
2855
2859
|
clientOrderId = self.safe_string_2(params, 'clientOid', 'clientOrderId')
|
2856
|
-
|
2860
|
+
trigger = self.safe_bool_2(params, 'stop', 'trigger', False)
|
2857
2861
|
hf = None
|
2858
2862
|
hf, params = self.handle_hf_and_params(params)
|
2859
2863
|
market = None
|
@@ -2867,7 +2871,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2867
2871
|
response = None
|
2868
2872
|
if clientOrderId is not None:
|
2869
2873
|
request['clientOid'] = clientOrderId
|
2870
|
-
if
|
2874
|
+
if trigger:
|
2871
2875
|
if symbol is not None:
|
2872
2876
|
request['symbol'] = market['id']
|
2873
2877
|
response = await self.privateGetStopOrderQueryOrderByClientOid(self.extend(request, params))
|
@@ -2882,7 +2886,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2882
2886
|
if id is None:
|
2883
2887
|
raise InvalidOrder(self.id + ' fetchOrder() requires an order id')
|
2884
2888
|
request['orderId'] = id
|
2885
|
-
if
|
2889
|
+
if trigger:
|
2886
2890
|
response = await self.privateGetStopOrderOrderId(self.extend(request, params))
|
2887
2891
|
elif hf:
|
2888
2892
|
response = await self.privateGetHfOrdersOrderId(self.extend(request, params))
|
@@ -3020,7 +3024,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
3020
3024
|
feeCurrencyId = self.safe_string(order, 'feeCurrency')
|
3021
3025
|
cancelExist = self.safe_bool(order, 'cancelExist', False)
|
3022
3026
|
responseStop = self.safe_string(order, 'stop')
|
3023
|
-
|
3027
|
+
trigger = responseStop is not None
|
3024
3028
|
stopTriggered = self.safe_bool(order, 'stopTriggered', False)
|
3025
3029
|
isActive = self.safe_bool_2(order, 'isActive', 'active')
|
3026
3030
|
responseStatus = self.safe_string(order, 'status')
|
@@ -3030,7 +3034,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
3030
3034
|
status = 'open'
|
3031
3035
|
else:
|
3032
3036
|
status = 'closed'
|
3033
|
-
if
|
3037
|
+
if trigger:
|
3034
3038
|
if responseStatus == 'NEW':
|
3035
3039
|
status = 'open'
|
3036
3040
|
elif not isActive and not stopTriggered:
|
@@ -4183,7 +4187,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
4183
4187
|
:param boolean [params.hf]: default False, when True will fetch ledger entries for the high frequency trading account
|
4184
4188
|
:param int [params.until]: the latest time in ms to fetch entries for
|
4185
4189
|
:param boolean [params.paginate]: default False, when True will automatically paginate by calling self endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
4186
|
-
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger
|
4190
|
+
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger>`
|
4187
4191
|
"""
|
4188
4192
|
await self.load_markets()
|
4189
4193
|
await self.load_accounts()
|
ccxt/async_support/luno.py
CHANGED
@@ -963,7 +963,7 @@ class luno(Exchange, ImplicitAPI):
|
|
963
963
|
:param int [since]: timestamp in ms of the earliest ledger entry, default is None
|
964
964
|
:param int [limit]: max number of ledger entries to return, default is None
|
965
965
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
966
|
-
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger
|
966
|
+
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger>`
|
967
967
|
"""
|
968
968
|
await self.load_markets()
|
969
969
|
await self.load_accounts()
|
ccxt/async_support/mexc.py
CHANGED
@@ -689,6 +689,143 @@ class mexc(Exchange, ImplicitAPI):
|
|
689
689
|
'maxTimeTillEnd': 90 * 86400 * 1000 - 1, # 90 days
|
690
690
|
'broker': 'CCXT',
|
691
691
|
},
|
692
|
+
'features': {
|
693
|
+
'default': {
|
694
|
+
'sandbox': False,
|
695
|
+
'createOrder': {
|
696
|
+
'marginMode': True,
|
697
|
+
'triggerPrice': False,
|
698
|
+
'triggerDirection': False,
|
699
|
+
'triggerPriceType': {
|
700
|
+
'last': False,
|
701
|
+
'mark': False,
|
702
|
+
'index': False,
|
703
|
+
},
|
704
|
+
'stopLossPrice': False, # todo
|
705
|
+
'takeProfitPrice': False,
|
706
|
+
'attachedStopLossTakeProfit': None,
|
707
|
+
'timeInForce': {
|
708
|
+
'IOC': True,
|
709
|
+
'FOK': True,
|
710
|
+
'PO': True,
|
711
|
+
'GTD': False,
|
712
|
+
},
|
713
|
+
'hedged': False,
|
714
|
+
# exchange-supported features
|
715
|
+
'selfTradePrevention': False,
|
716
|
+
'trailing': False,
|
717
|
+
'iceberg': False,
|
718
|
+
},
|
719
|
+
'createOrders': {
|
720
|
+
'max': 20,
|
721
|
+
},
|
722
|
+
'fetchMyTrades': {
|
723
|
+
'marginMode': False,
|
724
|
+
'limit': 100,
|
725
|
+
'daysBack': 30,
|
726
|
+
'untilDays': None,
|
727
|
+
},
|
728
|
+
'fetchOrder': {
|
729
|
+
'marginMode': False,
|
730
|
+
'trigger': False,
|
731
|
+
'trailing': False,
|
732
|
+
},
|
733
|
+
'fetchOpenOrders': {
|
734
|
+
'marginMode': True,
|
735
|
+
'limit': None,
|
736
|
+
'trigger': False,
|
737
|
+
'trailing': False,
|
738
|
+
},
|
739
|
+
'fetchOrders': {
|
740
|
+
'marginMode': True,
|
741
|
+
'limit': 1000,
|
742
|
+
'daysBack': 7,
|
743
|
+
'untilDays': 7,
|
744
|
+
'trigger': False,
|
745
|
+
'trailing': False,
|
746
|
+
},
|
747
|
+
'fetchClosedOrders': {
|
748
|
+
'marginMode': True,
|
749
|
+
'limit': 1000,
|
750
|
+
'daysBackClosed': 7,
|
751
|
+
'daysBackCanceled': 7,
|
752
|
+
'untilDays': 7,
|
753
|
+
'trigger': False,
|
754
|
+
'trailing': False,
|
755
|
+
},
|
756
|
+
'fetchOHLCV': {
|
757
|
+
'limit': 1000,
|
758
|
+
},
|
759
|
+
},
|
760
|
+
'spot': {
|
761
|
+
'extends': 'default',
|
762
|
+
},
|
763
|
+
'forDerivs': {
|
764
|
+
'extends': 'default',
|
765
|
+
'createOrder': {
|
766
|
+
'triggerPrice': True,
|
767
|
+
'triggerPriceType': {
|
768
|
+
'last': True,
|
769
|
+
'mark': True,
|
770
|
+
'index': True,
|
771
|
+
},
|
772
|
+
'triggerDirection': True,
|
773
|
+
'stopLossPrice': False, # todo
|
774
|
+
'takeProfitPrice': False,
|
775
|
+
'hedged': True,
|
776
|
+
},
|
777
|
+
'createOrders': {
|
778
|
+
'max': 50,
|
779
|
+
},
|
780
|
+
'fetchMyTrades': {
|
781
|
+
'marginMode': False,
|
782
|
+
'limit': 100,
|
783
|
+
'daysBack': 90,
|
784
|
+
'untilDays': 90,
|
785
|
+
},
|
786
|
+
'fetchOrder': {
|
787
|
+
'marginMode': False,
|
788
|
+
},
|
789
|
+
'fetchOpenOrders': {
|
790
|
+
'marginMode': False,
|
791
|
+
'limit': 100,
|
792
|
+
'trigger': True,
|
793
|
+
'trailing': False,
|
794
|
+
},
|
795
|
+
'fetchOrders': {
|
796
|
+
'marginMode': False,
|
797
|
+
'limit': 100,
|
798
|
+
'daysBack': 90,
|
799
|
+
'untilDays': 90,
|
800
|
+
'trigger': True,
|
801
|
+
'trailing': False,
|
802
|
+
},
|
803
|
+
'fetchClosedOrders': {
|
804
|
+
'marginMode': False,
|
805
|
+
'limit': 100,
|
806
|
+
'daysBackClosed': 90,
|
807
|
+
'daysBackCanceled': None,
|
808
|
+
'untilDays': 90,
|
809
|
+
'trigger': True,
|
810
|
+
'trailing': False,
|
811
|
+
},
|
812
|
+
'fetchOHLCV': {
|
813
|
+
'limit': 2000,
|
814
|
+
},
|
815
|
+
},
|
816
|
+
'swap': {
|
817
|
+
'linear': {
|
818
|
+
'extends': 'forDerivs',
|
819
|
+
},
|
820
|
+
'inverse': {
|
821
|
+
'extends': 'forDerivs',
|
822
|
+
},
|
823
|
+
},
|
824
|
+
'future': {
|
825
|
+
'linear': None,
|
826
|
+
'inverse': None,
|
827
|
+
},
|
828
|
+
},
|
692
829
|
'commonCurrencies': {
|
693
830
|
'BEYONDPROTOCOL': 'BEYOND',
|
694
831
|
'BIFI': 'BIFIF',
|
@@ -2161,7 +2298,6 @@ class mexc(Exchange, ImplicitAPI):
|
|
2161
2298
|
:param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
2162
2299
|
:param str [marginMode]: only 'isolated' is supported for spot-margin trading
|
2163
2300
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2164
|
-
:param float [params.triggerPrice]: The price at which a trigger order is triggered at
|
2165
2301
|
:param bool [params.postOnly]: if True, the order will only be posted if it will be a maker order
|
2166
2302
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
2167
2303
|
"""
|
ccxt/async_support/ndax.py
CHANGED
@@ -1194,7 +1194,7 @@ class ndax(Exchange, ImplicitAPI):
|
|
1194
1194
|
:param int [since]: timestamp in ms of the earliest ledger entry, default is None
|
1195
1195
|
:param int [limit]: max number of ledger entries to return, default is None
|
1196
1196
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1197
|
-
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger
|
1197
|
+
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger>`
|
1198
1198
|
"""
|
1199
1199
|
omsId = self.safe_integer(self.options, 'omsId', 1)
|
1200
1200
|
await self.load_markets()
|