ccxt 4.4.14__py2.py3-none-any.whl → 4.4.16__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.
Files changed (150) hide show
  1. ccxt/__init__.py +1 -1
  2. ccxt/ascendex.py +5 -5
  3. ccxt/async_support/__init__.py +1 -1
  4. ccxt/async_support/ascendex.py +5 -5
  5. ccxt/async_support/base/exchange.py +1 -1
  6. ccxt/async_support/bigone.py +6 -4
  7. ccxt/async_support/binance.py +58 -7
  8. ccxt/async_support/bingx.py +7 -6
  9. ccxt/async_support/bit2c.py +6 -4
  10. ccxt/async_support/bitbank.py +6 -4
  11. ccxt/async_support/bitbns.py +6 -4
  12. ccxt/async_support/bitfinex.py +4 -2
  13. ccxt/async_support/bitfinex2.py +4 -2
  14. ccxt/async_support/bitget.py +6 -5
  15. ccxt/async_support/bitmart.py +5 -4
  16. ccxt/async_support/bitmex.py +4 -4
  17. ccxt/async_support/bitso.py +5 -4
  18. ccxt/async_support/bitstamp.py +6 -4
  19. ccxt/async_support/bitvavo.py +6 -4
  20. ccxt/async_support/blockchaincom.py +11 -8
  21. ccxt/async_support/blofin.py +21 -0
  22. ccxt/async_support/bybit.py +6 -6
  23. ccxt/async_support/cex.py +5 -4
  24. ccxt/async_support/coinbase.py +4 -4
  25. ccxt/async_support/coinex.py +5 -5
  26. ccxt/async_support/coinone.py +6 -3
  27. ccxt/async_support/coinsph.py +5 -5
  28. ccxt/async_support/cryptocom.py +5 -4
  29. ccxt/async_support/currencycom.py +5 -5
  30. ccxt/async_support/delta.py +7 -5
  31. ccxt/async_support/deribit.py +6 -4
  32. ccxt/async_support/digifinex.py +6 -4
  33. ccxt/async_support/exmo.py +6 -4
  34. ccxt/async_support/gate.py +5 -4
  35. ccxt/async_support/gemini.py +4 -3
  36. ccxt/async_support/hashkey.py +7 -5
  37. ccxt/async_support/hitbtc.py +6 -5
  38. ccxt/async_support/hollaex.py +6 -5
  39. ccxt/async_support/htx.py +16 -6
  40. ccxt/async_support/hyperliquid.py +8 -7
  41. ccxt/async_support/idex.py +4 -4
  42. ccxt/async_support/independentreserve.py +4 -4
  43. ccxt/async_support/indodax.py +3 -3
  44. ccxt/async_support/kraken.py +7 -5
  45. ccxt/async_support/kucoin.py +6 -5
  46. ccxt/async_support/kucoinfutures.py +5 -3
  47. ccxt/async_support/kuna.py +5 -3
  48. ccxt/async_support/lbank.py +14 -12
  49. ccxt/async_support/lykke.py +6 -4
  50. ccxt/async_support/mexc.py +6 -6
  51. ccxt/async_support/ndax.py +33 -5
  52. ccxt/async_support/oceanex.py +4 -4
  53. ccxt/async_support/okcoin.py +8 -6
  54. ccxt/async_support/okx.py +17 -6
  55. ccxt/async_support/onetrading.py +8 -7
  56. ccxt/async_support/oxfun.py +6 -6
  57. ccxt/async_support/paymium.py +6 -5
  58. ccxt/async_support/phemex.py +8 -6
  59. ccxt/async_support/poloniex.py +6 -4
  60. ccxt/async_support/probit.py +7 -6
  61. ccxt/async_support/timex.py +4 -4
  62. ccxt/async_support/tokocrypto.py +5 -5
  63. ccxt/async_support/upbit.py +7 -6
  64. ccxt/async_support/vertex.py +8 -0
  65. ccxt/async_support/wavesexchange.py +9 -9
  66. ccxt/async_support/wazirx.py +24 -4
  67. ccxt/async_support/whitebit.py +6 -4
  68. ccxt/async_support/woo.py +6 -4
  69. ccxt/async_support/xt.py +7 -5
  70. ccxt/async_support/yobit.py +32 -23
  71. ccxt/async_support/zonda.py +31 -6
  72. ccxt/base/exchange.py +2 -2
  73. ccxt/base/types.py +8 -0
  74. ccxt/bigone.py +6 -4
  75. ccxt/binance.py +58 -7
  76. ccxt/bingx.py +7 -6
  77. ccxt/bit2c.py +6 -4
  78. ccxt/bitbank.py +6 -4
  79. ccxt/bitbns.py +6 -4
  80. ccxt/bitfinex.py +4 -2
  81. ccxt/bitfinex2.py +4 -2
  82. ccxt/bitget.py +6 -5
  83. ccxt/bitmart.py +5 -4
  84. ccxt/bitmex.py +4 -4
  85. ccxt/bitso.py +5 -4
  86. ccxt/bitstamp.py +6 -4
  87. ccxt/bitvavo.py +6 -4
  88. ccxt/blockchaincom.py +11 -8
  89. ccxt/blofin.py +21 -0
  90. ccxt/bybit.py +6 -6
  91. ccxt/cex.py +5 -4
  92. ccxt/coinbase.py +4 -4
  93. ccxt/coinex.py +5 -5
  94. ccxt/coinone.py +6 -3
  95. ccxt/coinsph.py +5 -5
  96. ccxt/cryptocom.py +5 -4
  97. ccxt/currencycom.py +5 -5
  98. ccxt/delta.py +7 -5
  99. ccxt/deribit.py +6 -4
  100. ccxt/digifinex.py +6 -4
  101. ccxt/exmo.py +6 -4
  102. ccxt/gate.py +5 -4
  103. ccxt/gemini.py +4 -3
  104. ccxt/hashkey.py +7 -5
  105. ccxt/hitbtc.py +6 -5
  106. ccxt/hollaex.py +6 -5
  107. ccxt/htx.py +16 -6
  108. ccxt/hyperliquid.py +8 -7
  109. ccxt/idex.py +4 -4
  110. ccxt/independentreserve.py +4 -4
  111. ccxt/indodax.py +3 -3
  112. ccxt/kraken.py +7 -5
  113. ccxt/kucoin.py +6 -5
  114. ccxt/kucoinfutures.py +5 -3
  115. ccxt/kuna.py +5 -3
  116. ccxt/lbank.py +14 -12
  117. ccxt/lykke.py +6 -4
  118. ccxt/mexc.py +6 -6
  119. ccxt/ndax.py +33 -5
  120. ccxt/oceanex.py +4 -4
  121. ccxt/okcoin.py +8 -6
  122. ccxt/okx.py +17 -6
  123. ccxt/onetrading.py +8 -7
  124. ccxt/oxfun.py +6 -6
  125. ccxt/paymium.py +6 -5
  126. ccxt/phemex.py +8 -6
  127. ccxt/poloniex.py +6 -4
  128. ccxt/pro/__init__.py +1 -1
  129. ccxt/pro/binance.py +1 -1
  130. ccxt/pro/upbit.py +42 -1
  131. ccxt/pro/vertex.py +11 -0
  132. ccxt/probit.py +7 -6
  133. ccxt/test/tests_async.py +1 -0
  134. ccxt/test/tests_sync.py +1 -0
  135. ccxt/timex.py +4 -4
  136. ccxt/tokocrypto.py +5 -5
  137. ccxt/upbit.py +7 -6
  138. ccxt/vertex.py +8 -0
  139. ccxt/wavesexchange.py +9 -9
  140. ccxt/wazirx.py +24 -4
  141. ccxt/whitebit.py +6 -4
  142. ccxt/woo.py +6 -4
  143. ccxt/xt.py +7 -5
  144. ccxt/yobit.py +32 -23
  145. ccxt/zonda.py +31 -6
  146. {ccxt-4.4.14.dist-info → ccxt-4.4.16.dist-info}/METADATA +4 -4
  147. {ccxt-4.4.14.dist-info → ccxt-4.4.16.dist-info}/RECORD +150 -150
  148. {ccxt-4.4.14.dist-info → ccxt-4.4.16.dist-info}/LICENSE.txt +0 -0
  149. {ccxt-4.4.14.dist-info → ccxt-4.4.16.dist-info}/WHEEL +0 -0
  150. {ccxt-4.4.14.dist-info → ccxt-4.4.16.dist-info}/top_level.txt +0 -0
