ccxt 4.4.77__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 +3 -3
- ccxt/abstract/apex.py +31 -0
- ccxt/abstract/bitmart.py +1 -0
- ccxt/apex.py +1884 -0
- ccxt/ascendex.py +23 -6
- ccxt/async_support/__init__.py +3 -3
- ccxt/async_support/apex.py +1884 -0
- ccxt/async_support/ascendex.py +23 -6
- ccxt/async_support/base/exchange.py +5 -1
- ccxt/async_support/binance.py +9 -3
- ccxt/async_support/bingx.py +4 -4
- ccxt/async_support/bitfinex.py +61 -36
- ccxt/async_support/bitflyer.py +2 -2
- ccxt/async_support/bitget.py +186 -128
- ccxt/async_support/bitmart.py +9 -4
- ccxt/async_support/bitmex.py +14 -7
- 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/cex.py +1 -1
- ccxt/async_support/coinbase.py +17 -4
- ccxt/async_support/coincatch.py +66 -0
- ccxt/async_support/coinex.py +2 -1
- ccxt/async_support/coinlist.py +1 -0
- ccxt/async_support/coinone.py +1 -0
- ccxt/async_support/cryptocom.py +2 -2
- ccxt/async_support/defx.py +1 -1
- ccxt/async_support/delta.py +4 -1
- ccxt/async_support/deribit.py +3 -2
- ccxt/async_support/derive.py +2 -2
- ccxt/async_support/digifinex.py +2 -2
- ccxt/async_support/gate.py +1 -1
- ccxt/async_support/hitbtc.py +5 -2
- ccxt/async_support/hollaex.py +1 -0
- ccxt/async_support/htx.py +9 -5
- ccxt/async_support/huobijp.py +1 -0
- ccxt/async_support/hyperliquid.py +14 -6
- ccxt/async_support/kraken.py +4 -2
- ccxt/async_support/krakenfutures.py +2 -2
- ccxt/async_support/kucoinfutures.py +2 -2
- ccxt/async_support/mexc.py +50 -52
- ccxt/async_support/okx.py +2 -2
- ccxt/async_support/oxfun.py +2 -2
- ccxt/async_support/paradex.py +2 -2
- ccxt/async_support/phemex.py +4 -3
- ccxt/async_support/poloniex.py +4 -3
- ccxt/async_support/probit.py +1 -0
- ccxt/async_support/timex.py +2 -2
- ccxt/async_support/tradeogre.py +2 -1
- ccxt/async_support/upbit.py +243 -63
- ccxt/async_support/vertex.py +2 -2
- ccxt/async_support/whitebit.py +66 -12
- ccxt/async_support/woo.py +5 -3
- ccxt/async_support/woofipro.py +2 -2
- ccxt/async_support/xt.py +9 -2
- ccxt/base/exchange.py +69 -2
- ccxt/binance.py +9 -3
- ccxt/bingx.py +4 -4
- ccxt/bitfinex.py +61 -36
- ccxt/bitflyer.py +2 -2
- ccxt/bitget.py +186 -128
- ccxt/bitmart.py +9 -4
- ccxt/bitmex.py +14 -7
- 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/cex.py +1 -1
- ccxt/coinbase.py +17 -4
- ccxt/coincatch.py +66 -0
- ccxt/coinex.py +2 -1
- ccxt/coinlist.py +1 -0
- ccxt/coinone.py +1 -0
- ccxt/cryptocom.py +2 -2
- ccxt/defx.py +1 -1
- ccxt/delta.py +4 -1
- ccxt/deribit.py +3 -2
- ccxt/derive.py +2 -2
- ccxt/digifinex.py +2 -2
- ccxt/gate.py +1 -1
- ccxt/hitbtc.py +5 -2
- ccxt/hollaex.py +1 -0
- ccxt/htx.py +9 -5
- ccxt/huobijp.py +1 -0
- ccxt/hyperliquid.py +14 -6
- ccxt/kraken.py +4 -2
- ccxt/krakenfutures.py +2 -2
- ccxt/kucoinfutures.py +2 -2
- ccxt/mexc.py +50 -52
- ccxt/okx.py +2 -2
- ccxt/oxfun.py +2 -2
- ccxt/paradex.py +2 -2
- ccxt/phemex.py +4 -3
- ccxt/poloniex.py +4 -3
- ccxt/pro/__init__.py +5 -1
- ccxt/pro/apex.py +984 -0
- ccxt/pro/binance.py +3 -3
- ccxt/pro/coinbase.py +43 -57
- ccxt/pro/gate.py +22 -2
- ccxt/pro/hollaex.py +2 -2
- ccxt/pro/p2b.py +2 -2
- ccxt/pro/tradeogre.py +272 -0
- ccxt/pro/upbit.py +42 -0
- ccxt/probit.py +1 -0
- ccxt/test/tests_async.py +4 -1
- ccxt/test/tests_sync.py +4 -1
- ccxt/timex.py +2 -2
- ccxt/tradeogre.py +2 -1
- ccxt/upbit.py +243 -63
- ccxt/vertex.py +2 -2
- ccxt/whitebit.py +66 -12
- ccxt/woo.py +5 -3
- ccxt/woofipro.py +2 -2
- ccxt/xt.py +9 -2
- {ccxt-4.4.77.dist-info → ccxt-4.4.80.dist-info}/METADATA +9 -11
- {ccxt-4.4.77.dist-info → ccxt-4.4.80.dist-info}/RECORD +130 -128
- ccxt/abstract/ace.py +0 -15
- ccxt/ace.py +0 -1152
- ccxt/async_support/ace.py +0 -1152
- {ccxt-4.4.77.dist-info → ccxt-4.4.80.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.4.77.dist-info → ccxt-4.4.80.dist-info}/WHEEL +0 -0
- {ccxt-4.4.77.dist-info → ccxt-4.4.80.dist-info}/top_level.txt +0 -0
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, 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': {
|
@@ -2633,7 +2650,7 @@ class ascendex(Exchange, ImplicitAPI):
|
|
2633
2650
|
'internal': False,
|
2634
2651
|
}
|
2635
2652
|
|
2636
|
-
async def fetch_positions(self, symbols: Strings = None, params={}):
|
2653
|
+
async def fetch_positions(self, symbols: Strings = None, params={}) -> List[Position]:
|
2637
2654
|
"""
|
2638
2655
|
fetch all open positions
|
2639
2656
|
:param str[]|None symbols: list of unified market symbols
|
@@ -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
@@ -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 Any, Balances, BorrowInterest, Conversion, CrossBorrowRate, Currencies, Currency, DepositAddress, Greeks, Int, IsolatedBorrowRate, IsolatedBorrowRates, LedgerEntry, Leverage, Leverages, LeverageTier, LeverageTiers, LongShortRatio, MarginMode, MarginModes, MarginModification, Market, Num, Option, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade, TradingFeeInterface, TradingFees, Transaction, MarketInterface, TransferEntry
|
11
|
+
from ccxt.base.types import Any, Balances, BorrowInterest, Conversion, CrossBorrowRate, Currencies, Currency, DepositAddress, Greeks, Int, IsolatedBorrowRate, IsolatedBorrowRates, LedgerEntry, Leverage, Leverages, LeverageTier, LeverageTiers, LongShortRatio, MarginMode, MarginModes, MarginModification, Market, Num, Option, Order, OrderBook, OrderRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade, TradingFeeInterface, TradingFees, Transaction, MarketInterface, TransferEntry
|
12
12
|
from typing import List
|
13
13
|
from ccxt.base.errors import ExchangeError
|
14
14
|
from ccxt.base.errors import AuthenticationError
|
@@ -44,7 +44,7 @@ class binance(Exchange, ImplicitAPI):
|
|
44
44
|
return self.deep_extend(super(binance, self).describe(), {
|
45
45
|
'id': 'binance',
|
46
46
|
'name': 'Binance',
|
47
|
-
'countries': [
|
47
|
+
'countries': [], # Japan
|
48
48
|
'rateLimit': 50,
|
49
49
|
'certified': True,
|
50
50
|
'pro': True,
|
@@ -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)):
|
@@ -10111,7 +10117,7 @@ class binance(Exchange, ImplicitAPI):
|
|
10111
10117
|
'percentage': None,
|
10112
10118
|
})
|
10113
10119
|
|
10114
|
-
async def fetch_positions(self, symbols: Strings = None, params={}):
|
10120
|
+
async def fetch_positions(self, symbols: Strings = None, params={}) -> List[Position]:
|
10115
10121
|
"""
|
10116
10122
|
fetch all open positions
|
10117
10123
|
|
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]:
|
@@ -2372,7 +2372,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
2372
2372
|
positions = self.parse_positions(records)
|
2373
2373
|
return self.filter_by_symbol_since_limit(positions, symbol, since, limit)
|
2374
2374
|
|
2375
|
-
async def fetch_positions(self, symbols: Strings = None, params={}):
|
2375
|
+
async def fetch_positions(self, symbols: Strings = None, params={}) -> List[Position]:
|
2376
2376
|
"""
|
2377
2377
|
fetch all open positions
|
2378
2378
|
|
ccxt/async_support/bitfinex.py
CHANGED
@@ -7,7 +7,7 @@ from ccxt.async_support.base.exchange import Exchange
|
|
7
7
|
from ccxt.abstract.bitfinex import ImplicitAPI
|
8
8
|
import asyncio
|
9
9
|
import hashlib
|
10
|
-
from ccxt.base.types import Any, Balances, Currencies, Currency, DepositAddress, Int, LedgerEntry, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade, TradingFees, Transaction, TransferEntry
|
10
|
+
from ccxt.base.types import Any, Balances, Currencies, Currency, DepositAddress, Int, LedgerEntry, 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
|
@@ -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
|
#
|
@@ -2676,7 +2701,7 @@ class bitfinex(Exchange, ImplicitAPI):
|
|
2676
2701
|
self.throw_broadly_matched_exception(self.exceptions['broad'], text, text)
|
2677
2702
|
return self.parse_transaction(response, currency)
|
2678
2703
|
|
2679
|
-
async def fetch_positions(self, symbols: Strings = None, params={}):
|
2704
|
+
async def fetch_positions(self, symbols: Strings = None, params={}) -> List[Position]:
|
2680
2705
|
"""
|
2681
2706
|
fetch all open positions
|
2682
2707
|
|
ccxt/async_support/bitflyer.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.async_support.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.bitflyer import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Any, Balances, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, FundingRate, Trade, TradingFeeInterface, Transaction, MarketInterface
|
9
|
+
from ccxt.base.types import Any, Balances, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Position, Str, Strings, Ticker, FundingRate, Trade, TradingFeeInterface, Transaction, MarketInterface
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
12
|
from ccxt.base.errors import ArgumentsRequired
|
@@ -842,7 +842,7 @@ class bitflyer(Exchange, ImplicitAPI):
|
|
842
842
|
#
|
843
843
|
return self.parse_trades(response, market, since, limit)
|
844
844
|
|
845
|
-
async def fetch_positions(self, symbols: Strings = None, params={}):
|
845
|
+
async def fetch_positions(self, symbols: Strings = None, params={}) -> List[Position]:
|
846
846
|
"""
|
847
847
|
fetch all open positions
|
848
848
|
|