whitebit-python-sdk 1.1.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.
Files changed (451) hide show
  1. whitebit/__init__.py +793 -0
  2. whitebit/client.py +580 -0
  3. whitebit/codes/__init__.py +7 -0
  4. whitebit/codes/client.py +510 -0
  5. whitebit/codes/raw_client.py +809 -0
  6. whitebit/codes/types/__init__.py +10 -0
  7. whitebit/codes/types/apply_code_response.py +22 -0
  8. whitebit/codes/types/create_code_response.py +32 -0
  9. whitebit/codes/types/get_codes_history_response.py +27 -0
  10. whitebit/codes/types/get_my_codes_response.py +27 -0
  11. whitebit/collateral_trading/__init__.py +183 -0
  12. whitebit/collateral_trading/client.py +2452 -0
  13. whitebit/collateral_trading/raw_client.py +4337 -0
  14. whitebit/collateral_trading/types/__init__.py +213 -0
  15. whitebit/collateral_trading/types/cancel_oco_order_response.py +34 -0
  16. whitebit/collateral_trading/types/cancel_oco_order_response_stop_loss.py +146 -0
  17. whitebit/collateral_trading/types/cancel_oco_order_response_stop_loss_activation_condition.py +5 -0
  18. whitebit/collateral_trading/types/cancel_oco_order_response_stop_loss_side.py +5 -0
  19. whitebit/collateral_trading/types/cancel_oco_order_response_take_profit.py +114 -0
  20. whitebit/collateral_trading/types/cancel_oco_order_response_take_profit_side.py +5 -0
  21. whitebit/collateral_trading/types/change_collateral_account_leverage_response.py +22 -0
  22. whitebit/collateral_trading/types/close_position_request_position_side.py +5 -0
  23. whitebit/collateral_trading/types/collateral_account_balance_summary_response_item.py +48 -0
  24. whitebit/collateral_trading/types/collateral_account_summary_response.py +60 -0
  25. whitebit/collateral_trading/types/create_collateral_bulk_order_request_orders_item.py +98 -0
  26. whitebit/collateral_trading/types/create_collateral_bulk_order_request_orders_item_position_side.py +7 -0
  27. whitebit/collateral_trading/types/create_collateral_bulk_order_request_orders_item_side.py +5 -0
  28. whitebit/collateral_trading/types/create_collateral_bulk_order_response_item.py +29 -0
  29. whitebit/collateral_trading/types/create_collateral_bulk_order_response_item_error.py +36 -0
  30. whitebit/collateral_trading/types/create_collateral_bulk_order_response_item_result.py +132 -0
  31. whitebit/collateral_trading/types/create_collateral_bulk_order_response_item_result_position_side.py +7 -0
  32. whitebit/collateral_trading/types/create_collateral_bulk_order_response_item_result_side.py +5 -0
  33. whitebit/collateral_trading/types/create_collateral_bulk_order_response_item_result_status.py +7 -0
  34. whitebit/collateral_trading/types/create_collateral_limit_order_request_position_side.py +5 -0
  35. whitebit/collateral_trading/types/create_collateral_limit_order_request_side.py +5 -0
  36. whitebit/collateral_trading/types/create_collateral_limit_order_response.py +132 -0
  37. whitebit/collateral_trading/types/create_collateral_limit_order_response_oto.py +44 -0
  38. whitebit/collateral_trading/types/create_collateral_limit_order_response_position_side.py +5 -0
  39. whitebit/collateral_trading/types/create_collateral_limit_order_response_side.py +5 -0
  40. whitebit/collateral_trading/types/create_collateral_limit_order_response_status.py +7 -0
  41. whitebit/collateral_trading/types/create_collateral_market_order_request_position_side.py +5 -0
  42. whitebit/collateral_trading/types/create_collateral_market_order_request_side.py +5 -0
  43. whitebit/collateral_trading/types/create_collateral_market_order_response.py +110 -0
  44. whitebit/collateral_trading/types/create_collateral_market_order_response_oto.py +44 -0
  45. whitebit/collateral_trading/types/create_collateral_market_order_response_position_side.py +5 -0
  46. whitebit/collateral_trading/types/create_collateral_market_order_response_side.py +5 -0
  47. whitebit/collateral_trading/types/create_collateral_market_order_response_status.py +7 -0
  48. whitebit/collateral_trading/types/create_collateral_oco_order_request_side.py +5 -0
  49. whitebit/collateral_trading/types/create_collateral_oco_order_response.py +34 -0
  50. whitebit/collateral_trading/types/create_collateral_oco_order_response_stop_loss.py +159 -0
  51. whitebit/collateral_trading/types/create_collateral_oco_order_response_stop_loss_activation_condition.py +5 -0
  52. whitebit/collateral_trading/types/create_collateral_oco_order_response_stop_loss_position_side.py +5 -0
  53. whitebit/collateral_trading/types/create_collateral_oco_order_response_stop_loss_side.py +5 -0
  54. whitebit/collateral_trading/types/create_collateral_oco_order_response_stop_loss_status.py +7 -0
  55. whitebit/collateral_trading/types/create_collateral_oco_order_response_take_profit.py +139 -0
  56. whitebit/collateral_trading/types/create_collateral_oco_order_response_take_profit_position_side.py +7 -0
  57. whitebit/collateral_trading/types/create_collateral_oco_order_response_take_profit_side.py +5 -0
  58. whitebit/collateral_trading/types/create_collateral_oco_order_response_take_profit_status.py +7 -0
  59. whitebit/collateral_trading/types/create_collateral_stop_limit_order_request_position_side.py +5 -0
  60. whitebit/collateral_trading/types/create_collateral_stop_limit_order_request_side.py +5 -0
  61. whitebit/collateral_trading/types/create_collateral_stop_limit_order_response.py +122 -0
  62. whitebit/collateral_trading/types/create_collateral_stop_limit_order_response_oto.py +44 -0
  63. whitebit/collateral_trading/types/create_collateral_stop_limit_order_response_position_side.py +5 -0
  64. whitebit/collateral_trading/types/create_collateral_stop_limit_order_response_side.py +5 -0
  65. whitebit/collateral_trading/types/create_collateral_stop_limit_order_response_status.py +7 -0
  66. whitebit/collateral_trading/types/create_collateral_trigger_market_order_request_position_side.py +7 -0
  67. whitebit/collateral_trading/types/create_collateral_trigger_market_order_request_side.py +5 -0
  68. whitebit/collateral_trading/types/create_collateral_trigger_market_order_response.py +117 -0
  69. whitebit/collateral_trading/types/create_collateral_trigger_market_order_response_oto.py +44 -0
  70. whitebit/collateral_trading/types/create_collateral_trigger_market_order_response_position_side.py +7 -0
  71. whitebit/collateral_trading/types/create_collateral_trigger_market_order_response_side.py +5 -0
  72. whitebit/collateral_trading/types/create_collateral_trigger_market_order_response_status.py +7 -0
  73. whitebit/collateral_trading/types/get_collateral_hedge_mode_response.py +26 -0
  74. whitebit/collateral_trading/types/get_conditional_orders_response.py +38 -0
  75. whitebit/collateral_trading/types/get_conditional_orders_response_records_item.py +60 -0
  76. whitebit/collateral_trading/types/get_conditional_orders_response_records_item_oco.py +31 -0
  77. whitebit/collateral_trading/types/get_conditional_orders_response_records_item_oco_stop_loss.py +28 -0
  78. whitebit/collateral_trading/types/get_conditional_orders_response_records_item_oco_stop_loss_position_side.py +7 -0
  79. whitebit/collateral_trading/types/get_conditional_orders_response_records_item_oco_take_profit.py +28 -0
  80. whitebit/collateral_trading/types/get_conditional_orders_response_records_item_oco_take_profit_position_side.py +7 -0
  81. whitebit/collateral_trading/types/get_conditional_orders_response_records_item_oto.py +34 -0
  82. whitebit/collateral_trading/types/get_conditional_orders_response_records_item_oto_conditional_order.py +30 -0
  83. whitebit/collateral_trading/types/get_conditional_orders_response_records_item_oto_conditional_order_position_side.py +7 -0
  84. whitebit/collateral_trading/types/get_funding_history_response.py +33 -0
  85. whitebit/collateral_trading/types/get_funding_history_response_records_item.py +66 -0
  86. whitebit/collateral_trading/types/get_oco_orders_response_item.py +34 -0
  87. whitebit/collateral_trading/types/get_oco_orders_response_item_stop_loss.py +49 -0
  88. whitebit/collateral_trading/types/get_oco_orders_response_item_stop_loss_activation_condition.py +5 -0
  89. whitebit/collateral_trading/types/get_oco_orders_response_item_stop_loss_side.py +5 -0
  90. whitebit/collateral_trading/types/get_oco_orders_response_item_take_profit.py +43 -0
  91. whitebit/collateral_trading/types/get_oco_orders_response_item_take_profit_side.py +5 -0
  92. whitebit/collateral_trading/types/get_open_positions_response_item.py +136 -0
  93. whitebit/collateral_trading/types/get_open_positions_response_item_liquidation_state.py +5 -0
  94. whitebit/collateral_trading/types/get_open_positions_response_item_position_side.py +5 -0
  95. whitebit/collateral_trading/types/get_open_positions_response_item_tpsl.py +51 -0
  96. whitebit/collateral_trading/types/get_positions_history_response_item.py +95 -0
  97. whitebit/collateral_trading/types/get_positions_history_response_item_liquidation_state.py +5 -0
  98. whitebit/collateral_trading/types/get_positions_history_response_item_order_detail.py +61 -0
  99. whitebit/collateral_trading/types/get_positions_history_response_item_position_side.py +5 -0
  100. whitebit/core/__init__.py +52 -0
  101. whitebit/core/api_error.py +23 -0
  102. whitebit/core/client_wrapper.py +57 -0
  103. whitebit/core/datetime_utils.py +28 -0
  104. whitebit/core/file.py +67 -0
  105. whitebit/core/http_client.py +497 -0
  106. whitebit/core/http_response.py +55 -0
  107. whitebit/core/jsonable_encoder.py +100 -0
  108. whitebit/core/pydantic_utilities.py +255 -0
  109. whitebit/core/query_encoder.py +58 -0
  110. whitebit/core/remove_none_from_dict.py +11 -0
  111. whitebit/core/request_options.py +35 -0
  112. whitebit/core/serialization.py +276 -0
  113. whitebit/credit_line/__init__.py +4 -0
  114. whitebit/credit_line/client.py +128 -0
  115. whitebit/credit_line/raw_client.py +191 -0
  116. whitebit/crypto_lending_fixed/__init__.py +7 -0
  117. whitebit/crypto_lending_fixed/client.py +651 -0
  118. whitebit/crypto_lending_fixed/raw_client.py +931 -0
  119. whitebit/crypto_lending_fixed/types/__init__.py +9 -0
  120. whitebit/crypto_lending_fixed/types/create_fixed_investment_response.py +22 -0
  121. whitebit/crypto_lending_fixed/types/get_fixed_investments_history_response.py +22 -0
  122. whitebit/crypto_lending_fixed/types/get_interest_payment_history_response.py +22 -0
  123. whitebit/crypto_lending_flex/__init__.py +29 -0
  124. whitebit/crypto_lending_flex/client.py +1140 -0
  125. whitebit/crypto_lending_flex/raw_client.py +1651 -0
  126. whitebit/crypto_lending_flex/types/__init__.py +27 -0
  127. whitebit/crypto_lending_flex/types/close_flex_investment_response.py +20 -0
  128. whitebit/crypto_lending_flex/types/close_flex_investment_response_data.py +26 -0
  129. whitebit/crypto_lending_flex/types/create_flex_investment_response.py +20 -0
  130. whitebit/crypto_lending_flex/types/create_flex_investment_response_data.py +26 -0
  131. whitebit/crypto_lending_flex/types/get_flex_investment_history_response.py +22 -0
  132. whitebit/crypto_lending_flex/types/get_flex_payment_history_response.py +22 -0
  133. whitebit/crypto_lending_flex/types/get_user_flex_investments_response.py +22 -0
  134. whitebit/crypto_lending_flex/types/update_flex_auto_reinvestment_response.py +19 -0
  135. whitebit/crypto_lending_flex/types/withdraw_from_flex_investment_response.py +20 -0
  136. whitebit/crypto_lending_flex/types/withdraw_from_flex_investment_response_data.py +26 -0
  137. whitebit/deposit/__init__.py +35 -0
  138. whitebit/deposit/client.py +997 -0
  139. whitebit/deposit/raw_client.py +1342 -0
  140. whitebit/deposit/types/__init__.py +33 -0
  141. whitebit/deposit/types/create_new_address_request_type.py +5 -0
  142. whitebit/deposit/types/create_new_address_response.py +22 -0
  143. whitebit/deposit/types/create_new_address_response_account.py +27 -0
  144. whitebit/deposit/types/create_new_address_response_required.py +48 -0
  145. whitebit/deposit/types/create_new_address_response_required_flex_fee.py +42 -0
  146. whitebit/deposit/types/get_deposit_address_response.py +22 -0
  147. whitebit/deposit/types/get_deposit_address_response_account.py +27 -0
  148. whitebit/deposit/types/get_deposit_address_response_required.py +48 -0
  149. whitebit/deposit/types/get_deposit_address_response_required_flex_fee.py +42 -0
  150. whitebit/deposit/types/get_fiat_deposit_url_request_customer.py +61 -0
  151. whitebit/deposit/types/get_fiat_deposit_url_request_customer_address.py +56 -0
  152. whitebit/deposit/types/get_fiat_deposit_url_response.py +22 -0
  153. whitebit/deposit/types/refund_deposit_response.py +22 -0
  154. whitebit/environment.py +17 -0
  155. whitebit/errors/__init__.py +19 -0
  156. whitebit/errors/bad_request_error.py +10 -0
  157. whitebit/errors/internal_server_error.py +10 -0
  158. whitebit/errors/not_found_error.py +11 -0
  159. whitebit/errors/service_unavailable_error.py +10 -0
  160. whitebit/errors/unauthorized_error.py +10 -0
  161. whitebit/errors/unprocessable_entity_error.py +10 -0
  162. whitebit/fees/__init__.py +4 -0
  163. whitebit/fees/client.py +126 -0
  164. whitebit/fees/raw_client.py +144 -0
  165. whitebit/jwt/__init__.py +7 -0
  166. whitebit/jwt/client.py +224 -0
  167. whitebit/jwt/raw_client.py +389 -0
  168. whitebit/jwt/types/__init__.py +9 -0
  169. whitebit/jwt/types/get_web_socket_token_response.py +22 -0
  170. whitebit/jwt/types/issue_jwt_token_response.py +20 -0
  171. whitebit/jwt/types/issue_jwt_token_response_data.py +27 -0
  172. whitebit/main_account/__init__.py +7 -0
  173. whitebit/main_account/client.py +380 -0
  174. whitebit/main_account/raw_client.py +493 -0
  175. whitebit/main_account/types/__init__.py +8 -0
  176. whitebit/main_account/types/get_deposit_withdraw_history_response.py +26 -0
  177. whitebit/main_account/types/get_main_balance_response_value.py +22 -0
  178. whitebit/market_fee/__init__.py +7 -0
  179. whitebit/market_fee/client.py +193 -0
  180. whitebit/market_fee/raw_client.py +267 -0
  181. whitebit/market_fee/types/__init__.py +8 -0
  182. whitebit/market_fee/types/get_all_market_fees_response.py +43 -0
  183. whitebit/market_fee/types/get_market_fee_response.py +38 -0
  184. whitebit/mining_pool/__init__.py +67 -0
  185. whitebit/mining_pool/client.py +1083 -0
  186. whitebit/mining_pool/raw_client.py +1695 -0
  187. whitebit/mining_pool/types/__init__.py +69 -0
  188. whitebit/mining_pool/types/create_mining_account_response.py +20 -0
  189. whitebit/mining_pool/types/create_mining_account_response_data.py +31 -0
  190. whitebit/mining_pool/types/create_mining_watcher_link_request_live_until.py +5 -0
  191. whitebit/mining_pool/types/create_mining_watcher_link_request_permissions_item.py +7 -0
  192. whitebit/mining_pool/types/create_mining_watcher_link_response.py +20 -0
  193. whitebit/mining_pool/types/create_mining_watcher_link_response_data.py +24 -0
  194. whitebit/mining_pool/types/get_mining_accounts_response.py +20 -0
  195. whitebit/mining_pool/types/get_mining_accounts_response_data_item.py +31 -0
  196. whitebit/mining_pool/types/get_mining_hashrate_request_interval.py +5 -0
  197. whitebit/mining_pool/types/get_mining_hashrate_response.py +20 -0
  198. whitebit/mining_pool/types/get_mining_hashrate_response_data.py +21 -0
  199. whitebit/mining_pool/types/get_mining_hashrate_response_data_hashrate_item.py +20 -0
  200. whitebit/mining_pool/types/get_mining_miner_info_response.py +20 -0
  201. whitebit/mining_pool/types/get_mining_miner_info_response_data.py +25 -0
  202. whitebit/mining_pool/types/get_mining_miner_info_response_data_stratum_item.py +22 -0
  203. whitebit/mining_pool/types/get_mining_payout_destination_response.py +36 -0
  204. whitebit/mining_pool/types/get_mining_payout_destination_response_payout_destination.py +7 -0
  205. whitebit/mining_pool/types/get_mining_rewards_response.py +22 -0
  206. whitebit/mining_pool/types/get_mining_worker_hashrate_request_interval.py +5 -0
  207. whitebit/mining_pool/types/get_mining_worker_hashrate_response.py +20 -0
  208. whitebit/mining_pool/types/get_mining_worker_hashrate_response_data.py +20 -0
  209. whitebit/mining_pool/types/get_mining_worker_hashrate_response_data_hashrates_item.py +23 -0
  210. whitebit/mining_pool/types/get_mining_worker_names_response.py +22 -0
  211. whitebit/mining_pool/types/get_mining_worker_names_response_data.py +19 -0
  212. whitebit/mining_pool/types/list_mining_watcher_links_response.py +20 -0
  213. whitebit/mining_pool/types/list_mining_watcher_links_response_data_item.py +27 -0
  214. whitebit/mining_pool/types/set_mining_payout_destination_request_destination.py +7 -0
  215. whitebit/mining_pool/types/set_mining_payout_destination_response.py +27 -0
  216. whitebit/mining_pool/types/set_mining_payout_destination_response_payout_destination.py +7 -0
  217. whitebit/public_api_v4/__init__.py +37 -0
  218. whitebit/public_api_v4/client.py +1096 -0
  219. whitebit/public_api_v4/raw_client.py +1398 -0
  220. whitebit/public_api_v4/types/__init__.py +37 -0
  221. whitebit/public_api_v4/types/get_api_v4public_funding_history_market_response_item.py +52 -0
  222. whitebit/public_api_v4/types/get_api_v4public_futures_response.py +22 -0
  223. whitebit/public_api_v4/types/get_api_v4public_markets_response_item.py +110 -0
  224. whitebit/public_api_v4/types/get_api_v4public_markets_response_item_type.py +5 -0
  225. whitebit/public_api_v4/types/get_api_v4public_mining_pool_response.py +20 -0
  226. whitebit/public_api_v4/types/get_api_v4public_mining_pool_response_data.py +39 -0
  227. whitebit/public_api_v4/types/get_api_v4public_mining_pool_response_data_blocks_item.py +22 -0
  228. whitebit/public_api_v4/types/get_api_v4public_mining_pool_response_data_last7days_hash_rate_item.py +20 -0
  229. whitebit/public_api_v4/types/get_api_v4public_platform_status_response.py +22 -0
  230. whitebit/public_api_v4/types/get_api_v4public_ticker_response_value.py +56 -0
  231. whitebit/public_api_v4/types/get_api_v4public_time_response.py +22 -0
  232. whitebit/public_api_v4/types/get_api_v4public_trades_market_request_type.py +5 -0
  233. whitebit/public_api_v4/types/get_api_v4public_trades_market_response_item.py +57 -0
  234. whitebit/public_api_v4/types/get_api_v4public_trades_market_response_item_type.py +5 -0
  235. whitebit/raw_client.py +637 -0
  236. whitebit/spot_trading/__init__.py +47 -0
  237. whitebit/spot_trading/client.py +4143 -0
  238. whitebit/spot_trading/raw_client.py +5628 -0
  239. whitebit/spot_trading/types/__init__.py +45 -0
  240. whitebit/spot_trading/types/cancel_all_orders_request_type_item.py +5 -0
  241. whitebit/spot_trading/types/get_executed_order_history_response_value_item.py +62 -0
  242. whitebit/spot_trading/types/get_executed_order_history_response_value_item_side.py +5 -0
  243. whitebit/spot_trading/types/get_kill_switch_status_response_item.py +44 -0
  244. whitebit/spot_trading/types/get_kill_switch_status_response_item_types_item.py +5 -0
  245. whitebit/spot_trading/types/get_order_deals_response.py +33 -0
  246. whitebit/spot_trading/types/get_order_deals_response_records_item.py +80 -0
  247. whitebit/spot_trading/types/get_order_history_response_value_item.py +131 -0
  248. whitebit/spot_trading/types/get_order_history_response_value_item_side.py +5 -0
  249. whitebit/spot_trading/types/limit_order_request_side.py +5 -0
  250. whitebit/spot_trading/types/limit_order_request_stp.py +5 -0
  251. whitebit/spot_trading/types/set_kill_switch_request_types_item.py +5 -0
  252. whitebit/spot_trading/types/set_kill_switch_response.py +44 -0
  253. whitebit/spot_trading/types/set_kill_switch_response_types_item.py +5 -0
  254. whitebit/spot_trading/types/stop_limit_order_request_side.py +5 -0
  255. whitebit/spot_trading/types/stop_limit_order_request_stp.py +5 -0
  256. whitebit/spot_trading/types/stop_market_order_request_side.py +5 -0
  257. whitebit/spot_trading/types/stop_market_order_request_stp.py +5 -0
  258. whitebit/spot_trading/types/trade_account_balance_response_value.py +27 -0
  259. whitebit/sub_account/__init__.py +25 -0
  260. whitebit/sub_account/client.py +892 -0
  261. whitebit/sub_account/raw_client.py +1399 -0
  262. whitebit/sub_account/types/__init__.py +23 -0
  263. whitebit/sub_account/types/create_sub_account_request_permissions.py +29 -0
  264. whitebit/sub_account/types/edit_sub_account_request_permissions.py +29 -0
  265. whitebit/sub_account/types/get_sub_account_balances_response_value_item.py +21 -0
  266. whitebit/sub_account/types/get_sub_account_transfer_history_request_direction.py +5 -0
  267. whitebit/sub_account/types/get_sub_account_transfer_history_response.py +22 -0
  268. whitebit/sub_account/types/list_sub_accounts_response.py +22 -0
  269. whitebit/sub_account/types/sub_account_transfer_request_direction.py +5 -0
  270. whitebit/sub_account/types/sub_account_transfer_response.py +26 -0
  271. whitebit/sub_account_api_keys/__init__.py +19 -0
  272. whitebit/sub_account_api_keys/client.py +754 -0
  273. whitebit/sub_account_api_keys/raw_client.py +1183 -0
  274. whitebit/sub_account_api_keys/types/__init__.py +17 -0
  275. whitebit/sub_account_api_keys/types/create_sub_account_api_key_ip_address_response.py +19 -0
  276. whitebit/sub_account_api_keys/types/delete_sub_account_api_key_ip_address_response.py +19 -0
  277. whitebit/sub_account_api_keys/types/edit_sub_account_api_key_request_urls_item.py +20 -0
  278. whitebit/sub_account_api_keys/types/list_sub_account_api_key_ip_addresses_response.py +19 -0
  279. whitebit/sub_account_api_keys/types/list_sub_account_api_keys_response.py +22 -0
  280. whitebit/transfer/__init__.py +15 -0
  281. whitebit/transfer/client.py +220 -0
  282. whitebit/transfer/raw_client.py +276 -0
  283. whitebit/transfer/types/__init__.py +13 -0
  284. whitebit/transfer/types/transfer_between_balances_request_from.py +5 -0
  285. whitebit/transfer/types/transfer_between_balances_request_method.py +7 -0
  286. whitebit/transfer/types/transfer_between_balances_request_to.py +5 -0
  287. whitebit/types/__init__.py +311 -0
  288. whitebit/types/asset.py +106 -0
  289. whitebit/types/asset_limits.py +33 -0
  290. whitebit/types/asset_limits_deposit_value.py +20 -0
  291. whitebit/types/asset_limits_withdraw_value.py +20 -0
  292. whitebit/types/asset_memo.py +24 -0
  293. whitebit/types/asset_networks.py +36 -0
  294. whitebit/types/asset_providers.py +24 -0
  295. whitebit/types/authorize_request.py +32 -0
  296. whitebit/types/authorize_response.py +29 -0
  297. whitebit/types/authorize_response_result.py +22 -0
  298. whitebit/types/bad_request_error_body.py +20 -0
  299. whitebit/types/balance_margin_request.py +32 -0
  300. whitebit/types/balance_margin_response.py +33 -0
  301. whitebit/types/balance_margin_response_result_value.py +37 -0
  302. whitebit/types/balance_margin_subscribe.py +32 -0
  303. whitebit/types/balance_margin_update.py +33 -0
  304. whitebit/types/balance_margin_update_params_item.py +48 -0
  305. whitebit/types/balance_spot_request.py +32 -0
  306. whitebit/types/balance_spot_response.py +33 -0
  307. whitebit/types/balance_spot_response_result_value.py +27 -0
  308. whitebit/types/balance_spot_subscribe.py +32 -0
  309. whitebit/types/balance_spot_update.py +33 -0
  310. whitebit/types/balance_spot_update_params_item_value.py +27 -0
  311. whitebit/types/base_request.py +22 -0
  312. whitebit/types/base_response.py +24 -0
  313. whitebit/types/book_ticker_subscribe.py +29 -0
  314. whitebit/types/book_ticker_update.py +26 -0
  315. whitebit/types/book_ticker_update_data.py +5 -0
  316. whitebit/types/borrows_events_subscribe.py +32 -0
  317. whitebit/types/borrows_events_update.py +34 -0
  318. whitebit/types/borrows_subscribe.py +32 -0
  319. whitebit/types/borrows_update.py +30 -0
  320. whitebit/types/borrows_update_params.py +25 -0
  321. whitebit/types/borrows_update_params_records_item.py +47 -0
  322. whitebit/types/bulk_limit_order_response.py +7 -0
  323. whitebit/types/bulk_limit_order_response_item.py +22 -0
  324. whitebit/types/bulk_order_item.py +42 -0
  325. whitebit/types/bulk_order_item_side.py +5 -0
  326. whitebit/types/candle.py +5 -0
  327. whitebit/types/candles_request.py +36 -0
  328. whitebit/types/candles_response.py +26 -0
  329. whitebit/types/candles_subscribe.py +34 -0
  330. whitebit/types/candles_update.py +26 -0
  331. whitebit/types/code_history.py +47 -0
  332. whitebit/types/code_info.py +47 -0
  333. whitebit/types/convert_confirm_response.py +33 -0
  334. whitebit/types/convert_estimate_request_direction.py +5 -0
  335. whitebit/types/convert_estimate_response.py +56 -0
  336. whitebit/types/convert_history_response.py +34 -0
  337. whitebit/types/convert_history_response_records_item.py +45 -0
  338. whitebit/types/convert_history_response_records_item_path_item.py +23 -0
  339. whitebit/types/credit_line.py +28 -0
  340. whitebit/types/deals_request.py +35 -0
  341. whitebit/types/deals_response.py +29 -0
  342. whitebit/types/deals_response_result.py +30 -0
  343. whitebit/types/deals_response_result_records_item.py +82 -0
  344. whitebit/types/deals_subscribe.py +32 -0
  345. whitebit/types/deals_update.py +43 -0
  346. whitebit/types/depth_level.py +5 -0
  347. whitebit/types/depth_request.py +35 -0
  348. whitebit/types/depth_response.py +22 -0
  349. whitebit/types/depth_subscribe.py +32 -0
  350. whitebit/types/depth_update.py +31 -0
  351. whitebit/types/depth_update_data.py +40 -0
  352. whitebit/types/error.py +21 -0
  353. whitebit/types/error_inner.py +21 -0
  354. whitebit/types/error_response.py +32 -0
  355. whitebit/types/error_v4.py +25 -0
  356. whitebit/types/executed_order_object.py +133 -0
  357. whitebit/types/executed_order_object_position_side.py +5 -0
  358. whitebit/types/executed_order_object_stp.py +5 -0
  359. whitebit/types/fee_details.py +23 -0
  360. whitebit/types/fee_details_flex.py +21 -0
  361. whitebit/types/fee_info.py +49 -0
  362. whitebit/types/fee_info_deposit.py +63 -0
  363. whitebit/types/fee_info_withdraw.py +63 -0
  364. whitebit/types/fixed_plan.py +79 -0
  365. whitebit/types/flex_investment.py +67 -0
  366. whitebit/types/flex_investment_history.py +64 -0
  367. whitebit/types/flex_plan.py +50 -0
  368. whitebit/types/futures_market.py +117 -0
  369. whitebit/types/interest_payment.py +48 -0
  370. whitebit/types/investment.py +64 -0
  371. whitebit/types/lastprice_request.py +29 -0
  372. whitebit/types/lastprice_response.py +25 -0
  373. whitebit/types/lastprice_subscribe.py +29 -0
  374. whitebit/types/lastprice_update.py +30 -0
  375. whitebit/types/margin_positions_events_subscribe.py +34 -0
  376. whitebit/types/margin_positions_events_update.py +34 -0
  377. whitebit/types/market_order_request.py +51 -0
  378. whitebit/types/market_order_request_side.py +5 -0
  379. whitebit/types/market_order_request_stp.py +5 -0
  380. whitebit/types/market_request.py +34 -0
  381. whitebit/types/market_response.py +22 -0
  382. whitebit/types/market_statistics.py +57 -0
  383. whitebit/types/market_subscribe.py +25 -0
  384. whitebit/types/market_today_request.py +29 -0
  385. whitebit/types/market_today_response.py +22 -0
  386. whitebit/types/market_today_statistics.py +47 -0
  387. whitebit/types/market_today_subscribe.py +25 -0
  388. whitebit/types/market_today_update.py +30 -0
  389. whitebit/types/market_update.py +30 -0
  390. whitebit/types/mining_reward.py +62 -0
  391. whitebit/types/not_found_error_body.py +20 -0
  392. whitebit/types/order_book.py +33 -0
  393. whitebit/types/order_object.py +118 -0
  394. whitebit/types/order_object_position_side.py +5 -0
  395. whitebit/types/order_object_stp.py +5 -0
  396. whitebit/types/order_response.py +123 -0
  397. whitebit/types/orderbook_response.py +37 -0
  398. whitebit/types/orders_executed_request.py +35 -0
  399. whitebit/types/orders_executed_response.py +29 -0
  400. whitebit/types/orders_executed_response_result.py +30 -0
  401. whitebit/types/orders_executed_subscribe.py +34 -0
  402. whitebit/types/orders_executed_update.py +33 -0
  403. whitebit/types/orders_pending_request.py +32 -0
  404. whitebit/types/orders_pending_response.py +29 -0
  405. whitebit/types/orders_pending_response_result.py +35 -0
  406. whitebit/types/orders_pending_subscribe.py +32 -0
  407. whitebit/types/orders_pending_update.py +32 -0
  408. whitebit/types/ping_request.py +25 -0
  409. whitebit/types/ping_response.py +21 -0
  410. whitebit/types/ping_response_result.py +5 -0
  411. whitebit/types/positions_subscribe.py +32 -0
  412. whitebit/types/positions_update.py +30 -0
  413. whitebit/types/positions_update_params.py +25 -0
  414. whitebit/types/positions_update_params_records_item.py +99 -0
  415. whitebit/types/positions_update_params_records_item_liq_stage.py +5 -0
  416. whitebit/types/positions_update_params_records_item_position_side.py +5 -0
  417. whitebit/types/provider_fee_details.py +28 -0
  418. whitebit/types/sub_account.py +63 -0
  419. whitebit/types/sub_account_api_key.py +84 -0
  420. whitebit/types/sub_account_api_key_access_endpoints_item.py +27 -0
  421. whitebit/types/sub_account_api_key_list.py +39 -0
  422. whitebit/types/sub_account_api_key_list_access_endpoints_item.py +20 -0
  423. whitebit/types/sub_account_kyc.py +37 -0
  424. whitebit/types/sub_account_permissions.py +37 -0
  425. whitebit/types/sub_account_transfer.py +53 -0
  426. whitebit/types/subscription_response.py +29 -0
  427. whitebit/types/subscription_response_result.py +22 -0
  428. whitebit/types/time_request.py +25 -0
  429. whitebit/types/time_response.py +23 -0
  430. whitebit/types/trade.py +48 -0
  431. whitebit/types/trade_type.py +5 -0
  432. whitebit/types/trades_request.py +35 -0
  433. whitebit/types/trades_response.py +22 -0
  434. whitebit/types/trades_subscribe.py +28 -0
  435. whitebit/types/trades_update.py +30 -0
  436. whitebit/types/transaction_history.py +108 -0
  437. whitebit/types/transaction_history_confirmations.py +31 -0
  438. whitebit/types/unprocessable_entity_error_body.py +20 -0
  439. whitebit/types/unsubscribe_request.py +32 -0
  440. whitebit/withdraw/__init__.py +11 -0
  441. whitebit/withdraw/client.py +496 -0
  442. whitebit/withdraw/raw_client.py +634 -0
  443. whitebit/withdraw/types/__init__.py +9 -0
  444. whitebit/withdraw/types/create_withdraw_request_beneficiary.py +74 -0
  445. whitebit/withdraw/types/create_withdraw_request_travel_rule.py +52 -0
  446. whitebit/withdraw/types/create_withdraw_request_travel_rule_type.py +5 -0
  447. whitebit_python_sdk-1.1.0.dist-info/METADATA +155 -0
  448. whitebit_python_sdk-1.1.0.dist-info/RECORD +451 -0
  449. whitebit_python_sdk-1.1.0.dist-info/WHEEL +5 -0
  450. whitebit_python_sdk-1.1.0.dist-info/licenses/LICENSE +20 -0
  451. whitebit_python_sdk-1.1.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,1140 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