@@ -7,7 +7,7 @@ from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.yobit import ImplicitAPI
8
8
  import asyncio
9
9
  import hashlib
10
- from ccxt.base.types import Balances, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFees
10
+ from ccxt.base.types import Balances, DepositAddress, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFees
11
11
  from typing import List
12
12
  from ccxt.base.errors import ExchangeError
13
13
  from ccxt.base.errors import AuthenticationError
@@ -52,27 +52,48 @@ class yobit(Exchange, ImplicitAPI):
52
52
  'createStopMarketOrder': False,
53
53
  'createStopOrder': False,
54
54
  'fetchBalance': True,
55
+ 'fetchBorrowInterest': False,
56
+ 'fetchBorrowRate': False,
55
57
  'fetchBorrowRateHistories': False,
56
58
  'fetchBorrowRateHistory': False,
59
+ 'fetchBorrowRates': False,
60
+ 'fetchBorrowRatesPerSymbol': False,
57
61
  'fetchCrossBorrowRate': False,
58
62
  'fetchCrossBorrowRates': False,
59
63
  'fetchDepositAddress': True,
64
+ 'fetchDepositAddresses': False,
65
+ 'fetchDepositAddressesByNetwork': False,
60
66
  'fetchDeposits': False,
61
67
  'fetchFundingHistory': False,
68
+ 'fetchFundingInterval': False,
69
+ 'fetchFundingIntervals': False,
62
70
  'fetchFundingRate': False,
63
71
  'fetchFundingRateHistory': False,
64
72
  'fetchFundingRates': False,
73
+ 'fetchGreeks': False,
65
74
  'fetchIndexOHLCV': False,
66
75
  'fetchIsolatedBorrowRate': False,
67
76
  'fetchIsolatedBorrowRates': False,
77
+ 'fetchIsolatedPositions': False,
68
78
  'fetchLeverage': False,
79
+ 'fetchLeverages': False,
69
80
  'fetchLeverageTiers': False,
81
+ 'fetchLiquidations': False,
82
+ 'fetchMarginAdjustmentHistory': False,
70
83
  'fetchMarginMode': False,
