binance-sdk-derivatives-trading-portfolio-margin 1.0.0__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.
Potentially problematic release.
This version of binance-sdk-derivatives-trading-portfolio-margin might be problematic. Click here for more details.
- CHANGELOG.md +5 -0
- README.md +293 -0
- binance_sdk_derivatives_trading_portfolio_margin/__init__.py +39 -0
- binance_sdk_derivatives_trading_portfolio_margin/derivatives_trading_portfolio_margin.py +68 -0
- binance_sdk_derivatives_trading_portfolio_margin/metadata.py +1 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/__init__.py +13 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/api/__init__.py +14 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/api/account_api.py +2096 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/api/market_data_api.py +62 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/api/trade_api.py +3557 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/api/user_data_streams_api.py +132 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/__init__.py +550 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/account_balance_response.py +145 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/account_balance_response1.py +81 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/account_balance_response1_inner.py +164 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/account_balance_response2.py +159 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/account_information_response.py +145 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/bnb_transfer_response.py +102 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/cancel_all_cm_open_conditional_orders_response.py +103 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/cancel_all_cm_open_orders_response.py +103 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/cancel_all_um_open_conditional_orders_response.py +103 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/cancel_all_um_open_orders_response.py +103 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/cancel_cm_conditional_order_response.py +161 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/cancel_cm_order_response.py +156 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/cancel_margin_account_all_open_orders_on_a_symbol_response.py +83 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/cancel_margin_account_all_open_orders_on_a_symbol_response_inner.py +215 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/cancel_margin_account_all_open_orders_on_a_symbol_response_inner_order_reports_inner.py +156 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/cancel_margin_account_all_open_orders_on_a_symbol_response_inner_orders_inner.py +110 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/cancel_margin_account_oco_orders_response.py +174 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/cancel_margin_account_oco_orders_response_order_reports_inner.py +151 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/cancel_margin_account_oco_orders_response_orders_inner.py +110 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/cancel_margin_account_order_response.py +145 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/cancel_um_conditional_order_response.py +172 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/cancel_um_order_response.py +164 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/change_auto_repay_futures_status_response.py +102 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/change_cm_initial_leverage_response.py +110 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/change_cm_position_mode_response.py +103 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/change_um_initial_leverage_response.py +112 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/change_um_position_mode_response.py +103 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/cm_account_trade_list_response.py +81 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/cm_account_trade_list_response_inner.py +153 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/cm_notional_and_leverage_brackets_response.py +81 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/cm_notional_and_leverage_brackets_response_inner.py +129 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/cm_notional_and_leverage_brackets_response_inner_brackets_inner.py +125 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/cm_position_adl_quantile_estimation_response.py +83 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/cm_position_adl_quantile_estimation_response_inner.py +122 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/cm_position_adl_quantile_estimation_response_inner_adl_quantile.py +112 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/enums.py +278 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/fund_auto_collection_response.py +102 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/fund_collection_by_asset_response.py +102 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/get_auto_repay_futures_status_response.py +102 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/get_cm_account_detail_response.py +142 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/get_cm_account_detail_response_assets_inner.py +135 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/get_cm_account_detail_response_positions_inner.py +147 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/get_cm_current_position_mode_response.py +104 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/get_cm_income_history_response.py +81 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/get_cm_income_history_response_inner.py +129 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/get_download_id_for_um_futures_order_history_response.py +110 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/get_download_id_for_um_futures_trade_history_response.py +110 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/get_download_id_for_um_futures_transaction_history_response.py +110 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/get_margin_borrow_loan_interest_history_response.py +127 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/get_margin_borrow_loan_interest_history_response_rows_inner.py +131 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/get_um_account_detail_response.py +142 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/get_um_account_detail_response_positions_inner.py +153 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/get_um_account_detail_v2_response.py +142 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/get_um_account_detail_v2_response_assets_inner.py +135 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/get_um_account_detail_v2_response_positions_inner.py +131 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/get_um_current_position_mode_response.py +104 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/get_um_futures_bnb_burn_status_response.py +102 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/get_um_futures_order_download_link_by_id_response.py +128 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/get_um_futures_trade_download_link_by_id_response.py +128 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/get_um_futures_transaction_download_link_by_id_response.py +128 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/get_um_income_history_response.py +81 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/get_um_income_history_response_inner.py +129 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/get_user_commission_rate_for_cm_response.py +118 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/get_user_commission_rate_for_um_response.py +118 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/margin_account_borrow_response.py +102 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/margin_account_new_oco_response.py +182 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/margin_account_new_oco_response_order_reports_inner.py +149 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/margin_account_new_oco_response_orders_inner.py +110 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/margin_account_repay_debt_response.py +122 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/margin_account_repay_response.py +102 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/margin_account_trade_list_response.py +81 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/margin_account_trade_list_response_inner.py +138 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/margin_max_borrow_response.py +105 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/modify_cm_order_response.py +159 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/modify_um_order_response.py +167 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/new_cm_conditional_order_response.py +164 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/new_cm_order_response.py +156 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/new_margin_order_response.py +173 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/new_margin_order_response_fills_inner.py +117 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/new_um_conditional_order_response.py +172 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/new_um_order_response.py +164 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/portfolio_margin_um_trading_quantitative_rules_indicators_response.py +122 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/portfolio_margin_um_trading_quantitative_rules_indicators_response_indicators.py +154 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/portfolio_margin_um_trading_quantitative_rules_indicators_response_indicators_account_inner.py +124 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/portfolio_margin_um_trading_quantitative_rules_indicators_response_indicators_btcusdt_inner.py +134 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_all_cm_conditional_orders_response.py +81 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_all_cm_conditional_orders_response_inner.py +167 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_all_cm_orders_response.py +81 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_all_cm_orders_response_inner.py +159 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_all_current_cm_open_conditional_orders_response.py +83 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_all_current_cm_open_conditional_orders_response_inner.py +155 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_all_current_cm_open_orders_response.py +81 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_all_current_um_open_conditional_orders_response.py +83 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_all_current_um_open_conditional_orders_response_inner.py +166 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_all_current_um_open_orders_response.py +81 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_all_current_um_open_orders_response_inner.py +167 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_all_margin_account_orders_response.py +81 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_all_margin_account_orders_response_inner.py +173 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_all_um_conditional_orders_response.py +81 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_all_um_conditional_orders_response_inner.py +178 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_all_um_orders_response.py +81 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_cm_conditional_order_history_response.py +176 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_cm_modify_order_history_response.py +81 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_cm_modify_order_history_response_inner.py +138 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_cm_modify_order_history_response_inner_amendment.py +136 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_cm_modify_order_history_response_inner_amendment_orig_qty.py +105 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_cm_modify_order_history_response_inner_amendment_price.py +105 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_cm_order_response.py +159 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_cm_position_information_response.py +81 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_cm_position_information_response_inner.py +142 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_current_cm_open_conditional_order_response.py +155 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_current_cm_open_order_response.py +159 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_current_margin_open_order_response.py +81 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_current_margin_open_order_response_inner.py +173 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_current_um_open_conditional_order_response.py +166 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_current_um_open_order_response.py +167 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_margin_account_order_response.py +173 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_margin_accounts_all_oco_response.py +81 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_margin_accounts_all_oco_response_inner.py +152 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_margin_accounts_all_oco_response_inner_orders_inner.py +110 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_margin_accounts_oco_response.py +150 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_margin_accounts_oco_response_orders_inner.py +110 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_margin_accounts_open_oco_response.py +81 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_margin_accounts_open_oco_response_inner.py +152 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_margin_accounts_open_oco_response_inner_orders_inner.py +110 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_margin_loan_record_response.py +125 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_margin_loan_record_response_rows_inner.py +120 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_margin_max_withdraw_response.py +102 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_margin_repay_record_response.py +125 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_margin_repay_record_response_rows_inner.py +126 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_portfolio_margin_negative_balance_interest_history_response.py +83 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_portfolio_margin_negative_balance_interest_history_response_inner.py +122 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_um_conditional_order_history_response.py +181 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_um_modify_order_history_response.py +81 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_um_modify_order_history_response_inner.py +141 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_um_order_response.py +167 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_um_position_information_response.py +81 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_um_position_information_response_inner.py +144 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_user_negative_balance_auto_exchange_record_response.py +129 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_user_negative_balance_auto_exchange_record_response_rows_inner.py +131 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_user_negative_balance_auto_exchange_record_response_rows_inner_details_inner.py +120 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_user_rate_limit_response.py +81 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_user_rate_limit_response_inner.py +117 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_users_cm_force_orders_response.py +81 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_users_cm_force_orders_response_inner.py +159 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_users_margin_force_orders_response.py +125 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_users_margin_force_orders_response_rows_inner.py +132 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_users_um_force_orders_response.py +81 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_users_um_force_orders_response_inner.py +156 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/repay_futures_negative_balance_response.py +102 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/start_user_data_stream_response.py +102 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/toggle_bnb_burn_on_um_futures_trade_response.py +103 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/um_account_trade_list_response.py +81 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/um_account_trade_list_response_inner.py +147 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/um_futures_account_configuration_response.py +133 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/um_futures_symbol_configuration_response.py +81 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/um_futures_symbol_configuration_response_inner.py +124 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/um_notional_and_leverage_brackets_response.py +81 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/um_notional_and_leverage_brackets_response_inner.py +131 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/um_notional_and_leverage_brackets_response_inner_brackets_inner.py +125 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/um_position_adl_quantile_estimation_response.py +83 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/um_position_adl_quantile_estimation_response_inner.py +122 -0
- binance_sdk_derivatives_trading_portfolio_margin/rest_api/rest_api.py +3837 -0
- binance_sdk_derivatives_trading_portfolio_margin/websocket_streams/__init__.py +13 -0
- binance_sdk_derivatives_trading_portfolio_margin/websocket_streams/models/__init__.py +38 -0
- binance_sdk_derivatives_trading_portfolio_margin/websocket_streams/models/account_config_update.py +118 -0
- binance_sdk_derivatives_trading_portfolio_margin/websocket_streams/models/account_config_update_ac.py +99 -0
- binance_sdk_derivatives_trading_portfolio_margin/websocket_streams/models/account_update.py +120 -0
- binance_sdk_derivatives_trading_portfolio_margin/websocket_streams/models/account_update_a.py +134 -0
- binance_sdk_derivatives_trading_portfolio_margin/websocket_streams/models/account_update_ab_inner.py +108 -0
- binance_sdk_derivatives_trading_portfolio_margin/websocket_streams/models/account_update_ap_inner.py +114 -0
- binance_sdk_derivatives_trading_portfolio_margin/websocket_streams/models/balanceupdate.py +110 -0
- binance_sdk_derivatives_trading_portfolio_margin/websocket_streams/models/conditional_order_trade_update.py +118 -0
- binance_sdk_derivatives_trading_portfolio_margin/websocket_streams/models/conditional_order_trade_update_so.py +164 -0
- binance_sdk_derivatives_trading_portfolio_margin/websocket_streams/models/enums.py +9 -0
- binance_sdk_derivatives_trading_portfolio_margin/websocket_streams/models/executionreport.py +227 -0
- binance_sdk_derivatives_trading_portfolio_margin/websocket_streams/models/liabilitychange.py +114 -0
- binance_sdk_derivatives_trading_portfolio_margin/websocket_streams/models/listenkeyexpired.py +98 -0
- binance_sdk_derivatives_trading_portfolio_margin/websocket_streams/models/openorderloss.py +118 -0
- binance_sdk_derivatives_trading_portfolio_margin/websocket_streams/models/openorderloss_o_inner.py +99 -0
- binance_sdk_derivatives_trading_portfolio_margin/websocket_streams/models/order_trade_update.py +120 -0
- binance_sdk_derivatives_trading_portfolio_margin/websocket_streams/models/order_trade_update_o.py +188 -0
- binance_sdk_derivatives_trading_portfolio_margin/websocket_streams/models/outboundaccountposition.py +125 -0
- binance_sdk_derivatives_trading_portfolio_margin/websocket_streams/models/outboundaccountposition_b_inner.py +102 -0
- binance_sdk_derivatives_trading_portfolio_margin/websocket_streams/models/risklevelchange.py +112 -0
- binance_sdk_derivatives_trading_portfolio_margin/websocket_streams/models/user_data_stream_events_response.py +386 -0
- binance_sdk_derivatives_trading_portfolio_margin/websocket_streams/streams/__init__.py +9 -0
- binance_sdk_derivatives_trading_portfolio_margin/websocket_streams/websocket_streams.py +105 -0
- binance_sdk_derivatives_trading_portfolio_margin-1.0.0.dist-info/LICENCE +21 -0
- binance_sdk_derivatives_trading_portfolio_margin-1.0.0.dist-info/METADATA +321 -0
- binance_sdk_derivatives_trading_portfolio_margin-1.0.0.dist-info/RECORD +204 -0
- binance_sdk_derivatives_trading_portfolio_margin-1.0.0.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,2096 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Binance Derivatives Trading Portfolio Margin REST API
|
|
3
|
+
|
|
4
|
+
OpenAPI Specification for the Binance Derivatives Trading Portfolio Margin REST API
|
|
5
|
+
The version of the OpenAPI document: 1.0.0
|
|
6
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
7
|
+
|
|
8
|
+
Do not edit the class manually.
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
from typing import Optional
|
|
12
|
+
from requests import Session
|
|
13
|
+
from binance_common.configuration import ConfigurationRestAPI
|
|
14
|
+
from binance_common.errors import RequiredError
|
|
15
|
+
from binance_common.models import ApiResponse
|
|
16
|
+
from binance_common.signature import Signers
|
|
17
|
+
from binance_common.utils import send_request
|
|
18
|
+
|
|
19
|
+
from ..models import AccountBalanceResponse
|
|
20
|
+
from ..models import AccountInformationResponse
|
|
21
|
+
from ..models import BnbTransferResponse
|
|
22
|
+
from ..models import ChangeAutoRepayFuturesStatusResponse
|
|
23
|
+
from ..models import ChangeCmInitialLeverageResponse
|
|
24
|
+
from ..models import ChangeCmPositionModeResponse
|
|
25
|
+
from ..models import ChangeUmInitialLeverageResponse
|
|
26
|
+
from ..models import ChangeUmPositionModeResponse
|
|
27
|
+
from ..models import CmNotionalAndLeverageBracketsResponse
|
|
28
|
+
from ..models import FundAutoCollectionResponse
|
|
29
|
+
from ..models import FundCollectionByAssetResponse
|
|
30
|
+
from ..models import GetAutoRepayFuturesStatusResponse
|
|
31
|
+
from ..models import GetCmAccountDetailResponse
|
|
32
|
+
from ..models import GetCmCurrentPositionModeResponse
|
|
33
|
+
from ..models import GetCmIncomeHistoryResponse
|
|
34
|
+
from ..models import GetDownloadIdForUmFuturesOrderHistoryResponse
|
|
35
|
+
from ..models import GetDownloadIdForUmFuturesTradeHistoryResponse
|
|
36
|
+
from ..models import GetDownloadIdForUmFuturesTransactionHistoryResponse
|
|
37
|
+
from ..models import GetMarginBorrowLoanInterestHistoryResponse
|
|
38
|
+
from ..models import GetUmAccountDetailResponse
|
|
39
|
+
from ..models import GetUmAccountDetailV2Response
|
|
40
|
+
from ..models import GetUmCurrentPositionModeResponse
|
|
41
|
+
from ..models import GetUmFuturesOrderDownloadLinkByIdResponse
|
|
42
|
+
from ..models import GetUmFuturesTradeDownloadLinkByIdResponse
|
|
43
|
+
from ..models import GetUmFuturesTransactionDownloadLinkByIdResponse
|
|
44
|
+
from ..models import GetUmIncomeHistoryResponse
|
|
45
|
+
from ..models import GetUserCommissionRateForCmResponse
|
|
46
|
+
from ..models import GetUserCommissionRateForUmResponse
|
|
47
|
+
from ..models import MarginMaxBorrowResponse
|
|
48
|
+
from ..models import PortfolioMarginUmTradingQuantitativeRulesIndicatorsResponse
|
|
49
|
+
from ..models import QueryCmPositionInformationResponse
|
|
50
|
+
from ..models import QueryMarginLoanRecordResponse
|
|
51
|
+
from ..models import QueryMarginMaxWithdrawResponse
|
|
52
|
+
from ..models import QueryMarginRepayRecordResponse
|
|
53
|
+
from ..models import QueryPortfolioMarginNegativeBalanceInterestHistoryResponse
|
|
54
|
+
from ..models import QueryUmPositionInformationResponse
|
|
55
|
+
from ..models import QueryUserNegativeBalanceAutoExchangeRecordResponse
|
|
56
|
+
from ..models import QueryUserRateLimitResponse
|
|
57
|
+
from ..models import RepayFuturesNegativeBalanceResponse
|
|
58
|
+
from ..models import UmFuturesAccountConfigurationResponse
|
|
59
|
+
from ..models import UmFuturesSymbolConfigurationResponse
|
|
60
|
+
from ..models import UmNotionalAndLeverageBracketsResponse
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
class AccountApi:
|
|
64
|
+
"""API Client for AccountApi endpoints."""
|
|
65
|
+
|
|
66
|
+
def __init__(
|
|
67
|
+
self,
|
|
68
|
+
configuration: ConfigurationRestAPI = None,
|
|
69
|
+
session: Session = None,
|
|
70
|
+
signer: Signers = None,
|
|
71
|
+
) -> None:
|
|
72
|
+
self._configuration = configuration
|
|
73
|
+
self._session = session
|
|
74
|
+
self._signer = signer
|
|
75
|
+
|
|
76
|
+
def account_balance(
|
|
77
|
+
self,
|
|
78
|
+
asset: Optional[str] = None,
|
|
79
|
+
recv_window: Optional[int] = None,
|
|
80
|
+
) -> ApiResponse[AccountBalanceResponse]:
|
|
81
|
+
"""
|
|
82
|
+
Account Balance(USER_DATA)
|
|
83
|
+
GET /papi/v1/balance
|
|
84
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/account/Account-Balance
|
|
85
|
+
|
|
86
|
+
Query account balance
|
|
87
|
+
|
|
88
|
+
Weight: 20
|
|
89
|
+
|
|
90
|
+
Args:
|
|
91
|
+
asset (Optional[str]):
|
|
92
|
+
recv_window (Optional[int]):
|
|
93
|
+
|
|
94
|
+
Returns:
|
|
95
|
+
ApiResponse[AccountBalanceResponse]
|
|
96
|
+
|
|
97
|
+
Raises:
|
|
98
|
+
RequiredError: If a required parameter is missing.
|
|
99
|
+
|
|
100
|
+
"""
|
|
101
|
+
|
|
102
|
+
payload = {"asset": asset, "recv_window": recv_window}
|
|
103
|
+
|
|
104
|
+
return send_request(
|
|
105
|
+
self._session,
|
|
106
|
+
self._configuration,
|
|
107
|
+
method="GET",
|
|
108
|
+
path="/papi/v1/balance",
|
|
109
|
+
payload=payload,
|
|
110
|
+
time_unit=self._configuration.time_unit,
|
|
111
|
+
response_model=AccountBalanceResponse,
|
|
112
|
+
is_signed=True,
|
|
113
|
+
signer=self._signer,
|
|
114
|
+
)
|
|
115
|
+
|
|
116
|
+
def account_information(
|
|
117
|
+
self,
|
|
118
|
+
recv_window: Optional[int] = None,
|
|
119
|
+
) -> ApiResponse[AccountInformationResponse]:
|
|
120
|
+
"""
|
|
121
|
+
Account Information(USER_DATA)
|
|
122
|
+
GET /papi/v1/account
|
|
123
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/account/Account-Information
|
|
124
|
+
|
|
125
|
+
Query account information
|
|
126
|
+
|
|
127
|
+
Weight: 20
|
|
128
|
+
|
|
129
|
+
Args:
|
|
130
|
+
recv_window (Optional[int]):
|
|
131
|
+
|
|
132
|
+
Returns:
|
|
133
|
+
ApiResponse[AccountInformationResponse]
|
|
134
|
+
|
|
135
|
+
Raises:
|
|
136
|
+
RequiredError: If a required parameter is missing.
|
|
137
|
+
|
|
138
|
+
"""
|
|
139
|
+
|
|
140
|
+
payload = {"recv_window": recv_window}
|
|
141
|
+
|
|
142
|
+
return send_request(
|
|
143
|
+
self._session,
|
|
144
|
+
self._configuration,
|
|
145
|
+
method="GET",
|
|
146
|
+
path="/papi/v1/account",
|
|
147
|
+
payload=payload,
|
|
148
|
+
time_unit=self._configuration.time_unit,
|
|
149
|
+
response_model=AccountInformationResponse,
|
|
150
|
+
is_signed=True,
|
|
151
|
+
signer=self._signer,
|
|
152
|
+
)
|
|
153
|
+
|
|
154
|
+
def bnb_transfer(
|
|
155
|
+
self,
|
|
156
|
+
amount: float = None,
|
|
157
|
+
transfer_side: str = None,
|
|
158
|
+
recv_window: Optional[int] = None,
|
|
159
|
+
) -> ApiResponse[BnbTransferResponse]:
|
|
160
|
+
"""
|
|
161
|
+
BNB transfer (TRADE)
|
|
162
|
+
POST /papi/v1/bnb-transfer
|
|
163
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/account/BNB-transfer
|
|
164
|
+
|
|
165
|
+
Transfer BNB in and out of UM
|
|
166
|
+
|
|
167
|
+
* The endpoint can only be called 10 times per 10 minutes in a rolling manner
|
|
168
|
+
|
|
169
|
+
Weight: 750
|
|
170
|
+
|
|
171
|
+
Args:
|
|
172
|
+
amount (float):
|
|
173
|
+
transfer_side (str): "TO_UM","FROM_UM"
|
|
174
|
+
recv_window (Optional[int]):
|
|
175
|
+
|
|
176
|
+
Returns:
|
|
177
|
+
ApiResponse[BnbTransferResponse]
|
|
178
|
+
|
|
179
|
+
Raises:
|
|
180
|
+
RequiredError: If a required parameter is missing.
|
|
181
|
+
|
|
182
|
+
"""
|
|
183
|
+
|
|
184
|
+
if amount is None:
|
|
185
|
+
raise RequiredError(
|
|
186
|
+
field="amount", error_message="Missing required parameter 'amount'"
|
|
187
|
+
)
|
|
188
|
+
if transfer_side is None:
|
|
189
|
+
raise RequiredError(
|
|
190
|
+
field="transfer_side",
|
|
191
|
+
error_message="Missing required parameter 'transfer_side'",
|
|
192
|
+
)
|
|
193
|
+
|
|
194
|
+
payload = {
|
|
195
|
+
"amount": amount,
|
|
196
|
+
"transfer_side": transfer_side,
|
|
197
|
+
"recv_window": recv_window,
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
return send_request(
|
|
201
|
+
self._session,
|
|
202
|
+
self._configuration,
|
|
203
|
+
method="POST",
|
|
204
|
+
path="/papi/v1/bnb-transfer",
|
|
205
|
+
payload=payload,
|
|
206
|
+
time_unit=self._configuration.time_unit,
|
|
207
|
+
response_model=BnbTransferResponse,
|
|
208
|
+
is_signed=True,
|
|
209
|
+
signer=self._signer,
|
|
210
|
+
)
|
|
211
|
+
|
|
212
|
+
def change_auto_repay_futures_status(
|
|
213
|
+
self,
|
|
214
|
+
auto_repay: str = None,
|
|
215
|
+
recv_window: Optional[int] = None,
|
|
216
|
+
) -> ApiResponse[ChangeAutoRepayFuturesStatusResponse]:
|
|
217
|
+
"""
|
|
218
|
+
Change Auto-repay-futures Status(TRADE)
|
|
219
|
+
POST /papi/v1/repay-futures-switch
|
|
220
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/account/Change-Auto-repay-futures-Status
|
|
221
|
+
|
|
222
|
+
Change Auto-repay-futures Status
|
|
223
|
+
|
|
224
|
+
Weight: 750
|
|
225
|
+
|
|
226
|
+
Args:
|
|
227
|
+
auto_repay (str): Default: `true`; `false` for turn off the auto-repay futures negative balance function
|
|
228
|
+
recv_window (Optional[int]):
|
|
229
|
+
|
|
230
|
+
Returns:
|
|
231
|
+
ApiResponse[ChangeAutoRepayFuturesStatusResponse]
|
|
232
|
+
|
|
233
|
+
Raises:
|
|
234
|
+
RequiredError: If a required parameter is missing.
|
|
235
|
+
|
|
236
|
+
"""
|
|
237
|
+
|
|
238
|
+
if auto_repay is None:
|
|
239
|
+
raise RequiredError(
|
|
240
|
+
field="auto_repay",
|
|
241
|
+
error_message="Missing required parameter 'auto_repay'",
|
|
242
|
+
)
|
|
243
|
+
|
|
244
|
+
payload = {"auto_repay": auto_repay, "recv_window": recv_window}
|
|
245
|
+
|
|
246
|
+
return send_request(
|
|
247
|
+
self._session,
|
|
248
|
+
self._configuration,
|
|
249
|
+
method="POST",
|
|
250
|
+
path="/papi/v1/repay-futures-switch",
|
|
251
|
+
payload=payload,
|
|
252
|
+
time_unit=self._configuration.time_unit,
|
|
253
|
+
response_model=ChangeAutoRepayFuturesStatusResponse,
|
|
254
|
+
is_signed=True,
|
|
255
|
+
signer=self._signer,
|
|
256
|
+
)
|
|
257
|
+
|
|
258
|
+
def change_cm_initial_leverage(
|
|
259
|
+
self,
|
|
260
|
+
symbol: str = None,
|
|
261
|
+
leverage: int = None,
|
|
262
|
+
recv_window: Optional[int] = None,
|
|
263
|
+
) -> ApiResponse[ChangeCmInitialLeverageResponse]:
|
|
264
|
+
"""
|
|
265
|
+
Change CM Initial Leverage (TRADE)
|
|
266
|
+
POST /papi/v1/cm/leverage
|
|
267
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/account/Change-CM-Initial-Leverage
|
|
268
|
+
|
|
269
|
+
Change user's initial leverage of specific symbol in CM.
|
|
270
|
+
|
|
271
|
+
Weight: 1
|
|
272
|
+
|
|
273
|
+
Args:
|
|
274
|
+
symbol (str):
|
|
275
|
+
leverage (int): target initial leverage: int from 1 to 125
|
|
276
|
+
recv_window (Optional[int]):
|
|
277
|
+
|
|
278
|
+
Returns:
|
|
279
|
+
ApiResponse[ChangeCmInitialLeverageResponse]
|
|
280
|
+
|
|
281
|
+
Raises:
|
|
282
|
+
RequiredError: If a required parameter is missing.
|
|
283
|
+
|
|
284
|
+
"""
|
|
285
|
+
|
|
286
|
+
if symbol is None:
|
|
287
|
+
raise RequiredError(
|
|
288
|
+
field="symbol", error_message="Missing required parameter 'symbol'"
|
|
289
|
+
)
|
|
290
|
+
if leverage is None:
|
|
291
|
+
raise RequiredError(
|
|
292
|
+
field="leverage", error_message="Missing required parameter 'leverage'"
|
|
293
|
+
)
|
|
294
|
+
|
|
295
|
+
payload = {"symbol": symbol, "leverage": leverage, "recv_window": recv_window}
|
|
296
|
+
|
|
297
|
+
return send_request(
|
|
298
|
+
self._session,
|
|
299
|
+
self._configuration,
|
|
300
|
+
method="POST",
|
|
301
|
+
path="/papi/v1/cm/leverage",
|
|
302
|
+
payload=payload,
|
|
303
|
+
time_unit=self._configuration.time_unit,
|
|
304
|
+
response_model=ChangeCmInitialLeverageResponse,
|
|
305
|
+
is_signed=True,
|
|
306
|
+
signer=self._signer,
|
|
307
|
+
)
|
|
308
|
+
|
|
309
|
+
def change_cm_position_mode(
|
|
310
|
+
self,
|
|
311
|
+
dual_side_position: str = None,
|
|
312
|
+
recv_window: Optional[int] = None,
|
|
313
|
+
) -> ApiResponse[ChangeCmPositionModeResponse]:
|
|
314
|
+
"""
|
|
315
|
+
Change CM Position Mode(TRADE)
|
|
316
|
+
POST /papi/v1/cm/positionSide/dual
|
|
317
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/account/Change-CM-Position-Mode
|
|
318
|
+
|
|
319
|
+
Change user's position mode (Hedge Mode or One-way Mode ) on EVERY symbol in CM
|
|
320
|
+
|
|
321
|
+
Weight: 1
|
|
322
|
+
|
|
323
|
+
Args:
|
|
324
|
+
dual_side_position (str): "true": Hedge Mode; "false": One-way Mode
|
|
325
|
+
recv_window (Optional[int]):
|
|
326
|
+
|
|
327
|
+
Returns:
|
|
328
|
+
ApiResponse[ChangeCmPositionModeResponse]
|
|
329
|
+
|
|
330
|
+
Raises:
|
|
331
|
+
RequiredError: If a required parameter is missing.
|
|
332
|
+
|
|
333
|
+
"""
|
|
334
|
+
|
|
335
|
+
if dual_side_position is None:
|
|
336
|
+
raise RequiredError(
|
|
337
|
+
field="dual_side_position",
|
|
338
|
+
error_message="Missing required parameter 'dual_side_position'",
|
|
339
|
+
)
|
|
340
|
+
|
|
341
|
+
payload = {"dual_side_position": dual_side_position, "recv_window": recv_window}
|
|
342
|
+
|
|
343
|
+
return send_request(
|
|
344
|
+
self._session,
|
|
345
|
+
self._configuration,
|
|
346
|
+
method="POST",
|
|
347
|
+
path="/papi/v1/cm/positionSide/dual",
|
|
348
|
+
payload=payload,
|
|
349
|
+
time_unit=self._configuration.time_unit,
|
|
350
|
+
response_model=ChangeCmPositionModeResponse,
|
|
351
|
+
is_signed=True,
|
|
352
|
+
signer=self._signer,
|
|
353
|
+
)
|
|
354
|
+
|
|
355
|
+
def change_um_initial_leverage(
|
|
356
|
+
self,
|
|
357
|
+
symbol: str = None,
|
|
358
|
+
leverage: int = None,
|
|
359
|
+
recv_window: Optional[int] = None,
|
|
360
|
+
) -> ApiResponse[ChangeUmInitialLeverageResponse]:
|
|
361
|
+
"""
|
|
362
|
+
Change UM Initial Leverage(TRADE)
|
|
363
|
+
POST /papi/v1/um/leverage
|
|
364
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/account/Change-UM-Initial-Leverage
|
|
365
|
+
|
|
366
|
+
Change user's initial leverage of specific symbol in UM.
|
|
367
|
+
|
|
368
|
+
Weight: 1
|
|
369
|
+
|
|
370
|
+
Args:
|
|
371
|
+
symbol (str):
|
|
372
|
+
leverage (int): target initial leverage: int from 1 to 125
|
|
373
|
+
recv_window (Optional[int]):
|
|
374
|
+
|
|
375
|
+
Returns:
|
|
376
|
+
ApiResponse[ChangeUmInitialLeverageResponse]
|
|
377
|
+
|
|
378
|
+
Raises:
|
|
379
|
+
RequiredError: If a required parameter is missing.
|
|
380
|
+
|
|
381
|
+
"""
|
|
382
|
+
|
|
383
|
+
if symbol is None:
|
|
384
|
+
raise RequiredError(
|
|
385
|
+
field="symbol", error_message="Missing required parameter 'symbol'"
|
|
386
|
+
)
|
|
387
|
+
if leverage is None:
|
|
388
|
+
raise RequiredError(
|
|
389
|
+
field="leverage", error_message="Missing required parameter 'leverage'"
|
|
390
|
+
)
|
|
391
|
+
|
|
392
|
+
payload = {"symbol": symbol, "leverage": leverage, "recv_window": recv_window}
|
|
393
|
+
|
|
394
|
+
return send_request(
|
|
395
|
+
self._session,
|
|
396
|
+
self._configuration,
|
|
397
|
+
method="POST",
|
|
398
|
+
path="/papi/v1/um/leverage",
|
|
399
|
+
payload=payload,
|
|
400
|
+
time_unit=self._configuration.time_unit,
|
|
401
|
+
response_model=ChangeUmInitialLeverageResponse,
|
|
402
|
+
is_signed=True,
|
|
403
|
+
signer=self._signer,
|
|
404
|
+
)
|
|
405
|
+
|
|
406
|
+
def change_um_position_mode(
|
|
407
|
+
self,
|
|
408
|
+
dual_side_position: str = None,
|
|
409
|
+
recv_window: Optional[int] = None,
|
|
410
|
+
) -> ApiResponse[ChangeUmPositionModeResponse]:
|
|
411
|
+
"""
|
|
412
|
+
Change UM Position Mode(TRADE)
|
|
413
|
+
POST /papi/v1/um/positionSide/dual
|
|
414
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/account/Change-UM-Position-Mode
|
|
415
|
+
|
|
416
|
+
Change user's position mode (Hedge Mode or One-way Mode ) on EVERY symbol in UM
|
|
417
|
+
|
|
418
|
+
Weight: 1
|
|
419
|
+
|
|
420
|
+
Args:
|
|
421
|
+
dual_side_position (str): "true": Hedge Mode; "false": One-way Mode
|
|
422
|
+
recv_window (Optional[int]):
|
|
423
|
+
|
|
424
|
+
Returns:
|
|
425
|
+
ApiResponse[ChangeUmPositionModeResponse]
|
|
426
|
+
|
|
427
|
+
Raises:
|
|
428
|
+
RequiredError: If a required parameter is missing.
|
|
429
|
+
|
|
430
|
+
"""
|
|
431
|
+
|
|
432
|
+
if dual_side_position is None:
|
|
433
|
+
raise RequiredError(
|
|
434
|
+
field="dual_side_position",
|
|
435
|
+
error_message="Missing required parameter 'dual_side_position'",
|
|
436
|
+
)
|
|
437
|
+
|
|
438
|
+
payload = {"dual_side_position": dual_side_position, "recv_window": recv_window}
|
|
439
|
+
|
|
440
|
+
return send_request(
|
|
441
|
+
self._session,
|
|
442
|
+
self._configuration,
|
|
443
|
+
method="POST",
|
|
444
|
+
path="/papi/v1/um/positionSide/dual",
|
|
445
|
+
payload=payload,
|
|
446
|
+
time_unit=self._configuration.time_unit,
|
|
447
|
+
response_model=ChangeUmPositionModeResponse,
|
|
448
|
+
is_signed=True,
|
|
449
|
+
signer=self._signer,
|
|
450
|
+
)
|
|
451
|
+
|
|
452
|
+
def cm_notional_and_leverage_brackets(
|
|
453
|
+
self,
|
|
454
|
+
symbol: Optional[str] = None,
|
|
455
|
+
recv_window: Optional[int] = None,
|
|
456
|
+
) -> ApiResponse[CmNotionalAndLeverageBracketsResponse]:
|
|
457
|
+
"""
|
|
458
|
+
CM Notional and Leverage Brackets(USER_DATA)
|
|
459
|
+
GET /papi/v1/cm/leverageBracket
|
|
460
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/account/CM-Notional-and-Leverage-Brackets
|
|
461
|
+
|
|
462
|
+
Query CM notional and leverage brackets
|
|
463
|
+
|
|
464
|
+
Weight: 1
|
|
465
|
+
|
|
466
|
+
Args:
|
|
467
|
+
symbol (Optional[str]):
|
|
468
|
+
recv_window (Optional[int]):
|
|
469
|
+
|
|
470
|
+
Returns:
|
|
471
|
+
ApiResponse[CmNotionalAndLeverageBracketsResponse]
|
|
472
|
+
|
|
473
|
+
Raises:
|
|
474
|
+
RequiredError: If a required parameter is missing.
|
|
475
|
+
|
|
476
|
+
"""
|
|
477
|
+
|
|
478
|
+
payload = {"symbol": symbol, "recv_window": recv_window}
|
|
479
|
+
|
|
480
|
+
return send_request(
|
|
481
|
+
self._session,
|
|
482
|
+
self._configuration,
|
|
483
|
+
method="GET",
|
|
484
|
+
path="/papi/v1/cm/leverageBracket",
|
|
485
|
+
payload=payload,
|
|
486
|
+
time_unit=self._configuration.time_unit,
|
|
487
|
+
response_model=CmNotionalAndLeverageBracketsResponse,
|
|
488
|
+
is_signed=True,
|
|
489
|
+
signer=self._signer,
|
|
490
|
+
)
|
|
491
|
+
|
|
492
|
+
def fund_auto_collection(
|
|
493
|
+
self,
|
|
494
|
+
recv_window: Optional[int] = None,
|
|
495
|
+
) -> ApiResponse[FundAutoCollectionResponse]:
|
|
496
|
+
"""
|
|
497
|
+
Fund Auto-collection(TRADE)
|
|
498
|
+
POST /papi/v1/auto-collection
|
|
499
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/account/Fund-Auto-collection
|
|
500
|
+
|
|
501
|
+
Fund collection for Portfolio Margin
|
|
502
|
+
|
|
503
|
+
* The BNB would not be collected from UM-PM account to the Portfolio Margin account.
|
|
504
|
+
* You can only use this function 500 times per hour in a rolling manner.
|
|
505
|
+
|
|
506
|
+
Weight: 750
|
|
507
|
+
|
|
508
|
+
Args:
|
|
509
|
+
recv_window (Optional[int]):
|
|
510
|
+
|
|
511
|
+
Returns:
|
|
512
|
+
ApiResponse[FundAutoCollectionResponse]
|
|
513
|
+
|
|
514
|
+
Raises:
|
|
515
|
+
RequiredError: If a required parameter is missing.
|
|
516
|
+
|
|
517
|
+
"""
|
|
518
|
+
|
|
519
|
+
payload = {"recv_window": recv_window}
|
|
520
|
+
|
|
521
|
+
return send_request(
|
|
522
|
+
self._session,
|
|
523
|
+
self._configuration,
|
|
524
|
+
method="POST",
|
|
525
|
+
path="/papi/v1/auto-collection",
|
|
526
|
+
payload=payload,
|
|
527
|
+
time_unit=self._configuration.time_unit,
|
|
528
|
+
response_model=FundAutoCollectionResponse,
|
|
529
|
+
is_signed=True,
|
|
530
|
+
signer=self._signer,
|
|
531
|
+
)
|
|
532
|
+
|
|
533
|
+
def fund_collection_by_asset(
|
|
534
|
+
self,
|
|
535
|
+
asset: str = None,
|
|
536
|
+
recv_window: Optional[int] = None,
|
|
537
|
+
) -> ApiResponse[FundCollectionByAssetResponse]:
|
|
538
|
+
"""
|
|
539
|
+
Fund Collection by Asset(TRADE)
|
|
540
|
+
POST /papi/v1/asset-collection
|
|
541
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/account/Fund-Collection-by-Asset
|
|
542
|
+
|
|
543
|
+
Transfers specific asset from Futures Account to Margin account
|
|
544
|
+
|
|
545
|
+
* The BNB transfer is not be supported
|
|
546
|
+
|
|
547
|
+
Weight: 30
|
|
548
|
+
|
|
549
|
+
Args:
|
|
550
|
+
asset (str):
|
|
551
|
+
recv_window (Optional[int]):
|
|
552
|
+
|
|
553
|
+
Returns:
|
|
554
|
+
ApiResponse[FundCollectionByAssetResponse]
|
|
555
|
+
|
|
556
|
+
Raises:
|
|
557
|
+
RequiredError: If a required parameter is missing.
|
|
558
|
+
|
|
559
|
+
"""
|
|
560
|
+
|
|
561
|
+
if asset is None:
|
|
562
|
+
raise RequiredError(
|
|
563
|
+
field="asset", error_message="Missing required parameter 'asset'"
|
|
564
|
+
)
|
|
565
|
+
|
|
566
|
+
payload = {"asset": asset, "recv_window": recv_window}
|
|
567
|
+
|
|
568
|
+
return send_request(
|
|
569
|
+
self._session,
|
|
570
|
+
self._configuration,
|
|
571
|
+
method="POST",
|
|
572
|
+
path="/papi/v1/asset-collection",
|
|
573
|
+
payload=payload,
|
|
574
|
+
time_unit=self._configuration.time_unit,
|
|
575
|
+
response_model=FundCollectionByAssetResponse,
|
|
576
|
+
is_signed=True,
|
|
577
|
+
signer=self._signer,
|
|
578
|
+
)
|
|
579
|
+
|
|
580
|
+
def get_auto_repay_futures_status(
|
|
581
|
+
self,
|
|
582
|
+
recv_window: Optional[int] = None,
|
|
583
|
+
) -> ApiResponse[GetAutoRepayFuturesStatusResponse]:
|
|
584
|
+
"""
|
|
585
|
+
Get Auto-repay-futures Status(USER_DATA)
|
|
586
|
+
GET /papi/v1/repay-futures-switch
|
|
587
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-Auto-repay-futures-Status
|
|
588
|
+
|
|
589
|
+
Query Auto-repay-futures Status
|
|
590
|
+
|
|
591
|
+
Weight: 30
|
|
592
|
+
|
|
593
|
+
Args:
|
|
594
|
+
recv_window (Optional[int]):
|
|
595
|
+
|
|
596
|
+
Returns:
|
|
597
|
+
ApiResponse[GetAutoRepayFuturesStatusResponse]
|
|
598
|
+
|
|
599
|
+
Raises:
|
|
600
|
+
RequiredError: If a required parameter is missing.
|
|
601
|
+
|
|
602
|
+
"""
|
|
603
|
+
|
|
604
|
+
payload = {"recv_window": recv_window}
|
|
605
|
+
|
|
606
|
+
return send_request(
|
|
607
|
+
self._session,
|
|
608
|
+
self._configuration,
|
|
609
|
+
method="GET",
|
|
610
|
+
path="/papi/v1/repay-futures-switch",
|
|
611
|
+
payload=payload,
|
|
612
|
+
time_unit=self._configuration.time_unit,
|
|
613
|
+
response_model=GetAutoRepayFuturesStatusResponse,
|
|
614
|
+
is_signed=True,
|
|
615
|
+
signer=self._signer,
|
|
616
|
+
)
|
|
617
|
+
|
|
618
|
+
def get_cm_account_detail(
|
|
619
|
+
self,
|
|
620
|
+
recv_window: Optional[int] = None,
|
|
621
|
+
) -> ApiResponse[GetCmAccountDetailResponse]:
|
|
622
|
+
"""
|
|
623
|
+
Get CM Account Detail(USER_DATA)
|
|
624
|
+
GET /papi/v1/cm/account
|
|
625
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-CM-Account-Detail
|
|
626
|
+
|
|
627
|
+
Get current CM account asset and position information.
|
|
628
|
+
|
|
629
|
+
Weight: 5
|
|
630
|
+
|
|
631
|
+
Args:
|
|
632
|
+
recv_window (Optional[int]):
|
|
633
|
+
|
|
634
|
+
Returns:
|
|
635
|
+
ApiResponse[GetCmAccountDetailResponse]
|
|
636
|
+
|
|
637
|
+
Raises:
|
|
638
|
+
RequiredError: If a required parameter is missing.
|
|
639
|
+
|
|
640
|
+
"""
|
|
641
|
+
|
|
642
|
+
payload = {"recv_window": recv_window}
|
|
643
|
+
|
|
644
|
+
return send_request(
|
|
645
|
+
self._session,
|
|
646
|
+
self._configuration,
|
|
647
|
+
method="GET",
|
|
648
|
+
path="/papi/v1/cm/account",
|
|
649
|
+
payload=payload,
|
|
650
|
+
time_unit=self._configuration.time_unit,
|
|
651
|
+
response_model=GetCmAccountDetailResponse,
|
|
652
|
+
is_signed=True,
|
|
653
|
+
signer=self._signer,
|
|
654
|
+
)
|
|
655
|
+
|
|
656
|
+
def get_cm_current_position_mode(
|
|
657
|
+
self,
|
|
658
|
+
recv_window: Optional[int] = None,
|
|
659
|
+
) -> ApiResponse[GetCmCurrentPositionModeResponse]:
|
|
660
|
+
"""
|
|
661
|
+
Get CM Current Position Mode(USER_DATA)
|
|
662
|
+
GET /papi/v1/cm/positionSide/dual
|
|
663
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-CM-Current-Position-Mode
|
|
664
|
+
|
|
665
|
+
Get user's position mode (Hedge Mode or One-way Mode ) on EVERY symbol in CM
|
|
666
|
+
|
|
667
|
+
Weight: 30
|
|
668
|
+
|
|
669
|
+
Args:
|
|
670
|
+
recv_window (Optional[int]):
|
|
671
|
+
|
|
672
|
+
Returns:
|
|
673
|
+
ApiResponse[GetCmCurrentPositionModeResponse]
|
|
674
|
+
|
|
675
|
+
Raises:
|
|
676
|
+
RequiredError: If a required parameter is missing.
|
|
677
|
+
|
|
678
|
+
"""
|
|
679
|
+
|
|
680
|
+
payload = {"recv_window": recv_window}
|
|
681
|
+
|
|
682
|
+
return send_request(
|
|
683
|
+
self._session,
|
|
684
|
+
self._configuration,
|
|
685
|
+
method="GET",
|
|
686
|
+
path="/papi/v1/cm/positionSide/dual",
|
|
687
|
+
payload=payload,
|
|
688
|
+
time_unit=self._configuration.time_unit,
|
|
689
|
+
response_model=GetCmCurrentPositionModeResponse,
|
|
690
|
+
is_signed=True,
|
|
691
|
+
signer=self._signer,
|
|
692
|
+
)
|
|
693
|
+
|
|
694
|
+
def get_cm_income_history(
|
|
695
|
+
self,
|
|
696
|
+
symbol: Optional[str] = None,
|
|
697
|
+
income_type: Optional[str] = None,
|
|
698
|
+
start_time: Optional[int] = None,
|
|
699
|
+
end_time: Optional[int] = None,
|
|
700
|
+
page: Optional[int] = None,
|
|
701
|
+
limit: Optional[int] = None,
|
|
702
|
+
recv_window: Optional[int] = None,
|
|
703
|
+
) -> ApiResponse[GetCmIncomeHistoryResponse]:
|
|
704
|
+
"""
|
|
705
|
+
Get CM Income History(USER_DATA)
|
|
706
|
+
GET /papi/v1/cm/income
|
|
707
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-CM-Income-History
|
|
708
|
+
|
|
709
|
+
Get CM Income History
|
|
710
|
+
|
|
711
|
+
|
|
712
|
+
* If `incomeType` is not sent, all kinds of flow will be returned
|
|
713
|
+
* "trandId" is unique in the same "incomeType" for a user
|
|
714
|
+
* The interval between `startTime` and `endTime` can not exceed 200 days:
|
|
715
|
+
* If `startTime` and `endTime` are not sent, the last 200 days will be returned
|
|
716
|
+
|
|
717
|
+
Weight: 30
|
|
718
|
+
|
|
719
|
+
Args:
|
|
720
|
+
symbol (Optional[str]):
|
|
721
|
+
income_type (Optional[str]): TRANSFER, WELCOME_BONUS, REALIZED_PNL, FUNDING_FEE, COMMISSION, INSURANCE_CLEAR, REFERRAL_KICKBACK, COMMISSION_REBATE, API_REBATE, CONTEST_REWARD, CROSS_COLLATERAL_TRANSFER, OPTIONS_PREMIUM_FEE, OPTIONS_SETTLE_PROFIT, INTERNAL_TRANSFER, AUTO_EXCHANGE, DELIVERED_SETTELMENT, COIN_SWAP_DEPOSIT, COIN_SWAP_WITHDRAW, POSITION_LIMIT_INCREASE_FEE
|
|
722
|
+
start_time (Optional[int]): Timestamp in ms to get funding from INCLUSIVE.
|
|
723
|
+
end_time (Optional[int]): Timestamp in ms to get funding until INCLUSIVE.
|
|
724
|
+
page (Optional[int]):
|
|
725
|
+
limit (Optional[int]): Default 100; max 1000
|
|
726
|
+
recv_window (Optional[int]):
|
|
727
|
+
|
|
728
|
+
Returns:
|
|
729
|
+
ApiResponse[GetCmIncomeHistoryResponse]
|
|
730
|
+
|
|
731
|
+
Raises:
|
|
732
|
+
RequiredError: If a required parameter is missing.
|
|
733
|
+
|
|
734
|
+
"""
|
|
735
|
+
|
|
736
|
+
payload = {
|
|
737
|
+
"symbol": symbol,
|
|
738
|
+
"income_type": income_type,
|
|
739
|
+
"start_time": start_time,
|
|
740
|
+
"end_time": end_time,
|
|
741
|
+
"page": page,
|
|
742
|
+
"limit": limit,
|
|
743
|
+
"recv_window": recv_window,
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
return send_request(
|
|
747
|
+
self._session,
|
|
748
|
+
self._configuration,
|
|
749
|
+
method="GET",
|
|
750
|
+
path="/papi/v1/cm/income",
|
|
751
|
+
payload=payload,
|
|
752
|
+
time_unit=self._configuration.time_unit,
|
|
753
|
+
response_model=GetCmIncomeHistoryResponse,
|
|
754
|
+
is_signed=True,
|
|
755
|
+
signer=self._signer,
|
|
756
|
+
)
|
|
757
|
+
|
|
758
|
+
def get_download_id_for_um_futures_order_history(
|
|
759
|
+
self,
|
|
760
|
+
start_time: int = None,
|
|
761
|
+
end_time: int = None,
|
|
762
|
+
recv_window: Optional[int] = None,
|
|
763
|
+
) -> ApiResponse[GetDownloadIdForUmFuturesOrderHistoryResponse]:
|
|
764
|
+
"""
|
|
765
|
+
Get Download Id For UM Futures Order History (USER_DATA)
|
|
766
|
+
GET /papi/v1/um/order/asyn
|
|
767
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-Download-Id-For-UM-Futures-Order-History
|
|
768
|
+
|
|
769
|
+
Get download id for UM futures order history
|
|
770
|
+
|
|
771
|
+
* Request Limitation is 10 times per month, shared by front end download page and rest api
|
|
772
|
+
* The time between `startTime` and `endTime` can not be longer than 1 year
|
|
773
|
+
|
|
774
|
+
Weight: 1500
|
|
775
|
+
|
|
776
|
+
Args:
|
|
777
|
+
start_time (int):
|
|
778
|
+
end_time (int):
|
|
779
|
+
recv_window (Optional[int]):
|
|
780
|
+
|
|
781
|
+
Returns:
|
|
782
|
+
ApiResponse[GetDownloadIdForUmFuturesOrderHistoryResponse]
|
|
783
|
+
|
|
784
|
+
Raises:
|
|
785
|
+
RequiredError: If a required parameter is missing.
|
|
786
|
+
|
|
787
|
+
"""
|
|
788
|
+
|
|
789
|
+
if start_time is None:
|
|
790
|
+
raise RequiredError(
|
|
791
|
+
field="start_time",
|
|
792
|
+
error_message="Missing required parameter 'start_time'",
|
|
793
|
+
)
|
|
794
|
+
if end_time is None:
|
|
795
|
+
raise RequiredError(
|
|
796
|
+
field="end_time", error_message="Missing required parameter 'end_time'"
|
|
797
|
+
)
|
|
798
|
+
|
|
799
|
+
payload = {
|
|
800
|
+
"start_time": start_time,
|
|
801
|
+
"end_time": end_time,
|
|
802
|
+
"recv_window": recv_window,
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
return send_request(
|
|
806
|
+
self._session,
|
|
807
|
+
self._configuration,
|
|
808
|
+
method="GET",
|
|
809
|
+
path="/papi/v1/um/order/asyn",
|
|
810
|
+
payload=payload,
|
|
811
|
+
time_unit=self._configuration.time_unit,
|
|
812
|
+
response_model=GetDownloadIdForUmFuturesOrderHistoryResponse,
|
|
813
|
+
is_signed=True,
|
|
814
|
+
signer=self._signer,
|
|
815
|
+
)
|
|
816
|
+
|
|
817
|
+
def get_download_id_for_um_futures_trade_history(
|
|
818
|
+
self,
|
|
819
|
+
start_time: int = None,
|
|
820
|
+
end_time: int = None,
|
|
821
|
+
recv_window: Optional[int] = None,
|
|
822
|
+
) -> ApiResponse[GetDownloadIdForUmFuturesTradeHistoryResponse]:
|
|
823
|
+
"""
|
|
824
|
+
Get Download Id For UM Futures Trade History (USER_DATA)
|
|
825
|
+
GET /papi/v1/um/trade/asyn
|
|
826
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-Download-Id-For-UM-Futures-Trade-History
|
|
827
|
+
|
|
828
|
+
Get download id for UM futures trade history
|
|
829
|
+
|
|
830
|
+
* Request Limitation is 5 times per month, shared by front end download page and rest api
|
|
831
|
+
* The time between `startTime` and `endTime` can not be longer than 1 year
|
|
832
|
+
|
|
833
|
+
Weight: 1500
|
|
834
|
+
|
|
835
|
+
Args:
|
|
836
|
+
start_time (int):
|
|
837
|
+
end_time (int):
|
|
838
|
+
recv_window (Optional[int]):
|
|
839
|
+
|
|
840
|
+
Returns:
|
|
841
|
+
ApiResponse[GetDownloadIdForUmFuturesTradeHistoryResponse]
|
|
842
|
+
|
|
843
|
+
Raises:
|
|
844
|
+
RequiredError: If a required parameter is missing.
|
|
845
|
+
|
|
846
|
+
"""
|
|
847
|
+
|
|
848
|
+
if start_time is None:
|
|
849
|
+
raise RequiredError(
|
|
850
|
+
field="start_time",
|
|
851
|
+
error_message="Missing required parameter 'start_time'",
|
|
852
|
+
)
|
|
853
|
+
if end_time is None:
|
|
854
|
+
raise RequiredError(
|
|
855
|
+
field="end_time", error_message="Missing required parameter 'end_time'"
|
|
856
|
+
)
|
|
857
|
+
|
|
858
|
+
payload = {
|
|
859
|
+
"start_time": start_time,
|
|
860
|
+
"end_time": end_time,
|
|
861
|
+
"recv_window": recv_window,
|
|
862
|
+
}
|
|
863
|
+
|
|
864
|
+
return send_request(
|
|
865
|
+
self._session,
|
|
866
|
+
self._configuration,
|
|
867
|
+
method="GET",
|
|
868
|
+
path="/papi/v1/um/trade/asyn",
|
|
869
|
+
payload=payload,
|
|
870
|
+
time_unit=self._configuration.time_unit,
|
|
871
|
+
response_model=GetDownloadIdForUmFuturesTradeHistoryResponse,
|
|
872
|
+
is_signed=True,
|
|
873
|
+
signer=self._signer,
|
|
874
|
+
)
|
|
875
|
+
|
|
876
|
+
def get_download_id_for_um_futures_transaction_history(
|
|
877
|
+
self,
|
|
878
|
+
start_time: int = None,
|
|
879
|
+
end_time: int = None,
|
|
880
|
+
recv_window: Optional[int] = None,
|
|
881
|
+
) -> ApiResponse[GetDownloadIdForUmFuturesTransactionHistoryResponse]:
|
|
882
|
+
"""
|
|
883
|
+
Get Download Id For UM Futures Transaction History (USER_DATA)
|
|
884
|
+
GET /papi/v1/um/income/asyn
|
|
885
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-Download-Id-For-UM-Futures-Transaction-History
|
|
886
|
+
|
|
887
|
+
Get download id for UM futures transaction history
|
|
888
|
+
|
|
889
|
+
* Request Limitation is 5 times per month, shared by front end download page and rest api
|
|
890
|
+
* The time between `startTime` and `endTime` can not be longer than 1 year
|
|
891
|
+
|
|
892
|
+
Weight: 1500
|
|
893
|
+
|
|
894
|
+
Args:
|
|
895
|
+
start_time (int):
|
|
896
|
+
end_time (int):
|
|
897
|
+
recv_window (Optional[int]):
|
|
898
|
+
|
|
899
|
+
Returns:
|
|
900
|
+
ApiResponse[GetDownloadIdForUmFuturesTransactionHistoryResponse]
|
|
901
|
+
|
|
902
|
+
Raises:
|
|
903
|
+
RequiredError: If a required parameter is missing.
|
|
904
|
+
|
|
905
|
+
"""
|
|
906
|
+
|
|
907
|
+
if start_time is None:
|
|
908
|
+
raise RequiredError(
|
|
909
|
+
field="start_time",
|
|
910
|
+
error_message="Missing required parameter 'start_time'",
|
|
911
|
+
)
|
|
912
|
+
if end_time is None:
|
|
913
|
+
raise RequiredError(
|
|
914
|
+
field="end_time", error_message="Missing required parameter 'end_time'"
|
|
915
|
+
)
|
|
916
|
+
|
|
917
|
+
payload = {
|
|
918
|
+
"start_time": start_time,
|
|
919
|
+
"end_time": end_time,
|
|
920
|
+
"recv_window": recv_window,
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
return send_request(
|
|
924
|
+
self._session,
|
|
925
|
+
self._configuration,
|
|
926
|
+
method="GET",
|
|
927
|
+
path="/papi/v1/um/income/asyn",
|
|
928
|
+
payload=payload,
|
|
929
|
+
time_unit=self._configuration.time_unit,
|
|
930
|
+
response_model=GetDownloadIdForUmFuturesTransactionHistoryResponse,
|
|
931
|
+
is_signed=True,
|
|
932
|
+
signer=self._signer,
|
|
933
|
+
)
|
|
934
|
+
|
|
935
|
+
def get_margin_borrow_loan_interest_history(
|
|
936
|
+
self,
|
|
937
|
+
asset: Optional[str] = None,
|
|
938
|
+
start_time: Optional[int] = None,
|
|
939
|
+
end_time: Optional[int] = None,
|
|
940
|
+
current: Optional[int] = None,
|
|
941
|
+
size: Optional[int] = None,
|
|
942
|
+
archived: Optional[str] = None,
|
|
943
|
+
recv_window: Optional[int] = None,
|
|
944
|
+
) -> ApiResponse[GetMarginBorrowLoanInterestHistoryResponse]:
|
|
945
|
+
"""
|
|
946
|
+
Get Margin Borrow/Loan Interest History(USER_DATA)
|
|
947
|
+
GET /papi/v1/margin/marginInterestHistory
|
|
948
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-Margin-BorrowLoan-Interest-History
|
|
949
|
+
|
|
950
|
+
Get Margin Borrow/Loan Interest History
|
|
951
|
+
|
|
952
|
+
|
|
953
|
+
* Response in descending order
|
|
954
|
+
* The max interval between startTime and endTime is 30 days. It is a MUST to ensure data correctness.
|
|
955
|
+
* If `startTime` and `endTime` not sent, return records of the last 7 days by default
|
|
956
|
+
* If `startTime` is sent and `endTime` is not sent, the records from `startTime` to the present will be returned; if `startTime` is more than 30 days ago, the records of the past 30 days will be returned.
|
|
957
|
+
* If `startTime` is not sent and `endTime` is sent, the records of the 7 days before `endTime` is returned.
|
|
958
|
+
* Type in response has 5 enums:
|
|
959
|
+
* `PERIODIC` interest charged per hour
|
|
960
|
+
* `ON_BORROW` first interest charged on borrow
|
|
961
|
+
* `PERIODIC_CONVERTED` interest charged per hour converted into BNB
|
|
962
|
+
* `ON_BORROW_CONVERTED` first interest charged on borrow converted into BNB
|
|
963
|
+
* `PORTFOLIO` Portfolio Margin negative balance daily interest
|
|
964
|
+
|
|
965
|
+
Weight: 1
|
|
966
|
+
|
|
967
|
+
Args:
|
|
968
|
+
asset (Optional[str]):
|
|
969
|
+
start_time (Optional[int]): Timestamp in ms to get funding from INCLUSIVE.
|
|
970
|
+
end_time (Optional[int]): Timestamp in ms to get funding until INCLUSIVE.
|
|
971
|
+
current (Optional[int]): Currently querying page. Start from 1. Default:1
|
|
972
|
+
size (Optional[int]): Default:10 Max:100
|
|
973
|
+
archived (Optional[str]): Default: `false`. Set to `true` for archived data from 6 months ago
|
|
974
|
+
recv_window (Optional[int]):
|
|
975
|
+
|
|
976
|
+
Returns:
|
|
977
|
+
ApiResponse[GetMarginBorrowLoanInterestHistoryResponse]
|
|
978
|
+
|
|
979
|
+
Raises:
|
|
980
|
+
RequiredError: If a required parameter is missing.
|
|
981
|
+
|
|
982
|
+
"""
|
|
983
|
+
|
|
984
|
+
payload = {
|
|
985
|
+
"asset": asset,
|
|
986
|
+
"start_time": start_time,
|
|
987
|
+
"end_time": end_time,
|
|
988
|
+
"current": current,
|
|
989
|
+
"size": size,
|
|
990
|
+
"archived": archived,
|
|
991
|
+
"recv_window": recv_window,
|
|
992
|
+
}
|
|
993
|
+
|
|
994
|
+
return send_request(
|
|
995
|
+
self._session,
|
|
996
|
+
self._configuration,
|
|
997
|
+
method="GET",
|
|
998
|
+
path="/papi/v1/margin/marginInterestHistory",
|
|
999
|
+
payload=payload,
|
|
1000
|
+
time_unit=self._configuration.time_unit,
|
|
1001
|
+
response_model=GetMarginBorrowLoanInterestHistoryResponse,
|
|
1002
|
+
is_signed=True,
|
|
1003
|
+
signer=self._signer,
|
|
1004
|
+
)
|
|
1005
|
+
|
|
1006
|
+
def get_um_account_detail(
|
|
1007
|
+
self,
|
|
1008
|
+
recv_window: Optional[int] = None,
|
|
1009
|
+
) -> ApiResponse[GetUmAccountDetailResponse]:
|
|
1010
|
+
"""
|
|
1011
|
+
Get UM Account Detail(USER_DATA)
|
|
1012
|
+
GET /papi/v1/um/account
|
|
1013
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Account-Detail
|
|
1014
|
+
|
|
1015
|
+
Get current UM account asset and position information.
|
|
1016
|
+
|
|
1017
|
+
Weight: 5
|
|
1018
|
+
|
|
1019
|
+
Args:
|
|
1020
|
+
recv_window (Optional[int]):
|
|
1021
|
+
|
|
1022
|
+
Returns:
|
|
1023
|
+
ApiResponse[GetUmAccountDetailResponse]
|
|
1024
|
+
|
|
1025
|
+
Raises:
|
|
1026
|
+
RequiredError: If a required parameter is missing.
|
|
1027
|
+
|
|
1028
|
+
"""
|
|
1029
|
+
|
|
1030
|
+
payload = {"recv_window": recv_window}
|
|
1031
|
+
|
|
1032
|
+
return send_request(
|
|
1033
|
+
self._session,
|
|
1034
|
+
self._configuration,
|
|
1035
|
+
method="GET",
|
|
1036
|
+
path="/papi/v1/um/account",
|
|
1037
|
+
payload=payload,
|
|
1038
|
+
time_unit=self._configuration.time_unit,
|
|
1039
|
+
response_model=GetUmAccountDetailResponse,
|
|
1040
|
+
is_signed=True,
|
|
1041
|
+
signer=self._signer,
|
|
1042
|
+
)
|
|
1043
|
+
|
|
1044
|
+
def get_um_account_detail_v2(
|
|
1045
|
+
self,
|
|
1046
|
+
recv_window: Optional[int] = None,
|
|
1047
|
+
) -> ApiResponse[GetUmAccountDetailV2Response]:
|
|
1048
|
+
"""
|
|
1049
|
+
Get UM Account Detail V2(USER_DATA)
|
|
1050
|
+
GET /papi/v2/um/account
|
|
1051
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Account-Detail-V2
|
|
1052
|
+
|
|
1053
|
+
Get current UM account asset and position information.
|
|
1054
|
+
|
|
1055
|
+
Weight: 5
|
|
1056
|
+
|
|
1057
|
+
Args:
|
|
1058
|
+
recv_window (Optional[int]):
|
|
1059
|
+
|
|
1060
|
+
Returns:
|
|
1061
|
+
ApiResponse[GetUmAccountDetailV2Response]
|
|
1062
|
+
|
|
1063
|
+
Raises:
|
|
1064
|
+
RequiredError: If a required parameter is missing.
|
|
1065
|
+
|
|
1066
|
+
"""
|
|
1067
|
+
|
|
1068
|
+
payload = {"recv_window": recv_window}
|
|
1069
|
+
|
|
1070
|
+
return send_request(
|
|
1071
|
+
self._session,
|
|
1072
|
+
self._configuration,
|
|
1073
|
+
method="GET",
|
|
1074
|
+
path="/papi/v2/um/account",
|
|
1075
|
+
payload=payload,
|
|
1076
|
+
time_unit=self._configuration.time_unit,
|
|
1077
|
+
response_model=GetUmAccountDetailV2Response,
|
|
1078
|
+
is_signed=True,
|
|
1079
|
+
signer=self._signer,
|
|
1080
|
+
)
|
|
1081
|
+
|
|
1082
|
+
def get_um_current_position_mode(
|
|
1083
|
+
self,
|
|
1084
|
+
recv_window: Optional[int] = None,
|
|
1085
|
+
) -> ApiResponse[GetUmCurrentPositionModeResponse]:
|
|
1086
|
+
"""
|
|
1087
|
+
Get UM Current Position Mode(USER_DATA)
|
|
1088
|
+
GET /papi/v1/um/positionSide/dual
|
|
1089
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Current-Position-Mode
|
|
1090
|
+
|
|
1091
|
+
Get user's position mode (Hedge Mode or One-way Mode ) on EVERY symbol in UM
|
|
1092
|
+
|
|
1093
|
+
Weight: 30
|
|
1094
|
+
|
|
1095
|
+
Args:
|
|
1096
|
+
recv_window (Optional[int]):
|
|
1097
|
+
|
|
1098
|
+
Returns:
|
|
1099
|
+
ApiResponse[GetUmCurrentPositionModeResponse]
|
|
1100
|
+
|
|
1101
|
+
Raises:
|
|
1102
|
+
RequiredError: If a required parameter is missing.
|
|
1103
|
+
|
|
1104
|
+
"""
|
|
1105
|
+
|
|
1106
|
+
payload = {"recv_window": recv_window}
|
|
1107
|
+
|
|
1108
|
+
return send_request(
|
|
1109
|
+
self._session,
|
|
1110
|
+
self._configuration,
|
|
1111
|
+
method="GET",
|
|
1112
|
+
path="/papi/v1/um/positionSide/dual",
|
|
1113
|
+
payload=payload,
|
|
1114
|
+
time_unit=self._configuration.time_unit,
|
|
1115
|
+
response_model=GetUmCurrentPositionModeResponse,
|
|
1116
|
+
is_signed=True,
|
|
1117
|
+
signer=self._signer,
|
|
1118
|
+
)
|
|
1119
|
+
|
|
1120
|
+
def get_um_futures_order_download_link_by_id(
|
|
1121
|
+
self,
|
|
1122
|
+
download_id: str = None,
|
|
1123
|
+
recv_window: Optional[int] = None,
|
|
1124
|
+
) -> ApiResponse[GetUmFuturesOrderDownloadLinkByIdResponse]:
|
|
1125
|
+
"""
|
|
1126
|
+
Get UM Futures Order Download Link by Id(USER_DATA)
|
|
1127
|
+
GET /papi/v1/um/order/asyn/id
|
|
1128
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Futures-Order-Download-Link-by-Id
|
|
1129
|
+
|
|
1130
|
+
Get UM futures order download link by Id
|
|
1131
|
+
|
|
1132
|
+
* Download link expiration: 24h
|
|
1133
|
+
|
|
1134
|
+
Weight: 10
|
|
1135
|
+
|
|
1136
|
+
Args:
|
|
1137
|
+
download_id (str): get by download id api
|
|
1138
|
+
recv_window (Optional[int]):
|
|
1139
|
+
|
|
1140
|
+
Returns:
|
|
1141
|
+
ApiResponse[GetUmFuturesOrderDownloadLinkByIdResponse]
|
|
1142
|
+
|
|
1143
|
+
Raises:
|
|
1144
|
+
RequiredError: If a required parameter is missing.
|
|
1145
|
+
|
|
1146
|
+
"""
|
|
1147
|
+
|
|
1148
|
+
if download_id is None:
|
|
1149
|
+
raise RequiredError(
|
|
1150
|
+
field="download_id",
|
|
1151
|
+
error_message="Missing required parameter 'download_id'",
|
|
1152
|
+
)
|
|
1153
|
+
|
|
1154
|
+
payload = {"download_id": download_id, "recv_window": recv_window}
|
|
1155
|
+
|
|
1156
|
+
return send_request(
|
|
1157
|
+
self._session,
|
|
1158
|
+
self._configuration,
|
|
1159
|
+
method="GET",
|
|
1160
|
+
path="/papi/v1/um/order/asyn/id",
|
|
1161
|
+
payload=payload,
|
|
1162
|
+
time_unit=self._configuration.time_unit,
|
|
1163
|
+
response_model=GetUmFuturesOrderDownloadLinkByIdResponse,
|
|
1164
|
+
is_signed=True,
|
|
1165
|
+
signer=self._signer,
|
|
1166
|
+
)
|
|
1167
|
+
|
|
1168
|
+
def get_um_futures_trade_download_link_by_id(
|
|
1169
|
+
self,
|
|
1170
|
+
download_id: str = None,
|
|
1171
|
+
recv_window: Optional[int] = None,
|
|
1172
|
+
) -> ApiResponse[GetUmFuturesTradeDownloadLinkByIdResponse]:
|
|
1173
|
+
"""
|
|
1174
|
+
Get UM Futures Trade Download Link by Id(USER_DATA)
|
|
1175
|
+
GET /papi/v1/um/trade/asyn/id
|
|
1176
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Futures-Trade-Download-Link-by-Id
|
|
1177
|
+
|
|
1178
|
+
Get UM futures trade download link by Id
|
|
1179
|
+
|
|
1180
|
+
* Download link expiration: 24h
|
|
1181
|
+
|
|
1182
|
+
Weight: 10
|
|
1183
|
+
|
|
1184
|
+
Args:
|
|
1185
|
+
download_id (str): get by download id api
|
|
1186
|
+
recv_window (Optional[int]):
|
|
1187
|
+
|
|
1188
|
+
Returns:
|
|
1189
|
+
ApiResponse[GetUmFuturesTradeDownloadLinkByIdResponse]
|
|
1190
|
+
|
|
1191
|
+
Raises:
|
|
1192
|
+
RequiredError: If a required parameter is missing.
|
|
1193
|
+
|
|
1194
|
+
"""
|
|
1195
|
+
|
|
1196
|
+
if download_id is None:
|
|
1197
|
+
raise RequiredError(
|
|
1198
|
+
field="download_id",
|
|
1199
|
+
error_message="Missing required parameter 'download_id'",
|
|
1200
|
+
)
|
|
1201
|
+
|
|
1202
|
+
payload = {"download_id": download_id, "recv_window": recv_window}
|
|
1203
|
+
|
|
1204
|
+
return send_request(
|
|
1205
|
+
self._session,
|
|
1206
|
+
self._configuration,
|
|
1207
|
+
method="GET",
|
|
1208
|
+
path="/papi/v1/um/trade/asyn/id",
|
|
1209
|
+
payload=payload,
|
|
1210
|
+
time_unit=self._configuration.time_unit,
|
|
1211
|
+
response_model=GetUmFuturesTradeDownloadLinkByIdResponse,
|
|
1212
|
+
is_signed=True,
|
|
1213
|
+
signer=self._signer,
|
|
1214
|
+
)
|
|
1215
|
+
|
|
1216
|
+
def get_um_futures_transaction_download_link_by_id(
|
|
1217
|
+
self,
|
|
1218
|
+
download_id: str = None,
|
|
1219
|
+
recv_window: Optional[int] = None,
|
|
1220
|
+
) -> ApiResponse[GetUmFuturesTransactionDownloadLinkByIdResponse]:
|
|
1221
|
+
"""
|
|
1222
|
+
Get UM Futures Transaction Download Link by Id(USER_DATA)
|
|
1223
|
+
GET /papi/v1/um/income/asyn/id
|
|
1224
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Futures-Transaction-Download-Link-by-Id
|
|
1225
|
+
|
|
1226
|
+
Get UM futures Transaction download link by Id
|
|
1227
|
+
|
|
1228
|
+
* Download link expiration: 24h
|
|
1229
|
+
|
|
1230
|
+
Weight: 10
|
|
1231
|
+
|
|
1232
|
+
Args:
|
|
1233
|
+
download_id (str): get by download id api
|
|
1234
|
+
recv_window (Optional[int]):
|
|
1235
|
+
|
|
1236
|
+
Returns:
|
|
1237
|
+
ApiResponse[GetUmFuturesTransactionDownloadLinkByIdResponse]
|
|
1238
|
+
|
|
1239
|
+
Raises:
|
|
1240
|
+
RequiredError: If a required parameter is missing.
|
|
1241
|
+
|
|
1242
|
+
"""
|
|
1243
|
+
|
|
1244
|
+
if download_id is None:
|
|
1245
|
+
raise RequiredError(
|
|
1246
|
+
field="download_id",
|
|
1247
|
+
error_message="Missing required parameter 'download_id'",
|
|
1248
|
+
)
|
|
1249
|
+
|
|
1250
|
+
payload = {"download_id": download_id, "recv_window": recv_window}
|
|
1251
|
+
|
|
1252
|
+
return send_request(
|
|
1253
|
+
self._session,
|
|
1254
|
+
self._configuration,
|
|
1255
|
+
method="GET",
|
|
1256
|
+
path="/papi/v1/um/income/asyn/id",
|
|
1257
|
+
payload=payload,
|
|
1258
|
+
time_unit=self._configuration.time_unit,
|
|
1259
|
+
response_model=GetUmFuturesTransactionDownloadLinkByIdResponse,
|
|
1260
|
+
is_signed=True,
|
|
1261
|
+
signer=self._signer,
|
|
1262
|
+
)
|
|
1263
|
+
|
|
1264
|
+
def get_um_income_history(
|
|
1265
|
+
self,
|
|
1266
|
+
symbol: Optional[str] = None,
|
|
1267
|
+
income_type: Optional[str] = None,
|
|
1268
|
+
start_time: Optional[int] = None,
|
|
1269
|
+
end_time: Optional[int] = None,
|
|
1270
|
+
page: Optional[int] = None,
|
|
1271
|
+
limit: Optional[int] = None,
|
|
1272
|
+
recv_window: Optional[int] = None,
|
|
1273
|
+
) -> ApiResponse[GetUmIncomeHistoryResponse]:
|
|
1274
|
+
"""
|
|
1275
|
+
Get UM Income History(USER_DATA)
|
|
1276
|
+
GET /papi/v1/um/income
|
|
1277
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Income-History
|
|
1278
|
+
|
|
1279
|
+
Get UM Income History
|
|
1280
|
+
|
|
1281
|
+
* If neither `startTime` nor `endTime` is sent, the recent 7-day data will be returned.
|
|
1282
|
+
* If `incomeType` is not sent, all kinds of flow will be returned
|
|
1283
|
+
* "trandId" is unique in the same incomeType for a user
|
|
1284
|
+
* Income history only contains data for the last three months
|
|
1285
|
+
|
|
1286
|
+
Weight: 30
|
|
1287
|
+
|
|
1288
|
+
Args:
|
|
1289
|
+
symbol (Optional[str]):
|
|
1290
|
+
income_type (Optional[str]): TRANSFER, WELCOME_BONUS, REALIZED_PNL, FUNDING_FEE, COMMISSION, INSURANCE_CLEAR, REFERRAL_KICKBACK, COMMISSION_REBATE, API_REBATE, CONTEST_REWARD, CROSS_COLLATERAL_TRANSFER, OPTIONS_PREMIUM_FEE, OPTIONS_SETTLE_PROFIT, INTERNAL_TRANSFER, AUTO_EXCHANGE, DELIVERED_SETTELMENT, COIN_SWAP_DEPOSIT, COIN_SWAP_WITHDRAW, POSITION_LIMIT_INCREASE_FEE
|
|
1291
|
+
start_time (Optional[int]): Timestamp in ms to get funding from INCLUSIVE.
|
|
1292
|
+
end_time (Optional[int]): Timestamp in ms to get funding until INCLUSIVE.
|
|
1293
|
+
page (Optional[int]):
|
|
1294
|
+
limit (Optional[int]): Default 100; max 1000
|
|
1295
|
+
recv_window (Optional[int]):
|
|
1296
|
+
|
|
1297
|
+
Returns:
|
|
1298
|
+
ApiResponse[GetUmIncomeHistoryResponse]
|
|
1299
|
+
|
|
1300
|
+
Raises:
|
|
1301
|
+
RequiredError: If a required parameter is missing.
|
|
1302
|
+
|
|
1303
|
+
"""
|
|
1304
|
+
|
|
1305
|
+
payload = {
|
|
1306
|
+
"symbol": symbol,
|
|
1307
|
+
"income_type": income_type,
|
|
1308
|
+
"start_time": start_time,
|
|
1309
|
+
"end_time": end_time,
|
|
1310
|
+
"page": page,
|
|
1311
|
+
"limit": limit,
|
|
1312
|
+
"recv_window": recv_window,
|
|
1313
|
+
}
|
|
1314
|
+
|
|
1315
|
+
return send_request(
|
|
1316
|
+
self._session,
|
|
1317
|
+
self._configuration,
|
|
1318
|
+
method="GET",
|
|
1319
|
+
path="/papi/v1/um/income",
|
|
1320
|
+
payload=payload,
|
|
1321
|
+
time_unit=self._configuration.time_unit,
|
|
1322
|
+
response_model=GetUmIncomeHistoryResponse,
|
|
1323
|
+
is_signed=True,
|
|
1324
|
+
signer=self._signer,
|
|
1325
|
+
)
|
|
1326
|
+
|
|
1327
|
+
def get_user_commission_rate_for_cm(
|
|
1328
|
+
self,
|
|
1329
|
+
symbol: str = None,
|
|
1330
|
+
recv_window: Optional[int] = None,
|
|
1331
|
+
) -> ApiResponse[GetUserCommissionRateForCmResponse]:
|
|
1332
|
+
"""
|
|
1333
|
+
Get User Commission Rate for CM(USER_DATA)
|
|
1334
|
+
GET /papi/v1/cm/commissionRate
|
|
1335
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-User-Commission-Rate-for-CM
|
|
1336
|
+
|
|
1337
|
+
Get User Commission Rate for CM
|
|
1338
|
+
|
|
1339
|
+
Weight: 20
|
|
1340
|
+
|
|
1341
|
+
Args:
|
|
1342
|
+
symbol (str):
|
|
1343
|
+
recv_window (Optional[int]):
|
|
1344
|
+
|
|
1345
|
+
Returns:
|
|
1346
|
+
ApiResponse[GetUserCommissionRateForCmResponse]
|
|
1347
|
+
|
|
1348
|
+
Raises:
|
|
1349
|
+
RequiredError: If a required parameter is missing.
|
|
1350
|
+
|
|
1351
|
+
"""
|
|
1352
|
+
|
|
1353
|
+
if symbol is None:
|
|
1354
|
+
raise RequiredError(
|
|
1355
|
+
field="symbol", error_message="Missing required parameter 'symbol'"
|
|
1356
|
+
)
|
|
1357
|
+
|
|
1358
|
+
payload = {"symbol": symbol, "recv_window": recv_window}
|
|
1359
|
+
|
|
1360
|
+
return send_request(
|
|
1361
|
+
self._session,
|
|
1362
|
+
self._configuration,
|
|
1363
|
+
method="GET",
|
|
1364
|
+
path="/papi/v1/cm/commissionRate",
|
|
1365
|
+
payload=payload,
|
|
1366
|
+
time_unit=self._configuration.time_unit,
|
|
1367
|
+
response_model=GetUserCommissionRateForCmResponse,
|
|
1368
|
+
is_signed=True,
|
|
1369
|
+
signer=self._signer,
|
|
1370
|
+
)
|
|
1371
|
+
|
|
1372
|
+
def get_user_commission_rate_for_um(
|
|
1373
|
+
self,
|
|
1374
|
+
symbol: str = None,
|
|
1375
|
+
recv_window: Optional[int] = None,
|
|
1376
|
+
) -> ApiResponse[GetUserCommissionRateForUmResponse]:
|
|
1377
|
+
"""
|
|
1378
|
+
Get User Commission Rate for UM(USER_DATA)
|
|
1379
|
+
GET /papi/v1/um/commissionRate
|
|
1380
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-User-Commission-Rate-for-UM
|
|
1381
|
+
|
|
1382
|
+
Get User Commission Rate for UM
|
|
1383
|
+
|
|
1384
|
+
Weight: 20
|
|
1385
|
+
|
|
1386
|
+
Args:
|
|
1387
|
+
symbol (str):
|
|
1388
|
+
recv_window (Optional[int]):
|
|
1389
|
+
|
|
1390
|
+
Returns:
|
|
1391
|
+
ApiResponse[GetUserCommissionRateForUmResponse]
|
|
1392
|
+
|
|
1393
|
+
Raises:
|
|
1394
|
+
RequiredError: If a required parameter is missing.
|
|
1395
|
+
|
|
1396
|
+
"""
|
|
1397
|
+
|
|
1398
|
+
if symbol is None:
|
|
1399
|
+
raise RequiredError(
|
|
1400
|
+
field="symbol", error_message="Missing required parameter 'symbol'"
|
|
1401
|
+
)
|
|
1402
|
+
|
|
1403
|
+
payload = {"symbol": symbol, "recv_window": recv_window}
|
|
1404
|
+
|
|
1405
|
+
return send_request(
|
|
1406
|
+
self._session,
|
|
1407
|
+
self._configuration,
|
|
1408
|
+
method="GET",
|
|
1409
|
+
path="/papi/v1/um/commissionRate",
|
|
1410
|
+
payload=payload,
|
|
1411
|
+
time_unit=self._configuration.time_unit,
|
|
1412
|
+
response_model=GetUserCommissionRateForUmResponse,
|
|
1413
|
+
is_signed=True,
|
|
1414
|
+
signer=self._signer,
|
|
1415
|
+
)
|
|
1416
|
+
|
|
1417
|
+
def margin_max_borrow(
|
|
1418
|
+
self,
|
|
1419
|
+
asset: str = None,
|
|
1420
|
+
recv_window: Optional[int] = None,
|
|
1421
|
+
) -> ApiResponse[MarginMaxBorrowResponse]:
|
|
1422
|
+
"""
|
|
1423
|
+
Margin Max Borrow(USER_DATA)
|
|
1424
|
+
GET /papi/v1/margin/maxBorrowable
|
|
1425
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/account/Margin-Max-Borrow
|
|
1426
|
+
|
|
1427
|
+
Query margin max borrow
|
|
1428
|
+
|
|
1429
|
+
Weight: 5
|
|
1430
|
+
|
|
1431
|
+
Args:
|
|
1432
|
+
asset (str):
|
|
1433
|
+
recv_window (Optional[int]):
|
|
1434
|
+
|
|
1435
|
+
Returns:
|
|
1436
|
+
ApiResponse[MarginMaxBorrowResponse]
|
|
1437
|
+
|
|
1438
|
+
Raises:
|
|
1439
|
+
RequiredError: If a required parameter is missing.
|
|
1440
|
+
|
|
1441
|
+
"""
|
|
1442
|
+
|
|
1443
|
+
if asset is None:
|
|
1444
|
+
raise RequiredError(
|
|
1445
|
+
field="asset", error_message="Missing required parameter 'asset'"
|
|
1446
|
+
)
|
|
1447
|
+
|
|
1448
|
+
payload = {"asset": asset, "recv_window": recv_window}
|
|
1449
|
+
|
|
1450
|
+
return send_request(
|
|
1451
|
+
self._session,
|
|
1452
|
+
self._configuration,
|
|
1453
|
+
method="GET",
|
|
1454
|
+
path="/papi/v1/margin/maxBorrowable",
|
|
1455
|
+
payload=payload,
|
|
1456
|
+
time_unit=self._configuration.time_unit,
|
|
1457
|
+
response_model=MarginMaxBorrowResponse,
|
|
1458
|
+
is_signed=True,
|
|
1459
|
+
signer=self._signer,
|
|
1460
|
+
)
|
|
1461
|
+
|
|
1462
|
+
def portfolio_margin_um_trading_quantitative_rules_indicators(
|
|
1463
|
+
self,
|
|
1464
|
+
symbol: Optional[str] = None,
|
|
1465
|
+
recv_window: Optional[int] = None,
|
|
1466
|
+
) -> ApiResponse[PortfolioMarginUmTradingQuantitativeRulesIndicatorsResponse]:
|
|
1467
|
+
"""
|
|
1468
|
+
Portfolio Margin UM Trading Quantitative Rules Indicators(USER_DATA)
|
|
1469
|
+
GET /papi/v1/um/apiTradingStatus
|
|
1470
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/account/Portfolio-Margin-UM-Trading-Quantitative-Rules-Indicators
|
|
1471
|
+
|
|
1472
|
+
Portfolio Margin UM Trading Quantitative Rules Indicators
|
|
1473
|
+
|
|
1474
|
+
Weight: 1 for a single symbol
|
|
1475
|
+
10 when the symbol parameter is omitted
|
|
1476
|
+
|
|
1477
|
+
Args:
|
|
1478
|
+
symbol (Optional[str]):
|
|
1479
|
+
recv_window (Optional[int]):
|
|
1480
|
+
|
|
1481
|
+
Returns:
|
|
1482
|
+
ApiResponse[PortfolioMarginUmTradingQuantitativeRulesIndicatorsResponse]
|
|
1483
|
+
|
|
1484
|
+
Raises:
|
|
1485
|
+
RequiredError: If a required parameter is missing.
|
|
1486
|
+
|
|
1487
|
+
"""
|
|
1488
|
+
|
|
1489
|
+
payload = {"symbol": symbol, "recv_window": recv_window}
|
|
1490
|
+
|
|
1491
|
+
return send_request(
|
|
1492
|
+
self._session,
|
|
1493
|
+
self._configuration,
|
|
1494
|
+
method="GET",
|
|
1495
|
+
path="/papi/v1/um/apiTradingStatus",
|
|
1496
|
+
payload=payload,
|
|
1497
|
+
time_unit=self._configuration.time_unit,
|
|
1498
|
+
response_model=PortfolioMarginUmTradingQuantitativeRulesIndicatorsResponse,
|
|
1499
|
+
is_signed=True,
|
|
1500
|
+
signer=self._signer,
|
|
1501
|
+
)
|
|
1502
|
+
|
|
1503
|
+
def query_cm_position_information(
|
|
1504
|
+
self,
|
|
1505
|
+
margin_asset: Optional[str] = None,
|
|
1506
|
+
pair: Optional[str] = None,
|
|
1507
|
+
recv_window: Optional[int] = None,
|
|
1508
|
+
) -> ApiResponse[QueryCmPositionInformationResponse]:
|
|
1509
|
+
"""
|
|
1510
|
+
Query CM Position Information(USER_DATA)
|
|
1511
|
+
GET /papi/v1/cm/positionRisk
|
|
1512
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-CM-Position-Information
|
|
1513
|
+
|
|
1514
|
+
Get current CM position information.
|
|
1515
|
+
|
|
1516
|
+
* If neither `marginAsset` nor `pair` is sent, positions of all symbols with `TRADING` status will be returned.
|
|
1517
|
+
* for One-way Mode user, the response will only show the "BOTH" positions
|
|
1518
|
+
* for Hedge Mode user, the response will show "LONG", and "SHORT" positions.
|
|
1519
|
+
* Please use with user data stream `ACCOUNT_UPDATE` to meet your timeliness and accuracy needs.
|
|
1520
|
+
|
|
1521
|
+
Weight: 1
|
|
1522
|
+
|
|
1523
|
+
Args:
|
|
1524
|
+
margin_asset (Optional[str]):
|
|
1525
|
+
pair (Optional[str]):
|
|
1526
|
+
recv_window (Optional[int]):
|
|
1527
|
+
|
|
1528
|
+
Returns:
|
|
1529
|
+
ApiResponse[QueryCmPositionInformationResponse]
|
|
1530
|
+
|
|
1531
|
+
Raises:
|
|
1532
|
+
RequiredError: If a required parameter is missing.
|
|
1533
|
+
|
|
1534
|
+
"""
|
|
1535
|
+
|
|
1536
|
+
payload = {
|
|
1537
|
+
"margin_asset": margin_asset,
|
|
1538
|
+
"pair": pair,
|
|
1539
|
+
"recv_window": recv_window,
|
|
1540
|
+
}
|
|
1541
|
+
|
|
1542
|
+
return send_request(
|
|
1543
|
+
self._session,
|
|
1544
|
+
self._configuration,
|
|
1545
|
+
method="GET",
|
|
1546
|
+
path="/papi/v1/cm/positionRisk",
|
|
1547
|
+
payload=payload,
|
|
1548
|
+
time_unit=self._configuration.time_unit,
|
|
1549
|
+
response_model=QueryCmPositionInformationResponse,
|
|
1550
|
+
is_signed=True,
|
|
1551
|
+
signer=self._signer,
|
|
1552
|
+
)
|
|
1553
|
+
|
|
1554
|
+
def query_margin_loan_record(
|
|
1555
|
+
self,
|
|
1556
|
+
asset: str = None,
|
|
1557
|
+
tx_id: Optional[int] = None,
|
|
1558
|
+
start_time: Optional[int] = None,
|
|
1559
|
+
end_time: Optional[int] = None,
|
|
1560
|
+
current: Optional[int] = None,
|
|
1561
|
+
size: Optional[int] = None,
|
|
1562
|
+
archived: Optional[str] = None,
|
|
1563
|
+
recv_window: Optional[int] = None,
|
|
1564
|
+
) -> ApiResponse[QueryMarginLoanRecordResponse]:
|
|
1565
|
+
"""
|
|
1566
|
+
Query Margin Loan Record(USER_DATA)
|
|
1567
|
+
GET /papi/v1/margin/marginLoan
|
|
1568
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-Margin-Loan-Record
|
|
1569
|
+
|
|
1570
|
+
Query margin loan record
|
|
1571
|
+
|
|
1572
|
+
* txId or startTime must be sent. txId takes precedence.
|
|
1573
|
+
* Response in descending order
|
|
1574
|
+
* The max interval between `startTime` and `endTime` is 30 days.
|
|
1575
|
+
* If `startTime` and `endTime` not sent, return records of the last 7 days by default
|
|
1576
|
+
* Set `archived` to `true` to query data from 6 months ago
|
|
1577
|
+
|
|
1578
|
+
Weight: 10
|
|
1579
|
+
|
|
1580
|
+
Args:
|
|
1581
|
+
asset (str):
|
|
1582
|
+
tx_id (Optional[int]): the `tranId` in `POST/papi/v1/marginLoan`
|
|
1583
|
+
start_time (Optional[int]): Timestamp in ms to get funding from INCLUSIVE.
|
|
1584
|
+
end_time (Optional[int]): Timestamp in ms to get funding until INCLUSIVE.
|
|
1585
|
+
current (Optional[int]): Currently querying page. Start from 1. Default:1
|
|
1586
|
+
size (Optional[int]): Default:10 Max:100
|
|
1587
|
+
archived (Optional[str]): Default: `false`. Set to `true` for archived data from 6 months ago
|
|
1588
|
+
recv_window (Optional[int]):
|
|
1589
|
+
|
|
1590
|
+
Returns:
|
|
1591
|
+
ApiResponse[QueryMarginLoanRecordResponse]
|
|
1592
|
+
|
|
1593
|
+
Raises:
|
|
1594
|
+
RequiredError: If a required parameter is missing.
|
|
1595
|
+
|
|
1596
|
+
"""
|
|
1597
|
+
|
|
1598
|
+
if asset is None:
|
|
1599
|
+
raise RequiredError(
|
|
1600
|
+
field="asset", error_message="Missing required parameter 'asset'"
|
|
1601
|
+
)
|
|
1602
|
+
|
|
1603
|
+
payload = {
|
|
1604
|
+
"asset": asset,
|
|
1605
|
+
"tx_id": tx_id,
|
|
1606
|
+
"start_time": start_time,
|
|
1607
|
+
"end_time": end_time,
|
|
1608
|
+
"current": current,
|
|
1609
|
+
"size": size,
|
|
1610
|
+
"archived": archived,
|
|
1611
|
+
"recv_window": recv_window,
|
|
1612
|
+
}
|
|
1613
|
+
|
|
1614
|
+
return send_request(
|
|
1615
|
+
self._session,
|
|
1616
|
+
self._configuration,
|
|
1617
|
+
method="GET",
|
|
1618
|
+
path="/papi/v1/margin/marginLoan",
|
|
1619
|
+
payload=payload,
|
|
1620
|
+
time_unit=self._configuration.time_unit,
|
|
1621
|
+
response_model=QueryMarginLoanRecordResponse,
|
|
1622
|
+
is_signed=True,
|
|
1623
|
+
signer=self._signer,
|
|
1624
|
+
)
|
|
1625
|
+
|
|
1626
|
+
def query_margin_max_withdraw(
|
|
1627
|
+
self,
|
|
1628
|
+
asset: str = None,
|
|
1629
|
+
recv_window: Optional[int] = None,
|
|
1630
|
+
) -> ApiResponse[QueryMarginMaxWithdrawResponse]:
|
|
1631
|
+
"""
|
|
1632
|
+
Query Margin Max Withdraw(USER_DATA)
|
|
1633
|
+
GET /papi/v1/margin/maxWithdraw
|
|
1634
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-Margin-Max-Withdraw
|
|
1635
|
+
|
|
1636
|
+
Query Margin Max Withdraw
|
|
1637
|
+
|
|
1638
|
+
Weight: 5
|
|
1639
|
+
|
|
1640
|
+
Args:
|
|
1641
|
+
asset (str):
|
|
1642
|
+
recv_window (Optional[int]):
|
|
1643
|
+
|
|
1644
|
+
Returns:
|
|
1645
|
+
ApiResponse[QueryMarginMaxWithdrawResponse]
|
|
1646
|
+
|
|
1647
|
+
Raises:
|
|
1648
|
+
RequiredError: If a required parameter is missing.
|
|
1649
|
+
|
|
1650
|
+
"""
|
|
1651
|
+
|
|
1652
|
+
if asset is None:
|
|
1653
|
+
raise RequiredError(
|
|
1654
|
+
field="asset", error_message="Missing required parameter 'asset'"
|
|
1655
|
+
)
|
|
1656
|
+
|
|
1657
|
+
payload = {"asset": asset, "recv_window": recv_window}
|
|
1658
|
+
|
|
1659
|
+
return send_request(
|
|
1660
|
+
self._session,
|
|
1661
|
+
self._configuration,
|
|
1662
|
+
method="GET",
|
|
1663
|
+
path="/papi/v1/margin/maxWithdraw",
|
|
1664
|
+
payload=payload,
|
|
1665
|
+
time_unit=self._configuration.time_unit,
|
|
1666
|
+
response_model=QueryMarginMaxWithdrawResponse,
|
|
1667
|
+
is_signed=True,
|
|
1668
|
+
signer=self._signer,
|
|
1669
|
+
)
|
|
1670
|
+
|
|
1671
|
+
def query_margin_repay_record(
|
|
1672
|
+
self,
|
|
1673
|
+
asset: str = None,
|
|
1674
|
+
tx_id: Optional[int] = None,
|
|
1675
|
+
start_time: Optional[int] = None,
|
|
1676
|
+
end_time: Optional[int] = None,
|
|
1677
|
+
current: Optional[int] = None,
|
|
1678
|
+
size: Optional[int] = None,
|
|
1679
|
+
archived: Optional[str] = None,
|
|
1680
|
+
recv_window: Optional[int] = None,
|
|
1681
|
+
) -> ApiResponse[QueryMarginRepayRecordResponse]:
|
|
1682
|
+
"""
|
|
1683
|
+
Query Margin repay Record(USER_DATA)
|
|
1684
|
+
GET /papi/v1/margin/repayLoan
|
|
1685
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-Margin-repay-Record
|
|
1686
|
+
|
|
1687
|
+
Query margin repay record.
|
|
1688
|
+
|
|
1689
|
+
* txId or startTime must be sent. txId takes precedence.
|
|
1690
|
+
* Response in descending order
|
|
1691
|
+
* The max interval between `startTime` and `endTime` is 30 days.
|
|
1692
|
+
* If `startTime` and `endTime` not sent, return records of the last 7 days by default
|
|
1693
|
+
* Set `archived` to `true` to query data from 6 months ago
|
|
1694
|
+
|
|
1695
|
+
Weight: 10
|
|
1696
|
+
|
|
1697
|
+
Args:
|
|
1698
|
+
asset (str):
|
|
1699
|
+
tx_id (Optional[int]): the `tranId` in `POST/papi/v1/marginLoan`
|
|
1700
|
+
start_time (Optional[int]): Timestamp in ms to get funding from INCLUSIVE.
|
|
1701
|
+
end_time (Optional[int]): Timestamp in ms to get funding until INCLUSIVE.
|
|
1702
|
+
current (Optional[int]): Currently querying page. Start from 1. Default:1
|
|
1703
|
+
size (Optional[int]): Default:10 Max:100
|
|
1704
|
+
archived (Optional[str]): Default: `false`. Set to `true` for archived data from 6 months ago
|
|
1705
|
+
recv_window (Optional[int]):
|
|
1706
|
+
|
|
1707
|
+
Returns:
|
|
1708
|
+
ApiResponse[QueryMarginRepayRecordResponse]
|
|
1709
|
+
|
|
1710
|
+
Raises:
|
|
1711
|
+
RequiredError: If a required parameter is missing.
|
|
1712
|
+
|
|
1713
|
+
"""
|
|
1714
|
+
|
|
1715
|
+
if asset is None:
|
|
1716
|
+
raise RequiredError(
|
|
1717
|
+
field="asset", error_message="Missing required parameter 'asset'"
|
|
1718
|
+
)
|
|
1719
|
+
|
|
1720
|
+
payload = {
|
|
1721
|
+
"asset": asset,
|
|
1722
|
+
"tx_id": tx_id,
|
|
1723
|
+
"start_time": start_time,
|
|
1724
|
+
"end_time": end_time,
|
|
1725
|
+
"current": current,
|
|
1726
|
+
"size": size,
|
|
1727
|
+
"archived": archived,
|
|
1728
|
+
"recv_window": recv_window,
|
|
1729
|
+
}
|
|
1730
|
+
|
|
1731
|
+
return send_request(
|
|
1732
|
+
self._session,
|
|
1733
|
+
self._configuration,
|
|
1734
|
+
method="GET",
|
|
1735
|
+
path="/papi/v1/margin/repayLoan",
|
|
1736
|
+
payload=payload,
|
|
1737
|
+
time_unit=self._configuration.time_unit,
|
|
1738
|
+
response_model=QueryMarginRepayRecordResponse,
|
|
1739
|
+
is_signed=True,
|
|
1740
|
+
signer=self._signer,
|
|
1741
|
+
)
|
|
1742
|
+
|
|
1743
|
+
def query_portfolio_margin_negative_balance_interest_history(
|
|
1744
|
+
self,
|
|
1745
|
+
asset: Optional[str] = None,
|
|
1746
|
+
start_time: Optional[int] = None,
|
|
1747
|
+
end_time: Optional[int] = None,
|
|
1748
|
+
size: Optional[int] = None,
|
|
1749
|
+
recv_window: Optional[int] = None,
|
|
1750
|
+
) -> ApiResponse[QueryPortfolioMarginNegativeBalanceInterestHistoryResponse]:
|
|
1751
|
+
"""
|
|
1752
|
+
Query Portfolio Margin Negative Balance Interest History(USER_DATA)
|
|
1753
|
+
GET /papi/v1/portfolio/interest-history
|
|
1754
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-Portfolio-Margin-Negative-Balance-Interest-History
|
|
1755
|
+
|
|
1756
|
+
Query interest history of negative balance for portfolio margin.
|
|
1757
|
+
|
|
1758
|
+
* Response in descending order
|
|
1759
|
+
* The max interval between startTime and endTime is 30 days. It is a MUST to ensure data correctness.
|
|
1760
|
+
* If `startTime` and `endTime` not sent, return records of the last 7 days by default
|
|
1761
|
+
* If `startTime` is sent and `endTime` is not sent, the records from `startTime` to the present will be returned; if `startTime` is more than 30 days ago, the records of the past 30 days will be returned.
|
|
1762
|
+
* If `startTime` is not sent and `endTime` is sent, the records of the 7 days before `endTime` is returned.
|
|
1763
|
+
|
|
1764
|
+
Weight: 50
|
|
1765
|
+
|
|
1766
|
+
Args:
|
|
1767
|
+
asset (Optional[str]):
|
|
1768
|
+
start_time (Optional[int]): Timestamp in ms to get funding from INCLUSIVE.
|
|
1769
|
+
end_time (Optional[int]): Timestamp in ms to get funding until INCLUSIVE.
|
|
1770
|
+
size (Optional[int]): Default:10 Max:100
|
|
1771
|
+
recv_window (Optional[int]):
|
|
1772
|
+
|
|
1773
|
+
Returns:
|
|
1774
|
+
ApiResponse[QueryPortfolioMarginNegativeBalanceInterestHistoryResponse]
|
|
1775
|
+
|
|
1776
|
+
Raises:
|
|
1777
|
+
RequiredError: If a required parameter is missing.
|
|
1778
|
+
|
|
1779
|
+
"""
|
|
1780
|
+
|
|
1781
|
+
payload = {
|
|
1782
|
+
"asset": asset,
|
|
1783
|
+
"start_time": start_time,
|
|
1784
|
+
"end_time": end_time,
|
|
1785
|
+
"size": size,
|
|
1786
|
+
"recv_window": recv_window,
|
|
1787
|
+
}
|
|
1788
|
+
|
|
1789
|
+
return send_request(
|
|
1790
|
+
self._session,
|
|
1791
|
+
self._configuration,
|
|
1792
|
+
method="GET",
|
|
1793
|
+
path="/papi/v1/portfolio/interest-history",
|
|
1794
|
+
payload=payload,
|
|
1795
|
+
time_unit=self._configuration.time_unit,
|
|
1796
|
+
response_model=QueryPortfolioMarginNegativeBalanceInterestHistoryResponse,
|
|
1797
|
+
is_signed=True,
|
|
1798
|
+
signer=self._signer,
|
|
1799
|
+
)
|
|
1800
|
+
|
|
1801
|
+
def query_um_position_information(
|
|
1802
|
+
self,
|
|
1803
|
+
symbol: Optional[str] = None,
|
|
1804
|
+
recv_window: Optional[int] = None,
|
|
1805
|
+
) -> ApiResponse[QueryUmPositionInformationResponse]:
|
|
1806
|
+
"""
|
|
1807
|
+
Query UM Position Information(USER_DATA)
|
|
1808
|
+
GET /papi/v1/um/positionRisk
|
|
1809
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-UM-Position-Information
|
|
1810
|
+
|
|
1811
|
+
Get current UM position information.
|
|
1812
|
+
|
|
1813
|
+
* Please use with user data stream `ACCOUNT_UPDATE` to meet your timeliness and accuracy needs.
|
|
1814
|
+
* for One-way Mode user, the response will only show the "BOTH" positions
|
|
1815
|
+
* for Hedge Mode user, the response will show "LONG", and "SHORT" positions.
|
|
1816
|
+
|
|
1817
|
+
Weight: 5
|
|
1818
|
+
|
|
1819
|
+
Args:
|
|
1820
|
+
symbol (Optional[str]):
|
|
1821
|
+
recv_window (Optional[int]):
|
|
1822
|
+
|
|
1823
|
+
Returns:
|
|
1824
|
+
ApiResponse[QueryUmPositionInformationResponse]
|
|
1825
|
+
|
|
1826
|
+
Raises:
|
|
1827
|
+
RequiredError: If a required parameter is missing.
|
|
1828
|
+
|
|
1829
|
+
"""
|
|
1830
|
+
|
|
1831
|
+
payload = {"symbol": symbol, "recv_window": recv_window}
|
|
1832
|
+
|
|
1833
|
+
return send_request(
|
|
1834
|
+
self._session,
|
|
1835
|
+
self._configuration,
|
|
1836
|
+
method="GET",
|
|
1837
|
+
path="/papi/v1/um/positionRisk",
|
|
1838
|
+
payload=payload,
|
|
1839
|
+
time_unit=self._configuration.time_unit,
|
|
1840
|
+
response_model=QueryUmPositionInformationResponse,
|
|
1841
|
+
is_signed=True,
|
|
1842
|
+
signer=self._signer,
|
|
1843
|
+
)
|
|
1844
|
+
|
|
1845
|
+
def query_user_negative_balance_auto_exchange_record(
|
|
1846
|
+
self,
|
|
1847
|
+
start_time: int = None,
|
|
1848
|
+
end_time: int = None,
|
|
1849
|
+
recv_window: Optional[int] = None,
|
|
1850
|
+
) -> ApiResponse[QueryUserNegativeBalanceAutoExchangeRecordResponse]:
|
|
1851
|
+
"""
|
|
1852
|
+
Query User Negative Balance Auto Exchange Record (USER_DATA)
|
|
1853
|
+
GET /papi/v1/portfolio/negative-balance-exchange-record
|
|
1854
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-User-Negative-Balance-Auto-Exchange-Record
|
|
1855
|
+
|
|
1856
|
+
Query user negative balance auto exchange record
|
|
1857
|
+
|
|
1858
|
+
* Response in descending order
|
|
1859
|
+
* The max interval between `startTime` and `endTime` is 3 months.
|
|
1860
|
+
|
|
1861
|
+
Weight: 100
|
|
1862
|
+
|
|
1863
|
+
Args:
|
|
1864
|
+
start_time (int):
|
|
1865
|
+
end_time (int):
|
|
1866
|
+
recv_window (Optional[int]):
|
|
1867
|
+
|
|
1868
|
+
Returns:
|
|
1869
|
+
ApiResponse[QueryUserNegativeBalanceAutoExchangeRecordResponse]
|
|
1870
|
+
|
|
1871
|
+
Raises:
|
|
1872
|
+
RequiredError: If a required parameter is missing.
|
|
1873
|
+
|
|
1874
|
+
"""
|
|
1875
|
+
|
|
1876
|
+
if start_time is None:
|
|
1877
|
+
raise RequiredError(
|
|
1878
|
+
field="start_time",
|
|
1879
|
+
error_message="Missing required parameter 'start_time'",
|
|
1880
|
+
)
|
|
1881
|
+
if end_time is None:
|
|
1882
|
+
raise RequiredError(
|
|
1883
|
+
field="end_time", error_message="Missing required parameter 'end_time'"
|
|
1884
|
+
)
|
|
1885
|
+
|
|
1886
|
+
payload = {
|
|
1887
|
+
"start_time": start_time,
|
|
1888
|
+
"end_time": end_time,
|
|
1889
|
+
"recv_window": recv_window,
|
|
1890
|
+
}
|
|
1891
|
+
|
|
1892
|
+
return send_request(
|
|
1893
|
+
self._session,
|
|
1894
|
+
self._configuration,
|
|
1895
|
+
method="GET",
|
|
1896
|
+
path="/papi/v1/portfolio/negative-balance-exchange-record",
|
|
1897
|
+
payload=payload,
|
|
1898
|
+
time_unit=self._configuration.time_unit,
|
|
1899
|
+
response_model=QueryUserNegativeBalanceAutoExchangeRecordResponse,
|
|
1900
|
+
is_signed=True,
|
|
1901
|
+
signer=self._signer,
|
|
1902
|
+
)
|
|
1903
|
+
|
|
1904
|
+
def query_user_rate_limit(
|
|
1905
|
+
self,
|
|
1906
|
+
recv_window: Optional[int] = None,
|
|
1907
|
+
) -> ApiResponse[QueryUserRateLimitResponse]:
|
|
1908
|
+
"""
|
|
1909
|
+
Query User Rate Limit (USER_DATA)
|
|
1910
|
+
GET /papi/v1/rateLimit/order
|
|
1911
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-User-Rate-Limit
|
|
1912
|
+
|
|
1913
|
+
Query User Rate Limit
|
|
1914
|
+
|
|
1915
|
+
Weight: 1
|
|
1916
|
+
|
|
1917
|
+
Args:
|
|
1918
|
+
recv_window (Optional[int]):
|
|
1919
|
+
|
|
1920
|
+
Returns:
|
|
1921
|
+
ApiResponse[QueryUserRateLimitResponse]
|
|
1922
|
+
|
|
1923
|
+
Raises:
|
|
1924
|
+
RequiredError: If a required parameter is missing.
|
|
1925
|
+
|
|
1926
|
+
"""
|
|
1927
|
+
|
|
1928
|
+
payload = {"recv_window": recv_window}
|
|
1929
|
+
|
|
1930
|
+
return send_request(
|
|
1931
|
+
self._session,
|
|
1932
|
+
self._configuration,
|
|
1933
|
+
method="GET",
|
|
1934
|
+
path="/papi/v1/rateLimit/order",
|
|
1935
|
+
payload=payload,
|
|
1936
|
+
time_unit=self._configuration.time_unit,
|
|
1937
|
+
response_model=QueryUserRateLimitResponse,
|
|
1938
|
+
is_signed=True,
|
|
1939
|
+
signer=self._signer,
|
|
1940
|
+
)
|
|
1941
|
+
|
|
1942
|
+
def repay_futures_negative_balance(
|
|
1943
|
+
self,
|
|
1944
|
+
recv_window: Optional[int] = None,
|
|
1945
|
+
) -> ApiResponse[RepayFuturesNegativeBalanceResponse]:
|
|
1946
|
+
"""
|
|
1947
|
+
Repay futures Negative Balance(USER_DATA)
|
|
1948
|
+
POST /papi/v1/repay-futures-negative-balance
|
|
1949
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/account/Repay-futures-Negative-Balance
|
|
1950
|
+
|
|
1951
|
+
Repay futures Negative Balance
|
|
1952
|
+
|
|
1953
|
+
Weight: 750
|
|
1954
|
+
|
|
1955
|
+
Args:
|
|
1956
|
+
recv_window (Optional[int]):
|
|
1957
|
+
|
|
1958
|
+
Returns:
|
|
1959
|
+
ApiResponse[RepayFuturesNegativeBalanceResponse]
|
|
1960
|
+
|
|
1961
|
+
Raises:
|
|
1962
|
+
RequiredError: If a required parameter is missing.
|
|
1963
|
+
|
|
1964
|
+
"""
|
|
1965
|
+
|
|
1966
|
+
payload = {"recv_window": recv_window}
|
|
1967
|
+
|
|
1968
|
+
return send_request(
|
|
1969
|
+
self._session,
|
|
1970
|
+
self._configuration,
|
|
1971
|
+
method="POST",
|
|
1972
|
+
path="/papi/v1/repay-futures-negative-balance",
|
|
1973
|
+
payload=payload,
|
|
1974
|
+
time_unit=self._configuration.time_unit,
|
|
1975
|
+
response_model=RepayFuturesNegativeBalanceResponse,
|
|
1976
|
+
is_signed=True,
|
|
1977
|
+
signer=self._signer,
|
|
1978
|
+
)
|
|
1979
|
+
|
|
1980
|
+
def um_futures_account_configuration(
|
|
1981
|
+
self,
|
|
1982
|
+
recv_window: Optional[int] = None,
|
|
1983
|
+
) -> ApiResponse[UmFuturesAccountConfigurationResponse]:
|
|
1984
|
+
"""
|
|
1985
|
+
UM Futures Account Configuration(USER_DATA)
|
|
1986
|
+
GET /papi/v1/um/accountConfig
|
|
1987
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Futures-Account-Config
|
|
1988
|
+
|
|
1989
|
+
Query UM Futures account configuration
|
|
1990
|
+
|
|
1991
|
+
Weight: 5
|
|
1992
|
+
|
|
1993
|
+
Args:
|
|
1994
|
+
recv_window (Optional[int]):
|
|
1995
|
+
|
|
1996
|
+
Returns:
|
|
1997
|
+
ApiResponse[UmFuturesAccountConfigurationResponse]
|
|
1998
|
+
|
|
1999
|
+
Raises:
|
|
2000
|
+
RequiredError: If a required parameter is missing.
|
|
2001
|
+
|
|
2002
|
+
"""
|
|
2003
|
+
|
|
2004
|
+
payload = {"recv_window": recv_window}
|
|
2005
|
+
|
|
2006
|
+
return send_request(
|
|
2007
|
+
self._session,
|
|
2008
|
+
self._configuration,
|
|
2009
|
+
method="GET",
|
|
2010
|
+
path="/papi/v1/um/accountConfig",
|
|
2011
|
+
payload=payload,
|
|
2012
|
+
time_unit=self._configuration.time_unit,
|
|
2013
|
+
response_model=UmFuturesAccountConfigurationResponse,
|
|
2014
|
+
is_signed=True,
|
|
2015
|
+
signer=self._signer,
|
|
2016
|
+
)
|
|
2017
|
+
|
|
2018
|
+
def um_futures_symbol_configuration(
|
|
2019
|
+
self,
|
|
2020
|
+
symbol: Optional[str] = None,
|
|
2021
|
+
recv_window: Optional[int] = None,
|
|
2022
|
+
) -> ApiResponse[UmFuturesSymbolConfigurationResponse]:
|
|
2023
|
+
"""
|
|
2024
|
+
UM Futures Symbol Configuration(USER_DATA)
|
|
2025
|
+
GET /papi/v1/um/symbolConfig
|
|
2026
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Futures-Symbol-Config
|
|
2027
|
+
|
|
2028
|
+
Get current UM account symbol configuration.
|
|
2029
|
+
|
|
2030
|
+
Weight: 5
|
|
2031
|
+
|
|
2032
|
+
Args:
|
|
2033
|
+
symbol (Optional[str]):
|
|
2034
|
+
recv_window (Optional[int]):
|
|
2035
|
+
|
|
2036
|
+
Returns:
|
|
2037
|
+
ApiResponse[UmFuturesSymbolConfigurationResponse]
|
|
2038
|
+
|
|
2039
|
+
Raises:
|
|
2040
|
+
RequiredError: If a required parameter is missing.
|
|
2041
|
+
|
|
2042
|
+
"""
|
|
2043
|
+
|
|
2044
|
+
payload = {"symbol": symbol, "recv_window": recv_window}
|
|
2045
|
+
|
|
2046
|
+
return send_request(
|
|
2047
|
+
self._session,
|
|
2048
|
+
self._configuration,
|
|
2049
|
+
method="GET",
|
|
2050
|
+
path="/papi/v1/um/symbolConfig",
|
|
2051
|
+
payload=payload,
|
|
2052
|
+
time_unit=self._configuration.time_unit,
|
|
2053
|
+
response_model=UmFuturesSymbolConfigurationResponse,
|
|
2054
|
+
is_signed=True,
|
|
2055
|
+
signer=self._signer,
|
|
2056
|
+
)
|
|
2057
|
+
|
|
2058
|
+
def um_notional_and_leverage_brackets(
|
|
2059
|
+
self,
|
|
2060
|
+
symbol: Optional[str] = None,
|
|
2061
|
+
recv_window: Optional[int] = None,
|
|
2062
|
+
) -> ApiResponse[UmNotionalAndLeverageBracketsResponse]:
|
|
2063
|
+
"""
|
|
2064
|
+
UM Notional and Leverage Brackets (USER_DATA)
|
|
2065
|
+
GET /papi/v1/um/leverageBracket
|
|
2066
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/account/UM-Notional-and-Leverage-Brackets
|
|
2067
|
+
|
|
2068
|
+
Query UM notional and leverage brackets
|
|
2069
|
+
|
|
2070
|
+
Weight: 1
|
|
2071
|
+
|
|
2072
|
+
Args:
|
|
2073
|
+
symbol (Optional[str]):
|
|
2074
|
+
recv_window (Optional[int]):
|
|
2075
|
+
|
|
2076
|
+
Returns:
|
|
2077
|
+
ApiResponse[UmNotionalAndLeverageBracketsResponse]
|
|
2078
|
+
|
|
2079
|
+
Raises:
|
|
2080
|
+
RequiredError: If a required parameter is missing.
|
|
2081
|
+
|
|
2082
|
+
"""
|
|
2083
|
+
|
|
2084
|
+
payload = {"symbol": symbol, "recv_window": recv_window}
|
|
2085
|
+
|
|
2086
|
+
return send_request(
|
|
2087
|
+
self._session,
|
|
2088
|
+
self._configuration,
|
|
2089
|
+
method="GET",
|
|
2090
|
+
path="/papi/v1/um/leverageBracket",
|
|
2091
|
+
payload=payload,
|
|
2092
|
+
time_unit=self._configuration.time_unit,
|
|
2093
|
+
response_model=UmNotionalAndLeverageBracketsResponse,
|
|
2094
|
+
is_signed=True,
|
|
2095
|
+
signer=self._signer,
|
|
2096
|
+
)
|