ccxt 4.2.30__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/abstract/coinbase.py +10 -0
- ccxt/abstract/okx.py +12 -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 +17 -16
- 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 +386 -40
- ccxt/async_support/bitflyer.py +5 -5
- ccxt/async_support/bitforex.py +4 -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 +16 -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 +5 -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 +11 -11
- 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 +45 -5
- ccxt/async_support/krakenfutures.py +8 -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 +5 -4
- 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 +26 -12
- 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 +4 -1
- ccxt/async_support/probit.py +5 -5
- ccxt/async_support/timex.py +2 -2
- 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 +6 -6
- 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 +77 -44
- ccxt/base/types.py +10 -0
- ccxt/bigone.py +25 -5
- ccxt/binance.py +17 -16
- 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 +386 -40
- ccxt/bitflyer.py +5 -5
- ccxt/bitforex.py +4 -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 +16 -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 +5 -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 +11 -11
- ccxt/huobijp.py +4 -4
- ccxt/idex.py +2 -2
- ccxt/independentreserve.py +2 -2
- ccxt/indodax.py +2 -2
- ccxt/kraken.py +45 -5
- ccxt/krakenfutures.py +8 -5
- ccxt/kucoin.py +8 -8
- ccxt/kucoinfutures.py +4 -4
- ccxt/kuna.py +2 -2
- ccxt/latoken.py +3 -3
- ccxt/lbank.py +5 -4
- 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 +26 -12
- 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 +4 -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 +2 -2
- ccxt/tokocrypto.py +4 -4
- ccxt/upbit.py +2 -2
- ccxt/wavesexchange.py +4 -3
- ccxt/wazirx.py +1 -1
- ccxt/whitebit.py +6 -6
- ccxt/woo.py +6 -6
- ccxt/yobit.py +41 -2
- ccxt/zaif.py +2 -2
- ccxt/zonda.py +4 -4
- {ccxt-4.2.30.dist-info → ccxt-4.2.34.dist-info}/METADATA +10 -10
- ccxt-4.2.34.dist-info/RECORD +438 -0
- ccxt-4.2.30.dist-info/RECORD +0 -438
- {ccxt-4.2.30.dist-info → ccxt-4.2.34.dist-info}/WHEEL +0 -0
- {ccxt-4.2.30.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
|
@@ -4692,7 +4692,7 @@ class htx(Exchange, ImplicitAPI):
|
|
4692
4692
|
marketId = self.safe_string_2(order, 'contract_code', 'symbol')
|
4693
4693
|
market = self.safe_market(marketId, market)
|
4694
4694
|
timestamp = self.safe_integer_n(order, ['created_at', 'created-at', 'create_date'])
|
4695
|
-
clientOrderId = self.safe_string_2(order, 'client_order_id', 'client-
|
4695
|
+
clientOrderId = self.safe_string_2(order, 'client_order_id', 'client-or' + 'der-id') # transpiler regex trick for php issue
|
4696
4696
|
cost = None
|
4697
4697
|
amount = None
|
4698
4698
|
if (type is not None) and (type.find('market') >= 0):
|
@@ -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
|
@@ -958,7 +958,9 @@ class kraken(Exchange, ImplicitAPI):
|
|
958
958
|
else:
|
959
959
|
request['interval'] = timeframe
|
960
960
|
if since is not None:
|
961
|
-
|
961
|
+
# contrary to kraken's api documentation, the since parameter must be passed in nanoseconds
|
962
|
+
# the adding of '000000' is copied from the fetchTrades function
|
963
|
+
request['since'] = self.number_to_string(since) + '000000' # expected to be in nanoseconds
|
962
964
|
response = await self.publicGetOHLC(self.extend(request, params))
|
963
965
|
#
|
964
966
|
# {
|
@@ -1296,7 +1298,7 @@ class kraken(Exchange, ImplicitAPI):
|
|
1296
1298
|
#
|
1297
1299
|
return self.parse_balance(response)
|
1298
1300
|
|
1299
|
-
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={}):
|
1300
1302
|
"""
|
1301
1303
|
:see: https://docs.kraken.com/rest/#tag/Trading/operation/addOrder
|
1302
1304
|
create a trade order
|
@@ -1456,6 +1458,41 @@ class kraken(Exchange, ImplicitAPI):
|
|
1456
1458
|
# "txid": "OTI672-HJFAO-XOIPPK"
|
1457
1459
|
# }
|
1458
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
|
+
#
|
1459
1496
|
description = self.safe_value(order, 'descr', {})
|
1460
1497
|
orderDescription = self.safe_string(description, 'order', description)
|
1461
1498
|
side = None
|
@@ -1492,6 +1529,9 @@ class kraken(Exchange, ImplicitAPI):
|
|
1492
1529
|
# kraken truncates the cost in the api response so we will ignore it and calculate it from average & filled
|
1493
1530
|
# cost = self.safe_string(order, 'cost')
|
1494
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
|
1495
1535
|
if (price is None) or Precise.string_equals(price, '0'):
|
1496
1536
|
price = self.safe_string(description, 'price2')
|
1497
1537
|
if (price is None) or Precise.string_equals(price, '0'):
|
@@ -2440,7 +2480,7 @@ class kraken(Exchange, ImplicitAPI):
|
|
2440
2480
|
'info': depositAddress,
|
2441
2481
|
}
|
2442
2482
|
|
2443
|
-
async def withdraw(self, code: str, amount, address, tag=None, params={}):
|
2483
|
+
async def withdraw(self, code: str, amount: float, address, tag=None, params={}):
|
2444
2484
|
"""
|
2445
2485
|
make a withdrawal
|
2446
2486
|
:see: https://docs.kraken.com/rest/#tag/Funding/operation/withdrawFunds
|
@@ -2557,7 +2597,7 @@ class kraken(Exchange, ImplicitAPI):
|
|
2557
2597
|
"""
|
2558
2598
|
return await self.transfer(code, amount, 'spot', 'swap', params)
|
2559
2599
|
|
2560
|
-
async def transfer(self, code: str, amount, fromAccount, toAccount, params={}):
|
2600
|
+
async def transfer(self, code: str, amount: float, fromAccount, toAccount, params={}) -> TransferEntry:
|
2561
2601
|
"""
|
2562
2602
|
:see: https://docs.kraken.com/rest/#tag/User-Funding/operation/walletTransfer
|
2563
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
|
@@ -57,6 +57,9 @@ class krakenfutures(Exchange, ImplicitAPI):
|
|
57
57
|
'fetchClosedOrders': None, # https://support.kraken.com/hc/en-us/articles/360058243651-Historical-orders
|
58
58
|
'fetchCrossBorrowRate': False,
|
59
59
|
'fetchCrossBorrowRates': False,
|
60
|
+
'fetchDepositAddress': False,
|
61
|
+
'fetchDepositAddresses': False,
|
62
|
+
'fetchDepositAddressesByNetwork': False,
|
60
63
|
'fetchFundingHistory': None,
|
61
64
|
'fetchFundingRate': 'emulated',
|
62
65
|
'fetchFundingRateHistory': True,
|
@@ -814,7 +817,7 @@ class krakenfutures(Exchange, ImplicitAPI):
|
|
814
817
|
'fee': None,
|
815
818
|
})
|
816
819
|
|
817
|
-
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={}):
|
818
821
|
market = self.market(symbol)
|
819
822
|
type = self.safe_string(params, 'orderType', type)
|
820
823
|
timeInForce = self.safe_string(params, 'timeInForce')
|
@@ -866,7 +869,7 @@ class krakenfutures(Exchange, ImplicitAPI):
|
|
866
869
|
params = self.omit(params, ['clientOrderId', 'timeInForce', 'triggerPrice', 'stopLossPrice', 'takeProfitPrice'])
|
867
870
|
return self.extend(request, params)
|
868
871
|
|
869
|
-
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={}):
|
870
873
|
"""
|
871
874
|
Create an order on the exchange
|
872
875
|
:see: https://docs.futures.kraken.com/#http-api-trading-v3-api-order-management-send-order
|
@@ -2112,7 +2115,7 @@ class krakenfutures(Exchange, ImplicitAPI):
|
|
2112
2115
|
"""
|
2113
2116
|
return await self.transfer(code, amount, 'future', 'spot', params)
|
2114
2117
|
|
2115
|
-
async def transfer(self, code: str, amount, fromAccount, toAccount, params={}):
|
2118
|
+
async def transfer(self, code: str, amount: float, fromAccount, toAccount, params={}) -> TransferEntry:
|
2116
2119
|
"""
|
2117
2120
|
:see: https://docs.futures.kraken.com/#http-api-trading-v3-api-transfers-initiate-wallet-transfer
|
2118
2121
|
:see: https://docs.futures.kraken.com/#http-api-trading-v3-api-transfers-initiate-withdrawal-to-spot-wallet
|
@@ -2155,7 +2158,7 @@ class krakenfutures(Exchange, ImplicitAPI):
|
|
2155
2158
|
'toAccount': toAccount,
|
2156
2159
|
})
|
2157
2160
|
|
2158
|
-
async def set_leverage(self, leverage, symbol: Str = None, params={}):
|
2161
|
+
async def set_leverage(self, leverage: Int, symbol: Str = None, params={}):
|
2159
2162
|
"""
|
2160
2163
|
set the level of leverage for a market
|
2161
2164
|
:see: https://docs.futures.kraken.com/#http-api-trading-v3-api-multi-collateral-set-the-leverage-setting-for-a-market
|