84
+ 'fetchMarginModes': False,
85
+ 'fetchMarketLeverageTiers': False,
71
86
  'fetchMarkets': True,
72
87
  'fetchMarkOHLCV': False,
88
+ 'fetchMarkPrices': False,
89
+ 'fetchMyLiquidations': False,
90
+ 'fetchMySettlementHistory': False,
73
91
  'fetchMyTrades': True,
92
+ 'fetchOpenInterest': False,
74
93
  'fetchOpenInterestHistory': False,
75
94
  'fetchOpenOrders': True,
95
+ 'fetchOption': False,
96
+ 'fetchOptionChain': False,
76
97
  'fetchOrder': True,
77
98
  'fetchOrderBook': True,
78
99
  'fetchOrderBooks': True,
@@ -84,6 +105,7 @@ class yobit(Exchange, ImplicitAPI):
84
105
  'fetchPositionsHistory': False,
85
106
  'fetchPositionsRisk': False,
86
107
  'fetchPremiumIndexOHLCV': False,
108
+ 'fetchSettlementHistory': False,
87
109
  'fetchTicker': True,
88
110
  'fetchTickers': True,
89
111
  'fetchTrades': True,
@@ -92,9 +114,14 @@ class yobit(Exchange, ImplicitAPI):
92
114
  'fetchTransactions': False,
93
115
  'fetchTransfer': False,
94
116
  'fetchTransfers': False,
117
+ 'fetchUnderlyingAssets': False,
118
+ 'fetchVolatilityHistory': False,
95
119
  'fetchWithdrawals': False,
96
120
  'reduceMargin': False,
121
+ 'repayCrossMargin': False,
122
+ 'repayIsolatedMargin': False,
97
123
  'setLeverage': False,
124
+ 'setMargin': False,
98
125
  'setMarginMode': False,
99
126
  'setPositionMode': False,
100
127
  'transfer': False,
@@ -1126,10 +1153,10 @@ class yobit(Exchange, ImplicitAPI):
1126
1153
  'info': response['info'],
1127
1154
  }
1128
1155
 
