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/gate.py
CHANGED
@@ -7,7 +7,7 @@ from ccxt.async_support.base.exchange import Exchange
|
|
7
7
|
from ccxt.abstract.gate 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, FundingHistory, Str, Strings, Ticker, Tickers, Trade, Transaction
|
10
|
+
from ccxt.base.types import Balances, Currency, Greeks, Int, Market, Order, TransferEntry, OrderBook, OrderRequest, OrderSide, OrderType, FundingHistory, 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
|
@@ -1591,32 +1591,33 @@ class gate(Exchange, ImplicitAPI):
|
|
1591
1591
|
withdrawAvailable = self.safe_value(result[code], 'withdraw')
|
1592
1592
|
withdrawAvailable = withdrawEnabled if (withdrawEnabled) else withdrawAvailable
|
1593
1593
|
networks = self.safe_value(result[code], 'networks', {})
|
1594
|
-
|
1595
|
-
|
1596
|
-
|
1597
|
-
|
1598
|
-
|
1599
|
-
|
1600
|
-
|
1601
|
-
|
1602
|
-
|
1603
|
-
|
1604
|
-
|
1605
|
-
|
1606
|
-
'
|
1607
|
-
'
|
1608
|
-
|
1609
|
-
|
1610
|
-
|
1611
|
-
'
|
1612
|
-
|
1613
|
-
|
1614
|
-
|
1615
|
-
'
|
1616
|
-
|
1594
|
+
if networkCode is not None:
|
1595
|
+
networks[networkCode] = {
|
1596
|
+
'info': entry,
|
1597
|
+
'id': networkId,
|
1598
|
+
'network': networkCode,
|
1599
|
+
'currencyId': currencyId,
|
1600
|
+
'lowerCaseCurrencyId': currencyIdLower,
|
1601
|
+
'deposit': depositEnabled,
|
1602
|
+
'withdraw': withdrawEnabled,
|
1603
|
+
'active': active,
|
1604
|
+
'fee': None,
|
1605
|
+
'precision': self.parse_number('1e-4'),
|
1606
|
+
'limits': {
|
1607
|
+
'amount': {
|
1608
|
+
'min': None,
|
1609
|
+
'max': None,
|
1610
|
+
},
|
1611
|
+
'withdraw': {
|
1612
|
+
'min': None,
|
1613
|
+
'max': None,
|
1614
|
+
},
|
1615
|
+
'deposit': {
|
1616
|
+
'min': None,
|
1617
|
+
'max': None,
|
1618
|
+
},
|
1617
1619
|
},
|
1618
|
-
}
|
1619
|
-
}
|
1620
|
+
}
|
1620
1621
|
result[code]['networks'] = networks
|
1621
1622
|
info = self.safe_value(result[code], 'info', [])
|
1622
1623
|
info.append(entry)
|
@@ -2503,6 +2504,7 @@ class gate(Exchange, ImplicitAPI):
|
|
2503
2504
|
type, query = self.handle_market_type_and_params('fetchTickers', market, params)
|
2504
2505
|
request, requestParams = self.prepare_request(None, type, query)
|
2505
2506
|
response = None
|
2507
|
+
request['timezone'] = 'utc0' # default to utc
|
2506
2508
|
if type == 'spot' or type == 'margin':
|
2507
2509
|
response = await self.publicSpotGetTickers(self.extend(request, requestParams))
|
2508
2510
|
elif type == 'swap':
|
@@ -2516,7 +2518,7 @@ class gate(Exchange, ImplicitAPI):
|
|
2516
2518
|
request['underlying'] = self.safe_string(optionParts, 0)
|
2517
2519
|
response = await self.publicOptionsGetTickers(self.extend(request, requestParams))
|
2518
2520
|
else:
|
2519
|
-
raise NotSupported(self.id + ' fetchTickers() not support self market type')
|
2521
|
+
raise NotSupported(self.id + ' fetchTickers() not support self market type, provide symbols or set params["defaultType"] to one from spot/margin/swap/future/option')
|
2520
2522
|
return self.parse_tickers(response, symbols)
|
2521
2523
|
|
2522
2524
|
def parse_balance_helper(self, entry):
|
@@ -3383,7 +3385,7 @@ class gate(Exchange, ImplicitAPI):
|
|
3383
3385
|
response = await self.privateWalletGetWithdrawals(self.extend(request, params))
|
3384
3386
|
return self.parse_transactions(response, currency)
|
3385
3387
|
|
3386
|
-
async def withdraw(self, code: str, amount, address, tag=None, params={}):
|
3388
|
+
async def withdraw(self, code: str, amount: float, address, tag=None, params={}):
|
3387
3389
|
"""
|
3388
3390
|
make a withdrawal
|
3389
3391
|
:see: https://www.gate.io/docs/developers/apiv4/en/#withdraw
|
@@ -3530,7 +3532,7 @@ class gate(Exchange, ImplicitAPI):
|
|
3530
3532
|
},
|
3531
3533
|
}
|
3532
3534
|
|
3533
|
-
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
|
3535
|
+
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
|
3534
3536
|
"""
|
3535
3537
|
Create an order on the exchange
|
3536
3538
|
:see: https://www.gate.io/docs/developers/apiv4/en/#create-an-order
|
@@ -3696,7 +3698,7 @@ class gate(Exchange, ImplicitAPI):
|
|
3696
3698
|
response = await self.privateFuturesPostSettleBatchOrders(ordersRequests)
|
3697
3699
|
return self.parse_orders(response)
|
3698
3700
|
|
3699
|
-
def create_order_request(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
|
3701
|
+
def create_order_request(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
|
3700
3702
|
market = self.market(symbol)
|
3701
3703
|
contract = market['contract']
|
3702
3704
|
trigger = self.safe_value(params, 'trigger')
|
@@ -4729,7 +4731,7 @@ class gate(Exchange, ImplicitAPI):
|
|
4729
4731
|
#
|
4730
4732
|
return self.parse_orders(response, market)
|
4731
4733
|
|
4732
|
-
async def transfer(self, code: str, amount, fromAccount, toAccount, params={}):
|
4734
|
+
async def transfer(self, code: str, amount: float, fromAccount, toAccount, params={}) -> TransferEntry:
|
4733
4735
|
"""
|
4734
4736
|
transfer currency internally between wallets on the same account
|
4735
4737
|
:see: https://www.gate.io/docs/developers/apiv4/en/#transfer-between-trading-accounts
|
@@ -4805,7 +4807,7 @@ class gate(Exchange, ImplicitAPI):
|
|
4805
4807
|
'info': transfer,
|
4806
4808
|
}
|
4807
4809
|
|
4808
|
-
async def set_leverage(self, leverage, symbol: Str = None, params={}):
|
4810
|
+
async def set_leverage(self, leverage: Int, symbol: Str = None, params={}):
|
4809
4811
|
"""
|
4810
4812
|
set the level of leverage for a market
|
4811
4813
|
:see: https://www.gate.io/docs/developers/apiv4/en/#update-position-leverage
|
@@ -4827,14 +4829,15 @@ class gate(Exchange, ImplicitAPI):
|
|
4827
4829
|
defaultMarginMode = self.safe_string_2(self.options, 'marginMode', 'defaultMarginMode')
|
4828
4830
|
crossLeverageLimit = self.safe_string(query, 'cross_leverage_limit')
|
4829
4831
|
marginMode = self.safe_string(query, 'marginMode', defaultMarginMode)
|
4832
|
+
stringifiedMargin = self.number_to_string(leverage)
|
4830
4833
|
if crossLeverageLimit is not None:
|
4831
4834
|
marginMode = 'cross'
|
4832
|
-
|
4835
|
+
stringifiedMargin = crossLeverageLimit
|
4833
4836
|
if marginMode == 'cross' or marginMode == 'cross_margin':
|
4834
|
-
request['cross_leverage_limit'] =
|
4837
|
+
request['cross_leverage_limit'] = stringifiedMargin
|
4835
4838
|
request['leverage'] = '0'
|
4836
4839
|
else:
|
4837
|
-
request['leverage'] =
|
4840
|
+
request['leverage'] = stringifiedMargin
|
4838
4841
|
response = None
|
4839
4842
|
if market['swap']:
|
4840
4843
|
response = await self.privateFuturesPostSettlePositionsContractLeverage(self.extend(request, query))
|
@@ -5430,7 +5433,7 @@ class gate(Exchange, ImplicitAPI):
|
|
5430
5433
|
response = self.safe_value(response, 0)
|
5431
5434
|
return self.parse_margin_loan(response, currency)
|
5432
5435
|
|
5433
|
-
async def borrow_isolated_margin(self, symbol: str, code: str, amount, params={}):
|
5436
|
+
async def borrow_isolated_margin(self, symbol: str, code: str, amount: float, params={}):
|
5434
5437
|
"""
|
5435
5438
|
create a loan to borrow margin
|
5436
5439
|
:see: https://www.gate.io/docs/developers/apiv4/en/#marginuni
|
@@ -5473,7 +5476,7 @@ class gate(Exchange, ImplicitAPI):
|
|
5473
5476
|
#
|
5474
5477
|
return self.parse_margin_loan(response, currency)
|
5475
5478
|
|
5476
|
-
async def borrow_cross_margin(self, code: str, amount, params={}):
|
5479
|
+
async def borrow_cross_margin(self, code: str, amount: float, params={}):
|
5477
5480
|
"""
|
5478
5481
|
create a loan to borrow margin
|
5479
5482
|
:see: https://www.gate.io/docs/apiv4/en/#create-a-cross-margin-borrow-loan
|
@@ -6439,6 +6442,7 @@ class gate(Exchange, ImplicitAPI):
|
|
6439
6442
|
entryMarketId = self.safe_string(entry, 'name')
|
6440
6443
|
if entryMarketId == marketId:
|
6441
6444
|
return self.parse_greeks(entry, market)
|
6445
|
+
return None
|
6442
6446
|
|
6443
6447
|
def parse_greeks(self, greeks, market: Market = None):
|
6444
6448
|
#
|
ccxt/async_support/gemini.py
CHANGED
@@ -1263,7 +1263,7 @@ class gemini(Exchange, ImplicitAPI):
|
|
1263
1263
|
market = self.market(symbol) # throws on non-existent symbol
|
1264
1264
|
return self.parse_orders(response, market, since, limit)
|
1265
1265
|
|
1266
|
-
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
|
1266
|
+
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
|
1267
1267
|
"""
|
1268
1268
|
create a trade order
|
1269
1269
|
:see: https://docs.gemini.com/rest-api/#new-order
|
@@ -1410,7 +1410,7 @@ class gemini(Exchange, ImplicitAPI):
|
|
1410
1410
|
response = await self.privatePostV1Mytrades(self.extend(request, params))
|
1411
1411
|
return self.parse_trades(response, market, since, limit)
|
1412
1412
|
|
1413
|
-
async def withdraw(self, code: str, amount, address, tag=None, params={}):
|
1413
|
+
async def withdraw(self, code: str, amount: float, address, tag=None, params={}):
|
1414
1414
|
"""
|
1415
1415
|
make a withdrawal
|
1416
1416
|
:param str code: unified currency code
|
ccxt/async_support/hitbtc.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.async_support.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.hitbtc import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Balances, Currency, Int, MarginMode, Market, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
|
9
|
+
from ccxt.base.types import Balances, Currency, Int, MarginMode, 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
|
@@ -2107,7 +2107,7 @@ class hitbtc(Exchange, ImplicitAPI):
|
|
2107
2107
|
raise NotSupported(self.id + ' editOrder() not support self market type')
|
2108
2108
|
return self.parse_order(response, market)
|
2109
2109
|
|
2110
|
-
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
|
2110
|
+
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
|
2111
2111
|
"""
|
2112
2112
|
create a trade order
|
2113
2113
|
:see: https://api.hitbtc.com/#create-new-spot-order
|
@@ -2400,7 +2400,7 @@ class hitbtc(Exchange, ImplicitAPI):
|
|
2400
2400
|
filteredMargin = self.filter_by_symbol(marginModes, symbol)
|
2401
2401
|
return self.safe_value(filteredMargin, 0)
|
2402
2402
|
|
2403
|
-
async def transfer(self, code: str, amount, fromAccount, toAccount, params={}):
|
2403
|
+
async def transfer(self, code: str, amount: float, fromAccount, toAccount, params={}) -> TransferEntry:
|
2404
2404
|
"""
|
2405
2405
|
transfer currency internally between wallets on the same account
|
2406
2406
|
:see: https://api.hitbtc.com/#transfer-between-wallet-and-exchange
|
@@ -2481,7 +2481,7 @@ class hitbtc(Exchange, ImplicitAPI):
|
|
2481
2481
|
'info': response,
|
2482
2482
|
}
|
2483
2483
|
|
2484
|
-
async def withdraw(self, code: str, amount, address, tag=None, params={}):
|
2484
|
+
async def withdraw(self, code: str, amount: float, address, tag=None, params={}):
|
2485
2485
|
"""
|
2486
2486
|
make a withdrawal
|
2487
2487
|
:see: https://api.hitbtc.com/#withdraw-crypto
|
@@ -3149,7 +3149,7 @@ class hitbtc(Exchange, ImplicitAPI):
|
|
3149
3149
|
#
|
3150
3150
|
return self.safe_number(response, 'leverage')
|
3151
3151
|
|
3152
|
-
async def set_leverage(self, leverage, symbol: Str = None, params={}):
|
3152
|
+
async def set_leverage(self, leverage: Int, symbol: Str = None, params={}):
|
3153
3153
|
"""
|
3154
3154
|
set the level of leverage for a market
|
3155
3155
|
:see: https://api.hitbtc.com/#create-update-margin-account-2
|
ccxt/async_support/hollaex.py
CHANGED
@@ -1079,7 +1079,7 @@ class hollaex(Exchange, ImplicitAPI):
|
|
1079
1079
|
'average': None,
|
1080
1080
|
}, market)
|
1081
1081
|
|
1082
|
-
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
|
1082
|
+
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
|
1083
1083
|
"""
|
1084
1084
|
create a trade order
|
1085
1085
|
:param str symbol: unified symbol of the market to create an order in
|
@@ -1584,7 +1584,7 @@ class hollaex(Exchange, ImplicitAPI):
|
|
1584
1584
|
'fee': fee,
|
1585
1585
|
}
|
1586
1586
|
|
1587
|
-
async def withdraw(self, code: str, amount, address, tag=None, params={}):
|
1587
|
+
async def withdraw(self, code: str, amount: float, address, tag=None, params={}):
|
1588
1588
|
"""
|
1589
1589
|
make a withdrawal
|
1590
1590
|
:param str code: unified currency code
|
ccxt/async_support/htx.py
CHANGED
@@ -7,7 +7,7 @@ from ccxt.async_support.base.exchange import Exchange
|
|
7
7
|
from ccxt.abstract.htx import ImplicitAPI
|
8
8
|
import asyncio
|
9
9
|
import hashlib
|
10
|
-
from ccxt.base.types import Balances, Currency, Int, Market, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
|
10
|
+
from ccxt.base.types import Balances, Currency, 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
|
@@ -2715,7 +2715,7 @@ class htx(Exchange, ImplicitAPI):
|
|
2715
2715
|
trades = self.safe_value(trades, 'trades')
|
2716
2716
|
return self.parse_trades(trades, market, since, limit)
|
2717
2717
|
|
2718
|
-
async def fetch_trades(self, symbol: str, since: Int = None, limit=1000, params={}) -> List[Trade]:
|
2718
|
+
async def fetch_trades(self, symbol: str, since: Int = None, limit: Int = 1000, params={}) -> List[Trade]:
|
2719
2719
|
"""
|
2720
2720
|
:see: https://huobiapi.github.io/docs/spot/v1/en/#get-the-most-recent-trades
|
2721
2721
|
:see: https://huobiapi.github.io/docs/dm/v1/en/#query-a-batch-of-trade-records-of-a-contract
|
@@ -4790,7 +4790,7 @@ class htx(Exchange, ImplicitAPI):
|
|
4790
4790
|
params['trailingTriggerPrice'] = trailingTriggerPrice
|
4791
4791
|
return await self.create_order(symbol, type, side, amount, price, params)
|
4792
4792
|
|
4793
|
-
async def create_spot_order_request(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
|
4793
|
+
async def create_spot_order_request(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
|
4794
4794
|
"""
|
4795
4795
|
* @ignore
|
4796
4796
|
helper function to build request
|
@@ -4894,7 +4894,7 @@ class htx(Exchange, ImplicitAPI):
|
|
4894
4894
|
params = self.omit(params, ['stopPrice', 'stop-price', 'clientOrderId', 'client-order-id', 'operator', 'timeInForce'])
|
4895
4895
|
return self.extend(request, params)
|
4896
4896
|
|
4897
|
-
def create_contract_order_request(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
|
4897
|
+
def create_contract_order_request(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
|
4898
4898
|
"""
|
4899
4899
|
* @ignore
|
4900
4900
|
helper function to build request
|
@@ -4975,7 +4975,7 @@ class htx(Exchange, ImplicitAPI):
|
|
4975
4975
|
params = self.omit(params, ['reduceOnly', 'stopPrice', 'stopLossPrice', 'takeProfitPrice', 'triggerType', 'leverRate', 'timeInForce', 'leverage', 'trailingPercent', 'trailingTriggerPrice'])
|
4976
4976
|
return self.extend(request, params)
|
4977
4977
|
|
4978
|
-
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
|
4978
|
+
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
|
4979
4979
|
"""
|
4980
4980
|
create a trade order
|
4981
4981
|
:see: https://huobiapi.github.io/docs/spot/v1/en/#place-a-new-order # spot, margin
|
@@ -5947,7 +5947,7 @@ class htx(Exchange, ImplicitAPI):
|
|
5947
5947
|
}
|
5948
5948
|
return self.safe_string(statuses, status, status)
|
5949
5949
|
|
5950
|
-
async def withdraw(self, code: str, amount, address, tag=None, params={}):
|
5950
|
+
async def withdraw(self, code: str, amount: float, address, tag=None, params={}):
|
5951
5951
|
"""
|
5952
5952
|
make a withdrawal
|
5953
5953
|
:param str code: unified currency code
|
@@ -6023,7 +6023,7 @@ class htx(Exchange, ImplicitAPI):
|
|
6023
6023
|
'status': None,
|
6024
6024
|
}
|
6025
6025
|
|
6026
|
-
async def transfer(self, code: str, amount, fromAccount, toAccount, params={}):
|
6026
|
+
async def transfer(self, code: str, amount: float, fromAccount, toAccount, params={}) -> TransferEntry:
|
6027
6027
|
"""
|
6028
6028
|
transfer currency internally between wallets on the same account
|
6029
6029
|
:see: https://huobiapi.github.io/docs/dm/v1/en/#transfer-margin-between-spot-account-and-future-account
|
@@ -6716,7 +6716,7 @@ class htx(Exchange, ImplicitAPI):
|
|
6716
6716
|
data = self.safe_value(response, 'data', [])
|
6717
6717
|
return self.parse_incomes(data, market, since, limit)
|
6718
6718
|
|
6719
|
-
async def set_leverage(self, leverage, symbol: Str = None, params={}):
|
6719
|
+
async def set_leverage(self, leverage: Int, symbol: Str = None, params={}):
|
6720
6720
|
"""
|
6721
6721
|
set the level of leverage for a market
|
6722
6722
|
:param float leverage: the rate of leverage
|
@@ -7801,7 +7801,7 @@ class htx(Exchange, ImplicitAPI):
|
|
7801
7801
|
'info': interest,
|
7802
7802
|
}, market)
|
7803
7803
|
|
7804
|
-
async def borrow_isolated_margin(self, symbol: str, code: str, amount, params={}):
|
7804
|
+
async def borrow_isolated_margin(self, symbol: str, code: str, amount: float, params={}):
|
7805
7805
|
"""
|
7806
7806
|
create a loan to borrow margin
|
7807
7807
|
:see: https://huobiapi.github.io/docs/spot/v1/en/#request-a-margin-loan-isolated
|
@@ -7834,7 +7834,7 @@ class htx(Exchange, ImplicitAPI):
|
|
7834
7834
|
'symbol': symbol,
|
7835
7835
|
})
|
7836
7836
|
|
7837
|
-
async def borrow_cross_margin(self, code: str, amount, params={}):
|
7837
|
+
async def borrow_cross_margin(self, code: str, amount: float, params={}):
|
7838
7838
|
"""
|
7839
7839
|
create a loan to borrow margin
|
7840
7840
|
:see: https://huobiapi.github.io/docs/spot/v1/en/#request-a-margin-loan-isolated
|
ccxt/async_support/huobijp.py
CHANGED
@@ -837,7 +837,7 @@ class huobijp(Exchange, ImplicitAPI):
|
|
837
837
|
response = await self.privateGetOrderMatchresults(self.extend(request, params))
|
838
838
|
return self.parse_trades(response['data'], market, since, limit)
|
839
839
|
|
840
|
-
async def fetch_trades(self, symbol: str, since: Int = None, limit=1000, params={}) -> List[Trade]:
|
840
|
+
async def fetch_trades(self, symbol: str, since: Int = None, limit: Int = 1000, params={}) -> List[Trade]:
|
841
841
|
"""
|
842
842
|
get the list of most recent trades for a particular symbol
|
843
843
|
:param str symbol: unified symbol of the market to fetch trades for
|
@@ -910,7 +910,7 @@ class huobijp(Exchange, ImplicitAPI):
|
|
910
910
|
self.safe_number(ohlcv, 'amount'),
|
911
911
|
]
|
912
912
|
|
913
|
-
async def fetch_ohlcv(self, symbol: str, timeframe='1m', since: Int = None, limit=1000, params={}) -> List[list]:
|
913
|
+
async def fetch_ohlcv(self, symbol: str, timeframe='1m', since: Int = None, limit: Int = 1000, params={}) -> List[list]:
|
914
914
|
"""
|
915
915
|
fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
916
916
|
:param str symbol: unified symbol of the market to fetch OHLCV data for
|
@@ -1320,7 +1320,7 @@ class huobijp(Exchange, ImplicitAPI):
|
|
1320
1320
|
params['createMarketBuyOrderRequiresPrice'] = False
|
1321
1321
|
return await self.create_order(symbol, 'market', 'buy', cost, None, params)
|
1322
1322
|
|
1323
|
-
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
|
1323
|
+
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
|
1324
1324
|
"""
|
1325
1325
|
create a trade order
|
1326
1326
|
:param str symbol: unified symbol of the market to create an order in
|
@@ -1696,7 +1696,7 @@ class huobijp(Exchange, ImplicitAPI):
|
|
1696
1696
|
}
|
1697
1697
|
return self.safe_string(statuses, status, status)
|
1698
1698
|
|
1699
|
-
async def withdraw(self, code: str, amount, address, tag=None, params={}):
|
1699
|
+
async def withdraw(self, code: str, amount: float, address, tag=None, params={}):
|
1700
1700
|
"""
|
1701
1701
|
make a withdrawal
|
1702
1702
|
:param str code: unified currency code
|
ccxt/async_support/idex.py
CHANGED
@@ -1084,7 +1084,7 @@ class idex(Exchange, ImplicitAPI):
|
|
1084
1084
|
result = await self.privatePostWallets(request)
|
1085
1085
|
return result
|
1086
1086
|
|
1087
|
-
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
|
1087
|
+
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
|
1088
1088
|
"""
|
1089
1089
|
create a trade order, https://docs.idex.io/#create-order
|
1090
1090
|
:param str symbol: unified symbol of the market to create an order in
|
@@ -1259,7 +1259,7 @@ class idex(Exchange, ImplicitAPI):
|
|
1259
1259
|
response = await self.privatePostOrders(request)
|
1260
1260
|
return self.parse_order(response, market)
|
1261
1261
|
|
1262
|
-
async def withdraw(self, code: str, amount, address, tag=None, params={}):
|
1262
|
+
async def withdraw(self, code: str, amount: float, address, tag=None, params={}):
|
1263
1263
|
"""
|
1264
1264
|
make a withdrawal
|
1265
1265
|
:param str code: unified currency code
|
@@ -504,7 +504,7 @@ class independentreserve(Exchange, ImplicitAPI):
|
|
504
504
|
data = self.safe_value(response, 'Data', [])
|
505
505
|
return self.parse_orders(data, market, since, limit)
|
506
506
|
|
507
|
-
async def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit=50, params={}):
|
507
|
+
async def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = 50, params={}):
|
508
508
|
"""
|
509
509
|
fetch all trades made by the user
|
510
510
|
:param str symbol: unified market symbol
|
@@ -625,7 +625,7 @@ class independentreserve(Exchange, ImplicitAPI):
|
|
625
625
|
}
|
626
626
|
return result
|
627
627
|
|
628
|
-
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
|
628
|
+
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
|
629
629
|
"""
|
630
630
|
create a trade order
|
631
631
|
:param str symbol: unified symbol of the market to create an order in
|
ccxt/async_support/indodax.py
CHANGED
@@ -659,7 +659,7 @@ class indodax(Exchange, ImplicitAPI):
|
|
659
659
|
orders = self.filter_by(orders, 'status', 'closed')
|
660
660
|
return self.filter_by_symbol_since_limit(orders, symbol, since, limit)
|
661
661
|
|
662
|
-
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
|
662
|
+
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
|
663
663
|
"""
|
664
664
|
create a trade order
|
665
665
|
:param str symbol: unified symbol of the market to create an order in
|
@@ -840,7 +840,7 @@ class indodax(Exchange, ImplicitAPI):
|
|
840
840
|
transactions = self.array_concat(withdraws, deposits)
|
841
841
|
return self.parse_transactions(transactions, currency, since, limit)
|
842
842
|
|
843
|
-
async def withdraw(self, code: str, amount, address, tag=None, params={}):
|
843
|
+
async def withdraw(self, code: str, amount: float, address, tag=None, params={}):
|
844
844
|
"""
|
845
845
|
make a withdrawal
|
846
846
|
:param str code: unified currency code
|
ccxt/async_support/kraken.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.async_support.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.kraken import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Balances, Currency, Int, Market, Order, OrderBook, OrderSide, OrderType, IndexType, Str, Strings, Ticker, Tickers, Trade, Transaction
|
9
|
+
from ccxt.base.types import Balances, Currency, Int, Market, Order, TransferEntry, OrderBook, OrderSide, OrderType, IndexType, 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
|
@@ -1298,7 +1298,7 @@ class kraken(Exchange, ImplicitAPI):
|
|
1298
1298
|
#
|
1299
1299
|
return self.parse_balance(response)
|
1300
1300
|
|
1301
|
-
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
|
1301
|
+
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
|
1302
1302
|
"""
|
1303
1303
|
:see: https://docs.kraken.com/rest/#tag/Trading/operation/addOrder
|
1304
1304
|
create a trade order
|
@@ -1458,6 +1458,41 @@ class kraken(Exchange, ImplicitAPI):
|
|
1458
1458
|
# "txid": "OTI672-HJFAO-XOIPPK"
|
1459
1459
|
# }
|
1460
1460
|
#
|
1461
|
+
# {
|
1462
|
+
# "error": [],
|
1463
|
+
# "result": {
|
1464
|
+
# "open": {
|
1465
|
+
# "OXVPSU-Q726F-L3SDEP": {
|
1466
|
+
# "refid": null,
|
1467
|
+
# "userref": 0,
|
1468
|
+
# "status": "open",
|
1469
|
+
# "opentm": 1706893367.4656649,
|
1470
|
+
# "starttm": 0,
|
1471
|
+
# "expiretm": 0,
|
1472
|
+
# "descr": {
|
1473
|
+
# "pair": "XRPEUR",
|
1474
|
+
# "type": "sell",
|
1475
|
+
# "ordertype": "trailing-stop",
|
1476
|
+
# "price": "+50.0000%",
|
1477
|
+
# "price2": "0",
|
1478
|
+
# "leverage": "none",
|
1479
|
+
# "order": "sell 10.00000000 XRPEUR @ trailing stop +50.0000%",
|
1480
|
+
# "close": ""
|
1481
|
+
# },
|
1482
|
+
# "vol": "10.00000000",
|
1483
|
+
# "vol_exec": "0.00000000",
|
1484
|
+
# "cost": "0.00000000",
|
1485
|
+
# "fee": "0.00000000",
|
1486
|
+
# "price": "0.00000000",
|
1487
|
+
# "stopprice": "0.23424000",
|
1488
|
+
# "limitprice": "0.46847000",
|
1489
|
+
# "misc": "",
|
1490
|
+
# "oflags": "fciq",
|
1491
|
+
# "trigger": "index"
|
1492
|
+
# }
|
1493
|
+
# }
|
1494
|
+
# }
|
1495
|
+
#
|
1461
1496
|
description = self.safe_value(order, 'descr', {})
|
1462
1497
|
orderDescription = self.safe_string(description, 'order', description)
|
1463
1498
|
side = None
|
@@ -1494,6 +1529,9 @@ class kraken(Exchange, ImplicitAPI):
|
|
1494
1529
|
# kraken truncates the cost in the api response so we will ignore it and calculate it from average & filled
|
1495
1530
|
# cost = self.safe_string(order, 'cost')
|
1496
1531
|
price = self.safe_string(description, 'price', price)
|
1532
|
+
# when type = trailling stop returns price = '+50.0000%'
|
1533
|
+
if (price is not None) and price.endswith('%'):
|
1534
|
+
price = None # self is not the price we want
|
1497
1535
|
if (price is None) or Precise.string_equals(price, '0'):
|
1498
1536
|
price = self.safe_string(description, 'price2')
|
1499
1537
|
if (price is None) or Precise.string_equals(price, '0'):
|
@@ -2442,7 +2480,7 @@ class kraken(Exchange, ImplicitAPI):
|
|
2442
2480
|
'info': depositAddress,
|
2443
2481
|
}
|
2444
2482
|
|
2445
|
-
async def withdraw(self, code: str, amount, address, tag=None, params={}):
|
2483
|
+
async def withdraw(self, code: str, amount: float, address, tag=None, params={}):
|
2446
2484
|
"""
|
2447
2485
|
make a withdrawal
|
2448
2486
|
:see: https://docs.kraken.com/rest/#tag/Funding/operation/withdrawFunds
|
@@ -2559,7 +2597,7 @@ class kraken(Exchange, ImplicitAPI):
|
|
2559
2597
|
"""
|
2560
2598
|
return await self.transfer(code, amount, 'spot', 'swap', params)
|
2561
2599
|
|
2562
|
-
async def transfer(self, code: str, amount, fromAccount, toAccount, params={}):
|
2600
|
+
async def transfer(self, code: str, amount: float, fromAccount, toAccount, params={}) -> TransferEntry:
|
2563
2601
|
"""
|
2564
2602
|
:see: https://docs.kraken.com/rest/#tag/User-Funding/operation/walletTransfer
|
2565
2603
|
transfers currencies between sub-accounts(only spot->swap direction is supported)
|
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.async_support.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.krakenfutures import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Balances, Currency, Int, Market, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade
|
9
|
+
from ccxt.base.types import Balances, Currency, Int, Market, Order, TransferEntry, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
12
|
from ccxt.base.errors import ArgumentsRequired
|
@@ -817,7 +817,7 @@ class krakenfutures(Exchange, ImplicitAPI):
|
|
817
817
|
'fee': None,
|
818
818
|
})
|
819
819
|
|
820
|
-
def create_order_request(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
|
820
|
+
def create_order_request(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
|
821
821
|
market = self.market(symbol)
|
822
822
|
type = self.safe_string(params, 'orderType', type)
|
823
823
|
timeInForce = self.safe_string(params, 'timeInForce')
|
@@ -869,7 +869,7 @@ class krakenfutures(Exchange, ImplicitAPI):
|
|
869
869
|
params = self.omit(params, ['clientOrderId', 'timeInForce', 'triggerPrice', 'stopLossPrice', 'takeProfitPrice'])
|
870
870
|
return self.extend(request, params)
|
871
871
|
|
872
|
-
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
|
872
|
+
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
|
873
873
|
"""
|
874
874
|
Create an order on the exchange
|
875
875
|
:see: https://docs.futures.kraken.com/#http-api-trading-v3-api-order-management-send-order
|
@@ -2115,7 +2115,7 @@ class krakenfutures(Exchange, ImplicitAPI):
|
|
2115
2115
|
"""
|
2116
2116
|
return await self.transfer(code, amount, 'future', 'spot', params)
|
2117
2117
|
|
2118
|
-
async def transfer(self, code: str, amount, fromAccount, toAccount, params={}):
|
2118
|
+
async def transfer(self, code: str, amount: float, fromAccount, toAccount, params={}) -> TransferEntry:
|
2119
2119
|
"""
|
2120
2120
|
:see: https://docs.futures.kraken.com/#http-api-trading-v3-api-transfers-initiate-wallet-transfer
|
2121
2121
|
:see: https://docs.futures.kraken.com/#http-api-trading-v3-api-transfers-initiate-withdrawal-to-spot-wallet
|
@@ -2158,7 +2158,7 @@ class krakenfutures(Exchange, ImplicitAPI):
|
|
2158
2158
|
'toAccount': toAccount,
|
2159
2159
|
})
|
2160
2160
|
|
2161
|
-
async def set_leverage(self, leverage, symbol: Str = None, params={}):
|
2161
|
+
async def set_leverage(self, leverage: Int, symbol: Str = None, params={}):
|
2162
2162
|
"""
|
2163
2163
|
set the level of leverage for a market
|
2164
2164
|
:see: https://docs.futures.kraken.com/#http-api-trading-v3-api-multi-collateral-set-the-leverage-setting-for-a-market
|
ccxt/async_support/kucoin.py
CHANGED
@@ -9,7 +9,7 @@ import asyncio
|
|
9
9
|
import hashlib
|
10
10
|
import math
|
11
11
|
import json
|
12
|
-
from ccxt.base.types import Balances, Currency, Int, Market, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
|
12
|
+
from ccxt.base.types import Balances, Currency, Int, Market, Order, TransferEntry, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
|
13
13
|
from typing import List
|
14
14
|
from ccxt.base.errors import ExchangeError
|
15
15
|
from ccxt.base.errors import PermissionDenied
|
@@ -1824,7 +1824,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
1824
1824
|
raise ExchangeError(self.id + ' createOrder() - you should use either triggerPrice or stopLossPrice or takeProfitPrice')
|
1825
1825
|
return [triggerPrice, stopLossPrice, takeProfitPrice]
|
1826
1826
|
|
1827
|
-
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
|
1827
|
+
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
|
1828
1828
|
"""
|
1829
1829
|
Create an order on the exchange
|
1830
1830
|
:see: https://docs.kucoin.com/spot#place-a-new-order
|
@@ -2017,7 +2017,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2017
2017
|
data = self.safe_value(data, 'data', [])
|
2018
2018
|
return self.parse_orders(data)
|
2019
2019
|
|
2020
|
-
def create_order_request(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
|
2020
|
+
def create_order_request(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
|
2021
2021
|
market = self.market(symbol)
|
2022
2022
|
# required param, cannot be used twice
|
2023
2023
|
clientOrderId = self.safe_string_2(params, 'clientOid', 'clientOrderId', self.uuid())
|
@@ -2912,7 +2912,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2912
2912
|
'tierBased': True,
|
2913
2913
|
}
|
2914
2914
|
|
2915
|
-
async def withdraw(self, code: str, amount, address, tag=None, params={}):
|
2915
|
+
async def withdraw(self, code: str, amount: float, address, tag=None, params={}):
|
2916
2916
|
"""
|
2917
2917
|
make a withdrawal
|
2918
2918
|
:see: https://docs.kucoin.com/#apply-withdraw-2
|
@@ -3373,7 +3373,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
3373
3373
|
returnType = result if isolated else self.safe_balance(result)
|
3374
3374
|
return returnType
|
3375
3375
|
|
3376
|
-
async def transfer(self, code: str, amount, fromAccount, toAccount, params={}):
|
3376
|
+
async def transfer(self, code: str, amount: float, fromAccount, toAccount, params={}) -> TransferEntry:
|
3377
3377
|
"""
|
3378
3378
|
transfer currency internally between wallets on the same account
|
3379
3379
|
:see: https://docs.kucoin.com/#inner-transfer
|
@@ -3945,7 +3945,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
3945
3945
|
'info': info,
|
3946
3946
|
}
|
3947
3947
|
|
3948
|
-
async def borrow_cross_margin(self, code: str, amount, params={}):
|
3948
|
+
async def borrow_cross_margin(self, code: str, amount: float, params={}):
|
3949
3949
|
"""
|
3950
3950
|
create a loan to borrow margin
|
3951
3951
|
:see: https://docs.kucoin.com/#1-margin-borrowing
|
@@ -3978,7 +3978,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
3978
3978
|
data = self.safe_value(response, 'data', {})
|
3979
3979
|
return self.parse_margin_loan(data, currency)
|
3980
3980
|
|
3981
|
-
async def borrow_isolated_margin(self, symbol: str, code: str, amount, params={}):
|
3981
|
+
async def borrow_isolated_margin(self, symbol: str, code: str, amount: float, params={}):
|
3982
3982
|
"""
|
3983
3983
|
create a loan to borrow margin
|
3984
3984
|
:see: https://docs.kucoin.com/#1-margin-borrowing
|
@@ -4150,7 +4150,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
4150
4150
|
endpart = ''
|
4151
4151
|
headers = headers if (headers is not None) else {}
|
4152
4152
|
url = self.urls['api'][api]
|
4153
|
-
if query:
|
4153
|
+
if not self.is_empty(query):
|
4154
4154
|
if (method == 'GET') or (method == 'DELETE'):
|
4155
4155
|
endpoint += '?' + self.rawencode(query)
|
4156
4156
|
else:
|