ccxt 4.4.44__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/blofin.py +22 -0
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/base/exchange.py +1 -1
- ccxt/async_support/binance.py +178 -62
- ccxt/async_support/bingx.py +15 -9
- ccxt/async_support/bitfinex.py +1 -1
- ccxt/async_support/bitget.py +3 -3
- ccxt/async_support/bitmart.py +3 -3
- ccxt/async_support/bitmex.py +1 -1
- ccxt/async_support/blofin.py +22 -0
- ccxt/async_support/bybit.py +4 -4
- ccxt/async_support/coinbase.py +1 -1
- ccxt/async_support/coinex.py +1 -1
- ccxt/async_support/cryptocom.py +1 -1
- ccxt/async_support/exmo.py +16 -8
- ccxt/async_support/gate.py +1 -1
- ccxt/async_support/hashkey.py +6 -1
- ccxt/async_support/htx.py +2 -2
- ccxt/async_support/hyperliquid.py +1 -1
- ccxt/async_support/kraken.py +1 -1
- ccxt/async_support/krakenfutures.py +1 -1
- ccxt/async_support/kucoin.py +1 -1
- ccxt/async_support/kucoinfutures.py +2 -3
- ccxt/async_support/lykke.py +1 -1
- ccxt/async_support/mexc.py +2 -2
- ccxt/async_support/myokx.py +8 -0
- ccxt/async_support/okx.py +4 -4
- ccxt/async_support/onetrading.py +2 -1
- ccxt/async_support/whitebit.py +31 -8
- ccxt/async_support/woo.py +1 -1
- ccxt/async_support/woofipro.py +2 -2
- ccxt/base/exchange.py +1 -1
- ccxt/binance.py +178 -62
- ccxt/bingx.py +15 -9
- ccxt/bitfinex.py +1 -1
- ccxt/bitget.py +3 -3
- ccxt/bitmart.py +3 -3
- ccxt/bitmex.py +1 -1
- ccxt/blofin.py +22 -0
- ccxt/bybit.py +4 -4
- ccxt/coinbase.py +1 -1
- ccxt/coinex.py +1 -1
- ccxt/cryptocom.py +1 -1
- ccxt/exmo.py +16 -8
- ccxt/gate.py +1 -1
- ccxt/hashkey.py +6 -1
- ccxt/htx.py +2 -2
- ccxt/hyperliquid.py +1 -1
- ccxt/kraken.py +1 -1
- ccxt/krakenfutures.py +1 -1
- ccxt/kucoin.py +1 -1
- ccxt/kucoinfutures.py +2 -3
- ccxt/lykke.py +1 -1
- ccxt/mexc.py +2 -2
- ccxt/myokx.py +8 -0
- ccxt/okx.py +4 -4
- ccxt/onetrading.py +2 -1
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/binance.py +2 -1
- ccxt/pro/myokx.py +5 -0
- ccxt/whitebit.py +31 -8
- ccxt/woo.py +1 -1
- ccxt/woofipro.py +2 -2
- {ccxt-4.4.44.dist-info → ccxt-4.4.45.dist-info}/METADATA +4 -4
- {ccxt-4.4.44.dist-info → ccxt-4.4.45.dist-info}/RECORD +69 -69
- {ccxt-4.4.44.dist-info → ccxt-4.4.45.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.4.44.dist-info → ccxt-4.4.45.dist-info}/WHEEL +0 -0
- {ccxt-4.4.44.dist-info → ccxt-4.4.45.dist-info}/top_level.txt +0 -0
ccxt/__init__.py
CHANGED
ccxt/abstract/blofin.py
CHANGED
@@ -26,6 +26,18 @@ class ImplicitAPI:
|
|
26
26
|
private_get_trade_orders_tpsl_history = privateGetTradeOrdersTpslHistory = Entry('trade/orders-tpsl-history', 'private', 'GET', {'cost': 1})
|
27
27
|
private_get_user_query_apikey = privateGetUserQueryApikey = Entry('user/query-apikey', 'private', 'GET', {'cost': 1})
|
28
28
|
private_get_affiliate_basic = privateGetAffiliateBasic = Entry('affiliate/basic', 'private', 'GET', {'cost': 1})
|
29
|
+
private_get_copytrading_instruments = privateGetCopytradingInstruments = Entry('copytrading/instruments', 'private', 'GET', {'cost': 1})
|
30
|
+
private_get_copytrading_account_balance = privateGetCopytradingAccountBalance = Entry('copytrading/account/balance', 'private', 'GET', {'cost': 1})
|
31
|
+
private_get_copytrading_account_positions_by_order = privateGetCopytradingAccountPositionsByOrder = Entry('copytrading/account/positions-by-order', 'private', 'GET', {'cost': 1})
|
32
|
+
private_get_copytrading_account_positions_details_by_order = privateGetCopytradingAccountPositionsDetailsByOrder = Entry('copytrading/account/positions-details-by-order', 'private', 'GET', {'cost': 1})
|
33
|
+
private_get_copytrading_account_positions_by_contract = privateGetCopytradingAccountPositionsByContract = Entry('copytrading/account/positions-by-contract', 'private', 'GET', {'cost': 1})
|
34
|
+
private_get_copytrading_account_position_mode = privateGetCopytradingAccountPositionMode = Entry('copytrading/account/position-mode', 'private', 'GET', {'cost': 1})
|
35
|
+
private_get_copytrading_account_leverage_info = privateGetCopytradingAccountLeverageInfo = Entry('copytrading/account/leverage-info', 'private', 'GET', {'cost': 1})
|
36
|
+
private_get_copytrading_trade_orders_pending = privateGetCopytradingTradeOrdersPending = Entry('copytrading/trade/orders-pending', 'private', 'GET', {'cost': 1})
|
37
|
+
private_get_copytrading_trade_pending_tpsl_by_contract = privateGetCopytradingTradePendingTpslByContract = Entry('copytrading/trade/pending-tpsl-by-contract', 'private', 'GET', {'cost': 1})
|
38
|
+
private_get_copytrading_trade_position_history_by_order = privateGetCopytradingTradePositionHistoryByOrder = Entry('copytrading/trade/position-history-by-order', 'private', 'GET', {'cost': 1})
|
39
|
+
private_get_copytrading_trade_orders_history = privateGetCopytradingTradeOrdersHistory = Entry('copytrading/trade/orders-history', 'private', 'GET', {'cost': 1})
|
40
|
+
private_get_copytrading_trade_pending_tpsl_by_order = privateGetCopytradingTradePendingTpslByOrder = Entry('copytrading/trade/pending-tpsl-by-order', 'private', 'GET', {'cost': 1})
|
29
41
|
private_post_trade_order = privatePostTradeOrder = Entry('trade/order', 'private', 'POST', {'cost': 1})
|
30
42
|
private_post_trade_cancel_order = privatePostTradeCancelOrder = Entry('trade/cancel-order', 'private', 'POST', {'cost': 1})
|
31
43
|
private_post_account_set_leverage = privatePostAccountSetLeverage = Entry('account/set-leverage', 'private', 'POST', {'cost': 1})
|
@@ -35,3 +47,13 @@ class ImplicitAPI:
|
|
35
47
|
private_post_trade_cancel_tpsl = privatePostTradeCancelTpsl = Entry('trade/cancel-tpsl', 'private', 'POST', {'cost': 1})
|
36
48
|
private_post_trade_close_position = privatePostTradeClosePosition = Entry('trade/close-position', 'private', 'POST', {'cost': 1})
|
37
49
|
private_post_asset_transfer = privatePostAssetTransfer = Entry('asset/transfer', 'private', 'POST', {'cost': 1})
|
50
|
+
private_post_copytrading_account_set_position_mode = privatePostCopytradingAccountSetPositionMode = Entry('copytrading/account/set-position-mode', 'private', 'POST', {'cost': 1})
|
51
|
+
private_post_copytrading_account_set_leverage = privatePostCopytradingAccountSetLeverage = Entry('copytrading/account/set-leverage', 'private', 'POST', {'cost': 1})
|
52
|
+
private_post_copytrading_trade_place_order = privatePostCopytradingTradePlaceOrder = Entry('copytrading/trade/place-order', 'private', 'POST', {'cost': 1})
|
53
|
+
private_post_copytrading_trade_cancel_order = privatePostCopytradingTradeCancelOrder = Entry('copytrading/trade/cancel-order', 'private', 'POST', {'cost': 1})
|
54
|
+
private_post_copytrading_trade_place_tpsl_by_contract = privatePostCopytradingTradePlaceTpslByContract = Entry('copytrading/trade/place-tpsl-by-contract', 'private', 'POST', {'cost': 1})
|
55
|
+
private_post_copytrading_trade_cancel_tpsl_by_contract = privatePostCopytradingTradeCancelTpslByContract = Entry('copytrading/trade/cancel-tpsl-by-contract', 'private', 'POST', {'cost': 1})
|
56
|
+
private_post_copytrading_trade_place_tpsl_by_order = privatePostCopytradingTradePlaceTpslByOrder = Entry('copytrading/trade/place-tpsl-by-order', 'private', 'POST', {'cost': 1})
|
57
|
+
private_post_copytrading_trade_cancel_tpsl_by_order = privatePostCopytradingTradeCancelTpslByOrder = Entry('copytrading/trade/cancel-tpsl-by-order', 'private', 'POST', {'cost': 1})
|
58
|
+
private_post_copytrading_trade_close_position_by_order = privatePostCopytradingTradeClosePositionByOrder = Entry('copytrading/trade/close-position-by-order', 'private', 'POST', {'cost': 1})
|
59
|
+
private_post_copytrading_trade_close_position_by_contract = privatePostCopytradingTradeClosePositionByContract = Entry('copytrading/trade/close-position-by-contract', 'private', 'POST', {'cost': 1})
|
ccxt/async_support/__init__.py
CHANGED
ccxt/async_support/binance.py
CHANGED
@@ -1643,7 +1643,7 @@ class binance(Exchange, ImplicitAPI):
|
|
1643
1643
|
'fetchClosedOrders': {
|
1644
1644
|
'marginMode': True,
|
1645
1645
|
'limit': 1000,
|
1646
|
-
'
|
1646
|
+
'daysBack': None,
|
1647
1647
|
'daysBackCanceled': None,
|
1648
1648
|
'untilDays': 10000,
|
1649
1649
|
'trigger': False,
|
@@ -1713,7 +1713,7 @@ class binance(Exchange, ImplicitAPI):
|
|
1713
1713
|
'fetchClosedOrders': {
|
1714
1714
|
'marginMode': True,
|
1715
1715
|
'limit': 1000,
|
1716
|
-
'
|
1716
|
+
'daysBack': 90,
|
1717
1717
|
'daysBackCanceled': 3,
|
1718
1718
|
'untilDays': 7,
|
1719
1719
|
'trigger': False,
|
@@ -2436,92 +2436,189 @@ class binance(Exchange, ImplicitAPI):
|
|
2436
2436
|
'portfolioMargin': {
|
2437
2437
|
'exact': {
|
2438
2438
|
#
|
2439
|
-
#
|
2439
|
+
# 10xx General Server or Network Issues
|
2440
2440
|
#
|
2441
|
-
'-
|
2442
|
-
'-
|
2443
|
-
'-
|
2444
|
-
'-
|
2445
|
-
'-
|
2446
|
-
'-
|
2447
|
-
'-
|
2448
|
-
'-
|
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
|
2449
2461
|
#
|
2450
|
-
#
|
2462
|
+
# 11xx Request Issues
|
2451
2463
|
#
|
2452
|
-
'-
|
2453
|
-
'-
|
2454
|
-
'-
|
2455
|
-
'-
|
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.
|
2456
2506
|
'-2021': OrderImmediatelyFillable, # Order would immediately trigger.
|
2457
|
-
'-2022': InvalidOrder, # ReduceOnly Order is rejected
|
2458
|
-
'-2023': OperationFailed, # User in liquidation mode now
|
2459
|
-
'-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.
|
2460
2510
|
'-2025': OperationRejected, # Reach max open order limit.
|
2461
2511
|
'-2026': InvalidOrder, # This OrderType is not supported when reduceOnly.
|
2462
2512
|
'-2027': OperationRejected, # Exceeded the maximum allowable position at current leverage.
|
2463
2513
|
'-2028': OperationRejected, # Leverage is smaller than permitted: insufficient margin balance.
|
2464
2514
|
#
|
2465
|
-
# 4xxx
|
2515
|
+
# 4xxx Filters and other issues
|
2466
2516
|
#
|
2467
|
-
'-
|
2468
|
-
'-
|
2469
|
-
'-
|
2470
|
-
'-
|
2471
|
-
'-
|
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
|
2472
2577
|
'-4070': BadRequest, # Client options id is not valid.
|
2473
2578
|
'-4071': BadRequest, # Invalid options direction
|
2474
2579
|
'-4072': OperationRejected, # premium fee is not updated, reject order
|
2475
|
-
'-4073': BadRequest, #
|
2580
|
+
'-4073': BadRequest, # input premium fee is less than 0, reject order
|
2476
2581
|
'-4074': BadRequest, # Order amount is bigger than upper boundary or less than 0, reject order
|
2477
2582
|
'-4075': BadRequest, # output premium fee is less than 0, reject order
|
2478
2583
|
'-4076': OperationRejected, # original fee is too much higher than last fee
|
2479
2584
|
'-4077': OperationRejected, # place order amount has reached to limit, reject order
|
2480
2585
|
'-4078': OperationFailed, # options internal error
|
2481
2586
|
'-4079': BadRequest, # invalid options id
|
2482
|
-
'-4080': PermissionDenied, # user not found
|
2483
|
-
'-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.
|
2484
2592
|
'-4085': BadRequest, # Invalid notional limit coefficient
|
2485
2593
|
'-4086': BadRequest, # Invalid price spread threshold
|
2486
2594
|
'-4087': PermissionDenied, # User can only place reduce only order
|
2487
2595
|
'-4088': PermissionDenied, # User can not place order currently
|
2488
|
-
'-
|
2489
|
-
'-
|
2490
|
-
'-
|
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
|
2491
2600
|
'-4131': OperationRejected, # The counterparty's best price does not meet the PERCENT_PRICE filter limit
|
2492
|
-
'-
|
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
|
2493
2606
|
'-4141': BadRequest, # Symbol is closed
|
2607
|
+
'-4142': OrderImmediatelyFillable, # REJECT: take profit or stop order will be triggered immediately
|
2494
2608
|
'-4144': BadSymbol, # Invalid pair
|
2495
2609
|
'-4161': OperationRejected, # Leverage reduction is not supported in Isolated Margin Mode with open positions
|
2496
|
-
'-4164':
|
2610
|
+
'-4164': InvalidOrder, # Order's notional must be no smaller than 5.0(unless you choose reduce only)
|
2497
2611
|
'-4165': BadRequest, # Invalid time interval
|
2498
|
-
'-4183':
|
2499
|
-
'-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.
|
2500
2615
|
#
|
2501
|
-
# 5xxx
|
2616
|
+
# 5xxx Order Execution Issues
|
2502
2617
|
#
|
2503
2618
|
'-5021': OrderNotFillable, # Due to the order could not be filled immediately, the FOK order has been rejected.
|
2504
2619
|
'-5022': OrderNotFillable, # Due to the order could not be executed, the Post Only order will be rejected.
|
2505
|
-
#
|
2506
|
-
#
|
2507
|
-
#
|
2508
|
-
'-20121': ExchangeError, # override commons
|
2509
|
-
'-20124': ExchangeError, # override commons
|
2510
|
-
'-20130': ExchangeError, # override commons
|
2511
|
-
'-20132': ExchangeError, # override commons
|
2512
|
-
'-20194': ExchangeError, # override commons
|
2513
|
-
'-20195': ExchangeError, # override commons
|
2514
|
-
'-20196': ExchangeError, # override commons
|
2515
|
-
'-20198': ExchangeError, # override commons
|
2516
|
-
'-20204': ExchangeError, # override commons
|
2517
|
-
# 21xxx - PORTFOLIO MARGIN(documented in spot docs)
|
2518
|
-
'-21001': BadRequest, # Request ID is not a Portfolio Margin Account.
|
2519
|
-
'-21002': BadRequest, # Portfolio Margin Account doesn't support transfer from margin to futures.
|
2520
|
-
'-21003': BadResponse, # Fail to retrieve margin assets.
|
2521
|
-
'-21004': OperationRejected, # User doesn’t have portfolio margin bankruptcy loan
|
2522
|
-
'-21005': InsufficientFunds, # User’s spot wallet doesn’t have enough BUSD to repay portfolio margin bankruptcy loan
|
2523
|
-
'-21006': OperationFailed, # User had portfolio margin bankruptcy loan repayment in process
|
2524
|
-
'-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.
|
2525
2622
|
},
|
2526
2623
|
},
|
2527
2624
|
'exact': {
|
@@ -3549,7 +3646,11 @@ class binance(Exchange, ImplicitAPI):
|
|
3549
3646
|
account['used'] = self.safe_string(entry, 'crossMarginLocked')
|
3550
3647
|
account['total'] = self.safe_string(entry, 'crossMarginAsset')
|
3551
3648
|
else:
|
3552
|
-
|
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)
|
3553
3654
|
result[code] = account
|
3554
3655
|
elif not isolated and ((type == 'spot') or cross):
|
3555
3656
|
timestamp = self.safe_integer(response, 'updateTime')
|
@@ -5159,10 +5260,10 @@ class binance(Exchange, ImplicitAPI):
|
|
5159
5260
|
request: dict = {
|
5160
5261
|
'symbol': market['id'],
|
5161
5262
|
'side': side.upper(),
|
5263
|
+
'orderId': id,
|
5264
|
+
'quantity': self.amount_to_precision(symbol, amount),
|
5162
5265
|
}
|
5163
5266
|
clientOrderId = self.safe_string_n(params, ['newClientOrderId', 'clientOrderId', 'origClientOrderId'])
|
5164
|
-
request['orderId'] = id
|
5165
|
-
request['quantity'] = self.amount_to_precision(symbol, amount)
|
5166
5267
|
if price is not None:
|
5167
5268
|
request['price'] = self.price_to_precision(symbol, price)
|
5168
5269
|
if clientOrderId is not None:
|
@@ -5176,6 +5277,8 @@ class binance(Exchange, ImplicitAPI):
|
|
5176
5277
|
|
5177
5278
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Order
|
5178
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
|
5179
5282
|
|
5180
5283
|
:param str id: cancel order id
|
5181
5284
|
:param str symbol: unified symbol of the market to create an order in
|
@@ -5184,16 +5287,28 @@ class binance(Exchange, ImplicitAPI):
|
|
5184
5287
|
:param float amount: how much of currency you want to trade in units of base currency
|
5185
5288
|
:param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
5186
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
|
5187
5291
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
5188
5292
|
"""
|
5189
5293
|
await self.load_markets()
|
5190
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')
|
5191
5300
|
request = self.edit_contract_order_request(id, symbol, type, side, amount, price, params)
|
5192
5301
|
response = None
|
5193
5302
|
if market['linear']:
|
5194
|
-
|
5303
|
+
if isPortfolioMargin:
|
5304
|
+
response = await self.papiPutUmOrder(self.extend(request, params))
|
5305
|
+
else:
|
5306
|
+
response = await self.fapiPrivatePutOrder(self.extend(request, params))
|
5195
5307
|
elif market['inverse']:
|
5196
|
-
|
5308
|
+
if isPortfolioMargin:
|
5309
|
+
response = await self.papiPutCmOrder(self.extend(request, params))
|
5310
|
+
else:
|
5311
|
+
response = await self.dapiPrivatePutOrder(self.extend(request, params))
|
5197
5312
|
#
|
5198
5313
|
# swap and future
|
5199
5314
|
#
|
@@ -5238,6 +5353,7 @@ class binance(Exchange, ImplicitAPI):
|
|
5238
5353
|
:param float amount: how much of currency you want to trade in units of base currency
|
5239
5354
|
:param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
5240
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
|
5241
5357
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
5242
5358
|
"""
|
5243
5359
|
await self.load_markets()
|
@@ -11152,7 +11268,7 @@ class binance(Exchange, ImplicitAPI):
|
|
11152
11268
|
elif url.startswith('https://eapi.' + hostname + '/'):
|
11153
11269
|
marketType = 'option'
|
11154
11270
|
elif url.startswith('https://papi.' + hostname + '/'):
|
11155
|
-
marketType = '
|
11271
|
+
marketType = 'portfolioMargin'
|
11156
11272
|
if marketType is not None:
|
11157
11273
|
exceptionsForMarketType = self.safe_dict(self.exceptions, marketType, {})
|
11158
11274
|
return self.safe_dict(exceptionsForMarketType, exactOrBroad, {})
|
ccxt/async_support/bingx.py
CHANGED
@@ -566,7 +566,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
566
566
|
'mark': True,
|
567
567
|
'index': True,
|
568
568
|
},
|
569
|
-
'
|
569
|
+
'price': True,
|
570
570
|
},
|
571
571
|
'timeInForce': {
|
572
572
|
'IOC': True,
|
@@ -613,7 +613,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
613
613
|
'fetchClosedOrders': {
|
614
614
|
'marginMode': False,
|
615
615
|
'limit': 1000,
|
616
|
-
'
|
616
|
+
'daysBack': None,
|
617
617
|
'daysBackCanceled': None,
|
618
618
|
'untilDays': 7,
|
619
619
|
'trigger': False,
|
@@ -637,7 +637,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
637
637
|
'fetchClosedOrders': {
|
638
638
|
'marginMode': False,
|
639
639
|
'limit': 1000,
|
640
|
-
'
|
640
|
+
'daysBack': None,
|
641
641
|
'daysBackCanceled': None,
|
642
642
|
'untilDays': 7,
|
643
643
|
'trigger': False,
|
@@ -2652,8 +2652,10 @@ class bingx(Exchange, ImplicitAPI):
|
|
2652
2652
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2653
2653
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
2654
2654
|
"""
|
2655
|
-
|
2656
|
-
|
2655
|
+
req = {
|
2656
|
+
'quoteOrderQty': cost,
|
2657
|
+
}
|
2658
|
+
return await self.create_order(symbol, 'market', side, cost, None, self.extend(req, params))
|
2657
2659
|
|
2658
2660
|
async def create_market_buy_order_with_cost(self, symbol: str, cost: float, params={}):
|
2659
2661
|
"""
|
@@ -2663,8 +2665,10 @@ class bingx(Exchange, ImplicitAPI):
|
|
2663
2665
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2664
2666
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
2665
2667
|
"""
|
2666
|
-
|
2667
|
-
|
2668
|
+
req = {
|
2669
|
+
'quoteOrderQty': cost,
|
2670
|
+
}
|
2671
|
+
return await self.create_order(symbol, 'market', 'buy', cost, None, self.extend(req, params))
|
2668
2672
|
|
2669
2673
|
async def create_market_sell_order_with_cost(self, symbol: str, cost: float, params={}):
|
2670
2674
|
"""
|
@@ -2674,8 +2678,10 @@ class bingx(Exchange, ImplicitAPI):
|
|
2674
2678
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2675
2679
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
2676
2680
|
"""
|
2677
|
-
|
2678
|
-
|
2681
|
+
req = {
|
2682
|
+
'quoteOrderQty': cost,
|
2683
|
+
}
|
2684
|
+
return await self.create_order(symbol, 'market', 'sell', cost, None, self.extend(req, params))
|
2679
2685
|
|
2680
2686
|
def create_order_request(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
|
2681
2687
|
"""
|
ccxt/async_support/bitfinex.py
CHANGED
ccxt/async_support/bitget.py
CHANGED
@@ -1483,7 +1483,7 @@ class bitget(Exchange, ImplicitAPI):
|
|
1483
1483
|
'mark': False,
|
1484
1484
|
'index': False,
|
1485
1485
|
},
|
1486
|
-
'
|
1486
|
+
'price': True,
|
1487
1487
|
},
|
1488
1488
|
'timeInForce': {
|
1489
1489
|
'IOC': True,
|
@@ -1525,7 +1525,7 @@ class bitget(Exchange, ImplicitAPI):
|
|
1525
1525
|
'fetchClosedOrders': {
|
1526
1526
|
'marginMode': True,
|
1527
1527
|
'limit': 100,
|
1528
|
-
'
|
1528
|
+
'daysBack': None,
|
1529
1529
|
'daysBackCanceled': None,
|
1530
1530
|
'untilDays': 90,
|
1531
1531
|
'trigger': True,
|
@@ -1553,7 +1553,7 @@ class bitget(Exchange, ImplicitAPI):
|
|
1553
1553
|
'mark': True,
|
1554
1554
|
'index': True,
|
1555
1555
|
},
|
1556
|
-
'
|
1556
|
+
'price': False,
|
1557
1557
|
},
|
1558
1558
|
'timeInForce': {
|
1559
1559
|
'IOC': True,
|
ccxt/async_support/bitmart.py
CHANGED
@@ -756,7 +756,7 @@ class bitmart(Exchange, ImplicitAPI):
|
|
756
756
|
'fetchClosedOrders': {
|
757
757
|
'marginMode': True,
|
758
758
|
'limit': 200,
|
759
|
-
'
|
759
|
+
'daysBack': None,
|
760
760
|
'daysBackCanceled': None,
|
761
761
|
'untilDays': None,
|
762
762
|
'trigger': False,
|
@@ -785,7 +785,7 @@ class bitmart(Exchange, ImplicitAPI):
|
|
785
785
|
'mark': True,
|
786
786
|
'index': False,
|
787
787
|
},
|
788
|
-
'
|
788
|
+
'price': False,
|
789
789
|
},
|
790
790
|
'timeInForce': {
|
791
791
|
'IOC': True,
|
@@ -823,7 +823,7 @@ class bitmart(Exchange, ImplicitAPI):
|
|
823
823
|
'fetchClosedOrders': {
|
824
824
|
'marginMode': True,
|
825
825
|
'limit': 200,
|
826
|
-
'
|
826
|
+
'daysBack': None,
|
827
827
|
'daysBackCanceled': None,
|
828
828
|
'untilDays': None,
|
829
829
|
'trigger': False,
|
ccxt/async_support/bitmex.py
CHANGED
ccxt/async_support/blofin.py
CHANGED
@@ -204,6 +204,18 @@ class blofin(Exchange, ImplicitAPI):
|
|
204
204
|
'trade/orders-tpsl-history': 1,
|
205
205
|
'user/query-apikey': 1,
|
206
206
|
'affiliate/basic': 1,
|
207
|
+
'copytrading/instruments': 1,
|
208
|
+
'copytrading/account/balance': 1,
|
209
|
+
'copytrading/account/positions-by-order': 1,
|
210
|
+
'copytrading/account/positions-details-by-order': 1,
|
211
|
+
'copytrading/account/positions-by-contract': 1,
|
212
|
+
'copytrading/account/position-mode': 1,
|
213
|
+
'copytrading/account/leverage-info': 1,
|
214
|
+
'copytrading/trade/orders-pending': 1,
|
215
|
+
'copytrading/trade/pending-tpsl-by-contract': 1,
|
216
|
+
'copytrading/trade/position-history-by-order': 1,
|
217
|
+
'copytrading/trade/orders-history': 1,
|
218
|
+
'copytrading/trade/pending-tpsl-by-order': 1,
|
207
219
|
},
|
208
220
|
'post': {
|
209
221
|
'trade/order': 1,
|
@@ -215,6 +227,16 @@ class blofin(Exchange, ImplicitAPI):
|
|
215
227
|
'trade/cancel-tpsl': 1,
|
216
228
|
'trade/close-position': 1,
|
217
229
|
'asset/transfer': 1,
|
230
|
+
'copytrading/account/set-position-mode': 1,
|
231
|
+
'copytrading/account/set-leverage': 1,
|
232
|
+
'copytrading/trade/place-order': 1,
|
233
|
+
'copytrading/trade/cancel-order': 1,
|
234
|
+
'copytrading/trade/place-tpsl-by-contract': 1,
|
235
|
+
'copytrading/trade/cancel-tpsl-by-contract': 1,
|
236
|
+
'copytrading/trade/place-tpsl-by-order': 1,
|
237
|
+
'copytrading/trade/cancel-tpsl-by-order': 1,
|
238
|
+
'copytrading/trade/close-position-by-order': 1,
|
239
|
+
'copytrading/trade/close-position-by-contract': 1,
|
218
240
|
},
|
219
241
|
},
|
220
242
|
},
|