1129
- async def fetch_deposit_address(self, code: str, params={}):
1156
+ async def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
1130
1157
  """
1131
- :see: https://yobit.net/en/api
1132
1158
  fetch the deposit address for a currency associated with self account
1159
+ :see: https://yobit.net/en/api
1133
1160
  :param str code: unified currency code
1134
1161
  :param dict [params]: extra parameters specific to the exchange API endpoint
1135
1162
  :returns dict: an `address structure <https://docs.ccxt.com/#/?id=address-structure>`
@@ -1152,29 +1179,11 @@ class yobit(Exchange, ImplicitAPI):
1152
1179
  address = self.safe_string(response['return'], 'address')
1153
1180
  self.check_address(address)
1154
1181
  return {
1155
- 'id': None,
1182
+ 'info': response,
1156
1183
  'currency': code,
1184
+ 'network': None,
1157
1185
  'address': address,
1158
1186
  'tag': None,
1159
- 'network': None,
1160
- 'info': response,
1161
- 'txid': None,
1162
- 'type': None,
1163
- 'amount': None,
1164
- 'status': None,
1165
- 'timestamp': None,
1166
- 'datetime': None,
1167
- 'addressFrom': None,
1168
- 'addressTo': None,
1169
- 'tagFrom': None,
1170
- 'tagTo': None,
1171
- 'updated': None,
1172
- 'comment': None,
1173
- 'fee': {
1174
- 'currency': None,
1175
- 'cost': None,
1176
- 'rate': None,
1177
- },
1178
1187
  }
1179
1188
 
1180
1189
  async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}):
@@ -6,7 +6,7 @@
6
6
  from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.zonda import ImplicitAPI
8
8
  import hashlib
9
- from ccxt.base.types import Balances, Currency, Int, LedgerEntry, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntry
9
+ from ccxt.base.types import Balances, Currency, DepositAddress, Int, LedgerEntry, Market, Num, Order, OrderBook, OrderSide, OrderType, 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
@@ -50,32 +50,52 @@ class zonda(Exchange, ImplicitAPI):
50
50
  'createOrder': True,
51
51
  'createReduceOnlyOrder': False,
52
52
  'fetchBalance': True,
53
+ 'fetchBorrowInterest': False,
54
+ 'fetchBorrowRate': False,
53
55
  'fetchBorrowRateHistories': False,
54
56
  'fetchBorrowRateHistory': False,
57
+ 'fetchBorrowRates': False,
58
+ 'fetchBorrowRatesPerSymbol': False,
55
59
  'fetchCrossBorrowRate': False,
56
60
  'fetchCrossBorrowRates': False,
57
61
  'fetchDeposit': False,
58
62
  'fetchDepositAddress': True,
59
63
  'fetchDepositAddresses': True,
64
+ 'fetchDepositAddressesByNetwork': False,
60
65
  'fetchDeposits': None,
61
66
  'fetchFundingHistory': False,
67
+ 'fetchFundingInterval': False,
68
+ 'fetchFundingIntervals': False,
62
69
  'fetchFundingRate': False,
63
70
  'fetchFundingRateHistory': False,
64
71
  'fetchFundingRates': False,
72
+ 'fetchGreeks': False,
65
73
  'fetchIndexOHLCV': False,
66
74
  'fetchIsolatedBorrowRate': False,
67
75
  'fetchIsolatedBorrowRates': False,
76
+ 'fetchIsolatedPositions': False,
68
77
  'fetchLedger': True,
69
78
  'fetchLeverage': False,
79
+ 'fetchLeverages': False,
70
80
  'fetchLeverageTiers': False,
81
+ 'fetchLiquidations': False,
82
+ 'fetchMarginAdjustmentHistory': False,
71
83
  'fetchMarginMode': False,
84
+ 'fetchMarginModes': False,
85
+ 'fetchMarketLeverageTiers': False,
72
86
  'fetchMarkets': True,
73
87
  'fetchMarkOHLCV': False,
88
+ 'fetchMarkPrices': False,
89
+ 'fetchMyLiquidations': False,
90
+ 'fetchMySettlementHistory': False,
74
91
  'fetchMyTrades': True,
75
92
  'fetchOHLCV': True,
93
+ 'fetchOpenInterest': False,
76
94
  'fetchOpenInterestHistory': False,
77
95
  'fetchOpenOrder': False,
78
96
  'fetchOpenOrders': True,
97
+ 'fetchOption': False,
98
+ 'fetchOptionChain': False,
79
99
  'fetchOrderBook': True,
80
100
  'fetchOrderBooks': False,
81
101
  'fetchPosition': False,
@@ -83,6 +103,7 @@ class zonda(Exchange, ImplicitAPI):
83
103
  'fetchPositions': False,
84
104
  'fetchPositionsRisk': False,
85
105
  'fetchPremiumIndexOHLCV': False,
106
+ 'fetchSettlementHistory': False,
86
107
  'fetchTicker': True,
87
108
  'fetchTickers': True,
88
109
  'fetchTime': False,
@@ -93,9 +114,13 @@ class zonda(Exchange, ImplicitAPI):
93
114
  'fetchTransactionFees': False,
94
115
  'fetchTransactions': None,
95
116
  'fetchTransfer': False,
117
+ 'fetchUnderlyingAssets': False,
118
+ 'fetchVolatilityHistory': False,
96
119
  'fetchWithdrawal': False,
97
120
  'fetchWithdrawals': None,
98
121
  'reduceMargin': False,
122
+ 'repayCrossMargin': False,
123
+ 'repayIsolatedMargin': False,
99
124
  'setLeverage': False,
100
125
  'setMargin': False,
101
126
  'setMarginMode': False,
@@ -1476,7 +1501,7 @@ class zonda(Exchange, ImplicitAPI):
1476
1501
  }
1477
1502
  return self.safe_bool(fiatCurrencies, currency, False)
1478
1503
 
1479
- def parse_deposit_address(self, depositAddress, currency: Currency = None):
1504
+ def parse_deposit_address(self, depositAddress, currency: Currency = None) -> DepositAddress:
1480
1505
  #
1481
1506
  # {
1482
1507
  # "address": "33u5YAEhQbYfjHHPsfMfCoSdEjfwYjVcBE",
@@ -1490,14 +1515,14 @@ class zonda(Exchange, ImplicitAPI):
1490
1515
  address = self.safe_string(depositAddress, 'address')
1491
1516
  self.check_address(address)
1492
1517
  return {
1518
+ 'info': depositAddress,
1493
1519
  'currency': self.safe_currency_code(currencyId, currency),
1520
+ 'network': None,
1494
1521
  'address': address,
1495
1522
  'tag': self.safe_string(depositAddress, 'tag'),
1496
- 'network': None,
1497
- 'info': depositAddress,
1498
1523
  }
1499
1524
 
1500
- async def fetch_deposit_address(self, code: str, params={}):
1525
+ async def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
1501
1526
  """
1502
1527
  :see: https://docs.zondacrypto.exchange/reference/deposit-addresses-for-crypto
1503
1528
  fetch the deposit address for a currency associated with self account
@@ -1529,7 +1554,7 @@ class zonda(Exchange, ImplicitAPI):
1529
1554
  first = self.safe_dict(data, 0)
1530
1555
  return self.parse_deposit_address(first, currency)
1531
1556
 
