ccxt 4.4.25__py2.py3-none-any.whl → 4.4.27__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/alpaca.py +3 -0
- ccxt/abstract/bingx.py +1 -0
- ccxt/abstract/hyperliquid.py +1 -1
- ccxt/abstract/okx.py +1 -0
- ccxt/abstract/phemex.py +1 -0
- ccxt/ace.py +1 -1
- ccxt/alpaca.py +426 -17
- ccxt/ascendex.py +1 -1
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/ace.py +1 -1
- ccxt/async_support/alpaca.py +426 -17
- ccxt/async_support/ascendex.py +1 -1
- ccxt/async_support/base/exchange.py +24 -6
- ccxt/async_support/bequant.py +1 -1
- ccxt/async_support/bigone.py +1 -1
- ccxt/async_support/binance.py +6 -7
- ccxt/async_support/binancecoinm.py +1 -1
- ccxt/async_support/binanceus.py +1 -1
- ccxt/async_support/binanceusdm.py +1 -1
- ccxt/async_support/bingx.py +29 -29
- ccxt/async_support/bit2c.py +1 -1
- ccxt/async_support/bitbank.py +1 -1
- ccxt/async_support/bitbns.py +1 -1
- ccxt/async_support/bitfinex.py +1 -1
- ccxt/async_support/bitfinex2.py +1 -1
- ccxt/async_support/bitflyer.py +1 -1
- ccxt/async_support/bitget.py +6 -6
- ccxt/async_support/bithumb.py +1 -1
- ccxt/async_support/bitmart.py +7 -7
- ccxt/async_support/bitmex.py +1 -1
- ccxt/async_support/bitopro.py +1 -1
- ccxt/async_support/bitrue.py +1 -1
- ccxt/async_support/bitso.py +1 -1
- ccxt/async_support/bitstamp.py +1 -1
- ccxt/async_support/bitteam.py +1 -1
- ccxt/async_support/bitvavo.py +1 -1
- ccxt/async_support/bl3p.py +1 -1
- ccxt/async_support/blockchaincom.py +1 -1
- ccxt/async_support/blofin.py +1 -1
- ccxt/async_support/btcalpha.py +1 -1
- ccxt/async_support/btcbox.py +1 -1
- ccxt/async_support/btcmarkets.py +1 -1
- ccxt/async_support/btcturk.py +1 -1
- ccxt/async_support/bybit.py +10 -16
- ccxt/async_support/cex.py +36 -0
- ccxt/async_support/coinbase.py +89 -11
- ccxt/async_support/coinex.py +6 -8
- ccxt/async_support/digifinex.py +5 -5
- ccxt/async_support/exmo.py +1 -0
- ccxt/async_support/gate.py +26 -22
- ccxt/async_support/htx.py +5 -6
- ccxt/async_support/hyperliquid.py +31 -5
- ccxt/async_support/kucoin.py +5 -5
- ccxt/async_support/lbank.py +97 -2
- ccxt/async_support/okx.py +6 -5
- ccxt/async_support/phemex.py +4 -2
- ccxt/async_support/wavesexchange.py +13 -2
- ccxt/async_support/whitebit.py +5 -5
- ccxt/async_support/woo.py +1 -1
- ccxt/async_support/xt.py +32 -24
- ccxt/base/exchange.py +29 -6
- ccxt/base/types.py +12 -0
- ccxt/bequant.py +1 -1
- ccxt/bigone.py +1 -1
- ccxt/binance.py +6 -7
- ccxt/binancecoinm.py +1 -1
- ccxt/binanceus.py +1 -1
- ccxt/binanceusdm.py +1 -1
- ccxt/bingx.py +29 -29
- ccxt/bit2c.py +1 -1
- ccxt/bitbank.py +1 -1
- ccxt/bitbns.py +1 -1
- ccxt/bitfinex.py +1 -1
- ccxt/bitfinex2.py +1 -1
- ccxt/bitflyer.py +1 -1
- ccxt/bitget.py +6 -6
- ccxt/bithumb.py +1 -1
- ccxt/bitmart.py +7 -7
- ccxt/bitmex.py +1 -1
- ccxt/bitopro.py +1 -1
- ccxt/bitrue.py +1 -1
- ccxt/bitso.py +1 -1
- ccxt/bitstamp.py +1 -1
- ccxt/bitteam.py +1 -1
- ccxt/bitvavo.py +1 -1
- ccxt/bl3p.py +1 -1
- ccxt/blockchaincom.py +1 -1
- ccxt/blofin.py +1 -1
- ccxt/btcalpha.py +1 -1
- ccxt/btcbox.py +1 -1
- ccxt/btcmarkets.py +1 -1
- ccxt/btcturk.py +1 -1
- ccxt/bybit.py +10 -16
- ccxt/cex.py +36 -0
- ccxt/coinbase.py +89 -11
- ccxt/coinex.py +6 -8
- ccxt/digifinex.py +5 -5
- ccxt/exmo.py +1 -0
- ccxt/gate.py +26 -22
- ccxt/htx.py +5 -6
- ccxt/hyperliquid.py +31 -5
- ccxt/kucoin.py +5 -5
- ccxt/lbank.py +97 -2
- ccxt/okx.py +6 -5
- ccxt/phemex.py +4 -2
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/binance.py +2 -2
- ccxt/pro/bybit.py +1 -1
- ccxt/pro/exmo.py +204 -4
- ccxt/pro/lbank.py +7 -4
- ccxt/pro/okx.py +1 -1
- ccxt/test/tests_helpers.py +3 -1
- ccxt/wavesexchange.py +13 -2
- ccxt/whitebit.py +5 -5
- ccxt/woo.py +1 -1
- ccxt/xt.py +32 -24
- ccxt-4.4.27.dist-info/METADATA +637 -0
- {ccxt-4.4.25.dist-info → ccxt-4.4.27.dist-info}/RECORD +122 -122
- ccxt-4.4.25.dist-info/METADATA +0 -636
- {ccxt-4.4.25.dist-info → ccxt-4.4.27.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.4.25.dist-info → ccxt-4.4.27.dist-info}/WHEEL +0 -0
- {ccxt-4.4.25.dist-info → ccxt-4.4.27.dist-info}/top_level.txt +0 -0
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
|
11
|
+
from ccxt.base.types import Balances, BorrowInterest, Conversion, CrossBorrowRate, Currencies, Currency, DepositAddress, Greeks, Int, IsolatedBorrowRate, IsolatedBorrowRates, LedgerEntry, Leverage, Leverages, LeverageTier, LeverageTiers, LongShortRatio, MarginMode, MarginModes, MarginModification, Market, MarketInterface, Num, Option, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, 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
|
@@ -212,7 +212,7 @@ class binance(Exchange, ImplicitAPI):
|
|
212
212
|
'1M': '1M',
|
213
213
|
},
|
214
214
|
'urls': {
|
215
|
-
'logo': 'https://
|
215
|
+
'logo': 'https://github.com/user-attachments/assets/e9419b93-ccb0-46aa-9bff-c883f096274b',
|
216
216
|
'test': {
|
217
217
|
'dapiPublic': 'https://testnet.binancefuture.com/dapi/v1',
|
218
218
|
'dapiPrivate': 'https://testnet.binancefuture.com/dapi/v1',
|
@@ -11305,7 +11305,7 @@ class binance(Exchange, ImplicitAPI):
|
|
11305
11305
|
#
|
11306
11306
|
return response
|
11307
11307
|
|
11308
|
-
async def fetch_borrow_interest(self, code: Str = None, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
11308
|
+
async def fetch_borrow_interest(self, code: Str = None, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[BorrowInterest]:
|
11309
11309
|
"""
|
11310
11310
|
fetch the interest owed by the user for borrowing currency for margin trading
|
11311
11311
|
:see: https://developers.binance.com/docs/margin_trading/borrow-and-repay/Get-Interest-History
|
@@ -11379,21 +11379,20 @@ class binance(Exchange, ImplicitAPI):
|
|
11379
11379
|
interest = self.parse_borrow_interests(rows, market)
|
11380
11380
|
return self.filter_by_currency_since_limit(interest, code, since, limit)
|
11381
11381
|
|
11382
|
-
def parse_borrow_interest(self, info: dict, market: Market = None):
|
11382
|
+
def parse_borrow_interest(self, info: dict, market: Market = None) -> BorrowInterest:
|
11383
11383
|
symbol = self.safe_string(info, 'isolatedSymbol')
|
11384
11384
|
timestamp = self.safe_integer(info, 'interestAccuredTime')
|
11385
11385
|
marginMode = 'cross' if (symbol is None) else 'isolated'
|
11386
11386
|
return {
|
11387
|
-
'
|
11387
|
+
'info': info,
|
11388
11388
|
'symbol': symbol,
|
11389
|
-
'marginMode': marginMode,
|
11390
11389
|
'currency': self.safe_currency_code(self.safe_string(info, 'asset')),
|
11391
11390
|
'interest': self.safe_number(info, 'interest'),
|
11392
11391
|
'interestRate': self.safe_number(info, 'interestRate'),
|
11393
11392
|
'amountBorrowed': self.safe_number(info, 'principal'),
|
11393
|
+
'marginMode': marginMode,
|
11394
11394
|
'timestamp': timestamp,
|
11395
11395
|
'datetime': self.iso8601(timestamp),
|
11396
|
-
'info': info,
|
11397
11396
|
}
|
11398
11397
|
|
11399
11398
|
async def repay_cross_margin(self, code: str, amount, params={}):
|
@@ -14,7 +14,7 @@ class binancecoinm(binance, ImplicitAPI):
|
|
14
14
|
'id': 'binancecoinm',
|
15
15
|
'name': 'Binance COIN-M',
|
16
16
|
'urls': {
|
17
|
-
'logo': 'https://
|
17
|
+
'logo': 'https://github.com/user-attachments/assets/387cfc4e-5f33-48cd-8f5c-cd4854dabf0c',
|
18
18
|
'doc': [
|
19
19
|
'https://binance-docs.github.io/apidocs/delivery/en/',
|
20
20
|
'https://binance-docs.github.io/apidocs/spot/en',
|
ccxt/async_support/binanceus.py
CHANGED
@@ -19,7 +19,7 @@ class binanceus(binance, ImplicitAPI):
|
|
19
19
|
'certified': False,
|
20
20
|
'pro': True,
|
21
21
|
'urls': {
|
22
|
-
'logo': 'https://
|
22
|
+
'logo': 'https://github.com/user-attachments/assets/a9667919-b632-4d52-a832-df89f8a35e8c',
|
23
23
|
'api': {
|
24
24
|
'web': 'https://www.binance.us',
|
25
25
|
'public': 'https://api.binance.us/api/v3',
|
@@ -15,7 +15,7 @@ class binanceusdm(binance, ImplicitAPI):
|
|
15
15
|
'id': 'binanceusdm',
|
16
16
|
'name': 'Binance USDⓈ-M',
|
17
17
|
'urls': {
|
18
|
-
'logo': 'https://
|
18
|
+
'logo': 'https://github.com/user-attachments/assets/871cbea7-eebb-4b28-b260-c1c91df0487a',
|
19
19
|
'doc': [
|
20
20
|
'https://binance-docs.github.io/apidocs/futures/en/',
|
21
21
|
'https://binance-docs.github.io/apidocs/spot/en',
|
ccxt/async_support/bingx.py
CHANGED
@@ -220,6 +220,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
220
220
|
'market/markPriceKlines': 1,
|
221
221
|
'trade/batchCancelReplace': 5,
|
222
222
|
'trade/fullOrder': 2,
|
223
|
+
'positionMargin/history': 2,
|
223
224
|
},
|
224
225
|
'post': {
|
225
226
|
'trade/cancelReplace': 2,
|
@@ -2677,33 +2678,37 @@ class bingx(Exchange, ImplicitAPI):
|
|
2677
2678
|
:see: https://bingx-api.github.io/docs/#/swapV2/trade-api.html#Bulk%20order
|
2678
2679
|
:param Array orders: list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
|
2679
2680
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2681
|
+
:param boolean [params.sync]: *spot only* if True, multiple orders are ordered serially and all orders do not require the same symbol/side/type
|
2680
2682
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
2681
2683
|
"""
|
2682
2684
|
await self.load_markets()
|
2683
2685
|
ordersRequests = []
|
2684
|
-
|
2686
|
+
marketIds = []
|
2685
2687
|
for i in range(0, len(orders)):
|
2686
2688
|
rawOrder = orders[i]
|
2687
2689
|
marketId = self.safe_string(rawOrder, 'symbol')
|
2688
|
-
if symbol is None:
|
2689
|
-
symbol = marketId
|
2690
|
-
else:
|
2691
|
-
if symbol != marketId:
|
2692
|
-
raise BadRequest(self.id + ' createOrders() requires all orders to have the same symbol')
|
2693
2690
|
type = self.safe_string(rawOrder, 'type')
|
2691
|
+
marketIds.append(marketId)
|
2694
2692
|
side = self.safe_string(rawOrder, 'side')
|
2695
2693
|
amount = self.safe_number(rawOrder, 'amount')
|
2696
2694
|
price = self.safe_number(rawOrder, 'price')
|
2697
2695
|
orderParams = self.safe_dict(rawOrder, 'params', {})
|
2698
2696
|
orderRequest = self.create_order_request(marketId, type, side, amount, price, orderParams)
|
2699
2697
|
ordersRequests.append(orderRequest)
|
2700
|
-
|
2698
|
+
symbols = self.market_symbols(marketIds, None, False, True, True)
|
2699
|
+
symbolsLength = len(symbols)
|
2700
|
+
market = self.market(symbols[0])
|
2701
2701
|
request: dict = {}
|
2702
2702
|
response = None
|
2703
2703
|
if market['swap']:
|
2704
|
+
if symbolsLength > 5:
|
2705
|
+
raise InvalidOrder(self.id + ' createOrders() can not create more than 5 orders at once for swap markets')
|
2704
2706
|
request['batchOrders'] = self.json(ordersRequests)
|
2705
2707
|
response = await self.swapV2PrivatePostTradeBatchOrders(request)
|
2706
2708
|
else:
|
2709
|
+
sync = self.safe_bool(params, 'sync', False)
|
2710
|
+
if sync:
|
2711
|
+
request['sync'] = True
|
2707
2712
|
request['data'] = self.json(ordersRequests)
|
2708
2713
|
response = await self.spotV1PrivatePostTradeBatchOrders(request)
|
2709
2714
|
#
|
@@ -2751,6 +2756,12 @@ class bingx(Exchange, ImplicitAPI):
|
|
2751
2756
|
# }
|
2752
2757
|
# }
|
2753
2758
|
#
|
2759
|
+
if isinstance(response, str):
|
2760
|
+
# broken api engine : order-ids are too long numbers(i.e. 1742930526912864656)
|
2761
|
+
# and json.loadscan not handle them in JS, so we have to use .parseJson
|
2762
|
+
# however, when order has an attached SL/TP, their value types need extra parsing
|
2763
|
+
response = self.fix_stringified_json_members(response)
|
2764
|
+
response = self.parse_json(response)
|
2754
2765
|
data = self.safe_dict(response, 'data', {})
|
2755
2766
|
result = self.safe_list(data, 'orders', [])
|
2756
2767
|
return self.parse_orders(result, market)
|
@@ -3140,7 +3151,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
3140
3151
|
'cost': Precise.string_abs(feeCost),
|
3141
3152
|
},
|
3142
3153
|
'trades': None,
|
3143
|
-
'reduceOnly': self.
|
3154
|
+
'reduceOnly': self.safe_bool_2(order, 'reduceOnly', 'ro'),
|
3144
3155
|
}, market)
|
3145
3156
|
|
3146
3157
|
def parse_order_status(self, status: Str):
|
@@ -4295,32 +4306,21 @@ class bingx(Exchange, ImplicitAPI):
|
|
4295
4306
|
|
4296
4307
|
def parse_deposit_address(self, depositAddress, currency: Currency = None) -> DepositAddress:
|
4297
4308
|
#
|
4298
|
-
#
|
4299
|
-
#
|
4300
|
-
#
|
4301
|
-
#
|
4302
|
-
#
|
4303
|
-
#
|
4304
|
-
#
|
4309
|
+
# {
|
4310
|
+
# "coinId":"4",
|
4311
|
+
# "coin":"USDT",
|
4312
|
+
# "network":"OMNI",
|
4313
|
+
# "address":"1HXyx8HVQRY7Nhqz63nwnRB7SpS9xQPzLN",
|
4314
|
+
# "addressWithPrefix":"1HXyx8HVQRY7Nhqz63nwnRB7SpS9xQPzLN"
|
4315
|
+
# }
|
4305
4316
|
#
|
4306
|
-
address = self.safe_string(depositAddress, 'address')
|
4307
4317
|
tag = self.safe_string(depositAddress, 'tag')
|
4308
4318
|
currencyId = self.safe_string(depositAddress, 'coin')
|
4309
4319
|
currency = self.safe_currency(currencyId, currency)
|
4310
4320
|
code = currency['code']
|
4311
|
-
|
4312
|
-
|
4313
|
-
|
4314
|
-
# that is only if the underlying contract address has the 0x prefix
|
4315
|
-
networkCode = self.safe_string(depositAddress, 'network')
|
4316
|
-
if networkCode is not None:
|
4317
|
-
if networkCode in currency['networks']:
|
4318
|
-
network = currency['networks'][networkCode]
|
4319
|
-
contractAddress = self.safe_string(network['info'], 'contractAddress')
|
4320
|
-
if contractAddress is not None:
|
4321
|
-
if contractAddress[0] == '0' and contractAddress[1] == 'x':
|
4322
|
-
if address[0] != '0' or address[1] != 'x':
|
4323
|
-
address = '0x' + address
|
4321
|
+
address = self.safe_string(depositAddress, 'addressWithPrefix')
|
4322
|
+
networkdId = self.safe_string(depositAddress, 'network')
|
4323
|
+
networkCode = self.network_id_to_code(networkdId, code)
|
4324
4324
|
self.check_address(address)
|
4325
4325
|
return {
|
4326
4326
|
'info': depositAddress,
|
ccxt/async_support/bit2c.py
CHANGED
@@ -85,7 +85,7 @@ class bit2c(Exchange, ImplicitAPI):
|
|
85
85
|
'ws': False,
|
86
86
|
},
|
87
87
|
'urls': {
|
88
|
-
'logo': 'https://
|
88
|
+
'logo': 'https://github.com/user-attachments/assets/db0bce50-6842-4c09-a1d5-0c87d22118aa',
|
89
89
|
'api': {
|
90
90
|
'rest': 'https://bit2c.co.il',
|
91
91
|
},
|
ccxt/async_support/bitbank.py
CHANGED
@@ -100,7 +100,7 @@ class bitbank(Exchange, ImplicitAPI):
|
|
100
100
|
},
|
101
101
|
'hostname': 'bitbank.cc',
|
102
102
|
'urls': {
|
103
|
-
'logo': 'https://
|
103
|
+
'logo': 'https://github.com/user-attachments/assets/9d616de0-8a88-4468-8e38-d269acab0348',
|
104
104
|
'api': {
|
105
105
|
'public': 'https://public.{hostname}',
|
106
106
|
'private': 'https://api.{hostname}',
|
ccxt/async_support/bitbns.py
CHANGED
@@ -74,7 +74,7 @@ class bitbns(Exchange, ImplicitAPI):
|
|
74
74
|
},
|
75
75
|
'hostname': 'bitbns.com',
|
76
76
|
'urls': {
|
77
|
-
'logo': 'https://
|
77
|
+
'logo': 'https://github.com/user-attachments/assets/a5b9a562-cdd8-4bea-9fa7-fd24c1dad3d9',
|
78
78
|
'api': {
|
79
79
|
'www': 'https://{hostname}',
|
80
80
|
'v1': 'https://api.{hostname}/api/trade/v1',
|
ccxt/async_support/bitfinex.py
CHANGED
@@ -105,7 +105,7 @@ class bitfinex(Exchange, ImplicitAPI):
|
|
105
105
|
'1M': '1M',
|
106
106
|
},
|
107
107
|
'urls': {
|
108
|
-
'logo': 'https://
|
108
|
+
'logo': 'https://github.com/user-attachments/assets/9147c6c5-7197-481e-827b-7483672bb0e9',
|
109
109
|
'api': {
|
110
110
|
'v2': 'https://api-pub.bitfinex.com', # https://github.com/ccxt/ccxt/issues/5109
|
111
111
|
'public': 'https://api.bitfinex.com',
|
ccxt/async_support/bitfinex2.py
CHANGED
@@ -148,7 +148,7 @@ class bitfinex2(Exchange, ImplicitAPI):
|
|
148
148
|
# cheapest endpoint is 240 requests per minute => ~ 4 requests per second =>( 1000ms / 4 ) = 250ms between requests on average
|
149
149
|
'rateLimit': 250,
|
150
150
|
'urls': {
|
151
|
-
'logo': 'https://
|
151
|
+
'logo': 'https://github.com/user-attachments/assets/4a8e947f-ab46-481a-a8ae-8b20e9b03178',
|
152
152
|
'api': {
|
153
153
|
'v1': 'https://api.bitfinex.com',
|
154
154
|
'public': 'https://api-pub.bitfinex.com',
|
ccxt/async_support/bitflyer.py
CHANGED
@@ -62,7 +62,7 @@ class bitflyer(Exchange, ImplicitAPI):
|
|
62
62
|
'withdraw': True,
|
63
63
|
},
|
64
64
|
'urls': {
|
65
|
-
'logo': 'https://
|
65
|
+
'logo': 'https://github.com/user-attachments/assets/d0217747-e54d-4533-8416-0d553dca74bb',
|
66
66
|
'api': {
|
67
67
|
'rest': 'https://api.{hostname}',
|
68
68
|
},
|
ccxt/async_support/bitget.py
CHANGED
@@ -8,7 +8,7 @@ from ccxt.abstract.bitget import ImplicitAPI
|
|
8
8
|
import asyncio
|
9
9
|
import hashlib
|
10
10
|
import json
|
11
|
-
from ccxt.base.types import
|
11
|
+
from ccxt.base.types import Balances, BorrowInterest, Conversion, CrossBorrowRate, Currencies, Currency, DepositAddress, FundingHistory, Int, IsolatedBorrowRate, LedgerEntry, Leverage, LeverageTier, Liquidation, LongShortRatio, MarginMode, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, FundingRate, 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
|
@@ -182,7 +182,7 @@ class bitget(Exchange, ImplicitAPI):
|
|
182
182
|
},
|
183
183
|
'hostname': 'bitget.com',
|
184
184
|
'urls': {
|
185
|
-
'logo': 'https://
|
185
|
+
'logo': 'https://github.com/user-attachments/assets/fbaa10cc-a277-441d-a5b7-997dd9a87658',
|
186
186
|
'api': {
|
187
187
|
'spot': 'https://api.{hostname}',
|
188
188
|
'mix': 'https://api.{hostname}',
|
@@ -7629,7 +7629,7 @@ class bitget(Exchange, ImplicitAPI):
|
|
7629
7629
|
'info': info,
|
7630
7630
|
}
|
7631
7631
|
|
7632
|
-
async def fetch_borrow_interest(self, code: Str = None, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
7632
|
+
async def fetch_borrow_interest(self, code: Str = None, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[BorrowInterest]:
|
7633
7633
|
"""
|
7634
7634
|
fetch the interest owed by the user for borrowing currency for margin trading
|
7635
7635
|
:see: https://www.bitget.com/api-doc/margin/cross/record/Get-Cross-Interest-Records
|
@@ -7726,7 +7726,7 @@ class bitget(Exchange, ImplicitAPI):
|
|
7726
7726
|
interest = self.parse_borrow_interests(rows, market)
|
7727
7727
|
return self.filter_by_currency_since_limit(interest, code, since, limit)
|
7728
7728
|
|
7729
|
-
def parse_borrow_interest(self, info: dict, market: Market = None):
|
7729
|
+
def parse_borrow_interest(self, info: dict, market: Market = None) -> BorrowInterest:
|
7730
7730
|
#
|
7731
7731
|
# isolated
|
7732
7732
|
#
|
@@ -7760,15 +7760,15 @@ class bitget(Exchange, ImplicitAPI):
|
|
7760
7760
|
marginMode = 'isolated' if (marketId is not None) else 'cross'
|
7761
7761
|
timestamp = self.safe_integer(info, 'cTime')
|
7762
7762
|
return {
|
7763
|
+
'info': info,
|
7763
7764
|
'symbol': self.safe_string(market, 'symbol'),
|
7764
|
-
'marginMode': marginMode,
|
7765
7765
|
'currency': self.safe_currency_code(self.safe_string(info, 'interestCoin')),
|
7766
7766
|
'interest': self.safe_number(info, 'interestAmount'),
|
7767
7767
|
'interestRate': self.safe_number(info, 'dailyInterestRate'),
|
7768
7768
|
'amountBorrowed': None,
|
7769
|
+
'marginMode': marginMode,
|
7769
7770
|
'timestamp': timestamp,
|
7770
7771
|
'datetime': self.iso8601(timestamp),
|
7771
|
-
'info': info,
|
7772
7772
|
}
|
7773
7773
|
|
7774
7774
|
async def close_position(self, symbol: str, side: OrderSide = None, params={}) -> Order:
|
ccxt/async_support/bithumb.py
CHANGED
@@ -88,7 +88,7 @@ class bithumb(Exchange, ImplicitAPI):
|
|
88
88
|
},
|
89
89
|
'hostname': 'bithumb.com',
|
90
90
|
'urls': {
|
91
|
-
'logo': 'https://
|
91
|
+
'logo': 'https://github.com/user-attachments/assets/c9e0eefb-4777-46b9-8f09-9d7f7c4af82d',
|
92
92
|
'api': {
|
93
93
|
'public': 'https://api.{hostname}/public',
|
94
94
|
'private': 'https://api.{hostname}',
|
ccxt/async_support/bitmart.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.async_support.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.bitmart import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Balances, Currencies, Currency, DepositAddress, Int, IsolatedBorrowRate, IsolatedBorrowRates, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, FundingRate, Trade, TradingFeeInterface, Transaction, TransferEntry
|
9
|
+
from ccxt.base.types import Balances, BorrowInterest, Currencies, Currency, DepositAddress, Int, IsolatedBorrowRate, IsolatedBorrowRates, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, FundingRate, Trade, TradingFeeInterface, Transaction, TransferEntry
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
12
|
from ccxt.base.errors import AuthenticationError
|
@@ -127,7 +127,7 @@ class bitmart(Exchange, ImplicitAPI):
|
|
127
127
|
},
|
128
128
|
'hostname': 'bitmart.com', # bitmart.info, bitmart.news for Hong Kong users
|
129
129
|
'urls': {
|
130
|
-
'logo': 'https://
|
130
|
+
'logo': 'https://github.com/user-attachments/assets/0623e9c4-f50e-48c9-82bd-65c3908c3a14',
|
131
131
|
'api': {
|
132
132
|
'spot': 'https://api-cloud.{hostname}',
|
133
133
|
'swap': 'https://api-cloud-v2.{hostname}', # bitmart.info for Hong Kong users
|
@@ -1806,7 +1806,7 @@ class bitmart(Exchange, ImplicitAPI):
|
|
1806
1806
|
if since is not None:
|
1807
1807
|
request['after'] = self.parse_to_int((since / 1000)) - 1
|
1808
1808
|
else:
|
1809
|
-
maxLimit =
|
1809
|
+
maxLimit = 500
|
1810
1810
|
if limit is None:
|
1811
1811
|
limit = maxLimit
|
1812
1812
|
limit = min(maxLimit, limit)
|
@@ -3983,7 +3983,7 @@ class bitmart(Exchange, ImplicitAPI):
|
|
3983
3983
|
records = self.safe_list(data, 'records', [])
|
3984
3984
|
return self.parse_transfers(records, currency, since, limit)
|
3985
3985
|
|
3986
|
-
async def fetch_borrow_interest(self, code: Str = None, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
3986
|
+
async def fetch_borrow_interest(self, code: Str = None, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[BorrowInterest]:
|
3987
3987
|
"""
|
3988
3988
|
fetch the interest owed by the user for borrowing currency for margin trading
|
3989
3989
|
:see: https://developer-pro.bitmart.com/en/spot/#get-borrow-record-isolated
|
@@ -4032,7 +4032,7 @@ class bitmart(Exchange, ImplicitAPI):
|
|
4032
4032
|
interest = self.parse_borrow_interests(rows, market)
|
4033
4033
|
return self.filter_by_currency_since_limit(interest, code, since, limit)
|
4034
4034
|
|
4035
|
-
def parse_borrow_interest(self, info: dict, market: Market = None):
|
4035
|
+
def parse_borrow_interest(self, info: dict, market: Market = None) -> BorrowInterest:
|
4036
4036
|
#
|
4037
4037
|
# {
|
4038
4038
|
# "borrow_id": "1657664327844Lk5eJJugXmdHHZoe",
|
@@ -4049,15 +4049,15 @@ class bitmart(Exchange, ImplicitAPI):
|
|
4049
4049
|
market = self.safe_market(marketId, market)
|
4050
4050
|
timestamp = self.safe_integer(info, 'create_time')
|
4051
4051
|
return {
|
4052
|
+
'info': info,
|
4052
4053
|
'symbol': self.safe_string(market, 'symbol'),
|
4053
|
-
'marginMode': 'isolated',
|
4054
4054
|
'currency': self.safe_currency_code(self.safe_string(info, 'currency')),
|
4055
4055
|
'interest': self.safe_number(info, 'interest_amount'),
|
4056
4056
|
'interestRate': self.safe_number(info, 'hourly_interest'),
|
4057
4057
|
'amountBorrowed': self.safe_number(info, 'borrow_amount'),
|
4058
|
+
'marginMode': 'isolated',
|
4058
4059
|
'timestamp': timestamp, # borrow creation time
|
4059
4060
|
'datetime': self.iso8601(timestamp),
|
4060
|
-
'info': info,
|
4061
4061
|
}
|
4062
4062
|
|
4063
4063
|
async def fetch_open_interest(self, symbol: str, params={}):
|
ccxt/async_support/bitmex.py
CHANGED
@@ -119,7 +119,7 @@ class bitmex(Exchange, ImplicitAPI):
|
|
119
119
|
'public': 'https://testnet.bitmex.com',
|
120
120
|
'private': 'https://testnet.bitmex.com',
|
121
121
|
},
|
122
|
-
'logo': 'https://github.com/
|
122
|
+
'logo': 'https://github.com/user-attachments/assets/c78425ab-78d5-49d6-bd14-db7734798f04',
|
123
123
|
'api': {
|
124
124
|
'public': 'https://www.bitmex.com',
|
125
125
|
'private': 'https://www.bitmex.com',
|
ccxt/async_support/bitopro.py
CHANGED
@@ -112,7 +112,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
112
112
|
'1M': '1M',
|
113
113
|
},
|
114
114
|
'urls': {
|
115
|
-
'logo': 'https://
|
115
|
+
'logo': 'https://github.com/user-attachments/assets/affc6337-b95a-44bf-aacd-04f9722364f6',
|
116
116
|
'api': {
|
117
117
|
'rest': 'https://api.bitopro.com/v3',
|
118
118
|
},
|
ccxt/async_support/bitrue.py
CHANGED
@@ -116,7 +116,7 @@ class bitrue(Exchange, ImplicitAPI):
|
|
116
116
|
'1w': '1W',
|
117
117
|
},
|
118
118
|
'urls': {
|
119
|
-
'logo': 'https://
|
119
|
+
'logo': 'https://github.com/user-attachments/assets/67abe346-1273-461a-bd7c-42fa32907c8e',
|
120
120
|
'api': {
|
121
121
|
'spot': 'https://www.bitrue.com/api',
|
122
122
|
'fapi': 'https://fapi.bitrue.com/fapi',
|
ccxt/async_support/bitso.py
CHANGED
@@ -104,7 +104,7 @@ class bitso(Exchange, ImplicitAPI):
|
|
104
104
|
'withdraw': True,
|
105
105
|
},
|
106
106
|
'urls': {
|
107
|
-
'logo': 'https://
|
107
|
+
'logo': 'https://github.com/user-attachments/assets/178c8e56-9054-4107-b192-5e5053d4f975',
|
108
108
|
'api': {
|
109
109
|
'rest': 'https://bitso.com/api',
|
110
110
|
},
|
ccxt/async_support/bitstamp.py
CHANGED
@@ -107,7 +107,7 @@ class bitstamp(Exchange, ImplicitAPI):
|
|
107
107
|
'withdraw': True,
|
108
108
|
},
|
109
109
|
'urls': {
|
110
|
-
'logo': 'https://
|
110
|
+
'logo': 'https://github.com/user-attachments/assets/d5480572-1fee-43cb-b900-d38c522d0024',
|
111
111
|
'api': {
|
112
112
|
'public': 'https://www.bitstamp.net/api',
|
113
113
|
'private': 'https://www.bitstamp.net/api',
|
ccxt/async_support/bitteam.py
CHANGED
@@ -137,7 +137,7 @@ class bitteam(Exchange, ImplicitAPI):
|
|
137
137
|
'1d': '1D',
|
138
138
|
},
|
139
139
|
'urls': {
|
140
|
-
'logo': 'https://github.com/
|
140
|
+
'logo': 'https://github.com/user-attachments/assets/b41b5e0d-98e5-4bd3-8a6e-aeb230a4a135',
|
141
141
|
'api': {
|
142
142
|
'history': 'https://history.bit.team',
|
143
143
|
'public': 'https://bit.team',
|
ccxt/async_support/bitvavo.py
CHANGED
@@ -127,7 +127,7 @@ class bitvavo(Exchange, ImplicitAPI):
|
|
127
127
|
'1d': '1d',
|
128
128
|
},
|
129
129
|
'urls': {
|
130
|
-
'logo': 'https://
|
130
|
+
'logo': 'https://github.com/user-attachments/assets/d213155c-8c71-4701-9bd5-45351febc2a8',
|
131
131
|
'api': {
|
132
132
|
'public': 'https://api.bitvavo.com',
|
133
133
|
'private': 'https://api.bitvavo.com',
|
ccxt/async_support/bl3p.py
CHANGED
@@ -82,7 +82,7 @@ class bl3p(Exchange, ImplicitAPI):
|
|
82
82
|
'ws': False,
|
83
83
|
},
|
84
84
|
'urls': {
|
85
|
-
'logo': 'https://
|
85
|
+
'logo': 'https://github.com/user-attachments/assets/75aeb14e-cd48-43c8-8492-dff002dea0be',
|
86
86
|
'api': {
|
87
87
|
'rest': 'https://api.bl3p.eu',
|
88
88
|
},
|
@@ -82,7 +82,7 @@ class blockchaincom(Exchange, ImplicitAPI):
|
|
82
82
|
},
|
83
83
|
'timeframes': None,
|
84
84
|
'urls': {
|
85
|
-
'logo': 'https://
|
85
|
+
'logo': 'https://github.com/user-attachments/assets/975e3054-3399-4363-bcee-ec3c6d63d4e8',
|
86
86
|
'test': {
|
87
87
|
'public': 'https://testnet-api.delta.exchange',
|
88
88
|
'private': 'https://testnet-api.delta.exchange',
|
ccxt/async_support/blofin.py
CHANGED
@@ -162,7 +162,7 @@ class blofin(Exchange, ImplicitAPI):
|
|
162
162
|
},
|
163
163
|
'hostname': 'www.blofin.com',
|
164
164
|
'urls': {
|
165
|
-
'logo': 'https://github.com/
|
165
|
+
'logo': 'https://github.com/user-attachments/assets/518cdf80-f05d-4821-a3e3-d48ceb41d73b',
|
166
166
|
'api': {
|
167
167
|
'rest': 'https://openapi.blofin.com',
|
168
168
|
},
|
ccxt/async_support/btcalpha.py
CHANGED
@@ -103,7 +103,7 @@ class btcalpha(Exchange, ImplicitAPI):
|
|
103
103
|
'1d': 'D',
|
104
104
|
},
|
105
105
|
'urls': {
|
106
|
-
'logo': 'https://
|
106
|
+
'logo': 'https://github.com/user-attachments/assets/dce49f3a-61e5-4ba0-a2fe-41d192fd0e5d',
|
107
107
|
'api': {
|
108
108
|
'rest': 'https://btc-alpha.com/api',
|
109
109
|
},
|
ccxt/async_support/btcbox.py
CHANGED
@@ -88,7 +88,7 @@ class btcbox(Exchange, ImplicitAPI):
|
|
88
88
|
'ws': False,
|
89
89
|
},
|
90
90
|
'urls': {
|
91
|
-
'logo': 'https://
|
91
|
+
'logo': 'https://github.com/user-attachments/assets/1e2cb499-8d0f-4f8f-9464-3c015cfbc76b',
|
92
92
|
'api': {
|
93
93
|
'rest': 'https://www.btcbox.co.jp/api',
|
94
94
|
},
|
ccxt/async_support/btcmarkets.py
CHANGED
@@ -91,7 +91,7 @@ class btcmarkets(Exchange, ImplicitAPI):
|
|
91
91
|
'withdraw': True,
|
92
92
|
},
|
93
93
|
'urls': {
|
94
|
-
'logo': 'https://
|
94
|
+
'logo': 'https://github.com/user-attachments/assets/8c8d6907-3873-4cc4-ad20-e22fba28247e',
|
95
95
|
'api': {
|
96
96
|
'public': 'https://api.btcmarkets.net',
|
97
97
|
'private': 'https://api.btcmarkets.net',
|
ccxt/async_support/btcturk.py
CHANGED
@@ -93,7 +93,7 @@ class btcturk(Exchange, ImplicitAPI):
|
|
93
93
|
'1y': '1 y',
|
94
94
|
},
|
95
95
|
'urls': {
|
96
|
-
'logo': 'https://
|
96
|
+
'logo': 'https://github.com/user-attachments/assets/10e0a238-9f60-4b06-9dda-edfc7602f1d6',
|
97
97
|
'api': {
|
98
98
|
'public': 'https://api.btcturk.com/api/v2',
|
99
99
|
'private': 'https://api.btcturk.com/api/v1',
|