ccxt 4.2.31__py2.py3-none-any.whl → 4.2.34__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.
Potentially problematic release.
This version of ccxt might be problematic. Click here for more details.
- ccxt/__init__.py +1 -1
- ccxt/ace.py +4 -3
- ccxt/alpaca.py +1 -1
- ccxt/ascendex.py +6 -6
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/ace.py +4 -3
- ccxt/async_support/alpaca.py +1 -1
- ccxt/async_support/ascendex.py +6 -6
- ccxt/async_support/base/exchange.py +62 -39
- ccxt/async_support/bigone.py +25 -5
- ccxt/async_support/binance.py +16 -15
- ccxt/async_support/bingx.py +10 -9
- ccxt/async_support/bit2c.py +13 -1
- ccxt/async_support/bitbank.py +2 -2
- ccxt/async_support/bitbns.py +1 -1
- ccxt/async_support/bitfinex.py +5 -5
- ccxt/async_support/bitfinex2.py +6 -6
- ccxt/async_support/bitflyer.py +5 -5
- ccxt/async_support/bitforex.py +1 -1
- ccxt/async_support/bitget.py +11 -11
- ccxt/async_support/bithumb.py +2 -2
- ccxt/async_support/bitmart.py +9 -9
- ccxt/async_support/bitmex.py +3 -3
- ccxt/async_support/bitopro.py +2 -2
- ccxt/async_support/bitrue.py +8 -8
- ccxt/async_support/bitso.py +4 -4
- ccxt/async_support/bitstamp.py +2 -2
- ccxt/async_support/bitteam.py +1 -1
- ccxt/async_support/bitvavo.py +3 -3
- ccxt/async_support/bl3p.py +1 -1
- ccxt/async_support/blockchaincom.py +3 -3
- ccxt/async_support/btcalpha.py +1 -1
- ccxt/async_support/btcbox.py +1 -1
- ccxt/async_support/btcmarkets.py +2 -2
- ccxt/async_support/btcturk.py +1 -1
- ccxt/async_support/bybit.py +9 -9
- ccxt/async_support/cex.py +1 -1
- ccxt/async_support/coinbase.py +6 -6
- ccxt/async_support/coinbasepro.py +2 -2
- ccxt/async_support/coincheck.py +1 -1
- ccxt/async_support/coinex.py +9 -9
- ccxt/async_support/coinlist.py +4 -4
- ccxt/async_support/coinmate.py +2 -2
- ccxt/async_support/coinmetro.py +2 -2
- ccxt/async_support/coinone.py +1 -1
- ccxt/async_support/coinsph.py +2 -2
- ccxt/async_support/coinspot.py +1 -1
- ccxt/async_support/cryptocom.py +14 -14
- ccxt/async_support/currencycom.py +1 -1
- ccxt/async_support/delta.py +2 -2
- ccxt/async_support/deribit.py +4 -4
- ccxt/async_support/digifinex.py +6 -6
- ccxt/async_support/exmo.py +2 -2
- ccxt/async_support/gate.py +41 -37
- ccxt/async_support/gemini.py +2 -2
- ccxt/async_support/hitbtc.py +5 -5
- ccxt/async_support/hollaex.py +2 -2
- ccxt/async_support/htx.py +10 -10
- ccxt/async_support/huobijp.py +4 -4
- ccxt/async_support/idex.py +2 -2
- ccxt/async_support/independentreserve.py +2 -2
- ccxt/async_support/indodax.py +2 -2
- ccxt/async_support/kraken.py +42 -4
- ccxt/async_support/krakenfutures.py +5 -5
- ccxt/async_support/kucoin.py +8 -8
- ccxt/async_support/kucoinfutures.py +4 -4
- ccxt/async_support/kuna.py +2 -2
- ccxt/async_support/latoken.py +3 -3
- ccxt/async_support/lbank.py +2 -2
- ccxt/async_support/luno.py +1 -1
- ccxt/async_support/lykke.py +2 -2
- ccxt/async_support/mercado.py +2 -2
- ccxt/async_support/mexc.py +7 -6
- ccxt/async_support/ndax.py +2 -2
- ccxt/async_support/novadax.py +4 -4
- ccxt/async_support/oceanex.py +1 -1
- ccxt/async_support/okcoin.py +5 -5
- ccxt/async_support/okx.py +11 -10
- ccxt/async_support/onetrading.py +2 -2
- ccxt/async_support/p2b.py +1 -1
- ccxt/async_support/paymium.py +3 -3
- ccxt/async_support/phemex.py +13 -13
- ccxt/async_support/poloniex.py +4 -4
- ccxt/async_support/poloniexfutures.py +1 -1
- ccxt/async_support/probit.py +5 -5
- ccxt/async_support/timex.py +1 -1
- ccxt/async_support/tokocrypto.py +4 -4
- ccxt/async_support/upbit.py +2 -2
- ccxt/async_support/wavesexchange.py +4 -3
- ccxt/async_support/wazirx.py +1 -1
- ccxt/async_support/whitebit.py +5 -5
- ccxt/async_support/woo.py +6 -6
- ccxt/async_support/yobit.py +41 -2
- ccxt/async_support/zaif.py +2 -2
- ccxt/async_support/zonda.py +4 -4
- ccxt/base/exchange.py +67 -40
- ccxt/base/types.py +10 -0
- ccxt/bigone.py +25 -5
- ccxt/binance.py +16 -15
- ccxt/bingx.py +10 -9
- ccxt/bit2c.py +13 -1
- ccxt/bitbank.py +2 -2
- ccxt/bitbns.py +1 -1
- ccxt/bitfinex.py +5 -5
- ccxt/bitfinex2.py +6 -6
- ccxt/bitflyer.py +5 -5
- ccxt/bitforex.py +1 -1
- ccxt/bitget.py +11 -11
- ccxt/bithumb.py +2 -2
- ccxt/bitmart.py +9 -9
- ccxt/bitmex.py +3 -3
- ccxt/bitopro.py +2 -2
- ccxt/bitrue.py +8 -8
- ccxt/bitso.py +4 -4
- ccxt/bitstamp.py +2 -2
- ccxt/bitteam.py +1 -1
- ccxt/bitvavo.py +3 -3
- ccxt/bl3p.py +1 -1
- ccxt/blockchaincom.py +3 -3
- ccxt/btcalpha.py +1 -1
- ccxt/btcbox.py +1 -1
- ccxt/btcmarkets.py +2 -2
- ccxt/btcturk.py +1 -1
- ccxt/bybit.py +9 -9
- ccxt/cex.py +1 -1
- ccxt/coinbase.py +6 -6
- ccxt/coinbasepro.py +2 -2
- ccxt/coincheck.py +1 -1
- ccxt/coinex.py +9 -9
- ccxt/coinlist.py +4 -4
- ccxt/coinmate.py +2 -2
- ccxt/coinmetro.py +2 -2
- ccxt/coinone.py +1 -1
- ccxt/coinsph.py +2 -2
- ccxt/coinspot.py +1 -1
- ccxt/cryptocom.py +14 -14
- ccxt/currencycom.py +1 -1
- ccxt/delta.py +2 -2
- ccxt/deribit.py +4 -4
- ccxt/digifinex.py +6 -6
- ccxt/exmo.py +2 -2
- ccxt/gate.py +41 -37
- ccxt/gemini.py +2 -2
- ccxt/hitbtc.py +5 -5
- ccxt/hollaex.py +2 -2
- ccxt/htx.py +10 -10
- ccxt/huobijp.py +4 -4
- ccxt/idex.py +2 -2
- ccxt/independentreserve.py +2 -2
- ccxt/indodax.py +2 -2
- ccxt/kraken.py +42 -4
- ccxt/krakenfutures.py +5 -5
- ccxt/kucoin.py +8 -8
- ccxt/kucoinfutures.py +4 -4
- ccxt/kuna.py +2 -2
- ccxt/latoken.py +3 -3
- ccxt/lbank.py +2 -2
- ccxt/luno.py +1 -1
- ccxt/lykke.py +2 -2
- ccxt/mercado.py +2 -2
- ccxt/mexc.py +7 -6
- ccxt/ndax.py +2 -2
- ccxt/novadax.py +4 -4
- ccxt/oceanex.py +1 -1
- ccxt/okcoin.py +5 -5
- ccxt/okx.py +11 -10
- ccxt/onetrading.py +2 -2
- ccxt/p2b.py +1 -1
- ccxt/paymium.py +3 -3
- ccxt/phemex.py +13 -13
- ccxt/poloniex.py +4 -4
- ccxt/poloniexfutures.py +1 -1
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/alpaca.py +8 -4
- ccxt/pro/ascendex.py +1 -2
- ccxt/pro/binance.py +14 -10
- ccxt/pro/bingx.py +1 -1
- ccxt/pro/bitfinex.py +21 -22
- ccxt/pro/bitfinex2.py +13 -15
- ccxt/pro/bitget.py +3 -1
- ccxt/pro/bitmart.py +3 -7
- ccxt/pro/bitmex.py +4 -6
- ccxt/pro/bitopro.py +2 -4
- ccxt/pro/bitrue.py +1 -1
- ccxt/pro/bitstamp.py +2 -3
- ccxt/pro/bitvavo.py +10 -5
- ccxt/pro/blockchaincom.py +22 -22
- ccxt/pro/bybit.py +5 -5
- ccxt/pro/cex.py +7 -7
- ccxt/pro/coinbase.py +3 -2
- ccxt/pro/coinbasepro.py +1 -1
- ccxt/pro/coinex.py +15 -13
- ccxt/pro/currencycom.py +5 -6
- ccxt/pro/deribit.py +4 -4
- ccxt/pro/exmo.py +15 -13
- ccxt/pro/gate.py +1 -1
- ccxt/pro/gemini.py +4 -2
- ccxt/pro/hitbtc.py +10 -9
- ccxt/pro/hollaex.py +2 -2
- ccxt/pro/htx.py +6 -6
- ccxt/pro/huobijp.py +3 -4
- ccxt/pro/idex.py +1 -1
- ccxt/pro/independentreserve.py +14 -13
- ccxt/pro/kraken.py +10 -14
- ccxt/pro/krakenfutures.py +10 -6
- ccxt/pro/kucoin.py +10 -10
- ccxt/pro/kucoinfutures.py +11 -10
- ccxt/pro/lbank.py +10 -10
- ccxt/pro/luno.py +12 -14
- ccxt/pro/mexc.py +3 -2
- ccxt/pro/ndax.py +7 -11
- ccxt/pro/okcoin.py +7 -10
- ccxt/pro/okx.py +6 -9
- ccxt/pro/onetrading.py +16 -15
- ccxt/pro/p2b.py +5 -3
- ccxt/pro/phemex.py +16 -11
- ccxt/pro/poloniex.py +6 -4
- ccxt/pro/poloniexfutures.py +13 -9
- ccxt/pro/probit.py +15 -12
- ccxt/pro/upbit.py +8 -8
- ccxt/pro/wazirx.py +6 -3
- ccxt/pro/woo.py +9 -7
- ccxt/probit.py +5 -5
- ccxt/test/base/test_order_book.py +7 -7
- ccxt/test/base/test_shared_methods.py +1 -1
- ccxt/test/test_async.py +86 -36
- ccxt/test/test_sync.py +86 -36
- ccxt/timex.py +1 -1
- ccxt/tokocrypto.py +4 -4
- ccxt/upbit.py +2 -2
- ccxt/wavesexchange.py +4 -3
- ccxt/wazirx.py +1 -1
- ccxt/whitebit.py +5 -5
- ccxt/woo.py +6 -6
- ccxt/yobit.py +41 -2
- ccxt/zaif.py +2 -2
- ccxt/zonda.py +4 -4
- {ccxt-4.2.31.dist-info → ccxt-4.2.34.dist-info}/METADATA +9 -8
- ccxt-4.2.34.dist-info/RECORD +438 -0
- ccxt-4.2.31.dist-info/RECORD +0 -438
- {ccxt-4.2.31.dist-info → ccxt-4.2.34.dist-info}/WHEEL +0 -0
- {ccxt-4.2.31.dist-info → ccxt-4.2.34.dist-info}/top_level.txt +0 -0
ccxt/async_support/bitflyer.py
CHANGED
@@ -514,7 +514,7 @@ class bitflyer(Exchange, ImplicitAPI):
|
|
514
514
|
'taker': fee,
|
515
515
|
}
|
516
516
|
|
517
|
-
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
|
517
|
+
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
|
518
518
|
"""
|
519
519
|
create a trade order
|
520
520
|
:see: https://lightning.bitflyer.com/docs?lang=en#send-a-new-order
|
@@ -615,7 +615,7 @@ class bitflyer(Exchange, ImplicitAPI):
|
|
615
615
|
'trades': None,
|
616
616
|
}, market)
|
617
617
|
|
618
|
-
async def fetch_orders(self, symbol: Str = None, since: Int = None, limit=100, params={}) -> List[Order]:
|
618
|
+
async def fetch_orders(self, symbol: Str = None, since: Int = None, limit: Int = 100, params={}) -> List[Order]:
|
619
619
|
"""
|
620
620
|
fetches information on multiple orders made by the user
|
621
621
|
:see: https://lightning.bitflyer.com/docs?lang=en#list-orders
|
@@ -639,7 +639,7 @@ class bitflyer(Exchange, ImplicitAPI):
|
|
639
639
|
orders = self.filter_by(orders, 'symbol', symbol)
|
640
640
|
return orders
|
641
641
|
|
642
|
-
async def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit=100, params={}) -> List[Order]:
|
642
|
+
async def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = 100, params={}) -> List[Order]:
|
643
643
|
"""
|
644
644
|
fetch all unfilled currently open orders
|
645
645
|
:see: https://lightning.bitflyer.com/docs?lang=en#list-orders
|
@@ -654,7 +654,7 @@ class bitflyer(Exchange, ImplicitAPI):
|
|
654
654
|
}
|
655
655
|
return await self.fetch_orders(symbol, since, limit, self.extend(request, params))
|
656
656
|
|
657
|
-
async def fetch_closed_orders(self, symbol: Str = None, since: Int = None, limit=100, params={}) -> List[Order]:
|
657
|
+
async def fetch_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = 100, params={}) -> List[Order]:
|
658
658
|
"""
|
659
659
|
fetches information on multiple closed orders made by the user
|
660
660
|
:see: https://lightning.bitflyer.com/docs?lang=en#list-orders
|
@@ -756,7 +756,7 @@ class bitflyer(Exchange, ImplicitAPI):
|
|
756
756
|
# todo unify parsePosition/parsePositions
|
757
757
|
return response
|
758
758
|
|
759
|
-
async def withdraw(self, code: str, amount, address, tag=None, params={}):
|
759
|
+
async def withdraw(self, code: str, amount: float, address, tag=None, params={}):
|
760
760
|
"""
|
761
761
|
make a withdrawal
|
762
762
|
:see: https://lightning.bitflyer.com/docs?lang=en#withdrawing-funds
|
ccxt/async_support/bitforex.py
CHANGED
@@ -748,7 +748,7 @@ class bitforex(Exchange, ImplicitAPI):
|
|
748
748
|
response = await self.privatePostApiV1TradeOrderInfos(self.extend(request, params))
|
749
749
|
return self.parse_orders(response['data'], market, since, limit)
|
750
750
|
|
751
|
-
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
|
751
|
+
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
|
752
752
|
"""
|
753
753
|
create a trade order
|
754
754
|
:see: https://apidoc.bitforex.com/#new-order-trade
|
ccxt/async_support/bitget.py
CHANGED
@@ -8,7 +8,7 @@ from ccxt.abstract.bitget import ImplicitAPI
|
|
8
8
|
import asyncio
|
9
9
|
import hashlib
|
10
10
|
import json
|
11
|
-
from ccxt.base.types import Balances, Currency, Int, Liquidation, Market, Order, OrderBook, OrderRequest, OrderSide, OrderType, Position, FundingHistory, Str, Strings, Ticker, Tickers, Trade, Transaction
|
11
|
+
from ccxt.base.types import Balances, Currency, Int, Liquidation, Market, Order, TransferEntry, OrderBook, OrderRequest, OrderSide, OrderType, Position, FundingHistory, Str, Strings, Ticker, Tickers, Trade, Transaction
|
12
12
|
from typing import List
|
13
13
|
from ccxt.base.errors import ExchangeError
|
14
14
|
from ccxt.base.errors import PermissionDenied
|
@@ -2129,7 +2129,7 @@ class bitget(Exchange, ImplicitAPI):
|
|
2129
2129
|
rawTransactions = self.safe_value(response, 'data', [])
|
2130
2130
|
return self.parse_transactions(rawTransactions, currency, since, limit)
|
2131
2131
|
|
2132
|
-
async def withdraw(self, code: str, amount, address, tag=None, params={}):
|
2132
|
+
async def withdraw(self, code: str, amount: float, address, tag=None, params={}):
|
2133
2133
|
"""
|
2134
2134
|
make a withdrawal
|
2135
2135
|
:see: https://www.bitget.com/api-doc/spot/account/Wallet-Withdrawal
|
@@ -3851,7 +3851,7 @@ class bitget(Exchange, ImplicitAPI):
|
|
3851
3851
|
params['createMarketBuyOrderRequiresPrice'] = False
|
3852
3852
|
return await self.create_order(symbol, 'market', 'buy', cost, None, params)
|
3853
3853
|
|
3854
|
-
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
|
3854
|
+
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
|
3855
3855
|
"""
|
3856
3856
|
create a trade order
|
3857
3857
|
:see: https://www.bitget.com/api-doc/spot/trade/Place-Order
|
@@ -3934,7 +3934,7 @@ class bitget(Exchange, ImplicitAPI):
|
|
3934
3934
|
data = self.safe_value(response, 'data', {})
|
3935
3935
|
return self.parse_order(data, market)
|
3936
3936
|
|
3937
|
-
def create_order_request(self, symbol, type, side, amount, price=None, params={}):
|
3937
|
+
def create_order_request(self, symbol, type, side, amount: float, price: float = None, params={}):
|
3938
3938
|
sandboxMode = self.safe_value(self.options, 'sandboxMode', False)
|
3939
3939
|
market = None
|
3940
3940
|
if sandboxMode:
|
@@ -3963,7 +3963,7 @@ class bitget(Exchange, ImplicitAPI):
|
|
3963
3963
|
isTakeProfit = takeProfit is not None
|
3964
3964
|
isStopLossOrTakeProfitTrigger = isStopLossTriggerOrder or isTakeProfitTriggerOrder
|
3965
3965
|
isStopLossOrTakeProfit = isStopLoss or isTakeProfit
|
3966
|
-
trailingTriggerPrice = self.safe_string(params, 'trailingTriggerPrice', price)
|
3966
|
+
trailingTriggerPrice = self.safe_string(params, 'trailingTriggerPrice', self.number_to_string(price))
|
3967
3967
|
trailingPercent = self.safe_string_2(params, 'trailingPercent', 'callbackRatio')
|
3968
3968
|
isTrailingPercentOrder = trailingPercent is not None
|
3969
3969
|
if self.sum(isTriggerOrder, isStopLossTriggerOrder, isTakeProfitTriggerOrder, isTrailingPercentOrder) > 1:
|
@@ -6458,11 +6458,11 @@ class bitget(Exchange, ImplicitAPI):
|
|
6458
6458
|
#
|
6459
6459
|
return response
|
6460
6460
|
|
6461
|
-
async def set_leverage(self, leverage, symbol: Str = None, params={}):
|
6461
|
+
async def set_leverage(self, leverage: Int, symbol: Str = None, params={}):
|
6462
6462
|
"""
|
6463
6463
|
set the level of leverage for a market
|
6464
6464
|
:see: https://www.bitget.com/api-doc/contract/account/Change-Leverage
|
6465
|
-
:param
|
6465
|
+
:param int leverage: the rate of leverage
|
6466
6466
|
:param str symbol: unified market symbol
|
6467
6467
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
6468
6468
|
:param str [params.holdSide]: *isolated only* position direction, 'long' or 'short'
|
@@ -6483,7 +6483,7 @@ class bitget(Exchange, ImplicitAPI):
|
|
6483
6483
|
request = {
|
6484
6484
|
'symbol': market['id'],
|
6485
6485
|
'marginCoin': market['settleId'],
|
6486
|
-
'leverage': leverage,
|
6486
|
+
'leverage': self.number_to_string(leverage),
|
6487
6487
|
'productType': productType,
|
6488
6488
|
# 'holdSide': 'long',
|
6489
6489
|
}
|
@@ -6716,7 +6716,7 @@ class bitget(Exchange, ImplicitAPI):
|
|
6716
6716
|
data = self.safe_value(response, 'data', [])
|
6717
6717
|
return self.parse_transfers(data, currency, since, limit)
|
6718
6718
|
|
6719
|
-
async def transfer(self, code: str, amount, fromAccount, toAccount, params={}):
|
6719
|
+
async def transfer(self, code: str, amount: float, fromAccount, toAccount, params={}) -> TransferEntry:
|
6720
6720
|
"""
|
6721
6721
|
transfer currency internally between wallets on the same account
|
6722
6722
|
:see: https://www.bitget.com/api-doc/spot/account/Wallet-Transfer
|
@@ -6906,7 +6906,7 @@ class bitget(Exchange, ImplicitAPI):
|
|
6906
6906
|
data = self.safe_value(response, 'data', [])
|
6907
6907
|
return self.parse_deposit_withdraw_fees(data, codes, 'coin')
|
6908
6908
|
|
6909
|
-
async def borrow_cross_margin(self, code: str, amount, params={}):
|
6909
|
+
async def borrow_cross_margin(self, code: str, amount: float, params={}):
|
6910
6910
|
"""
|
6911
6911
|
create a loan to borrow margin
|
6912
6912
|
:see: https://www.bitget.com/api-doc/margin/cross/account/Cross-Borrow
|
@@ -6937,7 +6937,7 @@ class bitget(Exchange, ImplicitAPI):
|
|
6937
6937
|
data = self.safe_value(response, 'data', {})
|
6938
6938
|
return self.parse_margin_loan(data, currency)
|
6939
6939
|
|
6940
|
-
async def borrow_isolated_margin(self, symbol: str, code: str, amount, params={}):
|
6940
|
+
async def borrow_isolated_margin(self, symbol: str, code: str, amount: float, params={}):
|
6941
6941
|
"""
|
6942
6942
|
create a loan to borrow margin
|
6943
6943
|
:see: https://www.bitget.com/api-doc/margin/isolated/account/Isolated-Borrow
|
ccxt/async_support/bithumb.py
CHANGED
@@ -650,7 +650,7 @@ class bithumb(Exchange, ImplicitAPI):
|
|
650
650
|
data = self.safe_value(response, 'data', [])
|
651
651
|
return self.parse_trades(data, market, since, limit)
|
652
652
|
|
653
|
-
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
|
653
|
+
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
|
654
654
|
"""
|
655
655
|
create a trade order
|
656
656
|
:param str symbol: unified symbol of the market to create an order in
|
@@ -909,7 +909,7 @@ class bithumb(Exchange, ImplicitAPI):
|
|
909
909
|
}
|
910
910
|
return await self.cancel_order(order['id'], order['symbol'], self.extend(request, params))
|
911
911
|
|
912
|
-
async def withdraw(self, code: str, amount, address, tag=None, params={}):
|
912
|
+
async def withdraw(self, code: str, amount: float, address, tag=None, params={}):
|
913
913
|
"""
|
914
914
|
make a withdrawal
|
915
915
|
:param str code: unified currency code
|
ccxt/async_support/bitmart.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.async_support.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.bitmart import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Balances, Currency, Int, Market, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
|
9
|
+
from ccxt.base.types import Balances, Currency, Int, Market, Order, TransferEntry, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
12
|
from ccxt.base.errors import PermissionDenied
|
@@ -2197,7 +2197,7 @@ class bitmart(Exchange, ImplicitAPI):
|
|
2197
2197
|
params['createMarketBuyOrderRequiresPrice'] = False
|
2198
2198
|
return await self.create_order(symbol, 'market', 'buy', cost, None, params)
|
2199
2199
|
|
2200
|
-
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
|
2200
|
+
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
|
2201
2201
|
"""
|
2202
2202
|
create a trade order
|
2203
2203
|
:see: https://developer-pro.bitmart.com/en/spot/#new-order-v2-signed
|
@@ -2265,7 +2265,7 @@ class bitmart(Exchange, ImplicitAPI):
|
|
2265
2265
|
order['price'] = price
|
2266
2266
|
return order
|
2267
2267
|
|
2268
|
-
def create_swap_order_request(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
|
2268
|
+
def create_swap_order_request(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
|
2269
2269
|
"""
|
2270
2270
|
* @ignore
|
2271
2271
|
create a trade order
|
@@ -2314,7 +2314,7 @@ class bitmart(Exchange, ImplicitAPI):
|
|
2314
2314
|
request['mode'] = 4
|
2315
2315
|
triggerPrice = self.safe_string_n(params, ['triggerPrice', 'stopPrice', 'trigger_price'])
|
2316
2316
|
isTriggerOrder = triggerPrice is not None
|
2317
|
-
trailingTriggerPrice = self.safe_string_2(params, 'trailingTriggerPrice', 'activation_price', price)
|
2317
|
+
trailingTriggerPrice = self.safe_string_2(params, 'trailingTriggerPrice', 'activation_price', self.number_to_string(price))
|
2318
2318
|
trailingPercent = self.safe_string_2(params, 'trailingPercent', 'callback_rate')
|
2319
2319
|
isTrailingPercentOrder = trailingPercent is not None
|
2320
2320
|
if isLimitOrder:
|
@@ -2359,7 +2359,7 @@ class bitmart(Exchange, ImplicitAPI):
|
|
2359
2359
|
request['leverage'] = self.number_to_string(leverage)
|
2360
2360
|
return self.extend(request, params)
|
2361
2361
|
|
2362
|
-
def create_spot_order_request(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
|
2362
|
+
def create_spot_order_request(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
|
2363
2363
|
"""
|
2364
2364
|
* @ignore
|
2365
2365
|
create a spot order request
|
@@ -2918,7 +2918,7 @@ class bitmart(Exchange, ImplicitAPI):
|
|
2918
2918
|
# TODO: parse
|
2919
2919
|
return networkId
|
2920
2920
|
|
2921
|
-
async def withdraw(self, code: str, amount, address, tag=None, params={}):
|
2921
|
+
async def withdraw(self, code: str, amount: float, address, tag=None, params={}):
|
2922
2922
|
"""
|
2923
2923
|
make a withdrawal
|
2924
2924
|
:param str code: unified currency code
|
@@ -3239,7 +3239,7 @@ class bitmart(Exchange, ImplicitAPI):
|
|
3239
3239
|
'symbol': symbol,
|
3240
3240
|
})
|
3241
3241
|
|
3242
|
-
async def borrow_isolated_margin(self, symbol: str, code: str, amount, params={}):
|
3242
|
+
async def borrow_isolated_margin(self, symbol: str, code: str, amount: float, params={}):
|
3243
3243
|
"""
|
3244
3244
|
create a loan to borrow margin
|
3245
3245
|
:see: https://developer-pro.bitmart.com/en/spot/#margin-borrow-isolated
|
@@ -3441,7 +3441,7 @@ class bitmart(Exchange, ImplicitAPI):
|
|
3441
3441
|
result.append(self.parse_isolated_borrow_rate(symbol))
|
3442
3442
|
return result
|
3443
3443
|
|
3444
|
-
async def transfer(self, code: str, amount, fromAccount, toAccount, params={}):
|
3444
|
+
async def transfer(self, code: str, amount: float, fromAccount, toAccount, params={}) -> TransferEntry:
|
3445
3445
|
"""
|
3446
3446
|
transfer currency internally between wallets on the same account, currently only supports transfer between spot and margin
|
3447
3447
|
:see: https://developer-pro.bitmart.com/en/spot/#margin-asset-transfer-signed
|
@@ -3756,7 +3756,7 @@ class bitmart(Exchange, ImplicitAPI):
|
|
3756
3756
|
'info': interest,
|
3757
3757
|
}, market)
|
3758
3758
|
|
3759
|
-
async def set_leverage(self, leverage, symbol: Str = None, params={}):
|
3759
|
+
async def set_leverage(self, leverage: Int, symbol: Str = None, params={}):
|
3760
3760
|
"""
|
3761
3761
|
set the level of leverage for a market
|
3762
3762
|
:see: https://developer-pro.bitmart.com/en/futures/#submit-leverage-signed
|
ccxt/async_support/bitmex.py
CHANGED
@@ -1743,7 +1743,7 @@ class bitmex(Exchange, ImplicitAPI):
|
|
1743
1743
|
#
|
1744
1744
|
return self.parse_trades(response, market, since, limit)
|
1745
1745
|
|
1746
|
-
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
|
1746
|
+
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
|
1747
1747
|
"""
|
1748
1748
|
create a trade order
|
1749
1749
|
:see: https://www.bitmex.com/api/explorer/#not /Order/Order_new
|
@@ -2217,7 +2217,7 @@ class bitmex(Exchange, ImplicitAPI):
|
|
2217
2217
|
'takeProfitPrice': None,
|
2218
2218
|
})
|
2219
2219
|
|
2220
|
-
async def withdraw(self, code: str, amount, address, tag=None, params={}):
|
2220
|
+
async def withdraw(self, code: str, amount: float, address, tag=None, params={}):
|
2221
2221
|
"""
|
2222
2222
|
make a withdrawal
|
2223
2223
|
:param str code: unified currency code
|
@@ -2383,7 +2383,7 @@ class bitmex(Exchange, ImplicitAPI):
|
|
2383
2383
|
'datetime': datetime,
|
2384
2384
|
}
|
2385
2385
|
|
2386
|
-
async def set_leverage(self, leverage, symbol: Str = None, params={}):
|
2386
|
+
async def set_leverage(self, leverage: Int, symbol: Str = None, params={}):
|
2387
2387
|
"""
|
2388
2388
|
set the level of leverage for a market
|
2389
2389
|
:param float leverage: the rate of leverage
|
ccxt/async_support/bitopro.py
CHANGED
@@ -949,7 +949,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
949
949
|
'info': order,
|
950
950
|
}, market)
|
951
951
|
|
952
|
-
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
|
952
|
+
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
|
953
953
|
"""
|
954
954
|
create a trade order
|
955
955
|
:see: https://github.com/bitoex/bitopro-offical-api-docs/blob/master/api/v3/private/create_an_order.md
|
@@ -1477,7 +1477,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
1477
1477
|
#
|
1478
1478
|
return self.parse_transaction(result, currency)
|
1479
1479
|
|
1480
|
-
async def withdraw(self, code: str, amount, address, tag=None, params={}):
|
1480
|
+
async def withdraw(self, code: str, amount: float, address, tag=None, params={}):
|
1481
1481
|
"""
|
1482
1482
|
make a withdrawal
|
1483
1483
|
:see: https://github.com/bitoex/bitopro-offical-api-docs/blob/master/api/v3/private/create_an_withdraw_invoice.md
|
ccxt/async_support/bitrue.py
CHANGED
@@ -8,7 +8,7 @@ from ccxt.abstract.bitrue import ImplicitAPI
|
|
8
8
|
import asyncio
|
9
9
|
import hashlib
|
10
10
|
import json
|
11
|
-
from ccxt.base.types import Balances, Currency, Int, Market, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
|
11
|
+
from ccxt.base.types import Balances, Currency, Int, Market, Order, TransferEntry, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
|
12
12
|
from typing import List
|
13
13
|
from ccxt.base.errors import ExchangeError
|
14
14
|
from ccxt.base.errors import PermissionDenied
|
@@ -1818,7 +1818,7 @@ class bitrue(Exchange, ImplicitAPI):
|
|
1818
1818
|
params['createMarketBuyOrderRequiresPrice'] = False
|
1819
1819
|
return await self.create_order(symbol, 'market', 'buy', cost, None, params)
|
1820
1820
|
|
1821
|
-
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
|
1821
|
+
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
|
1822
1822
|
"""
|
1823
1823
|
create a trade order
|
1824
1824
|
:see: https://github.com/Bitrue-exchange/Spot-official-api-docs#recent-trades-list
|
@@ -1882,9 +1882,9 @@ class bitrue(Exchange, ImplicitAPI):
|
|
1882
1882
|
amountString = self.number_to_string(amount)
|
1883
1883
|
priceString = self.number_to_string(price)
|
1884
1884
|
quoteAmount = Precise.string_mul(amountString, priceString)
|
1885
|
-
|
1886
|
-
request['amount'] = self.cost_to_precision(symbol,
|
1887
|
-
request['volume'] = self.cost_to_precision(symbol,
|
1885
|
+
requestAmount = cost if (cost is not None) else quoteAmount
|
1886
|
+
request['amount'] = self.cost_to_precision(symbol, requestAmount)
|
1887
|
+
request['volume'] = self.cost_to_precision(symbol, requestAmount)
|
1888
1888
|
else:
|
1889
1889
|
request['amount'] = self.parse_to_numeric(amount)
|
1890
1890
|
request['volume'] = self.parse_to_numeric(amount)
|
@@ -2587,7 +2587,7 @@ class bitrue(Exchange, ImplicitAPI):
|
|
2587
2587
|
'fee': fee,
|
2588
2588
|
}
|
2589
2589
|
|
2590
|
-
async def withdraw(self, code: str, amount, address, tag=None, params={}):
|
2590
|
+
async def withdraw(self, code: str, amount: float, address, tag=None, params={}):
|
2591
2591
|
"""
|
2592
2592
|
make a withdrawal
|
2593
2593
|
:see: https://github.com/Bitrue-exchange/Spot-official-api-docs#withdraw-commit--withdraw_data
|
@@ -2779,7 +2779,7 @@ class bitrue(Exchange, ImplicitAPI):
|
|
2779
2779
|
data = self.safe_value(response, 'data', {})
|
2780
2780
|
return self.parse_transfers(data, currency, since, limit)
|
2781
2781
|
|
2782
|
-
async def transfer(self, code: str, amount, fromAccount, toAccount, params={}):
|
2782
|
+
async def transfer(self, code: str, amount: float, fromAccount, toAccount, params={}) -> TransferEntry:
|
2783
2783
|
"""
|
2784
2784
|
transfer currency internally between wallets on the same account
|
2785
2785
|
:see: https://www.bitrue.com/api-docs#new-future-account-transfer-user_data-hmac-sha256
|
@@ -2812,7 +2812,7 @@ class bitrue(Exchange, ImplicitAPI):
|
|
2812
2812
|
data = self.safe_value(response, 'data', {})
|
2813
2813
|
return self.parse_transfer(data, currency)
|
2814
2814
|
|
2815
|
-
async def set_leverage(self, leverage, symbol: str = None, params={}):
|
2815
|
+
async def set_leverage(self, leverage: Int, symbol: str = None, params={}):
|
2816
2816
|
"""
|
2817
2817
|
set the level of leverage for a market
|
2818
2818
|
:see: https://www.bitrue.com/api-docs#change-initial-leverage-trade-hmac-sha256
|
ccxt/async_support/bitso.py
CHANGED
@@ -877,7 +877,7 @@ class bitso(Exchange, ImplicitAPI):
|
|
877
877
|
}
|
878
878
|
return result
|
879
879
|
|
880
|
-
async def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit=25, params={}):
|
880
|
+
async def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = 25, params={}):
|
881
881
|
"""
|
882
882
|
fetch all trades made by the user
|
883
883
|
:param str symbol: unified market symbol
|
@@ -910,7 +910,7 @@ class bitso(Exchange, ImplicitAPI):
|
|
910
910
|
response = await self.privateGetUserTrades(self.extend(request, params))
|
911
911
|
return self.parse_trades(response['payload'], market, since, limit)
|
912
912
|
|
913
|
-
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
|
913
|
+
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
|
914
914
|
"""
|
915
915
|
create a trade order
|
916
916
|
:param str symbol: unified symbol of the market to create an order in
|
@@ -1061,7 +1061,7 @@ class bitso(Exchange, ImplicitAPI):
|
|
1061
1061
|
'trades': None,
|
1062
1062
|
}, market)
|
1063
1063
|
|
1064
|
-
async def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit=25, params={}) -> List[Order]:
|
1064
|
+
async def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = 25, params={}) -> List[Order]:
|
1065
1065
|
"""
|
1066
1066
|
fetch all unfilled currently open orders
|
1067
1067
|
:param str symbol: unified market symbol
|
@@ -1457,7 +1457,7 @@ class bitso(Exchange, ImplicitAPI):
|
|
1457
1457
|
result[code]['info'][code] = withdrawFee
|
1458
1458
|
return result
|
1459
1459
|
|
1460
|
-
async def withdraw(self, code: str, amount, address, tag=None, params={}):
|
1460
|
+
async def withdraw(self, code: str, amount: float, address, tag=None, params={}):
|
1461
1461
|
"""
|
1462
1462
|
make a withdrawal
|
1463
1463
|
:param str code: unified currency code
|
ccxt/async_support/bitstamp.py
CHANGED
@@ -1275,7 +1275,7 @@ class bitstamp(Exchange, ImplicitAPI):
|
|
1275
1275
|
result[code]['info'][id] = dictValue
|
1276
1276
|
return result
|
1277
1277
|
|
1278
|
-
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
|
1278
|
+
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
|
1279
1279
|
"""
|
1280
1280
|
create a trade order
|
1281
1281
|
:see: https://www.bitstamp.net/api/#tag/Orders/operation/OpenInstantBuyOrder
|
@@ -1915,7 +1915,7 @@ class bitstamp(Exchange, ImplicitAPI):
|
|
1915
1915
|
'info': response,
|
1916
1916
|
}
|
1917
1917
|
|
1918
|
-
async def withdraw(self, code: str, amount, address, tag=None, params={}):
|
1918
|
+
async def withdraw(self, code: str, amount: float, address, tag=None, params={}):
|
1919
1919
|
"""
|
1920
1920
|
make a withdrawal
|
1921
1921
|
:param str code: unified currency code
|
ccxt/async_support/bitteam.py
CHANGED
@@ -952,7 +952,7 @@ class bitteam(Exchange, ImplicitAPI):
|
|
952
952
|
}
|
953
953
|
return await self.fetch_orders(symbol, since, limit, self.extend(request, params))
|
954
954
|
|
955
|
-
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
|
955
|
+
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
|
956
956
|
"""
|
957
957
|
create a trade order
|
958
958
|
:see: https://bit.team/trade/api/documentation#/PRIVATE/postTradeApiCcxtOrdercreate
|
ccxt/async_support/bitvavo.py
CHANGED
@@ -1025,7 +1025,7 @@ class bitvavo(Exchange, ImplicitAPI):
|
|
1025
1025
|
'info': response,
|
1026
1026
|
}
|
1027
1027
|
|
1028
|
-
def create_order_request(self, symbol: Str, type: OrderType, side: OrderSide, amount, price=None, params={}):
|
1028
|
+
def create_order_request(self, symbol: Str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
|
1029
1029
|
market = self.market(symbol)
|
1030
1030
|
request = {
|
1031
1031
|
'market': market['id'],
|
@@ -1078,7 +1078,7 @@ class bitvavo(Exchange, ImplicitAPI):
|
|
1078
1078
|
request['postOnly'] = True
|
1079
1079
|
return self.extend(request, params)
|
1080
1080
|
|
1081
|
-
async def create_order(self, symbol: Str, type: OrderType, side: OrderSide, amount, price=None, params={}):
|
1081
|
+
async def create_order(self, symbol: Str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
|
1082
1082
|
"""
|
1083
1083
|
create a trade order
|
1084
1084
|
:see: https://docs.bitvavo.com/#tag/Orders/paths/~1order/post
|
@@ -1625,7 +1625,7 @@ class bitvavo(Exchange, ImplicitAPI):
|
|
1625
1625
|
request['paymentId'] = tag
|
1626
1626
|
return self.extend(request, params)
|
1627
1627
|
|
1628
|
-
async def withdraw(self, code: str, amount, address, tag=None, params={}):
|
1628
|
+
async def withdraw(self, code: str, amount: float, address, tag=None, params={}):
|
1629
1629
|
"""
|
1630
1630
|
make a withdrawal
|
1631
1631
|
:param str code: unified currency code
|
ccxt/async_support/bl3p.py
CHANGED
@@ -355,7 +355,7 @@ class bl3p(Exchange, ImplicitAPI):
|
|
355
355
|
}
|
356
356
|
return result
|
357
357
|
|
358
|
-
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
|
358
|
+
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
|
359
359
|
"""
|
360
360
|
create a trade order
|
361
361
|
:see: https://github.com/BitonicNL/bl3p-api/blob/master/examples/nodejs/example.md#21---create-an-order
|
@@ -514,12 +514,12 @@ class blockchaincom(Exchange, ImplicitAPI):
|
|
514
514
|
'remaining': remaining,
|
515
515
|
'cost': None,
|
516
516
|
'trades': [],
|
517
|
-
'fees':
|
517
|
+
'fees': [],
|
518
518
|
'info': order,
|
519
519
|
})
|
520
520
|
return result
|
521
521
|
|
522
|
-
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
|
522
|
+
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
|
523
523
|
"""
|
524
524
|
create a trade order
|
525
525
|
:param str symbol: unified symbol of the market to create an order in
|
@@ -859,7 +859,7 @@ class blockchaincom(Exchange, ImplicitAPI):
|
|
859
859
|
'fee': fee,
|
860
860
|
}
|
861
861
|
|
862
|
-
async def withdraw(self, code: str, amount, address, tag=None, params={}):
|
862
|
+
async def withdraw(self, code: str, amount: float, address, tag=None, params={}):
|
863
863
|
"""
|
864
864
|
make a withdrawal
|
865
865
|
:param str code: unified currency code
|
ccxt/async_support/btcalpha.py
CHANGED
@@ -694,7 +694,7 @@ class btcalpha(Exchange, ImplicitAPI):
|
|
694
694
|
'average': None,
|
695
695
|
}, market)
|
696
696
|
|
697
|
-
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
|
697
|
+
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
|
698
698
|
"""
|
699
699
|
:see: https://btc-alpha.github.io/api-docs/#create-order
|
700
700
|
create a trade order
|
ccxt/async_support/btcbox.py
CHANGED
@@ -282,7 +282,7 @@ class btcbox(Exchange, ImplicitAPI):
|
|
282
282
|
#
|
283
283
|
return self.parse_trades(response, market, since, limit)
|
284
284
|
|
285
|
-
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
|
285
|
+
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
|
286
286
|
"""
|
287
287
|
create a trade order
|
288
288
|
:param str symbol: unified symbol of the market to create an order in
|
ccxt/async_support/btcmarkets.py
CHANGED
@@ -735,7 +735,7 @@ class btcmarkets(Exchange, ImplicitAPI):
|
|
735
735
|
#
|
736
736
|
return self.parse_trades(response, market, since, limit)
|
737
737
|
|
738
|
-
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
|
738
|
+
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
|
739
739
|
"""
|
740
740
|
create a trade order
|
741
741
|
:param str symbol: unified symbol of the market to create an order in
|
@@ -1062,7 +1062,7 @@ class btcmarkets(Exchange, ImplicitAPI):
|
|
1062
1062
|
#
|
1063
1063
|
return self.parse_trades(response, market, since, limit)
|
1064
1064
|
|
1065
|
-
async def withdraw(self, code: str, amount, address, tag=None, params={}):
|
1065
|
+
async def withdraw(self, code: str, amount: float, address, tag=None, params={}):
|
1066
1066
|
"""
|
1067
1067
|
make a withdrawal
|
1068
1068
|
:param str code: unified currency code
|
ccxt/async_support/btcturk.py
CHANGED
@@ -628,7 +628,7 @@ class btcturk(Exchange, ImplicitAPI):
|
|
628
628
|
sorted = self.sort_by(results, 0)
|
629
629
|
return self.filter_by_since_limit(sorted, since, limit, 0)
|
630
630
|
|
631
|
-
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
|
631
|
+
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
|
632
632
|
"""
|
633
633
|
create a trade order
|
634
634
|
:param str symbol: unified symbol of the market to create an order in
|
ccxt/async_support/bybit.py
CHANGED
@@ -7,7 +7,7 @@ from ccxt.async_support.base.exchange import Exchange
|
|
7
7
|
from ccxt.abstract.bybit import ImplicitAPI
|
8
8
|
import asyncio
|
9
9
|
import hashlib
|
10
|
-
from ccxt.base.types import Balances, Currency, Greeks, Int, Market, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
|
10
|
+
from ccxt.base.types import Balances, Currency, Greeks, Int, Market, Order, TransferEntry, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
|
11
11
|
from typing import List
|
12
12
|
from ccxt.base.errors import ExchangeError
|
13
13
|
from ccxt.base.errors import PermissionDenied
|
@@ -3333,7 +3333,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
3333
3333
|
raise NotSupported(self.id + ' createMarketSellOrderWithCost() supports spot orders only')
|
3334
3334
|
return await self.create_order(symbol, 'market', 'sell', cost, 1, params)
|
3335
3335
|
|
3336
|
-
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
|
3336
|
+
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
|
3337
3337
|
"""
|
3338
3338
|
create a trade order
|
3339
3339
|
:see: https://bybit-exchange.github.io/docs/v5/order/create-order
|
@@ -3393,7 +3393,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
3393
3393
|
order = self.safe_value(response, 'result', {})
|
3394
3394
|
return self.parse_order(order, market)
|
3395
3395
|
|
3396
|
-
def create_order_request(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}, isUTA=True):
|
3396
|
+
def create_order_request(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}, isUTA=True):
|
3397
3397
|
market = self.market(symbol)
|
3398
3398
|
symbol = market['symbol']
|
3399
3399
|
lowerCaseType = type.lower()
|
@@ -3490,7 +3490,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
3490
3490
|
takeProfitTriggerPrice = self.safe_value(params, 'takeProfitPrice')
|
3491
3491
|
stopLoss = self.safe_value(params, 'stopLoss')
|
3492
3492
|
takeProfit = self.safe_value(params, 'takeProfit')
|
3493
|
-
trailingTriggerPrice = self.safe_string_2(params, 'trailingTriggerPrice', 'activePrice', price)
|
3493
|
+
trailingTriggerPrice = self.safe_string_2(params, 'trailingTriggerPrice', 'activePrice', self.number_to_string(price))
|
3494
3494
|
trailingAmount = self.safe_string_2(params, 'trailingAmount', 'trailingStop')
|
3495
3495
|
isTrailingAmountOrder = trailingAmount is not None
|
3496
3496
|
isStopLossTriggerOrder = stopLossTriggerPrice is not None
|
@@ -3627,7 +3627,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
3627
3627
|
#
|
3628
3628
|
return self.parse_orders(data)
|
3629
3629
|
|
3630
|
-
async def create_usdc_order(self, symbol, type, side, amount, price=None, params={}):
|
3630
|
+
async def create_usdc_order(self, symbol, type, side, amount: float, price: float = None, params={}):
|
3631
3631
|
await self.load_markets()
|
3632
3632
|
market = self.market(symbol)
|
3633
3633
|
if type == 'market':
|
@@ -5204,7 +5204,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
5204
5204
|
}
|
5205
5205
|
return self.safe_string(types, type, type)
|
5206
5206
|
|
5207
|
-
async def withdraw(self, code: str, amount, address, tag=None, params={}):
|
5207
|
+
async def withdraw(self, code: str, amount: float, address, tag=None, params={}):
|
5208
5208
|
"""
|
5209
5209
|
make a withdrawal
|
5210
5210
|
:see: https://bybit-exchange.github.io/docs/v5/asset/withdraw
|
@@ -5770,7 +5770,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
5770
5770
|
response = await self.privatePostV5PositionSwitchIsolated(self.extend(request, params))
|
5771
5771
|
return response
|
5772
5772
|
|
5773
|
-
async def set_leverage(self, leverage, symbol: Str = None, params={}):
|
5773
|
+
async def set_leverage(self, leverage: Int, symbol: Str = None, params={}):
|
5774
5774
|
"""
|
5775
5775
|
set the level of leverage for a market
|
5776
5776
|
:see: https://bybit-exchange.github.io/docs/v5/position/leverage
|
@@ -6133,7 +6133,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
6133
6133
|
'info': info,
|
6134
6134
|
}
|
6135
6135
|
|
6136
|
-
async def transfer(self, code: str, amount, fromAccount, toAccount, params={}):
|
6136
|
+
async def transfer(self, code: str, amount: float, fromAccount, toAccount, params={}) -> TransferEntry:
|
6137
6137
|
"""
|
6138
6138
|
transfer currency internally between wallets on the same account
|
6139
6139
|
:see: https://bybit-exchange.github.io/docs/v5/asset/create-inter-transfer
|
@@ -6237,7 +6237,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
6237
6237
|
data = self.add_pagination_cursor_to_result(response)
|
6238
6238
|
return self.parse_transfers(data, currency, since, limit)
|
6239
6239
|
|
6240
|
-
async def borrow_cross_margin(self, code: str, amount, params={}):
|
6240
|
+
async def borrow_cross_margin(self, code: str, amount: float, params={}):
|
6241
6241
|
"""
|
6242
6242
|
create a loan to borrow margin
|
6243
6243
|
:see: https://bybit-exchange.github.io/docs/v5/spot-margin-normal/borrow
|
ccxt/async_support/cex.py
CHANGED
@@ -720,7 +720,7 @@ class cex(Exchange, ImplicitAPI):
|
|
720
720
|
}
|
721
721
|
return result
|
722
722
|
|
723
|
-
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
|
723
|
+
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
|
724
724
|
"""
|
725
725
|
:see: https://docs.cex.io/#place-order
|
726
726
|
create a trade order
|