ccxt 4.2.30__py2.py3-none-any.whl → 4.2.34__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/coinbase.py +10 -0
- ccxt/abstract/okx.py +12 -1
- ccxt/ace.py +4 -3
- ccxt/alpaca.py +1 -1
- ccxt/ascendex.py +6 -6
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/ace.py +4 -3
- ccxt/async_support/alpaca.py +1 -1
- ccxt/async_support/ascendex.py +6 -6
- ccxt/async_support/base/exchange.py +62 -39
- ccxt/async_support/bigone.py +25 -5
- ccxt/async_support/binance.py +17 -16
- ccxt/async_support/bingx.py +10 -9
- ccxt/async_support/bit2c.py +13 -1
- ccxt/async_support/bitbank.py +2 -2
- ccxt/async_support/bitbns.py +1 -1
- ccxt/async_support/bitfinex.py +5 -5
- ccxt/async_support/bitfinex2.py +386 -40
- ccxt/async_support/bitflyer.py +5 -5
- ccxt/async_support/bitforex.py +4 -1
- ccxt/async_support/bitget.py +11 -11
- ccxt/async_support/bithumb.py +2 -2
- ccxt/async_support/bitmart.py +9 -9
- ccxt/async_support/bitmex.py +3 -3
- ccxt/async_support/bitopro.py +2 -2
- ccxt/async_support/bitrue.py +8 -8
- ccxt/async_support/bitso.py +4 -4
- ccxt/async_support/bitstamp.py +2 -2
- ccxt/async_support/bitteam.py +1 -1
- ccxt/async_support/bitvavo.py +3 -3
- ccxt/async_support/bl3p.py +1 -1
- ccxt/async_support/blockchaincom.py +3 -3
- ccxt/async_support/btcalpha.py +1 -1
- ccxt/async_support/btcbox.py +1 -1
- ccxt/async_support/btcmarkets.py +2 -2
- ccxt/async_support/btcturk.py +1 -1
- ccxt/async_support/bybit.py +9 -9
- ccxt/async_support/cex.py +1 -1
- ccxt/async_support/coinbase.py +16 -6
- ccxt/async_support/coinbasepro.py +2 -2
- ccxt/async_support/coincheck.py +1 -1
- ccxt/async_support/coinex.py +9 -9
- ccxt/async_support/coinlist.py +4 -4
- ccxt/async_support/coinmate.py +2 -2
- ccxt/async_support/coinmetro.py +2 -2
- ccxt/async_support/coinone.py +1 -1
- ccxt/async_support/coinsph.py +2 -2
- ccxt/async_support/coinspot.py +1 -1
- ccxt/async_support/cryptocom.py +14 -14
- ccxt/async_support/currencycom.py +1 -1
- ccxt/async_support/delta.py +2 -2
- ccxt/async_support/deribit.py +5 -4
- ccxt/async_support/digifinex.py +6 -6
- ccxt/async_support/exmo.py +2 -2
- ccxt/async_support/gate.py +41 -37
- ccxt/async_support/gemini.py +2 -2
- ccxt/async_support/hitbtc.py +5 -5
- ccxt/async_support/hollaex.py +2 -2
- ccxt/async_support/htx.py +11 -11
- ccxt/async_support/huobijp.py +4 -4
- ccxt/async_support/idex.py +2 -2
- ccxt/async_support/independentreserve.py +2 -2
- ccxt/async_support/indodax.py +2 -2
- ccxt/async_support/kraken.py +45 -5
- ccxt/async_support/krakenfutures.py +8 -5
- ccxt/async_support/kucoin.py +8 -8
- ccxt/async_support/kucoinfutures.py +4 -4
- ccxt/async_support/kuna.py +2 -2
- ccxt/async_support/latoken.py +3 -3
- ccxt/async_support/lbank.py +5 -4
- ccxt/async_support/luno.py +1 -1
- ccxt/async_support/lykke.py +2 -2
- ccxt/async_support/mercado.py +2 -2
- ccxt/async_support/mexc.py +7 -6
- ccxt/async_support/ndax.py +2 -2
- ccxt/async_support/novadax.py +4 -4
- ccxt/async_support/oceanex.py +1 -1
- ccxt/async_support/okcoin.py +5 -5
- ccxt/async_support/okx.py +26 -12
- ccxt/async_support/onetrading.py +2 -2
- ccxt/async_support/p2b.py +1 -1
- ccxt/async_support/paymium.py +3 -3
- ccxt/async_support/phemex.py +13 -13
- ccxt/async_support/poloniex.py +4 -4
- ccxt/async_support/poloniexfutures.py +4 -1
- ccxt/async_support/probit.py +5 -5
- ccxt/async_support/timex.py +2 -2
- ccxt/async_support/tokocrypto.py +4 -4
- ccxt/async_support/upbit.py +2 -2
- ccxt/async_support/wavesexchange.py +4 -3
- ccxt/async_support/wazirx.py +1 -1
- ccxt/async_support/whitebit.py +6 -6
- ccxt/async_support/woo.py +6 -6
- ccxt/async_support/yobit.py +41 -2
- ccxt/async_support/zaif.py +2 -2
- ccxt/async_support/zonda.py +4 -4
- ccxt/base/exchange.py +77 -44
- ccxt/base/types.py +10 -0
- ccxt/bigone.py +25 -5
- ccxt/binance.py +17 -16
- ccxt/bingx.py +10 -9
- ccxt/bit2c.py +13 -1
- ccxt/bitbank.py +2 -2
- ccxt/bitbns.py +1 -1
- ccxt/bitfinex.py +5 -5
- ccxt/bitfinex2.py +386 -40
- ccxt/bitflyer.py +5 -5
- ccxt/bitforex.py +4 -1
- ccxt/bitget.py +11 -11
- ccxt/bithumb.py +2 -2
- ccxt/bitmart.py +9 -9
- ccxt/bitmex.py +3 -3
- ccxt/bitopro.py +2 -2
- ccxt/bitrue.py +8 -8
- ccxt/bitso.py +4 -4
- ccxt/bitstamp.py +2 -2
- ccxt/bitteam.py +1 -1
- ccxt/bitvavo.py +3 -3
- ccxt/bl3p.py +1 -1
- ccxt/blockchaincom.py +3 -3
- ccxt/btcalpha.py +1 -1
- ccxt/btcbox.py +1 -1
- ccxt/btcmarkets.py +2 -2
- ccxt/btcturk.py +1 -1
- ccxt/bybit.py +9 -9
- ccxt/cex.py +1 -1
- ccxt/coinbase.py +16 -6
- ccxt/coinbasepro.py +2 -2
- ccxt/coincheck.py +1 -1
- ccxt/coinex.py +9 -9
- ccxt/coinlist.py +4 -4
- ccxt/coinmate.py +2 -2
- ccxt/coinmetro.py +2 -2
- ccxt/coinone.py +1 -1
- ccxt/coinsph.py +2 -2
- ccxt/coinspot.py +1 -1
- ccxt/cryptocom.py +14 -14
- ccxt/currencycom.py +1 -1
- ccxt/delta.py +2 -2
- ccxt/deribit.py +5 -4
- ccxt/digifinex.py +6 -6
- ccxt/exmo.py +2 -2
- ccxt/gate.py +41 -37
- ccxt/gemini.py +2 -2
- ccxt/hitbtc.py +5 -5
- ccxt/hollaex.py +2 -2
- ccxt/htx.py +11 -11
- ccxt/huobijp.py +4 -4
- ccxt/idex.py +2 -2
- ccxt/independentreserve.py +2 -2
- ccxt/indodax.py +2 -2
- ccxt/kraken.py +45 -5
- ccxt/krakenfutures.py +8 -5
- ccxt/kucoin.py +8 -8
- ccxt/kucoinfutures.py +4 -4
- ccxt/kuna.py +2 -2
- ccxt/latoken.py +3 -3
- ccxt/lbank.py +5 -4
- ccxt/luno.py +1 -1
- ccxt/lykke.py +2 -2
- ccxt/mercado.py +2 -2
- ccxt/mexc.py +7 -6
- ccxt/ndax.py +2 -2
- ccxt/novadax.py +4 -4
- ccxt/oceanex.py +1 -1
- ccxt/okcoin.py +5 -5
- ccxt/okx.py +26 -12
- ccxt/onetrading.py +2 -2
- ccxt/p2b.py +1 -1
- ccxt/paymium.py +3 -3
- ccxt/phemex.py +13 -13
- ccxt/poloniex.py +4 -4
- ccxt/poloniexfutures.py +4 -1
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/alpaca.py +8 -4
- ccxt/pro/ascendex.py +1 -2
- ccxt/pro/binance.py +14 -10
- ccxt/pro/bingx.py +1 -1
- ccxt/pro/bitfinex.py +21 -22
- ccxt/pro/bitfinex2.py +13 -15
- ccxt/pro/bitget.py +3 -1
- ccxt/pro/bitmart.py +3 -7
- ccxt/pro/bitmex.py +4 -6
- ccxt/pro/bitopro.py +2 -4
- ccxt/pro/bitrue.py +1 -1
- ccxt/pro/bitstamp.py +2 -3
- ccxt/pro/bitvavo.py +10 -5
- ccxt/pro/blockchaincom.py +22 -22
- ccxt/pro/bybit.py +5 -5
- ccxt/pro/cex.py +7 -7
- ccxt/pro/coinbase.py +3 -2
- ccxt/pro/coinbasepro.py +1 -1
- ccxt/pro/coinex.py +15 -13
- ccxt/pro/currencycom.py +5 -6
- ccxt/pro/deribit.py +4 -4
- ccxt/pro/exmo.py +15 -13
- ccxt/pro/gate.py +1 -1
- ccxt/pro/gemini.py +4 -2
- ccxt/pro/hitbtc.py +10 -9
- ccxt/pro/hollaex.py +2 -2
- ccxt/pro/htx.py +6 -6
- ccxt/pro/huobijp.py +3 -4
- ccxt/pro/idex.py +1 -1
- ccxt/pro/independentreserve.py +14 -13
- ccxt/pro/kraken.py +10 -14
- ccxt/pro/krakenfutures.py +10 -6
- ccxt/pro/kucoin.py +10 -10
- ccxt/pro/kucoinfutures.py +11 -10
- ccxt/pro/lbank.py +10 -10
- ccxt/pro/luno.py +12 -14
- ccxt/pro/mexc.py +3 -2
- ccxt/pro/ndax.py +7 -11
- ccxt/pro/okcoin.py +7 -10
- ccxt/pro/okx.py +6 -9
- ccxt/pro/onetrading.py +16 -15
- ccxt/pro/p2b.py +5 -3
- ccxt/pro/phemex.py +16 -11
- ccxt/pro/poloniex.py +6 -4
- ccxt/pro/poloniexfutures.py +13 -9
- ccxt/pro/probit.py +15 -12
- ccxt/pro/upbit.py +8 -8
- ccxt/pro/wazirx.py +6 -3
- ccxt/pro/woo.py +9 -7
- ccxt/probit.py +5 -5
- ccxt/test/base/test_order_book.py +7 -7
- ccxt/test/base/test_shared_methods.py +1 -1
- ccxt/test/test_async.py +86 -36
- ccxt/test/test_sync.py +86 -36
- ccxt/timex.py +2 -2
- ccxt/tokocrypto.py +4 -4
- ccxt/upbit.py +2 -2
- ccxt/wavesexchange.py +4 -3
- ccxt/wazirx.py +1 -1
- ccxt/whitebit.py +6 -6
- ccxt/woo.py +6 -6
- ccxt/yobit.py +41 -2
- ccxt/zaif.py +2 -2
- ccxt/zonda.py +4 -4
- {ccxt-4.2.30.dist-info → ccxt-4.2.34.dist-info}/METADATA +10 -10
- ccxt-4.2.34.dist-info/RECORD +438 -0
- ccxt-4.2.30.dist-info/RECORD +0 -438
- {ccxt-4.2.30.dist-info → ccxt-4.2.34.dist-info}/WHEEL +0 -0
- {ccxt-4.2.30.dist-info → ccxt-4.2.34.dist-info}/top_level.txt +0 -0
ccxt/binance.py
CHANGED
@@ -7,7 +7,7 @@ from ccxt.base.exchange import Exchange
|
|
7
7
|
from ccxt.abstract.binance import ImplicitAPI
|
8
8
|
import hashlib
|
9
9
|
import json
|
10
|
-
from ccxt.base.types import Balances, Currency, Greeks, Int, Market, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
|
10
|
+
from ccxt.base.types import Balances, Currency, Greeks, Int, Market, Order, TransferEntry, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
|
11
11
|
from typing import List
|
12
12
|
from ccxt.base.errors import ExchangeError
|
13
13
|
from ccxt.base.errors import PermissionDenied
|
@@ -3089,7 +3089,7 @@ class binance(Exchange, ImplicitAPI):
|
|
3089
3089
|
account['debt'] = Precise.string_add(debt, interest)
|
3090
3090
|
return account
|
3091
3091
|
|
3092
|
-
def
|
3092
|
+
def parse_balance_custom(self, response, type=None, marginMode=None) -> Balances:
|
3093
3093
|
result = {
|
3094
3094
|
'info': response,
|
3095
3095
|
}
|
@@ -3407,7 +3407,7 @@ class binance(Exchange, ImplicitAPI):
|
|
3407
3407
|
# }
|
3408
3408
|
# ]
|
3409
3409
|
#
|
3410
|
-
return self.
|
3410
|
+
return self.parse_balance_custom(response, type, marginMode)
|
3411
3411
|
|
3412
3412
|
def fetch_order_book(self, symbol: str, limit: Int = None, params={}) -> OrderBook:
|
3413
3413
|
"""
|
@@ -4354,7 +4354,7 @@ class binance(Exchange, ImplicitAPI):
|
|
4354
4354
|
#
|
4355
4355
|
return self.parse_trades(response, market, since, limit)
|
4356
4356
|
|
4357
|
-
def edit_spot_order(self, id: str, symbol, type, side, amount, price=None, params={}):
|
4357
|
+
def edit_spot_order(self, id: str, symbol, type, side, amount: float, price: float = None, params={}):
|
4358
4358
|
"""
|
4359
4359
|
* @ignore
|
4360
4360
|
edit a trade order
|
@@ -4417,7 +4417,7 @@ class binance(Exchange, ImplicitAPI):
|
|
4417
4417
|
data = self.safe_value(response, 'newOrderResponse')
|
4418
4418
|
return self.parse_order(data, market)
|
4419
4419
|
|
4420
|
-
def edit_spot_order_request(self, id: str, symbol, type, side, amount, price=None, params={}):
|
4420
|
+
def edit_spot_order_request(self, id: str, symbol, type, side, amount: float, price: float = None, params={}):
|
4421
4421
|
"""
|
4422
4422
|
* @ignore
|
4423
4423
|
helper function to build request for editSpotOrder
|
@@ -4522,7 +4522,7 @@ class binance(Exchange, ImplicitAPI):
|
|
4522
4522
|
params = self.omit(params, ['quoteOrderQty', 'cost', 'stopPrice', 'newClientOrderId', 'clientOrderId', 'postOnly'])
|
4523
4523
|
return self.extend(request, params)
|
4524
4524
|
|
4525
|
-
def edit_contract_order(self, id: str, symbol, type, side, amount, price=None, params={}):
|
4525
|
+
def edit_contract_order(self, id: str, symbol, type, side, amount: float, price: float = None, params={}):
|
4526
4526
|
"""
|
4527
4527
|
edit a trade order
|
4528
4528
|
:see: https://binance-docs.github.io/apidocs/futures/en/#modify-order-trade
|
@@ -4945,7 +4945,7 @@ class binance(Exchange, ImplicitAPI):
|
|
4945
4945
|
#
|
4946
4946
|
return self.parse_orders(response)
|
4947
4947
|
|
4948
|
-
def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
|
4948
|
+
def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
|
4949
4949
|
"""
|
4950
4950
|
create a trade order
|
4951
4951
|
:see: https://binance-docs.github.io/apidocs/spot/en/#new-order-trade
|
@@ -4994,7 +4994,7 @@ class binance(Exchange, ImplicitAPI):
|
|
4994
4994
|
response = getattr(self, method)(request)
|
4995
4995
|
return self.parse_order(response, market)
|
4996
4996
|
|
4997
|
-
def create_order_request(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
|
4997
|
+
def create_order_request(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
|
4998
4998
|
"""
|
4999
4999
|
* @ignore
|
5000
5000
|
helper function to build request
|
@@ -5020,7 +5020,7 @@ class binance(Exchange, ImplicitAPI):
|
|
5020
5020
|
stopLossPrice = self.safe_value(params, 'stopLossPrice', triggerPrice) # fallback to stopLoss
|
5021
5021
|
takeProfitPrice = self.safe_value(params, 'takeProfitPrice')
|
5022
5022
|
trailingDelta = self.safe_value(params, 'trailingDelta')
|
5023
|
-
trailingTriggerPrice = self.safe_string_2(params, 'trailingTriggerPrice', 'activationPrice', price)
|
5023
|
+
trailingTriggerPrice = self.safe_string_2(params, 'trailingTriggerPrice', 'activationPrice', self.number_to_string(price))
|
5024
5024
|
trailingPercent = self.safe_string_2(params, 'trailingPercent', 'callbackRate')
|
5025
5025
|
isTrailingPercentOrder = trailingPercent is not None
|
5026
5026
|
isStopLoss = stopLossPrice is not None or trailingDelta is not None
|
@@ -5514,7 +5514,7 @@ class binance(Exchange, ImplicitAPI):
|
|
5514
5514
|
params = self.omit(params, 'type')
|
5515
5515
|
orders = self.fetch_orders(symbol, since, None, params)
|
5516
5516
|
filteredOrders = self.filter_by(orders, 'status', 'canceled')
|
5517
|
-
return self.
|
5517
|
+
return self.filter_by_since_limit(filteredOrders, since, limit)
|
5518
5518
|
|
5519
5519
|
def cancel_order(self, id: str, symbol: Str = None, params={}):
|
5520
5520
|
"""
|
@@ -6432,7 +6432,7 @@ class binance(Exchange, ImplicitAPI):
|
|
6432
6432
|
'amount': amount,
|
6433
6433
|
}
|
6434
6434
|
|
6435
|
-
def transfer(self, code: str, amount, fromAccount, toAccount, params={}):
|
6435
|
+
def transfer(self, code: str, amount: float, fromAccount, toAccount, params={}) -> TransferEntry:
|
6436
6436
|
"""
|
6437
6437
|
transfer currency internally between wallets on the same account
|
6438
6438
|
:see: https://binance-docs.github.io/apidocs/spot/en/#user-universal-transfer-user_data
|
@@ -6882,7 +6882,7 @@ class binance(Exchange, ImplicitAPI):
|
|
6882
6882
|
}
|
6883
6883
|
return result
|
6884
6884
|
|
6885
|
-
def withdraw(self, code: str, amount, address, tag=None, params={}):
|
6885
|
+
def withdraw(self, code: str, amount: float, address, tag=None, params={}):
|
6886
6886
|
"""
|
6887
6887
|
make a withdrawal
|
6888
6888
|
:see: https://binance-docs.github.io/apidocs/spot/en/#withdraw-user_data
|
@@ -8207,7 +8207,7 @@ class binance(Exchange, ImplicitAPI):
|
|
8207
8207
|
raise NotSupported(self.id + ' fetchFundingHistory() supports linear and inverse contracts only')
|
8208
8208
|
return self.parse_incomes(response, market, since, limit)
|
8209
8209
|
|
8210
|
-
def set_leverage(self, leverage, symbol: Str = None, params={}):
|
8210
|
+
def set_leverage(self, leverage: Int, symbol: Str = None, params={}):
|
8211
8211
|
"""
|
8212
8212
|
set the level of leverage for a market
|
8213
8213
|
:see: https://binance-docs.github.io/apidocs/futures/en/#change-initial-leverage-trade
|
@@ -8847,7 +8847,7 @@ class binance(Exchange, ImplicitAPI):
|
|
8847
8847
|
return entry[1]
|
8848
8848
|
return self.safe_value(config, 'cost', 1)
|
8849
8849
|
|
8850
|
-
def request(self, path, api='public', method='GET', params={}, headers=None, body=None, config={}
|
8850
|
+
def request(self, path, api='public', method='GET', params={}, headers=None, body=None, config={}):
|
8851
8851
|
response = self.fetch2(path, api, method, params, headers, body, config)
|
8852
8852
|
# a workaround for {"code":-2015,"msg":"Invalid API-key, IP, or permissions for action."}
|
8853
8853
|
if api == 'private':
|
@@ -9225,7 +9225,7 @@ class binance(Exchange, ImplicitAPI):
|
|
9225
9225
|
#
|
9226
9226
|
return self.parse_margin_loan(response, currency)
|
9227
9227
|
|
9228
|
-
def borrow_cross_margin(self, code: str, amount, params={}):
|
9228
|
+
def borrow_cross_margin(self, code: str, amount: float, params={}):
|
9229
9229
|
"""
|
9230
9230
|
create a loan to borrow margin
|
9231
9231
|
:see: https://binance-docs.github.io/apidocs/spot/en/#margin-account-borrow-repay-margin
|
@@ -9251,7 +9251,7 @@ class binance(Exchange, ImplicitAPI):
|
|
9251
9251
|
#
|
9252
9252
|
return self.parse_margin_loan(response, currency)
|
9253
9253
|
|
9254
|
-
def borrow_isolated_margin(self, symbol: str, code: str, amount, params={}):
|
9254
|
+
def borrow_isolated_margin(self, symbol: str, code: str, amount: float, params={}):
|
9255
9255
|
"""
|
9256
9256
|
create a loan to borrow margin
|
9257
9257
|
:see: https://binance-docs.github.io/apidocs/spot/en/#margin-account-borrow-repay-margin
|
@@ -9420,6 +9420,7 @@ class binance(Exchange, ImplicitAPI):
|
|
9420
9420
|
return item
|
9421
9421
|
else:
|
9422
9422
|
return self.parse_open_interest(response, market)
|
9423
|
+
return None
|
9423
9424
|
|
9424
9425
|
def parse_open_interest(self, interest, market: Market = None):
|
9425
9426
|
timestamp = self.safe_integer_2(interest, 'timestamp', 'time')
|
ccxt/bingx.py
CHANGED
@@ -7,7 +7,7 @@ from ccxt.base.exchange import Exchange
|
|
7
7
|
from ccxt.abstract.bingx import ImplicitAPI
|
8
8
|
import hashlib
|
9
9
|
import numbers
|
10
|
-
from ccxt.base.types import Balances, Currency, Int, Market, Order, OrderBook, OrderRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade, Transaction
|
10
|
+
from ccxt.base.types import Balances, Currency, Int, Market, Order, TransferEntry, OrderBook, OrderRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade, Transaction
|
11
11
|
from typing import List
|
12
12
|
from ccxt.base.errors import ExchangeError
|
13
13
|
from ccxt.base.errors import PermissionDenied
|
@@ -1679,7 +1679,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
1679
1679
|
params['quoteOrderQty'] = cost
|
1680
1680
|
return self.create_order(symbol, 'market', 'sell', cost, None, params)
|
1681
1681
|
|
1682
|
-
def create_order_request(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
|
1682
|
+
def create_order_request(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
|
1683
1683
|
"""
|
1684
1684
|
* @ignore
|
1685
1685
|
helper function to build request
|
@@ -1782,6 +1782,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
1782
1782
|
requestTrailingPercent = Precise.string_div(trailingPercent, '100')
|
1783
1783
|
request['priceRate'] = self.parse_to_numeric(requestTrailingPercent)
|
1784
1784
|
if isStopLoss or isTakeProfit:
|
1785
|
+
stringifiedAmount = self.number_to_string(amount)
|
1785
1786
|
if isStopLoss:
|
1786
1787
|
slTriggerPrice = self.safe_string_2(stopLoss, 'triggerPrice', 'stopPrice', stopLoss)
|
1787
1788
|
slWorkingType = self.safe_string(stopLoss, 'workingType', 'MARK_PRICE')
|
@@ -1794,7 +1795,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
1794
1795
|
slPrice = self.safe_string(stopLoss, 'price')
|
1795
1796
|
if slPrice is not None:
|
1796
1797
|
slRequest['price'] = self.parse_to_numeric(self.price_to_precision(symbol, slPrice))
|
1797
|
-
slQuantity = self.safe_string(stopLoss, 'quantity',
|
1798
|
+
slQuantity = self.safe_string(stopLoss, 'quantity', stringifiedAmount)
|
1798
1799
|
slRequest['quantity'] = self.parse_to_numeric(self.amount_to_precision(symbol, slQuantity))
|
1799
1800
|
request['stopLoss'] = self.json(slRequest)
|
1800
1801
|
if isTakeProfit:
|
@@ -1809,7 +1810,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
1809
1810
|
slPrice = self.safe_string(takeProfit, 'price')
|
1810
1811
|
if slPrice is not None:
|
1811
1812
|
tpRequest['price'] = self.parse_to_numeric(self.price_to_precision(symbol, slPrice))
|
1812
|
-
tkQuantity = self.safe_string(takeProfit, 'quantity',
|
1813
|
+
tkQuantity = self.safe_string(takeProfit, 'quantity', stringifiedAmount)
|
1813
1814
|
tpRequest['quantity'] = self.parse_to_numeric(self.amount_to_precision(symbol, tkQuantity))
|
1814
1815
|
request['takeProfit'] = self.json(tpRequest)
|
1815
1816
|
positionSide = None
|
@@ -1822,7 +1823,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
1822
1823
|
params = self.omit(params, ['reduceOnly', 'triggerPrice', 'stopLossPrice', 'takeProfitPrice', 'trailingAmount', 'trailingPercent', 'takeProfit', 'stopLoss', 'clientOrderId'])
|
1823
1824
|
return self.extend(request, params)
|
1824
1825
|
|
1825
|
-
def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
|
1826
|
+
def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
|
1826
1827
|
"""
|
1827
1828
|
create a trade order
|
1828
1829
|
:see: https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#Trade%20order
|
@@ -2681,7 +2682,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
2681
2682
|
orders = self.safe_value(data, 'orders', [])
|
2682
2683
|
return self.parse_orders(orders, market, since, limit)
|
2683
2684
|
|
2684
|
-
def transfer(self, code: str, amount, fromAccount, toAccount, params={}):
|
2685
|
+
def transfer(self, code: str, amount: float, fromAccount, toAccount, params={}) -> TransferEntry:
|
2685
2686
|
"""
|
2686
2687
|
transfer currency internally between wallets on the same account
|
2687
2688
|
:see: https://bingx-api.github.io/docs/#/spot/account-api.html#User%20Universal%20Transfer
|
@@ -3137,7 +3138,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
3137
3138
|
#
|
3138
3139
|
return response
|
3139
3140
|
|
3140
|
-
def set_leverage(self, leverage, symbol: Str = None, params={}):
|
3141
|
+
def set_leverage(self, leverage: Int, symbol: Str = None, params={}):
|
3141
3142
|
"""
|
3142
3143
|
set the level of leverage for a market
|
3143
3144
|
:see: https://bingx-api.github.io/docs/#/swapV2/trade-api.html#Switch%20Leverage
|
@@ -3333,7 +3334,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
3333
3334
|
coins = self.safe_value(response, 'data')
|
3334
3335
|
return self.parse_deposit_withdraw_fees(coins, codes, 'coin')
|
3335
3336
|
|
3336
|
-
def withdraw(self, code: str, amount, address, tag=None, params={}):
|
3337
|
+
def withdraw(self, code: str, amount: float, address, tag=None, params={}):
|
3337
3338
|
"""
|
3338
3339
|
make a withdrawal
|
3339
3340
|
:see: https://bingx-api.github.io/docs/#/common/account-api.html#Withdraw
|
@@ -3371,7 +3372,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
3371
3372
|
# "id":"1197073063359000577"
|
3372
3373
|
# }
|
3373
3374
|
# }
|
3374
|
-
self.parse_transaction(data)
|
3375
|
+
return self.parse_transaction(data)
|
3375
3376
|
|
3376
3377
|
def parse_params(self, params):
|
3377
3378
|
sortedParams = self.keysort(params)
|
ccxt/bit2c.py
CHANGED
@@ -212,6 +212,7 @@ class bit2c(Exchange, ImplicitAPI):
|
|
212
212
|
def fetch_balance(self, params={}) -> Balances:
|
213
213
|
"""
|
214
214
|
query for balance and get the amount of funds available for trading or funds locked in orders
|
215
|
+
:see: https://bit2c.co.il/home/api#balance
|
215
216
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
216
217
|
:returns dict: a `balance structure <https://docs.ccxt.com/#/?id=balance-structure>`
|
217
218
|
"""
|
@@ -264,6 +265,7 @@ class bit2c(Exchange, ImplicitAPI):
|
|
264
265
|
def fetch_order_book(self, symbol: str, limit: Int = None, params={}) -> OrderBook:
|
265
266
|
"""
|
266
267
|
fetches information on open orders with bid(buy) and ask(sell) prices, volumes and other data
|
268
|
+
:see: https://bit2c.co.il/home/api#orderb
|
267
269
|
:param str symbol: unified symbol of the market to fetch the order book for
|
268
270
|
:param int [limit]: the maximum amount of order book entries to return
|
269
271
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -308,6 +310,7 @@ class bit2c(Exchange, ImplicitAPI):
|
|
308
310
|
def fetch_ticker(self, symbol: str, params={}) -> Ticker:
|
309
311
|
"""
|
310
312
|
fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
313
|
+
:see: https://bit2c.co.il/home/api#ticker
|
311
314
|
:param str symbol: unified symbol of the market to fetch the ticker for
|
312
315
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
313
316
|
:returns dict: a `ticker structure <https://docs.ccxt.com/#/?id=ticker-structure>`
|
@@ -323,6 +326,8 @@ class bit2c(Exchange, ImplicitAPI):
|
|
323
326
|
def fetch_trades(self, symbol: str, since: Int = None, limit: Int = None, params={}) -> List[Trade]:
|
324
327
|
"""
|
325
328
|
get the list of most recent trades for a particular symbol
|
329
|
+
:see: https://bit2c.co.il/home/api#transactions
|
330
|
+
:see: https://bit2c.co.il/home/api#trades
|
326
331
|
:param str symbol: unified symbol of the market to fetch trades for
|
327
332
|
:param int [since]: timestamp in ms of the earliest trade to fetch
|
328
333
|
:param int [limit]: the maximum amount of trades to fetch
|
@@ -358,6 +363,7 @@ class bit2c(Exchange, ImplicitAPI):
|
|
358
363
|
def fetch_trading_fees(self, params={}):
|
359
364
|
"""
|
360
365
|
fetch the trading fees for multiple markets
|
366
|
+
:see: https://bit2c.co.il/home/api#balance
|
361
367
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
362
368
|
:returns dict: a dictionary of `fee structures <https://docs.ccxt.com/#/?id=fee-structure>` indexed by market symbols
|
363
369
|
"""
|
@@ -400,9 +406,10 @@ class bit2c(Exchange, ImplicitAPI):
|
|
400
406
|
}
|
401
407
|
return result
|
402
408
|
|
403
|
-
def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
|
409
|
+
def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
|
404
410
|
"""
|
405
411
|
create a trade order
|
412
|
+
:see: https://bit2c.co.il/home/api#addo
|
406
413
|
:param str symbol: unified symbol of the market to create an order in
|
407
414
|
:param str type: 'market' or 'limit'
|
408
415
|
:param str side: 'buy' or 'sell'
|
@@ -432,6 +439,7 @@ class bit2c(Exchange, ImplicitAPI):
|
|
432
439
|
def cancel_order(self, id: str, symbol: Str = None, params={}):
|
433
440
|
"""
|
434
441
|
cancels an open order
|
442
|
+
:see: https://bit2c.co.il/home/api#cancelo
|
435
443
|
:param str id: order id
|
436
444
|
:param str symbol: Not used by bit2c cancelOrder()
|
437
445
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -445,6 +453,7 @@ class bit2c(Exchange, ImplicitAPI):
|
|
445
453
|
def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
446
454
|
"""
|
447
455
|
fetch all unfilled currently open orders
|
456
|
+
:see: https://bit2c.co.il/home/api#geto
|
448
457
|
:param str symbol: unified market symbol
|
449
458
|
:param int [since]: the earliest time in ms to fetch open orders for
|
450
459
|
:param int [limit]: the maximum number of open order structures to retrieve
|
@@ -467,6 +476,7 @@ class bit2c(Exchange, ImplicitAPI):
|
|
467
476
|
def fetch_order(self, id: str, symbol: Str = None, params={}):
|
468
477
|
"""
|
469
478
|
fetches information on an order made by the user
|
479
|
+
:see: https://bit2c.co.il/home/api#getoid
|
470
480
|
:param str symbol: unified market symbol
|
471
481
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
472
482
|
:returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
@@ -603,6 +613,7 @@ class bit2c(Exchange, ImplicitAPI):
|
|
603
613
|
def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
604
614
|
"""
|
605
615
|
fetch all trades made by the user
|
616
|
+
:see: https://bit2c.co.il/home/api#orderh
|
606
617
|
:param str symbol: unified market symbol
|
607
618
|
:param int [since]: the earliest time in ms to fetch trades for
|
608
619
|
:param int [limit]: the maximum number of trades structures to retrieve
|
@@ -769,6 +780,7 @@ class bit2c(Exchange, ImplicitAPI):
|
|
769
780
|
def fetch_deposit_address(self, code: str, params={}):
|
770
781
|
"""
|
771
782
|
fetch the deposit address for a currency associated with self account
|
783
|
+
:see: https://bit2c.co.il/home/api#addc
|
772
784
|
:param str code: unified currency code
|
773
785
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
774
786
|
:returns dict: an `address structure <https://docs.ccxt.com/#/?id=address-structure>`
|
ccxt/bitbank.py
CHANGED
@@ -622,7 +622,7 @@ class bitbank(Exchange, ImplicitAPI):
|
|
622
622
|
'info': order,
|
623
623
|
}, market)
|
624
624
|
|
625
|
-
def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
|
625
|
+
def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
|
626
626
|
"""
|
627
627
|
create a trade order
|
628
628
|
:see: https://github.com/bitbankinc/bitbank-api-docs/blob/38d6d7c6f486c793872fd4b4087a0d090a04cd0a/rest-api.md#create-new-order
|
@@ -761,7 +761,7 @@ class bitbank(Exchange, ImplicitAPI):
|
|
761
761
|
'info': response,
|
762
762
|
}
|
763
763
|
|
764
|
-
def withdraw(self, code: str, amount, address, tag=None, params={}):
|
764
|
+
def withdraw(self, code: str, amount: float, address, tag=None, params={}):
|
765
765
|
"""
|
766
766
|
make a withdrawal
|
767
767
|
:see: https://github.com/bitbankinc/bitbank-api-docs/blob/38d6d7c6f486c793872fd4b4087a0d090a04cd0a/rest-api.md#new-withdrawal-request
|
ccxt/bitbns.py
CHANGED
@@ -564,7 +564,7 @@ class bitbns(Exchange, ImplicitAPI):
|
|
564
564
|
'trades': None,
|
565
565
|
}, market)
|
566
566
|
|
567
|
-
def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
|
567
|
+
def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
|
568
568
|
"""
|
569
569
|
create a trade order
|
570
570
|
:see: https://docs.bitbns.com/bitbns/rest-endpoints/order-apis/version-2/place-orders
|
ccxt/bitfinex.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.bitfinex import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Balances, Currency, Int, Market, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
|
9
|
+
from ccxt.base.types import Balances, Currency, Int, Market, Order, TransferEntry, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
12
|
from ccxt.base.errors import PermissionDenied
|
@@ -724,7 +724,7 @@ class bitfinex(Exchange, ImplicitAPI):
|
|
724
724
|
result[code] = account
|
725
725
|
return self.safe_balance(result)
|
726
726
|
|
727
|
-
def transfer(self, code: str, amount, fromAccount, toAccount, params={}):
|
727
|
+
def transfer(self, code: str, amount: float, fromAccount, toAccount, params={}) -> TransferEntry:
|
728
728
|
"""
|
729
729
|
transfer currency internally between wallets on the same account
|
730
730
|
:param str code: unified currency code
|
@@ -953,7 +953,7 @@ class bitfinex(Exchange, ImplicitAPI):
|
|
953
953
|
'fee': fee,
|
954
954
|
}, market)
|
955
955
|
|
956
|
-
def fetch_trades(self, symbol: str, since: Int = None, limit=50, params={}) -> List[Trade]:
|
956
|
+
def fetch_trades(self, symbol: str, since: Int = None, limit: Int = 50, params={}) -> List[Trade]:
|
957
957
|
"""
|
958
958
|
get the list of most recent trades for a particular symbol
|
959
959
|
:param str symbol: unified symbol of the market to fetch trades for
|
@@ -1008,7 +1008,7 @@ class bitfinex(Exchange, ImplicitAPI):
|
|
1008
1008
|
response = self.privatePostMytrades(self.extend(request, params))
|
1009
1009
|
return self.parse_trades(response, market, since, limit)
|
1010
1010
|
|
1011
|
-
def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
|
1011
|
+
def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
|
1012
1012
|
"""
|
1013
1013
|
create a trade order
|
1014
1014
|
:param str symbol: unified symbol of the market to create an order in
|
@@ -1441,7 +1441,7 @@ class bitfinex(Exchange, ImplicitAPI):
|
|
1441
1441
|
}
|
1442
1442
|
return self.safe_string(statuses, status, status)
|
1443
1443
|
|
1444
|
-
def withdraw(self, code: str, amount, address, tag=None, params={}):
|
1444
|
+
def withdraw(self, code: str, amount: float, address, tag=None, params={}):
|
1445
1445
|
"""
|
1446
1446
|
make a withdrawal
|
1447
1447
|
:param str code: unified currency code
|