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,1695 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+ from json.decoder import JSONDecodeError
5
+
6
+ from ..core.api_error import ApiError
7
+ from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
8
+ from ..core.http_response import AsyncHttpResponse, HttpResponse
9
+ from ..core.pydantic_utilities import parse_obj_as
10
+ from ..core.request_options import RequestOptions
11
+ from ..errors.bad_request_error import BadRequestError
12
+ from ..errors.unprocessable_entity_error import UnprocessableEntityError
13
+ from .types.create_mining_account_response import CreateMiningAccountResponse
14
+ from .types.create_mining_watcher_link_request_live_until import CreateMiningWatcherLinkRequestLiveUntil
15
+ from .types.create_mining_watcher_link_request_permissions_item import CreateMiningWatcherLinkRequestPermissionsItem
16
+ from .types.create_mining_watcher_link_response import CreateMiningWatcherLinkResponse
17
+ from .types.get_mining_accounts_response import GetMiningAccountsResponse
18
+ from .types.get_mining_hashrate_request_interval import GetMiningHashrateRequestInterval
19
+ from .types.get_mining_hashrate_response import GetMiningHashrateResponse
20
+ from .types.get_mining_miner_info_response import GetMiningMinerInfoResponse
21
+ from .types.get_mining_payout_destination_response import GetMiningPayoutDestinationResponse
22
+ from .types.get_mining_rewards_response import GetMiningRewardsResponse
23
+ from .types.get_mining_worker_hashrate_request_interval import GetMiningWorkerHashrateRequestInterval
24
+ from .types.get_mining_worker_hashrate_response import GetMiningWorkerHashrateResponse
25
+ from .types.get_mining_worker_names_response import GetMiningWorkerNamesResponse
26
+ from .types.list_mining_watcher_links_response import ListMiningWatcherLinksResponse
27
+ from .types.set_mining_payout_destination_request_destination import SetMiningPayoutDestinationRequestDestination
28
+ from .types.set_mining_payout_destination_response import SetMiningPayoutDestinationResponse
29
+
30
+ # this is used as the default value for optional parameters
31
+ OMIT = typing.cast(typing.Any, ...)
32
+
33
+
34
+ class RawMiningPoolClient:
35
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
36
+ self._client_wrapper = client_wrapper
37
+
38
+ def get_mining_rewards(
39
+ self,
40
+ *,
41
+ account: typing.Optional[str] = OMIT,
42
+ from_: typing.Optional[int] = OMIT,
43
+ to: typing.Optional[int] = OMIT,
44
+ limit: typing.Optional[int] = OMIT,
45
+ offset: typing.Optional[int] = OMIT,
46
+ request_options: typing.Optional[RequestOptions] = None,
47
+ ) -> HttpResponse[GetMiningRewardsResponse]:
48
+ """
49
+ The endpoint returns rewards received from mining.
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
+ account : typing.Optional[str]
62
+ Mining pool account
63
+
64
+ from_ : typing.Optional[int]
65
+ Date timestamp starting from which rewards are received
66
+
67
+ to : typing.Optional[int]
68
+ Date timestamp until which rewards are received
69
+
70
+ limit : typing.Optional[int]
71
+
72
+ offset : typing.Optional[int]
73
+
74
+ request_options : typing.Optional[RequestOptions]
75
+ Request-specific configuration.
76
+
77
+ Returns
78
+ -------
79
+ HttpResponse[GetMiningRewardsResponse]
80
+ Successful response
81
+ """
82
+ _response = self._client_wrapper.httpx_client.request(
83
+ "api/v4/mining/rewards",
84
+ base_url=self._client_wrapper.get_environment().base,
85
+ method="POST",
86
+ json={
87
+ "account": account,
88
+ "from": from_,
89
+ "to": to,
90
+ "limit": limit,
91
+ "offset": offset,
92
+ },
93
+ headers={
94
+ "content-type": "application/json",
95
+ },
96
+ request_options=request_options,
97
+ omit=OMIT,
98
+ )
99
+ try:
100
+ if 200 <= _response.status_code < 300:
101
+ _data = typing.cast(
102
+ GetMiningRewardsResponse,
103
+ parse_obj_as(
104
+ type_=GetMiningRewardsResponse, # type: ignore
105
+ object_=_response.json(),
106
+ ),
107
+ )
108
+ return HttpResponse(response=_response, data=_data)
109
+ if _response.status_code == 422:
110
+ raise UnprocessableEntityError(
111
+ headers=dict(_response.headers),
112
+ body=typing.cast(
113
+ typing.Optional[typing.Any],
114
+ parse_obj_as(
115
+ type_=typing.Optional[typing.Any], # type: ignore
116
+ object_=_response.json(),
117
+ ),
118
+ ),
119
+ )
120
+ _response_json = _response.json()
121
+ except JSONDecodeError:
122
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
123
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
124
+
125
+ def get_mining_hashrate(
126
+ self,
127
+ *,
128
+ account: str,
129
+ from_: typing.Optional[int] = OMIT,
130
+ to: typing.Optional[int] = OMIT,
131
+ interval: typing.Optional[GetMiningHashrateRequestInterval] = OMIT,
132
+ request_options: typing.Optional[RequestOptions] = None,
133
+ ) -> HttpResponse[GetMiningHashrateResponse]:
134
+ """
135
+ The endpoint returns hashrate of mining pool account.
136
+
137
+ <Warning>
138
+ Rate limit: 1000 requests/10 sec.
139
+ </Warning>
140
+
141
+ <Note>
142
+ The API does not cache the response.
143
+ </Note>
144
+
145
+ Parameters
146
+ ----------
147
+ account : str
148
+ Mining pool account
149
+
150
+ from_ : typing.Optional[int]
151
+ Unix timestamp of starting point
152
+
153
+ to : typing.Optional[int]
154
+ Unix timestamp of final point
155
+
156
+ interval : typing.Optional[GetMiningHashrateRequestInterval]
157
+ Timestamp interval
158
+
159
+ request_options : typing.Optional[RequestOptions]
160
+ Request-specific configuration.
161
+
162
+ Returns
163
+ -------
164
+ HttpResponse[GetMiningHashrateResponse]
165
+ Successful response
166
+ """
167
+ _response = self._client_wrapper.httpx_client.request(
168
+ "api/v4/mining/hashrate",
169
+ base_url=self._client_wrapper.get_environment().base,
170
+ method="POST",
171
+ json={
172
+ "account": account,
173
+ "from": from_,
174
+ "to": to,
175
+ "interval": interval,
176
+ },
177
+ headers={
178
+ "content-type": "application/json",
179
+ },
180
+ request_options=request_options,
181
+ omit=OMIT,
182
+ )
183
+ try:
184
+ if 200 <= _response.status_code < 300:
185
+ _data = typing.cast(
186
+ GetMiningHashrateResponse,
187
+ parse_obj_as(
188
+ type_=GetMiningHashrateResponse, # type: ignore
189
+ object_=_response.json(),
190
+ ),
191
+ )
192
+ return HttpResponse(response=_response, data=_data)
193
+ if _response.status_code == 422:
194
+ raise UnprocessableEntityError(
195
+ headers=dict(_response.headers),
196
+ body=typing.cast(
197
+ typing.Optional[typing.Any],
198
+ parse_obj_as(
199
+ type_=typing.Optional[typing.Any], # type: ignore
200
+ object_=_response.json(),
201
+ ),
202
+ ),
203
+ )
204
+ _response_json = _response.json()
205
+ except JSONDecodeError:
206
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
207
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
208
+
209
+ def get_mining_payout_destination(
210
+ self, *, account_name: str, request_options: typing.Optional[RequestOptions] = None
211
+ ) -> HttpResponse[GetMiningPayoutDestinationResponse]:
212
+ """
213
+ Returns the current payout destination setting for a specific mining account belonging to the authenticated user.
214
+
215
+ <Warning>
216
+ Rate limit: 1000 requests/10 sec.
217
+ </Warning>
218
+
219
+ Parameters
220
+ ----------
221
+ account_name : str
222
+ Mining pool account name
223
+
224
+ request_options : typing.Optional[RequestOptions]
225
+ Request-specific configuration.
226
+
227
+ Returns
228
+ -------
229
+ HttpResponse[GetMiningPayoutDestinationResponse]
230
+ Successful response
231
+ """
232
+ _response = self._client_wrapper.httpx_client.request(
233
+ "api/v4/mining/payout-destination",
234
+ base_url=self._client_wrapper.get_environment().base,
235
+ method="POST",
236
+ json={
237
+ "accountName": account_name,
238
+ },
239
+ headers={
240
+ "content-type": "application/json",
241
+ },
242
+ request_options=request_options,
243
+ omit=OMIT,
244
+ )
245
+ try:
246
+ if 200 <= _response.status_code < 300:
247
+ _data = typing.cast(
248
+ GetMiningPayoutDestinationResponse,
249
+ parse_obj_as(
250
+ type_=GetMiningPayoutDestinationResponse, # type: ignore
251
+ object_=_response.json(),
252
+ ),
253
+ )
254
+ return HttpResponse(response=_response, data=_data)
255
+ if _response.status_code == 400:
256
+ raise BadRequestError(
257
+ headers=dict(_response.headers),
258
+ body=typing.cast(
259
+ typing.Optional[typing.Any],
260
+ parse_obj_as(
261
+ type_=typing.Optional[typing.Any], # type: ignore
262
+ object_=_response.json(),
263
+ ),
264
+ ),
265
+ )
266
+ _response_json = _response.json()
267
+ except JSONDecodeError:
268
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
269
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
270
+
271
+ def set_mining_payout_destination(
272
+ self,
273
+ *,
274
+ account_name: str,
275
+ destination: SetMiningPayoutDestinationRequestDestination,
276
+ address: typing.Optional[str] = OMIT,
277
+ request_options: typing.Optional[RequestOptions] = None,
278
+ ) -> HttpResponse[SetMiningPayoutDestinationResponse]:
279
+ """
280
+ Updates the payout destination for a specific mining account belonging to the authenticated user. Can be set to main balance or an external BTC address.
281
+
282
+ <Warning>
283
+ Rate limit: 1000 requests/10 sec.
284
+ </Warning>
285
+
286
+ Parameters
287
+ ----------
288
+ account_name : str
289
+ Mining pool account name
290
+
291
+ destination : SetMiningPayoutDestinationRequestDestination
292
+ Payout destination type
293
+
294
+ address : typing.Optional[str]
295
+ External BTC address. Required when destination is external_address. Supports all standard Bitcoin address formats.
296
+
297
+ request_options : typing.Optional[RequestOptions]
298
+ Request-specific configuration.
299
+
300
+ Returns
301
+ -------
302
+ HttpResponse[SetMiningPayoutDestinationResponse]
303
+ Successful response
304
+ """
305
+ _response = self._client_wrapper.httpx_client.request(
306
+ "api/v4/mining/payout-destination/edit",
307
+ base_url=self._client_wrapper.get_environment().base,
308
+ method="POST",
309
+ json={
310
+ "accountName": account_name,
311
+ "destination": destination,
312
+ "address": address,
313
+ },
314
+ headers={
315
+ "content-type": "application/json",
316
+ },
317
+ request_options=request_options,
318
+ omit=OMIT,
319
+ )
320
+ try:
321
+ if 200 <= _response.status_code < 300:
322
+ _data = typing.cast(
323
+ SetMiningPayoutDestinationResponse,
324
+ parse_obj_as(
325
+ type_=SetMiningPayoutDestinationResponse, # type: ignore
326
+ object_=_response.json(),
327
+ ),
328
+ )
329
+ return HttpResponse(response=_response, data=_data)
330
+ if _response.status_code == 400:
331
+ raise BadRequestError(
332
+ headers=dict(_response.headers),
333
+ body=typing.cast(
334
+ typing.Optional[typing.Any],
335
+ parse_obj_as(
336
+ type_=typing.Optional[typing.Any], # type: ignore
337
+ object_=_response.json(),
338
+ ),
339
+ ),
340
+ )
341
+ _response_json = _response.json()
342
+ except JSONDecodeError:
343
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
344
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
345
+
346
+ def get_mining_miner_info(
347
+ self, *, account: str, request_options: typing.Optional[RequestOptions] = None
348
+ ) -> HttpResponse[GetMiningMinerInfoResponse]:
349
+ """
350
+ Returns fee information and stratum connection details with worker counts for a specific mining account.
351
+
352
+ <Warning>
353
+ Rate limit: 1000 requests/10 sec.
354
+ </Warning>
355
+
356
+ Parameters
357
+ ----------
358
+ account : str
359
+ Mining pool account name
360
+
361
+ request_options : typing.Optional[RequestOptions]
362
+ Request-specific configuration.
363
+
364
+ Returns
365
+ -------
366
+ HttpResponse[GetMiningMinerInfoResponse]
367
+ Successful response
368
+ """
369
+ _response = self._client_wrapper.httpx_client.request(
370
+ "api/v4/mining/miners/info",
371
+ base_url=self._client_wrapper.get_environment().base,
372
+ method="POST",
373
+ json={
374
+ "account": account,
375
+ },
376
+ headers={
377
+ "content-type": "application/json",
378
+ },
379
+ request_options=request_options,
380
+ omit=OMIT,
381
+ )
382
+ try:
383
+ if 200 <= _response.status_code < 300:
384
+ _data = typing.cast(
385
+ GetMiningMinerInfoResponse,
386
+ parse_obj_as(
387
+ type_=GetMiningMinerInfoResponse, # type: ignore
388
+ object_=_response.json(),
389
+ ),
390
+ )
391
+ return HttpResponse(response=_response, data=_data)
392
+ if _response.status_code == 400:
393
+ raise BadRequestError(
394
+ headers=dict(_response.headers),
395
+ body=typing.cast(
396
+ typing.Optional[typing.Any],
397
+ parse_obj_as(
398
+ type_=typing.Optional[typing.Any], # type: ignore
399
+ object_=_response.json(),
400
+ ),
401
+ ),
402
+ )
403
+ _response_json = _response.json()
404
+ except JSONDecodeError:
405
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
406
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
407
+
408
+ def get_mining_worker_names(
409
+ self,
410
+ *,
411
+ account: str,
412
+ offset: typing.Optional[int] = OMIT,
413
+ limit: typing.Optional[int] = OMIT,
414
+ request_options: typing.Optional[RequestOptions] = None,
415
+ ) -> HttpResponse[GetMiningWorkerNamesResponse]:
416
+ """
417
+ Returns a paginated list of online worker names for a specific mining account.
418
+
419
+ <Warning>
420
+ Rate limit: 1000 requests/10 sec.
421
+ </Warning>
422
+
423
+ Parameters
424
+ ----------
425
+ account : str
426
+ Mining pool account name
427
+
428
+ offset : typing.Optional[int]
429
+ Pagination offset
430
+
431
+ limit : typing.Optional[int]
432
+ Pagination limit
433
+
434
+ request_options : typing.Optional[RequestOptions]
435
+ Request-specific configuration.
436
+
437
+ Returns
438
+ -------
439
+ HttpResponse[GetMiningWorkerNamesResponse]
440
+ Successful response
441
+ """
442
+ _response = self._client_wrapper.httpx_client.request(
443
+ "api/v4/mining/workers/names",
444
+ base_url=self._client_wrapper.get_environment().base,
445
+ method="POST",
446
+ json={
447
+ "account": account,
448
+ "offset": offset,
449
+ "limit": limit,
450
+ },
451
+ headers={
452
+ "content-type": "application/json",
453
+ },
454
+ request_options=request_options,
455
+ omit=OMIT,
456
+ )
457
+ try:
458
+ if 200 <= _response.status_code < 300:
459
+ _data = typing.cast(
460
+ GetMiningWorkerNamesResponse,
461
+ parse_obj_as(
462
+ type_=GetMiningWorkerNamesResponse, # type: ignore
463
+ object_=_response.json(),
464
+ ),
465
+ )
466
+ return HttpResponse(response=_response, data=_data)
467
+ if _response.status_code == 400:
468
+ raise BadRequestError(
469
+ headers=dict(_response.headers),
470
+ body=typing.cast(
471
+ typing.Optional[typing.Any],
472
+ parse_obj_as(
473
+ type_=typing.Optional[typing.Any], # type: ignore
474
+ object_=_response.json(),
475
+ ),
476
+ ),
477
+ )
478
+ _response_json = _response.json()
479
+ except JSONDecodeError:
480
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
481
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
482
+
483
+ def get_mining_worker_hashrate(
484
+ self,
485
+ *,
486
+ account: str,
487
+ worker: str,
488
+ interval: typing.Optional[GetMiningWorkerHashrateRequestInterval] = OMIT,
489
+ from_: typing.Optional[int] = OMIT,
490
+ to: typing.Optional[int] = OMIT,
491
+ request_options: typing.Optional[RequestOptions] = None,
492
+ ) -> HttpResponse[GetMiningWorkerHashrateResponse]:
493
+ """
494
+ Returns hashrate performance history for a specific worker on a mining account.
495
+
496
+ <Warning>
497
+ Rate limit: 1000 requests/10 sec.
498
+ </Warning>
499
+
500
+ Parameters
501
+ ----------
502
+ account : str
503
+ Mining pool account name
504
+
505
+ worker : str
506
+ Worker name
507
+
508
+ interval : typing.Optional[GetMiningWorkerHashrateRequestInterval]
509
+ Time frame granularity
510
+
511
+ from_ : typing.Optional[int]
512
+ Start timestamp in Unix seconds. Must be <= now
513
+
514
+ to : typing.Optional[int]
515
+ End timestamp in Unix seconds. Must be <= now
516
+
517
+ request_options : typing.Optional[RequestOptions]
518
+ Request-specific configuration.
519
+
520
+ Returns
521
+ -------
522
+ HttpResponse[GetMiningWorkerHashrateResponse]
523
+ Successful response
524
+ """
525
+ _response = self._client_wrapper.httpx_client.request(
526
+ "api/v4/mining/workers/hashrate",
527
+ base_url=self._client_wrapper.get_environment().base,
528
+ method="POST",
529
+ json={
530
+ "account": account,
531
+ "worker": worker,
532
+ "interval": interval,
533
+ "from": from_,
534
+ "to": to,
535
+ },
536
+ headers={
537
+ "content-type": "application/json",
538
+ },
539
+ request_options=request_options,
540
+ omit=OMIT,
541
+ )
542
+ try:
543
+ if 200 <= _response.status_code < 300:
544
+ _data = typing.cast(
545
+ GetMiningWorkerHashrateResponse,
546
+ parse_obj_as(
547
+ type_=GetMiningWorkerHashrateResponse, # type: ignore
548
+ object_=_response.json(),
549
+ ),
550
+ )
551
+ return HttpResponse(response=_response, data=_data)
552
+ if _response.status_code == 400:
553
+ raise BadRequestError(
554
+ headers=dict(_response.headers),
555
+ body=typing.cast(
556
+ typing.Optional[typing.Any],
557
+ parse_obj_as(
558
+ type_=typing.Optional[typing.Any], # type: ignore
559
+ object_=_response.json(),
560
+ ),
561
+ ),
562
+ )
563
+ _response_json = _response.json()
564
+ except JSONDecodeError:
565
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
566
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
567
+
568
+ def create_mining_watcher_link(
569
+ self,
570
+ *,
571
+ accounts: typing.Sequence[str],
572
+ name: str,
573
+ permissions: typing.Sequence[CreateMiningWatcherLinkRequestPermissionsItem],
574
+ live_until: CreateMiningWatcherLinkRequestLiveUntil,
575
+ request_options: typing.Optional[RequestOptions] = None,
576
+ ) -> HttpResponse[CreateMiningWatcherLinkResponse]:
577
+ """
578
+ Creates a new watcher link for one or more mining accounts, granting specific permissions with a configurable expiration.
579
+
580
+ <Warning>
581
+ Rate limit: 1000 requests/10 sec.
582
+ </Warning>
583
+
584
+ Parameters
585
+ ----------
586
+ accounts : typing.Sequence[str]
587
+ Array of mining account names
588
+
589
+ name : str
590
+ Link name (alphanumeric and underscores only)
591
+
592
+ permissions : typing.Sequence[CreateMiningWatcherLinkRequestPermissionsItem]
593
+ Array of permissions
594
+
595
+ live_until : CreateMiningWatcherLinkRequestLiveUntil
596
+ Expiration period
597
+
598
+ request_options : typing.Optional[RequestOptions]
599
+ Request-specific configuration.
600
+
601
+ Returns
602
+ -------
603
+ HttpResponse[CreateMiningWatcherLinkResponse]
604
+ Watcher link created successfully
605
+ """
606
+ _response = self._client_wrapper.httpx_client.request(
607
+ "api/v4/mining/watcher-links/create",
608
+ base_url=self._client_wrapper.get_environment().base,
609
+ method="POST",
610
+ json={
611
+ "accounts": accounts,
612
+ "name": name,
613
+ "permissions": permissions,
614
+ "liveUntil": live_until,
615
+ },
616
+ headers={
617
+ "content-type": "application/json",
618
+ },
619
+ request_options=request_options,
620
+ omit=OMIT,
621
+ )
622
+ try:
623
+ if 200 <= _response.status_code < 300:
624
+ _data = typing.cast(
625
+ CreateMiningWatcherLinkResponse,
626
+ parse_obj_as(
627
+ type_=CreateMiningWatcherLinkResponse, # type: ignore
628
+ object_=_response.json(),
629
+ ),
630
+ )
631
+ return HttpResponse(response=_response, data=_data)
632
+ if _response.status_code == 400:
633
+ raise BadRequestError(
634
+ headers=dict(_response.headers),
635
+ body=typing.cast(
636
+ typing.Optional[typing.Any],
637
+ parse_obj_as(
638
+ type_=typing.Optional[typing.Any], # type: ignore
639
+ object_=_response.json(),
640
+ ),
641
+ ),
642
+ )
643
+ _response_json = _response.json()
644
+ except JSONDecodeError:
645
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
646
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
647
+
648
+ def list_mining_watcher_links(
649
+ self, *, account: str, request_options: typing.Optional[RequestOptions] = None
650
+ ) -> HttpResponse[ListMiningWatcherLinksResponse]:
651
+ """
652
+ Returns all active watcher links for a specific mining account.
653
+
654
+ <Warning>
655
+ Rate limit: 1000 requests/10 sec.
656
+ </Warning>
657
+
658
+ Parameters
659
+ ----------
660
+ account : str
661
+ Mining pool account name
662
+
663
+ request_options : typing.Optional[RequestOptions]
664
+ Request-specific configuration.
665
+
666
+ Returns
667
+ -------
668
+ HttpResponse[ListMiningWatcherLinksResponse]
669
+ Successful response
670
+ """
671
+ _response = self._client_wrapper.httpx_client.request(
672
+ "api/v4/mining/watcher-links/list",
673
+ base_url=self._client_wrapper.get_environment().base,
674
+ method="POST",
675
+ json={
676
+ "account": account,
677
+ },
678
+ headers={
679
+ "content-type": "application/json",
680
+ },
681
+ request_options=request_options,
682
+ omit=OMIT,
683
+ )
684
+ try:
685
+ if 200 <= _response.status_code < 300:
686
+ _data = typing.cast(
687
+ ListMiningWatcherLinksResponse,
688
+ parse_obj_as(
689
+ type_=ListMiningWatcherLinksResponse, # type: ignore
690
+ object_=_response.json(),
691
+ ),
692
+ )
693
+ return HttpResponse(response=_response, data=_data)
694
+ if _response.status_code == 400:
695
+ raise BadRequestError(
696
+ headers=dict(_response.headers),
697
+ body=typing.cast(
698
+ typing.Optional[typing.Any],
699
+ parse_obj_as(
700
+ type_=typing.Optional[typing.Any], # type: ignore
701
+ object_=_response.json(),
702
+ ),
703
+ ),
704
+ )
705
+ _response_json = _response.json()
706
+ except JSONDecodeError:
707
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
708
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
709
+
710
+ def create_mining_account(
711
+ self,
712
+ *,
713
+ name: str,
714
+ request: str,
715
+ nonce: str,
716
+ referral_code: typing.Optional[str] = OMIT,
717
+ request_options: typing.Optional[RequestOptions] = None,
718
+ ) -> HttpResponse[CreateMiningAccountResponse]:
719
+ """
720
+ Creates a new mining account for the authenticated user. The account name must be unique within the user's accounts.
721
+
722
+ <Warning>
723
+ Rate limit: 1000 requests/10 sec.
724
+ </Warning>
725
+
726
+ Parameters
727
+ ----------
728
+ name : str
729
+ Mining pool account name. Must be unique. Alphanumeric characters and underscores allowed.
730
+
731
+ request : str
732
+ Request signature
733
+
734
+ nonce : str
735
+ Unique request identifier
736
+
737
+ referral_code : typing.Optional[str]
738
+ Optional referral code for account creation
739
+
740
+ request_options : typing.Optional[RequestOptions]
741
+ Request-specific configuration.
742
+
743
+ Returns
744
+ -------
745
+ HttpResponse[CreateMiningAccountResponse]
746
+ Successful response
747
+ """
748
+ _response = self._client_wrapper.httpx_client.request(
749
+ "api/v4/mining/accounts/create",
750
+ base_url=self._client_wrapper.get_environment().base,
751
+ method="POST",
752
+ json={
753
+ "name": name,
754
+ "referralCode": referral_code,
755
+ "request": request,
756
+ "nonce": nonce,
757
+ },
758
+ headers={
759
+ "content-type": "application/json",
760
+ },
761
+ request_options=request_options,
762
+ omit=OMIT,
763
+ )
764
+ try:
765
+ if 200 <= _response.status_code < 300:
766
+ _data = typing.cast(
767
+ CreateMiningAccountResponse,
768
+ parse_obj_as(
769
+ type_=CreateMiningAccountResponse, # type: ignore
770
+ object_=_response.json(),
771
+ ),
772
+ )
773
+ return HttpResponse(response=_response, data=_data)
774
+ if _response.status_code == 400:
775
+ raise BadRequestError(
776
+ headers=dict(_response.headers),
777
+ body=typing.cast(
778
+ typing.Optional[typing.Any],
779
+ parse_obj_as(
780
+ type_=typing.Optional[typing.Any], # type: ignore
781
+ object_=_response.json(),
782
+ ),
783
+ ),
784
+ )
785
+ _response_json = _response.json()
786
+ except JSONDecodeError:
787
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
788
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
789
+
790
+ def get_mining_accounts(
791
+ self,
792
+ *,
793
+ request: str,
794
+ nonce: str,
795
+ name: typing.Optional[str] = OMIT,
796
+ request_options: typing.Optional[RequestOptions] = None,
797
+ ) -> HttpResponse[GetMiningAccountsResponse]:
798
+ """
799
+ Returns a list of mining accounts for the authenticated user. Supports filtering by account name.
800
+
801
+ <Warning>
802
+ Rate limit: 1000 requests/10 sec.
803
+ </Warning>
804
+
805
+ Parameters
806
+ ----------
807
+ request : str
808
+ Request signature
809
+
810
+ nonce : str
811
+ Unique request identifier
812
+
813
+ name : typing.Optional[str]
814
+ Optional filter to search for a specific mining account name (exact match)
815
+
816
+ request_options : typing.Optional[RequestOptions]
817
+ Request-specific configuration.
818
+
819
+ Returns
820
+ -------
821
+ HttpResponse[GetMiningAccountsResponse]
822
+ Successful response
823
+ """
824
+ _response = self._client_wrapper.httpx_client.request(
825
+ "api/v4/mining/accounts",
826
+ base_url=self._client_wrapper.get_environment().base,
827
+ method="POST",
828
+ json={
829
+ "name": name,
830
+ "request": request,
831
+ "nonce": nonce,
832
+ },
833
+ headers={
834
+ "content-type": "application/json",
835
+ },
836
+ request_options=request_options,
837
+ omit=OMIT,
838
+ )
839
+ try:
840
+ if 200 <= _response.status_code < 300:
841
+ _data = typing.cast(
842
+ GetMiningAccountsResponse,
843
+ parse_obj_as(
844
+ type_=GetMiningAccountsResponse, # type: ignore
845
+ object_=_response.json(),
846
+ ),
847
+ )
848
+ return HttpResponse(response=_response, data=_data)
849
+ if _response.status_code == 400:
850
+ raise BadRequestError(
851
+ headers=dict(_response.headers),
852
+ body=typing.cast(
853
+ typing.Optional[typing.Any],
854
+ parse_obj_as(
855
+ type_=typing.Optional[typing.Any], # type: ignore
856
+ object_=_response.json(),
857
+ ),
858
+ ),
859
+ )
860
+ _response_json = _response.json()
861
+ except JSONDecodeError:
862
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
863
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
864
+
865
+
866
+ class AsyncRawMiningPoolClient:
867
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
868
+ self._client_wrapper = client_wrapper
869
+
870
+ async def get_mining_rewards(
871
+ self,
872
+ *,
873
+ account: typing.Optional[str] = OMIT,
874
+ from_: typing.Optional[int] = OMIT,
875
+ to: typing.Optional[int] = OMIT,
876
+ limit: typing.Optional[int] = OMIT,
877
+ offset: typing.Optional[int] = OMIT,
878
+ request_options: typing.Optional[RequestOptions] = None,
879
+ ) -> AsyncHttpResponse[GetMiningRewardsResponse]:
880
+ """
881
+ The endpoint returns rewards received from mining.
882
+
883
+ <Warning>
884
+ Rate limit: 1000 requests/10 sec.
885
+ </Warning>
886
+
887
+ <Note>
888
+ The API does not cache the response.
889
+ </Note>
890
+
891
+ Parameters
892
+ ----------
893
+ account : typing.Optional[str]
894
+ Mining pool account
895
+
896
+ from_ : typing.Optional[int]
897
+ Date timestamp starting from which rewards are received
898
+
899
+ to : typing.Optional[int]
900
+ Date timestamp until which rewards are received
901
+
902
+ limit : typing.Optional[int]
903
+
904
+ offset : typing.Optional[int]
905
+
906
+ request_options : typing.Optional[RequestOptions]
907
+ Request-specific configuration.
908
+
909
+ Returns
910
+ -------
911
+ AsyncHttpResponse[GetMiningRewardsResponse]
912
+ Successful response
913
+ """
914
+ _response = await self._client_wrapper.httpx_client.request(
915
+ "api/v4/mining/rewards",
916
+ base_url=self._client_wrapper.get_environment().base,
917
+ method="POST",
918
+ json={
919
+ "account": account,
920
+ "from": from_,
921
+ "to": to,
922
+ "limit": limit,
923
+ "offset": offset,
924
+ },
925
+ headers={
926
+ "content-type": "application/json",
927
+ },
928
+ request_options=request_options,
929
+ omit=OMIT,
930
+ )
931
+ try:
932
+ if 200 <= _response.status_code < 300:
933
+ _data = typing.cast(
934
+ GetMiningRewardsResponse,
935
+ parse_obj_as(
936
+ type_=GetMiningRewardsResponse, # type: ignore
937
+ object_=_response.json(),
938
+ ),
939
+ )
940
+ return AsyncHttpResponse(response=_response, data=_data)
941
+ if _response.status_code == 422:
942
+ raise UnprocessableEntityError(
943
+ headers=dict(_response.headers),
944
+ body=typing.cast(
945
+ typing.Optional[typing.Any],
946
+ parse_obj_as(
947
+ type_=typing.Optional[typing.Any], # type: ignore
948
+ object_=_response.json(),
949
+ ),
950
+ ),
951
+ )
952
+ _response_json = _response.json()
953
+ except JSONDecodeError:
954
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
955
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
956
+
957
+ async def get_mining_hashrate(
958
+ self,
959
+ *,
960
+ account: str,
961
+ from_: typing.Optional[int] = OMIT,
962
+ to: typing.Optional[int] = OMIT,
963
+ interval: typing.Optional[GetMiningHashrateRequestInterval] = OMIT,
964
+ request_options: typing.Optional[RequestOptions] = None,
965
+ ) -> AsyncHttpResponse[GetMiningHashrateResponse]:
966
+ """
967
+ The endpoint returns hashrate of mining pool account.
968
+
969
+ <Warning>
970
+ Rate limit: 1000 requests/10 sec.
971
+ </Warning>
972
+
973
+ <Note>
974
+ The API does not cache the response.
975
+ </Note>
976
+
977
+ Parameters
978
+ ----------
979
+ account : str
980
+ Mining pool account
981
+
982
+ from_ : typing.Optional[int]
983
+ Unix timestamp of starting point
984
+
985
+ to : typing.Optional[int]
986
+ Unix timestamp of final point
987
+
988
+ interval : typing.Optional[GetMiningHashrateRequestInterval]
989
+ Timestamp interval
990
+
991
+ request_options : typing.Optional[RequestOptions]
992
+ Request-specific configuration.
993
+
994
+ Returns
995
+ -------
996
+ AsyncHttpResponse[GetMiningHashrateResponse]
997
+ Successful response
998
+ """
999
+ _response = await self._client_wrapper.httpx_client.request(
1000
+ "api/v4/mining/hashrate",
1001
+ base_url=self._client_wrapper.get_environment().base,
1002
+ method="POST",
1003
+ json={
1004
+ "account": account,
1005
+ "from": from_,
1006
+ "to": to,
1007
+ "interval": interval,
1008
+ },
1009
+ headers={
1010
+ "content-type": "application/json",
1011
+ },
1012
+ request_options=request_options,
1013
+ omit=OMIT,
1014
+ )
1015
+ try:
1016
+ if 200 <= _response.status_code < 300:
1017
+ _data = typing.cast(
1018
+ GetMiningHashrateResponse,
1019
+ parse_obj_as(
1020
+ type_=GetMiningHashrateResponse, # type: ignore
1021
+ object_=_response.json(),
1022
+ ),
1023
+ )
1024
+ return AsyncHttpResponse(response=_response, data=_data)
1025
+ if _response.status_code == 422:
1026
+ raise UnprocessableEntityError(
1027
+ headers=dict(_response.headers),
1028
+ body=typing.cast(
1029
+ typing.Optional[typing.Any],
1030
+ parse_obj_as(
1031
+ type_=typing.Optional[typing.Any], # type: ignore
1032
+ object_=_response.json(),
1033
+ ),
1034
+ ),
1035
+ )
1036
+ _response_json = _response.json()
1037
+ except JSONDecodeError:
1038
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
1039
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
1040
+
1041
+ async def get_mining_payout_destination(
1042
+ self, *, account_name: str, request_options: typing.Optional[RequestOptions] = None
1043
+ ) -> AsyncHttpResponse[GetMiningPayoutDestinationResponse]:
1044
+ """
1045
+ Returns the current payout destination setting for a specific mining account belonging to the authenticated user.
1046
+
1047
+ <Warning>
1048
+ Rate limit: 1000 requests/10 sec.
1049
+ </Warning>
1050
+
1051
+ Parameters
1052
+ ----------
1053
+ account_name : str
1054
+ Mining pool account name
1055
+
1056
+ request_options : typing.Optional[RequestOptions]
1057
+ Request-specific configuration.
1058
+
1059
+ Returns
1060
+ -------
1061
+ AsyncHttpResponse[GetMiningPayoutDestinationResponse]
1062
+ Successful response
1063
+ """
1064
+ _response = await self._client_wrapper.httpx_client.request(
1065
+ "api/v4/mining/payout-destination",
1066
+ base_url=self._client_wrapper.get_environment().base,
1067
+ method="POST",
1068
+ json={
1069
+ "accountName": account_name,
1070
+ },
1071
+ headers={
1072
+ "content-type": "application/json",
1073
+ },
1074
+ request_options=request_options,
1075
+ omit=OMIT,
1076
+ )
1077
+ try:
1078
+ if 200 <= _response.status_code < 300:
1079
+ _data = typing.cast(
1080
+ GetMiningPayoutDestinationResponse,
1081
+ parse_obj_as(
1082
+ type_=GetMiningPayoutDestinationResponse, # type: ignore
1083
+ object_=_response.json(),
1084
+ ),
1085
+ )
1086
+ return AsyncHttpResponse(response=_response, data=_data)
1087
+ if _response.status_code == 400:
1088
+ raise BadRequestError(
1089
+ headers=dict(_response.headers),
1090
+ body=typing.cast(
1091
+ typing.Optional[typing.Any],
1092
+ parse_obj_as(
1093
+ type_=typing.Optional[typing.Any], # type: ignore
1094
+ object_=_response.json(),
1095
+ ),
1096
+ ),
1097
+ )
1098
+ _response_json = _response.json()
1099
+ except JSONDecodeError:
1100
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
1101
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
1102
+
1103
+ async def set_mining_payout_destination(
1104
+ self,
1105
+ *,
1106
+ account_name: str,
1107
+ destination: SetMiningPayoutDestinationRequestDestination,
1108
+ address: typing.Optional[str] = OMIT,
1109
+ request_options: typing.Optional[RequestOptions] = None,
1110
+ ) -> AsyncHttpResponse[SetMiningPayoutDestinationResponse]:
1111
+ """
1112
+ Updates the payout destination for a specific mining account belonging to the authenticated user. Can be set to main balance or an external BTC address.
1113
+
1114
+ <Warning>
1115
+ Rate limit: 1000 requests/10 sec.
1116
+ </Warning>
1117
+
1118
+ Parameters
1119
+ ----------
1120
+ account_name : str
1121
+ Mining pool account name
1122
+
1123
+ destination : SetMiningPayoutDestinationRequestDestination
1124
+ Payout destination type
1125
+
1126
+ address : typing.Optional[str]
1127
+ External BTC address. Required when destination is external_address. Supports all standard Bitcoin address formats.
1128
+
1129
+ request_options : typing.Optional[RequestOptions]
1130
+ Request-specific configuration.
1131
+
1132
+ Returns
1133
+ -------
1134
+ AsyncHttpResponse[SetMiningPayoutDestinationResponse]
1135
+ Successful response
1136
+ """
1137
+ _response = await self._client_wrapper.httpx_client.request(
1138
+ "api/v4/mining/payout-destination/edit",
1139
+ base_url=self._client_wrapper.get_environment().base,
1140
+ method="POST",
1141
+ json={
1142
+ "accountName": account_name,
1143
+ "destination": destination,
1144
+ "address": address,
1145
+ },
1146
+ headers={
1147
+ "content-type": "application/json",
1148
+ },
1149
+ request_options=request_options,
1150
+ omit=OMIT,
1151
+ )
1152
+ try:
1153
+ if 200 <= _response.status_code < 300:
1154
+ _data = typing.cast(
1155
+ SetMiningPayoutDestinationResponse,
1156
+ parse_obj_as(
1157
+ type_=SetMiningPayoutDestinationResponse, # type: ignore
1158
+ object_=_response.json(),
1159
+ ),
1160
+ )
1161
+ return AsyncHttpResponse(response=_response, data=_data)
1162
+ if _response.status_code == 400:
1163
+ raise BadRequestError(
1164
+ headers=dict(_response.headers),
1165
+ body=typing.cast(
1166
+ typing.Optional[typing.Any],
1167
+ parse_obj_as(
1168
+ type_=typing.Optional[typing.Any], # type: ignore
1169
+ object_=_response.json(),
1170
+ ),
1171
+ ),
1172
+ )
1173
+ _response_json = _response.json()
1174
+ except JSONDecodeError:
1175
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
1176
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
1177
+
1178
+ async def get_mining_miner_info(
1179
+ self, *, account: str, request_options: typing.Optional[RequestOptions] = None
1180
+ ) -> AsyncHttpResponse[GetMiningMinerInfoResponse]:
1181
+ """
1182
+ Returns fee information and stratum connection details with worker counts for a specific mining account.
1183
+
1184
+ <Warning>
1185
+ Rate limit: 1000 requests/10 sec.
1186
+ </Warning>
1187
+
1188
+ Parameters
1189
+ ----------
1190
+ account : str
1191
+ Mining pool account name
1192
+
1193
+ request_options : typing.Optional[RequestOptions]
1194
+ Request-specific configuration.
1195
+
1196
+ Returns
1197
+ -------
1198
+ AsyncHttpResponse[GetMiningMinerInfoResponse]
1199
+ Successful response
1200
+ """
1201
+ _response = await self._client_wrapper.httpx_client.request(
1202
+ "api/v4/mining/miners/info",
1203
+ base_url=self._client_wrapper.get_environment().base,
1204
+ method="POST",
1205
+ json={
1206
+ "account": account,
1207
+ },
1208
+ headers={
1209
+ "content-type": "application/json",
1210
+ },
1211
+ request_options=request_options,
1212
+ omit=OMIT,
1213
+ )
1214
+ try:
1215
+ if 200 <= _response.status_code < 300:
1216
+ _data = typing.cast(
1217
+ GetMiningMinerInfoResponse,
1218
+ parse_obj_as(
1219
+ type_=GetMiningMinerInfoResponse, # type: ignore
1220
+ object_=_response.json(),
1221
+ ),
1222
+ )
1223
+ return AsyncHttpResponse(response=_response, data=_data)
1224
+ if _response.status_code == 400:
1225
+ raise BadRequestError(
1226
+ headers=dict(_response.headers),
1227
+ body=typing.cast(
1228
+ typing.Optional[typing.Any],
1229
+ parse_obj_as(
1230
+ type_=typing.Optional[typing.Any], # type: ignore
1231
+ object_=_response.json(),
1232
+ ),
1233
+ ),
1234
+ )
1235
+ _response_json = _response.json()
1236
+ except JSONDecodeError:
1237
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
1238
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
1239
+
1240
+ async def get_mining_worker_names(
1241
+ self,
1242
+ *,
1243
+ account: str,
1244
+ offset: typing.Optional[int] = OMIT,
1245
+ limit: typing.Optional[int] = OMIT,
1246
+ request_options: typing.Optional[RequestOptions] = None,
1247
+ ) -> AsyncHttpResponse[GetMiningWorkerNamesResponse]:
1248
+ """
1249
+ Returns a paginated list of online worker names for a specific mining account.
1250
+
1251
+ <Warning>
1252
+ Rate limit: 1000 requests/10 sec.
1253
+ </Warning>
1254
+
1255
+ Parameters
1256
+ ----------
1257
+ account : str
1258
+ Mining pool account name
1259
+
1260
+ offset : typing.Optional[int]
1261
+ Pagination offset
1262
+
1263
+ limit : typing.Optional[int]
1264
+ Pagination limit
1265
+
1266
+ request_options : typing.Optional[RequestOptions]
1267
+ Request-specific configuration.
1268
+
1269
+ Returns
1270
+ -------
1271
+ AsyncHttpResponse[GetMiningWorkerNamesResponse]
1272
+ Successful response
1273
+ """
1274
+ _response = await self._client_wrapper.httpx_client.request(
1275
+ "api/v4/mining/workers/names",
1276
+ base_url=self._client_wrapper.get_environment().base,
1277
+ method="POST",
1278
+ json={
1279
+ "account": account,
1280
+ "offset": offset,
1281
+ "limit": limit,
1282
+ },
1283
+ headers={
1284
+ "content-type": "application/json",
1285
+ },
1286
+ request_options=request_options,
1287
+ omit=OMIT,
1288
+ )
1289
+ try:
1290
+ if 200 <= _response.status_code < 300:
1291
+ _data = typing.cast(
1292
+ GetMiningWorkerNamesResponse,
1293
+ parse_obj_as(
1294
+ type_=GetMiningWorkerNamesResponse, # type: ignore
1295
+ object_=_response.json(),
1296
+ ),
1297
+ )
1298
+ return AsyncHttpResponse(response=_response, data=_data)
1299
+ if _response.status_code == 400:
1300
+ raise BadRequestError(
1301
+ headers=dict(_response.headers),
1302
+ body=typing.cast(
1303
+ typing.Optional[typing.Any],
1304
+ parse_obj_as(
1305
+ type_=typing.Optional[typing.Any], # type: ignore
1306
+ object_=_response.json(),
1307
+ ),
1308
+ ),
1309
+ )
1310
+ _response_json = _response.json()
1311
+ except JSONDecodeError:
1312
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
1313
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
1314
+
1315
+ async def get_mining_worker_hashrate(
1316
+ self,
1317
+ *,
1318
+ account: str,
1319
+ worker: str,
1320
+ interval: typing.Optional[GetMiningWorkerHashrateRequestInterval] = OMIT,
1321
+ from_: typing.Optional[int] = OMIT,
1322
+ to: typing.Optional[int] = OMIT,
1323
+ request_options: typing.Optional[RequestOptions] = None,
1324
+ ) -> AsyncHttpResponse[GetMiningWorkerHashrateResponse]:
1325
+ """
1326
+ Returns hashrate performance history for a specific worker on a mining account.
1327
+
1328
+ <Warning>
1329
+ Rate limit: 1000 requests/10 sec.
1330
+ </Warning>
1331
+
1332
+ Parameters
1333
+ ----------
1334
+ account : str
1335
+ Mining pool account name
1336
+
1337
+ worker : str
1338
+ Worker name
1339
+
1340
+ interval : typing.Optional[GetMiningWorkerHashrateRequestInterval]
1341
+ Time frame granularity
1342
+
1343
+ from_ : typing.Optional[int]
1344
+ Start timestamp in Unix seconds. Must be <= now
1345
+
1346
+ to : typing.Optional[int]
1347
+ End timestamp in Unix seconds. Must be <= now
1348
+
1349
+ request_options : typing.Optional[RequestOptions]
1350
+ Request-specific configuration.
1351
+
1352
+ Returns
1353
+ -------
1354
+ AsyncHttpResponse[GetMiningWorkerHashrateResponse]
1355
+ Successful response
1356
+ """
1357
+ _response = await self._client_wrapper.httpx_client.request(
1358
+ "api/v4/mining/workers/hashrate",
1359
+ base_url=self._client_wrapper.get_environment().base,
1360
+ method="POST",
1361
+ json={
1362
+ "account": account,
1363
+ "worker": worker,
1364
+ "interval": interval,
1365
+ "from": from_,
1366
+ "to": to,
1367
+ },
1368
+ headers={
1369
+ "content-type": "application/json",
1370
+ },
1371
+ request_options=request_options,
1372
+ omit=OMIT,
1373
+ )
1374
+ try:
1375
+ if 200 <= _response.status_code < 300:
1376
+ _data = typing.cast(
1377
+ GetMiningWorkerHashrateResponse,
1378
+ parse_obj_as(
1379
+ type_=GetMiningWorkerHashrateResponse, # type: ignore
1380
+ object_=_response.json(),
1381
+ ),
1382
+ )
1383
+ return AsyncHttpResponse(response=_response, data=_data)
1384
+ if _response.status_code == 400:
1385
+ raise BadRequestError(
1386
+ headers=dict(_response.headers),
1387
+ body=typing.cast(
1388
+ typing.Optional[typing.Any],
1389
+ parse_obj_as(
1390
+ type_=typing.Optional[typing.Any], # type: ignore
1391
+ object_=_response.json(),
1392
+ ),
1393
+ ),
1394
+ )
1395
+ _response_json = _response.json()
1396
+ except JSONDecodeError:
1397
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
1398
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
1399
+
1400
+ async def create_mining_watcher_link(
1401
+ self,
1402
+ *,
1403
+ accounts: typing.Sequence[str],
1404
+ name: str,
1405
+ permissions: typing.Sequence[CreateMiningWatcherLinkRequestPermissionsItem],
1406
+ live_until: CreateMiningWatcherLinkRequestLiveUntil,
1407
+ request_options: typing.Optional[RequestOptions] = None,
1408
+ ) -> AsyncHttpResponse[CreateMiningWatcherLinkResponse]:
1409
+ """
1410
+ Creates a new watcher link for one or more mining accounts, granting specific permissions with a configurable expiration.
1411
+
1412
+ <Warning>
1413
+ Rate limit: 1000 requests/10 sec.
1414
+ </Warning>
1415
+
1416
+ Parameters
1417
+ ----------
1418
+ accounts : typing.Sequence[str]
1419
+ Array of mining account names
1420
+
1421
+ name : str
1422
+ Link name (alphanumeric and underscores only)
1423
+
1424
+ permissions : typing.Sequence[CreateMiningWatcherLinkRequestPermissionsItem]
1425
+ Array of permissions
1426
+
1427
+ live_until : CreateMiningWatcherLinkRequestLiveUntil
1428
+ Expiration period
1429
+
1430
+ request_options : typing.Optional[RequestOptions]
1431
+ Request-specific configuration.
1432
+
1433
+ Returns
1434
+ -------
1435
+ AsyncHttpResponse[CreateMiningWatcherLinkResponse]
1436
+ Watcher link created successfully
1437
+ """
1438
+ _response = await self._client_wrapper.httpx_client.request(
1439
+ "api/v4/mining/watcher-links/create",
1440
+ base_url=self._client_wrapper.get_environment().base,
1441
+ method="POST",
1442
+ json={
1443
+ "accounts": accounts,
1444
+ "name": name,
1445
+ "permissions": permissions,
1446
+ "liveUntil": live_until,
1447
+ },
1448
+ headers={
1449
+ "content-type": "application/json",
1450
+ },
1451
+ request_options=request_options,
1452
+ omit=OMIT,
1453
+ )
1454
+ try:
1455
+ if 200 <= _response.status_code < 300:
1456
+ _data = typing.cast(
1457
+ CreateMiningWatcherLinkResponse,
1458
+ parse_obj_as(
1459
+ type_=CreateMiningWatcherLinkResponse, # type: ignore
1460
+ object_=_response.json(),
1461
+ ),
1462
+ )
1463
+ return AsyncHttpResponse(response=_response, data=_data)
1464
+ if _response.status_code == 400:
1465
+ raise BadRequestError(
1466
+ headers=dict(_response.headers),
1467
+ body=typing.cast(
1468
+ typing.Optional[typing.Any],
1469
+ parse_obj_as(
1470
+ type_=typing.Optional[typing.Any], # type: ignore
1471
+ object_=_response.json(),
1472
+ ),
1473
+ ),
1474
+ )
1475
+ _response_json = _response.json()
1476
+ except JSONDecodeError:
1477
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
1478
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
1479
+
1480
+ async def list_mining_watcher_links(
1481
+ self, *, account: str, request_options: typing.Optional[RequestOptions] = None
1482
+ ) -> AsyncHttpResponse[ListMiningWatcherLinksResponse]:
1483
+ """
1484
+ Returns all active watcher links for a specific mining account.
1485
+
1486
+ <Warning>
1487
+ Rate limit: 1000 requests/10 sec.
1488
+ </Warning>
1489
+
1490
+ Parameters
1491
+ ----------
1492
+ account : str
1493
+ Mining pool account name
1494
+
1495
+ request_options : typing.Optional[RequestOptions]
1496
+ Request-specific configuration.
1497
+
1498
+ Returns
1499
+ -------
1500
+ AsyncHttpResponse[ListMiningWatcherLinksResponse]
1501
+ Successful response
1502
+ """
1503
+ _response = await self._client_wrapper.httpx_client.request(
1504
+ "api/v4/mining/watcher-links/list",
1505
+ base_url=self._client_wrapper.get_environment().base,
1506
+ method="POST",
1507
+ json={
1508
+ "account": account,
1509
+ },
1510
+ headers={
1511
+ "content-type": "application/json",
1512
+ },
1513
+ request_options=request_options,
1514
+ omit=OMIT,
1515
+ )
1516
+ try:
1517
+ if 200 <= _response.status_code < 300:
1518
+ _data = typing.cast(
1519
+ ListMiningWatcherLinksResponse,
1520
+ parse_obj_as(
1521
+ type_=ListMiningWatcherLinksResponse, # type: ignore
1522
+ object_=_response.json(),
1523
+ ),
1524
+ )
1525
+ return AsyncHttpResponse(response=_response, data=_data)
1526
+ if _response.status_code == 400:
1527
+ raise BadRequestError(
1528
+ headers=dict(_response.headers),
1529
+ body=typing.cast(
1530
+ typing.Optional[typing.Any],
1531
+ parse_obj_as(
1532
+ type_=typing.Optional[typing.Any], # type: ignore
1533
+ object_=_response.json(),
1534
+ ),
1535
+ ),
1536
+ )
1537
+ _response_json = _response.json()
1538
+ except JSONDecodeError:
1539
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
1540
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
1541
+
1542
+ async def create_mining_account(
1543
+ self,
1544
+ *,
1545
+ name: str,
1546
+ request: str,
1547
+ nonce: str,
1548
+ referral_code: typing.Optional[str] = OMIT,
1549
+ request_options: typing.Optional[RequestOptions] = None,
1550
+ ) -> AsyncHttpResponse[CreateMiningAccountResponse]:
1551
+ """
1552
+ Creates a new mining account for the authenticated user. The account name must be unique within the user's accounts.
1553
+
1554
+ <Warning>
1555
+ Rate limit: 1000 requests/10 sec.
1556
+ </Warning>
1557
+
1558
+ Parameters
1559
+ ----------
1560
+ name : str
1561
+ Mining pool account name. Must be unique. Alphanumeric characters and underscores allowed.
1562
+
1563
+ request : str
1564
+ Request signature
1565
+
1566
+ nonce : str
1567
+ Unique request identifier
1568
+
1569
+ referral_code : typing.Optional[str]
1570
+ Optional referral code for account creation
1571
+
1572
+ request_options : typing.Optional[RequestOptions]
1573
+ Request-specific configuration.
1574
+
1575
+ Returns
1576
+ -------
1577
+ AsyncHttpResponse[CreateMiningAccountResponse]
1578
+ Successful response
1579
+ """
1580
+ _response = await self._client_wrapper.httpx_client.request(
1581
+ "api/v4/mining/accounts/create",
1582
+ base_url=self._client_wrapper.get_environment().base,
1583
+ method="POST",
1584
+ json={
1585
+ "name": name,
1586
+ "referralCode": referral_code,
1587
+ "request": request,
1588
+ "nonce": nonce,
1589
+ },
1590
+ headers={
1591
+ "content-type": "application/json",
1592
+ },
1593
+ request_options=request_options,
1594
+ omit=OMIT,
1595
+ )
1596
+ try:
1597
+ if 200 <= _response.status_code < 300:
1598
+ _data = typing.cast(
1599
+ CreateMiningAccountResponse,
1600
+ parse_obj_as(
1601
+ type_=CreateMiningAccountResponse, # type: ignore
1602
+ object_=_response.json(),
1603
+ ),
1604
+ )
1605
+ return AsyncHttpResponse(response=_response, data=_data)
1606
+ if _response.status_code == 400:
1607
+ raise BadRequestError(
1608
+ headers=dict(_response.headers),
1609
+ body=typing.cast(
1610
+ typing.Optional[typing.Any],
1611
+ parse_obj_as(
1612
+ type_=typing.Optional[typing.Any], # type: ignore
1613
+ object_=_response.json(),
1614
+ ),
1615
+ ),
1616
+ )
1617
+ _response_json = _response.json()
1618
+ except JSONDecodeError:
1619
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
1620
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
1621
+
1622
+ async def get_mining_accounts(
1623
+ self,
1624
+ *,
1625
+ request: str,
1626
+ nonce: str,
1627
+ name: typing.Optional[str] = OMIT,
1628
+ request_options: typing.Optional[RequestOptions] = None,
1629
+ ) -> AsyncHttpResponse[GetMiningAccountsResponse]:
1630
+ """
1631
+ Returns a list of mining accounts for the authenticated user. Supports filtering by account name.
1632
+
1633
+ <Warning>
1634
+ Rate limit: 1000 requests/10 sec.
1635
+ </Warning>
1636
+
1637
+ Parameters
1638
+ ----------
1639
+ request : str
1640
+ Request signature
1641
+
1642
+ nonce : str
1643
+ Unique request identifier
1644
+
1645
+ name : typing.Optional[str]
1646
+ Optional filter to search for a specific mining account name (exact match)
1647
+
1648
+ request_options : typing.Optional[RequestOptions]
1649
+ Request-specific configuration.
1650
+
1651
+ Returns
1652
+ -------
1653
+ AsyncHttpResponse[GetMiningAccountsResponse]
1654
+ Successful response
1655
+ """
1656
+ _response = await self._client_wrapper.httpx_client.request(
1657
+ "api/v4/mining/accounts",
1658
+ base_url=self._client_wrapper.get_environment().base,
1659
+ method="POST",
1660
+ json={
1661
+ "name": name,
1662
+ "request": request,
1663
+ "nonce": nonce,
1664
+ },
1665
+ headers={
1666
+ "content-type": "application/json",
1667
+ },
1668
+ request_options=request_options,
1669
+ omit=OMIT,
1670
+ )
1671
+ try:
1672
+ if 200 <= _response.status_code < 300:
1673
+ _data = typing.cast(
1674
+ GetMiningAccountsResponse,
1675
+ parse_obj_as(
1676
+ type_=GetMiningAccountsResponse, # type: ignore
1677
+ object_=_response.json(),
1678
+ ),
1679
+ )
1680
+ return AsyncHttpResponse(response=_response, data=_data)
1681
+ if _response.status_code == 400:
1682
+ raise BadRequestError(
1683
+ headers=dict(_response.headers),
1684
+ body=typing.cast(
1685
+ typing.Optional[typing.Any],
1686
+ parse_obj_as(
1687
+ type_=typing.Optional[typing.Any], # type: ignore
1688
+ object_=_response.json(),
1689
+ ),
1690
+ ),
1691
+ )
1692
+ _response_json = _response.json()
1693
+ except JSONDecodeError:
1694
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
1695
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)