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/gate.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.gate import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Balances, Currency, Greeks, Int, Market, Order, OrderBook, OrderRequest, OrderSide, OrderType, FundingHistory, Str, Strings, Ticker, Tickers, Trade, Transaction
|
9
|
+
from ccxt.base.types import Balances, Currency, Greeks, Int, Market, Order, TransferEntry, OrderBook, OrderRequest, OrderSide, OrderType, FundingHistory, 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
|
@@ -1590,32 +1590,33 @@ class gate(Exchange, ImplicitAPI):
|
|
1590
1590
|
withdrawAvailable = self.safe_value(result[code], 'withdraw')
|
1591
1591
|
withdrawAvailable = withdrawEnabled if (withdrawEnabled) else withdrawAvailable
|
1592
1592
|
networks = self.safe_value(result[code], 'networks', {})
|
1593
|
-
|
1594
|
-
|
1595
|
-
|
1596
|
-
|
1597
|
-
|
1598
|
-
|
1599
|
-
|
1600
|
-
|
1601
|
-
|
1602
|
-
|
1603
|
-
|
1604
|
-
|
1605
|
-
'
|
1606
|
-
'
|
1607
|
-
|
1608
|
-
|
1609
|
-
|
1610
|
-
'
|
1611
|
-
|
1612
|
-
|
1613
|
-
|
1614
|
-
'
|
1615
|
-
|
1593
|
+
if networkCode is not None:
|
1594
|
+
networks[networkCode] = {
|
1595
|
+
'info': entry,
|
1596
|
+
'id': networkId,
|
1597
|
+
'network': networkCode,
|
1598
|
+
'currencyId': currencyId,
|
1599
|
+
'lowerCaseCurrencyId': currencyIdLower,
|
1600
|
+
'deposit': depositEnabled,
|
1601
|
+
'withdraw': withdrawEnabled,
|
1602
|
+
'active': active,
|
1603
|
+
'fee': None,
|
1604
|
+
'precision': self.parse_number('1e-4'),
|
1605
|
+
'limits': {
|
1606
|
+
'amount': {
|
1607
|
+
'min': None,
|
1608
|
+
'max': None,
|
1609
|
+
},
|
1610
|
+
'withdraw': {
|
1611
|
+
'min': None,
|
1612
|
+
'max': None,
|
1613
|
+
},
|
1614
|
+
'deposit': {
|
1615
|
+
'min': None,
|
1616
|
+
'max': None,
|
1617
|
+
},
|
1616
1618
|
},
|
1617
|
-
}
|
1618
|
-
}
|
1619
|
+
}
|
1619
1620
|
result[code]['networks'] = networks
|
1620
1621
|
info = self.safe_value(result[code], 'info', [])
|
1621
1622
|
info.append(entry)
|
@@ -2502,6 +2503,7 @@ class gate(Exchange, ImplicitAPI):
|
|
2502
2503
|
type, query = self.handle_market_type_and_params('fetchTickers', market, params)
|
2503
2504
|
request, requestParams = self.prepare_request(None, type, query)
|
2504
2505
|
response = None
|
2506
|
+
request['timezone'] = 'utc0' # default to utc
|
2505
2507
|
if type == 'spot' or type == 'margin':
|
2506
2508
|
response = self.publicSpotGetTickers(self.extend(request, requestParams))
|
2507
2509
|
elif type == 'swap':
|
@@ -2515,7 +2517,7 @@ class gate(Exchange, ImplicitAPI):
|
|
2515
2517
|
request['underlying'] = self.safe_string(optionParts, 0)
|
2516
2518
|
response = self.publicOptionsGetTickers(self.extend(request, requestParams))
|
2517
2519
|
else:
|
2518
|
-
raise NotSupported(self.id + ' fetchTickers() not support self market type')
|
2520
|
+
raise NotSupported(self.id + ' fetchTickers() not support self market type, provide symbols or set params["defaultType"] to one from spot/margin/swap/future/option')
|
2519
2521
|
return self.parse_tickers(response, symbols)
|
2520
2522
|
|
2521
2523
|
def parse_balance_helper(self, entry):
|
@@ -3382,7 +3384,7 @@ class gate(Exchange, ImplicitAPI):
|
|
3382
3384
|
response = self.privateWalletGetWithdrawals(self.extend(request, params))
|
3383
3385
|
return self.parse_transactions(response, currency)
|
3384
3386
|
|
3385
|
-
def withdraw(self, code: str, amount, address, tag=None, params={}):
|
3387
|
+
def withdraw(self, code: str, amount: float, address, tag=None, params={}):
|
3386
3388
|
"""
|
3387
3389
|
make a withdrawal
|
3388
3390
|
:see: https://www.gate.io/docs/developers/apiv4/en/#withdraw
|
@@ -3529,7 +3531,7 @@ class gate(Exchange, ImplicitAPI):
|
|
3529
3531
|
},
|
3530
3532
|
}
|
3531
3533
|
|
3532
|
-
def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
|
3534
|
+
def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
|
3533
3535
|
"""
|
3534
3536
|
Create an order on the exchange
|
3535
3537
|
:see: https://www.gate.io/docs/developers/apiv4/en/#create-an-order
|
@@ -3695,7 +3697,7 @@ class gate(Exchange, ImplicitAPI):
|
|
3695
3697
|
response = self.privateFuturesPostSettleBatchOrders(ordersRequests)
|
3696
3698
|
return self.parse_orders(response)
|
3697
3699
|
|
3698
|
-
def create_order_request(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
|
3700
|
+
def create_order_request(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
|
3699
3701
|
market = self.market(symbol)
|
3700
3702
|
contract = market['contract']
|
3701
3703
|
trigger = self.safe_value(params, 'trigger')
|
@@ -4728,7 +4730,7 @@ class gate(Exchange, ImplicitAPI):
|
|
4728
4730
|
#
|
4729
4731
|
return self.parse_orders(response, market)
|
4730
4732
|
|
4731
|
-
def transfer(self, code: str, amount, fromAccount, toAccount, params={}):
|
4733
|
+
def transfer(self, code: str, amount: float, fromAccount, toAccount, params={}) -> TransferEntry:
|
4732
4734
|
"""
|
4733
4735
|
transfer currency internally between wallets on the same account
|
4734
4736
|
:see: https://www.gate.io/docs/developers/apiv4/en/#transfer-between-trading-accounts
|
@@ -4804,7 +4806,7 @@ class gate(Exchange, ImplicitAPI):
|
|
4804
4806
|
'info': transfer,
|
4805
4807
|
}
|
4806
4808
|
|
4807
|
-
def set_leverage(self, leverage, symbol: Str = None, params={}):
|
4809
|
+
def set_leverage(self, leverage: Int, symbol: Str = None, params={}):
|
4808
4810
|
"""
|
4809
4811
|
set the level of leverage for a market
|
4810
4812
|
:see: https://www.gate.io/docs/developers/apiv4/en/#update-position-leverage
|
@@ -4826,14 +4828,15 @@ class gate(Exchange, ImplicitAPI):
|
|
4826
4828
|
defaultMarginMode = self.safe_string_2(self.options, 'marginMode', 'defaultMarginMode')
|
4827
4829
|
crossLeverageLimit = self.safe_string(query, 'cross_leverage_limit')
|
4828
4830
|
marginMode = self.safe_string(query, 'marginMode', defaultMarginMode)
|
4831
|
+
stringifiedMargin = self.number_to_string(leverage)
|
4829
4832
|
if crossLeverageLimit is not None:
|
4830
4833
|
marginMode = 'cross'
|
4831
|
-
|
4834
|
+
stringifiedMargin = crossLeverageLimit
|
4832
4835
|
if marginMode == 'cross' or marginMode == 'cross_margin':
|
4833
|
-
request['cross_leverage_limit'] =
|
4836
|
+
request['cross_leverage_limit'] = stringifiedMargin
|
4834
4837
|
request['leverage'] = '0'
|
4835
4838
|
else:
|
4836
|
-
request['leverage'] =
|
4839
|
+
request['leverage'] = stringifiedMargin
|
4837
4840
|
response = None
|
4838
4841
|
if market['swap']:
|
4839
4842
|
response = self.privateFuturesPostSettlePositionsContractLeverage(self.extend(request, query))
|
@@ -5429,7 +5432,7 @@ class gate(Exchange, ImplicitAPI):
|
|
5429
5432
|
response = self.safe_value(response, 0)
|
5430
5433
|
return self.parse_margin_loan(response, currency)
|
5431
5434
|
|
5432
|
-
def borrow_isolated_margin(self, symbol: str, code: str, amount, params={}):
|
5435
|
+
def borrow_isolated_margin(self, symbol: str, code: str, amount: float, params={}):
|
5433
5436
|
"""
|
5434
5437
|
create a loan to borrow margin
|
5435
5438
|
:see: https://www.gate.io/docs/developers/apiv4/en/#marginuni
|
@@ -5472,7 +5475,7 @@ class gate(Exchange, ImplicitAPI):
|
|
5472
5475
|
#
|
5473
5476
|
return self.parse_margin_loan(response, currency)
|
5474
5477
|
|
5475
|
-
def borrow_cross_margin(self, code: str, amount, params={}):
|
5478
|
+
def borrow_cross_margin(self, code: str, amount: float, params={}):
|
5476
5479
|
"""
|
5477
5480
|
create a loan to borrow margin
|
5478
5481
|
:see: https://www.gate.io/docs/apiv4/en/#create-a-cross-margin-borrow-loan
|
@@ -6438,6 +6441,7 @@ class gate(Exchange, ImplicitAPI):
|
|
6438
6441
|
entryMarketId = self.safe_string(entry, 'name')
|
6439
6442
|
if entryMarketId == marketId:
|
6440
6443
|
return self.parse_greeks(entry, market)
|
6444
|
+
return None
|
6441
6445
|
|
6442
6446
|
def parse_greeks(self, greeks, market: Market = None):
|
6443
6447
|
#
|
ccxt/gemini.py
CHANGED
@@ -1262,7 +1262,7 @@ class gemini(Exchange, ImplicitAPI):
|
|
1262
1262
|
market = self.market(symbol) # throws on non-existent symbol
|
1263
1263
|
return self.parse_orders(response, market, since, limit)
|
1264
1264
|
|
1265
|
-
def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
|
1265
|
+
def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
|
1266
1266
|
"""
|
1267
1267
|
create a trade order
|
1268
1268
|
:see: https://docs.gemini.com/rest-api/#new-order
|
@@ -1409,7 +1409,7 @@ class gemini(Exchange, ImplicitAPI):
|
|
1409
1409
|
response = self.privatePostV1Mytrades(self.extend(request, params))
|
1410
1410
|
return self.parse_trades(response, market, since, limit)
|
1411
1411
|
|
1412
|
-
def withdraw(self, code: str, amount, address, tag=None, params={}):
|
1412
|
+
def withdraw(self, code: str, amount: float, address, tag=None, params={}):
|
1413
1413
|
"""
|
1414
1414
|
make a withdrawal
|
1415
1415
|
:param str code: unified currency code
|
ccxt/hitbtc.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.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
|
-
def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
|
2110
|
+
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
|
-
def transfer(self, code: str, amount, fromAccount, toAccount, params={}):
|
2403
|
+
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
|
-
def withdraw(self, code: str, amount, address, tag=None, params={}):
|
2484
|
+
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
|
-
def set_leverage(self, leverage, symbol: Str = None, params={}):
|
3152
|
+
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/hollaex.py
CHANGED
@@ -1079,7 +1079,7 @@ class hollaex(Exchange, ImplicitAPI):
|
|
1079
1079
|
'average': None,
|
1080
1080
|
}, market)
|
1081
1081
|
|
1082
|
-
def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
|
1082
|
+
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
|
-
def withdraw(self, code: str, amount, address, tag=None, params={}):
|
1587
|
+
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/htx.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.htx 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, Transaction
|
9
|
+
from ccxt.base.types import Balances, Currency, Int, Market, Order, TransferEntry, OrderBook, OrderRequest, 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
|
@@ -2714,7 +2714,7 @@ class htx(Exchange, ImplicitAPI):
|
|
2714
2714
|
trades = self.safe_value(trades, 'trades')
|
2715
2715
|
return self.parse_trades(trades, market, since, limit)
|
2716
2716
|
|
2717
|
-
def fetch_trades(self, symbol: str, since: Int = None, limit=1000, params={}) -> List[Trade]:
|
2717
|
+
def fetch_trades(self, symbol: str, since: Int = None, limit: Int = 1000, params={}) -> List[Trade]:
|
2718
2718
|
"""
|
2719
2719
|
:see: https://huobiapi.github.io/docs/spot/v1/en/#get-the-most-recent-trades
|
2720
2720
|
:see: https://huobiapi.github.io/docs/dm/v1/en/#query-a-batch-of-trade-records-of-a-contract
|
@@ -4789,7 +4789,7 @@ class htx(Exchange, ImplicitAPI):
|
|
4789
4789
|
params['trailingTriggerPrice'] = trailingTriggerPrice
|
4790
4790
|
return self.create_order(symbol, type, side, amount, price, params)
|
4791
4791
|
|
4792
|
-
def create_spot_order_request(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
|
4792
|
+
def create_spot_order_request(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
|
4793
4793
|
"""
|
4794
4794
|
* @ignore
|
4795
4795
|
helper function to build request
|
@@ -4893,7 +4893,7 @@ class htx(Exchange, ImplicitAPI):
|
|
4893
4893
|
params = self.omit(params, ['stopPrice', 'stop-price', 'clientOrderId', 'client-order-id', 'operator', 'timeInForce'])
|
4894
4894
|
return self.extend(request, params)
|
4895
4895
|
|
4896
|
-
def create_contract_order_request(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
|
4896
|
+
def create_contract_order_request(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
|
4897
4897
|
"""
|
4898
4898
|
* @ignore
|
4899
4899
|
helper function to build request
|
@@ -4974,7 +4974,7 @@ class htx(Exchange, ImplicitAPI):
|
|
4974
4974
|
params = self.omit(params, ['reduceOnly', 'stopPrice', 'stopLossPrice', 'takeProfitPrice', 'triggerType', 'leverRate', 'timeInForce', 'leverage', 'trailingPercent', 'trailingTriggerPrice'])
|
4975
4975
|
return self.extend(request, params)
|
4976
4976
|
|
4977
|
-
def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
|
4977
|
+
def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
|
4978
4978
|
"""
|
4979
4979
|
create a trade order
|
4980
4980
|
:see: https://huobiapi.github.io/docs/spot/v1/en/#place-a-new-order # spot, margin
|
@@ -5946,7 +5946,7 @@ class htx(Exchange, ImplicitAPI):
|
|
5946
5946
|
}
|
5947
5947
|
return self.safe_string(statuses, status, status)
|
5948
5948
|
|
5949
|
-
def withdraw(self, code: str, amount, address, tag=None, params={}):
|
5949
|
+
def withdraw(self, code: str, amount: float, address, tag=None, params={}):
|
5950
5950
|
"""
|
5951
5951
|
make a withdrawal
|
5952
5952
|
:param str code: unified currency code
|
@@ -6022,7 +6022,7 @@ class htx(Exchange, ImplicitAPI):
|
|
6022
6022
|
'status': None,
|
6023
6023
|
}
|
6024
6024
|
|
6025
|
-
def transfer(self, code: str, amount, fromAccount, toAccount, params={}):
|
6025
|
+
def transfer(self, code: str, amount: float, fromAccount, toAccount, params={}) -> TransferEntry:
|
6026
6026
|
"""
|
6027
6027
|
transfer currency internally between wallets on the same account
|
6028
6028
|
:see: https://huobiapi.github.io/docs/dm/v1/en/#transfer-margin-between-spot-account-and-future-account
|
@@ -6715,7 +6715,7 @@ class htx(Exchange, ImplicitAPI):
|
|
6715
6715
|
data = self.safe_value(response, 'data', [])
|
6716
6716
|
return self.parse_incomes(data, market, since, limit)
|
6717
6717
|
|
6718
|
-
def set_leverage(self, leverage, symbol: Str = None, params={}):
|
6718
|
+
def set_leverage(self, leverage: Int, symbol: Str = None, params={}):
|
6719
6719
|
"""
|
6720
6720
|
set the level of leverage for a market
|
6721
6721
|
:param float leverage: the rate of leverage
|
@@ -7800,7 +7800,7 @@ class htx(Exchange, ImplicitAPI):
|
|
7800
7800
|
'info': interest,
|
7801
7801
|
}, market)
|
7802
7802
|
|
7803
|
-
def borrow_isolated_margin(self, symbol: str, code: str, amount, params={}):
|
7803
|
+
def borrow_isolated_margin(self, symbol: str, code: str, amount: float, params={}):
|
7804
7804
|
"""
|
7805
7805
|
create a loan to borrow margin
|
7806
7806
|
:see: https://huobiapi.github.io/docs/spot/v1/en/#request-a-margin-loan-isolated
|
@@ -7833,7 +7833,7 @@ class htx(Exchange, ImplicitAPI):
|
|
7833
7833
|
'symbol': symbol,
|
7834
7834
|
})
|
7835
7835
|
|
7836
|
-
def borrow_cross_margin(self, code: str, amount, params={}):
|
7836
|
+
def borrow_cross_margin(self, code: str, amount: float, params={}):
|
7837
7837
|
"""
|
7838
7838
|
create a loan to borrow margin
|
7839
7839
|
:see: https://huobiapi.github.io/docs/spot/v1/en/#request-a-margin-loan-isolated
|
ccxt/huobijp.py
CHANGED
@@ -837,7 +837,7 @@ class huobijp(Exchange, ImplicitAPI):
|
|
837
837
|
response = self.privateGetOrderMatchresults(self.extend(request, params))
|
838
838
|
return self.parse_trades(response['data'], market, since, limit)
|
839
839
|
|
840
|
-
def fetch_trades(self, symbol: str, since: Int = None, limit=1000, params={}) -> List[Trade]:
|
840
|
+
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
|
-
def fetch_ohlcv(self, symbol: str, timeframe='1m', since: Int = None, limit=1000, params={}) -> List[list]:
|
913
|
+
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 self.create_order(symbol, 'market', 'buy', cost, None, params)
|
1322
1322
|
|
1323
|
-
def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
|
1323
|
+
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
|
-
def withdraw(self, code: str, amount, address, tag=None, params={}):
|
1699
|
+
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/idex.py
CHANGED
@@ -1084,7 +1084,7 @@ class idex(Exchange, ImplicitAPI):
|
|
1084
1084
|
result = self.privatePostWallets(request)
|
1085
1085
|
return result
|
1086
1086
|
|
1087
|
-
def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
|
1087
|
+
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 = self.privatePostOrders(request)
|
1260
1260
|
return self.parse_order(response, market)
|
1261
1261
|
|
1262
|
-
def withdraw(self, code: str, amount, address, tag=None, params={}):
|
1262
|
+
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
|
ccxt/independentreserve.py
CHANGED
@@ -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
|
-
def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit=50, params={}):
|
507
|
+
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
|
-
def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
|
628
|
+
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/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
|
-
def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
|
662
|
+
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
|
-
def withdraw(self, code: str, amount, address, tag=None, params={}):
|
843
|
+
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/kraken.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.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
|
-
def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
|
1301
|
+
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
|
-
def withdraw(self, code: str, amount, address, tag=None, params={}):
|
2483
|
+
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 self.transfer(code, amount, 'spot', 'swap', params)
|
2561
2599
|
|
2562
|
-
def transfer(self, code: str, amount, fromAccount, toAccount, params={}):
|
2600
|
+
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)
|
ccxt/krakenfutures.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.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
|
-
def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
|
872
|
+
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 self.transfer(code, amount, 'future', 'spot', params)
|
2117
2117
|
|
2118
|
-
def transfer(self, code: str, amount, fromAccount, toAccount, params={}):
|
2118
|
+
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
|
-
def set_leverage(self, leverage, symbol: Str = None, params={}):
|
2161
|
+
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/kucoin.py
CHANGED
@@ -8,7 +8,7 @@ from ccxt.abstract.kucoin import ImplicitAPI
|
|
8
8
|
import hashlib
|
9
9
|
import math
|
10
10
|
import json
|
11
|
-
from ccxt.base.types import Balances, Currency, Int, Market, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
|
11
|
+
from ccxt.base.types import Balances, Currency, Int, Market, Order, TransferEntry, OrderBook, OrderRequest, 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
|
@@ -1823,7 +1823,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
1823
1823
|
raise ExchangeError(self.id + ' createOrder() - you should use either triggerPrice or stopLossPrice or takeProfitPrice')
|
1824
1824
|
return [triggerPrice, stopLossPrice, takeProfitPrice]
|
1825
1825
|
|
1826
|
-
def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
|
1826
|
+
def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
|
1827
1827
|
"""
|
1828
1828
|
Create an order on the exchange
|
1829
1829
|
:see: https://docs.kucoin.com/spot#place-a-new-order
|
@@ -2016,7 +2016,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2016
2016
|
data = self.safe_value(data, 'data', [])
|
2017
2017
|
return self.parse_orders(data)
|
2018
2018
|
|
2019
|
-
def create_order_request(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
|
2019
|
+
def create_order_request(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
|
2020
2020
|
market = self.market(symbol)
|
2021
2021
|
# required param, cannot be used twice
|
2022
2022
|
clientOrderId = self.safe_string_2(params, 'clientOid', 'clientOrderId', self.uuid())
|
@@ -2911,7 +2911,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2911
2911
|
'tierBased': True,
|
2912
2912
|
}
|
2913
2913
|
|
2914
|
-
def withdraw(self, code: str, amount, address, tag=None, params={}):
|
2914
|
+
def withdraw(self, code: str, amount: float, address, tag=None, params={}):
|
2915
2915
|
"""
|
2916
2916
|
make a withdrawal
|
2917
2917
|
:see: https://docs.kucoin.com/#apply-withdraw-2
|
@@ -3372,7 +3372,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
3372
3372
|
returnType = result if isolated else self.safe_balance(result)
|
3373
3373
|
return returnType
|
3374
3374
|
|
3375
|
-
def transfer(self, code: str, amount, fromAccount, toAccount, params={}):
|
3375
|
+
def transfer(self, code: str, amount: float, fromAccount, toAccount, params={}) -> TransferEntry:
|
3376
3376
|
"""
|
3377
3377
|
transfer currency internally between wallets on the same account
|
3378
3378
|
:see: https://docs.kucoin.com/#inner-transfer
|
@@ -3944,7 +3944,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
3944
3944
|
'info': info,
|
3945
3945
|
}
|
3946
3946
|
|
3947
|
-
def borrow_cross_margin(self, code: str, amount, params={}):
|
3947
|
+
def borrow_cross_margin(self, code: str, amount: float, params={}):
|
3948
3948
|
"""
|
3949
3949
|
create a loan to borrow margin
|
3950
3950
|
:see: https://docs.kucoin.com/#1-margin-borrowing
|
@@ -3977,7 +3977,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
3977
3977
|
data = self.safe_value(response, 'data', {})
|
3978
3978
|
return self.parse_margin_loan(data, currency)
|
3979
3979
|
|
3980
|
-
def borrow_isolated_margin(self, symbol: str, code: str, amount, params={}):
|
3980
|
+
def borrow_isolated_margin(self, symbol: str, code: str, amount: float, params={}):
|
3981
3981
|
"""
|
3982
3982
|
create a loan to borrow margin
|
3983
3983
|
:see: https://docs.kucoin.com/#1-margin-borrowing
|
@@ -4149,7 +4149,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
4149
4149
|
endpart = ''
|
4150
4150
|
headers = headers if (headers is not None) else {}
|
4151
4151
|
url = self.urls['api'][api]
|
4152
|
-
if query:
|
4152
|
+
if not self.is_empty(query):
|
4153
4153
|
if (method == 'GET') or (method == 'DELETE'):
|
4154
4154
|
endpoint += '?' + self.rawencode(query)
|
4155
4155
|
else:
|