1532
- async def fetch_deposit_addresses(self, codes: Strings = None, params={}):
1557
+ async def fetch_deposit_addresses(self, codes: Strings = None, params={}) -> List[DepositAddress]:
1533
1558
  """
1534
1559
  :see: https://docs.zondacrypto.exchange/reference/deposit-addresses-for-crypto
1535
1560
  fetch deposit addresses for multiple currencies and chain types
ccxt/base/exchange.py CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  # -----------------------------------------------------------------------------
6
6
 
7
- __version__ = '4.4.14'
7
+ __version__ = '4.4.16'
8
8
 
9
9
  # -----------------------------------------------------------------------------
10
10
 
@@ -5423,7 +5423,7 @@ class Exchange(object):
5423
5423
  if codes is not None:
5424
5424
  result = self.filter_by_array(result, 'currency', codes, False)
5425
5425
  if indexed:
5426
- return self.index_by(result, 'currency')
5426
+ result = self.filter_by_array(result, 'currency', None, indexed)
5427
5427
  return result
5428
5428
 
5429
5429
  def parse_borrow_interests(self, response, market: Market = None):
ccxt/base/types.py CHANGED
@@ -514,6 +514,14 @@ class LedgerEntry:
514
514
  fee: Fee
515
515
 
516
516
 
517
+ class DepositAddress:
518
+ info: Any
519
+ currency: Str
520
+ network: Optional[Str]
521
+ address: Str
522
+ tag: Optional[Str]
523
+
524
+
517
525
  FundingRates = Dict[Str, FundingRate]
518
526
  LastPrices = Dict[Str, LastPrice]
519
527
  Currencies = Dict[Str, CurrencyInterface]
ccxt/bigone.py CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  from ccxt.base.exchange import Exchange
7
7
  from ccxt.abstract.bigone import ImplicitAPI
8
- from ccxt.base.types import Balances, Bool, Currencies, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntry
8
+ from ccxt.base.types import Balances, Bool, Currencies, Currency, DepositAddress, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntry
9
9
  from typing import List
10
10
  from ccxt.base.errors import ExchangeError
11
11
  from ccxt.base.errors import AuthenticationError
@@ -51,6 +51,8 @@ class bigone(Exchange, ImplicitAPI):
51
51
  'fetchClosedOrders': True,
52
52
  'fetchCurrencies': True,
53
53
  'fetchDepositAddress': True,
54
+ 'fetchDepositAddresses': False,
55
+ 'fetchDepositAddressesByNetwork': False,
54
56
  'fetchDeposits': True,
55
57
  'fetchFundingRate': False,
56
58
  'fetchMarkets': True,
@@ -1700,7 +1702,7 @@ class bigone(Exchange, ImplicitAPI):
1700
1702
  headers['User-Agent'] = 'ccxt/' + self.id + '-' + self.version
1701
1703
  return {'url': url, 'method': method, 'body': body, 'headers': headers}
1702
1704
 
1703
- def fetch_deposit_address(self, code: str, params={}):
1705
+ def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
1704
1706
  """
1705
1707
  fetch the deposit address for a currency associated with self account
1706
1708
  :see: https://open.big.one/docs/spot_deposit.html#get-deposite-address-of-one-asset-of-user
@@ -1743,11 +1745,11 @@ class bigone(Exchange, ImplicitAPI):
1743
1745
  tag = self.safe_string(addressObject, 'memo')
1744
1746
  self.check_address(address)
1745
1747
  return {
1748
+ 'info': response,
1746
1749
  'currency': code,
1750
+ 'network': self.network_id_to_code(selectedNetworkId),
1747
1751
  'address': address,
1748
1752
  'tag': tag,
1749
- 'network': self.network_id_to_code(selectedNetworkId),
1750
- 'info': response,
1751
1753
  }
1752
1754
 
1753
1755
  def parse_transaction_status(self, status: Str):
ccxt/binance.py CHANGED
@@ -7,7 +7,7 @@ from ccxt.base.exchange import Exchange
7
7
  from ccxt.abstract.binance import ImplicitAPI
8
8
  import hashlib
9
9
  import json
10
- from ccxt.base.types import Balances, Conversion, CrossBorrowRate, Currencies, Currency, Greeks, Int, IsolatedBorrowRate, IsolatedBorrowRates, LedgerEntry, Leverage, Leverages, LeverageTier, LeverageTiers, MarginMode, MarginModes, MarginModification, Market, MarketInterface, Num, Option, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade, TradingFeeInterface, TradingFees, Transaction, TransferEntry
10
+ from ccxt.base.types import Balances, Conversion, CrossBorrowRate, Currencies, Currency, DepositAddress, Greeks, Int, IsolatedBorrowRate, IsolatedBorrowRates, LedgerEntry, Leverage, Leverages, LeverageTier, LeverageTiers, MarginMode, MarginModes, MarginModification, Market, MarketInterface, Num, Option, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade, TradingFeeInterface, TradingFees, Transaction, TransferEntry
11
11
  from typing import List
12
12
  from ccxt.base.errors import ExchangeError
13
13
  from ccxt.base.errors import AuthenticationError
@@ -134,6 +134,7 @@ class binance(Exchange, ImplicitAPI):
134
134
  'fetchMarketLeverageTiers': 'emulated',
135
135
  'fetchMarkets': True,
136
136
  'fetchMarkOHLCV': True,
137
+ 'fetchMarkPrice': True,
137
138
  'fetchMarkPrices': True,
138
139
  'fetchMyLiquidations': True,
139
140
  'fetchMySettlementHistory': True,
@@ -4108,10 +4109,41 @@ class binance(Exchange, ImplicitAPI):
4108
4109
  raise NotSupported(self.id + ' fetchTickers() does not support ' + type + ' markets yet')
4109
4110
  return self.parse_tickers(response, symbols)
4110
4111
 
