ccxt 4.4.71__py2.py3-none-any.whl → 4.4.73__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 -3
- ccxt/abstract/bingx.py +1 -1
- ccxt/ace.py +36 -1
- ccxt/alpaca.py +46 -0
- ccxt/ascendex.py +2 -2
- ccxt/async_support/__init__.py +1 -3
- ccxt/async_support/ace.py +36 -1
- ccxt/async_support/alpaca.py +46 -0
- ccxt/async_support/ascendex.py +2 -2
- ccxt/async_support/base/exchange.py +1 -1
- ccxt/async_support/binance.py +19 -15
- ccxt/async_support/bingx.py +2 -2
- ccxt/async_support/bit2c.py +11 -0
- ccxt/async_support/bitfinex.py +1 -1
- ccxt/async_support/bitfinex1.py +1 -1
- ccxt/async_support/bitget.py +6 -5
- ccxt/async_support/bitrue.py +1 -1
- ccxt/async_support/bl3p.py +2 -2
- ccxt/async_support/bybit.py +32 -25
- ccxt/async_support/cex.py +1 -0
- ccxt/async_support/coinbase.py +3 -2
- ccxt/async_support/coinbaseexchange.py +3 -2
- ccxt/async_support/coinbaseinternational.py +3 -2
- ccxt/async_support/coinex.py +1 -1
- ccxt/async_support/defx.py +1 -1
- ccxt/async_support/deribit.py +2 -1
- ccxt/async_support/derive.py +13 -7
- ccxt/async_support/gate.py +3 -0
- ccxt/async_support/gemini.py +2 -1
- ccxt/async_support/hitbtc.py +1 -1
- ccxt/async_support/hyperliquid.py +38 -0
- ccxt/async_support/kraken.py +1 -1
- ccxt/async_support/krakenfutures.py +4 -0
- ccxt/async_support/kucoin.py +1 -1
- ccxt/async_support/kuna.py +1 -1
- ccxt/async_support/mexc.py +1 -1
- ccxt/async_support/ndax.py +1 -1
- ccxt/async_support/okcoin.py +4 -0
- ccxt/async_support/okx.py +21 -30
- ccxt/async_support/paradex.py +65 -7
- ccxt/async_support/paymium.py +1 -1
- ccxt/async_support/poloniex.py +2 -1
- ccxt/async_support/upbit.py +1 -1
- ccxt/async_support/whitebit.py +98 -2
- ccxt/async_support/woo.py +3 -1
- ccxt/async_support/woofipro.py +1 -1
- ccxt/async_support/yobit.py +2 -1
- ccxt/base/errors.py +6 -0
- ccxt/base/exchange.py +13 -12
- ccxt/binance.py +19 -15
- ccxt/bingx.py +2 -2
- ccxt/bit2c.py +11 -0
- ccxt/bitfinex.py +1 -1
- ccxt/bitfinex1.py +1 -1
- ccxt/bitget.py +6 -5
- ccxt/bitrue.py +1 -1
- ccxt/bl3p.py +2 -2
- ccxt/bybit.py +32 -25
- ccxt/cex.py +1 -0
- ccxt/coinbase.py +3 -2
- ccxt/coinbaseexchange.py +3 -2
- ccxt/coinbaseinternational.py +3 -2
- ccxt/coinex.py +1 -1
- ccxt/defx.py +1 -1
- ccxt/deribit.py +2 -1
- ccxt/derive.py +13 -7
- ccxt/gate.py +3 -0
- ccxt/gemini.py +2 -1
- ccxt/hitbtc.py +1 -1
- ccxt/hyperliquid.py +38 -0
- ccxt/kraken.py +1 -1
- ccxt/krakenfutures.py +4 -0
- ccxt/kucoin.py +1 -1
- ccxt/kuna.py +1 -1
- ccxt/mexc.py +1 -1
- ccxt/ndax.py +1 -1
- ccxt/okcoin.py +4 -0
- ccxt/okx.py +21 -30
- ccxt/paradex.py +65 -7
- ccxt/paymium.py +1 -1
- ccxt/poloniex.py +2 -1
- ccxt/pro/__init__.py +1 -3
- ccxt/pro/bingx.py +1 -1
- ccxt/pro/bitmart.py +15 -7
- ccxt/pro/derive.py +2 -2
- ccxt/pro/krakenfutures.py +1 -1
- ccxt/test/tests_async.py +6 -3
- ccxt/test/tests_sync.py +6 -3
- ccxt/upbit.py +1 -1
- ccxt/whitebit.py +98 -2
- ccxt/woo.py +3 -1
- ccxt/woofipro.py +1 -1
- ccxt/yobit.py +2 -1
- {ccxt-4.4.71.dist-info → ccxt-4.4.73.dist-info}/METADATA +5 -5
- {ccxt-4.4.71.dist-info → ccxt-4.4.73.dist-info}/RECORD +98 -99
- ccxt/abstract/bitfinex1.py +0 -69
- {ccxt-4.4.71.dist-info → ccxt-4.4.73.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.4.71.dist-info → ccxt-4.4.73.dist-info}/WHEEL +0 -0
- {ccxt-4.4.71.dist-info → ccxt-4.4.73.dist-info}/top_level.txt +0 -0
ccxt/binance.py
CHANGED
@@ -1317,12 +1317,13 @@ class binance(Exchange, ImplicitAPI):
|
|
1317
1317
|
},
|
1318
1318
|
'quoteOrderQty': True, # whether market orders support amounts in quote currency
|
1319
1319
|
'broker': {
|
1320
|
-
'spot': 'x-
|
1321
|
-
'margin': 'x-
|
1322
|
-
'future': 'x-
|
1320
|
+
'spot': 'x-TKT5PX2F',
|
1321
|
+
'margin': 'x-TKT5PX2F',
|
1322
|
+
'future': 'x-cvBPrNm9',
|
1323
1323
|
'delivery': 'x-xcKtGhcu',
|
1324
|
-
'swap': 'x-
|
1324
|
+
'swap': 'x-cvBPrNm9',
|
1325
1325
|
'option': 'x-xcKtGhcu',
|
1326
|
+
'inverse': 'x-xcKtGhcu',
|
1326
1327
|
},
|
1327
1328
|
'accountsByType': {
|
1328
1329
|
'main': 'MAIN',
|
@@ -4085,7 +4086,7 @@ class binance(Exchange, ImplicitAPI):
|
|
4085
4086
|
# "symbol": "BTCUSDT",
|
4086
4087
|
# "markPrice": "11793.63104562", # mark price
|
4087
4088
|
# "indexPrice": "11781.80495970", # index price
|
4088
|
-
# "estimatedSettlePrice": "11781.16138815", # Estimated Settle Price, only useful in the last hour before the settlement starts
|
4089
|
+
# "estimatedSettlePrice": "11781.16138815", # Estimated Settle Price, only useful in the last hour before the settlement starts
|
4089
4090
|
# "lastFundingRate": "0.00038246", # This is the lastest estimated funding rate
|
4090
4091
|
# "nextFundingTime": 1597392000000,
|
4091
4092
|
# "interestRate": "0.00010000",
|
@@ -5161,7 +5162,7 @@ class binance(Exchange, ImplicitAPI):
|
|
5161
5162
|
# "symbol": "BTCUSDT",
|
5162
5163
|
# "orderId": 16383176297,
|
5163
5164
|
# "orderListId": -1,
|
5164
|
-
# "clientOrderId": "x-
|
5165
|
+
# "clientOrderId": "x-TKT5PX2F22ecb58eb9074fb1be018c",
|
5165
5166
|
# "transactTime": 1670891847932,
|
5166
5167
|
# "price": "13500.00000000",
|
5167
5168
|
# "origQty": "0.00085000",
|
@@ -5517,7 +5518,7 @@ class binance(Exchange, ImplicitAPI):
|
|
5517
5518
|
# "symbol": "BTCUSDT",
|
5518
5519
|
# "orderId": 16383176297,
|
5519
5520
|
# "orderListId": -1,
|
5520
|
-
# "clientOrderId": "x-
|
5521
|
+
# "clientOrderId": "x-TKT5PX2F22ecb58eb9074fb1be018c",
|
5521
5522
|
# "transactTime": 1670891847932,
|
5522
5523
|
# "price": "13500.00000000",
|
5523
5524
|
# "origQty": "0.00085000",
|
@@ -5580,7 +5581,7 @@ class binance(Exchange, ImplicitAPI):
|
|
5580
5581
|
# "symbol": "BTCUSDT",
|
5581
5582
|
# "orderId": 5403233939,
|
5582
5583
|
# "orderListId": -1,
|
5583
|
-
# "clientOrderId": "x-
|
5584
|
+
# "clientOrderId": "x-TKT5PX2F5e669e75b6c14f69a2c43e",
|
5584
5585
|
# "transactTime": 1617151923742,
|
5585
5586
|
# "price": "0.00000000",
|
5586
5587
|
# "origQty": "0.00050000",
|
@@ -5755,7 +5756,7 @@ class binance(Exchange, ImplicitAPI):
|
|
5755
5756
|
# createOrder, cancelAllOrders, cancelOrder: portfolio margin spot margin
|
5756
5757
|
#
|
5757
5758
|
# {
|
5758
|
-
# "clientOrderId": "x-
|
5759
|
+
# "clientOrderId": "x-TKT5PX2Fe9ef29d8346440f0b28b86",
|
5759
5760
|
# "cummulativeQuoteQty": "0.00000000",
|
5760
5761
|
# "executedQty": "0.00000000",
|
5761
5762
|
# "fills": [],
|
@@ -5776,7 +5777,7 @@ class binance(Exchange, ImplicitAPI):
|
|
5776
5777
|
# {
|
5777
5778
|
# "symbol": "BTCUSDT",
|
5778
5779
|
# "orderId": 24700763749,
|
5779
|
-
# "clientOrderId": "x-
|
5780
|
+
# "clientOrderId": "x-TKT5PX2F6f724c2a4af6425f98c7b6",
|
5780
5781
|
# "price": "35000.00000000",
|
5781
5782
|
# "origQty": "0.00100000",
|
5782
5783
|
# "executedQty": "0.00000000",
|
@@ -6315,8 +6316,11 @@ class binance(Exchange, ImplicitAPI):
|
|
6315
6316
|
clientOrderIdRequest = 'newClientStrategyId' if isPortfolioMarginConditional else 'newClientOrderId'
|
6316
6317
|
if clientOrderId is None:
|
6317
6318
|
broker = self.safe_dict(self.options, 'broker', {})
|
6318
|
-
defaultId = 'x-xcKtGhcu' if (market['contract']) else 'x-
|
6319
|
-
|
6319
|
+
defaultId = 'x-xcKtGhcu' if (market['contract']) else 'x-TKT5PX2F'
|
6320
|
+
idMarketType = 'spot'
|
6321
|
+
if market['contract']:
|
6322
|
+
idMarketType = 'swap' if (market['swap'] and market['linear']) else 'inverse'
|
6323
|
+
brokerId = self.safe_string(broker, idMarketType, defaultId)
|
6320
6324
|
request[clientOrderIdRequest] = brokerId + self.uuid22()
|
6321
6325
|
else:
|
6322
6326
|
request[clientOrderIdRequest] = clientOrderId
|
@@ -6835,7 +6839,7 @@ class binance(Exchange, ImplicitAPI):
|
|
6835
6839
|
# {
|
6836
6840
|
# "symbol": "BTCUSDT",
|
6837
6841
|
# "orderId": 24684460474,
|
6838
|
-
# "clientOrderId": "x-
|
6842
|
+
# "clientOrderId": "x-TKT5PX2Fe9ef29d8346440f0b28b86",
|
6839
6843
|
# "price": "35000.00000000",
|
6840
6844
|
# "origQty": "0.00100000",
|
6841
6845
|
# "executedQty": "0.00000000",
|
@@ -7448,7 +7452,7 @@ class binance(Exchange, ImplicitAPI):
|
|
7448
7452
|
# [
|
7449
7453
|
# {
|
7450
7454
|
# "symbol": "ADAUSDT",
|
7451
|
-
# "origClientOrderId": "x-
|
7455
|
+
# "origClientOrderId": "x-TKT5PX2F662cde7a90114475b86e21",
|
7452
7456
|
# "orderId": 3935107,
|
7453
7457
|
# "orderListId": -1,
|
7454
7458
|
# "clientOrderId": "bqM2w1oTlugfRAjnTIFBE8",
|
@@ -11323,7 +11327,7 @@ class binance(Exchange, ImplicitAPI):
|
|
11323
11327
|
if newClientOrderId is None:
|
11324
11328
|
isSpotOrMargin = (api.find('sapi') > -1 or api == 'private')
|
11325
11329
|
marketType = 'spot' if isSpotOrMargin else 'future'
|
11326
|
-
defaultId = 'x-xcKtGhcu' if (not isSpotOrMargin) else 'x-
|
11330
|
+
defaultId = 'x-xcKtGhcu' if (not isSpotOrMargin) else 'x-TKT5PX2F'
|
11327
11331
|
broker = self.safe_dict(self.options, 'broker', {})
|
11328
11332
|
brokerId = self.safe_string(broker, marketType, defaultId)
|
11329
11333
|
params['newClientOrderId'] = brokerId + self.uuid22()
|
ccxt/bingx.py
CHANGED
@@ -175,7 +175,6 @@ class bingx(Exchange, ImplicitAPI):
|
|
175
175
|
'trade/myTrades': 2,
|
176
176
|
'user/commissionRate': 5,
|
177
177
|
'account/balance': 2,
|
178
|
-
'account/allAccountBalance': 2,
|
179
178
|
},
|
180
179
|
'post': {
|
181
180
|
'trade/order': 2,
|
@@ -402,6 +401,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
402
401
|
'uid': 1,
|
403
402
|
'apiKey/query': 2,
|
404
403
|
'account/apiPermissions': 5,
|
404
|
+
'allAccountBalance': 2,
|
405
405
|
},
|
406
406
|
'post': {
|
407
407
|
'innerTransfer/authorizeSubAccount': 1,
|
@@ -831,7 +831,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
831
831
|
# {
|
832
832
|
# "symbol": "GEAR-USDT",
|
833
833
|
# "minQty": 735, # deprecated
|
834
|
-
# "maxQty": 2941177, # deprecated
|
834
|
+
# "maxQty": 2941177, # deprecated.
|
835
835
|
# "minNotional": 5,
|
836
836
|
# "maxNotional": 20000,
|
837
837
|
# "status": 1,
|
ccxt/bit2c.py
CHANGED
@@ -62,23 +62,34 @@ class bit2c(Exchange, ImplicitAPI):
|
|
62
62
|
'fetchMarginMode': False,
|
63
63
|
'fetchMarkOHLCV': False,
|
64
64
|
'fetchMyTrades': True,
|
65
|
+
'fetchOpenInterest': False,
|
65
66
|
'fetchOpenInterestHistory': False,
|
67
|
+
'fetchOpenInterests': False,
|
66
68
|
'fetchOpenOrders': True,
|
67
69
|
'fetchOrder': True,
|
68
70
|
'fetchOrderBook': True,
|
69
71
|
'fetchPosition': False,
|
72
|
+
'fetchPositionHistory': False,
|
70
73
|
'fetchPositionMode': False,
|
71
74
|
'fetchPositions': False,
|
75
|
+
'fetchPositionsForSymbol': False,
|
76
|
+
'fetchPositionsHistory': False,
|
72
77
|
'fetchPositionsRisk': False,
|
73
78
|
'fetchPremiumIndexOHLCV': False,
|
79
|
+
'fetchSettlementHistory': False,
|
74
80
|
'fetchTicker': True,
|
75
81
|
'fetchTrades': True,
|
76
82
|
'fetchTradingFee': False,
|
77
83
|
'fetchTradingFees': True,
|
78
84
|
'fetchTransfer': False,
|
79
85
|
'fetchTransfers': False,
|
86
|
+
'fetchUnderlyingAssets': False,
|
80
87
|
'reduceMargin': False,
|
88
|
+
'repayCrossMargin': False,
|
89
|
+
'repayIsolatedMargin': False,
|
90
|
+
'repayMargin': False,
|
81
91
|
'setLeverage': False,
|
92
|
+
'setMargin': False,
|
82
93
|
'setMarginMode': False,
|
83
94
|
'setPositionMode': False,
|
84
95
|
'transfer': False,
|
ccxt/bitfinex.py
CHANGED
@@ -2202,7 +2202,7 @@ class bitfinex(Exchange, ImplicitAPI):
|
|
2202
2202
|
tradesList.append({'result': response[i]}) # convert to array of dicts to match parseOrder signature
|
2203
2203
|
return self.parse_trades(tradesList, market, since, limit)
|
2204
2204
|
|
2205
|
-
def create_deposit_address(self, code: str, params={}):
|
2205
|
+
def create_deposit_address(self, code: str, params={}) -> DepositAddress:
|
2206
2206
|
"""
|
2207
2207
|
create a currency deposit address
|
2208
2208
|
|
ccxt/bitfinex1.py
CHANGED
@@ -1394,7 +1394,7 @@ class bitfinex1(Exchange, ImplicitAPI):
|
|
1394
1394
|
return self.options['currencyNames'][code]
|
1395
1395
|
raise NotSupported(self.id + ' ' + code + ' not supported for withdrawal')
|
1396
1396
|
|
1397
|
-
def create_deposit_address(self, code: str, params={}):
|
1397
|
+
def create_deposit_address(self, code: str, params={}) -> DepositAddress:
|
1398
1398
|
"""
|
1399
1399
|
create a currency deposit address
|
1400
1400
|
|
ccxt/bitget.py
CHANGED
@@ -1917,7 +1917,7 @@ class bitget(Exchange, ImplicitAPI):
|
|
1917
1917
|
priceDecimals = self.safe_integer(market, 'pricePlace')
|
1918
1918
|
amountDecimals = self.safe_integer(market, 'volumePlace')
|
1919
1919
|
priceStep = self.safe_string(market, 'priceEndStep')
|
1920
|
-
amountStep = self.safe_string(market, '
|
1920
|
+
amountStep = self.safe_string(market, 'sizeMultiplier')
|
1921
1921
|
precise = Precise(priceStep)
|
1922
1922
|
precise.decimals = max(precise.decimals, priceDecimals)
|
1923
1923
|
precise.reduce()
|
@@ -2416,16 +2416,17 @@ class bitget(Exchange, ImplicitAPI):
|
|
2416
2416
|
paginate, params = self.handle_option_and_params(params, 'fetchWithdrawals', 'paginate')
|
2417
2417
|
if paginate:
|
2418
2418
|
return self.fetch_paginated_call_cursor('fetchWithdrawals', None, since, limit, params, 'idLessThan', 'idLessThan', None, 100)
|
2419
|
-
|
2420
|
-
|
2421
|
-
|
2419
|
+
currency = None
|
2420
|
+
if code is not None:
|
2421
|
+
currency = self.currency(code)
|
2422
2422
|
if since is None:
|
2423
2423
|
since = self.milliseconds() - 7776000000 # 90 days
|
2424
2424
|
request: dict = {
|
2425
|
-
'coin': currency['id'],
|
2426
2425
|
'startTime': since,
|
2427
2426
|
'endTime': self.milliseconds(),
|
2428
2427
|
}
|
2428
|
+
if currency is not None:
|
2429
|
+
request['coin'] = currency['id']
|
2429
2430
|
request, params = self.handle_until_option('endTime', request, params)
|
2430
2431
|
if limit is not None:
|
2431
2432
|
request['limit'] = limit
|
ccxt/bitrue.py
CHANGED
@@ -1229,7 +1229,7 @@ class bitrue(Exchange, ImplicitAPI):
|
|
1229
1229
|
# "time": 1699338305000
|
1230
1230
|
# }
|
1231
1231
|
#
|
1232
|
-
timestamp = self.
|
1232
|
+
timestamp = self.safe_integer_2(response, 'time', 'lastUpdateId')
|
1233
1233
|
orderbook = self.parse_order_book(response, symbol, timestamp)
|
1234
1234
|
orderbook['nonce'] = self.safe_integer(response, 'lastUpdateId')
|
1235
1235
|
return orderbook
|
ccxt/bl3p.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.bl3p import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Any, Balances, Currency, IndexType, Int, Market, Num, OrderBook, OrderSide, OrderType, Str, Ticker, Trade, TradingFees
|
9
|
+
from ccxt.base.types import Any, Balances, Currency, DepositAddress, IndexType, Int, Market, Num, OrderBook, OrderSide, OrderType, Str, Ticker, Trade, TradingFees
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.decimal_to_precision import TICK_SIZE
|
12
12
|
from ccxt.base.precise import Precise
|
@@ -477,7 +477,7 @@ class bl3p(Exchange, ImplicitAPI):
|
|
477
477
|
'info': response,
|
478
478
|
})
|
479
479
|
|
480
|
-
def create_deposit_address(self, code: str, params={}):
|
480
|
+
def create_deposit_address(self, code: str, params={}) -> DepositAddress:
|
481
481
|
"""
|
482
482
|
create a currency deposit address
|
483
483
|
|
ccxt/bybit.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.bybit import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Any, Balances, BorrowInterest, Conversion, CrossBorrowRate, Currencies, Currency, DepositAddress, Greeks, Int, LedgerEntry, Leverage, LeverageTier, LeverageTiers, LongShortRatio, Market, Num, Option, OptionChain, Order, OrderBook, OrderRequest, CancellationRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade, TradingFeeInterface, TradingFees, Transaction, MarketInterface, TransferEntry
|
9
|
+
from ccxt.base.types import Any, Balances, BorrowInterest, Conversion, CrossBorrowRate, Currencies, Currency, DepositAddress, FundingHistory, Greeks, Int, LedgerEntry, Leverage, LeverageTier, LeverageTiers, Liquidation, LongShortRatio, Market, Num, Option, OptionChain, Order, OrderBook, OrderRequest, CancellationRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade, TradingFeeInterface, TradingFees, Transaction, MarketInterface, TransferEntry
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
12
|
from ccxt.base.errors import AuthenticationError
|
@@ -2475,7 +2475,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
2475
2475
|
tickerList = self.safe_list(result, 'list', [])
|
2476
2476
|
return self.parse_tickers(tickerList, parsedSymbols)
|
2477
2477
|
|
2478
|
-
def fetch_bids_asks(self, symbols: Strings = None, params={}):
|
2478
|
+
def fetch_bids_asks(self, symbols: Strings = None, params={}) -> Tickers:
|
2479
2479
|
"""
|
2480
2480
|
fetches the bid and ask price and volume for multiple markets
|
2481
2481
|
|
@@ -3689,7 +3689,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
3689
3689
|
'trades': None,
|
3690
3690
|
}, market)
|
3691
3691
|
|
3692
|
-
def create_market_buy_order_with_cost(self, symbol: str, cost: float, params={}):
|
3692
|
+
def create_market_buy_order_with_cost(self, symbol: str, cost: float, params={}) -> Order:
|
3693
3693
|
"""
|
3694
3694
|
create a market buy order by providing the symbol and cost
|
3695
3695
|
|
@@ -3706,7 +3706,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
3706
3706
|
raise NotSupported(self.id + ' createMarketBuyOrderWithCost() supports spot orders only')
|
3707
3707
|
return self.create_order(symbol, 'market', 'buy', cost, 1, params)
|
3708
3708
|
|
3709
|
-
def create_market_sell_order_with_cost(self, symbol: str, cost: float, params={}):
|
3709
|
+
def create_market_sell_order_with_cost(self, symbol: str, cost: float, params={}) -> Order:
|
3710
3710
|
"""
|
3711
3711
|
create a market sell order by providing the symbol and cost
|
3712
3712
|
|
@@ -3727,7 +3727,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
3727
3727
|
raise NotSupported(self.id + ' createMarketSellOrderWithCost() supports spot orders only')
|
3728
3728
|
return self.create_order(symbol, 'market', 'sell', cost, 1, params)
|
3729
3729
|
|
3730
|
-
def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
|
3730
|
+
def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}) -> Order:
|
3731
3731
|
"""
|
3732
3732
|
create a trade order
|
3733
3733
|
|
@@ -3986,7 +3986,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
3986
3986
|
params = self.omit(params, ['stopPrice', 'timeInForce', 'stopLossPrice', 'takeProfitPrice', 'postOnly', 'clientOrderId', 'triggerPrice', 'stopLoss', 'takeProfit', 'trailingAmount', 'trailingTriggerPrice', 'hedged'])
|
3987
3987
|
return self.extend(request, params)
|
3988
3988
|
|
3989
|
-
def create_orders(self, orders: List[OrderRequest], params={}):
|
3989
|
+
def create_orders(self, orders: List[OrderRequest], params={}) -> List[Order]:
|
3990
3990
|
"""
|
3991
3991
|
create a list of trade orders
|
3992
3992
|
|
@@ -4136,7 +4136,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
4136
4136
|
params = self.omit(params, ['stopPrice', 'stopLossPrice', 'takeProfitPrice', 'triggerPrice', 'clientOrderId', 'stopLoss', 'takeProfit'])
|
4137
4137
|
return request
|
4138
4138
|
|
4139
|
-
def edit_order(self, id: str, symbol: str, type: OrderType, side: OrderSide, amount: Num = None, price: Num = None, params={}):
|
4139
|
+
def edit_order(self, id: str, symbol: str, type: OrderType, side: OrderSide, amount: Num = None, price: Num = None, params={}) -> Order:
|
4140
4140
|
"""
|
4141
4141
|
edit a trade order
|
4142
4142
|
|
@@ -4186,7 +4186,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
4186
4186
|
'id': self.safe_string(result, 'orderId'),
|
4187
4187
|
})
|
4188
4188
|
|
4189
|
-
def edit_orders(self, orders: List[OrderRequest], params={}):
|
4189
|
+
def edit_orders(self, orders: List[OrderRequest], params={}) -> List[Order]:
|
4190
4190
|
"""
|
4191
4191
|
edit a list of trade orders
|
4192
4192
|
|
@@ -4297,7 +4297,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
4297
4297
|
request['category'] = 'option'
|
4298
4298
|
return self.extend(request, params)
|
4299
4299
|
|
4300
|
-
def cancel_order(self, id: str, symbol: Str = None, params={}):
|
4300
|
+
def cancel_order(self, id: str, symbol: Str = None, params={}) -> Order:
|
4301
4301
|
"""
|
4302
4302
|
cancels an open order
|
4303
4303
|
|
@@ -4332,7 +4332,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
4332
4332
|
result = self.safe_dict(response, 'result', {})
|
4333
4333
|
return self.parse_order(result, market)
|
4334
4334
|
|
4335
|
-
def cancel_orders(self, ids, symbol: Str = None, params={}):
|
4335
|
+
def cancel_orders(self, ids, symbol: Str = None, params={}) -> List[Order]:
|
4336
4336
|
"""
|
4337
4337
|
cancel multiple orders
|
4338
4338
|
|
@@ -4601,7 +4601,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
4601
4601
|
return response
|
4602
4602
|
return self.parse_orders(orders, market)
|
4603
4603
|
|
4604
|
-
def fetch_order_classic(self, id: str, symbol: Str = None, params={}):
|
4604
|
+
def fetch_order_classic(self, id: str, symbol: Str = None, params={}) -> Order:
|
4605
4605
|
"""
|
4606
4606
|
fetches information on an order made by the user *classic accounts only*
|
4607
4607
|
|
@@ -4846,7 +4846,7 @@ classic accounts only/ spot not supported* fetches information on an order made
|
|
4846
4846
|
data = self.add_pagination_cursor_to_result(response)
|
4847
4847
|
return self.parse_orders(data, market, since, limit)
|
4848
4848
|
|
4849
|
-
def fetch_closed_order(self, id: str, symbol: Str = None, params={}):
|
4849
|
+
def fetch_closed_order(self, id: str, symbol: Str = None, params={}) -> Order:
|
4850
4850
|
"""
|
4851
4851
|
fetches information on a closed order made by the user
|
4852
4852
|
|
@@ -4876,7 +4876,7 @@ classic accounts only/ spot not supported* fetches information on an order made
|
|
4876
4876
|
raise InvalidOrder(self.id + ' returned more than one order')
|
4877
4877
|
return self.safe_value(result, 0)
|
4878
4878
|
|
4879
|
-
def fetch_open_order(self, id: str, symbol: Str = None, params={}):
|
4879
|
+
def fetch_open_order(self, id: str, symbol: Str = None, params={}) -> Order:
|
4880
4880
|
"""
|
4881
4881
|
fetches information on an open order made by the user
|
4882
4882
|
|
@@ -5032,7 +5032,7 @@ classic accounts only/ spot not supported* fetches information on an order made
|
|
5032
5032
|
}
|
5033
5033
|
return self.fetch_canceled_and_closed_orders(symbol, since, limit, self.extend(request, params))
|
5034
5034
|
|
5035
|
-
def fetch_canceled_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
5035
|
+
def fetch_canceled_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
5036
5036
|
"""
|
5037
5037
|
fetches information on multiple canceled orders made by the user
|
5038
5038
|
|
@@ -5155,7 +5155,7 @@ classic accounts only/ spot not supported* fetches information on an order made
|
|
5155
5155
|
data = self.add_pagination_cursor_to_result(response)
|
5156
5156
|
return self.parse_orders(data, market, since, limit)
|
5157
5157
|
|
5158
|
-
def fetch_order_trades(self, id: str, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
5158
|
+
def fetch_order_trades(self, id: str, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Trade]:
|
5159
5159
|
"""
|
5160
5160
|
fetch all the trades made from a single order
|
5161
5161
|
|
@@ -5177,7 +5177,7 @@ classic accounts only/ spot not supported* fetches information on an order made
|
|
5177
5177
|
params = self.omit(params, ['clientOrderId', 'orderLinkId'])
|
5178
5178
|
return self.fetch_my_trades(symbol, since, limit, self.extend(request, params))
|
5179
5179
|
|
5180
|
-
def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
5180
|
+
def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Trade]:
|
5181
5181
|
"""
|
5182
5182
|
fetch all trades made by the user
|
5183
5183
|
|
@@ -5900,7 +5900,7 @@ classic accounts only/ spot not supported* fetches information on an order made
|
|
5900
5900
|
result = self.safe_dict(response, 'result', {})
|
5901
5901
|
return self.parse_transaction(result, currency)
|
5902
5902
|
|
5903
|
-
def fetch_position(self, symbol: str, params={}):
|
5903
|
+
def fetch_position(self, symbol: str, params={}) -> Position:
|
5904
5904
|
"""
|
5905
5905
|
fetch data on a single open contract trade position
|
5906
5906
|
|
@@ -5971,7 +5971,7 @@ classic accounts only/ spot not supported* fetches information on an order made
|
|
5971
5971
|
position['datetime'] = self.iso8601(timestamp)
|
5972
5972
|
return position
|
5973
5973
|
|
5974
|
-
def fetch_positions(self, symbols: Strings = None, params={}):
|
5974
|
+
def fetch_positions(self, symbols: Strings = None, params={}) -> List[Position]:
|
5975
5975
|
"""
|
5976
5976
|
fetch all open positions
|
5977
5977
|
|
@@ -5983,9 +5983,14 @@ classic accounts only/ spot not supported* fetches information on an order made
|
|
5983
5983
|
:param str [params.subType]: market subType, ['linear', 'inverse']
|
5984
5984
|
:param str [params.baseCoin]: Base coin. Supports linear, inverse & option
|
5985
5985
|
:param str [params.settleCoin]: Settle coin. Supports linear, inverse & option
|
5986
|
+
:param boolean [params.paginate]: default False, when True will automatically paginate by calling self endpoint multiple times
|
5986
5987
|
:returns dict[]: a list of `position structure <https://docs.ccxt.com/#/?id=position-structure>`
|
5987
5988
|
"""
|
5988
5989
|
self.load_markets()
|
5990
|
+
paginate = False
|
5991
|
+
paginate, params = self.handle_option_and_params(params, 'fetchPositions', 'paginate')
|
5992
|
+
if paginate:
|
5993
|
+
return self.fetch_paginated_call_cursor('fetchPositions', symbols, None, None, params, 'nextPageCursor', 'cursor', None, 200)
|
5989
5994
|
symbol = None
|
5990
5995
|
if (symbols is not None) and isinstance(symbols, list):
|
5991
5996
|
symbolsLength = len(symbols)
|
@@ -6016,6 +6021,8 @@ classic accounts only/ spot not supported* fetches information on an order made
|
|
6016
6021
|
# inverse
|
6017
6022
|
if symbol is None and baseCoin is None:
|
6018
6023
|
request['category'] = 'inverse'
|
6024
|
+
if self.safe_integer(params, 'limit') is None:
|
6025
|
+
request['limit'] = 200 # max limit
|
6019
6026
|
params = self.omit(params, ['type'])
|
6020
6027
|
request['category'] = type
|
6021
6028
|
response = self.privateGetV5PositionList(self.extend(request, params))
|
@@ -6064,7 +6071,7 @@ classic accounts only/ spot not supported* fetches information on an order made
|
|
6064
6071
|
results.append(self.parse_position(rawPosition))
|
6065
6072
|
return self.filter_by_array_positions(results, 'symbol', symbols, False)
|
6066
6073
|
|
6067
|
-
def parse_position(self, position: dict, market: Market = None):
|
6074
|
+
def parse_position(self, position: dict, market: Market = None) -> Position:
|
6068
6075
|
#
|
6069
6076
|
# linear swap
|
6070
6077
|
#
|
@@ -7015,7 +7022,7 @@ classic accounts only/ spot not supported* fetches information on an order made
|
|
7015
7022
|
'amount': amount,
|
7016
7023
|
})
|
7017
7024
|
|
7018
|
-
def parse_margin_loan(self, info, currency: Currency = None):
|
7025
|
+
def parse_margin_loan(self, info, currency: Currency = None) -> dict:
|
7019
7026
|
#
|
7020
7027
|
# borrowCrossMargin
|
7021
7028
|
#
|
@@ -7253,7 +7260,7 @@ classic accounts only/ spot not supported* fetches information on an order made
|
|
7253
7260
|
result[symbol] = fee
|
7254
7261
|
return result
|
7255
7262
|
|
7256
|
-
def parse_deposit_withdraw_fee(self, fee, currency: Currency = None):
|
7263
|
+
def parse_deposit_withdraw_fee(self, fee, currency: Currency = None) -> Any:
|
7257
7264
|
#
|
7258
7265
|
# {
|
7259
7266
|
# "name": "BTC",
|
@@ -7701,7 +7708,7 @@ classic accounts only/ spot not supported* fetches information on an order made
|
|
7701
7708
|
'info': greeks,
|
7702
7709
|
}
|
7703
7710
|
|
7704
|
-
def fetch_my_liquidations(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
7711
|
+
def fetch_my_liquidations(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Liquidation]:
|
7705
7712
|
"""
|
7706
7713
|
retrieves the users liquidated positions
|
7707
7714
|
|
@@ -7780,7 +7787,7 @@ classic accounts only/ spot not supported* fetches information on an order made
|
|
7780
7787
|
liquidations = self.add_pagination_cursor_to_result(response)
|
7781
7788
|
return self.parse_liquidations(liquidations, market, since, limit)
|
7782
7789
|
|
7783
|
-
def parse_liquidation(self, liquidation, market: Market = None):
|
7790
|
+
def parse_liquidation(self, liquidation, market: Market = None) -> Liquidation:
|
7784
7791
|
#
|
7785
7792
|
# {
|
7786
7793
|
# "symbol": "ETHPERP",
|
@@ -7943,7 +7950,7 @@ classic accounts only/ spot not supported* fetches information on an order made
|
|
7943
7950
|
})
|
7944
7951
|
return tiers
|
7945
7952
|
|
7946
|
-
def fetch_funding_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
7953
|
+
def fetch_funding_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[FundingHistory]:
|
7947
7954
|
"""
|
7948
7955
|
fetch the history of funding payments paid and received on self account
|
7949
7956
|
|
@@ -7984,7 +7991,7 @@ classic accounts only/ spot not supported* fetches information on an order made
|
|
7984
7991
|
fundings = self.add_pagination_cursor_to_result(response)
|
7985
7992
|
return self.parse_incomes(fundings, market, since, limit)
|
7986
7993
|
|
7987
|
-
def parse_income(self, income, market: Market = None):
|
7994
|
+
def parse_income(self, income, market: Market = None) -> object:
|
7988
7995
|
#
|
7989
7996
|
# {
|
7990
7997
|
# "symbol": "XMRUSDT",
|
ccxt/cex.py
CHANGED
ccxt/coinbase.py
CHANGED
@@ -734,7 +734,7 @@ class coinbase(Exchange, ImplicitAPI):
|
|
734
734
|
'info': account,
|
735
735
|
}
|
736
736
|
|
737
|
-
def create_deposit_address(self, code: str, params={}):
|
737
|
+
def create_deposit_address(self, code: str, params={}) -> DepositAddress:
|
738
738
|
"""
|
739
739
|
create a currency deposit address
|
740
740
|
|
@@ -802,6 +802,7 @@ class coinbase(Exchange, ImplicitAPI):
|
|
802
802
|
'currency': code,
|
803
803
|
'tag': tag,
|
804
804
|
'address': address,
|
805
|
+
'network': None,
|
805
806
|
'info': response,
|
806
807
|
}
|
807
808
|
|
@@ -2300,7 +2301,7 @@ class coinbase(Exchange, ImplicitAPI):
|
|
2300
2301
|
# "ending_before":null,
|
2301
2302
|
# "starting_after":null,
|
2302
2303
|
# "previous_ending_before":null,
|
2303
|
-
# "next_starting_after":"6b17acd6-2e68-5eb0-9f45-
|
2304
|
+
# "next_starting_after":"6b17acd6-2e68-5eb0-9f45-72d67cef578a",
|
2304
2305
|
# "limit":100,
|
2305
2306
|
# "order":"desc",
|
2306
2307
|
# "previous_uri":null,
|
ccxt/coinbaseexchange.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.coinbaseexchange import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Account, Any, Balances, Currencies, Currency, Int, LedgerEntry, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFees, Transaction
|
9
|
+
from ccxt.base.types import Account, Any, Balances, Currencies, Currency, DepositAddress, Int, LedgerEntry, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFees, Transaction
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
12
|
from ccxt.base.errors import AuthenticationError
|
@@ -1783,7 +1783,7 @@ class coinbaseexchange(Exchange, ImplicitAPI):
|
|
1783
1783
|
'fee': fee,
|
1784
1784
|
}
|
1785
1785
|
|
1786
|
-
def create_deposit_address(self, code: str, params={}):
|
1786
|
+
def create_deposit_address(self, code: str, params={}) -> DepositAddress:
|
1787
1787
|
"""
|
1788
1788
|
create a currency deposit address
|
1789
1789
|
|
@@ -1814,6 +1814,7 @@ class coinbaseexchange(Exchange, ImplicitAPI):
|
|
1814
1814
|
return {
|
1815
1815
|
'currency': code,
|
1816
1816
|
'address': self.check_address(address),
|
1817
|
+
'network': None,
|
1817
1818
|
'tag': tag,
|
1818
1819
|
'info': response,
|
1819
1820
|
}
|
ccxt/coinbaseinternational.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.coinbaseinternational import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Any, Balances, Currencies, Currency, Int, Market, Order, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntry
|
9
|
+
from ccxt.base.types import Any, Balances, Currencies, Currency, DepositAddress, Int, Market, Order, OrderSide, OrderType, Position, 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 AuthenticationError
|
@@ -736,7 +736,7 @@ class coinbaseinternational(Exchange, ImplicitAPI):
|
|
736
736
|
}
|
737
737
|
return self.safe_string(statuses, status, status)
|
738
738
|
|
739
|
-
def create_deposit_address(self, code: str, params={}):
|
739
|
+
def create_deposit_address(self, code: str, params={}) -> DepositAddress:
|
740
740
|
"""
|
741
741
|
create a currency deposit address
|
742
742
|
|
@@ -783,6 +783,7 @@ class coinbaseinternational(Exchange, ImplicitAPI):
|
|
783
783
|
'currency': code,
|
784
784
|
'tag': tag,
|
785
785
|
'address': address,
|
786
|
+
'network': None,
|
786
787
|
'info': response,
|
787
788
|
}
|
788
789
|
|
ccxt/coinex.py
CHANGED
@@ -3678,7 +3678,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
3678
3678
|
"""
|
3679
3679
|
return self.fetch_orders_by_status('finished', symbol, since, limit, params)
|
3680
3680
|
|
3681
|
-
def create_deposit_address(self, code: str, params={}):
|
3681
|
+
def create_deposit_address(self, code: str, params={}) -> DepositAddress:
|
3682
3682
|
"""
|
3683
3683
|
create a currency deposit address
|
3684
3684
|
|
ccxt/defx.py
CHANGED
@@ -613,7 +613,7 @@ class defx(Exchange, ImplicitAPI):
|
|
613
613
|
'active': self.safe_string(market, 'status', '') == 'active',
|
614
614
|
'contract': True,
|
615
615
|
'linear': True,
|
616
|
-
'inverse':
|
616
|
+
'inverse': False,
|
617
617
|
'taker': self.safe_number(fees, 'taker'),
|
618
618
|
'maker': self.safe_number(fees, 'maker'),
|
619
619
|
'contractSize': self.parse_number('1'),
|
ccxt/deribit.py
CHANGED
@@ -1100,7 +1100,7 @@ class deribit(Exchange, ImplicitAPI):
|
|
1100
1100
|
result = self.safe_dict(response, 'result', {})
|
1101
1101
|
return self.parse_balance(result)
|
1102
1102
|
|
1103
|
-
def create_deposit_address(self, code: str, params={}):
|
1103
|
+
def create_deposit_address(self, code: str, params={}) -> DepositAddress:
|
1104
1104
|
"""
|
1105
1105
|
create a currency deposit address
|
1106
1106
|
|
@@ -1135,6 +1135,7 @@ class deribit(Exchange, ImplicitAPI):
|
|
1135
1135
|
'currency': code,
|
1136
1136
|
'address': address,
|
1137
1137
|
'tag': None,
|
1138
|
+
'network': None,
|
1138
1139
|
'info': response,
|
1139
1140
|
}
|
1140
1141
|
|