ccxt 4.4.43__py2.py3-none-any.whl → 4.4.45__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 +1 -0
- ccxt/abstract/binancecoinm.py +1 -0
- ccxt/abstract/binanceus.py +1 -0
- ccxt/abstract/binanceusdm.py +1 -0
- ccxt/abstract/blofin.py +22 -0
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/base/exchange.py +1 -1
- ccxt/async_support/binance.py +235 -107
- ccxt/async_support/bingx.py +20 -9
- ccxt/async_support/bitfinex.py +7 -3
- ccxt/async_support/bitget.py +6 -4
- ccxt/async_support/bitmart.py +7 -10
- ccxt/async_support/bitmex.py +4 -6
- ccxt/async_support/bitstamp.py +5 -0
- ccxt/async_support/blofin.py +22 -0
- ccxt/async_support/bybit.py +12 -27
- ccxt/async_support/coinbase.py +14 -10
- ccxt/async_support/coinbaseinternational.py +13 -9
- ccxt/async_support/coincatch.py +2 -2
- ccxt/async_support/coinex.py +6 -6
- ccxt/async_support/cryptocom.py +5 -3
- ccxt/async_support/defx.py +2 -2
- ccxt/async_support/delta.py +1 -1
- ccxt/async_support/exmo.py +16 -8
- ccxt/async_support/gate.py +10 -5
- ccxt/async_support/gemini.py +5 -0
- ccxt/async_support/hashkey.py +15 -10
- ccxt/async_support/htx.py +103 -5
- ccxt/async_support/hyperliquid.py +6 -1
- ccxt/async_support/kraken.py +10 -3
- ccxt/async_support/krakenfutures.py +6 -1
- ccxt/async_support/kucoin.py +10 -8
- ccxt/async_support/kucoinfutures.py +7 -8
- ccxt/async_support/lykke.py +1 -1
- ccxt/async_support/mexc.py +20 -14
- ccxt/async_support/myokx.py +8 -0
- ccxt/async_support/ndax.py +1 -1
- ccxt/async_support/oceanex.py +1 -1
- ccxt/async_support/okx.py +9 -10
- ccxt/async_support/onetrading.py +2 -1
- ccxt/async_support/whitebit.py +35 -10
- ccxt/async_support/woo.py +6 -4
- ccxt/async_support/woofipro.py +7 -4
- ccxt/base/exchange.py +1 -1
- ccxt/binance.py +235 -107
- ccxt/bingx.py +20 -9
- ccxt/bitfinex.py +7 -3
- ccxt/bitget.py +6 -4
- ccxt/bitmart.py +7 -10
- ccxt/bitmex.py +4 -6
- ccxt/bitstamp.py +5 -0
- ccxt/blofin.py +22 -0
- ccxt/bybit.py +12 -27
- ccxt/coinbase.py +14 -10
- ccxt/coinbaseinternational.py +13 -9
- ccxt/coincatch.py +2 -2
- ccxt/coinex.py +6 -6
- ccxt/cryptocom.py +5 -3
- ccxt/defx.py +2 -2
- ccxt/delta.py +1 -1
- ccxt/exmo.py +16 -8
- ccxt/gate.py +10 -5
- ccxt/gemini.py +5 -0
- ccxt/hashkey.py +15 -10
- ccxt/htx.py +103 -5
- ccxt/hyperliquid.py +6 -1
- ccxt/kraken.py +10 -3
- ccxt/krakenfutures.py +6 -1
- ccxt/kucoin.py +10 -8
- ccxt/kucoinfutures.py +7 -8
- ccxt/lykke.py +1 -1
- ccxt/mexc.py +20 -14
- ccxt/myokx.py +8 -0
- ccxt/ndax.py +1 -1
- ccxt/oceanex.py +1 -1
- ccxt/okx.py +9 -10
- ccxt/onetrading.py +2 -1
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/binance.py +2 -1
- ccxt/pro/bitcoincom.py +4 -1
- ccxt/pro/bitopro.py +1 -1
- ccxt/pro/myokx.py +5 -0
- ccxt/whitebit.py +35 -10
- ccxt/woo.py +6 -4
- ccxt/woofipro.py +7 -4
- {ccxt-4.4.43.dist-info → ccxt-4.4.45.dist-info}/METADATA +4 -4
- {ccxt-4.4.43.dist-info → ccxt-4.4.45.dist-info}/RECORD +91 -91
- {ccxt-4.4.43.dist-info → ccxt-4.4.45.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.4.43.dist-info → ccxt-4.4.45.dist-info}/WHEEL +0 -0
- {ccxt-4.4.43.dist-info → ccxt-4.4.45.dist-info}/top_level.txt +0 -0
ccxt/async_support/binance.py
CHANGED
@@ -249,6 +249,7 @@ 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',
|
252
253
|
},
|
253
254
|
'www': 'https://www.binance.com',
|
254
255
|
'referral': {
|
@@ -1191,6 +1192,11 @@ class binance(Exchange, ImplicitAPI):
|
|
1191
1192
|
'listenKey': 0.2,
|
1192
1193
|
},
|
1193
1194
|
},
|
1195
|
+
'papiV2': {
|
1196
|
+
'get': {
|
1197
|
+
'um/account': 1,
|
1198
|
+
},
|
1199
|
+
},
|
1194
1200
|
},
|
1195
1201
|
'fees': {
|
1196
1202
|
'trading': {
|
@@ -1583,7 +1589,6 @@ class binance(Exchange, ImplicitAPI):
|
|
1583
1589
|
},
|
1584
1590
|
},
|
1585
1591
|
'features': {
|
1586
|
-
# https://developers.binance.com/docs/binance-spot-api-docs/rest-api#:~:text=quoteOrderQty
|
1587
1592
|
'spot': {
|
1588
1593
|
'sandbox': True,
|
1589
1594
|
'createOrder': {
|
@@ -1601,12 +1606,13 @@ class binance(Exchange, ImplicitAPI):
|
|
1601
1606
|
'GTD': False,
|
1602
1607
|
},
|
1603
1608
|
'hedged': True,
|
1609
|
+
'leverage': False,
|
1610
|
+
'marketBuyRequiresPrice': False,
|
1611
|
+
'marketBuyByCost': True,
|
1604
1612
|
# exchange-supported features
|
1605
|
-
'selfTradePrevention': True,
|
1613
|
+
'selfTradePrevention': True, # todo
|
1606
1614
|
'trailing': True,
|
1607
|
-
'
|
1608
|
-
'iceberg': True,
|
1609
|
-
'oco': False,
|
1615
|
+
'iceberg': True, # todo implementation
|
1610
1616
|
},
|
1611
1617
|
'createOrders': None,
|
1612
1618
|
'fetchMyTrades': {
|
@@ -1637,7 +1643,7 @@ class binance(Exchange, ImplicitAPI):
|
|
1637
1643
|
'fetchClosedOrders': {
|
1638
1644
|
'marginMode': True,
|
1639
1645
|
'limit': 1000,
|
1640
|
-
'
|
1646
|
+
'daysBack': None,
|
1641
1647
|
'daysBackCanceled': None,
|
1642
1648
|
'untilDays': 10000,
|
1643
1649
|
'trigger': False,
|
@@ -1669,11 +1675,12 @@ class binance(Exchange, ImplicitAPI):
|
|
1669
1675
|
},
|
1670
1676
|
'hedged': True,
|
1671
1677
|
# exchange-supported features
|
1672
|
-
'selfTradePrevention': True,
|
1678
|
+
'selfTradePrevention': True, # todo
|
1673
1679
|
'trailing': True,
|
1674
|
-
'twap': False,
|
1675
1680
|
'iceberg': False,
|
1676
|
-
'
|
1681
|
+
'leverage': False,
|
1682
|
+
'marketBuyRequiresPrice': False,
|
1683
|
+
'marketBuyByCost': True,
|
1677
1684
|
},
|
1678
1685
|
'createOrders': {
|
1679
1686
|
'max': 5,
|
@@ -1706,7 +1713,7 @@ class binance(Exchange, ImplicitAPI):
|
|
1706
1713
|
'fetchClosedOrders': {
|
1707
1714
|
'marginMode': True,
|
1708
1715
|
'limit': 1000,
|
1709
|
-
'
|
1716
|
+
'daysBack': 90,
|
1710
1717
|
'daysBackCanceled': 3,
|
1711
1718
|
'untilDays': 7,
|
1712
1719
|
'trigger': False,
|
@@ -2429,92 +2436,189 @@ class binance(Exchange, ImplicitAPI):
|
|
2429
2436
|
'portfolioMargin': {
|
2430
2437
|
'exact': {
|
2431
2438
|
#
|
2432
|
-
#
|
2439
|
+
# 10xx General Server or Network Issues
|
2433
2440
|
#
|
2434
|
-
'-
|
2435
|
-
'-
|
2436
|
-
'-
|
2437
|
-
'-
|
2438
|
-
'-
|
2439
|
-
'-
|
2440
|
-
'-
|
2441
|
-
'-
|
2441
|
+
'-1000': OperationFailed, # An unknown error occured while processing the request.
|
2442
|
+
'-1001': ExchangeError, # Internal error; unable to process your request. Please try again.
|
2443
|
+
'-1002': PermissionDenied, # You are not authorized to execute self request.
|
2444
|
+
'-1003': RateLimitExceeded, # Too many requests use the websocket for live updates to avoid polling the API.
|
2445
|
+
'-1004': BadRequest, # This IP is already on the white list.
|
2446
|
+
'-1005': PermissionDenied, # No such IP has been white listed.
|
2447
|
+
'-1006': BadResponse, # An unexpected response was received from the message bus. Execution status unknown.
|
2448
|
+
'-1007': BadResponse, # Timeout waiting for response from backend server. Send status unknown, execution status unknown.
|
2449
|
+
'-1008': OperationFailed, # WS Spot server is currently overloaded with other requests. Please try again in a few minutes.
|
2450
|
+
'-1010': ExchangeError, # ERROR_MSG_RECEIVED
|
2451
|
+
'-1011': PermissionDenied, # This IP cannot access self route.
|
2452
|
+
'-1013': ExchangeError, # INVALID_MESSAGE.
|
2453
|
+
'-1014': InvalidOrder, # Unsupported order combination.
|
2454
|
+
'-1015': InvalidOrder, # Too many new orders.
|
2455
|
+
'-1016': NotSupported, # This service is no longer available.
|
2456
|
+
'-1020': NotSupported, # This operation is not supported.
|
2457
|
+
'-1021': BadRequest, # Timestamp for self request is outside of the recvWindow 1000ms ahead of the servers time.
|
2458
|
+
'-1022': BadRequest, # Signature for self request is not valid.
|
2459
|
+
'-1023': BadRequest, # Start time is greater than end time
|
2460
|
+
'-1099': OperationFailed, # WS not found authenticated or authorized
|
2442
2461
|
#
|
2443
|
-
#
|
2462
|
+
# 11xx Request Issues
|
2444
2463
|
#
|
2445
|
-
'-
|
2446
|
-
'-
|
2447
|
-
'-
|
2448
|
-
'-
|
2464
|
+
'-1100': BadRequest, # Illegal characters found in a parameter.
|
2465
|
+
'-1101': BadRequest, # Too many parameters sent for self endpoint.
|
2466
|
+
'-1102': BadRequest, # A mandatory parameter was not sent, was empty/null, or malformed.
|
2467
|
+
'-1103': BadRequest, # An unknown parameter was sent.
|
2468
|
+
'-1104': BadRequest, # Not all sent parameters were read.
|
2469
|
+
'-1105': BadRequest, # A parameter was empty.
|
2470
|
+
'-1106': BadRequest, # A parameter was sent when not required.
|
2471
|
+
'-1108': BadRequest, # Invalid asset.
|
2472
|
+
'-1109': BadRequest, # Invalid account.
|
2473
|
+
'-1110': BadSymbol, # Invalid symbolType.
|
2474
|
+
'-1111': BadRequest, # Precision is over the maximum defined for self asset.
|
2475
|
+
'-1112': BadRequest, # No orders on book for symbol.
|
2476
|
+
'-1113': BadRequest, # Withdrawal amount must be negative.
|
2477
|
+
'-1114': BadRequest, # TimeInForce parameter sent when not required.
|
2478
|
+
'-1115': BadRequest, # Invalid timeInForce.
|
2479
|
+
'-1116': BadRequest, # Invalid orderType.
|
2480
|
+
'-1117': BadRequest, # Invalid side.
|
2481
|
+
'-1118': BadRequest, # New client order ID was empty.
|
2482
|
+
'-1119': BadRequest, # Original client order ID was empty.
|
2483
|
+
'-1120': BadRequest, # Invalid interval.
|
2484
|
+
'-1121': BadSymbol, # Invalid symbol.
|
2485
|
+
'-1125': BadRequest, # This listenKey does not exist.
|
2486
|
+
'-1127': BadRequest, # Lookup interval is too big.
|
2487
|
+
'-1128': BadRequest, # Combination of optional parameters invalid.
|
2488
|
+
'-1130': BadRequest, # Invalid data sent for a parameter.
|
2489
|
+
'-1131': BadRequest, # WS recvWindow must be less than 60000
|
2490
|
+
'-1134': BadRequest, # WS strategyType was less than 1000000.
|
2491
|
+
'-1136': BadRequest, # Invalid newOrderRespType.
|
2492
|
+
'-1145': BadRequest, # WS cancelRestrictions has to be either ONLY_NEW or ONLY_PARTIALLY_FILLED.
|
2493
|
+
'-1151': BadRequest, # WS Symbol is present multiple times in the list.
|
2494
|
+
#
|
2495
|
+
# 20xx Processing Issues
|
2496
|
+
#
|
2497
|
+
'-2010': InvalidOrder, # NEW_ORDER_REJECTED
|
2498
|
+
'-2011': OperationRejected, # CANCEL_REJECTED
|
2499
|
+
'-2013': BadRequest, # Order does not exist.
|
2500
|
+
'-2014': OperationRejected, # API-key format invalid.
|
2501
|
+
'-2015': OperationRejected, # Invalid API-key, IP, or permissions for action.
|
2502
|
+
'-2016': OperationFailed, # No trading window could be found for the symbol. Try ticker/24hrs instead.
|
2503
|
+
'-2018': OperationFailed, # Balance is insufficient.
|
2504
|
+
'-2019': OperationFailed, # Margin is insufficient.
|
2505
|
+
'-2020': OrderNotFillable, # Unable to fill.
|
2449
2506
|
'-2021': OrderImmediatelyFillable, # Order would immediately trigger.
|
2450
|
-
'-2022': InvalidOrder, # ReduceOnly Order is rejected
|
2451
|
-
'-2023': OperationFailed, # User in liquidation mode now
|
2452
|
-
'-2024': OperationRejected, # Position is not sufficient
|
2507
|
+
'-2022': InvalidOrder, # ReduceOnly Order is rejected.
|
2508
|
+
'-2023': OperationFailed, # User in liquidation mode now.
|
2509
|
+
'-2024': OperationRejected, # Position is not sufficient.
|
2453
2510
|
'-2025': OperationRejected, # Reach max open order limit.
|
2454
2511
|
'-2026': InvalidOrder, # This OrderType is not supported when reduceOnly.
|
2455
2512
|
'-2027': OperationRejected, # Exceeded the maximum allowable position at current leverage.
|
2456
2513
|
'-2028': OperationRejected, # Leverage is smaller than permitted: insufficient margin balance.
|
2457
2514
|
#
|
2458
|
-
# 4xxx
|
2515
|
+
# 4xxx Filters and other issues
|
2459
2516
|
#
|
2460
|
-
'-
|
2461
|
-
'-
|
2462
|
-
'-
|
2463
|
-
'-
|
2464
|
-
'-
|
2517
|
+
'-4000': BadRequest, # Invalid order status.
|
2518
|
+
'-4001': BadRequest, # Price less than 0.
|
2519
|
+
'-4002': BadRequest, # Price greater than max price.
|
2520
|
+
'-4003': BadRequest, # Quantity less than zero.
|
2521
|
+
'-4004': BadRequest, # Quantity less than min quantity.
|
2522
|
+
'-4005': BadRequest, # Quantity greater than max quantity.
|
2523
|
+
'-4006': BadRequest, # Stop price less than zero.
|
2524
|
+
'-4007': BadRequest, # Stop price greater than max price.
|
2525
|
+
'-4008': BadRequest, # Tick size less than zero.
|
2526
|
+
'-4009': BadRequest, # Max price less than min price.
|
2527
|
+
'-4010': BadRequest, # Max qty less than min qty.
|
2528
|
+
'-4011': BadRequest, # Step size less than zero.
|
2529
|
+
'-4012': BadRequest, # Max mum orders less than zero.
|
2530
|
+
'-4013': BadRequest, # Price less than min price.
|
2531
|
+
'-4014': BadRequest, # Price not increased by tick size.
|
2532
|
+
'-4015': BadRequest, # Client order id is not valid.
|
2533
|
+
'-4016': BadRequest, # Price is higher than mark price multiplier cap.
|
2534
|
+
'-4017': BadRequest, # Multiplier up less than zero.
|
2535
|
+
'-4018': BadRequest, # Multiplier down less than zero.
|
2536
|
+
'-4019': BadRequest, # Composite scale too large.
|
2537
|
+
'-4020': BadRequest, # Target strategy invalid for orderType '%s',reduceOnly '%b'.
|
2538
|
+
'-4021': BadRequest, # Invalid depth limit.
|
2539
|
+
'-4022': BadRequest, # market status sent is not valid.
|
2540
|
+
'-4023': BadRequest, # Qty not increased by step size.
|
2541
|
+
'-4024': BadRequest, # Price is lower than mark price multiplier floor.
|
2542
|
+
'-4025': BadRequest, # Multiplier decimal less than zero.
|
2543
|
+
'-4026': BadRequest, # Commission invalid.
|
2544
|
+
'-4027': BadRequest, # Invalid account type.
|
2545
|
+
'-4028': BadRequest, # Invalid leverage
|
2546
|
+
'-4029': BadRequest, # Tick size precision is invalid.
|
2547
|
+
'-4030': BadRequest, # Step size precision is invalid.
|
2548
|
+
'-4031': BadRequest, # Invalid parameter working type
|
2549
|
+
'-4032': BadRequest, # Exceed maximum cancel order size.
|
2550
|
+
'-4033': BadRequest, # Insurance account not found.
|
2551
|
+
'-4044': BadRequest, # Balance Type is invalid.
|
2552
|
+
'-4045': BadRequest, # Reach max stop order limit.
|
2553
|
+
'-4046': BadRequest, # No need to change margin type.
|
2554
|
+
'-4047': BadRequest, # Margin type cannot be changed if there exists open orders.
|
2555
|
+
'-4048': BadRequest, # Margin type cannot be changed if there exists position.
|
2556
|
+
'-4049': BadRequest, # Add margin only support for isolated position.
|
2557
|
+
'-4050': BadRequest, # Cross balance insufficient.
|
2558
|
+
'-4051': BadRequest, # Isolated balance insufficient.
|
2559
|
+
'-4052': BadRequest, # No need to change auto add margin.
|
2560
|
+
'-4053': BadRequest, # Auto add margin only support for isolated position.
|
2561
|
+
'-4054': BadRequest, # Cannot add position margin: position is 0.
|
2562
|
+
'-4055': BadRequest, # Amount must be positive.
|
2563
|
+
'-4056': PermissionDenied, # Invalid api key type.
|
2564
|
+
'-4057': PermissionDenied, # Invalid api public key
|
2565
|
+
'-4058': BadRequest, # maxPrice and priceDecimal too large,please check.
|
2566
|
+
'-4059': BadRequest, # No need to change position side.
|
2567
|
+
'-4060': BadRequest, # Invalid position side.
|
2568
|
+
'-4061': InvalidOrder, # Order's position side does not match user's setting.
|
2569
|
+
'-4062': BadRequest, # Invalid or improper reduceOnly value.
|
2570
|
+
'-4063': BadRequest, # Invalid options request type
|
2571
|
+
'-4064': BadRequest, # Invalid options time frame
|
2572
|
+
'-4065': BadRequest, # Invalid options amount
|
2573
|
+
'-4066': BadRequest, # Invalid options event type
|
2574
|
+
'-4067': BadRequest, # Position side cannot be changed if there exists open orders.
|
2575
|
+
'-4068': BadRequest, # Position side cannot be changed if there exists position.
|
2576
|
+
'-4069': BadRequest, # Invalid options premium fee
|
2465
2577
|
'-4070': BadRequest, # Client options id is not valid.
|
2466
2578
|
'-4071': BadRequest, # Invalid options direction
|
2467
2579
|
'-4072': OperationRejected, # premium fee is not updated, reject order
|
2468
|
-
'-4073': BadRequest, #
|
2580
|
+
'-4073': BadRequest, # input premium fee is less than 0, reject order
|
2469
2581
|
'-4074': BadRequest, # Order amount is bigger than upper boundary or less than 0, reject order
|
2470
2582
|
'-4075': BadRequest, # output premium fee is less than 0, reject order
|
2471
2583
|
'-4076': OperationRejected, # original fee is too much higher than last fee
|
2472
2584
|
'-4077': OperationRejected, # place order amount has reached to limit, reject order
|
2473
2585
|
'-4078': OperationFailed, # options internal error
|
2474
2586
|
'-4079': BadRequest, # invalid options id
|
2475
|
-
'-4080': PermissionDenied, # user not found
|
2476
|
-
'-4081': BadRequest, #
|
2587
|
+
'-4080': PermissionDenied, # user not found
|
2588
|
+
'-4081': BadRequest, # options not found
|
2589
|
+
'-4082': BadRequest, # Invalid number of batch place orders.
|
2590
|
+
'-4083': BadRequest, # Fail to place batch orders.
|
2591
|
+
'-4084': NotSupported, # Method is not allowed currently. Upcoming soon.
|
2477
2592
|
'-4085': BadRequest, # Invalid notional limit coefficient
|
2478
2593
|
'-4086': BadRequest, # Invalid price spread threshold
|
2479
2594
|
'-4087': PermissionDenied, # User can only place reduce only order
|
2480
2595
|
'-4088': PermissionDenied, # User can not place order currently
|
2481
|
-
'-
|
2482
|
-
'-
|
2483
|
-
'-
|
2596
|
+
'-4104': BadRequest, # Invalid contract type
|
2597
|
+
'-4114': BadRequest, # clientTranId is not valid
|
2598
|
+
'-4115': BadRequest, # clientTranId is duplicated
|
2599
|
+
'-4118': OperationRejected, # ReduceOnly Order Failed. Please check your existing position and open orders
|
2484
2600
|
'-4131': OperationRejected, # The counterparty's best price does not meet the PERCENT_PRICE filter limit
|
2485
|
-
'-
|
2601
|
+
'-4135': BadRequest, # Invalid activation price
|
2602
|
+
'-4137': BadRequest, # Quantity must be zero with closePosition equals True
|
2603
|
+
'-4138': BadRequest, # Reduce only must be True with closePosition equals True
|
2604
|
+
'-4139': BadRequest, # Order type can not be market if it's unable to cancel
|
2605
|
+
'-4140': OrderImmediatelyFillable, # Invalid symbol status for opening position
|
2486
2606
|
'-4141': BadRequest, # Symbol is closed
|
2607
|
+
'-4142': OrderImmediatelyFillable, # REJECT: take profit or stop order will be triggered immediately
|
2487
2608
|
'-4144': BadSymbol, # Invalid pair
|
2488
2609
|
'-4161': OperationRejected, # Leverage reduction is not supported in Isolated Margin Mode with open positions
|
2489
|
-
'-4164':
|
2610
|
+
'-4164': InvalidOrder, # Order's notional must be no smaller than 5.0(unless you choose reduce only)
|
2490
2611
|
'-4165': BadRequest, # Invalid time interval
|
2491
|
-
'-4183':
|
2492
|
-
'-4184':
|
2612
|
+
'-4183': InvalidOrder, # Price is higher than stop price multiplier cap.
|
2613
|
+
'-4184': InvalidOrder, # Price is lower than stop price multiplier floor.
|
2614
|
+
'-4408': InvalidOrder, # This symbol is in reduce only mode due to regulation requirements. Please upgrade to Binance Credits Trading Mode.
|
2493
2615
|
#
|
2494
|
-
# 5xxx
|
2616
|
+
# 5xxx Order Execution Issues
|
2495
2617
|
#
|
2496
2618
|
'-5021': OrderNotFillable, # Due to the order could not be filled immediately, the FOK order has been rejected.
|
2497
2619
|
'-5022': OrderNotFillable, # Due to the order could not be executed, the Post Only order will be rejected.
|
2498
|
-
#
|
2499
|
-
#
|
2500
|
-
#
|
2501
|
-
'-20121': ExchangeError, # override commons
|
2502
|
-
'-20124': ExchangeError, # override commons
|
2503
|
-
'-20130': ExchangeError, # override commons
|
2504
|
-
'-20132': ExchangeError, # override commons
|
2505
|
-
'-20194': ExchangeError, # override commons
|
2506
|
-
'-20195': ExchangeError, # override commons
|
2507
|
-
'-20196': ExchangeError, # override commons
|
2508
|
-
'-20198': ExchangeError, # override commons
|
2509
|
-
'-20204': ExchangeError, # override commons
|
2510
|
-
# 21xxx - PORTFOLIO MARGIN(documented in spot docs)
|
2511
|
-
'-21001': BadRequest, # Request ID is not a Portfolio Margin Account.
|
2512
|
-
'-21002': BadRequest, # Portfolio Margin Account doesn't support transfer from margin to futures.
|
2513
|
-
'-21003': BadResponse, # Fail to retrieve margin assets.
|
2514
|
-
'-21004': OperationRejected, # User doesn’t have portfolio margin bankruptcy loan
|
2515
|
-
'-21005': InsufficientFunds, # User’s spot wallet doesn’t have enough BUSD to repay portfolio margin bankruptcy loan
|
2516
|
-
'-21006': OperationFailed, # User had portfolio margin bankruptcy loan repayment in process
|
2517
|
-
'-21007': OperationFailed, # User failed to repay portfolio margin bankruptcy loan since liquidation was in process
|
2620
|
+
'-5028': OperationFailed, # The requested timestamp is outside the recvWindow of the matching engine
|
2621
|
+
'-5041': RateLimitExceeded, # Time out for too many requests from self account queueing at the same time.
|
2518
2622
|
},
|
2519
2623
|
},
|
2520
2624
|
'exact': {
|
@@ -2826,7 +2930,7 @@ class binance(Exchange, ImplicitAPI):
|
|
2826
2930
|
"""
|
2827
2931
|
fetches the current integer timestamp in milliseconds from the exchange server
|
2828
2932
|
|
2829
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#check-server-time # spot
|
2933
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#check-server-time # spot
|
2830
2934
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Check-Server-Time # swap
|
2831
2935
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Check-Server-time # future
|
2832
2936
|
|
@@ -3062,7 +3166,7 @@ class binance(Exchange, ImplicitAPI):
|
|
3062
3166
|
"""
|
3063
3167
|
retrieves data on all markets for binance
|
3064
3168
|
|
3065
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#exchange-information # spot
|
3169
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#exchange-information # spot
|
3066
3170
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Exchange-Information # swap
|
3067
3171
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Exchange-Information # future
|
3068
3172
|
https://developers.binance.com/docs/derivatives/option/market-data/Exchange-Information # option
|
@@ -3542,7 +3646,11 @@ class binance(Exchange, ImplicitAPI):
|
|
3542
3646
|
account['used'] = self.safe_string(entry, 'crossMarginLocked')
|
3543
3647
|
account['total'] = self.safe_string(entry, 'crossMarginAsset')
|
3544
3648
|
else:
|
3545
|
-
|
3649
|
+
usedLinear = self.safe_string(entry, 'umUnrealizedPNL')
|
3650
|
+
usedInverse = self.safe_string(entry, 'cmUnrealizedPNL')
|
3651
|
+
totalUsed = Precise.string_add(usedLinear, usedInverse)
|
3652
|
+
totalWalletBalance = self.safe_string(entry, 'totalWalletBalance')
|
3653
|
+
account['total'] = Precise.string_add(totalUsed, totalWalletBalance)
|
3546
3654
|
result[code] = account
|
3547
3655
|
elif not isolated and ((type == 'spot') or cross):
|
3548
3656
|
timestamp = self.safe_integer(response, 'updateTime')
|
@@ -3617,7 +3725,7 @@ class binance(Exchange, ImplicitAPI):
|
|
3617
3725
|
"""
|
3618
3726
|
query for balance and get the amount of funds available for trading or funds locked in orders
|
3619
3727
|
|
3620
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#account-information-user_data # spot
|
3728
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#account-information-user_data # spot
|
3621
3729
|
https://developers.binance.com/docs/margin_trading/account/Query-Cross-Margin-Account-Details # cross margin
|
3622
3730
|
https://developers.binance.com/docs/margin_trading/account/Query-Isolated-Margin-Account-Info # isolated margin
|
3623
3731
|
https://developers.binance.com/docs/wallet/asset/funding-wallet # funding
|
@@ -3875,7 +3983,7 @@ class binance(Exchange, ImplicitAPI):
|
|
3875
3983
|
"""
|
3876
3984
|
fetches information on open orders with bid(buy) and ask(sell) prices, volumes and other data
|
3877
3985
|
|
3878
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#order-book # spot
|
3986
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#order-book # spot
|
3879
3987
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Order-Book # swap
|
3880
3988
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Order-Book # future
|
3881
3989
|
https://developers.binance.com/docs/derivatives/option/market-data/Order-Book # option
|
@@ -4132,8 +4240,8 @@ class binance(Exchange, ImplicitAPI):
|
|
4132
4240
|
"""
|
4133
4241
|
fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
4134
4242
|
|
4135
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#24hr-ticker-price-change-statistics # spot
|
4136
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#rolling-window-price-change-statistics # spot
|
4243
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#24hr-ticker-price-change-statistics # spot
|
4244
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#rolling-window-price-change-statistics # spot
|
4137
4245
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/24hr-Ticker-Price-Change-Statistics # swap
|
4138
4246
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/24hr-Ticker-Price-Change-Statistics # future
|
4139
4247
|
https://developers.binance.com/docs/derivatives/option/market-data/24hr-Ticker-Price-Change-Statistics # option
|
@@ -4171,7 +4279,7 @@ class binance(Exchange, ImplicitAPI):
|
|
4171
4279
|
"""
|
4172
4280
|
fetches the bid and ask price and volume for multiple markets
|
4173
4281
|
|
4174
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#symbol-order-book-ticker # spot
|
4282
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#symbol-order-book-ticker # spot
|
4175
4283
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Symbol-Order-Book-Ticker # swap
|
4176
4284
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Symbol-Order-Book-Ticker # future
|
4177
4285
|
|
@@ -4205,7 +4313,7 @@ class binance(Exchange, ImplicitAPI):
|
|
4205
4313
|
"""
|
4206
4314
|
fetches the last price for multiple markets
|
4207
4315
|
|
4208
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#symbol-price-ticker # spot
|
4316
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#symbol-price-ticker # spot
|
4209
4317
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Symbol-Price-Ticker # swap
|
4210
4318
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Symbol-Price-Ticker # future
|
4211
4319
|
|
@@ -4306,7 +4414,7 @@ class binance(Exchange, ImplicitAPI):
|
|
4306
4414
|
"""
|
4307
4415
|
fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
4308
4416
|
|
4309
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#24hr-ticker-price-change-statistics # spot
|
4417
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#24hr-ticker-price-change-statistics # spot
|
4310
4418
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/24hr-Ticker-Price-Change-Statistics # swap
|
4311
4419
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/24hr-Ticker-Price-Change-Statistics # future
|
4312
4420
|
https://developers.binance.com/docs/derivatives/option/market-data/24hr-Ticker-Price-Change-Statistics # option
|
@@ -4467,7 +4575,7 @@ class binance(Exchange, ImplicitAPI):
|
|
4467
4575
|
"""
|
4468
4576
|
fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
4469
4577
|
|
4470
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#klinecandlestick-data
|
4578
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#klinecandlestick-data
|
4471
4579
|
https://developers.binance.com/docs/derivatives/option/market-data/Kline-Candlestick-Data
|
4472
4580
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Kline-Candlestick-Data
|
4473
4581
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Index-Price-Kline-Candlestick-Data
|
@@ -4843,17 +4951,17 @@ class binance(Exchange, ImplicitAPI):
|
|
4843
4951
|
get the list of most recent trades for a particular symbol
|
4844
4952
|
Default fetchTradesMethod
|
4845
4953
|
|
4846
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#compressedaggregate-trades-list # publicGetAggTrades(spot)
|
4954
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#compressedaggregate-trades-list # publicGetAggTrades(spot)
|
4847
4955
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Compressed-Aggregate-Trades-List # fapiPublicGetAggTrades(swap)
|
4848
4956
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Compressed-Aggregate-Trades-List # dapiPublicGetAggTrades(future)
|
4849
4957
|
https://developers.binance.com/docs/derivatives/option/market-data/Recent-Trades-List # eapiPublicGetTrades(option)
|
4850
4958
|
|
4851
4959
|
Other fetchTradesMethod
|
4852
4960
|
|
4853
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#recent-trades-list # publicGetTrades(spot)
|
4961
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#recent-trades-list # publicGetTrades(spot)
|
4854
4962
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Recent-Trades-List # fapiPublicGetTrades(swap)
|
4855
4963
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Recent-Trades-List # dapiPublicGetTrades(future)
|
4856
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#old-trade-lookup # publicGetHistoricalTrades(spot)
|
4964
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#old-trade-lookup # publicGetHistoricalTrades(spot)
|
4857
4965
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Old-Trades-Lookup # fapiPublicGetHistoricalTrades(swap)
|
4858
4966
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Old-Trades-Lookup # dapiPublicGetHistoricalTrades(future)
|
4859
4967
|
https://developers.binance.com/docs/derivatives/option/market-data/Old-Trades-Lookup # eapiPublicGetHistoricalTrades(option)
|
@@ -4980,7 +5088,7 @@ class binance(Exchange, ImplicitAPI):
|
|
4980
5088
|
@ignore
|
4981
5089
|
edit a trade order
|
4982
5090
|
|
4983
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#cancel-an-existing-order-and-send-a-new-order-trade
|
5091
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#cancel-an-existing-order-and-send-a-new-order-trade
|
4984
5092
|
|
4985
5093
|
:param str id: cancel order id
|
4986
5094
|
:param str symbol: unified symbol of the market to create an order in
|
@@ -5152,10 +5260,10 @@ class binance(Exchange, ImplicitAPI):
|
|
5152
5260
|
request: dict = {
|
5153
5261
|
'symbol': market['id'],
|
5154
5262
|
'side': side.upper(),
|
5263
|
+
'orderId': id,
|
5264
|
+
'quantity': self.amount_to_precision(symbol, amount),
|
5155
5265
|
}
|
5156
5266
|
clientOrderId = self.safe_string_n(params, ['newClientOrderId', 'clientOrderId', 'origClientOrderId'])
|
5157
|
-
request['orderId'] = id
|
5158
|
-
request['quantity'] = self.amount_to_precision(symbol, amount)
|
5159
5267
|
if price is not None:
|
5160
5268
|
request['price'] = self.price_to_precision(symbol, price)
|
5161
5269
|
if clientOrderId is not None:
|
@@ -5169,6 +5277,8 @@ class binance(Exchange, ImplicitAPI):
|
|
5169
5277
|
|
5170
5278
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Order
|
5171
5279
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Modify-Order
|
5280
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Modify-UM-Order
|
5281
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Modify-CM-Order
|
5172
5282
|
|
5173
5283
|
:param str id: cancel order id
|
5174
5284
|
:param str symbol: unified symbol of the market to create an order in
|
@@ -5177,16 +5287,28 @@ class binance(Exchange, ImplicitAPI):
|
|
5177
5287
|
:param float amount: how much of currency you want to trade in units of base currency
|
5178
5288
|
:param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
5179
5289
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
5290
|
+
:param boolean [params.portfolioMargin]: set to True if you would like to edit an order in a portfolio margin account
|
5180
5291
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
5181
5292
|
"""
|
5182
5293
|
await self.load_markets()
|
5183
5294
|
market = self.market(symbol)
|
5295
|
+
isPortfolioMargin = None
|
5296
|
+
isPortfolioMargin, params = self.handle_option_and_params_2(params, 'editContractOrder', 'papi', 'portfolioMargin', False)
|
5297
|
+
if market['linear'] or isPortfolioMargin:
|
5298
|
+
if price is None:
|
5299
|
+
raise ArgumentsRequired(self.id + ' editOrder() requires a price argument for portfolio margin and linear orders')
|
5184
5300
|
request = self.edit_contract_order_request(id, symbol, type, side, amount, price, params)
|
5185
5301
|
response = None
|
5186
5302
|
if market['linear']:
|
5187
|
-
|
5303
|
+
if isPortfolioMargin:
|
5304
|
+
response = await self.papiPutUmOrder(self.extend(request, params))
|
5305
|
+
else:
|
5306
|
+
response = await self.fapiPrivatePutOrder(self.extend(request, params))
|
5188
5307
|
elif market['inverse']:
|
5189
|
-
|
5308
|
+
if isPortfolioMargin:
|
5309
|
+
response = await self.papiPutCmOrder(self.extend(request, params))
|
5310
|
+
else:
|
5311
|
+
response = await self.dapiPrivatePutOrder(self.extend(request, params))
|
5190
5312
|
#
|
5191
5313
|
# swap and future
|
5192
5314
|
#
|
@@ -5220,7 +5342,7 @@ class binance(Exchange, ImplicitAPI):
|
|
5220
5342
|
"""
|
5221
5343
|
edit a trade order
|
5222
5344
|
|
5223
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#cancel-an-existing-order-and-send-a-new-order-trade
|
5345
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#cancel-an-existing-order-and-send-a-new-order-trade
|
5224
5346
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Order
|
5225
5347
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Modify-Order
|
5226
5348
|
|
@@ -5231,6 +5353,7 @@ class binance(Exchange, ImplicitAPI):
|
|
5231
5353
|
:param float amount: how much of currency you want to trade in units of base currency
|
5232
5354
|
:param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
5233
5355
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
5356
|
+
:param boolean [params.portfolioMargin]: set to True if you would like to edit an order in a portfolio margin account
|
5234
5357
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
5235
5358
|
"""
|
5236
5359
|
await self.load_markets()
|
@@ -5895,13 +6018,13 @@ class binance(Exchange, ImplicitAPI):
|
|
5895
6018
|
"""
|
5896
6019
|
create a trade order
|
5897
6020
|
|
5898
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#new-order-trade
|
5899
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#test-new-order-trade
|
6021
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#new-order-trade
|
6022
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#test-new-order-trade
|
5900
6023
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/New-Order
|
5901
6024
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/New-Order
|
5902
6025
|
https://developers.binance.com/docs/derivatives/option/trade/New-Order
|
5903
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#sor
|
5904
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#test-new-order-using-sor-trade
|
6026
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#sor
|
6027
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#test-new-order-using-sor-trade
|
5905
6028
|
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-UM-Order
|
5906
6029
|
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-CM-Order
|
5907
6030
|
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-Margin-Order
|
@@ -5927,6 +6050,7 @@ class binance(Exchange, ImplicitAPI):
|
|
5927
6050
|
:param str [params.stopLossOrTakeProfit]: 'stopLoss' or 'takeProfit', required for spot trailing orders
|
5928
6051
|
: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
|
5929
6052
|
:param bool [params.hedged]: *swap and portfolio margin only* True for hedged mode, False for one way mode, default is False
|
6053
|
+
:param float [params.cost]: *spot market buy only* the quote quantity that can be used alternative for the amount
|
5930
6054
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
5931
6055
|
"""
|
5932
6056
|
await self.load_markets()
|
@@ -6235,7 +6359,7 @@ class binance(Exchange, ImplicitAPI):
|
|
6235
6359
|
"""
|
6236
6360
|
create a market order by providing the symbol, side and cost
|
6237
6361
|
|
6238
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#new-order-trade
|
6362
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#new-order-trade
|
6239
6363
|
|
6240
6364
|
:param str symbol: unified symbol of the market to create an order in
|
6241
6365
|
:param str side: 'buy' or 'sell'
|
@@ -6247,14 +6371,16 @@ class binance(Exchange, ImplicitAPI):
|
|
6247
6371
|
market = self.market(symbol)
|
6248
6372
|
if not market['spot']:
|
6249
6373
|
raise NotSupported(self.id + ' createMarketOrderWithCost() supports spot orders only')
|
6250
|
-
|
6251
|
-
|
6374
|
+
req = {
|
6375
|
+
'cost': cost,
|
6376
|
+
}
|
6377
|
+
return await self.create_order(symbol, 'market', side, 0, None, self.extend(req, params))
|
6252
6378
|
|
6253
6379
|
async def create_market_buy_order_with_cost(self, symbol: str, cost: float, params={}):
|
6254
6380
|
"""
|
6255
6381
|
create a market buy order by providing the symbol and cost
|
6256
6382
|
|
6257
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#new-order-trade
|
6383
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#new-order-trade
|
6258
6384
|
|
6259
6385
|
:param str symbol: unified symbol of the market to create an order in
|
6260
6386
|
:param float cost: how much you want to trade in units of the quote currency
|
@@ -6265,14 +6391,16 @@ class binance(Exchange, ImplicitAPI):
|
|
6265
6391
|
market = self.market(symbol)
|
6266
6392
|
if not market['spot']:
|
6267
6393
|
raise NotSupported(self.id + ' createMarketBuyOrderWithCost() supports spot orders only')
|
6268
|
-
|
6269
|
-
|
6394
|
+
req = {
|
6395
|
+
'cost': cost,
|
6396
|
+
}
|
6397
|
+
return await self.create_order(symbol, 'market', 'buy', 0, None, self.extend(req, params))
|
6270
6398
|
|
6271
6399
|
async def create_market_sell_order_with_cost(self, symbol: str, cost: float, params={}):
|
6272
6400
|
"""
|
6273
6401
|
create a market sell order by providing the symbol and cost
|
6274
6402
|
|
6275
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#new-order-trade
|
6403
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#new-order-trade
|
6276
6404
|
|
6277
6405
|
:param str symbol: unified symbol of the market to create an order in
|
6278
6406
|
:param float cost: how much you want to trade in units of the quote currency
|
@@ -6290,7 +6418,7 @@ class binance(Exchange, ImplicitAPI):
|
|
6290
6418
|
"""
|
6291
6419
|
fetches information on an order made by the user
|
6292
6420
|
|
6293
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#query-order-user_data
|
6421
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#query-order-user_data
|
6294
6422
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Query-Order
|
6295
6423
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Query-Order
|
6296
6424
|
https://developers.binance.com/docs/derivatives/option/trade/Query-Single-Order
|
@@ -6355,7 +6483,7 @@ class binance(Exchange, ImplicitAPI):
|
|
6355
6483
|
"""
|
6356
6484
|
fetches information on multiple orders made by the user
|
6357
6485
|
|
6358
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#all-orders-user_data
|
6486
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#all-orders-user_data
|
6359
6487
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/All-Orders
|
6360
6488
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/All-Orders
|
6361
6489
|
https://developers.binance.com/docs/derivatives/option/trade/Query-Option-Order-History
|
@@ -6614,7 +6742,7 @@ class binance(Exchange, ImplicitAPI):
|
|
6614
6742
|
"""
|
6615
6743
|
fetch all unfilled currently open orders
|
6616
6744
|
|
6617
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#current-open-orders-user_data
|
6745
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#current-open-orders-user_data
|
6618
6746
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Current-All-Open-Orders
|
6619
6747
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Current-All-Open-Orders
|
6620
6748
|
https://developers.binance.com/docs/derivatives/option/trade/Query-Current-Open-Option-Orders
|
@@ -6900,7 +7028,7 @@ class binance(Exchange, ImplicitAPI):
|
|
6900
7028
|
"""
|
6901
7029
|
fetches information on multiple closed orders made by the user
|
6902
7030
|
|
6903
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#all-orders-user_data
|
7031
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#all-orders-user_data
|
6904
7032
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/All-Orders
|
6905
7033
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/All-Orders
|
6906
7034
|
https://developers.binance.com/docs/derivatives/option/trade/Query-Option-Order-History
|
@@ -6929,7 +7057,7 @@ class binance(Exchange, ImplicitAPI):
|
|
6929
7057
|
"""
|
6930
7058
|
fetches information on multiple canceled orders made by the user
|
6931
7059
|
|
6932
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#all-orders-user_data
|
7060
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#all-orders-user_data
|
6933
7061
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/All-Orders
|
6934
7062
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/All-Orders
|
6935
7063
|
https://developers.binance.com/docs/derivatives/option/trade/Query-Option-Order-History
|
@@ -6958,7 +7086,7 @@ class binance(Exchange, ImplicitAPI):
|
|
6958
7086
|
"""
|
6959
7087
|
fetches information on multiple canceled orders made by the user
|
6960
7088
|
|
6961
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#all-orders-user_data
|
7089
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#all-orders-user_data
|
6962
7090
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/All-Orders
|
6963
7091
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/All-Orders
|
6964
7092
|
https://developers.binance.com/docs/derivatives/option/trade/Query-Option-Order-History
|
@@ -6990,7 +7118,7 @@ class binance(Exchange, ImplicitAPI):
|
|
6990
7118
|
"""
|
6991
7119
|
cancels an open order
|
6992
7120
|
|
6993
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#cancel-order-trade
|
7121
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#cancel-order-trade
|
6994
7122
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-Order
|
6995
7123
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Cancel-Order
|
6996
7124
|
https://developers.binance.com/docs/derivatives/option/trade/Cancel-Option-Order
|
@@ -7071,7 +7199,7 @@ class binance(Exchange, ImplicitAPI):
|
|
7071
7199
|
"""
|
7072
7200
|
cancel all open orders in a market
|
7073
7201
|
|
7074
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#cancel-all-open-orders-on-a-symbol-trade
|
7202
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#cancel-all-open-orders-on-a-symbol-trade
|
7075
7203
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-All-Open-Orders
|
7076
7204
|
https://developers.binance.com/docs/derivatives/option/trade/Cancel-all-Option-orders-on-specific-symbol
|
7077
7205
|
https://developers.binance.com/docs/margin_trading/trade/Margin-Account-Cancel-All-Open-Orders
|
@@ -7296,7 +7424,7 @@ class binance(Exchange, ImplicitAPI):
|
|
7296
7424
|
"""
|
7297
7425
|
fetch all the trades made from a single order
|
7298
7426
|
|
7299
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#account-trade-list-user_data
|
7427
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#account-trade-list-user_data
|
7300
7428
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Account-Trade-List
|
7301
7429
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Account-Trade-List
|
7302
7430
|
https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-Trade-List
|
@@ -7325,7 +7453,7 @@ class binance(Exchange, ImplicitAPI):
|
|
7325
7453
|
"""
|
7326
7454
|
fetch all trades made by the user
|
7327
7455
|
|
7328
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#account-trade-list-user_data
|
7456
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#account-trade-list-user_data
|
7329
7457
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Account-Trade-List
|
7330
7458
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Account-Trade-List
|
7331
7459
|
https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-Trade-List
|
@@ -11061,7 +11189,7 @@ class binance(Exchange, ImplicitAPI):
|
|
11061
11189
|
body = self.urlencode(params)
|
11062
11190
|
else:
|
11063
11191
|
raise AuthenticationError(self.id + ' userDataStream endpoint requires `apiKey` credential')
|
11064
|
-
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'):
|
11192
|
+
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') or (api == 'papiV2'):
|
11065
11193
|
self.check_required_credentials()
|
11066
11194
|
if method == 'POST' and ((path == 'order') or (path == 'sor/order')):
|
11067
11195
|
# inject in implicit API calls
|
@@ -11140,7 +11268,7 @@ class binance(Exchange, ImplicitAPI):
|
|
11140
11268
|
elif url.startswith('https://eapi.' + hostname + '/'):
|
11141
11269
|
marketType = 'option'
|
11142
11270
|
elif url.startswith('https://papi.' + hostname + '/'):
|
11143
|
-
marketType = '
|
11271
|
+
marketType = 'portfolioMargin'
|
11144
11272
|
if marketType is not None:
|
11145
11273
|
exceptionsForMarketType = self.safe_dict(self.exceptions, marketType, {})
|
11146
11274
|
return self.safe_dict(exceptionsForMarketType, exactOrBroad, {})
|