ccxt 4.4.51__py2.py3-none-any.whl → 4.4.53__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ccxt/__init__.py +1 -1
- ccxt/abstract/binance.py +0 -1
- ccxt/abstract/binancecoinm.py +0 -1
- ccxt/abstract/binanceus.py +0 -1
- ccxt/abstract/binanceusdm.py +0 -1
- ccxt/ace.py +3 -0
- ccxt/alpaca.py +5 -0
- ccxt/ascendex.py +2 -1
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/ace.py +3 -0
- ccxt/async_support/alpaca.py +5 -0
- ccxt/async_support/ascendex.py +2 -1
- ccxt/async_support/base/exchange.py +20 -3
- ccxt/async_support/bigone.py +5 -0
- ccxt/async_support/binance.py +55 -69
- ccxt/async_support/bingx.py +25 -29
- ccxt/async_support/bit2c.py +3 -0
- ccxt/async_support/bitbank.py +3 -0
- ccxt/async_support/bitbns.py +3 -0
- ccxt/async_support/bitfinex.py +6 -1
- ccxt/async_support/bitflyer.py +6 -1
- ccxt/async_support/bitget.py +8 -4
- ccxt/async_support/bithumb.py +3 -1
- ccxt/async_support/bitmart.py +22 -12
- ccxt/async_support/bitmex.py +99 -93
- ccxt/async_support/bitopro.py +7 -2
- ccxt/async_support/bitrue.py +4 -0
- ccxt/async_support/bitso.py +5 -2
- ccxt/async_support/bitstamp.py +3 -0
- ccxt/async_support/bitteam.py +5 -0
- ccxt/async_support/bitvavo.py +4 -0
- ccxt/async_support/blockchaincom.py +4 -0
- ccxt/async_support/blofin.py +3 -0
- ccxt/async_support/btcalpha.py +5 -0
- ccxt/async_support/btcbox.py +3 -2
- ccxt/async_support/btcmarkets.py +5 -0
- ccxt/async_support/btcturk.py +3 -0
- ccxt/async_support/bybit.py +10 -4
- ccxt/async_support/cex.py +2 -0
- ccxt/async_support/coinbase.py +19 -12
- ccxt/async_support/coinbaseexchange.py +5 -0
- ccxt/async_support/coinbaseinternational.py +21 -2
- ccxt/async_support/coincatch.py +3 -0
- ccxt/async_support/coincheck.py +2 -0
- ccxt/async_support/coinex.py +5 -1
- ccxt/async_support/coinlist.py +5 -0
- ccxt/async_support/coinmate.py +4 -0
- ccxt/async_support/coinmetro.py +9 -5
- ccxt/async_support/coinone.py +3 -0
- ccxt/async_support/coinsph.py +4 -0
- ccxt/async_support/coinspot.py +1 -0
- ccxt/async_support/cryptocom.py +5 -0
- ccxt/async_support/currencycom.py +3 -0
- ccxt/async_support/defx.py +5 -0
- ccxt/async_support/delta.py +4 -1
- ccxt/async_support/deribit.py +16 -5
- ccxt/async_support/digifinex.py +10 -5
- ccxt/async_support/ellipx.py +9 -5
- ccxt/async_support/exmo.py +6 -3
- ccxt/async_support/gate.py +5 -1
- ccxt/async_support/gemini.py +3 -0
- ccxt/async_support/hashkey.py +5 -4
- ccxt/async_support/hitbtc.py +6 -2
- ccxt/async_support/hollaex.py +7 -2
- ccxt/async_support/htx.py +8 -1
- ccxt/async_support/huobijp.py +5 -0
- ccxt/async_support/hyperliquid.py +6 -1
- ccxt/async_support/idex.py +5 -1
- ccxt/async_support/independentreserve.py +4 -0
- ccxt/async_support/indodax.py +3 -0
- ccxt/async_support/kraken.py +6 -4
- ccxt/async_support/krakenfutures.py +5 -2
- ccxt/async_support/kucoin.py +13 -6
- ccxt/async_support/kucoinfutures.py +5 -1
- ccxt/async_support/kuna.py +3 -0
- ccxt/async_support/latoken.py +4 -0
- ccxt/async_support/lbank.py +6 -1
- ccxt/async_support/luno.py +6 -1
- ccxt/async_support/lykke.py +4 -0
- ccxt/async_support/mercado.py +4 -0
- ccxt/async_support/mexc.py +10 -9
- ccxt/async_support/ndax.py +6 -1
- ccxt/async_support/novadax.py +5 -0
- ccxt/async_support/oceanex.py +6 -2
- ccxt/async_support/okcoin.py +4 -0
- ccxt/async_support/okx.py +17 -5
- ccxt/async_support/onetrading.py +4 -0
- ccxt/async_support/oxfun.py +3 -0
- ccxt/async_support/p2b.py +3 -0
- ccxt/async_support/paradex.py +8 -2
- ccxt/async_support/phemex.py +10 -4
- ccxt/async_support/poloniex.py +6 -3
- ccxt/async_support/poloniexfutures.py +5 -1
- ccxt/async_support/probit.py +4 -0
- ccxt/async_support/timex.py +4 -0
- ccxt/async_support/tokocrypto.py +5 -0
- ccxt/async_support/tradeogre.py +2 -0
- ccxt/async_support/upbit.py +5 -2
- ccxt/async_support/vertex.py +6 -2
- ccxt/async_support/wavesexchange.py +20 -3
- ccxt/async_support/wazirx.py +2 -0
- ccxt/async_support/whitebit.py +5 -4
- ccxt/async_support/woo.py +15 -5
- ccxt/async_support/woofipro.py +21 -7
- ccxt/async_support/xt.py +5 -0
- ccxt/async_support/yobit.py +5 -2
- ccxt/async_support/zaif.py +2 -0
- ccxt/async_support/zonda.py +2 -0
- ccxt/base/exchange.py +113 -50
- ccxt/base/types.py +1 -1
- ccxt/bigone.py +5 -0
- ccxt/binance.py +55 -69
- ccxt/bingx.py +25 -29
- ccxt/bit2c.py +3 -0
- ccxt/bitbank.py +3 -0
- ccxt/bitbns.py +3 -0
- ccxt/bitfinex.py +6 -1
- ccxt/bitflyer.py +6 -1
- ccxt/bitget.py +8 -4
- ccxt/bithumb.py +3 -1
- ccxt/bitmart.py +22 -12
- ccxt/bitmex.py +99 -93
- ccxt/bitopro.py +7 -2
- ccxt/bitrue.py +4 -0
- ccxt/bitso.py +5 -2
- ccxt/bitstamp.py +3 -0
- ccxt/bitteam.py +5 -0
- ccxt/bitvavo.py +4 -0
- ccxt/blockchaincom.py +4 -0
- ccxt/blofin.py +3 -0
- ccxt/btcalpha.py +5 -0
- ccxt/btcbox.py +3 -2
- ccxt/btcmarkets.py +5 -0
- ccxt/btcturk.py +3 -0
- ccxt/bybit.py +10 -4
- ccxt/cex.py +2 -0
- ccxt/coinbase.py +19 -12
- ccxt/coinbaseexchange.py +5 -0
- ccxt/coinbaseinternational.py +21 -2
- ccxt/coincatch.py +3 -0
- ccxt/coincheck.py +2 -0
- ccxt/coinex.py +5 -1
- ccxt/coinlist.py +5 -0
- ccxt/coinmate.py +4 -0
- ccxt/coinmetro.py +9 -5
- ccxt/coinone.py +3 -0
- ccxt/coinsph.py +4 -0
- ccxt/coinspot.py +1 -0
- ccxt/cryptocom.py +5 -0
- ccxt/currencycom.py +3 -0
- ccxt/defx.py +5 -0
- ccxt/delta.py +4 -1
- ccxt/deribit.py +16 -5
- ccxt/digifinex.py +10 -5
- ccxt/ellipx.py +9 -5
- ccxt/exmo.py +6 -3
- ccxt/gate.py +5 -1
- ccxt/gemini.py +3 -0
- ccxt/hashkey.py +5 -4
- ccxt/hitbtc.py +6 -2
- ccxt/hollaex.py +7 -2
- ccxt/htx.py +8 -1
- ccxt/huobijp.py +5 -0
- ccxt/hyperliquid.py +6 -1
- ccxt/idex.py +5 -1
- ccxt/independentreserve.py +4 -0
- ccxt/indodax.py +3 -0
- ccxt/kraken.py +6 -4
- ccxt/krakenfutures.py +5 -2
- ccxt/kucoin.py +13 -6
- ccxt/kucoinfutures.py +5 -1
- ccxt/kuna.py +3 -0
- ccxt/latoken.py +4 -0
- ccxt/lbank.py +6 -1
- ccxt/luno.py +6 -1
- ccxt/lykke.py +4 -0
- ccxt/mercado.py +4 -0
- ccxt/mexc.py +10 -9
- ccxt/ndax.py +6 -1
- ccxt/novadax.py +5 -0
- ccxt/oceanex.py +6 -2
- ccxt/okcoin.py +4 -0
- ccxt/okx.py +17 -5
- ccxt/onetrading.py +4 -0
- ccxt/oxfun.py +3 -0
- ccxt/p2b.py +3 -0
- ccxt/paradex.py +8 -2
- ccxt/phemex.py +10 -4
- ccxt/poloniex.py +6 -3
- ccxt/poloniexfutures.py +5 -1
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/bitcoincom.py +1 -4
- ccxt/pro/bitopro.py +1 -1
- ccxt/probit.py +4 -0
- ccxt/test/tests_async.py +57 -31
- ccxt/test/tests_sync.py +57 -31
- ccxt/timex.py +4 -0
- ccxt/tokocrypto.py +5 -0
- ccxt/tradeogre.py +2 -0
- ccxt/upbit.py +5 -2
- ccxt/vertex.py +6 -2
- ccxt/wavesexchange.py +20 -3
- ccxt/wazirx.py +2 -0
- ccxt/whitebit.py +5 -4
- ccxt/woo.py +15 -5
- ccxt/woofipro.py +21 -7
- ccxt/xt.py +5 -0
- ccxt/yobit.py +5 -2
- ccxt/zaif.py +2 -0
- ccxt/zonda.py +2 -0
- {ccxt-4.4.51.dist-info → ccxt-4.4.53.dist-info}/METADATA +225 -140
- {ccxt-4.4.51.dist-info → ccxt-4.4.53.dist-info}/RECORD +215 -224
- ccxt/static_dependencies/ethereum/abi/py.typed +0 -0
- ccxt/static_dependencies/ethereum/account/py.typed +0 -0
- ccxt/static_dependencies/ethereum/hexbytes/py.typed +0 -0
- ccxt/static_dependencies/ethereum/typing/py.typed +0 -0
- ccxt/static_dependencies/ethereum/utils/py.typed +0 -0
- ccxt/static_dependencies/lark/py.typed +0 -0
- ccxt/static_dependencies/marshmallow/py.typed +0 -0
- ccxt/static_dependencies/marshmallow_dataclass/py.typed +0 -0
- ccxt/static_dependencies/marshmallow_oneofschema/py.typed +0 -0
- {ccxt-4.4.51.dist-info → ccxt-4.4.53.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.4.51.dist-info → ccxt-4.4.53.dist-info}/WHEEL +0 -0
- {ccxt-4.4.51.dist-info → ccxt-4.4.53.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, BorrowInterest, Conversion, CrossBorrowRate, Currencies, Currency, DepositAddress, Greeks, Int, IsolatedBorrowRate, IsolatedBorrowRates, LedgerEntry, Leverage, Leverages, LeverageTier, LeverageTiers, LongShortRatio, MarginMode, MarginModes, MarginModification, Market,
|
10
|
+
from ccxt.base.types import Balances, BorrowInterest, Conversion, CrossBorrowRate, Currencies, Currency, DepositAddress, Greeks, Int, IsolatedBorrowRate, IsolatedBorrowRates, LedgerEntry, Leverage, Leverages, LeverageTier, LeverageTiers, LongShortRatio, MarginMode, MarginModes, MarginModification, Market, Num, Option, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade, TradingFeeInterface, TradingFees, Transaction, MarketInterface, TransferEntry
|
11
11
|
from typing import List
|
12
12
|
from ccxt.base.errors import ExchangeError
|
13
13
|
from ccxt.base.errors import AuthenticationError
|
@@ -248,7 +248,6 @@ class binance(Exchange, ImplicitAPI):
|
|
248
248
|
'private': 'https://api.binance.com/api/v3',
|
249
249
|
'v1': 'https://api.binance.com/api/v1',
|
250
250
|
'papi': 'https://papi.binance.com/papi/v1',
|
251
|
-
'papiV2': 'https://papi.binance.com/papi/v2',
|
252
251
|
},
|
253
252
|
'www': 'https://www.binance.com',
|
254
253
|
'referral': {
|
@@ -1193,11 +1192,6 @@ class binance(Exchange, ImplicitAPI):
|
|
1193
1192
|
'listenKey': 0.2,
|
1194
1193
|
},
|
1195
1194
|
},
|
1196
|
-
'papiV2': {
|
1197
|
-
'get': {
|
1198
|
-
'um/account': 1,
|
1199
|
-
},
|
1200
|
-
},
|
1201
1195
|
},
|
1202
1196
|
'fees': {
|
1203
1197
|
'trading': {
|
@@ -1356,7 +1350,8 @@ class binance(Exchange, ImplicitAPI):
|
|
1356
1350
|
'BEP20': 'BSC',
|
1357
1351
|
'OMNI': 'OMNI',
|
1358
1352
|
'EOS': 'EOS',
|
1359
|
-
'SPL': 'SOL',
|
1353
|
+
'SPL': 'SOL', # temporarily keep support for SPL(old name)
|
1354
|
+
'SOL': 'SOL', # we shouldn't rename SOL
|
1360
1355
|
},
|
1361
1356
|
# keeping self object for backward-compatibility
|
1362
1357
|
'reverseNetworks': {
|
@@ -1454,6 +1449,7 @@ class binance(Exchange, ImplicitAPI):
|
|
1454
1449
|
'explorer.zensystem.io': 'ZEN',
|
1455
1450
|
},
|
1456
1451
|
'networksById': {
|
1452
|
+
'SOL': 'SOL', # temporary fix for SPL definition
|
1457
1453
|
'tronscan.org': 'TRC20',
|
1458
1454
|
'etherscan.io': 'ERC20',
|
1459
1455
|
'bscscan.com': 'BSC',
|
@@ -1625,11 +1621,13 @@ class binance(Exchange, ImplicitAPI):
|
|
1625
1621
|
'limit': 1000,
|
1626
1622
|
'daysBack': None,
|
1627
1623
|
'untilDays': 1, # days between start-end
|
1624
|
+
'symbolRequired': True,
|
1628
1625
|
},
|
1629
1626
|
'fetchOrder': {
|
1630
1627
|
'marginMode': True,
|
1631
1628
|
'trigger': False,
|
1632
1629
|
'trailing': False,
|
1630
|
+
'symbolRequired': True,
|
1633
1631
|
},
|
1634
1632
|
'fetchOpenOrders': {
|
1635
1633
|
'marginMode': True,
|
@@ -1644,6 +1642,7 @@ class binance(Exchange, ImplicitAPI):
|
|
1644
1642
|
'untilDays': 10000,
|
1645
1643
|
'trigger': False,
|
1646
1644
|
'trailing': False,
|
1645
|
+
'symbolRequired': True,
|
1647
1646
|
},
|
1648
1647
|
'fetchClosedOrders': {
|
1649
1648
|
'marginMode': True,
|
@@ -1653,6 +1652,7 @@ class binance(Exchange, ImplicitAPI):
|
|
1653
1652
|
'untilDays': 10000,
|
1654
1653
|
'trigger': False,
|
1655
1654
|
'trailing': False,
|
1655
|
+
'symbolRequired': True,
|
1656
1656
|
},
|
1657
1657
|
'fetchOHLCV': {
|
1658
1658
|
'limit': 1000,
|
@@ -1695,17 +1695,20 @@ class binance(Exchange, ImplicitAPI):
|
|
1695
1695
|
'daysBack': None,
|
1696
1696
|
'limit': 1000,
|
1697
1697
|
'untilDays': 7,
|
1698
|
+
'symbolRequired': True,
|
1698
1699
|
},
|
1699
1700
|
'fetchOrder': {
|
1700
1701
|
'marginMode': False,
|
1701
1702
|
'trigger': False,
|
1702
1703
|
'trailing': False,
|
1704
|
+
'symbolRequired': True,
|
1703
1705
|
},
|
1704
1706
|
'fetchOpenOrders': {
|
1705
1707
|
'marginMode': True,
|
1706
1708
|
'limit': 500,
|
1707
1709
|
'trigger': False,
|
1708
1710
|
'trailing': False,
|
1711
|
+
'symbolRequired': False,
|
1709
1712
|
},
|
1710
1713
|
'fetchOrders': {
|
1711
1714
|
'marginMode': True,
|
@@ -1714,6 +1717,7 @@ class binance(Exchange, ImplicitAPI):
|
|
1714
1717
|
'untilDays': 7,
|
1715
1718
|
'trigger': False,
|
1716
1719
|
'trailing': False,
|
1720
|
+
'symbolRequired': True,
|
1717
1721
|
},
|
1718
1722
|
'fetchClosedOrders': {
|
1719
1723
|
'marginMode': True,
|
@@ -1723,6 +1727,7 @@ class binance(Exchange, ImplicitAPI):
|
|
1723
1727
|
'untilDays': 7,
|
1724
1728
|
'trigger': False,
|
1725
1729
|
'trailing': False,
|
1730
|
+
'symbolRequired': True,
|
1726
1731
|
},
|
1727
1732
|
'fetchOHLCV': {
|
1728
1733
|
'limit': 1500,
|
@@ -2935,7 +2940,7 @@ class binance(Exchange, ImplicitAPI):
|
|
2935
2940
|
"""
|
2936
2941
|
fetches the current integer timestamp in milliseconds from the exchange server
|
2937
2942
|
|
2938
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api
|
2943
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#check-server-time # spot
|
2939
2944
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Check-Server-Time # swap
|
2940
2945
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Check-Server-time # future
|
2941
2946
|
|
@@ -3171,7 +3176,7 @@ class binance(Exchange, ImplicitAPI):
|
|
3171
3176
|
"""
|
3172
3177
|
retrieves data on all markets for binance
|
3173
3178
|
|
3174
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api
|
3179
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#exchange-information # spot
|
3175
3180
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Exchange-Information # swap
|
3176
3181
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Exchange-Information # future
|
3177
3182
|
https://developers.binance.com/docs/derivatives/option/market-data/Exchange-Information # option
|
@@ -3730,7 +3735,7 @@ class binance(Exchange, ImplicitAPI):
|
|
3730
3735
|
"""
|
3731
3736
|
query for balance and get the amount of funds available for trading or funds locked in orders
|
3732
3737
|
|
3733
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api
|
3738
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#account-information-user_data # spot
|
3734
3739
|
https://developers.binance.com/docs/margin_trading/account/Query-Cross-Margin-Account-Details # cross margin
|
3735
3740
|
https://developers.binance.com/docs/margin_trading/account/Query-Isolated-Margin-Account-Info # isolated margin
|
3736
3741
|
https://developers.binance.com/docs/wallet/asset/funding-wallet # funding
|
@@ -3988,7 +3993,7 @@ class binance(Exchange, ImplicitAPI):
|
|
3988
3993
|
"""
|
3989
3994
|
fetches information on open orders with bid(buy) and ask(sell) prices, volumes and other data
|
3990
3995
|
|
3991
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api
|
3996
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#order-book # spot
|
3992
3997
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Order-Book # swap
|
3993
3998
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Order-Book # future
|
3994
3999
|
https://developers.binance.com/docs/derivatives/option/market-data/Order-Book # option
|
@@ -4245,8 +4250,8 @@ class binance(Exchange, ImplicitAPI):
|
|
4245
4250
|
"""
|
4246
4251
|
fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
4247
4252
|
|
4248
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api
|
4249
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api
|
4253
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#24hr-ticker-price-change-statistics # spot
|
4254
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#rolling-window-price-change-statistics # spot
|
4250
4255
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/24hr-Ticker-Price-Change-Statistics # swap
|
4251
4256
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/24hr-Ticker-Price-Change-Statistics # future
|
4252
4257
|
https://developers.binance.com/docs/derivatives/option/market-data/24hr-Ticker-Price-Change-Statistics # option
|
@@ -4284,7 +4289,7 @@ class binance(Exchange, ImplicitAPI):
|
|
4284
4289
|
"""
|
4285
4290
|
fetches the bid and ask price and volume for multiple markets
|
4286
4291
|
|
4287
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api
|
4292
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#symbol-order-book-ticker # spot
|
4288
4293
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Symbol-Order-Book-Ticker # swap
|
4289
4294
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Symbol-Order-Book-Ticker # future
|
4290
4295
|
|
@@ -4318,7 +4323,7 @@ class binance(Exchange, ImplicitAPI):
|
|
4318
4323
|
"""
|
4319
4324
|
fetches the last price for multiple markets
|
4320
4325
|
|
4321
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api
|
4326
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#symbol-price-ticker # spot
|
4322
4327
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Symbol-Price-Ticker # swap
|
4323
4328
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Symbol-Price-Ticker # future
|
4324
4329
|
|
@@ -4418,7 +4423,7 @@ class binance(Exchange, ImplicitAPI):
|
|
4418
4423
|
"""
|
4419
4424
|
fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
4420
4425
|
|
4421
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api
|
4426
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#24hr-ticker-price-change-statistics # spot
|
4422
4427
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/24hr-Ticker-Price-Change-Statistics # swap
|
4423
4428
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/24hr-Ticker-Price-Change-Statistics # future
|
4424
4429
|
https://developers.binance.com/docs/derivatives/option/market-data/24hr-Ticker-Price-Change-Statistics # option
|
@@ -4579,7 +4584,7 @@ class binance(Exchange, ImplicitAPI):
|
|
4579
4584
|
"""
|
4580
4585
|
fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
4581
4586
|
|
4582
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api
|
4587
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#klinecandlestick-data
|
4583
4588
|
https://developers.binance.com/docs/derivatives/option/market-data/Kline-Candlestick-Data
|
4584
4589
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Kline-Candlestick-Data
|
4585
4590
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Index-Price-Kline-Candlestick-Data
|
@@ -4692,7 +4697,8 @@ class binance(Exchange, ImplicitAPI):
|
|
4692
4697
|
# }
|
4693
4698
|
# ]
|
4694
4699
|
#
|
4695
|
-
|
4700
|
+
candles = self.parse_ohlcvs(response, market, timeframe, since, limit)
|
4701
|
+
return candles
|
4696
4702
|
|
4697
4703
|
def parse_trade(self, trade: dict, market: Market = None) -> Trade:
|
4698
4704
|
if 'isDustTrade' in trade:
|
@@ -4955,17 +4961,17 @@ class binance(Exchange, ImplicitAPI):
|
|
4955
4961
|
get the list of most recent trades for a particular symbol
|
4956
4962
|
Default fetchTradesMethod
|
4957
4963
|
|
4958
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api
|
4964
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#compressedaggregate-trades-list # publicGetAggTrades(spot)
|
4959
4965
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Compressed-Aggregate-Trades-List # fapiPublicGetAggTrades(swap)
|
4960
4966
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Compressed-Aggregate-Trades-List # dapiPublicGetAggTrades(future)
|
4961
4967
|
https://developers.binance.com/docs/derivatives/option/market-data/Recent-Trades-List # eapiPublicGetTrades(option)
|
4962
4968
|
|
4963
4969
|
Other fetchTradesMethod
|
4964
4970
|
|
4965
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api
|
4971
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#recent-trades-list # publicGetTrades(spot)
|
4966
4972
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Recent-Trades-List # fapiPublicGetTrades(swap)
|
4967
4973
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Recent-Trades-List # dapiPublicGetTrades(future)
|
4968
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api
|
4974
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#old-trade-lookup # publicGetHistoricalTrades(spot)
|
4969
4975
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Old-Trades-Lookup # fapiPublicGetHistoricalTrades(swap)
|
4970
4976
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Old-Trades-Lookup # dapiPublicGetHistoricalTrades(future)
|
4971
4977
|
https://developers.binance.com/docs/derivatives/option/market-data/Old-Trades-Lookup # eapiPublicGetHistoricalTrades(option)
|
@@ -5094,7 +5100,7 @@ class binance(Exchange, ImplicitAPI):
|
|
5094
5100
|
@ignore
|
5095
5101
|
edit a trade order
|
5096
5102
|
|
5097
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api
|
5103
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#cancel-an-existing-order-and-send-a-new-order-trade
|
5098
5104
|
|
5099
5105
|
:param str id: cancel order id
|
5100
5106
|
:param str symbol: unified symbol of the market to create an order in
|
@@ -5266,10 +5272,10 @@ class binance(Exchange, ImplicitAPI):
|
|
5266
5272
|
request: dict = {
|
5267
5273
|
'symbol': market['id'],
|
5268
5274
|
'side': side.upper(),
|
5269
|
-
'orderId': id,
|
5270
|
-
'quantity': self.amount_to_precision(symbol, amount),
|
5271
5275
|
}
|
5272
5276
|
clientOrderId = self.safe_string_n(params, ['newClientOrderId', 'clientOrderId', 'origClientOrderId'])
|
5277
|
+
request['orderId'] = id
|
5278
|
+
request['quantity'] = self.amount_to_precision(symbol, amount)
|
5273
5279
|
if price is not None:
|
5274
5280
|
request['price'] = self.price_to_precision(symbol, price)
|
5275
5281
|
if clientOrderId is not None:
|
@@ -5283,8 +5289,6 @@ class binance(Exchange, ImplicitAPI):
|
|
5283
5289
|
|
5284
5290
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Order
|
5285
5291
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Modify-Order
|
5286
|
-
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Modify-UM-Order
|
5287
|
-
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Modify-CM-Order
|
5288
5292
|
|
5289
5293
|
:param str id: cancel order id
|
5290
5294
|
:param str symbol: unified symbol of the market to create an order in
|
@@ -5293,28 +5297,16 @@ class binance(Exchange, ImplicitAPI):
|
|
5293
5297
|
:param float amount: how much of currency you want to trade in units of base currency
|
5294
5298
|
:param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
5295
5299
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
5296
|
-
:param boolean [params.portfolioMargin]: set to True if you would like to edit an order in a portfolio margin account
|
5297
5300
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
5298
5301
|
"""
|
5299
5302
|
self.load_markets()
|
5300
5303
|
market = self.market(symbol)
|
5301
|
-
isPortfolioMargin = None
|
5302
|
-
isPortfolioMargin, params = self.handle_option_and_params_2(params, 'editContractOrder', 'papi', 'portfolioMargin', False)
|
5303
|
-
if market['linear'] or isPortfolioMargin:
|
5304
|
-
if price is None:
|
5305
|
-
raise ArgumentsRequired(self.id + ' editOrder() requires a price argument for portfolio margin and linear orders')
|
5306
5304
|
request = self.edit_contract_order_request(id, symbol, type, side, amount, price, params)
|
5307
5305
|
response = None
|
5308
5306
|
if market['linear']:
|
5309
|
-
|
5310
|
-
response = self.papiPutUmOrder(self.extend(request, params))
|
5311
|
-
else:
|
5312
|
-
response = self.fapiPrivatePutOrder(self.extend(request, params))
|
5307
|
+
response = self.fapiPrivatePutOrder(self.extend(request, params))
|
5313
5308
|
elif market['inverse']:
|
5314
|
-
|
5315
|
-
response = self.papiPutCmOrder(self.extend(request, params))
|
5316
|
-
else:
|
5317
|
-
response = self.dapiPrivatePutOrder(self.extend(request, params))
|
5309
|
+
response = self.dapiPrivatePutOrder(self.extend(request, params))
|
5318
5310
|
#
|
5319
5311
|
# swap and future
|
5320
5312
|
#
|
@@ -5348,7 +5340,7 @@ class binance(Exchange, ImplicitAPI):
|
|
5348
5340
|
"""
|
5349
5341
|
edit a trade order
|
5350
5342
|
|
5351
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api
|
5343
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#cancel-an-existing-order-and-send-a-new-order-trade
|
5352
5344
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Order
|
5353
5345
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Modify-Order
|
5354
5346
|
|
@@ -5359,7 +5351,6 @@ class binance(Exchange, ImplicitAPI):
|
|
5359
5351
|
:param float amount: how much of currency you want to trade in units of base currency
|
5360
5352
|
:param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
5361
5353
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
5362
|
-
:param boolean [params.portfolioMargin]: set to True if you would like to edit an order in a portfolio margin account
|
5363
5354
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
5364
5355
|
"""
|
5365
5356
|
self.load_markets()
|
@@ -6029,8 +6020,8 @@ class binance(Exchange, ImplicitAPI):
|
|
6029
6020
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/New-Order
|
6030
6021
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/New-Order
|
6031
6022
|
https://developers.binance.com/docs/derivatives/option/trade/New-Order
|
6032
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api
|
6033
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api
|
6023
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#sor
|
6024
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#test-new-order-using-sor-trade
|
6034
6025
|
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-UM-Order
|
6035
6026
|
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-CM-Order
|
6036
6027
|
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-Margin-Order
|
@@ -6058,7 +6049,6 @@ class binance(Exchange, ImplicitAPI):
|
|
6058
6049
|
:param str [params.stopLossOrTakeProfit]: 'stopLoss' or 'takeProfit', required for spot trailing orders
|
6059
6050
|
:param str [params.positionSide]: *swap and portfolio margin only* "BOTH" for one-way mode, "LONG" for buy side of hedged mode, "SHORT" for sell side of hedged mode
|
6060
6051
|
:param bool [params.hedged]: *swap and portfolio margin only* True for hedged mode, False for one way mode, default is False
|
6061
|
-
:param float [params.cost]: *spot market buy only* the quote quantity that can be used alternative for the amount
|
6062
6052
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
6063
6053
|
"""
|
6064
6054
|
self.load_markets()
|
@@ -6377,7 +6367,7 @@ class binance(Exchange, ImplicitAPI):
|
|
6377
6367
|
"""
|
6378
6368
|
create a market order by providing the symbol, side and cost
|
6379
6369
|
|
6380
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api
|
6370
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#new-order-trade
|
6381
6371
|
|
6382
6372
|
:param str symbol: unified symbol of the market to create an order in
|
6383
6373
|
:param str side: 'buy' or 'sell'
|
@@ -6389,16 +6379,14 @@ class binance(Exchange, ImplicitAPI):
|
|
6389
6379
|
market = self.market(symbol)
|
6390
6380
|
if not market['spot']:
|
6391
6381
|
raise NotSupported(self.id + ' createMarketOrderWithCost() supports spot orders only')
|
6392
|
-
|
6393
|
-
|
6394
|
-
}
|
6395
|
-
return self.create_order(symbol, 'market', side, 0, None, self.extend(req, params))
|
6382
|
+
params['cost'] = cost
|
6383
|
+
return self.create_order(symbol, 'market', side, cost, None, params)
|
6396
6384
|
|
6397
6385
|
def create_market_buy_order_with_cost(self, symbol: str, cost: float, params={}):
|
6398
6386
|
"""
|
6399
6387
|
create a market buy order by providing the symbol and cost
|
6400
6388
|
|
6401
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api
|
6389
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#new-order-trade
|
6402
6390
|
|
6403
6391
|
:param str symbol: unified symbol of the market to create an order in
|
6404
6392
|
:param float cost: how much you want to trade in units of the quote currency
|
@@ -6409,16 +6397,14 @@ class binance(Exchange, ImplicitAPI):
|
|
6409
6397
|
market = self.market(symbol)
|
6410
6398
|
if not market['spot']:
|
6411
6399
|
raise NotSupported(self.id + ' createMarketBuyOrderWithCost() supports spot orders only')
|
6412
|
-
|
6413
|
-
|
6414
|
-
}
|
6415
|
-
return self.create_order(symbol, 'market', 'buy', 0, None, self.extend(req, params))
|
6400
|
+
params['cost'] = cost
|
6401
|
+
return self.create_order(symbol, 'market', 'buy', cost, None, params)
|
6416
6402
|
|
6417
6403
|
def create_market_sell_order_with_cost(self, symbol: str, cost: float, params={}):
|
6418
6404
|
"""
|
6419
6405
|
create a market sell order by providing the symbol and cost
|
6420
6406
|
|
6421
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api
|
6407
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#new-order-trade
|
6422
6408
|
|
6423
6409
|
:param str symbol: unified symbol of the market to create an order in
|
6424
6410
|
:param float cost: how much you want to trade in units of the quote currency
|
@@ -6436,7 +6422,7 @@ class binance(Exchange, ImplicitAPI):
|
|
6436
6422
|
"""
|
6437
6423
|
fetches information on an order made by the user
|
6438
6424
|
|
6439
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api
|
6425
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#query-order-user_data
|
6440
6426
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Query-Order
|
6441
6427
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Query-Order
|
6442
6428
|
https://developers.binance.com/docs/derivatives/option/trade/Query-Single-Order
|
@@ -6501,7 +6487,7 @@ class binance(Exchange, ImplicitAPI):
|
|
6501
6487
|
"""
|
6502
6488
|
fetches information on multiple orders made by the user
|
6503
6489
|
|
6504
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api
|
6490
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#all-orders-user_data
|
6505
6491
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/All-Orders
|
6506
6492
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/All-Orders
|
6507
6493
|
https://developers.binance.com/docs/derivatives/option/trade/Query-Option-Order-History
|
@@ -6760,7 +6746,7 @@ class binance(Exchange, ImplicitAPI):
|
|
6760
6746
|
"""
|
6761
6747
|
fetch all unfilled currently open orders
|
6762
6748
|
|
6763
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api
|
6749
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#current-open-orders-user_data
|
6764
6750
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Current-All-Open-Orders
|
6765
6751
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Current-All-Open-Orders
|
6766
6752
|
https://developers.binance.com/docs/derivatives/option/trade/Query-Current-Open-Option-Orders
|
@@ -7047,7 +7033,7 @@ class binance(Exchange, ImplicitAPI):
|
|
7047
7033
|
"""
|
7048
7034
|
fetches information on multiple closed orders made by the user
|
7049
7035
|
|
7050
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api
|
7036
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#all-orders-user_data
|
7051
7037
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/All-Orders
|
7052
7038
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/All-Orders
|
7053
7039
|
https://developers.binance.com/docs/derivatives/option/trade/Query-Option-Order-History
|
@@ -7076,7 +7062,7 @@ class binance(Exchange, ImplicitAPI):
|
|
7076
7062
|
"""
|
7077
7063
|
fetches information on multiple canceled orders made by the user
|
7078
7064
|
|
7079
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api
|
7065
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#all-orders-user_data
|
7080
7066
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/All-Orders
|
7081
7067
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/All-Orders
|
7082
7068
|
https://developers.binance.com/docs/derivatives/option/trade/Query-Option-Order-History
|
@@ -7105,7 +7091,7 @@ class binance(Exchange, ImplicitAPI):
|
|
7105
7091
|
"""
|
7106
7092
|
fetches information on multiple canceled orders made by the user
|
7107
7093
|
|
7108
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api
|
7094
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#all-orders-user_data
|
7109
7095
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/All-Orders
|
7110
7096
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/All-Orders
|
7111
7097
|
https://developers.binance.com/docs/derivatives/option/trade/Query-Option-Order-History
|
@@ -7137,7 +7123,7 @@ class binance(Exchange, ImplicitAPI):
|
|
7137
7123
|
"""
|
7138
7124
|
cancels an open order
|
7139
7125
|
|
7140
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api
|
7126
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#cancel-order-trade
|
7141
7127
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-Order
|
7142
7128
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Cancel-Order
|
7143
7129
|
https://developers.binance.com/docs/derivatives/option/trade/Cancel-Option-Order
|
@@ -7218,7 +7204,7 @@ class binance(Exchange, ImplicitAPI):
|
|
7218
7204
|
"""
|
7219
7205
|
cancel all open orders in a market
|
7220
7206
|
|
7221
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api
|
7207
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#cancel-all-open-orders-on-a-symbol-trade
|
7222
7208
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-All-Open-Orders
|
7223
7209
|
https://developers.binance.com/docs/derivatives/option/trade/Cancel-all-Option-orders-on-specific-symbol
|
7224
7210
|
https://developers.binance.com/docs/margin_trading/trade/Margin-Account-Cancel-All-Open-Orders
|
@@ -7443,7 +7429,7 @@ class binance(Exchange, ImplicitAPI):
|
|
7443
7429
|
"""
|
7444
7430
|
fetch all the trades made from a single order
|
7445
7431
|
|
7446
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api
|
7432
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#account-trade-list-user_data
|
7447
7433
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Account-Trade-List
|
7448
7434
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Account-Trade-List
|
7449
7435
|
https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-Trade-List
|
@@ -7472,7 +7458,7 @@ class binance(Exchange, ImplicitAPI):
|
|
7472
7458
|
"""
|
7473
7459
|
fetch all trades made by the user
|
7474
7460
|
|
7475
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api
|
7461
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#account-trade-list-user_data
|
7476
7462
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Account-Trade-List
|
7477
7463
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Account-Trade-List
|
7478
7464
|
https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-Trade-List
|
@@ -11212,7 +11198,7 @@ class binance(Exchange, ImplicitAPI):
|
|
11212
11198
|
body = self.urlencode(params)
|
11213
11199
|
else:
|
11214
11200
|
raise AuthenticationError(self.id + ' userDataStream endpoint requires `apiKey` credential')
|
11215
|
-
elif (api == 'private') or (api == 'eapiPrivate') or (api == 'sapi' and path != 'system/status') or (api == 'sapiV2') or (api == 'sapiV3') or (api == 'sapiV4') or (api == 'dapiPrivate') or (api == 'dapiPrivateV2') or (api == 'fapiPrivate') or (api == 'fapiPrivateV2') or (api == 'fapiPrivateV3') or (api == 'papi' and path != 'ping')
|
11201
|
+
elif (api == 'private') or (api == 'eapiPrivate') or (api == 'sapi' and path != 'system/status') or (api == 'sapiV2') or (api == 'sapiV3') or (api == 'sapiV4') or (api == 'dapiPrivate') or (api == 'dapiPrivateV2') or (api == 'fapiPrivate') or (api == 'fapiPrivateV2') or (api == 'fapiPrivateV3') or (api == 'papi' and path != 'ping'):
|
11216
11202
|
self.check_required_credentials()
|
11217
11203
|
if method == 'POST' and ((path == 'order') or (path == 'sor/order')):
|
11218
11204
|
# inject in implicit API calls
|
@@ -12382,7 +12368,7 @@ class binance(Exchange, ImplicitAPI):
|
|
12382
12368
|
# "price": "10871.09",
|
12383
12369
|
# "avgPrice": "10913.21000",
|
12384
12370
|
# "origQty": "0.001",
|
12385
|
-
# "executedQty": "0.
|
12371
|
+
# "executedQty": "0.002",
|
12386
12372
|
# "cumQuote": "10.91321",
|
12387
12373
|
# "timeInForce": "IOC",
|
12388
12374
|
# "type": "LIMIT",
|
ccxt/bingx.py
CHANGED
@@ -518,6 +518,8 @@ class bingx(Exchange, ImplicitAPI):
|
|
518
518
|
'SNOW': 'Snowman', # Snowman vs SnowSwap conflict
|
519
519
|
'OMNI': 'OmniCat',
|
520
520
|
'NAP': '$NAP', # NAP on SOL = SNAP
|
521
|
+
'TRUMP': 'TRUMPMAGA',
|
522
|
+
'TRUMPSOL': 'TRUMP',
|
521
523
|
},
|
522
524
|
'options': {
|
523
525
|
'defaultType': 'spot',
|
@@ -589,17 +591,20 @@ class bingx(Exchange, ImplicitAPI):
|
|
589
591
|
'limit': 512, # 512 days for 'allFillOrders', 1000 days for 'fillOrders'
|
590
592
|
'daysBack': 30, # 30 for 'allFillOrders', 7 for 'fillHistory'
|
591
593
|
'untilDays': 30, # 30 for 'allFillOrders', 7 for 'fillHistory'
|
594
|
+
'symbolRequired': True,
|
592
595
|
},
|
593
596
|
'fetchOrder': {
|
594
597
|
'marginMode': False,
|
595
598
|
'trigger': False,
|
596
599
|
'trailing': False,
|
600
|
+
'symbolRequired': True,
|
597
601
|
},
|
598
602
|
'fetchOpenOrders': {
|
599
603
|
'marginMode': False,
|
600
604
|
'limit': None,
|
601
605
|
'trigger': False,
|
602
606
|
'trailing': False,
|
607
|
+
'symbolRequired': False,
|
603
608
|
},
|
604
609
|
'fetchOrders': {
|
605
610
|
'marginMode': False,
|
@@ -608,6 +613,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
608
613
|
'untilDays': 7,
|
609
614
|
'trigger': False,
|
610
615
|
'trailing': False,
|
616
|
+
'symbolRequired': True,
|
611
617
|
},
|
612
618
|
'fetchClosedOrders': {
|
613
619
|
'marginMode': False,
|
@@ -617,6 +623,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
617
623
|
'untilDays': 7,
|
618
624
|
'trigger': False,
|
619
625
|
'trailing': False,
|
626
|
+
'symbolRequired': True,
|
620
627
|
},
|
621
628
|
'fetchOHLCV': {
|
622
629
|
'limit': 1440,
|
@@ -629,19 +636,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
629
636
|
'daysBack': None,
|
630
637
|
'untilDays': None,
|
631
638
|
},
|
632
|
-
'fetchOHLCV': {
|
633
|
-
'limit': 1440,
|
634
|
-
},
|
635
639
|
'fetchOrders': None,
|
636
|
-
'fetchClosedOrders': {
|
637
|
-
'marginMode': False,
|
638
|
-
'limit': 1000,
|
639
|
-
'daysBack': None,
|
640
|
-
'daysBackCanceled': None,
|
641
|
-
'untilDays': 7,
|
642
|
-
'trigger': False,
|
643
|
-
'trailing': False,
|
644
|
-
},
|
645
640
|
},
|
646
641
|
#
|
647
642
|
'spot': {
|
@@ -670,12 +665,16 @@ class bingx(Exchange, ImplicitAPI):
|
|
670
665
|
'extends': 'defaultForInverse',
|
671
666
|
},
|
672
667
|
},
|
668
|
+
'defaultForFuture': {
|
669
|
+
'extends': 'defaultForLinear',
|
670
|
+
'fetchOrders': None,
|
671
|
+
},
|
673
672
|
'future': {
|
674
673
|
'linear': {
|
675
|
-
'extends': '
|
674
|
+
'extends': 'defaultForFuture',
|
676
675
|
},
|
677
676
|
'inverse': {
|
678
|
-
'extends': '
|
677
|
+
'extends': 'defaultForFuture',
|
679
678
|
},
|
680
679
|
},
|
681
680
|
},
|
@@ -818,7 +817,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
818
817
|
}
|
819
818
|
return result
|
820
819
|
|
821
|
-
def fetch_spot_markets(self, params):
|
820
|
+
def fetch_spot_markets(self, params) -> List[Market]:
|
822
821
|
response = self.spotV1PublicGetCommonSymbols(params)
|
823
822
|
#
|
824
823
|
# {
|
@@ -2657,10 +2656,8 @@ class bingx(Exchange, ImplicitAPI):
|
|
2657
2656
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2658
2657
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
2659
2658
|
"""
|
2660
|
-
|
2661
|
-
|
2662
|
-
}
|
2663
|
-
return self.create_order(symbol, 'market', side, cost, None, self.extend(req, params))
|
2659
|
+
params['quoteOrderQty'] = cost
|
2660
|
+
return self.create_order(symbol, 'market', side, cost, None, params)
|
2664
2661
|
|
2665
2662
|
def create_market_buy_order_with_cost(self, symbol: str, cost: float, params={}):
|
2666
2663
|
"""
|
@@ -2670,10 +2667,8 @@ class bingx(Exchange, ImplicitAPI):
|
|
2670
2667
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2671
2668
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
2672
2669
|
"""
|
2673
|
-
|
2674
|
-
|
2675
|
-
}
|
2676
|
-
return self.create_order(symbol, 'market', 'buy', cost, None, self.extend(req, params))
|
2670
|
+
params['quoteOrderQty'] = cost
|
2671
|
+
return self.create_order(symbol, 'market', 'buy', cost, None, params)
|
2677
2672
|
|
2678
2673
|
def create_market_sell_order_with_cost(self, symbol: str, cost: float, params={}):
|
2679
2674
|
"""
|
@@ -2683,10 +2678,8 @@ class bingx(Exchange, ImplicitAPI):
|
|
2683
2678
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2684
2679
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
2685
2680
|
"""
|
2686
|
-
|
2687
|
-
|
2688
|
-
}
|
2689
|
-
return self.create_order(symbol, 'market', 'sell', cost, None, self.extend(req, params))
|
2681
|
+
params['quoteOrderQty'] = cost
|
2682
|
+
return self.create_order(symbol, 'market', 'sell', cost, None, params)
|
2690
2683
|
|
2691
2684
|
def create_order_request(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
|
2692
2685
|
"""
|
@@ -2869,7 +2862,10 @@ class bingx(Exchange, ImplicitAPI):
|
|
2869
2862
|
else:
|
2870
2863
|
positionSide = 'BOTH'
|
2871
2864
|
request['positionSide'] = positionSide
|
2872
|
-
|
2865
|
+
amountReq = amount
|
2866
|
+
if not market['inverse']:
|
2867
|
+
amountReq = self.parse_to_numeric(self.amount_to_precision(symbol, amount))
|
2868
|
+
request['quantity'] = amountReq # precision not available for inverse contracts
|
2873
2869
|
params = self.omit(params, ['hedged', 'triggerPrice', 'stopLossPrice', 'takeProfitPrice', 'trailingAmount', 'trailingPercent', 'trailingType', 'takeProfit', 'stopLoss', 'clientOrderId'])
|
2874
2870
|
return self.extend(request, params)
|
2875
2871
|
|
@@ -5533,7 +5529,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
5533
5529
|
request: dict = {
|
5534
5530
|
'coin': currency['id'],
|
5535
5531
|
'address': address,
|
5536
|
-
'amount': self.
|
5532
|
+
'amount': self.currency_to_precision(code, amount),
|
5537
5533
|
'walletType': walletType,
|
5538
5534
|
}
|
5539
5535
|
network = self.safe_string_upper(params, 'network')
|