ccxt 4.4.70__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 -3
- ccxt/abstract/bingx.py +1 -0
- ccxt/abstract/bitmart.py +1 -0
- ccxt/abstract/poloniex.py +36 -0
- ccxt/ascendex.py +1 -1
- ccxt/async_support/__init__.py +1 -3
- ccxt/async_support/ascendex.py +1 -1
- ccxt/async_support/base/exchange.py +3 -3
- ccxt/async_support/binance.py +107 -102
- ccxt/async_support/bingx.py +65 -43
- ccxt/async_support/bitfinex.py +1 -1
- ccxt/async_support/bitfinex1.py +1 -1
- ccxt/async_support/bitget.py +0 -3
- ccxt/async_support/bitmart.py +12 -1
- ccxt/async_support/bitopro.py +1 -0
- ccxt/async_support/bitrue.py +1 -0
- ccxt/async_support/bl3p.py +2 -2
- ccxt/async_support/cex.py +2 -0
- ccxt/async_support/coinbase.py +3 -2
- ccxt/async_support/coinbaseexchange.py +4 -2
- ccxt/async_support/coinbaseinternational.py +3 -2
- ccxt/async_support/coinex.py +1 -1
- ccxt/async_support/deribit.py +3 -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/hashkey.py +4 -2
- ccxt/async_support/hitbtc.py +1 -1
- ccxt/async_support/hyperliquid.py +38 -0
- ccxt/async_support/kraken.py +78 -6
- ccxt/async_support/krakenfutures.py +4 -0
- ccxt/async_support/kucoin.py +5 -3
- ccxt/async_support/kuna.py +1 -1
- ccxt/async_support/mexc.py +9 -5
- ccxt/async_support/ndax.py +1 -1
- ccxt/async_support/okcoin.py +4 -0
- ccxt/async_support/okx.py +79 -76
- ccxt/async_support/paradex.py +65 -7
- ccxt/async_support/paymium.py +1 -1
- ccxt/async_support/poloniex.py +1265 -86
- ccxt/async_support/upbit.py +1 -1
- ccxt/async_support/whitebit.py +102 -4
- 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 +31 -4
- ccxt/base/types.py +28 -0
- ccxt/binance.py +107 -102
- ccxt/bingx.py +65 -43
- ccxt/bitfinex.py +1 -1
- ccxt/bitfinex1.py +1 -1
- ccxt/bitget.py +0 -3
- ccxt/bitmart.py +12 -1
- ccxt/bitopro.py +1 -0
- ccxt/bitrue.py +1 -0
- ccxt/bl3p.py +2 -2
- ccxt/cex.py +2 -0
- ccxt/coinbase.py +3 -2
- ccxt/coinbaseexchange.py +4 -2
- ccxt/coinbaseinternational.py +3 -2
- ccxt/coinex.py +1 -1
- ccxt/deribit.py +3 -1
- ccxt/derive.py +11 -7
- ccxt/gate.py +3 -0
- ccxt/gemini.py +2 -1
- ccxt/hashkey.py +4 -2
- ccxt/hitbtc.py +1 -1
- ccxt/hyperliquid.py +38 -0
- ccxt/kraken.py +78 -6
- ccxt/krakenfutures.py +4 -0
- ccxt/kucoin.py +5 -3
- ccxt/kuna.py +1 -1
- ccxt/mexc.py +9 -5
- ccxt/ndax.py +1 -1
- ccxt/okcoin.py +4 -0
- ccxt/okx.py +79 -76
- ccxt/paradex.py +65 -7
- ccxt/paymium.py +1 -1
- ccxt/poloniex.py +1264 -86
- ccxt/pro/__init__.py +1 -3
- ccxt/pro/binance.py +102 -102
- ccxt/pro/bingx.py +63 -52
- ccxt/pro/bitmart.py +15 -7
- ccxt/pro/derive.py +2 -2
- ccxt/pro/krakenfutures.py +1 -1
- ccxt/test/tests_async.py +1 -0
- ccxt/test/tests_sync.py +1 -0
- ccxt/upbit.py +1 -1
- ccxt/whitebit.py +102 -4
- ccxt/woo.py +3 -1
- ccxt/woofipro.py +1 -1
- ccxt/yobit.py +2 -1
- {ccxt-4.4.70.dist-info → ccxt-4.4.72.dist-info}/METADATA +6 -9
- {ccxt-4.4.70.dist-info → ccxt-4.4.72.dist-info}/RECORD +98 -99
- ccxt/abstract/poloniexfutures.py +0 -48
- {ccxt-4.4.70.dist-info → ccxt-4.4.72.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.4.70.dist-info → ccxt-4.4.72.dist-info}/WHEEL +0 -0
- {ccxt-4.4.70.dist-info → ccxt-4.4.72.dist-info}/top_level.txt +0 -0
ccxt/pro/bingx.py
CHANGED
@@ -42,7 +42,7 @@ class bingx(ccxt.async_support.bingx):
|
|
42
42
|
},
|
43
43
|
},
|
44
44
|
'options': {
|
45
|
-
'listenKeyRefreshRate': 3540000, # 1 hour(59 mins so we have
|
45
|
+
'listenKeyRefreshRate': 3540000, # 1 hour(59 mins so we have 1 min to renew the token)
|
46
46
|
'ws': {
|
47
47
|
'gunzip': True,
|
48
48
|
},
|
@@ -639,60 +639,67 @@ class bingx(ccxt.async_support.bingx):
|
|
639
639
|
#
|
640
640
|
# spot
|
641
641
|
#
|
642
|
-
#
|
643
|
-
#
|
644
|
-
#
|
645
|
-
#
|
646
|
-
#
|
647
|
-
#
|
648
|
-
#
|
649
|
-
#
|
650
|
-
#
|
651
|
-
#
|
652
|
-
#
|
653
|
-
#
|
654
|
-
#
|
655
|
-
#
|
656
|
-
#
|
657
|
-
#
|
642
|
+
# {
|
643
|
+
# "code":0,
|
644
|
+
# "data":
|
645
|
+
# {
|
646
|
+
# "asks":[
|
647
|
+
# ["84119.73","0.000011"],
|
648
|
+
# ["84116.52","0.000014"],
|
649
|
+
# ["84116.40","0.000039"]
|
650
|
+
# ],
|
651
|
+
# "bids":[
|
652
|
+
# ["83656.98","2.570805"],
|
653
|
+
# ["83655.51","0.000347"],
|
654
|
+
# ["83654.59","0.000082"]
|
655
|
+
# ],
|
656
|
+
# "lastUpdateId":13565694850
|
657
|
+
# },
|
658
|
+
# "dataType":"BTC-USDT@depth100",
|
659
|
+
# "success":true,
|
660
|
+
# "timestamp":1743241379958
|
661
|
+
# }
|
658
662
|
#
|
659
663
|
# linear swap
|
660
664
|
#
|
661
|
-
#
|
662
|
-
#
|
663
|
-
#
|
664
|
-
#
|
665
|
-
#
|
666
|
-
#
|
667
|
-
#
|
668
|
-
#
|
669
|
-
#
|
670
|
-
#
|
671
|
-
#
|
672
|
-
#
|
673
|
-
#
|
674
|
-
#
|
675
|
-
#
|
665
|
+
# {
|
666
|
+
# "code":0,
|
667
|
+
# "dataType":"BTC-USDT@depth100@500ms",
|
668
|
+
# "ts":1743241563651,
|
669
|
+
# "data":
|
670
|
+
# {
|
671
|
+
# "bids":[
|
672
|
+
# ["83363.2","0.1908"],
|
673
|
+
# ["83360.0","0.0003"],
|
674
|
+
# ["83356.5","0.0245"],
|
675
|
+
# ],
|
676
|
+
# "asks":[
|
677
|
+
# ["83495.0","0.0024"],
|
678
|
+
# ["83490.0","0.0001"],
|
679
|
+
# ["83488.0","0.0004"],
|
680
|
+
# ]
|
681
|
+
# }
|
682
|
+
# }
|
676
683
|
#
|
677
684
|
# inverse swap
|
678
685
|
#
|
679
686
|
# {
|
680
|
-
# "code":
|
681
|
-
# "dataType":
|
682
|
-
# "data":
|
683
|
-
#
|
684
|
-
#
|
685
|
-
# "
|
686
|
-
#
|
687
|
-
#
|
688
|
-
#
|
689
|
-
#
|
690
|
-
#
|
691
|
-
#
|
692
|
-
#
|
693
|
-
#
|
694
|
-
#
|
695
|
-
#
|
687
|
+
# "code":0,
|
688
|
+
# "dataType":"BTC-USD@depth100",
|
689
|
+
# "data":{
|
690
|
+
# "symbol":"BTC-USD",
|
691
|
+
# "bids":[
|
692
|
+
# {"p":"83411.2","a":"2.979216","v":"2485.0"},
|
693
|
+
# {"p":"83411.1","a":"1.592114","v":"1328.0"},
|
694
|
+
# {"p":"83410.8","a":"2.656730","v":"2216.0"},
|
695
|
+
# ],
|
696
|
+
# "asks":[
|
697
|
+
# {"p":"88200.0","a":"0.344671","v":"304.0"},
|
698
|
+
# {"p":"88023.8","a":"0.045442","v":"40.0"},
|
699
|
+
# {"p":"88001.0","a":"0.003409","v":"3.0"},
|
700
|
+
# ],
|
701
|
+
# "aggPrecision":"0.1",
|
702
|
+
# "timestamp":1743242290710
|
696
703
|
# }
|
697
704
|
# }
|
698
705
|
#
|
@@ -706,7 +713,8 @@ class bingx(ccxt.async_support.bingx):
|
|
706
713
|
marketType = 'swap' if isSwap else 'spot'
|
707
714
|
market = self.safe_market(marketId, None, None, marketType)
|
708
715
|
symbol = market['symbol']
|
709
|
-
|
716
|
+
orderbook = self.safe_value(self.orderbooks, symbol)
|
717
|
+
if orderbook is None:
|
710
718
|
# limit = [5, 10, 20, 50, 100]
|
711
719
|
subscriptionHash = dataType
|
712
720
|
subscription = client.subscriptions[subscriptionHash]
|
@@ -714,12 +722,15 @@ class bingx(ccxt.async_support.bingx):
|
|
714
722
|
self.orderbooks[symbol] = self.order_book({}, limit)
|
715
723
|
orderbook = self.orderbooks[symbol]
|
716
724
|
snapshot = None
|
725
|
+
timestamp = self.safe_integer_2(message, 'timestamp', 'ts')
|
726
|
+
timestamp = self.safe_integer_2(data, 'timestamp', 'ts', timestamp)
|
717
727
|
if market['inverse']:
|
718
|
-
snapshot = self.parse_order_book(data, symbol,
|
728
|
+
snapshot = self.parse_order_book(data, symbol, timestamp, 'bids', 'asks', 'p', 'a')
|
719
729
|
else:
|
720
|
-
snapshot = self.parse_order_book(data, symbol,
|
730
|
+
snapshot = self.parse_order_book(data, symbol, timestamp, 'bids', 'asks', 0, 1)
|
731
|
+
nonce = self.safe_integer(data, 'lastUpdateId')
|
732
|
+
snapshot['nonce'] = nonce
|
721
733
|
orderbook.reset(snapshot)
|
722
|
-
self.orderbooks[symbol] = orderbook
|
723
734
|
messageHash = self.get_message_hash('orderbook', symbol)
|
724
735
|
client.resolve(orderbook, messageHash)
|
725
736
|
# resolve for "all"
|
ccxt/pro/bitmart.py
CHANGED
@@ -858,15 +858,12 @@ class bitmart(ccxt.async_support.bitmart):
|
|
858
858
|
# "data":[
|
859
859
|
# {
|
860
860
|
# "trade_id":6798697637,
|
861
|
-
# "contract_id":1,
|
862
861
|
# "symbol":"BTCUSDT",
|
863
862
|
# "deal_price":"39735.8",
|
864
863
|
# "deal_vol":"2",
|
865
|
-
# "type":0,
|
866
864
|
# "way":1,
|
867
|
-
# "
|
868
|
-
# "
|
869
|
-
# "created_at":"2023-12-03T15:48:23.517518538Z"
|
865
|
+
# "created_at":"2023-12-03T15:48:23.517518538Z",
|
866
|
+
# "m": True,
|
870
867
|
# }
|
871
868
|
# ]
|
872
869
|
# }
|
@@ -899,6 +896,7 @@ class bitmart(ccxt.async_support.bitmart):
|
|
899
896
|
return symbol
|
900
897
|
|
901
898
|
def parse_ws_trade(self, trade: dict, market: Market = None):
|
899
|
+
#
|
902
900
|
# spot
|
903
901
|
# {
|
904
902
|
# "ms_t": 1740320841473,
|
@@ -929,6 +927,16 @@ class bitmart(ccxt.async_support.bitmart):
|
|
929
927
|
timestamp = self.parse8601(datetime)
|
930
928
|
else:
|
931
929
|
datetime = self.iso8601(timestamp)
|
930
|
+
takerOrMaker = None # True for public trades
|
931
|
+
side = self.safe_string(trade, 'side')
|
932
|
+
buyerMaker = self.safe_bool(trade, 'm')
|
933
|
+
if buyerMaker is not None:
|
934
|
+
if side is None:
|
935
|
+
if buyerMaker:
|
936
|
+
side = 'sell'
|
937
|
+
else:
|
938
|
+
side = 'buy'
|
939
|
+
takerOrMaker = 'taker'
|
932
940
|
return self.safe_trade({
|
933
941
|
'info': trade,
|
934
942
|
'id': self.safe_string(trade, 'trade_id'),
|
@@ -937,11 +945,11 @@ class bitmart(ccxt.async_support.bitmart):
|
|
937
945
|
'datetime': datetime,
|
938
946
|
'symbol': market['symbol'],
|
939
947
|
'type': None,
|
940
|
-
'side':
|
948
|
+
'side': side,
|
941
949
|
'price': self.safe_string_2(trade, 'price', 'deal_price'),
|
942
950
|
'amount': self.safe_string_2(trade, 'size', 'deal_vol'),
|
943
951
|
'cost': None,
|
944
|
-
'takerOrMaker':
|
952
|
+
'takerOrMaker': takerOrMaker,
|
945
953
|
'fee': None,
|
946
954
|
}, market)
|
947
955
|
|
ccxt/pro/derive.py
CHANGED
@@ -417,12 +417,12 @@ class derive(ccxt.async_support.derive):
|
|
417
417
|
requestId = self.request_id(url)
|
418
418
|
now = str(self.milliseconds())
|
419
419
|
signature = self.signMessage(now, self.privateKey)
|
420
|
-
|
420
|
+
deriveWalletAddress = self.safe_string(self.options, 'deriveWalletAddress')
|
421
421
|
request: dict = {
|
422
422
|
'id': requestId,
|
423
423
|
'method': 'public/login',
|
424
424
|
'params': {
|
425
|
-
'wallet':
|
425
|
+
'wallet': deriveWalletAddress,
|
426
426
|
'timestamp': now,
|
427
427
|
'signature': signature,
|
428
428
|
},
|
ccxt/pro/krakenfutures.py
CHANGED
@@ -460,7 +460,7 @@ class krakenfutures(ccxt.async_support.krakenfutures):
|
|
460
460
|
# {
|
461
461
|
# "feed": "trade",
|
462
462
|
# "product_id": "PI_XBTUSD",
|
463
|
-
# "uid": "caa9c653-420b-4c24-
|
463
|
+
# "uid": "caa9c653-420b-4c24-a9f2-462a054d86f1",
|
464
464
|
# "side": "sell",
|
465
465
|
# "type": "fill",
|
466
466
|
# "seq": 655508,
|
ccxt/test/tests_async.py
CHANGED
@@ -935,6 +935,7 @@ class testMainClass:
|
|
935
935
|
def init_offline_exchange(self, exchange_name):
|
936
936
|
markets = self.load_markets_from_file(exchange_name)
|
937
937
|
currencies = self.load_currencies_from_file(exchange_name)
|
938
|
+
# we add "proxy" 2 times to intentionally trigger InvalidProxySettings
|
938
939
|
exchange = init_exchange(exchange_name, {
|
939
940
|
'markets': markets,
|
940
941
|
'currencies': currencies,
|
ccxt/test/tests_sync.py
CHANGED
@@ -932,6 +932,7 @@ class testMainClass:
|
|
932
932
|
def init_offline_exchange(self, exchange_name):
|
933
933
|
markets = self.load_markets_from_file(exchange_name)
|
934
934
|
currencies = self.load_currencies_from_file(exchange_name)
|
935
|
+
# we add "proxy" 2 times to intentionally trigger InvalidProxySettings
|
935
936
|
exchange = init_exchange(exchange_name, {
|
936
937
|
'markets': markets,
|
937
938
|
'currencies': currencies,
|
ccxt/upbit.py
CHANGED
@@ -1886,7 +1886,7 @@ class upbit(Exchange, ImplicitAPI):
|
|
1886
1886
|
#
|
1887
1887
|
return self.parse_deposit_address(response)
|
1888
1888
|
|
1889
|
-
def create_deposit_address(self, code: str, params={}):
|
1889
|
+
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/whitebit.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.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,
|
@@ -1342,9 +1345,11 @@ class whitebit(Exchange, ImplicitAPI):
|
|
1342
1345
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1343
1346
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
1344
1347
|
"""
|
1345
|
-
|
1348
|
+
req = {
|
1349
|
+
'cost': cost,
|
1350
|
+
}
|
1346
1351
|
# only buy side is supported
|
1347
|
-
return self.create_order(symbol, 'market', side, 0, None, params)
|
1352
|
+
return self.create_order(symbol, 'market', side, 0, None, self.extend(req, params))
|
1348
1353
|
|
1349
1354
|
def create_market_buy_order_with_cost(self, symbol: str, cost: float, params={}) -> Order:
|
1350
1355
|
"""
|
@@ -1373,6 +1378,10 @@ class whitebit(Exchange, ImplicitAPI):
|
|
1373
1378
|
:param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
1374
1379
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1375
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
|
1376
1385
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
1377
1386
|
"""
|
1378
1387
|
self.load_markets()
|
@@ -1999,6 +2008,60 @@ class whitebit(Exchange, ImplicitAPI):
|
|
1999
2008
|
'tag': tag,
|
2000
2009
|
}
|
2001
2010
|
|
2011
|
+
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
|
+
self.load_markets()
|
2024
|
+
currency = self.currency(code)
|
2025
|
+
request: dict = {
|
2026
|
+
'ticker': currency['id'],
|
2027
|
+
}
|
2028
|
+
response = 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
|
+
|
2002
2065
|
def set_leverage(self, leverage: Int, symbol: Str = None, params={}):
|
2003
2066
|
"""
|
2004
2067
|
set the level of leverage for a market
|
@@ -3067,6 +3130,41 @@ class whitebit(Exchange, ImplicitAPI):
|
|
3067
3130
|
'takeProfitPrice': self.safe_number(tpsl, 'takeProfit'),
|
3068
3131
|
})
|
3069
3132
|
|
3133
|
+
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
|
+
self.load_markets()
|
3144
|
+
currency = self.currency(code)
|
3145
|
+
request: dict = {
|
3146
|
+
'ticker': currency['id'],
|
3147
|
+
}
|
3148
|
+
response = 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
|
+
|
3070
3168
|
def is_fiat(self, currency: str) -> bool:
|
3071
3169
|
fiatCurrencies = self.safe_value(self.options, 'fiatCurrencies', [])
|
3072
3170
|
return self.in_array(currency, fiatCurrencies)
|
ccxt/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/woofipro.py
CHANGED
ccxt/yobit.py
CHANGED
@@ -1216,7 +1216,7 @@ class yobit(Exchange, ImplicitAPI):
|
|
1216
1216
|
result.append(trade)
|
1217
1217
|
return self.filter_by_symbol_since_limit(result, market['symbol'], since, limit)
|
1218
1218
|
|
1219
|
-
def create_deposit_address(self, code: str, params={}):
|
1219
|
+
def create_deposit_address(self, code: str, params={}) -> DepositAddress:
|
1220
1220
|
"""
|
1221
1221
|
|
1222
1222
|
https://yobit.net/en/api
|
@@ -1236,6 +1236,7 @@ class yobit(Exchange, ImplicitAPI):
|
|
1236
1236
|
'currency': code,
|
1237
1237
|
'address': address,
|
1238
1238
|
'tag': None,
|
1239
|
+
'network': None,
|
1239
1240
|
'info': response['info'],
|
1240
1241
|
}
|
1241
1242
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: ccxt
|
3
|
-
Version: 4.4.
|
3
|
+
Version: 4.4.72
|
4
4
|
Summary: A JavaScript / TypeScript / Python / C# / PHP cryptocurrency trading library with support for 100+ exchanges
|
5
5
|
Home-page: https://ccxt.com
|
6
6
|
Author: Igor Kroitor
|
@@ -49,9 +49,9 @@ Requires-Dist: mypy==1.6.1; extra == "type"
|
|
49
49
|
|
50
50
|
# CCXT – CryptoCurrency eXchange Trading Library
|
51
51
|
|
52
|
-
[](https://www.npmjs.com/package/ccxt) [](https://npmjs.com/package/ccxt) [](https://pypi.python.org/pypi/ccxt) [](https://www.nuget.org/packages/ccxt) [](https://godoc.org/github.com/ccxt/ccxt/go/v4) [](https://discord.gg/ccxt) [](https://www.npmjs.com/package/ccxt) [](https://npmjs.com/package/ccxt) [](https://pypi.python.org/pypi/ccxt) [](https://www.nuget.org/packages/ccxt) [](https://godoc.org/github.com/ccxt/ccxt/go/v4) [](https://discord.gg/ccxt) [](https://github.com/ccxt/ccxt/wiki/Exchange-Markets) [](https://x.com/ccxt_official)
|
53
53
|
|
54
|
-
A JavaScript / Python / PHP / C
|
54
|
+
A `JavaScript` / `Python` / `PHP` / `C#` / `Go` library for cryptocurrency trading and e-commerce with support for many bitcoin/ether/altcoin exchange markets and merchant APIs.
|
55
55
|
|
56
56
|
### [Install](#install) · [Usage](#usage) · [Manual](https://github.com/ccxt/ccxt/wiki) · [FAQ](https://github.com/ccxt/ccxt/wiki/FAQ) · [Examples](https://github.com/ccxt/ccxt/tree/master/examples) · [Contributing](https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md) · [Social](#social)
|
57
57
|
|
@@ -70,9 +70,6 @@ Current feature list:
|
|
70
70
|
|
71
71
|
## Sponsored Promotion
|
72
72
|
|
73
|
-
[](https://www.gate.io/activities/ccxt-trading-competition)
|
74
|
-
|
75
|
-
|
76
73
|
## See Also
|
77
74
|
|
78
75
|
- <sub>[](https://tab-trader.com/?utm_source=ccxt)</sub> **[TabTrader](https://tab-trader.com/?utm_source=ccxt)** – trading on all exchanges in one app. Available on **[Android](https://play.google.com/store/apps/details?id=com.tabtrader.android&referrer=utm_source%3Dccxt)** and **[iOS](https://itunes.apple.com/app/apple-store/id1095716562?mt=8)**!
|
@@ -278,13 +275,13 @@ console.log(version, Object.keys(exchanges));
|
|
278
275
|
|
279
276
|
All-in-one browser bundle (dependencies included), served from a CDN of your choice:
|
280
277
|
|
281
|
-
* jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.4.
|
282
|
-
* unpkg: https://unpkg.com/ccxt@4.4.
|
278
|
+
* jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.4.72/dist/ccxt.browser.min.js
|
279
|
+
* unpkg: https://unpkg.com/ccxt@4.4.72/dist/ccxt.browser.min.js
|
283
280
|
|
284
281
|
CDNs are not updated in real-time and may have delays. Defaulting to the most recent version without specifying the version number is not recommended. Please, keep in mind that we are not responsible for the correct operation of those CDN servers.
|
285
282
|
|
286
283
|
```HTML
|
287
|
-
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@4.4.
|
284
|
+
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@4.4.72/dist/ccxt.browser.min.js"></script>
|
288
285
|
```
|
289
286
|
|
290
287
|
Creates a global `ccxt` object:
|