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.

Files changed (204) hide show
  1. CHANGELOG.md +5 -0
  2. README.md +293 -0
  3. binance_sdk_derivatives_trading_portfolio_margin/__init__.py +39 -0
  4. binance_sdk_derivatives_trading_portfolio_margin/derivatives_trading_portfolio_margin.py +68 -0
  5. binance_sdk_derivatives_trading_portfolio_margin/metadata.py +1 -0
  6. binance_sdk_derivatives_trading_portfolio_margin/rest_api/__init__.py +13 -0
  7. binance_sdk_derivatives_trading_portfolio_margin/rest_api/api/__init__.py +14 -0
  8. binance_sdk_derivatives_trading_portfolio_margin/rest_api/api/account_api.py +2096 -0
  9. binance_sdk_derivatives_trading_portfolio_margin/rest_api/api/market_data_api.py +62 -0
  10. binance_sdk_derivatives_trading_portfolio_margin/rest_api/api/trade_api.py +3557 -0
  11. binance_sdk_derivatives_trading_portfolio_margin/rest_api/api/user_data_streams_api.py +132 -0
  12. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/__init__.py +550 -0
  13. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/account_balance_response.py +145 -0
  14. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/account_balance_response1.py +81 -0
  15. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/account_balance_response1_inner.py +164 -0
  16. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/account_balance_response2.py +159 -0
  17. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/account_information_response.py +145 -0
  18. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/bnb_transfer_response.py +102 -0
  19. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/cancel_all_cm_open_conditional_orders_response.py +103 -0
  20. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/cancel_all_cm_open_orders_response.py +103 -0
  21. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/cancel_all_um_open_conditional_orders_response.py +103 -0
  22. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/cancel_all_um_open_orders_response.py +103 -0
  23. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/cancel_cm_conditional_order_response.py +161 -0
  24. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/cancel_cm_order_response.py +156 -0
  25. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/cancel_margin_account_all_open_orders_on_a_symbol_response.py +83 -0
  26. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/cancel_margin_account_all_open_orders_on_a_symbol_response_inner.py +215 -0
  27. 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
  28. 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
  29. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/cancel_margin_account_oco_orders_response.py +174 -0
  30. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/cancel_margin_account_oco_orders_response_order_reports_inner.py +151 -0
  31. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/cancel_margin_account_oco_orders_response_orders_inner.py +110 -0
  32. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/cancel_margin_account_order_response.py +145 -0
  33. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/cancel_um_conditional_order_response.py +172 -0
  34. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/cancel_um_order_response.py +164 -0
  35. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/change_auto_repay_futures_status_response.py +102 -0
  36. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/change_cm_initial_leverage_response.py +110 -0
  37. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/change_cm_position_mode_response.py +103 -0
  38. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/change_um_initial_leverage_response.py +112 -0
  39. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/change_um_position_mode_response.py +103 -0
  40. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/cm_account_trade_list_response.py +81 -0
  41. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/cm_account_trade_list_response_inner.py +153 -0
  42. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/cm_notional_and_leverage_brackets_response.py +81 -0
  43. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/cm_notional_and_leverage_brackets_response_inner.py +129 -0
  44. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/cm_notional_and_leverage_brackets_response_inner_brackets_inner.py +125 -0
  45. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/cm_position_adl_quantile_estimation_response.py +83 -0
  46. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/cm_position_adl_quantile_estimation_response_inner.py +122 -0
  47. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/cm_position_adl_quantile_estimation_response_inner_adl_quantile.py +112 -0
  48. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/enums.py +278 -0
  49. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/fund_auto_collection_response.py +102 -0
  50. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/fund_collection_by_asset_response.py +102 -0
  51. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/get_auto_repay_futures_status_response.py +102 -0
  52. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/get_cm_account_detail_response.py +142 -0
  53. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/get_cm_account_detail_response_assets_inner.py +135 -0
  54. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/get_cm_account_detail_response_positions_inner.py +147 -0
  55. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/get_cm_current_position_mode_response.py +104 -0
  56. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/get_cm_income_history_response.py +81 -0
  57. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/get_cm_income_history_response_inner.py +129 -0
  58. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/get_download_id_for_um_futures_order_history_response.py +110 -0
  59. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/get_download_id_for_um_futures_trade_history_response.py +110 -0
  60. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/get_download_id_for_um_futures_transaction_history_response.py +110 -0
  61. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/get_margin_borrow_loan_interest_history_response.py +127 -0
  62. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/get_margin_borrow_loan_interest_history_response_rows_inner.py +131 -0
  63. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/get_um_account_detail_response.py +142 -0
  64. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/get_um_account_detail_response_positions_inner.py +153 -0
  65. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/get_um_account_detail_v2_response.py +142 -0
  66. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/get_um_account_detail_v2_response_assets_inner.py +135 -0
  67. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/get_um_account_detail_v2_response_positions_inner.py +131 -0
  68. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/get_um_current_position_mode_response.py +104 -0
  69. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/get_um_futures_bnb_burn_status_response.py +102 -0
  70. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/get_um_futures_order_download_link_by_id_response.py +128 -0
  71. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/get_um_futures_trade_download_link_by_id_response.py +128 -0
  72. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/get_um_futures_transaction_download_link_by_id_response.py +128 -0
  73. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/get_um_income_history_response.py +81 -0
  74. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/get_um_income_history_response_inner.py +129 -0
  75. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/get_user_commission_rate_for_cm_response.py +118 -0
  76. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/get_user_commission_rate_for_um_response.py +118 -0
  77. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/margin_account_borrow_response.py +102 -0
  78. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/margin_account_new_oco_response.py +182 -0
  79. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/margin_account_new_oco_response_order_reports_inner.py +149 -0
  80. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/margin_account_new_oco_response_orders_inner.py +110 -0
  81. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/margin_account_repay_debt_response.py +122 -0
  82. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/margin_account_repay_response.py +102 -0
  83. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/margin_account_trade_list_response.py +81 -0
  84. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/margin_account_trade_list_response_inner.py +138 -0
  85. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/margin_max_borrow_response.py +105 -0
  86. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/modify_cm_order_response.py +159 -0
  87. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/modify_um_order_response.py +167 -0
  88. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/new_cm_conditional_order_response.py +164 -0
  89. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/new_cm_order_response.py +156 -0
  90. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/new_margin_order_response.py +173 -0
  91. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/new_margin_order_response_fills_inner.py +117 -0
  92. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/new_um_conditional_order_response.py +172 -0
  93. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/new_um_order_response.py +164 -0
  94. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/portfolio_margin_um_trading_quantitative_rules_indicators_response.py +122 -0
  95. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/portfolio_margin_um_trading_quantitative_rules_indicators_response_indicators.py +154 -0
  96. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/portfolio_margin_um_trading_quantitative_rules_indicators_response_indicators_account_inner.py +124 -0
  97. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/portfolio_margin_um_trading_quantitative_rules_indicators_response_indicators_btcusdt_inner.py +134 -0
  98. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_all_cm_conditional_orders_response.py +81 -0
  99. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_all_cm_conditional_orders_response_inner.py +167 -0
  100. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_all_cm_orders_response.py +81 -0
  101. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_all_cm_orders_response_inner.py +159 -0
  102. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_all_current_cm_open_conditional_orders_response.py +83 -0
  103. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_all_current_cm_open_conditional_orders_response_inner.py +155 -0
  104. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_all_current_cm_open_orders_response.py +81 -0
  105. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_all_current_um_open_conditional_orders_response.py +83 -0
  106. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_all_current_um_open_conditional_orders_response_inner.py +166 -0
  107. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_all_current_um_open_orders_response.py +81 -0
  108. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_all_current_um_open_orders_response_inner.py +167 -0
  109. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_all_margin_account_orders_response.py +81 -0
  110. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_all_margin_account_orders_response_inner.py +173 -0
  111. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_all_um_conditional_orders_response.py +81 -0
  112. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_all_um_conditional_orders_response_inner.py +178 -0
  113. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_all_um_orders_response.py +81 -0
  114. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_cm_conditional_order_history_response.py +176 -0
  115. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_cm_modify_order_history_response.py +81 -0
  116. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_cm_modify_order_history_response_inner.py +138 -0
  117. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_cm_modify_order_history_response_inner_amendment.py +136 -0
  118. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_cm_modify_order_history_response_inner_amendment_orig_qty.py +105 -0
  119. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_cm_modify_order_history_response_inner_amendment_price.py +105 -0
  120. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_cm_order_response.py +159 -0
  121. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_cm_position_information_response.py +81 -0
  122. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_cm_position_information_response_inner.py +142 -0
  123. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_current_cm_open_conditional_order_response.py +155 -0
  124. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_current_cm_open_order_response.py +159 -0
  125. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_current_margin_open_order_response.py +81 -0
  126. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_current_margin_open_order_response_inner.py +173 -0
  127. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_current_um_open_conditional_order_response.py +166 -0
  128. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_current_um_open_order_response.py +167 -0
  129. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_margin_account_order_response.py +173 -0
  130. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_margin_accounts_all_oco_response.py +81 -0
  131. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_margin_accounts_all_oco_response_inner.py +152 -0
  132. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_margin_accounts_all_oco_response_inner_orders_inner.py +110 -0
  133. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_margin_accounts_oco_response.py +150 -0
  134. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_margin_accounts_oco_response_orders_inner.py +110 -0
  135. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_margin_accounts_open_oco_response.py +81 -0
  136. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_margin_accounts_open_oco_response_inner.py +152 -0
  137. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_margin_accounts_open_oco_response_inner_orders_inner.py +110 -0
  138. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_margin_loan_record_response.py +125 -0
  139. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_margin_loan_record_response_rows_inner.py +120 -0
  140. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_margin_max_withdraw_response.py +102 -0
  141. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_margin_repay_record_response.py +125 -0
  142. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_margin_repay_record_response_rows_inner.py +126 -0
  143. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_portfolio_margin_negative_balance_interest_history_response.py +83 -0
  144. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_portfolio_margin_negative_balance_interest_history_response_inner.py +122 -0
  145. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_um_conditional_order_history_response.py +181 -0
  146. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_um_modify_order_history_response.py +81 -0
  147. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_um_modify_order_history_response_inner.py +141 -0
  148. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_um_order_response.py +167 -0
  149. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_um_position_information_response.py +81 -0
  150. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_um_position_information_response_inner.py +144 -0
  151. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_user_negative_balance_auto_exchange_record_response.py +129 -0
  152. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_user_negative_balance_auto_exchange_record_response_rows_inner.py +131 -0
  153. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_user_negative_balance_auto_exchange_record_response_rows_inner_details_inner.py +120 -0
  154. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_user_rate_limit_response.py +81 -0
  155. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_user_rate_limit_response_inner.py +117 -0
  156. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_users_cm_force_orders_response.py +81 -0
  157. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_users_cm_force_orders_response_inner.py +159 -0
  158. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_users_margin_force_orders_response.py +125 -0
  159. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_users_margin_force_orders_response_rows_inner.py +132 -0
  160. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_users_um_force_orders_response.py +81 -0
  161. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/query_users_um_force_orders_response_inner.py +156 -0
  162. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/repay_futures_negative_balance_response.py +102 -0
  163. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/start_user_data_stream_response.py +102 -0
  164. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/toggle_bnb_burn_on_um_futures_trade_response.py +103 -0
  165. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/um_account_trade_list_response.py +81 -0
  166. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/um_account_trade_list_response_inner.py +147 -0
  167. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/um_futures_account_configuration_response.py +133 -0
  168. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/um_futures_symbol_configuration_response.py +81 -0
  169. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/um_futures_symbol_configuration_response_inner.py +124 -0
  170. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/um_notional_and_leverage_brackets_response.py +81 -0
  171. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/um_notional_and_leverage_brackets_response_inner.py +131 -0
  172. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/um_notional_and_leverage_brackets_response_inner_brackets_inner.py +125 -0
  173. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/um_position_adl_quantile_estimation_response.py +83 -0
  174. binance_sdk_derivatives_trading_portfolio_margin/rest_api/models/um_position_adl_quantile_estimation_response_inner.py +122 -0
  175. binance_sdk_derivatives_trading_portfolio_margin/rest_api/rest_api.py +3837 -0
  176. binance_sdk_derivatives_trading_portfolio_margin/websocket_streams/__init__.py +13 -0
  177. binance_sdk_derivatives_trading_portfolio_margin/websocket_streams/models/__init__.py +38 -0
  178. binance_sdk_derivatives_trading_portfolio_margin/websocket_streams/models/account_config_update.py +118 -0
  179. binance_sdk_derivatives_trading_portfolio_margin/websocket_streams/models/account_config_update_ac.py +99 -0
  180. binance_sdk_derivatives_trading_portfolio_margin/websocket_streams/models/account_update.py +120 -0
  181. binance_sdk_derivatives_trading_portfolio_margin/websocket_streams/models/account_update_a.py +134 -0
  182. binance_sdk_derivatives_trading_portfolio_margin/websocket_streams/models/account_update_ab_inner.py +108 -0
  183. binance_sdk_derivatives_trading_portfolio_margin/websocket_streams/models/account_update_ap_inner.py +114 -0
  184. binance_sdk_derivatives_trading_portfolio_margin/websocket_streams/models/balanceupdate.py +110 -0
  185. binance_sdk_derivatives_trading_portfolio_margin/websocket_streams/models/conditional_order_trade_update.py +118 -0
  186. binance_sdk_derivatives_trading_portfolio_margin/websocket_streams/models/conditional_order_trade_update_so.py +164 -0
  187. binance_sdk_derivatives_trading_portfolio_margin/websocket_streams/models/enums.py +9 -0
  188. binance_sdk_derivatives_trading_portfolio_margin/websocket_streams/models/executionreport.py +227 -0
  189. binance_sdk_derivatives_trading_portfolio_margin/websocket_streams/models/liabilitychange.py +114 -0
  190. binance_sdk_derivatives_trading_portfolio_margin/websocket_streams/models/listenkeyexpired.py +98 -0
  191. binance_sdk_derivatives_trading_portfolio_margin/websocket_streams/models/openorderloss.py +118 -0
  192. binance_sdk_derivatives_trading_portfolio_margin/websocket_streams/models/openorderloss_o_inner.py +99 -0
  193. binance_sdk_derivatives_trading_portfolio_margin/websocket_streams/models/order_trade_update.py +120 -0
  194. binance_sdk_derivatives_trading_portfolio_margin/websocket_streams/models/order_trade_update_o.py +188 -0
  195. binance_sdk_derivatives_trading_portfolio_margin/websocket_streams/models/outboundaccountposition.py +125 -0
  196. binance_sdk_derivatives_trading_portfolio_margin/websocket_streams/models/outboundaccountposition_b_inner.py +102 -0
  197. binance_sdk_derivatives_trading_portfolio_margin/websocket_streams/models/risklevelchange.py +112 -0
  198. binance_sdk_derivatives_trading_portfolio_margin/websocket_streams/models/user_data_stream_events_response.py +386 -0
  199. binance_sdk_derivatives_trading_portfolio_margin/websocket_streams/streams/__init__.py +9 -0
  200. binance_sdk_derivatives_trading_portfolio_margin/websocket_streams/websocket_streams.py +105 -0
  201. binance_sdk_derivatives_trading_portfolio_margin-1.0.0.dist-info/LICENCE +21 -0
  202. binance_sdk_derivatives_trading_portfolio_margin-1.0.0.dist-info/METADATA +321 -0
  203. binance_sdk_derivatives_trading_portfolio_margin-1.0.0.dist-info/RECORD +204 -0
  204. binance_sdk_derivatives_trading_portfolio_margin-1.0.0.dist-info/WHEEL +4 -0
