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/bitteam.py
CHANGED
@@ -1185,7 +1185,6 @@ class bitteam(Exchange, ImplicitAPI):
|
|
1185
1185
|
side = self.safe_string(order, 'side')
|
1186
1186
|
feeRaw = self.safe_value(order, 'fee')
|
1187
1187
|
price = self.safe_string(order, 'price')
|
1188
|
-
stopPrice = self.safe_string(order, 'stopPrice')
|
1189
1188
|
amount = self.safe_string(order, 'quantity')
|
1190
1189
|
filled = self.safe_string(order, 'executed')
|
1191
1190
|
fee = None
|
@@ -1210,8 +1209,7 @@ class bitteam(Exchange, ImplicitAPI):
|
|
1210
1209
|
'timeInForce': 'GTC',
|
1211
1210
|
'side': side,
|
1212
1211
|
'price': price,
|
1213
|
-
'
|
1214
|
-
'triggerPrice': stopPrice,
|
1212
|
+
'triggerPrice': self.safe_string(order, 'stopPrice'),
|
1215
1213
|
'average': None,
|
1216
1214
|
'amount': amount,
|
1217
1215
|
'cost': None,
|
ccxt/async_support/bitvavo.py
CHANGED
@@ -1112,7 +1112,7 @@ class bitvavo(Exchange, ImplicitAPI):
|
|
1112
1112
|
:param float price: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
1113
1113
|
:param dict [params]: extra parameters specific to the bitvavo api endpoint
|
1114
1114
|
:param str [params.timeInForce]: "GTC", "IOC", or "PO"
|
1115
|
-
:param float [params.stopPrice]:
|
1115
|
+
:param float [params.stopPrice]: Alias for triggerPrice
|
1116
1116
|
:param float [params.triggerPrice]: The price at which a trigger order is triggered at
|
1117
1117
|
:param bool [params.postOnly]: If True, the order will only be posted to the order book and not executed immediately
|
1118
1118
|
:param float [params.stopLossPrice]: The price at which a stop loss order is triggered at
|
@@ -1564,7 +1564,6 @@ class bitvavo(Exchange, ImplicitAPI):
|
|
1564
1564
|
timeInForce = self.safe_string(order, 'timeInForce')
|
1565
1565
|
postOnly = self.safe_value(order, 'postOnly')
|
1566
1566
|
# https://github.com/ccxt/ccxt/issues/8489
|
1567
|
-
stopPrice = self.safe_number(order, 'triggerPrice')
|
1568
1567
|
return self.safe_order({
|
1569
1568
|
'info': order,
|
1570
1569
|
'id': id,
|
@@ -1578,8 +1577,7 @@ class bitvavo(Exchange, ImplicitAPI):
|
|
1578
1577
|
'postOnly': postOnly,
|
1579
1578
|
'side': side,
|
1580
1579
|
'price': price,
|
1581
|
-
'
|
1582
|
-
'triggerPrice': stopPrice,
|
1580
|
+
'triggerPrice': self.safe_number(order, 'triggerPrice'),
|
1583
1581
|
'amount': amount,
|
1584
1582
|
'cost': cost,
|
1585
1583
|
'average': None,
|
@@ -567,12 +567,12 @@ class blockchaincom(Exchange, ImplicitAPI):
|
|
567
567
|
'orderQty': self.amount_to_precision(symbol, amount),
|
568
568
|
'clOrdId': clientOrderId,
|
569
569
|
}
|
570
|
-
|
570
|
+
triggerPrice = self.safe_value_2(params, 'stopPx', 'stopPrice')
|
571
571
|
params = self.omit(params, ['stopPx', 'stopPrice'])
|
572
572
|
if uppercaseOrderType == 'STOP' or uppercaseOrderType == 'STOPLIMIT':
|
573
|
-
if
|
574
|
-
raise ArgumentsRequired(self.id + ' createOrder() requires a stopPx or
|
575
|
-
if
|
573
|
+
if triggerPrice is None:
|
574
|
+
raise ArgumentsRequired(self.id + ' createOrder() requires a stopPx or triggerPrice param for a ' + uppercaseOrderType + ' order')
|
575
|
+
if triggerPrice is not None:
|
576
576
|
if uppercaseOrderType == 'MARKET':
|
577
577
|
request['ordType'] = 'STOP'
|
578
578
|
elif uppercaseOrderType == 'LIMIT':
|
@@ -586,7 +586,7 @@ class blockchaincom(Exchange, ImplicitAPI):
|
|
586
586
|
if priceRequired:
|
587
587
|
request['price'] = self.price_to_precision(symbol, price)
|
588
588
|
if stopPriceRequired:
|
589
|
-
request['stopPx'] = self.price_to_precision(symbol,
|
589
|
+
request['stopPx'] = self.price_to_precision(symbol, triggerPrice)
|
590
590
|
response = await self.privatePostOrders(self.extend(request, params))
|
591
591
|
return self.parse_order(response, market)
|
592
592
|
|
ccxt/async_support/blofin.py
CHANGED
@@ -1331,7 +1331,7 @@ class blofin(Exchange, ImplicitAPI):
|
|
1331
1331
|
:param int [since]: the earliest time in ms to fetch open orders for
|
1332
1332
|
:param int [limit]: the maximum number of open orders structures to retrieve
|
1333
1333
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1334
|
-
:param bool [params.
|
1334
|
+
:param bool [params.trigger]: True if fetching trigger or conditional orders
|
1335
1335
|
: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)
|
1336
1336
|
:returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
1337
1337
|
"""
|
@@ -1348,12 +1348,12 @@ class blofin(Exchange, ImplicitAPI):
|
|
1348
1348
|
request['instId'] = market['id']
|
1349
1349
|
if limit is not None:
|
1350
1350
|
request['limit'] = limit # default 100, max 100
|
1351
|
-
|
1351
|
+
isTrigger = self.safe_bool_n(params, ['stop', 'trigger', 'tpsl', 'TPSL'], False)
|
1352
1352
|
method: Str = None
|
1353
1353
|
method, params = self.handle_option_and_params(params, 'fetchOpenOrders', 'method', 'privateGetTradeOrdersPending')
|
1354
1354
|
query = self.omit(params, ['method', 'stop', 'trigger', 'tpsl', 'TPSL'])
|
1355
1355
|
response = None
|
1356
|
-
if
|
1356
|
+
if isTrigger or (method == 'privateGetTradeOrdersTpslPending'):
|
1357
1357
|
response = await self.privateGetTradeOrdersTpslPending(self.extend(request, query))
|
1358
1358
|
else:
|
1359
1359
|
response = await self.privateGetTradeOrdersPending(self.extend(request, query))
|
@@ -1473,7 +1473,7 @@ class blofin(Exchange, ImplicitAPI):
|
|
1473
1473
|
:param str [params.marginMode]: 'cross' or 'isolated'
|
1474
1474
|
:param int [params.until]: the latest time in ms to fetch entries for
|
1475
1475
|
: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)
|
1476
|
-
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger
|
1476
|
+
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger>`
|
1477
1477
|
"""
|
1478
1478
|
await self.load_markets()
|
1479
1479
|
paginate = False
|
@@ -1660,8 +1660,8 @@ class blofin(Exchange, ImplicitAPI):
|
|
1660
1660
|
method = self.safe_string(params, 'method', defaultMethod)
|
1661
1661
|
clientOrderIds = self.parse_ids(self.safe_value(params, 'clientOrderId'))
|
1662
1662
|
tpslIds = self.parse_ids(self.safe_value(params, 'tpslId'))
|
1663
|
-
|
1664
|
-
if
|
1663
|
+
trigger = self.safe_bool_n(params, ['stop', 'trigger', 'tpsl'])
|
1664
|
+
if trigger:
|
1665
1665
|
method = 'privatePostTradeCancelTpsl'
|
1666
1666
|
if clientOrderIds is None:
|
1667
1667
|
ids = self.parse_ids(ids)
|
@@ -1672,7 +1672,7 @@ class blofin(Exchange, ImplicitAPI):
|
|
1672
1672
|
'instId': market['id'],
|
1673
1673
|
})
|
1674
1674
|
for i in range(0, len(ids)):
|
1675
|
-
if
|
1675
|
+
if trigger:
|
1676
1676
|
request.append({
|
1677
1677
|
'tpslId': ids[i],
|
1678
1678
|
'instId': market['id'],
|
@@ -2060,7 +2060,7 @@ class blofin(Exchange, ImplicitAPI):
|
|
2060
2060
|
:param int [since]: the earliest time in ms to fetch orders for
|
2061
2061
|
:param int [limit]: the maximum number of orde structures to retrieve
|
2062
2062
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2063
|
-
:param bool [params.
|
2063
|
+
:param bool [params.trigger]: True if fetching trigger or conditional orders
|
2064
2064
|
: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)
|
2065
2065
|
:returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
2066
2066
|
"""
|
@@ -2079,12 +2079,12 @@ class blofin(Exchange, ImplicitAPI):
|
|
2079
2079
|
request['limit'] = limit # default 100, max 100
|
2080
2080
|
if since is not None:
|
2081
2081
|
request['begin'] = since
|
2082
|
-
|
2082
|
+
isTrigger = self.safe_bool_n(params, ['stop', 'trigger', 'tpsl', 'TPSL'], False)
|
2083
2083
|
method: Str = None
|
2084
2084
|
method, params = self.handle_option_and_params(params, 'fetchOpenOrders', 'method', 'privateGetTradeOrdersHistory')
|
2085
2085
|
query = self.omit(params, ['method', 'stop', 'trigger', 'tpsl', 'TPSL'])
|
2086
2086
|
response = None
|
2087
|
-
if (
|
2087
|
+
if (isTrigger) or (method == 'privateGetTradeOrdersTpslHistory'):
|
2088
2088
|
response = await self.privateGetTradeOrdersTpslHistory(self.extend(request, query))
|
2089
2089
|
else:
|
2090
2090
|
response = await self.privateGetTradeOrdersHistory(self.extend(request, query))
|
ccxt/async_support/btcalpha.py
CHANGED
ccxt/async_support/btcbox.py
CHANGED
ccxt/async_support/btcmarkets.py
CHANGED
@@ -1015,7 +1015,6 @@ class btcmarkets(Exchange, ImplicitAPI):
|
|
1015
1015
|
id = self.safe_string(order, 'orderId')
|
1016
1016
|
clientOrderId = self.safe_string(order, 'clientOrderId')
|
1017
1017
|
timeInForce = self.safe_string(order, 'timeInForce')
|
1018
|
-
stopPrice = self.safe_number(order, 'triggerPrice')
|
1019
1018
|
postOnly = self.safe_bool(order, 'postOnly')
|
1020
1019
|
return self.safe_order({
|
1021
1020
|
'info': order,
|
@@ -1030,8 +1029,7 @@ class btcmarkets(Exchange, ImplicitAPI):
|
|
1030
1029
|
'postOnly': postOnly,
|
1031
1030
|
'side': side,
|
1032
1031
|
'price': price,
|
1033
|
-
'
|
1034
|
-
'triggerPrice': stopPrice,
|
1032
|
+
'triggerPrice': self.safe_number(order, 'triggerPrice'),
|
1035
1033
|
'cost': None,
|
1036
1034
|
'amount': amount,
|
1037
1035
|
'filled': None,
|
ccxt/async_support/bybit.py
CHANGED
@@ -3531,29 +3531,29 @@ class bybit(Exchange, ImplicitAPI):
|
|
3531
3531
|
avgPrice = self.omit_zero(self.safe_string(order, 'avgPrice'))
|
3532
3532
|
rawTimeInForce = self.safe_string(order, 'timeInForce')
|
3533
3533
|
timeInForce = self.parse_time_in_force(rawTimeInForce)
|
3534
|
-
|
3534
|
+
triggerPrice = self.omit_zero(self.safe_string(order, 'triggerPrice'))
|
3535
3535
|
reduceOnly = self.safe_bool(order, 'reduceOnly')
|
3536
3536
|
takeProfitPrice = self.omit_zero(self.safe_string(order, 'takeProfit'))
|
3537
3537
|
stopLossPrice = self.omit_zero(self.safe_string(order, 'stopLoss'))
|
3538
3538
|
triggerDirection = self.safe_string(order, 'triggerDirection')
|
3539
3539
|
isAscending = (triggerDirection == '1')
|
3540
|
-
isStopOrderType2 = (
|
3540
|
+
isStopOrderType2 = (triggerPrice is not None) and reduceOnly
|
3541
3541
|
if (stopLossPrice is None) and isStopOrderType2:
|
3542
3542
|
# check if order is stop order type 2 - stopLossPrice
|
3543
3543
|
if isAscending and (side == 'buy'):
|
3544
3544
|
# stopLoss order against short position
|
3545
|
-
stopLossPrice =
|
3545
|
+
stopLossPrice = triggerPrice
|
3546
3546
|
if not isAscending and (side == 'sell'):
|
3547
3547
|
# stopLoss order against a long position
|
3548
|
-
stopLossPrice =
|
3548
|
+
stopLossPrice = triggerPrice
|
3549
3549
|
if (takeProfitPrice is None) and isStopOrderType2:
|
3550
3550
|
# check if order is stop order type 2 - takeProfitPrice
|
3551
3551
|
if isAscending and (side == 'sell'):
|
3552
3552
|
# takeprofit order against a long position
|
3553
|
-
takeProfitPrice =
|
3553
|
+
takeProfitPrice = triggerPrice
|
3554
3554
|
if not isAscending and (side == 'buy'):
|
3555
3555
|
# takeprofit order against a short position
|
3556
|
-
takeProfitPrice =
|
3556
|
+
takeProfitPrice = triggerPrice
|
3557
3557
|
return self.safe_order({
|
3558
3558
|
'info': order,
|
3559
3559
|
'id': id,
|
@@ -3569,8 +3569,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
3569
3569
|
'reduceOnly': self.safe_bool(order, 'reduceOnly'),
|
3570
3570
|
'side': side,
|
3571
3571
|
'price': price,
|
3572
|
-
'
|
3573
|
-
'triggerPrice': stopPrice,
|
3572
|
+
'triggerPrice': triggerPrice,
|
3574
3573
|
'takeProfitPrice': takeProfitPrice,
|
3575
3574
|
'stopLossPrice': stopLossPrice,
|
3576
3575
|
'amount': amount,
|
@@ -5429,7 +5428,7 @@ classic accounts only/ spot not supported* fetches information on an order made
|
|
5429
5428
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
5430
5429
|
: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)
|
5431
5430
|
:param str [params.subType]: if inverse will use v5/account/contract-transaction-log
|
5432
|
-
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger
|
5431
|
+
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger>`
|
5433
5432
|
"""
|
5434
5433
|
await self.load_markets()
|
5435
5434
|
paginate = False
|
@@ -6371,7 +6370,7 @@ classic accounts only/ spot not supported* fetches information on an order made
|
|
6371
6370
|
data = self.add_pagination_cursor_to_result(response)
|
6372
6371
|
id = self.safe_string(result, 'symbol')
|
6373
6372
|
market = self.safe_market(id, market, None, 'contract')
|
6374
|
-
return self.
|
6373
|
+
return self.parse_open_interests_history(data, market, since, limit)
|
6375
6374
|
|
6376
6375
|
async def fetch_open_interest(self, symbol: str, params={}):
|
6377
6376
|
"""
|
@@ -7705,7 +7704,7 @@ classic accounts only/ spot not supported* fetches information on an order made
|
|
7705
7704
|
if market['spot']:
|
7706
7705
|
raise NotSupported(self.id + ' fetchLeverageTiers() is not supported for spot market')
|
7707
7706
|
symbol = market['symbol']
|
7708
|
-
data = await self.get_leverage_tiers_paginated(symbol, self.extend({'paginate': True, 'paginationCalls':
|
7707
|
+
data = await self.get_leverage_tiers_paginated(symbol, self.extend({'paginate': True, 'paginationCalls': 40}, params))
|
7709
7708
|
symbols = self.market_symbols(symbols)
|
7710
7709
|
return self.parse_leverage_tiers(data, symbols, 'symbol')
|
7711
7710
|
|
ccxt/async_support/cex.py
CHANGED
@@ -1238,7 +1238,7 @@ class cex(Exchange, ImplicitAPI):
|
|
1238
1238
|
:param int [limit]: max number of ledger entries to return
|
1239
1239
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1240
1240
|
:param int [params.until]: timestamp in ms of the latest ledger entry
|
1241
|
-
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger
|
1241
|
+
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger>`
|
1242
1242
|
"""
|
1243
1243
|
await self.load_markets()
|
1244
1244
|
currency = None
|
ccxt/async_support/coinbase.py
CHANGED
@@ -385,6 +385,82 @@ class coinbase(Exchange, ImplicitAPI):
|
|
385
385
|
'fetchTime': 'v2PublicGetTime', # 'v2PublicGetTime' or 'v3PublicGetBrokerageTime'
|
386
386
|
'user_native_currency': 'USD', # needed to get fees for v3
|
387
387
|
},
|
388
|
+
'features': {
|
389
|
+
'spot': {
|
390
|
+
'sandbox': False,
|
391
|
+
'createOrder': {
|
392
|
+
'marginMode': True,
|
393
|
+
'triggerPrice': True,
|
394
|
+
'triggerPriceType': None,
|
395
|
+
'triggerDirection': True,
|
396
|
+
'stopLossPrice': True,
|
397
|
+
'takeProfitPrice': True,
|
398
|
+
'attachedStopLossTakeProfit': None,
|
399
|
+
'timeInForce': {
|
400
|
+
'IOC': True,
|
401
|
+
'FOK': True,
|
402
|
+
'PO': True,
|
403
|
+
'GTD': True,
|
404
|
+
},
|
405
|
+
'hedged': False,
|
406
|
+
'trailing': False,
|
407
|
+
},
|
408
|
+
'createOrders': None,
|
409
|
+
'fetchMyTrades': {
|
410
|
+
'marginMode': False,
|
411
|
+
'limit': 3000,
|
412
|
+
'daysBack': None,
|
413
|
+
'untilDays': 10000,
|
414
|
+
},
|
415
|
+
'fetchOrder': {
|
416
|
+
'marginMode': False,
|
417
|
+
'trigger': False,
|
418
|
+
'trailing': False,
|
419
|
+
},
|
420
|
+
'fetchOpenOrders': {
|
421
|
+
'marginMode': False,
|
422
|
+
'limit': None,
|
423
|
+
'trigger': False,
|
424
|
+
'trailing': False,
|
425
|
+
},
|
426
|
+
'fetchOrders': {
|
427
|
+
'marginMode': False,
|
428
|
+
'limit': None,
|
429
|
+
'daysBack': None,
|
430
|
+
'untilDays': 10000,
|
431
|
+
'trigger': False,
|
432
|
+
'trailing': False,
|
433
|
+
},
|
434
|
+
'fetchClosedOrders': {
|
435
|
+
'marginMode': False,
|
436
|
+
'limit': None,
|
437
|
+
'daysBackClosed': None,
|
438
|
+
'daysBackCanceled': None,
|
439
|
+
'untilDays': 10000,
|
440
|
+
'trigger': False,
|
441
|
+
'trailing': False,
|
442
|
+
},
|
443
|
+
'fetchOHLCV': {
|
444
|
+
'limit': 350,
|
445
|
+
},
|
446
|
+
},
|
447
|
+
'swap': {
|
448
|
+
'linear': {
|
449
|
+
'extends': 'spot',
|
450
|
+
},
|
451
|
+
'inverse': {
|
452
|
+
'extends': 'spot',
|
453
|
+
},
|
454
|
+
},
|
455
|
+
'future': {
|
456
|
+
'linear': {
|
457
|
+
'extends': 'spot',
|
458
|
+
},
|
459
|
+
'inverse': {
|
460
|
+
'extends': 'spot',
|
461
|
+
},
|
462
|
+
},
|
463
|
+
},
|
388
464
|
})
|
389
465
|
|
390
466
|
async def fetch_time(self, params={}):
|
@@ -2289,7 +2365,7 @@ class coinbase(Exchange, ImplicitAPI):
|
|
2289
2365
|
:param int [limit]: max number of ledger entries to return, default is None
|
2290
2366
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2291
2367
|
: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)
|
2292
|
-
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger
|
2368
|
+
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger>`
|
2293
2369
|
"""
|
2294
2370
|
await self.load_markets()
|
2295
2371
|
paginate = False
|
@@ -1449,7 +1449,7 @@ class coinbaseexchange(Exchange, ImplicitAPI):
|
|
1449
1449
|
:param int [limit]: max number of ledger entries to return, default is None
|
1450
1450
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1451
1451
|
:param int [params.until]: the latest time in ms to fetch trades for
|
1452
|
-
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger
|
1452
|
+
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger>`
|
1453
1453
|
"""
|
1454
1454
|
# https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getaccountledger
|
1455
1455
|
if code is None:
|
@@ -264,6 +264,68 @@ class coinbaseinternational(Exchange, ImplicitAPI):
|
|
264
264
|
'bitcoin': 'BTC',
|
265
265
|
},
|
266
266
|
},
|
267
|
+
'features': {
|
268
|
+
'spot': {
|
269
|
+
'sandbox': True,
|
270
|
+
'createOrder': {
|
271
|
+
'marginMode': False,
|
272
|
+
'triggerPrice': True,
|
273
|
+
'triggerPriceType': None,
|
274
|
+
'triggerDirection': True,
|
275
|
+
'stopLossPrice': False, # todo implementation
|
276
|
+
'takeProfitPrice': False, # todo implementation
|
277
|
+
'attachedStopLossTakeProfit': None,
|
278
|
+
'timeInForce': {
|
279
|
+
'IOC': True,
|
280
|
+
'FOK': True,
|
281
|
+
'PO': True,
|
282
|
+
'GTD': True,
|
283
|
+
'GTC': True, # has 30 days max
|
284
|
+
},
|
285
|
+
'hedged': False,
|
286
|
+
'trailing': False,
|
287
|
+
},
|
288
|
+
'createOrders': None,
|
289
|
+
'fetchMyTrades': {
|
290
|
+
'marginMode': False,
|
291
|
+
'limit': 100,
|
292
|
+
'daysBack': None,
|
293
|
+
'untilDays': 10000,
|
294
|
+
},
|
295
|
+
'fetchOrder': {
|
296
|
+
'marginMode': False,
|
297
|
+
'trigger': False,
|
298
|
+
'trailing': False,
|
299
|
+
},
|
300
|
+
'fetchOpenOrders': {
|
301
|
+
'marginMode': False,
|
302
|
+
'limit': 100,
|
303
|
+
'trigger': False,
|
304
|
+
'trailing': False,
|
305
|
+
},
|
306
|
+
'fetchOrders': None,
|
307
|
+
'fetchClosedOrders': None,
|
308
|
+
'fetchOHLCV': {
|
309
|
+
'limit': 300,
|
310
|
+
},
|
311
|
+
},
|
312
|
+
'swap': {
|
313
|
+
'linear': {
|
314
|
+
'extends': 'spot',
|
315
|
+
},
|
316
|
+
'inverse': {
|
317
|
+
'extends': 'spot',
|
318
|
+
},
|
319
|
+
},
|
320
|
+
'future': {
|
321
|
+
'linear': {
|
322
|
+
'extends': 'spot',
|
323
|
+
},
|
324
|
+
'inverse': {
|
325
|
+
'extends': 'spot',
|
326
|
+
},
|
327
|
+
},
|
328
|
+
},
|
267
329
|
})
|
268
330
|
|
269
331
|
async def handle_portfolio_and_params(self, methodName: str, params={}):
|
ccxt/async_support/coincatch.py
CHANGED
@@ -4783,7 +4783,7 @@ class coincatch(Exchange, ImplicitAPI):
|
|
4783
4783
|
:param str [params.business]: *swap only*
|
4784
4784
|
:param str [params.lastEndId]: *swap only*
|
4785
4785
|
:param bool [params.next]: *swap only*
|
4786
|
-
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger
|
4786
|
+
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger>`
|
4787
4787
|
"""
|
4788
4788
|
methodName = 'fetchLedger'
|
4789
4789
|
await self.load_markets()
|
ccxt/async_support/coinex.py
CHANGED
@@ -2543,18 +2543,18 @@ class coinex(Exchange, ImplicitAPI):
|
|
2543
2543
|
request: dict = {
|
2544
2544
|
'market': market['id'],
|
2545
2545
|
}
|
2546
|
-
|
2546
|
+
trigger = self.safe_bool_2(params, 'stop', 'trigger')
|
2547
2547
|
params = self.omit(params, ['stop', 'trigger'])
|
2548
2548
|
response = None
|
2549
2549
|
requestIds = []
|
2550
2550
|
for i in range(0, len(ids)):
|
2551
2551
|
requestIds.append(int(ids[i]))
|
2552
|
-
if
|
2552
|
+
if trigger:
|
2553
2553
|
request['stop_ids'] = requestIds
|
2554
2554
|
else:
|
2555
2555
|
request['order_ids'] = requestIds
|
2556
2556
|
if market['spot']:
|
2557
|
-
if
|
2557
|
+
if trigger:
|
2558
2558
|
response = await self.v2PrivatePostSpotCancelBatchStopOrder(self.extend(request, params))
|
2559
2559
|
#
|
2560
2560
|
# {
|
@@ -2623,7 +2623,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
2623
2623
|
#
|
2624
2624
|
else:
|
2625
2625
|
request['market_type'] = 'FUTURES'
|
2626
|
-
if
|
2626
|
+
if trigger:
|
2627
2627
|
response = await self.v2PrivatePostFuturesCancelBatchStopOrder(self.extend(request, params))
|
2628
2628
|
#
|
2629
2629
|
# {
|
@@ -3271,7 +3271,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
3271
3271
|
request['market'] = market['id']
|
3272
3272
|
if limit is not None:
|
3273
3273
|
request['limit'] = limit
|
3274
|
-
|
3274
|
+
trigger = self.safe_bool_2(params, 'stop', 'trigger')
|
3275
3275
|
params = self.omit(params, ['stop', 'trigger'])
|
3276
3276
|
marketType = None
|
3277
3277
|
marketType, params = self.handle_market_type_and_params('fetchOrdersByStatus', market, params)
|
@@ -3281,7 +3281,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
3281
3281
|
if marketType == 'swap':
|
3282
3282
|
request['market_type'] = 'FUTURES'
|
3283
3283
|
if isClosed:
|
3284
|
-
if
|
3284
|
+
if trigger:
|
3285
3285
|
response = await self.v2PrivateGetFuturesFinishedStopOrder(self.extend(request, params))
|
3286
3286
|
#
|
3287
3287
|
# {
|
@@ -3342,7 +3342,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
3342
3342
|
# }
|
3343
3343
|
#
|
3344
3344
|
elif isOpen:
|
3345
|
-
if
|
3345
|
+
if trigger:
|
3346
3346
|
response = await self.v2PrivateGetFuturesPendingStopOrder(self.extend(request, params))
|
3347
3347
|
#
|
3348
3348
|
# {
|
@@ -3415,7 +3415,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
3415
3415
|
else:
|
3416
3416
|
request['market_type'] = 'SPOT'
|
3417
3417
|
if isClosed:
|
3418
|
-
if
|
3418
|
+
if trigger:
|
3419
3419
|
response = await self.v2PrivateGetSpotFinishedStopOrder(self.extend(request, params))
|
3420
3420
|
#
|
3421
3421
|
# {
|
@@ -3479,7 +3479,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
3479
3479
|
# }
|
3480
3480
|
#
|
3481
3481
|
elif status == 'pending':
|
3482
|
-
if
|
3482
|
+
if trigger:
|
3483
3483
|
response = await self.v2PrivateGetSpotPendingStopOrder(self.extend(request, params))
|
3484
3484
|
#
|
3485
3485
|
# {
|
ccxt/async_support/coinlist.py
CHANGED
@@ -2046,7 +2046,7 @@ class coinlist(Exchange, ImplicitAPI):
|
|
2046
2046
|
:param int [limit]: max number of ledger entries to return(default 200, max 500)
|
2047
2047
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2048
2048
|
:param int [params.until]: the latest time in ms to fetch entries for
|
2049
|
-
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger
|
2049
|
+
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger>`
|
2050
2050
|
"""
|
2051
2051
|
traderId = self.safe_string_2(params, 'trader_id', 'traderId')
|
2052
2052
|
if traderId is None:
|
ccxt/async_support/coinmetro.py
CHANGED
@@ -977,7 +977,7 @@ class coinmetro(Exchange, ImplicitAPI):
|
|
977
977
|
:param int [limit]: max number of ledger entries to return(default 200, max 500)
|
978
978
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
979
979
|
:param int [params.until]: the latest time in ms to fetch entries for
|
980
|
-
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger
|
980
|
+
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger>`
|
981
981
|
"""
|
982
982
|
await self.load_markets()
|
983
983
|
request: dict = {}
|