ccxt 4.4.52__py2.py3-none-any.whl → 4.4.57__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 -3
- 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 -3
- 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 +24 -7
- ccxt/async_support/bigone.py +5 -0
- ccxt/async_support/binance.py +54 -54
- 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 +9 -5
- 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 +13 -5
- ccxt/async_support/cex.py +2 -0
- ccxt/async_support/coinbase.py +20 -13
- ccxt/async_support/coinbaseexchange.py +5 -0
- ccxt/async_support/coinbaseinternational.py +23 -4
- ccxt/async_support/coincatch.py +3 -0
- ccxt/async_support/coincheck.py +2 -0
- ccxt/async_support/coinex.py +6 -2
- 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 +15 -28
- ccxt/async_support/digifinex.py +10 -5
- ccxt/async_support/ellipx.py +9 -5
- ccxt/async_support/exmo.py +7 -4
- 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 +9 -4
- 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 +7 -5
- 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/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 +23 -9
- 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 +96 -54
- ccxt/base/types.py +1 -1
- ccxt/bigone.py +5 -0
- ccxt/binance.py +54 -54
- 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 +9 -5
- 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 +13 -5
- ccxt/cex.py +2 -0
- ccxt/coinbase.py +20 -13
- ccxt/coinbaseexchange.py +5 -0
- ccxt/coinbaseinternational.py +23 -4
- ccxt/coincatch.py +3 -0
- ccxt/coincheck.py +2 -0
- ccxt/coinex.py +6 -2
- 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 +15 -28
- ccxt/digifinex.py +10 -5
- ccxt/ellipx.py +9 -5
- ccxt/exmo.py +7 -4
- 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 +9 -4
- ccxt/idex.py +5 -1
- ccxt/independentreserve.py +4 -0
- ccxt/indodax.py +3 -0
- ccxt/kraken.py +7 -5
- 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/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/binance.py +2 -2
- ccxt/pro/bitcoincom.py +1 -4
- ccxt/pro/bitget.py +3 -3
- ccxt/pro/bitopro.py +1 -1
- ccxt/pro/bybit.py +7 -2
- ccxt/pro/cex.py +1 -1
- ccxt/pro/coincatch.py +3 -3
- ccxt/pro/mexc.py +3 -3
- ccxt/pro/okx.py +1 -1
- ccxt/probit.py +4 -0
- ccxt/test/tests_async.py +57 -30
- ccxt/test/tests_sync.py +57 -30
- 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 +23 -9
- ccxt/xt.py +5 -0
- ccxt/yobit.py +5 -2
- ccxt/zaif.py +2 -0
- ccxt/zonda.py +2 -0
- {ccxt-4.4.52.dist-info → ccxt-4.4.57.dist-info}/METADATA +225 -143
- {ccxt-4.4.52.dist-info → ccxt-4.4.57.dist-info}/RECORD +220 -223
- ccxt/abstract/lykke.py +0 -29
- ccxt/async_support/lykke.py +0 -1370
- ccxt/lykke.py +0 -1370
- {ccxt-4.4.52.dist-info → ccxt-4.4.57.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.4.52.dist-info → ccxt-4.4.57.dist-info}/WHEEL +0 -0
- {ccxt-4.4.52.dist-info → ccxt-4.4.57.dist-info}/top_level.txt +0 -0
ccxt/async_support/binance.py
CHANGED
@@ -8,7 +8,7 @@ from ccxt.abstract.binance import ImplicitAPI
|
|
8
8
|
import asyncio
|
9
9
|
import hashlib
|
10
10
|
import json
|
11
|
-
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,
|
11
|
+
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
|
12
12
|
from typing import List
|
13
13
|
from ccxt.base.errors import ExchangeError
|
14
14
|
from ccxt.base.errors import AuthenticationError
|
@@ -249,7 +249,6 @@ class binance(Exchange, ImplicitAPI):
|
|
249
249
|
'private': 'https://api.binance.com/api/v3',
|
250
250
|
'v1': 'https://api.binance.com/api/v1',
|
251
251
|
'papi': 'https://papi.binance.com/papi/v1',
|
252
|
-
'papiV2': 'https://papi.binance.com/papi/v2',
|
253
252
|
},
|
254
253
|
'www': 'https://www.binance.com',
|
255
254
|
'referral': {
|
@@ -1194,11 +1193,6 @@ class binance(Exchange, ImplicitAPI):
|
|
1194
1193
|
'listenKey': 0.2,
|
1195
1194
|
},
|
1196
1195
|
},
|
1197
|
-
'papiV2': {
|
1198
|
-
'get': {
|
1199
|
-
'um/account': 1,
|
1200
|
-
},
|
1201
|
-
},
|
1202
1196
|
},
|
1203
1197
|
'fees': {
|
1204
1198
|
'trading': {
|
@@ -1357,7 +1351,8 @@ class binance(Exchange, ImplicitAPI):
|
|
1357
1351
|
'BEP20': 'BSC',
|
1358
1352
|
'OMNI': 'OMNI',
|
1359
1353
|
'EOS': 'EOS',
|
1360
|
-
'SPL': 'SOL',
|
1354
|
+
'SPL': 'SOL', # temporarily keep support for SPL(old name)
|
1355
|
+
'SOL': 'SOL', # we shouldn't rename SOL
|
1361
1356
|
},
|
1362
1357
|
# keeping self object for backward-compatibility
|
1363
1358
|
'reverseNetworks': {
|
@@ -1455,6 +1450,7 @@ class binance(Exchange, ImplicitAPI):
|
|
1455
1450
|
'explorer.zensystem.io': 'ZEN',
|
1456
1451
|
},
|
1457
1452
|
'networksById': {
|
1453
|
+
'SOL': 'SOL', # temporary fix for SPL definition
|
1458
1454
|
'tronscan.org': 'TRC20',
|
1459
1455
|
'etherscan.io': 'ERC20',
|
1460
1456
|
'bscscan.com': 'BSC',
|
@@ -1626,11 +1622,13 @@ class binance(Exchange, ImplicitAPI):
|
|
1626
1622
|
'limit': 1000,
|
1627
1623
|
'daysBack': None,
|
1628
1624
|
'untilDays': 1, # days between start-end
|
1625
|
+
'symbolRequired': True,
|
1629
1626
|
},
|
1630
1627
|
'fetchOrder': {
|
1631
1628
|
'marginMode': True,
|
1632
1629
|
'trigger': False,
|
1633
1630
|
'trailing': False,
|
1631
|
+
'symbolRequired': True,
|
1634
1632
|
},
|
1635
1633
|
'fetchOpenOrders': {
|
1636
1634
|
'marginMode': True,
|
@@ -1645,6 +1643,7 @@ class binance(Exchange, ImplicitAPI):
|
|
1645
1643
|
'untilDays': 10000,
|
1646
1644
|
'trigger': False,
|
1647
1645
|
'trailing': False,
|
1646
|
+
'symbolRequired': True,
|
1648
1647
|
},
|
1649
1648
|
'fetchClosedOrders': {
|
1650
1649
|
'marginMode': True,
|
@@ -1654,6 +1653,7 @@ class binance(Exchange, ImplicitAPI):
|
|
1654
1653
|
'untilDays': 10000,
|
1655
1654
|
'trigger': False,
|
1656
1655
|
'trailing': False,
|
1656
|
+
'symbolRequired': True,
|
1657
1657
|
},
|
1658
1658
|
'fetchOHLCV': {
|
1659
1659
|
'limit': 1000,
|
@@ -1696,17 +1696,20 @@ class binance(Exchange, ImplicitAPI):
|
|
1696
1696
|
'daysBack': None,
|
1697
1697
|
'limit': 1000,
|
1698
1698
|
'untilDays': 7,
|
1699
|
+
'symbolRequired': True,
|
1699
1700
|
},
|
1700
1701
|
'fetchOrder': {
|
1701
1702
|
'marginMode': False,
|
1702
1703
|
'trigger': False,
|
1703
1704
|
'trailing': False,
|
1705
|
+
'symbolRequired': True,
|
1704
1706
|
},
|
1705
1707
|
'fetchOpenOrders': {
|
1706
1708
|
'marginMode': True,
|
1707
1709
|
'limit': 500,
|
1708
1710
|
'trigger': False,
|
1709
1711
|
'trailing': False,
|
1712
|
+
'symbolRequired': False,
|
1710
1713
|
},
|
1711
1714
|
'fetchOrders': {
|
1712
1715
|
'marginMode': True,
|
@@ -1715,6 +1718,7 @@ class binance(Exchange, ImplicitAPI):
|
|
1715
1718
|
'untilDays': 7,
|
1716
1719
|
'trigger': False,
|
1717
1720
|
'trailing': False,
|
1721
|
+
'symbolRequired': True,
|
1718
1722
|
},
|
1719
1723
|
'fetchClosedOrders': {
|
1720
1724
|
'marginMode': True,
|
@@ -1724,6 +1728,7 @@ class binance(Exchange, ImplicitAPI):
|
|
1724
1728
|
'untilDays': 7,
|
1725
1729
|
'trigger': False,
|
1726
1730
|
'trailing': False,
|
1731
|
+
'symbolRequired': True,
|
1727
1732
|
},
|
1728
1733
|
'fetchOHLCV': {
|
1729
1734
|
'limit': 1500,
|
@@ -2936,7 +2941,7 @@ class binance(Exchange, ImplicitAPI):
|
|
2936
2941
|
"""
|
2937
2942
|
fetches the current integer timestamp in milliseconds from the exchange server
|
2938
2943
|
|
2939
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api
|
2944
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#check-server-time # spot
|
2940
2945
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Check-Server-Time # swap
|
2941
2946
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Check-Server-time # future
|
2942
2947
|
|
@@ -3172,7 +3177,7 @@ class binance(Exchange, ImplicitAPI):
|
|
3172
3177
|
"""
|
3173
3178
|
retrieves data on all markets for binance
|
3174
3179
|
|
3175
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api
|
3180
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#exchange-information # spot
|
3176
3181
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Exchange-Information # swap
|
3177
3182
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Exchange-Information # future
|
3178
3183
|
https://developers.binance.com/docs/derivatives/option/market-data/Exchange-Information # option
|
@@ -3731,7 +3736,7 @@ class binance(Exchange, ImplicitAPI):
|
|
3731
3736
|
"""
|
3732
3737
|
query for balance and get the amount of funds available for trading or funds locked in orders
|
3733
3738
|
|
3734
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api
|
3739
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#account-information-user_data # spot
|
3735
3740
|
https://developers.binance.com/docs/margin_trading/account/Query-Cross-Margin-Account-Details # cross margin
|
3736
3741
|
https://developers.binance.com/docs/margin_trading/account/Query-Isolated-Margin-Account-Info # isolated margin
|
3737
3742
|
https://developers.binance.com/docs/wallet/asset/funding-wallet # funding
|
@@ -3989,7 +3994,7 @@ class binance(Exchange, ImplicitAPI):
|
|
3989
3994
|
"""
|
3990
3995
|
fetches information on open orders with bid(buy) and ask(sell) prices, volumes and other data
|
3991
3996
|
|
3992
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api
|
3997
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#order-book # spot
|
3993
3998
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Order-Book # swap
|
3994
3999
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Order-Book # future
|
3995
4000
|
https://developers.binance.com/docs/derivatives/option/market-data/Order-Book # option
|
@@ -4246,8 +4251,8 @@ class binance(Exchange, ImplicitAPI):
|
|
4246
4251
|
"""
|
4247
4252
|
fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
4248
4253
|
|
4249
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api
|
4250
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api
|
4254
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#24hr-ticker-price-change-statistics # spot
|
4255
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#rolling-window-price-change-statistics # spot
|
4251
4256
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/24hr-Ticker-Price-Change-Statistics # swap
|
4252
4257
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/24hr-Ticker-Price-Change-Statistics # future
|
4253
4258
|
https://developers.binance.com/docs/derivatives/option/market-data/24hr-Ticker-Price-Change-Statistics # option
|
@@ -4285,7 +4290,7 @@ class binance(Exchange, ImplicitAPI):
|
|
4285
4290
|
"""
|
4286
4291
|
fetches the bid and ask price and volume for multiple markets
|
4287
4292
|
|
4288
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api
|
4293
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#symbol-order-book-ticker # spot
|
4289
4294
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Symbol-Order-Book-Ticker # swap
|
4290
4295
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Symbol-Order-Book-Ticker # future
|
4291
4296
|
|
@@ -4319,7 +4324,7 @@ class binance(Exchange, ImplicitAPI):
|
|
4319
4324
|
"""
|
4320
4325
|
fetches the last price for multiple markets
|
4321
4326
|
|
4322
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api
|
4327
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#symbol-price-ticker # spot
|
4323
4328
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Symbol-Price-Ticker # swap
|
4324
4329
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Symbol-Price-Ticker # future
|
4325
4330
|
|
@@ -4419,7 +4424,7 @@ class binance(Exchange, ImplicitAPI):
|
|
4419
4424
|
"""
|
4420
4425
|
fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
4421
4426
|
|
4422
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api
|
4427
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#24hr-ticker-price-change-statistics # spot
|
4423
4428
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/24hr-Ticker-Price-Change-Statistics # swap
|
4424
4429
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/24hr-Ticker-Price-Change-Statistics # future
|
4425
4430
|
https://developers.binance.com/docs/derivatives/option/market-data/24hr-Ticker-Price-Change-Statistics # option
|
@@ -4580,7 +4585,7 @@ class binance(Exchange, ImplicitAPI):
|
|
4580
4585
|
"""
|
4581
4586
|
fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
4582
4587
|
|
4583
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api
|
4588
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#klinecandlestick-data
|
4584
4589
|
https://developers.binance.com/docs/derivatives/option/market-data/Kline-Candlestick-Data
|
4585
4590
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Kline-Candlestick-Data
|
4586
4591
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Index-Price-Kline-Candlestick-Data
|
@@ -4693,7 +4698,8 @@ class binance(Exchange, ImplicitAPI):
|
|
4693
4698
|
# }
|
4694
4699
|
# ]
|
4695
4700
|
#
|
4696
|
-
|
4701
|
+
candles = self.parse_ohlcvs(response, market, timeframe, since, limit)
|
4702
|
+
return candles
|
4697
4703
|
|
4698
4704
|
def parse_trade(self, trade: dict, market: Market = None) -> Trade:
|
4699
4705
|
if 'isDustTrade' in trade:
|
@@ -4956,17 +4962,17 @@ class binance(Exchange, ImplicitAPI):
|
|
4956
4962
|
get the list of most recent trades for a particular symbol
|
4957
4963
|
Default fetchTradesMethod
|
4958
4964
|
|
4959
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api
|
4965
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#compressedaggregate-trades-list # publicGetAggTrades(spot)
|
4960
4966
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Compressed-Aggregate-Trades-List # fapiPublicGetAggTrades(swap)
|
4961
4967
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Compressed-Aggregate-Trades-List # dapiPublicGetAggTrades(future)
|
4962
4968
|
https://developers.binance.com/docs/derivatives/option/market-data/Recent-Trades-List # eapiPublicGetTrades(option)
|
4963
4969
|
|
4964
4970
|
Other fetchTradesMethod
|
4965
4971
|
|
4966
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api
|
4972
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#recent-trades-list # publicGetTrades(spot)
|
4967
4973
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Recent-Trades-List # fapiPublicGetTrades(swap)
|
4968
4974
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Recent-Trades-List # dapiPublicGetTrades(future)
|
4969
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api
|
4975
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#old-trade-lookup # publicGetHistoricalTrades(spot)
|
4970
4976
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Old-Trades-Lookup # fapiPublicGetHistoricalTrades(swap)
|
4971
4977
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Old-Trades-Lookup # dapiPublicGetHistoricalTrades(future)
|
4972
4978
|
https://developers.binance.com/docs/derivatives/option/market-data/Old-Trades-Lookup # eapiPublicGetHistoricalTrades(option)
|
@@ -5095,7 +5101,7 @@ class binance(Exchange, ImplicitAPI):
|
|
5095
5101
|
@ignore
|
5096
5102
|
edit a trade order
|
5097
5103
|
|
5098
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api
|
5104
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#cancel-an-existing-order-and-send-a-new-order-trade
|
5099
5105
|
|
5100
5106
|
:param str id: cancel order id
|
5101
5107
|
:param str symbol: unified symbol of the market to create an order in
|
@@ -5302,7 +5308,7 @@ class binance(Exchange, ImplicitAPI):
|
|
5302
5308
|
isPortfolioMargin = None
|
5303
5309
|
isPortfolioMargin, params = self.handle_option_and_params_2(params, 'editContractOrder', 'papi', 'portfolioMargin', False)
|
5304
5310
|
if market['linear'] or isPortfolioMargin:
|
5305
|
-
if price is None:
|
5311
|
+
if (price is None) and not ('priceMatch' in params):
|
5306
5312
|
raise ArgumentsRequired(self.id + ' editOrder() requires a price argument for portfolio margin and linear orders')
|
5307
5313
|
request = self.edit_contract_order_request(id, symbol, type, side, amount, price, params)
|
5308
5314
|
response = None
|
@@ -5349,7 +5355,7 @@ class binance(Exchange, ImplicitAPI):
|
|
5349
5355
|
"""
|
5350
5356
|
edit a trade order
|
5351
5357
|
|
5352
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api
|
5358
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#cancel-an-existing-order-and-send-a-new-order-trade
|
5353
5359
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Order
|
5354
5360
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Modify-Order
|
5355
5361
|
|
@@ -5360,7 +5366,6 @@ class binance(Exchange, ImplicitAPI):
|
|
5360
5366
|
:param float amount: how much of currency you want to trade in units of base currency
|
5361
5367
|
:param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
5362
5368
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
5363
|
-
:param boolean [params.portfolioMargin]: set to True if you would like to edit an order in a portfolio margin account
|
5364
5369
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
5365
5370
|
"""
|
5366
5371
|
await self.load_markets()
|
@@ -6030,8 +6035,8 @@ class binance(Exchange, ImplicitAPI):
|
|
6030
6035
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/New-Order
|
6031
6036
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/New-Order
|
6032
6037
|
https://developers.binance.com/docs/derivatives/option/trade/New-Order
|
6033
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api
|
6034
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api
|
6038
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#sor
|
6039
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#test-new-order-using-sor-trade
|
6035
6040
|
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-UM-Order
|
6036
6041
|
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-CM-Order
|
6037
6042
|
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-Margin-Order
|
@@ -6059,7 +6064,6 @@ class binance(Exchange, ImplicitAPI):
|
|
6059
6064
|
:param str [params.stopLossOrTakeProfit]: 'stopLoss' or 'takeProfit', required for spot trailing orders
|
6060
6065
|
: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
|
6061
6066
|
:param bool [params.hedged]: *swap and portfolio margin only* True for hedged mode, False for one way mode, default is False
|
6062
|
-
:param float [params.cost]: *spot market buy only* the quote quantity that can be used alternative for the amount
|
6063
6067
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
6064
6068
|
"""
|
6065
6069
|
await self.load_markets()
|
@@ -6378,7 +6382,7 @@ class binance(Exchange, ImplicitAPI):
|
|
6378
6382
|
"""
|
6379
6383
|
create a market order by providing the symbol, side and cost
|
6380
6384
|
|
6381
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api
|
6385
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#new-order-trade
|
6382
6386
|
|
6383
6387
|
:param str symbol: unified symbol of the market to create an order in
|
6384
6388
|
:param str side: 'buy' or 'sell'
|
@@ -6390,16 +6394,14 @@ class binance(Exchange, ImplicitAPI):
|
|
6390
6394
|
market = self.market(symbol)
|
6391
6395
|
if not market['spot']:
|
6392
6396
|
raise NotSupported(self.id + ' createMarketOrderWithCost() supports spot orders only')
|
6393
|
-
|
6394
|
-
|
6395
|
-
}
|
6396
|
-
return await self.create_order(symbol, 'market', side, 0, None, self.extend(req, params))
|
6397
|
+
params['cost'] = cost
|
6398
|
+
return await self.create_order(symbol, 'market', side, cost, None, params)
|
6397
6399
|
|
6398
6400
|
async def create_market_buy_order_with_cost(self, symbol: str, cost: float, params={}):
|
6399
6401
|
"""
|
6400
6402
|
create a market buy order by providing the symbol and cost
|
6401
6403
|
|
6402
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api
|
6404
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#new-order-trade
|
6403
6405
|
|
6404
6406
|
:param str symbol: unified symbol of the market to create an order in
|
6405
6407
|
:param float cost: how much you want to trade in units of the quote currency
|
@@ -6410,16 +6412,14 @@ class binance(Exchange, ImplicitAPI):
|
|
6410
6412
|
market = self.market(symbol)
|
6411
6413
|
if not market['spot']:
|
6412
6414
|
raise NotSupported(self.id + ' createMarketBuyOrderWithCost() supports spot orders only')
|
6413
|
-
|
6414
|
-
|
6415
|
-
}
|
6416
|
-
return await self.create_order(symbol, 'market', 'buy', 0, None, self.extend(req, params))
|
6415
|
+
params['cost'] = cost
|
6416
|
+
return await self.create_order(symbol, 'market', 'buy', cost, None, params)
|
6417
6417
|
|
6418
6418
|
async def create_market_sell_order_with_cost(self, symbol: str, cost: float, params={}):
|
6419
6419
|
"""
|
6420
6420
|
create a market sell order by providing the symbol and cost
|
6421
6421
|
|
6422
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api
|
6422
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#new-order-trade
|
6423
6423
|
|
6424
6424
|
:param str symbol: unified symbol of the market to create an order in
|
6425
6425
|
:param float cost: how much you want to trade in units of the quote currency
|
@@ -6437,7 +6437,7 @@ class binance(Exchange, ImplicitAPI):
|
|
6437
6437
|
"""
|
6438
6438
|
fetches information on an order made by the user
|
6439
6439
|
|
6440
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api
|
6440
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#query-order-user_data
|
6441
6441
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Query-Order
|
6442
6442
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Query-Order
|
6443
6443
|
https://developers.binance.com/docs/derivatives/option/trade/Query-Single-Order
|
@@ -6502,7 +6502,7 @@ class binance(Exchange, ImplicitAPI):
|
|
6502
6502
|
"""
|
6503
6503
|
fetches information on multiple orders made by the user
|
6504
6504
|
|
6505
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api
|
6505
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#all-orders-user_data
|
6506
6506
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/All-Orders
|
6507
6507
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/All-Orders
|
6508
6508
|
https://developers.binance.com/docs/derivatives/option/trade/Query-Option-Order-History
|
@@ -6761,7 +6761,7 @@ class binance(Exchange, ImplicitAPI):
|
|
6761
6761
|
"""
|
6762
6762
|
fetch all unfilled currently open orders
|
6763
6763
|
|
6764
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api
|
6764
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#current-open-orders-user_data
|
6765
6765
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Current-All-Open-Orders
|
6766
6766
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Current-All-Open-Orders
|
6767
6767
|
https://developers.binance.com/docs/derivatives/option/trade/Query-Current-Open-Option-Orders
|
@@ -7048,7 +7048,7 @@ class binance(Exchange, ImplicitAPI):
|
|
7048
7048
|
"""
|
7049
7049
|
fetches information on multiple closed orders made by the user
|
7050
7050
|
|
7051
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api
|
7051
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#all-orders-user_data
|
7052
7052
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/All-Orders
|
7053
7053
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/All-Orders
|
7054
7054
|
https://developers.binance.com/docs/derivatives/option/trade/Query-Option-Order-History
|
@@ -7077,7 +7077,7 @@ class binance(Exchange, ImplicitAPI):
|
|
7077
7077
|
"""
|
7078
7078
|
fetches information on multiple canceled orders made by the user
|
7079
7079
|
|
7080
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api
|
7080
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#all-orders-user_data
|
7081
7081
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/All-Orders
|
7082
7082
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/All-Orders
|
7083
7083
|
https://developers.binance.com/docs/derivatives/option/trade/Query-Option-Order-History
|
@@ -7106,7 +7106,7 @@ class binance(Exchange, ImplicitAPI):
|
|
7106
7106
|
"""
|
7107
7107
|
fetches information on multiple canceled orders made by the user
|
7108
7108
|
|
7109
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api
|
7109
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#all-orders-user_data
|
7110
7110
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/All-Orders
|
7111
7111
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/All-Orders
|
7112
7112
|
https://developers.binance.com/docs/derivatives/option/trade/Query-Option-Order-History
|
@@ -7138,7 +7138,7 @@ class binance(Exchange, ImplicitAPI):
|
|
7138
7138
|
"""
|
7139
7139
|
cancels an open order
|
7140
7140
|
|
7141
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api
|
7141
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#cancel-order-trade
|
7142
7142
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-Order
|
7143
7143
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Cancel-Order
|
7144
7144
|
https://developers.binance.com/docs/derivatives/option/trade/Cancel-Option-Order
|
@@ -7219,7 +7219,7 @@ class binance(Exchange, ImplicitAPI):
|
|
7219
7219
|
"""
|
7220
7220
|
cancel all open orders in a market
|
7221
7221
|
|
7222
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api
|
7222
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#cancel-all-open-orders-on-a-symbol-trade
|
7223
7223
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-All-Open-Orders
|
7224
7224
|
https://developers.binance.com/docs/derivatives/option/trade/Cancel-all-Option-orders-on-specific-symbol
|
7225
7225
|
https://developers.binance.com/docs/margin_trading/trade/Margin-Account-Cancel-All-Open-Orders
|
@@ -7444,7 +7444,7 @@ class binance(Exchange, ImplicitAPI):
|
|
7444
7444
|
"""
|
7445
7445
|
fetch all the trades made from a single order
|
7446
7446
|
|
7447
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api
|
7447
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#account-trade-list-user_data
|
7448
7448
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Account-Trade-List
|
7449
7449
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Account-Trade-List
|
7450
7450
|
https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-Trade-List
|
@@ -7473,7 +7473,7 @@ class binance(Exchange, ImplicitAPI):
|
|
7473
7473
|
"""
|
7474
7474
|
fetch all trades made by the user
|
7475
7475
|
|
7476
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api
|
7476
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#account-trade-list-user_data
|
7477
7477
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Account-Trade-List
|
7478
7478
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Account-Trade-List
|
7479
7479
|
https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-Trade-List
|
@@ -11213,7 +11213,7 @@ class binance(Exchange, ImplicitAPI):
|
|
11213
11213
|
body = self.urlencode(params)
|
11214
11214
|
else:
|
11215
11215
|
raise AuthenticationError(self.id + ' userDataStream endpoint requires `apiKey` credential')
|
11216
|
-
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
|
+
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'):
|
11217
11217
|
self.check_required_credentials()
|
11218
11218
|
if method == 'POST' and ((path == 'order') or (path == 'sor/order')):
|
11219
11219
|
# inject in implicit API calls
|
@@ -12074,7 +12074,7 @@ class binance(Exchange, ImplicitAPI):
|
|
12074
12074
|
:returns dict: an array of `open interest structure <https://docs.ccxt.com/#/?id=open-interest-structure>`
|
12075
12075
|
"""
|
12076
12076
|
if timeframe == '1m':
|
12077
|
-
raise BadRequest(self.id + 'fetchOpenInterestHistory cannot use the 1m timeframe')
|
12077
|
+
raise BadRequest(self.id + ' fetchOpenInterestHistory cannot use the 1m timeframe')
|
12078
12078
|
await self.load_markets()
|
12079
12079
|
paginate = False
|
12080
12080
|
paginate, params = self.handle_option_and_params(params, 'fetchOpenInterestHistory', 'paginate', False)
|
@@ -12383,7 +12383,7 @@ class binance(Exchange, ImplicitAPI):
|
|
12383
12383
|
# "price": "10871.09",
|
12384
12384
|
# "avgPrice": "10913.21000",
|
12385
12385
|
# "origQty": "0.001",
|
12386
|
-
# "executedQty": "0.
|
12386
|
+
# "executedQty": "0.002",
|
12387
12387
|
# "cumQuote": "10.91321",
|
12388
12388
|
# "timeInForce": "IOC",
|
12389
12389
|
# "type": "LIMIT",
|
@@ -12833,7 +12833,7 @@ class binance(Exchange, ImplicitAPI):
|
|
12833
12833
|
elif market['inverse']:
|
12834
12834
|
response = await self.dapiPrivateGetPositionMarginHistory(self.extend(request, params))
|
12835
12835
|
else:
|
12836
|
-
raise BadRequest(self.id + 'fetchMarginAdjustmentHistory() is not supported for markets of type ' + market['type'])
|
12836
|
+
raise BadRequest(self.id + ' fetchMarginAdjustmentHistory() is not supported for markets of type ' + market['type'])
|
12837
12837
|
#
|
12838
12838
|
# [
|
12839
12839
|
# {
|
ccxt/async_support/bingx.py
CHANGED
@@ -519,6 +519,8 @@ class bingx(Exchange, ImplicitAPI):
|
|
519
519
|
'SNOW': 'Snowman', # Snowman vs SnowSwap conflict
|
520
520
|
'OMNI': 'OmniCat',
|
521
521
|
'NAP': '$NAP', # NAP on SOL = SNAP
|
522
|
+
'TRUMP': 'TRUMPMAGA',
|
523
|
+
'TRUMPSOL': 'TRUMP',
|
522
524
|
},
|
523
525
|
'options': {
|
524
526
|
'defaultType': 'spot',
|
@@ -590,17 +592,20 @@ class bingx(Exchange, ImplicitAPI):
|
|
590
592
|
'limit': 512, # 512 days for 'allFillOrders', 1000 days for 'fillOrders'
|
591
593
|
'daysBack': 30, # 30 for 'allFillOrders', 7 for 'fillHistory'
|
592
594
|
'untilDays': 30, # 30 for 'allFillOrders', 7 for 'fillHistory'
|
595
|
+
'symbolRequired': True,
|
593
596
|
},
|
594
597
|
'fetchOrder': {
|
595
598
|
'marginMode': False,
|
596
599
|
'trigger': False,
|
597
600
|
'trailing': False,
|
601
|
+
'symbolRequired': True,
|
598
602
|
},
|
599
603
|
'fetchOpenOrders': {
|
600
604
|
'marginMode': False,
|
601
605
|
'limit': None,
|
602
606
|
'trigger': False,
|
603
607
|
'trailing': False,
|
608
|
+
'symbolRequired': False,
|
604
609
|
},
|
605
610
|
'fetchOrders': {
|
606
611
|
'marginMode': False,
|
@@ -609,6 +614,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
609
614
|
'untilDays': 7,
|
610
615
|
'trigger': False,
|
611
616
|
'trailing': False,
|
617
|
+
'symbolRequired': True,
|
612
618
|
},
|
613
619
|
'fetchClosedOrders': {
|
614
620
|
'marginMode': False,
|
@@ -618,6 +624,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
618
624
|
'untilDays': 7,
|
619
625
|
'trigger': False,
|
620
626
|
'trailing': False,
|
627
|
+
'symbolRequired': True,
|
621
628
|
},
|
622
629
|
'fetchOHLCV': {
|
623
630
|
'limit': 1440,
|
@@ -630,19 +637,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
630
637
|
'daysBack': None,
|
631
638
|
'untilDays': None,
|
632
639
|
},
|
633
|
-
'fetchOHLCV': {
|
634
|
-
'limit': 1440,
|
635
|
-
},
|
636
640
|
'fetchOrders': None,
|
637
|
-
'fetchClosedOrders': {
|
638
|
-
'marginMode': False,
|
639
|
-
'limit': 1000,
|
640
|
-
'daysBack': None,
|
641
|
-
'daysBackCanceled': None,
|
642
|
-
'untilDays': 7,
|
643
|
-
'trigger': False,
|
644
|
-
'trailing': False,
|
645
|
-
},
|
646
641
|
},
|
647
642
|
#
|
648
643
|
'spot': {
|
@@ -671,12 +666,16 @@ class bingx(Exchange, ImplicitAPI):
|
|
671
666
|
'extends': 'defaultForInverse',
|
672
667
|
},
|
673
668
|
},
|
669
|
+
'defaultForFuture': {
|
670
|
+
'extends': 'defaultForLinear',
|
671
|
+
'fetchOrders': None,
|
672
|
+
},
|
674
673
|
'future': {
|
675
674
|
'linear': {
|
676
|
-
'extends': '
|
675
|
+
'extends': 'defaultForFuture',
|
677
676
|
},
|
678
677
|
'inverse': {
|
679
|
-
'extends': '
|
678
|
+
'extends': 'defaultForFuture',
|
680
679
|
},
|
681
680
|
},
|
682
681
|
},
|
@@ -819,7 +818,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
819
818
|
}
|
820
819
|
return result
|
821
820
|
|
822
|
-
async def fetch_spot_markets(self, params):
|
821
|
+
async def fetch_spot_markets(self, params) -> List[Market]:
|
823
822
|
response = await self.spotV1PublicGetCommonSymbols(params)
|
824
823
|
#
|
825
824
|
# {
|
@@ -2658,10 +2657,8 @@ class bingx(Exchange, ImplicitAPI):
|
|
2658
2657
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2659
2658
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
2660
2659
|
"""
|
2661
|
-
|
2662
|
-
|
2663
|
-
}
|
2664
|
-
return await self.create_order(symbol, 'market', side, cost, None, self.extend(req, params))
|
2660
|
+
params['quoteOrderQty'] = cost
|
2661
|
+
return await self.create_order(symbol, 'market', side, cost, None, params)
|
2665
2662
|
|
2666
2663
|
async def create_market_buy_order_with_cost(self, symbol: str, cost: float, params={}):
|
2667
2664
|
"""
|
@@ -2671,10 +2668,8 @@ class bingx(Exchange, ImplicitAPI):
|
|
2671
2668
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2672
2669
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
2673
2670
|
"""
|
2674
|
-
|
2675
|
-
|
2676
|
-
}
|
2677
|
-
return await self.create_order(symbol, 'market', 'buy', cost, None, self.extend(req, params))
|
2671
|
+
params['quoteOrderQty'] = cost
|
2672
|
+
return await self.create_order(symbol, 'market', 'buy', cost, None, params)
|
2678
2673
|
|
2679
2674
|
async def create_market_sell_order_with_cost(self, symbol: str, cost: float, params={}):
|
2680
2675
|
"""
|
@@ -2684,10 +2679,8 @@ class bingx(Exchange, ImplicitAPI):
|
|
2684
2679
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2685
2680
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
2686
2681
|
"""
|
2687
|
-
|
2688
|
-
|
2689
|
-
}
|
2690
|
-
return await self.create_order(symbol, 'market', 'sell', cost, None, self.extend(req, params))
|
2682
|
+
params['quoteOrderQty'] = cost
|
2683
|
+
return await self.create_order(symbol, 'market', 'sell', cost, None, params)
|
2691
2684
|
|
2692
2685
|
def create_order_request(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
|
2693
2686
|
"""
|
@@ -2870,7 +2863,10 @@ class bingx(Exchange, ImplicitAPI):
|
|
2870
2863
|
else:
|
2871
2864
|
positionSide = 'BOTH'
|
2872
2865
|
request['positionSide'] = positionSide
|
2873
|
-
|
2866
|
+
amountReq = amount
|
2867
|
+
if not market['inverse']:
|
2868
|
+
amountReq = self.parse_to_numeric(self.amount_to_precision(symbol, amount))
|
2869
|
+
request['quantity'] = amountReq # precision not available for inverse contracts
|
2874
2870
|
params = self.omit(params, ['hedged', 'triggerPrice', 'stopLossPrice', 'takeProfitPrice', 'trailingAmount', 'trailingPercent', 'trailingType', 'takeProfit', 'stopLoss', 'clientOrderId'])
|
2875
2871
|
return self.extend(request, params)
|
2876
2872
|
|
@@ -5534,7 +5530,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
5534
5530
|
request: dict = {
|
5535
5531
|
'coin': currency['id'],
|
5536
5532
|
'address': address,
|
5537
|
-
'amount': self.
|
5533
|
+
'amount': self.currency_to_precision(code, amount),
|
5538
5534
|
'walletType': walletType,
|
5539
5535
|
}
|
5540
5536
|
network = self.safe_string_upper(params, 'network')
|
ccxt/async_support/bit2c.py
CHANGED
@@ -209,17 +209,20 @@ class bit2c(Exchange, ImplicitAPI):
|
|
209
209
|
'limit': 100,
|
210
210
|
'daysBack': 30,
|
211
211
|
'untilDays': 30,
|
212
|
+
'symbolRequired': False,
|
212
213
|
},
|
213
214
|
'fetchOrder': {
|
214
215
|
'marginMode': False,
|
215
216
|
'trigger': False,
|
216
217
|
'trailing': False,
|
218
|
+
'symbolRequired': False,
|
217
219
|
},
|
218
220
|
'fetchOpenOrders': {
|
219
221
|
'marginMode': False,
|
220
222
|
'limit': None,
|
221
223
|
'trigger': False,
|
222
224
|
'trailing': False,
|
225
|
+
'symbolRequired': True,
|
223
226
|
},
|
224
227
|
'fetchOrders': None,
|
225
228
|
'fetchClosedOrders': None, # todo implement
|