ccxt 4.2.38__py2.py3-none-any.whl → 4.2.40__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.
Potentially problematic release.
This version of ccxt might be problematic. Click here for more details.
- ccxt/__init__.py +1 -1
- ccxt/abstract/bingx.py +4 -0
- ccxt/abstract/coinbase.py +1 -0
- ccxt/abstract/coinbasepro.py +1 -0
- ccxt/abstract/okx.py +1 -0
- ccxt/ascendex.py +31 -27
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/ascendex.py +31 -27
- ccxt/async_support/base/exchange.py +19 -7
- ccxt/async_support/bigone.py +2 -2
- ccxt/async_support/binance.py +478 -188
- ccxt/async_support/bingx.py +250 -28
- ccxt/async_support/bitfinex.py +3 -3
- ccxt/async_support/bitfinex2.py +2 -2
- ccxt/async_support/bitget.py +16 -7
- ccxt/async_support/bitmart.py +2 -2
- ccxt/async_support/bitmex.py +2 -2
- ccxt/async_support/bitrue.py +2 -2
- ccxt/async_support/bitso.py +19 -3
- ccxt/async_support/bitstamp.py +25 -3
- ccxt/async_support/bitvavo.py +1 -1
- ccxt/async_support/bl3p.py +6 -0
- ccxt/async_support/blockchaincom.py +21 -0
- ccxt/async_support/blofin.py +2 -2
- ccxt/async_support/btcalpha.py +9 -0
- ccxt/async_support/btcbox.py +9 -0
- ccxt/async_support/btcmarkets.py +19 -0
- ccxt/async_support/bybit.py +9 -7
- ccxt/async_support/cex.py +1 -1
- ccxt/async_support/coinbase.py +20 -9
- ccxt/async_support/coinbasepro.py +1 -0
- ccxt/async_support/coinex.py +4 -4
- ccxt/async_support/coinlist.py +11 -9
- ccxt/async_support/coinmetro.py +2 -1
- ccxt/async_support/coinone.py +1 -1
- ccxt/async_support/delta.py +2 -2
- ccxt/async_support/deribit.py +3 -3
- ccxt/async_support/digifinex.py +3 -3
- ccxt/async_support/exmo.py +2 -2
- ccxt/async_support/gate.py +6 -6
- ccxt/async_support/hitbtc.py +2 -2
- ccxt/async_support/hollaex.py +1 -1
- ccxt/async_support/htx.py +3 -3
- ccxt/async_support/huobijp.py +1 -1
- ccxt/async_support/kraken.py +2 -2
- ccxt/async_support/krakenfutures.py +117 -16
- ccxt/async_support/kucoin.py +5 -5
- ccxt/async_support/kucoinfutures.py +2 -2
- ccxt/async_support/latoken.py +1 -1
- ccxt/async_support/lbank.py +2 -2
- ccxt/async_support/luno.py +2 -2
- ccxt/async_support/mexc.py +5 -5
- ccxt/async_support/ndax.py +1 -1
- ccxt/async_support/novadax.py +1 -1
- ccxt/async_support/okcoin.py +2 -2
- ccxt/async_support/okx.py +18 -21
- ccxt/async_support/paymium.py +2 -2
- ccxt/async_support/phemex.py +5 -4
- ccxt/async_support/poloniex.py +2 -2
- ccxt/async_support/poloniexfutures.py +10 -6
- ccxt/async_support/probit.py +1 -1
- ccxt/async_support/timex.py +1 -1
- ccxt/async_support/upbit.py +1 -1
- ccxt/async_support/wavesexchange.py +1 -1
- ccxt/async_support/whitebit.py +2 -2
- ccxt/async_support/woo.py +4 -4
- ccxt/async_support/zonda.py +3 -3
- ccxt/base/exchange.py +37 -25
- ccxt/bigone.py +2 -2
- ccxt/binance.py +478 -188
- ccxt/bingx.py +250 -28
- ccxt/bitfinex.py +3 -3
- ccxt/bitfinex2.py +2 -2
- ccxt/bitget.py +16 -7
- ccxt/bitmart.py +2 -2
- ccxt/bitmex.py +2 -2
- ccxt/bitrue.py +2 -2
- ccxt/bitso.py +19 -3
- ccxt/bitstamp.py +25 -3
- ccxt/bitvavo.py +1 -1
- ccxt/bl3p.py +6 -0
- ccxt/blockchaincom.py +21 -0
- ccxt/blofin.py +2 -2
- ccxt/btcalpha.py +9 -0
- ccxt/btcbox.py +9 -0
- ccxt/btcmarkets.py +19 -0
- ccxt/bybit.py +9 -7
- ccxt/cex.py +1 -1
- ccxt/coinbase.py +20 -9
- ccxt/coinbasepro.py +1 -0
- ccxt/coinex.py +4 -4
- ccxt/coinlist.py +11 -9
- ccxt/coinmetro.py +2 -1
- ccxt/coinone.py +1 -1
- ccxt/delta.py +2 -2
- ccxt/deribit.py +3 -3
- ccxt/digifinex.py +3 -3
- ccxt/exmo.py +2 -2
- ccxt/gate.py +6 -6
- ccxt/hitbtc.py +2 -2
- ccxt/hollaex.py +1 -1
- ccxt/htx.py +3 -3
- ccxt/huobijp.py +1 -1
- ccxt/kraken.py +2 -2
- ccxt/krakenfutures.py +117 -16
- ccxt/kucoin.py +5 -5
- ccxt/kucoinfutures.py +2 -2
- ccxt/latoken.py +1 -1
- ccxt/lbank.py +2 -2
- ccxt/luno.py +2 -2
- ccxt/mexc.py +5 -5
- ccxt/ndax.py +1 -1
- ccxt/novadax.py +1 -1
- ccxt/okcoin.py +2 -2
- ccxt/okx.py +18 -21
- ccxt/paymium.py +2 -2
- ccxt/phemex.py +5 -4
- ccxt/poloniex.py +2 -2
- ccxt/poloniexfutures.py +10 -6
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/bitmart.py +129 -46
- ccxt/pro/bitvavo.py +1 -1
- ccxt/pro/bybit.py +6 -6
- ccxt/pro/cex.py +2 -2
- ccxt/pro/coinbase.py +2 -2
- ccxt/pro/coinex.py +1 -1
- ccxt/pro/lbank.py +1 -1
- ccxt/pro/mexc.py +1 -1
- ccxt/probit.py +1 -1
- ccxt/test/test_async.py +3 -1
- ccxt/test/test_sync.py +3 -1
- ccxt/timex.py +1 -1
- ccxt/upbit.py +1 -1
- ccxt/wavesexchange.py +1 -1
- ccxt/whitebit.py +2 -2
- ccxt/woo.py +4 -4
- ccxt/zonda.py +3 -3
- {ccxt-4.2.38.dist-info → ccxt-4.2.40.dist-info}/METADATA +4 -4
- {ccxt-4.2.38.dist-info → ccxt-4.2.40.dist-info}/RECORD +141 -141
- {ccxt-4.2.38.dist-info → ccxt-4.2.40.dist-info}/WHEEL +0 -0
- {ccxt-4.2.38.dist-info → ccxt-4.2.40.dist-info}/top_level.txt +0 -0
ccxt/async_support/paymium.py
CHANGED
@@ -325,7 +325,7 @@ class paymium(Exchange, ImplicitAPI):
|
|
325
325
|
#
|
326
326
|
return self.parse_deposit_address(response)
|
327
327
|
|
328
|
-
async def fetch_deposit_addresses(self, codes=None, params={}):
|
328
|
+
async def fetch_deposit_addresses(self, codes: List[str] = None, params={}):
|
329
329
|
"""
|
330
330
|
fetch deposit addresses for multiple currencies and chain types
|
331
331
|
:see: https://paymium.github.io/api-documentation/#tag/User/paths/~1user~1addresses/get
|
@@ -409,7 +409,7 @@ class paymium(Exchange, ImplicitAPI):
|
|
409
409
|
}
|
410
410
|
return await self.privateDeleteUserOrdersUuidCancel(self.extend(request, params))
|
411
411
|
|
412
|
-
async def transfer(self, code: str, amount: float, fromAccount, toAccount, params={}) -> TransferEntry:
|
412
|
+
async def transfer(self, code: str, amount: float, fromAccount: str, toAccount: str, params={}) -> TransferEntry:
|
413
413
|
"""
|
414
414
|
transfer currency internally between wallets on the same account
|
415
415
|
:see: https://paymium.github.io/api-documentation/#tag/Transfer/paths/~1user~1email_transfers/post
|
ccxt/async_support/phemex.py
CHANGED
@@ -50,6 +50,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
50
50
|
'addMargin': False,
|
51
51
|
'cancelAllOrders': True,
|
52
52
|
'cancelOrder': True,
|
53
|
+
'closePosition': False,
|
53
54
|
'createOrder': True,
|
54
55
|
'createReduceOnlyOrder': True,
|
55
56
|
'createStopLimitOrder': True,
|
@@ -2589,7 +2590,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
2589
2590
|
data = self.safe_value(response, 'data', {})
|
2590
2591
|
return self.parse_order(data, market)
|
2591
2592
|
|
2592
|
-
async def edit_order(self, id: str, symbol, type=None, side=None, amount=None, price=None, params={}):
|
2593
|
+
async def edit_order(self, id: str, symbol: str, type: OrderType = None, side: OrderSide = None, amount: float = None, price: float = None, params={}):
|
2593
2594
|
"""
|
2594
2595
|
edit a trade order
|
2595
2596
|
:see: https://github.com/phemex/phemex-api-docs/blob/master/Public-Hedged-Perpetual-API.md#amend-order-by-orderid
|
@@ -3797,7 +3798,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
3797
3798
|
'status': self.parse_margin_status(self.safe_string(data, 'code')),
|
3798
3799
|
}
|
3799
3800
|
|
3800
|
-
async def set_margin_mode(self, marginMode, symbol: Str = None, params={}):
|
3801
|
+
async def set_margin_mode(self, marginMode: str, symbol: Str = None, params={}):
|
3801
3802
|
"""
|
3802
3803
|
set margin mode to 'cross' or 'isolated'
|
3803
3804
|
:param str marginMode: 'cross' or 'isolated'
|
@@ -3825,7 +3826,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
3825
3826
|
}
|
3826
3827
|
return await self.privatePutPositionsLeverage(self.extend(request, params))
|
3827
3828
|
|
3828
|
-
async def set_position_mode(self, hedged, symbol: Str = None, params={}):
|
3829
|
+
async def set_position_mode(self, hedged: bool, symbol: Str = None, params={}):
|
3829
3830
|
"""
|
3830
3831
|
set hedged to True or False for a market
|
3831
3832
|
:see: https://github.com/phemex/phemex-api-docs/blob/master/Public-Hedged-Perpetual-API.md#switch-position-mode-synchronously
|
@@ -4054,7 +4055,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
4054
4055
|
response = await self.privatePutPositionsLeverage(self.extend(request, params))
|
4055
4056
|
return response
|
4056
4057
|
|
4057
|
-
async def transfer(self, code: str, amount: float, fromAccount, toAccount, params={}) -> TransferEntry:
|
4058
|
+
async def transfer(self, code: str, amount: float, fromAccount: str, toAccount: str, params={}) -> TransferEntry:
|
4058
4059
|
"""
|
4059
4060
|
transfer currency internally between wallets on the same account
|
4060
4061
|
:param str code: unified currency code
|
ccxt/async_support/poloniex.py
CHANGED
@@ -1300,7 +1300,7 @@ class poloniex(Exchange, ImplicitAPI):
|
|
1300
1300
|
# remember the timestamp before issuing the request
|
1301
1301
|
return [request, params]
|
1302
1302
|
|
1303
|
-
async def edit_order(self, id: str, symbol, type, side, amount=None, price=None, params={}):
|
1303
|
+
async def edit_order(self, id: str, symbol: str, type: OrderType, side: OrderSide, amount: float = None, price: float = None, params={}):
|
1304
1304
|
"""
|
1305
1305
|
edit a trade order
|
1306
1306
|
:see: https://docs.poloniex.com/#authenticated-endpoints-orders-cancel-replace-order
|
@@ -1736,7 +1736,7 @@ class poloniex(Exchange, ImplicitAPI):
|
|
1736
1736
|
'info': response,
|
1737
1737
|
}
|
1738
1738
|
|
1739
|
-
async def transfer(self, code: str, amount: float, fromAccount, toAccount, params={}) -> TransferEntry:
|
1739
|
+
async def transfer(self, code: str, amount: float, fromAccount: str, toAccount: str, params={}) -> TransferEntry:
|
1740
1740
|
"""
|
1741
1741
|
transfer currency internally between wallets on the same account
|
1742
1742
|
:see: https://docs.poloniex.com/#authenticated-endpoints-accounts-accounts-transfer
|
@@ -1321,7 +1321,7 @@ class poloniexfutures(Exchange, ImplicitAPI):
|
|
1321
1321
|
"""
|
1322
1322
|
return await self.fetch_orders_by_status('closed', symbol, since, limit, params)
|
1323
1323
|
|
1324
|
-
async def fetch_order(self, id=None, symbol: Str = None, params={}):
|
1324
|
+
async def fetch_order(self, id: str = None, symbol: Str = None, params={}):
|
1325
1325
|
"""
|
1326
1326
|
fetches information on an order made by the user
|
1327
1327
|
:see: https://futures-docs.poloniex.com/#get-details-of-a-single-order
|
@@ -1619,24 +1619,28 @@ class poloniexfutures(Exchange, ImplicitAPI):
|
|
1619
1619
|
trades = self.safe_value(data, 'items', {})
|
1620
1620
|
return self.parse_trades(trades, market, since, limit)
|
1621
1621
|
|
1622
|
-
async def set_margin_mode(self, marginMode, symbol, params={}):
|
1622
|
+
async def set_margin_mode(self, marginMode: str, symbol: str = None, params={}):
|
1623
1623
|
"""
|
1624
1624
|
set margin mode to 'cross' or 'isolated'
|
1625
1625
|
:see: https://futures-docs.poloniex.com/#change-margin-mode
|
1626
|
-
:param
|
1626
|
+
:param str marginMode: "0"(isolated) or "1"(cross)
|
1627
1627
|
:param str symbol: unified market symbol
|
1628
1628
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1629
1629
|
:returns dict: response from the exchange
|
1630
1630
|
"""
|
1631
1631
|
if symbol is None:
|
1632
1632
|
raise ArgumentsRequired(self.id + ' setMarginMode() requires a symbol argument')
|
1633
|
-
if (marginMode != 0) and (marginMode != 1):
|
1634
|
-
raise ArgumentsRequired(self.id + ' setMarginMode() marginMode must be 0
|
1633
|
+
if (marginMode != '0') and (marginMode != '1') and (marginMode != 'isolated') and (marginMode != 'cross'):
|
1634
|
+
raise ArgumentsRequired(self.id + ' setMarginMode() marginMode must be 0/isolated or 1/cross')
|
1635
1635
|
await self.load_markets()
|
1636
|
+
if marginMode == 'isolated':
|
1637
|
+
marginMode = '0'
|
1638
|
+
if marginMode == 'cross':
|
1639
|
+
marginMode = '1'
|
1636
1640
|
market = self.market(symbol)
|
1637
1641
|
request = {
|
1638
1642
|
'symbol': market['id'],
|
1639
|
-
'marginType': marginMode,
|
1643
|
+
'marginType': self.parse_to_int(marginMode),
|
1640
1644
|
}
|
1641
1645
|
return await self.privatePostMarginTypeChange(request)
|
1642
1646
|
|
ccxt/async_support/probit.py
CHANGED
@@ -1311,7 +1311,7 @@ class probit(Exchange, ImplicitAPI):
|
|
1311
1311
|
raise InvalidAddress(self.id + ' fetchDepositAddress() returned an empty response')
|
1312
1312
|
return self.parse_deposit_address(firstAddress, currency)
|
1313
1313
|
|
1314
|
-
async def fetch_deposit_addresses(self, codes=None, params={}):
|
1314
|
+
async def fetch_deposit_addresses(self, codes: List[str] = None, params={}):
|
1315
1315
|
"""
|
1316
1316
|
:see: https://docs-en.probit.com/reference/deposit_address
|
1317
1317
|
fetch deposit addresses for multiple currencies and chain types
|
ccxt/async_support/timex.py
CHANGED
@@ -755,7 +755,7 @@ class timex(Exchange, ImplicitAPI):
|
|
755
755
|
order = self.safe_value(orders, 0, {})
|
756
756
|
return self.parse_order(order, market)
|
757
757
|
|
758
|
-
async def edit_order(self, id: str, symbol, type, side, amount=None, price=None, params={}):
|
758
|
+
async def edit_order(self, id: str, symbol: str, type: OrderType, side: OrderSide, amount: float = None, price: float = None, params={}):
|
759
759
|
await self.load_markets()
|
760
760
|
market = self.market(symbol)
|
761
761
|
request = {
|
ccxt/async_support/upbit.py
CHANGED
@@ -1522,7 +1522,7 @@ class upbit(Exchange, ImplicitAPI):
|
|
1522
1522
|
#
|
1523
1523
|
return self.parse_order(response)
|
1524
1524
|
|
1525
|
-
async def fetch_deposit_addresses(self, codes=None, params={}):
|
1525
|
+
async def fetch_deposit_addresses(self, codes: List[str] = None, params={}):
|
1526
1526
|
"""
|
1527
1527
|
:see: https://docs.upbit.com/reference/%EC%A0%84%EC%B2%B4-%EC%9E%85%EA%B8%88-%EC%A3%BC%EC%86%8C-%EC%A1%B0%ED%9A%8C
|
1528
1528
|
fetch deposit addresses for multiple currencies and chain types
|
@@ -325,7 +325,7 @@ class wavesexchange(Exchange, ImplicitAPI):
|
|
325
325
|
},
|
326
326
|
},
|
327
327
|
'currencies': {
|
328
|
-
'WX': self.safe_currency_structure({'id': 'EMAMLxDnv3xiz8RXg8Btj33jcEw3wLczL3JKYYmuubpc', 'numericId': None, 'code': 'WX', 'precision': self.
|
328
|
+
'WX': self.safe_currency_structure({'id': 'EMAMLxDnv3xiz8RXg8Btj33jcEw3wLczL3JKYYmuubpc', 'numericId': None, 'code': 'WX', 'precision': self.parse_to_int('8')}),
|
329
329
|
},
|
330
330
|
'precisionMode': DECIMAL_PLACES,
|
331
331
|
'options': {
|
ccxt/async_support/whitebit.py
CHANGED
@@ -456,7 +456,7 @@ class whitebit(Exchange, ImplicitAPI):
|
|
456
456
|
}
|
457
457
|
return result
|
458
458
|
|
459
|
-
async def fetch_transaction_fees(self, codes=None, params={}):
|
459
|
+
async def fetch_transaction_fees(self, codes: List[str] = None, params={}):
|
460
460
|
"""
|
461
461
|
* @deprecated
|
462
462
|
please use fetchDepositWithdrawFees instead
|
@@ -1616,7 +1616,7 @@ class whitebit(Exchange, ImplicitAPI):
|
|
1616
1616
|
# "leverage": 5
|
1617
1617
|
# }
|
1618
1618
|
|
1619
|
-
async def transfer(self, code: str, amount: float, fromAccount, toAccount, params={}) -> TransferEntry:
|
1619
|
+
async def transfer(self, code: str, amount: float, fromAccount: str, toAccount: str, params={}) -> TransferEntry:
|
1620
1620
|
"""
|
1621
1621
|
transfer currency internally between wallets on the same account
|
1622
1622
|
:see: https://docs.whitebit.com/private/http-main-v4/#transfer-between-main-and-trade-balances
|
ccxt/async_support/woo.py
CHANGED
@@ -738,7 +738,7 @@ class woo(Exchange, ImplicitAPI):
|
|
738
738
|
}
|
739
739
|
return result
|
740
740
|
|
741
|
-
async def create_market_buy_order_with_cost(self, symbol: str, cost, params={}):
|
741
|
+
async def create_market_buy_order_with_cost(self, symbol: str, cost: float, params={}):
|
742
742
|
"""
|
743
743
|
create a market buy order by providing the symbol and cost
|
744
744
|
:see: https://docs.woo.org/#send-order
|
@@ -971,7 +971,7 @@ class woo(Exchange, ImplicitAPI):
|
|
971
971
|
order['type'] = type
|
972
972
|
return order
|
973
973
|
|
974
|
-
async def edit_order(self, id: str, symbol, type, side, amount=None, price=None, params={}):
|
974
|
+
async def edit_order(self, id: str, symbol: str, type: OrderType, side: OrderSide, amount: float = None, price: float = None, params={}):
|
975
975
|
"""
|
976
976
|
edit a trade order
|
977
977
|
:see: https://docs.woo.org/#edit-order
|
@@ -1009,7 +1009,7 @@ class woo(Exchange, ImplicitAPI):
|
|
1009
1009
|
stopPrice = self.safe_number_n(params, ['triggerPrice', 'stopPrice', 'takeProfitPrice', 'stopLossPrice'])
|
1010
1010
|
if stopPrice is not None:
|
1011
1011
|
request['triggerPrice'] = self.price_to_precision(symbol, stopPrice)
|
1012
|
-
trailingTriggerPrice = self.safe_string_2(params, 'trailingTriggerPrice', 'activatedPrice', price)
|
1012
|
+
trailingTriggerPrice = self.safe_string_2(params, 'trailingTriggerPrice', 'activatedPrice', self.number_to_string(price))
|
1013
1013
|
trailingAmount = self.safe_string_2(params, 'trailingAmount', 'callbackValue')
|
1014
1014
|
trailingPercent = self.safe_string_2(params, 'trailingPercent', 'callbackRate')
|
1015
1015
|
isTrailingAmountOrder = trailingAmount is not None
|
@@ -1945,7 +1945,7 @@ class woo(Exchange, ImplicitAPI):
|
|
1945
1945
|
}
|
1946
1946
|
return self.safe_string(statuses, status, status)
|
1947
1947
|
|
1948
|
-
async def transfer(self, code: str, amount: float, fromAccount, toAccount, params={}) -> TransferEntry:
|
1948
|
+
async def transfer(self, code: str, amount: float, fromAccount: str, toAccount: str, params={}) -> TransferEntry:
|
1949
1949
|
"""
|
1950
1950
|
transfer currency internally between wallets on the same account
|
1951
1951
|
:param str code: unified currency code
|
ccxt/async_support/zonda.py
CHANGED
@@ -654,7 +654,7 @@ class zonda(Exchange, ImplicitAPI):
|
|
654
654
|
'info': ticker,
|
655
655
|
}, market)
|
656
656
|
|
657
|
-
async def fetch_ticker(self, symbol, params={}):
|
657
|
+
async def fetch_ticker(self, symbol: str, params={}):
|
658
658
|
"""
|
659
659
|
v1_01PublicGetTradingTickerSymbol retrieves timestamp, datetime, bid, ask, close, last, previousClose, v1_01PublicGetTradingStatsSymbol retrieves high, low, volume and opening price of an asset
|
660
660
|
:see: https://docs.zondacrypto.exchange/reference/market-statistics
|
@@ -1512,7 +1512,7 @@ class zonda(Exchange, ImplicitAPI):
|
|
1512
1512
|
first = self.safe_value(data, 0)
|
1513
1513
|
return self.parse_deposit_address(first, currency)
|
1514
1514
|
|
1515
|
-
async def fetch_deposit_addresses(self, codes=None, params={}):
|
1515
|
+
async def fetch_deposit_addresses(self, codes: List[str] = None, params={}):
|
1516
1516
|
"""
|
1517
1517
|
:see: https://docs.zondacrypto.exchange/reference/deposit-addresses-for-crypto
|
1518
1518
|
fetch deposit addresses for multiple currencies and chain types
|
@@ -1538,7 +1538,7 @@ class zonda(Exchange, ImplicitAPI):
|
|
1538
1538
|
data = self.safe_value(response, 'data')
|
1539
1539
|
return self.parse_deposit_addresses(data, codes)
|
1540
1540
|
|
1541
|
-
async def transfer(self, code: str, amount: float, fromAccount, toAccount, params={}) -> TransferEntry:
|
1541
|
+
async def transfer(self, code: str, amount: float, fromAccount: str, toAccount: str, params={}) -> TransferEntry:
|
1542
1542
|
"""
|
1543
1543
|
:see: https://docs.zondacrypto.exchange/reference/internal-transfer
|
1544
1544
|
transfer currency internally between wallets on the same account
|
ccxt/base/exchange.py
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
# -----------------------------------------------------------------------------
|
6
6
|
|
7
|
-
__version__ = '4.2.
|
7
|
+
__version__ = '4.2.40'
|
8
8
|
|
9
9
|
# -----------------------------------------------------------------------------
|
10
10
|
|
@@ -2189,6 +2189,18 @@ class Exchange(object):
|
|
2189
2189
|
def set_leverage(self, leverage: Int, symbol: str = None, params={}):
|
2190
2190
|
raise NotSupported(self.id + ' setLeverage() is not supported yet')
|
2191
2191
|
|
2192
|
+
def fetch_leverage(self, symbol: str, params={}):
|
2193
|
+
raise NotSupported(self.id + ' fetchLeverage() is not supported yet')
|
2194
|
+
|
2195
|
+
def set_position_mode(self, hedged: bool, symbol: Str = None, params={}):
|
2196
|
+
raise NotSupported(self.id + ' setPositionMode() is not supported yet')
|
2197
|
+
|
2198
|
+
def set_margin_mode(self, marginMode: str, symbol: Str = None, params={}):
|
2199
|
+
raise NotSupported(self.id + ' setMarginMode() is not supported yet')
|
2200
|
+
|
2201
|
+
def fetch_deposit_addresses_by_network(self, code: str, params={}):
|
2202
|
+
raise NotSupported(self.id + ' fetchDepositAddressesByNetwork() is not supported yet')
|
2203
|
+
|
2192
2204
|
def fetch_open_interest_history(self, symbol: str, timeframe='1h', since: Int = None, limit: Int = None, params={}):
|
2193
2205
|
raise NotSupported(self.id + ' fetchOpenInterestHistory() is not supported yet')
|
2194
2206
|
|
@@ -3226,11 +3238,11 @@ class Exchange(object):
|
|
3226
3238
|
:param str|None currencyCode: unified currency code, but self argument is not required by default, unless there is an exchange(like huobi) that needs an override of the method to be able to pass currencyCode argument additionally
|
3227
3239
|
:returns str|None: unified network code
|
3228
3240
|
"""
|
3229
|
-
networkCodesByIds = self.
|
3241
|
+
networkCodesByIds = self.safe_dict(self.options, 'networksById', {})
|
3230
3242
|
networkCode = self.safe_string(networkCodesByIds, networkId, networkId)
|
3231
3243
|
# replace mainnet network-codes(i.e. ERC20->ETH)
|
3232
3244
|
if currencyCode is not None:
|
3233
|
-
defaultNetworkCodeReplacements = self.
|
3245
|
+
defaultNetworkCodeReplacements = self.safe_dict(self.options, 'defaultNetworkCodeReplacements', {})
|
3234
3246
|
if currencyCode in defaultNetworkCodeReplacements:
|
3235
3247
|
replacementObject = self.safe_dict(defaultNetworkCodeReplacements, currencyCode, {})
|
3236
3248
|
networkCode = self.safe_string(replacementObject, networkCode, networkCode)
|
@@ -3243,15 +3255,15 @@ class Exchange(object):
|
|
3243
3255
|
# if it was not defined by user, we should not set it from 'defaultNetworks', because handleNetworkCodeAndParams is for only request-side and thus we do not fill it with anything. We can only use 'defaultNetworks' after parsing response-side
|
3244
3256
|
return [networkCodeInParams, params]
|
3245
3257
|
|
3246
|
-
def default_network_code(self, currencyCode):
|
3258
|
+
def default_network_code(self, currencyCode: str):
|
3247
3259
|
defaultNetworkCode = None
|
3248
|
-
defaultNetworks = self.
|
3260
|
+
defaultNetworks = self.safe_dict(self.options, 'defaultNetworks', {})
|
3249
3261
|
if currencyCode in defaultNetworks:
|
3250
3262
|
# if currency had set its network in "defaultNetworks", use it
|
3251
3263
|
defaultNetworkCode = defaultNetworks[currencyCode]
|
3252
3264
|
else:
|
3253
3265
|
# otherwise, try to use the global-scope 'defaultNetwork' value(even if that network is not supported by currency, it doesn't make any problem, self will be just used "at first" if currency supports self network at all)
|
3254
|
-
defaultNetwork = self.
|
3266
|
+
defaultNetwork = self.safe_dict(self.options, 'defaultNetwork')
|
3255
3267
|
if defaultNetwork is not None:
|
3256
3268
|
defaultNetworkCode = defaultNetwork
|
3257
3269
|
return defaultNetworkCode
|
@@ -3287,7 +3299,7 @@ class Exchange(object):
|
|
3287
3299
|
chosenNetworkId = defaultNetworkId if (defaultNetworkId in indexedNetworkEntries) else availableNetworkIds[0]
|
3288
3300
|
return chosenNetworkId
|
3289
3301
|
|
3290
|
-
def safe_number_2(self, dictionary, key1, key2, d=None):
|
3302
|
+
def safe_number_2(self, dictionary: object, key1: IndexType, key2: IndexType, d=None):
|
3291
3303
|
value = self.safe_string_2(dictionary, key1, key2)
|
3292
3304
|
return self.parse_number(value, d)
|
3293
3305
|
|
@@ -3689,13 +3701,13 @@ class Exchange(object):
|
|
3689
3701
|
raise NotSupported(self.id + ' fetchStatus() is not supported yet')
|
3690
3702
|
|
3691
3703
|
def fetch_funding_fee(self, code: str, params={}):
|
3692
|
-
warnOnFetchFundingFee = self.
|
3704
|
+
warnOnFetchFundingFee = self.safe_bool(self.options, 'warnOnFetchFundingFee', True)
|
3693
3705
|
if warnOnFetchFundingFee:
|
3694
3706
|
raise NotSupported(self.id + ' fetchFundingFee() method is deprecated, it will be removed in July 2022, please, use fetchTransactionFee() or set exchange.options["warnOnFetchFundingFee"] = False to suppress self warning')
|
3695
3707
|
return self.fetch_transaction_fee(code, params)
|
3696
3708
|
|
3697
3709
|
def fetch_funding_fees(self, codes: List[str] = None, params={}):
|
3698
|
-
warnOnFetchFundingFees = self.
|
3710
|
+
warnOnFetchFundingFees = self.safe_bool(self.options, 'warnOnFetchFundingFees', True)
|
3699
3711
|
if warnOnFetchFundingFees:
|
3700
3712
|
raise NotSupported(self.id + ' fetchFundingFees() method is deprecated, it will be removed in July 2022. Please, use fetchTransactionFees() or set exchange.options["warnOnFetchFundingFees"] = False to suppress self warning')
|
3701
3713
|
return self.fetch_transaction_fees(codes, params)
|
@@ -3738,12 +3750,12 @@ class Exchange(object):
|
|
3738
3750
|
if not self.has['fetchBorrowRates']:
|
3739
3751
|
raise NotSupported(self.id + ' fetchIsolatedBorrowRate() is not supported yet')
|
3740
3752
|
borrowRates = self.fetchIsolatedBorrowRates(params)
|
3741
|
-
rate = self.
|
3753
|
+
rate = self.safe_dict(borrowRates, symbol)
|
3742
3754
|
if rate is None:
|
3743
3755
|
raise ExchangeError(self.id + ' fetchIsolatedBorrowRate() could not find the borrow rate for market symbol ' + symbol)
|
3744
3756
|
return rate
|
3745
3757
|
|
3746
|
-
def handle_option_and_params(self, params, methodName, optionName, defaultValue=None):
|
3758
|
+
def handle_option_and_params(self, params: object, methodName: str, optionName: str, defaultValue=None):
|
3747
3759
|
# This method can be used to obtain method specific properties, i.e: self.handle_option_and_params(params, 'fetchPosition', 'marginMode', 'isolated')
|
3748
3760
|
defaultOptionName = 'default' + self.capitalize(optionName) # we also need to check the 'defaultXyzWhatever'
|
3749
3761
|
# check if params contain the key
|
@@ -3763,7 +3775,7 @@ class Exchange(object):
|
|
3763
3775
|
value = value if (value is not None) else defaultValue
|
3764
3776
|
return [value, params]
|
3765
3777
|
|
3766
|
-
def handle_option_and_params_2(self, params, methodName, methodName2, optionName, defaultValue=None):
|
3778
|
+
def handle_option_and_params_2(self, params: object, methodName: str, methodName2: str, optionName: str, defaultValue=None):
|
3767
3779
|
# This method can be used to obtain method specific properties, i.e: self.handle_option_and_params(params, 'fetchPosition', 'marginMode', 'isolated')
|
3768
3780
|
defaultOptionName = 'default' + self.capitalize(optionName) # we also need to check the 'defaultXyzWhatever'
|
3769
3781
|
# check if params contain the key
|
@@ -3783,14 +3795,14 @@ class Exchange(object):
|
|
3783
3795
|
value = value if (value is not None) else defaultValue
|
3784
3796
|
return [value, params]
|
3785
3797
|
|
3786
|
-
def handle_option(self, methodName, optionName, defaultValue=None):
|
3798
|
+
def handle_option(self, methodName: str, optionName: str, defaultValue=None):
|
3787
3799
|
# eslint-disable-next-line no-unused-vars
|
3788
3800
|
result, empty = self.handle_option_and_params({}, methodName, optionName, defaultValue)
|
3789
3801
|
return result
|
3790
3802
|
|
3791
3803
|
def handle_market_type_and_params(self, methodName: str, market: Market = None, params={}):
|
3792
3804
|
defaultType = self.safe_string_2(self.options, 'defaultType', 'type', 'spot')
|
3793
|
-
methodOptions = self.
|
3805
|
+
methodOptions = self.safe_dict(self.options, methodName)
|
3794
3806
|
methodType = defaultType
|
3795
3807
|
if methodOptions is not None:
|
3796
3808
|
if isinstance(methodOptions, str):
|
@@ -3802,7 +3814,7 @@ class Exchange(object):
|
|
3802
3814
|
params = self.omit(params, ['defaultType', 'type'])
|
3803
3815
|
return [type, params]
|
3804
3816
|
|
3805
|
-
def handle_sub_type_and_params(self, methodName, market=None, params={}, defaultValue=None):
|
3817
|
+
def handle_sub_type_and_params(self, methodName: str, market=None, params={}, defaultValue=None):
|
3806
3818
|
subType = None
|
3807
3819
|
# if set in params, it takes precedence
|
3808
3820
|
subTypeInParams = self.safe_string_2(params, 'subType', 'defaultSubType')
|
@@ -3819,11 +3831,11 @@ class Exchange(object):
|
|
3819
3831
|
subType = 'inverse'
|
3820
3832
|
# if it was not defined in market object
|
3821
3833
|
if subType is None:
|
3822
|
-
values = self.handle_option_and_params(
|
3834
|
+
values = self.handle_option_and_params({}, methodName, 'subType', defaultValue) # no need to re-test params here
|
3823
3835
|
subType = values[0]
|
3824
3836
|
return [subType, params]
|
3825
3837
|
|
3826
|
-
def handle_margin_mode_and_params(self, methodName, params={}, defaultValue=None):
|
3838
|
+
def handle_margin_mode_and_params(self, methodName: str, params={}, defaultValue=None):
|
3827
3839
|
"""
|
3828
3840
|
* @ignore
|
3829
3841
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -3866,7 +3878,7 @@ class Exchange(object):
|
|
3866
3878
|
market = self.market(symbol)
|
3867
3879
|
symbol = market['symbol']
|
3868
3880
|
tickers = self.fetch_tickers([symbol], params)
|
3869
|
-
ticker = self.
|
3881
|
+
ticker = self.safe_dict(tickers, symbol)
|
3870
3882
|
if ticker is None:
|
3871
3883
|
raise NullResponse(self.id + ' fetchTickers() could not find a ticker for ' + symbol)
|
3872
3884
|
else:
|
@@ -3899,7 +3911,7 @@ class Exchange(object):
|
|
3899
3911
|
return order['status']
|
3900
3912
|
|
3901
3913
|
def fetch_unified_order(self, order, params={}):
|
3902
|
-
return self.fetch_order(self.
|
3914
|
+
return self.fetch_order(self.safe_string(order, 'id'), self.safe_string(order, 'symbol'), params)
|
3903
3915
|
|
3904
3916
|
def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
|
3905
3917
|
raise NotSupported(self.id + ' createOrder() is not supported yet')
|
@@ -4124,7 +4136,7 @@ class Exchange(object):
|
|
4124
4136
|
raise NotSupported(self.id + ' cancelAllOrdersWs() is not supported yet')
|
4125
4137
|
|
4126
4138
|
def cancel_unified_order(self, order, params={}):
|
4127
|
-
return self.cancelOrder(self.
|
4139
|
+
return self.cancelOrder(self.safe_string(order, 'id'), self.safe_string(order, 'symbol'), params)
|
4128
4140
|
|
4129
4141
|
def fetch_orders(self, symbol: str = None, since: Int = None, limit: Int = None, params={}):
|
4130
4142
|
if self.has['fetchOpenOrders'] and self.has['fetchClosedOrders']:
|
@@ -4249,7 +4261,7 @@ class Exchange(object):
|
|
4249
4261
|
return currency
|
4250
4262
|
return self.safe_string(self.commonCurrencies, currency, currency)
|
4251
4263
|
|
4252
|
-
def currency(self, code):
|
4264
|
+
def currency(self, code: str):
|
4253
4265
|
if self.currencies is None:
|
4254
4266
|
raise ExchangeError(self.id + ' currencies not loaded')
|
4255
4267
|
if isinstance(code, str):
|
@@ -4558,7 +4570,7 @@ class Exchange(object):
|
|
4558
4570
|
return result
|
4559
4571
|
|
4560
4572
|
def is_trigger_order(self, params):
|
4561
|
-
isTrigger = self.
|
4573
|
+
isTrigger = self.safe_bool_2(params, 'trigger', 'stop')
|
4562
4574
|
if isTrigger:
|
4563
4575
|
params = self.omit(params, ['trigger', 'stop'])
|
4564
4576
|
return [isTrigger, params]
|
@@ -4572,7 +4584,7 @@ class Exchange(object):
|
|
4572
4584
|
:returns boolean: True if a post only order, False otherwise
|
4573
4585
|
"""
|
4574
4586
|
timeInForce = self.safe_string_upper(params, 'timeInForce')
|
4575
|
-
postOnly = self.
|
4587
|
+
postOnly = self.safe_bool_2(params, 'postOnly', 'post_only', False)
|
4576
4588
|
# we assume timeInForce is uppercase from safeStringUpper(params, 'timeInForce')
|
4577
4589
|
ioc = timeInForce == 'IOC'
|
4578
4590
|
fok = timeInForce == 'FOK'
|
@@ -4732,7 +4744,7 @@ class Exchange(object):
|
|
4732
4744
|
:param str account: key for account name in self.options['accountsByType']
|
4733
4745
|
:returns: the exchange specific account name or the isolated margin id for transfers
|
4734
4746
|
"""
|
4735
|
-
accountsByType = self.
|
4747
|
+
accountsByType = self.safe_dict(self.options, 'accountsByType', {})
|
4736
4748
|
lowercaseAccount = account.lower()
|
4737
4749
|
if lowercaseAccount in accountsByType:
|
4738
4750
|
return accountsByType[lowercaseAccount]
|
@@ -5125,7 +5137,7 @@ class Exchange(object):
|
|
5125
5137
|
return input
|
5126
5138
|
|
5127
5139
|
def handle_until_option(self, key, request, params, multiplier=1):
|
5128
|
-
until = self.
|
5140
|
+
until = self.safe_integer_2(params, 'until', 'till')
|
5129
5141
|
if until is not None:
|
5130
5142
|
request[key] = self.parseToInt(until * multiplier)
|
5131
5143
|
params = self.omit(params, ['until', 'till'])
|
ccxt/bigone.py
CHANGED
@@ -1373,7 +1373,7 @@ class bigone(Exchange, ImplicitAPI):
|
|
1373
1373
|
'trades': None,
|
1374
1374
|
}, market)
|
1375
1375
|
|
1376
|
-
def create_market_buy_order_with_cost(self, symbol: str, cost, params={}):
|
1376
|
+
def create_market_buy_order_with_cost(self, symbol: str, cost: float, params={}):
|
1377
1377
|
"""
|
1378
1378
|
create a market buy order by providing the symbol and cost
|
1379
1379
|
:see: https://open.big.one/docs/spot_orders.html#create-order
|
@@ -1971,7 +1971,7 @@ class bigone(Exchange, ImplicitAPI):
|
|
1971
1971
|
withdrawals = self.safe_value(response, 'data', [])
|
1972
1972
|
return self.parse_transactions(withdrawals, currency, since, limit)
|
1973
1973
|
|
1974
|
-
def transfer(self, code: str, amount: float, fromAccount, toAccount, params={}) -> TransferEntry:
|
1974
|
+
def transfer(self, code: str, amount: float, fromAccount: str, toAccount: str, params={}) -> TransferEntry:
|
1975
1975
|
"""
|
1976
1976
|
transfer currency internally between wallets on the same account
|
1977
1977
|
:see: https://open.big.one/docs/spot_transfer.html#transfer-of-user
|