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/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
|
@@ -5301,7 +5307,7 @@ class binance(Exchange, ImplicitAPI):
|
|
5301
5307
|
isPortfolioMargin = None
|
5302
5308
|
isPortfolioMargin, params = self.handle_option_and_params_2(params, 'editContractOrder', 'papi', 'portfolioMargin', False)
|
5303
5309
|
if market['linear'] or isPortfolioMargin:
|
5304
|
-
if price is None:
|
5310
|
+
if (price is None) and not ('priceMatch' in params):
|
5305
5311
|
raise ArgumentsRequired(self.id + ' editOrder() requires a price argument for portfolio margin and linear orders')
|
5306
5312
|
request = self.edit_contract_order_request(id, symbol, type, side, amount, price, params)
|
5307
5313
|
response = None
|
@@ -5348,7 +5354,7 @@ class binance(Exchange, ImplicitAPI):
|
|
5348
5354
|
"""
|
5349
5355
|
edit a trade order
|
5350
5356
|
|
5351
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api
|
5357
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#cancel-an-existing-order-and-send-a-new-order-trade
|
5352
5358
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Order
|
5353
5359
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Modify-Order
|
5354
5360
|
|
@@ -5359,7 +5365,6 @@ class binance(Exchange, ImplicitAPI):
|
|
5359
5365
|
:param float amount: how much of currency you want to trade in units of base currency
|
5360
5366
|
:param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
5361
5367
|
: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
5368
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
5364
5369
|
"""
|
5365
5370
|
self.load_markets()
|
@@ -6029,8 +6034,8 @@ class binance(Exchange, ImplicitAPI):
|
|
6029
6034
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/New-Order
|
6030
6035
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/New-Order
|
6031
6036
|
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
|
6037
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#sor
|
6038
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#test-new-order-using-sor-trade
|
6034
6039
|
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-UM-Order
|
6035
6040
|
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-CM-Order
|
6036
6041
|
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-Margin-Order
|
@@ -6058,7 +6063,6 @@ class binance(Exchange, ImplicitAPI):
|
|
6058
6063
|
:param str [params.stopLossOrTakeProfit]: 'stopLoss' or 'takeProfit', required for spot trailing orders
|
6059
6064
|
: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
6065
|
: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
6066
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
6063
6067
|
"""
|
6064
6068
|
self.load_markets()
|
@@ -6377,7 +6381,7 @@ class binance(Exchange, ImplicitAPI):
|
|
6377
6381
|
"""
|
6378
6382
|
create a market order by providing the symbol, side and cost
|
6379
6383
|
|
6380
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api
|
6384
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#new-order-trade
|
6381
6385
|
|
6382
6386
|
:param str symbol: unified symbol of the market to create an order in
|
6383
6387
|
:param str side: 'buy' or 'sell'
|
@@ -6389,16 +6393,14 @@ class binance(Exchange, ImplicitAPI):
|
|
6389
6393
|
market = self.market(symbol)
|
6390
6394
|
if not market['spot']:
|
6391
6395
|
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))
|
6396
|
+
params['cost'] = cost
|
6397
|
+
return self.create_order(symbol, 'market', side, cost, None, params)
|
6396
6398
|
|
6397
6399
|
def create_market_buy_order_with_cost(self, symbol: str, cost: float, params={}):
|
6398
6400
|
"""
|
6399
6401
|
create a market buy order by providing the symbol and cost
|
6400
6402
|
|
6401
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api
|
6403
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#new-order-trade
|
6402
6404
|
|
6403
6405
|
:param str symbol: unified symbol of the market to create an order in
|
6404
6406
|
:param float cost: how much you want to trade in units of the quote currency
|
@@ -6409,16 +6411,14 @@ class binance(Exchange, ImplicitAPI):
|
|
6409
6411
|
market = self.market(symbol)
|
6410
6412
|
if not market['spot']:
|
6411
6413
|
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))
|
6414
|
+
params['cost'] = cost
|
6415
|
+
return self.create_order(symbol, 'market', 'buy', cost, None, params)
|
6416
6416
|
|
6417
6417
|
def create_market_sell_order_with_cost(self, symbol: str, cost: float, params={}):
|
6418
6418
|
"""
|
6419
6419
|
create a market sell order by providing the symbol and cost
|
6420
6420
|
|
6421
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api
|
6421
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#new-order-trade
|
6422
6422
|
|
6423
6423
|
:param str symbol: unified symbol of the market to create an order in
|
6424
6424
|
:param float cost: how much you want to trade in units of the quote currency
|
@@ -6436,7 +6436,7 @@ class binance(Exchange, ImplicitAPI):
|
|
6436
6436
|
"""
|
6437
6437
|
fetches information on an order made by the user
|
6438
6438
|
|
6439
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api
|
6439
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#query-order-user_data
|
6440
6440
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Query-Order
|
6441
6441
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Query-Order
|
6442
6442
|
https://developers.binance.com/docs/derivatives/option/trade/Query-Single-Order
|
@@ -6501,7 +6501,7 @@ class binance(Exchange, ImplicitAPI):
|
|
6501
6501
|
"""
|
6502
6502
|
fetches information on multiple orders made by the user
|
6503
6503
|
|
6504
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api
|
6504
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#all-orders-user_data
|
6505
6505
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/All-Orders
|
6506
6506
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/All-Orders
|
6507
6507
|
https://developers.binance.com/docs/derivatives/option/trade/Query-Option-Order-History
|
@@ -6760,7 +6760,7 @@ class binance(Exchange, ImplicitAPI):
|
|
6760
6760
|
"""
|
6761
6761
|
fetch all unfilled currently open orders
|
6762
6762
|
|
6763
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api
|
6763
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#current-open-orders-user_data
|
6764
6764
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Current-All-Open-Orders
|
6765
6765
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Current-All-Open-Orders
|
6766
6766
|
https://developers.binance.com/docs/derivatives/option/trade/Query-Current-Open-Option-Orders
|
@@ -7047,7 +7047,7 @@ class binance(Exchange, ImplicitAPI):
|
|
7047
7047
|
"""
|
7048
7048
|
fetches information on multiple closed orders made by the user
|
7049
7049
|
|
7050
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api
|
7050
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#all-orders-user_data
|
7051
7051
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/All-Orders
|
7052
7052
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/All-Orders
|
7053
7053
|
https://developers.binance.com/docs/derivatives/option/trade/Query-Option-Order-History
|
@@ -7076,7 +7076,7 @@ class binance(Exchange, ImplicitAPI):
|
|
7076
7076
|
"""
|
7077
7077
|
fetches information on multiple canceled orders made by the user
|
7078
7078
|
|
7079
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api
|
7079
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#all-orders-user_data
|
7080
7080
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/All-Orders
|
7081
7081
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/All-Orders
|
7082
7082
|
https://developers.binance.com/docs/derivatives/option/trade/Query-Option-Order-History
|
@@ -7105,7 +7105,7 @@ class binance(Exchange, ImplicitAPI):
|
|
7105
7105
|
"""
|
7106
7106
|
fetches information on multiple canceled orders made by the user
|
7107
7107
|
|
7108
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api
|
7108
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#all-orders-user_data
|
7109
7109
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/All-Orders
|
7110
7110
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/All-Orders
|
7111
7111
|
https://developers.binance.com/docs/derivatives/option/trade/Query-Option-Order-History
|
@@ -7137,7 +7137,7 @@ class binance(Exchange, ImplicitAPI):
|
|
7137
7137
|
"""
|
7138
7138
|
cancels an open order
|
7139
7139
|
|
7140
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api
|
7140
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#cancel-order-trade
|
7141
7141
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-Order
|
7142
7142
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Cancel-Order
|
7143
7143
|
https://developers.binance.com/docs/derivatives/option/trade/Cancel-Option-Order
|
@@ -7218,7 +7218,7 @@ class binance(Exchange, ImplicitAPI):
|
|
7218
7218
|
"""
|
7219
7219
|
cancel all open orders in a market
|
7220
7220
|
|
7221
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api
|
7221
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#cancel-all-open-orders-on-a-symbol-trade
|
7222
7222
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-All-Open-Orders
|
7223
7223
|
https://developers.binance.com/docs/derivatives/option/trade/Cancel-all-Option-orders-on-specific-symbol
|
7224
7224
|
https://developers.binance.com/docs/margin_trading/trade/Margin-Account-Cancel-All-Open-Orders
|
@@ -7443,7 +7443,7 @@ class binance(Exchange, ImplicitAPI):
|
|
7443
7443
|
"""
|
7444
7444
|
fetch all the trades made from a single order
|
7445
7445
|
|
7446
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api
|
7446
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#account-trade-list-user_data
|
7447
7447
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Account-Trade-List
|
7448
7448
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Account-Trade-List
|
7449
7449
|
https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-Trade-List
|
@@ -7472,7 +7472,7 @@ class binance(Exchange, ImplicitAPI):
|
|
7472
7472
|
"""
|
7473
7473
|
fetch all trades made by the user
|
7474
7474
|
|
7475
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api
|
7475
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#account-trade-list-user_data
|
7476
7476
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Account-Trade-List
|
7477
7477
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Account-Trade-List
|
7478
7478
|
https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-Trade-List
|
@@ -11212,7 +11212,7 @@ class binance(Exchange, ImplicitAPI):
|
|
11212
11212
|
body = self.urlencode(params)
|
11213
11213
|
else:
|
11214
11214
|
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')
|
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'):
|
11216
11216
|
self.check_required_credentials()
|
11217
11217
|
if method == 'POST' and ((path == 'order') or (path == 'sor/order')):
|
11218
11218
|
# inject in implicit API calls
|
@@ -12073,7 +12073,7 @@ class binance(Exchange, ImplicitAPI):
|
|
12073
12073
|
:returns dict: an array of `open interest structure <https://docs.ccxt.com/#/?id=open-interest-structure>`
|
12074
12074
|
"""
|
12075
12075
|
if timeframe == '1m':
|
12076
|
-
raise BadRequest(self.id + 'fetchOpenInterestHistory cannot use the 1m timeframe')
|
12076
|
+
raise BadRequest(self.id + ' fetchOpenInterestHistory cannot use the 1m timeframe')
|
12077
12077
|
self.load_markets()
|
12078
12078
|
paginate = False
|
12079
12079
|
paginate, params = self.handle_option_and_params(params, 'fetchOpenInterestHistory', 'paginate', False)
|
@@ -12382,7 +12382,7 @@ class binance(Exchange, ImplicitAPI):
|
|
12382
12382
|
# "price": "10871.09",
|
12383
12383
|
# "avgPrice": "10913.21000",
|
12384
12384
|
# "origQty": "0.001",
|
12385
|
-
# "executedQty": "0.
|
12385
|
+
# "executedQty": "0.002",
|
12386
12386
|
# "cumQuote": "10.91321",
|
12387
12387
|
# "timeInForce": "IOC",
|
12388
12388
|
# "type": "LIMIT",
|
@@ -12832,7 +12832,7 @@ class binance(Exchange, ImplicitAPI):
|
|
12832
12832
|
elif market['inverse']:
|
12833
12833
|
response = self.dapiPrivateGetPositionMarginHistory(self.extend(request, params))
|
12834
12834
|
else:
|
12835
|
-
raise BadRequest(self.id + 'fetchMarginAdjustmentHistory() is not supported for markets of type ' + market['type'])
|
12835
|
+
raise BadRequest(self.id + ' fetchMarginAdjustmentHistory() is not supported for markets of type ' + market['type'])
|
12836
12836
|
#
|
12837
12837
|
# [
|
12838
12838
|
# {
|
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')
|
ccxt/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
|