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.
- whitebit/__init__.py +793 -0
- whitebit/client.py +580 -0
- whitebit/codes/__init__.py +7 -0
- whitebit/codes/client.py +510 -0
- whitebit/codes/raw_client.py +809 -0
- whitebit/codes/types/__init__.py +10 -0
- whitebit/codes/types/apply_code_response.py +22 -0
- whitebit/codes/types/create_code_response.py +32 -0
- whitebit/codes/types/get_codes_history_response.py +27 -0
- whitebit/codes/types/get_my_codes_response.py +27 -0
- whitebit/collateral_trading/__init__.py +183 -0
- whitebit/collateral_trading/client.py +2452 -0
- whitebit/collateral_trading/raw_client.py +4337 -0
- whitebit/collateral_trading/types/__init__.py +213 -0
- whitebit/collateral_trading/types/cancel_oco_order_response.py +34 -0
- whitebit/collateral_trading/types/cancel_oco_order_response_stop_loss.py +146 -0
- whitebit/collateral_trading/types/cancel_oco_order_response_stop_loss_activation_condition.py +5 -0
- whitebit/collateral_trading/types/cancel_oco_order_response_stop_loss_side.py +5 -0
- whitebit/collateral_trading/types/cancel_oco_order_response_take_profit.py +114 -0
- whitebit/collateral_trading/types/cancel_oco_order_response_take_profit_side.py +5 -0
- whitebit/collateral_trading/types/change_collateral_account_leverage_response.py +22 -0
- whitebit/collateral_trading/types/close_position_request_position_side.py +5 -0
- whitebit/collateral_trading/types/collateral_account_balance_summary_response_item.py +48 -0
- whitebit/collateral_trading/types/collateral_account_summary_response.py +60 -0
- whitebit/collateral_trading/types/create_collateral_bulk_order_request_orders_item.py +98 -0
- whitebit/collateral_trading/types/create_collateral_bulk_order_request_orders_item_position_side.py +7 -0
- whitebit/collateral_trading/types/create_collateral_bulk_order_request_orders_item_side.py +5 -0
- whitebit/collateral_trading/types/create_collateral_bulk_order_response_item.py +29 -0
- whitebit/collateral_trading/types/create_collateral_bulk_order_response_item_error.py +36 -0
- whitebit/collateral_trading/types/create_collateral_bulk_order_response_item_result.py +132 -0
- whitebit/collateral_trading/types/create_collateral_bulk_order_response_item_result_position_side.py +7 -0
- whitebit/collateral_trading/types/create_collateral_bulk_order_response_item_result_side.py +5 -0
- whitebit/collateral_trading/types/create_collateral_bulk_order_response_item_result_status.py +7 -0
- whitebit/collateral_trading/types/create_collateral_limit_order_request_position_side.py +5 -0
- whitebit/collateral_trading/types/create_collateral_limit_order_request_side.py +5 -0
- whitebit/collateral_trading/types/create_collateral_limit_order_response.py +132 -0
- whitebit/collateral_trading/types/create_collateral_limit_order_response_oto.py +44 -0
- whitebit/collateral_trading/types/create_collateral_limit_order_response_position_side.py +5 -0
- whitebit/collateral_trading/types/create_collateral_limit_order_response_side.py +5 -0
- whitebit/collateral_trading/types/create_collateral_limit_order_response_status.py +7 -0
- whitebit/collateral_trading/types/create_collateral_market_order_request_position_side.py +5 -0
- whitebit/collateral_trading/types/create_collateral_market_order_request_side.py +5 -0
- whitebit/collateral_trading/types/create_collateral_market_order_response.py +110 -0
- whitebit/collateral_trading/types/create_collateral_market_order_response_oto.py +44 -0
- whitebit/collateral_trading/types/create_collateral_market_order_response_position_side.py +5 -0
- whitebit/collateral_trading/types/create_collateral_market_order_response_side.py +5 -0
- whitebit/collateral_trading/types/create_collateral_market_order_response_status.py +7 -0
- whitebit/collateral_trading/types/create_collateral_oco_order_request_side.py +5 -0
- whitebit/collateral_trading/types/create_collateral_oco_order_response.py +34 -0
- whitebit/collateral_trading/types/create_collateral_oco_order_response_stop_loss.py +159 -0
- whitebit/collateral_trading/types/create_collateral_oco_order_response_stop_loss_activation_condition.py +5 -0
- whitebit/collateral_trading/types/create_collateral_oco_order_response_stop_loss_position_side.py +5 -0
- whitebit/collateral_trading/types/create_collateral_oco_order_response_stop_loss_side.py +5 -0
- whitebit/collateral_trading/types/create_collateral_oco_order_response_stop_loss_status.py +7 -0
- whitebit/collateral_trading/types/create_collateral_oco_order_response_take_profit.py +139 -0
- whitebit/collateral_trading/types/create_collateral_oco_order_response_take_profit_position_side.py +7 -0
- whitebit/collateral_trading/types/create_collateral_oco_order_response_take_profit_side.py +5 -0
- whitebit/collateral_trading/types/create_collateral_oco_order_response_take_profit_status.py +7 -0
- whitebit/collateral_trading/types/create_collateral_stop_limit_order_request_position_side.py +5 -0
- whitebit/collateral_trading/types/create_collateral_stop_limit_order_request_side.py +5 -0
- whitebit/collateral_trading/types/create_collateral_stop_limit_order_response.py +122 -0
- whitebit/collateral_trading/types/create_collateral_stop_limit_order_response_oto.py +44 -0
- whitebit/collateral_trading/types/create_collateral_stop_limit_order_response_position_side.py +5 -0
- whitebit/collateral_trading/types/create_collateral_stop_limit_order_response_side.py +5 -0
- whitebit/collateral_trading/types/create_collateral_stop_limit_order_response_status.py +7 -0
- whitebit/collateral_trading/types/create_collateral_trigger_market_order_request_position_side.py +7 -0
- whitebit/collateral_trading/types/create_collateral_trigger_market_order_request_side.py +5 -0
- whitebit/collateral_trading/types/create_collateral_trigger_market_order_response.py +117 -0
- whitebit/collateral_trading/types/create_collateral_trigger_market_order_response_oto.py +44 -0
- whitebit/collateral_trading/types/create_collateral_trigger_market_order_response_position_side.py +7 -0
- whitebit/collateral_trading/types/create_collateral_trigger_market_order_response_side.py +5 -0
- whitebit/collateral_trading/types/create_collateral_trigger_market_order_response_status.py +7 -0
- whitebit/collateral_trading/types/get_collateral_hedge_mode_response.py +26 -0
- whitebit/collateral_trading/types/get_conditional_orders_response.py +38 -0
- whitebit/collateral_trading/types/get_conditional_orders_response_records_item.py +60 -0
- whitebit/collateral_trading/types/get_conditional_orders_response_records_item_oco.py +31 -0
- whitebit/collateral_trading/types/get_conditional_orders_response_records_item_oco_stop_loss.py +28 -0
- whitebit/collateral_trading/types/get_conditional_orders_response_records_item_oco_stop_loss_position_side.py +7 -0
- whitebit/collateral_trading/types/get_conditional_orders_response_records_item_oco_take_profit.py +28 -0
- whitebit/collateral_trading/types/get_conditional_orders_response_records_item_oco_take_profit_position_side.py +7 -0
- whitebit/collateral_trading/types/get_conditional_orders_response_records_item_oto.py +34 -0
- whitebit/collateral_trading/types/get_conditional_orders_response_records_item_oto_conditional_order.py +30 -0
- whitebit/collateral_trading/types/get_conditional_orders_response_records_item_oto_conditional_order_position_side.py +7 -0
- whitebit/collateral_trading/types/get_funding_history_response.py +33 -0
- whitebit/collateral_trading/types/get_funding_history_response_records_item.py +66 -0
- whitebit/collateral_trading/types/get_oco_orders_response_item.py +34 -0
- whitebit/collateral_trading/types/get_oco_orders_response_item_stop_loss.py +49 -0
- whitebit/collateral_trading/types/get_oco_orders_response_item_stop_loss_activation_condition.py +5 -0
- whitebit/collateral_trading/types/get_oco_orders_response_item_stop_loss_side.py +5 -0
- whitebit/collateral_trading/types/get_oco_orders_response_item_take_profit.py +43 -0
- whitebit/collateral_trading/types/get_oco_orders_response_item_take_profit_side.py +5 -0
- whitebit/collateral_trading/types/get_open_positions_response_item.py +136 -0
- whitebit/collateral_trading/types/get_open_positions_response_item_liquidation_state.py +5 -0
- whitebit/collateral_trading/types/get_open_positions_response_item_position_side.py +5 -0
- whitebit/collateral_trading/types/get_open_positions_response_item_tpsl.py +51 -0
- whitebit/collateral_trading/types/get_positions_history_response_item.py +95 -0
- whitebit/collateral_trading/types/get_positions_history_response_item_liquidation_state.py +5 -0
- whitebit/collateral_trading/types/get_positions_history_response_item_order_detail.py +61 -0
- whitebit/collateral_trading/types/get_positions_history_response_item_position_side.py +5 -0
- whitebit/core/__init__.py +52 -0
- whitebit/core/api_error.py +23 -0
- whitebit/core/client_wrapper.py +57 -0
- whitebit/core/datetime_utils.py +28 -0
- whitebit/core/file.py +67 -0
- whitebit/core/http_client.py +497 -0
- whitebit/core/http_response.py +55 -0
- whitebit/core/jsonable_encoder.py +100 -0
- whitebit/core/pydantic_utilities.py +255 -0
- whitebit/core/query_encoder.py +58 -0
- whitebit/core/remove_none_from_dict.py +11 -0
- whitebit/core/request_options.py +35 -0
- whitebit/core/serialization.py +276 -0
- whitebit/credit_line/__init__.py +4 -0
- whitebit/credit_line/client.py +128 -0
- whitebit/credit_line/raw_client.py +191 -0
- whitebit/crypto_lending_fixed/__init__.py +7 -0
- whitebit/crypto_lending_fixed/client.py +651 -0
- whitebit/crypto_lending_fixed/raw_client.py +931 -0
- whitebit/crypto_lending_fixed/types/__init__.py +9 -0
- whitebit/crypto_lending_fixed/types/create_fixed_investment_response.py +22 -0
- whitebit/crypto_lending_fixed/types/get_fixed_investments_history_response.py +22 -0
- whitebit/crypto_lending_fixed/types/get_interest_payment_history_response.py +22 -0
- whitebit/crypto_lending_flex/__init__.py +29 -0
- whitebit/crypto_lending_flex/client.py +1140 -0
- whitebit/crypto_lending_flex/raw_client.py +1651 -0
- whitebit/crypto_lending_flex/types/__init__.py +27 -0
- whitebit/crypto_lending_flex/types/close_flex_investment_response.py +20 -0
- whitebit/crypto_lending_flex/types/close_flex_investment_response_data.py +26 -0
- whitebit/crypto_lending_flex/types/create_flex_investment_response.py +20 -0
- whitebit/crypto_lending_flex/types/create_flex_investment_response_data.py +26 -0
- whitebit/crypto_lending_flex/types/get_flex_investment_history_response.py +22 -0
- whitebit/crypto_lending_flex/types/get_flex_payment_history_response.py +22 -0
- whitebit/crypto_lending_flex/types/get_user_flex_investments_response.py +22 -0
- whitebit/crypto_lending_flex/types/update_flex_auto_reinvestment_response.py +19 -0
- whitebit/crypto_lending_flex/types/withdraw_from_flex_investment_response.py +20 -0
- whitebit/crypto_lending_flex/types/withdraw_from_flex_investment_response_data.py +26 -0
- whitebit/deposit/__init__.py +35 -0
- whitebit/deposit/client.py +997 -0
- whitebit/deposit/raw_client.py +1342 -0
- whitebit/deposit/types/__init__.py +33 -0
- whitebit/deposit/types/create_new_address_request_type.py +5 -0
- whitebit/deposit/types/create_new_address_response.py +22 -0
- whitebit/deposit/types/create_new_address_response_account.py +27 -0
- whitebit/deposit/types/create_new_address_response_required.py +48 -0
- whitebit/deposit/types/create_new_address_response_required_flex_fee.py +42 -0
- whitebit/deposit/types/get_deposit_address_response.py +22 -0
- whitebit/deposit/types/get_deposit_address_response_account.py +27 -0
- whitebit/deposit/types/get_deposit_address_response_required.py +48 -0
- whitebit/deposit/types/get_deposit_address_response_required_flex_fee.py +42 -0
- whitebit/deposit/types/get_fiat_deposit_url_request_customer.py +61 -0
- whitebit/deposit/types/get_fiat_deposit_url_request_customer_address.py +56 -0
- whitebit/deposit/types/get_fiat_deposit_url_response.py +22 -0
- whitebit/deposit/types/refund_deposit_response.py +22 -0
- whitebit/environment.py +17 -0
- whitebit/errors/__init__.py +19 -0
- whitebit/errors/bad_request_error.py +10 -0
- whitebit/errors/internal_server_error.py +10 -0
- whitebit/errors/not_found_error.py +11 -0
- whitebit/errors/service_unavailable_error.py +10 -0
- whitebit/errors/unauthorized_error.py +10 -0
- whitebit/errors/unprocessable_entity_error.py +10 -0
- whitebit/fees/__init__.py +4 -0
- whitebit/fees/client.py +126 -0
- whitebit/fees/raw_client.py +144 -0
- whitebit/jwt/__init__.py +7 -0
- whitebit/jwt/client.py +224 -0
- whitebit/jwt/raw_client.py +389 -0
- whitebit/jwt/types/__init__.py +9 -0
- whitebit/jwt/types/get_web_socket_token_response.py +22 -0
- whitebit/jwt/types/issue_jwt_token_response.py +20 -0
- whitebit/jwt/types/issue_jwt_token_response_data.py +27 -0
- whitebit/main_account/__init__.py +7 -0
- whitebit/main_account/client.py +380 -0
- whitebit/main_account/raw_client.py +493 -0
- whitebit/main_account/types/__init__.py +8 -0
- whitebit/main_account/types/get_deposit_withdraw_history_response.py +26 -0
- whitebit/main_account/types/get_main_balance_response_value.py +22 -0
- whitebit/market_fee/__init__.py +7 -0
- whitebit/market_fee/client.py +193 -0
- whitebit/market_fee/raw_client.py +267 -0
- whitebit/market_fee/types/__init__.py +8 -0
- whitebit/market_fee/types/get_all_market_fees_response.py +43 -0
- whitebit/market_fee/types/get_market_fee_response.py +38 -0
- whitebit/mining_pool/__init__.py +67 -0
- whitebit/mining_pool/client.py +1083 -0
- whitebit/mining_pool/raw_client.py +1695 -0
- whitebit/mining_pool/types/__init__.py +69 -0
- whitebit/mining_pool/types/create_mining_account_response.py +20 -0
- whitebit/mining_pool/types/create_mining_account_response_data.py +31 -0
- whitebit/mining_pool/types/create_mining_watcher_link_request_live_until.py +5 -0
- whitebit/mining_pool/types/create_mining_watcher_link_request_permissions_item.py +7 -0
- whitebit/mining_pool/types/create_mining_watcher_link_response.py +20 -0
- whitebit/mining_pool/types/create_mining_watcher_link_response_data.py +24 -0
- whitebit/mining_pool/types/get_mining_accounts_response.py +20 -0
- whitebit/mining_pool/types/get_mining_accounts_response_data_item.py +31 -0
- whitebit/mining_pool/types/get_mining_hashrate_request_interval.py +5 -0
- whitebit/mining_pool/types/get_mining_hashrate_response.py +20 -0
- whitebit/mining_pool/types/get_mining_hashrate_response_data.py +21 -0
- whitebit/mining_pool/types/get_mining_hashrate_response_data_hashrate_item.py +20 -0
- whitebit/mining_pool/types/get_mining_miner_info_response.py +20 -0
- whitebit/mining_pool/types/get_mining_miner_info_response_data.py +25 -0
- whitebit/mining_pool/types/get_mining_miner_info_response_data_stratum_item.py +22 -0
- whitebit/mining_pool/types/get_mining_payout_destination_response.py +36 -0
- whitebit/mining_pool/types/get_mining_payout_destination_response_payout_destination.py +7 -0
- whitebit/mining_pool/types/get_mining_rewards_response.py +22 -0
- whitebit/mining_pool/types/get_mining_worker_hashrate_request_interval.py +5 -0
- whitebit/mining_pool/types/get_mining_worker_hashrate_response.py +20 -0
- whitebit/mining_pool/types/get_mining_worker_hashrate_response_data.py +20 -0
- whitebit/mining_pool/types/get_mining_worker_hashrate_response_data_hashrates_item.py +23 -0
- whitebit/mining_pool/types/get_mining_worker_names_response.py +22 -0
- whitebit/mining_pool/types/get_mining_worker_names_response_data.py +19 -0
- whitebit/mining_pool/types/list_mining_watcher_links_response.py +20 -0
- whitebit/mining_pool/types/list_mining_watcher_links_response_data_item.py +27 -0
- whitebit/mining_pool/types/set_mining_payout_destination_request_destination.py +7 -0
- whitebit/mining_pool/types/set_mining_payout_destination_response.py +27 -0
- whitebit/mining_pool/types/set_mining_payout_destination_response_payout_destination.py +7 -0
- whitebit/public_api_v4/__init__.py +37 -0
- whitebit/public_api_v4/client.py +1096 -0
- whitebit/public_api_v4/raw_client.py +1398 -0
- whitebit/public_api_v4/types/__init__.py +37 -0
- whitebit/public_api_v4/types/get_api_v4public_funding_history_market_response_item.py +52 -0
- whitebit/public_api_v4/types/get_api_v4public_futures_response.py +22 -0
- whitebit/public_api_v4/types/get_api_v4public_markets_response_item.py +110 -0
- whitebit/public_api_v4/types/get_api_v4public_markets_response_item_type.py +5 -0
- whitebit/public_api_v4/types/get_api_v4public_mining_pool_response.py +20 -0
- whitebit/public_api_v4/types/get_api_v4public_mining_pool_response_data.py +39 -0
- whitebit/public_api_v4/types/get_api_v4public_mining_pool_response_data_blocks_item.py +22 -0
- whitebit/public_api_v4/types/get_api_v4public_mining_pool_response_data_last7days_hash_rate_item.py +20 -0
- whitebit/public_api_v4/types/get_api_v4public_platform_status_response.py +22 -0
- whitebit/public_api_v4/types/get_api_v4public_ticker_response_value.py +56 -0
- whitebit/public_api_v4/types/get_api_v4public_time_response.py +22 -0
- whitebit/public_api_v4/types/get_api_v4public_trades_market_request_type.py +5 -0
- whitebit/public_api_v4/types/get_api_v4public_trades_market_response_item.py +57 -0
- whitebit/public_api_v4/types/get_api_v4public_trades_market_response_item_type.py +5 -0
- whitebit/raw_client.py +637 -0
- whitebit/spot_trading/__init__.py +47 -0
- whitebit/spot_trading/client.py +4143 -0
- whitebit/spot_trading/raw_client.py +5628 -0
- whitebit/spot_trading/types/__init__.py +45 -0
- whitebit/spot_trading/types/cancel_all_orders_request_type_item.py +5 -0
- whitebit/spot_trading/types/get_executed_order_history_response_value_item.py +62 -0
- whitebit/spot_trading/types/get_executed_order_history_response_value_item_side.py +5 -0
- whitebit/spot_trading/types/get_kill_switch_status_response_item.py +44 -0
- whitebit/spot_trading/types/get_kill_switch_status_response_item_types_item.py +5 -0
- whitebit/spot_trading/types/get_order_deals_response.py +33 -0
- whitebit/spot_trading/types/get_order_deals_response_records_item.py +80 -0
- whitebit/spot_trading/types/get_order_history_response_value_item.py +131 -0
- whitebit/spot_trading/types/get_order_history_response_value_item_side.py +5 -0
- whitebit/spot_trading/types/limit_order_request_side.py +5 -0
- whitebit/spot_trading/types/limit_order_request_stp.py +5 -0
- whitebit/spot_trading/types/set_kill_switch_request_types_item.py +5 -0
- whitebit/spot_trading/types/set_kill_switch_response.py +44 -0
- whitebit/spot_trading/types/set_kill_switch_response_types_item.py +5 -0
- whitebit/spot_trading/types/stop_limit_order_request_side.py +5 -0
- whitebit/spot_trading/types/stop_limit_order_request_stp.py +5 -0
- whitebit/spot_trading/types/stop_market_order_request_side.py +5 -0
- whitebit/spot_trading/types/stop_market_order_request_stp.py +5 -0
- whitebit/spot_trading/types/trade_account_balance_response_value.py +27 -0
- whitebit/sub_account/__init__.py +25 -0
- whitebit/sub_account/client.py +892 -0
- whitebit/sub_account/raw_client.py +1399 -0
- whitebit/sub_account/types/__init__.py +23 -0
- whitebit/sub_account/types/create_sub_account_request_permissions.py +29 -0
- whitebit/sub_account/types/edit_sub_account_request_permissions.py +29 -0
- whitebit/sub_account/types/get_sub_account_balances_response_value_item.py +21 -0
- whitebit/sub_account/types/get_sub_account_transfer_history_request_direction.py +5 -0
- whitebit/sub_account/types/get_sub_account_transfer_history_response.py +22 -0
- whitebit/sub_account/types/list_sub_accounts_response.py +22 -0
- whitebit/sub_account/types/sub_account_transfer_request_direction.py +5 -0
- whitebit/sub_account/types/sub_account_transfer_response.py +26 -0
- whitebit/sub_account_api_keys/__init__.py +19 -0
- whitebit/sub_account_api_keys/client.py +754 -0
- whitebit/sub_account_api_keys/raw_client.py +1183 -0
- whitebit/sub_account_api_keys/types/__init__.py +17 -0
- whitebit/sub_account_api_keys/types/create_sub_account_api_key_ip_address_response.py +19 -0
- whitebit/sub_account_api_keys/types/delete_sub_account_api_key_ip_address_response.py +19 -0
- whitebit/sub_account_api_keys/types/edit_sub_account_api_key_request_urls_item.py +20 -0
- whitebit/sub_account_api_keys/types/list_sub_account_api_key_ip_addresses_response.py +19 -0
- whitebit/sub_account_api_keys/types/list_sub_account_api_keys_response.py +22 -0
- whitebit/transfer/__init__.py +15 -0
- whitebit/transfer/client.py +220 -0
- whitebit/transfer/raw_client.py +276 -0
- whitebit/transfer/types/__init__.py +13 -0
- whitebit/transfer/types/transfer_between_balances_request_from.py +5 -0
- whitebit/transfer/types/transfer_between_balances_request_method.py +7 -0
- whitebit/transfer/types/transfer_between_balances_request_to.py +5 -0
- whitebit/types/__init__.py +311 -0
- whitebit/types/asset.py +106 -0
- whitebit/types/asset_limits.py +33 -0
- whitebit/types/asset_limits_deposit_value.py +20 -0
- whitebit/types/asset_limits_withdraw_value.py +20 -0
- whitebit/types/asset_memo.py +24 -0
- whitebit/types/asset_networks.py +36 -0
- whitebit/types/asset_providers.py +24 -0
- whitebit/types/authorize_request.py +32 -0
- whitebit/types/authorize_response.py +29 -0
- whitebit/types/authorize_response_result.py +22 -0
- whitebit/types/bad_request_error_body.py +20 -0
- whitebit/types/balance_margin_request.py +32 -0
- whitebit/types/balance_margin_response.py +33 -0
- whitebit/types/balance_margin_response_result_value.py +37 -0
- whitebit/types/balance_margin_subscribe.py +32 -0
- whitebit/types/balance_margin_update.py +33 -0
- whitebit/types/balance_margin_update_params_item.py +48 -0
- whitebit/types/balance_spot_request.py +32 -0
- whitebit/types/balance_spot_response.py +33 -0
- whitebit/types/balance_spot_response_result_value.py +27 -0
- whitebit/types/balance_spot_subscribe.py +32 -0
- whitebit/types/balance_spot_update.py +33 -0
- whitebit/types/balance_spot_update_params_item_value.py +27 -0
- whitebit/types/base_request.py +22 -0
- whitebit/types/base_response.py +24 -0
- whitebit/types/book_ticker_subscribe.py +29 -0
- whitebit/types/book_ticker_update.py +26 -0
- whitebit/types/book_ticker_update_data.py +5 -0
- whitebit/types/borrows_events_subscribe.py +32 -0
- whitebit/types/borrows_events_update.py +34 -0
- whitebit/types/borrows_subscribe.py +32 -0
- whitebit/types/borrows_update.py +30 -0
- whitebit/types/borrows_update_params.py +25 -0
- whitebit/types/borrows_update_params_records_item.py +47 -0
- whitebit/types/bulk_limit_order_response.py +7 -0
- whitebit/types/bulk_limit_order_response_item.py +22 -0
- whitebit/types/bulk_order_item.py +42 -0
- whitebit/types/bulk_order_item_side.py +5 -0
- whitebit/types/candle.py +5 -0
- whitebit/types/candles_request.py +36 -0
- whitebit/types/candles_response.py +26 -0
- whitebit/types/candles_subscribe.py +34 -0
- whitebit/types/candles_update.py +26 -0
- whitebit/types/code_history.py +47 -0
- whitebit/types/code_info.py +47 -0
- whitebit/types/convert_confirm_response.py +33 -0
- whitebit/types/convert_estimate_request_direction.py +5 -0
- whitebit/types/convert_estimate_response.py +56 -0
- whitebit/types/convert_history_response.py +34 -0
- whitebit/types/convert_history_response_records_item.py +45 -0
- whitebit/types/convert_history_response_records_item_path_item.py +23 -0
- whitebit/types/credit_line.py +28 -0
- whitebit/types/deals_request.py +35 -0
- whitebit/types/deals_response.py +29 -0
- whitebit/types/deals_response_result.py +30 -0
- whitebit/types/deals_response_result_records_item.py +82 -0
- whitebit/types/deals_subscribe.py +32 -0
- whitebit/types/deals_update.py +43 -0
- whitebit/types/depth_level.py +5 -0
- whitebit/types/depth_request.py +35 -0
- whitebit/types/depth_response.py +22 -0
- whitebit/types/depth_subscribe.py +32 -0
- whitebit/types/depth_update.py +31 -0
- whitebit/types/depth_update_data.py +40 -0
- whitebit/types/error.py +21 -0
- whitebit/types/error_inner.py +21 -0
- whitebit/types/error_response.py +32 -0
- whitebit/types/error_v4.py +25 -0
- whitebit/types/executed_order_object.py +133 -0
- whitebit/types/executed_order_object_position_side.py +5 -0
- whitebit/types/executed_order_object_stp.py +5 -0
- whitebit/types/fee_details.py +23 -0
- whitebit/types/fee_details_flex.py +21 -0
- whitebit/types/fee_info.py +49 -0
- whitebit/types/fee_info_deposit.py +63 -0
- whitebit/types/fee_info_withdraw.py +63 -0
- whitebit/types/fixed_plan.py +79 -0
- whitebit/types/flex_investment.py +67 -0
- whitebit/types/flex_investment_history.py +64 -0
- whitebit/types/flex_plan.py +50 -0
- whitebit/types/futures_market.py +117 -0
- whitebit/types/interest_payment.py +48 -0
- whitebit/types/investment.py +64 -0
- whitebit/types/lastprice_request.py +29 -0
- whitebit/types/lastprice_response.py +25 -0
- whitebit/types/lastprice_subscribe.py +29 -0
- whitebit/types/lastprice_update.py +30 -0
- whitebit/types/margin_positions_events_subscribe.py +34 -0
- whitebit/types/margin_positions_events_update.py +34 -0
- whitebit/types/market_order_request.py +51 -0
- whitebit/types/market_order_request_side.py +5 -0
- whitebit/types/market_order_request_stp.py +5 -0
- whitebit/types/market_request.py +34 -0
- whitebit/types/market_response.py +22 -0
- whitebit/types/market_statistics.py +57 -0
- whitebit/types/market_subscribe.py +25 -0
- whitebit/types/market_today_request.py +29 -0
- whitebit/types/market_today_response.py +22 -0
- whitebit/types/market_today_statistics.py +47 -0
- whitebit/types/market_today_subscribe.py +25 -0
- whitebit/types/market_today_update.py +30 -0
- whitebit/types/market_update.py +30 -0
- whitebit/types/mining_reward.py +62 -0
- whitebit/types/not_found_error_body.py +20 -0
- whitebit/types/order_book.py +33 -0
- whitebit/types/order_object.py +118 -0
- whitebit/types/order_object_position_side.py +5 -0
- whitebit/types/order_object_stp.py +5 -0
- whitebit/types/order_response.py +123 -0
- whitebit/types/orderbook_response.py +37 -0
- whitebit/types/orders_executed_request.py +35 -0
- whitebit/types/orders_executed_response.py +29 -0
- whitebit/types/orders_executed_response_result.py +30 -0
- whitebit/types/orders_executed_subscribe.py +34 -0
- whitebit/types/orders_executed_update.py +33 -0
- whitebit/types/orders_pending_request.py +32 -0
- whitebit/types/orders_pending_response.py +29 -0
- whitebit/types/orders_pending_response_result.py +35 -0
- whitebit/types/orders_pending_subscribe.py +32 -0
- whitebit/types/orders_pending_update.py +32 -0
- whitebit/types/ping_request.py +25 -0
- whitebit/types/ping_response.py +21 -0
- whitebit/types/ping_response_result.py +5 -0
- whitebit/types/positions_subscribe.py +32 -0
- whitebit/types/positions_update.py +30 -0
- whitebit/types/positions_update_params.py +25 -0
- whitebit/types/positions_update_params_records_item.py +99 -0
- whitebit/types/positions_update_params_records_item_liq_stage.py +5 -0
- whitebit/types/positions_update_params_records_item_position_side.py +5 -0
- whitebit/types/provider_fee_details.py +28 -0
- whitebit/types/sub_account.py +63 -0
- whitebit/types/sub_account_api_key.py +84 -0
- whitebit/types/sub_account_api_key_access_endpoints_item.py +27 -0
- whitebit/types/sub_account_api_key_list.py +39 -0
- whitebit/types/sub_account_api_key_list_access_endpoints_item.py +20 -0
- whitebit/types/sub_account_kyc.py +37 -0
- whitebit/types/sub_account_permissions.py +37 -0
- whitebit/types/sub_account_transfer.py +53 -0
- whitebit/types/subscription_response.py +29 -0
- whitebit/types/subscription_response_result.py +22 -0
- whitebit/types/time_request.py +25 -0
- whitebit/types/time_response.py +23 -0
- whitebit/types/trade.py +48 -0
- whitebit/types/trade_type.py +5 -0
- whitebit/types/trades_request.py +35 -0
- whitebit/types/trades_response.py +22 -0
- whitebit/types/trades_subscribe.py +28 -0
- whitebit/types/trades_update.py +30 -0
- whitebit/types/transaction_history.py +108 -0
- whitebit/types/transaction_history_confirmations.py +31 -0
- whitebit/types/unprocessable_entity_error_body.py +20 -0
- whitebit/types/unsubscribe_request.py +32 -0
- whitebit/withdraw/__init__.py +11 -0
- whitebit/withdraw/client.py +496 -0
- whitebit/withdraw/raw_client.py +634 -0
- whitebit/withdraw/types/__init__.py +9 -0
- whitebit/withdraw/types/create_withdraw_request_beneficiary.py +74 -0
- whitebit/withdraw/types/create_withdraw_request_travel_rule.py +52 -0
- whitebit/withdraw/types/create_withdraw_request_travel_rule_type.py +5 -0
- whitebit_python_sdk-1.1.0.dist-info/METADATA +155 -0
- whitebit_python_sdk-1.1.0.dist-info/RECORD +451 -0
- whitebit_python_sdk-1.1.0.dist-info/WHEEL +5 -0
- whitebit_python_sdk-1.1.0.dist-info/licenses/LICENSE +20 -0
- whitebit_python_sdk-1.1.0.dist-info/top_level.txt +1 -0
whitebit/client.py
ADDED
|
@@ -0,0 +1,580 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
import httpx
|
|
6
|
+
from .codes.client import AsyncCodesClient, CodesClient
|
|
7
|
+
from .collateral_trading.client import AsyncCollateralTradingClient, CollateralTradingClient
|
|
8
|
+
from .core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
9
|
+
from .core.request_options import RequestOptions
|
|
10
|
+
from .credit_line.client import AsyncCreditLineClient, CreditLineClient
|
|
11
|
+
from .crypto_lending_fixed.client import AsyncCryptoLendingFixedClient, CryptoLendingFixedClient
|
|
12
|
+
from .crypto_lending_flex.client import AsyncCryptoLendingFlexClient, CryptoLendingFlexClient
|
|
13
|
+
from .deposit.client import AsyncDepositClient, DepositClient
|
|
14
|
+
from .environment import WhitebitApiEnvironment
|
|
15
|
+
from .fees.client import AsyncFeesClient, FeesClient
|
|
16
|
+
from .jwt.client import AsyncJwtClient, JwtClient
|
|
17
|
+
from .main_account.client import AsyncMainAccountClient, MainAccountClient
|
|
18
|
+
from .market_fee.client import AsyncMarketFeeClient, MarketFeeClient
|
|
19
|
+
from .mining_pool.client import AsyncMiningPoolClient, MiningPoolClient
|
|
20
|
+
from .public_api_v4.client import AsyncPublicApiV4Client, PublicApiV4Client
|
|
21
|
+
from .raw_client import AsyncRawWhitebitApi, RawWhitebitApi
|
|
22
|
+
from .spot_trading.client import AsyncSpotTradingClient, SpotTradingClient
|
|
23
|
+
from .sub_account.client import AsyncSubAccountClient, SubAccountClient
|
|
24
|
+
from .sub_account_api_keys.client import AsyncSubAccountApiKeysClient, SubAccountApiKeysClient
|
|
25
|
+
from .transfer.client import AsyncTransferClient, TransferClient
|
|
26
|
+
from .types.convert_confirm_response import ConvertConfirmResponse
|
|
27
|
+
from .types.convert_estimate_request_direction import ConvertEstimateRequestDirection
|
|
28
|
+
from .types.convert_estimate_response import ConvertEstimateResponse
|
|
29
|
+
from .types.convert_history_response import ConvertHistoryResponse
|
|
30
|
+
from .withdraw.client import AsyncWithdrawClient, WithdrawClient
|
|
31
|
+
|
|
32
|
+
# this is used as the default value for optional parameters
|
|
33
|
+
OMIT = typing.cast(typing.Any, ...)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
class WhitebitApi:
|
|
37
|
+
"""
|
|
38
|
+
Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propagate to these functions.
|
|
39
|
+
|
|
40
|
+
Parameters
|
|
41
|
+
----------
|
|
42
|
+
environment : WhitebitApiEnvironment
|
|
43
|
+
The environment to use for requests from the client. from .environment import WhitebitApiEnvironment
|
|
44
|
+
|
|
45
|
+
Defaults to WhitebitApiEnvironment.DEFAULT
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
api_key : str
|
|
50
|
+
timeout : typing.Optional[float]
|
|
51
|
+
The timeout to be used, in seconds, for requests. By default the timeout is 60 seconds, unless a custom httpx client is used, in which case this default is not enforced.
|
|
52
|
+
|
|
53
|
+
follow_redirects : typing.Optional[bool]
|
|
54
|
+
Whether the default httpx client follows redirects or not, this is irrelevant if a custom httpx client is passed in.
|
|
55
|
+
|
|
56
|
+
httpx_client : typing.Optional[httpx.Client]
|
|
57
|
+
The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration.
|
|
58
|
+
|
|
59
|
+
Examples
|
|
60
|
+
--------
|
|
61
|
+
from whitebit import WhitebitApi
|
|
62
|
+
client = WhitebitApi(api_key="YOUR_API_KEY", )
|
|
63
|
+
"""
|
|
64
|
+
|
|
65
|
+
def __init__(
|
|
66
|
+
self,
|
|
67
|
+
*,
|
|
68
|
+
environment: WhitebitApiEnvironment = WhitebitApiEnvironment.DEFAULT,
|
|
69
|
+
api_key: str,
|
|
70
|
+
timeout: typing.Optional[float] = None,
|
|
71
|
+
follow_redirects: typing.Optional[bool] = True,
|
|
72
|
+
httpx_client: typing.Optional[httpx.Client] = None,
|
|
73
|
+
):
|
|
74
|
+
_defaulted_timeout = (
|
|
75
|
+
timeout if timeout is not None else 60 if httpx_client is None else httpx_client.timeout.read
|
|
76
|
+
)
|
|
77
|
+
self._client_wrapper = SyncClientWrapper(
|
|
78
|
+
environment=environment,
|
|
79
|
+
api_key=api_key,
|
|
80
|
+
httpx_client=httpx_client
|
|
81
|
+
if httpx_client is not None
|
|
82
|
+
else httpx.Client(timeout=_defaulted_timeout, follow_redirects=follow_redirects)
|
|
83
|
+
if follow_redirects is not None
|
|
84
|
+
else httpx.Client(timeout=_defaulted_timeout),
|
|
85
|
+
timeout=_defaulted_timeout,
|
|
86
|
+
)
|
|
87
|
+
self._raw_client = RawWhitebitApi(client_wrapper=self._client_wrapper)
|
|
88
|
+
self.public_api_v4 = PublicApiV4Client(client_wrapper=self._client_wrapper)
|
|
89
|
+
self.main_account = MainAccountClient(client_wrapper=self._client_wrapper)
|
|
90
|
+
self.deposit = DepositClient(client_wrapper=self._client_wrapper)
|
|
91
|
+
self.jwt = JwtClient(client_wrapper=self._client_wrapper)
|
|
92
|
+
self.withdraw = WithdrawClient(client_wrapper=self._client_wrapper)
|
|
93
|
+
self.transfer = TransferClient(client_wrapper=self._client_wrapper)
|
|
94
|
+
self.codes = CodesClient(client_wrapper=self._client_wrapper)
|
|
95
|
+
self.crypto_lending_fixed = CryptoLendingFixedClient(client_wrapper=self._client_wrapper)
|
|
96
|
+
self.crypto_lending_flex = CryptoLendingFlexClient(client_wrapper=self._client_wrapper)
|
|
97
|
+
self.fees = FeesClient(client_wrapper=self._client_wrapper)
|
|
98
|
+
self.sub_account = SubAccountClient(client_wrapper=self._client_wrapper)
|
|
99
|
+
self.sub_account_api_keys = SubAccountApiKeysClient(client_wrapper=self._client_wrapper)
|
|
100
|
+
self.mining_pool = MiningPoolClient(client_wrapper=self._client_wrapper)
|
|
101
|
+
self.credit_line = CreditLineClient(client_wrapper=self._client_wrapper)
|
|
102
|
+
self.collateral_trading = CollateralTradingClient(client_wrapper=self._client_wrapper)
|
|
103
|
+
self.market_fee = MarketFeeClient(client_wrapper=self._client_wrapper)
|
|
104
|
+
self.spot_trading = SpotTradingClient(client_wrapper=self._client_wrapper)
|
|
105
|
+
|
|
106
|
+
@property
|
|
107
|
+
def with_raw_response(self) -> RawWhitebitApi:
|
|
108
|
+
"""
|
|
109
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
110
|
+
|
|
111
|
+
Returns
|
|
112
|
+
-------
|
|
113
|
+
RawWhitebitApi
|
|
114
|
+
"""
|
|
115
|
+
return self._raw_client
|
|
116
|
+
|
|
117
|
+
def convert_estimate(
|
|
118
|
+
self,
|
|
119
|
+
*,
|
|
120
|
+
from_: str,
|
|
121
|
+
to: str,
|
|
122
|
+
direction: ConvertEstimateRequestDirection,
|
|
123
|
+
amount: str,
|
|
124
|
+
nonce: typing.Optional[int] = OMIT,
|
|
125
|
+
request: typing.Optional[str] = OMIT,
|
|
126
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
127
|
+
) -> ConvertEstimateResponse:
|
|
128
|
+
"""
|
|
129
|
+
The endpoint creates a quote for converting one currency to another. Quote lifetime is 10 seconds, then quote will be expired.
|
|
130
|
+
|
|
131
|
+
<Warning>
|
|
132
|
+
Rate limit: 10000 requests/10 sec.
|
|
133
|
+
</Warning>
|
|
134
|
+
|
|
135
|
+
Parameters
|
|
136
|
+
----------
|
|
137
|
+
from_ : str
|
|
138
|
+
From currency. Example: BTC
|
|
139
|
+
|
|
140
|
+
to : str
|
|
141
|
+
To currency. Example: USDT
|
|
142
|
+
|
|
143
|
+
direction : ConvertEstimateRequestDirection
|
|
144
|
+
Convert amount direction, defines in which currency corresponding "amount" field is populated. Use "to" in case amount is in "to" currency, use "from" if amount is in "from" currency
|
|
145
|
+
|
|
146
|
+
amount : str
|
|
147
|
+
Amount to convert or receive.
|
|
148
|
+
|
|
149
|
+
nonce : typing.Optional[int]
|
|
150
|
+
Nonce for request
|
|
151
|
+
|
|
152
|
+
request : typing.Optional[str]
|
|
153
|
+
Request path
|
|
154
|
+
|
|
155
|
+
request_options : typing.Optional[RequestOptions]
|
|
156
|
+
Request-specific configuration.
|
|
157
|
+
|
|
158
|
+
Returns
|
|
159
|
+
-------
|
|
160
|
+
ConvertEstimateResponse
|
|
161
|
+
Successful response
|
|
162
|
+
|
|
163
|
+
Examples
|
|
164
|
+
--------
|
|
165
|
+
from whitebit import WhitebitApi
|
|
166
|
+
client = WhitebitApi(api_key="YOUR_API_KEY", )
|
|
167
|
+
client.convert_estimate(from_='BTC', to='USDT', direction="to", amount='35,103.1', )
|
|
168
|
+
"""
|
|
169
|
+
_response = self._raw_client.convert_estimate(
|
|
170
|
+
from_=from_,
|
|
171
|
+
to=to,
|
|
172
|
+
direction=direction,
|
|
173
|
+
amount=amount,
|
|
174
|
+
nonce=nonce,
|
|
175
|
+
request=request,
|
|
176
|
+
request_options=request_options,
|
|
177
|
+
)
|
|
178
|
+
return _response.data
|
|
179
|
+
|
|
180
|
+
def convert_confirm(
|
|
181
|
+
self,
|
|
182
|
+
*,
|
|
183
|
+
quote_id: str,
|
|
184
|
+
nonce: typing.Optional[int] = OMIT,
|
|
185
|
+
request: typing.Optional[str] = OMIT,
|
|
186
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
187
|
+
) -> ConvertConfirmResponse:
|
|
188
|
+
"""
|
|
189
|
+
The endpoint confirms an estimated quote.
|
|
190
|
+
|
|
191
|
+
<Warning>
|
|
192
|
+
Rate limit: 10000 requests/10 sec.
|
|
193
|
+
</Warning>
|
|
194
|
+
|
|
195
|
+
Parameters
|
|
196
|
+
----------
|
|
197
|
+
quote_id : str
|
|
198
|
+
Quote ID
|
|
199
|
+
|
|
200
|
+
nonce : typing.Optional[int]
|
|
201
|
+
Nonce for request
|
|
202
|
+
|
|
203
|
+
request : typing.Optional[str]
|
|
204
|
+
Request path
|
|
205
|
+
|
|
206
|
+
request_options : typing.Optional[RequestOptions]
|
|
207
|
+
Request-specific configuration.
|
|
208
|
+
|
|
209
|
+
Returns
|
|
210
|
+
-------
|
|
211
|
+
ConvertConfirmResponse
|
|
212
|
+
Successful response
|
|
213
|
+
|
|
214
|
+
Examples
|
|
215
|
+
--------
|
|
216
|
+
from whitebit import WhitebitApi
|
|
217
|
+
client = WhitebitApi(api_key="YOUR_API_KEY", )
|
|
218
|
+
client.convert_confirm(quote_id='4050', )
|
|
219
|
+
"""
|
|
220
|
+
_response = self._raw_client.convert_confirm(
|
|
221
|
+
quote_id=quote_id, nonce=nonce, request=request, request_options=request_options
|
|
222
|
+
)
|
|
223
|
+
return _response.data
|
|
224
|
+
|
|
225
|
+
def convert_history(
|
|
226
|
+
self,
|
|
227
|
+
*,
|
|
228
|
+
from_ticker: typing.Optional[str] = OMIT,
|
|
229
|
+
to_ticker: typing.Optional[str] = OMIT,
|
|
230
|
+
from_: typing.Optional[str] = OMIT,
|
|
231
|
+
to: typing.Optional[str] = OMIT,
|
|
232
|
+
quote_id: typing.Optional[str] = OMIT,
|
|
233
|
+
limit: typing.Optional[str] = OMIT,
|
|
234
|
+
offset: typing.Optional[str] = OMIT,
|
|
235
|
+
nonce: typing.Optional[int] = OMIT,
|
|
236
|
+
request: typing.Optional[str] = OMIT,
|
|
237
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
238
|
+
) -> ConvertHistoryResponse:
|
|
239
|
+
"""
|
|
240
|
+
The endpoint returns convert history.
|
|
241
|
+
|
|
242
|
+
<Warning>
|
|
243
|
+
Rate limit: 10000 requests/10 sec.
|
|
244
|
+
</Warning>
|
|
245
|
+
**Note:** The endpoint can retrieve data not older than 6 months from current month. For older data, use the Report on the History page.
|
|
246
|
+
|
|
247
|
+
Parameters
|
|
248
|
+
----------
|
|
249
|
+
from_ticker : typing.Optional[str]
|
|
250
|
+
From currency. Example: BTC
|
|
251
|
+
|
|
252
|
+
to_ticker : typing.Optional[str]
|
|
253
|
+
To currency. Example: USDT
|
|
254
|
+
|
|
255
|
+
from_ : typing.Optional[str]
|
|
256
|
+
From time filter. Example: 1699260637. Default: now()
|
|
257
|
+
|
|
258
|
+
to : typing.Optional[str]
|
|
259
|
+
To time filter. Example: 1699260637. Default: now() +
|
|
260
|
+
|
|
261
|
+
quote_id : typing.Optional[str]
|
|
262
|
+
Quote Id. Example: 4050
|
|
263
|
+
|
|
264
|
+
limit : typing.Optional[str]
|
|
265
|
+
How many records to receive. Default: 100
|
|
266
|
+
|
|
267
|
+
offset : typing.Optional[str]
|
|
268
|
+
Amount to convert or receive. Default 0
|
|
269
|
+
|
|
270
|
+
nonce : typing.Optional[int]
|
|
271
|
+
Nonce for request
|
|
272
|
+
|
|
273
|
+
request : typing.Optional[str]
|
|
274
|
+
Request path
|
|
275
|
+
|
|
276
|
+
request_options : typing.Optional[RequestOptions]
|
|
277
|
+
Request-specific configuration.
|
|
278
|
+
|
|
279
|
+
Returns
|
|
280
|
+
-------
|
|
281
|
+
ConvertHistoryResponse
|
|
282
|
+
Successful response
|
|
283
|
+
|
|
284
|
+
Examples
|
|
285
|
+
--------
|
|
286
|
+
from whitebit import WhitebitApi
|
|
287
|
+
client = WhitebitApi(api_key="YOUR_API_KEY", )
|
|
288
|
+
client.convert_history(from_ticker='BTC', )
|
|
289
|
+
"""
|
|
290
|
+
_response = self._raw_client.convert_history(
|
|
291
|
+
from_ticker=from_ticker,
|
|
292
|
+
to_ticker=to_ticker,
|
|
293
|
+
from_=from_,
|
|
294
|
+
to=to,
|
|
295
|
+
quote_id=quote_id,
|
|
296
|
+
limit=limit,
|
|
297
|
+
offset=offset,
|
|
298
|
+
nonce=nonce,
|
|
299
|
+
request=request,
|
|
300
|
+
request_options=request_options,
|
|
301
|
+
)
|
|
302
|
+
return _response.data
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
class AsyncWhitebitApi:
|
|
306
|
+
"""
|
|
307
|
+
Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propagate to these functions.
|
|
308
|
+
|
|
309
|
+
Parameters
|
|
310
|
+
----------
|
|
311
|
+
environment : WhitebitApiEnvironment
|
|
312
|
+
The environment to use for requests from the client. from .environment import WhitebitApiEnvironment
|
|
313
|
+
|
|
314
|
+
Defaults to WhitebitApiEnvironment.DEFAULT
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
api_key : str
|
|
319
|
+
timeout : typing.Optional[float]
|
|
320
|
+
The timeout to be used, in seconds, for requests. By default the timeout is 60 seconds, unless a custom httpx client is used, in which case this default is not enforced.
|
|
321
|
+
|
|
322
|
+
follow_redirects : typing.Optional[bool]
|
|
323
|
+
Whether the default httpx client follows redirects or not, this is irrelevant if a custom httpx client is passed in.
|
|
324
|
+
|
|
325
|
+
httpx_client : typing.Optional[httpx.AsyncClient]
|
|
326
|
+
The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration.
|
|
327
|
+
|
|
328
|
+
Examples
|
|
329
|
+
--------
|
|
330
|
+
from whitebit import AsyncWhitebitApi
|
|
331
|
+
client = AsyncWhitebitApi(api_key="YOUR_API_KEY", )
|
|
332
|
+
"""
|
|
333
|
+
|
|
334
|
+
def __init__(
|
|
335
|
+
self,
|
|
336
|
+
*,
|
|
337
|
+
environment: WhitebitApiEnvironment = WhitebitApiEnvironment.DEFAULT,
|
|
338
|
+
api_key: str,
|
|
339
|
+
timeout: typing.Optional[float] = None,
|
|
340
|
+
follow_redirects: typing.Optional[bool] = True,
|
|
341
|
+
httpx_client: typing.Optional[httpx.AsyncClient] = None,
|
|
342
|
+
):
|
|
343
|
+
_defaulted_timeout = (
|
|
344
|
+
timeout if timeout is not None else 60 if httpx_client is None else httpx_client.timeout.read
|
|
345
|
+
)
|
|
346
|
+
self._client_wrapper = AsyncClientWrapper(
|
|
347
|
+
environment=environment,
|
|
348
|
+
api_key=api_key,
|
|
349
|
+
httpx_client=httpx_client
|
|
350
|
+
if httpx_client is not None
|
|
351
|
+
else httpx.AsyncClient(timeout=_defaulted_timeout, follow_redirects=follow_redirects)
|
|
352
|
+
if follow_redirects is not None
|
|
353
|
+
else httpx.AsyncClient(timeout=_defaulted_timeout),
|
|
354
|
+
timeout=_defaulted_timeout,
|
|
355
|
+
)
|
|
356
|
+
self._raw_client = AsyncRawWhitebitApi(client_wrapper=self._client_wrapper)
|
|
357
|
+
self.public_api_v4 = AsyncPublicApiV4Client(client_wrapper=self._client_wrapper)
|
|
358
|
+
self.main_account = AsyncMainAccountClient(client_wrapper=self._client_wrapper)
|
|
359
|
+
self.deposit = AsyncDepositClient(client_wrapper=self._client_wrapper)
|
|
360
|
+
self.jwt = AsyncJwtClient(client_wrapper=self._client_wrapper)
|
|
361
|
+
self.withdraw = AsyncWithdrawClient(client_wrapper=self._client_wrapper)
|
|
362
|
+
self.transfer = AsyncTransferClient(client_wrapper=self._client_wrapper)
|
|
363
|
+
self.codes = AsyncCodesClient(client_wrapper=self._client_wrapper)
|
|
364
|
+
self.crypto_lending_fixed = AsyncCryptoLendingFixedClient(client_wrapper=self._client_wrapper)
|
|
365
|
+
self.crypto_lending_flex = AsyncCryptoLendingFlexClient(client_wrapper=self._client_wrapper)
|
|
366
|
+
self.fees = AsyncFeesClient(client_wrapper=self._client_wrapper)
|
|
367
|
+
self.sub_account = AsyncSubAccountClient(client_wrapper=self._client_wrapper)
|
|
368
|
+
self.sub_account_api_keys = AsyncSubAccountApiKeysClient(client_wrapper=self._client_wrapper)
|
|
369
|
+
self.mining_pool = AsyncMiningPoolClient(client_wrapper=self._client_wrapper)
|
|
370
|
+
self.credit_line = AsyncCreditLineClient(client_wrapper=self._client_wrapper)
|
|
371
|
+
self.collateral_trading = AsyncCollateralTradingClient(client_wrapper=self._client_wrapper)
|
|
372
|
+
self.market_fee = AsyncMarketFeeClient(client_wrapper=self._client_wrapper)
|
|
373
|
+
self.spot_trading = AsyncSpotTradingClient(client_wrapper=self._client_wrapper)
|
|
374
|
+
|
|
375
|
+
@property
|
|
376
|
+
def with_raw_response(self) -> AsyncRawWhitebitApi:
|
|
377
|
+
"""
|
|
378
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
379
|
+
|
|
380
|
+
Returns
|
|
381
|
+
-------
|
|
382
|
+
AsyncRawWhitebitApi
|
|
383
|
+
"""
|
|
384
|
+
return self._raw_client
|
|
385
|
+
|
|
386
|
+
async def convert_estimate(
|
|
387
|
+
self,
|
|
388
|
+
*,
|
|
389
|
+
from_: str,
|
|
390
|
+
to: str,
|
|
391
|
+
direction: ConvertEstimateRequestDirection,
|
|
392
|
+
amount: str,
|
|
393
|
+
nonce: typing.Optional[int] = OMIT,
|
|
394
|
+
request: typing.Optional[str] = OMIT,
|
|
395
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
396
|
+
) -> ConvertEstimateResponse:
|
|
397
|
+
"""
|
|
398
|
+
The endpoint creates a quote for converting one currency to another. Quote lifetime is 10 seconds, then quote will be expired.
|
|
399
|
+
|
|
400
|
+
<Warning>
|
|
401
|
+
Rate limit: 10000 requests/10 sec.
|
|
402
|
+
</Warning>
|
|
403
|
+
|
|
404
|
+
Parameters
|
|
405
|
+
----------
|
|
406
|
+
from_ : str
|
|
407
|
+
From currency. Example: BTC
|
|
408
|
+
|
|
409
|
+
to : str
|
|
410
|
+
To currency. Example: USDT
|
|
411
|
+
|
|
412
|
+
direction : ConvertEstimateRequestDirection
|
|
413
|
+
Convert amount direction, defines in which currency corresponding "amount" field is populated. Use "to" in case amount is in "to" currency, use "from" if amount is in "from" currency
|
|
414
|
+
|
|
415
|
+
amount : str
|
|
416
|
+
Amount to convert or receive.
|
|
417
|
+
|
|
418
|
+
nonce : typing.Optional[int]
|
|
419
|
+
Nonce for request
|
|
420
|
+
|
|
421
|
+
request : typing.Optional[str]
|
|
422
|
+
Request path
|
|
423
|
+
|
|
424
|
+
request_options : typing.Optional[RequestOptions]
|
|
425
|
+
Request-specific configuration.
|
|
426
|
+
|
|
427
|
+
Returns
|
|
428
|
+
-------
|
|
429
|
+
ConvertEstimateResponse
|
|
430
|
+
Successful response
|
|
431
|
+
|
|
432
|
+
Examples
|
|
433
|
+
--------
|
|
434
|
+
from whitebit import AsyncWhitebitApi
|
|
435
|
+
import asyncio
|
|
436
|
+
client = AsyncWhitebitApi(api_key="YOUR_API_KEY", )
|
|
437
|
+
async def main() -> None:
|
|
438
|
+
await client.convert_estimate(from_='BTC', to='USDT', direction="to", amount='35,103.1', )
|
|
439
|
+
asyncio.run(main())
|
|
440
|
+
"""
|
|
441
|
+
_response = await self._raw_client.convert_estimate(
|
|
442
|
+
from_=from_,
|
|
443
|
+
to=to,
|
|
444
|
+
direction=direction,
|
|
445
|
+
amount=amount,
|
|
446
|
+
nonce=nonce,
|
|
447
|
+
request=request,
|
|
448
|
+
request_options=request_options,
|
|
449
|
+
)
|
|
450
|
+
return _response.data
|
|
451
|
+
|
|
452
|
+
async def convert_confirm(
|
|
453
|
+
self,
|
|
454
|
+
*,
|
|
455
|
+
quote_id: str,
|
|
456
|
+
nonce: typing.Optional[int] = OMIT,
|
|
457
|
+
request: typing.Optional[str] = OMIT,
|
|
458
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
459
|
+
) -> ConvertConfirmResponse:
|
|
460
|
+
"""
|
|
461
|
+
The endpoint confirms an estimated quote.
|
|
462
|
+
|
|
463
|
+
<Warning>
|
|
464
|
+
Rate limit: 10000 requests/10 sec.
|
|
465
|
+
</Warning>
|
|
466
|
+
|
|
467
|
+
Parameters
|
|
468
|
+
----------
|
|
469
|
+
quote_id : str
|
|
470
|
+
Quote ID
|
|
471
|
+
|
|
472
|
+
nonce : typing.Optional[int]
|
|
473
|
+
Nonce for request
|
|
474
|
+
|
|
475
|
+
request : typing.Optional[str]
|
|
476
|
+
Request path
|
|
477
|
+
|
|
478
|
+
request_options : typing.Optional[RequestOptions]
|
|
479
|
+
Request-specific configuration.
|
|
480
|
+
|
|
481
|
+
Returns
|
|
482
|
+
-------
|
|
483
|
+
ConvertConfirmResponse
|
|
484
|
+
Successful response
|
|
485
|
+
|
|
486
|
+
Examples
|
|
487
|
+
--------
|
|
488
|
+
from whitebit import AsyncWhitebitApi
|
|
489
|
+
import asyncio
|
|
490
|
+
client = AsyncWhitebitApi(api_key="YOUR_API_KEY", )
|
|
491
|
+
async def main() -> None:
|
|
492
|
+
await client.convert_confirm(quote_id='4050', )
|
|
493
|
+
asyncio.run(main())
|
|
494
|
+
"""
|
|
495
|
+
_response = await self._raw_client.convert_confirm(
|
|
496
|
+
quote_id=quote_id, nonce=nonce, request=request, request_options=request_options
|
|
497
|
+
)
|
|
498
|
+
return _response.data
|
|
499
|
+
|
|
500
|
+
async def convert_history(
|
|
501
|
+
self,
|
|
502
|
+
*,
|
|
503
|
+
from_ticker: typing.Optional[str] = OMIT,
|
|
504
|
+
to_ticker: typing.Optional[str] = OMIT,
|
|
505
|
+
from_: typing.Optional[str] = OMIT,
|
|
506
|
+
to: typing.Optional[str] = OMIT,
|
|
507
|
+
quote_id: typing.Optional[str] = OMIT,
|
|
508
|
+
limit: typing.Optional[str] = OMIT,
|
|
509
|
+
offset: typing.Optional[str] = OMIT,
|
|
510
|
+
nonce: typing.Optional[int] = OMIT,
|
|
511
|
+
request: typing.Optional[str] = OMIT,
|
|
512
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
513
|
+
) -> ConvertHistoryResponse:
|
|
514
|
+
"""
|
|
515
|
+
The endpoint returns convert history.
|
|
516
|
+
|
|
517
|
+
<Warning>
|
|
518
|
+
Rate limit: 10000 requests/10 sec.
|
|
519
|
+
</Warning>
|
|
520
|
+
**Note:** The endpoint can retrieve data not older than 6 months from current month. For older data, use the Report on the History page.
|
|
521
|
+
|
|
522
|
+
Parameters
|
|
523
|
+
----------
|
|
524
|
+
from_ticker : typing.Optional[str]
|
|
525
|
+
From currency. Example: BTC
|
|
526
|
+
|
|
527
|
+
to_ticker : typing.Optional[str]
|
|
528
|
+
To currency. Example: USDT
|
|
529
|
+
|
|
530
|
+
from_ : typing.Optional[str]
|
|
531
|
+
From time filter. Example: 1699260637. Default: now()
|
|
532
|
+
|
|
533
|
+
to : typing.Optional[str]
|
|
534
|
+
To time filter. Example: 1699260637. Default: now() +
|
|
535
|
+
|
|
536
|
+
quote_id : typing.Optional[str]
|
|
537
|
+
Quote Id. Example: 4050
|
|
538
|
+
|
|
539
|
+
limit : typing.Optional[str]
|
|
540
|
+
How many records to receive. Default: 100
|
|
541
|
+
|
|
542
|
+
offset : typing.Optional[str]
|
|
543
|
+
Amount to convert or receive. Default 0
|
|
544
|
+
|
|
545
|
+
nonce : typing.Optional[int]
|
|
546
|
+
Nonce for request
|
|
547
|
+
|
|
548
|
+
request : typing.Optional[str]
|
|
549
|
+
Request path
|
|
550
|
+
|
|
551
|
+
request_options : typing.Optional[RequestOptions]
|
|
552
|
+
Request-specific configuration.
|
|
553
|
+
|
|
554
|
+
Returns
|
|
555
|
+
-------
|
|
556
|
+
ConvertHistoryResponse
|
|
557
|
+
Successful response
|
|
558
|
+
|
|
559
|
+
Examples
|
|
560
|
+
--------
|
|
561
|
+
from whitebit import AsyncWhitebitApi
|
|
562
|
+
import asyncio
|
|
563
|
+
client = AsyncWhitebitApi(api_key="YOUR_API_KEY", )
|
|
564
|
+
async def main() -> None:
|
|
565
|
+
await client.convert_history(from_ticker='BTC', )
|
|
566
|
+
asyncio.run(main())
|
|
567
|
+
"""
|
|
568
|
+
_response = await self._raw_client.convert_history(
|
|
569
|
+
from_ticker=from_ticker,
|
|
570
|
+
to_ticker=to_ticker,
|
|
571
|
+
from_=from_,
|
|
572
|
+
to=to,
|
|
573
|
+
quote_id=quote_id,
|
|
574
|
+
limit=limit,
|
|
575
|
+
offset=offset,
|
|
576
|
+
nonce=nonce,
|
|
577
|
+
request=request,
|
|
578
|
+
request_options=request_options,
|
|
579
|
+
)
|
|
580
|
+
return _response.data
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
# isort: skip_file
|
|
4
|
+
|
|
5
|
+
from .types import ApplyCodeResponse, CreateCodeResponse, GetCodesHistoryResponse, GetMyCodesResponse
|
|
6
|
+
|
|
7
|
+
__all__ = ["ApplyCodeResponse", "CreateCodeResponse", "GetCodesHistoryResponse", "GetMyCodesResponse"]
|