4112
+ def fetch_mark_price(self, symbol: str, params={}) -> Ticker:
4113
+ """
4114
+ fetches mark price for the market
4115
+ :see: https://binance-docs.github.io/apidocs/futures/en/#mark-price
4116
+ :see: https://binance-docs.github.io/apidocs/delivery/en/#index-price-and-mark-price
4117
+ :param str[] [symbols]: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
4118
+ :param dict [params]: extra parameters specific to the exchange API endpoint
4119
+ :param str [params.subType]: "linear" or "inverse"
4120
+ :returns dict: a dictionary of `ticker structures <https://docs.ccxt.com/#/?id=ticker-structure>`
4121
+ """
4122
+ self.load_markets()
4123
+ market = self.market(symbol)
4124
+ type = None
4125
+ type, params = self.handle_market_type_and_params('fetchMarkPrice', market, params, 'swap')
4126
+ subType = None
4127
+ subType, params = self.handle_sub_type_and_params('fetchMarkPrice', market, params, 'linear')
4128
+ request = {
4129
+ 'symbol': market['id'],
4130
+ }
4131
+ response = None
4132
+ if self.is_linear(type, subType):
4133
+ response = self.fapiPublicGetPremiumIndex(self.extend(request, params))
4134
+ elif self.is_inverse(type, subType):
4135
+ response = self.dapiPublicGetPremiumIndex(self.extend(request, params))
4136
+ else:
4137
+ raise NotSupported(self.id + ' fetchMarkPrice() does not support ' + type + ' markets yet')
4138
+ if isinstance(response, list):
4139
+ return self.parse_ticker(self.safe_dict(response, 0, {}), market)
4140
+ return self.parse_ticker(response, market)
4141
+
4111
4142
  def fetch_mark_prices(self, symbols: Strings = None, params={}) -> Tickers:
4112
4143
  """
4113
4144
  fetches mark prices for multiple markets
4114
4145
  :see: https://binance-docs.github.io/apidocs/futures/en/#mark-price
4146
+ :see: https://binance-docs.github.io/apidocs/delivery/en/#index-price-and-mark-price
4115
4147
  :param str[] [symbols]: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
4116
4148
  :param dict [params]: extra parameters specific to the exchange API endpoint
4117
4149
  :param str [params.subType]: "linear" or "inverse"
@@ -4121,9 +4153,9 @@ class binance(Exchange, ImplicitAPI):
4121
4153
  symbols = self.market_symbols(symbols, None, True, True, True)
4122
4154
  market = self.get_market_from_symbols(symbols)
4123
4155
  type = None
4124
- type, params = self.handle_market_type_and_params('fetchTickers', market, params, 'swap')
4156
+ type, params = self.handle_market_type_and_params('fetchMarkPrices', market, params, 'swap')
4125
4157
  subType = None
4126
- subType, params = self.handle_sub_type_and_params('fetchTickers', market, params, 'linear')
4158
+ subType, params = self.handle_sub_type_and_params('fetchMarkPrices', market, params, 'linear')
4127
4159
  response = None
4128
4160
  if self.is_linear(type, subType):
4129
4161
  response = self.fapiPublicGetPremiumIndex(params)
@@ -8078,7 +8110,7 @@ class binance(Exchange, ImplicitAPI):
8078
8110
  rows = self.safe_list_2(response, 'rows', 'data', [])
8079
8111
  return self.parse_transfers(rows, currency, since, limit)
8080
8112
 
8081
- def fetch_deposit_address(self, code: str, params={}):
8113
+ def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
8082
8114
  """
8083
8115
  fetch the deposit address for a currency associated with self account
8084
8116
  :see: https://developers.binance.com/docs/wallet/capital/deposite-address
@@ -8113,8 +8145,27 @@ class binance(Exchange, ImplicitAPI):
8113
8145
  # }
8114
8146
  # }
8115
8147
  #
8148
+ return self.parse_deposit_address(response, currency)
8149
+
8150
+ def parse_deposit_address(self, response, currency: Currency = None) -> DepositAddress:
8151
+ #
8152
+ # {
8153
+ # "currency": "XRP",
8154
+ # "address": "rEb8TK3gBgk5auZkwc6sHnwrGVJH8DuaLh",
8155
+ # "tag": "108618262",
8156
+ # "info": {
8157
+ # "coin": "XRP",
8158
+ # "address": "rEb8TK3gBgk5auZkwc6sHnwrGVJH8DuaLh",
8159
+ # "tag": "108618262",
8160
+ # "url": "https://bithomp.com/explorer/rEb8TK3gBgk5auZkwc6sHnwrGVJH8DuaLh"
8161
+ # }
8162
+ # }
8163
+ #
8164
+ info = self.safe_dict(response, 'info', {})
8165
+ url = self.safe_string(info, 'url')
8116
8166
  address = self.safe_string(response, 'address')
8117
- url = self.safe_string(response, 'url')
8167
+ currencyId = self.safe_string(response, 'currency')
8168
+ code = self.safe_currency_code(currencyId, currency)
8118
8169
  impliedNetwork = None
8119
8170
  if url is not None:
8120
8171
  reverseNetworks = self.safe_dict(self.options, 'reverseNetworks', {})
@@ -8137,11 +8188,11 @@ class binance(Exchange, ImplicitAPI):
8137
8188
  tag = None
8138
8189
  self.check_address(address)
8139
8190
  return {
8191
+ 'info': response,
8140
8192
  'currency': code,
8193
+ 'network': impliedNetwork,
8141
8194
  'address': address,
8142
8195
  'tag': tag,
8143
- 'network': impliedNetwork,
8144
- 'info': response,
8145
8196
  }
8146
8197
 
8147
8198
  def fetch_transaction_fees(self, codes: Strings = None, params={}):
ccxt/bingx.py CHANGED
@@ -7,7 +7,7 @@ from ccxt.base.exchange import Exchange
7
7
  from ccxt.abstract.bingx import ImplicitAPI
8
8
  import hashlib
9
9
  import numbers
10
- from ccxt.base.types import Balances, Currencies, Currency, Int, Leverage, MarginMode, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade, TradingFeeInterface, Transaction, TransferEntry
10
+ from ccxt.base.types import Balances, Currencies, Currency, DepositAddress, Int, Leverage, MarginMode, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade, TradingFeeInterface, Transaction, TransferEntry
11
11
  from typing import List
