ccxt 4.4.28__py2.py3-none-any.whl → 4.4.30__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 +1 -0
- ccxt/abstract/binance.py +9 -0
- ccxt/abstract/binancecoinm.py +9 -0
- ccxt/abstract/binanceus.py +9 -0
- ccxt/abstract/binanceusdm.py +9 -0
- ccxt/abstract/bybit.py +0 -13
- ccxt/alpaca.py +53 -8
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/alpaca.py +53 -8
- ccxt/async_support/base/exchange.py +4 -1
- ccxt/async_support/bigone.py +1 -1
- ccxt/async_support/binance.py +10 -1
- ccxt/async_support/bingx.py +1 -1
- ccxt/async_support/bitbank.py +1 -1
- ccxt/async_support/bitbns.py +12 -12
- ccxt/async_support/bitfinex.py +10 -10
- ccxt/async_support/bitfinex2.py +1 -1
- ccxt/async_support/bitflyer.py +1 -1
- ccxt/async_support/bitget.py +96 -8
- ccxt/async_support/bithumb.py +1 -1
- ccxt/async_support/bitmart.py +54 -54
- ccxt/async_support/bitmex.py +1 -1
- ccxt/async_support/bitopro.py +22 -22
- ccxt/async_support/bitrue.py +29 -29
- ccxt/async_support/bitso.py +1 -1
- ccxt/async_support/bitstamp.py +1 -1
- ccxt/async_support/bitvavo.py +4 -1
- ccxt/async_support/blockchaincom.py +1 -1
- ccxt/async_support/btcmarkets.py +1 -1
- ccxt/async_support/bybit.py +50 -585
- ccxt/async_support/coinbase.py +1 -1
- ccxt/async_support/coinbaseexchange.py +1 -1
- ccxt/async_support/coinbaseinternational.py +1 -1
- ccxt/async_support/coincatch.py +25 -5
- ccxt/async_support/coinex.py +1 -1
- ccxt/async_support/coinlist.py +1 -1
- ccxt/async_support/coinmate.py +1 -1
- ccxt/async_support/coinsph.py +1 -1
- ccxt/async_support/cryptocom.py +1 -1
- ccxt/async_support/deribit.py +8 -4
- ccxt/async_support/digifinex.py +1 -1
- ccxt/async_support/exmo.py +1 -1
- ccxt/async_support/gate.py +1 -1
- ccxt/async_support/gemini.py +1 -1
- ccxt/async_support/hashkey.py +1 -1
- ccxt/async_support/hitbtc.py +1 -1
- ccxt/async_support/hollaex.py +1 -1
- ccxt/async_support/htx.py +1 -1
- ccxt/async_support/huobijp.py +1 -1
- ccxt/async_support/hyperliquid.py +110 -5
- ccxt/async_support/idex.py +1 -1
- ccxt/async_support/independentreserve.py +1 -1
- ccxt/async_support/indodax.py +1 -1
- ccxt/async_support/kraken.py +1 -1
- ccxt/async_support/kucoin.py +1 -1
- ccxt/async_support/kuna.py +1 -1
- ccxt/async_support/lbank.py +6 -1
- ccxt/async_support/lykke.py +1 -1
- ccxt/async_support/mercado.py +1 -1
- ccxt/async_support/mexc.py +1 -1
- ccxt/async_support/ndax.py +1 -1
- ccxt/async_support/novadax.py +1 -1
- ccxt/async_support/okcoin.py +1 -1
- ccxt/async_support/okx.py +1 -1
- ccxt/async_support/onetrading.py +1 -1
- ccxt/async_support/oxfun.py +1 -1
- ccxt/async_support/phemex.py +1 -1
- ccxt/async_support/poloniex.py +1 -1
- ccxt/async_support/probit.py +1 -1
- ccxt/async_support/tokocrypto.py +1 -1
- ccxt/async_support/upbit.py +1 -1
- ccxt/async_support/vertex.py +52 -8
- ccxt/async_support/wavesexchange.py +1 -1
- ccxt/async_support/whitebit.py +1 -1
- ccxt/async_support/woo.py +1 -1
- ccxt/async_support/woofipro.py +1 -1
- ccxt/async_support/xt.py +1 -1
- ccxt/async_support/yobit.py +2 -2
- ccxt/async_support/zaif.py +1 -1
- ccxt/async_support/zonda.py +1 -1
- ccxt/base/exchange.py +4 -1
- ccxt/bigone.py +1 -1
- ccxt/binance.py +10 -1
- ccxt/bingx.py +1 -1
- ccxt/bitbank.py +1 -1
- ccxt/bitbns.py +12 -12
- ccxt/bitfinex.py +10 -10
- ccxt/bitfinex2.py +1 -1
- ccxt/bitflyer.py +1 -1
- ccxt/bitget.py +96 -8
- ccxt/bithumb.py +1 -1
- ccxt/bitmart.py +54 -54
- ccxt/bitmex.py +1 -1
- ccxt/bitopro.py +22 -22
- ccxt/bitrue.py +29 -29
- ccxt/bitso.py +1 -1
- ccxt/bitstamp.py +1 -1
- ccxt/bitvavo.py +4 -1
- ccxt/blockchaincom.py +1 -1
- ccxt/btcmarkets.py +1 -1
- ccxt/bybit.py +50 -585
- ccxt/coinbase.py +1 -1
- ccxt/coinbaseexchange.py +1 -1
- ccxt/coinbaseinternational.py +1 -1
- ccxt/coincatch.py +25 -5
- ccxt/coinex.py +1 -1
- ccxt/coinlist.py +1 -1
- ccxt/coinmate.py +1 -1
- ccxt/coinsph.py +1 -1
- ccxt/cryptocom.py +1 -1
- ccxt/deribit.py +8 -4
- ccxt/digifinex.py +1 -1
- ccxt/exmo.py +1 -1
- ccxt/gate.py +1 -1
- ccxt/gemini.py +1 -1
- ccxt/hashkey.py +1 -1
- ccxt/hitbtc.py +1 -1
- ccxt/hollaex.py +1 -1
- ccxt/htx.py +1 -1
- ccxt/huobijp.py +1 -1
- ccxt/hyperliquid.py +110 -5
- ccxt/idex.py +1 -1
- ccxt/independentreserve.py +1 -1
- ccxt/indodax.py +1 -1
- ccxt/kraken.py +1 -1
- ccxt/kucoin.py +1 -1
- ccxt/kuna.py +1 -1
- ccxt/lbank.py +6 -1
- ccxt/lykke.py +1 -1
- ccxt/mercado.py +1 -1
- ccxt/mexc.py +1 -1
- ccxt/ndax.py +1 -1
- ccxt/novadax.py +1 -1
- ccxt/okcoin.py +1 -1
- ccxt/okx.py +1 -1
- ccxt/onetrading.py +1 -1
- ccxt/oxfun.py +1 -1
- ccxt/phemex.py +1 -1
- ccxt/poloniex.py +1 -1
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/bitvavo.py +2 -1
- ccxt/pro/blofin.py +2 -1
- ccxt/pro/mexc.py +187 -30
- ccxt/probit.py +1 -1
- ccxt/test/tests_helpers.py +2 -2
- ccxt/tokocrypto.py +1 -1
- ccxt/upbit.py +1 -1
- ccxt/vertex.py +52 -8
- ccxt/wavesexchange.py +1 -1
- ccxt/whitebit.py +1 -1
- ccxt/woo.py +1 -1
- ccxt/woofipro.py +1 -1
- ccxt/xt.py +1 -1
- ccxt/yobit.py +2 -2
- ccxt/zaif.py +1 -1
- ccxt/zonda.py +1 -1
- {ccxt-4.4.28.dist-info → ccxt-4.4.30.dist-info}/METADATA +4 -4
- {ccxt-4.4.28.dist-info → ccxt-4.4.30.dist-info}/RECORD +162 -162
- {ccxt-4.4.28.dist-info → ccxt-4.4.30.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.4.28.dist-info → ccxt-4.4.30.dist-info}/WHEEL +0 -0
- {ccxt-4.4.28.dist-info → ccxt-4.4.30.dist-info}/top_level.txt +0 -0
ccxt/async_support/bitopro.py
CHANGED
@@ -233,7 +233,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
233
233
|
:returns dict: an associative dictionary of currencies
|
234
234
|
"""
|
235
235
|
response = await self.publicGetProvisioningCurrencies(params)
|
236
|
-
currencies = self.
|
236
|
+
currencies = self.safe_list(response, 'data', [])
|
237
237
|
#
|
238
238
|
# {
|
239
239
|
# "data":[
|
@@ -255,8 +255,8 @@ class bitopro(Exchange, ImplicitAPI):
|
|
255
255
|
currency = currencies[i]
|
256
256
|
currencyId = self.safe_string(currency, 'currency')
|
257
257
|
code = self.safe_currency_code(currencyId)
|
258
|
-
deposit = self.
|
259
|
-
withdraw = self.
|
258
|
+
deposit = self.safe_bool(currency, 'deposit')
|
259
|
+
withdraw = self.safe_bool(currency, 'withdraw')
|
260
260
|
fee = self.safe_number(currency, 'withdrawFee')
|
261
261
|
withdrawMin = self.safe_number(currency, 'minWithdraw')
|
262
262
|
withdrawMax = self.safe_number(currency, 'maxWithdraw')
|
@@ -293,7 +293,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
293
293
|
:returns dict[]: an array of objects representing market data
|
294
294
|
"""
|
295
295
|
response = await self.publicGetProvisioningTradingPairs()
|
296
|
-
markets = self.
|
296
|
+
markets = self.safe_list(response, 'data', [])
|
297
297
|
#
|
298
298
|
# {
|
299
299
|
# "data":[
|
@@ -317,7 +317,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
317
317
|
return self.parse_markets(markets)
|
318
318
|
|
319
319
|
def parse_market(self, market: dict) -> Market:
|
320
|
-
active = not self.
|
320
|
+
active = not self.safe_bool(market, 'maintain')
|
321
321
|
id = self.safe_string(market, 'pair')
|
322
322
|
uppercaseId = id.upper()
|
323
323
|
baseId = self.safe_string(market, 'base')
|
@@ -429,7 +429,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
429
429
|
'pair': market['id'],
|
430
430
|
}
|
431
431
|
response = await self.publicGetTickersPair(self.extend(request, params))
|
432
|
-
ticker = self.
|
432
|
+
ticker = self.safe_dict(response, 'data', {})
|
433
433
|
#
|
434
434
|
# {
|
435
435
|
# "data":{
|
@@ -455,7 +455,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
455
455
|
"""
|
456
456
|
await self.load_markets()
|
457
457
|
response = await self.publicGetTickers()
|
458
|
-
tickers = self.
|
458
|
+
tickers = self.safe_list(response, 'data', [])
|
459
459
|
#
|
460
460
|
# {
|
461
461
|
# "data":[
|
@@ -551,7 +551,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
551
551
|
type = self.safe_string_lower(trade, 'type')
|
552
552
|
side = self.safe_string_lower(trade, 'action')
|
553
553
|
if side is None:
|
554
|
-
isBuyer = self.
|
554
|
+
isBuyer = self.safe_bool(trade, 'isBuyer')
|
555
555
|
if isBuyer:
|
556
556
|
side = 'buy'
|
557
557
|
else:
|
@@ -568,7 +568,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
568
568
|
'currency': feeSymbol,
|
569
569
|
'rate': None,
|
570
570
|
}
|
571
|
-
isTaker = self.
|
571
|
+
isTaker = self.safe_bool(trade, 'isTaker')
|
572
572
|
takerOrMaker = None
|
573
573
|
if isTaker is not None:
|
574
574
|
if isTaker:
|
@@ -607,7 +607,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
607
607
|
'pair': market['id'],
|
608
608
|
}
|
609
609
|
response = await self.publicGetTradesPair(self.extend(request, params))
|
610
|
-
trades = self.
|
610
|
+
trades = self.safe_list(response, 'data', [])
|
611
611
|
#
|
612
612
|
# {
|
613
613
|
# "data":[
|
@@ -631,7 +631,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
631
631
|
"""
|
632
632
|
await self.load_markets()
|
633
633
|
response = await self.publicGetProvisioningLimitationsAndFees(params)
|
634
|
-
tradingFeeRate = self.
|
634
|
+
tradingFeeRate = self.safe_dict(response, 'tradingFeeRate', {})
|
635
635
|
first = self.safe_value(tradingFeeRate, 0)
|
636
636
|
#
|
637
637
|
# {
|
@@ -753,7 +753,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
753
753
|
request['from'] = int(math.floor(since / 1000))
|
754
754
|
request['to'] = self.sum(request['from'], limit * timeframeInSeconds)
|
755
755
|
response = await self.publicGetTradingHistoryPair(self.extend(request, params))
|
756
|
-
data = self.
|
756
|
+
data = self.safe_list(response, 'data', [])
|
757
757
|
#
|
758
758
|
# {
|
759
759
|
# "data":[
|
@@ -841,7 +841,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
841
841
|
"""
|
842
842
|
await self.load_markets()
|
843
843
|
response = await self.privateGetAccountsBalance(params)
|
844
|
-
balances = self.
|
844
|
+
balances = self.safe_list(response, 'data', [])
|
845
845
|
#
|
846
846
|
# {
|
847
847
|
# "data":[
|
@@ -1101,7 +1101,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
1101
1101
|
response = await self.privateDeleteOrdersPair(self.extend(request, params))
|
1102
1102
|
else:
|
1103
1103
|
response = await self.privateDeleteOrdersAll(self.extend(request, params))
|
1104
|
-
data = self.
|
1104
|
+
data = self.safe_dict(response, 'data', {})
|
1105
1105
|
#
|
1106
1106
|
# {
|
1107
1107
|
# "data":{
|
@@ -1183,7 +1183,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
1183
1183
|
if limit is not None:
|
1184
1184
|
request['limit'] = limit
|
1185
1185
|
response = await self.privateGetOrdersAllPair(self.extend(request, params))
|
1186
|
-
orders = self.
|
1186
|
+
orders = self.safe_list(response, 'data', [])
|
1187
1187
|
if orders is None:
|
1188
1188
|
orders = []
|
1189
1189
|
#
|
@@ -1253,7 +1253,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
1253
1253
|
'pair': market['id'],
|
1254
1254
|
}
|
1255
1255
|
response = await self.privateGetOrdersTradesPair(self.extend(request, params))
|
1256
|
-
trades = self.
|
1256
|
+
trades = self.safe_list(response, 'data', [])
|
1257
1257
|
#
|
1258
1258
|
# {
|
1259
1259
|
# "data":[
|
@@ -1395,7 +1395,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
1395
1395
|
if limit is not None:
|
1396
1396
|
request['limit'] = limit
|
1397
1397
|
response = await self.privateGetWalletDepositHistoryCurrency(self.extend(request, params))
|
1398
|
-
result = self.
|
1398
|
+
result = self.safe_list(response, 'data', [])
|
1399
1399
|
#
|
1400
1400
|
# {
|
1401
1401
|
# "data":[
|
@@ -1442,7 +1442,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
1442
1442
|
if limit is not None:
|
1443
1443
|
request['limit'] = limit
|
1444
1444
|
response = await self.privateGetWalletWithdrawHistoryCurrency(self.extend(request, params))
|
1445
|
-
result = self.
|
1445
|
+
result = self.safe_list(response, 'data', [])
|
1446
1446
|
#
|
1447
1447
|
# {
|
1448
1448
|
# "data":[
|
@@ -1481,7 +1481,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
1481
1481
|
'currency': currency['id'],
|
1482
1482
|
}
|
1483
1483
|
response = await self.privateGetWalletWithdrawCurrencySerial(self.extend(request, params))
|
1484
|
-
result = self.
|
1484
|
+
result = self.safe_dict(response, 'data', {})
|
1485
1485
|
#
|
1486
1486
|
# {
|
1487
1487
|
# "data":{
|
@@ -1500,7 +1500,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
1500
1500
|
#
|
1501
1501
|
return self.parse_transaction(result, currency)
|
1502
1502
|
|
1503
|
-
async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}):
|
1503
|
+
async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
|
1504
1504
|
"""
|
1505
1505
|
make a withdrawal
|
1506
1506
|
:see: https://github.com/bitoex/bitopro-offical-api-docs/blob/master/api/v3/private/create_an_withdraw_invoice.md
|
@@ -1521,7 +1521,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
1521
1521
|
'address': address,
|
1522
1522
|
}
|
1523
1523
|
if 'network' in params:
|
1524
|
-
networks = self.
|
1524
|
+
networks = self.safe_dict(self.options, 'networks', {})
|
1525
1525
|
requestedNetwork = self.safe_string_upper(params, 'network')
|
1526
1526
|
params = self.omit(params, ['network'])
|
1527
1527
|
networkId = self.safe_string(networks, requestedNetwork)
|
@@ -1531,7 +1531,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
1531
1531
|
if tag is not None:
|
1532
1532
|
request['message'] = tag
|
1533
1533
|
response = await self.privatePostWalletWithdrawCurrency(self.extend(request, params))
|
1534
|
-
result = self.
|
1534
|
+
result = self.safe_dict(response, 'data', {})
|
1535
1535
|
#
|
1536
1536
|
# {
|
1537
1537
|
# "data":{
|
ccxt/async_support/bitrue.py
CHANGED
@@ -634,7 +634,7 @@ class bitrue(Exchange, ImplicitAPI):
|
|
634
634
|
# }
|
635
635
|
#
|
636
636
|
result: dict = {}
|
637
|
-
coins = self.
|
637
|
+
coins = self.safe_list(response, 'coins', [])
|
638
638
|
for i in range(0, len(coins)):
|
639
639
|
currency = coins[i]
|
640
640
|
id = self.safe_string(currency, 'coin')
|
@@ -645,15 +645,15 @@ class bitrue(Exchange, ImplicitAPI):
|
|
645
645
|
minWithdrawString = None
|
646
646
|
maxWithdrawString = None
|
647
647
|
minWithdrawFeeString = None
|
648
|
-
networkDetails = self.
|
648
|
+
networkDetails = self.safe_list(currency, 'chainDetail', [])
|
649
649
|
networks: dict = {}
|
650
650
|
for j in range(0, len(networkDetails)):
|
651
651
|
entry = networkDetails[j]
|
652
652
|
networkId = self.safe_string(entry, 'chain')
|
653
653
|
network = self.network_id_to_code(networkId, code)
|
654
|
-
enableDeposit = self.
|
654
|
+
enableDeposit = self.safe_bool(entry, 'enableDeposit')
|
655
655
|
deposit = enableDeposit if (enableDeposit) else deposit
|
656
|
-
enableWithdraw = self.
|
656
|
+
enableWithdraw = self.safe_bool(entry, 'enableWithdraw')
|
657
657
|
withdraw = enableWithdraw if (enableWithdraw) else withdraw
|
658
658
|
networkWithdrawFeeString = self.safe_string(entry, 'withdrawFee')
|
659
659
|
if networkWithdrawFeeString is not None:
|
@@ -829,11 +829,11 @@ class bitrue(Exchange, ImplicitAPI):
|
|
829
829
|
symbol = base + '/' + quote
|
830
830
|
if settle is not None:
|
831
831
|
symbol += ':' + settle
|
832
|
-
filters = self.
|
832
|
+
filters = self.safe_list(market, 'filters', [])
|
833
833
|
filtersByType = self.index_by(filters, 'filterType')
|
834
834
|
status = self.safe_string(market, 'status')
|
835
|
-
priceFilter = self.
|
836
|
-
amountFilter = self.
|
835
|
+
priceFilter = self.safe_dict(filtersByType, 'PRICE_FILTER', {})
|
836
|
+
amountFilter = self.safe_dict(filtersByType, 'LOT_SIZE', {})
|
837
837
|
defaultPricePrecision = self.safe_string(market, 'pricePrecision')
|
838
838
|
defaultAmountPrecision = self.safe_string(market, 'quantityPrecision')
|
839
839
|
pricePrecision = self.safe_string(priceFilter, 'priceScale', defaultPricePrecision)
|
@@ -981,7 +981,7 @@ class bitrue(Exchange, ImplicitAPI):
|
|
981
981
|
if type == 'swap':
|
982
982
|
if subType is not None and subType == 'inverse':
|
983
983
|
response = await self.dapiV2PrivateGetAccount(params)
|
984
|
-
result = self.
|
984
|
+
result = self.safe_dict(response, 'data', {})
|
985
985
|
#
|
986
986
|
# {
|
987
987
|
# "code":"0",
|
@@ -1014,7 +1014,7 @@ class bitrue(Exchange, ImplicitAPI):
|
|
1014
1014
|
#
|
1015
1015
|
else:
|
1016
1016
|
response = await self.fapiV2PrivateGetAccount(params)
|
1017
|
-
result = self.
|
1017
|
+
result = self.safe_dict(response, 'data', {})
|
1018
1018
|
#
|
1019
1019
|
# {
|
1020
1020
|
# "code":"0",
|
@@ -1229,7 +1229,7 @@ class bitrue(Exchange, ImplicitAPI):
|
|
1229
1229
|
'symbol': market['id'],
|
1230
1230
|
}
|
1231
1231
|
response = await self.spotV1PublicGetTicker24hr(self.extend(request, params))
|
1232
|
-
data = self.
|
1232
|
+
data = self.safe_dict(response, 0, {})
|
1233
1233
|
else:
|
1234
1234
|
raise NotSupported(self.id + ' fetchTicker only support spot & swap markets')
|
1235
1235
|
#
|
@@ -1287,11 +1287,11 @@ class bitrue(Exchange, ImplicitAPI):
|
|
1287
1287
|
"""
|
1288
1288
|
await self.load_markets()
|
1289
1289
|
market = self.market(symbol)
|
1290
|
-
timeframes = self.
|
1290
|
+
timeframes = self.safe_dict(self.options, 'timeframes', {})
|
1291
1291
|
response = None
|
1292
1292
|
data = None
|
1293
1293
|
if market['swap']:
|
1294
|
-
timeframesFuture = self.
|
1294
|
+
timeframesFuture = self.safe_dict(timeframes, 'future', {})
|
1295
1295
|
request: dict = {
|
1296
1296
|
'contractName': market['id'],
|
1297
1297
|
# 1min / 5min / 15min / 30min / 1h / 1day / 1week / 1month
|
@@ -1305,7 +1305,7 @@ class bitrue(Exchange, ImplicitAPI):
|
|
1305
1305
|
response = await self.dapiV1PublicGetKlines(self.extend(request, params))
|
1306
1306
|
data = response
|
1307
1307
|
elif market['spot']:
|
1308
|
-
timeframesSpot = self.
|
1308
|
+
timeframesSpot = self.safe_dict(timeframes, 'spot', {})
|
1309
1309
|
request: dict = {
|
1310
1310
|
'symbol': market['id'],
|
1311
1311
|
# 1m / 5m / 15m / 30m / 1H / 2H / 4H / 12H / 1D / 1W
|
@@ -1316,7 +1316,7 @@ class bitrue(Exchange, ImplicitAPI):
|
|
1316
1316
|
if since is not None:
|
1317
1317
|
request['fromIdx'] = since
|
1318
1318
|
response = await self.spotV1PublicGetMarketKline(self.extend(request, params))
|
1319
|
-
data = self.
|
1319
|
+
data = self.safe_list(response, 'data', [])
|
1320
1320
|
else:
|
1321
1321
|
raise NotSupported(self.id + ' fetchOHLCV only support spot & swap markets')
|
1322
1322
|
#
|
@@ -1523,7 +1523,7 @@ class bitrue(Exchange, ImplicitAPI):
|
|
1523
1523
|
# https://github.com/ccxt/ccxt/issues/13856
|
1524
1524
|
tickers: dict = {}
|
1525
1525
|
for i in range(0, len(data)):
|
1526
|
-
ticker = self.
|
1526
|
+
ticker = self.safe_dict(data, i, {})
|
1527
1527
|
market = self.market(self.safe_value(ticker, 'symbol'))
|
1528
1528
|
tickers[market['id']] = ticker
|
1529
1529
|
return self.parse_tickers(tickers, symbols)
|
@@ -1585,8 +1585,8 @@ class bitrue(Exchange, ImplicitAPI):
|
|
1585
1585
|
orderId = self.safe_string(trade, 'orderId')
|
1586
1586
|
id = self.safe_string_2(trade, 'id', 'tradeId')
|
1587
1587
|
side = None
|
1588
|
-
buyerMaker = self.
|
1589
|
-
isBuyer = self.
|
1588
|
+
buyerMaker = self.safe_bool(trade, 'isBuyerMaker') # ignore "m" until Bitrue fixes api
|
1589
|
+
isBuyer = self.safe_bool(trade, 'isBuyer')
|
1590
1590
|
if buyerMaker is not None:
|
1591
1591
|
side = 'sell' if buyerMaker else 'buy'
|
1592
1592
|
if isBuyer is not None:
|
@@ -1598,7 +1598,7 @@ class bitrue(Exchange, ImplicitAPI):
|
|
1598
1598
|
'currency': self.safe_currency_code(self.safe_string(trade, 'commissionAssert')),
|
1599
1599
|
}
|
1600
1600
|
takerOrMaker = None
|
1601
|
-
isMaker = self.
|
1601
|
+
isMaker = self.safe_bool(trade, 'isMaker')
|
1602
1602
|
if isMaker is not None:
|
1603
1603
|
takerOrMaker = 'maker' if isMaker else 'taker'
|
1604
1604
|
return self.safe_trade({
|
@@ -1751,7 +1751,7 @@ class bitrue(Exchange, ImplicitAPI):
|
|
1751
1751
|
id = self.safe_string(order, 'orderId')
|
1752
1752
|
type = self.safe_string_lower(order, 'type')
|
1753
1753
|
side = self.safe_string_lower(order, 'side')
|
1754
|
-
fills = self.
|
1754
|
+
fills = self.safe_list(order, 'fills', [])
|
1755
1755
|
clientOrderId = self.safe_string(order, 'clientOrderId')
|
1756
1756
|
timeInForce = self.safe_string(order, 'timeInForce')
|
1757
1757
|
postOnly = (type == 'limit_maker') or (timeInForce == 'GTX') or (type == 'post_only')
|
@@ -1881,7 +1881,7 @@ class bitrue(Exchange, ImplicitAPI):
|
|
1881
1881
|
response = await self.fapiV2PrivatePostOrder(self.extend(request, params))
|
1882
1882
|
elif market['inverse']:
|
1883
1883
|
response = await self.dapiV2PrivatePostOrder(self.extend(request, params))
|
1884
|
-
data = self.
|
1884
|
+
data = self.safe_dict(response, 'data', {})
|
1885
1885
|
elif market['spot']:
|
1886
1886
|
request['symbol'] = market['id']
|
1887
1887
|
request['quantity'] = self.amount_to_precision(symbol, amount)
|
@@ -1956,7 +1956,7 @@ class bitrue(Exchange, ImplicitAPI):
|
|
1956
1956
|
response = await self.fapiV2PrivateGetOrder(self.extend(request, params))
|
1957
1957
|
elif market['inverse']:
|
1958
1958
|
response = await self.dapiV2PrivateGetOrder(self.extend(request, params))
|
1959
|
-
data = self.
|
1959
|
+
data = self.safe_dict(response, 'data', {})
|
1960
1960
|
elif market['spot']:
|
1961
1961
|
request['orderId'] = id # spot market id is mandatory
|
1962
1962
|
request['symbol'] = market['id']
|
@@ -2086,7 +2086,7 @@ class bitrue(Exchange, ImplicitAPI):
|
|
2086
2086
|
response = await self.fapiV2PrivateGetOpenOrders(self.extend(request, params))
|
2087
2087
|
elif market['inverse']:
|
2088
2088
|
response = await self.dapiV2PrivateGetOpenOrders(self.extend(request, params))
|
2089
|
-
data = self.
|
2089
|
+
data = self.safe_list(response, 'data', [])
|
2090
2090
|
elif market['spot']:
|
2091
2091
|
request['symbol'] = market['id']
|
2092
2092
|
response = await self.spotV1PrivateGetOpenOrders(self.extend(request, params))
|
@@ -2174,7 +2174,7 @@ class bitrue(Exchange, ImplicitAPI):
|
|
2174
2174
|
response = await self.fapiV2PrivatePostCancel(self.extend(request, params))
|
2175
2175
|
elif market['inverse']:
|
2176
2176
|
response = await self.dapiV2PrivatePostCancel(self.extend(request, params))
|
2177
|
-
data = self.
|
2177
|
+
data = self.safe_dict(response, 'data', {})
|
2178
2178
|
elif market['spot']:
|
2179
2179
|
request['symbol'] = market['id']
|
2180
2180
|
response = await self.spotV1PrivateDeleteOrder(self.extend(request, params))
|
@@ -2225,7 +2225,7 @@ class bitrue(Exchange, ImplicitAPI):
|
|
2225
2225
|
response = await self.fapiV2PrivatePostAllOpenOrders(self.extend(request, params))
|
2226
2226
|
elif market['inverse']:
|
2227
2227
|
response = await self.dapiV2PrivatePostAllOpenOrders(self.extend(request, params))
|
2228
|
-
data = self.
|
2228
|
+
data = self.safe_list(response, 'data', [])
|
2229
2229
|
else:
|
2230
2230
|
raise NotSupported(self.id + ' cancelAllOrders only support future markets')
|
2231
2231
|
#
|
@@ -2270,7 +2270,7 @@ class bitrue(Exchange, ImplicitAPI):
|
|
2270
2270
|
response = await self.fapiV2PrivateGetMyTrades(self.extend(request, params))
|
2271
2271
|
elif market['inverse']:
|
2272
2272
|
response = await self.dapiV2PrivateGetMyTrades(self.extend(request, params))
|
2273
|
-
data = self.
|
2273
|
+
data = self.safe_list(response, 'data', [])
|
2274
2274
|
elif market['spot']:
|
2275
2275
|
request['symbol'] = market['id']
|
2276
2276
|
response = await self.spotV2PrivateGetMyTrades(self.extend(request, params))
|
@@ -2457,7 +2457,7 @@ class bitrue(Exchange, ImplicitAPI):
|
|
2457
2457
|
'6': 'canceled',
|
2458
2458
|
},
|
2459
2459
|
}
|
2460
|
-
statuses = self.
|
2460
|
+
statuses = self.safe_dict(statusesByType, type, {})
|
2461
2461
|
return self.safe_string(statuses, status, status)
|
2462
2462
|
|
2463
2463
|
def parse_transaction(self, transaction: dict, currency: Currency = None) -> Transaction:
|
@@ -2580,7 +2580,7 @@ class bitrue(Exchange, ImplicitAPI):
|
|
2580
2580
|
'fee': fee,
|
2581
2581
|
}
|
2582
2582
|
|
2583
|
-
async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}):
|
2583
|
+
async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
|
2584
2584
|
"""
|
2585
2585
|
make a withdrawal
|
2586
2586
|
:see: https://github.com/Bitrue-exchange/Spot-official-api-docs#withdraw-commit--withdraw_data
|
@@ -2638,7 +2638,7 @@ class bitrue(Exchange, ImplicitAPI):
|
|
2638
2638
|
# "chainDetail": [[Object]]
|
2639
2639
|
# }
|
2640
2640
|
#
|
2641
|
-
chainDetails = self.
|
2641
|
+
chainDetails = self.safe_list(fee, 'chainDetail', [])
|
2642
2642
|
chainDetailLength = len(chainDetails)
|
2643
2643
|
result: dict = {
|
2644
2644
|
'info': fee,
|
@@ -2779,7 +2779,7 @@ class bitrue(Exchange, ImplicitAPI):
|
|
2779
2779
|
"""
|
2780
2780
|
await self.load_markets()
|
2781
2781
|
currency = self.currency(code)
|
2782
|
-
accountTypes = self.
|
2782
|
+
accountTypes = self.safe_dict(self.options, 'accountsByType', {})
|
2783
2783
|
fromId = self.safe_string(accountTypes, fromAccount, fromAccount)
|
2784
2784
|
toId = self.safe_string(accountTypes, toAccount, toAccount)
|
2785
2785
|
request: dict = {
|
ccxt/async_support/bitso.py
CHANGED
@@ -1500,7 +1500,7 @@ class bitso(Exchange, ImplicitAPI):
|
|
1500
1500
|
result[code]['info'][code] = withdrawFee
|
1501
1501
|
return result
|
1502
1502
|
|
1503
|
-
async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}):
|
1503
|
+
async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
|
1504
1504
|
"""
|
1505
1505
|
make a withdrawal
|
1506
1506
|
:param str code: unified currency code
|
ccxt/async_support/bitstamp.py
CHANGED
@@ -2009,7 +2009,7 @@ class bitstamp(Exchange, ImplicitAPI):
|
|
2009
2009
|
'tag': tag,
|
2010
2010
|
}
|
2011
2011
|
|
2012
|
-
async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}):
|
2012
|
+
async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
|
2013
2013
|
"""
|
2014
2014
|
make a withdrawal
|
2015
2015
|
:see: https://www.bitstamp.net/api/#tag/Withdrawals/operation/RequestFiatWithdrawal
|
ccxt/async_support/bitvavo.py
CHANGED
@@ -1081,6 +1081,9 @@ class bitvavo(Exchange, ImplicitAPI):
|
|
1081
1081
|
request['timeInForce'] = timeInForce
|
1082
1082
|
if postOnly:
|
1083
1083
|
request['postOnly'] = True
|
1084
|
+
clientOrderId = self.safe_string(params, 'clientOrderId')
|
1085
|
+
if clientOrderId is None:
|
1086
|
+
request['clientOrderId'] = self.uuid22()
|
1084
1087
|
return self.extend(request, params)
|
1085
1088
|
|
1086
1089
|
async def create_order(self, symbol: Str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
|
@@ -1631,7 +1634,7 @@ class bitvavo(Exchange, ImplicitAPI):
|
|
1631
1634
|
request['paymentId'] = tag
|
1632
1635
|
return self.extend(request, params)
|
1633
1636
|
|
1634
|
-
async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}):
|
1637
|
+
async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
|
1635
1638
|
"""
|
1636
1639
|
make a withdrawal
|
1637
1640
|
:param str code: unified currency code
|
@@ -880,7 +880,7 @@ class blockchaincom(Exchange, ImplicitAPI):
|
|
880
880
|
'fee': fee,
|
881
881
|
}
|
882
882
|
|
883
|
-
async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}):
|
883
|
+
async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
|
884
884
|
"""
|
885
885
|
make a withdrawal
|
886
886
|
:see: https://api.blockchain.com/v3/#createwithdrawal
|
ccxt/async_support/btcmarkets.py
CHANGED
@@ -1131,7 +1131,7 @@ class btcmarkets(Exchange, ImplicitAPI):
|
|
1131
1131
|
#
|
1132
1132
|
return self.parse_trades(response, market, since, limit)
|
1133
1133
|
|
1134
|
-
async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}):
|
1134
|
+
async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
|
1135
1135
|
"""
|
1136
1136
|
make a withdrawal
|
1137
1137
|
:see: https://docs.btcmarkets.net/v3/#tag/Fund-Management-APIs/paths/~1v3~1withdrawals/post
|