ccxt 4.2.29__py2.py3-none-any.whl → 4.2.31__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/bybit.py +2 -2
- ccxt/abstract/coinbase.py +10 -0
- ccxt/abstract/okx.py +12 -1
- ccxt/ascendex.py +5 -5
- ccxt/async_support/__init__.py +3 -3
- ccxt/async_support/ascendex.py +5 -5
- ccxt/async_support/base/exchange.py +3 -3
- ccxt/async_support/bigone.py +2 -2
- ccxt/async_support/binance.py +892 -218
- ccxt/async_support/bingx.py +1 -1
- ccxt/async_support/bitfinex.py +1 -1
- ccxt/async_support/bitfinex2.py +421 -86
- ccxt/async_support/bitforex.py +3 -0
- ccxt/async_support/bitget.py +8 -4
- ccxt/async_support/bitmart.py +3 -3
- ccxt/async_support/bitmex.py +4 -4
- ccxt/async_support/bitrue.py +1 -1
- ccxt/async_support/bitso.py +1 -1
- ccxt/async_support/bitteam.py +2 -2
- ccxt/async_support/btcalpha.py +1 -1
- ccxt/async_support/bybit.py +3 -3
- ccxt/async_support/coinbase.py +20 -5
- ccxt/async_support/coincheck.py +1 -1
- ccxt/async_support/coinex.py +2 -2
- ccxt/async_support/coinlist.py +1 -1
- ccxt/async_support/coinmate.py +1 -1
- ccxt/async_support/coinmetro.py +2 -2
- ccxt/async_support/coinsph.py +1 -1
- ccxt/async_support/cryptocom.py +3 -3
- ccxt/async_support/deribit.py +1 -0
- ccxt/async_support/digifinex.py +6 -4
- ccxt/async_support/exmo.py +2 -2
- ccxt/async_support/gate.py +5 -5
- ccxt/async_support/gemini.py +3 -3
- ccxt/async_support/hitbtc.py +13 -17
- ccxt/async_support/hollaex.py +2 -2
- ccxt/async_support/htx.py +6 -6
- ccxt/async_support/huobijp.py +1 -1
- ccxt/async_support/kraken.py +3 -1
- ccxt/async_support/krakenfutures.py +4 -1
- ccxt/async_support/kucoin.py +17 -17
- ccxt/async_support/kucoinfutures.py +3 -3
- ccxt/async_support/lbank.py +4 -3
- ccxt/async_support/mexc.py +7 -7
- ccxt/async_support/novadax.py +1 -1
- ccxt/async_support/okcoin.py +2 -2
- ccxt/async_support/okx.py +22 -8
- ccxt/async_support/p2b.py +1 -0
- ccxt/async_support/phemex.py +3 -3
- ccxt/async_support/poloniexfutures.py +6 -3
- ccxt/async_support/probit.py +1 -1
- ccxt/async_support/timex.py +2 -2
- ccxt/async_support/tokocrypto.py +3 -3
- ccxt/async_support/wavesexchange.py +2 -2
- ccxt/async_support/whitebit.py +3 -3
- ccxt/async_support/woo.py +3 -3
- ccxt/async_support/yobit.py +1 -1
- ccxt/async_support/zaif.py +1 -1
- ccxt/async_support/zonda.py +3 -3
- ccxt/base/errors.py +13 -12
- ccxt/base/exchange.py +36 -26
- ccxt/bigone.py +2 -2
- ccxt/binance.py +892 -218
- ccxt/bingx.py +1 -1
- ccxt/bitfinex.py +1 -1
- ccxt/bitfinex2.py +421 -86
- ccxt/bitforex.py +3 -0
- ccxt/bitget.py +8 -4
- ccxt/bitmart.py +3 -3
- ccxt/bitmex.py +4 -4
- ccxt/bitrue.py +1 -1
- ccxt/bitso.py +1 -1
- ccxt/bitteam.py +2 -2
- ccxt/btcalpha.py +1 -1
- ccxt/bybit.py +3 -3
- ccxt/coinbase.py +20 -5
- ccxt/coincheck.py +1 -1
- ccxt/coinex.py +2 -2
- ccxt/coinlist.py +1 -1
- ccxt/coinmate.py +1 -1
- ccxt/coinmetro.py +2 -2
- ccxt/coinsph.py +1 -1
- ccxt/cryptocom.py +3 -3
- ccxt/deribit.py +1 -0
- ccxt/digifinex.py +6 -4
- ccxt/exmo.py +2 -2
- ccxt/gate.py +5 -5
- ccxt/gemini.py +3 -3
- ccxt/hitbtc.py +13 -17
- ccxt/hollaex.py +2 -2
- ccxt/htx.py +6 -6
- ccxt/huobijp.py +1 -1
- ccxt/kraken.py +3 -1
- ccxt/krakenfutures.py +4 -1
- ccxt/kucoin.py +17 -17
- ccxt/kucoinfutures.py +3 -3
- ccxt/lbank.py +4 -3
- ccxt/mexc.py +7 -7
- ccxt/novadax.py +1 -1
- ccxt/okcoin.py +2 -2
- ccxt/okx.py +22 -8
- ccxt/p2b.py +1 -0
- ccxt/phemex.py +3 -3
- ccxt/poloniexfutures.py +6 -3
- ccxt/pro/__init__.py +3 -1
- ccxt/pro/alpaca.py +1 -1
- ccxt/pro/binance.py +4 -4
- ccxt/pro/bitget.py +1 -1
- ccxt/pro/bitmart.py +1 -1
- ccxt/pro/bitmex.py +43 -7
- ccxt/pro/bitvavo.py +1 -1
- ccxt/pro/bybit.py +2 -2
- ccxt/pro/cex.py +2 -2
- ccxt/pro/independentreserve.py +1 -1
- ccxt/pro/okx.py +1 -1
- ccxt/pro/onetrading.py +2 -2
- ccxt/pro/p2b.py +407 -0
- ccxt/pro/probit.py +5 -5
- ccxt/pro/whitebit.py +1 -1
- ccxt/probit.py +1 -1
- ccxt/timex.py +2 -2
- ccxt/tokocrypto.py +3 -3
- ccxt/wavesexchange.py +2 -2
- ccxt/whitebit.py +3 -3
- ccxt/woo.py +3 -3
- ccxt/yobit.py +1 -1
- ccxt/zaif.py +1 -1
- ccxt/zonda.py +3 -3
- {ccxt-4.2.29.dist-info → ccxt-4.2.31.dist-info}/METADATA +6 -7
- {ccxt-4.2.29.dist-info → ccxt-4.2.31.dist-info}/RECORD +133 -132
- {ccxt-4.2.29.dist-info → ccxt-4.2.31.dist-info}/WHEEL +0 -0
- {ccxt-4.2.29.dist-info → ccxt-4.2.31.dist-info}/top_level.txt +0 -0
ccxt/async_support/bitforex.py
CHANGED
@@ -51,6 +51,9 @@ class bitforex(Exchange, ImplicitAPI):
|
|
51
51
|
'fetchClosedOrders': True,
|
52
52
|
'fetchCrossBorrowRate': False,
|
53
53
|
'fetchCrossBorrowRates': False,
|
54
|
+
'fetchDepositAddress': False,
|
55
|
+
'fetchDepositAddresses': False,
|
56
|
+
'fetchDepositAddressesByNetwork': False,
|
54
57
|
'fetchFundingHistory': False,
|
55
58
|
'fetchFundingRate': False,
|
56
59
|
'fetchFundingRateHistory': False,
|
ccxt/async_support/bitget.py
CHANGED
@@ -88,6 +88,7 @@ class bitget(Exchange, ImplicitAPI):
|
|
88
88
|
'fetchCrossBorrowRate': True,
|
89
89
|
'fetchCrossBorrowRates': False,
|
90
90
|
'fetchCurrencies': True,
|
91
|
+
'fetchDeposit': False,
|
91
92
|
'fetchDepositAddress': True,
|
92
93
|
'fetchDepositAddresses': False,
|
93
94
|
'fetchDeposits': True,
|
@@ -117,6 +118,7 @@ class bitget(Exchange, ImplicitAPI):
|
|
117
118
|
'fetchOpenOrders': True,
|
118
119
|
'fetchOrder': True,
|
119
120
|
'fetchOrderBook': True,
|
121
|
+
'fetchOrderBooks': False,
|
120
122
|
'fetchOrders': False,
|
121
123
|
'fetchOrderTrades': False,
|
122
124
|
'fetchPosition': True,
|
@@ -124,6 +126,7 @@ class bitget(Exchange, ImplicitAPI):
|
|
124
126
|
'fetchPositions': True,
|
125
127
|
'fetchPositionsRisk': False,
|
126
128
|
'fetchPremiumIndexOHLCV': False,
|
129
|
+
'fetchStatus': False,
|
127
130
|
'fetchTicker': True,
|
128
131
|
'fetchTickers': True,
|
129
132
|
'fetchTime': True,
|
@@ -140,6 +143,7 @@ class bitget(Exchange, ImplicitAPI):
|
|
140
143
|
'repayCrossMargin': True,
|
141
144
|
'repayIsolatedMargin': True,
|
142
145
|
'setLeverage': True,
|
146
|
+
'setMargin': False,
|
143
147
|
'setMarginMode': True,
|
144
148
|
'setPositionMode': True,
|
145
149
|
'signIn': False,
|
@@ -2189,7 +2193,7 @@ class bitget(Exchange, ImplicitAPI):
|
|
2189
2193
|
'fee': None,
|
2190
2194
|
}
|
2191
2195
|
withdrawOptions = self.safe_value(self.options, 'withdraw', {})
|
2192
|
-
fillResponseFromRequest = self.
|
2196
|
+
fillResponseFromRequest = self.safe_bool(withdrawOptions, 'fillResponseFromRequest', True)
|
2193
2197
|
if fillResponseFromRequest:
|
2194
2198
|
result['currency'] = code
|
2195
2199
|
result['timestamp'] = self.milliseconds()
|
@@ -3016,7 +3020,7 @@ class bitget(Exchange, ImplicitAPI):
|
|
3016
3020
|
marginMode, params = self.handle_margin_mode_and_params('fetchTradingFees', params)
|
3017
3021
|
marketType, params = self.handle_market_type_and_params('fetchTradingFees', None, params)
|
3018
3022
|
if marketType == 'spot':
|
3019
|
-
margin = self.
|
3023
|
+
margin = self.safe_bool(params, 'margin', False)
|
3020
3024
|
params = self.omit(params, 'margin')
|
3021
3025
|
if (marginMode is not None) or margin:
|
3022
3026
|
response = await self.publicMarginGetV2MarginCurrencies(params)
|
@@ -3967,7 +3971,7 @@ class bitget(Exchange, ImplicitAPI):
|
|
3967
3971
|
if type == 'limit':
|
3968
3972
|
request['price'] = self.price_to_precision(symbol, price)
|
3969
3973
|
triggerType = self.safe_string(params, 'triggerType', 'mark_price')
|
3970
|
-
reduceOnly = self.
|
3974
|
+
reduceOnly = self.safe_bool(params, 'reduceOnly', False)
|
3971
3975
|
clientOrderId = self.safe_string_2(params, 'clientOid', 'clientOrderId')
|
3972
3976
|
exchangeSpecificTifParam = self.safe_string_2(params, 'force', 'timeInForce')
|
3973
3977
|
postOnly = None
|
@@ -4042,7 +4046,7 @@ class bitget(Exchange, ImplicitAPI):
|
|
4042
4046
|
marginMode = 'cross'
|
4043
4047
|
marginModeRequest = 'crossed' if (marginMode == 'cross') else 'isolated'
|
4044
4048
|
request['marginMode'] = marginModeRequest
|
4045
|
-
oneWayMode = self.
|
4049
|
+
oneWayMode = self.safe_bool(params, 'oneWayMode', False)
|
4046
4050
|
params = self.omit(params, 'oneWayMode')
|
4047
4051
|
requestSide = side
|
4048
4052
|
if reduceOnly:
|
ccxt/async_support/bitmart.py
CHANGED
@@ -1864,7 +1864,7 @@ class bitmart(Exchange, ImplicitAPI):
|
|
1864
1864
|
marketType = None
|
1865
1865
|
marketType, params = self.handle_market_type_and_params('fetchBalance', None, params)
|
1866
1866
|
marginMode = self.safe_string(params, 'marginMode')
|
1867
|
-
isMargin = self.
|
1867
|
+
isMargin = self.safe_bool(params, 'margin', False)
|
1868
1868
|
params = self.omit(params, ['margin', 'marginMode'])
|
1869
1869
|
if marginMode is not None or isMargin:
|
1870
1870
|
marketType = 'margin'
|
@@ -2643,7 +2643,7 @@ class bitmart(Exchange, ImplicitAPI):
|
|
2643
2643
|
if isStop:
|
2644
2644
|
response = await self.privateGetContractPrivateCurrentPlanOrder(self.extend(request, params))
|
2645
2645
|
else:
|
2646
|
-
trailing = self.
|
2646
|
+
trailing = self.safe_bool(params, 'trailing', False)
|
2647
2647
|
orderType = self.safe_string(params, 'orderType')
|
2648
2648
|
params = self.omit(params, ['orderType', 'trailing'])
|
2649
2649
|
if trailing:
|
@@ -2798,7 +2798,7 @@ class bitmart(Exchange, ImplicitAPI):
|
|
2798
2798
|
elif type == 'swap':
|
2799
2799
|
if symbol is None:
|
2800
2800
|
raise ArgumentsRequired(self.id + ' fetchOrder() requires a symbol argument')
|
2801
|
-
trailing = self.
|
2801
|
+
trailing = self.safe_bool(params, 'trailing', False)
|
2802
2802
|
orderType = self.safe_string(params, 'orderType')
|
2803
2803
|
params = self.omit(params, ['orderType', 'trailing'])
|
2804
2804
|
if trailing:
|
ccxt/async_support/bitmex.py
CHANGED
@@ -349,8 +349,8 @@ class bitmex(Exchange, ImplicitAPI):
|
|
349
349
|
network = self.network_id_to_code(networkId)
|
350
350
|
withdrawalFeeRaw = self.safe_string(chain, 'withdrawalFee')
|
351
351
|
withdrawalFee = self.parse_number(Precise.string_mul(withdrawalFeeRaw, precisionString))
|
352
|
-
isDepositEnabled = self.
|
353
|
-
isWithdrawEnabled = self.
|
352
|
+
isDepositEnabled = self.safe_bool(chain, 'depositEnabled', False)
|
353
|
+
isWithdrawEnabled = self.safe_bool(chain, 'withdrawalEnabled', False)
|
354
354
|
active = (isDepositEnabled and isWithdrawEnabled)
|
355
355
|
if isDepositEnabled:
|
356
356
|
depositEnabled = True
|
@@ -1637,7 +1637,7 @@ class bitmex(Exchange, ImplicitAPI):
|
|
1637
1637
|
defaultSubType = self.safe_string(self.options, 'defaultSubType', 'linear')
|
1638
1638
|
isInverse = (defaultSubType == 'inverse')
|
1639
1639
|
else:
|
1640
|
-
isInverse = self.
|
1640
|
+
isInverse = self.safe_bool(market, 'inverse', False)
|
1641
1641
|
if isInverse:
|
1642
1642
|
cost = self.convert_from_raw_quantity(symbol, qty)
|
1643
1643
|
else:
|
@@ -2277,7 +2277,7 @@ class bitmex(Exchange, ImplicitAPI):
|
|
2277
2277
|
item = response[i]
|
2278
2278
|
marketId = self.safe_string(item, 'symbol')
|
2279
2279
|
market = self.safe_market(marketId)
|
2280
|
-
swap = self.
|
2280
|
+
swap = self.safe_bool(market, 'swap', False)
|
2281
2281
|
if swap:
|
2282
2282
|
filteredResponse.append(item)
|
2283
2283
|
symbols = self.market_symbols(symbols)
|
ccxt/async_support/bitrue.py
CHANGED
@@ -2964,7 +2964,7 @@ class bitrue(Exchange, ImplicitAPI):
|
|
2964
2964
|
return None # fallback to default error handler
|
2965
2965
|
# check success value for wapi endpoints
|
2966
2966
|
# response in format {'msg': 'The coin does not exist.', 'success': True/false}
|
2967
|
-
success = self.
|
2967
|
+
success = self.safe_bool(response, 'success', True)
|
2968
2968
|
if not success:
|
2969
2969
|
messageInner = self.safe_string(response, 'msg')
|
2970
2970
|
parsedMessage = None
|
ccxt/async_support/bitso.py
CHANGED
@@ -1634,7 +1634,7 @@ class bitso(Exchange, ImplicitAPI):
|
|
1634
1634
|
#
|
1635
1635
|
# {"success":false,"error":{"code":104,"message":"Cannot perform request - nonce must be higher than 1520307203724237"}}
|
1636
1636
|
#
|
1637
|
-
success = self.
|
1637
|
+
success = self.safe_bool(response, 'success', False)
|
1638
1638
|
if isinstance(success, str):
|
1639
1639
|
if (success == 'true') or (success == '1'):
|
1640
1640
|
success = True
|
ccxt/async_support/bitteam.py
CHANGED
@@ -360,7 +360,7 @@ class bitteam(Exchange, ImplicitAPI):
|
|
360
360
|
created = self.parse8601(timeStart)
|
361
361
|
minCost = None
|
362
362
|
currenciesValuedInUsd = self.safe_value(self.options, 'currenciesValuedInUsd', {})
|
363
|
-
quoteInUsd = self.
|
363
|
+
quoteInUsd = self.safe_bool(currenciesValuedInUsd, quote, False)
|
364
364
|
if quoteInUsd:
|
365
365
|
settings = self.safe_value(market, 'settings', {})
|
366
366
|
minCost = self.safe_number(settings, 'limit_usd')
|
@@ -544,7 +544,7 @@ class bitteam(Exchange, ImplicitAPI):
|
|
544
544
|
id = self.safe_string(currency, 'symbol')
|
545
545
|
numericId = self.safe_integer(currency, 'id')
|
546
546
|
code = self.safe_currency_code(id)
|
547
|
-
active = self.
|
547
|
+
active = self.safe_bool(currency, 'active', False)
|
548
548
|
precision = self.safe_integer(currency, 'precision')
|
549
549
|
txLimits = self.safe_value(currency, 'txLimits', {})
|
550
550
|
minWithdraw = self.safe_string(txLimits, 'minWithdraw')
|
ccxt/async_support/btcalpha.py
CHANGED
@@ -655,7 +655,7 @@ class btcalpha(Exchange, ImplicitAPI):
|
|
655
655
|
marketId = self.safe_string(order, 'pair')
|
656
656
|
market = self.safe_market(marketId, market, '_')
|
657
657
|
symbol = market['symbol']
|
658
|
-
success = self.
|
658
|
+
success = self.safe_bool(order, 'success', False)
|
659
659
|
timestamp = None
|
660
660
|
if success:
|
661
661
|
timestamp = self.safe_timestamp(order, 'date')
|
ccxt/async_support/bybit.py
CHANGED
@@ -311,8 +311,6 @@ class bybit(Exchange, ImplicitAPI):
|
|
311
311
|
# account
|
312
312
|
'v5/account/wallet-balance': 1,
|
313
313
|
'v5/account/borrow-history': 1,
|
314
|
-
'v5/account/set-collateral-switch': 5,
|
315
|
-
'v5/account/set-collateral-switch-batch': 5,
|
316
314
|
'v5/account/collateral-info': 1,
|
317
315
|
'v5/asset/coin-greeks': 1,
|
318
316
|
'v5/account/fee-rate': 10, # 5/s = 1000 / (20 * 10)
|
@@ -505,6 +503,8 @@ class bybit(Exchange, ImplicitAPI):
|
|
505
503
|
'v5/lending/purchase': 5,
|
506
504
|
'v5/lending/redeem': 5,
|
507
505
|
'v5/lending/redeem-cancel': 5,
|
506
|
+
'v5/account/set-collateral-switch': 5,
|
507
|
+
'v5/account/set-collateral-switch-batch': 5,
|
508
508
|
},
|
509
509
|
},
|
510
510
|
},
|
@@ -3292,7 +3292,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
3292
3292
|
result = await self.fetch_orders(symbol, None, None, self.extend(request, params))
|
3293
3293
|
length = len(result)
|
3294
3294
|
if length == 0:
|
3295
|
-
isTrigger = self.
|
3295
|
+
isTrigger = self.safe_bool_n(params, ['trigger', 'stop'], False)
|
3296
3296
|
extra = '' if isTrigger else 'If you are trying to fetch SL/TP conditional order, you might try setting params["trigger"] = True'
|
3297
3297
|
raise OrderNotFound('Order ' + str(id) + ' was not found.' + extra)
|
3298
3298
|
if length > 1:
|
ccxt/async_support/coinbase.py
CHANGED
@@ -214,6 +214,13 @@ class coinbase(Exchange, ImplicitAPI):
|
|
214
214
|
'brokerage/best_bid_ask',
|
215
215
|
'brokerage/convert/trade/{trade_id}',
|
216
216
|
'brokerage/time',
|
217
|
+
'brokerage/cfm/balance_summary',
|
218
|
+
'brokerage/cfm/positions',
|
219
|
+
'brokerage/cfm/positions/{product_id}',
|
220
|
+
'brokerage/cfm/sweeps',
|
221
|
+
'brokerage/intx/portfolio/{portfolio_uuid}',
|
222
|
+
'brokerage/intx/positions/{portfolio_uuid}',
|
223
|
+
'brokerage/intx/positions/{portfolio_uuid}/{symbol}',
|
217
224
|
],
|
218
225
|
'post': [
|
219
226
|
'brokerage/orders',
|
@@ -224,12 +231,15 @@ class coinbase(Exchange, ImplicitAPI):
|
|
224
231
|
'brokerage/portfolios/move_funds',
|
225
232
|
'brokerage/convert/quote',
|
226
233
|
'brokerage/convert/trade/{trade_id}',
|
234
|
+
'brokerage/cfm/sweeps/schedule',
|
235
|
+
'brokerage/intx/allocate',
|
227
236
|
],
|
228
237
|
'put': [
|
229
238
|
'brokerage/portfolios/{portfolio_uuid}',
|
230
239
|
],
|
231
240
|
'delete': [
|
232
241
|
'brokerage/portfolios/{portfolio_uuid}',
|
242
|
+
'brokerage/cfm/sweeps',
|
233
243
|
],
|
234
244
|
},
|
235
245
|
},
|
@@ -1322,7 +1332,10 @@ class coinbase(Exchange, ImplicitAPI):
|
|
1322
1332
|
async def fetch_tickers_v3(self, symbols: Strings = None, params={}):
|
1323
1333
|
await self.load_markets()
|
1324
1334
|
symbols = self.market_symbols(symbols)
|
1325
|
-
|
1335
|
+
request = {}
|
1336
|
+
if symbols is not None:
|
1337
|
+
request['product_ids'] = self.market_ids(symbols)
|
1338
|
+
response = await self.v3PrivateGetBrokerageProducts(self.extend(request, params))
|
1326
1339
|
#
|
1327
1340
|
# {
|
1328
1341
|
# "products": [
|
@@ -1624,7 +1637,7 @@ class coinbase(Exchange, ImplicitAPI):
|
|
1624
1637
|
'limit': 250,
|
1625
1638
|
}
|
1626
1639
|
response = None
|
1627
|
-
isV3 = self.
|
1640
|
+
isV3 = self.safe_bool(params, 'v3', False)
|
1628
1641
|
params = self.omit(params, 'v3')
|
1629
1642
|
method = self.safe_string(self.options, 'fetchBalance', 'v3PrivateGetBrokerageAccounts')
|
1630
1643
|
if (isV3) or (method == 'v3PrivateGetBrokerageAccounts'):
|
@@ -3023,8 +3036,10 @@ class coinbase(Exchange, ImplicitAPI):
|
|
3023
3036
|
"""
|
3024
3037
|
await self.load_markets()
|
3025
3038
|
symbols = self.market_symbols(symbols)
|
3026
|
-
|
3027
|
-
|
3039
|
+
request = {}
|
3040
|
+
if symbols is not None:
|
3041
|
+
request['product_ids'] = self.market_ids(symbols)
|
3042
|
+
response = await self.v3PrivateGetBrokerageBestBidAsk(self.extend(request, params))
|
3028
3043
|
#
|
3029
3044
|
# {
|
3030
3045
|
# "pricebooks": [
|
@@ -3147,7 +3162,7 @@ class coinbase(Exchange, ImplicitAPI):
|
|
3147
3162
|
savedPath = fullPath
|
3148
3163
|
if method == 'GET':
|
3149
3164
|
if query:
|
3150
|
-
fullPath += '?' + self.
|
3165
|
+
fullPath += '?' + self.urlencode_with_array_repeat(query)
|
3151
3166
|
url = self.urls['api']['rest'] + fullPath
|
3152
3167
|
if signed:
|
3153
3168
|
authorization = self.safe_string(self.headers, 'Authorization')
|
ccxt/async_support/coincheck.py
CHANGED
@@ -784,7 +784,7 @@ class coincheck(Exchange, ImplicitAPI):
|
|
784
784
|
# {"success":false,"error":"disabled API Key"}'
|
785
785
|
# {"success":false,"error":"invalid authentication"}
|
786
786
|
#
|
787
|
-
success = self.
|
787
|
+
success = self.safe_bool(response, 'success', True)
|
788
788
|
if not success:
|
789
789
|
error = self.safe_string(response, 'error')
|
790
790
|
feedback = self.id + ' ' + self.json(response)
|
ccxt/async_support/coinex.py
CHANGED
@@ -3107,7 +3107,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
3107
3107
|
data = self.safe_value(response, 'data', {})
|
3108
3108
|
depositAddress = self.parse_deposit_address(data, currency)
|
3109
3109
|
options = self.safe_value(self.options, 'fetchDepositAddress', {})
|
3110
|
-
fillResponseFromRequest = self.
|
3110
|
+
fillResponseFromRequest = self.safe_bool(options, 'fillResponseFromRequest', True)
|
3111
3111
|
if fillResponseFromRequest:
|
3112
3112
|
depositAddress['network'] = self.safe_network_code(network, currency)
|
3113
3113
|
return depositAddress
|
@@ -4998,7 +4998,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
4998
4998
|
:returns Array: the marginMode in lowercase
|
4999
4999
|
"""
|
5000
5000
|
defaultType = self.safe_string(self.options, 'defaultType')
|
5001
|
-
isMargin = self.
|
5001
|
+
isMargin = self.safe_bool(params, 'margin', False)
|
5002
5002
|
marginMode = None
|
5003
5003
|
marginMode, params = super(coinex, self).handle_margin_mode_and_params(methodName, params, defaultValue)
|
5004
5004
|
if marginMode is None:
|
ccxt/async_support/coinlist.py
CHANGED
@@ -372,7 +372,7 @@ class coinlist(Exchange, ImplicitAPI):
|
|
372
372
|
currency = currencies[i]
|
373
373
|
id = self.safe_string(currency, 'asset')
|
374
374
|
code = self.safe_currency_code(id)
|
375
|
-
isTransferable = self.
|
375
|
+
isTransferable = self.safe_bool(currency, 'is_transferable', False)
|
376
376
|
withdrawEnabled = isTransferable
|
377
377
|
depositEnabled = isTransferable
|
378
378
|
active = isTransferable
|
ccxt/async_support/coinmate.py
CHANGED
@@ -530,7 +530,7 @@ class coinmate(Exchange, ImplicitAPI):
|
|
530
530
|
#
|
531
531
|
data = self.safe_value(response, 'data')
|
532
532
|
transaction = self.parse_transaction(data, currency)
|
533
|
-
fillResponseFromRequest = self.
|
533
|
+
fillResponseFromRequest = self.safe_bool(withdrawOptions, 'fillResponseFromRequest', True)
|
534
534
|
if fillResponseFromRequest:
|
535
535
|
transaction['amount'] = amount
|
536
536
|
transaction['currency'] = code
|
ccxt/async_support/coinmetro.py
CHANGED
@@ -380,7 +380,7 @@ class coinmetro(Exchange, ImplicitAPI):
|
|
380
380
|
quote = self.safe_currency_code(quoteId)
|
381
381
|
basePrecisionAndLimits = self.parse_market_precision_and_limits(baseId)
|
382
382
|
quotePrecisionAndLimits = self.parse_market_precision_and_limits(quoteId)
|
383
|
-
margin = self.
|
383
|
+
margin = self.safe_bool(market, 'margin', False)
|
384
384
|
tradingFees = self.safe_value(self.fees, 'trading', {})
|
385
385
|
return self.safe_market_structure({
|
386
386
|
'id': id,
|
@@ -1272,7 +1272,7 @@ class coinmetro(Exchange, ImplicitAPI):
|
|
1272
1272
|
}
|
1273
1273
|
marginMode = None
|
1274
1274
|
params, params = self.handle_margin_mode_and_params('cancelOrder', params)
|
1275
|
-
isMargin = self.
|
1275
|
+
isMargin = self.safe_bool(params, 'margin', False)
|
1276
1276
|
params = self.omit(params, 'margin')
|
1277
1277
|
response = None
|
1278
1278
|
if isMargin or (marginMode is not None):
|
ccxt/async_support/coinsph.py
CHANGED
@@ -1478,7 +1478,7 @@ class coinsph(Exchange, ImplicitAPI):
|
|
1478
1478
|
:returns dict: a `transaction structure <https://docs.ccxt.com/#/?id=transaction-structure>`
|
1479
1479
|
"""
|
1480
1480
|
options = self.safe_value(self.options, 'withdraw')
|
1481
|
-
warning = self.
|
1481
|
+
warning = self.safe_bool(options, 'warning', True)
|
1482
1482
|
if warning:
|
1483
1483
|
raise InvalidAddress(self.id + " withdraw() makes a withdrawals only to coins_ph account, add .options['withdraw']['warning'] = False to make a withdrawal to your coins_ph account")
|
1484
1484
|
networkCode = self.safe_string(params, 'network')
|
ccxt/async_support/cryptocom.py
CHANGED
@@ -1018,7 +1018,7 @@ class cryptocom(Exchange, ImplicitAPI):
|
|
1018
1018
|
request['time_in_force'] = 'FILL_OR_KILL'
|
1019
1019
|
else:
|
1020
1020
|
request['time_in_force'] = timeInForce
|
1021
|
-
postOnly = self.
|
1021
|
+
postOnly = self.safe_bool(params, 'postOnly', False)
|
1022
1022
|
if (postOnly) or (timeInForce == 'PO'):
|
1023
1023
|
request['exec_inst'] = ['POST_ONLY']
|
1024
1024
|
request['time_in_force'] = 'GOOD_TILL_CANCEL'
|
@@ -1204,7 +1204,7 @@ class cryptocom(Exchange, ImplicitAPI):
|
|
1204
1204
|
request['time_in_force'] = 'FILL_OR_KILL'
|
1205
1205
|
else:
|
1206
1206
|
request['time_in_force'] = timeInForce
|
1207
|
-
postOnly = self.
|
1207
|
+
postOnly = self.safe_bool(params, 'postOnly', False)
|
1208
1208
|
if (postOnly) or (timeInForce == 'PO'):
|
1209
1209
|
request['exec_inst'] = ['POST_ONLY']
|
1210
1210
|
request['time_in_force'] = 'GOOD_TILL_CANCEL'
|
@@ -2091,7 +2091,7 @@ class cryptocom(Exchange, ImplicitAPI):
|
|
2091
2091
|
:returns Array: the marginMode in lowercase
|
2092
2092
|
"""
|
2093
2093
|
defaultType = self.safe_string(self.options, 'defaultType')
|
2094
|
-
isMargin = self.
|
2094
|
+
isMargin = self.safe_bool(params, 'margin', False)
|
2095
2095
|
params = self.omit(params, 'margin')
|
2096
2096
|
marginMode = None
|
2097
2097
|
marginMode, params = self.handle_margin_mode_and_params(methodName, params)
|
ccxt/async_support/deribit.py
CHANGED
@@ -1301,6 +1301,7 @@ class deribit(Exchange, ImplicitAPI):
|
|
1301
1301
|
request['start_timestamp'] = now - (limit - 1) * duration * 1000
|
1302
1302
|
request['end_timestamp'] = now
|
1303
1303
|
else:
|
1304
|
+
since = max(since - 1, 0)
|
1304
1305
|
request['start_timestamp'] = since
|
1305
1306
|
if limit is None:
|
1306
1307
|
request['end_timestamp'] = now
|
ccxt/async_support/digifinex.py
CHANGED
@@ -1133,9 +1133,11 @@ class digifinex(Exchange, ImplicitAPI):
|
|
1133
1133
|
# "timestamp": 1663221614998
|
1134
1134
|
# }
|
1135
1135
|
#
|
1136
|
+
indexPrice = self.safe_number(ticker, 'index_price')
|
1137
|
+
marketType = 'contract' if (indexPrice is not None) else 'spot'
|
1136
1138
|
marketId = self.safe_string_upper_2(ticker, 'symbol', 'instrument_id')
|
1137
|
-
symbol = self.safe_symbol(marketId, market)
|
1138
|
-
market = self.safe_market(marketId)
|
1139
|
+
symbol = self.safe_symbol(marketId, market, None, marketType)
|
1140
|
+
market = self.safe_market(marketId, market, None, marketType)
|
1139
1141
|
timestamp = self.safe_timestamp(ticker, 'date')
|
1140
1142
|
if market['swap']:
|
1141
1143
|
timestamp = self.safe_integer(ticker, 'timestamp')
|
@@ -1662,7 +1664,7 @@ class digifinex(Exchange, ImplicitAPI):
|
|
1662
1664
|
postOnly = self.is_post_only(isMarketOrder, False, params)
|
1663
1665
|
postOnlyParsed = None
|
1664
1666
|
if swap:
|
1665
|
-
reduceOnly = self.
|
1667
|
+
reduceOnly = self.safe_bool(params, 'reduceOnly', False)
|
1666
1668
|
timeInForce = self.safe_string(params, 'timeInForce')
|
1667
1669
|
orderType = None
|
1668
1670
|
if side == 'buy':
|
@@ -3654,7 +3656,7 @@ class digifinex(Exchange, ImplicitAPI):
|
|
3654
3656
|
:returns Array: the marginMode in lowercase
|
3655
3657
|
"""
|
3656
3658
|
defaultType = self.safe_string(self.options, 'defaultType')
|
3657
|
-
isMargin = self.
|
3659
|
+
isMargin = self.safe_bool(params, 'margin', False)
|
3658
3660
|
marginMode = None
|
3659
3661
|
marginMode, params = super(digifinex, self).handle_margin_mode_and_params(methodName, params, defaultValue)
|
3660
3662
|
if marginMode is not None:
|
ccxt/async_support/exmo.py
CHANGED
@@ -259,7 +259,7 @@ class exmo(Exchange, ImplicitAPI):
|
|
259
259
|
#
|
260
260
|
margin = self.parse_margin_modification(response, market)
|
261
261
|
options = self.safe_value(self.options, 'margin', {})
|
262
|
-
fillResponseFromRequest = self.
|
262
|
+
fillResponseFromRequest = self.safe_bool(options, 'fillResponseFromRequest', True)
|
263
263
|
if fillResponseFromRequest:
|
264
264
|
margin['type'] = type
|
265
265
|
margin['amount'] = amount
|
@@ -2412,7 +2412,7 @@ class exmo(Exchange, ImplicitAPI):
|
|
2412
2412
|
# {"result":false,"error":"Error 50052: Insufficient funds"}
|
2413
2413
|
# {"s":"error","errmsg":"strconv.ParseInt: parsing \"\": invalid syntax"}
|
2414
2414
|
#
|
2415
|
-
success = self.
|
2415
|
+
success = self.safe_bool(response, 'result', False)
|
2416
2416
|
if isinstance(success, str):
|
2417
2417
|
if (success == 'true') or (success == '1'):
|
2418
2418
|
success = True
|
ccxt/async_support/gate.py
CHANGED
@@ -1563,9 +1563,9 @@ class gate(Exchange, ImplicitAPI):
|
|
1563
1563
|
networkId = self.safe_string(entry, 'chain')
|
1564
1564
|
networkCode = self.network_id_to_code(networkId, code)
|
1565
1565
|
delisted = self.safe_value(entry, 'delisted')
|
1566
|
-
withdrawDisabled = self.
|
1567
|
-
depositDisabled = self.
|
1568
|
-
tradeDisabled = self.
|
1566
|
+
withdrawDisabled = self.safe_bool(entry, 'withdraw_disabled', False)
|
1567
|
+
depositDisabled = self.safe_bool(entry, 'deposit_disabled', False)
|
1568
|
+
tradeDisabled = self.safe_bool(entry, 'trade_disabled', False)
|
1569
1569
|
withdrawEnabled = not withdrawDisabled
|
1570
1570
|
depositEnabled = not depositDisabled
|
1571
1571
|
tradeEnabled = not tradeDisabled
|
@@ -3806,7 +3806,7 @@ class gate(Exchange, ImplicitAPI):
|
|
3806
3806
|
if timeInForce is not None:
|
3807
3807
|
request['time_in_force'] = timeInForce
|
3808
3808
|
clientOrderId = self.safe_string_2(params, 'text', 'clientOrderId')
|
3809
|
-
textIsRequired = self.
|
3809
|
+
textIsRequired = self.safe_bool(params, 'textIsRequired', False)
|
3810
3810
|
if clientOrderId is not None:
|
3811
3811
|
# user-defined, must follow the rules if not empty
|
3812
3812
|
# prefixed with t-
|
@@ -4147,7 +4147,7 @@ class gate(Exchange, ImplicitAPI):
|
|
4147
4147
|
# "message": "Not enough balance"
|
4148
4148
|
# }
|
4149
4149
|
#
|
4150
|
-
succeeded = self.
|
4150
|
+
succeeded = self.safe_bool(order, 'succeeded', True)
|
4151
4151
|
if not succeeded:
|
4152
4152
|
# cancelOrders response
|
4153
4153
|
return self.safe_order({
|
ccxt/async_support/gemini.py
CHANGED
@@ -513,7 +513,7 @@ class gemini(Exchange, ImplicitAPI):
|
|
513
513
|
'post_only': True,
|
514
514
|
'limit_only': True,
|
515
515
|
}
|
516
|
-
return self.
|
516
|
+
return self.safe_bool(statuses, status, True)
|
517
517
|
|
518
518
|
async def fetch_usdt_markets(self, params={}):
|
519
519
|
# these markets can't be scrapped and fetchMarketsFrom api does an extra call
|
@@ -549,7 +549,7 @@ class gemini(Exchange, ImplicitAPI):
|
|
549
549
|
}
|
550
550
|
result[marketId] = self.parse_market(market)
|
551
551
|
options = self.safe_value(self.options, 'fetchMarketsFromAPI', {})
|
552
|
-
fetchDetailsForAllSymbols = self.
|
552
|
+
fetchDetailsForAllSymbols = self.safe_bool(options, 'fetchDetailsForAllSymbols', False)
|
553
553
|
fetchDetailsForMarketIds = self.safe_value(options, 'fetchDetailsForMarketIds', [])
|
554
554
|
promises = []
|
555
555
|
marketIds = []
|
@@ -1314,7 +1314,7 @@ class gemini(Exchange, ImplicitAPI):
|
|
1314
1314
|
request['options'] = ['fill-or-kill']
|
1315
1315
|
elif timeInForce == 'PO':
|
1316
1316
|
request['options'] = ['maker-or-cancel']
|
1317
|
-
postOnly = self.
|
1317
|
+
postOnly = self.safe_bool(params, 'postOnly', False)
|
1318
1318
|
params = self.omit(params, 'postOnly')
|
1319
1319
|
if postOnly:
|
1320
1320
|
request['options'] = ['maker-or-cancel']
|
ccxt/async_support/hitbtc.py
CHANGED
@@ -704,7 +704,7 @@ class hitbtc(Exchange, ImplicitAPI):
|
|
704
704
|
expiry = self.safe_integer(market, 'expiry')
|
705
705
|
contract = (marketType == 'futures')
|
706
706
|
spot = (marketType == 'spot')
|
707
|
-
marginTrading = self.
|
707
|
+
marginTrading = self.safe_bool(market, 'margin_trading', False)
|
708
708
|
margin = spot and marginTrading
|
709
709
|
future = (expiry is not None)
|
710
710
|
swap = (contract and not future)
|
@@ -833,9 +833,9 @@ class hitbtc(Exchange, ImplicitAPI):
|
|
833
833
|
entry = response[currencyId]
|
834
834
|
name = self.safe_string(entry, 'full_name')
|
835
835
|
precision = self.safe_number(entry, 'precision_transfer')
|
836
|
-
payinEnabled = self.
|
837
|
-
payoutEnabled = self.
|
838
|
-
transferEnabled = self.
|
836
|
+
payinEnabled = self.safe_bool(entry, 'payin_enabled', False)
|
837
|
+
payoutEnabled = self.safe_bool(entry, 'payout_enabled', False)
|
838
|
+
transferEnabled = self.safe_bool(entry, 'transfer_enabled', False)
|
839
839
|
active = payinEnabled and payoutEnabled and transferEnabled
|
840
840
|
rawNetworks = self.safe_value(entry, 'networks', [])
|
841
841
|
networks = {}
|
@@ -848,8 +848,8 @@ class hitbtc(Exchange, ImplicitAPI):
|
|
848
848
|
network = self.safe_network(networkId)
|
849
849
|
fee = self.safe_number(rawNetwork, 'payout_fee')
|
850
850
|
networkPrecision = self.safe_number(rawNetwork, 'precision_payout')
|
851
|
-
payinEnabledNetwork = self.
|
852
|
-
payoutEnabledNetwork = self.
|
851
|
+
payinEnabledNetwork = self.safe_bool(entry, 'payin_enabled', False)
|
852
|
+
payoutEnabledNetwork = self.safe_bool(entry, 'payout_enabled', False)
|
853
853
|
activeNetwork = payinEnabledNetwork and payoutEnabledNetwork
|
854
854
|
if payinEnabledNetwork and not depositEnabled:
|
855
855
|
depositEnabled = True
|
@@ -2511,7 +2511,7 @@ class hitbtc(Exchange, ImplicitAPI):
|
|
2511
2511
|
request['currency'] = parsedNetwork
|
2512
2512
|
params = self.omit(params, 'network')
|
2513
2513
|
withdrawOptions = self.safe_value(self.options, 'withdraw', {})
|
2514
|
-
includeFee = self.
|
2514
|
+
includeFee = self.safe_bool(withdrawOptions, 'includeFee', False)
|
2515
2515
|
if includeFee:
|
2516
2516
|
request['include_fee'] = True
|
2517
2517
|
response = await self.privatePostWalletCryptoWithdraw(self.extend(request, params))
|
@@ -2995,7 +2995,7 @@ class hitbtc(Exchange, ImplicitAPI):
|
|
2995
2995
|
await self.load_markets()
|
2996
2996
|
market = self.market(symbol)
|
2997
2997
|
leverage = self.safe_string(params, 'leverage')
|
2998
|
-
if market['
|
2998
|
+
if market['swap']:
|
2999
2999
|
if leverage is None:
|
3000
3000
|
raise ArgumentsRequired(self.id + ' modifyMarginHelper() requires a leverage parameter for swap markets')
|
3001
3001
|
if amount != 0:
|
@@ -3014,17 +3014,13 @@ class hitbtc(Exchange, ImplicitAPI):
|
|
3014
3014
|
marginMode = None
|
3015
3015
|
marketType, params = self.handle_market_type_and_params('modifyMarginHelper', market, params)
|
3016
3016
|
marginMode, params = self.handle_margin_mode_and_params('modifyMarginHelper', params)
|
3017
|
-
params = self.omit(params, ['marginMode', 'margin'])
|
3018
3017
|
response = None
|
3019
|
-
if
|
3018
|
+
if marketType == 'swap':
|
3019
|
+
response = await self.privatePutFuturesAccountIsolatedSymbol(self.extend(request, params))
|
3020
|
+
elif (marketType == 'margin') or (marketType == 'spot') or (marginMode == 'isolated'):
|
3020
3021
|
response = await self.privatePutMarginAccountIsolatedSymbol(self.extend(request, params))
|
3021
3022
|
else:
|
3022
|
-
|
3023
|
-
response = await self.privatePutFuturesAccountIsolatedSymbol(self.extend(request, params))
|
3024
|
-
elif marketType == 'margin':
|
3025
|
-
response = await self.privatePutMarginAccountIsolatedSymbol(self.extend(request, params))
|
3026
|
-
else:
|
3027
|
-
raise NotSupported(self.id + ' modifyMarginHelper() not support self market type')
|
3023
|
+
raise NotSupported(self.id + ' modifyMarginHelper() not support self market type')
|
3028
3024
|
#
|
3029
3025
|
# {
|
3030
3026
|
# "symbol": "BTCUSDT_PERP",
|
@@ -3309,7 +3305,7 @@ class hitbtc(Exchange, ImplicitAPI):
|
|
3309
3305
|
:returns Array: the marginMode in lowercase
|
3310
3306
|
"""
|
3311
3307
|
defaultType = self.safe_string(self.options, 'defaultType')
|
3312
|
-
isMargin = self.
|
3308
|
+
isMargin = self.safe_bool(params, 'margin', False)
|
3313
3309
|
marginMode = None
|
3314
3310
|
marginMode, params = super(hitbtc, self).handle_margin_mode_and_params(methodName, params, defaultValue)
|
3315
3311
|
if marginMode is None:
|
ccxt/async_support/hollaex.py
CHANGED
@@ -1053,7 +1053,7 @@ class hollaex(Exchange, ImplicitAPI):
|
|
1053
1053
|
filled = self.safe_string(order, 'filled')
|
1054
1054
|
status = self.parse_order_status(self.safe_string(order, 'status'))
|
1055
1055
|
meta = self.safe_value(order, 'meta', {})
|
1056
|
-
postOnly = self.
|
1056
|
+
postOnly = self.safe_bool(meta, 'post_only', False)
|
1057
1057
|
return self.safe_order({
|
1058
1058
|
'id': id,
|
1059
1059
|
'clientOrderId': None,
|
@@ -1105,7 +1105,7 @@ class hollaex(Exchange, ImplicitAPI):
|
|
1105
1105
|
}
|
1106
1106
|
stopPrice = self.safe_number_n(params, ['triggerPrice', 'stopPrice', 'stop'])
|
1107
1107
|
meta = self.safe_value(params, 'meta', {})
|
1108
|
-
exchangeSpecificParam = self.
|
1108
|
+
exchangeSpecificParam = self.safe_bool(meta, 'post_only', False)
|
1109
1109
|
isMarketOrder = type == 'market'
|
1110
1110
|
postOnly = self.is_post_only(isMarketOrder, exchangeSpecificParam, params)
|
1111
1111
|
if not isMarketOrder:
|