ccxt 4.4.78__py2.py3-none-any.whl → 4.4.80__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/bitmart.py +1 -0
- ccxt/apex.py +2 -2
- ccxt/ascendex.py +22 -5
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/apex.py +2 -2
- ccxt/async_support/ascendex.py +22 -5
- ccxt/async_support/base/exchange.py +5 -1
- ccxt/async_support/binance.py +6 -0
- ccxt/async_support/bingx.py +3 -3
- ccxt/async_support/bitfinex.py +59 -34
- ccxt/async_support/bitget.py +52 -64
- ccxt/async_support/bitmart.py +7 -2
- ccxt/async_support/bitmex.py +8 -1
- ccxt/async_support/bitopro.py +5 -1
- ccxt/async_support/bitrue.py +2 -1
- ccxt/async_support/bitso.py +1 -1
- ccxt/async_support/bitteam.py +2 -0
- ccxt/async_support/bitvavo.py +25 -10
- ccxt/async_support/btcalpha.py +1 -1
- ccxt/async_support/btcmarkets.py +1 -1
- ccxt/async_support/btcturk.py +1 -1
- ccxt/async_support/bybit.py +27 -15
- ccxt/async_support/coinbase.py +3 -15
- ccxt/async_support/coinex.py +1 -0
- ccxt/async_support/coinlist.py +1 -0
- ccxt/async_support/coinone.py +1 -0
- ccxt/async_support/delta.py +3 -0
- ccxt/async_support/deribit.py +1 -0
- ccxt/async_support/hollaex.py +1 -0
- ccxt/async_support/htx.py +7 -3
- ccxt/async_support/huobijp.py +1 -0
- ccxt/async_support/hyperliquid.py +1 -0
- ccxt/async_support/kraken.py +2 -0
- ccxt/async_support/okx.py +1 -1
- ccxt/async_support/poloniex.py +1 -0
- ccxt/async_support/timex.py +2 -2
- ccxt/async_support/upbit.py +43 -21
- ccxt/async_support/whitebit.py +65 -12
- ccxt/base/errors.py +0 -6
- ccxt/base/exchange.py +1 -1
- ccxt/binance.py +6 -0
- ccxt/bingx.py +3 -3
- ccxt/bitfinex.py +59 -34
- ccxt/bitget.py +52 -64
- ccxt/bitmart.py +7 -2
- ccxt/bitmex.py +8 -1
- ccxt/bitopro.py +5 -1
- ccxt/bitrue.py +2 -1
- ccxt/bitso.py +1 -1
- ccxt/bitteam.py +2 -0
- ccxt/bitvavo.py +25 -10
- ccxt/btcalpha.py +1 -1
- ccxt/btcmarkets.py +1 -1
- ccxt/btcturk.py +1 -1
- ccxt/bybit.py +27 -15
- ccxt/coinbase.py +3 -15
- ccxt/coinex.py +1 -0
- ccxt/coinlist.py +1 -0
- ccxt/coinone.py +1 -0
- ccxt/delta.py +3 -0
- ccxt/deribit.py +1 -0
- ccxt/hollaex.py +1 -0
- ccxt/htx.py +7 -3
- ccxt/huobijp.py +1 -0
- ccxt/hyperliquid.py +1 -0
- ccxt/kraken.py +2 -0
- ccxt/okx.py +1 -1
- ccxt/poloniex.py +1 -0
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/binance.py +3 -3
- ccxt/pro/coinbase.py +40 -52
- ccxt/pro/upbit.py +42 -0
- ccxt/test/tests_async.py +0 -1
- ccxt/test/tests_sync.py +0 -1
- ccxt/timex.py +2 -2
- ccxt/upbit.py +43 -21
- ccxt/whitebit.py +65 -12
- {ccxt-4.4.78.dist-info → ccxt-4.4.80.dist-info}/METADATA +9 -11
- {ccxt-4.4.78.dist-info → ccxt-4.4.80.dist-info}/RECORD +83 -83
- {ccxt-4.4.78.dist-info → ccxt-4.4.80.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.4.78.dist-info → ccxt-4.4.80.dist-info}/WHEEL +0 -0
- {ccxt-4.4.78.dist-info → ccxt-4.4.80.dist-info}/top_level.txt +0 -0
ccxt/__init__.py
CHANGED
ccxt/abstract/bitmart.py
CHANGED
@@ -61,6 +61,7 @@ class ImplicitAPI:
|
|
61
61
|
private_get_contract_private_order = privateGetContractPrivateOrder = Entry('contract/private/order', 'private', 'GET', {'cost': 1.2})
|
62
62
|
private_get_contract_private_order_history = privateGetContractPrivateOrderHistory = Entry('contract/private/order-history', 'private', 'GET', {'cost': 10})
|
63
63
|
private_get_contract_private_position = privateGetContractPrivatePosition = Entry('contract/private/position', 'private', 'GET', {'cost': 10})
|
64
|
+
private_get_contract_private_position_v2 = privateGetContractPrivatePositionV2 = Entry('contract/private/position-v2', 'private', 'GET', {'cost': 10})
|
64
65
|
private_get_contract_private_get_open_orders = privateGetContractPrivateGetOpenOrders = Entry('contract/private/get-open-orders', 'private', 'GET', {'cost': 1.2})
|
65
66
|
private_get_contract_private_current_plan_order = privateGetContractPrivateCurrentPlanOrder = Entry('contract/private/current-plan-order', 'private', 'GET', {'cost': 1.2})
|
66
67
|
private_get_contract_private_trades = privateGetContractPrivateTrades = Entry('contract/private/trades', 'private', 'GET', {'cost': 10})
|
ccxt/apex.py
CHANGED
@@ -827,7 +827,7 @@ class apex(Exchange, ImplicitAPI):
|
|
827
827
|
|
828
828
|
def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
|
829
829
|
#
|
830
|
-
#
|
830
|
+
# {
|
831
831
|
# "start": 1647511440000,
|
832
832
|
# "symbol": "BTC-USD",
|
833
833
|
# "interval": "1",
|
@@ -837,7 +837,7 @@ class apex(Exchange, ImplicitAPI):
|
|
837
837
|
# "close": "40000",
|
838
838
|
# "volume": "1.002",
|
839
839
|
# "turnover": "3"
|
840
|
-
#
|
840
|
+
# } {"s":"BTCUSDT","i":"1","t":1741265880000,"c":"90235","h":"90235","l":"90156","o":"90156","v":"0.052","tr":"4690.4466"}
|
841
841
|
#
|
842
842
|
return [
|
843
843
|
self.safe_integer_n(ohlcv, ['start', 't']),
|
ccxt/ascendex.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.ascendex import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Account, Any, Balances, Currencies, Currency, DepositAddress, Int, Leverage, Leverages, LeverageTier, LeverageTiers, MarginMode, MarginModes, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade, TradingFees, Transaction, TransferEntry
|
9
|
+
from ccxt.base.types import Account, Any, Balances, Bool, Currencies, Currency, DepositAddress, Int, Leverage, Leverages, LeverageTier, LeverageTiers, MarginMode, MarginModes, MarginModification, Market, Num, Order, OrderBook, OrderRequest, 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
|
@@ -521,6 +521,7 @@ class ascendex(Exchange, ImplicitAPI):
|
|
521
521
|
# "data":[
|
522
522
|
# {
|
523
523
|
# "assetCode":"BTT",
|
524
|
+
# "displayName": "BTT",
|
524
525
|
# "borrowAssetCode":"BTT-B",
|
525
526
|
# "interestAssetCode":"BTT-I",
|
526
527
|
# "nativeScale":0,
|
@@ -541,12 +542,13 @@ class ascendex(Exchange, ImplicitAPI):
|
|
541
542
|
# "data":[
|
542
543
|
# {
|
543
544
|
# "assetCode":"LTCBULL",
|
545
|
+
# "displayName": "LTCBULL",
|
544
546
|
# "nativeScale":4,
|
545
547
|
# "numConfirmations":20,
|
546
548
|
# "withdrawFee":"0.2",
|
547
549
|
# "minWithdrawalAmt":"1.0",
|
548
550
|
# "statusCode":"Normal",
|
549
|
-
# "statusMessage":""
|
551
|
+
# "statusMessage":"" # hideFromWalletTx
|
550
552
|
# }
|
551
553
|
# ]
|
552
554
|
# }
|
@@ -568,8 +570,23 @@ class ascendex(Exchange, ImplicitAPI):
|
|
568
570
|
scale = self.safe_string_2(currency, 'precisionScale', 'nativeScale')
|
569
571
|
precision = self.parse_number(self.parse_precision(scale))
|
570
572
|
fee = self.safe_number_2(currency, 'withdrawFee', 'withdrawalFee')
|
571
|
-
status = self.
|
573
|
+
status = self.safe_string(currency, 'status')
|
574
|
+
statusCode = self.safe_string(currency, 'statusCode')
|
572
575
|
active = (status == 'Normal')
|
576
|
+
depositEnabled: Bool = None
|
577
|
+
withdrawEnabled: Bool = None
|
578
|
+
if status == 'Delisted' or statusCode == 'hideFromWalletTx':
|
579
|
+
depositEnabled = False
|
580
|
+
withdrawEnabled = False
|
581
|
+
elif status == 'Normal':
|
582
|
+
depositEnabled = True
|
583
|
+
withdrawEnabled = True
|
584
|
+
elif status == 'NoTransaction' or statusCode == 'NoTransaction':
|
585
|
+
depositEnabled = True
|
586
|
+
withdrawEnabled = False
|
587
|
+
elif status == 'NoDeposit':
|
588
|
+
depositEnabled = False
|
589
|
+
withdrawEnabled = True
|
573
590
|
marginInside = ('borrowAssetCode' in currency)
|
574
591
|
result[code] = {
|
575
592
|
'id': id,
|
@@ -579,8 +596,8 @@ class ascendex(Exchange, ImplicitAPI):
|
|
579
596
|
'margin': marginInside,
|
580
597
|
'name': self.safe_string(currency, 'assetName'),
|
581
598
|
'active': active,
|
582
|
-
'deposit':
|
583
|
-
'withdraw':
|
599
|
+
'deposit': depositEnabled,
|
600
|
+
'withdraw': withdrawEnabled,
|
584
601
|
'fee': fee,
|
585
602
|
'precision': precision,
|
586
603
|
'limits': {
|
ccxt/async_support/__init__.py
CHANGED
ccxt/async_support/apex.py
CHANGED
@@ -827,7 +827,7 @@ class apex(Exchange, ImplicitAPI):
|
|
827
827
|
|
828
828
|
def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
|
829
829
|
#
|
830
|
-
#
|
830
|
+
# {
|
831
831
|
# "start": 1647511440000,
|
832
832
|
# "symbol": "BTC-USD",
|
833
833
|
# "interval": "1",
|
@@ -837,7 +837,7 @@ class apex(Exchange, ImplicitAPI):
|
|
837
837
|
# "close": "40000",
|
838
838
|
# "volume": "1.002",
|
839
839
|
# "turnover": "3"
|
840
|
-
#
|
840
|
+
# } {"s":"BTCUSDT","i":"1","t":1741265880000,"c":"90235","h":"90235","l":"90156","o":"90156","v":"0.052","tr":"4690.4466"}
|
841
841
|
#
|
842
842
|
return [
|
843
843
|
self.safe_integer_n(ohlcv, ['start', 't']),
|
ccxt/async_support/ascendex.py
CHANGED
@@ -7,7 +7,7 @@ from ccxt.async_support.base.exchange import Exchange
|
|
7
7
|
from ccxt.abstract.ascendex import ImplicitAPI
|
8
8
|
import asyncio
|
9
9
|
import hashlib
|
10
|
-
from ccxt.base.types import Account, Any, Balances, Currencies, Currency, DepositAddress, Int, Leverage, Leverages, LeverageTier, LeverageTiers, MarginMode, MarginModes, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade, TradingFees, Transaction, TransferEntry
|
10
|
+
from ccxt.base.types import Account, Any, Balances, Bool, Currencies, Currency, DepositAddress, Int, Leverage, Leverages, LeverageTier, LeverageTiers, MarginMode, MarginModes, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade, 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
|
@@ -522,6 +522,7 @@ class ascendex(Exchange, ImplicitAPI):
|
|
522
522
|
# "data":[
|
523
523
|
# {
|
524
524
|
# "assetCode":"BTT",
|
525
|
+
# "displayName": "BTT",
|
525
526
|
# "borrowAssetCode":"BTT-B",
|
526
527
|
# "interestAssetCode":"BTT-I",
|
527
528
|
# "nativeScale":0,
|
@@ -542,12 +543,13 @@ class ascendex(Exchange, ImplicitAPI):
|
|
542
543
|
# "data":[
|
543
544
|
# {
|
544
545
|
# "assetCode":"LTCBULL",
|
546
|
+
# "displayName": "LTCBULL",
|
545
547
|
# "nativeScale":4,
|
546
548
|
# "numConfirmations":20,
|
547
549
|
# "withdrawFee":"0.2",
|
548
550
|
# "minWithdrawalAmt":"1.0",
|
549
551
|
# "statusCode":"Normal",
|
550
|
-
# "statusMessage":""
|
552
|
+
# "statusMessage":"" # hideFromWalletTx
|
551
553
|
# }
|
552
554
|
# ]
|
553
555
|
# }
|
@@ -569,8 +571,23 @@ class ascendex(Exchange, ImplicitAPI):
|
|
569
571
|
scale = self.safe_string_2(currency, 'precisionScale', 'nativeScale')
|
570
572
|
precision = self.parse_number(self.parse_precision(scale))
|
571
573
|
fee = self.safe_number_2(currency, 'withdrawFee', 'withdrawalFee')
|
572
|
-
status = self.
|
574
|
+
status = self.safe_string(currency, 'status')
|
575
|
+
statusCode = self.safe_string(currency, 'statusCode')
|
573
576
|
active = (status == 'Normal')
|
577
|
+
depositEnabled: Bool = None
|
578
|
+
withdrawEnabled: Bool = None
|
579
|
+
if status == 'Delisted' or statusCode == 'hideFromWalletTx':
|
580
|
+
depositEnabled = False
|
581
|
+
withdrawEnabled = False
|
582
|
+
elif status == 'Normal':
|
583
|
+
depositEnabled = True
|
584
|
+
withdrawEnabled = True
|
585
|
+
elif status == 'NoTransaction' or statusCode == 'NoTransaction':
|
586
|
+
depositEnabled = True
|
587
|
+
withdrawEnabled = False
|
588
|
+
elif status == 'NoDeposit':
|
589
|
+
depositEnabled = False
|
590
|
+
withdrawEnabled = True
|
574
591
|
marginInside = ('borrowAssetCode' in currency)
|
575
592
|
result[code] = {
|
576
593
|
'id': id,
|
@@ -580,8 +597,8 @@ class ascendex(Exchange, ImplicitAPI):
|
|
580
597
|
'margin': marginInside,
|
581
598
|
'name': self.safe_string(currency, 'assetName'),
|
582
599
|
'active': active,
|
583
|
-
'deposit':
|
584
|
-
'withdraw':
|
600
|
+
'deposit': depositEnabled,
|
601
|
+
'withdraw': withdrawEnabled,
|
585
602
|
'fee': fee,
|
586
603
|
'precision': precision,
|
587
604
|
'limits': {
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# -----------------------------------------------------------------------------
|
4
4
|
|
5
|
-
__version__ = '4.4.
|
5
|
+
__version__ = '4.4.80'
|
6
6
|
|
7
7
|
# -----------------------------------------------------------------------------
|
8
8
|
|
@@ -114,6 +114,10 @@ class Exchange(BaseExchange):
|
|
114
114
|
if self.ssl_context is None:
|
115
115
|
# Create our SSL context object with our CA cert file
|
116
116
|
self.ssl_context = ssl.create_default_context(cafile=self.cafile) if self.verify else self.verify
|
117
|
+
if (self.ssl_context and self.safe_bool(self.options, 'include_OS_certificates', False)):
|
118
|
+
os_default_paths = ssl.get_default_verify_paths()
|
119
|
+
if os_default_paths.cafile and os_default_paths.cafile != self.cafile:
|
120
|
+
self.ssl_context.load_verify_locations(cafile=os_default_paths.cafile)
|
117
121
|
|
118
122
|
if self.own_session and self.session is None:
|
119
123
|
# Pass this SSL context to aiohttp and create a TCPConnector
|
ccxt/async_support/binance.py
CHANGED
@@ -1294,6 +1294,7 @@ class binance(Exchange, ImplicitAPI):
|
|
1294
1294
|
'inverse', # allows CORS in browsers
|
1295
1295
|
# 'option', # does not allow CORS, enable outside of the browser only
|
1296
1296
|
],
|
1297
|
+
'loadAllOptions': False,
|
1297
1298
|
'fetchCurrencies': True, # self is a private call and it requires API keys
|
1298
1299
|
# 'fetchTradesMethod': 'publicGetAggTrades', # publicGetTrades, publicGetHistoricalTrades, eapiPublicGetTrades
|
1299
1300
|
# 'repayCrossMarginMethod': 'papiPostRepayLoan', # papiPostMarginRepayDebt
|
@@ -3021,6 +3022,11 @@ class binance(Exchange, ImplicitAPI):
|
|
3021
3022
|
"""
|
3022
3023
|
promisesRaw = []
|
3023
3024
|
rawFetchMarkets = self.safe_list(self.options, 'fetchMarkets', ['spot', 'linear', 'inverse'])
|
3025
|
+
# handle loadAllOptions option
|
3026
|
+
loadAllOptions = self.safe_bool(self.options, 'loadAllOptions', False)
|
3027
|
+
if loadAllOptions:
|
3028
|
+
if not self.in_array('option', rawFetchMarkets):
|
3029
|
+
rawFetchMarkets.append('option')
|
3024
3030
|
sandboxMode = self.safe_bool(self.options, 'sandboxMode', False)
|
3025
3031
|
fetchMarkets = []
|
3026
3032
|
for i in range(0, len(rawFetchMarkets)):
|
ccxt/async_support/bingx.py
CHANGED
@@ -723,7 +723,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
723
723
|
#
|
724
724
|
# {
|
725
725
|
# "code": 0,
|
726
|
-
# "timestamp":
|
726
|
+
# "timestamp": 1702623271476,
|
727
727
|
# "data": [
|
728
728
|
# {
|
729
729
|
# "coin": "BTC",
|
@@ -805,7 +805,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
805
805
|
'limits': limits,
|
806
806
|
}
|
807
807
|
active = depositEnabled or withdrawEnabled
|
808
|
-
result[code] = {
|
808
|
+
result[code] = self.safe_currency_structure({
|
809
809
|
'info': entry,
|
810
810
|
'code': code,
|
811
811
|
'id': currencyId,
|
@@ -817,7 +817,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
817
817
|
'networks': networks,
|
818
818
|
'fee': fee,
|
819
819
|
'limits': defaultLimits,
|
820
|
-
}
|
820
|
+
})
|
821
821
|
return result
|
822
822
|
|
823
823
|
async def fetch_spot_markets(self, params) -> List[Market]:
|
ccxt/async_support/bitfinex.py
CHANGED
@@ -1151,9 +1151,8 @@ class bitfinex(Exchange, ImplicitAPI):
|
|
1151
1151
|
#
|
1152
1152
|
# on trading pairs(ex. tBTCUSD)
|
1153
1153
|
#
|
1154
|
-
#
|
1155
|
-
#
|
1156
|
-
# SYMBOL,
|
1154
|
+
# [
|
1155
|
+
# SYMBOL, # self index is not present in singular-ticker
|
1157
1156
|
# BID,
|
1158
1157
|
# BID_SIZE,
|
1159
1158
|
# ASK,
|
@@ -1164,15 +1163,13 @@ class bitfinex(Exchange, ImplicitAPI):
|
|
1164
1163
|
# VOLUME,
|
1165
1164
|
# HIGH,
|
1166
1165
|
# LOW
|
1167
|
-
#
|
1168
|
-
# }
|
1166
|
+
# ]
|
1169
1167
|
#
|
1170
1168
|
#
|
1171
1169
|
# on funding currencies(ex. fUSD)
|
1172
1170
|
#
|
1173
|
-
#
|
1174
|
-
#
|
1175
|
-
# SYMBOL,
|
1171
|
+
# [
|
1172
|
+
# SYMBOL, # self index is not present in singular-ticker
|
1176
1173
|
# FRR,
|
1177
1174
|
# BID,
|
1178
1175
|
# BID_PERIOD,
|
@@ -1189,35 +1186,71 @@ class bitfinex(Exchange, ImplicitAPI):
|
|
1189
1186
|
# _PLACEHOLDER,
|
1190
1187
|
# _PLACEHOLDER,
|
1191
1188
|
# FRR_AMOUNT_AVAILABLE
|
1192
|
-
#
|
1193
|
-
# }
|
1189
|
+
# ]
|
1194
1190
|
#
|
1195
|
-
|
1191
|
+
length = len(ticker)
|
1192
|
+
isFetchTicker = (length == 10) or (length == 16)
|
1193
|
+
symbol: Str = None
|
1194
|
+
minusIndex = 0
|
1195
|
+
isFundingCurrency = False
|
1196
|
+
if isFetchTicker:
|
1197
|
+
minusIndex = 1
|
1198
|
+
isFundingCurrency = (length == 16)
|
1199
|
+
else:
|
1200
|
+
marketId = self.safe_string(ticker, 0)
|
1201
|
+
market = self.safe_market(marketId, market)
|
1202
|
+
isFundingCurrency = (length == 17)
|
1196
1203
|
symbol = self.safe_symbol(None, market)
|
1197
|
-
|
1198
|
-
|
1199
|
-
|
1204
|
+
last: Str = None
|
1205
|
+
bid: Str = None
|
1206
|
+
ask: Str = None
|
1207
|
+
change: Str = None
|
1208
|
+
percentage: Str = None
|
1209
|
+
volume: Str = None
|
1210
|
+
high: Str = None
|
1211
|
+
low: Str = None
|
1212
|
+
if isFundingCurrency:
|
1213
|
+
# per api docs, they are different array type
|
1214
|
+
last = self.safe_string(ticker, 10 - minusIndex)
|
1215
|
+
bid = self.safe_string(ticker, 2 - minusIndex)
|
1216
|
+
ask = self.safe_string(ticker, 5 - minusIndex)
|
1217
|
+
change = self.safe_string(ticker, 8 - minusIndex)
|
1218
|
+
percentage = self.safe_string(ticker, 9 - minusIndex)
|
1219
|
+
volume = self.safe_string(ticker, 11 - minusIndex)
|
1220
|
+
high = self.safe_string(ticker, 12 - minusIndex)
|
1221
|
+
low = self.safe_string(ticker, 13 - minusIndex)
|
1222
|
+
else:
|
1223
|
+
# on trading pairs(ex. tBTCUSD or tHMSTR:USD)
|
1224
|
+
last = self.safe_string(ticker, 7 - minusIndex)
|
1225
|
+
bid = self.safe_string(ticker, 1 - minusIndex)
|
1226
|
+
ask = self.safe_string(ticker, 3 - minusIndex)
|
1227
|
+
change = self.safe_string(ticker, 5 - minusIndex)
|
1228
|
+
percentage = self.safe_string(ticker, 6 - minusIndex)
|
1229
|
+
percentage = Precise.string_mul(percentage, '100')
|
1230
|
+
volume = self.safe_string(ticker, 8 - minusIndex)
|
1231
|
+
high = self.safe_string(ticker, 9 - minusIndex)
|
1232
|
+
low = self.safe_string(ticker, 10 - minusIndex)
|
1200
1233
|
return self.safe_ticker({
|
1201
1234
|
'symbol': symbol,
|
1202
1235
|
'timestamp': None,
|
1203
1236
|
'datetime': None,
|
1204
|
-
'high':
|
1205
|
-
'low':
|
1206
|
-
'bid':
|
1207
|
-
'bidVolume':
|
1208
|
-
'ask':
|
1209
|
-
'askVolume':
|
1237
|
+
'high': high,
|
1238
|
+
'low': low,
|
1239
|
+
'bid': bid,
|
1240
|
+
'bidVolume': None,
|
1241
|
+
'ask': ask,
|
1242
|
+
'askVolume': None,
|
1210
1243
|
'vwap': None,
|
1211
1244
|
'open': None,
|
1212
1245
|
'close': last,
|
1213
1246
|
'last': last,
|
1214
1247
|
'previousClose': None,
|
1215
|
-
'change':
|
1216
|
-
'percentage':
|
1248
|
+
'change': change,
|
1249
|
+
'percentage': percentage,
|
1217
1250
|
'average': None,
|
1218
|
-
'baseVolume':
|
1251
|
+
'baseVolume': volume,
|
1219
1252
|
'quoteVolume': None,
|
1220
|
-
'info':
|
1253
|
+
'info': ticker,
|
1221
1254
|
}, market)
|
1222
1255
|
|
1223
1256
|
async def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
|
@@ -1278,14 +1311,7 @@ class bitfinex(Exchange, ImplicitAPI):
|
|
1278
1311
|
# ...
|
1279
1312
|
# ]
|
1280
1313
|
#
|
1281
|
-
|
1282
|
-
for i in range(0, len(tickers)):
|
1283
|
-
ticker = tickers[i]
|
1284
|
-
marketId = self.safe_string(ticker, 0)
|
1285
|
-
market = self.safe_market(marketId)
|
1286
|
-
symbol = market['symbol']
|
1287
|
-
result[symbol] = self.parse_ticker({'result': ticker}, market)
|
1288
|
-
return self.filter_by_array_tickers(result, 'symbol', symbols)
|
1314
|
+
return self.parse_tickers(tickers, symbols)
|
1289
1315
|
|
1290
1316
|
async def fetch_ticker(self, symbol: str, params={}) -> Ticker:
|
1291
1317
|
"""
|
@@ -1303,8 +1329,7 @@ class bitfinex(Exchange, ImplicitAPI):
|
|
1303
1329
|
'symbol': market['id'],
|
1304
1330
|
}
|
1305
1331
|
ticker = await self.publicGetTickerSymbol(self.extend(request, params))
|
1306
|
-
|
1307
|
-
return self.parse_ticker(result, market)
|
1332
|
+
return self.parse_ticker(ticker, market)
|
1308
1333
|
|
1309
1334
|
def parse_trade(self, trade: dict, market: Market = None) -> Trade:
|
1310
1335
|
#
|
ccxt/async_support/bitget.py
CHANGED
@@ -1567,6 +1567,8 @@ class bitget(Exchange, ImplicitAPI):
|
|
1567
1567
|
'method': 'privateMixGetV2MixPositionAllPosition', # or privateMixGetV2MixPositionHistoryPosition
|
1568
1568
|
},
|
1569
1569
|
'defaultTimeInForce': 'GTC', # 'GTC' = Good To Cancel(default), 'IOC' = Immediate Or Cancel
|
1570
|
+
# fiat currencies on deposit page
|
1571
|
+
'fiatCurrencies': ['EUR', 'VND', 'PLN', 'CZK', 'HUF', 'DKK', 'AUD', 'CAD', 'NOK', 'SEK', 'CHF', 'MXN', 'COP', 'ARS', 'GBP', 'BRL', 'UAH', 'ZAR'],
|
1570
1572
|
},
|
1571
1573
|
'features': {
|
1572
1574
|
'spot': {
|
@@ -2025,99 +2027,85 @@ class bitget(Exchange, ImplicitAPI):
|
|
2025
2027
|
"""
|
2026
2028
|
response = await self.publicSpotGetV2SpotPublicCoins(params)
|
2027
2029
|
#
|
2028
|
-
#
|
2029
|
-
#
|
2030
|
-
#
|
2031
|
-
#
|
2032
|
-
#
|
2033
|
-
#
|
2034
|
-
#
|
2035
|
-
#
|
2036
|
-
#
|
2037
|
-
#
|
2038
|
-
#
|
2039
|
-
#
|
2040
|
-
#
|
2041
|
-
#
|
2042
|
-
#
|
2043
|
-
#
|
2044
|
-
#
|
2045
|
-
#
|
2046
|
-
#
|
2047
|
-
#
|
2048
|
-
#
|
2049
|
-
#
|
2050
|
-
#
|
2051
|
-
#
|
2052
|
-
#
|
2053
|
-
#
|
2054
|
-
#
|
2030
|
+
# {
|
2031
|
+
# "code": "00000",
|
2032
|
+
# "msg": "success",
|
2033
|
+
# "requestTime": "1746195617812",
|
2034
|
+
# "data": [
|
2035
|
+
# {
|
2036
|
+
# "coinId": "1456",
|
2037
|
+
# "coin": "NEIROETH",
|
2038
|
+
# "transfer": "false",
|
2039
|
+
# "chains": [
|
2040
|
+
# {
|
2041
|
+
# "chain": "ERC20",
|
2042
|
+
# "needTag": "false",
|
2043
|
+
# "withdrawable": "true",
|
2044
|
+
# "rechargeable": "true",
|
2045
|
+
# "withdrawFee": "44.91017965",
|
2046
|
+
# "extraWithdrawFee": "0",
|
2047
|
+
# "depositConfirm": "12",
|
2048
|
+
# "withdrawConfirm": "64",
|
2049
|
+
# "minDepositAmount": "0.06",
|
2050
|
+
# "minWithdrawAmount": "60",
|
2051
|
+
# "browserUrl": "https://etherscan.io/tx/",
|
2052
|
+
# "contractAddress": "0xee2a03aa6dacf51c18679c516ad5283d8e7c2637",
|
2053
|
+
# "withdrawStep": "0",
|
2054
|
+
# "withdrawMinScale": "8",
|
2055
|
+
# "congestion": "normal"
|
2056
|
+
# }
|
2057
|
+
# ],
|
2058
|
+
# "areaCoin": "no"
|
2059
|
+
# },
|
2060
|
+
# ...
|
2055
2061
|
#
|
2056
2062
|
result: dict = {}
|
2057
2063
|
data = self.safe_value(response, 'data', [])
|
2064
|
+
fiatCurrencies = self.safe_list(self.options, 'fiatCurrencies', [])
|
2058
2065
|
for i in range(0, len(data)):
|
2059
2066
|
entry = data[i]
|
2060
2067
|
id = self.safe_string(entry, 'coin') # we don't use 'coinId' has no use. it is 'coin' field that needs to be used in currency related endpoints(deposit, withdraw, etc..)
|
2061
2068
|
code = self.safe_currency_code(id)
|
2062
2069
|
chains = self.safe_value(entry, 'chains', [])
|
2063
2070
|
networks: dict = {}
|
2064
|
-
deposit = False
|
2065
|
-
withdraw = False
|
2066
|
-
minWithdrawString = None
|
2067
|
-
minDepositString = None
|
2068
|
-
minWithdrawFeeString = None
|
2069
2071
|
for j in range(0, len(chains)):
|
2070
2072
|
chain = chains[j]
|
2071
2073
|
networkId = self.safe_string(chain, 'chain')
|
2072
2074
|
network = self.network_id_to_code(networkId, code)
|
2073
2075
|
if network is not None:
|
2074
2076
|
network = network.upper()
|
2075
|
-
withdrawEnabled = self.safe_string(chain, 'withdrawable')
|
2076
|
-
canWithdraw = withdrawEnabled == 'true'
|
2077
|
-
withdraw = canWithdraw if (canWithdraw) else withdraw
|
2078
|
-
depositEnabled = self.safe_string(chain, 'rechargeable')
|
2079
|
-
canDeposit = depositEnabled == 'true'
|
2080
|
-
deposit = canDeposit if (canDeposit) else deposit
|
2081
|
-
networkWithdrawFeeString = self.safe_string(chain, 'withdrawFee')
|
2082
|
-
if networkWithdrawFeeString is not None:
|
2083
|
-
minWithdrawFeeString = networkWithdrawFeeString if (minWithdrawFeeString is None) else Precise.string_min(networkWithdrawFeeString, minWithdrawFeeString)
|
2084
|
-
networkMinWithdrawString = self.safe_string(chain, 'minWithdrawAmount')
|
2085
|
-
if networkMinWithdrawString is not None:
|
2086
|
-
minWithdrawString = networkMinWithdrawString if (minWithdrawString is None) else Precise.string_min(networkMinWithdrawString, minWithdrawString)
|
2087
|
-
networkMinDepositString = self.safe_string(chain, 'minDepositAmount')
|
2088
|
-
if networkMinDepositString is not None:
|
2089
|
-
minDepositString = networkMinDepositString if (minDepositString is None) else Precise.string_min(networkMinDepositString, minDepositString)
|
2090
2077
|
networks[network] = {
|
2091
2078
|
'info': chain,
|
2092
2079
|
'id': networkId,
|
2093
2080
|
'network': network,
|
2094
2081
|
'limits': {
|
2095
2082
|
'withdraw': {
|
2096
|
-
'min': self.
|
2083
|
+
'min': self.safe_number(chain, 'minWithdrawAmount'),
|
2097
2084
|
'max': None,
|
2098
2085
|
},
|
2099
2086
|
'deposit': {
|
2100
|
-
'min': self.
|
2087
|
+
'min': self.safe_number(chain, 'minDepositAmount'),
|
2101
2088
|
'max': None,
|
2102
2089
|
},
|
2103
2090
|
},
|
2104
|
-
'active':
|
2105
|
-
'withdraw':
|
2106
|
-
'deposit':
|
2107
|
-
'fee': self.
|
2108
|
-
'precision':
|
2091
|
+
'active': None,
|
2092
|
+
'withdraw': self.safe_string(chain, 'withdrawable') == 'true',
|
2093
|
+
'deposit': self.safe_string(chain, 'rechargeable') == 'true',
|
2094
|
+
'fee': self.safe_number(chain, 'withdrawFee'),
|
2095
|
+
'precision': self.parse_number(self.parse_precision(self.safe_string(chain, 'withdrawMinScale'))),
|
2109
2096
|
}
|
2110
|
-
|
2097
|
+
isFiat = self.in_array(code, fiatCurrencies)
|
2098
|
+
result[code] = self.safe_currency_structure({
|
2111
2099
|
'info': entry,
|
2112
2100
|
'id': id,
|
2113
2101
|
'code': code,
|
2114
2102
|
'networks': networks,
|
2115
|
-
'type':
|
2103
|
+
'type': 'fiat' if isFiat else 'crypto',
|
2116
2104
|
'name': None,
|
2117
|
-
'active':
|
2118
|
-
'deposit':
|
2119
|
-
'withdraw':
|
2120
|
-
'fee':
|
2105
|
+
'active': None,
|
2106
|
+
'deposit': None,
|
2107
|
+
'withdraw': None,
|
2108
|
+
'fee': None,
|
2121
2109
|
'precision': None,
|
2122
2110
|
'limits': {
|
2123
2111
|
'amount': {
|
@@ -2125,16 +2113,16 @@ class bitget(Exchange, ImplicitAPI):
|
|
2125
2113
|
'max': None,
|
2126
2114
|
},
|
2127
2115
|
'withdraw': {
|
2128
|
-
'min':
|
2116
|
+
'min': None,
|
2129
2117
|
'max': None,
|
2130
2118
|
},
|
2131
2119
|
'deposit': {
|
2132
|
-
'min':
|
2120
|
+
'min': None,
|
2133
2121
|
'max': None,
|
2134
2122
|
},
|
2135
2123
|
},
|
2136
2124
|
'created': None,
|
2137
|
-
}
|
2125
|
+
})
|
2138
2126
|
return result
|
2139
2127
|
|
2140
2128
|
async def fetch_market_leverage_tiers(self, symbol: str, params={}) -> List[LeverageTier]:
|
@@ -2753,7 +2741,7 @@ class bitget(Exchange, ImplicitAPI):
|
|
2753
2741
|
close = self.safe_string(ticker, 'lastPr')
|
2754
2742
|
timestamp = self.safe_integer_omit_zero(ticker, 'ts') # exchange bitget provided 0
|
2755
2743
|
change = self.safe_string(ticker, 'change24h')
|
2756
|
-
open24 = self.
|
2744
|
+
open24 = self.safe_string_2(ticker, 'open24', 'open24h')
|
2757
2745
|
open = self.safe_string(ticker, 'open')
|
2758
2746
|
symbol: str
|
2759
2747
|
openValue: str
|