ccxt 4.3.13__py2.py3-none-any.whl → 4.3.14__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/async_support/__init__.py +1 -1
- ccxt/async_support/base/exchange.py +1 -1
- ccxt/async_support/binance.py +99 -3
- ccxt/async_support/bybit.py +99 -99
- ccxt/async_support/coinbase.py +96 -1
- ccxt/async_support/coinex.py +392 -375
- ccxt/async_support/okx.py +1 -1
- ccxt/base/exchange.py +5 -1
- ccxt/binance.py +99 -3
- ccxt/bybit.py +99 -99
- ccxt/coinbase.py +96 -1
- ccxt/coinex.py +392 -375
- ccxt/okx.py +1 -1
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/woo.py +137 -9
- {ccxt-4.3.13.dist-info → ccxt-4.3.14.dist-info}/METADATA +4 -4
- {ccxt-4.3.13.dist-info → ccxt-4.3.14.dist-info}/RECORD +20 -20
- {ccxt-4.3.13.dist-info → ccxt-4.3.14.dist-info}/WHEEL +0 -0
- {ccxt-4.3.13.dist-info → ccxt-4.3.14.dist-info}/top_level.txt +0 -0
ccxt/__init__.py
CHANGED
ccxt/async_support/__init__.py
CHANGED
ccxt/async_support/binance.py
CHANGED
@@ -8,7 +8,7 @@ from ccxt.abstract.binance import ImplicitAPI
|
|
8
8
|
import asyncio
|
9
9
|
import hashlib
|
10
10
|
import json
|
11
|
-
from ccxt.base.types import Balances, Conversion, CrossBorrowRate, Currencies, Currency, Greeks, Int, Leverage, Leverages, MarginMode, MarginModes, MarginModification, Market, MarketInterface, Num, Option, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, TradingFees, Transaction, TransferEntry
|
11
|
+
from ccxt.base.types import Balances, Conversion, CrossBorrowRate, Currencies, Currency, Greeks, Int, IsolatedBorrowRate, IsolatedBorrowRates, Leverage, Leverages, MarginMode, MarginModes, MarginModification, Market, MarketInterface, Num, Option, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, TradingFees, Transaction, TransferEntry
|
12
12
|
from typing import List
|
13
13
|
from ccxt.base.errors import ExchangeError
|
14
14
|
from ccxt.base.errors import AuthenticationError
|
@@ -116,8 +116,8 @@ class binance(Exchange, ImplicitAPI):
|
|
116
116
|
'fetchFundingRates': True,
|
117
117
|
'fetchGreeks': True,
|
118
118
|
'fetchIndexOHLCV': True,
|
119
|
-
'fetchIsolatedBorrowRate':
|
120
|
-
'fetchIsolatedBorrowRates':
|
119
|
+
'fetchIsolatedBorrowRate': 'emulated',
|
120
|
+
'fetchIsolatedBorrowRates': True,
|
121
121
|
'fetchL3OrderBook': False,
|
122
122
|
'fetchLastPrices': True,
|
123
123
|
'fetchLedger': True,
|
@@ -10434,6 +10434,65 @@ class binance(Exchange, ImplicitAPI):
|
|
10434
10434
|
rate = self.safe_dict(response, 0)
|
10435
10435
|
return self.parse_borrow_rate(rate)
|
10436
10436
|
|
10437
|
+
async def fetch_isolated_borrow_rate(self, symbol: str, params={}) -> IsolatedBorrowRate:
|
10438
|
+
"""
|
10439
|
+
fetch the rate of interest to borrow a currency for margin trading
|
10440
|
+
:see: https://binance-docs.github.io/apidocs/spot/en/#query-isolated-margin-fee-data-user_data
|
10441
|
+
:param str symbol: unified market symbol
|
10442
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
10443
|
+
*
|
10444
|
+
* EXCHANGE SPECIFIC PARAMETERS
|
10445
|
+
:param dict [params.vipLevel]: user's current specific margin data will be returned if viplevel is omitted
|
10446
|
+
:returns dict: an `isolated borrow rate structure <https://docs.ccxt.com/#/?id=isolated-borrow-rate-structure>`
|
10447
|
+
"""
|
10448
|
+
request = {
|
10449
|
+
'symbol': symbol,
|
10450
|
+
}
|
10451
|
+
borrowRates = await self.fetch_isolated_borrow_rates(self.extend(request, params))
|
10452
|
+
return self.safe_dict(borrowRates, symbol)
|
10453
|
+
|
10454
|
+
async def fetch_isolated_borrow_rates(self, params={}) -> IsolatedBorrowRates:
|
10455
|
+
"""
|
10456
|
+
fetch the borrow interest rates of all currencies
|
10457
|
+
:see: https://binance-docs.github.io/apidocs/spot/en/#query-isolated-margin-fee-data-user_data
|
10458
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
10459
|
+
:param dict [params.symbol]: unified market symbol
|
10460
|
+
*
|
10461
|
+
* EXCHANGE SPECIFIC PARAMETERS
|
10462
|
+
:param dict [params.vipLevel]: user's current specific margin data will be returned if viplevel is omitted
|
10463
|
+
:returns dict: a `borrow rate structure <https://docs.ccxt.com/#/?id=borrow-rate-structure>`
|
10464
|
+
"""
|
10465
|
+
await self.load_markets()
|
10466
|
+
request = {}
|
10467
|
+
symbol = self.safe_string(params, 'symbol')
|
10468
|
+
params = self.omit(params, 'symbol')
|
10469
|
+
if symbol is not None:
|
10470
|
+
market = self.market(symbol)
|
10471
|
+
request['symbol'] = market['id']
|
10472
|
+
response = await self.sapiGetMarginIsolatedMarginData(self.extend(request, params))
|
10473
|
+
#
|
10474
|
+
# [
|
10475
|
+
# {
|
10476
|
+
# "vipLevel": 0,
|
10477
|
+
# "symbol": "BTCUSDT",
|
10478
|
+
# "leverage": "10",
|
10479
|
+
# "data": [
|
10480
|
+
# {
|
10481
|
+
# "coin": "BTC",
|
10482
|
+
# "dailyInterest": "0.00026125",
|
10483
|
+
# "borrowLimit": "270"
|
10484
|
+
# },
|
10485
|
+
# {
|
10486
|
+
# "coin": "USDT",
|
10487
|
+
# "dailyInterest": "0.000475",
|
10488
|
+
# "borrowLimit": "2100000"
|
10489
|
+
# }
|
10490
|
+
# ]
|
10491
|
+
# }
|
10492
|
+
# ]
|
10493
|
+
#
|
10494
|
+
return self.parse_isolated_borrow_rates(response)
|
10495
|
+
|
10437
10496
|
async def fetch_borrow_rate_history(self, code: str, since: Int = None, limit: Int = None, params={}):
|
10438
10497
|
"""
|
10439
10498
|
retrieves a history of a currencies borrow interest rate at specific time slots
|
@@ -10502,6 +10561,43 @@ class binance(Exchange, ImplicitAPI):
|
|
10502
10561
|
'info': info,
|
10503
10562
|
}
|
10504
10563
|
|
10564
|
+
def parse_isolated_borrow_rate(self, info, market: Market = None):
|
10565
|
+
#
|
10566
|
+
# {
|
10567
|
+
# "vipLevel": 0,
|
10568
|
+
# "symbol": "BTCUSDT",
|
10569
|
+
# "leverage": "10",
|
10570
|
+
# "data": [
|
10571
|
+
# {
|
10572
|
+
# "coin": "BTC",
|
10573
|
+
# "dailyInterest": "0.00026125",
|
10574
|
+
# "borrowLimit": "270"
|
10575
|
+
# },
|
10576
|
+
# {
|
10577
|
+
# "coin": "USDT",
|
10578
|
+
# "dailyInterest": "0.000475",
|
10579
|
+
# "borrowLimit": "2100000"
|
10580
|
+
# }
|
10581
|
+
# ]
|
10582
|
+
# }
|
10583
|
+
#
|
10584
|
+
marketId = self.safe_string(info, 'symbol')
|
10585
|
+
market = self.safe_market(marketId, market, None, 'spot')
|
10586
|
+
data = self.safe_list(info, 'data')
|
10587
|
+
baseInfo = self.safe_dict(data, 0)
|
10588
|
+
quoteInfo = self.safe_dict(data, 1)
|
10589
|
+
return {
|
10590
|
+
'info': info,
|
10591
|
+
'symbol': self.safe_string(market, 'symbol'),
|
10592
|
+
'base': self.safe_string(baseInfo, 'coin'),
|
10593
|
+
'baseRate': self.safe_number(baseInfo, 'dailyInterest'),
|
10594
|
+
'quote': self.safe_string(quoteInfo, 'coin'),
|
10595
|
+
'quoteRate': self.safe_number(quoteInfo, 'dailyInterest'),
|
10596
|
+
'period': 86400000,
|
10597
|
+
'timestamp': None,
|
10598
|
+
'datetime': None,
|
10599
|
+
}
|
10600
|
+
|
10505
10601
|
async def create_gift_code(self, code: str, amount, params={}):
|
10506
10602
|
"""
|
10507
10603
|
create gift code
|