@@ -0,0 +1,3837 @@
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
+ import requests
12
+ from typing import Optional, TypeVar
13
+ from binance_common.configuration import ConfigurationRestAPI
14
+ from binance_common.models import ApiResponse
15
+ from binance_common.signature import Signers
16
+ from binance_common.utils import send_request
17
+ from .api.account_api import AccountApi
18
+ from .api.market_data_api import MarketDataApi
19
+ from .api.trade_api import TradeApi
20
+ from .api.user_data_streams_api import UserDataStreamsApi
21
+
22
+ from .models import AccountBalanceResponse
23
+ from .models import AccountInformationResponse
24
+ from .models import BnbTransferResponse
25
+ from .models import ChangeAutoRepayFuturesStatusResponse
26
+ from .models import ChangeCmInitialLeverageResponse
27
+ from .models import ChangeCmPositionModeResponse
28
+ from .models import ChangeUmInitialLeverageResponse
29
+ from .models import ChangeUmPositionModeResponse
30
+ from .models import CmNotionalAndLeverageBracketsResponse
31
+ from .models import FundAutoCollectionResponse
32
+ from .models import FundCollectionByAssetResponse
33
+ from .models import GetAutoRepayFuturesStatusResponse
34
+ from .models import GetCmAccountDetailResponse
35
+ from .models import GetCmCurrentPositionModeResponse
36
+ from .models import GetCmIncomeHistoryResponse
37
+ from .models import GetDownloadIdForUmFuturesOrderHistoryResponse
38
+ from .models import GetDownloadIdForUmFuturesTradeHistoryResponse
39
+ from .models import GetDownloadIdForUmFuturesTransactionHistoryResponse
40
+ from .models import GetMarginBorrowLoanInterestHistoryResponse
41
+ from .models import GetUmAccountDetailResponse
42
+ from .models import GetUmAccountDetailV2Response
43
+ from .models import GetUmCurrentPositionModeResponse
44
+ from .models import GetUmFuturesOrderDownloadLinkByIdResponse
45
+ from .models import GetUmFuturesTradeDownloadLinkByIdResponse
46
+ from .models import GetUmFuturesTransactionDownloadLinkByIdResponse
47
+ from .models import GetUmIncomeHistoryResponse
48
+ from .models import GetUserCommissionRateForCmResponse
49
+ from .models import GetUserCommissionRateForUmResponse
50
+ from .models import MarginMaxBorrowResponse
51
+ from .models import PortfolioMarginUmTradingQuantitativeRulesIndicatorsResponse
52
+ from .models import QueryCmPositionInformationResponse
53
+ from .models import QueryMarginLoanRecordResponse
54
+ from .models import QueryMarginMaxWithdrawResponse
55
+ from .models import QueryMarginRepayRecordResponse
56
+ from .models import QueryPortfolioMarginNegativeBalanceInterestHistoryResponse
57
+ from .models import QueryUmPositionInformationResponse
58
+ from .models import QueryUserNegativeBalanceAutoExchangeRecordResponse
59
+ from .models import QueryUserRateLimitResponse
60
+ from .models import RepayFuturesNegativeBalanceResponse
61
+ from .models import UmFuturesAccountConfigurationResponse
62
+ from .models import UmFuturesSymbolConfigurationResponse
63
+ from .models import UmNotionalAndLeverageBracketsResponse
64
+
65
+ from .models import CancelAllCmOpenConditionalOrdersResponse
66
+ from .models import CancelAllCmOpenOrdersResponse
67
+ from .models import CancelAllUmOpenConditionalOrdersResponse
68
+ from .models import CancelAllUmOpenOrdersResponse
69
+ from .models import CancelCmConditionalOrderResponse
70
+ from .models import CancelCmOrderResponse
71
+ from .models import CancelMarginAccountAllOpenOrdersOnASymbolResponse
72
+ from .models import CancelMarginAccountOcoOrdersResponse
73
+ from .models import CancelMarginAccountOrderResponse
74
+ from .models import CancelUmConditionalOrderResponse
75
+ from .models import CancelUmOrderResponse
76
+ from .models import CmAccountTradeListResponse
77
+ from .models import CmPositionAdlQuantileEstimationResponse
78
+ from .models import GetUmFuturesBnbBurnStatusResponse
79
+ from .models import MarginAccountBorrowResponse
80
+ from .models import MarginAccountNewOcoResponse
81
+ from .models import MarginAccountRepayResponse
82
+ from .models import MarginAccountRepayDebtResponse
83
+ from .models import MarginAccountTradeListResponse
84
+ from .models import ModifyCmOrderResponse
85
+ from .models import ModifyUmOrderResponse
86
+ from .models import NewCmConditionalOrderResponse
87
+ from .models import NewCmOrderResponse
88
+ from .models import NewMarginOrderResponse
89
+ from .models import NewUmConditionalOrderResponse
90
+ from .models import NewUmOrderResponse
91
+ from .models import QueryAllCmConditionalOrdersResponse
92
+ from .models import QueryAllCmOrdersResponse
93
+ from .models import QueryAllCurrentCmOpenConditionalOrdersResponse
94
+ from .models import QueryAllCurrentCmOpenOrdersResponse
95
+ from .models import QueryAllCurrentUmOpenConditionalOrdersResponse
96
+ from .models import QueryAllCurrentUmOpenOrdersResponse
97
+ from .models import QueryAllMarginAccountOrdersResponse
98
+ from .models import QueryAllUmConditionalOrdersResponse
99
+ from .models import QueryAllUmOrdersResponse
100
+ from .models import QueryCmConditionalOrderHistoryResponse
101
+ from .models import QueryCmModifyOrderHistoryResponse
102
+ from .models import QueryCmOrderResponse
103
+ from .models import QueryCurrentCmOpenConditionalOrderResponse
104
+ from .models import QueryCurrentCmOpenOrderResponse
105
+ from .models import QueryCurrentMarginOpenOrderResponse
106
+ from .models import QueryCurrentUmOpenConditionalOrderResponse
107
+ from .models import QueryCurrentUmOpenOrderResponse
108
+ from .models import QueryMarginAccountOrderResponse
109
+ from .models import QueryMarginAccountsAllOcoResponse
110
+ from .models import QueryMarginAccountsOcoResponse
111
+ from .models import QueryMarginAccountsOpenOcoResponse
112
+ from .models import QueryUmConditionalOrderHistoryResponse
113
+ from .models import QueryUmModifyOrderHistoryResponse
114
+ from .models import QueryUmOrderResponse
115
+ from .models import QueryUsersCmForceOrdersResponse
116
+ from .models import QueryUsersMarginForceOrdersResponse
117
+ from .models import QueryUsersUmForceOrdersResponse
118
+ from .models import ToggleBnbBurnOnUmFuturesTradeResponse
119
+ from .models import UmAccountTradeListResponse
120
+ from .models import UmPositionAdlQuantileEstimationResponse
121
+
122
+
123
+ from .models import StartUserDataStreamResponse
124
+
125
+
126
+ from .models import MarginAccountNewOcoSideEnum
127
+ from .models import MarginAccountNewOcoStopLimitTimeInForceEnum
128
+ from .models import MarginAccountNewOcoNewOrderRespTypeEnum
129
+ from .models import MarginAccountNewOcoSideEffectTypeEnum
130
+ from .models import ModifyCmOrderSideEnum
131
+ from .models import ModifyCmOrderPriceMatchEnum
132
+ from .models import ModifyUmOrderSideEnum
133
+ from .models import ModifyUmOrderPriceMatchEnum
134
+ from .models import NewCmConditionalOrderSideEnum
135
+ from .models import NewCmConditionalOrderStrategyTypeEnum
136
+ from .models import NewCmConditionalOrderPositionSideEnum
137
+ from .models import NewCmConditionalOrderTimeInForceEnum
138
+ from .models import NewCmConditionalOrderWorkingTypeEnum
139
+ from .models import NewCmOrderSideEnum
140
+ from .models import NewCmOrderTypeEnum
141
+ from .models import NewCmOrderPositionSideEnum
142
+ from .models import NewCmOrderTimeInForceEnum
143
+ from .models import NewCmOrderPriceMatchEnum
144
+ from .models import NewCmOrderNewOrderRespTypeEnum
145
+ from .models import NewMarginOrderSideEnum
146
+ from .models import NewMarginOrderTypeEnum
147
+ from .models import NewMarginOrderNewOrderRespTypeEnum
148
+ from .models import NewMarginOrderSideEffectTypeEnum
149
+ from .models import NewMarginOrderTimeInForceEnum
150
+ from .models import NewMarginOrderSelfTradePreventionModeEnum
151
+ from .models import NewUmConditionalOrderSideEnum
152
+ from .models import NewUmConditionalOrderStrategyTypeEnum
153
+ from .models import NewUmConditionalOrderPositionSideEnum
154
+ from .models import NewUmConditionalOrderTimeInForceEnum
155
+ from .models import NewUmConditionalOrderWorkingTypeEnum
156
+ from .models import NewUmConditionalOrderPriceMatchEnum
157
+ from .models import NewUmConditionalOrderSelfTradePreventionModeEnum
158
+ from .models import NewUmOrderSideEnum
159
+ from .models import NewUmOrderTypeEnum
160
+ from .models import NewUmOrderPositionSideEnum
161
+ from .models import NewUmOrderTimeInForceEnum
162
+ from .models import NewUmOrderNewOrderRespTypeEnum
163
+ from .models import NewUmOrderPriceMatchEnum
164
+ from .models import NewUmOrderSelfTradePreventionModeEnum
165
+ from .models import QueryUsersCmForceOrdersAutoCloseTypeEnum
166
+ from .models import QueryUsersUmForceOrdersAutoCloseTypeEnum
167
+
168
+
169
+ T = TypeVar("T")
170
+
171
+
172
+ class DerivativesTradingPortfolioMarginRestAPI:
173
+ def __init__(
174
+ self,
175
+ configuration: ConfigurationRestAPI,
176
+ ) -> None:
177
+ self.configuration = configuration
178
+ self._session = requests.Session()
179
+ self._signer = (
180
+ Signers.get_signer(
181
+ configuration.private_key, configuration.private_key_passphrase
182
+ )
183
+ if configuration.private_key is not None
184
+ else None
185
+ )
186
+
187
+ self._accountApi = AccountApi(self.configuration, self._session, self._signer)
188
+ self._marketDataApi = MarketDataApi(
189
+ self.configuration, self._session, self._signer
190
+ )
191
+ self._tradeApi = TradeApi(self.configuration, self._session, self._signer)
192
+ self._userDataStreamsApi = UserDataStreamsApi(
193
+ self.configuration, self._session, self._signer
194
+ )
195
+
196
+ def send_request(
197
+ self, endpoint: str, method: str, params: Optional[dict] = None
198
+ ) -> ApiResponse[T]:
199
+ """
200
+ Sends an request to the Binance REST API.
201
+
202
+ Args:
203
+ endpoint (str): The API endpoint path to send the request to.
204
+ method (str): The HTTP method to use for the request (e.g. "GET", "POST", "PUT", "DELETE").
205
+ params (Optional[dict]): The request payload as a dictionary, or None if no payload is required.
206
+
207
+ Returns:
208
+ ApiResponse[T]: The API response, where T is the expected response type.
209
+ """
210
+ return send_request[T](
211
+ self._session, self.configuration, method, endpoint, params
212
+ )
213
+
214
+ def send_signed_request(
215
+ self, endpoint: str, method: str, params: Optional[dict] = None
216
+ ) -> ApiResponse[T]:
217
+ """
218
+ Sends a signed request to the Binance REST API.
219
+
220
+ Args:
221
+ endpoint (str): The API endpoint path to send the request to.
222
+ method (str): The HTTP method to use for the request (e.g. "GET", "POST", "PUT", "DELETE").
223
+ params (Optional[dict]): The request payload as a dictionary, or None if no payload is required.
224
+
225
+ Returns:
226
+ ApiResponse[T]: The API response, where T is the expected response type.
227
+ """
228
+ return send_request[T](
229
+ self._session,
230
+ self.configuration,
231
+ method,
232
+ endpoint,
233
+ params,
234
+ is_signed=True,
235
+ signer=self._signer,
236
+ )
237
+
238
+ def account_balance(
239
+ self,
240
+ asset: Optional[str] = None,
241
+ recv_window: Optional[int] = None,
242
+ ) -> ApiResponse[AccountBalanceResponse]:
243
+ """
244
+ Account Balance(USER_DATA)
245
+
246
+ Query account balance
247
+
248
+ Weight: 20
249
+
250
+ Args:
251
+ asset (Optional[str]):
252
+ recv_window (Optional[int]):
253
+
254
+ Returns:
255
+ ApiResponse[AccountBalanceResponse]
256
+
257
+ Raises:
258
+ RequiredError: If a required parameter is missing.
259
+
260
+ """
261
+
262
+ return self._accountApi.account_balance(asset, recv_window)
263
+
264
+ def account_information(
265
+ self,
266
+ recv_window: Optional[int] = None,
267
+ ) -> ApiResponse[AccountInformationResponse]:
268
+ """
269
+ Account Information(USER_DATA)
270
+
271
+ Query account information
272
+
273
+ Weight: 20
274
+
275
+ Args:
276
+ recv_window (Optional[int]):
277
+
278
+ Returns:
279
+ ApiResponse[AccountInformationResponse]
280
+
281
+ Raises:
282
+ RequiredError: If a required parameter is missing.
283
+
284
+ """
285
+
286
+ return self._accountApi.account_information(recv_window)
287
+
288
+ def bnb_transfer(
289
+ self,
290
+ amount: float = None,
291
+ transfer_side: str = None,
292
+ recv_window: Optional[int] = None,
293
+ ) -> ApiResponse[BnbTransferResponse]:
294
+ """
295
+ BNB transfer (TRADE)
296
+
297
+ Transfer BNB in and out of UM
298
+
299
+ * The endpoint can only be called 10 times per 10 minutes in a rolling manner
300
+
301
+ Weight: 750
302
+
303
+ Args:
304
+ amount (float):
305
+ transfer_side (str): "TO_UM","FROM_UM"
306
+ recv_window (Optional[int]):
307
+
308
+ Returns:
309
+ ApiResponse[BnbTransferResponse]
310
+
311
+ Raises:
312
+ RequiredError: If a required parameter is missing.
313
+
314
+ """
315
+
316
+ return self._accountApi.bnb_transfer(amount, transfer_side, recv_window)
317
+
318
+ def change_auto_repay_futures_status(
319
+ self,
320
+ auto_repay: str = None,
321
+ recv_window: Optional[int] = None,
322
+ ) -> ApiResponse[ChangeAutoRepayFuturesStatusResponse]:
323
+ """
324
+ Change Auto-repay-futures Status(TRADE)
325
+
326
+ Change Auto-repay-futures Status
327
+
328
+ Weight: 750
329
+
330
+ Args:
331
+ auto_repay (str): Default: `true`; `false` for turn off the auto-repay futures negative balance function
332
+ recv_window (Optional[int]):
333
+
334
+ Returns:
335
+ ApiResponse[ChangeAutoRepayFuturesStatusResponse]
336
+
337
+ Raises:
338
+ RequiredError: If a required parameter is missing.
339
+
340
+ """
341
+
342
+ return self._accountApi.change_auto_repay_futures_status(
343
+ auto_repay, recv_window
344
+ )
345
+
346
+ def change_cm_initial_leverage(
347
+ self,
348
+ symbol: str = None,
349
+ leverage: int = None,
350
+ recv_window: Optional[int] = None,
351
+ ) -> ApiResponse[ChangeCmInitialLeverageResponse]:
352
+ """
353
+ Change CM Initial Leverage (TRADE)
354
+
355
+ Change user's initial leverage of specific symbol in CM.
356
+
357
+ Weight: 1
358
+
359
+ Args:
360
+ symbol (str):
361
+ leverage (int): target initial leverage: int from 1 to 125
362
+ recv_window (Optional[int]):
363
+
364
+ Returns:
365
+ ApiResponse[ChangeCmInitialLeverageResponse]
366
+
367
+ Raises:
368
+ RequiredError: If a required parameter is missing.
369
+
370
+ """
371
+
372
+ return self._accountApi.change_cm_initial_leverage(
373
+ symbol, leverage, recv_window
374
+ )
375
+
376
+ def change_cm_position_mode(
377
+ self,
378
+ dual_side_position: str = None,
379
+ recv_window: Optional[int] = None,
380
+ ) -> ApiResponse[ChangeCmPositionModeResponse]:
381
+ """
382
+ Change CM Position Mode(TRADE)
383
+
384
+ Change user's position mode (Hedge Mode or One-way Mode ) on EVERY symbol in CM
385
+
386
+ Weight: 1
387
+
388
+ Args:
389
+ dual_side_position (str): "true": Hedge Mode; "false": One-way Mode
390
+ recv_window (Optional[int]):
391
+
392
+ Returns:
393
+ ApiResponse[ChangeCmPositionModeResponse]
394
+
395
+ Raises:
396
+ RequiredError: If a required parameter is missing.
397
+
398
+ """
399
+
400
+ return self._accountApi.change_cm_position_mode(dual_side_position, recv_window)
401
+
402
+ def change_um_initial_leverage(
403
+ self,
404
+ symbol: str = None,
405
+ leverage: int = None,
406
+ recv_window: Optional[int] = None,
407
+ ) -> ApiResponse[ChangeUmInitialLeverageResponse]:
408
+ """
409
+ Change UM Initial Leverage(TRADE)
410
+
411
+ Change user's initial leverage of specific symbol in UM.
412
+
413
+ Weight: 1
414
+
415
+ Args:
416
+ symbol (str):
417
+ leverage (int): target initial leverage: int from 1 to 125
418
+ recv_window (Optional[int]):
419
+
420
+ Returns:
421
+ ApiResponse[ChangeUmInitialLeverageResponse]
422
+
423
+ Raises:
424
+ RequiredError: If a required parameter is missing.
425
+
426
+ """
427
+
428
+ return self._accountApi.change_um_initial_leverage(
429
+ symbol, leverage, recv_window
430
+ )
431
+
432
+ def change_um_position_mode(
433
+ self,
434
+ dual_side_position: str = None,
435
+ recv_window: Optional[int] = None,
436
+ ) -> ApiResponse[ChangeUmPositionModeResponse]:
437
+ """
438
+ Change UM Position Mode(TRADE)
439
+
440
+ Change user's position mode (Hedge Mode or One-way Mode ) on EVERY symbol in UM
441
+
442
+ Weight: 1
443
+
444
+ Args:
445
+ dual_side_position (str): "true": Hedge Mode; "false": One-way Mode
446
+ recv_window (Optional[int]):
447
+
448
+ Returns:
449
+ ApiResponse[ChangeUmPositionModeResponse]
450
+
451
+ Raises:
452
+ RequiredError: If a required parameter is missing.
453
+
454
+ """
455
+
456
+ return self._accountApi.change_um_position_mode(dual_side_position, recv_window)
457
+
458
+ def cm_notional_and_leverage_brackets(
459
+ self,
460
+ symbol: Optional[str] = None,
461
+ recv_window: Optional[int] = None,
462
+ ) -> ApiResponse[CmNotionalAndLeverageBracketsResponse]:
463
+ """
464
+ CM Notional and Leverage Brackets(USER_DATA)
465
+
466
+ Query CM notional and leverage brackets
467
+
468
+ Weight: 1
469
+
470
+ Args:
471
+ symbol (Optional[str]):
472
+ recv_window (Optional[int]):
473
+
474
+ Returns:
475
+ ApiResponse[CmNotionalAndLeverageBracketsResponse]
476
+
477
+ Raises:
478
+ RequiredError: If a required parameter is missing.
479
+
480
+ """
481
+
482
+ return self._accountApi.cm_notional_and_leverage_brackets(symbol, recv_window)
483
+
484
+ def fund_auto_collection(
485
+ self,
486
+ recv_window: Optional[int] = None,
487
+ ) -> ApiResponse[FundAutoCollectionResponse]:
488
+ """
489
+ Fund Auto-collection(TRADE)
490
+
491
+ Fund collection for Portfolio Margin
492
+
493
+ * The BNB would not be collected from UM-PM account to the Portfolio Margin account.
494
+ * You can only use this function 500 times per hour in a rolling manner.
495
+
496
+ Weight: 750
497
+
498
+ Args:
499
+ recv_window (Optional[int]):
500
+
501
+ Returns:
502
+ ApiResponse[FundAutoCollectionResponse]
503
+
504
+ Raises:
505
+ RequiredError: If a required parameter is missing.
506
+
507
+ """
508
+
509
+ return self._accountApi.fund_auto_collection(recv_window)
510
+
511
+ def fund_collection_by_asset(
512
+ self,
513
+ asset: str = None,
514
+ recv_window: Optional[int] = None,
515
+ ) -> ApiResponse[FundCollectionByAssetResponse]:
516
+ """
517
+ Fund Collection by Asset(TRADE)
518
+
519
+ Transfers specific asset from Futures Account to Margin account
520
+
521
+ * The BNB transfer is not be supported
522
+
523
+ Weight: 30
524
+
525
+ Args:
526
+ asset (str):
527
+ recv_window (Optional[int]):
528
+
529
+ Returns:
530
+ ApiResponse[FundCollectionByAssetResponse]
531
+
532
+ Raises:
533
+ RequiredError: If a required parameter is missing.
534
+
535
+ """
536
+
537
+ return self._accountApi.fund_collection_by_asset(asset, recv_window)
538
+
539
+ def get_auto_repay_futures_status(
540
+ self,
541
+ recv_window: Optional[int] = None,
542
+ ) -> ApiResponse[GetAutoRepayFuturesStatusResponse]:
543
+ """
544
+ Get Auto-repay-futures Status(USER_DATA)
545
+
546
+ Query Auto-repay-futures Status
547
+
548
+ Weight: 30
549
+
550
+ Args:
551
+ recv_window (Optional[int]):
552
+
553
+ Returns:
554
+ ApiResponse[GetAutoRepayFuturesStatusResponse]
555
+
556
+ Raises:
557
+ RequiredError: If a required parameter is missing.
558
+
559
+ """
560
+
561
+ return self._accountApi.get_auto_repay_futures_status(recv_window)
562
+
563
+ def get_cm_account_detail(
564
+ self,
565
+ recv_window: Optional[int] = None,
566
+ ) -> ApiResponse[GetCmAccountDetailResponse]:
567
+ """
568
+ Get CM Account Detail(USER_DATA)
569
+
570
+ Get current CM account asset and position information.
571
+
572
+ Weight: 5
573
+
574
+ Args:
575
+ recv_window (Optional[int]):
576
+
577
+ Returns:
578
+ ApiResponse[GetCmAccountDetailResponse]
579
+
580
+ Raises:
581
+ RequiredError: If a required parameter is missing.
582
+
583
+ """
584
+
585
+ return self._accountApi.get_cm_account_detail(recv_window)
586
+
587
+ def get_cm_current_position_mode(
588
+ self,
589
+ recv_window: Optional[int] = None,
590
+ ) -> ApiResponse[GetCmCurrentPositionModeResponse]:
591
+ """
592
+ Get CM Current Position Mode(USER_DATA)
593
+
594
+ Get user's position mode (Hedge Mode or One-way Mode ) on EVERY symbol in CM
595
+
596
+ Weight: 30
597
+
598
+ Args:
599
+ recv_window (Optional[int]):
600
+
601
+ Returns:
602
+ ApiResponse[GetCmCurrentPositionModeResponse]
603
+
604
+ Raises:
605
+ RequiredError: If a required parameter is missing.
606
+
607
+ """
608
+
609
+ return self._accountApi.get_cm_current_position_mode(recv_window)
610
+
611
+ def get_cm_income_history(
612
+ self,
613
+ symbol: Optional[str] = None,
614
+ income_type: Optional[str] = None,
615
+ start_time: Optional[int] = None,
616
+ end_time: Optional[int] = None,
617
+ page: Optional[int] = None,
618
+ limit: Optional[int] = None,
619
+ recv_window: Optional[int] = None,
620
+ ) -> ApiResponse[GetCmIncomeHistoryResponse]:
621
+ """
622
+ Get CM Income History(USER_DATA)
623
+
624
+ Get CM Income History
625
+
626
+
627
+ * If `incomeType` is not sent, all kinds of flow will be returned
628
+ * "trandId" is unique in the same "incomeType" for a user
629
+ * The interval between `startTime` and `endTime` can not exceed 200 days:
630
+ * If `startTime` and `endTime` are not sent, the last 200 days will be returned
631
+
632
+ Weight: 30
633
+
634
+ Args:
635
+ symbol (Optional[str]):
636
+ 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
637
+ start_time (Optional[int]): Timestamp in ms to get funding from INCLUSIVE.
638
+ end_time (Optional[int]): Timestamp in ms to get funding until INCLUSIVE.
639
+ page (Optional[int]):
640
+ limit (Optional[int]): Default 100; max 1000
641
+ recv_window (Optional[int]):
642
+
643
+ Returns:
644
+ ApiResponse[GetCmIncomeHistoryResponse]
645
+
646
+ Raises:
647
+ RequiredError: If a required parameter is missing.
648
+
649
+ """
650
+
651
+ return self._accountApi.get_cm_income_history(
652
+ symbol, income_type, start_time, end_time, page, limit, recv_window
653
+ )
654
+
655
+ def get_download_id_for_um_futures_order_history(
656
+ self,
657
+ start_time: int = None,
658
+ end_time: int = None,
659
+ recv_window: Optional[int] = None,
660
+ ) -> ApiResponse[GetDownloadIdForUmFuturesOrderHistoryResponse]:
661
+ """
662
+ Get Download Id For UM Futures Order History (USER_DATA)
663
+
664
+ Get download id for UM futures order history
665
+
666
+ * Request Limitation is 10 times per month, shared by front end download page and rest api
667
+ * The time between `startTime` and `endTime` can not be longer than 1 year
668
+
669
+ Weight: 1500
670
+
671
+ Args:
672
+ start_time (int):
673
+ end_time (int):
674
+ recv_window (Optional[int]):
675
+
676
+ Returns:
677
+ ApiResponse[GetDownloadIdForUmFuturesOrderHistoryResponse]
678
+
679
+ Raises:
680
+ RequiredError: If a required parameter is missing.
681
+
682
+ """
683
+
684
+ return self._accountApi.get_download_id_for_um_futures_order_history(
685
+ start_time, end_time, recv_window
686
+ )
687
+
688
+ def get_download_id_for_um_futures_trade_history(
689
+ self,
690
+ start_time: int = None,
691
+ end_time: int = None,
692
+ recv_window: Optional[int] = None,
693
+ ) -> ApiResponse[GetDownloadIdForUmFuturesTradeHistoryResponse]:
694
+ """
695
+ Get Download Id For UM Futures Trade History (USER_DATA)
696
+
697
+ Get download id for UM futures trade history
698
+
699
+ * Request Limitation is 5 times per month, shared by front end download page and rest api
700
+ * The time between `startTime` and `endTime` can not be longer than 1 year
701
+
702
+ Weight: 1500
703
+
704
+ Args:
705
+ start_time (int):
706
+ end_time (int):
707
+ recv_window (Optional[int]):
708
+
709
+ Returns:
710
+ ApiResponse[GetDownloadIdForUmFuturesTradeHistoryResponse]
711
+
712
+ Raises:
713
+ RequiredError: If a required parameter is missing.
714
+
715
+ """
716
+
717
+ return self._accountApi.get_download_id_for_um_futures_trade_history(
718
+ start_time, end_time, recv_window
719
+ )
720
+
721
+ def get_download_id_for_um_futures_transaction_history(
722
+ self,
723
+ start_time: int = None,
724
+ end_time: int = None,
725
+ recv_window: Optional[int] = None,
726
+ ) -> ApiResponse[GetDownloadIdForUmFuturesTransactionHistoryResponse]:
727
+ """
728
+ Get Download Id For UM Futures Transaction History (USER_DATA)
729
+
730
+ Get download id for UM futures transaction history
731
+
732
+ * Request Limitation is 5 times per month, shared by front end download page and rest api
733
+ * The time between `startTime` and `endTime` can not be longer than 1 year
734
+
735
+ Weight: 1500
736
+
737
+ Args:
738
+ start_time (int):
739
+ end_time (int):
740
+ recv_window (Optional[int]):
741
+
742
+ Returns:
743
+ ApiResponse[GetDownloadIdForUmFuturesTransactionHistoryResponse]
744
+
745
+ Raises:
746
+ RequiredError: If a required parameter is missing.
747
+
748
+ """
749
+
750
+ return self._accountApi.get_download_id_for_um_futures_transaction_history(
751
+ start_time, end_time, recv_window
752
+ )
753
+
754
+ def get_margin_borrow_loan_interest_history(
755
+ self,
756
+ asset: Optional[str] = None,
757
+ start_time: Optional[int] = None,
758
+ end_time: Optional[int] = None,
759
+ current: Optional[int] = None,
760
+ size: Optional[int] = None,
761
+ archived: Optional[str] = None,
762
+ recv_window: Optional[int] = None,
763
+ ) -> ApiResponse[GetMarginBorrowLoanInterestHistoryResponse]:
764
+ """
765
+ Get Margin Borrow/Loan Interest History(USER_DATA)
766
+
767
+ Get Margin Borrow/Loan Interest History
768
+
769
+
770
+ * Response in descending order
771
+ * The max interval between startTime and endTime is 30 days. It is a MUST to ensure data correctness.
772
+ * If `startTime` and `endTime` not sent, return records of the last 7 days by default
773
+ * 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.
774
+ * If `startTime` is not sent and `endTime` is sent, the records of the 7 days before `endTime` is returned.
775
+ * Type in response has 5 enums:
776
+ * `PERIODIC` interest charged per hour
777
+ * `ON_BORROW` first interest charged on borrow
778
+ * `PERIODIC_CONVERTED` interest charged per hour converted into BNB
779
+ * `ON_BORROW_CONVERTED` first interest charged on borrow converted into BNB
780
+ * `PORTFOLIO` Portfolio Margin negative balance daily interest
781
+
782
+ Weight: 1
783
+
784
+ Args:
785
+ asset (Optional[str]):
786
+ start_time (Optional[int]): Timestamp in ms to get funding from INCLUSIVE.
787
+ end_time (Optional[int]): Timestamp in ms to get funding until INCLUSIVE.
788
+ current (Optional[int]): Currently querying page. Start from 1. Default:1
789
+ size (Optional[int]): Default:10 Max:100
790
+ archived (Optional[str]): Default: `false`. Set to `true` for archived data from 6 months ago
791
+ recv_window (Optional[int]):
792
+
793
+ Returns:
794
+ ApiResponse[GetMarginBorrowLoanInterestHistoryResponse]
795
+
796
+ Raises:
797
+ RequiredError: If a required parameter is missing.
798
+
799
+ """
800
+
801
+ return self._accountApi.get_margin_borrow_loan_interest_history(
802
+ asset, start_time, end_time, current, size, archived, recv_window
803
+ )
804
+
805
+ def get_um_account_detail(
806
+ self,
807
+ recv_window: Optional[int] = None,
808
+ ) -> ApiResponse[GetUmAccountDetailResponse]:
809
+ """
810
+ Get UM Account Detail(USER_DATA)
811
+
812
+ Get current UM account asset and position information.
813
+
814
+ Weight: 5
815
+
816
+ Args:
817
+ recv_window (Optional[int]):
818
+
819
+ Returns:
820
+ ApiResponse[GetUmAccountDetailResponse]
821
+
822
+ Raises:
823
+ RequiredError: If a required parameter is missing.
824
+
825
+ """
826
+
827
+ return self._accountApi.get_um_account_detail(recv_window)
828
+
829
+ def get_um_account_detail_v2(
830
+ self,
831
+ recv_window: Optional[int] = None,
832
+ ) -> ApiResponse[GetUmAccountDetailV2Response]:
833
+ """
834
+ Get UM Account Detail V2(USER_DATA)
835
+
836
+ Get current UM account asset and position information.
837
+
838
+ Weight: 5
839
+
840
+ Args:
841
+ recv_window (Optional[int]):
842
+
843
+ Returns:
844
+ ApiResponse[GetUmAccountDetailV2Response]
845
+
846
+ Raises:
847
+ RequiredError: If a required parameter is missing.
848
+
849
+ """
850
+
851
+ return self._accountApi.get_um_account_detail_v2(recv_window)
852
+
853
+ def get_um_current_position_mode(
854
+ self,
855
+ recv_window: Optional[int] = None,
856
+ ) -> ApiResponse[GetUmCurrentPositionModeResponse]:
857
+ """
858
+ Get UM Current Position Mode(USER_DATA)
859
+
860
+ Get user's position mode (Hedge Mode or One-way Mode ) on EVERY symbol in UM
861
+
862
+ Weight: 30
863
+
864
+ Args:
865
+ recv_window (Optional[int]):
866
+
867
+ Returns:
868
+ ApiResponse[GetUmCurrentPositionModeResponse]
869
+
870
+ Raises:
871
+ RequiredError: If a required parameter is missing.
872
+
873
+ """
874
+
875
+ return self._accountApi.get_um_current_position_mode(recv_window)
876
+
877
+ def get_um_futures_order_download_link_by_id(
878
+ self,
879
+ download_id: str = None,
880
+ recv_window: Optional[int] = None,
881
+ ) -> ApiResponse[GetUmFuturesOrderDownloadLinkByIdResponse]:
882
+ """
883
+ Get UM Futures Order Download Link by Id(USER_DATA)
884
+
885
+ Get UM futures order download link by Id
886
+
887
+ * Download link expiration: 24h
888
+
889
+ Weight: 10
890
+
891
+ Args:
892
+ download_id (str): get by download id api
893
+ recv_window (Optional[int]):
894
+
895
+ Returns:
896
+ ApiResponse[GetUmFuturesOrderDownloadLinkByIdResponse]
897
+
898
+ Raises:
899
+ RequiredError: If a required parameter is missing.
900
+
901
+ """
902
+
903
+ return self._accountApi.get_um_futures_order_download_link_by_id(
904
+ download_id, recv_window
905
+ )
906
+
907
+ def get_um_futures_trade_download_link_by_id(
908
+ self,
909
+ download_id: str = None,
910
+ recv_window: Optional[int] = None,
911
+ ) -> ApiResponse[GetUmFuturesTradeDownloadLinkByIdResponse]:
912
+ """
913
+ Get UM Futures Trade Download Link by Id(USER_DATA)
914
+
915
+ Get UM futures trade download link by Id
916
+
917
+ * Download link expiration: 24h
918
+
919
+ Weight: 10
920
+
921
+ Args:
922
+ download_id (str): get by download id api
923
+ recv_window (Optional[int]):
924
+
925
+ Returns:
926
+ ApiResponse[GetUmFuturesTradeDownloadLinkByIdResponse]
927
+
928
+ Raises:
929
+ RequiredError: If a required parameter is missing.
930
+
931
+ """
932
+
933
+ return self._accountApi.get_um_futures_trade_download_link_by_id(
934
+ download_id, recv_window
935
+ )
936
+
937
+ def get_um_futures_transaction_download_link_by_id(
938
+ self,
939
+ download_id: str = None,
940
+ recv_window: Optional[int] = None,
941
+ ) -> ApiResponse[GetUmFuturesTransactionDownloadLinkByIdResponse]:
942
+ """
943
+ Get UM Futures Transaction Download Link by Id(USER_DATA)
944
+
945
+ Get UM futures Transaction download link by Id
946
+
947
+ * Download link expiration: 24h
948
+
949
+ Weight: 10
950
+
951
+ Args:
952
+ download_id (str): get by download id api
953
+ recv_window (Optional[int]):
954
+
955
+ Returns:
956
+ ApiResponse[GetUmFuturesTransactionDownloadLinkByIdResponse]
957
+
958
+ Raises:
959
+ RequiredError: If a required parameter is missing.
960
+
961
+ """
962
+
963
+ return self._accountApi.get_um_futures_transaction_download_link_by_id(
964
+ download_id, recv_window
965
+ )
966
+
967
+ def get_um_income_history(
968
+ self,
969
+ symbol: Optional[str] = None,
970
+ income_type: Optional[str] = None,
971
+ start_time: Optional[int] = None,
972
+ end_time: Optional[int] = None,
973
+ page: Optional[int] = None,
974
+ limit: Optional[int] = None,
975
+ recv_window: Optional[int] = None,
976
+ ) -> ApiResponse[GetUmIncomeHistoryResponse]:
977
+ """
978
+ Get UM Income History(USER_DATA)
979
+
980
+ Get UM Income History
981
+
982
+ * If neither `startTime` nor `endTime` is sent, the recent 7-day data will be returned.
983
+ * If `incomeType` is not sent, all kinds of flow will be returned
984
+ * "trandId" is unique in the same incomeType for a user
985
+ * Income history only contains data for the last three months
986
+
987
+ Weight: 30
988
+
989
+ Args:
990
+ symbol (Optional[str]):
991
+ 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
992
+ start_time (Optional[int]): Timestamp in ms to get funding from INCLUSIVE.
993
+ end_time (Optional[int]): Timestamp in ms to get funding until INCLUSIVE.
994
+ page (Optional[int]):
995
+ limit (Optional[int]): Default 100; max 1000
996
+ recv_window (Optional[int]):
997
+
998
+ Returns:
999
+ ApiResponse[GetUmIncomeHistoryResponse]
1000
+
1001
+ Raises:
1002
+ RequiredError: If a required parameter is missing.
1003
+
1004
+ """
1005
+
1006
+ return self._accountApi.get_um_income_history(
1007
+ symbol, income_type, start_time, end_time, page, limit, recv_window
1008
+ )
1009
+
1010
+ def get_user_commission_rate_for_cm(
1011
+ self,
1012
+ symbol: str = None,
1013
+ recv_window: Optional[int] = None,
1014
+ ) -> ApiResponse[GetUserCommissionRateForCmResponse]:
1015
+ """
1016
+ Get User Commission Rate for CM(USER_DATA)
1017
+
1018
+ Get User Commission Rate for CM
1019
+
1020
+ Weight: 20
1021
+
1022
+ Args:
1023
+ symbol (str):
1024
+ recv_window (Optional[int]):
1025
+
1026
+ Returns:
1027
+ ApiResponse[GetUserCommissionRateForCmResponse]
1028
+
1029
+ Raises:
1030
+ RequiredError: If a required parameter is missing.
1031
+
1032
+ """
1033
+
1034
+ return self._accountApi.get_user_commission_rate_for_cm(symbol, recv_window)
1035
+
1036
+ def get_user_commission_rate_for_um(
1037
+ self,
1038
+ symbol: str = None,
1039
+ recv_window: Optional[int] = None,
1040
+ ) -> ApiResponse[GetUserCommissionRateForUmResponse]:
1041
+ """
1042
+ Get User Commission Rate for UM(USER_DATA)
1043
+
1044
+ Get User Commission Rate for UM
1045
+
1046
+ Weight: 20
1047
+
1048
+ Args:
1049
+ symbol (str):
1050
+ recv_window (Optional[int]):
1051
+
1052
+ Returns:
1053
+ ApiResponse[GetUserCommissionRateForUmResponse]
1054
+
1055
+ Raises:
1056
+ RequiredError: If a required parameter is missing.
1057
+
1058
+ """
1059
+
1060
+ return self._accountApi.get_user_commission_rate_for_um(symbol, recv_window)
1061
+
1062
+ def margin_max_borrow(
1063
+ self,
1064
+ asset: str = None,
1065
+ recv_window: Optional[int] = None,
1066
+ ) -> ApiResponse[MarginMaxBorrowResponse]:
1067
+ """
1068
+ Margin Max Borrow(USER_DATA)
1069
+
1070
+ Query margin max borrow
1071
+
1072
+ Weight: 5
1073
+
1074
+ Args:
1075
+ asset (str):
1076
+ recv_window (Optional[int]):
1077
+
1078
+ Returns:
1079
+ ApiResponse[MarginMaxBorrowResponse]
1080
+
1081
+ Raises:
1082
+ RequiredError: If a required parameter is missing.
1083
+
1084
+ """
1085
+
1086
+ return self._accountApi.margin_max_borrow(asset, recv_window)
1087
+
1088
+ def portfolio_margin_um_trading_quantitative_rules_indicators(
1089
+ self,
1090
+ symbol: Optional[str] = None,
1091
+ recv_window: Optional[int] = None,
1092
+ ) -> ApiResponse[PortfolioMarginUmTradingQuantitativeRulesIndicatorsResponse]:
1093
+ """
1094
+ Portfolio Margin UM Trading Quantitative Rules Indicators(USER_DATA)
1095
+
1096
+ Portfolio Margin UM Trading Quantitative Rules Indicators
1097
+
1098
+ Weight: 1 for a single symbol
1099
+ 10 when the symbol parameter is omitted
1100
+
1101
+ Args:
1102
+ symbol (Optional[str]):
1103
+ recv_window (Optional[int]):
1104
+
1105
+ Returns:
1106
+ ApiResponse[PortfolioMarginUmTradingQuantitativeRulesIndicatorsResponse]
1107
+
1108
+ Raises:
1109
+ RequiredError: If a required parameter is missing.
1110
+
1111
+ """
1112
+
1113
+ return (
1114
+ self._accountApi.portfolio_margin_um_trading_quantitative_rules_indicators(
1115
+ symbol, recv_window
1116
+ )
1117
+ )
1118
+
1119
+ def query_cm_position_information(
1120
+ self,
1121
+ margin_asset: Optional[str] = None,
1122
+ pair: Optional[str] = None,
1123
+ recv_window: Optional[int] = None,
1124
+ ) -> ApiResponse[QueryCmPositionInformationResponse]:
1125
+ """
1126
+ Query CM Position Information(USER_DATA)
1127
+
1128
+ Get current CM position information.
1129
+
1130
+ * If neither `marginAsset` nor `pair` is sent, positions of all symbols with `TRADING` status will be returned.
1131
+ * for One-way Mode user, the response will only show the "BOTH" positions
1132
+ * for Hedge Mode user, the response will show "LONG", and "SHORT" positions.
1133
+ * Please use with user data stream `ACCOUNT_UPDATE` to meet your timeliness and accuracy needs.
1134
+
1135
+ Weight: 1
1136
+
1137
+ Args:
1138
+ margin_asset (Optional[str]):
1139
+ pair (Optional[str]):
1140
+ recv_window (Optional[int]):
1141
+
1142
+ Returns:
1143
+ ApiResponse[QueryCmPositionInformationResponse]
1144
+
1145
+ Raises:
1146
+ RequiredError: If a required parameter is missing.
1147
+
1148
+ """
1149
+
1150
+ return self._accountApi.query_cm_position_information(
1151
+ margin_asset, pair, recv_window
1152
+ )
1153
+
1154
+ def query_margin_loan_record(
1155
+ self,
1156
+ asset: str = None,
1157
+ tx_id: Optional[int] = None,
1158
+ start_time: Optional[int] = None,
1159
+ end_time: Optional[int] = None,
1160
+ current: Optional[int] = None,
1161
+ size: Optional[int] = None,
1162
+ archived: Optional[str] = None,
1163
+ recv_window: Optional[int] = None,
1164
+ ) -> ApiResponse[QueryMarginLoanRecordResponse]:
1165
+ """
1166
+ Query Margin Loan Record(USER_DATA)
1167
+
1168
+ Query margin loan record
1169
+
1170
+ * txId or startTime must be sent. txId takes precedence.
1171
+ * Response in descending order
1172
+ * The max interval between `startTime` and `endTime` is 30 days.
1173
+ * If `startTime` and `endTime` not sent, return records of the last 7 days by default
1174
+ * Set `archived` to `true` to query data from 6 months ago
1175
+
1176
+ Weight: 10
1177
+
1178
+ Args:
1179
+ asset (str):
1180
+ tx_id (Optional[int]): the `tranId` in `POST/papi/v1/marginLoan`
1181
+ start_time (Optional[int]): Timestamp in ms to get funding from INCLUSIVE.
1182
+ end_time (Optional[int]): Timestamp in ms to get funding until INCLUSIVE.
1183
+ current (Optional[int]): Currently querying page. Start from 1. Default:1
1184
+ size (Optional[int]): Default:10 Max:100
1185
+ archived (Optional[str]): Default: `false`. Set to `true` for archived data from 6 months ago
1186
+ recv_window (Optional[int]):
1187
+
1188
+ Returns:
1189
+ ApiResponse[QueryMarginLoanRecordResponse]
1190
+
1191
+ Raises:
1192
+ RequiredError: If a required parameter is missing.
1193
+
1194
+ """
1195
+
1196
+ return self._accountApi.query_margin_loan_record(
1197
+ asset, tx_id, start_time, end_time, current, size, archived, recv_window
1198
+ )
1199
+
1200
+ def query_margin_max_withdraw(
1201
+ self,
1202
+ asset: str = None,
1203
+ recv_window: Optional[int] = None,
1204
+ ) -> ApiResponse[QueryMarginMaxWithdrawResponse]:
1205
+ """
1206
+ Query Margin Max Withdraw(USER_DATA)
1207
+
1208
+ Query Margin Max Withdraw
1209
+
1210
+ Weight: 5
1211
+
1212
+ Args:
1213
+ asset (str):
1214
+ recv_window (Optional[int]):
1215
+
1216
+ Returns:
1217
+ ApiResponse[QueryMarginMaxWithdrawResponse]
1218
+
1219
+ Raises:
1220
+ RequiredError: If a required parameter is missing.
1221
+
1222
+ """
1223
+
1224
+ return self._accountApi.query_margin_max_withdraw(asset, recv_window)
1225
+
1226
+ def query_margin_repay_record(
1227
+ self,
1228
+ asset: str = None,
1229
+ tx_id: Optional[int] = None,
1230
+ start_time: Optional[int] = None,
1231
+ end_time: Optional[int] = None,
1232
+ current: Optional[int] = None,
1233
+ size: Optional[int] = None,
1234
+ archived: Optional[str] = None,
1235
+ recv_window: Optional[int] = None,
1236
+ ) -> ApiResponse[QueryMarginRepayRecordResponse]:
1237
+ """
1238
+ Query Margin repay Record(USER_DATA)
1239
+
1240
+ Query margin repay record.
1241
+
1242
+ * txId or startTime must be sent. txId takes precedence.
1243
+ * Response in descending order
1244
+ * The max interval between `startTime` and `endTime` is 30 days.
1245
+ * If `startTime` and `endTime` not sent, return records of the last 7 days by default
1246
+ * Set `archived` to `true` to query data from 6 months ago
1247
+
1248
+ Weight: 10
1249
+
1250
+ Args:
1251
+ asset (str):
1252
+ tx_id (Optional[int]): the `tranId` in `POST/papi/v1/marginLoan`
1253
+ start_time (Optional[int]): Timestamp in ms to get funding from INCLUSIVE.
1254
+ end_time (Optional[int]): Timestamp in ms to get funding until INCLUSIVE.
1255
+ current (Optional[int]): Currently querying page. Start from 1. Default:1
1256
+ size (Optional[int]): Default:10 Max:100
1257
+ archived (Optional[str]): Default: `false`. Set to `true` for archived data from 6 months ago
1258
+ recv_window (Optional[int]):
1259
+
1260
+ Returns:
1261
+ ApiResponse[QueryMarginRepayRecordResponse]
1262
+
1263
+ Raises:
1264
+ RequiredError: If a required parameter is missing.
1265
+
1266
+ """
1267
+
1268
+ return self._accountApi.query_margin_repay_record(
1269
+ asset, tx_id, start_time, end_time, current, size, archived, recv_window
1270
+ )
1271
+
1272
+ def query_portfolio_margin_negative_balance_interest_history(
1273
+ self,
1274
+ asset: Optional[str] = None,
1275
+ start_time: Optional[int] = None,
1276
+ end_time: Optional[int] = None,
1277
+ size: Optional[int] = None,
1278
+ recv_window: Optional[int] = None,
1279
+ ) -> ApiResponse[QueryPortfolioMarginNegativeBalanceInterestHistoryResponse]:
1280
+ """
1281
+ Query Portfolio Margin Negative Balance Interest History(USER_DATA)
1282
+
1283
+ Query interest history of negative balance for portfolio margin.
1284
+
1285
+ * Response in descending order
1286
+ * The max interval between startTime and endTime is 30 days. It is a MUST to ensure data correctness.
1287
+ * If `startTime` and `endTime` not sent, return records of the last 7 days by default
1288
+ * 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.
1289
+ * If `startTime` is not sent and `endTime` is sent, the records of the 7 days before `endTime` is returned.
1290
+
1291
+ Weight: 50
1292
+
1293
+ Args:
1294
+ asset (Optional[str]):
1295
+ start_time (Optional[int]): Timestamp in ms to get funding from INCLUSIVE.
1296
+ end_time (Optional[int]): Timestamp in ms to get funding until INCLUSIVE.
1297
+ size (Optional[int]): Default:10 Max:100
1298
+ recv_window (Optional[int]):
1299
+
1300
+ Returns:
1301
+ ApiResponse[QueryPortfolioMarginNegativeBalanceInterestHistoryResponse]
1302
+
1303
+ Raises:
1304
+ RequiredError: If a required parameter is missing.
1305
+
1306
+ """
1307
+
1308
+ return (
1309
+ self._accountApi.query_portfolio_margin_negative_balance_interest_history(
1310
+ asset, start_time, end_time, size, recv_window
1311
+ )
1312
+ )
1313
+
1314
+ def query_um_position_information(
1315
+ self,
1316
+ symbol: Optional[str] = None,
1317
+ recv_window: Optional[int] = None,
1318
+ ) -> ApiResponse[QueryUmPositionInformationResponse]:
1319
+ """
1320
+ Query UM Position Information(USER_DATA)
1321
+
1322
+ Get current UM position information.
1323
+
1324
+ * Please use with user data stream `ACCOUNT_UPDATE` to meet your timeliness and accuracy needs.
1325
+ * for One-way Mode user, the response will only show the "BOTH" positions
1326
+ * for Hedge Mode user, the response will show "LONG", and "SHORT" positions.
1327
+
1328
+ Weight: 5
1329
+
1330
+ Args:
1331
+ symbol (Optional[str]):
1332
+ recv_window (Optional[int]):
1333
+
1334
+ Returns:
1335
+ ApiResponse[QueryUmPositionInformationResponse]
1336
+
1337
+ Raises:
1338
+ RequiredError: If a required parameter is missing.
1339
+
1340
+ """
1341
+
1342
+ return self._accountApi.query_um_position_information(symbol, recv_window)
1343
+
1344
+ def query_user_negative_balance_auto_exchange_record(
1345
+ self,
1346
+ start_time: int = None,
1347
+ end_time: int = None,
1348
+ recv_window: Optional[int] = None,
1349
+ ) -> ApiResponse[QueryUserNegativeBalanceAutoExchangeRecordResponse]:
1350
+ """
1351
+ Query User Negative Balance Auto Exchange Record (USER_DATA)
1352
+
1353
+ Query user negative balance auto exchange record
1354
+
1355
+ * Response in descending order
1356
+ * The max interval between `startTime` and `endTime` is 3 months.
1357
+
1358
+ Weight: 100
1359
+
1360
+ Args:
1361
+ start_time (int):
1362
+ end_time (int):
1363
+ recv_window (Optional[int]):
1364
+
1365
+ Returns:
1366
+ ApiResponse[QueryUserNegativeBalanceAutoExchangeRecordResponse]
1367
+
1368
+ Raises:
1369
+ RequiredError: If a required parameter is missing.
1370
+
1371
+ """
1372
+
1373
+ return self._accountApi.query_user_negative_balance_auto_exchange_record(
1374
+ start_time, end_time, recv_window
1375
+ )
1376
+
1377
+ def query_user_rate_limit(
1378
+ self,
1379
+ recv_window: Optional[int] = None,
1380
+ ) -> ApiResponse[QueryUserRateLimitResponse]:
1381
+ """
1382
+ Query User Rate Limit (USER_DATA)
1383
+
1384
+ Query User Rate Limit
1385
+
1386
+ Weight: 1
1387
+
1388
+ Args:
1389
+ recv_window (Optional[int]):
1390
+
1391
+ Returns:
1392
+ ApiResponse[QueryUserRateLimitResponse]
1393
+
1394
+ Raises:
1395
+ RequiredError: If a required parameter is missing.
1396
+
1397
+ """
1398
+
1399
+ return self._accountApi.query_user_rate_limit(recv_window)
1400
+
1401
+ def repay_futures_negative_balance(
1402
+ self,
1403
+ recv_window: Optional[int] = None,
1404
+ ) -> ApiResponse[RepayFuturesNegativeBalanceResponse]:
1405
+ """
1406
+ Repay futures Negative Balance(USER_DATA)
1407
+
1408
+ Repay futures Negative Balance
1409
+
1410
+ Weight: 750
1411
+
1412
+ Args:
1413
+ recv_window (Optional[int]):
1414
+
1415
+ Returns:
1416
+ ApiResponse[RepayFuturesNegativeBalanceResponse]
1417
+
1418
+ Raises:
1419
+ RequiredError: If a required parameter is missing.
1420
+
1421
+ """
1422
+
1423
+ return self._accountApi.repay_futures_negative_balance(recv_window)
1424
+
1425
+ def um_futures_account_configuration(
1426
+ self,
1427
+ recv_window: Optional[int] = None,
1428
+ ) -> ApiResponse[UmFuturesAccountConfigurationResponse]:
1429
+ """
1430
+ UM Futures Account Configuration(USER_DATA)
1431
+
1432
+ Query UM Futures account configuration
1433
+
1434
+ Weight: 5
1435
+
1436
+ Args:
1437
+ recv_window (Optional[int]):
1438
+
1439
+ Returns:
1440
+ ApiResponse[UmFuturesAccountConfigurationResponse]
1441
+
1442
+ Raises:
1443
+ RequiredError: If a required parameter is missing.
1444
+
1445
+ """
1446
+
1447
+ return self._accountApi.um_futures_account_configuration(recv_window)
1448
+
1449
+ def um_futures_symbol_configuration(
1450
+ self,
1451
+ symbol: Optional[str] = None,
1452
+ recv_window: Optional[int] = None,
1453
+ ) -> ApiResponse[UmFuturesSymbolConfigurationResponse]:
1454
+ """
1455
+ UM Futures Symbol Configuration(USER_DATA)
1456
+
1457
+ Get current UM account symbol configuration.
1458
+
1459
+ Weight: 5
1460
+
1461
+ Args:
1462
+ symbol (Optional[str]):
1463
+ recv_window (Optional[int]):
1464
+
1465
+ Returns:
1466
+ ApiResponse[UmFuturesSymbolConfigurationResponse]
1467
+
1468
+ Raises:
1469
+ RequiredError: If a required parameter is missing.
1470
+
1471
+ """
1472
+
1473
+ return self._accountApi.um_futures_symbol_configuration(symbol, recv_window)
1474
+
1475
+ def um_notional_and_leverage_brackets(
1476
+ self,
1477
+ symbol: Optional[str] = None,
1478
+ recv_window: Optional[int] = None,
1479
+ ) -> ApiResponse[UmNotionalAndLeverageBracketsResponse]:
1480
+ """
1481
+ UM Notional and Leverage Brackets (USER_DATA)
1482
+
1483
+ Query UM notional and leverage brackets
1484
+
1485
+ Weight: 1
1486
+
1487
+ Args:
1488
+ symbol (Optional[str]):
1489
+ recv_window (Optional[int]):
1490
+
1491
+ Returns:
1492
+ ApiResponse[UmNotionalAndLeverageBracketsResponse]
1493
+
1494
+ Raises:
1495
+ RequiredError: If a required parameter is missing.
1496
+
1497
+ """
1498
+
1499
+ return self._accountApi.um_notional_and_leverage_brackets(symbol, recv_window)
1500
+
1501
+ def test_connectivity(
1502
+ self,
1503
+ ) -> ApiResponse[None]:
1504
+ """
1505
+ Test Connectivity
1506
+
1507
+ Test connectivity to the Rest API.
1508
+
1509
+ Weight: 1
1510
+
1511
+ Args:
1512
+
1513
+ Returns:
1514
+ ApiResponse[None]
1515
+
1516
+ Raises:
1517
+ RequiredError: If a required parameter is missing.
1518
+
1519
+ """
1520
+
1521
+ return self._marketDataApi.test_connectivity()
1522
+
1523
+ def cancel_all_cm_open_conditional_orders(
1524
+ self,
1525
+ symbol: str = None,
1526
+ recv_window: Optional[int] = None,
1527
+ ) -> ApiResponse[CancelAllCmOpenConditionalOrdersResponse]:
1528
+ """
1529
+ Cancel All CM Open Conditional Orders(TRADE)
1530
+
1531
+ Cancel All CM Open Conditional Orders
1532
+
1533
+ Weight: 1
1534
+
1535
+ Args:
1536
+ symbol (str):
1537
+ recv_window (Optional[int]):
1538
+
1539
+ Returns:
1540
+ ApiResponse[CancelAllCmOpenConditionalOrdersResponse]
1541
+
1542
+ Raises:
1543
+ RequiredError: If a required parameter is missing.
1544
+
1545
+ """
1546
+
1547
+ return self._tradeApi.cancel_all_cm_open_conditional_orders(symbol, recv_window)
1548
+
1549
+ def cancel_all_cm_open_orders(
1550
+ self,
1551
+ symbol: str = None,
1552
+ recv_window: Optional[int] = None,
1553
+ ) -> ApiResponse[CancelAllCmOpenOrdersResponse]:
1554
+ """
1555
+ Cancel All CM Open Orders(TRADE)
1556
+
1557
+ Cancel all active LIMIT orders on specific symbol
1558
+
1559
+ Weight: 1
1560
+
1561
+ Args:
1562
+ symbol (str):
1563
+ recv_window (Optional[int]):
1564
+
1565
+ Returns:
1566
+ ApiResponse[CancelAllCmOpenOrdersResponse]
1567
+
1568
+ Raises:
1569
+ RequiredError: If a required parameter is missing.
1570
+
1571
+ """
1572
+
1573
+ return self._tradeApi.cancel_all_cm_open_orders(symbol, recv_window)
1574
+
1575
+ def cancel_all_um_open_conditional_orders(
1576
+ self,
1577
+ symbol: str = None,
1578
+ recv_window: Optional[int] = None,
1579
+ ) -> ApiResponse[CancelAllUmOpenConditionalOrdersResponse]:
1580
+ """
1581
+ Cancel All UM Open Conditional Orders (TRADE)
1582
+
1583
+ Cancel All UM Open Conditional Orders
1584
+
1585
+ Weight: 1
1586
+
1587
+ Args:
1588
+ symbol (str):
1589
+ recv_window (Optional[int]):
1590
+
1591
+ Returns:
1592
+ ApiResponse[CancelAllUmOpenConditionalOrdersResponse]
1593
+
1594
+ Raises:
1595
+ RequiredError: If a required parameter is missing.
1596
+
1597
+ """
1598
+
1599
+ return self._tradeApi.cancel_all_um_open_conditional_orders(symbol, recv_window)
1600
+
1601
+ def cancel_all_um_open_orders(
1602
+ self,
1603
+ symbol: str = None,
1604
+ recv_window: Optional[int] = None,
1605
+ ) -> ApiResponse[CancelAllUmOpenOrdersResponse]:
1606
+ """
1607
+ Cancel All UM Open Orders(TRADE)
1608
+
1609
+ Cancel all active LIMIT orders on specific symbol
1610
+
1611
+ Weight: 1
1612
+
1613
+ Args:
1614
+ symbol (str):
1615
+ recv_window (Optional[int]):
1616
+
1617
+ Returns:
1618
+ ApiResponse[CancelAllUmOpenOrdersResponse]
1619
+
1620
+ Raises:
1621
+ RequiredError: If a required parameter is missing.
1622
+
1623
+ """
1624
+
1625
+ return self._tradeApi.cancel_all_um_open_orders(symbol, recv_window)
1626
+
1627
+ def cancel_cm_conditional_order(
1628
+ self,
1629
+ symbol: str = None,
1630
+ strategy_id: Optional[int] = None,
1631
+ new_client_strategy_id: Optional[str] = None,
1632
+ recv_window: Optional[int] = None,
1633
+ ) -> ApiResponse[CancelCmConditionalOrderResponse]:
1634
+ """
1635
+ Cancel CM Conditional Order(TRADE)
1636
+
1637
+ Cancel CM Conditional Order
1638
+
1639
+ * Either `strategyId` or `newClientStrategyId` must be sent.
1640
+
1641
+ Weight: 1
1642
+
1643
+ Args:
1644
+ symbol (str):
1645
+ strategy_id (Optional[int]):
1646
+ new_client_strategy_id (Optional[str]):
1647
+ recv_window (Optional[int]):
1648
+
1649
+ Returns:
1650
+ ApiResponse[CancelCmConditionalOrderResponse]
1651
+
1652
+ Raises:
1653
+ RequiredError: If a required parameter is missing.
1654
+
1655
+ """
1656
+
1657
+ return self._tradeApi.cancel_cm_conditional_order(
1658
+ symbol, strategy_id, new_client_strategy_id, recv_window
1659
+ )
1660
+
1661
+ def cancel_cm_order(
1662
+ self,
1663
+ symbol: str = None,
1664
+ order_id: Optional[int] = None,
1665
+ orig_client_order_id: Optional[str] = None,
1666
+ recv_window: Optional[int] = None,
1667
+ ) -> ApiResponse[CancelCmOrderResponse]:
1668
+ """
1669
+ Cancel CM Order(TRADE)
1670
+
1671
+ Cancel an active LIMIT order
1672
+
1673
+ * Either `orderId` or `origClientOrderId` must be sent.
1674
+
1675
+ Weight: 1
1676
+
1677
+ Args:
1678
+ symbol (str):
1679
+ order_id (Optional[int]):
1680
+ orig_client_order_id (Optional[str]):
1681
+ recv_window (Optional[int]):
1682
+
1683
+ Returns:
1684
+ ApiResponse[CancelCmOrderResponse]
1685
+
1686
+ Raises:
1687
+ RequiredError: If a required parameter is missing.
1688
+
1689
+ """
1690
+
1691
+ return self._tradeApi.cancel_cm_order(
1692
+ symbol, order_id, orig_client_order_id, recv_window
1693
+ )
1694
+
1695
+ def cancel_margin_account_all_open_orders_on_a_symbol(
1696
+ self,
1697
+ symbol: str = None,
1698
+ recv_window: Optional[int] = None,
1699
+ ) -> ApiResponse[CancelMarginAccountAllOpenOrdersOnASymbolResponse]:
1700
+ """
1701
+ Cancel Margin Account All Open Orders on a Symbol(TRADE)
1702
+
1703
+ Cancel Margin Account All Open Orders on a Symbol
1704
+
1705
+ Weight: 5
1706
+
1707
+ Args:
1708
+ symbol (str):
1709
+ recv_window (Optional[int]):
1710
+
1711
+ Returns:
1712
+ ApiResponse[CancelMarginAccountAllOpenOrdersOnASymbolResponse]
1713
+
1714
+ Raises:
1715
+ RequiredError: If a required parameter is missing.
1716
+
1717
+ """
1718
+
1719
+ return self._tradeApi.cancel_margin_account_all_open_orders_on_a_symbol(
1720
+ symbol, recv_window
1721
+ )
1722
+
1723
+ def cancel_margin_account_oco_orders(
1724
+ self,
1725
+ symbol: str = None,
1726
+ order_list_id: Optional[int] = None,
1727
+ list_client_order_id: Optional[str] = None,
1728
+ new_client_order_id: Optional[str] = None,
1729
+ recv_window: Optional[int] = None,
1730
+ ) -> ApiResponse[CancelMarginAccountOcoOrdersResponse]:
1731
+ """
1732
+ Cancel Margin Account OCO Orders(TRADE)
1733
+
1734
+ Cancel Margin Account OCO Orders
1735
+
1736
+ * Additional notes: Canceling an individual leg will cancel the entire OCO
1737
+
1738
+ Weight: 2
1739
+
1740
+ Args:
1741
+ symbol (str):
1742
+ order_list_id (Optional[int]): Either `orderListId` or `listClientOrderId` must be provided
1743
+ list_client_order_id (Optional[str]): Either `orderListId` or `listClientOrderId` must be provided
1744
+ new_client_order_id (Optional[str]): Used to uniquely identify this cancel. Automatically generated by default
1745
+ recv_window (Optional[int]):
1746
+
1747
+ Returns:
1748
+ ApiResponse[CancelMarginAccountOcoOrdersResponse]
1749
+
1750
+ Raises:
1751
+ RequiredError: If a required parameter is missing.
1752
+
1753
+ """
1754
+
1755
+ return self._tradeApi.cancel_margin_account_oco_orders(
1756
+ symbol,
1757
+ order_list_id,
1758
+ list_client_order_id,
1759
+ new_client_order_id,
1760
+ recv_window,
1761
+ )
1762
+
1763
+ def cancel_margin_account_order(
1764
+ self,
1765
+ symbol: str = None,
1766
+ order_id: Optional[int] = None,
1767
+ orig_client_order_id: Optional[str] = None,
1768
+ new_client_order_id: Optional[str] = None,
1769
+ recv_window: Optional[int] = None,
1770
+ ) -> ApiResponse[CancelMarginAccountOrderResponse]:
1771
+ """
1772
+ Cancel Margin Account Order(TRADE)
1773
+
1774
+ Cancel Margin Account Order
1775
+
1776
+ * Either `orderId` or `origClientOrderId` must be sent.
1777
+
1778
+ Weight: 2
1779
+
1780
+ Args:
1781
+ symbol (str):
1782
+ order_id (Optional[int]):
1783
+ orig_client_order_id (Optional[str]):
1784
+ new_client_order_id (Optional[str]): Used to uniquely identify this cancel. Automatically generated by default
1785
+ recv_window (Optional[int]):
1786
+
1787
+ Returns:
1788
+ ApiResponse[CancelMarginAccountOrderResponse]
1789
+
1790
+ Raises:
1791
+ RequiredError: If a required parameter is missing.
1792
+
1793
+ """
1794
+
1795
+ return self._tradeApi.cancel_margin_account_order(
1796
+ symbol, order_id, orig_client_order_id, new_client_order_id, recv_window
1797
+ )
1798
+
1799
+ def cancel_um_conditional_order(
1800
+ self,
1801
+ symbol: str = None,
1802
+ strategy_id: Optional[int] = None,
1803
+ new_client_strategy_id: Optional[str] = None,
1804
+ recv_window: Optional[int] = None,
1805
+ ) -> ApiResponse[CancelUmConditionalOrderResponse]:
1806
+ """
1807
+ Cancel UM Conditional Order(TRADE)
1808
+
1809
+ Cancel UM Conditional Order
1810
+
1811
+ * Either `strategyId` or `newClientStrategyId` must be sent.
1812
+
1813
+ Weight: 1
1814
+
1815
+ Args:
1816
+ symbol (str):
1817
+ strategy_id (Optional[int]):
1818
+ new_client_strategy_id (Optional[str]):
1819
+ recv_window (Optional[int]):
1820
+
1821
+ Returns:
1822
+ ApiResponse[CancelUmConditionalOrderResponse]
1823
+
1824
+ Raises:
1825
+ RequiredError: If a required parameter is missing.
1826
+
1827
+ """
1828
+
1829
+ return self._tradeApi.cancel_um_conditional_order(
1830
+ symbol, strategy_id, new_client_strategy_id, recv_window
1831
+ )
1832
+
1833
+ def cancel_um_order(
1834
+ self,
1835
+ symbol: str = None,
1836
+ order_id: Optional[int] = None,
1837
+ orig_client_order_id: Optional[str] = None,
1838
+ recv_window: Optional[int] = None,
1839
+ ) -> ApiResponse[CancelUmOrderResponse]:
1840
+ """
1841
+ Cancel UM Order(TRADE)
1842
+
1843
+ Cancel an active UM LIMIT order
1844
+
1845
+ * Either `orderId` or `origClientOrderId` must be sent.
1846
+
1847
+ Weight: 1
1848
+
1849
+ Args:
1850
+ symbol (str):
1851
+ order_id (Optional[int]):
1852
+ orig_client_order_id (Optional[str]):
1853
+ recv_window (Optional[int]):
1854
+
1855
+ Returns:
1856
+ ApiResponse[CancelUmOrderResponse]
1857
+
1858
+ Raises:
1859
+ RequiredError: If a required parameter is missing.
1860
+
1861
+ """
1862
+
1863
+ return self._tradeApi.cancel_um_order(
1864
+ symbol, order_id, orig_client_order_id, recv_window
1865
+ )
1866
+
1867
+ def cm_account_trade_list(
1868
+ self,
1869
+ symbol: Optional[str] = None,
1870
+ pair: Optional[str] = None,
1871
+ start_time: Optional[int] = None,
1872
+ end_time: Optional[int] = None,
1873
+ from_id: Optional[int] = None,
1874
+ limit: Optional[int] = None,
1875
+ recv_window: Optional[int] = None,
1876
+ ) -> ApiResponse[CmAccountTradeListResponse]:
1877
+ """
1878
+ CM Account Trade List(USER_DATA)
1879
+
1880
+ Get trades for a specific account and CM symbol.
1881
+
1882
+ * Either `symbol` or `pair` must be sent
1883
+ * `symbol` and `pair` cannot be sent together
1884
+ * `pair` and `fromId` cannot be sent together
1885
+ * `OrderId` can only be sent together with symbol
1886
+ * If a `pair` is sent, tickers for all symbols of the `pair` will be returned
1887
+ * The parameter `fromId` cannot be sent with `startTime` or `endTime`
1888
+ * If `startTime` and `endTime` are both not sent, then the last '24 hours' data will be returned.
1889
+ * The time between `startTime` and `endTime` cannot be longer than 24 hours.
1890
+
1891
+ Weight: 20 with symbol, 40 with pair
1892
+
1893
+ Args:
1894
+ symbol (Optional[str]):
1895
+ pair (Optional[str]):
1896
+ start_time (Optional[int]): Timestamp in ms to get funding from INCLUSIVE.
1897
+ end_time (Optional[int]): Timestamp in ms to get funding until INCLUSIVE.
1898
+ from_id (Optional[int]): Trade id to fetch from. Default gets most recent trades.
1899
+ limit (Optional[int]): Default 100; max 1000
1900
+ recv_window (Optional[int]):
1901
+
1902
+ Returns:
1903
+ ApiResponse[CmAccountTradeListResponse]
1904
+
1905
+ Raises:
1906
+ RequiredError: If a required parameter is missing.
1907
+
1908
+ """
1909
+
1910
+ return self._tradeApi.cm_account_trade_list(
1911
+ symbol, pair, start_time, end_time, from_id, limit, recv_window
1912
+ )
1913
+
1914
+ def cm_position_adl_quantile_estimation(
1915
+ self,
1916
+ symbol: Optional[str] = None,
1917
+ recv_window: Optional[int] = None,
1918
+ ) -> ApiResponse[CmPositionAdlQuantileEstimationResponse]:
1919
+ """
1920
+ CM Position ADL Quantile Estimation(USER_DATA)
1921
+
1922
+ Query CM Position ADL Quantile Estimation
1923
+ * Values update every 30s.
1924
+ * Values 0, 1, 2, 3, 4 shows the queue position and possibility of ADL from low to high.
1925
+ * For positions of the symbol are in One-way Mode or isolated margined in Hedge Mode, "LONG", "SHORT", and "BOTH" will be returned to show the positions' adl quantiles of different position sides.
1926
+ * If the positions of the symbol are crossed margined in Hedge Mode:
1927
+ * "HEDGE" as a sign will be returned instead of "BOTH";
1928
+ * A same value caculated on unrealized pnls on long and short sides' positions will be shown for "LONG" and "SHORT" when there are positions in both of long and short sides.
1929
+
1930
+ Weight: 5
1931
+
1932
+ Args:
1933
+ symbol (Optional[str]):
1934
+ recv_window (Optional[int]):
1935
+
1936
+ Returns:
1937
+ ApiResponse[CmPositionAdlQuantileEstimationResponse]
1938
+
1939
+ Raises:
1940
+ RequiredError: If a required parameter is missing.
1941
+
1942
+ """
1943
+
1944
+ return self._tradeApi.cm_position_adl_quantile_estimation(symbol, recv_window)
1945
+
1946
+ def get_um_futures_bnb_burn_status(
1947
+ self,
1948
+ recv_window: Optional[int] = None,
1949
+ ) -> ApiResponse[GetUmFuturesBnbBurnStatusResponse]:
1950
+ """
1951
+ Get UM Futures BNB Burn Status (USER_DATA)
1952
+
1953
+ Get user's BNB Fee Discount for UM Futures (Fee Discount On or Fee Discount Off )
1954
+
1955
+ Weight: 30
1956
+
1957
+ Args:
1958
+ recv_window (Optional[int]):
1959
+
1960
+ Returns:
1961
+ ApiResponse[GetUmFuturesBnbBurnStatusResponse]
1962
+
1963
+ Raises:
1964
+ RequiredError: If a required parameter is missing.
1965
+
1966
+ """
1967
+
1968
+ return self._tradeApi.get_um_futures_bnb_burn_status(recv_window)
1969
+
1970
+ def margin_account_borrow(
1971
+ self,
1972
+ asset: str = None,
1973
+ amount: float = None,
1974
+ recv_window: Optional[int] = None,
1975
+ ) -> ApiResponse[MarginAccountBorrowResponse]:
1976
+ """
1977
+ Margin Account Borrow(MARGIN)
1978
+
1979
+ Apply for a margin loan.
1980
+
1981
+ Weight: 100
1982
+
1983
+ Args:
1984
+ asset (str):
1985
+ amount (float):
1986
+ recv_window (Optional[int]):
1987
+
1988
+ Returns:
1989
+ ApiResponse[MarginAccountBorrowResponse]
1990
+
1991
+ Raises:
1992
+ RequiredError: If a required parameter is missing.
1993
+
1994
+ """
1995
+
1996
+ return self._tradeApi.margin_account_borrow(asset, amount, recv_window)
1997
+
1998
+ def margin_account_new_oco(
1999
+ self,
2000
+ symbol: str = None,
2001
+ side: MarginAccountNewOcoSideEnum = None,
2002
+ quantity: float = None,
2003
+ price: float = None,
2004
+ stop_price: float = None,
2005
+ list_client_order_id: Optional[str] = None,
2006
+ limit_client_order_id: Optional[str] = None,
2007
+ limit_iceberg_qty: Optional[float] = None,
2008
+ stop_client_order_id: Optional[str] = None,
2009
+ stop_limit_price: Optional[float] = None,
2010
+ stop_iceberg_qty: Optional[float] = None,
2011
+ stop_limit_time_in_force: Optional[
2012
+ MarginAccountNewOcoStopLimitTimeInForceEnum
2013
+ ] = None,
2014
+ new_order_resp_type: Optional[MarginAccountNewOcoNewOrderRespTypeEnum] = None,
2015
+ side_effect_type: Optional[MarginAccountNewOcoSideEffectTypeEnum] = None,
2016
+ recv_window: Optional[int] = None,
2017
+ ) -> ApiResponse[MarginAccountNewOcoResponse]:
2018
+ """
2019
+ Margin Account New OCO(TRADE)
2020
+
2021
+ Send in a new OCO for a margin account
2022
+
2023
+ * Price Restrictions:
2024
+ * `SELL`: Limit Price > Last Price > Stop Price
2025
+ * `BUY`: Limit Price < Last Price < Stop Price
2026
+ * Quantity Restrictions:
2027
+ * Both legs must have the same quantity
2028
+ * `ICEBERG` quantities however do not have to be the same.
2029
+ * Order Rate Limit
2030
+ * `OCO` counts as 2 orders against the order rate limit.
2031
+
2032
+ Weight: 1
2033
+
2034
+ Args:
2035
+ symbol (str):
2036
+ side (MarginAccountNewOcoSideEnum):
2037
+ quantity (float): Order quantity
2038
+ price (float):
2039
+ stop_price (float):
2040
+ list_client_order_id (Optional[str]): Either `orderListId` or `listClientOrderId` must be provided
2041
+ limit_client_order_id (Optional[str]): A unique Id for the limit order
2042
+ limit_iceberg_qty (Optional[float]):
2043
+ stop_client_order_id (Optional[str]): A unique Id for the stop loss/stop loss limit leg
2044
+ stop_limit_price (Optional[float]): If provided, stopLimitTimeInForce is required.
2045
+ stop_iceberg_qty (Optional[float]):
2046
+ stop_limit_time_in_force (Optional[MarginAccountNewOcoStopLimitTimeInForceEnum]): Valid values are `GTC/FOK/IOC`
2047
+ new_order_resp_type (Optional[MarginAccountNewOcoNewOrderRespTypeEnum]): "ACK", "RESULT", default "ACK"
2048
+ side_effect_type (Optional[MarginAccountNewOcoSideEffectTypeEnum]): NO_SIDE_EFFECT, MARGIN_BUY, AUTO_REPAY; default NO_SIDE_EFFECT.
2049
+ recv_window (Optional[int]):
2050
+
2051
+ Returns:
2052
+ ApiResponse[MarginAccountNewOcoResponse]
2053
+
2054
+ Raises:
2055
+ RequiredError: If a required parameter is missing.
2056
+
2057
+ """
2058
+
2059
+ return self._tradeApi.margin_account_new_oco(
2060
+ symbol,
2061
+ side,
2062
+ quantity,
2063
+ price,
2064
+ stop_price,
2065
+ list_client_order_id,
2066
+ limit_client_order_id,
2067
+ limit_iceberg_qty,
2068
+ stop_client_order_id,
2069
+ stop_limit_price,
2070
+ stop_iceberg_qty,
2071
+ stop_limit_time_in_force,
2072
+ new_order_resp_type,
2073
+ side_effect_type,
2074
+ recv_window,
2075
+ )
2076
+
2077
+ def margin_account_repay(
2078
+ self,
2079
+ asset: str = None,
2080
+ amount: float = None,
2081
+ recv_window: Optional[int] = None,
2082
+ ) -> ApiResponse[MarginAccountRepayResponse]:
2083
+ """
2084
+ Margin Account Repay(MARGIN)
2085
+
2086
+ Repay for a margin loan.
2087
+
2088
+ Weight: 100
2089
+
2090
+ Args:
2091
+ asset (str):
2092
+ amount (float):
2093
+ recv_window (Optional[int]):
2094
+
2095
+ Returns:
2096
+ ApiResponse[MarginAccountRepayResponse]
2097
+
2098
+ Raises:
2099
+ RequiredError: If a required parameter is missing.
2100
+
2101
+ """
2102
+
2103
+ return self._tradeApi.margin_account_repay(asset, amount, recv_window)
2104
+
2105
+ def margin_account_repay_debt(
2106
+ self,
2107
+ asset: str = None,
2108
+ amount: Optional[str] = None,
2109
+ specify_repay_assets: Optional[str] = None,
2110
+ recv_window: Optional[int] = None,
2111
+ ) -> ApiResponse[MarginAccountRepayDebtResponse]:
2112
+ """
2113
+ Margin Account Repay Debt(TRADE)
2114
+
2115
+ Repay debt for a margin loan.
2116
+
2117
+ * The repay asset amount cannot exceed 50000 USD equivalent value for a single request.
2118
+ * If `amount` is not sent, all the asset loan will be repaid if having enough specific repay assets.
2119
+ * If `amount` is sent, only the certain amount of the asset loan will be repaid if having enough specific repay assets.
2120
+ * The system will use the same asset to repay the loan first (if have) no matter whether put the asset in `specifyRepayAssets`
2121
+
2122
+ Weight: 3000
2123
+
2124
+ Args:
2125
+ asset (str):
2126
+ amount (Optional[str]):
2127
+ specify_repay_assets (Optional[str]): Specific asset list to repay debt; Can be added in batch, separated by commas
2128
+ recv_window (Optional[int]):
2129
+
2130
+ Returns:
2131
+ ApiResponse[MarginAccountRepayDebtResponse]
2132
+
2133
+ Raises:
2134
+ RequiredError: If a required parameter is missing.
2135
+
2136
+ """
2137
+
2138
+ return self._tradeApi.margin_account_repay_debt(
2139
+ asset, amount, specify_repay_assets, recv_window
2140
+ )
2141
+
2142
+ def margin_account_trade_list(
2143
+ self,
2144
+ symbol: str = None,
2145
+ order_id: Optional[int] = None,
2146
+ start_time: Optional[int] = None,
2147
+ end_time: Optional[int] = None,
2148
+ from_id: Optional[int] = None,
2149
+ limit: Optional[int] = None,
2150
+ recv_window: Optional[int] = None,
2151
+ ) -> ApiResponse[MarginAccountTradeListResponse]:
2152
+ """
2153
+ Margin Account Trade List (USER_DATA)
2154
+
2155
+ Margin Account Trade List
2156
+
2157
+ Weight: 5
2158
+
2159
+ Args:
2160
+ symbol (str):
2161
+ order_id (Optional[int]):
2162
+ start_time (Optional[int]): Timestamp in ms to get funding from INCLUSIVE.
2163
+ end_time (Optional[int]): Timestamp in ms to get funding until INCLUSIVE.
2164
+ from_id (Optional[int]): Trade id to fetch from. Default gets most recent trades.
2165
+ limit (Optional[int]): Default 100; max 1000
2166
+ recv_window (Optional[int]):
2167
+
2168
+ Returns:
2169
+ ApiResponse[MarginAccountTradeListResponse]
2170
+
2171
+ Raises:
2172
+ RequiredError: If a required parameter is missing.
2173
+
2174
+ """
2175
+
2176
+ return self._tradeApi.margin_account_trade_list(
2177
+ symbol, order_id, start_time, end_time, from_id, limit, recv_window
2178
+ )
2179
+
2180
+ def modify_cm_order(
2181
+ self,
2182
+ symbol: str = None,
2183
+ side: ModifyCmOrderSideEnum = None,
2184
+ quantity: float = None,
2185
+ price: float = None,
2186
+ order_id: Optional[int] = None,
2187
+ orig_client_order_id: Optional[str] = None,
2188
+ price_match: Optional[ModifyCmOrderPriceMatchEnum] = None,
2189
+ recv_window: Optional[int] = None,
2190
+ ) -> ApiResponse[ModifyCmOrderResponse]:
2191
+ """
2192
+ Modify CM Order(TRADE)
2193
+
2194
+ Order modify function, currently only LIMIT order modification is supported, modified orders will be reordered in the match queue
2195
+
2196
+ * Either `orderId` or `origClientOrderId` must be sent, and the `orderId` will prevail if both are sent.
2197
+ * Both `quantity` and `price` must be sent
2198
+ * When the new `quantity` or `price` doesn't satisfy PRICE_FILTER / PERCENT_FILTER / LOT_SIZE, amendment will be rejected and the order will stay as it is.
2199
+ * However the order will be cancelled by the amendment in the following situations:
2200
+ * when the order is in partially filled status and the new `quantity` <= `executedQty`
2201
+ * When the order is `GTX` and the new price will cause it to be executed immediately
2202
+
2203
+ Weight: 1
2204
+
2205
+ Args:
2206
+ symbol (str):
2207
+ side (ModifyCmOrderSideEnum):
2208
+ quantity (float): Order quantity
2209
+ price (float):
2210
+ order_id (Optional[int]):
2211
+ orig_client_order_id (Optional[str]):
2212
+ price_match (Optional[ModifyCmOrderPriceMatchEnum]): only avaliable for `LIMIT`/`STOP`/`TAKE_PROFIT` order; can be set to `OPPONENT`/ `OPPONENT_5`/ `OPPONENT_10`/ `OPPONENT_20`: /`QUEUE`/ `QUEUE_5`/ `QUEUE_10`/ `QUEUE_20`; Can't be passed together with `price`
2213
+ recv_window (Optional[int]):
2214
+
2215
+ Returns:
2216
+ ApiResponse[ModifyCmOrderResponse]
2217
+
2218
+ Raises:
2219
+ RequiredError: If a required parameter is missing.
2220
+
2221
+ """
2222
+
2223
+ return self._tradeApi.modify_cm_order(
2224
+ symbol,
2225
+ side,
2226
+ quantity,
2227
+ price,
2228
+ order_id,
2229
+ orig_client_order_id,
2230
+ price_match,
2231
+ recv_window,
2232
+ )
2233
+
2234
+ def modify_um_order(
2235
+ self,
2236
+ symbol: str = None,
2237
+ side: ModifyUmOrderSideEnum = None,
2238
+ quantity: float = None,
2239
+ price: float = None,
2240
+ order_id: Optional[int] = None,
2241
+ orig_client_order_id: Optional[str] = None,
2242
+ price_match: Optional[ModifyUmOrderPriceMatchEnum] = None,
2243
+ recv_window: Optional[int] = None,
2244
+ ) -> ApiResponse[ModifyUmOrderResponse]:
2245
+ """
2246
+ Modify UM Order(TRADE)
2247
+
2248
+ Order modify function, currently only LIMIT order modification is supported, modified orders will be reordered in the match queue
2249
+
2250
+ * Either orderId or origClientOrderId must be sent, and the orderId will prevail if both are sent.
2251
+ * Both quantity and price must be sent
2252
+ * When the new quantity or price doesn't satisfy PRICE_FILTER / PERCENT_FILTER / LOT_SIZE, amendment will be rejected and the order will stay as it is.
2253
+ * However the order will be cancelled by the amendment in the following situations:
2254
+ * when the order is in partially filled status and the new quantity <= executedQty
2255
+ * When the order is GTX and the new price will cause it to be executed immediately
2256
+
2257
+ Weight: 1
2258
+
2259
+ Args:
2260
+ symbol (str):
2261
+ side (ModifyUmOrderSideEnum):
2262
+ quantity (float): Order quantity
2263
+ price (float):
2264
+ order_id (Optional[int]):
2265
+ orig_client_order_id (Optional[str]):
2266
+ price_match (Optional[ModifyUmOrderPriceMatchEnum]): only avaliable for `LIMIT`/`STOP`/`TAKE_PROFIT` order; can be set to `OPPONENT`/ `OPPONENT_5`/ `OPPONENT_10`/ `OPPONENT_20`: /`QUEUE`/ `QUEUE_5`/ `QUEUE_10`/ `QUEUE_20`; Can't be passed together with `price`
2267
+ recv_window (Optional[int]):
2268
+
2269
+ Returns:
2270
+ ApiResponse[ModifyUmOrderResponse]
2271
+
2272
+ Raises:
2273
+ RequiredError: If a required parameter is missing.
2274
+
2275
+ """
2276
+
2277
+ return self._tradeApi.modify_um_order(
2278
+ symbol,
2279
+ side,
2280
+ quantity,
2281
+ price,
2282
+ order_id,
2283
+ orig_client_order_id,
2284
+ price_match,
2285
+ recv_window,
2286
+ )
2287
+
2288
+ def new_cm_conditional_order(
2289
+ self,
2290
+ symbol: str = None,
2291
+ side: NewCmConditionalOrderSideEnum = None,
2292
+ strategy_type: NewCmConditionalOrderStrategyTypeEnum = None,
2293
+ position_side: Optional[NewCmConditionalOrderPositionSideEnum] = None,
2294
+ time_in_force: Optional[NewCmConditionalOrderTimeInForceEnum] = None,
2295
+ quantity: Optional[float] = None,
2296
+ reduce_only: Optional[str] = None,
2297
+ price: Optional[float] = None,
2298
+ working_type: Optional[NewCmConditionalOrderWorkingTypeEnum] = None,
2299
+ price_protect: Optional[str] = None,
2300
+ new_client_strategy_id: Optional[str] = None,
2301
+ stop_price: Optional[float] = None,
2302
+ activation_price: Optional[float] = None,
2303
+ callback_rate: Optional[float] = None,
2304
+ recv_window: Optional[int] = None,
2305
+ ) -> ApiResponse[NewCmConditionalOrderResponse]:
2306
+ """
2307
+ New CM Conditional Order(TRADE)
2308
+
2309
+ New CM Conditional Order
2310
+
2311
+ * Order with type `STOP/TAKE_PROFIT`, parameter `timeInForce` can be sent ( default `GTC`).
2312
+ * Condition orders will be triggered when:
2313
+ * `STOP`, `STOP_MARKET`:
2314
+ * BUY: "MARK_PRICE" >= `stopPrice`
2315
+ * SELL: "MARK_PRICE" <= `stopPrice`
2316
+ * `TAKE_PROFIT`, `TAKE_PROFIT_MARKET`:
2317
+ * BUY: "MARK_PRICE" <= `stopPrice`
2318
+ * SELL: "MARK_PRICE" >= `stopPrice`
2319
+ * `TRAILING_STOP_MARKET`:
2320
+ * BUY: the lowest mark price after order placed `<= `activationPrice`, and the latest mark price >`= the lowest mark price * (1 + `callbackRate`)
2321
+ * SELL: the highest mark price after order placed >= `activationPrice`, and the latest mark price <= the highest mark price * (1 - `callbackRate`)
2322
+ * For `TRAILING_STOP_MARKET`, if you got such error code. `{"code": -2021, "msg": "Order would immediately trigger."}` means that the parameters you send do not meet the following requirements:
2323
+ * BUY: `activationPrice` should be smaller than latest mark price.
2324
+ * SELL: `activationPrice` should be larger than latest mark price.
2325
+ * Condition orders will be triggered when:
2326
+ * If parameter`priceProtect`is sent as true:
2327
+ * when price reaches the `stopPrice` ,the difference rate between "MARK_PRICE" and "CONTRACT_PRICE" cannot be larger than the "triggerProtect" of the symbol
2328
+ * "triggerProtect" of a symbol can be got from `GET /fapi/v1/exchangeInfo`
2329
+ * `STOP`, `STOP_MARKET`:
2330
+ * BUY: latest price ("MARK_PRICE" or "CONTRACT_PRICE") >= `stopPrice`
2331
+ * SELL: latest price ("MARK_PRICE" or "CONTRACT_PRICE") <= `stopPrice`
2332
+ * `TAKE_PROFIT`, `TAKE_PROFIT_MARKET`:
2333
+ * BUY: latest price ("MARK_PRICE" or "CONTRACT_PRICE") <= `stopPrice`
2334
+ * SELL: latest price ("MARK_PRICE" or "CONTRACT_PRICE") >= `stopPrice`
2335
+
2336
+ Weight: 1
2337
+
2338
+ Args:
2339
+ symbol (str):
2340
+ side (NewCmConditionalOrderSideEnum):
2341
+ strategy_type (NewCmConditionalOrderStrategyTypeEnum): "STOP", "STOP_MARKET", "TAKE_PROFIT", "TAKE_PROFIT_MARKET", and "TRAILING_STOP_MARKET"
2342
+ position_side (Optional[NewCmConditionalOrderPositionSideEnum]): Default `BOTH` for One-way Mode ; `LONG` or `SHORT` for Hedge Mode. It must be sent in Hedge Mode.
2343
+ time_in_force (Optional[NewCmConditionalOrderTimeInForceEnum]):
2344
+ quantity (Optional[float]):
2345
+ reduce_only (Optional[str]): "true" or "false". default "false". Cannot be sent in Hedge Mode .
2346
+ price (Optional[float]):
2347
+ working_type (Optional[NewCmConditionalOrderWorkingTypeEnum]): stopPrice triggered by: "MARK_PRICE", "CONTRACT_PRICE". Default "CONTRACT_PRICE"
2348
+ price_protect (Optional[str]): "TRUE" or "FALSE", default "FALSE". Used with `STOP/STOP_MARKET` or `TAKE_PROFIT/TAKE_PROFIT_MARKET` orders
2349
+ new_client_strategy_id (Optional[str]):
2350
+ stop_price (Optional[float]): Used with `STOP/STOP_MARKET` or `TAKE_PROFIT/TAKE_PROFIT_MARKET` orders.
2351
+ activation_price (Optional[float]): Used with `TRAILING_STOP_MARKET` orders, default as the mark price
2352
+ callback_rate (Optional[float]): Used with `TRAILING_STOP_MARKET` orders, min 0.1, max 5 where 1 for 1%
2353
+ recv_window (Optional[int]):
2354
+
2355
+ Returns:
2356
+ ApiResponse[NewCmConditionalOrderResponse]
2357
+
2358
+ Raises:
2359
+ RequiredError: If a required parameter is missing.
2360
+
2361
+ """
2362
+
2363
+ return self._tradeApi.new_cm_conditional_order(
2364
+ symbol,
2365
+ side,
2366
+ strategy_type,
2367
+ position_side,
2368
+ time_in_force,
2369
+ quantity,
2370
+ reduce_only,
2371
+ price,
2372
+ working_type,
2373
+ price_protect,
2374
+ new_client_strategy_id,
2375
+ stop_price,
2376
+ activation_price,
2377
+ callback_rate,
2378
+ recv_window,
2379
+ )
2380
+
2381
+ def new_cm_order(
2382
+ self,
2383
+ symbol: str = None,
2384
+ side: NewCmOrderSideEnum = None,
2385
+ type: NewCmOrderTypeEnum = None,
2386
+ position_side: Optional[NewCmOrderPositionSideEnum] = None,
2387
+ time_in_force: Optional[NewCmOrderTimeInForceEnum] = None,
2388
+ quantity: Optional[float] = None,
2389
+ reduce_only: Optional[str] = None,
2390
+ price: Optional[float] = None,
2391
+ price_match: Optional[NewCmOrderPriceMatchEnum] = None,
2392
+ new_client_order_id: Optional[str] = None,
2393
+ new_order_resp_type: Optional[NewCmOrderNewOrderRespTypeEnum] = None,
2394
+ recv_window: Optional[int] = None,
2395
+ ) -> ApiResponse[NewCmOrderResponse]:
2396
+ """
2397
+ New CM Order(TRADE)
2398
+
2399
+ Place new CM order
2400
+
2401
+ * If `newOrderRespType` is sent as `RESULT` :
2402
+ * `MARKET` order: the final FILLED result of the order will be return directly.
2403
+ * `LIMIT` order with special `timeInForce`: the final status result of the order(FILLED or EXPIRED) will be returned directly.
2404
+
2405
+ Weight: 1
2406
+
2407
+ Args:
2408
+ symbol (str):
2409
+ side (NewCmOrderSideEnum):
2410
+ type (NewCmOrderTypeEnum): `LIMIT`, `MARKET`
2411
+ position_side (Optional[NewCmOrderPositionSideEnum]): Default `BOTH` for One-way Mode ; `LONG` or `SHORT` for Hedge Mode. It must be sent in Hedge Mode.
2412
+ time_in_force (Optional[NewCmOrderTimeInForceEnum]):
2413
+ quantity (Optional[float]):
2414
+ reduce_only (Optional[str]): "true" or "false". default "false". Cannot be sent in Hedge Mode .
2415
+ price (Optional[float]):
2416
+ price_match (Optional[NewCmOrderPriceMatchEnum]): only avaliable for `LIMIT`/`STOP`/`TAKE_PROFIT` order; can be set to `OPPONENT`/ `OPPONENT_5`/ `OPPONENT_10`/ `OPPONENT_20`: /`QUEUE`/ `QUEUE_5`/ `QUEUE_10`/ `QUEUE_20`; Can't be passed together with `price`
2417
+ new_client_order_id (Optional[str]): Used to uniquely identify this cancel. Automatically generated by default
2418
+ new_order_resp_type (Optional[NewCmOrderNewOrderRespTypeEnum]): "ACK", "RESULT", default "ACK"
2419
+ recv_window (Optional[int]):
2420
+
2421
+ Returns:
2422
+ ApiResponse[NewCmOrderResponse]
2423
+
2424
+ Raises:
2425
+ RequiredError: If a required parameter is missing.
2426
+
2427
+ """
2428
+
2429
+ return self._tradeApi.new_cm_order(
2430
+ symbol,
2431
+ side,
2432
+ type,
2433
+ position_side,
2434
+ time_in_force,
2435
+ quantity,
2436
+ reduce_only,
2437
+ price,
2438
+ price_match,
2439
+ new_client_order_id,
2440
+ new_order_resp_type,
2441
+ recv_window,
2442
+ )
2443
+
2444
+ def new_margin_order(
2445
+ self,
2446
+ symbol: str = None,
2447
+ side: NewMarginOrderSideEnum = None,
2448
+ type: NewMarginOrderTypeEnum = None,
2449
+ quantity: Optional[float] = None,
2450
+ quote_order_qty: Optional[float] = None,
2451
+ price: Optional[float] = None,
2452
+ stop_price: Optional[float] = None,
2453
+ new_client_order_id: Optional[str] = None,
2454
+ new_order_resp_type: Optional[NewMarginOrderNewOrderRespTypeEnum] = None,
2455
+ iceberg_qty: Optional[float] = None,
2456
+ side_effect_type: Optional[NewMarginOrderSideEffectTypeEnum] = None,
2457
+ time_in_force: Optional[NewMarginOrderTimeInForceEnum] = None,
2458
+ self_trade_prevention_mode: Optional[
2459
+ NewMarginOrderSelfTradePreventionModeEnum
2460
+ ] = None,
2461
+ auto_repay_at_cancel: Optional[bool] = None,
2462
+ recv_window: Optional[int] = None,
2463
+ ) -> ApiResponse[NewMarginOrderResponse]:
2464
+ """
2465
+ New Margin Order(TRADE)
2466
+
2467
+ New Margin Order
2468
+
2469
+ Weight: 1
2470
+
2471
+ Args:
2472
+ symbol (str):
2473
+ side (NewMarginOrderSideEnum):
2474
+ type (NewMarginOrderTypeEnum): `LIMIT`, `MARKET`
2475
+ quantity (Optional[float]):
2476
+ quote_order_qty (Optional[float]):
2477
+ price (Optional[float]):
2478
+ stop_price (Optional[float]): Used with `STOP/STOP_MARKET` or `TAKE_PROFIT/TAKE_PROFIT_MARKET` orders.
2479
+ new_client_order_id (Optional[str]): Used to uniquely identify this cancel. Automatically generated by default
2480
+ new_order_resp_type (Optional[NewMarginOrderNewOrderRespTypeEnum]): "ACK", "RESULT", default "ACK"
2481
+ iceberg_qty (Optional[float]): Used with `LIMIT`, `STOP_LOSS_LIMIT`, and `TAKE_PROFIT_LIMIT` to create an iceberg order
2482
+ side_effect_type (Optional[NewMarginOrderSideEffectTypeEnum]): NO_SIDE_EFFECT, MARGIN_BUY, AUTO_REPAY; default NO_SIDE_EFFECT.
2483
+ time_in_force (Optional[NewMarginOrderTimeInForceEnum]):
2484
+ self_trade_prevention_mode (Optional[NewMarginOrderSelfTradePreventionModeEnum]): `NONE`:No STP / `EXPIRE_TAKER`:expire taker order when STP triggers/ `EXPIRE_MAKER`:expire taker order when STP triggers/ `EXPIRE_BOTH`:expire both orders when STP triggers
2485
+ auto_repay_at_cancel (Optional[bool]): 只有在自动借款单或者自动借还单生效,true表示的是撤单后需要把订单产生的借款归还,默认为true
2486
+ recv_window (Optional[int]):
2487
+
2488
+ Returns:
2489
+ ApiResponse[NewMarginOrderResponse]
2490
+
2491
+ Raises:
2492
+ RequiredError: If a required parameter is missing.
2493
+
2494
+ """
2495
+
2496
+ return self._tradeApi.new_margin_order(
2497
+ symbol,
2498
+ side,
2499
+ type,
2500
+ quantity,
2501
+ quote_order_qty,
2502
+ price,
2503
+ stop_price,
2504
+ new_client_order_id,
2505
+ new_order_resp_type,
2506
+ iceberg_qty,
2507
+ side_effect_type,
2508
+ time_in_force,
2509
+ self_trade_prevention_mode,
2510
+ auto_repay_at_cancel,
2511
+ recv_window,
2512
+ )
2513
+
2514
+ def new_um_conditional_order(
2515
+ self,
2516
+ symbol: str = None,
2517
+ side: NewUmConditionalOrderSideEnum = None,
2518
+ strategy_type: NewUmConditionalOrderStrategyTypeEnum = None,
2519
+ position_side: Optional[NewUmConditionalOrderPositionSideEnum] = None,
2520
+ time_in_force: Optional[NewUmConditionalOrderTimeInForceEnum] = None,
2521
+ quantity: Optional[float] = None,
2522
+ reduce_only: Optional[str] = None,
2523
+ price: Optional[float] = None,
2524
+ working_type: Optional[NewUmConditionalOrderWorkingTypeEnum] = None,
2525
+ price_protect: Optional[str] = None,
2526
+ new_client_strategy_id: Optional[str] = None,
2527
+ stop_price: Optional[float] = None,
2528
+ activation_price: Optional[float] = None,
2529
+ callback_rate: Optional[float] = None,
2530
+ price_match: Optional[NewUmConditionalOrderPriceMatchEnum] = None,
2531
+ self_trade_prevention_mode: Optional[
2532
+ NewUmConditionalOrderSelfTradePreventionModeEnum
2533
+ ] = None,
2534
+ good_till_date: Optional[int] = None,
2535
+ recv_window: Optional[int] = None,
2536
+ ) -> ApiResponse[NewUmConditionalOrderResponse]:
2537
+ """
2538
+ New UM Conditional Order (TRADE)
2539
+
2540
+ Place new UM conditional order
2541
+
2542
+ * Order with type `STOP/TAKE_PROFIT`, parameter `timeInForce` can be sent ( default `GTC`).
2543
+ * Condition orders will be triggered when:
2544
+ * `STOP`, `STOP_MARKET`:
2545
+ * BUY: "MARK_PRICE" >= `stopPrice`
2546
+ * SELL: "MARK_PRICE" <= `stopPrice`
2547
+ * `TAKE_PROFIT`, `TAKE_PROFIT_MARKET`:
2548
+ * BUY: "MARK_PRICE" <= `stopPrice`
2549
+ * SELL: "MARK_PRICE" >= `stopPrice`
2550
+ * `TRAILING_STOP_MARKET`:
2551
+ * BUY: the lowest mark price after order placed `<= `activationPrice`, and the latest mark price >`= the lowest mark price * (1 + `callbackRate`)
2552
+ * SELL: the highest mark price after order placed >= `activationPrice`, and the latest mark price <= the highest mark price * (1 - `callbackRate`)
2553
+ * For `TRAILING_STOP_MARKET`, if you got such error code. `{"code": -2021, "msg": "Order would immediately trigger."}` means that the parameters you send do not meet the following requirements:
2554
+ * BUY: `activationPrice` should be smaller than latest mark price.
2555
+ * SELL: `activationPrice` should be larger than latest mark price.
2556
+ * Condition orders will be triggered when:
2557
+ * If parameter`priceProtect`is sent as true:
2558
+ * when price reaches the `stopPrice` ,the difference rate between "MARK_PRICE" and "CONTRACT_PRICE" cannot be larger than the "triggerProtect" of the symbol
2559
+ * "triggerProtect" of a symbol can be got from `GET /fapi/v1/exchangeInfo`
2560
+ * `STOP`, `STOP_MARKET`:
2561
+ * BUY: latest price ("MARK_PRICE" or "CONTRACT_PRICE") >= `stopPrice`
2562
+ * SELL: latest price ("MARK_PRICE" or "CONTRACT_PRICE") <= `stopPrice`
2563
+ * `TAKE_PROFIT`, `TAKE_PROFIT_MARKET`:
2564
+ * BUY: latest price ("MARK_PRICE" or "CONTRACT_PRICE") <= `stopPrice`
2565
+ * SELL: latest price ("MARK_PRICE" or "CONTRACT_PRICE") >= `stopPrice`
2566
+ * `selfTradePreventionMode` is only effective when `timeInForce` set to `IOC` or `GTC` or `GTD`.
2567
+ * In extreme market conditions, timeInForce `GTD` order auto cancel time might be delayed comparing to `goodTillDate`
2568
+
2569
+ Weight: 1
2570
+
2571
+ Args:
2572
+ symbol (str):
2573
+ side (NewUmConditionalOrderSideEnum):
2574
+ strategy_type (NewUmConditionalOrderStrategyTypeEnum): "STOP", "STOP_MARKET", "TAKE_PROFIT", "TAKE_PROFIT_MARKET", and "TRAILING_STOP_MARKET"
2575
+ position_side (Optional[NewUmConditionalOrderPositionSideEnum]): Default `BOTH` for One-way Mode ; `LONG` or `SHORT` for Hedge Mode. It must be sent in Hedge Mode.
2576
+ time_in_force (Optional[NewUmConditionalOrderTimeInForceEnum]):
2577
+ quantity (Optional[float]):
2578
+ reduce_only (Optional[str]): "true" or "false". default "false". Cannot be sent in Hedge Mode .
2579
+ price (Optional[float]):
2580
+ working_type (Optional[NewUmConditionalOrderWorkingTypeEnum]): stopPrice triggered by: "MARK_PRICE", "CONTRACT_PRICE". Default "CONTRACT_PRICE"
2581
+ price_protect (Optional[str]): "TRUE" or "FALSE", default "FALSE". Used with `STOP/STOP_MARKET` or `TAKE_PROFIT/TAKE_PROFIT_MARKET` orders
2582
+ new_client_strategy_id (Optional[str]):
2583
+ stop_price (Optional[float]): Used with `STOP/STOP_MARKET` or `TAKE_PROFIT/TAKE_PROFIT_MARKET` orders.
2584
+ activation_price (Optional[float]): Used with `TRAILING_STOP_MARKET` orders, default as the mark price
2585
+ callback_rate (Optional[float]): Used with `TRAILING_STOP_MARKET` orders, min 0.1, max 5 where 1 for 1%
2586
+ price_match (Optional[NewUmConditionalOrderPriceMatchEnum]): only avaliable for `LIMIT`/`STOP`/`TAKE_PROFIT` order; can be set to `OPPONENT`/ `OPPONENT_5`/ `OPPONENT_10`/ `OPPONENT_20`: /`QUEUE`/ `QUEUE_5`/ `QUEUE_10`/ `QUEUE_20`; Can't be passed together with `price`
2587
+ self_trade_prevention_mode (Optional[NewUmConditionalOrderSelfTradePreventionModeEnum]): `NONE`:No STP / `EXPIRE_TAKER`:expire taker order when STP triggers/ `EXPIRE_MAKER`:expire taker order when STP triggers/ `EXPIRE_BOTH`:expire both orders when STP triggers
2588
+ good_till_date (Optional[int]): order cancel time for timeInForce `GTD`, mandatory when `timeInforce` set to `GTD`; order the timestamp only retains second-level precision, ms part will be ignored; The goodTillDate timestamp must be greater than the current time plus 600 seconds and smaller than 253402300799000Mode. It must be sent in Hedge Mode.
2589
+ recv_window (Optional[int]):
2590
+
2591
+ Returns:
2592
+ ApiResponse[NewUmConditionalOrderResponse]
2593
+
2594
+ Raises:
2595
+ RequiredError: If a required parameter is missing.
2596
+
2597
+ """
2598
+
2599
+ return self._tradeApi.new_um_conditional_order(
2600
+ symbol,
2601
+ side,
2602
+ strategy_type,
2603
+ position_side,
2604
+ time_in_force,
2605
+ quantity,
2606
+ reduce_only,
2607
+ price,
2608
+ working_type,
2609
+ price_protect,
2610
+ new_client_strategy_id,
2611
+ stop_price,
2612
+ activation_price,
2613
+ callback_rate,
2614
+ price_match,
2615
+ self_trade_prevention_mode,
2616
+ good_till_date,
2617
+ recv_window,
2618
+ )
2619
+
2620
+ def new_um_order(
2621
+ self,
2622
+ symbol: str = None,
2623
+ side: NewUmOrderSideEnum = None,
2624
+ type: NewUmOrderTypeEnum = None,
2625
+ position_side: Optional[NewUmOrderPositionSideEnum] = None,
2626
+ time_in_force: Optional[NewUmOrderTimeInForceEnum] = None,
2627
+ quantity: Optional[float] = None,
2628
+ reduce_only: Optional[str] = None,
2629
+ price: Optional[float] = None,
2630
+ new_client_order_id: Optional[str] = None,
2631
+ new_order_resp_type: Optional[NewUmOrderNewOrderRespTypeEnum] = None,
2632
+ price_match: Optional[NewUmOrderPriceMatchEnum] = None,
2633
+ self_trade_prevention_mode: Optional[
2634
+ NewUmOrderSelfTradePreventionModeEnum
2635
+ ] = None,
2636
+ good_till_date: Optional[int] = None,
2637
+ recv_window: Optional[int] = None,
2638
+ ) -> ApiResponse[NewUmOrderResponse]:
2639
+ """
2640
+ New UM Order (TRADE)
2641
+
2642
+ Place new UM order
2643
+
2644
+ * If `newOrderRespType` is sent as `RESULT` :
2645
+ * `MARKET` order: the final FILLED result of the order will be return directly.
2646
+ * `LIMIT` order with special `timeInForce`: the final status result of the order(FILLED or EXPIRED) will be returned directly.
2647
+ * `selfTradePreventionMode` is only effective when `timeInForce` set to `IOC` or `GTC` or `GTD`.
2648
+ * In extreme market conditions, timeInForce `GTD` order auto cancel time might be delayed comparing to `goodTillDate`
2649
+
2650
+ Weight: 1
2651
+
2652
+ Args:
2653
+ symbol (str):
2654
+ side (NewUmOrderSideEnum):
2655
+ type (NewUmOrderTypeEnum): `LIMIT`, `MARKET`
2656
+ position_side (Optional[NewUmOrderPositionSideEnum]): Default `BOTH` for One-way Mode ; `LONG` or `SHORT` for Hedge Mode. It must be sent in Hedge Mode.
2657
+ time_in_force (Optional[NewUmOrderTimeInForceEnum]):
2658
+ quantity (Optional[float]):
2659
+ reduce_only (Optional[str]): "true" or "false". default "false". Cannot be sent in Hedge Mode .
2660
+ price (Optional[float]):
2661
+ new_client_order_id (Optional[str]): Used to uniquely identify this cancel. Automatically generated by default
2662
+ new_order_resp_type (Optional[NewUmOrderNewOrderRespTypeEnum]): "ACK", "RESULT", default "ACK"
2663
+ price_match (Optional[NewUmOrderPriceMatchEnum]): only avaliable for `LIMIT`/`STOP`/`TAKE_PROFIT` order; can be set to `OPPONENT`/ `OPPONENT_5`/ `OPPONENT_10`/ `OPPONENT_20`: /`QUEUE`/ `QUEUE_5`/ `QUEUE_10`/ `QUEUE_20`; Can't be passed together with `price`
2664
+ self_trade_prevention_mode (Optional[NewUmOrderSelfTradePreventionModeEnum]): `NONE`:No STP / `EXPIRE_TAKER`:expire taker order when STP triggers/ `EXPIRE_MAKER`:expire taker order when STP triggers/ `EXPIRE_BOTH`:expire both orders when STP triggers
2665
+ good_till_date (Optional[int]): order cancel time for timeInForce `GTD`, mandatory when `timeInforce` set to `GTD`; order the timestamp only retains second-level precision, ms part will be ignored; The goodTillDate timestamp must be greater than the current time plus 600 seconds and smaller than 253402300799000Mode. It must be sent in Hedge Mode.
2666
+ recv_window (Optional[int]):
2667
+
2668
+ Returns:
2669
+ ApiResponse[NewUmOrderResponse]
2670
+
2671
+ Raises:
2672
+ RequiredError: If a required parameter is missing.
2673
+
2674
+ """
2675
+
2676
+ return self._tradeApi.new_um_order(
2677
+ symbol,
2678
+ side,
2679
+ type,
2680
+ position_side,
2681
+ time_in_force,
2682
+ quantity,
2683
+ reduce_only,
2684
+ price,
2685
+ new_client_order_id,
2686
+ new_order_resp_type,
2687
+ price_match,
2688
+ self_trade_prevention_mode,
2689
+ good_till_date,
2690
+ recv_window,
2691
+ )
2692
+
2693
+ def query_all_cm_conditional_orders(
2694
+ self,
2695
+ symbol: Optional[str] = None,
2696
+ strategy_id: Optional[int] = None,
2697
+ start_time: Optional[int] = None,
2698
+ end_time: Optional[int] = None,
2699
+ limit: Optional[int] = None,
2700
+ recv_window: Optional[int] = None,
2701
+ ) -> ApiResponse[QueryAllCmConditionalOrdersResponse]:
2702
+ """
2703
+ Query All CM Conditional Orders(USER_DATA)
2704
+
2705
+ Query All CM Conditional Orders
2706
+
2707
+ * These orders will not be found:
2708
+ * order strategyStatus is `CANCELED` or `EXPIRED`, **AND**
2709
+ * order has NO filled trade, **AND**
2710
+ * created time + 7 days < current time
2711
+ * The query time period must be less than 7 days( default as the recent 7 days).
2712
+
2713
+ Weight: 1 for a single symbol; 40 when the symbol parameter is omitted
2714
+
2715
+ Args:
2716
+ symbol (Optional[str]):
2717
+ strategy_id (Optional[int]):
2718
+ start_time (Optional[int]): Timestamp in ms to get funding from INCLUSIVE.
2719
+ end_time (Optional[int]): Timestamp in ms to get funding until INCLUSIVE.
2720
+ limit (Optional[int]): Default 100; max 1000
2721
+ recv_window (Optional[int]):
2722
+
2723
+ Returns:
2724
+ ApiResponse[QueryAllCmConditionalOrdersResponse]
2725
+
2726
+ Raises:
2727
+ RequiredError: If a required parameter is missing.
2728
+
2729
+ """
2730
+
2731
+ return self._tradeApi.query_all_cm_conditional_orders(
2732
+ symbol, strategy_id, start_time, end_time, limit, recv_window
2733
+ )
2734
+
2735
+ def query_all_cm_orders(
2736
+ self,
2737
+ symbol: str = None,
2738
+ pair: Optional[str] = None,
2739
+ order_id: Optional[int] = None,
2740
+ start_time: Optional[int] = None,
2741
+ end_time: Optional[int] = None,
2742
+ limit: Optional[int] = None,
2743
+ recv_window: Optional[int] = None,
2744
+ ) -> ApiResponse[QueryAllCmOrdersResponse]:
2745
+ """
2746
+ Query All CM Orders (USER_DATA)
2747
+
2748
+ Get all account CM orders; active, canceled, or filled.
2749
+
2750
+ * Either `symbol` or `pair` must be sent.
2751
+ * If `orderId` is set, it will get orders >= that orderId. Otherwise most recent orders are returned.
2752
+ * These orders will not be found:
2753
+ * order status is `CANCELED` or `EXPIRED`, **AND**
2754
+ * order has NO filled trade, **AND**
2755
+ * created time + 3 days < current time
2756
+
2757
+ Weight: 20 with symbol, 40 with pair
2758
+
2759
+ Args:
2760
+ symbol (str):
2761
+ pair (Optional[str]):
2762
+ order_id (Optional[int]):
2763
+ start_time (Optional[int]): Timestamp in ms to get funding from INCLUSIVE.
2764
+ end_time (Optional[int]): Timestamp in ms to get funding until INCLUSIVE.
2765
+ limit (Optional[int]): Default 100; max 1000
2766
+ recv_window (Optional[int]):
2767
+
2768
+ Returns:
2769
+ ApiResponse[QueryAllCmOrdersResponse]
2770
+
2771
+ Raises:
2772
+ RequiredError: If a required parameter is missing.
2773
+
2774
+ """
2775
+
2776
+ return self._tradeApi.query_all_cm_orders(
2777
+ symbol, pair, order_id, start_time, end_time, limit, recv_window
2778
+ )
2779
+
2780
+ def query_all_current_cm_open_conditional_orders(
2781
+ self,
2782
+ symbol: Optional[str] = None,
2783
+ recv_window: Optional[int] = None,
2784
+ ) -> ApiResponse[QueryAllCurrentCmOpenConditionalOrdersResponse]:
2785
+ """
2786
+ Query All Current CM Open Conditional Orders (USER_DATA)
2787
+
2788
+ Get all open conditional orders on a symbol. **Careful** when accessing this with no symbol.
2789
+
2790
+ * If the symbol is not sent, orders for all symbols will be returned in an array.
2791
+
2792
+ Weight: 1 for a single symbol; 40 when the symbol parameter is omitted
2793
+
2794
+ Args:
2795
+ symbol (Optional[str]):
2796
+ recv_window (Optional[int]):
2797
+
2798
+ Returns:
2799
+ ApiResponse[QueryAllCurrentCmOpenConditionalOrdersResponse]
2800
+
2801
+ Raises:
2802
+ RequiredError: If a required parameter is missing.
2803
+
2804
+ """
2805
+
2806
+ return self._tradeApi.query_all_current_cm_open_conditional_orders(
2807
+ symbol, recv_window
2808
+ )
2809
+
2810
+ def query_all_current_cm_open_orders(
2811
+ self,
2812
+ symbol: Optional[str] = None,
2813
+ pair: Optional[str] = None,
2814
+ recv_window: Optional[int] = None,
2815
+ ) -> ApiResponse[QueryAllCurrentCmOpenOrdersResponse]:
2816
+ """
2817
+ Query All Current CM Open Orders(USER_DATA)
2818
+
2819
+ Get all open orders on a symbol.
2820
+
2821
+ * If the symbol is not sent, orders for all symbols will be returned in an array.
2822
+
2823
+ Weight: 1 for a single symbol; 40 when the symbol parameter is omitted
2824
+ Careful when accessing this with no symbol.
2825
+
2826
+ Args:
2827
+ symbol (Optional[str]):
2828
+ pair (Optional[str]):
2829
+ recv_window (Optional[int]):
2830
+
2831
+ Returns:
2832
+ ApiResponse[QueryAllCurrentCmOpenOrdersResponse]
2833
+
2834
+ Raises:
2835
+ RequiredError: If a required parameter is missing.
2836
+
2837
+ """
2838
+
2839
+ return self._tradeApi.query_all_current_cm_open_orders(
2840
+ symbol, pair, recv_window
2841
+ )
2842
+
2843
+ def query_all_current_um_open_conditional_orders(
2844
+ self,
2845
+ symbol: Optional[str] = None,
2846
+ recv_window: Optional[int] = None,
2847
+ ) -> ApiResponse[QueryAllCurrentUmOpenConditionalOrdersResponse]:
2848
+ """
2849
+ Query All Current UM Open Conditional Orders(USER_DATA)
2850
+
2851
+ Get all open conditional orders on a symbol.
2852
+
2853
+ * If the symbol is not sent, orders for all symbols will be returned in an array.
2854
+
2855
+ Weight: 1 for a single symbol; 40 when the symbol parameter is omitted
2856
+ Careful when accessing this with no symbol.
2857
+
2858
+ Args:
2859
+ symbol (Optional[str]):
2860
+ recv_window (Optional[int]):
2861
+
2862
+ Returns:
2863
+ ApiResponse[QueryAllCurrentUmOpenConditionalOrdersResponse]
2864
+
2865
+ Raises:
2866
+ RequiredError: If a required parameter is missing.
2867
+
2868
+ """
2869
+
2870
+ return self._tradeApi.query_all_current_um_open_conditional_orders(
2871
+ symbol, recv_window
2872
+ )
2873
+
2874
+ def query_all_current_um_open_orders(
2875
+ self,
2876
+ symbol: Optional[str] = None,
2877
+ recv_window: Optional[int] = None,
2878
+ ) -> ApiResponse[QueryAllCurrentUmOpenOrdersResponse]:
2879
+ """
2880
+ Query All Current UM Open Orders(USER_DATA)
2881
+
2882
+ Get all open orders on a symbol.
2883
+
2884
+
2885
+ * If the symbol is not sent, orders for all symbols will be returned in an array.
2886
+
2887
+ Weight: 1 for a single symbol; 40 when the symbol parameter is omitted
2888
+
2889
+ Args:
2890
+ symbol (Optional[str]):
2891
+ recv_window (Optional[int]):
2892
+
2893
+ Returns:
2894
+ ApiResponse[QueryAllCurrentUmOpenOrdersResponse]
2895
+
2896
+ Raises:
2897
+ RequiredError: If a required parameter is missing.
2898
+
2899
+ """
2900
+
2901
+ return self._tradeApi.query_all_current_um_open_orders(symbol, recv_window)
2902
+
2903
+ def query_all_margin_account_orders(
2904
+ self,
2905
+ symbol: str = None,
2906
+ order_id: Optional[int] = None,
2907
+ start_time: Optional[int] = None,
2908
+ end_time: Optional[int] = None,
2909
+ limit: Optional[int] = None,
2910
+ recv_window: Optional[int] = None,
2911
+ ) -> ApiResponse[QueryAllMarginAccountOrdersResponse]:
2912
+ """
2913
+ Query All Margin Account Orders (USER_DATA)
2914
+
2915
+ Query All Margin Account Orders
2916
+
2917
+ Weight: 100
2918
+
2919
+ Args:
2920
+ symbol (str):
2921
+ order_id (Optional[int]):
2922
+ start_time (Optional[int]): Timestamp in ms to get funding from INCLUSIVE.
2923
+ end_time (Optional[int]): Timestamp in ms to get funding until INCLUSIVE.
2924
+ limit (Optional[int]): Default 100; max 1000
2925
+ recv_window (Optional[int]):
2926
+
2927
+ Returns:
2928
+ ApiResponse[QueryAllMarginAccountOrdersResponse]
2929
+
2930
+ Raises:
2931
+ RequiredError: If a required parameter is missing.
2932
+
2933
+ """
2934
+
2935
+ return self._tradeApi.query_all_margin_account_orders(
2936
+ symbol, order_id, start_time, end_time, limit, recv_window
2937
+ )
2938
+
2939
+ def query_all_um_conditional_orders(
2940
+ self,
2941
+ symbol: Optional[str] = None,
2942
+ strategy_id: Optional[int] = None,
2943
+ start_time: Optional[int] = None,
2944
+ end_time: Optional[int] = None,
2945
+ limit: Optional[int] = None,
2946
+ recv_window: Optional[int] = None,
2947
+ ) -> ApiResponse[QueryAllUmConditionalOrdersResponse]:
2948
+ """
2949
+ Query All UM Conditional Orders(USER_DATA)
2950
+
2951
+ Query All UM Conditional Orders
2952
+
2953
+ * These orders will not be found:
2954
+ * order strategyStatus is `CANCELED` or `EXPIRED`, **AND**
2955
+ * order has NO filled trade, **AND**
2956
+ * created time + 7 days < current time
2957
+ * The query time period must be less than 7 days( default as the recent 7 days).
2958
+
2959
+ Weight: 1 for a single symbol; 40 when the symbol parameter is omitted
2960
+
2961
+ Args:
2962
+ symbol (Optional[str]):
2963
+ strategy_id (Optional[int]):
2964
+ start_time (Optional[int]): Timestamp in ms to get funding from INCLUSIVE.
2965
+ end_time (Optional[int]): Timestamp in ms to get funding until INCLUSIVE.
2966
+ limit (Optional[int]): Default 100; max 1000
2967
+ recv_window (Optional[int]):
2968
+
2969
+ Returns:
2970
+ ApiResponse[QueryAllUmConditionalOrdersResponse]
2971
+
2972
+ Raises:
2973
+ RequiredError: If a required parameter is missing.
2974
+
2975
+ """
2976
+
2977
+ return self._tradeApi.query_all_um_conditional_orders(
2978
+ symbol, strategy_id, start_time, end_time, limit, recv_window
2979
+ )
2980
+
2981
+ def query_all_um_orders(
2982
+ self,
2983
+ symbol: str = None,
2984
+ order_id: Optional[int] = None,
2985
+ start_time: Optional[int] = None,
2986
+ end_time: Optional[int] = None,
2987
+ limit: Optional[int] = None,
2988
+ recv_window: Optional[int] = None,
2989
+ ) -> ApiResponse[QueryAllUmOrdersResponse]:
2990
+ """
2991
+ Query All UM Orders(USER_DATA)
2992
+
2993
+ Get all account UM orders; active, canceled, or filled.
2994
+ * These orders will not be found:
2995
+ * order status is `CANCELED` or `EXPIRED`, **AND**
2996
+ * order has NO filled trade, **AND**
2997
+ * created time + 3 days < current time
2998
+
2999
+ * If `orderId` is set, it will get orders >= that orderId. Otherwise most recent orders are returned.
3000
+ * The query time period must be less then 7 days( default as the recent 7 days).
3001
+
3002
+ Weight: 5
3003
+
3004
+ Args:
3005
+ symbol (str):
3006
+ order_id (Optional[int]):
3007
+ start_time (Optional[int]): Timestamp in ms to get funding from INCLUSIVE.
3008
+ end_time (Optional[int]): Timestamp in ms to get funding until INCLUSIVE.
3009
+ limit (Optional[int]): Default 100; max 1000
3010
+ recv_window (Optional[int]):
3011
+
3012
+ Returns:
3013
+ ApiResponse[QueryAllUmOrdersResponse]
3014
+
3015
+ Raises:
3016
+ RequiredError: If a required parameter is missing.
3017
+
3018
+ """
3019
+
3020
+ return self._tradeApi.query_all_um_orders(
3021
+ symbol, order_id, start_time, end_time, limit, recv_window
3022
+ )
3023
+
3024
+ def query_cm_conditional_order_history(
3025
+ self,
3026
+ symbol: str = None,
3027
+ strategy_id: Optional[int] = None,
3028
+ new_client_strategy_id: Optional[str] = None,
3029
+ recv_window: Optional[int] = None,
3030
+ ) -> ApiResponse[QueryCmConditionalOrderHistoryResponse]:
3031
+ """
3032
+ Query CM Conditional Order History(USER_DATA)
3033
+
3034
+ Query CM Conditional Order History
3035
+
3036
+
3037
+ * Either `strategyId` or `newClientStrategyId` must be sent.
3038
+ * `NEW` orders will not be found.
3039
+ * These orders will not be found:
3040
+ * order status is `CANCELED` or `EXPIRED`, **AND**
3041
+ * order has NO filled trade, **AND**
3042
+ * created time + 7 days < current time
3043
+
3044
+ Weight: 1
3045
+
3046
+ Args:
3047
+ symbol (str):
3048
+ strategy_id (Optional[int]):
3049
+ new_client_strategy_id (Optional[str]):
3050
+ recv_window (Optional[int]):
3051
+
3052
+ Returns:
3053
+ ApiResponse[QueryCmConditionalOrderHistoryResponse]
3054
+
3055
+ Raises:
3056
+ RequiredError: If a required parameter is missing.
3057
+
3058
+ """
3059
+
3060
+ return self._tradeApi.query_cm_conditional_order_history(
3061
+ symbol, strategy_id, new_client_strategy_id, recv_window
3062
+ )
3063
+
3064
+ def query_cm_modify_order_history(
3065
+ self,
3066
+ symbol: str = None,
3067
+ order_id: Optional[int] = None,
3068
+ orig_client_order_id: Optional[str] = None,
3069
+ start_time: Optional[int] = None,
3070
+ end_time: Optional[int] = None,
3071
+ limit: Optional[int] = None,
3072
+ recv_window: Optional[int] = None,
3073
+ ) -> ApiResponse[QueryCmModifyOrderHistoryResponse]:
3074
+ """
3075
+ Query CM Modify Order History(TRADE)
3076
+
3077
+ Get order modification history
3078
+
3079
+ * Either `orderId` or `origClientOrderId` must be sent, and the `orderId` will prevail if both are sent.
3080
+
3081
+ Weight: 1
3082
+
3083
+ Args:
3084
+ symbol (str):
3085
+ order_id (Optional[int]):
3086
+ orig_client_order_id (Optional[str]):
3087
+ start_time (Optional[int]): Timestamp in ms to get funding from INCLUSIVE.
3088
+ end_time (Optional[int]): Timestamp in ms to get funding until INCLUSIVE.
3089
+ limit (Optional[int]): Default 100; max 1000
3090
+ recv_window (Optional[int]):
3091
+
3092
+ Returns:
3093
+ ApiResponse[QueryCmModifyOrderHistoryResponse]
3094
+
3095
+ Raises:
3096
+ RequiredError: If a required parameter is missing.
3097
+
3098
+ """
3099
+
3100
+ return self._tradeApi.query_cm_modify_order_history(
3101
+ symbol,
3102
+ order_id,
3103
+ orig_client_order_id,
3104
+ start_time,
3105
+ end_time,
3106
+ limit,
3107
+ recv_window,
3108
+ )
3109
+
3110
+ def query_cm_order(
3111
+ self,
3112
+ symbol: str = None,
3113
+ order_id: Optional[int] = None,
3114
+ orig_client_order_id: Optional[str] = None,
3115
+ recv_window: Optional[int] = None,
3116
+ ) -> ApiResponse[QueryCmOrderResponse]:
3117
+ """
3118
+ Query CM Order(USER_DATA)
3119
+
3120
+ Check an CM order's status.
3121
+
3122
+ * Either `orderId` or `origClientOrderId` must be sent.
3123
+ * These orders will not be found:
3124
+ * order status is `CANCELED` or `EXPIRED`, **AND**
3125
+ * order has NO filled trade, **AND**
3126
+ * created time + 3 days < current time
3127
+
3128
+ Weight: 1
3129
+
3130
+ Args:
3131
+ symbol (str):
3132
+ order_id (Optional[int]):
3133
+ orig_client_order_id (Optional[str]):
3134
+ recv_window (Optional[int]):
3135
+
3136
+ Returns:
3137
+ ApiResponse[QueryCmOrderResponse]
3138
+
3139
+ Raises:
3140
+ RequiredError: If a required parameter is missing.
3141
+
3142
+ """
3143
+
3144
+ return self._tradeApi.query_cm_order(
3145
+ symbol, order_id, orig_client_order_id, recv_window
3146
+ )
3147
+
3148
+ def query_current_cm_open_conditional_order(
3149
+ self,
3150
+ symbol: str = None,
3151
+ strategy_id: Optional[int] = None,
3152
+ new_client_strategy_id: Optional[str] = None,
3153
+ recv_window: Optional[int] = None,
3154
+ ) -> ApiResponse[QueryCurrentCmOpenConditionalOrderResponse]:
3155
+ """
3156
+ Query Current CM Open Conditional Order(USER_DATA)
3157
+
3158
+ Query Current CM Open Conditional Order
3159
+
3160
+ * Either `strategyId` or `newClientStrategyId` must be sent.
3161
+ * If the queried order has been triggered, cancelled or expired, the error message "Order does not exist" will be returned.
3162
+
3163
+ Weight: 1
3164
+
3165
+ Args:
3166
+ symbol (str):
3167
+ strategy_id (Optional[int]):
3168
+ new_client_strategy_id (Optional[str]):
3169
+ recv_window (Optional[int]):
3170
+
3171
+ Returns:
3172
+ ApiResponse[QueryCurrentCmOpenConditionalOrderResponse]
3173
+
3174
+ Raises:
3175
+ RequiredError: If a required parameter is missing.
3176
+
3177
+ """
3178
+
3179
+ return self._tradeApi.query_current_cm_open_conditional_order(
3180
+ symbol, strategy_id, new_client_strategy_id, recv_window
3181
+ )
3182
+
3183
+ def query_current_cm_open_order(
3184
+ self,
3185
+ symbol: str = None,
3186
+ order_id: Optional[int] = None,
3187
+ orig_client_order_id: Optional[str] = None,
3188
+ recv_window: Optional[int] = None,
3189
+ ) -> ApiResponse[QueryCurrentCmOpenOrderResponse]:
3190
+ """
3191
+ Query Current CM Open Order (USER_DATA)
3192
+
3193
+ Query current CM open order
3194
+
3195
+ * Either `orderId` or `origClientOrderId` must be sent.
3196
+ * If the queried order has been filled or cancelled, the error message "Order does not exist" will be returned.
3197
+
3198
+ Weight: 1
3199
+
3200
+ Args:
3201
+ symbol (str):
3202
+ order_id (Optional[int]):
3203
+ orig_client_order_id (Optional[str]):
3204
+ recv_window (Optional[int]):
3205
+
3206
+ Returns:
3207
+ ApiResponse[QueryCurrentCmOpenOrderResponse]
3208
+
3209
+ Raises:
3210
+ RequiredError: If a required parameter is missing.
3211
+
3212
+ """
3213
+
3214
+ return self._tradeApi.query_current_cm_open_order(
3215
+ symbol, order_id, orig_client_order_id, recv_window
3216
+ )
3217
+
3218
+ def query_current_margin_open_order(
3219
+ self,
3220
+ symbol: str = None,
3221
+ recv_window: Optional[int] = None,
3222
+ ) -> ApiResponse[QueryCurrentMarginOpenOrderResponse]:
3223
+ """
3224
+ Query Current Margin Open Order (USER_DATA)
3225
+
3226
+ Query Current Margin Open Order
3227
+
3228
+ Weight: 5
3229
+
3230
+ Args:
3231
+ symbol (str):
3232
+ recv_window (Optional[int]):
3233
+
3234
+ Returns:
3235
+ ApiResponse[QueryCurrentMarginOpenOrderResponse]
3236
+
3237
+ Raises:
3238
+ RequiredError: If a required parameter is missing.
3239
+
3240
+ """
3241
+
3242
+ return self._tradeApi.query_current_margin_open_order(symbol, recv_window)
3243
+
3244
+ def query_current_um_open_conditional_order(
3245
+ self,
3246
+ symbol: str = None,
3247
+ strategy_id: Optional[int] = None,
3248
+ new_client_strategy_id: Optional[str] = None,
3249
+ recv_window: Optional[int] = None,
3250
+ ) -> ApiResponse[QueryCurrentUmOpenConditionalOrderResponse]:
3251
+ """
3252
+ Query Current UM Open Conditional Order(USER_DATA)
3253
+
3254
+ Query Current UM Open Conditional Order
3255
+
3256
+ * Either `strategyId` or `newClientStrategyId` must be sent.
3257
+ * If the queried order has been `CANCELED`, `TRIGGERED`或`EXPIRED`, the error message "Order does not exist" will be returned.
3258
+
3259
+ Weight: 1
3260
+
3261
+ Args:
3262
+ symbol (str):
3263
+ strategy_id (Optional[int]):
3264
+ new_client_strategy_id (Optional[str]):
3265
+ recv_window (Optional[int]):
3266
+
3267
+ Returns:
3268
+ ApiResponse[QueryCurrentUmOpenConditionalOrderResponse]
3269
+
3270
+ Raises:
3271
+ RequiredError: If a required parameter is missing.
3272
+
3273
+ """
3274
+
3275
+ return self._tradeApi.query_current_um_open_conditional_order(
3276
+ symbol, strategy_id, new_client_strategy_id, recv_window
3277
+ )
3278
+
3279
+ def query_current_um_open_order(
3280
+ self,
3281
+ symbol: str = None,
3282
+ order_id: Optional[int] = None,
3283
+ orig_client_order_id: Optional[str] = None,
3284
+ recv_window: Optional[int] = None,
3285
+ ) -> ApiResponse[QueryCurrentUmOpenOrderResponse]:
3286
+ """
3287
+ Query Current UM Open Order(USER_DATA)
3288
+
3289
+ Query current UM open order
3290
+
3291
+
3292
+ * Either `orderId` or `origClientOrderId` must be sent.
3293
+ * If the queried order has been filled or cancelled, the error message "Order does not exist" will be returned.
3294
+
3295
+ Weight: 1
3296
+
3297
+ Args:
3298
+ symbol (str):
3299
+ order_id (Optional[int]):
3300
+ orig_client_order_id (Optional[str]):
3301
+ recv_window (Optional[int]):
3302
+
3303
+ Returns:
3304
+ ApiResponse[QueryCurrentUmOpenOrderResponse]
3305
+
3306
+ Raises:
3307
+ RequiredError: If a required parameter is missing.
3308
+
3309
+ """
3310
+
3311
+ return self._tradeApi.query_current_um_open_order(
3312
+ symbol, order_id, orig_client_order_id, recv_window
3313
+ )
3314
+
3315
+ def query_margin_account_order(
3316
+ self,
3317
+ symbol: str = None,
3318
+ order_id: Optional[int] = None,
3319
+ orig_client_order_id: Optional[str] = None,
3320
+ recv_window: Optional[int] = None,
3321
+ ) -> ApiResponse[QueryMarginAccountOrderResponse]:
3322
+ """
3323
+ Query Margin Account Order (USER_DATA)
3324
+
3325
+ Query Margin Account Order
3326
+
3327
+ Weight: 10
3328
+
3329
+ Args:
3330
+ symbol (str):
3331
+ order_id (Optional[int]):
3332
+ orig_client_order_id (Optional[str]):
3333
+ recv_window (Optional[int]):
3334
+
3335
+ Returns:
3336
+ ApiResponse[QueryMarginAccountOrderResponse]
3337
+
3338
+ Raises:
3339
+ RequiredError: If a required parameter is missing.
3340
+
3341
+ """
3342
+
3343
+ return self._tradeApi.query_margin_account_order(
3344
+ symbol, order_id, orig_client_order_id, recv_window
3345
+ )
3346
+
3347
+ def query_margin_accounts_all_oco(
3348
+ self,
3349
+ from_id: Optional[int] = None,
3350
+ start_time: Optional[int] = None,
3351
+ end_time: Optional[int] = None,
3352
+ limit: Optional[int] = None,
3353
+ recv_window: Optional[int] = None,
3354
+ ) -> ApiResponse[QueryMarginAccountsAllOcoResponse]:
3355
+ """
3356
+ Query Margin Account's all OCO (USER_DATA)
3357
+
3358
+ Query all OCO for a specific margin account based on provided optional parameters
3359
+
3360
+ Weight: 100
3361
+
3362
+ Args:
3363
+ from_id (Optional[int]): Trade id to fetch from. Default gets most recent trades.
3364
+ start_time (Optional[int]): Timestamp in ms to get funding from INCLUSIVE.
3365
+ end_time (Optional[int]): Timestamp in ms to get funding until INCLUSIVE.
3366
+ limit (Optional[int]): Default 100; max 1000
3367
+ recv_window (Optional[int]):
3368
+
3369
+ Returns:
3370
+ ApiResponse[QueryMarginAccountsAllOcoResponse]
3371
+
3372
+ Raises:
3373
+ RequiredError: If a required parameter is missing.
3374
+
3375
+ """
3376
+
3377
+ return self._tradeApi.query_margin_accounts_all_oco(
3378
+ from_id, start_time, end_time, limit, recv_window
3379
+ )
3380
+
3381
+ def query_margin_accounts_oco(
3382
+ self,
3383
+ order_list_id: Optional[int] = None,
3384
+ orig_client_order_id: Optional[str] = None,
3385
+ recv_window: Optional[int] = None,
3386
+ ) -> ApiResponse[QueryMarginAccountsOcoResponse]:
3387
+ """
3388
+ Query Margin Account's OCO (USER_DATA)
3389
+
3390
+ Retrieves a specific OCO based on provided optional parameters
3391
+
3392
+ Weight: 5
3393
+
3394
+ Args:
3395
+ order_list_id (Optional[int]): Either `orderListId` or `listClientOrderId` must be provided
3396
+ orig_client_order_id (Optional[str]):
3397
+ recv_window (Optional[int]):
3398
+
3399
+ Returns:
3400
+ ApiResponse[QueryMarginAccountsOcoResponse]
3401
+
3402
+ Raises:
3403
+ RequiredError: If a required parameter is missing.
3404
+
3405
+ """
3406
+
3407
+ return self._tradeApi.query_margin_accounts_oco(
3408
+ order_list_id, orig_client_order_id, recv_window
3409
+ )
3410
+
3411
+ def query_margin_accounts_open_oco(
3412
+ self,
3413
+ recv_window: Optional[int] = None,
3414
+ ) -> ApiResponse[QueryMarginAccountsOpenOcoResponse]:
3415
+ """
3416
+ Query Margin Account's Open OCO (USER_DATA)
3417
+
3418
+ Query Margin Account's Open OCO
3419
+
3420
+ Weight: 5
3421
+
3422
+ Args:
3423
+ recv_window (Optional[int]):
3424
+
3425
+ Returns:
3426
+ ApiResponse[QueryMarginAccountsOpenOcoResponse]
3427
+
3428
+ Raises:
3429
+ RequiredError: If a required parameter is missing.
3430
+
3431
+ """
3432
+
3433
+ return self._tradeApi.query_margin_accounts_open_oco(recv_window)
3434
+
3435
+ def query_um_conditional_order_history(
3436
+ self,
3437
+ symbol: str = None,
3438
+ strategy_id: Optional[int] = None,
3439
+ new_client_strategy_id: Optional[str] = None,
3440
+ recv_window: Optional[int] = None,
3441
+ ) -> ApiResponse[QueryUmConditionalOrderHistoryResponse]:
3442
+ """
3443
+ Query UM Conditional Order History(USER_DATA)
3444
+
3445
+ Query UM Conditional Order History
3446
+
3447
+ * Either `strategyId` or `newClientStrategyId` must be sent.
3448
+ * `NEW` orders will not be found.
3449
+ * These orders will not be found:
3450
+ * order status is `CANCELED` or `EXPIRED`, **AND**
3451
+ * order has NO filled trade, **AND**
3452
+ * created time + 7 days < current time
3453
+
3454
+ Weight: 1
3455
+
3456
+ Args:
3457
+ symbol (str):
3458
+ strategy_id (Optional[int]):
3459
+ new_client_strategy_id (Optional[str]):
3460
+ recv_window (Optional[int]):
3461
+
3462
+ Returns:
3463
+ ApiResponse[QueryUmConditionalOrderHistoryResponse]
3464
+
3465
+ Raises:
3466
+ RequiredError: If a required parameter is missing.
3467
+
3468
+ """
3469
+
3470
+ return self._tradeApi.query_um_conditional_order_history(
3471
+ symbol, strategy_id, new_client_strategy_id, recv_window
3472
+ )
3473
+
3474
+ def query_um_modify_order_history(
3475
+ self,
3476
+ symbol: str = None,
3477
+ order_id: Optional[int] = None,
3478
+ orig_client_order_id: Optional[str] = None,
3479
+ start_time: Optional[int] = None,
3480
+ end_time: Optional[int] = None,
3481
+ limit: Optional[int] = None,
3482
+ recv_window: Optional[int] = None,
3483
+ ) -> ApiResponse[QueryUmModifyOrderHistoryResponse]:
3484
+ """
3485
+ Query UM Modify Order History(TRADE)
3486
+
3487
+ Get order modification history
3488
+
3489
+ * Either `orderId` or `origClientOrderId` must be sent, and the `orderId` will prevail if both are sent.
3490
+
3491
+ Weight: 1
3492
+
3493
+ Args:
3494
+ symbol (str):
3495
+ order_id (Optional[int]):
3496
+ orig_client_order_id (Optional[str]):
3497
+ start_time (Optional[int]): Timestamp in ms to get funding from INCLUSIVE.
3498
+ end_time (Optional[int]): Timestamp in ms to get funding until INCLUSIVE.
3499
+ limit (Optional[int]): Default 100; max 1000
3500
+ recv_window (Optional[int]):
3501
+
3502
+ Returns:
3503
+ ApiResponse[QueryUmModifyOrderHistoryResponse]
3504
+
3505
+ Raises:
3506
+ RequiredError: If a required parameter is missing.
3507
+
3508
+ """
3509
+
3510
+ return self._tradeApi.query_um_modify_order_history(
3511
+ symbol,
3512
+ order_id,
3513
+ orig_client_order_id,
3514
+ start_time,
3515
+ end_time,
3516
+ limit,
3517
+ recv_window,
3518
+ )
3519
+
3520
+ def query_um_order(
3521
+ self,
3522
+ symbol: str = None,
3523
+ order_id: Optional[int] = None,
3524
+ orig_client_order_id: Optional[str] = None,
3525
+ recv_window: Optional[int] = None,
3526
+ ) -> ApiResponse[QueryUmOrderResponse]:
3527
+ """
3528
+ Query UM Order (USER_DATA)
3529
+
3530
+ Check an UM order's status.
3531
+
3532
+ * These orders will not be found:
3533
+ * Either `orderId` or `origClientOrderId` must be sent.
3534
+ * order status is `CANCELED` or `EXPIRED`, **AND**
3535
+ * order has NO filled trade, **AND**
3536
+ * created time + 3 days < current time
3537
+
3538
+ Weight: 1
3539
+
3540
+ Args:
3541
+ symbol (str):
3542
+ order_id (Optional[int]):
3543
+ orig_client_order_id (Optional[str]):
3544
+ recv_window (Optional[int]):
3545
+
3546
+ Returns:
3547
+ ApiResponse[QueryUmOrderResponse]
3548
+
3549
+ Raises:
3550
+ RequiredError: If a required parameter is missing.
3551
+
3552
+ """
3553
+
3554
+ return self._tradeApi.query_um_order(
3555
+ symbol, order_id, orig_client_order_id, recv_window
3556
+ )
3557
+
3558
+ def query_users_cm_force_orders(
3559
+ self,
3560
+ symbol: Optional[str] = None,
3561
+ auto_close_type: Optional[QueryUsersCmForceOrdersAutoCloseTypeEnum] = None,
3562
+ start_time: Optional[int] = None,
3563
+ end_time: Optional[int] = None,
3564
+ limit: Optional[int] = None,
3565
+ recv_window: Optional[int] = None,
3566
+ ) -> ApiResponse[QueryUsersCmForceOrdersResponse]:
3567
+ """
3568
+ Query User's CM Force Orders(USER_DATA)
3569
+
3570
+ Query User's CM Force Orders
3571
+
3572
+ * If "autoCloseType" is not sent, orders with both of the types will be returned
3573
+ * If "startTime" is not sent, data within 7 days before "endTime" can be queried
3574
+
3575
+ Weight: 20 with symbol, 50 without symbol
3576
+
3577
+ Args:
3578
+ symbol (Optional[str]):
3579
+ auto_close_type (Optional[QueryUsersCmForceOrdersAutoCloseTypeEnum]): `LIQUIDATION` for liquidation orders, `ADL` for ADL orders.
3580
+ start_time (Optional[int]): Timestamp in ms to get funding from INCLUSIVE.
3581
+ end_time (Optional[int]): Timestamp in ms to get funding until INCLUSIVE.
3582
+ limit (Optional[int]): Default 100; max 1000
3583
+ recv_window (Optional[int]):
3584
+
3585
+ Returns:
3586
+ ApiResponse[QueryUsersCmForceOrdersResponse]
3587
+
3588
+ Raises:
3589
+ RequiredError: If a required parameter is missing.
3590
+
3591
+ """
3592
+
3593
+ return self._tradeApi.query_users_cm_force_orders(
3594
+ symbol, auto_close_type, start_time, end_time, limit, recv_window
3595
+ )
3596
+
3597
+ def query_users_margin_force_orders(
3598
+ self,
3599
+ start_time: Optional[int] = None,
3600
+ end_time: Optional[int] = None,
3601
+ current: Optional[int] = None,
3602
+ size: Optional[int] = None,
3603
+ recv_window: Optional[int] = None,
3604
+ ) -> ApiResponse[QueryUsersMarginForceOrdersResponse]:
3605
+ """
3606
+ Query User's Margin Force Orders(USER_DATA)
3607
+
3608
+ Query user's margin force orders
3609
+
3610
+ Weight: 1
3611
+
3612
+ Args:
3613
+ start_time (Optional[int]): Timestamp in ms to get funding from INCLUSIVE.
3614
+ end_time (Optional[int]): Timestamp in ms to get funding until INCLUSIVE.
3615
+ current (Optional[int]): Currently querying page. Start from 1. Default:1
3616
+ size (Optional[int]): Default:10 Max:100
3617
+ recv_window (Optional[int]):
3618
+
3619
+ Returns:
3620
+ ApiResponse[QueryUsersMarginForceOrdersResponse]
3621
+
3622
+ Raises:
3623
+ RequiredError: If a required parameter is missing.
3624
+
3625
+ """
3626
+
3627
+ return self._tradeApi.query_users_margin_force_orders(
3628
+ start_time, end_time, current, size, recv_window
3629
+ )
3630
+
3631
+ def query_users_um_force_orders(
3632
+ self,
3633
+ symbol: Optional[str] = None,
3634
+ auto_close_type: Optional[QueryUsersUmForceOrdersAutoCloseTypeEnum] = None,
3635
+ start_time: Optional[int] = None,
3636
+ end_time: Optional[int] = None,
3637
+ limit: Optional[int] = None,
3638
+ recv_window: Optional[int] = None,
3639
+ ) -> ApiResponse[QueryUsersUmForceOrdersResponse]:
3640
+ """
3641
+ Query User's UM Force Orders (USER_DATA)
3642
+
3643
+ Query User's UM Force Orders
3644
+
3645
+ * If `autoCloseType` is not sent, orders with both of the types will be returned
3646
+ * If `startTime` is not sent, data within 7 days before `endTime` can be queried
3647
+
3648
+ Weight: 20 with symbol, 50 without symbol
3649
+
3650
+ Args:
3651
+ symbol (Optional[str]):
3652
+ auto_close_type (Optional[QueryUsersUmForceOrdersAutoCloseTypeEnum]): `LIQUIDATION` for liquidation orders, `ADL` for ADL orders.
3653
+ start_time (Optional[int]): Timestamp in ms to get funding from INCLUSIVE.
3654
+ end_time (Optional[int]): Timestamp in ms to get funding until INCLUSIVE.
3655
+ limit (Optional[int]): Default 100; max 1000
3656
+ recv_window (Optional[int]):
3657
+
3658
+ Returns:
3659
+ ApiResponse[QueryUsersUmForceOrdersResponse]
3660
+
3661
+ Raises:
3662
+ RequiredError: If a required parameter is missing.
3663
+
3664
+ """
3665
+
3666
+ return self._tradeApi.query_users_um_force_orders(
3667
+ symbol, auto_close_type, start_time, end_time, limit, recv_window
3668
+ )
3669
+
3670
+ def toggle_bnb_burn_on_um_futures_trade(
3671
+ self,
3672
+ fee_burn: str = None,
3673
+ recv_window: Optional[int] = None,
3674
+ ) -> ApiResponse[ToggleBnbBurnOnUmFuturesTradeResponse]:
3675
+ """
3676
+ Toggle BNB Burn On UM Futures Trade (TRADE)
3677
+
3678
+ Change user's BNB Fee Discount for UM Futures (Fee Discount On or Fee Discount Off ) on ***EVERY symbol***
3679
+
3680
+
3681
+ * The BNB would not be collected from UM-PM account to the Portfolio Margin account.
3682
+
3683
+ Weight: 1
3684
+
3685
+ Args:
3686
+ fee_burn (str): "true": Fee Discount On; "false": Fee Discount Off
3687
+ recv_window (Optional[int]):
3688
+
3689
+ Returns:
3690
+ ApiResponse[ToggleBnbBurnOnUmFuturesTradeResponse]
3691
+
3692
+ Raises:
3693
+ RequiredError: If a required parameter is missing.
3694
+
3695
+ """
3696
+
3697
+ return self._tradeApi.toggle_bnb_burn_on_um_futures_trade(fee_burn, recv_window)
3698
+
3699
+ def um_account_trade_list(
3700
+ self,
3701
+ symbol: str = None,
3702
+ start_time: Optional[int] = None,
3703
+ end_time: Optional[int] = None,
3704
+ from_id: Optional[int] = None,
3705
+ limit: Optional[int] = None,
3706
+ recv_window: Optional[int] = None,
3707
+ ) -> ApiResponse[UmAccountTradeListResponse]:
3708
+ """
3709
+ UM Account Trade List(USER_DATA)
3710
+
3711
+ Get trades for a specific account and UM symbol.
3712
+
3713
+
3714
+ * If `startTime` and `endTime` are both not sent, then the last '7 days' data will be returned.
3715
+ * The time between `startTime` and `endTime` cannot be longer than 7 days.
3716
+ * The parameter `fromId` cannot be sent with `startTime` or `endTime`.
3717
+
3718
+ Weight: 5
3719
+
3720
+ Args:
3721
+ symbol (str):
3722
+ start_time (Optional[int]): Timestamp in ms to get funding from INCLUSIVE.
3723
+ end_time (Optional[int]): Timestamp in ms to get funding until INCLUSIVE.
3724
+ from_id (Optional[int]): Trade id to fetch from. Default gets most recent trades.
3725
+ limit (Optional[int]): Default 100; max 1000
3726
+ recv_window (Optional[int]):
3727
+
3728
+ Returns:
3729
+ ApiResponse[UmAccountTradeListResponse]
3730
+
3731
+ Raises:
3732
+ RequiredError: If a required parameter is missing.
3733
+
3734
+ """
3735
+
3736
+ return self._tradeApi.um_account_trade_list(
3737
+ symbol, start_time, end_time, from_id, limit, recv_window
3738
+ )
3739
+
3740
+ def um_position_adl_quantile_estimation(
3741
+ self,
3742
+ symbol: Optional[str] = None,
3743
+ recv_window: Optional[int] = None,
3744
+ ) -> ApiResponse[UmPositionAdlQuantileEstimationResponse]:
3745
+ """
3746
+ UM Position ADL Quantile Estimation(USER_DATA)
3747
+
3748
+ Query UM Position ADL Quantile Estimation
3749
+
3750
+ * Values update every 30s.
3751
+ * Values 0, 1, 2, 3, 4 shows the queue position and possibility of ADL from low to high.
3752
+ * For positions of the symbol are in One-way Mode or isolated margined in Hedge Mode, "LONG", "SHORT", and "BOTH" will be returned to show the positions' adl quantiles of different position sides.
3753
+ * If the positions of the symbol are crossed margined in Hedge Mode:
3754
+ * "HEDGE" as a sign will be returned instead of "BOTH";
3755
+ * A same value caculated on unrealized pnls on long and short sides' positions will be shown for "LONG" and "SHORT" when there are positions in both of long and short sides.
3756
+
3757
+ Weight: 5
3758
+
3759
+ Args:
3760
+ symbol (Optional[str]):
3761
+ recv_window (Optional[int]):
3762
+
3763
+ Returns:
3764
+ ApiResponse[UmPositionAdlQuantileEstimationResponse]
3765
+
3766
+ Raises:
3767
+ RequiredError: If a required parameter is missing.
3768
+
3769
+ """
3770
+
3771
+ return self._tradeApi.um_position_adl_quantile_estimation(symbol, recv_window)
3772
+
3773
+ def close_user_data_stream(
3774
+ self,
3775
+ ) -> ApiResponse[None]:
3776
+ """
3777
+ Close User Data Stream(USER_STREAM)
3778
+
3779
+ Close out a user data stream.
3780
+
3781
+ Weight: 1
3782
+
3783
+ Args:
3784
+
3785
+ Returns:
3786
+ ApiResponse[None]
3787
+
3788
+ Raises:
3789
+ RequiredError: If a required parameter is missing.
3790
+
3791
+ """
3792
+
3793
+ return self._userDataStreamsApi.close_user_data_stream()
3794
+
3795
+ def keepalive_user_data_stream(
3796
+ self,
3797
+ ) -> ApiResponse[None]:
3798
+ """
3799
+ Keepalive User Data Stream (USER_STREAM)
3800
+
3801
+ Keepalive a user data stream to prevent a time out. User data streams will close after 60 minutes. It's recommended to send a ping about every 60 minutes.
3802
+
3803
+ Weight: 1
3804
+
3805
+ Args:
3806
+
3807
+ Returns:
3808
+ ApiResponse[None]
3809
+
3810
+ Raises:
3811
+ RequiredError: If a required parameter is missing.
3812
+
3813
+ """
3814
+
3815
+ return self._userDataStreamsApi.keepalive_user_data_stream()
3816
+
3817
+ def start_user_data_stream(
3818
+ self,
3819
+ ) -> ApiResponse[StartUserDataStreamResponse]:
3820
+ """
3821
+ Start User Data Stream(USER_STREAM)
3822
+
3823
+ Start a new user data stream. The stream will close after 60 minutes unless a keepalive is sent. If the account has an active `listenKey`, that `listenKey` will be returned and its validity will be extended for 60 minutes.
3824
+
3825
+ Weight: 1
3826
+
3827
+ Args:
3828
+
3829
+ Returns:
3830
+ ApiResponse[StartUserDataStreamResponse]
3831
+
3832
+ Raises:
3833
+ RequiredError: If a required parameter is missing.
3834
+
3835
+ """
3836
+
3837
+ return self._userDataStreamsApi.start_user_data_stream()