12
12
  from ccxt.base.errors import ExchangeError
13
13
  from ccxt.base.errors import AuthenticationError
@@ -67,6 +67,7 @@ class bingx(Exchange, ImplicitAPI):
67
67
  'fetchClosedOrders': True,
68
68
  'fetchCurrencies': True,
69
69
  'fetchDepositAddress': True,
70
+ 'fetchDepositAddresses': False,
70
71
  'fetchDepositAddressesByNetwork': True,
71
72
  'fetchDeposits': True,
72
73
  'fetchDepositWithdrawFee': 'emulated',
@@ -4170,7 +4171,7 @@ class bingx(Exchange, ImplicitAPI):
4170
4171
  'status': status,
4171
4172
  }
4172
4173
 
4173
- def fetch_deposit_addresses_by_network(self, code: str, params={}):
4174
+ def fetch_deposit_addresses_by_network(self, code: str, params={}) -> List[DepositAddress]:
4174
4175
  """
4175
4176
  fetch the deposit addresses for a currency associated with self account
4176
4177
  :see: https://bingx-api.github.io/docs/#/en-us/common/wallet-api.html#Query%20Main%20Account%20Deposit%20Address
@@ -4211,7 +4212,7 @@ class bingx(Exchange, ImplicitAPI):
4211
4212
  parsed = self.parse_deposit_addresses(data, [currency['code']], False)
4212
4213
  return self.index_by(parsed, 'network')
4213
4214
 
4214
- def fetch_deposit_address(self, code: str, params={}):
4215
+ def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
4215
4216
  """
4216
4217
  fetch the deposit address for a currency associated with self account
4217
4218
  :see: https://bingx-api.github.io/docs/#/en-us/common/wallet-api.html#Query%20Main%20Account%20Deposit%20Address
@@ -4235,7 +4236,7 @@ class bingx(Exchange, ImplicitAPI):
4235
4236
  key = self.safe_string(keys, 0)
4236
4237
  return self.safe_dict(addressStructures, key)
4237
4238
 
4238
- def parse_deposit_address(self, depositAddress, currency: Currency = None):
4239
+ def parse_deposit_address(self, depositAddress, currency: Currency = None) -> DepositAddress:
4239
4240
  #
4240
4241
  # {
4241
4242
  # "coinId": "799",
@@ -4265,11 +4266,11 @@ class bingx(Exchange, ImplicitAPI):
4265
4266
  address = '0x' + address
4266
4267
  self.check_address(address)
4267
4268
  return {
4269
+ 'info': depositAddress,
4268
4270
  'currency': code,
4271
+ 'network': networkCode,
4269
4272
  'address': address,
4270
4273
  'tag': tag,
4271
- 'network': networkCode,
4272
- 'info': depositAddress,
4273
4274
  }
4274
4275
 
