ccxt 4.4.71__py2.py3-none-any.whl → 4.4.72__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ccxt/__init__.py +1 -1
- ccxt/abstract/bingx.py +1 -1
- ccxt/ascendex.py +1 -1
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/ascendex.py +1 -1
- ccxt/async_support/base/exchange.py +1 -1
- ccxt/async_support/binance.py +1 -1
- ccxt/async_support/bingx.py +2 -2
- ccxt/async_support/bitfinex.py +1 -1
- ccxt/async_support/bitfinex1.py +1 -1
- ccxt/async_support/bl3p.py +2 -2
- ccxt/async_support/cex.py +1 -0
- ccxt/async_support/coinbase.py +3 -2
- ccxt/async_support/coinbaseexchange.py +3 -2
- ccxt/async_support/coinbaseinternational.py +3 -2
- ccxt/async_support/coinex.py +1 -1
- ccxt/async_support/deribit.py +2 -1
- ccxt/async_support/derive.py +11 -7
- ccxt/async_support/gate.py +3 -0
- ccxt/async_support/gemini.py +2 -1
- ccxt/async_support/hitbtc.py +1 -1
- ccxt/async_support/hyperliquid.py +38 -0
- ccxt/async_support/kraken.py +1 -1
- ccxt/async_support/krakenfutures.py +4 -0
- ccxt/async_support/kucoin.py +1 -1
- ccxt/async_support/kuna.py +1 -1
- ccxt/async_support/mexc.py +1 -1
- ccxt/async_support/ndax.py +1 -1
- ccxt/async_support/okcoin.py +4 -0
- ccxt/async_support/okx.py +21 -30
- ccxt/async_support/paradex.py +65 -7
- ccxt/async_support/paymium.py +1 -1
- ccxt/async_support/poloniex.py +2 -1
- ccxt/async_support/upbit.py +1 -1
- ccxt/async_support/whitebit.py +98 -2
- ccxt/async_support/woo.py +3 -1
- ccxt/async_support/woofipro.py +1 -1
- ccxt/async_support/yobit.py +2 -1
- ccxt/base/errors.py +6 -0
- ccxt/base/exchange.py +9 -2
- ccxt/binance.py +1 -1
- ccxt/bingx.py +2 -2
- ccxt/bitfinex.py +1 -1
- ccxt/bitfinex1.py +1 -1
- ccxt/bl3p.py +2 -2
- ccxt/cex.py +1 -0
- ccxt/coinbase.py +3 -2
- ccxt/coinbaseexchange.py +3 -2
- ccxt/coinbaseinternational.py +3 -2
- ccxt/coinex.py +1 -1
- ccxt/deribit.py +2 -1
- ccxt/derive.py +11 -7
- ccxt/gate.py +3 -0
- ccxt/gemini.py +2 -1
- ccxt/hitbtc.py +1 -1
- ccxt/hyperliquid.py +38 -0
- ccxt/kraken.py +1 -1
- ccxt/krakenfutures.py +4 -0
- ccxt/kucoin.py +1 -1
- ccxt/kuna.py +1 -1
- ccxt/mexc.py +1 -1
- ccxt/ndax.py +1 -1
- ccxt/okcoin.py +4 -0
- ccxt/okx.py +21 -30
- ccxt/paradex.py +65 -7
- ccxt/paymium.py +1 -1
- ccxt/poloniex.py +2 -1
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/bingx.py +1 -1
- ccxt/pro/bitmart.py +15 -7
- ccxt/pro/derive.py +2 -2
- ccxt/pro/krakenfutures.py +1 -1
- ccxt/upbit.py +1 -1
- ccxt/whitebit.py +98 -2
- ccxt/woo.py +3 -1
- ccxt/woofipro.py +1 -1
- ccxt/yobit.py +2 -1
- {ccxt-4.4.71.dist-info → ccxt-4.4.72.dist-info}/METADATA +4 -4
- {ccxt-4.4.71.dist-info → ccxt-4.4.72.dist-info}/RECORD +82 -82
- {ccxt-4.4.71.dist-info → ccxt-4.4.72.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.4.71.dist-info → ccxt-4.4.72.dist-info}/WHEEL +0 -0
- {ccxt-4.4.71.dist-info → ccxt-4.4.72.dist-info}/top_level.txt +0 -0
ccxt/async_support/paradex.py
CHANGED
@@ -496,6 +496,57 @@ class paradex(Exchange, ImplicitAPI):
|
|
496
496
|
# "max_tob_spread": "0.2"
|
497
497
|
# }
|
498
498
|
#
|
499
|
+
# {
|
500
|
+
# "symbol":"BTC-USD-96000-C",
|
501
|
+
# "base_currency":"BTC",
|
502
|
+
# "quote_currency":"USD",
|
503
|
+
# "settlement_currency":"USDC",
|
504
|
+
# "order_size_increment":"0.001",
|
505
|
+
# "price_tick_size":"0.01",
|
506
|
+
# "min_notional":"100",
|
507
|
+
# "open_at":"1736764200000",
|
508
|
+
# "expiry_at":"0",
|
509
|
+
# "asset_kind":"PERP_OPTION",
|
510
|
+
# "market_kind":"cross",
|
511
|
+
# "position_limit":"10",
|
512
|
+
# "price_bands_width":"0.05",
|
513
|
+
# "iv_bands_width":"0.05",
|
514
|
+
# "max_open_orders":"100",
|
515
|
+
# "max_funding_rate":"0.02",
|
516
|
+
# "option_cross_margin_params":{
|
517
|
+
# "imf":{
|
518
|
+
# "long_itm":"0.2",
|
519
|
+
# "short_itm":"0.15",
|
520
|
+
# "short_otm":"0.1",
|
521
|
+
# "short_put_cap":"0.5",
|
522
|
+
# "premium_multiplier":"1"
|
523
|
+
# },
|
524
|
+
# "mmf":{
|
525
|
+
# "long_itm":"0.1",
|
526
|
+
# "short_itm":"0.075",
|
527
|
+
# "short_otm":"0.05",
|
528
|
+
# "short_put_cap":"0.5",
|
529
|
+
# "premium_multiplier":"0.5"
|
530
|
+
# }
|
531
|
+
# },
|
532
|
+
# "price_feed_id":"GVXRSBjFk6e6J3NbVPXohDJetcTjaeeuykUpbQF8UoMU",
|
533
|
+
# "oracle_ewma_factor":"0.20000046249626113",
|
534
|
+
# "max_order_size":"2",
|
535
|
+
# "max_funding_rate_change":"0.02",
|
536
|
+
# "max_tob_spread":"0.2",
|
537
|
+
# "interest_rate":"0.0001",
|
538
|
+
# "clamp_rate":"0.02",
|
539
|
+
# "option_type":"CALL",
|
540
|
+
# "strike_price":"96000",
|
541
|
+
# "funding_period_hours":"24",
|
542
|
+
# "tags":[
|
543
|
+
# ]
|
544
|
+
# }
|
545
|
+
#
|
546
|
+
assetKind = self.safe_string(market, 'asset_kind')
|
547
|
+
isOption = (assetKind == 'PERP_OPTION')
|
548
|
+
type = 'option' if (isOption) else 'swap'
|
549
|
+
isSwap = (type == 'swap')
|
499
550
|
marketId = self.safe_string(market, 'symbol')
|
500
551
|
quoteId = self.safe_string(market, 'quote_currency')
|
501
552
|
baseId = self.safe_string(market, 'base_currency')
|
@@ -505,6 +556,13 @@ class paradex(Exchange, ImplicitAPI):
|
|
505
556
|
settle = self.safe_currency_code(settleId)
|
506
557
|
symbol = base + '/' + quote + ':' + settle
|
507
558
|
expiry = self.safe_integer(market, 'expiry_at')
|
559
|
+
optionType = self.safe_string(market, 'option_type')
|
560
|
+
strikePrice = self.safe_string(market, 'strike_price')
|
561
|
+
if isOption:
|
562
|
+
optionTypeSuffix = 'C' if (optionType == 'CALL') else 'P'
|
563
|
+
symbol = symbol + '-' + strikePrice + '-' + optionTypeSuffix
|
564
|
+
else:
|
565
|
+
expiry = None
|
508
566
|
takerFee = self.parse_number('0.0003')
|
509
567
|
makerFee = self.parse_number('-0.00005')
|
510
568
|
return self.safe_market_structure({
|
@@ -516,23 +574,23 @@ class paradex(Exchange, ImplicitAPI):
|
|
516
574
|
'baseId': baseId,
|
517
575
|
'quoteId': quoteId,
|
518
576
|
'settleId': settleId,
|
519
|
-
'type':
|
577
|
+
'type': type,
|
520
578
|
'spot': False,
|
521
579
|
'margin': None,
|
522
|
-
'swap':
|
580
|
+
'swap': isSwap,
|
523
581
|
'future': False,
|
524
|
-
'option':
|
582
|
+
'option': isOption,
|
525
583
|
'active': self.safe_bool(market, 'enableTrading'),
|
526
584
|
'contract': True,
|
527
585
|
'linear': True,
|
528
|
-
'inverse':
|
586
|
+
'inverse': False,
|
529
587
|
'taker': takerFee,
|
530
588
|
'maker': makerFee,
|
531
589
|
'contractSize': self.parse_number('1'),
|
532
|
-
'expiry':
|
590
|
+
'expiry': expiry,
|
533
591
|
'expiryDatetime': None if (expiry == 0) else self.iso8601(expiry),
|
534
|
-
'strike':
|
535
|
-
'optionType':
|
592
|
+
'strike': self.parse_number(strikePrice),
|
593
|
+
'optionType': self.safe_string_lower(market, 'option_type'),
|
536
594
|
'precision': {
|
537
595
|
'amount': self.safe_number(market, 'order_size_increment'),
|
538
596
|
'price': self.safe_number(market, 'price_tick_size'),
|
ccxt/async_support/paymium.py
CHANGED
@@ -333,7 +333,7 @@ class paymium(Exchange, ImplicitAPI):
|
|
333
333
|
response = await self.publicGetDataCurrencyTrades(self.extend(request, params))
|
334
334
|
return self.parse_trades(response, market, since, limit)
|
335
335
|
|
336
|
-
async def create_deposit_address(self, code: str, params={}):
|
336
|
+
async def create_deposit_address(self, code: str, params={}) -> DepositAddress:
|
337
337
|
"""
|
338
338
|
create a currency deposit address
|
339
339
|
|
ccxt/async_support/poloniex.py
CHANGED
@@ -429,6 +429,7 @@ class poloniex(Exchange, ImplicitAPI):
|
|
429
429
|
'untilDays': None,
|
430
430
|
'trigger': False,
|
431
431
|
'trailing': False,
|
432
|
+
'symbolRequired': False,
|
432
433
|
},
|
433
434
|
'fetchMyTrades': {
|
434
435
|
'limit': 100,
|
@@ -2572,7 +2573,7 @@ class poloniex(Exchange, ImplicitAPI):
|
|
2572
2573
|
'nonce': None,
|
2573
2574
|
}
|
2574
2575
|
|
2575
|
-
async def create_deposit_address(self, code: str, params={}):
|
2576
|
+
async def create_deposit_address(self, code: str, params={}) -> DepositAddress:
|
2576
2577
|
"""
|
2577
2578
|
create a currency deposit address
|
2578
2579
|
|
ccxt/async_support/upbit.py
CHANGED
@@ -1886,7 +1886,7 @@ class upbit(Exchange, ImplicitAPI):
|
|
1886
1886
|
#
|
1887
1887
|
return self.parse_deposit_address(response)
|
1888
1888
|
|
1889
|
-
async def create_deposit_address(self, code: str, params={}):
|
1889
|
+
async def create_deposit_address(self, code: str, params={}) -> DepositAddress:
|
1890
1890
|
"""
|
1891
1891
|
|
1892
1892
|
https://docs.upbit.com/reference/%EC%9E%85%EA%B8%88-%EC%A3%BC%EC%86%8C-%EC%83%9D%EC%84%B1-%EC%9A%94%EC%B2%AD
|
ccxt/async_support/whitebit.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.async_support.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.whitebit import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Any, Balances, BorrowInterest, Bool, Conversion, Currencies, Currency, DepositAddress, FundingHistory, Int, Market, MarketType, Num, Order, OrderBook, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade, TradingFees, Transaction, TransferEntry
|
9
|
+
from ccxt.base.types import Any, Balances, BorrowInterest, Bool, Conversion, CrossBorrowRate, Currencies, Currency, DepositAddress, FundingHistory, Int, Market, MarketType, Num, Order, OrderBook, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade, TradingFees, Transaction, TransferEntry
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
12
|
from ccxt.base.errors import AuthenticationError
|
@@ -46,13 +46,16 @@ class whitebit(Exchange, ImplicitAPI):
|
|
46
46
|
'cancelOrder': True,
|
47
47
|
'cancelOrders': False,
|
48
48
|
'createConvertTrade': True,
|
49
|
+
'createDepositAddress': True,
|
49
50
|
'createMarketBuyOrderWithCost': True,
|
50
51
|
'createMarketOrderWithCost': False,
|
51
52
|
'createMarketSellOrderWithCost': False,
|
52
53
|
'createOrder': True,
|
54
|
+
'createPostOnlyOrder': True,
|
53
55
|
'createStopLimitOrder': True,
|
54
56
|
'createStopMarketOrder': True,
|
55
57
|
'createStopOrder': True,
|
58
|
+
'createTriggerOrder': True,
|
56
59
|
'editOrder': False,
|
57
60
|
'fetchBalance': True,
|
58
61
|
'fetchBorrowRateHistories': False,
|
@@ -61,7 +64,7 @@ class whitebit(Exchange, ImplicitAPI):
|
|
61
64
|
'fetchConvertQuote': True,
|
62
65
|
'fetchConvertTrade': False,
|
63
66
|
'fetchConvertTradeHistory': True,
|
64
|
-
'fetchCrossBorrowRate':
|
67
|
+
'fetchCrossBorrowRate': True,
|
65
68
|
'fetchCrossBorrowRates': False,
|
66
69
|
'fetchCurrencies': True,
|
67
70
|
'fetchDeposit': True,
|
@@ -1375,6 +1378,10 @@ class whitebit(Exchange, ImplicitAPI):
|
|
1375
1378
|
:param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
1376
1379
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1377
1380
|
:param float [params.cost]: *market orders only* the cost of the order in units of the base currency
|
1381
|
+
:param float [params.triggerPrice]: The price at which a trigger order is triggered at
|
1382
|
+
:param bool [params.postOnly]: If True, the order will only be posted to the order book and not executed immediately
|
1383
|
+
:param str [params.clientOrderId]: a unique id for the order
|
1384
|
+
:param str [params.marginMode]: 'cross' or 'isolated', for margin trading, uses self.options.defaultMarginMode if not passed, defaults to None/None/None
|
1378
1385
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
1379
1386
|
"""
|
1380
1387
|
await self.load_markets()
|
@@ -2001,6 +2008,60 @@ class whitebit(Exchange, ImplicitAPI):
|
|
2001
2008
|
'tag': tag,
|
2002
2009
|
}
|
2003
2010
|
|
2011
|
+
async def create_deposit_address(self, code: str, params={}) -> DepositAddress:
|
2012
|
+
"""
|
2013
|
+
create a currency deposit address
|
2014
|
+
|
2015
|
+
https://docs.whitebit.com/private/http-main-v4/#create-new-address-for-deposit
|
2016
|
+
|
2017
|
+
:param str code: unified currency code of the currency for the deposit address
|
2018
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2019
|
+
:param str [params.network]: the blockchain network to create a deposit address on
|
2020
|
+
:param str [params.type]: address type, available for specific currencies
|
2021
|
+
:returns dict: an `address structure <https://docs.ccxt.com/#/?id=address-structure>`
|
2022
|
+
"""
|
2023
|
+
await self.load_markets()
|
2024
|
+
currency = self.currency(code)
|
2025
|
+
request: dict = {
|
2026
|
+
'ticker': currency['id'],
|
2027
|
+
}
|
2028
|
+
response = await self.v4PrivatePostMainAccountCreateNewAddress(self.extend(request, params))
|
2029
|
+
#
|
2030
|
+
# {
|
2031
|
+
# "account": {
|
2032
|
+
# "address": "GDTSOI56XNVAKJNJBLJGRNZIVOCIZJRBIDKTWSCYEYNFAZEMBLN75RMN",
|
2033
|
+
# "memo": "48565488244493"
|
2034
|
+
# },
|
2035
|
+
# "required": {
|
2036
|
+
# "maxAmount": "0",
|
2037
|
+
# "minAmount": "1",
|
2038
|
+
# "fixedFee": "0",
|
2039
|
+
# "flexFee": {
|
2040
|
+
# "maxFee": "0",
|
2041
|
+
# "minFee": "0",
|
2042
|
+
# "percent": "0"
|
2043
|
+
# }
|
2044
|
+
# }
|
2045
|
+
# }
|
2046
|
+
#
|
2047
|
+
data = self.safe_dict(response, 'account', {})
|
2048
|
+
return self.parse_deposit_address(data, currency)
|
2049
|
+
|
2050
|
+
def parse_deposit_address(self, depositAddress, currency: Currency = None) -> DepositAddress:
|
2051
|
+
#
|
2052
|
+
# {
|
2053
|
+
# "address": "GDTSOI56XNVAKJNJBLJGRNZIVOCIZJRBIDKTWSCYEYNFAZEMBLN75RMN",
|
2054
|
+
# "memo": "48565488244493"
|
2055
|
+
# },
|
2056
|
+
#
|
2057
|
+
return {
|
2058
|
+
'info': depositAddress,
|
2059
|
+
'currency': self.safe_currency_code(None, currency),
|
2060
|
+
'network': None,
|
2061
|
+
'address': self.safe_string(depositAddress, 'address'),
|
2062
|
+
'tag': self.safe_string(depositAddress, 'memo'),
|
2063
|
+
}
|
2064
|
+
|
2004
2065
|
async def set_leverage(self, leverage: Int, symbol: Str = None, params={}):
|
2005
2066
|
"""
|
2006
2067
|
set the level of leverage for a market
|
@@ -3069,6 +3130,41 @@ class whitebit(Exchange, ImplicitAPI):
|
|
3069
3130
|
'takeProfitPrice': self.safe_number(tpsl, 'takeProfit'),
|
3070
3131
|
})
|
3071
3132
|
|
3133
|
+
async def fetch_cross_borrow_rate(self, code: str, params={}) -> CrossBorrowRate:
|
3134
|
+
"""
|
3135
|
+
fetch the rate of interest to borrow a currency for margin trading
|
3136
|
+
|
3137
|
+
https://docs.whitebit.com/private/http-main-v4/#get-plans
|
3138
|
+
|
3139
|
+
:param str code: unified currency code
|
3140
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
3141
|
+
:returns dict: a `borrow rate structure <https://docs.ccxt.com/#/?id=borrow-rate-structure>`
|
3142
|
+
"""
|
3143
|
+
await self.load_markets()
|
3144
|
+
currency = self.currency(code)
|
3145
|
+
request: dict = {
|
3146
|
+
'ticker': currency['id'],
|
3147
|
+
}
|
3148
|
+
response = await self.v4PrivatePostMainAccountSmartPlans(self.extend(request, params))
|
3149
|
+
#
|
3150
|
+
#
|
3151
|
+
data = self.safe_list(response, 0, [])
|
3152
|
+
return self.parse_borrow_rate(data, currency)
|
3153
|
+
|
3154
|
+
def parse_borrow_rate(self, info, currency: Currency = None):
|
3155
|
+
#
|
3156
|
+
#
|
3157
|
+
currencyId = self.safe_string(info, 'ticker')
|
3158
|
+
percent = self.safe_string(info, 'percent')
|
3159
|
+
return {
|
3160
|
+
'currency': self.safe_currency_code(currencyId, currency),
|
3161
|
+
'rate': self.parse_number(Precise.string_div(percent, '100')),
|
3162
|
+
'period': self.safe_integer(info, 'duration'),
|
3163
|
+
'timestamp': None,
|
3164
|
+
'datetime': None,
|
3165
|
+
'info': info,
|
3166
|
+
}
|
3167
|
+
|
3072
3168
|
def is_fiat(self, currency: str) -> bool:
|
3073
3169
|
fiatCurrencies = self.safe_value(self.options, 'fiatCurrencies', [])
|
3074
3170
|
return self.in_array(currency, fiatCurrencies)
|
ccxt/async_support/woo.py
CHANGED
@@ -563,6 +563,7 @@ class woo(Exchange, ImplicitAPI):
|
|
563
563
|
symbol = base + '/' + quote
|
564
564
|
contractSize: Num = None
|
565
565
|
linear: Bool = None
|
566
|
+
inverse: Bool = None
|
566
567
|
margin = True
|
567
568
|
contract = swap
|
568
569
|
if contract:
|
@@ -572,6 +573,7 @@ class woo(Exchange, ImplicitAPI):
|
|
572
573
|
symbol = base + '/' + quote + ':' + settle
|
573
574
|
contractSize = self.parse_number('1')
|
574
575
|
linear = True
|
576
|
+
inverse = False
|
575
577
|
return {
|
576
578
|
'id': marketId,
|
577
579
|
'symbol': symbol,
|
@@ -590,7 +592,7 @@ class woo(Exchange, ImplicitAPI):
|
|
590
592
|
'active': self.safe_string(market, 'is_trading') == '1',
|
591
593
|
'contract': contract,
|
592
594
|
'linear': linear,
|
593
|
-
'inverse':
|
595
|
+
'inverse': inverse,
|
594
596
|
'contractSize': contractSize,
|
595
597
|
'expiry': None,
|
596
598
|
'expiryDatetime': None,
|
ccxt/async_support/woofipro.py
CHANGED
ccxt/async_support/yobit.py
CHANGED
@@ -1217,7 +1217,7 @@ class yobit(Exchange, ImplicitAPI):
|
|
1217
1217
|
result.append(trade)
|
1218
1218
|
return self.filter_by_symbol_since_limit(result, market['symbol'], since, limit)
|
1219
1219
|
|
1220
|
-
async def create_deposit_address(self, code: str, params={}):
|
1220
|
+
async def create_deposit_address(self, code: str, params={}) -> DepositAddress:
|
1221
1221
|
"""
|
1222
1222
|
|
1223
1223
|
https://yobit.net/en/api
|
@@ -1237,6 +1237,7 @@ class yobit(Exchange, ImplicitAPI):
|
|
1237
1237
|
'currency': code,
|
1238
1238
|
'address': address,
|
1239
1239
|
'tag': None,
|
1240
|
+
'network': None,
|
1240
1241
|
'info': response['info'],
|
1241
1242
|
}
|
1242
1243
|
|
ccxt/base/errors.py
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
# ----------------------------------------------------------------------------
|
2
|
+
|
3
|
+
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
|
4
|
+
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
|
5
|
+
# EDIT THE CORRESPONDENT .ts FILE INSTEAD
|
6
|
+
|
1
7
|
error_hierarchy = {
|
2
8
|
'BaseError': {
|
3
9
|
'ExchangeError': {
|
ccxt/base/exchange.py
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
# -----------------------------------------------------------------------------
|
6
6
|
|
7
|
-
__version__ = '4.4.
|
7
|
+
__version__ = '4.4.72'
|
8
8
|
|
9
9
|
# -----------------------------------------------------------------------------
|
10
10
|
|
@@ -2921,7 +2921,8 @@ class Exchange(object):
|
|
2921
2921
|
length = len(keys)
|
2922
2922
|
if length != 0:
|
2923
2923
|
for i in range(0, length):
|
2924
|
-
|
2924
|
+
key = keys[i]
|
2925
|
+
network = networks[key]
|
2925
2926
|
deposit = self.safe_bool(network, 'deposit')
|
2926
2927
|
if currencyDeposit is None or deposit:
|
2927
2928
|
currency['deposit'] = deposit
|
@@ -2931,6 +2932,12 @@ class Exchange(object):
|
|
2931
2932
|
active = self.safe_bool(network, 'active')
|
2932
2933
|
if currencyActive is None or active:
|
2933
2934
|
currency['active'] = active
|
2935
|
+
# set network 'active' to False if D or W is disabled
|
2936
|
+
if self.safe_bool(network, 'active') is None:
|
2937
|
+
if deposit and withdraw:
|
2938
|
+
currency['networks'][key]['active'] = True
|
2939
|
+
elif deposit is not None and withdraw is not None:
|
2940
|
+
currency['networks'][key]['active'] = False
|
2934
2941
|
# find lowest fee(which is more desired)
|
2935
2942
|
fee = self.safe_string(network, 'fee')
|
2936
2943
|
feeMain = self.safe_string(currency, 'fee')
|
ccxt/binance.py
CHANGED
@@ -4085,7 +4085,7 @@ class binance(Exchange, ImplicitAPI):
|
|
4085
4085
|
# "symbol": "BTCUSDT",
|
4086
4086
|
# "markPrice": "11793.63104562", # mark price
|
4087
4087
|
# "indexPrice": "11781.80495970", # index price
|
4088
|
-
# "estimatedSettlePrice": "11781.16138815", # Estimated Settle Price, only useful in the last hour before the settlement starts
|
4088
|
+
# "estimatedSettlePrice": "11781.16138815", # Estimated Settle Price, only useful in the last hour before the settlement starts
|
4089
4089
|
# "lastFundingRate": "0.00038246", # This is the lastest estimated funding rate
|
4090
4090
|
# "nextFundingTime": 1597392000000,
|
4091
4091
|
# "interestRate": "0.00010000",
|
ccxt/bingx.py
CHANGED
@@ -175,7 +175,6 @@ class bingx(Exchange, ImplicitAPI):
|
|
175
175
|
'trade/myTrades': 2,
|
176
176
|
'user/commissionRate': 5,
|
177
177
|
'account/balance': 2,
|
178
|
-
'account/allAccountBalance': 2,
|
179
178
|
},
|
180
179
|
'post': {
|
181
180
|
'trade/order': 2,
|
@@ -402,6 +401,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
402
401
|
'uid': 1,
|
403
402
|
'apiKey/query': 2,
|
404
403
|
'account/apiPermissions': 5,
|
404
|
+
'allAccountBalance': 2,
|
405
405
|
},
|
406
406
|
'post': {
|
407
407
|
'innerTransfer/authorizeSubAccount': 1,
|
@@ -831,7 +831,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
831
831
|
# {
|
832
832
|
# "symbol": "GEAR-USDT",
|
833
833
|
# "minQty": 735, # deprecated
|
834
|
-
# "maxQty": 2941177, # deprecated
|
834
|
+
# "maxQty": 2941177, # deprecated.
|
835
835
|
# "minNotional": 5,
|
836
836
|
# "maxNotional": 20000,
|
837
837
|
# "status": 1,
|
ccxt/bitfinex.py
CHANGED
@@ -2202,7 +2202,7 @@ class bitfinex(Exchange, ImplicitAPI):
|
|
2202
2202
|
tradesList.append({'result': response[i]}) # convert to array of dicts to match parseOrder signature
|
2203
2203
|
return self.parse_trades(tradesList, market, since, limit)
|
2204
2204
|
|
2205
|
-
def create_deposit_address(self, code: str, params={}):
|
2205
|
+
def create_deposit_address(self, code: str, params={}) -> DepositAddress:
|
2206
2206
|
"""
|
2207
2207
|
create a currency deposit address
|
2208
2208
|
|
ccxt/bitfinex1.py
CHANGED
@@ -1394,7 +1394,7 @@ class bitfinex1(Exchange, ImplicitAPI):
|
|
1394
1394
|
return self.options['currencyNames'][code]
|
1395
1395
|
raise NotSupported(self.id + ' ' + code + ' not supported for withdrawal')
|
1396
1396
|
|
1397
|
-
def create_deposit_address(self, code: str, params={}):
|
1397
|
+
def create_deposit_address(self, code: str, params={}) -> DepositAddress:
|
1398
1398
|
"""
|
1399
1399
|
create a currency deposit address
|
1400
1400
|
|
ccxt/bl3p.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.bl3p import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Any, Balances, Currency, IndexType, Int, Market, Num, OrderBook, OrderSide, OrderType, Str, Ticker, Trade, TradingFees
|
9
|
+
from ccxt.base.types import Any, Balances, Currency, DepositAddress, IndexType, Int, Market, Num, OrderBook, OrderSide, OrderType, Str, Ticker, Trade, TradingFees
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.decimal_to_precision import TICK_SIZE
|
12
12
|
from ccxt.base.precise import Precise
|
@@ -477,7 +477,7 @@ class bl3p(Exchange, ImplicitAPI):
|
|
477
477
|
'info': response,
|
478
478
|
})
|
479
479
|
|
480
|
-
def create_deposit_address(self, code: str, params={}):
|
480
|
+
def create_deposit_address(self, code: str, params={}) -> DepositAddress:
|
481
481
|
"""
|
482
482
|
create a currency deposit address
|
483
483
|
|
ccxt/cex.py
CHANGED
ccxt/coinbase.py
CHANGED
@@ -734,7 +734,7 @@ class coinbase(Exchange, ImplicitAPI):
|
|
734
734
|
'info': account,
|
735
735
|
}
|
736
736
|
|
737
|
-
def create_deposit_address(self, code: str, params={}):
|
737
|
+
def create_deposit_address(self, code: str, params={}) -> DepositAddress:
|
738
738
|
"""
|
739
739
|
create a currency deposit address
|
740
740
|
|
@@ -802,6 +802,7 @@ class coinbase(Exchange, ImplicitAPI):
|
|
802
802
|
'currency': code,
|
803
803
|
'tag': tag,
|
804
804
|
'address': address,
|
805
|
+
'network': None,
|
805
806
|
'info': response,
|
806
807
|
}
|
807
808
|
|
@@ -2300,7 +2301,7 @@ class coinbase(Exchange, ImplicitAPI):
|
|
2300
2301
|
# "ending_before":null,
|
2301
2302
|
# "starting_after":null,
|
2302
2303
|
# "previous_ending_before":null,
|
2303
|
-
# "next_starting_after":"6b17acd6-2e68-5eb0-9f45-
|
2304
|
+
# "next_starting_after":"6b17acd6-2e68-5eb0-9f45-72d67cef578a",
|
2304
2305
|
# "limit":100,
|
2305
2306
|
# "order":"desc",
|
2306
2307
|
# "previous_uri":null,
|
ccxt/coinbaseexchange.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.coinbaseexchange import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Account, Any, Balances, Currencies, Currency, Int, LedgerEntry, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFees, Transaction
|
9
|
+
from ccxt.base.types import Account, Any, Balances, Currencies, Currency, DepositAddress, Int, LedgerEntry, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFees, Transaction
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
12
|
from ccxt.base.errors import AuthenticationError
|
@@ -1783,7 +1783,7 @@ class coinbaseexchange(Exchange, ImplicitAPI):
|
|
1783
1783
|
'fee': fee,
|
1784
1784
|
}
|
1785
1785
|
|
1786
|
-
def create_deposit_address(self, code: str, params={}):
|
1786
|
+
def create_deposit_address(self, code: str, params={}) -> DepositAddress:
|
1787
1787
|
"""
|
1788
1788
|
create a currency deposit address
|
1789
1789
|
|
@@ -1814,6 +1814,7 @@ class coinbaseexchange(Exchange, ImplicitAPI):
|
|
1814
1814
|
return {
|
1815
1815
|
'currency': code,
|
1816
1816
|
'address': self.check_address(address),
|
1817
|
+
'network': None,
|
1817
1818
|
'tag': tag,
|
1818
1819
|
'info': response,
|
1819
1820
|
}
|
ccxt/coinbaseinternational.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.coinbaseinternational import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Any, Balances, Currencies, Currency, Int, Market, Order, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntry
|
9
|
+
from ccxt.base.types import Any, Balances, Currencies, Currency, DepositAddress, Int, Market, Order, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntry
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
12
|
from ccxt.base.errors import AuthenticationError
|
@@ -736,7 +736,7 @@ class coinbaseinternational(Exchange, ImplicitAPI):
|
|
736
736
|
}
|
737
737
|
return self.safe_string(statuses, status, status)
|
738
738
|
|
739
|
-
def create_deposit_address(self, code: str, params={}):
|
739
|
+
def create_deposit_address(self, code: str, params={}) -> DepositAddress:
|
740
740
|
"""
|
741
741
|
create a currency deposit address
|
742
742
|
|
@@ -783,6 +783,7 @@ class coinbaseinternational(Exchange, ImplicitAPI):
|
|
783
783
|
'currency': code,
|
784
784
|
'tag': tag,
|
785
785
|
'address': address,
|
786
|
+
'network': None,
|
786
787
|
'info': response,
|
787
788
|
}
|
788
789
|
|
ccxt/coinex.py
CHANGED
@@ -3678,7 +3678,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
3678
3678
|
"""
|
3679
3679
|
return self.fetch_orders_by_status('finished', symbol, since, limit, params)
|
3680
3680
|
|
3681
|
-
def create_deposit_address(self, code: str, params={}):
|
3681
|
+
def create_deposit_address(self, code: str, params={}) -> DepositAddress:
|
3682
3682
|
"""
|
3683
3683
|
create a currency deposit address
|
3684
3684
|
|
ccxt/deribit.py
CHANGED
@@ -1100,7 +1100,7 @@ class deribit(Exchange, ImplicitAPI):
|
|
1100
1100
|
result = self.safe_dict(response, 'result', {})
|
1101
1101
|
return self.parse_balance(result)
|
1102
1102
|
|
1103
|
-
def create_deposit_address(self, code: str, params={}):
|
1103
|
+
def create_deposit_address(self, code: str, params={}) -> DepositAddress:
|
1104
1104
|
"""
|
1105
1105
|
create a currency deposit address
|
1106
1106
|
|
@@ -1135,6 +1135,7 @@ class deribit(Exchange, ImplicitAPI):
|
|
1135
1135
|
'currency': code,
|
1136
1136
|
'address': address,
|
1137
1137
|
'tag': None,
|
1138
|
+
'network': None,
|
1138
1139
|
'info': response,
|
1139
1140
|
}
|
1140
1141
|
|
ccxt/derive.py
CHANGED
@@ -600,6 +600,7 @@ class derive(Exchange, ImplicitAPI):
|
|
600
600
|
swap = False
|
601
601
|
option = False
|
602
602
|
linear: Bool = None
|
603
|
+
inverse: Bool = None
|
603
604
|
baseId = self.safe_string(market, 'base_currency')
|
604
605
|
quoteId = self.safe_string(market, 'quote_currency')
|
605
606
|
base = self.safe_currency_code(baseId)
|
@@ -622,6 +623,7 @@ class derive(Exchange, ImplicitAPI):
|
|
622
623
|
symbol = base + '/' + quote + ':' + settle
|
623
624
|
swap = True
|
624
625
|
linear = True
|
626
|
+
inverse = False
|
625
627
|
marketType = 'swap'
|
626
628
|
elif type == 'option':
|
627
629
|
settleId = 'USDC'
|
@@ -656,7 +658,7 @@ class derive(Exchange, ImplicitAPI):
|
|
656
658
|
'active': self.safe_bool(market, 'is_active'),
|
657
659
|
'contract': (swap or option),
|
658
660
|
'linear': linear,
|
659
|
-
'inverse':
|
661
|
+
'inverse': inverse,
|
660
662
|
'contractSize': None if (spot) else 1,
|
661
663
|
'expiry': expiry,
|
662
664
|
'expiryDatetime': self.iso8601(expiry),
|
@@ -1811,7 +1813,7 @@ class derive(Exchange, ImplicitAPI):
|
|
1811
1813
|
order = self.safe_dict(rawOrder, 'data')
|
1812
1814
|
if order is None:
|
1813
1815
|
order = rawOrder
|
1814
|
-
timestamp = self.
|
1816
|
+
timestamp = self.safe_integer_2(rawOrder, 'creation_timestamp', 'nonce')
|
1815
1817
|
orderId = self.safe_string(order, 'order_id')
|
1816
1818
|
marketId = self.safe_string(order, 'instrument_name')
|
1817
1819
|
if marketId is not None:
|
@@ -2328,17 +2330,19 @@ class derive(Exchange, ImplicitAPI):
|
|
2328
2330
|
result: dict = {
|
2329
2331
|
'info': response,
|
2330
2332
|
}
|
2331
|
-
# TODO:
|
2332
|
-
# checked multiple subaccounts
|
2333
|
-
# checked balance after open orders / positions
|
2334
2333
|
for i in range(0, len(response)):
|
2335
2334
|
subaccount = response[i]
|
2336
2335
|
collaterals = self.safe_list(subaccount, 'collaterals', [])
|
2337
2336
|
for j in range(0, len(collaterals)):
|
2338
2337
|
balance = collaterals[j]
|
2339
2338
|
code = self.safe_currency_code(self.safe_string(balance, 'currency'))
|
2340
|
-
account = self.
|
2341
|
-
account
|
2339
|
+
account = self.safe_dict(result, code)
|
2340
|
+
if account is None:
|
2341
|
+
account = self.account()
|
2342
|
+
account['total'] = self.safe_string(balance, 'amount')
|
2343
|
+
else:
|
2344
|
+
amount = self.safe_string(balance, 'amount')
|
2345
|
+
account['total'] = Precise.string_add(account['total'], amount)
|
2342
2346
|
result[code] = account
|
2343
2347
|
return self.safe_balance(result)
|
2344
2348
|
|
ccxt/gate.py
CHANGED
@@ -6363,6 +6363,9 @@ class gate(Exchange, ImplicitAPI):
|
|
6363
6363
|
if (method == 'GET') or (method == 'DELETE') or requiresURLEncoding or (method == 'PATCH'):
|
6364
6364
|
if query:
|
6365
6365
|
queryString = self.urlencode(query)
|
6366
|
+
# https://github.com/ccxt/ccxt/issues/25570
|
6367
|
+
if queryString.find('currencies=') >= 0 and queryString.find('%2C') >= 0:
|
6368
|
+
queryString = queryString.replace('%2', ',')
|
6366
6369
|
url += '?' + queryString
|
6367
6370
|
if method == 'PATCH':
|
6368
6371
|
body = self.json(query)
|