6
+ from ..core.request_options import RequestOptions
7
+ from ..types.flex_plan import FlexPlan
8
+ from .raw_client import AsyncRawCryptoLendingFlexClient, RawCryptoLendingFlexClient
9
+ from .types.close_flex_investment_response import CloseFlexInvestmentResponse
10
+ from .types.create_flex_investment_response import CreateFlexInvestmentResponse
11
+ from .types.get_flex_investment_history_response import GetFlexInvestmentHistoryResponse
12
+ from .types.get_flex_payment_history_response import GetFlexPaymentHistoryResponse
13
+ from .types.get_user_flex_investments_response import GetUserFlexInvestmentsResponse
14
+ from .types.update_flex_auto_reinvestment_response import UpdateFlexAutoReinvestmentResponse
15
+ from .types.withdraw_from_flex_investment_response import WithdrawFromFlexInvestmentResponse
16
+
17
+ # this is used as the default value for optional parameters
18
+ OMIT = typing.cast(typing.Any, ...)
19
+
20
+
21
+ class CryptoLendingFlexClient:
22
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
23
+ self._raw_client = RawCryptoLendingFlexClient(client_wrapper=client_wrapper)
24
+
25
+ @property
26
+ def with_raw_response(self) -> RawCryptoLendingFlexClient:
27
+ """
28
+ Retrieves a raw implementation of this client that returns raw responses.
29
+
30
+ Returns
31
+ -------
32
+ RawCryptoLendingFlexClient
33
+ """
34
+ return self._raw_client
35
+
36
+ def get_flex_plans(
37
+ self,
38
+ *,
39
+ request: str,
40
+ nonce: str,
41
+ limit: typing.Optional[int] = OMIT,
42
+ offset: typing.Optional[int] = OMIT,
43
+ ticker: typing.Optional[str] = OMIT,
44
+ request_options: typing.Optional[RequestOptions] = None,
45
+ ) -> typing.List[FlexPlan]:
46
+ """
47
+ Retrieve list of active [Flex Plans](/glossary#crypto-lending).
48
+
49
+ Available after September 22, 2025.
50
+
51
+ <Warning>
52
+ Rate limit: 1000 requests/10 sec.
53
+ </Warning>
54
+
55
+ <Note>
56
+ The API does not cache the response.
57
+ </Note>
58
+
59
+ Parameters
60
+ ----------
61
+ request : str
62
+ Request signature
63
+
64
+ nonce : str
65
+ Unique request identifier
66
+
67
+ limit : typing.Optional[int]
68
+ Pagination limit.
69
+
70
+ offset : typing.Optional[int]
71
+ Pagination offset.
72
+
73
+ ticker : typing.Optional[str]
74
+ Filter by currency [ticker](/glossary#ticker). Example: USDT
75
+
76
+ request_options : typing.Optional[RequestOptions]
77
+ Request-specific configuration.
78
+
79
+ Returns
80
+ -------
81
+ typing.List[FlexPlan]
82
+ Successful response
83
+
84
+ Examples
85
+ --------
86
+ from whitebit import WhitebitApi
87
+ client = WhitebitApi(api_key="YOUR_API_KEY", )
88
+ client.crypto_lending_flex.get_flex_plans(limit=50, offset=0, ticker='USDT', request='{{request}}', nonce='{{nonce}}', )
89
+ """
90
+ _response = self._raw_client.get_flex_plans(
91
+ request=request, nonce=nonce, limit=limit, offset=offset, ticker=ticker, request_options=request_options
92
+ )
93
+ return _response.data
94
+
95
+ def get_user_flex_investments(
96
+ self,
97
+ *,
98
+ request: str,
99
+ nonce: str,
100
+ limit: typing.Optional[int] = OMIT,
101
+ offset: typing.Optional[int] = OMIT,
102
+ ticker: typing.Optional[str] = OMIT,
103
+ plan: typing.Optional[str] = OMIT,
104
+ investment: typing.Optional[str] = OMIT,
105
+ investment_status: typing.Optional[int] = OMIT,
106
+ request_options: typing.Optional[RequestOptions] = None,
107
+ ) -> GetUserFlexInvestmentsResponse:
108
+ """
109
+ Retrieve user's investment portfolio with optional filtering.
110
+
111
+ <Warning>
112
+ Rate limit: 1000 requests/10 sec.
113
+ </Warning>
114
+
115
+ <Note>
116
+ The API does not cache the response.
117
+ </Note>
118
+
119
+ Parameters
120
+ ----------
121
+ request : str
122
+ Request signature
123
+
124
+ nonce : str
125
+ Unique request identifier
126
+
127
+ limit : typing.Optional[int]
128
+ Pagination limit. Default: 100.
129
+
130
+ offset : typing.Optional[int]
131
+ Pagination offset. Default: 0.
132
+
133
+ ticker : typing.Optional[str]
134
+ Filter by currency [ticker](/glossary#ticker). Example: USDT.
135
+
136
+ plan : typing.Optional[str]
137
+ Filter by plan ID (UUID).
138
+
139
+ investment : typing.Optional[str]
140
+ Filter by investment ID.
141
+
142
+ investment_status : typing.Optional[int]
143
+ Filter by status (1=ACTIVE, 0=CLOSED).
144
+
145
+ request_options : typing.Optional[RequestOptions]
146
+ Request-specific configuration.
147
+
148
+ Returns
149
+ -------
150
+ GetUserFlexInvestmentsResponse
151
+ Successful response
152
+
153
+ Examples
154
+ --------
155
+ from whitebit import WhitebitApi
156
+ client = WhitebitApi(api_key="YOUR_API_KEY", )
157
+ client.crypto_lending_flex.get_user_flex_investments(limit=100, offset=0, ticker='USDT', plan='8f2e9d3c-1a4b-4c2d-9e5f-6a7b8c9d0e1f', investment='invest_id_123', investment_status=1, request='{{request}}', nonce='{{nonce}}', )
158
+ """
159
+ _response = self._raw_client.get_user_flex_investments(
160
+ request=request,
161
+ nonce=nonce,
162
+ limit=limit,
163
+ offset=offset,
164
+ ticker=ticker,
165
+ plan=plan,
166
+ investment=investment,
167
+ investment_status=investment_status,
168
+ request_options=request_options,
169
+ )
170
+ return _response.data
171
+
172
+ def get_flex_investment_history(
173
+ self,
174
+ *,
175
+ request: str,
176
+ nonce: str,
177
+ limit: typing.Optional[int] = OMIT,
178
+ offset: typing.Optional[int] = OMIT,
179
+ plan: typing.Optional[str] = OMIT,
180
+ investment: typing.Optional[str] = OMIT,
181
+ transaction: typing.Optional[str] = OMIT,
182
+ date_from: typing.Optional[int] = OMIT,
183
+ date_to: typing.Optional[int] = OMIT,
184
+ action_types: typing.Optional[typing.Sequence[int]] = OMIT,
185
+ request_options: typing.Optional[RequestOptions] = None,
186
+ ) -> GetFlexInvestmentHistoryResponse:
187
+ """
188
+ Retrieve complete investment operations history with advanced filtering.
189
+
190
+ **Available Action Types:**
191
+ - 1: INVEST - Investment creation
192
+ - 2: REINVEST - Automatic reinvestment
193
+ - 3: WITHDRAW_FROM_INVESTMENT - Partial withdrawal
194
+ - 4: DAILY_EARNING - Daily earnings
195
+ - 5: CLOSE_INVESTMENT - Investment closure
196
+ - 6: OPEN_INVESTMENT - Investment opening
197
+
198
+ <Warning>
199
+ Rate limit: 1000 requests/10 sec.
200
+ </Warning>
201
+
202
+ <Note>
203
+ The API does not cache the response.
204
+ </Note>
205
+
206
+ Parameters
207
+ ----------
208
+ request : str
209
+ Request signature
210
+
211
+ nonce : str
212
+ Unique request identifier
213
+
214
+ limit : typing.Optional[int]
215
+ Pagination limit.
216
+
217
+ offset : typing.Optional[int]
218
+ Pagination offset.
219
+
220
+ plan : typing.Optional[str]
221
+ Filter by plan ID (UUID).
222
+
223
+ investment : typing.Optional[str]
224
+ Filter by investment ID.
225
+
226
+ transaction : typing.Optional[str]
227
+ Filter by transaction ID.
228
+
229
+ date_from : typing.Optional[int]
230
+ Filter from date (timestamp).
231
+
232
+ date_to : typing.Optional[int]
233
+ Filter to date (timestamp).
234
+
235
+ action_types : typing.Optional[typing.Sequence[int]]
236
+ Array of operation type IDs. See table below.
237
+
238
+ request_options : typing.Optional[RequestOptions]
239
+ Request-specific configuration.
240
+
241
+ Returns
242
+ -------
243
+ GetFlexInvestmentHistoryResponse
244
+ Successful response
245
+
246
+ Examples
247
+ --------
248
+ from whitebit import WhitebitApi
249
+ client = WhitebitApi(api_key="YOUR_API_KEY", )
250
+ client.crypto_lending_flex.get_flex_investment_history(limit=50, offset=0, plan='8f2e9d3c-1a4b-4c2d-9e5f-6a7b8c9d0e1f', investment='inv_123', transaction='tx_456', date_from=1640995200, date_to=1641081600, action_types=[1, 2, 4], request='{{request}}', nonce='{{nonce}}', )
251
+ """
252
+ _response = self._raw_client.get_flex_investment_history(
253
+ request=request,
254
+ nonce=nonce,
255
+ limit=limit,
256
+ offset=offset,
257
+ plan=plan,
258
+ investment=investment,
259
+ transaction=transaction,
260
+ date_from=date_from,
261
+ date_to=date_to,
262
+ action_types=action_types,
263
+ request_options=request_options,
264
+ )
265
+ return _response.data
266
+
267
+ def get_flex_payment_history(
268
+ self,
269
+ *,
270
+ request: str,
271
+ nonce: str,
272
+ limit: typing.Optional[int] = OMIT,
273
+ offset: typing.Optional[int] = OMIT,
274
+ plan: typing.Optional[str] = OMIT,
275
+ investment: typing.Optional[str] = OMIT,
276
+ transaction: typing.Optional[str] = OMIT,
277
+ date_from: typing.Optional[int] = OMIT,
278
+ date_to: typing.Optional[int] = OMIT,
279
+ request_options: typing.Optional[RequestOptions] = None,
280
+ ) -> GetFlexPaymentHistoryResponse:
281
+ """
282
+ Retrieve investment earnings history (ONLY DAILY_EARNING operations).
283
+
284
+ **Note:** The endpoint automatically filters to show ONLY DAILY_EARNING operations (type 4).
285
+
286
+ <Warning>
287
+ Rate limit: 1000 requests/10 sec.
288
+ </Warning>
289
+
290
+ <Note>
291
+ The API does not cache the response.
292
+ </Note>
293
+
294
+ Parameters
295
+ ----------
296
+ request : str
297
+ Request signature
298
+
299
+ nonce : str
300
+ Unique request identifier
301
+
302
+ limit : typing.Optional[int]
303
+ Pagination limit.
304
+
305
+ offset : typing.Optional[int]
306
+ Pagination offset.
307
+
308
+ plan : typing.Optional[str]
309
+ Filter by plan ID (UUID).
310
+
311
+ investment : typing.Optional[str]
312
+ Filter by investment ID.
313
+
314
+ transaction : typing.Optional[str]
315
+ Filter by transaction ID.
316
+
317
+ date_from : typing.Optional[int]
318
+ Filter from date (timestamp).
319
+
320
+ date_to : typing.Optional[int]
321
+ Filter to date (timestamp).
322
+
323
+ request_options : typing.Optional[RequestOptions]
324
+ Request-specific configuration.
325
+
326
+ Returns
327
+ -------
328
+ GetFlexPaymentHistoryResponse
329
+ Successful response
330
+
331
+ Examples
332
+ --------
333
+ from whitebit import WhitebitApi
334
+ client = WhitebitApi(api_key="YOUR_API_KEY", )
335
+ client.crypto_lending_flex.get_flex_payment_history(limit=50, offset=0, plan='8f2e9d3c-1a4b-4c2d-9e5f-6a7b8c9d0e1f', investment='inv_123', transaction='tx_456', date_from=1640995200, date_to=1641081600, request='{{request}}', nonce='{{nonce}}', )
336
+ """
337
+ _response = self._raw_client.get_flex_payment_history(
338
+ request=request,
339
+ nonce=nonce,
340
+ limit=limit,
341
+ offset=offset,
342
+ plan=plan,
343
+ investment=investment,
344
+ transaction=transaction,
345
+ date_from=date_from,
346
+ date_to=date_to,
347
+ request_options=request_options,
348
+ )
349
+ return _response.data
350
+
351
+ def create_flex_investment(
352
+ self,
353
+ *,
354
+ plan: str,
355
+ amount: str,
356
+ request: str,
357
+ nonce: str,
358
+ with_reinvest: typing.Optional[bool] = OMIT,
359
+ request_options: typing.Optional[RequestOptions] = None,
360
+ ) -> CreateFlexInvestmentResponse:
361
+ """
362
+ Create new investment in a Flex plan.
363
+
364
+ <Warning>
365
+ Rate limit: 1000 requests/10 sec.
366
+ </Warning>
367
+
368
+ <Note>
369
+ The API does not cache the response.
370
+ </Note>
371
+
372
+ Parameters
373
+ ----------
374
+ plan : str
375
+ Plan external ID (UUID).
376
+
377
+ amount : str
378
+ Investment amount.
379
+
380
+ request : str
381
+ Request signature
382
+
383
+ nonce : str
384
+ Unique request identifier
385
+
386
+ with_reinvest : typing.Optional[bool]
387
+ Enable auto-reinvestment.
388
+
389
+ request_options : typing.Optional[RequestOptions]
390
+ Request-specific configuration.
391
+
392
+ Returns
393
+ -------
394
+ CreateFlexInvestmentResponse
395
+ Investment created successfully
396
+
397
+ Examples
398
+ --------
399
+ from whitebit import WhitebitApi
400
+ client = WhitebitApi(api_key="YOUR_API_KEY", )
401
+ client.crypto_lending_flex.create_flex_investment(plan='8f2e9d3c-1a4b-4c2d-9e5f-6a7b8c9d0e1f', amount='1000.500000', with_reinvest=True, request='{{request}}', nonce='{{nonce}}', )
402
+ """
403
+ _response = self._raw_client.create_flex_investment(
404
+ plan=plan,
405
+ amount=amount,
406
+ request=request,
407
+ nonce=nonce,
408
+ with_reinvest=with_reinvest,
409
+ request_options=request_options,
410
+ )
411
+ return _response.data
412
+
413
+ def withdraw_from_flex_investment(
414
+ self,
415
+ *,
416
+ plan: str,
417
+ amount: str,
418
+ request: str,
419
+ nonce: str,
420
+ request_options: typing.Optional[RequestOptions] = None,
421
+ ) -> WithdrawFromFlexInvestmentResponse:
422
+ """
423
+ Withdraw specified amount from user's investment.
424
+
425
+ **Note:** Plan must be active and accessible to user.
426
+
427
+ <Warning>
428
+ Rate limit: 1000 requests/10 sec.
429
+ </Warning>
430
+
431
+ <Note>
432
+ The API does not cache the response.
433
+ </Note>
434
+
435
+ Parameters
436
+ ----------
437
+ plan : str
438
+ Plan external ID (UUID).
439
+
440
+ amount : str
441
+ Withdrawal amount.
442
+
443
+ request : str
444
+ Request signature
445
+
446
+ nonce : str
447
+ Unique request identifier
448
+
449
+ request_options : typing.Optional[RequestOptions]
450
+ Request-specific configuration.
451
+
452
+ Returns
453
+ -------
454
+ WithdrawFromFlexInvestmentResponse
455
+ Withdrawal successful
456
+
457
+ Examples
458
+ --------
459
+ from whitebit import WhitebitApi
460
+ client = WhitebitApi(api_key="YOUR_API_KEY", )
461
+ client.crypto_lending_flex.withdraw_from_flex_investment(plan='8f2e9d3c-1a4b-4c2d-9e5f-6a7b8c9d0e1f', amount='500.250000', request='{{request}}', nonce='{{nonce}}', )
462
+ """
463
+ _response = self._raw_client.withdraw_from_flex_investment(
464
+ plan=plan, amount=amount, request=request, nonce=nonce, request_options=request_options
465
+ )
466
+ return _response.data
467
+
468
+ def close_flex_investment(
469
+ self, *, plan: str, request: str, nonce: str, request_options: typing.Optional[RequestOptions] = None
470
+ ) -> CloseFlexInvestmentResponse:
471
+ """
472
+ Completely close investment and withdraw all funds.
473
+
474
+ **Validation Rules:**
475
+ - plan: required, string, UUID format, must exist
476
+ - Investment must be ACTIVE
477
+
478
+ <Warning>
479
+ Rate limit: 1000 requests/10 sec.
480
+ </Warning>
481
+
482
+ <Note>
483
+ The API does not cache the response.
484
+ </Note>
485
+
486
+ Parameters
487
+ ----------
488
+ plan : str
489
+ Plan external ID (UUID).
490
+
491
+ request : str
492
+ Request signature
493
+
494
+ nonce : str
495
+ Unique request identifier
496
+
497
+ request_options : typing.Optional[RequestOptions]
498
+ Request-specific configuration.
499
+
500
+ Returns
501
+ -------
502
+ CloseFlexInvestmentResponse
503
+ Investment closed successfully
504
+
505
+ Examples
506
+ --------
507
+ from whitebit import WhitebitApi
508
+ client = WhitebitApi(api_key="YOUR_API_KEY", )
509
+ client.crypto_lending_flex.close_flex_investment(plan='8f2e9d3c-1a4b-4c2d-9e5f-6a7b8c9d0e1f', request='{{request}}', nonce='{{nonce}}', )
510
+ """
511
+ _response = self._raw_client.close_flex_investment(
512
+ plan=plan, request=request, nonce=nonce, request_options=request_options
513
+ )
514
+ return _response.data
515
+
516
+ def update_flex_auto_reinvestment(
517
+ self,
518
+ *,
519
+ plan: str,
520
+ request: str,
521
+ nonce: str,
522
+ enabled: typing.Optional[bool] = OMIT,
523
+ request_options: typing.Optional[RequestOptions] = None,
524
+ ) -> UpdateFlexAutoReinvestmentResponse:
525
+ """
526
+ Enable/disable automatic reinvestment for user's investment.
527
+
528
+ <Warning>
529
+ Rate limit: 1000 requests/10 sec.
530
+ </Warning>
531
+
532
+ <Note>
533
+ The API does not cache the response.
534
+ </Note>
535
+
536
+ Parameters
537
+ ----------
538
+ plan : str
539
+ Plan external ID (UUID).
540
+
541
+ request : str
542
+ Request signature
543
+
544
+ nonce : str
545
+ Unique request identifier
546
+
547
+ enabled : typing.Optional[bool]
548
+ Enable or disable auto-reinvestment.
549
+
550
+ request_options : typing.Optional[RequestOptions]
551
+ Request-specific configuration.
552
+
553
+ Returns
554
+ -------
555
+ UpdateFlexAutoReinvestmentResponse
556
+ Auto-reinvestment updated successfully
557
+
558
+ Examples
559
+ --------
560
+ from whitebit import WhitebitApi
561
+ client = WhitebitApi(api_key="YOUR_API_KEY", )
562
+ client.crypto_lending_flex.update_flex_auto_reinvestment(plan='8f2e9d3c-1a4b-4c2d-9e5f-6a7b8c9d0e1f', enabled=True, request='{{request}}', nonce='{{nonce}}', )
563
+ """
564
+ _response = self._raw_client.update_flex_auto_reinvestment(
565
+ plan=plan, request=request, nonce=nonce, enabled=enabled, request_options=request_options
566
+ )
567
+ return _response.data
568
+
569
+
570
+ class AsyncCryptoLendingFlexClient:
571
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
572
+ self._raw_client = AsyncRawCryptoLendingFlexClient(client_wrapper=client_wrapper)
573
+
574
+ @property
575
+ def with_raw_response(self) -> AsyncRawCryptoLendingFlexClient:
576
+ """
577
+ Retrieves a raw implementation of this client that returns raw responses.
578
+
579
+ Returns
580
+ -------
581
+ AsyncRawCryptoLendingFlexClient
582
+ """
583
+ return self._raw_client
584
+
585
+ async def get_flex_plans(
586
+ self,
587
+ *,
588
+ request: str,
589
+ nonce: str,
590
+ limit: typing.Optional[int] = OMIT,
591
+ offset: typing.Optional[int] = OMIT,
592
+ ticker: typing.Optional[str] = OMIT,
593
+ request_options: typing.Optional[RequestOptions] = None,
594
+ ) -> typing.List[FlexPlan]:
595
+ """
596
+ Retrieve list of active [Flex Plans](/glossary#crypto-lending).
597
+
598
+ Available after September 22, 2025.
599
+
600
+ <Warning>
601
+ Rate limit: 1000 requests/10 sec.
602
+ </Warning>
603
+
604
+ <Note>
605
+ The API does not cache the response.
606
+ </Note>
607
+
608
+ Parameters
609
+ ----------
610
+ request : str
611
+ Request signature
612
+
613
+ nonce : str
614
+ Unique request identifier
615
+
616
+ limit : typing.Optional[int]
617
+ Pagination limit.
618
+
619
+ offset : typing.Optional[int]
620
+ Pagination offset.
621
+
622
+ ticker : typing.Optional[str]
623
+ Filter by currency [ticker](/glossary#ticker). Example: USDT
624
+
625
+ request_options : typing.Optional[RequestOptions]
626
+ Request-specific configuration.
627
+
628
+ Returns
629
+ -------
630
+ typing.List[FlexPlan]
631
+ Successful response
632
+
633
+ Examples
634
+ --------
635
+ from whitebit import AsyncWhitebitApi
636
+ import asyncio
637
+ client = AsyncWhitebitApi(api_key="YOUR_API_KEY", )
638
+ async def main() -> None:
639
+ await client.crypto_lending_flex.get_flex_plans(limit=50, offset=0, ticker='USDT', request='{{request}}', nonce='{{nonce}}', )
640
+ asyncio.run(main())
641
+ """
642
+ _response = await self._raw_client.get_flex_plans(
643
+ request=request, nonce=nonce, limit=limit, offset=offset, ticker=ticker, request_options=request_options
644
+ )
645
+ return _response.data
646
+
647
+ async def get_user_flex_investments(
648
+ self,
649
+ *,
650
+ request: str,
651
+ nonce: str,
652
+ limit: typing.Optional[int] = OMIT,
653
+ offset: typing.Optional[int] = OMIT,
654
+ ticker: typing.Optional[str] = OMIT,
655
+ plan: typing.Optional[str] = OMIT,
656
+ investment: typing.Optional[str] = OMIT,
657
+ investment_status: typing.Optional[int] = OMIT,
658
+ request_options: typing.Optional[RequestOptions] = None,
659
+ ) -> GetUserFlexInvestmentsResponse:
660
+ """
661
+ Retrieve user's investment portfolio with optional filtering.
662
+
663
+ <Warning>
664
+ Rate limit: 1000 requests/10 sec.
665
+ </Warning>
666
+
667
+ <Note>
668
+ The API does not cache the response.
669
+ </Note>
670
+
671
+ Parameters
672
+ ----------
673
+ request : str
674
+ Request signature
675
+
676
+ nonce : str
677
+ Unique request identifier
678
+
679
+ limit : typing.Optional[int]
680
+ Pagination limit. Default: 100.
681
+
682
+ offset : typing.Optional[int]
683
+ Pagination offset. Default: 0.
684
+
685
+ ticker : typing.Optional[str]
686
+ Filter by currency [ticker](/glossary#ticker). Example: USDT.
687
+
688
+ plan : typing.Optional[str]
689
+ Filter by plan ID (UUID).
690
+
691
+ investment : typing.Optional[str]
692
+ Filter by investment ID.
693
+
694
+ investment_status : typing.Optional[int]
695
+ Filter by status (1=ACTIVE, 0=CLOSED).
696
+
697
+ request_options : typing.Optional[RequestOptions]
698
+ Request-specific configuration.
699
+
700
+ Returns
701
+ -------
702
+ GetUserFlexInvestmentsResponse
703
+ Successful response
704
+
705
+ Examples
706
+ --------
707
+ from whitebit import AsyncWhitebitApi
708
+ import asyncio
709
+ client = AsyncWhitebitApi(api_key="YOUR_API_KEY", )
710
+ async def main() -> None:
711
+ await client.crypto_lending_flex.get_user_flex_investments(limit=100, offset=0, ticker='USDT', plan='8f2e9d3c-1a4b-4c2d-9e5f-6a7b8c9d0e1f', investment='invest_id_123', investment_status=1, request='{{request}}', nonce='{{nonce}}', )
712
+ asyncio.run(main())
713
+ """
714
+ _response = await self._raw_client.get_user_flex_investments(
715
+ request=request,
716
+ nonce=nonce,
717
+ limit=limit,
718
+ offset=offset,
719
+ ticker=ticker,
720
+ plan=plan,
721
+ investment=investment,
722
+ investment_status=investment_status,
723
+ request_options=request_options,
724
+ )
725
+ return _response.data
726
+
727
+ async def get_flex_investment_history(
728
+ self,
729
+ *,
730
+ request: str,
731
+ nonce: str,
732
+ limit: typing.Optional[int] = OMIT,
733
+ offset: typing.Optional[int] = OMIT,
734
+ plan: typing.Optional[str] = OMIT,
735
+ investment: typing.Optional[str] = OMIT,
736
+ transaction: typing.Optional[str] = OMIT,
737
+ date_from: typing.Optional[int] = OMIT,
738
+ date_to: typing.Optional[int] = OMIT,
739
+ action_types: typing.Optional[typing.Sequence[int]] = OMIT,
740
+ request_options: typing.Optional[RequestOptions] = None,
741
+ ) -> GetFlexInvestmentHistoryResponse:
742
+ """
743
+ Retrieve complete investment operations history with advanced filtering.
744
+
745
+ **Available Action Types:**
746
+ - 1: INVEST - Investment creation
747
+ - 2: REINVEST - Automatic reinvestment
748
+ - 3: WITHDRAW_FROM_INVESTMENT - Partial withdrawal
749
+ - 4: DAILY_EARNING - Daily earnings
750
+ - 5: CLOSE_INVESTMENT - Investment closure
751
+ - 6: OPEN_INVESTMENT - Investment opening
752
+
753
+ <Warning>
754
+ Rate limit: 1000 requests/10 sec.
755
+ </Warning>
756
+
757
+ <Note>
758
+ The API does not cache the response.
759
+ </Note>
760
+
761
+ Parameters
762
+ ----------
763
+ request : str
764
+ Request signature
765
+
766
+ nonce : str
767
+ Unique request identifier
768
+
769
+ limit : typing.Optional[int]
770
+ Pagination limit.
771
+
772
+ offset : typing.Optional[int]
773
+ Pagination offset.
774
+
775
+ plan : typing.Optional[str]
776
+ Filter by plan ID (UUID).
777
+
778
+ investment : typing.Optional[str]
779
+ Filter by investment ID.
780
+
781
+ transaction : typing.Optional[str]
782
+ Filter by transaction ID.
783
+
784
+ date_from : typing.Optional[int]
785
+ Filter from date (timestamp).
786
+
787
+ date_to : typing.Optional[int]
788
+ Filter to date (timestamp).
789
+
790
+ action_types : typing.Optional[typing.Sequence[int]]
791
+ Array of operation type IDs. See table below.
792
+
793
+ request_options : typing.Optional[RequestOptions]
794
+ Request-specific configuration.
795
+
796
+ Returns
797
+ -------
798
+ GetFlexInvestmentHistoryResponse
799
+ Successful response
800
+
801
+ Examples
802
+ --------
803
+ from whitebit import AsyncWhitebitApi
804
+ import asyncio
805
+ client = AsyncWhitebitApi(api_key="YOUR_API_KEY", )
806
+ async def main() -> None:
807
+ await client.crypto_lending_flex.get_flex_investment_history(limit=50, offset=0, plan='8f2e9d3c-1a4b-4c2d-9e5f-6a7b8c9d0e1f', investment='inv_123', transaction='tx_456', date_from=1640995200, date_to=1641081600, action_types=[1, 2, 4], request='{{request}}', nonce='{{nonce}}', )
808
+ asyncio.run(main())
809
+ """
810
+ _response = await self._raw_client.get_flex_investment_history(
811
+ request=request,
812
+ nonce=nonce,
813
+ limit=limit,
814
+ offset=offset,
815
+ plan=plan,
816
+ investment=investment,
817
+ transaction=transaction,
818
+ date_from=date_from,
819
+ date_to=date_to,
820
+ action_types=action_types,
821
+ request_options=request_options,
822
+ )
823
+ return _response.data
824
+
825
+ async def get_flex_payment_history(
826
+ self,
827
+ *,
828
+ request: str,
829
+ nonce: str,
830
+ limit: typing.Optional[int] = OMIT,
831
+ offset: typing.Optional[int] = OMIT,
832
+ plan: typing.Optional[str] = OMIT,
833
+ investment: typing.Optional[str] = OMIT,
834
+ transaction: typing.Optional[str] = OMIT,
835
+ date_from: typing.Optional[int] = OMIT,
836
+ date_to: typing.Optional[int] = OMIT,
837
+ request_options: typing.Optional[RequestOptions] = None,
838
+ ) -> GetFlexPaymentHistoryResponse:
839
+ """
840
+ Retrieve investment earnings history (ONLY DAILY_EARNING operations).
841
+
842
+ **Note:** The endpoint automatically filters to show ONLY DAILY_EARNING operations (type 4).
843
+
844
+ <Warning>
845
+ Rate limit: 1000 requests/10 sec.
846
+ </Warning>
847
+
848
+ <Note>
849
+ The API does not cache the response.
850
+ </Note>
851
+
852
+ Parameters
853
+ ----------
854
+ request : str
855
+ Request signature
856
+
857
+ nonce : str
858
+ Unique request identifier
859
+
860
+ limit : typing.Optional[int]
861
+ Pagination limit.
862
+
863
+ offset : typing.Optional[int]
864
+ Pagination offset.
865
+
866
+ plan : typing.Optional[str]
867
+ Filter by plan ID (UUID).
868
+
869
+ investment : typing.Optional[str]
870
+ Filter by investment ID.
871
+
872
+ transaction : typing.Optional[str]
873
+ Filter by transaction ID.
874
+
875
+ date_from : typing.Optional[int]
876
+ Filter from date (timestamp).
877
+
878
+ date_to : typing.Optional[int]
879
+ Filter to date (timestamp).
880
+
881
+ request_options : typing.Optional[RequestOptions]
882
+ Request-specific configuration.
883
+
884
+ Returns
885
+ -------
886
+ GetFlexPaymentHistoryResponse
887
+ Successful response
888
+
889
+ Examples
890
+ --------
891
+ from whitebit import AsyncWhitebitApi
892
+ import asyncio
893
+ client = AsyncWhitebitApi(api_key="YOUR_API_KEY", )
894
+ async def main() -> None:
895
+ await client.crypto_lending_flex.get_flex_payment_history(limit=50, offset=0, plan='8f2e9d3c-1a4b-4c2d-9e5f-6a7b8c9d0e1f', investment='inv_123', transaction='tx_456', date_from=1640995200, date_to=1641081600, request='{{request}}', nonce='{{nonce}}', )
896
+ asyncio.run(main())
897
+ """
898
+ _response = await self._raw_client.get_flex_payment_history(
899
+ request=request,
900
+ nonce=nonce,
901
+ limit=limit,
902
+ offset=offset,
903
+ plan=plan,
904
+ investment=investment,
905
+ transaction=transaction,
906
+ date_from=date_from,
907
+ date_to=date_to,
908
+ request_options=request_options,
909
+ )
910
+ return _response.data
911
+
912
+ async def create_flex_investment(
913
+ self,
914
+ *,
915
+ plan: str,
916
+ amount: str,
917
+ request: str,
918
+ nonce: str,
919
+ with_reinvest: typing.Optional[bool] = OMIT,
920
+ request_options: typing.Optional[RequestOptions] = None,
921
+ ) -> CreateFlexInvestmentResponse:
922
+ """
923
+ Create new investment in a Flex plan.
924
+
925
+ <Warning>
926
+ Rate limit: 1000 requests/10 sec.
927
+ </Warning>
928
+
929
+ <Note>
930
+ The API does not cache the response.
931
+ </Note>
932
+
933
+ Parameters
934
+ ----------
935
+ plan : str
936
+ Plan external ID (UUID).
937
+
938
+ amount : str
939
+ Investment amount.
940
+
941
+ request : str
942
+ Request signature
943
+
944
+ nonce : str
945
+ Unique request identifier
946
+
947
+ with_reinvest : typing.Optional[bool]
948
+ Enable auto-reinvestment.
949
+
950
+ request_options : typing.Optional[RequestOptions]
951
+ Request-specific configuration.
952
+
953
+ Returns
954
+ -------
955
+ CreateFlexInvestmentResponse
956
+ Investment created successfully
957
+
958
+ Examples
959
+ --------
960
+ from whitebit import AsyncWhitebitApi
961
+ import asyncio
962
+ client = AsyncWhitebitApi(api_key="YOUR_API_KEY", )
963
+ async def main() -> None:
964
+ await client.crypto_lending_flex.create_flex_investment(plan='8f2e9d3c-1a4b-4c2d-9e5f-6a7b8c9d0e1f', amount='1000.500000', with_reinvest=True, request='{{request}}', nonce='{{nonce}}', )
965
+ asyncio.run(main())
966
+ """
967
+ _response = await self._raw_client.create_flex_investment(
968
+ plan=plan,
969
+ amount=amount,
970
+ request=request,
971
+ nonce=nonce,
972
+ with_reinvest=with_reinvest,
973
+ request_options=request_options,
974
+ )
975
+ return _response.data
976
+
977
+ async def withdraw_from_flex_investment(
978
+ self,
979
+ *,
980
+ plan: str,
981
+ amount: str,
982
+ request: str,
983
+ nonce: str,
984
+ request_options: typing.Optional[RequestOptions] = None,
985
+ ) -> WithdrawFromFlexInvestmentResponse:
986
+ """
987
+ Withdraw specified amount from user's investment.
988
+
989
+ **Note:** Plan must be active and accessible to user.
990
+
991
+ <Warning>
992
+ Rate limit: 1000 requests/10 sec.
993
+ </Warning>
994
+
995
+ <Note>
996
+ The API does not cache the response.
997
+ </Note>
998
+
999
+ Parameters
1000
+ ----------
1001
+ plan : str
1002
+ Plan external ID (UUID).
1003
+
1004
+ amount : str
1005
+ Withdrawal amount.
1006
+
1007
+ request : str
1008
+ Request signature
1009
+
1010
+ nonce : str
1011
+ Unique request identifier
1012
+
1013
+ request_options : typing.Optional[RequestOptions]
1014
+ Request-specific configuration.
1015
+
1016
+ Returns
1017
+ -------
1018
+ WithdrawFromFlexInvestmentResponse
1019
+ Withdrawal successful
1020
+
1021
+ Examples
1022
+ --------
1023
+ from whitebit import AsyncWhitebitApi
1024
+ import asyncio
1025
+ client = AsyncWhitebitApi(api_key="YOUR_API_KEY", )
1026
+ async def main() -> None:
1027
+ await client.crypto_lending_flex.withdraw_from_flex_investment(plan='8f2e9d3c-1a4b-4c2d-9e5f-6a7b8c9d0e1f', amount='500.250000', request='{{request}}', nonce='{{nonce}}', )
1028
+ asyncio.run(main())
1029
+ """
1030
+ _response = await self._raw_client.withdraw_from_flex_investment(
1031
+ plan=plan, amount=amount, request=request, nonce=nonce, request_options=request_options
1032
+ )
1033
+ return _response.data
1034
+
1035
+ async def close_flex_investment(
1036
+ self, *, plan: str, request: str, nonce: str, request_options: typing.Optional[RequestOptions] = None
1037
+ ) -> CloseFlexInvestmentResponse:
1038
+ """
1039
+ Completely close investment and withdraw all funds.
1040
+
1041
+ **Validation Rules:**
1042
+ - plan: required, string, UUID format, must exist
1043
+ - Investment must be ACTIVE
1044
+
1045
+ <Warning>
1046
+ Rate limit: 1000 requests/10 sec.
1047
+ </Warning>
1048
+
1049
+ <Note>
1050
+ The API does not cache the response.
1051
+ </Note>
1052
+
1053
+ Parameters
1054
+ ----------
1055
+ plan : str
1056
+ Plan external ID (UUID).
1057
+
1058
+ request : str
1059
+ Request signature
1060
+
1061
+ nonce : str
1062
+ Unique request identifier
1063
+
1064
+ request_options : typing.Optional[RequestOptions]
1065
+ Request-specific configuration.
1066
+
1067
+ Returns
1068
+ -------
1069
+ CloseFlexInvestmentResponse
1070
+ Investment closed successfully
1071
+
1072
+ Examples
1073
+ --------
1074
+ from whitebit import AsyncWhitebitApi
1075
+ import asyncio
1076
+ client = AsyncWhitebitApi(api_key="YOUR_API_KEY", )
1077
+ async def main() -> None:
1078
+ await client.crypto_lending_flex.close_flex_investment(plan='8f2e9d3c-1a4b-4c2d-9e5f-6a7b8c9d0e1f', request='{{request}}', nonce='{{nonce}}', )
1079
+ asyncio.run(main())
1080
+ """
1081
+ _response = await self._raw_client.close_flex_investment(
1082
+ plan=plan, request=request, nonce=nonce, request_options=request_options
1083
+ )
1084
+ return _response.data
1085
+
1086
+ async def update_flex_auto_reinvestment(
1087
+ self,
1088
+ *,
1089
+ plan: str,
1090
+ request: str,
1091
+ nonce: str,
1092
+ enabled: typing.Optional[bool] = OMIT,
1093
+ request_options: typing.Optional[RequestOptions] = None,
1094
+ ) -> UpdateFlexAutoReinvestmentResponse:
1095
+ """
1096
+ Enable/disable automatic reinvestment for user's investment.
1097
+
1098
+ <Warning>
1099
+ Rate limit: 1000 requests/10 sec.
1100
+ </Warning>
1101
+
1102
+ <Note>
1103
+ The API does not cache the response.
1104
+ </Note>
1105
+
1106
+ Parameters
1107
+ ----------
1108
+ plan : str
1109
+ Plan external ID (UUID).
1110
+
1111
+ request : str
1112
+ Request signature
1113
+
1114
+ nonce : str
1115
+ Unique request identifier
1116
+
1117
+ enabled : typing.Optional[bool]
1118
+ Enable or disable auto-reinvestment.
1119
+
1120
+ request_options : typing.Optional[RequestOptions]
1121
+ Request-specific configuration.
1122
+
1123
+ Returns
1124
+ -------
1125
+ UpdateFlexAutoReinvestmentResponse
1126
+ Auto-reinvestment updated successfully
1127
+
1128
+ Examples
1129
+ --------
1130
+ from whitebit import AsyncWhitebitApi
1131
+ import asyncio
1132
+ client = AsyncWhitebitApi(api_key="YOUR_API_KEY", )
1133
+ async def main() -> None:
1134
+ await client.crypto_lending_flex.update_flex_auto_reinvestment(plan='8f2e9d3c-1a4b-4c2d-9e5f-6a7b8c9d0e1f', enabled=True, request='{{request}}', nonce='{{nonce}}', )
1135
+ asyncio.run(main())
1136
+ """
1137
+ _response = await self._raw_client.update_flex_auto_reinvestment(
1138
+ plan=plan, request=request, nonce=nonce, enabled=enabled, request_options=request_options
1139
+ )
1140
+ return _response.data