4275
4276
  def fetch_deposits(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
ccxt/bit2c.py CHANGED
@@ -6,7 +6,7 @@
6
6
  from ccxt.base.exchange import Exchange
7
7
  from ccxt.abstract.bit2c import ImplicitAPI
8
8
  import hashlib
9
- from ccxt.base.types import Balances, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Ticker, Trade, TradingFees
9
+ from ccxt.base.types import Balances, Currency, DepositAddress, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Ticker, Trade, TradingFees
10
10
  from typing import List
11
11
  from ccxt.base.errors import ExchangeError
12
12
  from ccxt.base.errors import AuthenticationError
@@ -48,6 +48,8 @@ class bit2c(Exchange, ImplicitAPI):
48
48
  'fetchCrossBorrowRate': False,
49
49
  'fetchCrossBorrowRates': False,
50
50
  'fetchDepositAddress': True,
51
+ 'fetchDepositAddresses': False,
52
+ 'fetchDepositAddressesByNetwork': False,
51
53
  'fetchFundingHistory': False,
52
54
  'fetchFundingRate': False,
53
55
  'fetchFundingRateHistory': False,
@@ -779,7 +781,7 @@ class bit2c(Exchange, ImplicitAPI):
779
781
  def is_fiat(self, code):
780
782
  return code == 'NIS'
781
783
 
782
- def fetch_deposit_address(self, code: str, params={}):
784
+ def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
783
785
  """
784
786
  fetch the deposit address for a currency associated with self account
785
787
  :see: https://bit2c.co.il/home/api#addc
@@ -803,7 +805,7 @@ class bit2c(Exchange, ImplicitAPI):
803
805
  #
804
806
  return self.parse_deposit_address(response, currency)
805
807
 
806
- def parse_deposit_address(self, depositAddress, currency: Currency = None):
808
+ def parse_deposit_address(self, depositAddress, currency: Currency = None) -> DepositAddress:
807
809
  #
808
810
  # {
809
811
  # "address": "0xf14b94518d74aff2b1a6d3429471bcfcd3881d42",
@@ -814,11 +816,11 @@ class bit2c(Exchange, ImplicitAPI):
814
816
  self.check_address(address)
815
817
  code = self.safe_currency_code(None, currency)
816
818
  return {
819
+ 'info': depositAddress,
817
820
  'currency': code,
818
821
  'network': None,
819
822
  'address': address,
820
823
  'tag': None,
821
- 'info': depositAddress,
822
824
  }
823
825
 
824
826
  def nonce(self):
ccxt/bitbank.py CHANGED
@@ -6,7 +6,7 @@
6
6
  from ccxt.base.exchange import Exchange
7
7
  from ccxt.abstract.bitbank import ImplicitAPI
8
8
  import hashlib
9
- from ccxt.base.types import Balances, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Ticker, Trade, TradingFees, Transaction
9
+ from ccxt.base.types import Balances, Currency, DepositAddress, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Ticker, 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
@@ -46,6 +46,8 @@ class bitbank(Exchange, ImplicitAPI):
46
46
  'fetchCrossBorrowRate': False,
47
47
  'fetchCrossBorrowRates': False,
48
48
  'fetchDepositAddress': True,
49
+ 'fetchDepositAddresses': False,
50
+ 'fetchDepositAddressesByNetwork': False,
49
51
  'fetchFundingHistory': False,
50
52
  'fetchFundingRate': False,
51
53
  'fetchFundingRateHistory': False,
@@ -785,7 +787,7 @@ class bitbank(Exchange, ImplicitAPI):
785
787
  trades = self.safe_list(data, 'trades', [])
786
788
  return self.parse_trades(trades, market, since, limit)
787
789
 
788
- def fetch_deposit_address(self, code: str, params={}):
790
+ def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
789
791
  """
790
792
  fetch the deposit address for a currency associated with self account
791
793
  :see: https://github.com/bitbankinc/bitbank-api-docs/blob/38d6d7c6f486c793872fd4b4087a0d090a04cd0a/rest-api.md#get-withdrawal-accounts
@@ -805,11 +807,11 @@ class bitbank(Exchange, ImplicitAPI):
805
807
  firstAccount = self.safe_value(accounts, 0, {})
806
808
  address = self.safe_string(firstAccount, 'address')
807
809
  return {
810
+ 'info': response,
808
811
  'currency': currency,
812
+ 'network': None,
809
813
  'address': address,
810
814
  'tag': None,
811
- 'network': None,
812
- 'info': response,
813
815
  }
814
816
 
815
817
  def withdraw(self, code: str, amount: float, address: str, tag=None, params={}):
ccxt/bitbns.py CHANGED
@@ -6,7 +6,7 @@
6
6
  from ccxt.base.exchange import Exchange
7
7
  from ccxt.abstract.bitbns import ImplicitAPI
8
8
  import hashlib
9
- from ccxt.base.types import Balances, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
9
+ from ccxt.base.types import Balances, Currency, DepositAddress, Int, Market, Num, Order, 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 ArgumentsRequired
@@ -41,6 +41,8 @@ class bitbns(Exchange, ImplicitAPI):
41
41
  'createOrder': True,
42
42
  'fetchBalance': True,
43
43
  'fetchDepositAddress': True,
44
+ 'fetchDepositAddresses': False,
45
+ 'fetchDepositAddressesByNetwork': False,
44
46
  'fetchDeposits': True,
45
47
  'fetchFundingHistory': False,
46
48
  'fetchFundingRate': False,
@@ -1065,7 +1067,7 @@ class bitbns(Exchange, ImplicitAPI):
1065
1067
  'fee': fee,
1066
1068
  }
1067
1069
 
1068
- def fetch_deposit_address(self, code: str, params={}):
1070
+ def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
1069
1071
  """
1070
1072
  fetch the deposit address for a currency associated with self account
1071
1073
  :param str code: unified currency code
@@ -1093,11 +1095,11 @@ class bitbns(Exchange, ImplicitAPI):
1093
1095
  tag = self.safe_string(data, 'tag')
1094
1096
  self.check_address(address)
1095
1097
  return {
1098
+ 'info': response,
1096
1099
  'currency': code,
1100
+ 'network': None,
1097
1101
  'address': address,
1098
1102
  'tag': tag,
1099
- 'network': None,
1100
- 'info': response,
1101
1103
  }
1102
1104
 
1103
1105
  def nonce(self):
ccxt/bitfinex.py CHANGED
@@ -6,7 +6,7 @@
6
6
  from ccxt.base.exchange import Exchange
7
7
  from ccxt.abstract.bitfinex import ImplicitAPI
8
8
  import hashlib
9
- from ccxt.base.types import Balances, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFees, Transaction, TransferEntry
9
+ from ccxt.base.types import Balances, Currency, DepositAddress, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, 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
@@ -54,6 +54,8 @@ class bitfinex(Exchange, ImplicitAPI):
54
54
  'fetchBalance': True,
55
55
  'fetchClosedOrders': True,
56
56
  'fetchDepositAddress': True,
57
+ 'fetchDepositAddresses': False,
58
+ 'fetchDepositAddressesByNetwork': False,
57
59
  'fetchDeposits': False,
58
60
  'fetchDepositsWithdrawals': True,
59
61
  'fetchDepositWithdrawFee': 'emulated',
@@ -1361,7 +1363,7 @@ class bitfinex(Exchange, ImplicitAPI):
1361
1363
  }
1362
1364
  return self.fetch_deposit_address(code, self.extend(request, params))
1363
1365
 
1364
- def fetch_deposit_address(self, code: str, params={}):
1366
+ def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
1365
1367
  """
1366
1368
  fetch the deposit address for a currency associated with self account
1367
1369
  :see: https://docs.bitfinex.com/v1/reference/rest-auth-deposit